Add test on using kotlin.coroutines property in gradle
This commit is contained in:
committed by
Stanislav Erokhin
parent
6697c902fc
commit
c0a3d3568a
+30
@@ -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
|
package org.jetbrains.kotlin.gradle
|
||||||
|
|
||||||
import org.gradle.api.logging.LogLevel
|
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
|
@Test
|
||||||
fun testConvertJavaToKotlin() {
|
fun testConvertJavaToKotlin() {
|
||||||
val project = Project("convertBetweenJavaAndKotlin", GRADLE_VERSION)
|
val project = Project("convertBetweenJavaAndKotlin", GRADLE_VERSION)
|
||||||
|
|||||||
+2
@@ -190,6 +190,8 @@ open class KotlinCompile : AbstractKotlinCompile<K2JVMCompilerArguments>(), Kotl
|
|||||||
args.coroutinesWarn = coroutines == CoroutineSupport.ENABLED_WITH_WARNING
|
args.coroutinesWarn = coroutines == CoroutineSupport.ENABLED_WITH_WARNING
|
||||||
args.coroutinesError = coroutines == CoroutineSupport.DISABLED
|
args.coroutinesError = coroutines == CoroutineSupport.DISABLED
|
||||||
|
|
||||||
|
logger.warn("Using kotlin.coroutines=${coroutines.compilerArgument}")
|
||||||
|
|
||||||
if (!incremental) {
|
if (!incremental) {
|
||||||
anyClassesCompiled = true
|
anyClassesCompiled = true
|
||||||
processCompilerExitCode(compileJvmNotIncrementally(
|
processCompilerExitCode(compileJvmNotIncrementally(
|
||||||
|
|||||||
Reference in New Issue
Block a user