Skip to content

Commit

Permalink
Implemented publishing of Linea JVM libs by Gradle (#404)
Browse files Browse the repository at this point in the history
* Implemented publishing of linea stuff

* Changed maven release to accept any gradle package id
  • Loading branch information
Filter94 authored Dec 10, 2024
1 parent 0bcfa5e commit f254667
Show file tree
Hide file tree
Showing 22 changed files with 60 additions and 35 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ on:
inputs:
libToRelease:
required: true
type: choice
type: string
description: 'Library to release, e.g :jvm-libs:blob-compressor'
options:
- ':jvm-libs:linea:blob-compressor'
- ':jvm-libs:linea:blob-shnarf-calculator'
- ':jvm-libs:linea:linea-contracts:l1-rollup'
- ':jvm-libs:linea:linea-contracts:l2-message-service'
version:
required: true
type: string
Expand Down
1 change: 0 additions & 1 deletion coordinator/clients/shomei-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ dependencies {
implementation project(':jvm-libs:generic:extensions:futures')
implementation project(':jvm-libs:generic:json-rpc')
implementation project(':jvm-libs:linea:metrics:micrometer')
implementation project(':jvm-libs:linea:core:traces')
implementation project(":jvm-libs:linea:teku-execution-client")
implementation "tech.pegasys.teku.internal:unsigned:${libs.versions.teku.get()}"

Expand Down
33 changes: 33 additions & 0 deletions jvm-libs/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
buildscript {
dependencies {
classpath(libs.jreleaser)
}
}

plugins {
id 'net.consensys.zkevm.kotlin-library-minimal-conventions'
}

// These libs are public, so we're commited on their artifactIds and `build.linea` group id, unlike the internal ones
Set<String> publicApiLibs = [
"blob-compressor",
"blob-decompressor",
"blob-shnarf-calculator",
"l1-rollup",
"l2-message-service"
]

subprojects {
// Note that artifacts with generated code only will be skipped if :publish is called without preceding :build
def hasGeneratedSources = it.fileTree(dir: 'build/generated', includes: ['**/*.java', '**/*.kt']).files.size() > 0
def hasSourceFiles = it.fileTree(dir: 'src', includes: ['**/*.java', '**/*.kt']).files.size() > 0

if (hasSourceFiles || hasGeneratedSources) {
// !in operator doesn't work with spotless plugin
if (!publicApiLibs.contains(it.name)) {
group="${rootProject.group}.internal"
}

it.apply from: rootProject.file("gradle/publishing.gradle")
}
}
18 changes: 0 additions & 18 deletions jvm-libs/generic/build.gradle

This file was deleted.

2 changes: 0 additions & 2 deletions jvm-libs/linea/blob-compressor/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
plugins {
id 'net.consensys.zkevm.kotlin-common-minimal-conventions'
id 'net.consensys.zkevm.linea-native-libs-helper'
alias(libs.plugins.jreleaser)
id 'java-test-fixtures'
}

description = 'Java JNA wrapper for Linea Blob Compressor Library implemented in GO Lang'
apply from: rootProject.file("gradle/publishing.gradle")

dependencies {
implementation "net.java.dev.jna:jna:${libs.versions.jna.get()}"
Expand Down
2 changes: 0 additions & 2 deletions jvm-libs/linea/blob-decompressor/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
plugins {
id 'net.consensys.zkevm.kotlin-library-conventions'
id 'net.consensys.zkevm.linea-native-libs-helper'
alias(libs.plugins.jreleaser)
id 'java-test-fixtures'
}

description = 'Java JNA wrapper for Linea Blob Decompressor Library implemented in GO Lang'
apply from: rootProject.file("gradle/publishing.gradle")

dependencies {
implementation "net.java.dev.jna:jna:${libs.versions.jna.get()}"
Expand Down
2 changes: 0 additions & 2 deletions jvm-libs/linea/blob-shnarf-calculator/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
plugins {
id 'net.consensys.zkevm.kotlin-common-minimal-conventions'
id 'net.consensys.zkevm.linea-native-libs-helper'
alias(libs.plugins.jreleaser)
}

description = 'Java JNA wrapper for Linea Blob Shnarf Calculator implemented in GO Lang'
apply from: rootProject.file("gradle/publishing.gradle")

dependencies {
api "net.java.dev.jna:jna:${libs.versions.jna.get()}"
Expand Down
2 changes: 2 additions & 0 deletions jvm-libs/linea/clients/interfaces/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ plugins {
id 'java-test-fixtures'
}

description="Interfaces for interaction with Linea Smart Contract"

dependencies {
api project(':jvm-libs:linea:core:domain-models')
api project(':jvm-libs:generic:extensions:futures')
Expand Down
2 changes: 2 additions & 0 deletions jvm-libs/linea/clients/linea-l1-contract-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ plugins {
id 'java-test-fixtures'
}

description="Linea L1 smart contract client"

dependencies {
api project(':jvm-libs:linea:core:domain-models')
api project(':jvm-libs:linea:clients:interfaces')
Expand Down
2 changes: 2 additions & 0 deletions jvm-libs/linea/clients/linea-state-manager/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ plugins {
id 'net.consensys.zkevm.kotlin-library-conventions'
}

description="Linea state manager client"

dependencies {
api project(':jvm-libs:linea:core:domain-models')
api project(':jvm-libs:linea:core:metrics')
Expand Down
2 changes: 2 additions & 0 deletions jvm-libs/linea/core/client-interface/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ plugins {
id 'net.consensys.zkevm.kotlin-library-conventions'
}

description="Linea Client interface"

dependencies {
implementation(project(':jvm-libs:generic:extensions:kotlin'))
implementation(project(':jvm-libs:linea:core:domain-models'))
Expand Down
2 changes: 2 additions & 0 deletions jvm-libs/linea/core/domain-models/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ plugins {
id 'net.consensys.zkevm.kotlin-common-conventions'
}

description="Linea domain models"

dependencies {
implementation project(":jvm-libs:generic:extensions:kotlin")
}
Expand Down
2 changes: 2 additions & 0 deletions jvm-libs/linea/core/long-running-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ plugins {
id 'net.consensys.zkevm.kotlin-library-conventions'
}

description="Linea long running service implementation"

dependencies {
implementation "io.vertx:vertx-core"
}
2 changes: 2 additions & 0 deletions jvm-libs/linea/core/metrics/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
plugins {
id 'net.consensys.zkevm.kotlin-library-conventions'
}

description="Linea metrics facade"
2 changes: 2 additions & 0 deletions jvm-libs/linea/core/traces/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ plugins {
id 'java-test-fixtures'
}

description="Linea Tracing utilities"

dependencies {
implementation "io.tmio:tuweni-units:${libs.versions.tuweni.get()}"
implementation project(':jvm-libs:generic:extensions:kotlin')
Expand Down
2 changes: 0 additions & 2 deletions jvm-libs/linea/linea-contracts/l1-rollup/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
id 'java-library'
id 'linea.web3j-codegen'
alias(libs.plugins.jreleaser)
}
java {
toolchain {
Expand All @@ -10,7 +9,6 @@ java {
}
description = 'Web3J Java client for Linea L1 Rollup Smart Contract'
ext.artifactId = 'l1-rollup-contract-client'
apply from: rootProject.file("gradle/publishing.gradle")

dependencies {
// this shall be very lightweight dependency, just export the generated sources
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
id 'java-library'
id 'linea.web3j-codegen'
alias(libs.plugins.jreleaser)
}
java {
toolchain {
Expand All @@ -11,7 +10,6 @@ java {

description = 'Web3J Java client for Linea L2 Message Service Contract'
ext.artifactId = 'l2-message-service-contract-client'
apply from: rootProject.file("gradle/publishing.gradle")

dependencies {
// this shall be very lightweight dependency, just export the generated sources
Expand Down
2 changes: 2 additions & 0 deletions jvm-libs/linea/metrics/micrometer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ plugins {
id 'net.consensys.zkevm.kotlin-library-conventions'
}

description="Micrometer metrics implementation for Linea"

dependencies {
api "io.vertx:vertx-micrometer-metrics"
implementation project(':jvm-libs:linea:core:metrics')
Expand Down
2 changes: 2 additions & 0 deletions jvm-libs/linea/testing/file-system/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ plugins {
id 'net.consensys.zkevm.kotlin-library-conventions'
}

description="Linea test utilities for file system interactions"

dependencies {
testImplementation(project(':jvm-libs:generic:extensions:kotlin'))
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ plugins {
id 'net.consensys.zkevm.kotlin-library-conventions'
}

description="Linea test utilities for L1 blob submission and Finalization"

dependencies {
api(project(':jvm-libs:linea:core:domain-models'))
implementation(project(':jvm-libs:generic:extensions:kotlin'))
Expand Down
2 changes: 2 additions & 0 deletions jvm-libs/linea/testing/teku-helper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ plugins {
id 'net.consensys.zkevm.kotlin-library-conventions'
}

description="Linea test utilities for interaction with Engine API by Teku client"

dependencies {
api project(":jvm-libs:linea:teku-execution-client")
api "tech.pegasys.teku.internal:unsigned:${libs.versions.teku.get()}"
Expand Down
2 changes: 2 additions & 0 deletions jvm-libs/linea/web3j-extensions/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ plugins {
id 'java-test-fixtures'
}

description="Web3j extensions for Linea"

dependencies {
api "org.web3j:core:${libs.versions.web3j.get()}"
api project(':jvm-libs:linea:core:domain-models')
Expand Down

0 comments on commit f254667

Please sign in to comment.