summaryrefslogtreecommitdiff
path: root/lib/WebCoso/Maker.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/WebCoso/Maker.pm')
-rw-r--r--lib/WebCoso/Maker.pm28
1 files changed, 19 insertions, 9 deletions
diff --git a/lib/WebCoso/Maker.pm b/lib/WebCoso/Maker.pm
index 91ceb03..b64c9cf 100644
--- a/lib/WebCoso/Maker.pm
+++ b/lib/WebCoso/Maker.pm
@@ -4,7 +4,7 @@ role WebCoso::Maker[$from,$to] {
has $.basename;
has $.dir;
- method process-contents(:$src,:@deps) { ... }
+ method process-contents($src) { ... }
method dest-files() {
say "Maker[$from,$to]($.dir/$.basename)::dest-files";
@@ -16,8 +16,16 @@ role WebCoso::Maker[$from,$to] {
return $.wc.get-files($.dir,$.basename,$from);
}
+ method get-file($path) {
+ return $.wc.get-file($.dir,$path);
+ }
+
method dep-files() {
- return Hash;
+ return $.wc.load-deps($.dir,$.basename,$to);
+ }
+
+ method set-deps(%deps) {
+ $.wc.save-deps($.dir,$.basename,$to,%deps);
}
method make() {
@@ -34,20 +42,22 @@ role WebCoso::Maker[$from,$to] {
my @deps = %deps{$lang} // ();
say "Maker[$from,$to]($.dir/$.basename)::make lang $lang";
say "Maker[$from,$to]($.dir/$.basename)::make dst modified {$dst ?? $dst.modified !! 'not-there'} src modified {$src.modified}";
- next if $dst and $dst.modified after
+ next if $dst and not $dst.modified before
all($src.modified,@depsĀ».modified.flat);
say "Maker[$from,$to]($.dir/$.basename)::make processing $lang";
- my $processed-contents = self.process-contents(
- src => $src.slurp,
- deps => @depsĀ».slurp,
+ my ($processed-contents,@new_deps) = self.process-contents(
+ $src,
);
- # that .Str.IO is a hack to work around
- # https://rt.perl.org/Public/Bug/Display.html?id=126006
%dsts{$lang} = $.wc.put-file($.dir,$.basename,$lang,$to,
- $processed-contents).Str.IO;
+ $processed-contents);
+ %deps{$lang} = @new_deps
+ if @new_deps;
}
+
+ $.set-deps(%deps);
+
return %dsts;
}
}