Skip to content

Commit

Permalink
Migrate to Adoptium Java 17.0.1+12 LTS builds
Browse files Browse the repository at this point in the history
  • Loading branch information
chadlwilson committed Dec 27, 2021
1 parent c38ca68 commit 46ee694
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ project.ext.compilerOptions = [

project.ext.packaging = [
adoptOpenjdk: [
featureVersion: 15,
featureVersion: 17,
interimVersion: 0, // set to `null` for the first release
updateVersion : 2, // set to `null` for the first release
buildVersion : 7
updateVersion : 1, // set to `null` for the first release
buildVersion : 12
]
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ enum OperatingSystem {
}
}

class AdoptOpenJDKUrlHelper {
class AdoptiumUrlHelper {
static String downloadURL(OperatingSystem operatingSystem, Integer featureVersion, Integer interimVersion, Integer updateVersion, Integer buildVersion) {
String versionComponent = [featureVersion, interimVersion, updateVersion].findAll({ it != null }).join('.')
String featureSuffix = updateVersion == null ? '' : 'U'

"https://github.com/AdoptOpenJDK/openjdk${featureVersion}-binaries/releases/download/jdk-${versionComponent}%2B${buildVersion}/OpenJDK${featureVersion}U-jre_x64_${operatingSystem.name()}_hotspot_${versionComponent}_${buildVersion}.${operatingSystem.extension}"
"https://github.com/adoptium/temurin${featureVersion}-binaries/releases/download/jdk-${versionComponent}%2B${buildVersion}/OpenJDK${featureVersion}${featureSuffix}-jre_x64_${operatingSystem.name()}_hotspot_${versionComponent}_${buildVersion}.${operatingSystem.extension}"
}

static String sha256sumURL(OperatingSystem operatingSystem, Integer featureVersion, Integer interimVersion, Integer updateVersion, Integer buildVersion) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.thoughtworks.go.build.docker

import com.thoughtworks.go.build.AdoptOpenJDKUrlHelper
import com.thoughtworks.go.build.AdoptiumUrlHelper
import org.gradle.api.Project

trait DistroBehavior {
Expand Down Expand Up @@ -53,7 +53,7 @@ trait DistroBehavior {
}

List<String> getInstallJavaCommands(Project project) {
def downloadUrl = AdoptOpenJDKUrlHelper.downloadURL(
def downloadUrl = AdoptiumUrlHelper.downloadURL(
com.thoughtworks.go.build.OperatingSystem.linux,
project.packaging.adoptOpenjdk.featureVersion,
project.packaging.adoptOpenjdk.interimVersion,
Expand Down
6 changes: 3 additions & 3 deletions installers/linux.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/


import com.thoughtworks.go.build.AdoptOpenJDKUrlHelper
import com.thoughtworks.go.build.AdoptiumUrlHelper
import com.thoughtworks.go.build.DownloadFile
import com.thoughtworks.go.build.InstallerType
import groovy.json.JsonOutput
Expand Down Expand Up @@ -105,7 +105,7 @@ private File destFile(String url) {
}

task downloadLinuxJreChecksum(type: DownloadFile) {
def srcUrl = AdoptOpenJDKUrlHelper.sha256sumURL(
def srcUrl = AdoptiumUrlHelper.sha256sumURL(
com.thoughtworks.go.build.OperatingSystem.linux,
project.packaging.adoptOpenjdk.featureVersion,
project.packaging.adoptOpenjdk.interimVersion,
Expand All @@ -119,7 +119,7 @@ task downloadLinuxJreChecksum(type: DownloadFile) {
task downloadLinuxJre(type: DownloadFile) {

dependsOn downloadLinuxJreChecksum
def srcUrl = AdoptOpenJDKUrlHelper.downloadURL(
def srcUrl = AdoptiumUrlHelper.downloadURL(
com.thoughtworks.go.build.OperatingSystem.linux,
project.packaging.adoptOpenjdk.featureVersion,
project.packaging.adoptOpenjdk.interimVersion,
Expand Down
6 changes: 3 additions & 3 deletions installers/osx.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import com.thoughtworks.go.build.AdoptOpenJDKUrlHelper
import com.thoughtworks.go.build.AdoptiumUrlHelper
import com.thoughtworks.go.build.DownloadFile
import com.thoughtworks.go.build.InstallerType
import org.apache.commons.codec.digest.DigestUtils
Expand All @@ -24,7 +24,7 @@ private File destFile(String url) {
}

task downloadOsxJreChecksum(type: DownloadFile) {
def srcUrl = AdoptOpenJDKUrlHelper.sha256sumURL(
def srcUrl = AdoptiumUrlHelper.sha256sumURL(
com.thoughtworks.go.build.OperatingSystem.mac,
project.packaging.adoptOpenjdk.featureVersion,
project.packaging.adoptOpenjdk.interimVersion,
Expand All @@ -37,7 +37,7 @@ task downloadOsxJreChecksum(type: DownloadFile) {

task downloadOsxJre(type: DownloadFile) {
dependsOn downloadOsxJreChecksum
def srcUrl = AdoptOpenJDKUrlHelper.downloadURL(
def srcUrl = AdoptiumUrlHelper.downloadURL(
com.thoughtworks.go.build.OperatingSystem.mac,
project.packaging.adoptOpenjdk.featureVersion,
project.packaging.adoptOpenjdk.interimVersion,
Expand Down
6 changes: 3 additions & 3 deletions installers/windows.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/


import com.thoughtworks.go.build.AdoptOpenJDKUrlHelper
import com.thoughtworks.go.build.AdoptiumUrlHelper
import com.thoughtworks.go.build.DownloadFile
import com.thoughtworks.go.build.InstallerType
import org.apache.commons.codec.digest.DigestUtils
Expand All @@ -26,7 +26,7 @@ private File destFile(String url) {
}

task downloadWindowsJreChecksum(type: DownloadFile) {
def srcUrl = AdoptOpenJDKUrlHelper.sha256sumURL(
def srcUrl = AdoptiumUrlHelper.sha256sumURL(
com.thoughtworks.go.build.OperatingSystem.windows,
project.packaging.adoptOpenjdk.featureVersion,
project.packaging.adoptOpenjdk.interimVersion,
Expand All @@ -39,7 +39,7 @@ task downloadWindowsJreChecksum(type: DownloadFile) {

task downloadWindowsJre(type: DownloadFile) {
dependsOn downloadWindowsJreChecksum
def srcUrl = AdoptOpenJDKUrlHelper.downloadURL(
def srcUrl = AdoptiumUrlHelper.downloadURL(
com.thoughtworks.go.build.OperatingSystem.windows,
project.packaging.adoptOpenjdk.featureVersion,
project.packaging.adoptOpenjdk.interimVersion,
Expand Down

0 comments on commit 46ee694

Please sign in to comment.