0

我有一个项目,我想编译 twitter bootstrap 并防止并行执行测试

def twitterBootstrapEntryPoints(base:File):PathFinder = {
    (base / "app" / "assets" / "stylesheets" / "bootstrap" * "bootstrap.less") +++
    (base / "app" / "assets" / "stylesheets" / "bootstrap" * "responsive.less") +++
    (base / "app" / "assets" / "stylesheets" * "*.less")
}



val common = PlayProject(appName, appVersion,appDependencies, mainLang = SCALA).settings(
    organization := appOrganization,
    lessEntryPoints <<= baseDirectory(twitterBootstrapEntryPoints),
    resolvers ++= commonResolvers).settings( inConfig(Test)(parallelExecution := false) : _* )

编辑:

要构建 twitter 引导程序,应该只编译 bootstrap.less 和 responsive.less ,它们会导入所有其他文件。在编译一切正常,在测试中运行时,这不再起作用,编译器尝试编译所有 .less 文件

这是我在游戏控制台上看到的

[GottwareWeb] $ clean
[success] Total time: 0 s, completed 26 sept. 2012 17:44:07
[GottwareWeb] $ compile
[info] Updating {file:/G:/GottwareWeb/}GottwareWeb...
[info] Resolving org.hibernate.javax.persistence#hibernate-jpa-2.0-api;1.0.1.Fin

[info] Done updating.
[info] Compiling 34 Scala sources and 1 Java source to G:\GottwareWeb\target\sca
la-2.9.1\classes...
[success] Total time: 9 s, completed 26 sept. 2012 17:44:17
[GottwareWeb] $ test
[error] {file:/G:/GottwareWeb/}GottwareWeb/*:play-copy-assets: in G:\GottwareWeb
\app\assets\stylesheets\accordion.less - PlayException: Compilation error [varia
ble @baseLineHeight is undefined]
[error] {file:/G:/GottwareWeb/}GottwareWeb/compile:resources: in G:\GottwareWeb\
app\assets\stylesheets\accordion.less - PlayException: Compilation error [variab
le @baseLineHeight is undefined]
[error] Total time: 0 s, completed 26 sept. 2012 17:44:32
[GottwareWeb] $
4

1 回答 1

2

默认情况下,并行执行测试设置为 false。您不必将其包含在配置中。

此处的文档:https ://github.com/playframework/Play20/wiki/SBTSettings

在您的设置中,Play 还必须在生产环境中编译 app/assets/stylesheets 中的所有 less 文件。这是你不想要的吗?还是编译 app/assets/stylesheets/bootstrap/ 中的所有内容?

于 2012-09-26T13:48:17.297 回答