How to exclude a folder from compilation

守給你的承諾、 提交于 2019-12-23 09:00:51

问题


In our Play project, we are having this issue.

When we run our javascript tests, it's triggering a compilation of the scala sources.

All the javascripts tests are under test/assets and any change inside this path shouldn't trigger a compilation of the sources.

This means that this folder is referred somewhere as a source directory. I tried to see in which sbt property this folder could be referred but I didn't find any.

Can anyone give some clues on how to prevent compilation triggering when a file inside this folder is changed?


回答1:


The watchSources task seems to contain the files that are tracked for change. To inspect the list of folders/files type the following in sbt:

>show watchSources

I am not sure if this is the simplest solution, but it will remove the test/assets from within the watchSources.

watchSources <<= watchSources.map{
    t => t.filterNot(x => x.getCanonicalPath.endsWith("test/assets"))
}


来源:https://stackoverflow.com/questions/29371618/how-to-exclude-a-folder-from-compilation

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