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:
Alexey Tsvetkov
2018-06-01 01:35:05 +03:00
parent 44a845eca9
commit 3ccaae249a
11 changed files with 54 additions and 30 deletions
@@ -206,7 +206,7 @@ abstract class AbstractKotlinAndroidGradleTests(
val getSomethingKt = project.projectDir.walk().filter { it.isFile && it.name.endsWith("getSomething.kt") }.first()
getSomethingKt.writeText(
"""
package foo
package com.example
fun getSomething() = 10
"""
@@ -214,8 +214,12 @@ fun getSomething() = 10
project.build("assembleDebug", options = options) {
assertSuccessful()
assertCompiledKotlinSources(listOf("app/src/main/kotlin/foo/KotlinActivity1.kt", "app/src/main/kotlin/foo/getSomething.kt"))
assertCompiledJavaSources(listOf("app/src/main/java/foo/JavaActivity.java"), weakTesting = true)
val affectedKotlinFiles = listOf(
"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)
}
}
@@ -20,7 +20,7 @@ android {
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "foo"
applicationId "com.example"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
@@ -1,5 +1,5 @@
<?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>
<activity android:name=".JavaActivity">
@@ -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();
}
}
@@ -1,9 +0,0 @@
package foo;
import android.app.Activity;
public class JavaActivity extends Activity {
void f() {
foo.GetSomethingKt.getSomething();
}
}
@@ -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()
}
@@ -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()
@@ -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!"
@@ -1,8 +0,0 @@
package foo
import android.app.Activity
open class KotlinActivity1 : Activity() {
val usage = getSomething()
}
@@ -1,5 +0,0 @@
package foo
import android.app.Activity
open class KotlinActivity2 : Activity()