2012-09-26 18 views
0

我有一個項目,我想編譯Twitter的引導,以及防止測試並行播放2.0 - Twitter的引導彙編測試

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] $ 

回答

2

測試並行執行上默認情況下設置爲false。您不應該將其包含在配置中。

文檔瀏覽:https://github.com/playframework/Play20/wiki/SBTSettings

在你的設置,播放必須在編譯應用程序/資產/樣式表中的所有文件,少生產爲好。這是你不想要的嗎?還是編譯app/assets/stylesheets/bootstrap /中的所有內容?

+0

twitter bootstrap文件應該只編譯bootstrap.less和responsive.less來編譯,看看我對我的問題的修改 – Edmondo1984

+0

你看到了什麼樣的錯誤?這可能與此問題有關:https://groups.google.com/forum/#!msg/play-framework/ws5gvEmpLGA/PB0ColbfmnEJ。我通過爲所有應用程序特定的較少文件創建一個入口點(app.less)來解決此問題。然後將app.less放在引導目錄中。並且在twitterBootstrapEntryPoints中包含'... /「bootstrap」*「app.less」'。 – rjsvaljean

+0

你能澄清一下嗎? – Edmondo1984