Fix JDK v15 installer download URL

Fix the logic used to determine the JDK 15 assets and download links. Pre-releases are now excluded, as well as openj9 binaries. The resulting assets are final releases of hotspot builds.
This commit is contained in:
cd2357 2020-09-26 12:02:15 +02:00
parent 50f5d9b2c3
commit d8d3371678
No known key found for this signature in database
GPG key ID: F26C56748514D0D3

View file

@ -57,9 +57,16 @@ task getJpackageJDKDownloadURL {
binariesFolderPath.mkdirs();
ext.binariesFolderPath = binariesFolderPath
def apiEndpointLatestRelease = 'https://api.github.com/repos/AdoptOpenJDK/openjdk15-binaries/releases/latest'
def apiEndpointLatestReleaseJSON = new groovy.json.JsonSlurper().parseText(apiEndpointLatestRelease.toURL().text)
def latestReleaseTag = apiEndpointLatestReleaseJSON.tag_name
def apiEndpointLatestReleases = 'https://api.github.com/repos/AdoptOpenJDK/openjdk15-binaries/releases'
def apiEndpointLatestReleasesJSON = new groovy.json.JsonSlurper().parseText(apiEndpointLatestReleases.toURL().text)
def finalHotspotReleases = apiEndpointLatestReleasesJSON.findAll {
// Filter out the pre-releases (nightly builds)
(it.prerelease == false) &&
// Filter our openj9 builds (for now stick to the hotspot ones)
(! it.body.contains('openj9'))
}
def latestReleaseJSON = finalHotspotReleases.first()
def latestReleaseTag = latestReleaseJSON.tag_name
println "Latest AdoptOpenJDK release is ${latestReleaseTag}"
// AdoptOpenJDK only offer the latest release version for download (but none of the previous ones)
@ -169,8 +176,8 @@ task packageGetJpackagePath {
task packageInstallers {
description 'Call jpackage to prepare platform-specific binaries for this platform'
dependsOn 'packageGetJpackagePath'
// We need :clean and :shadowJar to make sure we have a fresh, current jar for the installers
dependsOn ':clean'
// Clean all previous artefacts and create a fresh shadowJar for the installers
dependsOn rootProject.clean
dependsOn ':desktop:shadowJar'
doLast {