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.
25 exclude_filename = LICENSE
26 exclude_filename = README.md
36 [Prereqs::FromCPANfile] ; if a cpanfile exists in root
50 [Test::CleanNamespaces]
64 [MetaProvides::Package]
73 config_plugin = @Author::CCM
91 [MakeMaker] ; override with the "installer" attribute
94 [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>
122 our $VERSION = '999.999'; # VERSION
124 use Dist
::Zilla
::Util
;
126 use namespace
::autoclean
;
130 Specify which installer to
use, such as
:
133 * C<MakeMaker> (default)
134 * C<MakeMaker::Custom>
142 default => sub { shift-
>payload->{installer
} || 'MakeMaker' },
147 Disable plugins that
use the network
, and prevent releasing
.
155 default => sub { $ENV{DZIL_AIRPLANE
} // shift-
>payload->{airplane
} // 0 },
160 Do
not upload to CPAN
or git
push.
168 default => sub { $ENV{DZIL_NO_UPLOAD
} // shift-
>payload->{no_upload
} // 0 },
173 Required by L
<Dist
::Zilla
::Role
::PluginBundle
::Easy
>.
180 if ($self->no_upload) {
181 print '[@Author::CCM] WARNING! WARNING! WARNING! *** You are in no_upload mode!! ***', "\n";
184 my @copy_from_build = qw(LICENSE);
185 my @network_plugins = qw(Git::Push Test::Pod::No404s UploadToCPAN);
186 my @gather_exclude = (@copy_from_build, qw(README.md));
187 my @gather_prune = qw(dist.ini);
188 my @no_index = qw(eg share shares t xt);
189 my @allow_dirty = (@copy_from_build, qw(.travis.yml Changes LICENSE README.md));
190 my @git_remotes = qw(github origin);
191 my @check_files = qw(:InstallModules :ExecFiles :TestFiles :ExtraTestFiles);
196 ['Git::NextVersion'],
198 ['ReversionOnRelease' => {prompt
=> 1}],
204 ['Git::GatherDir' => {exclude_filename
=> [@gather_exclude]}],
206 ['PruneFiles' => {filename
=> [@gather_prune]}],
208 ['CopyFilesFromBuild' => {copy
=> [@copy_from_build]}],
212 -f
'cpanfile' ? ['Prereqs::FromCPANfile'] : (),
213 ['Prereqs::AuthorDeps'],
217 ['Test::CPAN::Changes'],
218 ['PodCoverageTests'],
220 ['Test::Pod::No404s'],
222 ['Test::EOL' => {finder
=> [@check_files]}],
223 ['Test::NoTabs' => {finder
=> [@check_files]}],
224 ['Test::Perl::Critic'],
225 ['Test::Portability'],
226 ['Test::CleanNamespaces'],
227 ['Test::ReportPrereqs'],
230 ['Authority' => {do_munging
=> 0}],
233 ['MetaNoIndex' => {directory
=> [@no_index]}],
234 ['MetaProvides::Package'],
236 ['Git::Contributors' => {order_by
=> 'commits'}],
237 ['GithubMeta' => {remote
=> [@git_remotes], issues
=> 1}],
240 ['PodWeaver' => {config_plugin
=> '@Author::CCM'}],
241 ['OverridePkgVersion'],
245 ['ReadmeAnyFromPod' => 'repo readme' => {filename
=> 'README.md', location
=> 'root', type
=> 'markdown', phase
=> 'release'}],
246 ['ReadmeAnyFromPod' => 'dist readme' => {filename
=> 'README', location
=> 'build', type
=> 'text'}],
251 $self->installer, # e.g. MakeMaker
254 ['CheckChangesHasContent'],
255 ['Git::Check' => {allow_dirty
=> [@allow_dirty], untracked_files
=> 'ignore'}],
257 # ['ConfirmRelease'],
258 $self->no_upload ? ['FakeRelease'] : ['UploadToCPAN'],
259 ['Git::Commit' => {allow_dirty
=> [@allow_dirty], commit_msg
=> 'Release %N %v%t%n%n%c'}],
260 ['Git::CommitBuild' => {branch
=> '', release_branch
=> 'dist', release_message
=> 'Version %v%t'}],
261 ['Git::Tag' => {tag_message
=> 'Version %v%t%n%n%c'}],
262 $self->no_upload ? () : ['Git::Push' => {push_to
=> 'origin master +master:refs/heads/release +dist', remotes_must_exist
=> 0}],
266 if ($self->airplane) {
267 my %network_plugins = map { Dist
::Zilla
::Util-
>expand_config_package_name($_) => 1 } @network_plugins;
269 @plugins = grep { !$network_plugins{Dist
::Zilla
::Util-
>expand_config_package_name(ref eq 'ARRAY' ? $_->[0] : $_)} } @plugins;
270 push @plugins, 'BlockRelease';
273 push @plugins, 'ConfirmRelease';
275 $self->add_plugins(@plugins);
278 with
'Dist::Zilla::Role::PluginBundle::Easy';
279 with
'Dist::Zilla::Role::PluginBundle::PluginRemover';
280 with
'Dist::Zilla::Role::PluginBundle::Config::Slicer';
282 __PACKAGE__-
>meta->make_immutable;