diff --git a/build.gradle b/build.gradle index b5626ed..3f8e328 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ import java.text.SimpleDateFormat plugins { - id 'org.jetbrains.kotlin.jvm' version '1.3.72' + id 'org.jetbrains.kotlin.jvm' version '1.6.21' id "application" id "distribution" id "idea" @@ -19,7 +19,7 @@ mainClassName = 'org.web3j.console.Web3j' applicationName = 'web3j' ext { - web3jVersion = '4.9.4' + web3jVersion = '4.10.1' picocli = '4.6.0' slf4jVersion = '1.7.30' junitVersion = '5.8.2' @@ -61,6 +61,7 @@ apply { repositories { jcenter() mavenCentral() + mavenLocal() maven { url "https://dl.bintray.com/ethereum/maven/" } maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } maven { url 'https://repo.gradle.org/gradle/libs-releases' } @@ -153,13 +154,13 @@ sourceSets { } compileKotlin { - kotlinOptions.jvmTarget = "1.8" + kotlinOptions.jvmTarget = "17" } compileTestKotlin { - kotlinOptions.jvmTarget = "1.8" + kotlinOptions.jvmTarget = "17" } -sourceCompatibility = 1.8 +sourceCompatibility = 17 def generatedResources = "$buildDir/generated-resources/main" @@ -179,3 +180,6 @@ task generateVersionProperties { generated.append("timestamp=${System.currentTimeMillis()}\n") } } + +tasks.named("spotlessJava").configure { dependsOn("javadoc","sourcesJar","compileTestJava","compileTestKotlin") } +tasks.named("spotlessKotlin").configure { dependsOn("compileKotlin","sourcesJar","compileTestKotlin") } diff --git a/gradle.properties b/gradle.properties index 2bc39a2..8772619 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -version=1.4.2 +version=1.5.0 group=org.web3j.console diff --git a/gradle/jacoco/build.gradle b/gradle/jacoco/build.gradle index 8e568d0..fb9fb7d 100644 --- a/gradle/jacoco/build.gradle +++ b/gradle/jacoco/build.gradle @@ -26,6 +26,6 @@ task jacocoRootTestReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) { } jacoco { - toolVersion = "0.8.4" + toolVersion = "0.8.10" } diff --git a/gradle/java/build.gradle b/gradle/java/build.gradle index df9a754..bdb987d 100644 --- a/gradle/java/build.gradle +++ b/gradle/java/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'java' -sourceCompatibility = 1.8 -targetCompatibility = 1.8 +sourceCompatibility = 17 +targetCompatibility = 17 compileJava { options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" diff --git a/gradle/repositories/build.gradle b/gradle/repositories/build.gradle index 350db19..e7581f6 100644 --- a/gradle/repositories/build.gradle +++ b/gradle/repositories/build.gradle @@ -1,4 +1,5 @@ repositories { + mavenLocal() mavenCentral() jcenter() maven { url 'https://oss.sonatype.org/content/repositories/releases/' } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5292e6c..06c0967 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip diff --git a/src/main/java/org/web3j/console/project/ProjectRunner.java b/src/main/java/org/web3j/console/project/ProjectRunner.java index 5561d82..6e87eac 100644 --- a/src/main/java/org/web3j/console/project/ProjectRunner.java +++ b/src/main/java/org/web3j/console/project/ProjectRunner.java @@ -89,7 +89,7 @@ public void run() { protected abstract void createProject(); public void buildProject(ProjectStructure projectStructure, ProgressCounter progressCounter) - throws IOException, InterruptedException { + throws IOException, InterruptedException, ClassNotFoundException { ProjectCreationUtils.generateWrappers(projectStructure.getProjectRoot()); if (withTests) { new JavaTestCLIRunner( diff --git a/src/main/java/org/web3j/console/project/java/Erc20JavaProjectCreator.java b/src/main/java/org/web3j/console/project/java/Erc20JavaProjectCreator.java index 5c64561..c5d0f0a 100644 --- a/src/main/java/org/web3j/console/project/java/Erc20JavaProjectCreator.java +++ b/src/main/java/org/web3j/console/project/java/Erc20JavaProjectCreator.java @@ -12,7 +12,6 @@ */ package org.web3j.console.project.java; -import org.web3j.commons.JavaVersion; import org.web3j.console.openapi.project.erc777.CopyUtils; import org.web3j.console.openapi.utils.PrettyPrinter; import org.web3j.console.openapi.utils.SimpleFileLogger; @@ -51,10 +50,7 @@ protected void createProject() { .withGradleSettings("project/settings.gradle.template") .withWrapperGradleSettings("project/gradlew-wrapper.properties.template") .withGradlewWrapperJar("gradle-wrapper.jar") - .withGradleBuild( - JavaVersion.getJavaVersionAsDouble() < 11 - ? "project/erc20/build.gradleErc20.template" - : "project/erc20/build.gradleErc20Java11.template") + .withGradleBuild("project/erc20/build.gradleErc20.template") .withMainJavaClass("project/erc20/JavaErc20.template") .build() .generateFiles(projectStructure); diff --git a/src/main/java/org/web3j/console/project/java/Erc777JavaProjectCreator.java b/src/main/java/org/web3j/console/project/java/Erc777JavaProjectCreator.java index 417c484..a337f24 100644 --- a/src/main/java/org/web3j/console/project/java/Erc777JavaProjectCreator.java +++ b/src/main/java/org/web3j/console/project/java/Erc777JavaProjectCreator.java @@ -12,7 +12,6 @@ */ package org.web3j.console.project.java; -import org.web3j.commons.JavaVersion; import org.web3j.console.openapi.project.erc777.CopyUtils; import org.web3j.console.openapi.utils.PrettyPrinter; import org.web3j.console.openapi.utils.SimpleFileLogger; @@ -52,10 +51,7 @@ protected void createProject() { .withGradleSettings("project/settings.gradle.template") .withWrapperGradleSettings("project/gradlew-wrapper.properties.template") .withGradlewWrapperJar("gradle-wrapper.jar") - .withGradleBuild( - JavaVersion.getJavaVersionAsDouble() < 11 - ? "project/erc777/build.gradleErc777.template" - : "project/erc777/build.gradleErc777Java11.template") + .withGradleBuild("project/erc777/build.gradleErc777.template") .withMainJavaClass("project/erc777/JavaErc777.template") .withReadme("project/erc777/README.erc777.md") .build() diff --git a/src/main/java/org/web3j/console/project/java/JavaProject.java b/src/main/java/org/web3j/console/project/java/JavaProject.java index b078ba1..763cb15 100644 --- a/src/main/java/org/web3j/console/project/java/JavaProject.java +++ b/src/main/java/org/web3j/console/project/java/JavaProject.java @@ -14,7 +14,6 @@ import java.io.IOException; -import org.web3j.commons.JavaVersion; import org.web3j.console.project.AbstractProject; import org.web3j.console.project.Project; import org.web3j.console.project.ProjectStructure; @@ -58,18 +57,12 @@ public JavaTemplateProvider getTemplateProvider() { if (command.equals("new")) { templateBuilder - .withGradleBuild( - JavaVersion.getJavaVersionAsDouble() < 11 - ? "project/build.gradle.template" - : "project/build.gradleJava11.template") + .withGradleBuild("project/build.gradle.template") .withSolidityProject("contracts/HelloWorld.sol"); } else if (command.equals("import")) { templateBuilder - .withGradleBuild( - JavaVersion.getJavaVersionAsDouble() < 11 - ? "project/build.gradleImport.template" - : "project/build.gradleImportJava11.template") + .withGradleBuild("project/build.gradleImport.template") .withPathToSolidityFolder(solidityImportPath); } diff --git a/src/main/java/org/web3j/console/project/kotlin/KotlinProject.java b/src/main/java/org/web3j/console/project/kotlin/KotlinProject.java index 46efaa3..fcf80d6 100644 --- a/src/main/java/org/web3j/console/project/kotlin/KotlinProject.java +++ b/src/main/java/org/web3j/console/project/kotlin/KotlinProject.java @@ -14,7 +14,6 @@ import java.io.IOException; -import org.web3j.commons.JavaVersion; import org.web3j.console.project.AbstractProject; import org.web3j.console.project.Project; import org.web3j.console.project.ProjectStructure; @@ -59,18 +58,12 @@ public KotlinTemplateProvider getTemplateProvider() { if (command.equals("new")) { templateBuilder - .withGradleBuild( - JavaVersion.getJavaVersionAsDouble() < 11 - ? "project/build.gradle.template" - : "project/build.gradleJava11.template") + .withGradleBuild("project/build.gradle.template") .withSolidityProject("contracts/HelloWorld.sol"); } else if (command.equals("import")) { templateBuilder - .withGradleBuild( - JavaVersion.getJavaVersionAsDouble() < 11 - ? "project/build.gradleImport.template" - : "project/build.gradleImportJava11.template") + .withGradleBuild("project/build.gradleImport.template") .withPathToSolidityFolder(solidityImportPath); } diff --git a/src/main/kotlin/org/web3j/console/openapi/subcommands/JarOpenApiCommand.kt b/src/main/kotlin/org/web3j/console/openapi/subcommands/JarOpenApiCommand.kt index d86e234..5fe0dc1 100644 --- a/src/main/kotlin/org/web3j/console/openapi/subcommands/JarOpenApiCommand.kt +++ b/src/main/kotlin/org/web3j/console/openapi/subcommands/JarOpenApiCommand.kt @@ -54,7 +54,7 @@ class JarOpenApiCommand : AbstractOpenApiCommand() { * Path to the `.web3j` folder */ private val web3jHomeFolder: Path = - Paths.get(System.getenv(if (System.getProperty("os.name").toLowerCase().startsWith("win")) "USERPROFILE" else "HOME"), ".web3j") + Paths.get(System.getenv(if (System.getProperty("os.name").lowercase().startsWith("win")) "USERPROFILE" else "HOME"), ".web3j") override fun generate(projectFolder: File) { if (solidityImportPath == null) { diff --git a/src/main/resources/project/Dockerfile.template b/src/main/resources/project/Dockerfile.template index cd028ac..2dba472 100644 --- a/src/main/resources/project/Dockerfile.template +++ b/src/main/resources/project/Dockerfile.template @@ -2,7 +2,7 @@ FROM ubuntu as Build COPY . /root/app RUN apt-get update && apt-get install -y \ - curl bash openjdk-11-jre \ + curl bash openjdk-17-jre \ && rm -rf /var/cache/apk/* \ && curl -L get.web3j.io | sh \ && /root/.web3j/web3j \ @@ -11,7 +11,7 @@ RUN apt-get update && apt-get install -y \ FROM alpine COPY --from=Build /root /root/ -RUN apk add --no-cache bash openjdk11-jre\ +RUN apk add --no-cache bash openjdk17-jre\ && rm -rf /var/cache/apk/* \ && mkdir /opt/app WORKDIR /root/app diff --git a/src/main/resources/project/build.gradle.template b/src/main/resources/project/build.gradle.template index fa3eec7..7862f92 100644 --- a/src/main/resources/project/build.gradle.template +++ b/src/main/resources/project/build.gradle.template @@ -1,23 +1,23 @@ plugins { id 'java' - id 'org.jetbrains.kotlin.jvm' version '1.3.61' + id 'org.jetbrains.kotlin.jvm' version '1.6.21' id 'application' id "com.github.johnrengelman.shadow" version "5.2.0" - id 'org.web3j' version '4.9.4' + id 'org.web3j' version '4.10.1' } group '' version '0.1.0' -sourceCompatibility = 1.8 +sourceCompatibility = 17 repositories { + mavenLocal() mavenCentral() maven { url "https://hyperledger.jfrog.io/hyperledger/besu-maven" } maven { url "https://artifacts.consensys.net/public/maven/maven/" } maven { url "https://splunk.jfrog.io/splunk/ext-releases-local" } - maven { url "https://dl.cloudsmith.io/public/consensys/quorum-mainnet-launcher/maven/"} } web3j { @@ -30,9 +30,13 @@ node { } ext { - web3jVersion = '4.9.4' + web3jVersion = '4.10.1' logbackVersion = '1.2.3' klaxonVersion = '5.5' + besuPluginVersion = '23.4.0' + besuInternalVersion = '23.4.0' + besuInternalCryptoVersion = '23.1.3' + besuCryptoDepVersion = '0.7.1' } dependencies { @@ -45,6 +49,21 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1' + + implementation "org.hyperledger.besu:plugin-api:$besuPluginVersion" + implementation "org.hyperledger.besu.internal:besu:$besuInternalVersion" + implementation "org.hyperledger.besu.internal:api:$besuInternalVersion" + implementation "org.hyperledger.besu:evm:$besuPluginVersion" + implementation "org.hyperledger.besu.internal:config:$besuInternalVersion" + implementation "org.hyperledger.besu.internal:core:$besuInternalVersion" + implementation "org.hyperledger.besu.internal:crypto:$besuInternalCryptoVersion" + implementation "org.hyperledger.besu.internal:rlp:$besuInternalVersion" + implementation "org.hyperledger.besu.internal:kvstore:$besuInternalVersion" + implementation "org.hyperledger.besu.internal:metrics-core:$besuInternalVersion" + implementation "org.hyperledger.besu.internal:trie:$besuInternalVersion" + implementation "org.hyperledger.besu.internal:util:$besuInternalVersion" + implementation "org.hyperledger.besu:bls12-381:$besuCryptoDepVersion" + implementation "org.hyperledger.besu:secp256k1:$besuCryptoDepVersion" } jar { @@ -65,13 +84,13 @@ test { } compileKotlin { - kotlinOptions.jvmTarget = "1.8" + kotlinOptions.jvmTarget = "17" } compileTestKotlin { - kotlinOptions.jvmTarget = "1.8" + kotlinOptions.jvmTarget = "17" } - - - +shadowJar { + zip64 = true +} diff --git a/src/main/resources/project/build.gradleGenerateOpenApi.template b/src/main/resources/project/build.gradleGenerateOpenApi.template index ce2d3ab..ddf55b8 100644 --- a/src/main/resources/project/build.gradleGenerateOpenApi.template +++ b/src/main/resources/project/build.gradleGenerateOpenApi.template @@ -1,11 +1,12 @@ plugins { - id "org.web3j.openapi" version "4.9.4" + id "org.web3j.openapi" version "4.10.1" } group '' version '1.0-SNAPSHOT' repositories { + mavenLocal() mavenCentral() } diff --git a/src/main/resources/project/build.gradleImport.template b/src/main/resources/project/build.gradleImport.template index 16e5220..861c760 100644 --- a/src/main/resources/project/build.gradleImport.template +++ b/src/main/resources/project/build.gradleImport.template @@ -1,19 +1,23 @@ plugins { id 'java' - id 'org.jetbrains.kotlin.jvm' version '1.3.61' + id 'org.jetbrains.kotlin.jvm' version '1.6.21' id 'application' id "com.github.johnrengelman.shadow" version "5.2.0" - id 'org.web3j' version '4.9.4' + id 'org.web3j' version '4.10.1' } group '' version '0.1.0' -sourceCompatibility = 1.8 +sourceCompatibility = 17 repositories { + mavenLocal() mavenCentral() + maven { url "https://hyperledger.jfrog.io/artifactory/besu-maven/" } + maven { url "https://artifacts.consensys.net/public/maven/maven/" } + maven { url "https://splunk.jfrog.io/splunk/ext-releases-local" } jcenter() } @@ -26,9 +30,13 @@ node { } ext { - web3jVersion = '4.9.4' + besuPluginVersion = '23.4.0' + besuInternalVersion = '23.4.0' + besuInternalCryptoVersion = '23.1.3' + web3jVersion = '4.10.1' logbackVersion = '1.2.3' klaxonVersion = '5.5' + besuCryptoDepVersion = '0.7.1' } dependencies { @@ -41,6 +49,21 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1' + + implementation "org.hyperledger.besu:plugin-api:$besuPluginVersion" + implementation "org.hyperledger.besu.internal:besu:$besuInternalVersion" + implementation "org.hyperledger.besu.internal:api:$besuInternalVersion" + implementation "org.hyperledger.besu:evm:$besuPluginVersion" + implementation "org.hyperledger.besu.internal:config:$besuInternalVersion" + implementation "org.hyperledger.besu.internal:core:$besuInternalVersion" + implementation "org.hyperledger.besu.internal:crypto:$besuInternalCryptoVersion" + implementation "org.hyperledger.besu.internal:rlp:$besuInternalVersion" + implementation "org.hyperledger.besu.internal:kvstore:$besuInternalVersion" + implementation "org.hyperledger.besu.internal:metrics-core:$besuInternalVersion" + implementation "org.hyperledger.besu.internal:trie:$besuInternalVersion" + implementation "org.hyperledger.besu.internal:util:$besuInternalVersion" + implementation "org.hyperledger.besu:bls12-381:$besuCryptoDepVersion" + implementation "org.hyperledger.besu:secp256k1:$besuCryptoDepVersion" } jar { @@ -61,7 +84,11 @@ test { } compileTestKotlin { - kotlinOptions.jvmTarget = "1.8" + kotlinOptions.jvmTarget = "17" +} + +shadowJar { + zip64 = true } diff --git a/src/main/resources/project/build.gradleImportJava11.template b/src/main/resources/project/build.gradleImportJava11.template deleted file mode 100644 index 4385af6..0000000 --- a/src/main/resources/project/build.gradleImportJava11.template +++ /dev/null @@ -1,69 +0,0 @@ -plugins { - id 'java' - id 'org.jetbrains.kotlin.jvm' version '1.3.61' - id 'application' - id "com.github.johnrengelman.shadow" version "5.2.0" - id 'org.web3j' version '4.9.4' -} - -group '' -version '0.1.0' - -sourceCompatibility = 11 - -repositories { - mavenCentral() - maven { url "https://hyperledger.jfrog.io/hyperledger/besu-maven" } - maven { url "https://artifacts.consensys.net/public/maven/maven/" } - maven { url "https://splunk.jfrog.io/splunk/ext-releases-local" } - maven { url "https://dl.cloudsmith.io/public/consensys/quorum-mainnet-launcher/maven/"} -} - -web3j { - generatedPackageName = '.generated.contracts' -} - -node { - nodeProjectDir.set(file("$projectDir")) -} - -ext { - web3jVersion = '4.9.4' - logbackVersion = '1.2.3' - klaxonVersion = '5.5' -} - -dependencies { - implementation "org.web3j:core:$web3jVersion", - "ch.qos.logback:logback-core:$logbackVersion", - "ch.qos.logback:logback-classic:$logbackVersion", - "com.beust:klaxon:$klaxonVersion" - implementation "org.web3j:web3j-unit:$web3jVersion" - implementation "org.web3j:web3j-evm:$web3jVersion" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1' -} -jar { - manifest { - attributes( - 'Main-Class': '.', - 'Multi-Release':'true' - ) - } -} -application { - mainClassName = '.' -} - -test { - useJUnitPlatform() -} - -compileKotlin { - kotlinOptions.jvmTarget = "11" -} - -compileTestKotlin { - kotlinOptions.jvmTarget = "11" -} diff --git a/src/main/resources/project/build.gradleImportOpenApi.template b/src/main/resources/project/build.gradleImportOpenApi.template index b4eda2b..e97382c 100644 --- a/src/main/resources/project/build.gradleImportOpenApi.template +++ b/src/main/resources/project/build.gradleImportOpenApi.template @@ -1,11 +1,12 @@ plugins { - id "org.web3j.openapi" version "4.9.4" + id "org.web3j.openapi" version "4.10.1" } group '' version '1.0-SNAPSHOT' repositories { + mavenLocal() mavenCentral() } diff --git a/src/main/resources/project/build.gradleJarOpenApi.template b/src/main/resources/project/build.gradleJarOpenApi.template index 60118e4..c44e96f 100644 --- a/src/main/resources/project/build.gradleJarOpenApi.template +++ b/src/main/resources/project/build.gradleJarOpenApi.template @@ -1,5 +1,5 @@ plugins { - id "org.web3j.openapi" version "4.9.4" + id "org.web3j.openapi" version "4.10.1" id "com.github.johnrengelman.shadow" version "5.2.0" } @@ -7,6 +7,7 @@ group '' version '1.0-SNAPSHOT' repositories { + mavenLocal() mavenCentral() } diff --git a/src/main/resources/project/build.gradleJava11.template b/src/main/resources/project/build.gradleJava11.template deleted file mode 100644 index 325d7e5..0000000 --- a/src/main/resources/project/build.gradleJava11.template +++ /dev/null @@ -1,74 +0,0 @@ -plugins { - id 'java' - id 'org.jetbrains.kotlin.jvm' version '1.3.61' - id 'application' - id "com.github.johnrengelman.shadow" version "5.2.0" - id 'org.web3j' version '4.9.4' -} - -group '' -version '0.1.0' - -sourceCompatibility = 11 - -repositories { - mavenCentral() - maven { url "https://hyperledger.jfrog.io/hyperledger/besu-maven" } - maven { url "https://artifacts.consensys.net/public/maven/maven/" } - maven { url "https://splunk.jfrog.io/splunk/ext-releases-local" } - maven { url "https://dl.cloudsmith.io/public/consensys/quorum-mainnet-launcher/maven/"} -} - -web3j { - generatedPackageName = '.generated.contracts' - excludedContracts = ['Mortal'] -} - -node { - nodeProjectDir.set(file("$projectDir")) -} - -ext { - web3jVersion = '4.9.4' - logbackVersion = '1.2.3' - klaxonVersion = '5.5' -} - -dependencies { - implementation "org.web3j:core:$web3jVersion", - "ch.qos.logback:logback-core:$logbackVersion", - "ch.qos.logback:logback-classic:$logbackVersion", - "com.beust:klaxon:$klaxonVersion" - implementation("org.web3j:web3j-unit:$web3jVersion") - implementation("org.web3j:web3j-evm:$web3jVersion") - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1' -} - -jar { - manifest { - attributes( - 'Main-Class': '.', - 'Multi-Release':'true' - ) - } -} -application { - mainClassName = '.' -} - -test { - useJUnitPlatform() -} - -compileKotlin { - kotlinOptions.jvmTarget = "11" -} - -compileTestKotlin { - kotlinOptions.jvmTarget = "11" -} - - - diff --git a/src/main/resources/project/build.gradleOpenApi.template b/src/main/resources/project/build.gradleOpenApi.template index 3ebc4ea..8e08b98 100644 --- a/src/main/resources/project/build.gradleOpenApi.template +++ b/src/main/resources/project/build.gradleOpenApi.template @@ -1,11 +1,12 @@ plugins { - id "org.web3j.openapi" version "4.9.4" + id "org.web3j.openapi" version "4.10.1" } group '' version '1.0-SNAPSHOT' repositories { + mavenLocal() mavenCentral() } diff --git a/src/main/resources/project/erc20/build.gradleErc20.template b/src/main/resources/project/erc20/build.gradleErc20.template index 50b5c2a..5e1aaae 100644 --- a/src/main/resources/project/erc20/build.gradleErc20.template +++ b/src/main/resources/project/erc20/build.gradleErc20.template @@ -1,22 +1,22 @@ plugins { id 'java' - id 'org.jetbrains.kotlin.jvm' version '1.3.61' + id 'org.jetbrains.kotlin.jvm' version '1.6.21' id 'application' id "com.github.johnrengelman.shadow" version "5.2.0" - id 'org.web3j' version '4.9.4' + id 'org.web3j' version '4.10.1' } group '' version '0.1.0' -sourceCompatibility = 1.8 +sourceCompatibility = 17 repositories { + mavenLocal() mavenCentral() maven { url "https://hyperledger.jfrog.io/hyperledger/besu-maven" } maven { url "https://artifacts.consensys.net/public/maven/maven/" } maven { url "https://splunk.jfrog.io/splunk/ext-releases-local" } - maven { url "https://dl.cloudsmith.io/public/consensys/quorum-mainnet-launcher/maven/"} } web3j { @@ -29,9 +29,13 @@ node { } ext { - web3jVersion = '4.9.4' + web3jVersion = '4.10.1' logbackVersion = '1.2.3' klaxonVersion = '5.5' + besuPluginVersion = '23.4.0' + besuInternalVersion = '23.4.0' + besuInternalCryptoVersion = '23.1.3' + besuCryptoDepVersion = '0.7.1' } dependencies { @@ -44,6 +48,21 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1' + + implementation "org.hyperledger.besu:plugin-api:$besuPluginVersion" + implementation "org.hyperledger.besu.internal:besu:$besuInternalVersion" + implementation "org.hyperledger.besu.internal:api:$besuInternalVersion" + implementation "org.hyperledger.besu:evm:$besuPluginVersion" + implementation "org.hyperledger.besu.internal:config:$besuInternalVersion" + implementation "org.hyperledger.besu.internal:core:$besuInternalVersion" + implementation "org.hyperledger.besu.internal:crypto:$besuInternalCryptoVersion" + implementation "org.hyperledger.besu.internal:rlp:$besuInternalVersion" + implementation "org.hyperledger.besu.internal:kvstore:$besuInternalVersion" + implementation "org.hyperledger.besu.internal:metrics-core:$besuInternalVersion" + implementation "org.hyperledger.besu.internal:trie:$besuInternalVersion" + implementation "org.hyperledger.besu.internal:util:$besuInternalVersion" + implementation "org.hyperledger.besu:bls12-381:$besuCryptoDepVersion" + implementation "org.hyperledger.besu:secp256k1:$besuCryptoDepVersion" } jar { @@ -64,14 +83,18 @@ test { } compileKotlin { - kotlinOptions.jvmTarget = "1.8" + kotlinOptions.jvmTarget = "17" } compileTestKotlin { - kotlinOptions.jvmTarget = "1.8" + kotlinOptions.jvmTarget = "17" } solidity { evmVersion = 'constantinople' } +shadowJar { + zip64 = true +} + diff --git a/src/main/resources/project/erc20/build.gradleErc20Java11.template b/src/main/resources/project/erc20/build.gradleErc20Java11.template deleted file mode 100644 index c4e816d..0000000 --- a/src/main/resources/project/erc20/build.gradleErc20Java11.template +++ /dev/null @@ -1,75 +0,0 @@ -plugins { - id 'java' - id 'org.jetbrains.kotlin.jvm' version '1.3.61' - id 'application' - id "com.github.johnrengelman.shadow" version "5.2.0" - id 'org.web3j' version '4.9.4' -} - -group '' -version '0.1.0' - -sourceCompatibility = 11 - -repositories { - mavenCentral() - maven { url "https://hyperledger.jfrog.io/hyperledger/besu-maven" } - maven { url "https://artifacts.consensys.net/public/maven/maven/" } - maven { url "https://splunk.jfrog.io/splunk/ext-releases-local" } - maven { url "https://dl.cloudsmith.io/public/consensys/quorum-mainnet-launcher/maven/"} -} - -web3j { - generatedPackageName = '.generated.contracts' - includedContracts = ['ERC20Token'] -} - -node { - nodeProjectDir.set(file("$projectDir")) -} - -ext { - web3jVersion = '4.9.4' - logbackVersion = '1.2.3' - klaxonVersion = '5.5' -} - -dependencies { - implementation "org.web3j:core:$web3jVersion", - "ch.qos.logback:logback-core:$logbackVersion", - "ch.qos.logback:logback-classic:$logbackVersion", - "com.beust:klaxon:$klaxonVersion" - implementation "org.web3j:web3j-unit:$web3jVersion" - implementation "org.web3j:web3j-evm:$web3jVersion" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1' -} - -jar { - manifest { - attributes( - 'Main-Class': '.', - 'Multi-Release':'true' - ) - } -} -application { - mainClassName = '.' -} - -test { - useJUnitPlatform() -} - -compileKotlin { - kotlinOptions.jvmTarget = "11" -} - -compileTestKotlin { - kotlinOptions.jvmTarget = "11" -} - -solidity { - evmVersion = 'constantinople' -} diff --git a/src/main/resources/project/erc20/build.gradleOpenApiErc20.template b/src/main/resources/project/erc20/build.gradleOpenApiErc20.template index ed59bd3..0c56591 100644 --- a/src/main/resources/project/erc20/build.gradleOpenApiErc20.template +++ b/src/main/resources/project/erc20/build.gradleOpenApiErc20.template @@ -1,11 +1,12 @@ plugins { - id "org.web3j.openapi" version "4.9.4" + id "org.web3j.openapi" version "4.10.1" } group '' version '1.0-SNAPSHOT' repositories { + mavenLocal() mavenCentral() } diff --git a/src/main/resources/project/erc777/build.gradleErc777.template b/src/main/resources/project/erc777/build.gradleErc777.template index eb6457f..6ea2edf 100644 --- a/src/main/resources/project/erc777/build.gradleErc777.template +++ b/src/main/resources/project/erc777/build.gradleErc777.template @@ -1,17 +1,18 @@ plugins { id 'java' - id 'org.jetbrains.kotlin.jvm' version '1.3.61' + id 'org.jetbrains.kotlin.jvm' version '1.6.21' id 'application' id "com.github.johnrengelman.shadow" version "5.2.0" - id 'org.web3j' version '4.9.4' + id 'org.web3j' version '4.10.1' } group '' version '0.1.0' -sourceCompatibility = 1.8 +sourceCompatibility = 17 repositories { + mavenLocal() mavenCentral() maven { url "https://hyperledger.jfrog.io/hyperledger/besu-maven" } maven { url "https://artifacts.consensys.net/public/maven/maven/" } @@ -29,7 +30,7 @@ node { } ext { - web3jVersion = '4.9.4' + web3jVersion = '4.10.1' logbackVersion = '1.2.3' klaxonVersion = '5.5' } @@ -64,14 +65,17 @@ test { } compileKotlin { - kotlinOptions.jvmTarget = "1.8" + kotlinOptions.jvmTarget = "17" } compileTestKotlin { - kotlinOptions.jvmTarget = "1.8" + kotlinOptions.jvmTarget = "17" } solidity { evmVersion = 'constantinople' } +shadowJar { + zip64 = true +} \ No newline at end of file diff --git a/src/main/resources/project/erc777/build.gradleErc777Java11.template b/src/main/resources/project/erc777/build.gradleErc777Java11.template deleted file mode 100644 index 3d6d5a1..0000000 --- a/src/main/resources/project/erc777/build.gradleErc777Java11.template +++ /dev/null @@ -1,71 +0,0 @@ -plugins { - id 'java' - id 'org.jetbrains.kotlin.jvm' version '1.3.61' - id 'application' - id "com.github.johnrengelman.shadow" version "5.2.0" - id 'org.web3j' version '4.9.4' -} - -group '' -version '0.1.0' - -sourceCompatibility = 11 - -repositories { - mavenCentral() - maven { url "https://hyperledger.jfrog.io/hyperledger/besu-maven" } - maven { url "https://artifacts.consensys.net/public/maven/maven/" } - maven { url "https://splunk.jfrog.io/splunk/ext-releases-local" } - maven { url "https://dl.cloudsmith.io/public/consensys/quorum-mainnet-launcher/maven/"} -} - -web3j { - generatedPackageName = '.generated.contracts' - includedContracts = ['ERC777Token'] -} - -node { - nodeProjectDir.set(file("$projectDir")) -} - -ext { - web3jVersion = '4.9.4' - klaxonVersion = '5.5' -} - -dependencies { - implementation "com.beust:klaxon:$klaxonVersion" - implementation "org.web3j:web3j-unit:$web3jVersion" - implementation "org.web3j:web3j-evm:$web3jVersion" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1' -} - -jar { - manifest { - attributes( - 'Main-Class': '.', - 'Multi-Release':'true' - ) - } -} -application { - mainClassName = '.' -} - -test { - useJUnitPlatform() -} - -compileKotlin { - kotlinOptions.jvmTarget = "11" -} - -compileTestKotlin { - kotlinOptions.jvmTarget = "11" -} - -solidity { - evmVersion = 'constantinople' -} diff --git a/src/main/resources/project/erc777/build.gradleOpenApiErc777.template b/src/main/resources/project/erc777/build.gradleOpenApiErc777.template index eaa641a..c797a8a 100644 --- a/src/main/resources/project/erc777/build.gradleOpenApiErc777.template +++ b/src/main/resources/project/erc777/build.gradleOpenApiErc777.template @@ -1,5 +1,5 @@ plugins { - id "org.web3j.openapi" version "4.9.4" + id "org.web3j.openapi" version "4.10.1" } group '' diff --git a/src/main/resources/project/gradlew-wrapper.properties.template b/src/main/resources/project/gradlew-wrapper.properties.template index ef9a9e0..070cb70 100644 --- a/src/main/resources/project/gradlew-wrapper.properties.template +++ b/src/main/resources/project/gradlew-wrapper.properties.template @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/resources/project/settings.gradle.template b/src/main/resources/project/settings.gradle.template index 1d698f6..4abfc83 100644 --- a/src/main/resources/project/settings.gradle.template +++ b/src/main/resources/project/settings.gradle.template @@ -1 +1,7 @@ +pluginManagement { + repositories { + mavenLocal() + gradlePluginPortal() + } +} rootProject.name = ''; \ No newline at end of file diff --git a/src/test/kotlin/org/web3j/console/openapi/OpenApiProjectTest.kt b/src/test/kotlin/org/web3j/console/openapi/OpenApiProjectTest.kt index 77c29ef..2cd5b23 100644 --- a/src/test/kotlin/org/web3j/console/openapi/OpenApiProjectTest.kt +++ b/src/test/kotlin/org/web3j/console/openapi/OpenApiProjectTest.kt @@ -22,6 +22,7 @@ import org.junit.jupiter.api.Test import org.web3j.console.project.utils.Folders import picocli.CommandLine import java.io.File +import java.io.PrintWriter import java.nio.file.Paths class OpenApiProjectTest { @@ -39,7 +40,8 @@ class OpenApiProjectTest { @Test fun testCorrectArgsOpenApiJarGeneration() { val args = arrayOf("-p", "org.com", "-n", "Test", "-o", tempDirPath, "-s", soliditySource.absolutePath) - val exitCode = CommandLine(JarOpenApiCommand::class.java).execute(*args) + val writer = PrintWriter(System.out) + val exitCode = CommandLine(JarOpenApiCommand::class.java).setErr(writer).execute(*args) assertEquals(0, exitCode) val jarFile = Paths.get(tempDirPath, "Test-server-all.jar").toFile() assertTrue(jarFile.exists())