From f69963a8c6c87ae5935094ab00f95584e36bfd8c Mon Sep 17 00:00:00 2001 From: halibobo1205 Date: Tue, 20 Aug 2024 11:23:22 +0800 Subject: [PATCH] feat(dependencies): update dependencies 1. grpc-java 2. jcommander 3. pf4j --- common/build.gradle | 2 +- framework/build.gradle | 47 +++++++------------ .../java/org/tron/core/config/args/Args.java | 13 ++--- protocol/build.gradle | 2 +- 4 files changed, 26 insertions(+), 38 deletions(-) diff --git a/common/build.gradle b/common/build.gradle index ee8c1e8d7e5..3d6c22aee24 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -34,7 +34,7 @@ dependencies { 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.beust', name: 'jcommander', version: '1.78' api group: 'com.typesafe', name: 'config', version: '1.3.2' api group: leveldbGroup, name: leveldbName, version: leveldbVersion api group: 'org.rocksdb', name: 'rocksdbjni', version: '7.7.3' diff --git a/framework/build.gradle b/framework/build.gradle index 82ee117dd26..5562ce32890 100644 --- a/framework/build.gradle +++ b/framework/build.gradle @@ -8,6 +8,7 @@ gitProperties.failOnNoGitDirectory = false; apply plugin: 'application' apply plugin: 'checkstyle' +apply plugin: 'com.github.johnrengelman.shadow' mainClassName = 'org.tron.program.FullNode' @@ -61,7 +62,7 @@ dependencies { compileOnly group: 'javax.portlet', name: 'portlet-api', version: '3.0.1' implementation "io.vavr:vavr:0.9.2" - implementation group: 'org.pf4j', name: 'pf4j', version: '2.5.0' + implementation group: 'org.pf4j', name: 'pf4j', version: '3.10.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' @@ -150,33 +151,6 @@ jacocoTestReport { getExecutionData().setFrom(fileTree('../framework/build/jacoco').include("**.exec")) } -def binaryRelease(taskName, jarName, mainClass) { - return tasks.create("${taskName}", Jar) { - baseName = jarName - version = null - from(sourceSets.main.output) { - include "/**" - } - - from { - configurations.runtimeClasspath.collect { - it.isDirectory() ? it : zipTree(it) - } - } - - // exclude these files for bouncycastle - exclude "META-INF/*.SF" - exclude "META-INF/*.DSA" - exclude "META-INF/*.RSA" - - manifest { - attributes "Main-Class": "${mainClass}" - } - -// classifier(jarName) - } -} - def createScript(project, mainClass, name) { project.tasks.create(name: name, type: CreateStartScripts) { unixStartScriptGenerator.template = resources.text.fromFile('../gradle/unixStartScript.txt') @@ -219,10 +193,23 @@ tasks.distTar.enabled = false createScript(project, 'org.tron.program.FullNode', 'FullNode') -artifacts { - archives(binaryRelease('buildFullNodeJar', 'FullNode', 'org.tron.program.FullNode')) +shadowJar { + baseName = 'FullNode' + classifier = null + version = null + // exclude these files for bouncycastle + exclude "META-INF/*.SF" + exclude "META-INF/*.DSA" + exclude "META-INF/*.RSA" + mergeServiceFiles() // https://github.com/grpc/grpc-java/issues/10853 +} +shadowDistZip { + enabled = false } +startShadowScripts { + enabled = false +} task copyToParent(type: Copy) { into "../build/distributions" diff --git a/framework/src/main/java/org/tron/core/config/args/Args.java b/framework/src/main/java/org/tron/core/config/args/Args.java index c2b5f94cfbb..1b61ca05efb 100644 --- a/framework/src/main/java/org/tron/core/config/args/Args.java +++ b/framework/src/main/java/org/tron/core/config/args/Args.java @@ -258,14 +258,15 @@ private static void printVersion() { } catch (IOException e) { logger.error(e.getMessage()); } - JCommander.getConsole().println("OS : " + System.getProperty("os.name")); - JCommander.getConsole().println("JVM : " + System.getProperty("java.vendor") + " " + JCommander jCommander = JCommander.newBuilder().build(); + jCommander.getConsole().println("OS : " + System.getProperty("os.name")); + jCommander.getConsole().println("JVM : " + System.getProperty("java.vendor") + " " + System.getProperty("java.version") + " " + System.getProperty("os.arch")); if (!noGitProperties) { - JCommander.getConsole().println("Git : " + properties.getProperty("git.commit.id")); + jCommander.getConsole().println("Git : " + properties.getProperty("git.commit.id")); } - JCommander.getConsole().println("Version : " + Version.getVersion()); - JCommander.getConsole().println("Code : " + Version.VERSION_CODE); + jCommander.getConsole().println("Version : " + Version.getVersion()); + jCommander.getConsole().println("Code : " + Version.VERSION_CODE); } public static void printHelp(JCommander jCommander) { @@ -309,7 +310,7 @@ public static void printHelp(JCommander jCommander) { helpStr.append(tmpOptionDesc); } } - JCommander.getConsole().println(helpStr.toString()); + jCommander.getConsole().println(helpStr.toString()); } public static String upperFirst(String name) { diff --git a/protocol/build.gradle b/protocol/build.gradle index 0644004d247..f5778dbc00b 100644 --- a/protocol/build.gradle +++ b/protocol/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.google.protobuf' def protobufVersion = '3.21.12' -def grpcVersion = '1.52.1' +def grpcVersion = '1.60.0' dependencies { api group: 'com.google.protobuf', name: 'protobuf-java', version: protobufVersion