Skip to content

Commit

Permalink
[Java] Improve build for Java 10 plus upgrade to Gradle 4.7.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjpt777 committed Apr 28, 2018
1 parent 669d013 commit eb88a68
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 27 deletions.
4 changes: 2 additions & 2 deletions agrona/src/main/java/org/agrona/collections/IntHashSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ public boolean addAll(final Collection<? extends Integer> coll)
* avoids boxing and allocations
*
* @param coll containing the values to be added.
* @return <tt>true</tt> if this set changed as a result of the call
* @return {@code true} if this set changed as a result of the call
*/
public boolean addAll(final IntHashSet coll)
{
Expand Down Expand Up @@ -498,7 +498,7 @@ public boolean removeAll(final Collection<?> coll)
* avoids boxing and allocations
*
* @param coll containing the values to be removed.
* @return <tt>true</tt> if this set changed as a result of the call
* @return {@code true} if this set changed as a result of the call
*/
public boolean removeAll(final IntHashSet coll)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public boolean addAll(final Collection<? extends T> coll)
* avoids boxing and allocations
*
* @param coll containing the values to be added.
* @return <tt>true</tt> if this set changed as a result of the call
* @return {@code true} if this set changed as a result of the call
*/
public boolean addAll(final ObjectHashSet<T> coll)
{
Expand Down Expand Up @@ -426,7 +426,7 @@ public boolean removeAll(final Collection<?> coll)
* avoids boxing and allocations
*
* @param coll containing the values to be removed.
* @return <tt>true</tt> if this set changed as a result of the call
* @return {@code true} if this set changed as a result of the call
*/
public boolean removeAll(final ObjectHashSet<T> coll)
{
Expand Down
47 changes: 25 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,6 @@ subprojects {

jar.enabled = true

[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

compileJava {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}

dependencies {
checkstyle 'com.puppycrawl.tools:checkstyle:8.9'

Expand All @@ -129,6 +122,27 @@ subprojects {
testCompile 'org.hamcrest:hamcrest-library:1.3'
testCompile 'com.google.guava:guava-testlib:23.5-jre'
}

compileJava {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
options.compilerArgs << '-XDignore.symbol.file' // Suppress warnings about using Unsafe
options.fork = true
options.forkOptions.javaHome = file("${System.env.JAVA_HOME}")
options.encoding = 'UTF-8'
options.deprecation = true
}


compileTestJava {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
options.compilerArgs << '-XDignore.symbol.file' // Suppress warnings about using Unsafe
options.fork = true
options.forkOptions.javaHome = file("${System.env.JAVA_HOME}")
options.encoding = 'UTF-8'
options.deprecation = true
}

test {
testLogging {
Expand All @@ -145,6 +159,9 @@ subprojects {
javadoc {
title = '<h1>Agrona</h1>'
options.bottom = '<i>Copyright &#169; 2014-2018 Real Logic Ltd. All Rights Reserved.</i>'
if (JavaVersion.current() == JavaVersion.VERSION_1_10) {
options.addBooleanOption 'html5', true
}
}

signing {
Expand All @@ -160,13 +177,6 @@ project(':agrona') {
throw new GradleException('JAVA_HOME environment variable required')
}

compileJava {
// Suppress warnings about using Unsafe and sun.misc
options.compilerArgs << '-XDignore.symbol.file'
options.fork = true
options.forkOptions.javaHome = file("${System.env.JAVA_HOME}")
}

uploadArchives {
repositories {
mavenDeployer {
Expand Down Expand Up @@ -244,13 +254,6 @@ project(':agrona') {
project(':agrona-agent') {
apply plugin: 'com.github.johnrengelman.shadow'

compileTestJava {
// Suppress warnings about using Unsafe and sun.misc
options.compilerArgs << '-XDignore.symbol.file'
options.fork = true
options.forkOptions.javaHome = file("${System.env.JAVA_HOME}")
}

dependencies {
compile project(':agrona')
compile "net.bytebuddy:byte-buddy:1.8.5"
Expand Down Expand Up @@ -350,6 +353,6 @@ task uploadToMavenCentral {
}

task wrapper(type: Wrapper) {
gradleVersion = '4.6'
gradleVersion = '4.7'
distributionType = 'ALL'
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit eb88a68

Please sign in to comment.