Test for KT-25051
This commit is contained in:
+8
@@ -236,6 +236,14 @@ fun getSomething() = 10
|
|||||||
assertCompiledKotlinSources(project.relativize(affectedSources), weakTesting = false)
|
assertCompiledKotlinSources(project.relativize(affectedSources), weakTesting = false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val libAndroidClassesOnlyUtilKt = project.projectDir.getFileByName("LibAndroidClassesOnlyUtil.kt")
|
||||||
|
libAndroidClassesOnlyUtilKt.modify { it.replace("fun libAndroidClassesOnlyUtil(): String", "fun libAndroidClassesOnlyUtil(): CharSequence") }
|
||||||
|
project.build("assembleDebug", options = options) {
|
||||||
|
assertSuccessful()
|
||||||
|
val affectedSources = project.projectDir.getFilesByNames("LibAndroidClassesOnlyUtil.kt", "useLibAndroidClassesOnlyUtil.kt")
|
||||||
|
assertCompiledKotlinSources(project.relativize(affectedSources), weakTesting = false)
|
||||||
|
}
|
||||||
|
|
||||||
val libJvmUtilKt = project.projectDir.getFileByName("LibJvmUtil.kt")
|
val libJvmUtilKt = project.projectDir.getFileByName("LibJvmUtil.kt")
|
||||||
libJvmUtilKt.modify { it.replace("fun libJvmUtil(): String", "fun libJvmUtil(): CharSequence") }
|
libJvmUtilKt.modify { it.replace("fun libJvmUtil(): String", "fun libJvmUtil(): CharSequence") }
|
||||||
project.build("assembleDebug", options = options) {
|
project.build("assembleDebug", options = options) {
|
||||||
|
|||||||
+1
@@ -20,4 +20,5 @@ dependencies {
|
|||||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
compile project(":libJvmClassesOnly")
|
compile project(":libJvmClassesOnly")
|
||||||
compile project(":libAndroid")
|
compile project(":libAndroid")
|
||||||
|
compile project(":libAndroidClassesOnly")
|
||||||
}
|
}
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||||
|
* that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.example
|
||||||
|
|
||||||
|
fun useLibAndroidClassesOnlyUtil() =
|
||||||
|
LibAndroidClassesOnlyUtil().libAndroidClassesOnlyUtil()
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
apply plugin: 'com.android.library'
|
||||||
|
apply plugin: 'kotlin-android'
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion 23
|
||||||
|
buildToolsVersion "25.0.2"
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdkVersion 14
|
||||||
|
targetSdkVersion 23
|
||||||
|
versionCode 1
|
||||||
|
versionName "1.0"
|
||||||
|
}
|
||||||
|
buildTypes.release.minifyEnabled = false
|
||||||
|
lintOptions.abortOnError = false
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
|
}
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.lib2" >
|
||||||
|
</manifest>
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||||
|
* that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.example
|
||||||
|
|
||||||
|
class LibAndroidClassesOnlyDummy
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||||
|
* that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.example
|
||||||
|
|
||||||
|
class LibAndroidClassesOnlyUtil {
|
||||||
|
fun libAndroidClassesOnlyUtil(): String =
|
||||||
|
"Hello, World"
|
||||||
|
}
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
include ':app', ':libAndroid', ':libJvmClassesOnly'
|
include ':app', ':libAndroid', ':libAndroidClassesOnly', ':libJvmClassesOnly'
|
||||||
|
|||||||
Reference in New Issue
Block a user