| 1 | package Dist::Zilla::Plugin::Alien; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 7 | our $AUTHORITY = 'cpan:GETTY'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # ABSTRACT: Use Alien::Base with Dist::Zilla | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 7 | $Dist::Zilla::Plugin::Alien::VERSION = '0.024'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 7 | ▶ | use Moose; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 7 | ▶ | use Data::Dumper; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 7 | extends 'Dist::Zilla::Plugin::ModuleBuild'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 7 | with 'Dist::Zilla::Role::PrereqSource', 'Dist::Zilla::Role::FileGatherer', 'Dist::Zilla::Role::MetaProvider'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 7 | ▶ | use URI; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 7 | has name => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | isa => 'Str', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | lazy_build => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 11 | ▶ | sub _build_name { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_name: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 11 | my ( $self ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 11 | my $name = $self->zilla->name; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 11 | $name =~ s/^Alien-//g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 11 | return $name; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 7 | has bins => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | isa => 'Str', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | predicate => 'has_bins', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 7 | has split_bins => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | isa => 'ArrayRef', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | lazy_build => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 11 | ▶ | sub _build_split_bins { $_[0]->has_bins ? [split(/\s+/,$_[0]->bins)] : [] } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_split_bins: called CC=2 SCAR=7.6
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 7 | has repo => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | isa => 'Str', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | required => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 7 | has repo_uri => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | isa => 'URI', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | lazy_build => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 11 | ▶ | sub _build_repo_uri { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_repo_uri: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 11 | my ( $self ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 11 | URI->new($self->repo); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 7 | has pattern_prefix => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | isa => 'Str', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | lazy_build => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 11 | ▶ | sub _build_pattern_prefix { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_pattern_prefix: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 11 | my ( $self ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 11 | return $self->name.'-'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 7 | has pattern_version => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | isa => 'Str', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | lazy_build => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 11 | ▶ | sub _build_pattern_version { '([\d\.]+)' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_pattern_version: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 7 | has pattern_suffix => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | isa => 'Str', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | lazy_build => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 11 | ▶ | sub _build_pattern_suffix { '\\.tar\\.gz' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_pattern_suffix: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 7 | has pattern => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | isa => 'Str', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | lazy_build => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 11 | ▶ | sub _build_pattern { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_pattern: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 11 | my ( $self ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 11 | join("", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | $self->pattern_prefix. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | $self->pattern_version. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | $self->pattern_suffix | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 7 | has exact_filename => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | isa => 'Str', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 7 | has build_command => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | isa => 'ArrayRef[Str]', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 7 | has install_command => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | isa => 'ArrayRef[Str]', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 7 | has test_command => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | isa => 'ArrayRef[Str]', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 7 | has isolate_dynamic => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | isa => 'Int', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 7 | has autoconf_with_pic => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | isa => 'Int', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | has inline_auto_include => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | isa => 'ArrayRef[Str]', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 10 | ▶ | default => sub { [] }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 7 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 7 | has msys => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | isa => 'Int', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | has bin_requires => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | isa => 'ArrayRef[Str]', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 10 | ▶ | default => sub { [] }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 7 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 39 | ▶ | sub _bin_requires_hash { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_bin_requires_hash: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 39 | my($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 39 | ▶ | my %bin_requires = map { /^\s*(.*?)\s*=\s*(.*)\s*$/ ? ($1 => $2) : ($_ => 0) } @{ $self->bin_requires }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 39 | \%bin_requires; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | has helper => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | isa => 'ArrayRef[Str]', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 11 | ▶ | default => sub { [] }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 7 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 28 | ▶ | sub _helper_hash { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_helper_hash: called CC=2 SCAR=8.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 28 | my($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | ▶ | my %helper = map { /^\s*(.*?)\s*=\s*(.*)\s*$/ ? ($1 => $2) : ($_ => '') } @{ $self->helper }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 28 | \%helper; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | has env => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | isa => 'ArrayRef[Str]', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 10 | ▶ | default => sub { [] }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 7 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 28 | ▶ | sub _env_hash { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_env_hash: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 28 | my($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | my %env = map { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 4 | ▶ | /^\s*(.*?)\s*=\s*(.*)\s*$/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | ? ($1 => $2) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | : $self->log_fatal("Please specify a value for $_") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 28 | } @{ $self->env }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 28 | \%env; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 7 | has stage_install => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | isa => 'Int', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 7 | has provides_cflags => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | isa => 'Str', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 7 | has provides_libs => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | isa => 'Str', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 7 | has version_check => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | isa => 'Str', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | is => 'rw', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | # multiple build/install commands return as an arrayref | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 12 | ▶ | around mvp_multivalue_args => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 12 | my ($orig, $self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | 12 | return ($self->$orig, 'build_command', 'install_command', 'test_command', 'inline_auto_include', 'bin_requires', 'helper', 'env'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 7 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 11 | ▶ | sub register_prereqs { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
register_prereqs: called CC=21 SCAR=31.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 11 | my ( $self ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 11 | my $ab_version = '0.002'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 11 | ▶ | if(defined $self->isolate_dynamic || defined $self->autoconf_with_pic || grep /(?<!\%)\%c/, @{ $self->build_command || [] }) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition62%5/8
defined $self->isolate_dynamic or defined $self->autoconf_with_pic or grep /(?<!\%)\%c/, @{$self->build_command or [];}
defined $self->isolate_dynamic or defined $self->autoconf_with_pic
$self->build_command || []
MC/DC33%1/3
defined $self->isolate_dynamic or defined $self->autoconf_with_pic or grep /(?<!\%)\%c/, @{$self->build_command or [];}
defined $self->isolate_dynamic
defined $self->autoconf_with_pic
grep /(?<!\%)\%c/, @{$self->build_command or [];}
MC/DC100%1/1
$self->build_command || []
$self->build_command
Truth table50%2/4
A or B or C
A= defined $self->isolate_dynamicB= defined $self->autoconf_with_picC= grep /(?<!\%)\%c/, @{$self->build_command or [];}
Truth table100%2/2
A
A= $self->build_command
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 1 | $ab_version = '0.005'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 11 | ▶ | if(@{ $self->inline_auto_include } || @{ $self->bin_requires } || defined $self->msys) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
@{$self->inline_auto_include;} or @{$self->bin_requires;} or defined $self->msys
@{$self->inline_auto_include;} or @{$self->bin_requires;}
MC/DC100%3/3
@{$self->inline_auto_include;} or @{$self->bin_requires;} or defined $self->msys
@{$self->inline_auto_include;}
@{$self->bin_requires;}
defined $self->msys
Truth table100%4/4
A or B or C
A= @{$self->inline_auto_include;}B= @{$self->bin_requires;}C= defined $self->msys
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 3 | $ab_version = '0.006'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 11 | ▶ | if(defined $self->stage_install) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | $ab_version = '0.016'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 11 | ▶ | if(@{ $self->helper } || grep /(?<!\%)\%\{([a-zA-Z_][a-zA-Z_0-9]+)\}/, @{ $self->build_command || [] }, @{ $self->install_command || [] }, @{ $self->test_command || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition77%7/9
@{$self->helper;} or grep /(?<!\%)\%\{([a-zA-Z_][a-zA-Z_0-9]+)\}/, @{$self->build_command or [];}, @{$self->install_command or [];}, @{$self->test_command or [];}
$self->build_command || []
$self->install_command || []
$self->test_command || []
MC/DC0%0/2
@{$self->helper;} or grep /(?<!\%)\%\{([a-zA-Z_][a-zA-Z_0-9]+)\}/, @{$self->build_command or [];}, @{$self->install_command or [];}, @{$self->test_command or [];}
@{$self->helper;}
grep /(?<!\%)\%\{([a-zA-Z_][a-zA-Z_0-9]+)\}/, @{$self->build_command or [];}, @{$self->install_command or [];}, @{$self->test_command or [];}
MC/DC100%1/1
$self->build_command || []
$self->build_command
MC/DC100%1/1
$self->install_command || []
$self->install_command
MC/DC100%1/1
$self->test_command || []
$self->test_command
Truth table33%1/3
A or B
A= @{$self->helper;}B= grep /(?<!\%)\%\{([a-zA-Z_][a-zA-Z_0-9]+)\}/, @{$self->build_command or [];}, @{$self->install_command or [];}, @{$self->test_command or [];}
Truth table100%2/2
A
A= $self->build_command
Truth table100%2/2
A
A= $self->install_command
Truth table100%2/2
A
A= $self->test_command
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | $ab_version = '0.020'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 11 | ▶ | if(@{ $self->env } || grep /(?<!\%)\%X/, @{ $self->build_command || [] }, @{ $self->install_command || [] }, @{ $self->test_command || [] } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%9/9
@{$self->env;} or grep /(?<!\%)\%X/, @{$self->build_command or [];}, @{$self->install_command or [];}, @{$self->test_command or [];}
$self->build_command || []
$self->install_command || []
$self->test_command || []
MC/DC100%2/2
@{$self->env;} or grep /(?<!\%)\%X/, @{$self->build_command or [];}, @{$self->install_command or [];}, @{$self->test_command or [];}
@{$self->env;}
grep /(?<!\%)\%X/, @{$self->build_command or [];}, @{$self->install_command or [];}, @{$self->test_command or [];}
MC/DC100%1/1
$self->build_command || []
$self->build_command
MC/DC100%1/1
$self->install_command || []
$self->install_command
MC/DC100%1/1
$self->test_command || []
$self->test_command
Truth table100%3/3
A or B
A= @{$self->env;}B= grep /(?<!\%)\%X/, @{$self->build_command or [];}, @{$self->install_command or [];}, @{$self->test_command or [];}
Truth table100%2/2
A
A= $self->build_command
Truth table100%2/2
A
A= $self->install_command
Truth table100%2/2
A
A= $self->test_command
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 2 | $ab_version = '0.027'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | $self->zilla->register_prereqs({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | type => 'requires', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | phase => 'configure', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 'Alien::Base::ModuleBuild' => $ab_version, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | 'File::ShareDir' => '1.03', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | 11 | ▶ | @{ $self->split_bins } > 0 ? ('Path::Class' => '0.013') : (), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | $self->zilla->register_prereqs({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | type => 'requires', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | phase => 'runtime', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 'Alien::Base' => $ab_version, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | 'File::ShareDir' => '1.03', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 11 | ▶ | @{ $self->split_bins } > 0 ? ('Path::Class' => '0.013') : (), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | has "+mb_class" => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | lazy => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 11 | ▶ | default => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.6
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 11 | my ( $self ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | 11 | ▶ | if( $self->has_bins ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 0 | return 'MyModuleBuild'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 11 | return 'Alien::Base::ModuleBuild'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 7 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 11 | ▶ | after gather_files => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=4 SCAR=22.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 11 | my ( $self ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | 11 | my $template = <<'__EOT__'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | #!/usr/bin/env perl | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | # PODNAME: {{ $bin }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | # ABSTRACT: Command {{ $bin }} of {{ $dist->name }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | $|=1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | use File::ShareDir ':ALL'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | use Path::Class; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | use {{ $mod }}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | my $abs; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | if({{ $mod }}->install_type ne 'system') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | $abs = file(dist_dir('{{ $dist->name }}'),'bin','{{ $bin }}')->cleanup->absolute; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | die "{{ $mod }} reinstalled as non-share install. Please remove wrapper at $0"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | exec($abs, @ARGV) or print STDERR "couldn't exec {{ $bin }}: $!"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | __EOT__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | 11 | my @bin_paths; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | 11 | for (@{$self->split_bins}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | 0 | my $module = $self->zilla->name; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | 0 | $module =~ s/-/::/g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | 0 | my $content = $self->fill_in_string( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | $template, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | dist => \($self->zilla), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | bin => $_, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | mod => $module, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | 0 | my $file = Dist::Zilla::File::InMemory->new({ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | content => $content, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | name => 'bin/'.$_, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | mode => 0755, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | 0 | push @bin_paths, $file->name; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | 0 | $self->add_file($file); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | 11 | ▶ | if( $self->has_bins ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 0 | ▶ | if( $self->mb_class ne 'MyModuleBuild' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | 0 | die "Unable to set custom subclass mb_class to 'MyModuleBuild' (needed for 'bins')"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 0 | my $mb_custom_template = <<'__EOT__'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | package # hide from PAUSE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | MyModuleBuild; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | use parent 'Alien::Base::ModuleBuild'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | sub process_script_files { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | if( $self->config_data->{install_type} eq 'system' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | my $bins; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | {{ $bin_paths }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | my %script_files = map { $_ => 1 } @{ $self->{properties}{script_files} }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | delete @script_files{ @$bins }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | $self->{properties}{script_files} = [ keys %script_files ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | $self->SUPER::process_script_files; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | __EOT__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | 0 | my $mb_custom_content = $self->fill_in_string( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | $mb_custom_template, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | bin_paths => Data::Dumper->Dump( [ \@bin_paths ], [qw(bins)]), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | 0 | my $mb_file = Dist::Zilla::File::InMemory->new({ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | content => $mb_custom_content, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | name => 'inc/' . $self->mb_class . '.pm', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | 0 | $self->add_file($mb_file); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | 7 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | 28 | ▶ | around module_build_args => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=15 SCAR=29.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | 28 | my ($orig, $self, @args) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | 28 | my $pattern = $self->pattern; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | 28 | my $exact_filename = $self->exact_filename; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | 28 | my $bin_requires = $self->_bin_requires_hash; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | 28 | my $helper = $self->_helper_hash; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | 28 | my $env = $self->_env_hash; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | 28 | ▶ | %{ $self->$orig(@args) }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 14 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | alien_name => $self->name, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | alien_repository => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | protocol => $self->repo_uri->scheme eq 'file' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | ? 'local' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | : $self->repo_uri->scheme, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | host => $self->repo_uri->can('port') # local files do not have port | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | ? ( $self->repo_uri->default_port == $self->repo_uri->port | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | ? $self->repo_uri->host | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | : $self->repo_uri->host_port ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | : '', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | location => $self->repo_uri->path, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | # NOTE Not using a compiled regex here for serialisation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | # in case it adds flags not in older versions of perl. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | # In particular, the compiled regex was adding the u | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | # modifier, but then getting serialised as | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | # (?^u:$pattern) which fails to parse under perl less | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | # than v5.014. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | defined $exact_filename ? (exact_filename => $exact_filename) : (pattern => "^$pattern\$"), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | (alien_build_commands => $self->build_command)x!! $self->build_command, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | (alien_install_commands => $self->install_command)x!! $self->install_command, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | (alien_test_commands => $self->test_command)x!! $self->test_command, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | (alien_inline_auto_include => $self->inline_auto_include)x!! $self->inline_auto_include, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | defined $self->autoconf_with_pic ? (alien_autoconf_with_pic => $self->autoconf_with_pic) : (), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | defined $self->isolate_dynamic ? (alien_isolate_dynamic => $self->isolate_dynamic) : (), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | defined $self->msys ? (alien_msys => $self->msys) : (), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | defined $self->stage_install ? (alien_stage_install => $self->stage_install) : (), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | defined $self->provides_libs ? (alien_provides_libs => $self->provides_libs) : (), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | defined $self->version_check ? (alien_version_check => $self->version_check) : (), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | defined $self->provides_cflags ? (alien_provides_cflags => $self->provides_cflags) : (), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | %$bin_requires ? ( alien_bin_requires => $bin_requires ) : (), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | %$helper ? ( alien_helper => $helper ): (), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | %$env ? ( alien_env => $env ) : (), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | 7 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | 11 | ▶ | sub _is_dynamic_config { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_is_dynamic_config: called CC=6 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | 11 | my($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | 11 | ▶ | %{ $self->_bin_requires_hash } || $self->msys || @{ $self->build_command || [] } == 0 || grep /(?<!\%)\%c/, @{ $self->build_command || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition90%9/10
%{$self->_bin_requires_hash;} or $self->msys or @{$self->build_command or [];} == 0
%{$self->_bin_requires_hash;} or $self->msys
$self->build_command || []
$self->build_command || []
MC/DC100%3/3
%{$self->_bin_requires_hash;} or $self->msys or @{$self->build_command or [];} == 0
%{$self->_bin_requires_hash;}
$self->msys
@{$self->build_command or [];} == 0
MC/DC100%1/1
$self->build_command || []
$self->build_command
MC/DC0%0/1
$self->build_command || []
$self->build_command
Truth table100%4/4
A or B or C
A= %{$self->_bin_requires_hash;}B= $self->msysC= @{$self->build_command or [];} == 0
Truth table100%2/2
A
A= $self->build_command
Truth table50%1/2
A
A= $self->build_command
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | 11 | ▶ | sub metadata { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
metadata: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | 11 | my($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | 11 | ▶ | $self->_is_dynamic_config ? { dynamic_config => 1 } : {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | 7 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | 7 | ▶ | no Moose; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | 7 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||