1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
package ExtUtils::Builder::FileSet;
$ExtUtils::Builder::FileSet::VERSION = '0.017';
use strict;
use warnings;
use Carp ();
sub new {
my ($class, %args) = @_;
my $self = bless {
entries => [],
dependents => [],
callback => $args{callback},
}, $class;
return $self;
}
sub entries {
my $self = shift;
return @{ $self->{entries} };
}
sub add_dependent {
my ($self, $dep) = @_;
push @{ $self->{dependents} }, $dep;
for my $file (@{ $self->{entries} }) {
$dep->add_input($file);
}
return;
}
sub _pass_on {
my ($self, $entry) = @_;
push @{ $self->{entries} }, $entry;
$self->{callback}->($entry) if $self->{callback};
for my $dependent (@{ $self->{dependents} }) {
$dependent->add_input($entry);
}
return;
}
1;
|