plugins {
    alias(libs.plugins.javafx)
    alias(libs.plugins.jlink)
    alias(libs.plugins.osdetector)
}

dependencies {
    implementation(
        project(":pacman-core"),
        project(":pacman-ui-lib"),
        project(":pacman-ui"),
        project(":pacman-app-arcade-pacman"),
        project(":pacman-app-arcade-pacmanxxl"),
        project(":pacman-app-arcade-mspacman"),
        project(":pacman-app-tengen-mspacman"),
        libs.bundles.tinylog
    )
}

application {
    mainModule = "pacmanfx.all"
    mainClass = "de.amr.pacmanfx.allgames.app.Main"
    if (osdetector.os == "linux") {
        applicationDefaultJvmArgs = ["-Dprism.forceGPU=true"]
    }
}

javafx {
    modules = ["javafx.base", "javafx.graphics", "javafx.controls", "javafx.media"]
}

jlink {
    options = ["--compress", "zip-9", "--strip-debug", "--no-header-files", "--no-man-pages"]
    launcher {
        name = "Pac-Man-FX-3D"
    }
    jpackage {
        appVersion = "1.0"
        vendor = "Armin Reichert"
        installerOptions = []
        installerType = osPkg
        if (osdetector.os == "windows") {
            icon = "pacman.ico"
            installerOptions += ["--win-dir-chooser", "--win-menu", "--win-menu-group", "Pac-Man FX", "--win-shortcut"]
            //imageOptions = ["--win-console"]
        }
    }
}
