You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Defer Adoptium API call until a JavaFX download task needs it (#7579)
`latestJavaVersion` was eagerly invoked on every Gradle invocation
(`}(javaVersion)`), making each `./gradlew <anything>` round-trip to
api.adoptium.net even for `help`, `tasks`, or any local-only target.
Convert it to a memoized closure consumed at use sites that already sit
inside lazy `tasks.register(...)` bodies (`downloadJfxMods`,
`downloadJavaFXLocal`). The network call now fires at most once per
build, and only when one of those JavaFX download tasks is realized.
Closes OPTIMIZATION.md item #2.
Copy file name to clipboardExpand all lines: build.gradle
+10-7Lines changed: 10 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -66,14 +66,17 @@ ext {
66
66
// Java version. It will affect JavaFX version too.
67
67
javaVersion =25
68
68
69
-
// The Eclipse Adoptium API will return the latest patch release for the majorJava version set
69
+
// The Eclipse Adoptium API returns the latest patch release for the majorJava version set.
70
+
// The closure is memoized so the network call fires at most once per Gradle invocation,
71
+
// and only when a JavaFX/JDK download task actually consumes the value (the use sites
72
+
// sit inside lazy tasks.register bodies).
70
73
latestJavaVersion = { majorJavaVersion->
71
74
def uri =newURI("https://api.adoptium.net/v3/assets/feature_releases/${majorJavaVersion}/ga?architecture=x64&page=0&page_size=1&project=jdk&sort_order=DESC&vendor=eclipse")
0 commit comments