| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | # App::hopen::H - H:: namespace for use in hopen files | 
| 2 |  |  |  |  |  |  | package App::hopen::H; | 
| 3 | 2 |  |  | 2 |  | 98900 | use strict; use warnings; | 
|  | 2 |  |  | 2 |  | 12 |  | 
|  | 2 |  |  |  |  | 60 |  | 
|  | 2 |  |  |  |  | 9 |  | 
|  | 2 |  |  |  |  | 4 |  | 
|  | 2 |  |  |  |  | 50 |  | 
| 4 | 2 |  |  | 2 |  | 11 | use Data::Hopen::Base; | 
|  | 2 |  |  |  |  | 3 |  | 
|  | 2 |  |  |  |  | 11 |  | 
| 5 |  |  |  |  |  |  |  | 
| 6 |  |  |  |  |  |  | our $VERSION = '0.000012'; # TRIAL | 
| 7 |  |  |  |  |  |  |  | 
| 8 | 2 |  |  | 2 |  | 2566 | use parent 'Exporter'; | 
|  | 2 |  |  |  |  | 4 |  | 
|  | 2 |  |  |  |  | 9 |  | 
| 9 | 2 |  |  | 2 |  | 516 | use vars::i '@EXPORT' => []; | 
|  | 2 |  |  |  |  | 802 |  | 
|  | 2 |  |  |  |  | 14 |  | 
| 10 | 2 |  |  | 2 |  | 174 | use vars::i '@EXPORT_OK' => qw(files); | 
|  | 2 |  |  |  |  | 4 |  | 
|  | 2 |  |  |  |  | 8 |  | 
| 11 | 2 |  |  |  |  | 21 | use vars::i '%EXPORT_TAGS' => ( | 
| 12 |  |  |  |  |  |  | default => [@EXPORT], | 
| 13 |  |  |  |  |  |  | all => [@EXPORT, @EXPORT_OK] | 
| 14 | 2 |  |  | 2 |  | 166 | ); | 
|  | 2 |  |  |  |  | 4 |  | 
| 15 |  |  |  |  |  |  |  | 
| 16 | 2 |  |  | 2 |  | 520 | use App::hopen::BuildSystemGlobals; | 
|  | 2 |  |  |  |  | 5 |  | 
|  | 2 |  |  |  |  | 230 |  | 
| 17 | 2 |  |  | 2 |  | 883 | use App::hopen::G::FilesCmd; | 
|  | 2 |  |  |  |  | 6 |  | 
|  | 2 |  |  |  |  | 93 |  | 
| 18 | 2 |  |  | 2 |  | 483 | use App::hopen::Util::BasedPath; | 
|  | 2 |  |  |  |  | 6 |  | 
|  | 2 |  |  |  |  | 101 |  | 
| 19 | 2 |  |  | 2 |  | 13 | use Data::Hopen qw(hlog getparameters); | 
|  | 2 |  |  |  |  | 4 |  | 
|  | 2 |  |  |  |  | 90 |  | 
| 20 | 2 |  |  | 2 |  | 934 | use Data::Hopen::G::GraphBuilder; | 
|  | 2 |  |  |  |  | 5711 |  | 
|  | 2 |  |  |  |  | 112 |  | 
| 21 | 2 |  |  | 2 |  | 15 | use Data::Hopen::Util::Data qw(forward_opts); | 
|  | 2 |  |  |  |  | 4 |  | 
|  | 2 |  |  |  |  | 90 |  | 
| 22 | 2 |  |  | 2 |  | 13 | use Path::Class; | 
|  | 2 |  |  |  |  | 5 |  | 
|  | 2 |  |  |  |  | 467 |  | 
| 23 |  |  |  |  |  |  |  | 
| 24 |  |  |  |  |  |  | # Docs {{{1 | 
| 25 |  |  |  |  |  |  |  | 
| 26 |  |  |  |  |  |  | =head1 NAME | 
| 27 |  |  |  |  |  |  |  | 
| 28 |  |  |  |  |  |  | Data::Hopen::H - H:: namespace for use in hopen files | 
| 29 |  |  |  |  |  |  |  | 
| 30 |  |  |  |  |  |  | =head1 SYNOPSIS | 
| 31 |  |  |  |  |  |  |  | 
| 32 |  |  |  |  |  |  | This module is loaded as C<H::*> into hopen files by | 
| 33 |  |  |  |  |  |  | L<Data::Hopen::HopenFileKit>. | 
| 34 |  |  |  |  |  |  |  | 
| 35 |  |  |  |  |  |  | =head1 FUNCTIONS | 
| 36 |  |  |  |  |  |  |  | 
| 37 |  |  |  |  |  |  | =cut | 
| 38 |  |  |  |  |  |  |  | 
| 39 |  |  |  |  |  |  | # }}}1 | 
| 40 |  |  |  |  |  |  |  | 
| 41 |  |  |  |  |  |  | =head2 files | 
| 42 |  |  |  |  |  |  |  | 
| 43 |  |  |  |  |  |  | Creates a command-graph node representing a set of input files. | 
| 44 |  |  |  |  |  |  | Example usage: | 
| 45 |  |  |  |  |  |  |  | 
| 46 |  |  |  |  |  |  | $Build->H::files('foo.c')->C::compile->C::link('foo')->default_goal; | 
| 47 |  |  |  |  |  |  |  | 
| 48 |  |  |  |  |  |  | The node is an L<App::hopen::G::FilesCmd>. | 
| 49 |  |  |  |  |  |  |  | 
| 50 |  |  |  |  |  |  | The file path is assumed to be relative to the current project directory. | 
| 51 |  |  |  |  |  |  | TODO handle subdirectories. | 
| 52 |  |  |  |  |  |  |  | 
| 53 |  |  |  |  |  |  | Adds each specified file as a separate node in the asset graph. | 
| 54 |  |  |  |  |  |  |  | 
| 55 |  |  |  |  |  |  | =cut | 
| 56 |  |  |  |  |  |  |  | 
| 57 |  |  |  |  |  |  | sub files { | 
| 58 |  |  |  |  |  |  | my ($builder, %args) = getparameters('self', ['*'], @_); | 
| 59 |  |  |  |  |  |  | hlog { __PACKAGE__, 'files:', Dumper(\%args) } 3; | 
| 60 |  |  |  |  |  |  | my $lrFiles = $args{'*'} // []; | 
| 61 |  |  |  |  |  |  | my @files = map { based_path(path => file($_), base => $ProjDir) } @$lrFiles; | 
| 62 |  |  |  |  |  |  | hlog { __PACKAGE__, 'file objects:', @files } 3; | 
| 63 |  |  |  |  |  |  | my $files_op = App::hopen::G::FilesCmd->new( | 
| 64 |  |  |  |  |  |  | files => [ @files ], | 
| 65 |  |  |  |  |  |  | forward_opts(\%args, 'name') | 
| 66 |  |  |  |  |  |  | ); | 
| 67 |  |  |  |  |  |  |  | 
| 68 |  |  |  |  |  |  | return $files_op; | 
| 69 |  |  |  |  |  |  | } #files() | 
| 70 |  |  |  |  |  |  |  | 
| 71 |  |  |  |  |  |  | make_GraphBuilder 'files'; | 
| 72 |  |  |  |  |  |  |  | 
| 73 |  |  |  |  |  |  | 1; | 
| 74 |  |  |  |  |  |  | __END__ | 
| 75 |  |  |  |  |  |  | # vi: set fdm=marker: # |