Skip to content

Commit

Permalink
Set Java11 as minimal version
Browse files Browse the repository at this point in the history
* Remove use of 'task.options.release' for Java version configuration in
in favour of Gradle's preferrs 'toolchain'.
* Removed Java 8 from pipelines.
* Bump Gradle to latest v8.0.2
* Remove use of 'io.spring.dependency-management' Gradle plugin in
'spring-boot' app in favor of Gradle's BOM support. This reduces
maintenance since only Boot version needs to be updated.

Fixes #1150
  • Loading branch information
abelsromero committed Mar 22, 2023
1 parent 6bd238b commit 0835ffd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 22 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,13 @@ jobs:
max-parallel: 4
matrix:
java:
- '8'
- '11'
- '17'
- '19'
os:
- ubuntu-latest
- macos-latest
exclude:
- os: macos-latest
java: '8'
- os: macos-latest
java: '19'
runs-on: ${{ matrix.os }}
Expand Down
5 changes: 0 additions & 5 deletions asciidoctorj-springboot-integration-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,3 @@ dependencies {
}

test.dependsOn(':asciidoctorj-springboot-integration-test:springboot-app:assemble')

tasks.withType(JavaCompile).configureEach { task ->
task.options.release = 17
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import org.springframework.boot.gradle.plugin.SpringBootPlugin

plugins {
id 'org.springframework.boot' version '3.0.0'
id 'io.spring.dependency-management' version '1.1.0'
id 'org.springframework.boot' version '3.0.4'
id 'java'
}

Expand All @@ -13,14 +14,18 @@ repositories {

dependencies {
implementation project(':asciidoctorj')

implementation platform(SpringBootPlugin.BOM_COORDINATES)
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

tasks.withType(JavaCompile).configureEach { task ->
task.options.release = 17
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

bootJar {
Expand Down
12 changes: 3 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -113,21 +113,13 @@ subprojects {

plugins.withType(JavaPlugin) {
project.tasks.withType(JavaCompile) { task ->
if (JavaVersion.current().isJava11Compatible()) {
task.options.release = 8
}
if (project.hasProperty("showDeprecation")) {
options.compilerArgs << "-Xlint:deprecation"
}
if (project.hasProperty("showUnchecked")) {
options.compilerArgs << "-Xlint:unchecked"
}
}
project.tasks.withType(GroovyCompile) { task ->
if (JavaVersion.current().isJava11Compatible()) {
task.options.release = 8
}
}
}

repositories {
Expand Down Expand Up @@ -201,7 +193,6 @@ configure(subprojects.findAll { !it.isDistribution() }) {
javadoc {
// Oracle JDK8 likes to fail the build over spoiled HTML
options.addStringOption('Xdoclint:none', '-quiet')
options.source('8')
}
}

Expand All @@ -210,6 +201,9 @@ configure(subprojects.findAll { !it.name.endsWith('-distribution') && ! it.name.
java {
withJavadocJar()
withSourcesJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}

}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 0835ffd

Please sign in to comment.