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(dependency): refactor gradle dependencies #5625

Merged
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
16 changes: 0 additions & 16 deletions actuator/build.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
description = "actuator – a series of transactions for blockchain."

// Dependency versions
// ---------------------------------------

def junitVersion = "4.13.2"
def mockitoVersion = "2.1.0"
def testNgVersion = "6.11"
def slf4jVersion = "1.7.25"
// --------------------------------------

dependencies {
compile project(":chainbase")
compile project(":protocol")
compile project(":crypto")
testImplementation "junit:junit:$junitVersion"
testImplementation "org.mockito:mockito-core:$mockitoVersion"

compile "org.slf4j:jcl-over-slf4j:$slf4jVersion"
compile group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.69'
compile group: 'commons-codec', name: 'commons-codec', version: '1.11'
compile 'org.reflections:reflections:0.9.11'
}

test {
Expand Down
13 changes: 8 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,7 @@ 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 "org.slf4j:jcl-over-slf4j:1.7.25"
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.9'
compileOnly 'org.projectlombok:lombok:1.18.12'
annotationProcessor 'org.projectlombok:lombok:1.18.12'
testCompileOnly 'org.projectlombok:lombok:1.18.12'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.12'
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'
Expand All @@ -52,7 +47,15 @@ subprojects {
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'

compileOnly 'org.projectlombok:lombok:1.18.12'
annotationProcessor 'org.projectlombok:lombok:1.18.12'
testCompileOnly 'org.projectlombok:lombok:1.18.12'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.12'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you simplify the dependency org.projectlombok:lombok:1.18.12?

Copy link
Contributor Author

@tomatoishealthy tomatoishealthy Dec 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, I am not very clear about the differences between these.

How should I optimize them, do you have any suggestions?

Reference: https://stackoverflow.com/questions/50519138/annotationprocessor-gradle-4-7-configuration-doesnt-run-lombok

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does compile 'org.projectlombok:lombok:1.18.12'work ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it doesn't work

testImplementation group: 'junit', name: 'junit', version: '4.13.2'
testImplementation "org.mockito:mockito-core:2.1.0"
}

task sourcesJar(type: Jar, dependsOn: classes) {
Expand Down
34 changes: 2 additions & 32 deletions chainbase/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,16 @@ description = "chainbase – a decentralized database for blockchain."

// Dependency versions
// ---------------------------------------

def junitVersion = "4.13.2"
def mockitoVersion = "2.1.0"
def testNgVersion = "6.11"
def jacocoVersion = "0.8.0"
def leveldbVersion = "1.8"
def jansiVersion = "1.16"
// --------------------------------------

static def isWindows() {
return org.gradle.internal.os.OperatingSystem.current().isWindows()
}

if (isWindows()) {
ext {
leveldbGroup = "org.ethereum"
leveldbName = "leveldbjni-all"
leveldbVersion = "1.18.3"
}
} else {
ext {
leveldbGroup = "org.fusesource.leveldbjni"
leveldbName = "leveldbjni-all"
leveldbVersion = "1.8"
}
}

dependencies {
testImplementation "junit:junit:$junitVersion"
testImplementation "org.mockito:mockito-core:$mockitoVersion"

compile group: leveldbGroup, name: leveldbName, version: leveldbVersion
compile "org.fusesource.jansi:jansi:$jansiVersion"
compile group: 'org.rocksdb', name: 'rocksdbjni', version: '5.15.10'
compile group: 'com.typesafe', name: 'config', version: '1.3.2'
compile 'io.github.tronprotocol:zksnark-java-sdk:1.0.0'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.8.5'
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'
}

Expand Down
7 changes: 0 additions & 7 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ sourceCompatibility = 1.8

// Dependency versions
// ---------------------------------------

def leveldbVersion = "1.8"
// --------------------------------------

Expand All @@ -30,13 +29,7 @@ if (isWindows()) {
}
}

repositories {
mavenCentral()
}

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.13.2'
compile group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.69'
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'
Expand Down
13 changes: 0 additions & 13 deletions consensus/build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
description = "consensus – a distributed consensus arithmetic for blockchain."

// Dependency versions
// ---------------------------------------
def junitVersion = "4.13.2"
def mockitoVersion = "2.1.0"
def testNgVersion = "6.11"
def slf4jVersion = "1.7.25"
// --------------------------------------

dependencies {
compile project(":chainbase")
compile project(":protocol")
testImplementation "junit:junit:$junitVersion"
testImplementation "org.mockito:mockito-core:$mockitoVersion"
compile "org.slf4j:jcl-over-slf4j:$slf4jVersion"
compile group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.69'
compile group: 'commons-codec', name: 'commons-codec', version: '1.11'
}

test {
Expand Down
2 changes: 0 additions & 2 deletions crypto/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ repositories {
}

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.13.2'
compile group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.69'
compile project(":common")
}

Expand Down
23 changes: 0 additions & 23 deletions framework/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,40 +40,17 @@ dependencies {
//local libraries
compile fileTree(dir: 'libs', include: '*.jar')
// end local libraries
testCompile group: 'junit', name: 'junit', version: '4.13.2'
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.13.0'
testCompile group: 'org.hamcrest', name: 'hamcrest-junit', version: '1.0.0.1'
testCompile group: 'com.github.stefanbirkner', name: 'system-rules', version: '1.16.0'

compile group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.69'

compile group: 'com.typesafe', name: 'config', version: '1.3.2'

compile "com.cedarsoftware:java-util:1.8.0"

compile group: 'com.beust', name: 'jcommander', version: '1.72'

compile group: 'junit', name: 'junit', version: '4.13.2'

compile group: 'net.jcip', name: 'jcip-annotations', version: '1.0'

compile group: 'com.google.inject', name: 'guice', version: '4.1.0'

compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.8.5'

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'

//compile 'com.googlecode.cqengine:cqengine:2.12.4'
compile group: 'com.google.api.grpc', name: 'proto-google-common-protos', version: '2.15.0'

// 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'
compile group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '4.1.1'
// end http

// https://mvnrepository.com/artifact/com.github.briandilley.jsonrpc4j/jsonrpc4j
Expand Down
3 changes: 0 additions & 3 deletions plugins/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ configurations.getByName('checkstyleConfig') {
dependencies {
//local libraries
compile fileTree(dir: 'libs', include: '*.jar')
testCompile group: 'junit', name: 'junit', version: '4.13.2'
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.13.0'
testCompile group: 'org.hamcrest', name: 'hamcrest-junit', version: '1.0.0.1'
testCompile project(":framework")
testCompile project(":framework").sourceSets.test.output
compile group: 'info.picocli', name: 'picocli', version: '4.6.3'
Expand Down