1 package Dist
::Zilla
::PluginBundle
::Author
::CCM
;
2 # ABSTRACT: A plugin bundle for distributions built by CCM
3 # KEYWORDS: dzil author bundle distribution tool
7 # In your dist.ini file:
12 You probably don't want to use this.
21 exclude_filename = LICENSE
22 exclude_filename = README.md
33 [Prereqs::FromCPANfile] ; if a cpanfile exists in root
43 [Test::MinimumVersion]
44 max_target_perl = 5.10.1
49 [Test::CleanNamespaces]
63 [MetaProvides::Package]
72 config_plugin = @Author::CCM
89 [MakeMaker] ; override with the "installer" attribute
93 [CheckChangesHasContent]
98 [UploadToCPAN] ; disable with the "no_upload" attribute
100 commit_msg = Release %N %v%t%n%n%c
103 release_branch = dist
104 release_message = Version %v%t
106 tag_message = Version %v%t%n%n%c
108 push_to = origin master +master:refs/heads/release +dist
109 remotes_must_exist = 0
115 * L<Dist::Zilla::PluginBundle::Author::ETHER>
123 our $VERSION = '999.999'; # VERSION
125 use Dist
::Zilla
::Util
;
128 use namespace
::autoclean
;
130 =attr max_target_perl
132 Specify the minimum perl version
. Defaults to C
<5.10.1>.
136 has max_target_perl
=> (
142 $self->payload->{'Test::MinimumVersion.max_target_perl'} // $self->payload->{max_target_perl
} // '5.10.1';
148 Specify the release authority
. Defaults to C
<cpan
:CCM
>.
158 $self->payload->{'Authority.authority'} // $self->payload->{authority
} // 'cpan:CCM';
164 Specify which installer to
use, such as
:
167 * C<MakeMaker> (default)
168 * C<MakeMaker::Custom>
176 default => sub { shift-
>payload->{installer
} // 'MakeMaker' },
181 Disable plugins that
use the network
, and prevent releasing
.
189 default => sub { $ENV{DZIL_AIRPLANE
} // shift-
>payload->{airplane
} // 0 },
194 Do
not upload to CPAN
or git
push.
202 default => sub { $ENV{DZIL_NO_UPLOAD
} // shift-
>payload->{no_upload
} // 0 },
207 Required by L
<Dist
::Zilla
::Role
::PluginBundle
::Easy
>.
214 my @copy_from_build = qw(LICENSE);
215 my @network_plugins = qw(Git::Push Test::Pod::No404s UploadToCPAN);
216 my @gather_exclude = (@copy_from_build, qw(README.md));
217 my @gather_prune = qw(dist.ini);
218 my @no_index = qw(eg share shares t xt);
219 my @allow_dirty = (@copy_from_build, qw(Changes LICENSE README.md));
220 my @git_remotes = qw(github origin);
221 my @check_files = qw(:InstallModules :ExecFiles :TestFiles :ExtraTestFiles);
222 my $perl_version_target = $self->max_target_perl;
224 if ($self->no_upload) {
225 say '[@Author::CCM] WARNING! WARNING! WARNING! *** You are in no_upload mode!! ***';
231 ['Git::NextVersion'],
232 ['ReversionOnRelease' => {prompt
=> 1}],
235 ['Git::GatherDir' => {exclude_filename
=> [@gather_exclude]}],
237 ['PruneFiles' => {filename
=> [@gather_prune]}],
239 ['CopyFilesFromBuild' => {copy
=> [@copy_from_build]}],
244 -f
'cpanfile' ? ['Prereqs::FromCPANfile'] : (),
245 ['Prereqs::AuthorDeps'],
249 ['Test::CPAN::Changes'],
250 ['PodCoverageTests'],
252 ['Test::Pod::No404s'],
254 ['Test::MinimumVersion' => {max_target_perl
=> $perl_version_target}],
255 ['Test::EOL' => {finder
=> [@check_files]}],
256 ['Test::NoTabs' => {finder
=> [@check_files]}],
257 ['Test::Perl::Critic'],
258 ['Test::Portability'],
259 ['Test::CleanNamespaces'],
260 ['Test::ReportPrereqs'],
263 ['Authority' => {authority
=> $self->authority, do_munging
=> 0}],
266 ['MetaNoIndex' => {directory
=> [@no_index]}],
267 ['MetaProvides::Package'],
269 ['Git::Contributors' => {order_by
=> 'commits'}],
270 ['GithubMeta' => {remote
=> [@git_remotes], issues
=> 1}],
273 ['PodWeaver' => {config_plugin
=> '@Author::CCM'}],
274 ['OverridePkgVersion'],
278 ['ReadmeAnyFromPod' => 'RepoReadme' => {filename
=> 'README.md', location
=> 'root', type
=> 'markdown', phase
=> 'release'}],
279 ['ReadmeAnyFromPod' => 'DistReadme' => {filename
=> 'README', location
=> 'build', type
=> 'text'}],
283 $self->installer, # e.g. MakeMaker
287 ['CheckChangesHasContent'],
288 ['Git::Check' => {allow_dirty
=> [@allow_dirty], untracked_files
=> 'ignore'}],
291 # ['ConfirmRelease'],
292 $self->no_upload ? ['FakeRelease'] : ['UploadToCPAN'],
293 ['Git::Commit' => {allow_dirty
=> [@allow_dirty], commit_msg
=> 'Release %N %v%t%n%n%c'}],
294 ['Git::CommitBuild' => {branch
=> '', release_branch
=> 'dist', release_message
=> 'Version %v%t'}],
295 ['Git::Tag' => {tag_message
=> 'Version %v%t%n%n%c'}],
296 $self->no_upload ? () : ['Git::Push' => {push_to
=> 'origin master +master:refs/heads/release +dist', remotes_must_exist
=> 0}],
300 if ($self->airplane) {
301 my %network_plugins = map { Dist
::Zilla
::Util-
>expand_config_package_name($_) => 1 } @network_plugins;
303 @plugins = grep { !$network_plugins{Dist
::Zilla
::Util-
>expand_config_package_name(ref eq 'ARRAY' ? $_->[0] : $_)} } @plugins;
304 push @plugins, 'BlockRelease';
307 push @plugins, 'ConfirmRelease';
309 $self->add_plugins(@plugins);
312 with
'Dist::Zilla::Role::PluginBundle::Easy';
313 with
'Dist::Zilla::Role::PluginBundle::PluginRemover';
314 with
'Dist::Zilla::Role::PluginBundle::Config::Slicer';
316 __PACKAGE__-
>meta->make_immutable;