Open natinusala opened 1 year ago
I have a similar issue, I'm trying to parse the contents of a TOML file to generate localization resources. It works as a prebuild command but blows our incremental build time. It doesn't work as a build command because it never executes again.
What's the status on this?
Description
I have a build tool plugin that depends on an executable inside the package. The plugin makes a build command to the executable on every target Swift file (using
context.tool(named:)
).The executable itself depends on resources, copied to the executable bundle by SPM. In my case they are Stencil template files to generate Swift code.
When I make any change to the executable code, SPM runs the build command again on every Swift file. That works fine.
However when I change a resource, SPM doesn't run the build command again. It copies the file to the bundle but it doesn't trigger a rebuild of the build commands declared by the plugin.
The end result is that I need to clean the project every time I make a change to a template if I want SPM to trigger my custom build command and update the generated Swift files.
Expected behavior
When I update a resource of an executable, I expect the executable target to be marked "dirty". I expect my plugin build commands to be ran again, as if the executable itself changed.
Actual behavior
The resource file is copied to the bundle but the executable target isn't considered changed, so my build commands are not executed again (and my generated code is outdated).
Steps to reproduce
output
arg c. That reads the file from the resources and writes it tooutput
Swift Package Manager version/commit hash
Swift Package Manager - Swift 5.7.1
Swift & OS version (output of
swift --version && uname -a
)