-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Coverage report not picked-up using Gradle Managed Devices and f…
…lavors Fixes: #102
- Loading branch information
Showing
18 changed files
with
179 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
plugin/src/test/test-fixtures/multi-module/library_android_flavors/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
72 changes: 72 additions & 0 deletions
72
plugin/src/test/test-fixtures/multi-module/library_android_flavors/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
plugins { | ||
id "com.android.library" | ||
alias(libs.plugins.kotlinAndroid) | ||
} | ||
|
||
android { | ||
|
||
namespace "org.neotech.library.flavors" | ||
compileSdkVersion libs.versions.androidCompileSdk.get().toInteger() | ||
|
||
defaultConfig { | ||
minSdkVersion libs.versions.androidMinSdk.get().toInteger() | ||
targetSdkVersion libs.versions.androidTargetSdk.get().toInteger() | ||
versionCode 1 | ||
versionName "1.0" | ||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
buildFeatures { | ||
buildConfig false | ||
} | ||
|
||
buildTypes { | ||
debug { | ||
|
||
testCoverageEnabled true | ||
} | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
|
||
flavorDimensions = ["version"] | ||
productFlavors { | ||
demo { | ||
dimension "version" | ||
} | ||
full { | ||
dimension "version" | ||
} | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
|
||
testOptions { | ||
managedDevices { | ||
devices { | ||
nexusoneapi30 (com.android.build.api.dsl.ManagedVirtualDevice) { | ||
device = "Nexus One" | ||
apiLevel = 30 | ||
systemImageSource = "aosp-atd" | ||
} | ||
} | ||
} | ||
} | ||
|
||
kotlinOptions { | ||
jvmTarget = "17" | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation libs.appCompat | ||
|
||
testImplementation libs.bundles.androidTest | ||
androidTestImplementation libs.bundles.androidInstrumentedTest | ||
} |
21 changes: 21 additions & 0 deletions
21
plugin/src/test/test-fixtures/multi-module/library_android_flavors/proguard-rules.pro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
15 changes: 15 additions & 0 deletions
15
...t/java/org/neotech/library/android/flavors/LibraryAndroidFlavorsKotlinInstrumentedTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.neotech.library.android.flavors | ||
|
||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import org.junit.Assert | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
class LibraryAndroidFlavorsKotlinInstrumentedTest { | ||
|
||
@Test | ||
fun touch() { | ||
LibraryAndroidFlavorsKotlin.touchedByInstrumentedTest() | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
.../src/test/test-fixtures/multi-module/library_android_flavors/src/main/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<manifest /> |
12 changes: 12 additions & 0 deletions
12
..._flavors/src/main/java/org/neotech/library/android/flavors/LibraryAndroidFlavorsKotlin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.neotech.library.android.flavors | ||
|
||
object LibraryAndroidFlavorsKotlin { | ||
|
||
fun touchedByUnitTest(): String { | ||
return "touchedByUnitTest" | ||
} | ||
|
||
fun touchedByInstrumentedTest(): String { | ||
return "touchedByInstrumentedTest" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...c/test/test-fixtures/multi-module/library_android_flavors/src/main/res/values/strings.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<resources> | ||
<string name="app_name">Library Android Flavors</string> | ||
</resources> |
12 changes: 12 additions & 0 deletions
12
.../src/test/java/org/neotech/library/android/flavors/LibraryAndroidFlavorsKotlinUnitTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.neotech.library.android.flavors | ||
|
||
import org.junit.Assert | ||
import org.junit.Test | ||
|
||
class LibraryAndroidFlavorsKotlinUnitTest { | ||
|
||
@Test | ||
fun touch() { | ||
LibraryAndroidFlavorsKotlin.touchedByUnitTest() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters