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

Update Gradle to 6.0, support Java 13 #180

Merged
merged 4 commits into from
Nov 11, 2019
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
25 changes: 15 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ plugins {
id 'com.github.ben-manes.versions' version '0.26.0'
id 'com.github.hierynomus.license' version '0.15.0'
id 'io.spring.dependency-management' version '1.0.8.RELEASE'
id 'me.champeau.gradle.jmh' version '0.4.8' apply false
id 'net.ltgt.errorprone' version '0.8.1'
id 'me.champeau.gradle.jmh' version '0.5.0' apply false
id 'net.ltgt.errorprone' version '1.1.1'
}

if (!JavaVersion.current().java11Compatible) {
Expand Down Expand Up @@ -98,7 +98,7 @@ allprojects {
version = rootProject.version

jacoco {
toolVersion = '0.8.2'
toolVersion = '0.8.5'
if (project.tasks.findByName('referenceTests')) {
applyTo referenceTests
}
Expand Down Expand Up @@ -197,9 +197,13 @@ allprojects {
check('FieldCanBeFinal', CheckSeverity.OFF)

// This check is broken in Java 12. See https://github.com/google/error-prone/issues/1257
if (JavaVersion.current().java12Compatible) {
if (JavaVersion.current() == JavaVersion.VERSION_12) {
check('Finally', CheckSeverity.OFF)
}
// This check is broken after Java 12. See https://github.com/google/error-prone/issues/1352
if (JavaVersion.current() > JavaVersion.VERSION_12) {
check('TypeParameterUnusedInFormals', CheckSeverity.OFF)
}

check('InsecureCryptoUsage', CheckSeverity.WARN)
check('WildcardImport', CheckSeverity.WARN)
Expand Down Expand Up @@ -283,7 +287,7 @@ task checkMavenCoordinateCollisions {
}
}

tasks.register('checkPluginAPIChanges', DefaultTask) { }
tasks.register('checkPluginAPIChanges', DefaultTask) {}
checkPluginAPIChanges.dependsOn(':plugin-api:checkAPIChanges')
check.dependsOn('checkPluginAPIChanges', 'checkMavenCoordinateCollisions')

Expand Down Expand Up @@ -317,11 +321,11 @@ subprojects {

def sourceSetIsPopulated = { sourceSetName ->
def result = project.sourceSets.names.contains(sourceSetName) && !project.sourceSets.getAt(sourceSetName).allSource.empty
logger.info("Project = "+ project.name + " Has Source Set (" + sourceSetName + ") = " + result + "(" + project.sourceSets.names + ")")
logger.info("Project = " + project.name + " Has Source Set (" + sourceSetName + ") = " + result + "(" + project.sourceSets.names + ")")
return result
}

if(sourceSetIsPopulated("main") || sourceSetIsPopulated("testSupport")) {
if (sourceSetIsPopulated("main") || sourceSetIsPopulated("testSupport")) {
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'

Expand All @@ -330,13 +334,13 @@ subprojects {
mavenJava(MavenPublication) {
groupId "org.hyperledger.besu.internal"
version "${project.version}"
if(sourceSetIsPopulated("main")) {
if (sourceSetIsPopulated("main")) {
from components.java
artifact sourcesJar
artifact javadocJar
}

if(sourceSetIsPopulated("testSupport")) {
if (sourceSetIsPopulated("testSupport")) {
artifact testSupportJar
}
versionMapping {
Expand Down Expand Up @@ -424,6 +428,7 @@ subprojects {
include = _strListCmdArg('include', [''])
humanOutputFile = project.file("${project.buildDir}/reports/jmh/results.txt")
resultFormat = 'JSON'
duplicateClassesStrategy = 'warn'
}

dependencies { jmh 'org.apache.logging.log4j:log4j-api' }
Expand Down Expand Up @@ -558,7 +563,7 @@ task dockerUpload(type: Exec) {
additionalTags.add('develop')
}

if (! version ==~ /.*-SNAPSHOT/) {
if (!version ==~ /.*-SNAPSHOT/) {
additionalTags.add('latest')
additionalTags.add(version.split(/\./)[0..1].join('.'))
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-bin.zip