| 1 | package ShipIt::ProjectType::Perl::MakeMaker; | ||||||||||||||||||||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use base 'ShipIt::ProjectType::Perl'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use ExtUtils::Manifest qw(manicheck skipcheck filecheck); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use ShipIt::Util qw(make_var); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use Config; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 2 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=5 SCAR=17.5
Pod
undocumented
| |||||||||||||||||||||||||||||
| 9 | 2 | my ($class) = @_; | |||||||||||||||||||||||||||
| 10 | 2 | my $self = $class->SUPER::new; | |||||||||||||||||||||||||||
| 11 | 2 | ▶ | my $make = $Config{make} or die "You don't have make"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 12 | 2 | ▶ | my $quot = $^O eq 'MSWin32' ? q/"/ : q/'/; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 13 | 2 | ▶ | $make = "$quot$make$quot" if $make =~ /\s/ && $make !~ /^$quot/; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$make =~ /\s/ and not $make =~ /^$quot/
MC/DC0%0/2
$make =~ /\s/ and not $make =~ /^$quot/
$make =~ /\s/
not $make =~ /^$quot/
Truth table33%1/3
A and not(B)
A= $make =~ /\s/B= not $make =~ /^$quot/
| |||||||||||||||||||||||||||||
| 14 | 2 | $self->{make} = $make; | |||||||||||||||||||||||||||
| 15 | 2 | return $self; | |||||||||||||||||||||||||||
| 16 | } | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 0 | ▶ | sub prepare_build { | ||||||||||||||||||||||||||
|
Subroutine
prepare_build: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 19 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 20 | 0 | ▶ | system("perl", "Makefile.PL") and die "Makefile.PL failed"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 0 | ▶ | sub run_build { | ||||||||||||||||||||||||||
|
Subroutine
run_build: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 24 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 25 | 0 | my($cmd) = @_; | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 0 | !system($self->{make}, $cmd); | |||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | # returns 1 if a make disttest succeeds. | ||||||||||||||||||||||||||||
| 31 | 0 | ▶ | sub disttest { | ||||||||||||||||||||||||||
|
Subroutine
disttest: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||
| 32 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 0 | $self->prepare_build; | |||||||||||||||||||||||||||
| 35 | 0 | ▶ | $self->run_build('disttest') or die "Disttest failed"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 36 | 0 | ▶ | $self->run_build('distclean') or die "Distclean failed"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 0 | my @missing = manicheck; | |||||||||||||||||||||||||||
| 39 | 0 | my @extra = filecheck; | |||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | # Module::Install creates inc/ in perl Makefile.PL and META.yml in make | ||||||||||||||||||||||||||||
| 42 | 0 | my $missing_ignore = join "|", qw( ^META\.yml$ ^inc/ ); | |||||||||||||||||||||||||||
| 43 | 0 | @missing = grep { $_ !~ $missing_ignore } @missing; | |||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | # I'm getting sick of making MANIFEST.SKIP files just for the | ||||||||||||||||||||||||||||
| 46 | # .shipit conf file and dh-make-perl stuff, so let's ignore those | ||||||||||||||||||||||||||||
| 47 | 0 | my %ignore = map { $_ => 1 } qw( | |||||||||||||||||||||||||||
| 48 | .shipit | ||||||||||||||||||||||||||||
| 49 | install-stamp | ||||||||||||||||||||||||||||
| 50 | build-stamp | ||||||||||||||||||||||||||||
| 51 | ); | ||||||||||||||||||||||||||||
| 52 | 0 | ▶ | @extra = grep { ! ($ignore{$_} || /^\.git/) } @extra; | ||||||||||||||||||||||||||
|
Condition0%0/3
$ignore{$_} || /^\.git/
MC/DC0%0/2
$ignore{$_} || /^\.git/
$ignore{$_}
/^\.git/
Truth table0%0/3
A || B
A= $ignore{$_}B= /^\.git/
| |||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | 0 | ▶ | my $list = sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 55 | 0 | join('', map { "$_\n" } @_); | |||||||||||||||||||||||||||
| 56 | 0 | }; | |||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | 0 | ▶ | die "Missing files in MANIFEST, not on disk:\n\n" . $list->(@missing) if @missing; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 59 | 0 | ▶ | die "Extra files on disk, not in MANIFEST:\n\n" . $list->(@extra) if @extra; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | 0 | return 1; | |||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | 0 | ▶ | sub makedist { | ||||||||||||||||||||||||||
|
Subroutine
makedist: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||
| 65 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 66 | 0 | $self->prepare_build; | |||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | 0 | ▶ | my $file = make_var("DISTVNAME") or die "No DISTVNAME in Makefile"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 69 | 0 | $file .= ".tar.gz"; | |||||||||||||||||||||||||||
| 70 | 0 | ▶ | die "Distfile $file already exists.\n" if -e $file; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | 0 | ▶ | $self->run_build("dist") or die "make dist failed"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 73 | 0 | ▶ | die "Distfile $file doesn't exists, but should.\n" unless -e $file; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 74 | 0 | return $file; | |||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | 2 | 1; | |||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||