托管资源仅适用于刚刚清理的项目

时间:2015-08-03 08:24:39

标签: sbt

我创建了一个生成资源的SBT AutoPlugin: https://github.com/sphereio/json-schema-inliner/

(Thx到Why doesn't a custom resourceGenerator get executed upon compile?,我可以解决我的第一个问题。)

例如,有一个测试项目生成“test / inline / category.schema.json”。

测试项目也在GIT中:https://github.com/sphereio/json-schema-inliner/tree/master/testProject

这个生成的资源可用于新近清理的项目:

cd testProject

▶ sbt clean run
[...]
[info] Running Main
url from test/category.schema.json: file:/Users/yannsimon/projects/json-schema/testProject/target/scala-2.10/classes/test/category.schema.json
url from test/inline/category.schema.json: file:/Users/yannsimon/projects/json-schema/testProject/target/scala-2.10/classes/test/inline/category.schema.json

再次运行时,托管资源从“testProject / target / scala-2.10 / classes / test / inline”消失

▶ sbt run
[...]
[info] Running Main
url from test/category.schema.json: file:/Users/yannsimon/projects/json-schema/testProject/target/scala-2.10/classes/test/category.schema.json
url from test/inline/category.schema.json: null

任何帮助都将不胜感激。

谢谢,Yann