line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
2918459
|
use 5.006; # our |
|
1
|
|
|
|
|
3
|
|
2
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
3
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
72
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package inc::My::NeoMakeMaker; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: An example MakeMaker with Beam |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# AUTHORITY |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
6
|
use Moose qw( around extends with has ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
12
|
|
|
|
|
|
|
extends 'Dist::Zilla::Plugin::MakeMaker'; |
13
|
|
|
|
|
|
|
with 'Beam::Emitter'; |
14
|
1
|
|
|
1
|
|
6353
|
use List::Util qw( first ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
725
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# PS: This example shows exactly how much you need to piss around with EUMM |
17
|
|
|
|
|
|
|
# just to get some basic stuff done. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has 'static_attribution' => ( |
20
|
|
|
|
|
|
|
isa => 'Bool', |
21
|
|
|
|
|
|
|
is => 'ro', |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
around write_makefile_args => sub { |
25
|
|
|
|
|
|
|
my ( $orig, $self, @args ) = @_; |
26
|
|
|
|
|
|
|
my $args = $self->$orig(@args); |
27
|
|
|
|
|
|
|
my $event = $_[1]->emit( |
28
|
|
|
|
|
|
|
'augment_makefile_args' => class => 'My::MakeMaker::Args', |
29
|
|
|
|
|
|
|
args => $args |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
return $event->args; |
32
|
|
|
|
|
|
|
}; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
my $template = q!# This file was automatically generated by {{ $generated_by }}. |
35
|
|
|
|
|
|
|
use strict; |
36
|
|
|
|
|
|
|
use warnings; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
{{ $perl_prereq ? qq[use $perl_prereq;] : ''; }} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
use ExtUtils::MakeMaker{{ defined $eumm_version && 0+$eumm_version ? ' ' . $eumm_version : '' }}; |
41
|
|
|
|
|
|
|
{{ $share_dir_code{preamble} || '' }} |
42
|
|
|
|
|
|
|
my {{ $WriteMakefileArgs }} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
my {{ $fallback_prereqs }} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
XXXPRELUDEXXX |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { |
49
|
|
|
|
|
|
|
delete $WriteMakefileArgs{TEST_REQUIRES}; |
50
|
|
|
|
|
|
|
delete $WriteMakefileArgs{BUILD_REQUIRES}; |
51
|
|
|
|
|
|
|
$WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
delete $WriteMakefileArgs{CONFIGURE_REQUIRES} |
55
|
|
|
|
|
|
|
unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
WriteMakefile(%WriteMakefileArgs); |
58
|
|
|
|
|
|
|
{{ $share_dir_code{postamble} || '' }}!; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub gather_files { |
61
|
1
|
|
|
1
|
0
|
146312
|
my ($self) = @_; |
62
|
|
|
|
|
|
|
|
63
|
1
|
|
|
|
|
8
|
require Dist::Zilla::File::InMemory; |
64
|
|
|
|
|
|
|
|
65
|
1
|
|
|
|
|
6
|
my $event = |
66
|
|
|
|
|
|
|
$self->emit( 'generate_prelude', class => 'My::MakeMaker::Prelude' ); |
67
|
|
|
|
|
|
|
|
68
|
1
|
|
|
|
|
81
|
$self->log_debug( [ "Prelude was <%s>", $event->prelude ] ); |
69
|
1
|
|
|
|
|
260
|
my $templ = $template; |
70
|
1
|
|
|
|
|
6
|
$templ =~ s{XXXPRELUDEXXX}{ $event->prelude }sex; |
|
1
|
|
|
|
|
30
|
|
71
|
|
|
|
|
|
|
|
72
|
1
|
|
|
|
|
31
|
my $file = Dist::Zilla::File::InMemory->new( |
73
|
|
|
|
|
|
|
{ |
74
|
|
|
|
|
|
|
name => 'Makefile.PL', |
75
|
|
|
|
|
|
|
content => $templ, # template evaluated later |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
); |
78
|
|
|
|
|
|
|
|
79
|
1
|
|
|
|
|
298
|
$self->add_file($file); |
80
|
1
|
|
|
|
|
491
|
return; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub setup_installer { |
84
|
1
|
|
|
1
|
0
|
65278
|
my ($self) = @_; |
85
|
|
|
|
|
|
|
|
86
|
1
|
|
|
|
|
6
|
my $write_makefile_args = $self->write_makefile_args; |
87
|
|
|
|
|
|
|
|
88
|
1
|
|
|
|
|
29
|
$self->__write_makefile_args($write_makefile_args); # save for testing |
89
|
|
|
|
|
|
|
|
90
|
1
|
|
|
|
|
8
|
my $perl_prereq = $write_makefile_args->{MIN_PERL_VERSION}; |
91
|
|
|
|
|
|
|
|
92
|
1
|
|
|
|
|
6
|
my $dumped_args = |
93
|
|
|
|
|
|
|
$self->_dump_as( $write_makefile_args, '*WriteMakefileArgs' ); |
94
|
|
|
|
|
|
|
|
95
|
1
|
|
|
8
|
|
155
|
my $file = first { $_->name eq 'Makefile.PL' } @{ $self->zilla->files }; |
|
8
|
|
|
|
|
221
|
|
|
1
|
|
|
|
|
54
|
|
96
|
|
|
|
|
|
|
|
97
|
1
|
|
|
|
|
38
|
$self->log_debug( ['updating contents of Makefile.PL in memory'] ); |
98
|
|
|
|
|
|
|
|
99
|
1
|
50
|
50
|
|
|
438
|
my $attribution = |
100
|
|
|
|
|
|
|
$self->static_attribution |
101
|
|
|
|
|
|
|
? ref($self) |
102
|
|
|
|
|
|
|
: sprintf( "%s v%s", ref($self), $self->VERSION || '(dev)' ); |
103
|
|
|
|
|
|
|
|
104
|
1
|
|
|
|
|
32
|
my $event = $self->emit( |
105
|
|
|
|
|
|
|
'augment_template_args', |
106
|
|
|
|
|
|
|
class => 'My::MakeMaker::TemplateArgs', |
107
|
|
|
|
|
|
|
args => { |
108
|
|
|
|
|
|
|
eumm_version => \( $self->eumm_version ), |
109
|
|
|
|
|
|
|
perl_prereq => \$perl_prereq, |
110
|
|
|
|
|
|
|
share_dir_code => $self->share_dir_code, |
111
|
|
|
|
|
|
|
fallback_prereqs => \( $self->fallback_prereq_pm ), |
112
|
|
|
|
|
|
|
WriteMakefileArgs => \$dumped_args, |
113
|
|
|
|
|
|
|
generated_by => \$attribution, |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
); |
116
|
1
|
|
|
|
|
12
|
my $content = $self->fill_in_string( $file->content, $event->args, ); |
117
|
|
|
|
|
|
|
|
118
|
1
|
|
|
|
|
1524
|
$file->content($content); |
119
|
|
|
|
|
|
|
|
120
|
1
|
|
|
|
|
294
|
return; |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
124
|
1
|
|
|
1
|
|
7
|
no Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
package My::MakeMaker::Args; |
127
|
|
|
|
|
|
|
|
128
|
1
|
|
|
1
|
|
190
|
use Moose qw( extends has ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
6
|
|
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
extends 'Beam::Event'; |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
has 'args' => ( is => 'ro', required => 1 ); |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
135
|
|
|
|
|
|
|
|
136
|
1
|
|
|
1
|
|
5957
|
no Moose; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
7
|
|
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
package My::MakeMaker::Prelude; |
139
|
|
|
|
|
|
|
|
140
|
1
|
|
|
1
|
|
149
|
use Moose qw( extends has ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
6
|
|
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
extends 'Beam::Event'; |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
has 'prelude' => ( is => 'rw', default => '' ); |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
147
|
|
|
|
|
|
|
|
148
|
1
|
|
|
1
|
|
5699
|
no Moose; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
7
|
|
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
package My::MakeMaker::TemplateArgs; |
151
|
|
|
|
|
|
|
|
152
|
1
|
|
|
1
|
|
144
|
use Moose qw( extends has ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
extends 'Beam::Event'; |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
has 'args' => ( is => 'ro', required => 1 ); |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
159
|
|
|
|
|
|
|
|
160
|
1
|
|
|
1
|
|
5616
|
no Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
1; |