69 lines
2 KiB
Text
69 lines
2 KiB
Text
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
|
|
|
|
plugins {
|
|
kotlin("jvm")
|
|
id("org.jetbrains.compose")
|
|
java
|
|
}
|
|
|
|
group = "com.wbrawner.pihelper"
|
|
version = "1.0-SNAPSHOT"
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
|
|
google()
|
|
}
|
|
|
|
val osName = System.getProperty("os.name")
|
|
val targetOs = when {
|
|
osName == "Mac OS X" -> "macos"
|
|
osName.startsWith("Win") -> "windows"
|
|
osName.startsWith("Linux") -> "linux"
|
|
else -> error("Unsupported OS: $osName")
|
|
}
|
|
|
|
val targetArch = when (val osArch = System.getProperty("os.arch")) {
|
|
"x86_64", "amd64" -> "x64"
|
|
"aarch64" -> "arm64"
|
|
else -> error("Unsupported arch: $osArch")
|
|
}
|
|
|
|
val skikoVersion = "0.7.77" // or any more recent version
|
|
val target = "${targetOs}-${targetArch}"
|
|
|
|
|
|
dependencies {
|
|
// Note, if you develop a library, you should use compose.desktop.common.
|
|
// compose.desktop.currentOs should be used in launcher-sourceSet
|
|
// (in a separate module for demo project and in testMain).
|
|
// With compose.desktop.common you will also lose @Preview functionality
|
|
implementation(project(":shared"))
|
|
implementation(compose.desktop.currentOs)
|
|
// implementation("org.jetbrains.skiko:skiko-awt-runtime-$target:$skikoVersion")
|
|
implementation(libs.kotlinx.coroutines.jvm)
|
|
implementation("ch.qos.logback:logback-classic:1.4.5")
|
|
}
|
|
|
|
compose.desktop {
|
|
application {
|
|
mainClass = "MainKt"
|
|
|
|
nativeDistributions {
|
|
includeAllModules = true
|
|
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
|
|
packageName = "Pi-helper"
|
|
packageVersion = "1.0.0"
|
|
|
|
macOS {
|
|
iconFile.set(project.file("src/main/resources/icon.icns"))
|
|
}
|
|
windows {
|
|
iconFile.set(project.file("src/main/resources/icon.ico"))
|
|
}
|
|
linux {
|
|
iconFile.set(project.file("src/main/resources/icon.png"))
|
|
}
|
|
}
|
|
}
|
|
}
|