import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.serialization) alias(libs.plugins.android.library) alias(libs.plugins.detekt) } group = "net.kukuri" version = "0.1.0" kotlin { jvm() androidTarget { compilations.all { kotlinOptions { jvmTarget = "17" } } } @OptIn(ExperimentalWasmDsl::class) wasmJs { nodejs() browser() binaries.executable() } linuxX64 { binaries.executable() } listOf( iosArm64(), iosSimulatorArm64(), iosX64(), ).forEach { target -> // static framework (build/bin//Framework/kukuri.framework) target.binaries.framework { baseName = "kukuri" isStatic = true } } sourceSets { commonMain.dependencies { implementation(libs.coroutines.core) implementation(libs.serialization.json) implementation(libs.datetime) implementation(libs.koin.core) implementation(libs.okio) } commonTest.dependencies { implementation(libs.kotlin.test) implementation(libs.coroutines.test) } } } android { namespace = "net.kukuri.domain" compileSdk = 35 defaultConfig { minSdk = 24 } compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } lint { checkReleaseBuilds = false abortOnError = false } } detekt { buildUponDefaultConfig = true source.setFrom("src/commonMain/kotlin", "src/jvmMain/kotlin") parallel = true } tasks.named("jvmJar") { manifest { attributes["Main-Class"] = "kukuri.MainKt" } } // ---- Deployment bundles (buildbot Deploy -> /artifact/kukuri/latest) ---- // Desktop launcher script (generated inline; keeps the repo free of a ci/ dir). val generateDesktopLauncher by tasks.registering { val out = layout.buildDirectory.file("launcher/kukuri.sh") outputs.file(out) doLast { val f = out.get().asFile f.parentFile.mkdirs() f.writeText( "#!/usr/bin/env sh\n" + "# Desktop launcher - resolves the module jvm jar next to this script's lib/ dir.\n" + "DIR=\$(CDPATH= cd -- \"\$(dirname -- \"\$0\")\" && pwd)\n" + "JAR=\$(ls \"\$DIR\"/../lib/*-jvm-*.jar 2>/dev/null | head -1)\n" + "exec java -jar \"\$JAR\" \"\$@\"\n", ) f.setExecutable(true) } } tasks.register("bundleDesktop") { group = "deployment" dependsOn(project(":apps:desktop").tasks.named("desktopFatJar")) dependsOn(generateDesktopLauncher) from(project(":apps:desktop").layout.buildDirectory.dir("app")) { into("lib") } from(generateDesktopLauncher.map { it.outputs.files.singleFile }) { into("bin") filePermissions { unix("rwxr-xr-x") } } archiveFileName.set("kukuri-desktop-${project.version}.zip") } tasks.register("bundleWasmNode") { group = "deployment" dependsOn("assemble") from(rootProject.layout.buildDirectory.dir("js/packages/kukuri-modules-orgflow-domain-wasm-js")) archiveFileName.set("kukuri-wasm-node-${project.version}.zip") } tasks.register("bundleWeb") { group = "deployment" dependsOn(project(":modules:orgflow-ui").tasks.named("wasmJsBrowserDistribution")) from(project(":modules:orgflow-ui").layout.buildDirectory.dir("dist/wasmJs/productionExecutable")) archiveFileName.set("kukuri-wasm-web-${project.version}.zip") } tasks.register("bundleNative") { group = "deployment" dependsOn("assemble") from(layout.buildDirectory.dir("bin/linuxX64/releaseExecutable")) { include("*.kexe") } // normalize the binary name inside the zip (kexe is named after the project) val kexeName = "kukuri.kexe" rename { kexeName } archiveFileName.set("kukuri-native-linuxx64-${project.version}.zip") } // Debug-signed APK so the artifact installs without a release keystore. tasks.register("bundleApk") { group = "deployment" dependsOn(project(":apps:android").tasks.named("assembleDebug")) from(project(":apps:android").layout.buildDirectory.dir("outputs/apk/debug")) include("*.apk") // local String capture only - keeps the task configuration-cache safe val artifactName = "kukuri-android-$version.apk" rename { artifactName } into(layout.buildDirectory.dir("distributions")) }