xsbt-filter
xsbt-filter copied to clipboard
Possible problem with triggeredBy method used to perform resources filtering
Hello, @sdb .
Please, see the discussion in the following issue sbt/sbt/issues/1187 regarding triggeredBy
method usage. Especially this comment.
Thank you.
Hi, I'll look into this issue this weekend and see if we can find a solution to avoid this super dangerous behavior.
I'll contact the sbt developers on this.
Thanks for the report.
I managed to reproduce the described problem with race condition in https://github.com/savulchik/xsbt-filter/tree/filterbug by adding Thread.sleep
to filterResources
task and running new check-jar
task in simple
test project.
Hello, @sdb . I'll try to fix the issue and submit a pull request.
Eventually I solved my problem with race condition during build using resource generator having default hook in sbt build cycle http://www.scala-sbt.org/0.13.5/docs/Howto/generatefiles.html#resources.
@sdb I couldn't find a solution for the plugin due to lack of sbt experience
I suspect that this is responsible for the fact that publishM2
and release
(from sbt-release) tasks will create jars where the resources are unfiltered. Unfortunately sbt/sbt#1187 doesn't explain how to correct the behavior. Any guidance anyone has for those tasks will be helpful.
Following up, it turns out my issues were related to the overlap between this project and sbt-osgi, which looks directly at resourceDirectories in Compile
to find the resources to store in the bundle. In order for this project to be compatible, it would need to register the task as a resource generator, and somehow suppress the use of the unmanaged resources.