Skip to content

Commit

Permalink
Merge pull request #75 from emeraldpay/feature/java-17
Browse files Browse the repository at this point in the history
  • Loading branch information
splix authored Mar 17, 2024
2 parents 49f530f + e2273e4 commit 84737ed
Show file tree
Hide file tree
Showing 15 changed files with 240 additions and 186 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17

- name: Get Version
run: ./gradlew properties -q | grep "^version:" | awk '{printf "PROJECT_VERSION=" $2}' >> $GITHUB_ENV
Expand All @@ -49,7 +49,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17

- name: Check
uses: eskatos/gradle-command-action@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17
- name: Check
uses: eskatos/gradle-command-action@v1
with:
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17
- name: Check
uses: eskatos/gradle-command-action@v1
with:
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17

- name: Check
uses: eskatos/gradle-command-action@v1
Expand All @@ -45,11 +45,10 @@ jobs:
# Make sure it works with all standard JVMs on main OSes
platform-test:
name: Java ${{ matrix.java }} on ${{ matrix.os }}
continue-on-error: ${{ matrix.java != '11' }}
continue-on-error: ${{ matrix.java != '17' }}
strategy:
matrix:
# to support Java 14 need to upgrade Groovy, https://github.com/gradle/gradle/issues/10248
java: ["11", "12", "13"]
java: ["17", "21"]
os: ["windows-latest", "macos-latest", "ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![codecov](https://codecov.io/gh/emeraldpay/etherjar/branch/master/graph/badge.svg)](https://codecov.io/gh/emeraldpay/etherjar)
[![license](https://img.shields.io/github/license/emeraldpay/etherjar.svg?maxAge=2592000)](https://github.com/emeraldpay/etherjar/blob/master/LICENSE)

Framework agnostic modular Java 11+ integration library for [Ethereum blockchains](https://www.ethereum.org)
Framework agnostic modular Java 17+ integration library for [Ethereum blockchains](https://www.ethereum.org)

- Latest Stable Version: 0.11.0
- Latest Snapshot Version: 0.12.0-SNAPSHOT
Expand Down
36 changes: 18 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,43 +32,43 @@ subprojects {
apply plugin: 'java-library'
apply plugin: 'groovy'
apply plugin: 'jacoco'
apply plugin: 'maven'
apply plugin: 'maven-publish'

if (System.getenv("ENABLE_GCP") == "true") {
apply plugin: "com.google.cloud.artifactregistry.gradle-plugin"
}

targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_17

[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

compileJava.options.compilerArgs \
<< '-Xlint:unchecked' << '-Xlint:deprecation'

dependencies {
testCompile 'org.objenesis:objenesis:2.+'
testCompile 'org.spockframework:spock-core:1.3-groovy-2.5'
testCompile 'nl.jqno.equalsverifier:equalsverifier:3.1.9'
testCompile 'org.codehaus.groovy:groovy-all:2.5.12'
testImplementation 'org.objenesis:objenesis:3.3'
testImplementation 'org.spockframework:spock-core:2.4-M2-groovy-4.0'
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.15.8'
testImplementation 'org.apache.groovy:groovy:4.0.20'
}

test {
jvmArgs '-ea'

testLogging.showStandardStreams = true
testLogging.exceptionFormat = 'full'
useJUnitPlatform()
}

jacocoTestReport {
reports {
xml.enabled true
xml.required = true
}
}

jacoco {
toolVersion = "0.8.5"
toolVersion = "0.8.11"
}

test.finalizedBy jacocoTestReport
Expand Down Expand Up @@ -108,12 +108,12 @@ subprojects {
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
archiveClassifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}

Expand All @@ -132,10 +132,10 @@ subprojects {
publications {
EtherJarPublication(MavenPublication) {
from components.java
artifact sourcesJar {
artifact("sourcesJar") {
classifier "sources"
}
artifact javadocJar {
artifact("javadocJar") {
classifier "javadoc"
}

Expand Down Expand Up @@ -177,18 +177,18 @@ task syncJars(type: Sync) {
}

jacoco {
toolVersion = "0.8.5"
toolVersion = "0.8.11"
}

task coverageReport(type: JacocoReport) {
dependsOn = subprojects.test
dependsOn = [subprojects.test, subprojects.jacocoTestReport]
additionalSourceDirs.setFrom files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories.setFrom files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories.setFrom files(subprojects.sourceSets.main.output)
executionData.setFrom project.fileTree(dir: '.', include: '**/build/jacoco/test.exec')
reports {
xml.enabled true
csv.enabled false
html.enabled true
xml.required = true
csv.required = false
html.required = true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ class TypeSpec extends Specification {

def "should encode & decode a dynamic type length"() {
when:
def data = DynamicType.encodeLength val
def res = DynamicType.decodeLength data
def data = Type.encodeLength val
def res = Type.decodeLength data

then:
data.toHex() == hex
Expand All @@ -134,7 +134,7 @@ class TypeSpec extends Specification {

def "should catch negative length before encoding"() {
when:
DynamicType.encodeLength val
Type.encodeLength val

then:
thrown IllegalArgumentException
Expand Down
4 changes: 2 additions & 2 deletions etherjar-rlp/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dependencies {
testCompile 'commons-codec:commons-codec:1.12'
testCompile project(':etherjar-domain')
testImplementation 'commons-codec:commons-codec:1.12'
testImplementation project(':etherjar-domain')
}
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,8 @@ class EmeraldTransportSpec extends Specification {

then:
act.size() == 1
with(act[0]) {
error == null
value == 0xab5461ca4b100
}
act[0].getError() == null
act[0].getValue() == 0xab5461ca4b100

cleanup:
transport.close()
Expand Down
4 changes: 2 additions & 2 deletions etherjar-rpc-http/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ dependencies {
implementation "io.projectreactor:reactor-core:3.5.3"
implementation "io.projectreactor.netty:reactor-netty:1.0.7"

testCompile "com.sparkjava:spark-core:2.9.1"
testCompile "io.projectreactor:reactor-test:3.5.3"
testImplementation "com.sparkjava:spark-core:2.9.1"
testImplementation "io.projectreactor:reactor-test:3.5.3"
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class ReactorHttpRpcClientSpec extends Specification {
StepVerifier.create(resp)
.expectNextMatches({
println("Received value: $it.value")
return it.value == 1 && it.error == null
return it.value == 1 && it.getError() == null
}).as("receive value")
.expectComplete()
.verify(Duration.ofSeconds(5))
Expand Down Expand Up @@ -108,11 +108,11 @@ class ReactorHttpRpcClientSpec extends Specification {
StepVerifier.create(resp)
.expectNextMatches({
println("Received value: $it.value ")
return it.value == 68 && it.error == null
return it.value == 68 && it.getError() == null
}).as("receive value for peers")
.expectNextMatches({
println("Received value: $it.value ${it.value.class}")
return it.value == Address.from("0x0000000000000000000000000000000000000000") && it.error == null
return it.value == Address.from("0x0000000000000000000000000000000000000000") && it.getError() == null
}).as("receive value for coinbase")
.expectComplete()
.verify(Duration.ofSeconds(5))
Expand Down Expand Up @@ -171,13 +171,13 @@ class ReactorHttpRpcClientSpec extends Specification {
println("Received value 1: $it.value ${it.value.class}")
return expecting.indexOf(it.value) >= 0 &&
expecting.remove(expecting.indexOf(it.value)) &&
it.error == null
it.getError() == null
}).as("receive value 1")
.expectNextMatches({
println("Received value 2: $it.value ${it.value.class}")
return expecting.indexOf(it.value) >= 0 &&
expecting.remove(expecting.indexOf(it.value)) &&
it.error == null
it.getError() == null
}).as("receive value 2")
.expectComplete()
.verify(Duration.ofSeconds(5))
Expand Down
2 changes: 1 addition & 1 deletion etherjar-tx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ dependencies {
api project(':etherjar-rlp')
implementation 'org.bouncycastle:bcprov-jdk15on:1.61'

testCompile 'commons-codec:commons-codec:1.12'
testImplementation 'commons-codec:commons-codec:1.12'
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 84737ed

Please sign in to comment.