From a1206d8a60a18885d896d7e13615e48848b580a2 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Wed, 28 Jun 2023 15:00:47 +0200 Subject: [PATCH] Improve code comments about GraalVM versions Signed-off-by: Sebastian Schuberth --- .../main/kotlin/org/gradle/toolchains/foojay/FoojayApi.kt | 5 +++-- .../kotlin/org/gradle/toolchains/foojay/distributions.kt | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/foojay-resolver/src/main/kotlin/org/gradle/toolchains/foojay/FoojayApi.kt b/foojay-resolver/src/main/kotlin/org/gradle/toolchains/foojay/FoojayApi.kt index 56ec0f9..fea4aec 100644 --- a/foojay-resolver/src/main/kotlin/org/gradle/toolchains/foojay/FoojayApi.kt +++ b/foojay-resolver/src/main/kotlin/org/gradle/toolchains/foojay/FoojayApi.kt @@ -64,8 +64,9 @@ class FoojayApi { } internal fun match(distributionName: String, version: JavaLanguageVersion, operatingSystem: OperatingSystem, architecture: Architecture): Package? { - // Old GraalVM releases are special in that the JVM version they target is part of the distribution name instead - // of the release version. For these releases "jdk_version" instead of "version" must be used as they key. + // Old GraalVM releases are special in that the Java language version they target is part of the distribution + // name and the release version is unrelated to the Java language version. That is why for these distributions + // "jdk_version" instead of "version" must be used as the query key. val versionApiKey = when { distributionName.startsWith("graalvm_ce") -> "jdk_version" else -> "version" diff --git a/foojay-resolver/src/main/kotlin/org/gradle/toolchains/foojay/distributions.kt b/foojay-resolver/src/main/kotlin/org/gradle/toolchains/foojay/distributions.kt index e502970..dc64fa0 100644 --- a/foojay-resolver/src/main/kotlin/org/gradle/toolchains/foojay/distributions.kt +++ b/foojay-resolver/src/main/kotlin/org/gradle/toolchains/foojay/distributions.kt @@ -30,8 +30,8 @@ val j9Aliases = mapOf( ) /** - * Given a list of [distributions], return those that match the provided [vendor], JVM [implementation], and Java - * language [version]. + * Given a list of [distributions], return those that match the provided [vendor] and JVM [implementation]. The Java + * language [version] is only used to remove wrong GraalVM distributions; no general version filtering is done here. */ fun match( distributions: List,