From c0a3d3568ac5e9c12a9ee057b788407145f2cb5d Mon Sep 17 00:00:00 2001 From: Mikhail Zarechenskiy Date: Thu, 15 Dec 2016 11:38:57 +0300 Subject: [PATCH] Add test on using kotlin.coroutines property in gradle --- .../kotlin/gradle/KotlinGradlePluginIT.kt | 30 +++++++++++++++++++ .../jetbrains/kotlin/gradle/tasks/Tasks.kt | 2 ++ 2 files changed, 32 insertions(+) diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt index d2de8b9546c..f79a33380dc 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2010-2016 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.kotlin.gradle import org.gradle.api.logging.LogLevel @@ -200,6 +216,20 @@ class KotlinGradleIT: BaseGradleIT() { } } + @Test + fun testCoroutinesPropertyFromLocalPropertiesFile() { + val project = Project("kotlinCoroutinesProject", GRADLE_VERSION) + project.setupWorkingDir() + + val localPropertyFile = File(project.projectDir, "local.properties") + val coroutinesProperty = "kotlin.coroutines=error" + localPropertyFile.writeText(coroutinesProperty) + + project.build("build") { + assertContains(coroutinesProperty) + } + } + @Test fun testConvertJavaToKotlin() { val project = Project("convertBetweenJavaAndKotlin", GRADLE_VERSION) diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt index d2f10262832..22735beba17 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt @@ -190,6 +190,8 @@ open class KotlinCompile : AbstractKotlinCompile(), Kotl args.coroutinesWarn = coroutines == CoroutineSupport.ENABLED_WITH_WARNING args.coroutinesError = coroutines == CoroutineSupport.DISABLED + logger.warn("Using kotlin.coroutines=${coroutines.compilerArgument}") + if (!incremental) { anyClassesCompiled = true processCompilerExitCode(compileJvmNotIncrementally(