Skip to content

Commit

Permalink
feat(dependencies): update dependencies
Browse files Browse the repository at this point in the history
  1. grpc-java
  2. jcommander
  3. pf4j
  • Loading branch information
halibobo1205 committed Nov 23, 2024
1 parent 06ee55d commit 884dffc
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 69 deletions.
2 changes: 1 addition & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,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'
// https://mvnrepository.com/artifact/org.quartz-scheduler/quartz
api group: 'org.quartz-scheduler', name: 'quartz', version: '2.3.2'
Expand Down
55 changes: 23 additions & 32 deletions framework/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ gitProperties.failOnNoGitDirectory = false;

apply plugin: 'application'
apply plugin: 'checkstyle'
apply plugin: 'com.github.johnrengelman.shadow'

mainClassName = 'org.tron.program.FullNode'

Expand Down Expand Up @@ -39,6 +40,10 @@ dependencies {
implementation fileTree(dir: 'libs', include: '*.jar')
// end local libraries
testImplementation group: 'org.hamcrest', name: 'hamcrest-junit', version: '1.0.0.1'
// https://github.com/stefanbirkner/system-rules/issues/85
// https://openjdk.org/jeps/411, JEP 411: Deprecate the Security Manager for Removal from JDK17
// WARNING: A terminally deprecated method in java.lang.System has been called
// WARNING: System::setSecurityManager will be removed in a future release
testImplementation group: 'com.github.stefanbirkner', name: 'system-rules', version: '1.16.0'

implementation group: 'com.google.inject', name: 'guice', version: '4.1.0'
Expand All @@ -57,7 +62,9 @@ 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',{
exclude group: 'org.slf4j', module: 'slf4j-api'
}

testImplementation group: 'org.springframework', name: 'spring-test', version: '5.2.0.RELEASE'
testImplementation group: 'org.springframework', name: 'spring-web', version: '5.2.0.RELEASE'
Expand Down Expand Up @@ -146,35 +153,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 "/**"
}
// explicit_dependency
dependsOn (project(':actuator').jar, project(':consensus').jar, project(':chainbase').jar,
project(':crypto').jar, project(':common').jar, project(':protocol').jar)
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')
Expand Down Expand Up @@ -222,10 +200,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"
Expand Down
13 changes: 7 additions & 6 deletions framework/src/main/java/org/tron/core/config/args/Args.java
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,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) {
Expand Down Expand Up @@ -311,7 +312,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) {
Expand Down
46 changes: 17 additions & 29 deletions plugins/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {

apply plugin: 'application'
apply plugin: 'checkstyle'
apply plugin: 'com.github.johnrengelman.shadow'

def versions = [
checkstyle: '8.7',
Expand Down Expand Up @@ -86,33 +87,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 "/**"
}

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

from {
configurations.runtimeClasspath.collect { // https://docs.gradle.org/current/userguide/upgrading_version_6.html#changes_6.3
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}"
}
}
}

def createScript(project, mainClass, name) {
project.tasks.create(name: name, type: CreateStartScripts) {
outputDir = new File(project.buildDir, 'scripts')
Expand All @@ -139,8 +113,22 @@ if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
}
createScript(project, 'org.tron.plugins.Toolkit', 'Toolkit')

artifacts {
archives(binaryRelease('buildToolkitJar', 'Toolkit', 'org.tron.plugins.Toolkit'))
shadowJar {
baseName = 'Toolkit'
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) {
Expand Down
2 changes: 1 addition & 1 deletion protocol/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.google.protobuf'

def protobufVersion = '3.25.5'
def grpcVersion = '1.52.1'
def grpcVersion = '1.60.0'

dependencies {
api group: 'com.google.protobuf', name: 'protobuf-java', version: protobufVersion
Expand Down

0 comments on commit 884dffc

Please sign in to comment.