line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Build::Pluggable::Base; |
2
|
7
|
|
|
7
|
|
32291
|
use strict; |
|
7
|
|
|
|
|
15
|
|
|
7
|
|
|
|
|
233
|
|
3
|
7
|
|
|
7
|
|
40
|
use warnings; |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
182
|
|
4
|
7
|
|
|
7
|
|
8519
|
use utf8; |
|
7
|
|
|
|
|
30
|
|
|
7
|
|
|
|
|
42
|
|
5
|
7
|
|
|
7
|
|
8104
|
use Class::Method::Modifiers qw/install_modifier/; |
|
7
|
|
|
|
|
12166
|
|
|
7
|
|
|
|
|
976
|
|
6
|
|
|
|
|
|
|
use Class::Accessor::Lite ( |
7
|
7
|
|
|
|
|
141
|
ro => [qw/builder/] |
8
|
7
|
|
|
7
|
|
7877
|
); |
|
7
|
|
|
|
|
17127
|
|
9
|
7
|
|
|
7
|
|
7003
|
use Module::Build::Pluggable::Util; |
|
7
|
|
|
|
|
15
|
|
|
7
|
|
|
|
|
2221
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
15
|
|
|
15
|
0
|
33
|
my $class = shift; |
13
|
15
|
|
|
|
|
67
|
my %args = @_; |
14
|
15
|
|
|
|
|
190
|
bless { %args }, $class; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub builder_class { |
18
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
19
|
0
|
|
|
|
|
0
|
my $builder = $self->builder; |
20
|
0
|
0
|
|
|
|
0
|
$builder = ref $builder if ref $builder; |
21
|
0
|
|
|
|
|
0
|
return $builder; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub add_before_action_modifier { |
26
|
0
|
|
|
0
|
1
|
0
|
my ($self, $target, $code) = @_; |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
0
|
my $builder = $self->builder_class; |
29
|
0
|
0
|
|
|
|
0
|
unless ($builder) { |
30
|
0
|
|
|
|
|
0
|
Carp::confess("You can call add_before_action_modifier method from HOOK_build method only."); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
0
|
install_modifier($builder, 'before', "ACTION_$target", $code); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub add_around_action_modifier { |
38
|
0
|
|
|
0
|
1
|
0
|
my ($self, $target, $code) = @_; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
0
|
my $builder = $self->builder_class; |
41
|
0
|
0
|
|
|
|
0
|
unless ($builder) { |
42
|
0
|
|
|
|
|
0
|
Carp::confess("You can call add_around_action_modifier method from HOOK_build method only."); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
0
|
install_modifier($builder, 'around', "ACTION_$target", $code); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub add_action { |
50
|
0
|
|
|
0
|
1
|
0
|
my ($self, $name, $code) = @_; |
51
|
0
|
|
|
|
|
0
|
my $builder = $self->builder_class; |
52
|
0
|
0
|
|
|
|
0
|
unless ($builder) { |
53
|
0
|
|
|
|
|
0
|
Carp::confess("You can call add_action method from HOOK_build method only."); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
7
|
|
|
7
|
|
40
|
no strict 'refs'; |
|
7
|
|
|
|
|
15
|
|
|
7
|
|
|
|
|
3399
|
|
57
|
0
|
|
|
|
|
0
|
*{"$builder\::ACTION_$name"} = $code; |
|
0
|
|
|
|
|
0
|
|
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub build_requires { |
62
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
63
|
0
|
|
|
|
|
0
|
Module::Build::Pluggable::Util->add_prereqs($self->builder, 'build_requires', @_); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub configure_requires { |
68
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
69
|
0
|
|
|
|
|
0
|
Module::Build::Pluggable::Util->add_prereqs($self->builder, 'configure_requires', @_); |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub requires { |
73
|
3
|
|
|
3
|
0
|
14
|
my $self = shift; |
74
|
3
|
|
|
|
|
47
|
Module::Build::Pluggable::Util->add_prereqs($self->builder, 'requires', @_); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub add_extra_compiler_flags { |
78
|
1
|
|
|
1
|
0
|
8
|
my ($self, @flags) = @_; |
79
|
1
|
|
|
|
|
29
|
$self->builder->extra_compiler_flags(@{$self->builder->extra_compiler_flags}, @flags); |
|
1
|
|
|
|
|
17
|
|
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
0
|
|
|
0
|
1
|
|
sub log_warn { shift->builder->log_warn(@_) } |
83
|
0
|
|
|
0
|
1
|
|
sub log_info { shift->builder->log_info(@_) } |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub can_run { |
88
|
0
|
|
|
0
|
0
|
|
my ($self, $cmd) = @_; |
89
|
0
|
|
|
|
|
|
require ExtUtils::MakeMaker; |
90
|
|
|
|
|
|
|
|
91
|
0
|
|
|
|
|
|
my $_cmd = $cmd; |
92
|
0
|
0
|
0
|
|
|
|
return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd)); |
93
|
|
|
|
|
|
|
|
94
|
0
|
|
|
|
|
|
for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { |
95
|
0
|
0
|
|
|
|
|
next if $dir eq ''; |
96
|
0
|
|
|
|
|
|
require File::Spec; |
97
|
0
|
|
|
|
|
|
my $abs = File::Spec->catfile($dir, $cmd); |
98
|
0
|
0
|
0
|
|
|
|
return $abs if (-x $abs or $abs = MM->maybe_command($abs)); |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
0
|
|
|
|
|
|
return; |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
1; |
105
|
|
|
|
|
|
|
__END__ |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 NAME |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Module::Build::Pluggable::Base - Base object for plugins |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 SYNOPSIS |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
package My::Module::Build::Plugin; |
114
|
|
|
|
|
|
|
use parent qw/Module::Build::Pluggable::Base/; |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 DESCRIPTION |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
This is a abstract base class for Module::Build::Pluggable. |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head1 METHODS |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=over 4 |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=item $self->builder_class() : Str |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Get a class name for Module::Build's subclass. |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
You cannot call this method in C<HOOK_prepare> and B<HOOK_configure> phase. |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=item $self->add_before_action_modifier($action_name: Str, $callback: Code) |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
$self->add_before_action_modifier('build' => \&code); |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
Add a 'before' action method modifier. |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
You need to call this method in C<HOOK_build> phase. |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=item $self->add_around_action_modifier($action_name: Str, $callback: Code) |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
$self->add_around_action_modifier('build' => \&code); |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
Add a 'around' action method modifier. |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
You need to call this method in C<HOOK_build> phase. |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=item $self->add_action($action_name: Str, $callback: Code) |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
Add a new action for Module::Build. |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
You need to call this method in C<HOOK_build> phase. |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=item $self->build_requires($module_name:Str[, $version:Str]) |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
Add a build dependencies. |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
You need to call this method in C<HOOK_configure> phase. |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=item $self->configure_requires($module_name:Str[, $version:Str]) |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
Add a configure dependencies. |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
You need to call this method in C<HOOK_configure> phase. |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=item C<< $self->log_info($msg: Str) >> |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
Output log in INFO level. |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=item C<< $self->log_warn($msg: Str) >> |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
Output log in WARN level. |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=back |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
|