2017-07-04 10 views
0

Gradle 3.1とGradle play pluginを使いたいです。私は仕事を追加する必要があります。Gradle playプラグインのプロパティtestClassesDesleがgradleにありません。

4.0から3.1までの下のスニペットを解析するのに役立つことができますか? あなたが言ったように私は

task doesNotWorkIn3_1(type: Test) { 

    dependsOn { tasks.compilePlayBinaryTests } 
    testClassesDirs = project.files { [tasks.compilePlayBinaryTests.destinationDir] } 
    classpath = project.files { testPlayBinary.classpath } 
    include '**/SwaggerControllerJsonTest.class' 
    outputs.upToDateWhen { false } 
} 

答えて

0
task genSwaggerJson(type: Test) { 
    dependsOn { tasks.compilePlayBinaryTests } 
    testClassesDir = file("$buildDir/genSwaggerJson_testClasses") 
    classpath = files({ tasks.testPlayBinary.classpath }) 
    outputs.upToDateWhen { false } 
    include '**/MySingleTest.class' 
} 

この1つはお返事3.1

0

のGradle 3.1に類似した性質testClassesDirsを見つけることができない、問題はそれがGradleの4.xではなく、Gradleの3.1に存在し、testClassesDirsです。

だから、これが動作するかどうか、私に教えてください

testClassesDir = tasks.compilePlayBinaryTests.destinationDir 

testClassesDirsの=のproject.files {[tasks.compilePlayBinaryTests.destinationDir]}

を更新してください。

+0

感謝のために正常に動作しますが、それは助けにはなりませんでした。私は自分自身で答えを提供しました – Sergey

+0

@ Sergey私はあなたの答えと私の違いを見ていない、何がエラーですか? – chenrui

+0

また、私は何とか自分の答えがあなたの元の質問とは違うと思う(ファイルフォルダの観点から)。 – chenrui

関連する問題