Skip to content

Commit

Permalink
Merge pull request #2057 from hyperledger/upgradeGradle8.7
Browse files Browse the repository at this point in the history
Upgrade gradle to 8.7 and remove Consensys Repo dependency
  • Loading branch information
gtebrean authored May 20, 2024
2 parents 5173684 + 4cef2b2 commit 760e50b
Show file tree
Hide file tree
Showing 39 changed files with 576 additions and 320 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.11.4]() (Upcoming)
# [4.12.0]() (Upcoming)

### Bug Fixes

Expand All @@ -15,7 +15,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

### BREAKING CHANGES

*
* Upgrade gradle to 8.7 and remove Consensys Repo dependency [#2057](https://github.com/hyperledger/web3j/pull/2057)

# [4.11.3](https://github.com/hyperledger/web3j/releases/tag/v4.11.3) (2024-05-01)

Expand Down
9 changes: 7 additions & 2 deletions abi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ dependencies {
api project(':utils')
}

tasks.named("spotlessJava").configure { dependsOn("spotlessGroovyGradle","compileJava","compileTestJava","javadoc","test") }
tasks.named("spotlessKotlin").configure { dependsOn("compileJava","spotlessJava", "spotlessGroovyGradle","compileTestJava","processTestResources","javadoc","test") }
tasks.named("spotlessJava").configure {
dependsOn("spotlessGroovyGradle", "compileJava", "compileTestJava", "javadoc", "test", "jacocoTestReport")
}

tasks.named("spotlessKotlin").configure {
dependsOn("compileJava", "spotlessJava", "spotlessGroovyGradle", "compileTestJava", "processTestResources", "javadoc", "test", "jacocoTestReport")
}
11 changes: 8 additions & 3 deletions abi/src/main/java/org/web3j/abi/FunctionEncoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,11 @@ public static Function makeFunction(
List<String> solidityInputTypes,
List<Object> arguments,
List<String> solidityOutputTypes)
throws ClassNotFoundException, NoSuchMethodException, InstantiationException,
IllegalAccessException, InvocationTargetException {
throws ClassNotFoundException,
NoSuchMethodException,
InstantiationException,
IllegalAccessException,
InvocationTargetException {
List<Type> encodedInput = new ArrayList<>();
Iterator argit = arguments.iterator();
for (String st : solidityInputTypes) {
Expand All @@ -88,7 +91,9 @@ public static Function makeFunction(

protected abstract String encodeParameters(List<Type> parameters);

/** @param methodId Callback selector / Abi method Id (Hex format) */
/**
* @param methodId Callback selector / Abi method Id (Hex format)
*/
protected abstract String encodeWithSelector(
final String methodId, final List<Type> parameters);

Expand Down
28 changes: 20 additions & 8 deletions abi/src/main/java/org/web3j/abi/TypeDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,20 @@ public class TypeDecoder {
static final int MAX_BYTE_LENGTH_FOR_HEX_STRING = Type.MAX_BYTE_LENGTH << 1;

public static Type instantiateType(String solidityType, Object value)
throws InvocationTargetException, NoSuchMethodException, InstantiationException,
IllegalAccessException, ClassNotFoundException {
throws InvocationTargetException,
NoSuchMethodException,
InstantiationException,
IllegalAccessException,
ClassNotFoundException {
return instantiateType(makeTypeReference(solidityType), value);
}

public static Type instantiateType(TypeReference ref, Object value)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException,
InstantiationException, ClassNotFoundException {
throws NoSuchMethodException,
IllegalAccessException,
InvocationTargetException,
InstantiationException,
ClassNotFoundException {
Class rc = ref.getClassType();
if (Array.class.isAssignableFrom(rc)) {
return instantiateArrayType(ref, value);
Expand Down Expand Up @@ -183,8 +189,11 @@ static <T extends NumericType> int getTypeLength(Class<T> type) {
}

static Type instantiateArrayType(TypeReference ref, Object value)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException,
InstantiationException, ClassNotFoundException {
throws NoSuchMethodException,
IllegalAccessException,
InvocationTargetException,
InstantiationException,
ClassNotFoundException {
List values;
if (value instanceof List) {
values = (List) value;
Expand Down Expand Up @@ -218,8 +227,11 @@ static Type instantiateArrayType(TypeReference ref, Object value)
}

static Type instantiateAtomicType(Class<?> referenceClass, Object value)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException,
InstantiationException, ClassNotFoundException {
throws NoSuchMethodException,
IllegalAccessException,
InvocationTargetException,
InstantiationException,
ClassNotFoundException {
Object constructorArg = null;
if (NumericType.class.isAssignableFrom(referenceClass)) {
constructorArg = asBigInteger(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -800,8 +800,11 @@ public void testABIv2DynamicArrayEncode() {

@Test
public void testMakeFunction()
throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException,
InstantiationException, IllegalAccessException {
throws ClassNotFoundException,
NoSuchMethodException,
InvocationTargetException,
InstantiationException,
IllegalAccessException {

Function expectedFunction =
new Function(
Expand Down
9 changes: 7 additions & 2 deletions besu/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ dependencies {
testImplementation project(path: ':core', configuration: 'testArtifacts')
}

tasks.named("spotlessJava").configure { dependsOn("spotlessGroovyGradle","compileJava","compileTestJava","javadoc","test") }
tasks.named("spotlessKotlin").configure { dependsOn("compileJava","spotlessJava", "spotlessGroovyGradle","compileTestJava","processTestResources","javadoc","test") }
tasks.named("spotlessJava").configure {
dependsOn("spotlessGroovyGradle", "compileJava", "compileTestJava", "javadoc", "test", "jacocoTestReport")
}

tasks.named("spotlessKotlin").configure {
dependsOn("compileJava", "spotlessJava", "spotlessGroovyGradle", "compileTestJava", "processTestResources", "javadoc", "test", "jacocoTestReport")
}
42 changes: 19 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
plugins {
id 'java'
id 'idea'
id 'org.sonarqube' version '3.4.0.2513'
id 'org.sonarqube' version '5.0.0.4638'
id 'jacoco'
id 'com.diffplug.gradle.spotless' version '4.5.1'
id 'io.codearte.nexus-staging' version '0.22.0'
id 'com.diffplug.spotless' version '6.25.0'
id 'io.codearte.nexus-staging' version '0.30.0'
id 'de.marcphilipp.nexus-publish' version '0.4.0'
id 'de.undercouch.download' version '4.1.1'
id 'de.undercouch.download' version '4.1.2'
id 'org.ajoberstar.git-publish' version '3.0.1'
}



ext {
bouncycastleVersion = '1.73'
jacksonVersion = '2.14.2'
javaPoetVersion = '1.7.0'
kotlinVersion = '1.3.72'
kotlinPoetVersion = '1.5.0'
jnr_unixsocketVersion = '0.38.17'
okhttpVersion = '4.9.0'
rxjavaVersion = '2.2.2'
slf4jVersion = '2.0.11'
javaWebSocketVersion = '1.5.3'
picocliVersion = '3.0.0'
ensAdraffyVersion = '0.1.2'
kzg4844Version = '0.8.0'
bouncycastleVersion = '1.78.1'
jacksonVersion = '2.17.1'
javaPoetVersion = '1.13.0'
kotlinVersion = '1.9.24'
kotlinPoetVersion = '1.16.0'
jnr_unixsocketVersion = '0.38.22'
okhttpVersion = '4.12.0'
rxjavaVersion = '2.2.21'
slf4jVersion = '2.0.13'
javaWebSocketVersion = '1.5.6'
picocliVersion = '4.7.6'
ensAdraffyVersion = '0.2.0'
kzg4844Version = '1.0.0'
tuweniVersion = '2.4.2'
// test dependencies
equalsverifierVersion = '3.14.1'
equalsverifierVersion = '3.16.1'
junitVersion = '5.5.2'
web3jUnitVersion = '4.11.3'
junitBenchmarkVersion = '0.7.2'
logbackVersion = '1.4.14'
logbackVersion = '1.5.6'
mockitoJunitVersion = '3.1.0'
junitPlatformLauncherVersion = '1.5.2'
}
Expand Down Expand Up @@ -74,10 +74,6 @@ allprojects {
useJUnitPlatform()
}

repositories {
maven { url "https://artifacts.consensys.net/public/maven/maven/" }
}

dependencies {
testImplementation "org.junit.jupiter:junit-jupiter:$junitVersion"
testImplementation "org.mockito:mockito-junit-jupiter:$mockitoJunitVersion"
Expand Down
9 changes: 7 additions & 2 deletions codegen/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,10 @@ file("src/test/resources/solidity").listFiles().each { File file ->
}
}

tasks.named("spotlessJava").configure { dependsOn("spotlessGroovyGradle","compileJava","compileTestJava","processTestResources","javadoc","test") }
tasks.named("spotlessKotlin").configure { dependsOn("compileJava","spotlessJava", "spotlessGroovyGradle","compileTestJava","processTestResources","javadoc","test") }
tasks.named("spotlessJava").configure {
dependsOn("spotlessGroovyGradle", "compileJava", "compileTestJava", "javadoc", "test", "jacocoTestReport")
}

tasks.named("spotlessKotlin").configure {
dependsOn("compileJava", "spotlessJava", "spotlessGroovyGradle", "compileTestJava", "processTestResources", "javadoc", "test", "jacocoTestReport")
}
Loading

0 comments on commit 760e50b

Please sign in to comment.