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

feat(build): upgrade Gradle from 5.6.4 to 7.6.4 #5856

Closed
wants to merge 8 commits into from
Closed
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
6 changes: 3 additions & 3 deletions actuator/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
description = "actuator – a series of transactions for blockchain."

dependencies {
compile project(":chainbase")
compile project(":protocol")
compile project(":crypto")
api project(":chainbase")
api project(":protocol")
api project(":crypto")
}

test {
Expand Down
30 changes: 15 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
allprojects {
version = "1.0.0"
apply plugin: "java"
apply plugin: "java-library"
}

subprojects {
apply plugin: "java"
apply plugin: "jacoco"
apply plugin: "maven"
apply plugin: "maven-publish"

sourceCompatibility = JavaVersion.VERSION_1_8
Expand Down Expand Up @@ -36,18 +34,18 @@ subprojects {
}

dependencies {
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
compile group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.25'
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.9'
compile group: 'com.google.guava', name: 'guava', version: '30.1-jre'
compile "com.google.code.findbugs:jsr305:3.0.0"
compile group: 'org.springframework', name: 'spring-context', version: '5.3.18'
compile group: 'org.springframework', name: 'spring-tx', version: '5.3.18'
compile "org.apache.commons:commons-lang3:3.4"
compile group: 'org.apache.commons', name: 'commons-math', version: '2.2'
compile "org.apache.commons:commons-collections4:4.1"
compile group: 'joda-time', name: 'joda-time', version: '2.3'
compile group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.69'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
implementation group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.25'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.9'
implementation group: 'com.google.guava', name: 'guava', version: '30.1-jre'
implementation "com.google.code.findbugs:jsr305:3.0.0"
implementation group: 'org.springframework', name: 'spring-context', version: '5.3.18'
implementation group: 'org.springframework', name: 'spring-tx', version: '5.3.18'
implementation "org.apache.commons:commons-lang3:3.4"
implementation group: 'org.apache.commons', name: 'commons-math', version: '2.2'
implementation "org.apache.commons:commons-collections4:4.1"
implementation group: 'joda-time', name: 'joda-time', version: '2.3'
implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.69'

compileOnly 'org.projectlombok:lombok:1.18.12'
annotationProcessor 'org.projectlombok:lombok:1.18.12'
Expand All @@ -61,12 +59,14 @@ subprojects {
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
duplicatesStrategy = DuplicatesStrategy.INCLUDE // allow duplicates
}


tasks.withType(AbstractArchiveTask) {
preserveFileTimestamps = false
reproducibleFileOrder = true
duplicatesStrategy = DuplicatesStrategy.INCLUDE // allow duplicates
}

configurations.all {
Expand Down
13 changes: 7 additions & 6 deletions chainbase/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ def jansiVersion = "1.16"
// --------------------------------------

dependencies {
compile project(":protocol")
compile project(":common")
compile project(":crypto")
compile "org.fusesource.jansi:jansi:$jansiVersion"
compile 'io.github.tronprotocol:zksnark-java-sdk:1.0.0'
compile 'org.reflections:reflections:0.9.11'
api project(":protocol")
api project(":common")
api project(":crypto")
api "org.fusesource.jansi:jansi:$jansiVersion"
api 'io.github.tronprotocol:zksnark-java-sdk:1.0.0'
api 'org.reflections:reflections:0.9.11'
}


Expand Down Expand Up @@ -46,6 +46,7 @@ jacoco {
}

jacocoTestReport {
dependsOn(processResources) // explicit_dependency
reports {
xml.enabled = true
html.enabled = true
Expand Down
42 changes: 25 additions & 17 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,38 @@ if (isWindows()) {
}

dependencies {
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.13.4.1'
compile "com.cedarsoftware:java-util:1.8.0"
compile group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '4.1.1'
compile group: 'commons-codec', name: 'commons-codec', version: '1.11'
compile group: 'com.beust', name: 'jcommander', version: '1.72'
compile group: 'com.typesafe', name: 'config', version: '1.3.2'
compile group: leveldbGroup, name: leveldbName, version: leveldbVersion
compile group: 'org.rocksdb', name: 'rocksdbjni', version: '5.15.10'
api group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.13.4.2' // https://github.com/FasterXML/jackson-databind/issues/3627
api "com.cedarsoftware:java-util:1.8.0"
api group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '4.1.1'
api group: 'commons-codec', name: 'commons-codec', version: '1.11'
api group: 'com.beust', name: 'jcommander', version: '1.72'
api group: 'com.typesafe', name: 'config', version: '1.3.2'
api group: leveldbGroup, name: leveldbName, version: leveldbVersion
api group: 'org.rocksdb', name: 'rocksdbjni', version: '5.15.10'
// https://mvnrepository.com/artifact/org.quartz-scheduler/quartz
compile group: 'org.quartz-scheduler', name: 'quartz', version: '2.3.2'
compile group: 'io.prometheus', name: 'simpleclient', version: '0.15.0'
compile group: 'io.prometheus', name: 'simpleclient_httpserver', version: '0.15.0'
compile group: 'io.prometheus', name: 'simpleclient_hotspot', version: '0.15.0'
compile 'org.aspectj:aspectjrt:1.8.13'
compile 'org.aspectj:aspectjweaver:1.8.13'
compile 'org.aspectj:aspectjtools:1.8.13'
compile group: 'io.github.tronprotocol', name: 'libp2p', version: '2.2.1',{
api group: 'org.quartz-scheduler', name: 'quartz', version: '2.3.2'
api group: 'io.prometheus', name: 'simpleclient', version: '0.15.0'
api group: 'io.prometheus', name: 'simpleclient_httpserver', version: '0.15.0'
api group: 'io.prometheus', name: 'simpleclient_hotspot', version: '0.15.0'
api 'org.aspectj:aspectjrt:1.8.13'
api 'org.aspectj:aspectjweaver:1.8.13'
api 'org.aspectj:aspectjtools:1.8.13'
api group: 'io.github.tronprotocol', name: 'libp2p', version: '2.2.1',{
exclude group: 'io.grpc', module: 'grpc-context'
exclude group: 'io.grpc', module: 'grpc-core'
exclude group: 'io.grpc', module: 'grpc-netty'
exclude group: 'com.google.protobuf', module: 'protobuf-java'
exclude group: 'com.google.protobuf', module: 'protobuf-java-util'
// https://github.com/dom4j/dom4j/pull/116
// https://github.com/gradle/gradle/issues/13656
// https://github.com/dom4j/dom4j/issues/99
exclude group: 'jaxen', module: 'jaxen'
exclude group: 'javax.xml.stream', module: 'stax-api'
exclude group: 'net.java.dev.msv', module: 'xsdlib'
exclude group: 'pull-parser', module: 'pull-parser'
exclude group: 'xpp3', module: 'xpp3'
}
compile project(":protocol")
api project(":protocol")
}

jacocoTestReport {
Expand Down
4 changes: 2 additions & 2 deletions consensus/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
description = "consensus – a distributed consensus arithmetic for blockchain."

dependencies {
compile project(":chainbase")
compile project(":protocol")
api project(":chainbase")
api project(":protocol")
}

test {
Expand Down
2 changes: 1 addition & 1 deletion crypto/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repositories {
}

dependencies {
compile project(":common")
api project(":common")
}

jacocoTestReport {
Expand Down
2 changes: 1 addition & 1 deletion example/actuator-example/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
description = "actuator-example – a example of actuator."

dependencies {
compile project(":actuator")
api project(":actuator")
}

44 changes: 23 additions & 21 deletions framework/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,38 +38,38 @@ task version(type: Exec) {

dependencies {
//local libraries
compile fileTree(dir: 'libs', include: '*.jar')
implementation fileTree(dir: 'libs', include: '*.jar')
// end local libraries
testCompile group: 'org.hamcrest', name: 'hamcrest-junit', version: '1.0.0.1'
testCompile group: 'com.github.stefanbirkner', name: 'system-rules', version: '1.16.0'
testImplementation group: 'org.hamcrest', name: 'hamcrest-junit', version: '1.0.0.1'
testImplementation group: 'com.github.stefanbirkner', name: 'system-rules', version: '1.16.0'

compile group: 'com.google.inject', name: 'guice', version: '4.1.0'
compile group: 'io.dropwizard.metrics', name: 'metrics-core', version: '3.1.2'
compile group: 'com.github.davidb', name: 'metrics-influxdb', version: '0.8.2'
compile group: 'com.carrotsearch', name: 'java-sizeof', version: '0.0.5'
implementation group: 'com.google.inject', name: 'guice', version: '4.1.0'
implementation group: 'io.dropwizard.metrics', name: 'metrics-core', version: '3.1.2'
implementation group: 'com.github.davidb', name: 'metrics-influxdb', version: '0.8.2'
implementation group: 'com.carrotsearch', name: 'java-sizeof', version: '0.0.5'
// http
compile 'org.eclipse.jetty:jetty-server:9.4.53.v20231009'
compile 'org.eclipse.jetty:jetty-servlet:9.4.53.v20231009'
compile 'com.alibaba:fastjson:1.2.83'
implementation 'org.eclipse.jetty:jetty-server:9.4.53.v20231009'
implementation 'org.eclipse.jetty:jetty-servlet:9.4.53.v20231009'
implementation 'com.alibaba:fastjson:1.2.83'
// end http

// https://mvnrepository.com/artifact/com.github.briandilley.jsonrpc4j/jsonrpc4j
compile group: 'com.github.briandilley.jsonrpc4j', name: 'jsonrpc4j', version: '1.6'
implementation group: 'com.github.briandilley.jsonrpc4j', name: 'jsonrpc4j', version: '1.6'

// https://mvnrepository.com/artifact/javax.portlet/portlet-api
compileOnly group: 'javax.portlet', name: 'portlet-api', version: '3.0.1'

compile "io.vavr:vavr:0.9.2"
compile group: 'org.pf4j', name: 'pf4j', version: '2.5.0'
implementation "io.vavr:vavr:0.9.2"
implementation group: 'org.pf4j', name: 'pf4j', version: '2.5.0'

testImplementation group: 'org.springframework', name: 'spring-test', version: '5.2.0.RELEASE'
testImplementation group: 'org.springframework', name: 'spring-web', version: '5.2.0.RELEASE'

compile group: 'org.zeromq', name: 'jeromq', version: '0.5.3'
compile project(":chainbase")
compile project(":protocol")
compile project(":actuator")
compile project(":consensus")
implementation group: 'org.zeromq', name: 'jeromq', version: '0.5.3'
api project(":chainbase")
api project(":protocol")
api project(":actuator")
api project(":consensus")
}

check.dependsOn 'lint'
Expand Down Expand Up @@ -152,9 +152,11 @@ def binaryRelease(taskName, jarName, mainClass) {
from(sourceSets.main.output) {
include "/**"
}

// explicit_dependency
dependsOn (project(':actuator').jar, project(':consensus').jar, project(':chainbase').jar,
project(':crypto').jar, project(':common').jar, project(':protocol').jar)
from {
configurations.compile.collect {
configurations.runtimeClasspath.collect {
it.isDirectory() ? it : zipTree(it)
}
}
Expand All @@ -179,7 +181,7 @@ def createScript(project, mainClass, name) {
outputDir = new File(project.buildDir, 'scripts')
mainClassName = mainClass
applicationName = name
classpath = project.tasks[JavaPlugin.JAR_TASK_NAME].outputs.files + project.configurations.runtime
classpath = project.tasks[JavaPlugin.JAR_TASK_NAME].outputs.files + project.configurations.runtimeClasspath
// defaultJvmOpts = ['-XX:+UseConcMarkSweepGC',
// '-XX:+PrintGCDetails',
// '-Xloggc:./gc.log',
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Thu Aug 01 15:17:43 CST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
22 changes: 19 additions & 3 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
## Gradle start up script for UN*X
Expand Down Expand Up @@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down Expand Up @@ -109,8 +125,8 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
Expand Down
18 changes: 17 additions & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
Expand All @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
28 changes: 15 additions & 13 deletions plugins/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ configurations.getByName('checkstyleConfig') {

dependencies {
//local libraries
compile fileTree(dir: 'libs', include: '*.jar')
testCompile project(":framework")
testCompile project(":framework").sourceSets.test.output
compile group: 'info.picocli', name: 'picocli', version: '4.6.3'
compile group: 'com.typesafe', name: 'config', version: '1.3.2'
compile group: 'me.tongfei', name: 'progressbar', version: '0.9.3'
compile group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.69'
compile group: 'org.rocksdb', name: 'rocksdbjni', version: '5.15.10'
compile 'io.github.tronprotocol:leveldbjni-all:1.18.2'
compile 'io.github.tronprotocol:leveldb:1.18.2'
compile project(":protocol")
implementation fileTree(dir: 'libs', include: '*.jar')
testImplementation project(":framework")
testImplementation project(":framework").sourceSets.test.output
implementation group: 'info.picocli', name: 'picocli', version: '4.6.3'
implementation group: 'com.typesafe', name: 'config', version: '1.3.2'
implementation group: 'me.tongfei', name: 'progressbar', version: '0.9.3'
implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.69'
implementation group: 'org.rocksdb', name: 'rocksdbjni', version: '5.15.10'
implementation 'io.github.tronprotocol:leveldbjni-all:1.18.2'
implementation 'io.github.tronprotocol:leveldb:1.18.2'
implementation project(":protocol")
}

check.dependsOn 'lint'
Expand Down Expand Up @@ -98,8 +98,10 @@ def binaryRelease(taskName, jarName, mainClass) {
include "/**"
}

dependsOn project(':protocol').jar // explicit_dependency

from {
configurations.compile.collect {
configurations.runtimeClasspath.collect { // https://docs.gradle.org/current/userguide/upgrading_version_6.html#changes_6.3
it.isDirectory() ? it : zipTree(it)
}
}
Expand All @@ -120,7 +122,7 @@ def createScript(project, mainClass, name) {
outputDir = new File(project.buildDir, 'scripts')
mainClassName = mainClass
applicationName = name
classpath = project.tasks[JavaPlugin.JAR_TASK_NAME].outputs.files + project.configurations.runtime
classpath = project.tasks[JavaPlugin.JAR_TASK_NAME].outputs.files + project.configurations.runtimeClasspath
}
project.tasks[name].dependsOn(project.jar)
project.applicationDistribution.with {
Expand Down
Loading
Loading