Skip to content

Commit

Permalink
[Java] Use different URI for early access JDK build.
Browse files Browse the repository at this point in the history
  • Loading branch information
vyazelenko committed Jan 13, 2025
1 parent 98b23b6 commit 4ec6025
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,15 @@ plugins {

defaultTasks 'clean', 'build'


static def rawBuildJavaVersion()
{
return System.getenv('BUILD_JAVA_VERSION') ?: JavaVersion.current().getMajorVersion()
}
boolean isEarlyAccessJavaVersion = rawBuildJavaVersion().endsWith("-ea")

static def getBuildJavaVersion() {
def buildJavaVersion = System.getenv('BUILD_JAVA_VERSION') ?: JavaVersion.current().getMajorVersion()
def buildJavaVersion = rawBuildJavaVersion()
if (buildJavaVersion.indexOf('.') > 0) {
buildJavaVersion = buildJavaVersion.substring(0, buildJavaVersion.indexOf('.'))
}
Expand Down Expand Up @@ -199,7 +206,7 @@ subprojects {
options.docEncoding = 'UTF-8'
options.charSet = 'UTF-8'
options.links("https://www.javadoc.io/doc/org.agrona/agrona/${libs.versions.agrona.get()}/")
if (buildJavaVersion > 23) { // early access JavaDoc location is different
if (isEarlyAccessJavaVersion) {
options.links("https://download.java.net/java/early_access/jdk${buildJavaVersion}/docs/api/")
}
else {
Expand Down

0 comments on commit 4ec6025

Please sign in to comment.