How to exclude a folder from compilation

2019-06-18 05:37发布

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条回答
唯我独甜
2楼-- · 2019-06-18 05:56

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"))
}
查看更多
登录 后发表回答