| 1 | package Dist::Zilla::PluginBundle::Author::CPANTesters; | ||
| 2 | our $VERSION = '0.003'; | ||
| 3 | # ABSTRACT: Dist::Zilla plugin bundle for CPAN Testers applications | ||
| 4 | |||
| 5 | #pod =head1 SYNOPSIS | ||
| 6 | #pod | ||
| 7 | #pod # In your dist.ini | ||
| 8 | #pod [@Author::CPANTesters] | ||
| 9 | #pod | ||
| 10 | #pod =head1 DESCRIPTION | ||
| 11 | #pod | ||
| 12 | #pod This bundle does the standard CPAN Testers build process. | ||
| 13 | #pod | ||
| 14 | #pod =head1 SEE ALSO | ||
| 15 | #pod | ||
| 16 | #pod L<Dist::Zilla>, L<Dist::Zilla::Role::PluginBundle::Easy> | ||
| 17 | #pod | ||
| 18 | #pod =cut | ||
| 19 | |||
| 20 | 0 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 21 | with 'Dist::Zilla::Role::PluginBundle::Easy'; | ||
| 22 | use namespace::autoclean; | ||
| 23 | |||
| 24 | sub configure { | ||
| 25 | my $self = shift; | ||
| 26 | $self->add_bundle('Filter', { | ||
| 27 | -bundle => '@Basic', | ||
| 28 | -remove => [qw( GatherDir Readme )], | ||
| 29 | }); | ||
| 30 | |||
| 31 | $self->add_plugins( | ||
| 32 | 'Readme::Brief', | ||
| 33 | [ | ||
| 34 | 'ReadmeAnyFromPod', { | ||
| 35 | location => 'root', | ||
| 36 | filename => 'README.mkdn', | ||
| 37 | type => 'markdown', | ||
| 38 | }, | ||
| 39 | ], | ||
| 40 | [ | ||
| 41 | 'PodWeaver', { | ||
| 42 | replacer => 'replace_with_comment', | ||
| 43 | post_code_replacer => 'replace_with_nothing', | ||
| 44 | }, | ||
| 45 | ], | ||
| 46 | 'RewriteVersion', | ||
| 47 | 'CPANFile', | ||
| 48 | 'MetaJSON', | ||
| 49 | 'MetaProvides::Package', | ||
| 50 | [ | ||
| 51 | 'MetaNoIndex', { | ||
| 52 | directory => [qw( t xt inc share eg examples )], | ||
| 53 | }, | ||
| 54 | ], | ||
| 55 | 'Git::Contributors', | ||
| 56 | 'Test::ReportPrereqs', | ||
| 57 | 'Test::Compile', | ||
| 58 | [ | ||
| 59 | 'Git::GatherDir', { | ||
| 60 | include_dotfiles => 1, | ||
| 61 | prune_directory => [qw( ^eg )], | ||
| 62 | exclude_match => [ | ||
| 63 | # Exclude dotfiles in the root directory | ||
| 64 | '^\.[^/]+$', | ||
| 65 | ], | ||
| 66 | exclude_filename => [ | ||
| 67 | # Exclude generated root content, which is included by the various plugins | ||
| 68 | # Without this, we get an error about duplicate content | ||
| 69 | 'cpanfile', | ||
| 70 | 'META.json', | ||
| 71 | 'LICENSE', | ||
| 72 | 'README', | ||
| 73 | 'README.mkdn', | ||
| 74 | 'Makefile.PL', | ||
| 75 | ], | ||
| 76 | }, | ||
| 77 | ], | ||
| 78 | |||
| 79 | [ | ||
| 80 | # Copy generated content to the repository root so users without Dist::Zilla | ||
| 81 | # can use it | ||
| 82 | 'CopyFilesFromBuild', { | ||
| 83 | copy => [qw( cpanfile META.json LICENSE Makefile.PL )], | ||
| 84 | }, | ||
| 85 | ], | ||
| 86 | |||
| 87 | [ 'CheckChangesHasContent', => { changelog => 'CHANGES' } ], | ||
| 88 | |||
| 89 | # Automatically commit these files during release | ||
| 90 | [ | ||
| 91 | 'Git::Check' => { | ||
| 92 | allow_dirty_match => [qw( README.* .*[.]PL )], | ||
| 93 | allow_dirty => [qw( cpanfile LICENSE CHANGES META.json )], | ||
| 94 | }, | ||
| 95 | ], | ||
| 96 | |||
| 97 | # Automatically commit with release version and changelog | ||
| 98 | [ | ||
| 99 | 'Git::Commit' => 'Commit_Dirty_Files', { | ||
| 100 | changelog => 'CHANGES', | ||
| 101 | commit_msg => 'release v%v%n%n%c', | ||
| 102 | allow_dirty_match => [qw( README.* .*[.]PL )], | ||
| 103 | allow_dirty => [qw( cpanfile LICENSE CHANGES META.json )], | ||
| 104 | add_files_in => '.', | ||
| 105 | }, | ||
| 106 | ], | ||
| 107 | [ | ||
| 108 | 'Git::Tag' => { | ||
| 109 | changelog => 'CHANGES', | ||
| 110 | tag_message => '%N v%v - %{yyyy-MM-dd}d%n%n%c', # Tag annotations show up in github release list | ||
| 111 | }, | ||
| 112 | ], | ||
| 113 | |||
| 114 | # NextRelease acts *during* pre-release to write $VERSION and | ||
| 115 | # timestamp to Changes and *after* release to add a new | ||
| 116 | # section, so to act at the right time after release, it must actually | ||
| 117 | # come after Commit_Dirty_Files but before Commit_Changes in the | ||
| 118 | # dist.ini. It will still act during pre-release as usual | ||
| 119 | [ 'NextRelease' => { filename => 'CHANGES' } ], | ||
| 120 | 'BumpVersionAfterRelease', | ||
| 121 | |||
| 122 | [ | ||
| 123 | 'Git::Commit', 'Commit_Changes', { | ||
| 124 | commit_msg => 'incrementing version after release', | ||
| 125 | allow_dirty => [qw( CHANGES )], | ||
| 126 | allow_dirty_match => [qw( ^bin/ ^lib/.*\.pm$ .*[.]PL )], | ||
| 127 | }, | ||
| 128 | ], | ||
| 129 | 'Git::Push', | ||
| 130 | |||
| 131 | [ | ||
| 132 | 'Run::AfterRelease', 'clean up release dirs', { | ||
| 133 | run => 'rm -rf %a %d', | ||
| 134 | }, | ||
| 135 | ], | ||
| 136 | ); | ||
| 137 | |||
| 138 | # XXX: How to add authordep Pod::Weaver::Section::Contributors? | ||
| 139 | } | ||
| 140 | |||
| 141 | __PACKAGE__->meta->make_immutable; | ||
| 142 | no Moose; | ||
| 143 | 1; | ||
| 144 | |||
| 145 | __END__ | ||