Skip to content

Commit 844d2da

Browse files
authored
Merge pull request #5869 from halibobo1205/feat/gradle7.6.4
feat(build): upgrade Gradle from 5.6.4 to 7.6.4
2 parents d383177 + 40525fe commit 844d2da

File tree

16 files changed

+131
-98
lines changed

16 files changed

+131
-98
lines changed

actuator/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
description = "actuator – a series of transactions for blockchain."
22

33
dependencies {
4-
compile project(":chainbase")
5-
compile project(":protocol")
6-
compile project(":crypto")
4+
api project(":chainbase")
5+
api project(":protocol")
6+
api project(":crypto")
77
}
88

99
test {

build.gradle

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
allprojects {
22
version = "1.0.0"
3-
apply plugin: "java"
3+
apply plugin: "java-library"
44
}
55

66
subprojects {
7-
apply plugin: "java"
87
apply plugin: "jacoco"
9-
apply plugin: "maven"
108
apply plugin: "maven-publish"
119

1210
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -36,18 +34,18 @@ subprojects {
3634
}
3735

3836
dependencies {
39-
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
40-
compile group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.25'
41-
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.9'
42-
compile group: 'com.google.guava', name: 'guava', version: '30.1-jre'
43-
compile "com.google.code.findbugs:jsr305:3.0.0"
44-
compile group: 'org.springframework', name: 'spring-context', version: '5.3.18'
45-
compile group: 'org.springframework', name: 'spring-tx', version: '5.3.18'
46-
compile "org.apache.commons:commons-lang3:3.4"
47-
compile group: 'org.apache.commons', name: 'commons-math', version: '2.2'
48-
compile "org.apache.commons:commons-collections4:4.1"
49-
compile group: 'joda-time', name: 'joda-time', version: '2.3'
50-
compile group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.69'
37+
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
38+
implementation group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.25'
39+
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.9'
40+
implementation group: 'com.google.guava', name: 'guava', version: '30.1-jre'
41+
implementation "com.google.code.findbugs:jsr305:3.0.0"
42+
implementation group: 'org.springframework', name: 'spring-context', version: '5.3.18'
43+
implementation group: 'org.springframework', name: 'spring-tx', version: '5.3.18'
44+
implementation "org.apache.commons:commons-lang3:3.4"
45+
implementation group: 'org.apache.commons', name: 'commons-math', version: '2.2'
46+
implementation "org.apache.commons:commons-collections4:4.1"
47+
implementation group: 'joda-time', name: 'joda-time', version: '2.3'
48+
implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.69'
5149

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

6665

6766
tasks.withType(AbstractArchiveTask) {
6867
preserveFileTimestamps = false
6968
reproducibleFileOrder = true
69+
duplicatesStrategy = DuplicatesStrategy.INCLUDE // allow duplicates
7070
}
7171

7272
configurations.all {

chainbase/build.gradle

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ def jansiVersion = "1.16"
77
// --------------------------------------
88

99
dependencies {
10-
compile project(":protocol")
11-
compile project(":common")
12-
compile project(":crypto")
13-
compile "org.fusesource.jansi:jansi:$jansiVersion"
14-
compile 'io.github.tronprotocol:zksnark-java-sdk:1.0.0'
15-
compile 'org.reflections:reflections:0.9.11'
10+
api project(":protocol")
11+
api project(":common")
12+
api project(":crypto")
13+
api "org.fusesource.jansi:jansi:$jansiVersion"
14+
api 'io.github.tronprotocol:zksnark-java-sdk:1.0.0'
15+
api 'org.reflections:reflections:0.9.11'
1616
}
1717

1818

common/build.gradle

+25-17
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,38 @@ if (isWindows()) {
3030
}
3131

3232
dependencies {
33-
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.13.4.1'
34-
compile "com.cedarsoftware:java-util:1.8.0"
35-
compile group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '4.1.1'
36-
compile group: 'commons-codec', name: 'commons-codec', version: '1.11'
37-
compile group: 'com.beust', name: 'jcommander', version: '1.72'
38-
compile group: 'com.typesafe', name: 'config', version: '1.3.2'
39-
compile group: leveldbGroup, name: leveldbName, version: leveldbVersion
40-
compile group: 'org.rocksdb', name: 'rocksdbjni', version: '5.15.10'
33+
api group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.13.4.2' // https://github.com/FasterXML/jackson-databind/issues/3627
34+
api "com.cedarsoftware:java-util:1.8.0"
35+
api group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '4.1.1'
36+
api group: 'commons-codec', name: 'commons-codec', version: '1.11'
37+
api group: 'com.beust', name: 'jcommander', version: '1.72'
38+
api group: 'com.typesafe', name: 'config', version: '1.3.2'
39+
api group: leveldbGroup, name: leveldbName, version: leveldbVersion
40+
api group: 'org.rocksdb', name: 'rocksdbjni', version: '5.15.10'
4141
// https://mvnrepository.com/artifact/org.quartz-scheduler/quartz
42-
compile group: 'org.quartz-scheduler', name: 'quartz', version: '2.3.2'
43-
compile group: 'io.prometheus', name: 'simpleclient', version: '0.15.0'
44-
compile group: 'io.prometheus', name: 'simpleclient_httpserver', version: '0.15.0'
45-
compile group: 'io.prometheus', name: 'simpleclient_hotspot', version: '0.15.0'
46-
compile 'org.aspectj:aspectjrt:1.8.13'
47-
compile 'org.aspectj:aspectjweaver:1.8.13'
48-
compile 'org.aspectj:aspectjtools:1.8.13'
49-
compile group: 'io.github.tronprotocol', name: 'libp2p', version: '2.2.1',{
42+
api group: 'org.quartz-scheduler', name: 'quartz', version: '2.3.2'
43+
api group: 'io.prometheus', name: 'simpleclient', version: '0.15.0'
44+
api group: 'io.prometheus', name: 'simpleclient_httpserver', version: '0.15.0'
45+
api group: 'io.prometheus', name: 'simpleclient_hotspot', version: '0.15.0'
46+
api 'org.aspectj:aspectjrt:1.8.13'
47+
api 'org.aspectj:aspectjweaver:1.8.13'
48+
api 'org.aspectj:aspectjtools:1.8.13'
49+
api group: 'io.github.tronprotocol', name: 'libp2p', version: '2.2.1',{
5050
exclude group: 'io.grpc', module: 'grpc-context'
5151
exclude group: 'io.grpc', module: 'grpc-core'
5252
exclude group: 'io.grpc', module: 'grpc-netty'
5353
exclude group: 'com.google.protobuf', module: 'protobuf-java'
5454
exclude group: 'com.google.protobuf', module: 'protobuf-java-util'
55+
// https://github.com/dom4j/dom4j/pull/116
56+
// https://github.com/gradle/gradle/issues/13656
57+
// https://github.com/dom4j/dom4j/issues/99
58+
exclude group: 'jaxen', module: 'jaxen'
59+
exclude group: 'javax.xml.stream', module: 'stax-api'
60+
exclude group: 'net.java.dev.msv', module: 'xsdlib'
61+
exclude group: 'pull-parser', module: 'pull-parser'
62+
exclude group: 'xpp3', module: 'xpp3'
5563
}
56-
compile project(":protocol")
64+
api project(":protocol")
5765
}
5866

5967
jacocoTestReport {

consensus/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
description = "consensus – a distributed consensus arithmetic for blockchain."
22

33
dependencies {
4-
compile project(":chainbase")
5-
compile project(":protocol")
4+
api project(":chainbase")
5+
api project(":protocol")
66
}
77

88
test {

crypto/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repositories {
1111
}
1212

1313
dependencies {
14-
compile project(":common")
14+
api project(":common")
1515
}
1616

1717
jacocoTestReport {

example/actuator-example/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
description = "actuator-example – a example of actuator."
22

33
dependencies {
4-
compile project(":actuator")
4+
api project(":actuator")
55
}
66

framework/build.gradle

+20-20
Original file line numberDiff line numberDiff line change
@@ -38,38 +38,38 @@ task version(type: Exec) {
3838

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

46-
compile group: 'com.google.inject', name: 'guice', version: '4.1.0'
47-
compile group: 'io.dropwizard.metrics', name: 'metrics-core', version: '3.1.2'
48-
compile group: 'com.github.davidb', name: 'metrics-influxdb', version: '0.8.2'
49-
compile group: 'com.carrotsearch', name: 'java-sizeof', version: '0.0.5'
46+
implementation group: 'com.google.inject', name: 'guice', version: '4.1.0'
47+
implementation group: 'io.dropwizard.metrics', name: 'metrics-core', version: '3.1.2'
48+
implementation group: 'com.github.davidb', name: 'metrics-influxdb', version: '0.8.2'
49+
implementation group: 'com.carrotsearch', name: 'java-sizeof', version: '0.0.5'
5050
// http
51-
compile 'org.eclipse.jetty:jetty-server:9.4.53.v20231009'
52-
compile 'org.eclipse.jetty:jetty-servlet:9.4.53.v20231009'
53-
compile 'com.alibaba:fastjson:1.2.83'
51+
implementation 'org.eclipse.jetty:jetty-server:9.4.53.v20231009'
52+
implementation 'org.eclipse.jetty:jetty-servlet:9.4.53.v20231009'
53+
implementation 'com.alibaba:fastjson:1.2.83'
5454
// end http
5555

5656
// https://mvnrepository.com/artifact/com.github.briandilley.jsonrpc4j/jsonrpc4j
57-
compile group: 'com.github.briandilley.jsonrpc4j', name: 'jsonrpc4j', version: '1.6'
57+
implementation group: 'com.github.briandilley.jsonrpc4j', name: 'jsonrpc4j', version: '1.6'
5858

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

62-
compile "io.vavr:vavr:0.9.2"
63-
compile group: 'org.pf4j', name: 'pf4j', version: '2.5.0'
62+
implementation "io.vavr:vavr:0.9.2"
63+
implementation group: 'org.pf4j', name: 'pf4j', version: '2.5.0'
6464

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

68-
compile group: 'org.zeromq', name: 'jeromq', version: '0.5.3'
69-
compile project(":chainbase")
70-
compile project(":protocol")
71-
compile project(":actuator")
72-
compile project(":consensus")
68+
implementation group: 'org.zeromq', name: 'jeromq', version: '0.5.3'
69+
api project(":chainbase")
70+
api project(":protocol")
71+
api project(":actuator")
72+
api project(":consensus")
7373
}
7474

7575
check.dependsOn 'lint'
@@ -154,7 +154,7 @@ def binaryRelease(taskName, jarName, mainClass) {
154154
}
155155

156156
from {
157-
configurations.compile.collect {
157+
configurations.runtimeClasspath.collect {
158158
it.isDirectory() ? it : zipTree(it)
159159
}
160160
}
@@ -179,7 +179,7 @@ def createScript(project, mainClass, name) {
179179
outputDir = new File(project.buildDir, 'scripts')
180180
mainClassName = mainClass
181181
applicationName = name
182-
classpath = project.tasks[JavaPlugin.JAR_TASK_NAME].outputs.files + project.configurations.runtime
182+
classpath = project.tasks[JavaPlugin.JAR_TASK_NAME].outputs.files + project.configurations.runtimeClasspath
183183
// defaultJvmOpts = ['-XX:+UseConcMarkSweepGC',
184184
// '-XX:+PrintGCDetails',
185185
// '-Xloggc:./gc.log',

gradle/wrapper/gradle-wrapper.jar

-556 Bytes
Binary file not shown.
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Thu Aug 01 15:17:43 CST 2019
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

gradlew

+19-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#!/usr/bin/env sh
22

3+
#
4+
# Copyright 2015 the original author or authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# https://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
319
##############################################################################
420
##
521
## Gradle start up script for UN*X
@@ -28,7 +44,7 @@ APP_NAME="Gradle"
2844
APP_BASE_NAME=`basename "$0"`
2945

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

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

112-
# For Cygwin, switch paths to Windows format before running java
113-
if $cygwin ; then
128+
# For Cygwin or MSYS, switch paths to Windows format before running java
129+
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
114130
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115131
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116132
JAVACMD=`cygpath --unix "$JAVACMD"`

gradlew.bat

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
@rem
2+
@rem Copyright 2015 the original author or authors.
3+
@rem
4+
@rem Licensed under the Apache License, Version 2.0 (the "License");
5+
@rem you may not use this file except in compliance with the License.
6+
@rem You may obtain a copy of the License at
7+
@rem
8+
@rem https://www.apache.org/licenses/LICENSE-2.0
9+
@rem
10+
@rem Unless required by applicable law or agreed to in writing, software
11+
@rem distributed under the License is distributed on an "AS IS" BASIS,
12+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
@rem See the License for the specific language governing permissions and
14+
@rem limitations under the License.
15+
@rem
16+
117
@if "%DEBUG%" == "" @echo off
218
@rem ##########################################################################
319
@rem
@@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
1430
set APP_HOME=%DIRNAME%
1531

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

1935
@rem Find java.exe
2036
if defined JAVA_HOME goto findJavaFromJavaHome

plugins/build.gradle

+13-13
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ configurations.getByName('checkstyleConfig') {
2525

2626
dependencies {
2727
//local libraries
28-
compile fileTree(dir: 'libs', include: '*.jar')
29-
testCompile project(":framework")
30-
testCompile project(":framework").sourceSets.test.output
31-
compile group: 'info.picocli', name: 'picocli', version: '4.6.3'
32-
compile group: 'com.typesafe', name: 'config', version: '1.3.2'
33-
compile group: 'me.tongfei', name: 'progressbar', version: '0.9.3'
34-
compile group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.69'
35-
compile group: 'org.rocksdb', name: 'rocksdbjni', version: '5.15.10'
36-
compile 'io.github.tronprotocol:leveldbjni-all:1.18.2'
37-
compile 'io.github.tronprotocol:leveldb:1.18.2'
38-
compile project(":protocol")
28+
implementation fileTree(dir: 'libs', include: '*.jar')
29+
testImplementation project(":framework")
30+
testImplementation project(":framework").sourceSets.test.output
31+
implementation group: 'info.picocli', name: 'picocli', version: '4.6.3'
32+
implementation group: 'com.typesafe', name: 'config', version: '1.3.2'
33+
implementation group: 'me.tongfei', name: 'progressbar', version: '0.9.3'
34+
implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.69'
35+
implementation group: 'org.rocksdb', name: 'rocksdbjni', version: '5.15.10'
36+
implementation 'io.github.tronprotocol:leveldbjni-all:1.18.2'
37+
implementation 'io.github.tronprotocol:leveldb:1.18.2'
38+
implementation project(":protocol")
3939
}
4040

4141
check.dependsOn 'lint'
@@ -99,7 +99,7 @@ def binaryRelease(taskName, jarName, mainClass) {
9999
}
100100

101101
from {
102-
configurations.compile.collect {
102+
configurations.runtimeClasspath.collect { // https://docs.gradle.org/current/userguide/upgrading_version_6.html#changes_6.3
103103
it.isDirectory() ? it : zipTree(it)
104104
}
105105
}
@@ -120,7 +120,7 @@ def createScript(project, mainClass, name) {
120120
outputDir = new File(project.buildDir, 'scripts')
121121
mainClassName = mainClass
122122
applicationName = name
123-
classpath = project.tasks[JavaPlugin.JAR_TASK_NAME].outputs.files + project.configurations.runtime
123+
classpath = project.tasks[JavaPlugin.JAR_TASK_NAME].outputs.files + project.configurations.runtimeClasspath
124124
}
125125
project.tasks[name].dependsOn(project.jar)
126126
project.applicationDistribution.with {

0 commit comments

Comments
 (0)