| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
20
|
|
|
20
|
|
15962
|
use strict; |
|
|
20
|
|
|
|
|
30
|
|
|
|
20
|
|
|
|
|
829
|
|
|
2
|
20
|
|
|
20
|
|
93
|
use warnings FATAL => 'recursion'; |
|
|
20
|
|
|
|
|
24
|
|
|
|
20
|
|
|
|
|
662
|
|
|
3
|
20
|
|
|
20
|
|
86
|
use utf8; |
|
|
20
|
|
|
|
|
166
|
|
|
|
20
|
|
|
|
|
109
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# This is .PHONY target. |
|
6
|
|
|
|
|
|
|
package Daiku::Task; |
|
7
|
20
|
|
|
20
|
|
10181
|
use File::stat; |
|
|
20
|
|
|
|
|
121963
|
|
|
|
20
|
|
|
|
|
145
|
|
|
8
|
20
|
|
|
20
|
|
10956
|
use Mouse; |
|
|
20
|
|
|
|
|
467131
|
|
|
|
20
|
|
|
|
|
120
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
with 'Daiku::Role'; |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has dst => ( |
|
13
|
|
|
|
|
|
|
is => 'rw', |
|
14
|
|
|
|
|
|
|
isa => 'Str', |
|
15
|
|
|
|
|
|
|
required => 1, |
|
16
|
|
|
|
|
|
|
); |
|
17
|
|
|
|
|
|
|
has deps => ( |
|
18
|
|
|
|
|
|
|
is => 'rw', |
|
19
|
|
|
|
|
|
|
isa => 'ArrayRef[Str]', |
|
20
|
|
|
|
|
|
|
default => sub { +[ ] }, |
|
21
|
|
|
|
|
|
|
); |
|
22
|
|
|
|
|
|
|
has code => ( |
|
23
|
|
|
|
|
|
|
is => 'rw', |
|
24
|
|
|
|
|
|
|
isa => 'CodeRef', |
|
25
|
|
|
|
|
|
|
default => sub { |
|
26
|
|
|
|
|
|
|
sub { } |
|
27
|
|
|
|
|
|
|
}, |
|
28
|
|
|
|
|
|
|
); |
|
29
|
|
|
|
|
|
|
has desc => ( |
|
30
|
|
|
|
|
|
|
is => 'ro', |
|
31
|
|
|
|
|
|
|
isa => 'Maybe[Str]', |
|
32
|
|
|
|
|
|
|
); |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# @return affected things |
|
35
|
|
|
|
|
|
|
sub build { |
|
36
|
21
|
|
|
21
|
1
|
41
|
my ($self, $target, @args) = @_; |
|
37
|
21
|
|
|
|
|
113
|
$self->log("Building Task: $self->{dst}"); |
|
38
|
|
|
|
|
|
|
|
|
39
|
21
|
|
|
|
|
84
|
my $built = $self->_build_deps(); |
|
40
|
|
|
|
|
|
|
|
|
41
|
21
|
|
|
|
|
93
|
$self->code->($self, @args); |
|
42
|
20
|
|
|
|
|
5794
|
$built++; |
|
43
|
|
|
|
|
|
|
|
|
44
|
20
|
|
|
|
|
90
|
return $built; |
|
45
|
|
|
|
|
|
|
} |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub match { |
|
48
|
207
|
|
|
207
|
0
|
1032
|
my ($self, $target) = @_; |
|
49
|
207
|
100
|
|
|
|
689
|
return 1 if $self->dst eq $target; |
|
50
|
177
|
|
|
|
|
428
|
return 0; |
|
51
|
|
|
|
|
|
|
} |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
# @return the number of built tasks |
|
54
|
|
|
|
|
|
|
sub _build_deps { |
|
55
|
21
|
|
|
21
|
|
35
|
my ($self) = @_; |
|
56
|
|
|
|
|
|
|
|
|
57
|
21
|
|
|
|
|
36
|
my $ret = 0; |
|
58
|
21
|
|
|
|
|
31
|
for my $target (@{$self->deps}) { |
|
|
21
|
|
|
|
|
123
|
|
|
59
|
9
|
|
|
|
|
43
|
my $task = $self->registry->find_task($target); |
|
60
|
9
|
50
|
|
|
|
34
|
if ($task) { |
|
61
|
9
|
|
|
|
|
31
|
$ret += $task->build($target); |
|
62
|
|
|
|
|
|
|
} else { |
|
63
|
0
|
|
|
|
|
0
|
die "I don't know to build '$target' depended by '$self->{dst}'\n"; |
|
64
|
|
|
|
|
|
|
} |
|
65
|
|
|
|
|
|
|
} |
|
66
|
21
|
|
|
|
|
45
|
return $ret; |
|
67
|
|
|
|
|
|
|
} |
|
68
|
|
|
|
|
|
|
|
|
69
|
20
|
|
|
20
|
|
13950
|
no Mouse; |
|
|
20
|
|
|
|
|
41
|
|
|
|
20
|
|
|
|
|
104
|
|
|
70
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |
|
73
|
|
|
|
|
|
|
__END__ |