Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将testOptions.unitTests.all转换为gradle Kotlin dsl_Gradle_Android Gradle Plugin_Gradle Kotlin Dsl - Fatal编程技术网

如何将testOptions.unitTests.all转换为gradle Kotlin dsl

如何将testOptions.unitTests.all转换为gradle Kotlin dsl,gradle,android-gradle-plugin,gradle-kotlin-dsl,Gradle,Android Gradle Plugin,Gradle Kotlin Dsl,在Gradle中如何将此代码从Groovy转换为Kotlin DSL testOptions.unitTests.all { testLogging { exceptionFormat = "full" events "passed", "failed", "standardError" showCauses true showException

在Gradle中如何将此代码从Groovy转换为Kotlin DSL

testOptions.unitTests.all {
    testLogging {
        exceptionFormat = "full"
        events "passed", "failed", "standardError"
        showCauses true
        showExceptions true
    }
}
使用以下命令:

import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent

testOptions.unitTests.apply {
    all(KotlinClosure1<Test, Test>({
        apply {
            testLogging.exceptionFormat = TestExceptionFormat.FULL
            testLogging.events = setOf(
                TestLogEvent.PASSED,
                TestLogEvent.FAILED,
                TestLogEvent.STANDARD_ERROR
            )
            testLogging.showCauses = true
            testLogging.showExceptions = true
        }
    }, this))
}
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
导入org.gradle.api.tasks.testing.logging.TestLogEvent
testOptions.unitTests.apply{
全部(KotlinClosure1)({
申请{
testLogging.exceptionFormat=TestExceptionFormat.FULL
testLogging.events=setOf(
TestLogEvent.PASSED,
TestLogEvent.0失败,
TestLogEvent.STANDARD_错误
)
testLogging.showCauses=true
testLogging.showExceptions=true
}
},本页)
}
使用以下方法:

import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent

testOptions.unitTests.apply {
    all(KotlinClosure1<Test, Test>({
        apply {
            testLogging.exceptionFormat = TestExceptionFormat.FULL
            testLogging.events = setOf(
                TestLogEvent.PASSED,
                TestLogEvent.FAILED,
                TestLogEvent.STANDARD_ERROR
            )
            testLogging.showCauses = true
            testLogging.showExceptions = true
        }
    }, this))
}
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
导入org.gradle.api.tasks.testing.logging.TestLogEvent
testOptions.unitTests.apply{
全部(KotlinClosure1)({
申请{
testLogging.exceptionFormat=TestExceptionFormat.FULL
testLogging.events=setOf(
TestLogEvent.PASSED,
TestLogEvent.0失败,
TestLogEvent.STANDARD_错误
)
testLogging.showCauses=true
testLogging.showExceptions=true
}
},本页)
}