mirror of
https://github.com/bitsycore/skiko.git
synced 2026-10-05 14:37:26 +00:00
- Upgrade Gradle wrappers to `9.5.0` across root and sample projects. - Migrate Android build logic to AGP 9-compatible APIs (including KMP Android integration updates). - Fix `SkiaMultiplatformSample` iOS simulator run flow: - remove `applePlugin` usage - replace invalid simctl spawn `--standalone <kexe>` with app bundle install + launch - add `-Pskiko.iosSimulatorDevice=<device>` for simulator targeting - fix `IosClocks` renderApi reference typo - Disable Kotlin JS Yarn lock generation in JS-enabled projects
93 lines
2.4 KiB
Kotlin
93 lines
2.4 KiB
Kotlin
import com.android.build.gradle.tasks.MergeSourceSetFolders
|
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
|
|
repositories {
|
|
mavenLocal()
|
|
google()
|
|
mavenCentral {
|
|
url = uri("https://cache-redirector.jetbrains.com/maven-central")
|
|
}
|
|
maven("https://redirector.kotlinlang.org/maven/compose-dev")
|
|
}
|
|
|
|
plugins {
|
|
id("com.android.application") version "9.0.0"
|
|
}
|
|
|
|
val skikoNativeX64 by configurations.creating
|
|
val skikoNativeArm64 by configurations.creating
|
|
|
|
val jniDir = "${projectDir.absolutePath}/src/main/jniLibs"
|
|
|
|
// TODO: filter .so files only.
|
|
val unzipTaskX64 = tasks.register("unzipNativeX64", Copy::class) {
|
|
destinationDir = file("$jniDir/x86_64")
|
|
from({ skikoNativeX64.files.map { zipTree(it) } })
|
|
}
|
|
|
|
val unzipTaskArm64 = tasks.register("unzipNativeArm64", Copy::class) {
|
|
destinationDir = file("$jniDir/arm64-v8a")
|
|
from({ skikoNativeArm64.files.map { zipTree(it) } })
|
|
}
|
|
|
|
android {
|
|
compileSdk = 35
|
|
namespace = "org.jetbrains.skiko.sample"
|
|
defaultConfig {
|
|
minSdk = 27
|
|
targetSdk = 35
|
|
versionCode = 1
|
|
versionName = "1.0"
|
|
|
|
applicationId = "org.jetbrains.skiko.sample"
|
|
|
|
ndk {
|
|
abiFilters += listOf("x86_64", "arm64-v8a")
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
isDebuggable = true
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
targetCompatibility = JavaVersion.VERSION_11
|
|
}
|
|
}
|
|
|
|
var version = if (project.hasProperty("skiko.version")) {
|
|
project.properties["skiko.version"] as String
|
|
} else {
|
|
"0.0.0-SNAPSHOT"
|
|
}
|
|
|
|
dependencies {
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0")
|
|
implementation("org.jetbrains.skiko:skiko-android:$version")
|
|
|
|
skikoNativeX64("org.jetbrains.skiko:skiko-android-runtime-x64:$version")
|
|
skikoNativeArm64("org.jetbrains.skiko:skiko-android-runtime-arm64:$version")
|
|
}
|
|
|
|
kotlin {
|
|
compilerOptions {
|
|
jvmTarget.set(JvmTarget.JVM_11)
|
|
}
|
|
}
|
|
|
|
// SKIKO-934: we need to unpack these libraries before Android collects JNI libs.
|
|
tasks.withType<MergeSourceSetFolders>().configureEach {
|
|
if (name.endsWith("JniLibFolders")) {
|
|
dependsOn(unzipTaskX64)
|
|
dependsOn(unzipTaskArm64)
|
|
}
|
|
}
|
|
|
|
tasks.withType<Copy> {
|
|
// This line needs to properly merge MANIFEST files from jars into dex
|
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
}
|