line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Dist::Zilla::Plugin::Author::Plicease::SpecialPrereqs 2.40 { |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1060
|
use 5.014; |
|
1
|
|
|
|
|
5
|
|
4
|
1
|
|
|
1
|
|
6
|
use Moose; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: Special prereq handling |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
with 'Dist::Zilla::Role::BeforeRelease'; |
10
|
|
|
|
|
|
|
with 'Dist::Zilla::Role::PrereqSource'; |
11
|
|
|
|
|
|
|
with 'Dist::Zilla::Role::InstallTool'; |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
0
|
0
|
|
sub mvp_multivalue_args { qw( upgrade preamble ) } |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has preamble => ( |
16
|
|
|
|
|
|
|
is => 'ro', |
17
|
|
|
|
|
|
|
default => sub { [] }, |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has upgrade => ( |
21
|
|
|
|
|
|
|
is => 'ro', |
22
|
|
|
|
|
|
|
default => sub { [] }, |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub register_prereqs |
26
|
|
|
|
|
|
|
{ |
27
|
0
|
|
|
0
|
0
|
|
my($self) = @_; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
my $prereqs = $self->zilla->prereqs->as_string_hash; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
my %upgrades = qw( |
32
|
|
|
|
|
|
|
Moo 2.0 |
33
|
|
|
|
|
|
|
PerlX::Maybe 0.003 |
34
|
|
|
|
|
|
|
AnyEvent::Open3::Simple 0.83 |
35
|
|
|
|
|
|
|
Path::Class 0.26 |
36
|
|
|
|
|
|
|
Mojolicious 4.31 |
37
|
|
|
|
|
|
|
Role::Tiny 1.003001 |
38
|
|
|
|
|
|
|
Test::More 0.98 |
39
|
|
|
|
|
|
|
Test::Exit 0.11 |
40
|
|
|
|
|
|
|
Clustericious 1.20 |
41
|
|
|
|
|
|
|
Test::Clustericious::Cluster 0.31 |
42
|
|
|
|
|
|
|
Test2::V0 0.000092 |
43
|
|
|
|
|
|
|
ExtUtils::ParseXS 3.30 |
44
|
|
|
|
|
|
|
); |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
$upgrades{$_} = '1.302015' for ( |
47
|
0
|
|
|
|
|
|
(map { "Test2::$_" } qw( API Event Formatter Formatter::TAP Hub IPC Util )), |
48
|
0
|
|
|
|
|
|
(map { "Test2::API::$_" } qw( Breakage Context Instance Stack )), |
49
|
0
|
|
|
|
|
|
(map { "Test2::Event::$_" } qw( Bail Diag Exception Note Ok Plan Skp Subtest Waiting )), |
50
|
0
|
|
|
|
|
|
(map { "Test2::Hub::$_" } qw( Interceptor Interceptor::Terminator Subtest )), |
51
|
0
|
|
|
|
|
|
(map { "Test2::IPC::$_" } qw( Driver Driver::Files )), |
52
|
0
|
|
|
|
|
|
(map { "Test2::Util::$_" } qw( ExternalMeta HashBase Trace )), |
53
|
|
|
|
|
|
|
'Test2', |
54
|
|
|
|
|
|
|
); |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
$upgrades{$_} = '0.000060' for qw( |
57
|
|
|
|
|
|
|
Test2::V0 |
58
|
|
|
|
|
|
|
Test2::Bundle |
59
|
|
|
|
|
|
|
Test2::Bundle::Extended |
60
|
|
|
|
|
|
|
Test2::Bundle::More |
61
|
|
|
|
|
|
|
Test2::Bundle::Simple |
62
|
|
|
|
|
|
|
Test2::Compare |
63
|
|
|
|
|
|
|
Test2::Compare::Array |
64
|
|
|
|
|
|
|
Test2::Compare::Base |
65
|
|
|
|
|
|
|
Test2::Compare::Custom |
66
|
|
|
|
|
|
|
Test2::Compare::Delta |
67
|
|
|
|
|
|
|
Test2::Compare::Event |
68
|
|
|
|
|
|
|
Test2::Compare::EventMeta |
69
|
|
|
|
|
|
|
Test2::Compare::Hash |
70
|
|
|
|
|
|
|
Test2::Compare::Meta |
71
|
|
|
|
|
|
|
Test2::Compare::Number |
72
|
|
|
|
|
|
|
Test2::Compare::Object |
73
|
|
|
|
|
|
|
Test2::Compare::OrderedSubset |
74
|
|
|
|
|
|
|
Test2::Compare::Pattern |
75
|
|
|
|
|
|
|
Test2::Compare::Ref |
76
|
|
|
|
|
|
|
Test2::Compare::Regex |
77
|
|
|
|
|
|
|
Test2::Compare::Scalar |
78
|
|
|
|
|
|
|
Test2::Compare::Set |
79
|
|
|
|
|
|
|
Test2::Compare::String |
80
|
|
|
|
|
|
|
Test2::Compare::Undef |
81
|
|
|
|
|
|
|
Test2::Compare::Wildcard |
82
|
|
|
|
|
|
|
Test2::Mock |
83
|
|
|
|
|
|
|
Test2::Plugin |
84
|
|
|
|
|
|
|
Test2::Plugin::BailOnFail |
85
|
|
|
|
|
|
|
Test2::Plugin::DieOnFail |
86
|
|
|
|
|
|
|
Test2::Plugin::ExitSummary |
87
|
|
|
|
|
|
|
Test2::Plugin::SRand |
88
|
|
|
|
|
|
|
Test2::Plugin::UTF8 |
89
|
|
|
|
|
|
|
Test2::Require |
90
|
|
|
|
|
|
|
Test2::Require::AuthorTesting |
91
|
|
|
|
|
|
|
Test2::Require::EnvVar |
92
|
|
|
|
|
|
|
Test2::Require::Fork |
93
|
|
|
|
|
|
|
Test2::Require::Module |
94
|
|
|
|
|
|
|
Test2::Require::Perl |
95
|
|
|
|
|
|
|
Test2::Require::RealFork |
96
|
|
|
|
|
|
|
Test2::Require::Threads |
97
|
|
|
|
|
|
|
Test2::Suite |
98
|
|
|
|
|
|
|
Test2::Todo |
99
|
|
|
|
|
|
|
Test2::Tools |
100
|
|
|
|
|
|
|
Test2::Tools::Basic |
101
|
|
|
|
|
|
|
Test2::Tools::Class |
102
|
|
|
|
|
|
|
Test2::Tools::ClassicCompare |
103
|
|
|
|
|
|
|
Test2::Tools::Compare |
104
|
|
|
|
|
|
|
Test2::Tools::Defer |
105
|
|
|
|
|
|
|
Test2::Tools::Encoding |
106
|
|
|
|
|
|
|
Test2::Tools::Event |
107
|
|
|
|
|
|
|
Test2::Tools::Exception |
108
|
|
|
|
|
|
|
Test2::Tools::Exports |
109
|
|
|
|
|
|
|
Test2::Tools::Grab |
110
|
|
|
|
|
|
|
Test2::Tools::Mock |
111
|
|
|
|
|
|
|
Test2::Tools::Ref |
112
|
|
|
|
|
|
|
Test2::Tools::Subtest |
113
|
|
|
|
|
|
|
Test2::Tools::Target |
114
|
|
|
|
|
|
|
Test2::Tools::Warnings |
115
|
|
|
|
|
|
|
Test2::Util::Grabber |
116
|
|
|
|
|
|
|
Test2::Util::Ref |
117
|
|
|
|
|
|
|
Test2::Util::Stash |
118
|
|
|
|
|
|
|
Test2::Util::Sub |
119
|
|
|
|
|
|
|
Test2::Util::Table |
120
|
|
|
|
|
|
|
Test2::Util::Table::LineBreak |
121
|
|
|
|
|
|
|
); |
122
|
|
|
|
|
|
|
|
123
|
0
|
|
|
|
|
|
foreach my $upgrade (@{ $self->upgrade }) |
|
0
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
{ |
125
|
0
|
0
|
|
|
|
|
if($upgrade =~ /^\s*(\S+)\s*=\s*(\S+)\s*$/) |
126
|
|
|
|
|
|
|
{ |
127
|
0
|
|
|
|
|
|
$upgrades{$1} = $2; |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
else |
130
|
|
|
|
|
|
|
{ |
131
|
0
|
|
|
|
|
|
$self->log_fatal("upgrade failed: $upgrade"); |
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
|
135
|
0
|
|
|
|
|
|
foreach my $phase (keys %$prereqs) |
136
|
|
|
|
|
|
|
{ |
137
|
0
|
|
|
|
|
|
foreach my $type (keys %{ $prereqs->{$phase} }) |
|
0
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
{ |
139
|
0
|
|
|
|
|
|
foreach my $module (sort keys %{ $prereqs->{$phase}->{$type} }) |
|
0
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
{ |
141
|
0
|
|
|
|
|
|
my $value = $prereqs->{$phase}->{$type}->{$module}; |
142
|
0
|
0
|
|
|
|
|
next unless $value == 0; |
143
|
0
|
0
|
|
|
|
|
if($upgrades{$module}) |
144
|
|
|
|
|
|
|
{ |
145
|
|
|
|
|
|
|
$self->zilla->register_prereqs({ |
146
|
|
|
|
|
|
|
type => $type, |
147
|
|
|
|
|
|
|
phase => $phase, |
148
|
0
|
|
|
|
|
|
}, $module => $upgrades{$module} ); |
149
|
|
|
|
|
|
|
} |
150
|
|
|
|
|
|
|
} |
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
} |
153
|
|
|
|
|
|
|
|
154
|
0
|
|
|
|
|
|
foreach my $phase (keys %$prereqs) |
155
|
|
|
|
|
|
|
{ |
156
|
0
|
|
|
|
|
|
foreach my $type (keys %{ $prereqs->{$phase} }) |
|
0
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
{ |
158
|
0
|
|
|
|
|
|
foreach my $module (keys %{ $prereqs->{$phase}->{$type} }) |
|
0
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
{ |
160
|
0
|
0
|
|
|
|
|
if($module =~ /^(JSON|PerlX::Maybe)$/) |
161
|
|
|
|
|
|
|
{ |
162
|
0
|
|
|
|
|
|
$self->zilla->register_prereqs({ |
163
|
|
|
|
|
|
|
type => 'recommends', |
164
|
|
|
|
|
|
|
phase => $phase, |
165
|
|
|
|
|
|
|
}, join('::', $module, 'XS') => 0 ); |
166
|
|
|
|
|
|
|
} |
167
|
0
|
0
|
|
|
|
|
if($module eq 'JSON::MaybeXS') |
168
|
|
|
|
|
|
|
{ |
169
|
0
|
|
|
|
|
|
$self->zilla->register_prereqs({ |
170
|
|
|
|
|
|
|
type => 'recommends', |
171
|
|
|
|
|
|
|
phase => $phase, |
172
|
|
|
|
|
|
|
}, "Cpanel::JSON::XS"); |
173
|
|
|
|
|
|
|
} |
174
|
0
|
|
|
|
|
|
my($first) = split /::/, $module; |
175
|
0
|
0
|
|
|
|
|
if($first =~ /^(AnyEvent|Mojo|Mojolicious)$/) |
176
|
|
|
|
|
|
|
{ |
177
|
0
|
|
|
|
|
|
$self->zilla->register_prereqs({ |
178
|
|
|
|
|
|
|
type => 'recommends', |
179
|
|
|
|
|
|
|
phase => $phase, |
180
|
|
|
|
|
|
|
}, EV => 0); |
181
|
|
|
|
|
|
|
} |
182
|
|
|
|
|
|
|
} |
183
|
|
|
|
|
|
|
} |
184
|
|
|
|
|
|
|
} |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
} |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
sub before_release |
189
|
|
|
|
|
|
|
{ |
190
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
191
|
0
|
0
|
|
|
|
|
$self->log_fatal('don\'t release via MSWin32') if $^O eq 'MSWin32'; |
192
|
0
|
0
|
|
|
|
|
$self->log_fatal('don\'t release without Git plugins') if $ENV{PLICEASE_DZIL_NO_GIT}; |
193
|
|
|
|
|
|
|
} |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
sub setup_installer |
196
|
|
|
|
|
|
|
{ |
197
|
0
|
|
|
0
|
0
|
|
my($self) = @_; |
198
|
|
|
|
|
|
|
|
199
|
0
|
|
|
|
|
|
my $prereqs = $self->zilla->prereqs->as_string_hash; |
200
|
|
|
|
|
|
|
|
201
|
0
|
|
|
|
|
|
my $perl_version = $prereqs->{runtime}->{requires}->{perl}; |
202
|
|
|
|
|
|
|
|
203
|
0
|
|
|
|
|
|
$self->log("perl version required = $perl_version"); |
204
|
|
|
|
|
|
|
|
205
|
0
|
|
|
|
|
|
foreach my $file (grep { $_->name =~ /^(Makefile\.PL|Build\.PL)$/ } @{ $self->zilla->files }) |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
{ |
207
|
0
|
|
|
|
|
|
my $content = $file->content; |
208
|
|
|
|
|
|
|
$content = join "\n", |
209
|
|
|
|
|
|
|
"BEGIN {", |
210
|
|
|
|
|
|
|
" use strict; use warnings;", |
211
|
0
|
|
|
|
|
|
(map { s/^\| / /; $_ } @{ $self->preamble }), |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
" unless(eval q{ use $perl_version; 1}) {", |
213
|
|
|
|
|
|
|
" print \"Perl $perl_version or better required\\n\";", |
214
|
|
|
|
|
|
|
" exit;", |
215
|
|
|
|
|
|
|
" }", |
216
|
|
|
|
|
|
|
"}", |
217
|
|
|
|
|
|
|
$content; |
218
|
0
|
|
|
|
|
|
$file->content($content); |
219
|
|
|
|
|
|
|
} |
220
|
|
|
|
|
|
|
} |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
223
|
|
|
|
|
|
|
} |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
1; |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
__END__ |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
=pod |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
=encoding UTF-8 |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
=head1 NAME |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
Dist::Zilla::Plugin::Author::Plicease::SpecialPrereqs - Special prereq handling |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
=head1 VERSION |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
version 2.40 |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
=head1 SYNOPSIS |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
[Author::Plicease::SpecialPrereqs] |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
=head1 DESCRIPTION |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
Some older versions of modules have problematic for various |
248
|
|
|
|
|
|
|
reasons (at least in the context of how I use them). This |
249
|
|
|
|
|
|
|
plugin will upgrade those prereqs to appropriate version |
250
|
|
|
|
|
|
|
if they are C<0>, meaning any version. |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
Some modules are recommended if certain modules are already |
253
|
|
|
|
|
|
|
prerequisites. For example, XS modules may be recommended if |
254
|
|
|
|
|
|
|
otherwise pure perl modules will optionally use them. |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
This plugin also enforces that releases are not done on |
257
|
|
|
|
|
|
|
Perl 5.8 or C<MSWin32>. |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
This plugin also adds a preface to your C<Makefile.PL> or C<Build.PL> to |
260
|
|
|
|
|
|
|
test the Perl version in a way that will not throw an exception, |
261
|
|
|
|
|
|
|
instead calling exit, so that they will not be reported on |
262
|
|
|
|
|
|
|
cpantesters as failures. This plugin should be the last |
263
|
|
|
|
|
|
|
L<Dist::Zilla::Role::InstallTool> plugin in your C<dist.ini>. |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
=over 4 |
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
=item Moo |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
Require 2.x as this fixes the bug where fatal warnings was |
270
|
|
|
|
|
|
|
enabled. |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
=item PerlX::Maybe |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
Require 0.003 |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
=item AnyEvent::Open3::Simple |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
Require 0.76 for new stdin style |
279
|
|
|
|
|
|
|
Require 0.83 for deprecation removals |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
=item Path::Class |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
Require 0.26 for spew |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
=item Mojolicious |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
Require 4.31 |
288
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
=item Role::Tiny |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
Require 1.003001. See rt#83248 |
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
=item JSON::XS |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
Recommended if JSON is required. |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
=item PerlX::Maybe::XS |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
Recommended if PerlX::Maybe is required. |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
=item EV |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
Recommended if Mojolicious or AnyEvent modules are required. |
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
=item Test::Exit |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
Require 0.11 for dealing with C<exit> inside and C<eval>. |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
=back |
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
=head1 SEE ALSO |
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
=over 4 |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
=item L<Dist::Zilla> |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
=item L<Dist::Zilla::PluginBundle::Author::Plicease> |
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
=back |
320
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
=head1 AUTHOR |
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
Graham Ollis <plicease@cpan.org> |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
326
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
This software is copyright (c) 2017 by Graham Ollis. |
328
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
330
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
=cut |