-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for android source-set layout version 2 (fixes #53)
- Loading branch information
1 parent
212386d
commit 699a2c4
Showing
11 changed files
with
145 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
plugins { | ||
alias(kodeinGlobals.plugins.android.library) | ||
alias(kodeinGlobals.plugins.kotlin.multiplatform) | ||
id("org.kodein.mock.mockmp") | ||
} | ||
|
||
repositories { | ||
mavenLocal() | ||
google() | ||
mavenCentral() | ||
} | ||
|
||
android { | ||
namespace = "org.kodein.mock.tests_android" | ||
compileSdk = 32 | ||
|
||
defaultConfig { | ||
minSdk = 21 | ||
targetSdk = 32 | ||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
} | ||
|
||
kotlin { | ||
android() | ||
ios() | ||
|
||
sourceSets { | ||
val commonMain by getting { | ||
kotlin.srcDir("$rootDir/../../tests/tests-junit4/src/commonMain/kotlin") | ||
dependencies { | ||
implementation(libs.datetime) | ||
} | ||
} | ||
val commonTest by getting { | ||
kotlin.srcDir("$rootDir/../../tests/tests-junit4/src/commonTest/kotlin") | ||
dependencies { | ||
implementation(libs.coroutines.test) | ||
} | ||
} | ||
|
||
val androidUnitTest by getting { | ||
dependencies { | ||
implementation(kodeinGlobals.kotlin.test.junit) | ||
} | ||
} | ||
} | ||
} | ||
|
||
mockmp { | ||
usesHelper = true | ||
} | ||
|
||
// Showing tests in Gradle command line | ||
afterEvaluate { | ||
tasks.withType<AbstractTestTask> { | ||
testLogging { | ||
events("passed", "skipped", "failed", "standard_out", "standard_error") | ||
showExceptions = true | ||
showStackTraces = true | ||
} | ||
} | ||
} |
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,5 @@ | ||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 | ||
|
||
android.useAndroidX=true | ||
android.nonTransitiveRClass=true | ||
kotlin.mpp.androidSourceSetLayoutVersion=2 |
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,44 @@ | ||
pluginManagement { | ||
repositories { | ||
mavenLocal() | ||
gradlePluginPortal() | ||
google() | ||
mavenCentral() | ||
} | ||
|
||
resolutionStrategy.eachPlugin { | ||
if (target.id.id == "org.kodein.mock.mockmp") { | ||
val rx = Regex("version = \"(.+)\"") | ||
val match = file("$rootDir/../../build.gradle.kts").useLines { lines -> | ||
lines.mapNotNull { rx.matchEntire(it.trim()) }.firstOrNull() | ||
} ?: error("Could not find parent project version") | ||
val mockmpVersion = match.groupValues[1] | ||
|
||
useModule("org.kodein.mock:mockmp-gradle-plugin:$mockmpVersion") | ||
} | ||
} | ||
} | ||
|
||
@Suppress("UnstableApiUsage") | ||
dependencyResolutionManagement { | ||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
maven(url = "https://raw.githubusercontent.com/kosi-libs/kodein-internal-gradle-plugin/mvn-repo") | ||
} | ||
|
||
versionCatalogs { | ||
create("kodeinGlobals") { | ||
val rx = Regex("classpath\\(\"org.kodein.internal.gradle:kodein-internal-gradle-settings:(.+)\"\\)") | ||
val match = file("$rootDir/../../settings.gradle.kts").useLines { lines -> | ||
lines.mapNotNull { rx.matchEntire(it.trim()) }.firstOrNull() | ||
} ?: error("Could not find parent KIGP version") | ||
val kigpVersion = match.groupValues[1] | ||
|
||
from("org.kodein.internal.gradle:kodein-internal-gradle-version-catalog:$kigpVersion") | ||
} | ||
create("libs") { | ||
from(files("../../gradle/libs.versions.toml")) | ||
} | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
tests-projects/tests-android-new/src/androidMain/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,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<application android:icon="@mipmap/ic_launcher" /> | ||
|
||
</manifest> |
Binary file added
BIN
+3.75 KB
tests-projects/tests-android-new/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.webp
Binary file not shown.
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