line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Minilla::ModuleMaker::ModuleBuild; |
2
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
4
|
1
|
|
|
1
|
|
5
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
5
|
1
|
|
|
1
|
|
25
|
use Data::Section::Simple qw(get_data_section); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
63
|
|
6
|
1
|
|
|
1
|
|
518
|
use Text::MicroTemplate qw(render_mt); |
|
1
|
|
|
|
|
3232
|
|
|
1
|
|
|
|
|
56
|
|
7
|
1
|
|
|
1
|
|
8
|
use Data::Dumper; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
8
|
1
|
|
|
1
|
|
7
|
use Minilla::Util qw(cmd_perl); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
5
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
320
|
no Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
232
|
use Minilla::Util qw(spew_raw); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
386
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub generate { |
17
|
0
|
|
|
0
|
0
|
|
my ($self, $project) = @_; |
18
|
|
|
|
|
|
|
|
19
|
0
|
0
|
|
|
|
|
Carp::croak('Usage: $module_maker->generate($project)') unless defined $project; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
local $Data::Dumper::Terse = 1; |
22
|
0
|
|
|
|
|
|
local $Data::Dumper::Useqq = 1; |
23
|
0
|
|
|
|
|
|
local $Data::Dumper::Purity = 1; |
24
|
0
|
|
|
|
|
|
local $Data::Dumper::Indent = 0; |
25
|
0
|
|
|
|
|
|
my $content = get_data_section('Build.PL'); |
26
|
0
|
|
|
0
|
|
|
my $mt = Text::MicroTemplate->new(template => $content, escape_func => sub { $_[0] }); |
|
0
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
my $src = $mt->build->($project); |
28
|
0
|
|
|
|
|
|
spew_raw('Build.PL', $src); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub prereqs { |
32
|
0
|
|
|
0
|
0
|
|
my ($self, $project) = @_; |
33
|
|
|
|
|
|
|
|
34
|
0
|
0
|
|
|
|
|
Carp::croak('Usage: $module_maker->prereqs($project)') unless defined $project; |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
my %configure_requires = ( |
37
|
|
|
|
|
|
|
'Module::Build' => 0.4005, # test_requires, --pureperl |
38
|
|
|
|
|
|
|
); |
39
|
0
|
0
|
0
|
|
|
|
if ($project->requires_external_bin && @{$project->requires_external_bin}) { |
|
0
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
$configure_requires{'Devel::CheckBin'} = 0; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
my $prereqs = +{ |
44
|
|
|
|
|
|
|
configure => { |
45
|
|
|
|
|
|
|
requires => { |
46
|
|
|
|
|
|
|
%configure_requires, |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
}; |
50
|
|
|
|
|
|
|
|
51
|
0
|
0
|
|
|
|
|
if( $project->use_xsutil ){ |
52
|
0
|
|
|
|
|
|
$prereqs->{configure}{requires}{'Module::Build::XSUtil'} = '0.03'; |
53
|
|
|
|
|
|
|
} |
54
|
0
|
|
|
|
|
|
return $prereqs; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub run_tests { |
58
|
0
|
|
|
0
|
0
|
|
cmd_perl('Build', 'test'); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |
62
|
|
|
|
|
|
|
__DATA__ |