Skip to content

Commit

Permalink
Gradle dependencies improv (#224)
Browse files Browse the repository at this point in the history
* Adding missing dependencies from exclusion api

* coordinator: switch tuweni to io.tmio fork

* jvmlibs: remove unnecessary dependencies

* jvmlibs: remove unnecessary dep on tuweni

---------

Co-authored-by: Roman <4833306+Filter94@users.noreply.github.com>
  • Loading branch information
jpnovais and Filter94 authored Oct 22, 2024
1 parent 04857a0 commit ea017bb
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,18 @@ plugins {
id 'net.consensys.zkevm.kotlin-common-minimal-conventions'
}

repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
maven {
url 'https://artifacts.consensys.net/public/teku/maven/'
content { includeGroupAndSubgroups('tech.pegasys') }
}
maven {
url "https://hyperledger.jfrog.io/artifactory/besu-maven/"
content { includeGroupAndSubgroups('org.hyperledger.besu') }
}
maven {
url "https://artifacts.consensys.net/public/maven/maven/"
}
// to allow locally published artifacts to be resolved uncomment enable mavenLocal() below
// build.linea:blob-compressor:2.0.0-SNAPSHOT
// useful to test WIP development versions
//mavenLocal() {
// content {
// includeModule('build.linea', 'blob-compressor')
// includeModule('build.linea', 'shnarf-calculator')
// }
//}
}

dependencies {
constraints {
// Define dependency versions as constraints
implementation 'org.apache.commons:commons-text:1.9'
}

api platform("io.vertx:vertx-stack-depchain:${libs.versions.vertx.get()}")
//<utils>
implementation 'com.michael-bull.kotlin-result:kotlin-result:1.1.16'
implementation "tech.pegasys.teku.internal:bytes:${libs.versions.teku.get()}"
implementation "com.michael-bull.kotlin-result:kotlin-result:${libs.versions.kotlinResult.get()}"
implementation ("tech.pegasys.teku.internal:async:${libs.versions.teku.get()}") {
exclude group: 'org.slf4j'
exclude group: 'com.github.jnr'
exclude group: 'com.squareup.okhttp3'
exclude group: 'org.apache.logging.log4j'
exclude group: 'tech.pegasys.teku.internal', module: 'metrics'
exclude group: 'tech.pegasys.teku.internal', module: 'time'
}

implementation "io.tmio:tuweni-units:${libs.versions.tuweni.get()}"
//</utils>
} because("We are using Teku's SafeFuture, an improved/extension of CompletableFuture.")

//<logging>
implementation "org.apache.logging.log4j:log4j-api:${libs.versions.log4j.get()}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,26 @@ java {

