Skip to content

Commit 5fcebcf

Browse files
authored
Merge pull request #1151 from abelsromero/issue-1150-set-java-11-as-minimal-support
Set Java11 as minimal version
2 parents f4e000a + b7b307f commit 5fcebcf

File tree

8 files changed

+41
-37
lines changed

8 files changed

+41
-37
lines changed

.github/workflows/continuous-integration.yaml

+2-7
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,12 @@ jobs:
1818
max-parallel: 4
1919
matrix:
2020
java:
21-
- '8'
2221
- '11'
2322
- '17'
2423
- '19'
2524
os:
2625
- ubuntu-latest
2726
- macos-latest
28-
exclude:
29-
- os: macos-latest
30-
java: '8'
31-
- os: macos-latest
32-
java: '19'
3327
runs-on: ${{ matrix.os }}
3428
steps:
3529
- uses: actions/checkout@v3
@@ -49,11 +43,12 @@ jobs:
4943
runs-on: windows-latest
5044
strategy:
5145
fail-fast: false
52-
max-parallel: 2
46+
max-parallel: 3
5347
matrix:
5448
java:
5549
- '11'
5650
- '17'
51+
- '19'
5752
steps:
5853
- uses: actions/checkout@v3
5954
with:

CHANGELOG.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Improvement::
2727
* Replace use of deprecated 'numbered' attribute by 'sectnums' (#1123) (@abelsromero)
2828
* Expose `source` and `source_lines` use of deprecated 'numbered' in Document interface (#1145) (@abelsromero)
2929
* Accept 'null' as valid input (same as empty string) for load and convert String methods (#1148) (@abelsromero)
30+
* Set Java 11 as the minimal version (#1151) (@abelsromero)
3031

3132
Bug Fixes::
3233

asciidoctorj-core/build.gradle

+1-6
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,7 @@ task pollutedTest(type: Test) {
127127
forkEvery = 10
128128
minHeapSize = '128m'
129129
maxHeapSize = '1024m'
130-
if (JavaVersion.current().isJava8Compatible()) {
131-
jvmArgs '-XX:-UseGCOverheadLimit'
132-
}
133-
else {
134-
jvmArgs '-XX:MaxPermSize=256m', '-XX:-UseGCOverheadLimit'
135-
}
130+
jvmArgs '-XX:-UseGCOverheadLimit'
136131

137132
environment 'GEM_PATH', '/some/path'
138133
environment 'GEM_HOME', '/some/other/path'

asciidoctorj-springboot-integration-test/build.gradle

-5
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,3 @@ dependencies {
1111
}
1212

1313
test.dependsOn(':asciidoctorj-springboot-integration-test:springboot-app:assemble')
14-
15-
tasks.withType(JavaCompile).configureEach { task ->
16-
task.options.release = 17
17-
}
18-

asciidoctorj-springboot-integration-test/springboot-app/build.gradle

+18-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
2+
import org.springframework.boot.gradle.plugin.SpringBootPlugin
3+
14
plugins {
2-
id 'org.springframework.boot' version '3.0.0'
3-
id 'io.spring.dependency-management' version '1.1.0'
5+
id 'org.springframework.boot' version '3.0.4'
46
id 'java'
57
}
68

@@ -13,14 +15,26 @@ repositories {
1315

1416
dependencies {
1517
implementation project(':asciidoctorj')
18+
19+
implementation platform(SpringBootPlugin.BOM_COORDINATES)
1620
implementation 'org.springframework.boot:spring-boot-starter-web'
1721
implementation 'org.springframework.boot:spring-boot-starter-actuator'
1822

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

22-
tasks.withType(JavaCompile).configureEach { task ->
23-
task.options.release = 17
26+
java {
27+
toolchain {
28+
languageVersion.set(JavaLanguageVersion.of(getToolchainVersion()))
29+
}
30+
}
31+
32+
def getToolchainVersion() {
33+
if (DefaultNativePlatform.getCurrentOperatingSystem().isWindows()) {
34+
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_19))
35+
return 19
36+
}
37+
return 17
2438
}
2539

2640
bootJar {

build.gradle

+17-13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
2+
13
import java.time.Duration
24

35
/*
@@ -113,21 +115,13 @@ subprojects {
113115

114116
plugins.withType(JavaPlugin) {
115117
project.tasks.withType(JavaCompile) { task ->
116-
if (JavaVersion.current().isJava11Compatible()) {
117-
task.options.release = 8
118-
}
119118
if (project.hasProperty("showDeprecation")) {
120119
options.compilerArgs << "-Xlint:deprecation"
121120
}
122121
if (project.hasProperty("showUnchecked")) {
123122
options.compilerArgs << "-Xlint:unchecked"
124123
}
125124
}
126-
project.tasks.withType(GroovyCompile) { task ->
127-
if (JavaVersion.current().isJava11Compatible()) {
128-
task.options.release = 8
129-
}
130-
}
131125
}
132126

133127
repositories {
@@ -168,9 +162,6 @@ subprojects {
168162
forkEvery = 10
169163
minHeapSize = '128m'
170164
maxHeapSize = '1024m'
171-
if (JavaVersion.current().isJava8Compatible()) {
172-
jvmArgs '-XX:-UseGCOverheadLimit'
173-
}
174165

175166
testLogging {
176167
// events 'passed', 'failed', 'skipped', 'standard_out', 'standard_error'
@@ -199,9 +190,8 @@ configure(subprojects.findAll { !it.isDistribution() }) {
199190

200191

201192
javadoc {
202-
// Oracle JDK8 likes to fail the build over spoiled HTML
193+
// Oracle JDK11+ likes to fail the build over spoiled HTML
203194
options.addStringOption('Xdoclint:none', '-quiet')
204-
options.source('8')
205195
}
206196
}
207197

@@ -210,6 +200,20 @@ configure(subprojects.findAll { !it.name.endsWith('-distribution') && ! it.name.
210200
java {
211201
withJavadocJar()
212202
withSourcesJar()
203+
toolchain {
204+
languageVersion.set(JavaLanguageVersion.of(getToolchainVersion()))
205+
}
213206
}
214207

215208
}
209+
210+
// Windows workaround to fix invalid toolchain detection
211+
def getToolchainVersion() {
212+
if (DefaultNativePlatform.getCurrentOperatingSystem().isWindows()) {
213+
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_19))
214+
return 19
215+
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17))
216+
return 17
217+
}
218+
return 11
219+
}

docs/modules/ROOT/pages/logs-handling.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= Logs Handling API
2-
:uri-javadocs-logmanager: https://docs.oracle.com/javase/8/docs/api/java/util/logging/LogManager.html
2+
:uri-javadocs-logmanager: https://docs.oracle.com/en/java/javase/11/docs/api/java.logging/java/util/logging/LogManager.html
33

44
[NOTE]
55
This API is inspired by Java Logging API (JUL).
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)