| 1 | package Dist::Zilla::PluginBundle::GENEHACK; | ||||||||||
| 2 | 1 | our $AUTHORITY = 'cpan:GENEHACK'; | |||||||||
| 3 | 1 | $Dist::Zilla::PluginBundle::GENEHACK::VERSION = '0.9'; | |||||||||
| 4 | # ABSTRACT: BeLike::GENEHACK when you zilla your dist | ||||||||||
| 5 | |||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use Dist::Zilla; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 1 | with 'Dist::Zilla::Role::PluginBundle::Easy'; | |||||||||
| 11 | |||||||||||
| 12 | 1 | ▶ | use Dist::Zilla::Plugin::GatherDir; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 1 | ▶ | use Dist::Zilla::PluginBundle::Filter; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | 1 | ▶ | use Dist::Zilla::PluginBundle::Basic; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | |||||||||||
| 17 | 1 | ▶ | use Dist::Zilla::Plugin::Git::NextVersion; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 18 | 1 | ▶ | use Dist::Zilla::Plugin::AutoPrereqs; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 19 | 1 | ▶ | use Dist::Zilla::Plugin::CheckChangesHasContent; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 20 | 1 | ▶ | use Dist::Zilla::Plugin::Authority; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 21 | 1 | ▶ | use Dist::Zilla::Plugin::MinimumPerl; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 22 | 1 | ▶ | use Dist::Zilla::Plugin::PkgVersion; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | 1 | ▶ | use Dist::Zilla::Plugin::TaskWeaver; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 24 | 1 | ▶ | use Dist::Zilla::Plugin::PodWeaver; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 25 | 1 | ▶ | use Dist::Zilla::Plugin::MetaConfig; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 26 | 1 | ▶ | use Dist::Zilla::Plugin::MetaResources; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 27 | 1 | ▶ | use Dist::Zilla::Plugin::MetaJSON; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 28 | 1 | ▶ | use Dist::Zilla::Plugin::InstallGuide; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 29 | 1 | ▶ | use Dist::Zilla::Plugin::CopyFilesFromBuild; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 30 | 1 | ▶ | use Dist::Zilla::Plugin::NextRelease; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 31 | 1 | ▶ | use Dist::Zilla::Plugin::ExtraTests; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 32 | 1 | ▶ | use Dist::Zilla::Plugin::PodCoverageTests; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 33 | 1 | ▶ | use Dist::Zilla::Plugin::PodSyntaxTests; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 34 | 1 | ▶ | use Dist::Zilla::Plugin::Test::EOL; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 35 | 1 | ▶ | use Dist::Zilla::Plugin::Test::Compile; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 36 | 1 | ▶ | use Dist::Zilla::Plugin::Git::Tag; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 37 | 1 | ▶ | use Dist::Zilla::Plugin::Git::Commit; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 38 | 1 | ▶ | use Dist::Zilla::Plugin::InstallRelease; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 39 | 1 | ▶ | use Dist::Zilla::Plugin::Git::Push; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 40 | 1 | ▶ | use Dist::Zilla::Plugin::Twitter; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 41 | 1 | ▶ | use Dist::Zilla::Plugin::Run; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 42 | |||||||||||
| 43 | has homepage => ( | ||||||||||
| 44 | is => 'ro' , | ||||||||||
| 45 | isa => 'Maybe[Str]' , | ||||||||||
| 46 | lazy => 1 , | ||||||||||
| 47 | 0 | ▶ | default => sub { $_[0]->payload->{homepage} } , | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 48 | 1 | ); | |||||||||
| 49 | |||||||||||
| 50 | has is_task => ( | ||||||||||
| 51 | is => 'ro', | ||||||||||
| 52 | isa => 'Bool', | ||||||||||
| 53 | lazy => 1, | ||||||||||
| 54 | 0 | ▶ | default => sub { $_[0]->payload->{task} }, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 55 | 1 | ); | |||||||||
| 56 | |||||||||||
| 57 | 0 | ▶ | sub configure { | ||||||||
|
Subroutine
configure: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 58 | 0 | my $self = shift; | |||||||||
| 59 | |||||||||||
| 60 | 0 | $self->add_plugins(['GatherDir' => { | |||||||||
| 61 | exclude_match => '^release.*' , | ||||||||||
| 62 | exclude_filename => [ 'dist.ini' , 'INSTALL' ], | ||||||||||
| 63 | }]); | ||||||||||
| 64 | |||||||||||
| 65 | 0 | $self->add_bundle('Filter' => { | |||||||||
| 66 | bundle => '@Basic' , | ||||||||||
| 67 | remove => [ 'GatherDir' , 'Readme' ] , | ||||||||||
| 68 | }); | ||||||||||
| 69 | |||||||||||
| 70 | 0 | $self->add_plugins( | |||||||||
| 71 | # auto-versioning from git | ||||||||||
| 72 | 'Git::NextVersion', | ||||||||||
| 73 | |||||||||||
| 74 | # automatically build deps list | ||||||||||
| 75 | 'AutoPrereqs' , | ||||||||||
| 76 | |||||||||||
| 77 | # does what it says on the tin | ||||||||||
| 78 | 'CheckChangesHasContent' , | ||||||||||
| 79 | |||||||||||
| 80 | # include $VERSION in all files | ||||||||||
| 81 | 'PkgVersion', | ||||||||||
| 82 | |||||||||||
| 83 | # munge files to add authority info | ||||||||||
| 84 | [ 'Authority' => { authority => 'cpan:GENEHACK' , do_metadata => 1 } ], | ||||||||||
| 85 | |||||||||||
| 86 | # automagically determine minimum required perl version | ||||||||||
| 87 | 'MinimumPerl' , | ||||||||||
| 88 | |||||||||||
| 89 | ); | ||||||||||
| 90 | |||||||||||
| 91 | # weave together POD bits or build a task module | ||||||||||
| 92 | 0 | ▶ | if ($self->is_task) { $self->add_plugins('TaskWeaver') } | ||||||||
|
Branch: 1 branch
| |||||||||||
| 93 | 0 | else { $self->add_plugins('PodWeaver') } | |||||||||
| 94 | |||||||||||
| 95 | 0 | $self->add_plugins( | |||||||||
| 96 | # include a bunch of dist::zilla meta info in META.* files | ||||||||||
| 97 | 'MetaConfig' , | ||||||||||
| 98 | |||||||||||
| 99 | # support for setting repo metadata | ||||||||||
| 100 | 'MetaResources', | ||||||||||
| 101 | |||||||||||
| 102 | # include a META.json file in addition to META.yml | ||||||||||
| 103 | 'MetaJSON' , | ||||||||||
| 104 | ); | ||||||||||
| 105 | |||||||||||
| 106 | 0 | $self->add_plugins( | |||||||||
| 107 | # auto-make INSTALL | ||||||||||
| 108 | 'InstallGuide' , | ||||||||||
| 109 | |||||||||||
| 110 | # and copy it from the build | ||||||||||
| 111 | [ 'CopyFilesFromBuild' => { copy => 'INSTALL' } ], | ||||||||||
| 112 | |||||||||||
| 113 | # munge Changes | ||||||||||
| 114 | 'NextRelease' , | ||||||||||
| 115 | |||||||||||
| 116 | # testing is good. | ||||||||||
| 117 | 'ExtraTests' , | ||||||||||
| 118 | |||||||||||
| 119 | # really good | ||||||||||
| 120 | 'PodCoverageTests' , | ||||||||||
| 121 | 'PodSyntaxTests' , | ||||||||||
| 122 | |||||||||||
| 123 | # oh, so very good | ||||||||||
| 124 | 'Test::EOL' , | ||||||||||
| 125 | ['Test::Compile' => { bail_out_on_fail => 1 } ], | ||||||||||
| 126 | |||||||||||
| 127 | # git magic | ||||||||||
| 128 | ['Git::Commit' => { add_files_in => 'releases/' } ], | ||||||||||
| 129 | 'Git::Tag', | ||||||||||
| 130 | |||||||||||
| 131 | # install dist after release | ||||||||||
| 132 | [ 'InstallRelease' => { install_command => 'cpanm .' } ] , | ||||||||||
| 133 | |||||||||||
| 134 | 'Git::Push', | ||||||||||
| 135 | |||||||||||
| 136 | # tweet releases. because i can. | ||||||||||
| 137 | 'Twitter' , | ||||||||||
| 138 | |||||||||||
| 139 | ['Run::BeforeBuild' => { | ||||||||||
| 140 | run => 'rm -f Makefile.PL' , | ||||||||||
| 141 | }], | ||||||||||
| 142 | |||||||||||
| 143 | ['Run::AfterBuild' => { | ||||||||||
| 144 | run => [ | ||||||||||
| 145 | 'cp %d/Makefile.PL ./' , | ||||||||||
| 146 | "git status --porcelain | grep 'M Makefile.PL' && git commit -m 'auto-committed by dist.ini' Makefile.PL || echo Makefile.PL up to date" , | ||||||||||
| 147 | ] , | ||||||||||
| 148 | }], | ||||||||||
| 149 | |||||||||||
| 150 | ['Run::Release' => { | ||||||||||
| 151 | run => 'mv %a ./releases/' , | ||||||||||
| 152 | add_files_in => 'releases/' , | ||||||||||
| 153 | }] , | ||||||||||
| 154 | ); | ||||||||||
| 155 | } | ||||||||||
| 156 | |||||||||||
| 157 | 1 | 1; | |||||||||
| 158 | |||||||||||
| 159 | __END__ | ||||||||||