sub with_entry_for {
my ($self, $for_id, $deps_for) = @_;
- my @expanded = $self->_expand_deps($deps_for);
my $new_revdeps = {
%{$self->revdeps},
- $for_id => \@expanded,
+ $for_id => $deps_for,
};
my $new_deps = $self->_merge_deps_for(
- $self->deps, $for_id, map @{$_}[1..$#$_], @expanded
+ $self->deps, $for_id, map @{$_}[1..$#$_], @$deps_for
);
ref($self)->new(
deps => $new_deps,
return $root->[0];
}
-sub _expand_deps {
- my ($self, $dep_groups) = @_;
- my @exp;
- assert_DependencyGroupList $dep_groups;
- map {
- my ($on, @deps) = @$_;
- my @exp;
- DEP: foreach my $dep (@deps) {
- my ($type, @path) = @$dep;
- push @exp, [
- $type,
- map { ref() ? @{$_->identity_path or next DEP} : $_ } @path
- ];
- }
- (@exp ? [ $on, @exp ] : ());
- } @$dep_groups;
-}
-
sub _dependents_of {
my ($self, $event) = @_;
my ($type, @path) = @$event;
has actions => (is => 'ro', isa => ArrayRef[Action], required => 1);
-has depends_on => (is => 'ro', isa => DependencyGroupList, required => 1);
+#has depends_on => (is => 'ro', isa => DependencyGroupList, required => 1);
+
+has depends_on => (is => 'ro', required => 1, coerce => sub {
+ my ($dep_groups) = @_;
+ my @exp;
+ assert_DependencyGroupList $dep_groups;
+ [ map {
+ my ($on, @deps) = @$_;
+ my @exp;
+ DEP: foreach my $dep (@deps) {
+ my ($type, @path) = @$dep;
+ push @exp, [
+ $type,
+ map { ref() ? @{$_->identity_path or next DEP} : $_ } @path
+ ];
+ }
+ (@exp ? [ $on, @exp ] : ());
+ } @$dep_groups ];
+});
has resolves => (is => 'ro', isa => Proposition);