| 1 | # Build::Hopen::G::Goal - A named build goal | ||||||||||
| 2 | package Build::Hopen::G::Goal; | ||||||||||
| 3 | 3 | ▶ | use Build::Hopen; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 3 | ▶ | use Build::Hopen::Base; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 3 | our $VERSION = '0.000008'; # TRIAL | |||||||||
| 7 | |||||||||||
| 8 | 3 | ▶ | use parent 'Build::Hopen::G::Op'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | #use Class::Tiny qw(_passthrough); | ||||||||||
| 10 | |||||||||||
| 11 | 3 | ▶ | use Build::Hopen::Arrrgs; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 3 | ▶ | use Build::Hopen::Util::Data qw(forward_opts); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 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<Goal> is a named build target, e.g., C<doc> or C<dist>. The name C<all> | ||||||||||
| 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<Build::Hopen::G::CollectOp>'s run function. | ||||||||||
| 32 | |||||||||||
| 33 | =cut | ||||||||||
| 34 | |||||||||||
| 35 | # }}}1 | ||||||||||
| 36 | |||||||||||
| 37 | 1 | ▶ | sub _run { | ||||||||
|
Subroutine
_run: called CC=1 SCAR=0.2
| |||||||||||
| 38 | 1 | my ($self, %args) = parameters('self', [qw(; phase generator)], @_); | |||||||||
| 39 | 0 | ▶ | hlog { Goal => $self->name }; | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 40 | 1 | 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 | 4 | ▶ | sub BUILD { | ||||||||
|
Subroutine
BUILD: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||
| 51 | 4 | my ($self, $args) = @_; | |||||||||
| 52 | 4 | ▶ | croak 'Goals must have names' unless $args->{name}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 53 | } #BUILD() | ||||||||||
| 54 | |||||||||||
| 55 | 3 | 1; | |||||||||
| 56 | __END__ | ||||||||||