Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ buildscript {
}

dependencies {
classpath "dev.icerock.moko:resources-generator:0.25.0"
classpath "dev.icerock.moko:resources-generator:0.25.1"
}
}

Expand All @@ -83,10 +83,10 @@ project build.gradle
apply plugin: "dev.icerock.mobile.multiplatform-resources"

dependencies {
commonMainApi("dev.icerock.moko:resources:0.25.0")
commonMainApi("dev.icerock.moko:resources-compose:0.25.0") // for compose multiplatform
commonMainApi("dev.icerock.moko:resources:0.25.1")
commonMainApi("dev.icerock.moko:resources-compose:0.25.1") // for compose multiplatform

commonTestImplementation("dev.icerock.moko:resources-test:0.25.0")
commonTestImplementation("dev.icerock.moko:resources-test:0.25.1")
}

multiplatformResources {
Expand Down Expand Up @@ -133,7 +133,7 @@ should [add `export` declarations](https://kotlinlang.org/docs/multiplatform-bui

```
framework {
export("dev.icerock.moko:resources:0.25.0")
export("dev.icerock.moko:resources:0.25.1")
export("dev.icerock.moko:graphics:0.9.0") // toUIColor here
}
```
Expand Down
2 changes: 1 addition & 1 deletion gradle/moko.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
resourcesVersion = "0.25.0"
resourcesVersion = "0.25.1"

[libraries]
resources = { module = "dev.icerock.moko:resources", version.ref = "resourcesVersion" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ kotlin.targets

fun KonanTarget.getAppleSdk(): String {
return when (this) {
KonanTarget.IOS_ARM32,
KonanTarget.IOS_ARM64 -> "iphoneos"

KonanTarget.IOS_SIMULATOR_ARM64,
Expand All @@ -124,16 +123,14 @@ fun KonanTarget.getAppleSdk(): String {

KonanTarget.WATCHOS_ARM64,
KonanTarget.WATCHOS_SIMULATOR_ARM64,
KonanTarget.WATCHOS_X64,
KonanTarget.WATCHOS_X86 -> "watchsimulator"
KonanTarget.WATCHOS_X64 -> "watchsimulator"

else -> error("Unsupported target for selecting SDK: $this")
}
}

fun KonanTarget.getClangTarget(): String {
return when (this) {
KonanTarget.IOS_ARM32 -> "armv7-apple-ios"
KonanTarget.IOS_ARM64 -> "aarch64-apple-ios"
KonanTarget.IOS_SIMULATOR_ARM64 -> "aarch64-apple-ios-simulator"
KonanTarget.IOS_X64 -> "x86_64-apple-ios-simulator"
Expand All @@ -150,7 +147,6 @@ fun KonanTarget.getClangTarget(): String {
KonanTarget.WATCHOS_DEVICE_ARM64 -> "aarch64-apple-watchos"
KonanTarget.WATCHOS_SIMULATOR_ARM64 -> "aarch64-apple-watchos-simulator"
KonanTarget.WATCHOS_X64 -> "x86_64-apple-watchos-simulator"
KonanTarget.WATCHOS_X86 -> "i386-apple-watchos"

else -> error("Unsupported target for selecting clang target: $this")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ internal object AppleSdk {
targets.addAll(archs.map { arch ->
when (arch) {
"arm64", "arm64e" -> KonanTarget.IOS_ARM64
"armv7", "armv7s" -> KonanTarget.IOS_ARM32
else -> throw UnknownArchitectureException(platform, arch)
}
})
Expand Down Expand Up @@ -51,7 +50,6 @@ internal object AppleSdk {
targets.addAll(archs.map { arch ->
when (arch) {
"arm64", "arm64e" -> KonanTarget.WATCHOS_SIMULATOR_ARM64
"i386" -> KonanTarget.WATCHOS_X86
"x86_64" -> KonanTarget.WATCHOS_X64
else -> throw UnknownArchitectureException(platform, arch)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ internal fun <T> createByPlatform(
KotlinPlatformType.androidJvm -> createAndroid()
KotlinPlatformType.js -> createJs()
KotlinPlatformType.native -> when (konanTarget()) {
KonanTarget.IOS_ARM32,
KonanTarget.IOS_ARM64,
KonanTarget.IOS_SIMULATOR_ARM64,
KonanTarget.IOS_X64,
Expand All @@ -42,26 +41,9 @@ internal fun <T> createByPlatform(
KonanTarget.WATCHOS_ARM64,
KonanTarget.WATCHOS_DEVICE_ARM64,
KonanTarget.WATCHOS_SIMULATOR_ARM64,
KonanTarget.WATCHOS_X64,
KonanTarget.WATCHOS_X86 -> createApple()
KonanTarget.WATCHOS_X64 -> createApple()

KonanTarget.ANDROID_ARM32,
KonanTarget.ANDROID_ARM64,
KonanTarget.ANDROID_X64,
KonanTarget.ANDROID_X86,

KonanTarget.LINUX_ARM32_HFP,
KonanTarget.LINUX_ARM64,
KonanTarget.LINUX_MIPS32,
KonanTarget.LINUX_MIPSEL32,
KonanTarget.LINUX_X64,

KonanTarget.MINGW_X64,
KonanTarget.MINGW_X86,

KonanTarget.WASM32,

is KonanTarget.ZEPHYR -> error("$konanTarget not supported by moko-resources now")
else -> error("${konanTarget()} not supported by moko-resources now")
}

KotlinPlatformType.wasm -> createWasm()
Expand Down
15 changes: 6 additions & 9 deletions samples/kotlin-2-tests/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
allprojects {
repositories {
google()
mavenCentral()
mavenLocal()
}
}

plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
Expand All @@ -15,7 +7,12 @@ plugins {
alias(libs.plugins.kotlin.native.cocoapods) apply false
alias(libs.plugins.sqldelight) apply false
alias(libs.plugins.compose.multiplatform) apply false
alias(libs.plugins.moko.resources) apply false
alias(libs.plugins.paparazzi) apply false
alias(libs.plugins.licenses) apply false
}

buildscript{
dependencies {
classpath(moko.resourcesGradlePlugin)
}
}
3 changes: 1 addition & 2 deletions samples/kotlin-2-tests/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ uuid = "0.8.4"
kodein = "7.23.1"
moko-resources = "0.24.5"
wrappers = "1.0.0-pre.839"
kotlin = "2.1.0"
kotlin = "2.2.20"
compose-multiplatform = "1.7.1"
paparazzi = "1.3.4"
kotest = "5.9.1"
Expand Down Expand Up @@ -60,7 +60,6 @@ robolectric = { group = "org.robolectric", name = "robolectric", version.ref = "
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
sqldelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" }
moko-resources = { id = "dev.icerock.mobile.multiplatform-resources", version.ref = "moko-resources" }
compose-multiplatform = { id = "org.jetbrains.compose", version.ref = "compose-multiplatform" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-plugin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
Expand Down
18 changes: 16 additions & 2 deletions samples/kotlin-2-tests/local-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,19 @@ log() {
echo "\033[0;32m> $1\033[0m"
}

./gradlew clean build
log "kotlin-2-test build success"
./gradlew clean assembleDebug
log "kotlin-2-tests mobile android success"

if ! command -v xcodebuild &> /dev/null
then
log "xcodebuild could not be found, skip ios checks"

./gradlew test lint
log "kotlin-2-tests test success"

./gradlew assembleDebug assembleRelease jsJar jvmJar
log "kotlin-2-tests build success"
else
./gradlew build
log "kotlin-2-tests success"
fi
14 changes: 14 additions & 0 deletions samples/kotlin-2-tests/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,17 @@ pluginManagement {
mavenLocal()
}
}

dependencyResolutionManagement {
repositories {
google()
mavenCentral()
mavenLocal()
}

versionCatalogs {
create("moko") {
from(files("../../gradle/moko.versions.toml"))
}
}
}
2 changes: 1 addition & 1 deletion samples/kotlin-2-tests/shared/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.moko.resources)
id("dev.icerock.mobile.multiplatform-resources")
}

kotlin {
Expand Down
Loading