mirror of
https://github.com/bitsycore/skiko.git
synced 2026-10-05 06:27:26 +00:00
[SKIKO-1066](https://youtrack.jetbrains.com/issue/SKIKO-1066) Support glibc 2.27 [CMP-9307](https://youtrack.jetbrains.com/issue/CMP-9307) Support glibc 2.27 - Added `linux-compat` docker image based on #1123. It works on both x64 and arm64 architectures - `multistrap` tool was replaced by installing required packages inside `linux-compat` and `linux-amd64` docker images - `linux-arm64` uses GCC instead of clang (aligning between distributions) - GitHub checks now use precompiled docker images to reuse the same environment - `ci.yml` and `web.yml` were combined into `tests.yml` - `publishToMavenLocal` checks are moved to `publish-dry-run.yml` - Add building an Android sample as part of CI checks --------- Co-authored-by: Vladislav.Ertel <vladislav.ertel@jetbrains.com>
108 lines
2.8 KiB
Kotlin
108 lines
2.8 KiB
Kotlin
import com.android.build.gradle.tasks.MergeSourceSetFolders
|
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
|
|
|
buildscript {
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
|
|
}
|
|
|
|
dependencies {
|
|
classpath("com.android.tools.build:gradle:8.9.0")
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
mavenLocal()
|
|
google()
|
|
mavenCentral()
|
|
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
|
|
}
|
|
|
|
plugins {
|
|
id("com.android.application") version "8.9.0"
|
|
kotlin("android") version "1.9.21"
|
|
}
|
|
|
|
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.map { zipTree(it) })
|
|
}
|
|
|
|
val unzipTaskArm64 = tasks.register("unzipNativeArm64", Copy::class) {
|
|
destinationDir = file("$jniDir/arm64-v8a")
|
|
from(skikoNativeArm64.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")
|
|
}
|
|
|
|
tasks.withType<KotlinJvmCompile>().configureEach {
|
|
compilerOptions {
|
|
jvmTarget.set(JvmTarget.JVM_11)
|
|
}
|
|
dependsOn(unzipTaskX64)
|
|
dependsOn(unzipTaskArm64)
|
|
}
|
|
|
|
// SKIKO-934: we need to unpack these libraries before these are collected from android
|
|
// TODO the tasks we're actually targetting are mergeDebugJniLibFolders and mergeReleaseJniLibFolders,
|
|
// this adds unncessary dependencies
|
|
tasks.withType<MergeSourceSetFolders>()
|
|
.configureEach {
|
|
dependsOn(unzipTaskX64)
|
|
dependsOn(unzipTaskArm64)
|
|
}
|
|
|
|
tasks.withType<Copy> {
|
|
// This line needs to properly merge MANIFEST files from jars into dex
|
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
}
|