]>
Dogcows Code - chaz/p5-Dist-Zilla-PluginBundle-Author-CCM/blob - lib/Dist/Zilla/PluginBundle/Author/CCM.pm
1 package Dist
::Zilla
::PluginBundle
::Author
::CCM
;
2 # ABSTRACT: A plugin bundle for distributions built by CCM
3 # KEYWORDS: dzil author bundle distribution tool
10 our $VERSION = '0.009'; # VERSION
12 use Dist
::Zilla
::Util
;
15 use namespace
::autoclean
;
18 has max_target_perl
=> (
24 $self->payload->{'Test::MinimumVersion.max_target_perl'} // $self->payload->{max_target_perl
} // '5.10.1';
35 $self->payload->{'Authority.authority'} // $self->payload->{authority
} // 'cpan:CCM';
44 default => sub { shift-
>payload->{installer
} // 'MakeMaker' },
52 default => sub { $ENV{DZIL_AIRPLANE
} // shift-
>payload->{airplane
} // 0 },
60 default => sub { $ENV{DZIL_NO_UPLOAD
} // shift-
>payload->{no_upload
} // 0 },
67 my @copy_from_build = qw(LICENSE);
68 my @network_plugins = qw(Git::Push Test::Pod::No404s UploadToCPAN);
69 my @gather_exclude = (@copy_from_build, qw(README.md));
70 my @gather_prune = qw(dist.ini);
71 my @no_index = qw(eg share shares t xt);
72 my @allow_dirty = (@copy_from_build, qw(Changes LICENSE README.md));
73 my @git_remotes = qw(github origin);
74 my @check_files = qw(:InstallModules :ExecFiles :TestFiles :ExtraTestFiles);
75 my $perl_version_target = $self->max_target_perl;
77 if ($self->no_upload) {
78 say '[@Author::CCM] WARNING! WARNING! WARNING! *** You are in no_upload mode!! ***';
87 ['Git::GatherDir' => {exclude_filename
=> [@gather_exclude]}],
89 ['PruneFiles' => {filename
=> [@gather_prune]}],
91 ['CopyFilesFromBuild' => {copy
=> [@copy_from_build]}],
96 -f
'cpanfile' ? ['Prereqs::FromCPANfile'] : (),
97 ['Prereqs::AuthorDeps'],
101 ['Test::CPAN::Changes'],
102 ['PodCoverageTests'],
104 ['Test::Pod::No404s'],
106 ['Test::MinimumVersion' => {max_target_perl
=> $perl_version_target}],
107 ['Test::EOL' => {finder
=> [@check_files]}],
108 ['Test::NoTabs' => {finder
=> [@check_files]}],
109 ['Test::Perl::Critic'],
110 ['Test::Portability'],
111 ['Test::CleanNamespaces'],
112 ['Test::ReportPrereqs'],
115 ['Authority' => {authority
=> $self->authority, do_munging
=> 0}],
118 ['MetaNoIndex' => {directory
=> [@no_index]}],
119 ['MetaProvides::Package'],
121 ['Git::Contributors' => {order_by
=> 'commits'}],
122 ['GithubMeta' => {remote
=> [@git_remotes], issues
=> 1}],
125 ['PodWeaver' => {config_plugin
=> '@Author::CCM'}],
126 ['OverridePkgVersion'],
130 ['ReadmeAnyFromPod' => 'RepoReadme' => {filename
=> 'README.md', location
=> 'root', type
=> 'markdown', phase
=> 'release'}],
131 ['ReadmeAnyFromPod' => 'DistReadme' => {filename
=> 'README', location
=> 'build', type
=> 'text'}],
135 $self->installer, # e.g. MakeMaker
139 ['CheckChangesHasContent'],
140 ['Git::Check' => {allow_dirty
=> [@allow_dirty], untracked_files
=> 'ignore'}],
143 # ['ConfirmRelease'],
144 $self->no_upload ? ['FakeRelease'] : ['UploadToCPAN'],
145 ['Git::Commit' => {allow_dirty
=> [@allow_dirty], commit_msg
=> 'Release %N %v%t%n%n%c'}],
146 ['Git::CommitBuild' => {branch
=> '', release_branch
=> 'dist', release_message
=> 'Version %v%t'}],
147 ['Git::Tag' => {tag_message
=> 'Version %v%t%n%n%c'}],
148 $self->no_upload ? () : ['Git::Push' => {push_to
=> 'origin master +master:refs/heads/release +dist', remotes_must_exist
=> 0}],
152 if ($self->airplane) {
153 my %network_plugins = map { Dist
::Zilla
::Util-
>expand_config_package_name($_) => 1 } @network_plugins;
155 @plugins = grep { !$network_plugins{Dist
::Zilla
::Util-
>expand_config_package_name(ref eq 'ARRAY' ? $_->[0] : $_)} } @plugins;
156 push @plugins, 'BlockRelease';
159 push @plugins, 'ConfirmRelease';
161 $self->add_plugins(@plugins);
164 with
'Dist::Zilla::Role::PluginBundle::Easy';
165 with
'Dist::Zilla::Role::PluginBundle::PluginRemover';
166 with
'Dist::Zilla::Role::PluginBundle::Config::Slicer';
168 __PACKAGE__-
>meta->make_immutable;
179 Dist::Zilla::PluginBundle::Author::CCM - A plugin bundle for distributions built by CCM
187 # In your dist.ini file:
192 You probably don't want to use this.
199 exclude_filename = LICENSE
200 exclude_filename = README.md
211 [Prereqs::FromCPANfile] ; if a cpanfile exists in root
212 [Prereqs::AuthorDeps]
216 [Test::CPAN::Changes]
221 [Test::MinimumVersion]
222 max_target_perl = 5.10.1
227 [Test::CleanNamespaces]
228 [Test::ReportPrereqs]
241 [MetaProvides::Package]
250 config_plugin = @Author::CCM
267 [MakeMaker] ; override with the "installer" attribute
271 [CheckChangesHasContent]
276 [UploadToCPAN] ; disable with the "no_upload" attribute
278 commit_msg = Release %N %v%t%n%n%c
281 release_branch = dist
282 release_message = Version %v%t
284 tag_message = Version %v%t%n%n%c
286 push_to = origin master +master:refs/heads/release +dist
287 remotes_must_exist = 0
291 =head2 max_target_perl
293 Specify the minimum perl version. Defaults to C<5.10.1>.
297 Specify the release authority. Defaults to C<cpan:CCM>.
301 Specify which installer to use, such as:
307 C<MakeMaker> (default)
317 Disable plugins that use the network, and prevent releasing.
321 Do not upload to CPAN or git push.
327 Required by L<Dist::Zilla::Role::PluginBundle::Easy>.
339 L<Dist::Zilla::PluginBundle::Author::ETHER>
345 Please report any bugs or feature requests on the bugtracker website
346 L<https://github.com/chazmcgarvey/Dist-Zilla-PluginBundle-Author-CCM/issues>
348 When submitting a bug or request, please include a test-file or a
349 patch to an existing test-file that illustrates the bug or desired
354 Charles McGarvey <chazmcgarvey@brokenzipper.com>
356 =head1 COPYRIGHT AND LICENSE
358 This software is copyright (c) 2016 by Charles McGarvey.
360 This is free software; you can redistribute it and/or modify it under
361 the same terms as the Perl 5 programming language system itself.
This page took 0.052001 seconds and 4 git commands to generate.