]>
Dogcows Code - chaz/p5-Dist-Zilla-PluginBundle-Author-CCM/blob - lib/Dist/Zilla/PluginBundle/Author/CCM.pm
1 package Dist
::Zilla
::PluginBundle
::Author
::CCM
;
2 # ABSTRACT: A plugin bundle for distributions built by CCM
3 # KEYWORDS: dzil author bundle distribution tool
10 our $VERSION = '0.012'; # VERSION
12 use Dist
::Zilla
::Util
;
15 use namespace
::autoclean
;
18 has max_target_perl
=> (
24 $self->payload->{'Test::MinimumVersion.max_target_perl'}
25 // $self->payload->{max_target_perl
}
37 [split(/\s+/, $self->payload->{'MetaNoIndex.directories'}
38 // $self->payload->{no_index
}
39 // 'eg share shares t xt')];
50 $self->payload->{'Authority.authority'} // $self->payload->{authority
} // 'cpan:CCM';
59 default => sub { shift-
>payload->{installer
} // 'MakeMaker' },
67 default => sub { $ENV{DZIL_AIRPLANE
} // shift-
>payload->{airplane
} // 0 },
75 default => sub { $ENV{DZIL_NO_UPLOAD
} // shift-
>payload->{no_upload
} // 0 },
82 my @copy_from_build = qw(LICENSE);
83 my @network_plugins = qw(Git::Push Test::Pod::No404s UploadToCPAN);
84 my @gather_exclude = (@copy_from_build, qw(README.md));
85 my @gather_prune = qw(dist.ini);
86 my @no_index = @{$self->no_index};
87 my @allow_dirty = (@copy_from_build, qw(Changes LICENSE README.md));
88 my @git_remotes = qw(github origin);
89 my @check_files = qw(:InstallModules :ExecFiles :TestFiles :ExtraTestFiles);
90 my $perl_version_target = $self->max_target_perl;
91 my $installer = $self->installer;
93 if ($self->no_upload) {
94 say '[@Author::CCM] WARNING! WARNING! WARNING! *** You are in no_upload mode!! ***';
100 ['Git::NextVersion'],
103 ['Git::GatherDir' => {exclude_filename
=> [@gather_exclude]}],
105 ['PruneFiles' => {filename
=> [@gather_prune]}],
107 ['CopyFilesFromBuild' => {copy
=> [@copy_from_build]}],
112 -f
'cpanfile' ? ['Prereqs::FromCPANfile'] : (),
113 ['Prereqs::AuthorDeps'],
117 ['Test::CPAN::Changes'],
118 ['PodCoverageTests'],
120 ['Test::Pod::No404s'],
122 ['Test::MinimumVersion' => {max_target_perl
=> $perl_version_target}],
123 ['Test::EOL' => {finder
=> [@check_files]}],
124 ['Test::NoTabs' => {finder
=> [@check_files]}],
125 ['Test::Perl::Critic'],
126 ['Test::Portability'],
127 ['Test::CleanNamespaces'],
128 ['Test::ReportPrereqs'],
131 ['Authority' => {authority
=> $self->authority, do_munging
=> 0}],
134 ['MetaNoIndex' => {directory
=> [@no_index]}],
135 ['MetaProvides::Package'],
137 ['Git::Contributors' => {order_by
=> 'commits'}],
138 ['GithubMeta' => {remote
=> [@git_remotes], issues
=> 1}],
141 ['PodWeaver' => {config_plugin
=> '@Author::CCM'}],
142 ['OverridePkgVersion'],
146 ['ReadmeAnyFromPod' => 'RepoReadme' => {filename
=> 'README.md', location
=> 'root', type
=> 'markdown', phase
=> 'release'}],
147 ['ReadmeAnyFromPod' => 'DistReadme' => {filename
=> 'README', location
=> 'build', type
=> 'text'}],
151 $installer ? $self->installer : (), # e.g. MakeMaker
154 ['NextRelease' => {format
=> '%-9v %{yyyy-MM-dd HH:mm:ssZZZ}d%{ (TRIAL RELEASE)}T'}],
155 ['CheckChangesHasContent'],
156 ['Git::Check' => {allow_dirty
=> [@allow_dirty], untracked_files
=> 'ignore'}],
159 # ['ConfirmRelease'],
160 $self->no_upload ? ['FakeRelease'] : ['UploadToCPAN'],
161 ['Git::Commit' => {allow_dirty
=> [@allow_dirty], commit_msg
=> 'Release %N %v%t%n%n%c'}],
162 ['Git::CommitBuild' => {branch
=> '', release_branch
=> 'dist', release_message
=> 'Version %v%t'}],
163 ['Git::Tag' => {tag_message
=> 'Version %v%t%n%n%c'}],
164 $self->no_upload ? () : ['Git::Push' => {push_to
=> 'origin master +master:refs/heads/release +dist', remotes_must_exist
=> 0}],
168 if ($self->airplane) {
169 my %network_plugins = map { Dist
::Zilla
::Util-
>expand_config_package_name($_) => 1 } @network_plugins;
171 @plugins = grep { !$network_plugins{Dist
::Zilla
::Util-
>expand_config_package_name(ref eq 'ARRAY' ? $_->[0] : $_)} } @plugins;
172 push @plugins, 'BlockRelease';
175 push @plugins, 'ConfirmRelease';
177 $self->add_plugins(@plugins);
180 with
'Dist::Zilla::Role::PluginBundle::Easy';
181 with
'Dist::Zilla::Role::PluginBundle::PluginRemover';
182 with
'Dist::Zilla::Role::PluginBundle::Config::Slicer';
184 __PACKAGE__-
>meta->make_immutable;
195 Dist::Zilla::PluginBundle::Author::CCM - A plugin bundle for distributions built by CCM
203 # In your dist.ini file:
208 You probably don't want to use this.
215 exclude_filename = LICENSE
216 exclude_filename = README.md
227 [Prereqs::FromCPANfile] ; if a cpanfile exists in root
228 [Prereqs::AuthorDeps]
232 [Test::CPAN::Changes]
237 [Test::MinimumVersion]
238 max_target_perl = 5.10.1
243 [Test::CleanNamespaces]
244 [Test::ReportPrereqs]
257 [MetaProvides::Package]
266 config_plugin = @Author::CCM
283 [MakeMaker] ; override with the "installer" attribute
287 [CheckChangesHasContent]
292 [UploadToCPAN] ; disable with the "no_upload" attribute
294 commit_msg = Release %N %v%t%n%n%c
297 release_branch = dist
298 release_message = Version %v%t
300 tag_message = Version %v%t%n%n%c
302 push_to = origin master +master:refs/heads/release +dist
303 remotes_must_exist = 0
307 =head2 max_target_perl
309 Specify the minimum perl version. Defaults to C<5.10.1>.
313 Set directories to not index.
319 Specify the release authority. Defaults to C<cpan:CCM>.
323 Specify which installer to use, such as:
329 C<MakeMaker> (default)
339 Disable plugins that use the network, and prevent releasing.
343 Do not upload to CPAN or git push.
349 Required by L<Dist::Zilla::Role::PluginBundle::Easy>.
361 L<Dist::Zilla::PluginBundle::Author::ETHER>
367 Please report any bugs or feature requests on the bugtracker website
368 L<https://github.com/chazmcgarvey/Dist-Zilla-PluginBundle-Author-CCM/issues>
370 When submitting a bug or request, please include a test-file or a
371 patch to an existing test-file that illustrates the bug or desired
376 Charles McGarvey <ccm@cpan.org>
378 =head1 COPYRIGHT AND LICENSE
380 This software is copyright (c) 2016 by Charles McGarvey.
382 This is free software; you can redistribute it and/or modify it under
383 the same terms as the Perl 5 programming language system itself.
This page took 0.063647 seconds and 4 git commands to generate.