我有一个带有两个单元测试的 Android 库项目,以及在 Gradle 中定义的那些任务:
task("cleanProject", dependsOn: "clean", group: "myGroup")
task("generateAAR", dependsOn: "assembleRelease", group: "myGroup")
task("copyAAR", type: Copy, group: "myGroup") {
from "${project.rootDir}/project/build/outputs/aar"
into "${project.rootDir}/mydir/aar"
}
我尝试通过添加以下 .yml 来使用 Azure 管道:
- task: Gradle@2
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
tasks: 'cleanProject'
displayName: Clean Project
- task: Gradle@2
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
tasks: 'testReleaseUnitTest'
displayName: Release Unit Test
- task: Gradle@2
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
tasks: 'generateAAR'
displayName: Generate AAR Lib
- task: Gradle@2
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
tasks: 'copyAAR'
displayName: Copy AAR Lib
它运行良好,但我注意到该测试也在 generateAAR 和 copyAAR 任务上执行,总共有 6 个测试通过。有没有办法从特定任务或管道中排除测试?
提前致谢。