2025-11-03 19:21:18 +01:00
|
|
|
import org.jetbrains.compose.desktop.application.dsl.TargetFormat.Deb
|
|
|
|
|
import org.jetbrains.compose.desktop.application.dsl.TargetFormat.Dmg
|
|
|
|
|
import org.jetbrains.compose.desktop.application.dsl.TargetFormat.Msi
|
2024-07-02 10:53:04 +02:00
|
|
|
|
|
|
|
|
plugins {
|
2025-10-14 22:18:11 +02:00
|
|
|
alias(libs.plugins.kotlin.kover)
|
2024-07-02 10:53:04 +02:00
|
|
|
alias(libs.plugins.kotlin.jvm)
|
2024-08-18 10:38:20 +02:00
|
|
|
alias(libs.plugins.compose.compiler)
|
2024-07-02 23:11:53 +02:00
|
|
|
alias(libs.plugins.compose)
|
2024-07-02 10:53:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
kotlin {
|
2025-05-30 06:06:51 +02:00
|
|
|
jvmToolchain(libs.versions.jdk.get().toInt())
|
2024-07-02 10:53:04 +02:00
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
|
implementation(compose.desktop.currentOs)
|
|
|
|
|
implementation(compose.material3)
|
|
|
|
|
implementation(compose.components.resources)
|
|
|
|
|
implementation(projects.commonUI)
|
|
|
|
|
implementation(compose.components.uiToolingPreview)
|
|
|
|
|
|
|
|
|
|
testImplementation(libs.kotlin.test)
|
|
|
|
|
testImplementation(libs.atrium)
|
|
|
|
|
testImplementation(compose.desktop.uiTestJUnit4)
|
|
|
|
|
testImplementation(compose.desktop.currentOs)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
compose.desktop {
|
|
|
|
|
application {
|
2025-07-09 21:19:41 +02:00
|
|
|
mainClass = "ch.dissem.yaep.ui.desktop.MainKt"
|
2024-07-02 10:53:04 +02:00
|
|
|
|
|
|
|
|
nativeDistributions {
|
2025-11-03 19:21:18 +01:00
|
|
|
val formats = mutableListOf(Deb)
|
2025-05-30 06:06:51 +02:00
|
|
|
packageName = "YAEP"
|
2025-11-03 19:21:18 +01:00
|
|
|
val baseVersion = version.toString()
|
|
|
|
|
packageVersion = baseVersion
|
|
|
|
|
if (baseVersion.matches(Regex("[1-9][0-9]*(\\.[0-9]+)(\\.[0-9]+)"))) {
|
|
|
|
|
formats.add(Dmg)
|
|
|
|
|
macOS {
|
|
|
|
|
iconFile.set(project.file("icon.icns"))
|
|
|
|
|
}
|
2025-05-30 06:06:51 +02:00
|
|
|
}
|
2025-11-03 19:21:18 +01:00
|
|
|
if (baseVersion.matches(Regex("[1-2]?[0-9]?[0-9]\\.[1-2]?[0-9]?[0-9]\\.[1-6]?[0-9]?[0-9]?[0-9]?[0-9]"))) {
|
|
|
|
|
windows {
|
|
|
|
|
formats.add(Msi)
|
|
|
|
|
iconFile.set(project.file("icon.ico"))
|
|
|
|
|
}
|
2025-05-30 06:06:51 +02:00
|
|
|
}
|
|
|
|
|
linux {
|
2025-11-03 19:21:18 +01:00
|
|
|
debPackageVersion = if (baseVersion.first().isDigit()) {
|
|
|
|
|
baseVersion
|
|
|
|
|
} else {
|
|
|
|
|
"0-$baseVersion"
|
|
|
|
|
}
|
2025-05-30 06:06:51 +02:00
|
|
|
iconFile.set(project.file("icon.png"))
|
|
|
|
|
}
|
2025-11-03 19:21:18 +01:00
|
|
|
targetFormats(*formats.toTypedArray())
|
2024-07-02 10:53:04 +02:00
|
|
|
|
|
|
|
|
buildTypes.release.proguard {
|
|
|
|
|
configurationFiles.from(project.file("proguard-rules.pro"))
|
2025-05-30 06:06:51 +02:00
|
|
|
isEnabled.set(false)
|
|
|
|
|
obfuscate.set(false)
|
2024-07-02 10:53:04 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|