Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Java11 as minimal version #1151

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,12 @@ 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 }}
steps:
- uses: actions/checkout@v3
Expand All @@ -49,11 +43,12 @@ jobs:
runs-on: windows-latest
strategy:
fail-fast: false
max-parallel: 2
max-parallel: 3
matrix:
java:
- '11'
- '17'
- '19'
steps:
- uses: actions/checkout@v3
with:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Improvement::
* Replace use of deprecated 'numbered' attribute by 'sectnums' (#1123) (@abelsromero)
* Expose `source` and `source_lines` use of deprecated 'numbered' in Document interface (#1145) (@abelsromero)
* Accept 'null' as valid input (same as empty string) for load and convert String methods (#1148) (@abelsromero)
* Set Java 11 as the minimal version (#1151) (@abelsromero)

Bug Fixes::

Expand Down
7 changes: 1 addition & 6 deletions asciidoctorj-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,7 @@ task pollutedTest(type: Test) {
forkEvery = 10
minHeapSize = '128m'
maxHeapSize = '1024m'
if (JavaVersion.current().isJava8Compatible()) {
jvmArgs '-XX:-UseGCOverheadLimit'
}
else {
jvmArgs '-XX:MaxPermSize=256m', '-XX:-UseGCOverheadLimit'
}
jvmArgs '-XX:-UseGCOverheadLimit'

environment 'GEM_PATH', '/some/path'
environment 'GEM_HOME', '/some/other/path'
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,8 @@
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
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 +15,26 @@ 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.set(JavaLanguageVersion.of(getToolchainVersion()))
}
}

def getToolchainVersion() {
if (DefaultNativePlatform.getCurrentOperatingSystem().isWindows()) {
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_19))
return 19
}
return 17
}

bootJar {
Expand Down
30 changes: 17 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform

import java.time.Duration

/*
Expand Down Expand Up @@ -113,21 +115,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 @@ -168,9 +162,6 @@ subprojects {
forkEvery = 10
minHeapSize = '128m'
maxHeapSize = '1024m'
if (JavaVersion.current().isJava8Compatible()) {
jvmArgs '-XX:-UseGCOverheadLimit'
}

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


javadoc {
// Oracle JDK8 likes to fail the build over spoiled HTML
// Oracle JDK11+ likes to fail the build over spoiled HTML
options.addStringOption('Xdoclint:none', '-quiet')
options.source('8')
}
}

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

}

// Windows workaround to fix invalid toolchain detection
def getToolchainVersion() {
if (DefaultNativePlatform.getCurrentOperatingSystem().isWindows()) {
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_19))
return 19
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17))
return 17
}
return 11
}
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/logs-handling.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
= Logs Handling API
:uri-javadocs-logmanager: https://docs.oracle.com/javase/8/docs/api/java/util/logging/LogManager.html
:uri-javadocs-logmanager: https://docs.oracle.com/en/java/javase/11/docs/api/java.logging/java/util/logging/LogManager.html

[NOTE]
This API is inspired by Java Logging API (JUL).
Expand Down
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