X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=lib%2FDist%2FZilla%2FPluginBundle%2FAuthor%2FCCM.pm;h=d1581c6aee1fa7b8687e50b0a1c5aadeab301997;hb=2f5c7d0bd19771ba817110c43aaf3520fc8b6d8e;hp=a64c1a590303e9a91ce9b9233c496ebe9a7a4726;hpb=ed0d6422ffd12219c90bf0dd8261e6217e31b284;p=chaz%2Fp5-Dist-Zilla-PluginBundle-Author-CCM diff --git a/lib/Dist/Zilla/PluginBundle/Author/CCM.pm b/lib/Dist/Zilla/PluginBundle/Author/CCM.pm index a64c1a5..d1581c6 100644 --- a/lib/Dist/Zilla/PluginBundle/Author/CCM.pm +++ b/lib/Dist/Zilla/PluginBundle/Author/CCM.pm @@ -13,9 +13,6 @@ You probably don't want to use this. ; VERSION [Git::NextVersion] - [NextRelease] - [ReversionOnRelease] - prompt = 1 ; GATHER [Git::GatherDir] @@ -41,6 +38,8 @@ You probably don't want to use this. [PodSyntaxTests] [Test::Pod::No404s] [Test::Compile] + [Test::MinimumVersion] + max_target_perl = 5.10.1 [Test::EOL] [Test::NoTabs] [Test::Perl::Critic] @@ -82,13 +81,13 @@ You probably don't want to use this. filename = README location = build type = text - [TravisYML] [Manifest] [ManifestSkip] [MakeMaker] ; override with the "installer" attribute ; RELEASE + [NextRelease] [CheckChangesHasContent] [Git::Check] [RunExtraTests] @@ -115,6 +114,7 @@ You probably don't want to use this. =cut +use 5.014; use warnings; use strict; @@ -122,8 +122,47 @@ our $VERSION = '999.999'; # VERSION use Dist::Zilla::Util; use Moose; +use Perl::Version; use namespace::autoclean; +=attr max_target_perl + +Specify the minimum perl version. Defaults to C<5.10.1>. + +=cut + +has max_target_perl => ( + is => 'ro', + isa => 'Str', + lazy => 1, + default => sub { + my $self = shift; + $self->payload->{'Test::MinimumVersion.max_target_perl'} + // $self->payload->{max_target_perl} + // '5.10.1'; + }, +); + +=attr no_index + +Set directories to not index. + +Default: + +=cut + +has no_index => ( + is => 'ro', + isa => 'ArrayRef', + lazy => 1, + default => sub { + my $self = shift; + [split(/\s+/, $self->payload->{'MetaNoIndex.directories'} + // $self->payload->{no_index} + // 'eg share shares t xt')]; + }, +); + =attr authority Specify the release authority. Defaults to C. @@ -154,7 +193,7 @@ has installer => ( is => 'ro', isa => 'Str', lazy => 1, - default => sub { shift->payload->{installer} || 'MakeMaker' }, + default => sub { shift->payload->{installer} // 'MakeMaker' }, ); =attr airplane @@ -192,25 +231,24 @@ Required by L. sub configure { my $self = shift; + my @copy_from_build = qw(LICENSE); + my @network_plugins = qw(Git::Push Test::Pod::No404s UploadToCPAN); + my @gather_exclude = (@copy_from_build, qw(README.md)); + my @gather_prune = qw(dist.ini); + my @no_index = @{$self->no_index}; + my @allow_dirty = (@copy_from_build, qw(Changes LICENSE README.md)); + my @git_remotes = qw(github origin); + my @check_files = qw(:InstallModules :ExecFiles :TestFiles :ExtraTestFiles); + my $perl_version_target = $self->max_target_perl; + if ($self->no_upload) { - print '[@Author::CCM] WARNING! WARNING! WARNING! *** You are in no_upload mode!! ***', "\n"; + say '[@Author::CCM] WARNING! WARNING! WARNING! *** You are in no_upload mode!! ***'; } - my @copy_from_build = qw(LICENSE); - my @network_plugins = qw(Git::Push Test::Pod::No404s UploadToCPAN); - my @gather_exclude = (@copy_from_build, qw(README.md)); - my @gather_prune = qw(dist.ini); - my @no_index = qw(eg share shares t xt); - my @allow_dirty = (@copy_from_build, qw(.travis.yml Changes LICENSE README.md)); - my @git_remotes = qw(github origin); - my @check_files = qw(:InstallModules :ExecFiles :TestFiles :ExtraTestFiles); - my @plugins = ( # VERSION ['Git::NextVersion'], - ['NextRelease'], - ['ReversionOnRelease' => {prompt => 1}], # GATHER ['Git::GatherDir' => {exclude_filename => [@gather_exclude]}], @@ -232,6 +270,7 @@ sub configure { ['PodSyntaxTests'], ['Test::Pod::No404s'], ['Test::Compile'], + ['Test::MinimumVersion' => {max_target_perl => $perl_version_target}], ['Test::EOL' => {finder => [@check_files]}], ['Test::NoTabs' => {finder => [@check_files]}], ['Test::Perl::Critic'], @@ -255,15 +294,15 @@ sub configure { # GENERATE FILES ['License'], - ['ReadmeAnyFromPod' => 'repo readme' => {filename => 'README.md', location => 'root', type => 'markdown', phase => 'release'}], - ['ReadmeAnyFromPod' => 'dist readme' => {filename => 'README', location => 'build', type => 'text'}], - ['TravisYML'], + ['ReadmeAnyFromPod' => 'RepoReadme' => {filename => 'README.md', location => 'root', type => 'markdown', phase => 'release'}], + ['ReadmeAnyFromPod' => 'DistReadme' => {filename => 'README', location => 'build', type => 'text'}], ['Manifest'], ['ManifestSkip'], $self->installer, # e.g. MakeMaker # RELEASE + ['NextRelease' => {format => '%-9v %{yyyy-MM-dd HH:mm:ssZZZ}d%{ (TRIAL RELEASE)}T'}], ['CheckChangesHasContent'], ['Git::Check' => {allow_dirty => [@allow_dirty], untracked_files => 'ignore'}], ['RunExtraTests'],