How to share resources between projects in SBT

▼魔方 西西 提交于 2019-11-30 20:30:55

This is what I'm doing. I create a global 'resources' directory in the root of the project, and then the following variable:

    lazy val globalResources = file("resources")

And then in every project's settings:

    unmanagedResourceDirectories in Runtime += globalResources 

For projects that use the xsbt-web-plugin or some other library that imports it you'll have to use the stronger

    unmanagedResourceDirectories in Compile += globalResources

Beware that using this solution your projects will potentially have muliple resource directories and AFAIK if you define the same file twice compile:copy-resources is going to be angry at you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!