repositories {
mavenCentral()
maven {
url 'https://artifacts.consensys.net/public/teku/maven/'
content { includeGroupAndSubgroups('tech.pegasys') }
}
maven {
url "https://hyperledger.jfrog.io/artifactory/besu-maven/"
content { includeGroupAndSubgroups('org.hyperledger.besu') }
}
maven {
url "https://artifacts.consensys.net/public/maven/maven/"
}
// to allow locally published artifacts to be resolved uncomment enable mavenLocal() below
// build.linea:blob-compressor:2.0.0-SNAPSHOT
// useful to test WIP development versions
//mavenLocal() {
// content {
// includeModule('build.linea', 'blob-compressor')
// includeModule('build.linea', 'shnarf-calculator')
// }
//}
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
plugins {
// Apply the common convention plugin for shared build configuration between library and application projects.
id 'net.consensys.zkevm.kotlin-common-conventions'

// Apply the java-library plugin for API and implementation separation.
id 'java-library'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
plugins {
id 'net.consensys.zkevm.kotlin-common-minimal-conventions'
id 'java-library'
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import com.fasterxml.jackson.databind.JsonSerializer
import com.fasterxml.jackson.databind.MapperFeature
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.SerializerProvider
import com.fasterxml.jackson.databind.module.SimpleModule
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
import com.fasterxml.jackson.module.kotlin.jacksonMapperBuilder
import org.apache.tuweni.bytes.Bytes
Expand All @@ -17,7 +16,6 @@ object JsonSerialization {
.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS)
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.addModule(JavaTimeModule())
.addModule(SimpleModule().addSerializer(Bytes::class.java, TuweniBytesSerializer()))
.build()
}

Expand Down
2 changes: 2 additions & 0 deletions coordinator/clients/type2-state-manager-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ dependencies {
implementation "com.fasterxml.jackson.core:jackson-annotations:${libs.versions.jackson.get()}"
implementation "com.fasterxml.jackson.core:jackson-databind:${libs.versions.jackson.get()}"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:${libs.versions.jackson.get()}"
// TODO: to remove from our internal domain classes
implementation "io.tmio:tuweni-units:${libs.versions.tuweni.get()}"

testImplementation "io.vertx:vertx-junit5"
testImplementation "com.github.tomakehurst:wiremock-jre8:${libs.versions.wiremock.get()}"
Expand Down
1 change: 1 addition & 0 deletions coordinator/ethereum/models-helper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
dependencies {
api (project(":coordinator:core"))
api project(":jvm-libs:linea:teku-execution-client")
implementation "tech.pegasys.teku.internal:bytes:${libs.versions.teku.get()}"
implementation "org.hyperledger.besu:besu-datatypes:${libs.versions.besu.get()}"
implementation "org.hyperledger.besu:evm:${libs.versions.besu.get()}"
implementation "org.hyperledger.besu.internal:rlp:${libs.versions.besu.get()}"
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ picoli = "4.7.1"
restassured = "5.3.0"
teku = "23.1.1"
tuweni = "2.4.2"
kotlinResult = "1.1.16"
vertx = "4.5.0"
web3j = "4.12.0"
wiremock = "3.0.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import io.vertx.core.http.HttpClientOptions
import io.vertx.core.http.HttpVersion
import io.vertx.core.json.JsonArray
import io.vertx.core.json.JsonObject
import net.consensys.decodeHex
import net.consensys.linea.async.get
import net.consensys.linea.async.toSafeFuture
import net.consensys.linea.jsonrpc.JsonRpcError
Expand All @@ -27,7 +28,6 @@ import net.consensys.linea.jsonrpc.JsonRpcSuccessResponse
import org.apache.logging.log4j.Level
import org.apache.logging.log4j.LogManager
import org.apache.logging.log4j.Logger
import org.apache.tuweni.bytes.Bytes
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.BeforeEach
Expand Down Expand Up @@ -81,7 +81,7 @@ class VertxHttpJsonRpcClientTest {
JsonObject()
.put("name", "Alice")
.put("email", "alice@wonderland.io")
.put("address", Bytes.fromHexString("0xaabbccdd").toArray())
.put("address", "0xaabbccdd".decodeHex())
)
client.makeRequest(JsonRpcRequestListParams("2.0", 1, "addUser", params)).get()

Expand Down
3 changes: 2 additions & 1 deletion jvm-libs/linea/core/domain-models/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ plugins {

dependencies {
implementation project(":jvm-libs:generic:extensions:kotlin")
implementation "io.tmio:tuweni-units:${libs.versions.tuweni.get()}"
// TODO: to remove from our internal domain classes
api "io.tmio:tuweni-units:${libs.versions.tuweni.get()}"
}

jar {
Expand Down
1 change: 1 addition & 0 deletions jvm-libs/linea/testing/teku-helper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ dependencies {

implementation "tech.pegasys.teku.internal:spec:${libs.versions.teku.get()}"
implementation "tech.pegasys.teku.internal:spec:${libs.versions.teku.get()}:test-fixtures"
implementation "io.tmio:tuweni-units:${libs.versions.tuweni.get()}"
}
1 change: 1 addition & 0 deletions jvm-libs/linea/web3j-extensions/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies {
api project(':jvm-libs:generic:logging')
// For domain mappers
implementation project(":jvm-libs:generic:extensions:kotlin")
implementation "tech.pegasys.teku.internal:bytes:${libs.versions.teku.get()}"
implementation "tech.pegasys.teku.internal:jackson:${libs.versions.teku.get()}"
// Returned by domain mapper
api project(":jvm-libs:linea:teku-execution-client")
Expand Down

0 comments on commit ea017bb

Please sign in to comment.