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 8e45b15 commit e78d399
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ 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 @@ -316,7 +322,7 @@ subprojects {
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 e78d399

Please sign in to comment.