openjfx / javafx-gradle-plugin

Gradle plugin that makes it easy to work with JavaFX 11+
https://openjfx.io/
BSD 3-Clause "New" or "Revised" License
359 stars 62 forks source link

Do not hard-code the default JavaFX version #86

Closed sschuberth closed 4 years ago

sschuberth commented 4 years ago

Instead of doing

https://github.com/openjfx/javafx-gradle-plugin/blob/e03fb27aedfdf85bca7d98fce474e6ce609201e4/src/main/java/org/openjfx/gradle/JavaFXOptions.java#L51

it seems more reasonable to me to do something like

private String version = JavaVersion.current().majorVersion
abhinayagarwal commented 4 years ago

It was hardcoded because we wanted to use the latest version of JavaFX irrespective of the Java version used.

sschuberth commented 4 years ago

But arbitrarily mixing the JavaFX version with a different Java version potentially leads to compile errors. I cannot recall the exact error message right now, but I believe I was unable to use Java 11 this way.

abhinayagarwal commented 4 years ago

All JavaFX versions after 11 is compatible with Java 11+. If you find a compatibility issue with any version, please report.

sschuberth commented 4 years ago

I can't reproduce the issue anymore right now, but I still believe it could make sense to do something like

version = 11.coerceAtLeast(JavaVersion.current().majorVersion.toInt()).toString()

(in Kotlin DSL syntax) here.