]>
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.010'; # VERSION
12 use Dist
::Zilla
::Util
;
15 use namespace
::autoclean
;
18 has max_target_perl
=> (
24 $self->payload->{'Test::MinimumVersion.max_target_perl'}
25 // $self->payload->{max_target_perl
}
37 [split(/\s+/, $self->payload->{'MetaNoIndex.directories'}
38 // $self->payload->{no_index
}
39 // 'eg share shares t xt')];
50 $self->payload->{'Authority.authority'} // $self->payload->{authority
} // 'cpan:CCM';
59 default => sub { shift-
>payload->{installer
} // 'MakeMaker' },
67 default => sub { $ENV{DZIL_AIRPLANE
} // shift-
>payload->{airplane
} // 0 },
75 default => sub { $ENV{DZIL_NO_UPLOAD
} // shift-
>payload->{no_upload
} // 0 },
82 my @copy_from_build = qw(LICENSE);
83 my @network_plugins = qw(Git::Push Test::Pod::No404s UploadToCPAN);
84 my @gather_exclude = (@copy_from_build, qw(README.md));
85 my @gather_prune = qw(dist.ini);
86 my @no_index = @{$self->no_index};
87 my @allow_dirty = (@copy_from_build, qw(Changes LICENSE README.md));
88 my @git_remotes = qw(github origin);
89 my @check_files = qw(:InstallModules :ExecFiles :TestFiles :ExtraTestFiles);
90 my $perl_version_target = $self->max_target_perl;
92 if ($self->no_upload) {
93 say '[@Author::CCM] WARNING! WARNING! WARNING! *** You are in no_upload mode!! ***';
102 ['Git::GatherDir' => {exclude_filename
=> [@gather_exclude]}],
104 ['PruneFiles' => {filename
=> [@gather_prune]}],
106 ['CopyFilesFromBuild' => {copy
=> [@copy_from_build]}],
111 -f
'cpanfile' ? ['Prereqs::FromCPANfile'] : (),
112 ['Prereqs::AuthorDeps'],
116 ['Test::CPAN::Changes'],
117 ['PodCoverageTests'],
119 ['Test::Pod::No404s'],
121 ['Test::MinimumVersion' => {max_target_perl
=> $perl_version_target}],
122 ['Test::EOL' => {finder
=> [@check_files]}],
123 ['Test::NoTabs' => {finder
=> [@check_files]}],
124 ['Test::Perl::Critic'],
125 ['Test::Portability'],
126 ['Test::CleanNamespaces'],
127 ['Test::ReportPrereqs'],
130 ['Authority' => {authority
=> $self->authority, do_munging
=> 0}],
133 ['MetaNoIndex' => {directory
=> [@no_index]}],
134 ['MetaProvides::Package'],
136 ['Git::Contributors' => {order_by
=> 'commits'}],
137 ['GithubMeta' => {remote
=> [@git_remotes], issues
=> 1}],
140 ['PodWeaver' => {config_plugin
=> '@Author::CCM'}],
141 ['OverridePkgVersion'],
145 ['ReadmeAnyFromPod' => 'RepoReadme' => {filename
=> 'README.md', location
=> 'root', type
=> 'markdown', phase
=> 'release'}],
146 ['ReadmeAnyFromPod' => 'DistReadme' => {filename
=> 'README', location
=> 'build', type
=> 'text'}],
150 $self->installer, # e.g. MakeMaker
154 ['CheckChangesHasContent'],
155 ['Git::Check' => {allow_dirty
=> [@allow_dirty], untracked_files
=> 'ignore'}],
158 # ['ConfirmRelease'],
159 $self->no_upload ? ['FakeRelease'] : ['UploadToCPAN'],
160 ['Git::Commit' => {allow_dirty
=> [@allow_dirty], commit_msg
=> 'Release %N %v%t%n%n%c'}],
161 ['Git::CommitBuild' => {branch
=> '', release_branch
=> 'dist', release_message
=> 'Version %v%t'}],
162 ['Git::Tag' => {tag_message
=> 'Version %v%t%n%n%c'}],
163 $self->no_upload ? () : ['Git::Push' => {push_to
=> 'origin master +master:refs/heads/release +dist', remotes_must_exist
=> 0}],
167 if ($self->airplane) {
168 my %network_plugins = map { Dist
::Zilla
::Util-
>expand_config_package_name($_) => 1 } @network_plugins;
170 @plugins = grep { !$network_plugins{Dist
::Zilla
::Util-
>expand_config_package_name(ref eq 'ARRAY' ? $_->[0] : $_)} } @plugins;
171 push @plugins, 'BlockRelease';
174 push @plugins, 'ConfirmRelease';
176 $self->add_plugins(@plugins);
179 with
'Dist::Zilla::Role::PluginBundle::Easy';
180 with
'Dist::Zilla::Role::PluginBundle::PluginRemover';
181 with
'Dist::Zilla::Role::PluginBundle::Config::Slicer';
183 __PACKAGE__-
>meta->make_immutable;
194 Dist::Zilla::PluginBundle::Author::CCM - A plugin bundle for distributions built by CCM
202 # In your dist.ini file:
207 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
282 [MakeMaker] ; override with the "installer" attribute
286 [CheckChangesHasContent]
291 [UploadToCPAN] ; disable with the "no_upload" attribute
293 commit_msg = Release %N %v%t%n%n%c
296 release_branch = dist
297 release_message = Version %v%t
299 tag_message = Version %v%t%n%n%c
301 push_to = origin master +master:refs/heads/release +dist
302 remotes_must_exist = 0
306 =head2 max_target_perl
308 Specify the minimum perl version. Defaults to C<5.10.1>.
312 Set directories to not index.
318 Specify the release authority. Defaults to C<cpan:CCM>.
322 Specify which installer to use, such as:
328 C<MakeMaker> (default)
338 Disable plugins that use the network, and prevent releasing.
342 Do not upload to CPAN or git push.
348 Required by L<Dist::Zilla::Role::PluginBundle::Easy>.
360 L<Dist::Zilla::PluginBundle::Author::ETHER>
366 Please report any bugs or feature requests on the bugtracker website
367 L<https://github.com/chazmcgarvey/Dist-Zilla-PluginBundle-Author-CCM/issues>
369 When submitting a bug or request, please include a test-file or a
370 patch to an existing test-file that illustrates the bug or desired
375 Charles McGarvey <ccm@cpan.org>
377 =head1 COPYRIGHT AND LICENSE
379 This software is copyright (c) 2016 by Charles McGarvey.
381 This is free software; you can redistribute it and/or modify it under
382 the same terms as the Perl 5 programming language system itself.
This page took 0.057751 seconds and 4 git commands to generate.