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.
22 exclude_filename = LICENSE
23 exclude_filename = README.md
34 [Prereqs::FromCPANfile] ; if a cpanfile exists in root
48 [Test::CleanNamespaces]
62 [MetaProvides::Package]
71 config_plugin = @Author::CCM
89 [MakeMaker] ; override with the "installer" attribute
92 [CheckChangesHasContent]
97 [UploadToCPAN] ; disable with the "no_upload" attribute
99 commit_msg = Release %N %v%t%n%n%c
102 release_branch = dist
103 release_message = Version %v%t
105 tag_message = Version %v%t%n%n%c
107 push_to = origin master +master:refs/heads/release +dist
108 remotes_must_exist = 0
114 * L<Dist::Zilla::PluginBundle::Author::ETHER>
121 our $VERSION = '999.999'; # VERSION
123 use Dist
::Zilla
::Util
;
125 use namespace
::autoclean
;
129 Specify which installer to
use, such as
:
132 * C<MakeMaker> (default)
133 * C<MakeMaker::Custom>
141 default => sub { shift-
>payload->{installer
} || 'MakeMaker' },
146 Disable plugins that
use the network
, and prevent releasing
.
154 default => sub { $ENV{DZIL_AIRPLANE
} // shift-
>payload->{airplane
} // 0 },
159 Do
not upload to CPAN
or git
push.
167 default => sub { $ENV{DZIL_NO_UPLOAD
} // shift-
>payload->{no_upload
} // 0 },
172 Required by L
<Dist
::Zilla
::Role
::PluginBundle
::Easy
>.
179 if ($self->no_upload) {
180 print '[@Author::CCM] WARNING! WARNING! WARNING! *** You are in no_upload mode!! ***', "\n";
183 my @copy_from_build = qw(LICENSE);
184 my @network_plugins = qw(Git::Push Test::Pod::No404s UploadToCPAN);
185 my @gather_exclude = (@copy_from_build, qw(README.md));
186 my @gather_prune = qw(dist.ini);
187 my @no_index = qw(eg share shares t xt);
188 my @allow_dirty = (@copy_from_build, qw(.travis.yml Changes LICENSE README.md));
189 my @git_remotes = qw(github origin);
190 my @check_files = qw(:InstallModules :ExecFiles :TestFiles :ExtraTestFiles);
195 ['Git::NextVersion'],
197 ['ReversionOnRelease' => {prompt
=> 1}],
200 ['Git::GatherDir' => {exclude_filename
=> [@gather_exclude]}],
202 ['PruneFiles' => {filename
=> [@gather_prune]}],
204 ['CopyFilesFromBuild' => {copy
=> [@copy_from_build]}],
209 -f
'cpanfile' ? ['Prereqs::FromCPANfile'] : (),
210 ['Prereqs::AuthorDeps'],
214 ['Test::CPAN::Changes'],
215 ['PodCoverageTests'],
217 ['Test::Pod::No404s'],
219 ['Test::EOL' => {finder
=> [@check_files]}],
220 ['Test::NoTabs' => {finder
=> [@check_files]}],
221 ['Test::Perl::Critic'],
222 ['Test::Portability'],
223 ['Test::CleanNamespaces'],
224 ['Test::ReportPrereqs'],
227 ['Authority' => {do_munging
=> 0}],
230 ['MetaNoIndex' => {directory
=> [@no_index]}],
231 ['MetaProvides::Package'],
233 ['Git::Contributors' => {order_by
=> 'commits'}],
234 ['GithubMeta' => {remote
=> [@git_remotes], issues
=> 1}],
237 ['PodWeaver' => {config_plugin
=> '@Author::CCM'}],
238 ['OverridePkgVersion'],
242 ['ReadmeAnyFromPod' => 'repo readme' => {filename
=> 'README.md', location
=> 'root', type
=> 'markdown', phase
=> 'release'}],
243 ['ReadmeAnyFromPod' => 'dist readme' => {filename
=> 'README', location
=> 'build', type
=> 'text'}],
248 $self->installer, # e.g. MakeMaker
251 ['CheckChangesHasContent'],
252 ['Git::Check' => {allow_dirty
=> [@allow_dirty], untracked_files
=> 'ignore'}],
255 # ['ConfirmRelease'],
256 $self->no_upload ? ['FakeRelease'] : ['UploadToCPAN'],
257 ['Git::Commit' => {allow_dirty
=> [@allow_dirty], commit_msg
=> 'Release %N %v%t%n%n%c'}],
258 ['Git::CommitBuild' => {branch
=> '', release_branch
=> 'dist', release_message
=> 'Version %v%t'}],
259 ['Git::Tag' => {tag_message
=> 'Version %v%t%n%n%c'}],
260 $self->no_upload ? () : ['Git::Push' => {push_to
=> 'origin master +master:refs/heads/release +dist', remotes_must_exist
=> 0}],
264 if ($self->airplane) {
265 my %network_plugins = map { Dist
::Zilla
::Util-
>expand_config_package_name($_) => 1 } @network_plugins;
267 @plugins = grep { !$network_plugins{Dist
::Zilla
::Util-
>expand_config_package_name(ref eq 'ARRAY' ? $_->[0] : $_)} } @plugins;
268 push @plugins, 'BlockRelease';
271 push @plugins, 'ConfirmRelease';
273 $self->add_plugins(@plugins);
276 with
'Dist::Zilla::Role::PluginBundle::Easy';
277 with
'Dist::Zilla::Role::PluginBundle::PluginRemover';
278 with
'Dist::Zilla::Role::PluginBundle::Config::Slicer';
280 __PACKAGE__-
>meta->make_immutable;