|
@@ -1,7 +1,8 @@
|
|
|
import org.gradle.internal.os.OperatingSystem
|
|
import org.gradle.internal.os.OperatingSystem
|
|
|
|
|
+import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
|
|
|
|
|
|
|
plugins {
|
|
plugins {
|
|
|
- val kotlinVersion = "2.2.0"
|
|
|
|
|
|
|
+ val kotlinVersion = "2.2.21"
|
|
|
kotlin("multiplatform") version kotlinVersion
|
|
kotlin("multiplatform") version kotlinVersion
|
|
|
kotlin("plugin.serialization") version kotlinVersion
|
|
kotlin("plugin.serialization") version kotlinVersion
|
|
|
id("org.sirekanyan.version-checker") version "1.0.14"
|
|
id("org.sirekanyan.version-checker") version "1.0.14"
|
|
@@ -9,7 +10,7 @@ plugins {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
group = "org.sirekanyan"
|
|
group = "org.sirekanyan"
|
|
|
-version = "1.0"
|
|
|
|
|
|
|
+version = "1.0.1"
|
|
|
|
|
|
|
|
repositories {
|
|
repositories {
|
|
|
mavenCentral()
|
|
mavenCentral()
|
|
@@ -18,33 +19,47 @@ repositories {
|
|
|
dependencies {
|
|
dependencies {
|
|
|
commonMainImplementation("com.github.ajalt.clikt:clikt-core:5.0.3")
|
|
commonMainImplementation("com.github.ajalt.clikt:clikt-core:5.0.3")
|
|
|
commonMainImplementation("org.jetbrains.kotlinx:kotlinx-datetime:0.7.1")
|
|
commonMainImplementation("org.jetbrains.kotlinx:kotlinx-datetime:0.7.1")
|
|
|
- commonMainImplementation("org.jetbrains.kotlinx:kotlinx-io-core:0.8.0")
|
|
|
|
|
|
|
+ commonMainImplementation("org.jetbrains.kotlinx:kotlinx-io-core:0.8.2")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
kotlin {
|
|
kotlin {
|
|
|
val os = OperatingSystem.current()
|
|
val os = OperatingSystem.current()
|
|
|
- when {
|
|
|
|
|
- os.isLinux -> linuxX64("linux")
|
|
|
|
|
- os.isMacOsX -> macosX64("macos")
|
|
|
|
|
- else -> error("Unsupported operating system: $os")
|
|
|
|
|
- }.binaries {
|
|
|
|
|
- executable(listOf(if (hasProperty("release")) RELEASE else DEBUG))
|
|
|
|
|
|
|
+ buildList {
|
|
|
|
|
+ add(linuxX64())
|
|
|
|
|
+ add(linuxArm64())
|
|
|
|
|
+ if (os.isMacOsX) {
|
|
|
|
|
+ add(macosX64())
|
|
|
|
|
+ add(macosArm64())
|
|
|
|
|
+ }
|
|
|
|
|
+ }.forEach {
|
|
|
|
|
+ it.binaries {
|
|
|
|
|
+ executable(listOf(if (hasProperty("release")) RELEASE else DEBUG))
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+private val kotlinTargetNames: List<String> =
|
|
|
|
|
+ kotlin.targets.filterIsInstance<KotlinNativeTarget>().map { it.name }
|
|
|
|
|
+
|
|
|
distributions {
|
|
distributions {
|
|
|
- main {
|
|
|
|
|
- contents {
|
|
|
|
|
- from("build/bin/linux/releaseExecutable/todo.kexe") {
|
|
|
|
|
- rename { it.removeSuffix(".kexe") }
|
|
|
|
|
|
|
+ kotlinTargetNames.forEach { targetName ->
|
|
|
|
|
+ create(targetName) {
|
|
|
|
|
+ distributionBaseName = "todo-${targetName.replace("X64", "-amd64").replace("Arm64", "-arm64")}"
|
|
|
|
|
+ contents {
|
|
|
|
|
+ from("build/bin/${targetName}/releaseExecutable/todo.kexe") {
|
|
|
|
|
+ rename { it.removeSuffix(".kexe") }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-tasks {
|
|
|
|
|
- getByName<Tar>("distTar") {
|
|
|
|
|
- compression = Compression.GZIP
|
|
|
|
|
- archiveExtension = ".tar.gz"
|
|
|
|
|
|
|
+kotlinTargetNames.forEach { targetName ->
|
|
|
|
|
+ tasks {
|
|
|
|
|
+ getByName<Tar>("${targetName}DistTar") {
|
|
|
|
|
+ filePermissions { unix("755") }
|
|
|
|
|
+ compression = Compression.GZIP
|
|
|
|
|
+ archiveExtension = "tar.gz"
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|