]>
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.005'; # 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!! ***';
76 ['ReversionOnRelease' => {prompt
=> 1}],
79 ['Git::GatherDir' => {exclude_filename
=> [@gather_exclude]}],
81 ['PruneFiles' => {filename
=> [@gather_prune]}],
83 ['CopyFilesFromBuild' => {copy
=> [@copy_from_build]}],
88 -f
'cpanfile' ? ['Prereqs::FromCPANfile'] : (),
89 ['Prereqs::AuthorDeps'],
93 ['Test::CPAN::Changes'],
96 ['Test::Pod::No404s'],
98 ['Test::MinimumVersion' => {max_target_perl
=> $perl_version_target}],
99 ['Test::EOL' => {finder
=> [@check_files]}],
100 ['Test::NoTabs' => {finder
=> [@check_files]}],
101 ['Test::Perl::Critic'],
102 ['Test::Portability'],
103 ['Test::CleanNamespaces'],
104 ['Test::ReportPrereqs'],
107 ['Authority' => {authority
=> $self->authority, do_munging
=> 0}],
110 ['MetaNoIndex' => {directory
=> [@no_index]}],
111 ['MetaProvides::Package'],
113 ['Git::Contributors' => {order_by
=> 'commits'}],
114 ['GithubMeta' => {remote
=> [@git_remotes], issues
=> 1}],
117 ['PodWeaver' => {config_plugin
=> '@Author::CCM'}],
118 ['OverridePkgVersion'],
122 ['ReadmeAnyFromPod' => 'RepoReadme' => {filename
=> 'README.md', location
=> 'root', type
=> 'markdown', phase
=> 'release'}],
123 ['ReadmeAnyFromPod' => 'DistReadme' => {filename
=> 'README', location
=> 'build', type
=> 'text'}],
124 ['TravisYML' => {build_branch
=> '/^(dist|build\/.*)$/', perl_version
=> $perl_version, perl_version_build
=> $perl_version_build}],
128 $self->installer, # e.g. MakeMaker
131 ['CheckChangesHasContent'],
132 ['Git::Check' => {allow_dirty
=> [@allow_dirty], untracked_files
=> 'ignore'}],
135 # ['ConfirmRelease'],
136 $self->no_upload ? ['FakeRelease'] : ['UploadToCPAN'],
137 ['Git::Commit' => {allow_dirty
=> [@allow_dirty], commit_msg
=> 'Release %N %v%t%n%n%c'}],
138 ['Git::CommitBuild' => {branch
=> '', release_branch
=> 'dist', release_message
=> 'Version %v%t'}],
139 ['Git::Tag' => {tag_message
=> 'Version %v%t%n%n%c'}],
140 $self->no_upload ? () : ['Git::Push' => {push_to
=> 'origin master +master:refs/heads/release +dist', remotes_must_exist
=> 0}],
144 if ($self->airplane) {
145 my %network_plugins = map { Dist
::Zilla
::Util-
>expand_config_package_name($_) => 1 } @network_plugins;
147 @plugins = grep { !$network_plugins{Dist
::Zilla
::Util-
>expand_config_package_name(ref eq 'ARRAY' ? $_->[0] : $_)} } @plugins;
148 push @plugins, 'BlockRelease';
151 push @plugins, 'ConfirmRelease';
153 $self->add_plugins(@plugins);
156 with
'Dist::Zilla::Role::PluginBundle::Easy';
157 with
'Dist::Zilla::Role::PluginBundle::PluginRemover';
158 with
'Dist::Zilla::Role::PluginBundle::Config::Slicer';
160 __PACKAGE__-
>meta->make_immutable;
171 Dist::Zilla::PluginBundle::Author::CCM - A plugin bundle for distributions built by CCM
179 # In your dist.ini file:
184 You probably don't want to use this.
194 exclude_filename = LICENSE
195 exclude_filename = README.md
206 [Prereqs::FromCPANfile] ; if a cpanfile exists in root
207 [Prereqs::AuthorDeps]
211 [Test::CPAN::Changes]
216 [Test::MinimumVersion]
217 max_target_perl = 5.10.1
222 [Test::CleanNamespaces]
223 [Test::ReportPrereqs]
236 [MetaProvides::Package]
245 config_plugin = @Author::CCM
260 build_branch = /^(dist|build\/.*)$/
264 [MakeMaker] ; override with the "installer" attribute
267 [CheckChangesHasContent]
272 [UploadToCPAN] ; disable with the "no_upload" attribute
274 commit_msg = Release %N %v%t%n%n%c
277 release_branch = dist
278 release_message = Version %v%t
280 tag_message = Version %v%t%n%n%c
282 push_to = origin master +master:refs/heads/release +dist
283 remotes_must_exist = 0
289 Specify the release authority. Defaults to C<cpan:CCM>.
293 Specify which installer to use, such as:
299 C<MakeMaker> (default)
309 Disable plugins that use the network, and prevent releasing.
313 Do not upload to CPAN or git push.
319 Required by L<Dist::Zilla::Role::PluginBundle::Easy>.
331 L<Dist::Zilla::PluginBundle::Author::ETHER>
337 Please report any bugs or feature requests on the bugtracker website
338 L<https://github.com/chazmcgarvey/Dist-Zilla-PluginBundle-Author-CCM/issues>
340 When submitting a bug or request, please include a test-file or a
341 patch to an existing test-file that illustrates the bug or desired
346 Charles McGarvey <chazmcgarvey@brokenzipper.com>
348 =head1 COPYRIGHT AND LICENSE
350 This software is copyright (c) 2016 by Charles McGarvey.
352 This is free software; you can redistribute it and/or modify it under
353 the same terms as the Perl 5 programming language system itself.
This page took 0.05431 seconds and 5 git commands to generate.