我创建了一个生成资源的SBT AutoPlugin:https://github.com/sphereio/json-schema-inliner/
(对于Why doesn't a custom resourceGenerator get executed upon compile?,我可以解决我的第一个问题。)
例如,有一个测试项目会生成“test /inline.taxy.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任何帮助都将不胜感激。
谢谢,亚恩
发布于 2015-10-02 09:05:16
https://stackoverflow.com/questions/31782625
复制相似问题