Files
photophetch/build.gradle.kts
Kyle Bolen 207f55d263 Add comprehensive JVM module list for packaged distribution
Include all modules commonly needed by logback, coroutines, Swing,
Kotlin serialization, and networking to prevent NoClassDefFoundError
when running as a packaged .app bundle.
2026-08-02 18:04:27 +00:00

92 lines
3.0 KiB
Plaintext

import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.compose.multiplatform)
}
group = "com.bolenpad.photophetch"
version = "1.0.0"
kotlin {
jvmToolchain(21)
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "17"
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
dependencies {
implementation(compose.desktop.currentOs)
implementation(compose.material3)
implementation(compose.materialIconsExtended)
implementation(libs.coroutines.core)
implementation(libs.coroutines.swing)
implementation(libs.serialization.json)
implementation(libs.slf4j.api)
implementation(libs.logback.classic)
}
compose.desktop {
application {
mainClass = "com.bolenpad.photophetch.MainKt"
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "PhotoPhetch"
packageVersion = "1.0.0"
description = "Import photos from phones into PhotoPhile"
vendor = "bolenpad"
copyright = "© 2026 Kyle Bolen"
modules(
// Networking and naming — needed by logback JNDI
"java.naming",
// JMX — needed by logback JMX appender
"java.management",
// Instrumentation — needed by logback/class loading
"java.instrument",
// Reflection support for Unsafe — needed by coroutines, serialization
"jdk.unsupported",
// XML processing — needed by logback XML config parser
"java.xml",
// Logging — java.util.logging bridge
"java.logging",
// Security
"java.security.jgss",
"java.security.sasl",
// Desktop/AWT (for Swing integration)
"java.desktop",
// Compiler API — sometimes needed by Kotlin reflection
"java.compiler",
// SQL — needed by some Kotlin stdlib internals
"java.sql",
// Network — needed by HTTP calls (Gitea API, pymobiledevice3)
"java.net.http",
// Preferences — used by some desktop apps
"java.prefs",
)
macOS {
bundleID = "com.bolenpad.photophetch"
// Uncomment and add icon.icns to src/main/resources/ for a custom icon:
// iconFile.set(project.file("src/main/resources/icon.icns"))
signing {
sign.set(false) // set true + add identity for App Store / Gatekeeper
}
}
}
// Fat JAR for quick distribution
buildTypes.release.proguard {
isEnabled = false
}
}
}