diff --git a/actuator/build.gradle b/actuator/build.gradle index 9b200064fb0..1143dc83618 100644 --- a/actuator/build.gradle +++ b/actuator/build.gradle @@ -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 { diff --git a/build.gradle b/build.gradle index 1abb18f6341..3efa4592963 100644 --- a/build.gradle +++ b/build.gradle @@ -34,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' diff --git a/chainbase/build.gradle b/chainbase/build.gradle index 408fe56ba42..79a246014d7 100644 --- a/chainbase/build.gradle +++ b/chainbase/build.gradle @@ -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' } diff --git a/common/build.gradle b/common/build.gradle index 6c1545e5d13..08425606237 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -30,30 +30,30 @@ 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.1' + 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' } - compile project(":protocol") + api project(":protocol") } jacocoTestReport { diff --git a/consensus/build.gradle b/consensus/build.gradle index 4ecd7180d13..04cc24be5fd 100644 --- a/consensus/build.gradle +++ b/consensus/build.gradle @@ -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 { diff --git a/crypto/build.gradle b/crypto/build.gradle index b551471bf49..82814af49e6 100644 --- a/crypto/build.gradle +++ b/crypto/build.gradle @@ -11,7 +11,7 @@ repositories { } dependencies { - compile project(":common") + api project(":common") } jacocoTestReport { diff --git a/example/actuator-example/build.gradle b/example/actuator-example/build.gradle index d0130e11375..e17c75895a1 100644 --- a/example/actuator-example/build.gradle +++ b/example/actuator-example/build.gradle @@ -1,6 +1,6 @@ description = "actuator-example – a example of actuator." dependencies { - compile project(":actuator") + api project(":actuator") } diff --git a/framework/build.gradle b/framework/build.gradle index 8c4fbfc4583..b92ae00ea97 100644 --- a/framework/build.gradle +++ b/framework/build.gradle @@ -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' @@ -154,7 +154,7 @@ def binaryRelease(taskName, jarName, mainClass) { } from { - configurations.compile.collect { + configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } @@ -179,7 +179,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', diff --git a/plugins/build.gradle b/plugins/build.gradle index 7f226d7099c..b85a435dc30 100644 --- a/plugins/build.gradle +++ b/plugins/build.gradle @@ -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' @@ -99,7 +99,7 @@ def binaryRelease(taskName, jarName, mainClass) { } 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) } } @@ -120,7 +120,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 { diff --git a/protocol/build.gradle b/protocol/build.gradle index 922d6d19859..0644004d247 100644 --- a/protocol/build.gradle +++ b/protocol/build.gradle @@ -4,20 +4,20 @@ def protobufVersion = '3.21.12' def grpcVersion = '1.52.1' dependencies { - compile group: 'com.google.protobuf', name: 'protobuf-java', version: protobufVersion - compile group: 'com.google.protobuf', name: 'protobuf-java-util', version: protobufVersion - compile group: 'net.jcip', name: 'jcip-annotations', version: '1.0' + api group: 'com.google.protobuf', name: 'protobuf-java', version: protobufVersion + api group: 'com.google.protobuf', name: 'protobuf-java-util', version: protobufVersion + api group: 'net.jcip', name: 'jcip-annotations', version: '1.0' // checkstyleConfig "com.puppycrawl.tools:checkstyle:${versions.checkstyle}" // google grpc - compile group: 'io.grpc', name: 'grpc-netty', version: grpcVersion - compile group: 'io.grpc', name: 'grpc-protobuf', version: grpcVersion - compile group: 'io.grpc', name: 'grpc-stub', version: grpcVersion - compile group: 'io.grpc', name: 'grpc-services', version: grpcVersion + api group: 'io.grpc', name: 'grpc-netty', version: grpcVersion + api group: 'io.grpc', name: 'grpc-protobuf', version: grpcVersion + api group: 'io.grpc', name: 'grpc-stub', version: grpcVersion + api group: 'io.grpc', name: 'grpc-services', version: grpcVersion // end google grpc - compile group: 'com.google.api.grpc', name: 'proto-google-common-protos', version: '2.15.0' + api group: 'com.google.api.grpc', name: 'proto-google-common-protos', version: '2.15.0' } tasks.matching { it instanceof Test }.all {