2013-10-24 48 views
0


我們使用的是gradle-cobertura-plugin,並且有一個包含大量子項目的主項目,但必須爲某些子項目排除cobertura。如何使用gradle cobertura插件排除子項目

project('test-modules:functional-tests') { 
    cobertura { 
     skip = true 
    } 
} 

但gradle這個抱怨

棄用的動態屬性:上 「n[email protected]6e56dd10」 「跳過」,值:使用以下嘗試「真「

跳過此子項目的方法是什麼?

謝謝
水稻

+0

那是一個警告或錯誤? –

+0

我猜是因爲它說skip不推薦使用,它不會跳過該子項目的任務,所以它不起作用,不僅僅是一個我可以忽略的警告 - 「按需創建屬性(又名動態屬性)已被棄用並計劃在Gradle 2.0中刪除。請閱讀http://gradle.org/docs/current/dsl/org.gradle.api.plugins.ExtraPropertiesExtension.html以獲取有關動態屬性替換的信息。 已棄用的動態屬性:「跳過」在「任務」上:test-modules:功能測試:compileJava'「,值:」true「。」 – Paddy

回答

0

的coberbura配置不知道任何轉移標誌,所以你在這裏引入一個新的特性,這就是棄用警告試圖告訴你。我不知道有關的Cobertura插件的細節,但你可以通過設置啓用=假

coberturaTask.enabled = false // you have to replace 'coberturaTask' with the correct task name here 

歡呼禁用的Cobertura任務,

+0

Hi @René,這是行不通的,我試圖在相關子項目的開始和結束時給出這樣的結果,並且在像project('subprojectname''{cobertura.enabled = false}')這樣的根項目中也這樣做,但是它不執行它 – Paddy

+0

嗨稻田,你能給我一個鏈接到您正在使用的gradle cobertura插件嗎? –

+0

Hi @René,我使用的是早期版本,但已升級到可用於gradle插件的最新版本https://github.com/stevesaliman/gradle-cobertura-plugin/ available @ http://mvnrepository.com/artifact /net.saliman/gradle-cobertura-plugin/2.0.0。我嘗試在項目中單獨給cobertura.enabled = false排除以及在root項目中使用「project('subprojectname'){cobertura.enabled = false}」格式,但即使使用這個最新版本,也沒有運氣,正在觸發cobertura爲那些項目排除 – Paddy

相關問題