Skip to content

Commit

Permalink
SOLR-17205 De-couple SolrJ Java version from server Java version (apa…
Browse files Browse the repository at this point in the history
  • Loading branch information
janhoy authored Apr 2, 2024
1 parent 62cf3aa commit 2eb9b21
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ plugins {
id 'com.github.node-gradle.node' version '7.0.1' apply false
}

// Declare default Java versions for the entire project and for SolrJ separately
rootProject.ext.minJavaVersionDefault = JavaVersion.VERSION_11
rootProject.ext.minJavaVersionSolrJ = JavaVersion.VERSION_11

apply from: file('gradle/globals.gradle')

// General metadata.
Expand Down Expand Up @@ -85,8 +89,6 @@ ext {
buildTime = DateTimeFormatter.ofPattern("HH:mm:ss").format(tstamp)
buildYear = DateTimeFormatter.ofPattern("yyyy").format(tstamp)

minJavaVersion = JavaVersion.VERSION_11

// Allow definiting external tool locations using system props.
externalTool = { name ->
def resolved = propertyOrDefault("${name}.exe", name as String)
Expand Down
4 changes: 4 additions & 0 deletions gradle/globals.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,9 @@ allprojects {
// "CI": Github (https://docs.github.com/en/actions/learn-github-actions/environment-variables)
// anything starting with "JENKINS_" or "HUDSON_": Jenkins/Hudson (https://jenkins.thetaphi.de/env-vars.html/)
isCIBuild = System.getenv().keySet().any { it ==~ /(?i)((JENKINS|HUDSON)(_\w+)?|CI)/ }

// Assign different java version for client-side modules 'api' and 'solrj*'
var isSolrJ = project.name.matches("^(solrj.*|api)\$")
minJavaVersion = isSolrJ ? rootProject.minJavaVersionSolrJ : rootProject.minJavaVersionDefault
}
}
6 changes: 3 additions & 3 deletions gradle/ide/eclipse.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ configure(rootProject) {
}

jdt {
sourceCompatibility = rootProject.minJavaVersion
targetCompatibility = rootProject.minJavaVersion
javaRuntimeName = "JavaSE-${rootProject.minJavaVersion}"
sourceCompatibility = rootProject.minJavaVersionDefault
targetCompatibility = rootProject.minJavaVersionDefault
javaRuntimeName = "JavaSE-${rootProject.minJavaVersionDefault}"
}
}

Expand Down
6 changes: 3 additions & 3 deletions gradle/java/javac.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

allprojects {
plugins.withType(JavaPlugin) {
sourceCompatibility = rootProject.minJavaVersion
targetCompatibility = rootProject.minJavaVersion
sourceCompatibility = project.minJavaVersion
targetCompatibility = project.minJavaVersion

// Use 'release' flag instead of 'source' and 'target'
tasks.withType(JavaCompile) {
options.compilerArgs += ["--release", rootProject.minJavaVersion.toString()]
options.compilerArgs += ["--release", project.minJavaVersion.toString()]
}

// Configure warnings.
Expand Down
2 changes: 2 additions & 0 deletions solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ Other Changes

* SOLR-14410: Switch from SysV init script to systemd service definition (Marius Ghita via janhoy)

* SOLR-17205: De-couple SolrJ required Java version from server Java version (janhoy)

================== 9.6.0 ==================
New Features
---------------------
Expand Down

0 comments on commit 2eb9b21

Please sign in to comment.