X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=lib%2FDist%2FZilla%2FPluginBundle%2FAuthor%2FCCM.pm;h=356f6c60b6f7852c9e1888d63a3f64abda8bbcb9;hb=9d0e5b43bfd9d69f39ec1c4bf2a28dab741ee4b2;hp=fd3da4643a684e0514ca7b9b8c643ca85f7d9ba8;hpb=df5f0318e30bd90f863fedfc345898f088c42ebb;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 fd3da46..356f6c6 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] @@ -84,14 +81,13 @@ You probably don't want to use this. filename = README location = build type = text - [TravisYML] - build_branch = /^(dist|build\/.*)$/ [Manifest] [ManifestSkip] [MakeMaker] ; override with the "installer" attribute ; RELEASE + [NextRelease] [CheckChangesHasContent] [Git::Check] [RunExtraTests] @@ -126,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. @@ -158,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 @@ -200,45 +235,20 @@ sub configure { 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 @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 = '5.10.1'; - my $perl_version = '5.24 5.22 5.20 5.18 5.16 5.14'; - my $perl_version_build = $perl_version . ' 5.12 5.10 -5.8'; + my $perl_version_target = $self->max_target_perl; if ($self->no_upload) { say '[@Author::CCM] WARNING! WARNING! WARNING! *** You are in no_upload mode!! ***'; } - if (!$self->payload->{'TravisYML.support_builddir'}) { - # swap perl_version and perl_version_build because DZP::TravisYML got it backwards! - # https://github.com/SineSwiper/Dist-Zilla-TravisCI/pull/40 - - my $tmp = $self->payload->{'TravisYML.perl_version_build'}; - if (defined $self->payload->{'TravisYML.perl_version'}) { - $self->payload->{'TravisYML.perl_version_build'} = $self->payload->{'TravisYML.perl_version'} - } - else { - delete $self->payload->{'TravisYML.perl_version_build'}; - } - if (defined $tmp) { - $self->payload->{'TravisYML.perl_version'} = $tmp; - } - else { - delete $self->payload->{'TravisYML.perl_version'}; - } - - ($perl_version, $perl_version_build) = ($perl_version_build, $perl_version); - } - my @plugins = ( # VERSION ['Git::NextVersion'], - ['NextRelease'], - ['ReversionOnRelease' => {prompt => 1}], # GATHER ['Git::GatherDir' => {exclude_filename => [@gather_exclude]}], @@ -286,13 +296,13 @@ sub configure { ['License'], ['ReadmeAnyFromPod' => 'RepoReadme' => {filename => 'README.md', location => 'root', type => 'markdown', phase => 'release'}], ['ReadmeAnyFromPod' => 'DistReadme' => {filename => 'README', location => 'build', type => 'text'}], - ['TravisYML' => {build_branch => '/^(dist|build\/.*)$/', perl_version => $perl_version, perl_version_build => $perl_version_build}], ['Manifest'], ['ManifestSkip'], $self->installer, # e.g. MakeMaker # RELEASE + ['NextRelease'], ['CheckChangesHasContent'], ['Git::Check' => {allow_dirty => [@allow_dirty], untracked_files => 'ignore'}], ['RunExtraTests'],