line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Minilla::ModuleMaker::ExtUtilsMakeMaker; |
2
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
4
|
1
|
|
|
1
|
|
5
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
5
|
1
|
|
|
1
|
|
24
|
use Data::Section::Simple qw(get_data_section); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
48
|
|
6
|
1
|
|
|
1
|
|
5
|
use Text::MicroTemplate qw(render_mt); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
33
|
|
7
|
1
|
|
|
1
|
|
14
|
use Data::Dumper; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
54
|
|
8
|
1
|
|
|
1
|
|
6
|
use File::Spec::Functions qw(catdir rel2abs); |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
55
|
|
9
|
1
|
|
|
1
|
|
6
|
use File::Find (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
15
|
|
10
|
1
|
|
|
1
|
|
5
|
use TAP::Harness::Env; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
11
|
1
|
|
|
1
|
|
6
|
use Cwd; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
57
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# This module is EXPERIMENTAL. |
14
|
|
|
|
|
|
|
# You can use this. But I may change the behaviour... |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
7
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
346
|
no Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
261
|
use Minilla::Util qw(spew_raw); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
679
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub generate { |
23
|
0
|
|
|
0
|
0
|
|
my ($self, $project) = @_; |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
local $Data::Dumper::Terse = 1; |
26
|
0
|
|
|
|
|
|
local $Data::Dumper::Useqq = 1; |
27
|
0
|
|
|
|
|
|
local $Data::Dumper::Purity = 1; |
28
|
0
|
|
|
|
|
|
local $Data::Dumper::Indent = 1; |
29
|
0
|
|
|
|
|
|
local $Data::Dumper::Sortkeys = 1; |
30
|
0
|
|
|
|
|
|
my $content = get_data_section('Makefile.PL'); |
31
|
0
|
|
|
0
|
|
|
my $mt = Text::MicroTemplate->new(template => $content, escape_func => sub { $_[0] }); |
|
0
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
my $src = $mt->build->($project); |
33
|
0
|
|
|
|
|
|
spew_raw('Makefile.PL', $src); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub prereqs { |
37
|
0
|
|
|
0
|
0
|
|
my ($self, $project) = @_; |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
my %configure_requires = ( |
40
|
|
|
|
|
|
|
'ExtUtils::MakeMaker' => $self->_eumm_minimum_version($project), |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
my $prereqs = +{ |
44
|
|
|
|
|
|
|
configure => { |
45
|
|
|
|
|
|
|
requires => { |
46
|
|
|
|
|
|
|
%configure_requires, |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
}; |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
for my $key (qw(tap_harness_args use_xsutil c_source allow_pureperl requires_external_bin)) { |
52
|
0
|
0
|
|
|
|
|
if( $project->$key ){ |
53
|
0
|
|
|
|
|
|
die "$key does not supported by " . __PACKAGE__; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
} |
56
|
0
|
|
|
|
|
|
return $prereqs; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub _eumm_minimum_version { |
60
|
0
|
|
|
0
|
|
|
my ($self, $project) = @_; |
61
|
|
|
|
|
|
|
|
62
|
0
|
0
|
|
|
|
|
if (@{ $project->unsupported->os }) { |
|
0
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
return '7.26'; # os_unsupported |
64
|
|
|
|
|
|
|
} |
65
|
0
|
|
|
|
|
|
return '6.64'; # TEST_REQUIRES (and MYMETA) |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub run_tests { |
69
|
|
|
|
|
|
|
my $harness = TAP::Harness::Env->create({ |
70
|
|
|
|
|
|
|
verbosity => 0, |
71
|
0
|
|
|
0
|
0
|
|
lib => [ map { rel2abs(catdir(qw/blib/, $_), cwd) } qw/arch lib/ ], |
|
0
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
color => -t STDOUT |
73
|
|
|
|
|
|
|
}); |
74
|
0
|
|
|
|
|
|
my @tests = sort +_find(qr/\.t$/, 't'); |
75
|
0
|
0
|
|
|
|
|
if ($ENV{RELEASE_TESTING}) { |
76
|
0
|
|
|
|
|
|
push @tests, sort +_find(qr/\.t$/, 'xt'); |
77
|
|
|
|
|
|
|
} |
78
|
0
|
0
|
|
|
|
|
$harness->runtests(@tests)->has_errors and die; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub _find { |
82
|
0
|
|
|
0
|
|
|
my ($pattern, $dir) = @_; |
83
|
0
|
|
|
|
|
|
my @ret; |
84
|
0
|
0
|
0
|
0
|
|
|
File::Find::find(sub { push @ret, $File::Find::name if /$pattern/ && -f }, $dir) if -d $dir; |
|
0
|
0
|
|
|
|
|
|
85
|
0
|
|
|
|
|
|
return @ret; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
1; |
89
|
|
|
|
|
|
|
__DATA__ |