1
1
use strict; # satisfy linter
2
2
use warnings; # satisfy linter
3
3
4
+ =pod
5
+
6
+ Semantic sugar to simplify management of modules which changed their required Perl version
7
+ (directly or via dependencies)
8
+
9
+ requires_by_perl Module,
10
+ prior 5.010 => 'use version X',
11
+ prior 5.012 => 'use version Y',
12
+ otherwise do_not_install
13
+ ;
14
+
15
+ =cut
16
+
17
+ sub requires_by_perl {
18
+ my @requires = (shift );
19
+
20
+ while (@_ ) {
21
+ shift , next
22
+ unless @_ == 1 || $] < shift
23
+ ;
24
+
25
+ push @requires , shift // return ;
26
+ last ;
27
+ }
28
+
29
+ requires @requires ;
30
+ }
31
+
32
+ sub prior { @_ }
33
+ sub otherwise { @_ }
34
+ sub do_not_install { undef }
35
+
36
+ requires_by_perl ' Pod::Man' ,
37
+ prior 5.010 => ' ==4.14' ,
38
+ prior 5.012 => ' ==5.01' ,
39
+ ;
40
+
4
41
# Last versions which install on < 5.12
5
42
if ( " $] " < 5.012 ) {
6
43
requires ' Data::Section' , ' ==0.200007' ;
@@ -16,11 +53,9 @@ else {
16
53
}
17
54
18
55
if ( " $] " >= 5.010 ) {
19
- requires ' Pod::Man' , ' >= 5.00' ;
20
56
requires ' Perl::Critic' , ' >= 1.144' ;
21
57
}
22
58
else {
23
- requires ' Pod::Man' , ' ==4.14' ;
24
59
requires ' Perl::Critic' , ' ==1.142' ;
25
60
}
26
61
@@ -42,7 +77,6 @@ requires 'Test::Differences';
42
77
requires ' Test::EOL' ;
43
78
requires ' Test::Fatal' ;
44
79
requires ' Test::MinimumVersion' ;
45
- requires ' Test::MockModule' ;
46
80
requires ' Test::Mojibake' ;
47
81
requires ' Test::More' ;
48
82
requires ' Test::Needs' ;
@@ -58,19 +92,32 @@ requires 'Test::Synopsis';
58
92
requires ' Test::Version' ;
59
93
requires ' Test::Warnings' ;
60
94
95
+ requires_by_perl ' Devel::Cover' ,
96
+ prior 5.010 => do_not_install,
97
+ prior 5.012 => ' ==1.42' ,
98
+ ;
99
+
100
+ requires_by_perl ' Test::MockModule' ,
101
+ prior 5.012 => ' ==0.178' ,
102
+ ;
103
+
104
+ requires_by_perl ' Test2::Harness' ,
105
+ prior 5.010 => do_not_install,
106
+ prior 5.014 => ' ==1.000156' ,
107
+ ;
108
+
109
+ requires_by_perl ' Test2::Harness::Renderer::JUnit' ,
110
+ prior 5.010001 => do_not_install,
111
+ prior 5.014 => ' ==1.000005' ,
112
+ ;
113
+
61
114
if ( " $] " >= 5.010 ) {
62
- requires ' Devel::Cover' ;
63
115
requires ' Devel::Cover::Report::Codecov' ;
64
116
requires ' Devel::Cover::Report::Coveralls' ;
65
117
requires ' Minilla' ;
66
- requires ' Test2::Harness' ;
67
118
requires ' Test::Vars' ;
68
119
}
69
120
70
- if ( " $] " >= 5.010001 ) {
71
- requires ' Test2::Harness::Renderer::JUnit' ;
72
- }
73
-
74
121
if ( " $] " >= 5.012 ) {
75
122
requires ' Code::TidyAll::Plugin::SortLines::Naturally' ;
76
123
requires ' Code::TidyAll::Plugin::Test::Vars' ;
@@ -88,12 +135,12 @@ if ( "$]" >= 5.020 ) {
88
135
requires ' Dist::Zilla::PluginBundle::DROLSKY' ;
89
136
requires ' Dist::Zilla::PluginBundle::Milla' ;
90
137
91
- if ( " $] " < 5.026 ) {
92
- requires ' Dist::Zilla::PluginBundle::RJBS ' , ' ==5.023 ' ;
93
- }
94
- else {
95
- requires ' Dist::Zilla::PluginBundle::RJBS ' ;
96
- }
138
+ requires_by_perl ' Dist::Zilla::PluginBundle::RJBS ' ,
139
+ prior 5. 020 => do_not_install,
140
+ prior 5. 026 => ' ==5.023 ' ,
141
+ prior 5. 034 => ' ==5.025 ' ,
142
+ otherwise ' >5.028 ' # 5.028 requires v5.36 whereas following versions only v5.34, so omit it
143
+ ;
97
144
98
145
requires ' Dist::Zilla::PluginBundle::Starter::Git' ;
99
146
requires ' Dist::Zilla::Plugin::CheckChangeLog' ;
0 commit comments