blib/lib/ExtUtils/Builder/MakeMaker.pm

filter: Statementstmt 87.5% 77 / 88 Branchbran 66.6% 8 / 12 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 54.5% 12 / 22 Podpod 100% 1 / 1 totaltotal 77.3% 99 / 128 CC 10 SCAR 10.9
CC
10
Cov
83%
postamble
9.2
import
2.0
__ANON__
2.0
CRAP 3.0
« blib/lib/ExtUtils/Builder/Node.pm ↑ Summary blib/lib/ExtUtils/Builder/Planner/Extension.pm »
1 package ExtUtils::Builder::MakeMaker;
2 2 $ExtUtils::Builder::MakeMaker::VERSION = '0.020';
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our @ISA;
7  
8 2 ▶use ExtUtils::MakeMaker 6.68;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use ExtUtils::Builder::Planner;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use ExtUtils::Builder::Util 'unix_to_native_path';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use ExtUtils::Config::MakeMaker;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use ExtUtils::Manifest ();
Subroutine BEGIN: called CC=1 SCAR=0.0
13 2 ▶use version ();
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 ▶sub import {
Subroutine import: called CC=2 SCAR=7.0
16 1 my ($class, @args) = @_;
17 1 ▶ if (!MM->isa(__PACKAGE__)) {
Branch: 1 branch
BranchTrueFalseTotal
unless ("MM"->isa(__PACKAGE__)) 1 0 1
18 1 @ISA = @MM::ISA;
19 1 @MM::ISA = __PACKAGE__;
20 1 splice @ExtUtils::MakeMaker::Overridable, -1, 0, 'make_plans';
21 }
22 1 return;
23 }
24  
25 2 ▶my $escape_command = sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
26 2 my ($maker, $elements) = @_;
27 2 ▶ return join ' ', map { (my $temp = m{[^\w/\$().-]} ? $maker->quote_literal($_) : $_) =~ s/\n/\\\n\t/g; $temp } @{$elements};
Branch: 1 branch
BranchTrueFalseTotal
m[[^\w/\$().-]] ? : 1 4 5
28 2 };
29  
30 2 my %double_colon = map { $_ => 1 } qw/all pure_all subdirs config dynamic static clean distdir test install/;
31 2 ▶my $make_entry = sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
32 2 my ($maker, $target, $dependencies, $actions) = @_;
33 2 my @commands = map { $maker->$escape_command($_) } map { $_->to_command(perl => '$(ABSPERLRUN)') } @{$actions};
34 2 my @dependencies = map { $maker->quote_dep($_) } @{$dependencies};
35 2 ▶ my $colon = $double_colon{$target} ? '::' : ':';
Branch: 1 branch
BranchTrueFalseTotal
$double_colon{$target} ? : 1 1 2
36 2 return join "\n\t", join(' ', $target, $colon, @dependencies), @commands;
37 2 };
38  
39 1 ▶sub postamble {
Subroutine postamble: called CC=7 SCAR=22.2
Pod documented
40 1 my ($maker, %args) = @_;
41 1 my @ret = split "\n\n", $maker->SUPER::postamble(%args);
42  
43 1 my $planner = ExtUtils::Builder::Planner->new;
44 0 ▶ $planner->add_delegate('makemaker', sub { $maker });
Subroutine __ANON__: not called CC=1 SCAR=1.2
45 1 $planner->load_extension('ExtUtils::Builder::CPAN::Tool');
46 1 my $config = ExtUtils::Config::MakeMaker->new($maker);
47 0 ▶ $planner->add_delegate('config', sub { $config });
Subroutine __ANON__: not called CC=1 SCAR=2.6
Subroutine config: not called CC=1 SCAR=2.6
48 0 ▶ $planner->add_delegate('distribution', sub { $maker->{DIST_NAME} });
Subroutine __ANON__: not called CC=1 SCAR=2.6
Subroutine distribution: not called CC=1 SCAR=2.6
49 0 ▶ $planner->add_delegate('version', sub { version->new($maker->{VERSION}) });
Subroutine __ANON__: not called CC=1 SCAR=1.2
50 0 ▶ $planner->add_delegate('main_module', sub { $maker->{NAME} });
Subroutine __ANON__: not called CC=1 SCAR=1.2
51 0 ▶ $planner->add_delegate('pureperl_only', sub { $maker->{PUREPERL_ONLY} });
Subroutine __ANON__: not called CC=1 SCAR=1.2
52 0 ▶ $planner->add_delegate('perl_path', sub { $maker->{ABSPERLRUN} });
Subroutine __ANON__: not called CC=1 SCAR=1.2
53 0 ▶ $planner->add_delegate('uninst', sub { $maker->{UNINST} });
Subroutine __ANON__: not called CC=1 SCAR=1.2
54  
55 1 $planner->add_seen(unix_to_native_path($_)) for sort keys %{ ExtUtils::Manifest::maniread() };
56  
57 1 ▶ $maker->make_plans($planner, %args) if $maker->can('make_plans');
Branch: 1 branch
BranchTrueFalseTotal
if $maker->can("make_plans") 1 0 1
58 1 for my $file (glob 'planner/*.pl') {
59 0 $planner->new_scope->run_dsl($file);
60 }
61  
62 1 my $plan = $planner->materialize;
63 1 push @ret, map { $maker->$make_entry($_->target, [ $_->dependencies ], [ $_ ]) } $plan->nodes;
64  
65 1 ▶ if ($maker->is_make_type('gmake') || $maker->is_make_type('bsdmake')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($maker->is_make_type("gmake") or $maker->is_make_type("bsdmake")) 1 0 1
Condition33%1/3
$maker->is_make_type("gmake") or $maker->is_make_type("bsdmake")
l!l&&r!l&&!r
100
MC/DC0%0/2
$maker->is_make_type("gmake") or $maker->is_make_type("bsdmake")
$maker->is_make_type("gmake") $maker->is_make_type("bsdmake")
Truth table33%1/3
A or B
A= $maker->is_make_type("gmake")B= $maker->is_make_type("bsdmake")
ABresult
1X1
011
000
66 1 my @phonies = grep { !$double_colon{$_} } $plan->phonies;
67 1 ▶ push @ret, $maker->$make_entry('.PHONY', \@phonies) if @phonies
Branch: 1 branch
BranchTrueFalseTotal
if @phonies 0 1 1
68 }
69  
70 1 return join "\n\n", @ret;
71 }
72  
73 2 1;
74  
75 #ABSTRACT: A MakeMaker consumer for ExtUtils::Builder Plan objects
76  
77 __END__
« blib/lib/ExtUtils/Builder/Node.pm ↑ Summary blib/lib/ExtUtils/Builder/Planner/Extension.pm »