Skip to content

Commit

Permalink
Remove toolchain for acceptance test
Browse files Browse the repository at this point in the history
  • Loading branch information
welandaz committed Nov 15, 2024
1 parent 3e73b72 commit 4b244fc
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions acceptance-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ plugins {
val ciJenkinsBuild: Boolean by (gradle as ExtensionAware).extra

java {
// Only used for compilation. We don't rely on toolchain for running the tests,
// as Jenkins ATH doesn't allow to specify the JAVA_HOME.
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
Expand Down Expand Up @@ -80,14 +82,6 @@ jenkinsVersions
!ciJenkinsBuild && !OperatingSystem.current().isWindows
}

environment("JAVA_HOME", javaToolchains.launcherFor {
languageVersion.set(jenkinsVersion.javaVersion)
}.get().executablePath.toString())

javaLauncher.set(javaToolchains.launcherFor {
languageVersion.set(jenkinsVersion.javaVersion)
})

systemProperties(
mapOf(
"jdk.xml.xpathExprOpLimit" to 150
Expand All @@ -106,7 +100,7 @@ jenkinsVersions
}
}

data class JenkinsVersion(val version: String, val downloadUrl: URL, val javaVersion: JavaLanguageVersion) {
data class JenkinsVersion(val version: String, val downloadUrl: URL) {

companion object {

Expand All @@ -118,14 +112,11 @@ data class JenkinsVersion(val version: String, val downloadUrl: URL, val javaVer

private val JENKINS_VERSION_PATTERN = "^\\d+([.]\\d+)*?\$".toRegex()

private val JAVA_11 = JavaLanguageVersion.of(11)
private val JAVA_17 = JavaLanguageVersion.of(17)

val LATEST = of(LATEST_VERSION, JAVA_17)
val LATEST = of(LATEST_VERSION)
val LATEST_LTS = of(LATEST_LTS_VERSION)
val V2_401 = of(V2_401_VERSION)

private fun of(version: String, javaVersion: JavaLanguageVersion = JAVA_11): JenkinsVersion {
private fun of(version: String): JenkinsVersion {
val downloadUrl =
when (version) {
LATEST_VERSION -> "${MIRROR}/current/latest/jenkins.war"
Expand All @@ -138,7 +129,7 @@ data class JenkinsVersion(val version: String, val downloadUrl: URL, val javaVer
}
}

return JenkinsVersion(version, URL(downloadUrl), javaVersion)
return JenkinsVersion(version, URL(downloadUrl))
}

private fun isJenkinsVersion(version: String) = JENKINS_VERSION_PATTERN.matches(version)
Expand All @@ -153,4 +144,5 @@ data class JenkinsVersion(val version: String, val downloadUrl: URL, val javaVer
} else {
version.split("-").joinToString(separator = "") { it.capitalized() }
}

}

0 comments on commit 4b244fc

Please sign in to comment.