]>
Dogcows Code - chaz/p5-Dist-Zilla-PluginBundle-Author-CCM/blob - lib/Dist/Zilla/PluginBundle/Author/CCM.pm
5105692ea75cc82f5eeb77ae9fda5a151b414fab
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.007'; # VERSION
12 use Dist
::Zilla
::Util
;
14 use namespace
::autoclean
;
23 $self->payload->{'Authority.authority'} // $self->payload->{authority
} // 'cpan:CCM';
32 default => sub { shift-
>payload->{installer
} || 'MakeMaker' },
40 default => sub { $ENV{DZIL_AIRPLANE
} // shift-
>payload->{airplane
} // 0 },
48 default => sub { $ENV{DZIL_NO_UPLOAD
} // shift-
>payload->{no_upload
} // 0 },
55 my @copy_from_build = qw(LICENSE);
56 my @network_plugins = qw(Git::Push Test::Pod::No404s UploadToCPAN);
57 my @gather_exclude = (@copy_from_build, qw(README.md));
58 my @gather_prune = qw(dist.ini);
59 my @no_index = qw(eg share shares t xt);
60 my @allow_dirty = (@copy_from_build, qw(.travis.yml Changes LICENSE README.md));
61 my @git_remotes = qw(github origin);
62 my @check_files = qw(:InstallModules :ExecFiles :TestFiles :ExtraTestFiles);
63 my $perl_version_target = '5.10.1';
64 my $perl_version = '5.24 5.22 5.20 5.18 5.16 5.14';
65 my $perl_version_build = $perl_version . ' 5.12 5.10 -5.8';
67 if ($self->no_upload) {
68 say '[@Author::CCM] WARNING! WARNING! WARNING! *** You are in no_upload mode!! ***';
71 if (!$self->payload->{'TravisYML.support_builddir'}) {
72 # swap perl_version and perl_version_build because DZP::TravisYML got it backwards!
73 # https://github.com/SineSwiper/Dist-Zilla-TravisCI/pull/40
75 my $tmp = $self->payload->{'TravisYML.perl_version_build'};
76 if (defined $self->payload->{'TravisYML.perl_version'}) {
77 $self->payload->{'TravisYML.perl_version_build'} = $self->payload->{'TravisYML.perl_version'}
80 delete $self->payload->{'TravisYML.perl_version_build'};
83 $self->payload->{'TravisYML.perl_version'} = $tmp;
86 delete $self->payload->{'TravisYML.perl_version'};
89 ($perl_version, $perl_version_build) = ($perl_version_build, $perl_version);
96 ['ReversionOnRelease' => {prompt
=> 1}],
99 ['Git::GatherDir' => {exclude_filename
=> [@gather_exclude]}],
101 ['PruneFiles' => {filename
=> [@gather_prune]}],
103 ['CopyFilesFromBuild' => {copy
=> [@copy_from_build]}],
108 -f
'cpanfile' ? ['Prereqs::FromCPANfile'] : (),
109 ['Prereqs::AuthorDeps'],
113 ['Test::CPAN::Changes'],
114 ['PodCoverageTests'],
116 ['Test::Pod::No404s'],
118 ['Test::MinimumVersion' => {max_target_perl
=> $perl_version_target}],
119 ['Test::EOL' => {finder
=> [@check_files]}],
120 ['Test::NoTabs' => {finder
=> [@check_files]}],
121 ['Test::Perl::Critic'],
122 ['Test::Portability'],
123 ['Test::CleanNamespaces'],
124 ['Test::ReportPrereqs'],
127 ['Authority' => {authority
=> $self->authority, do_munging
=> 0}],
130 ['MetaNoIndex' => {directory
=> [@no_index]}],
131 ['MetaProvides::Package'],
133 ['Git::Contributors' => {order_by
=> 'commits'}],
134 ['GithubMeta' => {remote
=> [@git_remotes], issues
=> 1}],
137 ['PodWeaver' => {config_plugin
=> '@Author::CCM'}],
138 ['OverridePkgVersion'],
142 ['ReadmeAnyFromPod' => 'RepoReadme' => {filename
=> 'README.md', location
=> 'root', type
=> 'markdown', phase
=> 'release'}],
143 ['ReadmeAnyFromPod' => 'DistReadme' => {filename
=> 'README', location
=> 'build', type
=> 'text'}],
144 ['TravisYML' => {build_branch
=> '/^(dist|build\/.*)$/', perl_version
=> $perl_version, perl_version_build
=> $perl_version_build}],
148 $self->installer, # e.g. MakeMaker
152 ['CheckChangesHasContent'],
153 ['Git::Check' => {allow_dirty
=> [@allow_dirty], untracked_files
=> 'ignore'}],
156 # ['ConfirmRelease'],
157 $self->no_upload ? ['FakeRelease'] : ['UploadToCPAN'],
158 ['Git::Commit' => {allow_dirty
=> [@allow_dirty], commit_msg
=> 'Release %N %v%t%n%n%c'}],
159 ['Git::CommitBuild' => {branch
=> '', release_branch
=> 'dist', release_message
=> 'Version %v%t'}],
160 ['Git::Tag' => {tag_message
=> 'Version %v%t%n%n%c'}],
161 $self->no_upload ? () : ['Git::Push' => {push_to
=> 'origin master +master:refs/heads/release +dist', remotes_must_exist
=> 0}],
165 if ($self->airplane) {
166 my %network_plugins = map { Dist
::Zilla
::Util-
>expand_config_package_name($_) => 1 } @network_plugins;
168 @plugins = grep { !$network_plugins{Dist
::Zilla
::Util-
>expand_config_package_name(ref eq 'ARRAY' ? $_->[0] : $_)} } @plugins;
169 push @plugins, 'BlockRelease';
172 push @plugins, 'ConfirmRelease';
174 $self->add_plugins(@plugins);
177 with
'Dist::Zilla::Role::PluginBundle::Easy';
178 with
'Dist::Zilla::Role::PluginBundle::PluginRemover';
179 with
'Dist::Zilla::Role::PluginBundle::Config::Slicer';
181 __PACKAGE__-
>meta->make_immutable;
192 Dist::Zilla::PluginBundle::Author::CCM - A plugin bundle for distributions built by CCM
200 # In your dist.ini file:
205 You probably don't want to use this.
214 exclude_filename = LICENSE
215 exclude_filename = README.md
226 [Prereqs::FromCPANfile] ; if a cpanfile exists in root
227 [Prereqs::AuthorDeps]
231 [Test::CPAN::Changes]
236 [Test::MinimumVersion]
237 max_target_perl = 5.10.1
242 [Test::CleanNamespaces]
243 [Test::ReportPrereqs]
256 [MetaProvides::Package]
265 config_plugin = @Author::CCM
280 build_branch = /^(dist|build\/.*)$/
284 [MakeMaker] ; override with the "installer" attribute
288 [CheckChangesHasContent]
293 [UploadToCPAN] ; disable with the "no_upload" attribute
295 commit_msg = Release %N %v%t%n%n%c
298 release_branch = dist
299 release_message = Version %v%t
301 tag_message = Version %v%t%n%n%c
303 push_to = origin master +master:refs/heads/release +dist
304 remotes_must_exist = 0
310 Specify the release authority. Defaults to C<cpan:CCM>.
314 Specify which installer to use, such as:
320 C<MakeMaker> (default)
330 Disable plugins that use the network, and prevent releasing.
334 Do not upload to CPAN or git push.
340 Required by L<Dist::Zilla::Role::PluginBundle::Easy>.
352 L<Dist::Zilla::PluginBundle::Author::ETHER>
358 Please report any bugs or feature requests on the bugtracker website
359 L<https://github.com/chazmcgarvey/Dist-Zilla-PluginBundle-Author-CCM/issues>
361 When submitting a bug or request, please include a test-file or a
362 patch to an existing test-file that illustrates the bug or desired
367 Charles McGarvey <chazmcgarvey@brokenzipper.com>
369 =head1 COPYRIGHT AND LICENSE
371 This software is copyright (c) 2016 by Charles McGarvey.
373 This is free software; you can redistribute it and/or modify it under
374 the same terms as the Perl 5 programming language system itself.
This page took 0.052569 seconds and 3 git commands to generate.