MaterialFX/demo/build.gradle
Alessadro Parisi f16e5ffb6b 💥 Ditch the user agent stylesheet system in favor of Theme API
One of the biggest issues MaterialFX has ever had since it's beginning was the difficulty in customizing the controls through CSS. The root cause of this has always been the bad and shitty management of stylesheets priority by JavaFX. While in the past patches were implemented to fix the issue, in more than one occasion they were just mitigations that would work or not depending on...I don't know. Because you see, another problem of using such shitty system is that it was actually quite hard to debug, a theme/stylesheet could work for me but not for the user, a nightmare

With this commit, we definitely ditch the garbage user agent system in favor of a theming API that is discussed in more details on the project's README

Signed-off-by: Alessadro Parisi <alessandro.parisi406@gmail.com>
2023-03-16 12:18:41 +01:00

104 lines
2.8 KiB
Groovy
Executable File

import org.apache.tools.ant.taskdefs.condition.Os
plugins {
id 'application'
id 'org.beryx.jlink' version "$jlink"
}
repositories {
mavenCentral()
flatDir {
dirs "${project(':demo').projectDir}/libs"
}
}
dependencies {
testImplementation "org.testfx:testfx-core:$testfx"
testImplementation "org.testfx:testfx-junit5:$testfx"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit"
testImplementation "org.junit.platform:junit-platform-suite-api:$junitSuite"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit"
implementation "io.github.palexdev:scenicview:$scenicView"
implementation("fr.brouillard.oss:cssfx:$cssfx") { exclude group: 'org.openjfx' }
implementation "org.kordamp.ikonli:ikonli-core:$ikonli"
implementation "org.kordamp.ikonli:ikonli-javafx:$ikonli"
implementation "org.kordamp.ikonli:ikonli-fontawesome5-pack:$ikonli"
implementation "io.github.palexdev:virtualizedfx:$vfx"
implementation project(':materialfx')
}
compileJava {
sourceCompatibility = "$testJdk"
targetCompatibility = "$testJdk"
}
compileTestJava {
moduleOptions {
compileOnClasspath = true
}
}
test {
useJUnitPlatform()
moduleOptions {
runOnClasspath = true
}
}
application {
setMainModule("MaterialFX.Demo")
String main = project.findProperty("chooseMain").toString()
if (main != "null" && !main.trim().isEmpty()) {
setMainClassName(main)
} else {
setMainClassName("io.github.palexdev.materialfx.demo.Demo")
}
applicationDefaultJvmArgs = ["-Dglass.disableGrab=true"]
}
jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
mainClass = "io.github.palexdev.materialfx.demo.Demo"
name = 'MaterialFX Demo'
}
jpackage {
imageOptions = ['--icon', 'src/main/resources/logo.ico']
}
targetPlatform("linux-x64") {
jdkHome = jdkDownload("https://cdn.azul.com/zulu/bin/zulu19.32.13-ca-jdk19.0.2-linux_x64.tar.gz")
addExtraModulePath("/home/palexdev/Documents/JavaFX_jmods/linux_x64")
}
targetPlatform("win") {
jdkHome = jdkDownload("https://cdn.azul.com/zulu/bin/zulu19.32.13-ca-jdk19.0.2-win_x64.zip")
addExtraModulePath("/home/palexdev/Documents/JavaFX_jmods/win_x64")
}
targetPlatform("mac") {
jdkHome = jdkDownload("https://cdn.azul.com/zulu/bin/zulu19.32.13-ca-jdk19.0.2-macosx_x64.tar.gz")
addExtraModulePath("/home/palexdev/Documents/JavaFX_jmods/mac_x64")
}
addExtraDependencies('javafx')
}
tasks.register('doPackageAll') {
doLast {
if (Os.isFamily(Os.FAMILY_UNIX)) {
exec {
executable "$projectDir/scripts/JLinkPackage.sh"
args = ["$buildDir"]
}
}
}
}
jlinkZip.doLast {
doPackageAll
}