| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
19
|
|
|
19
|
|
75
|
use strict; |
|
|
19
|
|
|
|
|
23
|
|
|
|
19
|
|
|
|
|
665
|
|
|
2
|
19
|
|
|
19
|
|
80
|
use warnings FATAL => 'recursion'; |
|
|
19
|
|
|
|
|
22
|
|
|
|
19
|
|
|
|
|
566
|
|
|
3
|
19
|
|
|
19
|
|
785
|
use utf8; |
|
|
19
|
|
|
|
|
34
|
|
|
|
19
|
|
|
|
|
138
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
19
|
|
|
19
|
|
6425
|
use Daiku::Task; |
|
|
19
|
|
|
|
|
47
|
|
|
|
19
|
|
|
|
|
604
|
|
|
6
|
19
|
|
|
19
|
|
6154
|
use Daiku::File; |
|
|
19
|
|
|
|
|
33
|
|
|
|
19
|
|
|
|
|
514
|
|
|
7
|
19
|
|
|
19
|
|
6218
|
use Daiku::SuffixRule; |
|
|
19
|
|
|
|
|
36
|
|
|
|
19
|
|
|
|
|
485
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
19
|
|
|
19
|
|
8303
|
use Parse::CommandLine (); |
|
|
19
|
|
|
|
|
10130
|
|
|
|
19
|
|
|
|
|
390
|
|
|
10
|
19
|
|
|
19
|
|
8894
|
use Tie::IxHash; |
|
|
19
|
|
|
|
|
61582
|
|
|
|
19
|
|
|
|
|
584
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Daiku::Registry; |
|
13
|
19
|
|
|
19
|
|
97
|
use Mouse; |
|
|
19
|
|
|
|
|
26
|
|
|
|
19
|
|
|
|
|
110
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has tasks => ( |
|
16
|
|
|
|
|
|
|
is => 'rw', |
|
17
|
|
|
|
|
|
|
isa => 'HashRef', |
|
18
|
|
|
|
|
|
|
default => sub { tie my %h, "Tie::IxHash"; \%h }, |
|
19
|
|
|
|
|
|
|
); |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
has temporary_desc => ( |
|
22
|
|
|
|
|
|
|
is => 'rw', |
|
23
|
|
|
|
|
|
|
isa => 'Str', |
|
24
|
|
|
|
|
|
|
clearer => 'clear_temporary_desc', |
|
25
|
|
|
|
|
|
|
); |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
has namespaces => ( |
|
28
|
|
|
|
|
|
|
is => 'rw', |
|
29
|
|
|
|
|
|
|
isa => 'ArrayRef', |
|
30
|
|
|
|
|
|
|
default => sub { [] }, |
|
31
|
|
|
|
|
|
|
); |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub register { |
|
34
|
68
|
|
|
68
|
1
|
99
|
my ($self, $task) = (shift, shift); |
|
35
|
68
|
|
|
|
|
199
|
my $orig = $self->find_task($task->dst); |
|
36
|
68
|
100
|
|
|
|
185
|
$task->merge($orig) if $orig; |
|
37
|
68
|
|
|
|
|
407
|
$self->tasks->{$task->dst} = $task; |
|
38
|
68
|
|
|
|
|
1217
|
$task->registry($self); |
|
39
|
|
|
|
|
|
|
} |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub build { |
|
42
|
50
|
|
|
50
|
1
|
100
|
my ($self, $target) = @_; |
|
43
|
50
|
50
|
|
|
|
277
|
if (!defined $target) { |
|
44
|
0
|
|
|
|
|
0
|
die "Missing target\n"; |
|
45
|
|
|
|
|
|
|
} |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# parsing 'task_name[arg1 arg2]' |
|
48
|
50
|
|
|
|
|
365
|
($target, my $argument) = $target =~ /\A([^\[]+)(?:\[(.*)\])?\z/ms; |
|
49
|
50
|
|
|
|
|
108
|
my @args; |
|
50
|
50
|
100
|
|
|
|
117
|
@args = Parse::CommandLine::parse_command_line($argument) if defined $argument; |
|
51
|
|
|
|
|
|
|
|
|
52
|
50
|
|
|
|
|
277
|
my $task = $self->find_task($target); |
|
53
|
50
|
100
|
|
|
|
275
|
if ($task) { |
|
54
|
47
|
|
|
|
|
151
|
return $task->build($target, @args); |
|
55
|
|
|
|
|
|
|
} else { |
|
56
|
3
|
|
|
|
|
29
|
die "There is no rule to build '$target'\n"; |
|
57
|
|
|
|
|
|
|
} |
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub find_task { |
|
61
|
239
|
|
|
239
|
0
|
298
|
my ($self, $target) = @_; |
|
62
|
239
|
|
|
|
|
219
|
for my $task (values %{$self->{tasks}}) { |
|
|
239
|
|
|
|
|
1079
|
|
|
63
|
546
|
100
|
|
|
|
4287
|
return $task if $task->match($target); |
|
64
|
|
|
|
|
|
|
} |
|
65
|
138
|
100
|
|
|
|
2048
|
if ( -f $target ) { |
|
66
|
69
|
|
|
|
|
848
|
return Daiku::File->new( dst => $target ); |
|
67
|
|
|
|
|
|
|
} |
|
68
|
69
|
|
|
|
|
108
|
return undef; |
|
69
|
|
|
|
|
|
|
} |
|
70
|
|
|
|
|
|
|
|
|
71
|
19
|
|
|
19
|
|
10601
|
no Mouse; __PACKAGE__->meta->make_immutable; |
|
|
19
|
|
|
|
|
32
|
|
|
|
19
|
|
|
|
|
92
|
|
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
__END__ |