File Coverage

blib/lib/Build/Hopen/G/Goal.pm
Criterion Covered Total %
statement 20 21 95.2
branch 1 2 50.0
condition n/a
subroutine 7 8 87.5
pod 1 1 100.0
total 29 32 90.6


line stmt bran cond sub pod time code
1             # Build::Hopen::G::Goal - A named build goal
2             package Build::Hopen::G::Goal;
3 3     3   1361 use Build::Hopen;
  3         6  
  3         191  
4 3     3   18 use Build::Hopen::Base;
  3         7  
  3         18  
5              
6             our $VERSION = '0.000008'; # TRIAL
7              
8 3     3   695 use parent 'Build::Hopen::G::Op';
  3         7  
  3         25  
9             #use Class::Tiny qw(_passthrough);
10              
11 3     3   177 use Build::Hopen::Arrrgs;
  3         6  
  3         143  
12 3     3   17 use Build::Hopen::Util::Data qw(forward_opts);
  3         6  
  3         722  
13              
14             # Docs {{{1
15              
16             =head1 NAME
17              
18             Build::Hopen::G::Goal - a named goal in a hopen build
19              
20             =head1 SYNOPSIS
21              
22             A C is a named build target, e.g., C or C. The name C
23             is reserved for the root goal. Goals usually appear at the end of the build
24             graph, but this is not required --- Goal nodes can appear anywhere in the
25             graph.
26              
27             =head1 FUNCTIONS
28              
29             =head2 run
30              
31             Wraps a L's run function.
32              
33             =cut
34              
35             # }}}1
36              
37             sub _run {
38 1     1   6 my ($self, %args) = parameters('self', [qw(; phase generator)], @_);
39 1     0   7 hlog { Goal => $self->name };
  0         0  
40 1         8 return $self->passthrough(-nocontext=>1, -levels => 'local',
41             forward_opts(\%args, {'-'=>1}, qw[phase generator]));
42             } #_run()
43              
44             =head2 BUILD
45              
46             Enforce the requirement for a user-specified name.
47              
48             =cut
49              
50             sub BUILD {
51 4     4 1 692 my ($self, $args) = @_;
52 4 50       21 croak 'Goals must have names' unless $args->{name};
53             } #BUILD()
54              
55             1;
56             __END__