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

Remove source- and targetCompatiblity options and use javaCompile.opt… #1042

Merged
merged 2 commits into from May 29, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.adoc
Expand Up @@ -23,6 +23,10 @@ Bug Fixes::
Deprecated Attributes.setTableOfContents2().
Added new constants Placement.PREAMBLE and Placement.MACRO as parameters for Attributes.setTableOfConstants(). (@abelsromero) (#1037)

Build Improvement::

* Use JavaCompile options.release instead of sourceCompatibility and targetCompatibility to target Java 8 (#1042)

== 2.5.1 (2021-05-04)

Improvement::
Expand Down
23 changes: 10 additions & 13 deletions build.gradle
Expand Up @@ -103,14 +103,12 @@ subprojects {

status = _status

// NOTE sourceCompatibility & targetCompatibility are set in gradle.properties to meet requirements of Gradle
// Must redefine here to work around a bug in the Eclipse plugin
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8

plugins.withType(JavaPlugin) {
project.tasks.withType(JavaCompile) { task ->
task.sourceCompatibility = project.sourceCompatibility
task.targetCompatibility = project.targetCompatibility
if (JavaVersion.current().isJava11Compatible()) {
task.options.release = 8
}
if (project.hasProperty("showDeprecation")) {
options.compilerArgs << "-Xlint:deprecation"
}
Expand All @@ -119,8 +117,9 @@ subprojects {
}
}
project.tasks.withType(GroovyCompile) { task ->
task.sourceCompatibility = project.sourceCompatibility
task.targetCompatibility = project.targetCompatibility
if (JavaVersion.current().isJava11Compatible()) {
task.options.release = 8
}
}
}

Expand Down Expand Up @@ -204,12 +203,10 @@ configure(subprojects.findAll { !it.isDistribution() }) {
ruby.gems()
}

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

Expand Down
2 changes: 0 additions & 2 deletions gradle.properties
@@ -1,4 +1,2 @@
version=2.5.2-SNAPSHOT
sourceCompatibility=1.8
targetCompatibility=1.8
org.gradle.jvmargs=-XX:MaxMetaspaceSize=512m