Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude a folder from compilation

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?

like image 464
rmorais Avatar asked Mar 31 '15 14:03

rmorais


People also ask

How do I ignore a folder in Tsconfig?

Use the exclude option in your tsconfig. json file to exclude a folder from compilation in TypeScript. The exclude option changes what the include setting finds and defaults to node_modules and bower_components .

How do I ignore a folder in Visual Studio?

You can use Visual Studio to exclude a file from a solution by context-clicking the file in Solution Explorer and selecting Exclude from Project in the context menu.

How do you exclude files from a build?

To exclude specific files from deploymentIn the Solution Explorer window, right-click the file, and then click Properties. In the Properties window, in the Build Action row, select None.


1 Answers

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"))
}
like image 84
marios Avatar answered Oct 08 '22 12:10

marios