Move Android test from foo to com.example package
Otherwise the test `KotlinAndroid32GradleIT.testIncrementalCompile` failed with Android resource linking failed error: "attribute 'package' in <manifest> tag is not a valid Android package name: 'foo'."
This commit is contained in:
+7
-3
@@ -206,7 +206,7 @@ abstract class AbstractKotlinAndroidGradleTests(
|
|||||||
val getSomethingKt = project.projectDir.walk().filter { it.isFile && it.name.endsWith("getSomething.kt") }.first()
|
val getSomethingKt = project.projectDir.walk().filter { it.isFile && it.name.endsWith("getSomething.kt") }.first()
|
||||||
getSomethingKt.writeText(
|
getSomethingKt.writeText(
|
||||||
"""
|
"""
|
||||||
package foo
|
package com.example
|
||||||
|
|
||||||
fun getSomething() = 10
|
fun getSomething() = 10
|
||||||
"""
|
"""
|
||||||
@@ -214,8 +214,12 @@ fun getSomething() = 10
|
|||||||
|
|
||||||
project.build("assembleDebug", options = options) {
|
project.build("assembleDebug", options = options) {
|
||||||
assertSuccessful()
|
assertSuccessful()
|
||||||
assertCompiledKotlinSources(listOf("app/src/main/kotlin/foo/KotlinActivity1.kt", "app/src/main/kotlin/foo/getSomething.kt"))
|
val affectedKotlinFiles = listOf(
|
||||||
assertCompiledJavaSources(listOf("app/src/main/java/foo/JavaActivity.java"), weakTesting = true)
|
"app/src/main/kotlin/com/example/KotlinActivity1.kt",
|
||||||
|
"app/src/main/kotlin/com/example/getSomething.kt"
|
||||||
|
)
|
||||||
|
assertCompiledKotlinSources(affectedKotlinFiles)
|
||||||
|
assertCompiledJavaSources(listOf("app/src/main/java/com/example/JavaActivity.java"), weakTesting = true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ android {
|
|||||||
buildToolsVersion "25.0.2"
|
buildToolsVersion "25.0.2"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "foo"
|
applicationId "com.example"
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 23
|
targetSdkVersion 23
|
||||||
versionCode 1
|
versionCode 1
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="foo" >
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example" >
|
||||||
|
|
||||||
<application>
|
<application>
|
||||||
<activity android:name=".JavaActivity">
|
<activity android:name=".JavaActivity">
|
||||||
|
|||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
/*
|
||||||
|
* 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;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
|
||||||
|
public class JavaActivity extends Activity {
|
||||||
|
void f() {
|
||||||
|
GetSomethingKt.getSomething();
|
||||||
|
}
|
||||||
|
}
|
||||||
-9
@@ -1,9 +0,0 @@
|
|||||||
package foo;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
|
|
||||||
public class JavaActivity extends Activity {
|
|
||||||
void f() {
|
|
||||||
foo.GetSomethingKt.getSomething();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
|
|
||||||
|
open class KotlinActivity1 : Activity() {
|
||||||
|
val usage = getSomething()
|
||||||
|
}
|
||||||
|
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
/*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
|
|
||||||
|
open class KotlinActivity2 : Activity()
|
||||||
+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
|
||||||
|
|
||||||
|
fun getSomething() = "Hello, world!"
|
||||||
-8
@@ -1,8 +0,0 @@
|
|||||||
package foo
|
|
||||||
|
|
||||||
import android.app.Activity
|
|
||||||
|
|
||||||
open class KotlinActivity1 : Activity() {
|
|
||||||
val usage = getSomething()
|
|
||||||
}
|
|
||||||
|
|
||||||
-5
@@ -1,5 +0,0 @@
|
|||||||
package foo
|
|
||||||
|
|
||||||
import android.app.Activity
|
|
||||||
|
|
||||||
open class KotlinActivity2 : Activity()
|
|
||||||
-3
@@ -1,3 +0,0 @@
|
|||||||
package foo
|
|
||||||
|
|
||||||
fun getSomething() = "Hello, world!"
|
|
||||||
Reference in New Issue
Block a user