Skip to content

Commit 31d62a1

Browse files
authored
Use Besu plugin Gradle plugin (#65)
Signed-off-by: Fabio Di Fabio <[email protected]>
1 parent de37cec commit 31d62a1

File tree

4 files changed

+29
-137
lines changed

4 files changed

+29
-137
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ jobs:
5656
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5757
with:
5858
upload_url: ${{ steps.create_release.outputs.upload_url }}
59-
asset_path: ./build/libs/besu-shomei-plugin-${{ steps.get_version.outputs.VERSION }}.jar
60-
asset_name: besu-shomei-plugin-${{ steps.get_version.outputs.VERSION }}.jar
59+
asset_path: ./build/distributions/besu-shomei-plugin-${{ steps.get_version.outputs.VERSION }}.zip
60+
asset_name: besu-shomei-plugin-${{ steps.get_version.outputs.VERSION }}.zip
6161
asset_content_type: application/octet-stream
6262
- name: Upload Test Support JAR
6363
id: upload-test-support-release-asset

build.gradle

Lines changed: 17 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -15,43 +15,16 @@ import groovy.transform.Memoized
1515
* SPDX-License-Identifier: Apache-2.0
1616
*/
1717

18-
buildscript {
19-
repositories {
20-
maven {
21-
url "https://artifacts.consensys.net/public/linea-besu/maven/"
22-
content { includeGroupByRegex('io\\.consensys\\..*') }
23-
content { includeGroupByRegex('org\\.hyperledger\\..*') }
24-
}
25-
maven {
26-
url "https://hyperledger.jfrog.io/artifactory/besu-maven/"
27-
content { includeGroupByRegex('org\\.hyperledger\\.besu\\..*')}
28-
}
29-
mavenCentral()
30-
maven {
31-
url "https://artifacts.consensys.net/public/maven/maven/"
32-
content { includeGroupByRegex('tech\\.pegasys\\..*')}
33-
}
34-
mavenLocal()
35-
}
36-
dependencies {
37-
classpath 'tech.pegasys.internal.license.reporter:license-reporter:1.1.1'
38-
}
39-
}
40-
4118
plugins {
4219
id 'com.diffplug.spotless' version '6.21.0'
43-
id 'com.github.ben-manes.versions' version '0.46.0'
4420
id 'com.github.hierynomus.license' version '0.16.1'
4521
id 'io.spring.dependency-management' version '1.1.0'
4622
id 'com.github.jk1.dependency-license-report' version '2.1'
4723
id 'net.ltgt.errorprone' version '3.0.1' apply false
48-
id 'com.github.johnrengelman.shadow' version '7.1.2'
49-
id 'java'
50-
id 'java-library'
24+
id 'net.consensys.besu-plugin-distribution' version '0.1.2'
5125
}
5226

53-
54-
apply plugin: 'java-library'
27+
apply plugin: 'net.consensys.besu-plugin-distribution'
5528
apply plugin: 'io.spring.dependency-management'
5629
apply plugin: 'net.ltgt.errorprone'
5730
apply plugin: 'jacoco'
@@ -62,42 +35,26 @@ group = 'net.consensys.shomei.besu.plugin'
6235
//version = '0.1.0'
6336
version = project.hasProperty('releaseVersion') ? project.getProperty('releaseVersion') : 'snapshot'
6437

65-
sourceCompatibility = JavaVersion.VERSION_21
66-
targetCompatibility = JavaVersion.VERSION_21
38+
java {
39+
sourceCompatibility = 21
40+
targetCompatibility = 21
41+
}
6742

6843
defaultTasks 'build', 'checkLicenses', 'javadoc', 'plugin'
6944

7045
repositories {
71-
maven {
72-
url "https://artifacts.consensys.net/public/linea-besu/maven/"
73-
content { includeGroupByRegex('io\\.consensys\\..*') }
74-
content { includeGroupByRegex('org\\.hyperledger\\..*') }
75-
}
76-
maven {
77-
url "https://hyperledger.jfrog.io/artifactory/besu-maven/"
78-
content { includeGroupByRegex('org\\.hyperledger\\.besu\\..*')}
79-
}
8046
mavenCentral()
81-
maven {
82-
url "https://artifacts.consensys.net/public/maven/maven/"
83-
content { includeGroupByRegex('tech\\.pegasys($|\\..*)')}
84-
}
8547
maven {
8648
url "https://dl.cloudsmith.io/public/libp2p/jvm-libp2p/maven/"
8749
content { includeGroupByRegex('io\\.libp2p($|\\..*)') }
8850
}
89-
maven {
90-
url "https://hyperledger.jfrog.io/artifactory/besu-maven/"
91-
content { includeGroupByRegex('org\\.hyperledger\\.besu($|\\..*)') }
92-
}
93-
mavenLocal()
9451
maven {
9552
url "https://artifacts.consensys.net/public/linea-arithmetization/maven/"
9653
content {
9754
includeGroupByRegex('net\\.consensys\\.linea\\..*?')
9855
}
9956
}
100-
57+
mavenLocal()
10158
}
10259

10360
apply plugin: 'com.diffplug.spotless'
@@ -198,101 +155,24 @@ sourceSets {
198155
configurations {
199156
testSupportImplementation
200157
testSupportRuntimeOnly
201-
202-
all {
203-
// transitive versions conflict new Besu coordinates
204-
exclude group: 'org.hyperledger.besu.internal', module: 'dsl'
205-
exclude group: 'org.hyperledger.besu.internal', module: 'besu'
206-
exclude group: 'org.hyperledger.besu.internal', module: 'config'
207-
exclude group: 'org.hyperledger.besu.internal', module: 'clique'
208-
exclude group: 'org.hyperledger.besu.internal', module: 'common'
209-
exclude group: 'org.hyperledger.besu.internal', module: 'ibft'
210-
exclude group: 'org.hyperledger.besu.internal', module: 'ibftlegacy'
211-
exclude group: 'org.hyperledger.besu.internal', module: 'merge'
212-
exclude group: 'org.hyperledger.besu.internal', module: 'qbft'
213-
exclude group: 'org.hyperledger.besu.internal', module: 'qbft-core'
214-
exclude group: 'org.hyperledger.besu.internal', module: 'algorithms'
215-
exclude group: 'org.hyperledger.besu.internal', module: 'services'
216-
exclude group: 'org.hyperledger.besu.internal', module: 'api'
217-
exclude group: 'org.hyperledger.besu.internal', module: 'blockcreation'
218-
exclude group: 'org.hyperledger.besu.internal', module: 'core'
219-
exclude group: 'org.hyperledger.besu.internal', module: 'eth'
220-
exclude group: 'org.hyperledger.besu.internal', module: 'p2p'
221-
exclude group: 'org.hyperledger.besu.internal', module: 'permissioning'
222-
exclude group: 'org.hyperledger.besu.internal', module: 'referencetests'
223-
exclude group: 'org.hyperledger.besu.internal', module: 'rlp'
224-
exclude group: 'org.hyperledger.besu.internal', module: 'trie'
225-
exclude group: 'org.hyperledger.besu', module: 'evm'
226-
exclude group: 'org.hyperledger.besu.internal', module: 'metrics-core'
227-
exclude group: 'org.hyperledger.besu', module: 'plugin-api'
228-
exclude group: 'org.hyperledger.besu.internal', module: 'testutil'
229-
exclude group: 'org.hyperledger.besu.internal', module: 'util'
230-
exclude group: 'org.hyperledger.besu.internal', module: 'nat'
231-
exclude group: 'org.hyperledger.besu.internal', module: 'tasks'
232-
exclude group: 'org.hyperledger.besu.internal', module: 'pipeline'
233-
exclude group: 'org.hyperledger.besu.internal', module: 'kvstore'
234-
exclude group: 'org.hyperledger.besu.internal', module: 'enclave'
235-
}
236158
}
237159

238160
dependencies {
239-
testImplementation sourceSets.testSupport.output
240-
241-
// annotationProcessor generates the file META-INF/services/org.hyperledger.besu.plugin.BesuPlugin
242-
annotationProcessor 'com.google.auto.service:auto-service'
243161
errorprone("com.google.errorprone:error_prone_core")
244162
errorprone("tech.pegasys.tools.epchecks:errorprone-checks")
245163

246-
// Dependencies provided by BESU at runtime
247-
compileOnly 'com.google.auto.service:auto-service-annotations'
248-
compileOnly 'com.google.guava:guava'
249-
compileOnly 'org.slf4j:slf4j-api'
250-
compileOnly 'info.picocli:picocli'
251-
implementation('io.vertx:vertx-web-client') { transitive = false }
252-
implementation('io.vertx:vertx-uri-template') { transitive = false }
253-
compileOnly 'io.vertx:vertx-web'
254-
compileOnly 'org.apache.logging.log4j:log4j-slf4j2-impl'
255-
compileOnly 'org.apache.logging.log4j:log4j-core'
256-
compileOnly 'com.fasterxml.jackson.core:jackson-databind'
257-
compileOnly 'com.fasterxml.jackson.core:jackson-annotations'
258-
compileOnly 'org.hyperledger.besu.internal:besu-ethereum-rlp'
259-
compileOnly 'org.hyperledger.besu:besu-plugin-api'
260-
compileOnly 'org.hyperledger.besu:besu-datatypes'
261-
compileOnly 'org.hyperledger.besu.internal:besu-ethereum-core'
262-
compileOnly 'org.hyperledger.besu:besu-evm'
263-
264-
// This will be provided by besu package
265-
compileOnly 'net.consensys.linea.zktracer:arithmetization'
266-
267-
testImplementation 'io.vertx:vertx-web'
268-
testImplementation 'com.fasterxml.jackson.core:jackson-databind'
269-
testImplementation 'com.fasterxml.jackson.core:jackson-annotations'
270-
testImplementation 'net.consensys.linea.zktracer:arithmetization'
271-
testImplementation 'org.slf4j:slf4j-api'
272-
testImplementation 'org.apache.logging.log4j:log4j-slf4j2-impl'
273-
testImplementation 'org.apache.logging.log4j:log4j-core'
274-
testImplementation 'org.hyperledger.besu.internal:besu-ethereum-rlp'
275-
testImplementation 'org.hyperledger.besu:besu-plugin-api'
276-
testImplementation 'org.hyperledger.besu:besu-datatypes'
277-
testImplementation "org.hyperledger.besu.internal:besu-testutil"
278-
testImplementation "org.hyperledger.besu.internal:besu-crypto-algorithms"
279-
testImplementation 'org.hyperledger.besu.internal:besu-ethereum-core'
280-
testImplementation 'org.hyperledger.besu:besu-evm'
164+
implementation 'io.vertx:vertx-web-client'
165+
implementation 'net.consensys.linea.zktracer:arithmetization'
166+
167+
testImplementation sourceSets.testSupport.output
168+
testImplementation 'io.vertx:vertx-junit5'
281169
testImplementation 'org.assertj:assertj-core'
282170
testImplementation 'org.junit.jupiter:junit-jupiter'
283-
testImplementation 'org.assertj:assertj-core'
284171
testImplementation 'org.junit.jupiter:junit-jupiter-params'
285172
testImplementation 'org.mockito:mockito-core'
286173
testImplementation 'org.mockito:mockito-junit-jupiter'
287-
testImplementation 'io.vertx:vertx-junit5'
288-
testImplementation 'com.google.guava:guava'
289-
290-
// pull in testSupport
291-
testImplementation "org.hyperledger.besu.internal:besu-ethereum-core:${besuVersion}:test-support@jar"
292174
}
293175

294-
apply plugin: 'java'
295-
296176
jar {
297177
archiveBaseName = 'besu-shomei-plugin'
298178

@@ -304,10 +184,12 @@ jar {
304184
'Implementation-Version': calculateVersion()
305185
)
306186
}
187+
}
307188

308-
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
309-
exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
310-
duplicatesStrategy(DuplicatesStrategy.INCLUDE)
189+
distributions {
190+
main {
191+
distributionBaseName = 'besu-shomei-plugin'
192+
}
311193
}
312194

313195
test {

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
releaseVersion=0.8.2-SNAPSHOT
22
besuVersion=25.11.0-RC1-linea2
33
arithmetizationVersion=beta-v4.0-rc23
4+
besuRepo=https://artifacts.consensys.net/public/linea-besu/maven/

settings.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
1+
pluginManagement {
2+
repositories {
3+
gradlePluginPortal()
4+
maven {
5+
url = uri('https://raw.githubusercontent.com/Consensys/besu-plugin-gradle-plugin-artifacts/main')
6+
}
7+
}
8+
}
9+
110
rootProject.name = 'besu-shomei-plugin'
211

0 commit comments

Comments
 (0)