如何从编译中排除文件夹 [英] How to exclude a folder from compilation

查看:78
本文介绍了如何从编译中排除文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的Play项目中,我们遇到了这个问题.

In our Play project, we are having this issue.

当我们运行javascript测试时,它会触发scala源代码的编译.

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

所有javascript测试均在test/assets下,并且此路径内的任何更改都不应触发源代码的编译.

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

这意味着此文件夹在某处称为源目录.我试图查看可以在哪个sbt属性中引用该文件夹,但没有找到.

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?

推荐答案

watchSources任务似乎包含跟踪更改的文件.要检查文件夹/文件列表,请在sbt中键入以下内容:

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

我不确定这是否是最简单的解决方案,但是它将从watchSources中删除test/assets.

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"))
}

这篇关于如何从编译中排除文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