How to have the filewatcher watch non-code files?

As @Sze said, this works if you let the build system know about both the input(s) and output(s). Here’s an example using addFileArg and addOutputFileArg:

const build_cmd = b.addSystemCommand(&.{ "resinator", "--" });
build_cmd.addFileArg(b.path("test.rc"));
_ = build_cmd.addOutputFileArg("test.res");

From my quick glance at what I think are the pdflatex docs, you might be interested in addOutputDirectoryArg.

Unsure if the input-only version not being watched is a bug. Setting build_cmd.has_side_effects = true didn’t have any effect either.

2 Likes