Files
photophetch/build.gradle.kts
Kyle Bolen bbb3bb1aae Use JavaFX Gradle plugin for proper module path setup
Replace manual classifier-based jar deps with the openjfx javafx-plugin
which correctly sets up the JavaFX module path, native lib paths, and
JVM args needed for media codecs (AVFoundation on macOS).

This fixes 'media type not supported' which was caused by JavaFX being
on classpath instead of module path — native .dylib codecs only load
when JavaFX runs as a named module.
2026-07-30 06:25:38 +00:00

66 lines
1.7 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)
alias(libs.plugins.javafx)
}
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)
// JavaFX media — configured via the javafx plugin block below
}
javafx {
version = "21.0.3"
modules = listOf("javafx.media", "javafx.swing", "javafx.graphics", "javafx.controls", "javafx.base")
}
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"
macOS {
bundleID = "com.bolenpad.photophetch"
iconFile.set(project.file("src/main/resources/icon.icns"))
}
}
// Fat JAR for quick distribution
buildTypes.release.proguard {
isEnabled = false
}
}
}