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'} // $self->payload->{max_target_perl
} // '5.10.1';
146 Specify the release authority
. Defaults to C
<cpan
:CCM
>.
156 $self->payload->{'Authority.authority'} // $self->payload->{authority
} // 'cpan:CCM';
162 Specify which installer to
use, such as
:
165 * C<MakeMaker> (default)
166 * C<MakeMaker::Custom>
174 default => sub { shift-
>payload->{installer
} // 'MakeMaker' },
179 Disable plugins that
use the network
, and prevent releasing
.
187 default => sub { $ENV{DZIL_AIRPLANE
} // shift-
>payload->{airplane
} // 0 },
192 Do
not upload to CPAN
or git
push.
200 default => sub { $ENV{DZIL_NO_UPLOAD
} // shift-
>payload->{no_upload
} // 0 },
205 Required by L
<Dist
::Zilla
::Role
::PluginBundle
::Easy
>.
212 my @copy_from_build = qw(LICENSE);
213 my @network_plugins = qw(Git::Push Test::Pod::No404s UploadToCPAN);
214 my @gather_exclude = (@copy_from_build, qw(README.md));
215 my @gather_prune = qw(dist.ini);
216 my @no_index = qw(eg share shares t xt);
217 my @allow_dirty = (@copy_from_build, qw(Changes LICENSE README.md));
218 my @git_remotes = qw(github origin);
219 my @check_files = qw(:InstallModules :ExecFiles :TestFiles :ExtraTestFiles);
220 my $perl_version_target = $self->max_target_perl;
222 if ($self->no_upload) {
223 say '[@Author::CCM] WARNING! WARNING! WARNING! *** You are in no_upload mode!! ***';
229 ['Git::NextVersion'],
232 ['Git::GatherDir' => {exclude_filename
=> [@gather_exclude]}],
234 ['PruneFiles' => {filename
=> [@gather_prune]}],
236 ['CopyFilesFromBuild' => {copy
=> [@copy_from_build]}],
241 -f
'cpanfile' ? ['Prereqs::FromCPANfile'] : (),
242 ['Prereqs::AuthorDeps'],
246 ['Test::CPAN::Changes'],
247 ['PodCoverageTests'],
249 ['Test::Pod::No404s'],
251 ['Test::MinimumVersion' => {max_target_perl
=> $perl_version_target}],
252 ['Test::EOL' => {finder
=> [@check_files]}],
253 ['Test::NoTabs' => {finder
=> [@check_files]}],
254 ['Test::Perl::Critic'],
255 ['Test::Portability'],
256 ['Test::CleanNamespaces'],
257 ['Test::ReportPrereqs'],
260 ['Authority' => {authority
=> $self->authority, do_munging
=> 0}],
263 ['MetaNoIndex' => {directory
=> [@no_index]}],
264 ['MetaProvides::Package'],
266 ['Git::Contributors' => {order_by
=> 'commits'}],
267 ['GithubMeta' => {remote
=> [@git_remotes], issues
=> 1}],
270 ['PodWeaver' => {config_plugin
=> '@Author::CCM'}],
271 ['OverridePkgVersion'],
275 ['ReadmeAnyFromPod' => 'RepoReadme' => {filename
=> 'README.md', location
=> 'root', type
=> 'markdown', phase
=> 'release'}],
276 ['ReadmeAnyFromPod' => 'DistReadme' => {filename
=> 'README', location
=> 'build', type
=> 'text'}],
280 $self->installer, # e.g. MakeMaker
284 ['CheckChangesHasContent'],
285 ['Git::Check' => {allow_dirty
=> [@allow_dirty], untracked_files
=> 'ignore'}],
288 # ['ConfirmRelease'],
289 $self->no_upload ? ['FakeRelease'] : ['UploadToCPAN'],
290 ['Git::Commit' => {allow_dirty
=> [@allow_dirty], commit_msg
=> 'Release %N %v%t%n%n%c'}],
291 ['Git::CommitBuild' => {branch
=> '', release_branch
=> 'dist', release_message
=> 'Version %v%t'}],
292 ['Git::Tag' => {tag_message
=> 'Version %v%t%n%n%c'}],
293 $self->no_upload ? () : ['Git::Push' => {push_to
=> 'origin master +master:refs/heads/release +dist', remotes_must_exist
=> 0}],
297 if ($self->airplane) {
298 my %network_plugins = map { Dist
::Zilla
::Util-
>expand_config_package_name($_) => 1 } @network_plugins;
300 @plugins = grep { !$network_plugins{Dist
::Zilla
::Util-
>expand_config_package_name(ref eq 'ARRAY' ? $_->[0] : $_)} } @plugins;
301 push @plugins, 'BlockRelease';
304 push @plugins, 'ConfirmRelease';
306 $self->add_plugins(@plugins);
309 with
'Dist::Zilla::Role::PluginBundle::Easy';
310 with
'Dist::Zilla::Role::PluginBundle::PluginRemover';
311 with
'Dist::Zilla::Role::PluginBundle::Config::Slicer';
313 __PACKAGE__-
>meta->make_immutable;