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.
19 exclude_filename = LICENSE
20 exclude_filename = README.md
31 [Prereqs::FromCPANfile] ; if a cpanfile exists in root
41 [Test::MinimumVersion]
42 max_target_perl = 5.10.1
47 [Test::CleanNamespaces]
61 [MetaProvides::Package]
70 config_plugin = @Author::CCM
87 [MakeMaker] ; override with the "installer" attribute
91 [CheckChangesHasContent]
96 [UploadToCPAN] ; disable with the "no_upload" attribute
98 commit_msg = Release %N %v%t%n%n%c
101 release_branch = dist
102 release_message = Version %v%t
104 tag_message = Version %v%t%n%n%c
106 push_to = origin master +master:refs/heads/release +dist
107 remotes_must_exist = 0
113 * L<Dist::Zilla::PluginBundle::Author::ETHER>
121 our $VERSION = '999.999'; # VERSION
123 use Dist
::Zilla
::Util
;
126 use namespace
::autoclean
;
128 =attr max_target_perl
130 Specify the minimum perl version
. Defaults to C
<5.10.1>.
134 has max_target_perl
=> (
140 $self->payload->{'Test::MinimumVersion.max_target_perl'}
141 // $self->payload->{max_target_perl
}
148 Set directories to
not index.
160 [split(/\s+/, $self->payload->{'MetaNoIndex.directories'}
161 // $self->payload->{no_index
}
162 // 'eg share shares t xt')];
168 Specify the release authority
. Defaults to C
<cpan
:CCM
>.
178 $self->payload->{'Authority.authority'} // $self->payload->{authority
} // 'cpan:CCM';
184 Specify which installer to
use, such as
:
187 * C<MakeMaker> (default)
188 * C<MakeMaker::Custom>
196 default => sub { shift-
>payload->{installer
} // 'MakeMaker' },
201 Disable plugins that
use the network
, and prevent releasing
.
209 default => sub { $ENV{DZIL_AIRPLANE
} // shift-
>payload->{airplane
} // 0 },
214 Do
not upload to CPAN
or git
push.
222 default => sub { $ENV{DZIL_NO_UPLOAD
} // shift-
>payload->{no_upload
} // 0 },
227 Required by L
<Dist
::Zilla
::Role
::PluginBundle
::Easy
>.
234 my @copy_from_build = qw(LICENSE);
235 my @network_plugins = qw(Git::Push Test::Pod::No404s UploadToCPAN);
236 my @gather_exclude = (@copy_from_build, qw(README.md));
237 my @gather_prune = qw(dist.ini);
238 my @no_index = @{$self->no_index};
239 my @allow_dirty = (@copy_from_build, qw(Changes LICENSE README.md));
240 my @git_remotes = qw(github origin);
241 my @check_files = qw(:InstallModules :ExecFiles :TestFiles :ExtraTestFiles);
242 my $perl_version_target = $self->max_target_perl;
244 if ($self->no_upload) {
245 say '[@Author::CCM] WARNING! WARNING! WARNING! *** You are in no_upload mode!! ***';
251 ['Git::NextVersion'],
254 ['Git::GatherDir' => {exclude_filename
=> [@gather_exclude]}],
256 ['PruneFiles' => {filename
=> [@gather_prune]}],
258 ['CopyFilesFromBuild' => {copy
=> [@copy_from_build]}],
263 -f
'cpanfile' ? ['Prereqs::FromCPANfile'] : (),
264 ['Prereqs::AuthorDeps'],
268 ['Test::CPAN::Changes'],
269 ['PodCoverageTests'],
271 ['Test::Pod::No404s'],
273 ['Test::MinimumVersion' => {max_target_perl
=> $perl_version_target}],
274 ['Test::EOL' => {finder
=> [@check_files]}],
275 ['Test::NoTabs' => {finder
=> [@check_files]}],
276 ['Test::Perl::Critic'],
277 ['Test::Portability'],
278 ['Test::CleanNamespaces'],
279 ['Test::ReportPrereqs'],
282 ['Authority' => {authority
=> $self->authority, do_munging
=> 0}],
285 ['MetaNoIndex' => {directory
=> [@no_index]}],
286 ['MetaProvides::Package'],
288 ['Git::Contributors' => {order_by
=> 'commits'}],
289 ['GithubMeta' => {remote
=> [@git_remotes], issues
=> 1}],
292 ['PodWeaver' => {config_plugin
=> '@Author::CCM'}],
293 ['OverridePkgVersion'],
297 ['ReadmeAnyFromPod' => 'RepoReadme' => {filename
=> 'README.md', location
=> 'root', type
=> 'markdown', phase
=> 'release'}],
298 ['ReadmeAnyFromPod' => 'DistReadme' => {filename
=> 'README', location
=> 'build', type
=> 'text'}],
302 $self->installer, # e.g. MakeMaker
306 ['CheckChangesHasContent'],
307 ['Git::Check' => {allow_dirty
=> [@allow_dirty], untracked_files
=> 'ignore'}],
310 # ['ConfirmRelease'],
311 $self->no_upload ? ['FakeRelease'] : ['UploadToCPAN'],
312 ['Git::Commit' => {allow_dirty
=> [@allow_dirty], commit_msg
=> 'Release %N %v%t%n%n%c'}],
313 ['Git::CommitBuild' => {branch
=> '', release_branch
=> 'dist', release_message
=> 'Version %v%t'}],
314 ['Git::Tag' => {tag_message
=> 'Version %v%t%n%n%c'}],
315 $self->no_upload ? () : ['Git::Push' => {push_to
=> 'origin master +master:refs/heads/release +dist', remotes_must_exist
=> 0}],
319 if ($self->airplane) {
320 my %network_plugins = map { Dist
::Zilla
::Util-
>expand_config_package_name($_) => 1 } @network_plugins;
322 @plugins = grep { !$network_plugins{Dist
::Zilla
::Util-
>expand_config_package_name(ref eq 'ARRAY' ? $_->[0] : $_)} } @plugins;
323 push @plugins, 'BlockRelease';
326 push @plugins, 'ConfirmRelease';
328 $self->add_plugins(@plugins);
331 with
'Dist::Zilla::Role::PluginBundle::Easy';
332 with
'Dist::Zilla::Role::PluginBundle::PluginRemover';
333 with
'Dist::Zilla::Role::PluginBundle::Config::Slicer';
335 __PACKAGE__-
>meta->make_immutable;