From dc549315ac791b645ef54e2c404f143aa48c6221 Mon Sep 17 00:00:00 2001 From: David Ryan Date: Wed, 23 Oct 2024 14:49:23 +1100 Subject: [PATCH] A quick go at upgrading Gradle to 8.10.1 and to compile to Java 21. Not tested. --- build.gradle | 99 ++++++++++--------- bytes/build.gradle | 2 +- dependency-versions.gradle | 6 +- devp2p/build.gradle | 5 +- .../org/apache/tuweni/devp2p/PacketType.kt | 2 +- dist/build.gradle | 10 +- eth-client-app/build.gradle | 6 +- eth-crawler/build.gradle | 2 +- eth-faucet/build.gradle | 6 +- gossip/build.gradle | 7 +- gradle/wrapper/gradle-wrapper.properties | 3 +- gradlew | 34 ++++--- gradlew.bat | 22 +++-- hobbits-relayer/build.gradle | 6 +- jsonrpc-app/build.gradle | 2 +- jsonrpc-downloader/build.gradle | 2 +- .../apache/tuweni/jsonrpc/JSONRPCServer.kt | 4 + stratum-proxy/build.gradle | 2 +- 18 files changed, 126 insertions(+), 94 deletions(-) diff --git a/build.gradle b/build.gradle index 7d59e5922..7ffed37e4 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,9 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -import org.ajoberstar.grgit.Grgit +import net.ltgt.gradle.errorprone.CheckSeverity +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import groovy.xml.XmlParser import java.time.Instant import java.time.ZoneId import java.time.format.DateTimeFormatter @@ -21,22 +23,22 @@ buildscript { } dependencies { - classpath "org.ajoberstar.grgit:grgit-core:5.2.1" + classpath "org.ajoberstar.grgit:grgit-core:5.3.0" } } plugins { - id 'com.diffplug.spotless' version '6.22.0' - id 'net.ltgt.errorprone' version '3.1.0' - id 'org.springframework.boot' version '3.2.4' - id 'io.spring.dependency-management' version '1.1.3' + id 'com.diffplug.spotless' version '6.25.0' + id 'net.ltgt.errorprone' version '4.1.0' + id 'org.springframework.boot' version '3.3.4' + id 'io.spring.dependency-management' version '1.1.6' id 'org.gradle.crypto.checksum' version '1.4.0' - id 'org.jetbrains.kotlin.jvm' version '1.9.23' - id 'org.jetbrains.kotlin.plugin.spring' version '1.9.23' + id 'org.jetbrains.kotlin.jvm' version '2.0.21' + id 'org.jetbrains.kotlin.plugin.spring' version '2.0.21' id 'org.jetbrains.dokka' version '1.9.20' id 'maven-publish' id 'se.patrikerdes.use-latest-versions' version '0.2.18' - id 'com.github.ben-manes.versions' version '0.49.0' + id 'com.github.ben-manes.versions' version '0.51.0' } description = 'A set of libraries and other tools to aid development of blockchain and other decentralized software in Java and other JVM languages' @@ -74,7 +76,7 @@ def expandedTaskList = [] gradle.startParameter.taskNames.each { expandedTaskList << (buildAliases[it] ? buildAliases[it] : it) } -gradle.startParameter.taskNames = expandedTaskList.flatten() +gradle.startParameter.taskNames = expandedTaskList.flatten() as Iterable ext { gradleVersion = '7.6' @@ -96,7 +98,7 @@ spotless { } } -task integrationTest(type: Test) { +tasks.register('integrationTest', Test) { } subprojects { @@ -142,7 +144,7 @@ subprojects { integrationTestRuntimeOnly 'ch.qos.logback:logback-classic' } - task integrationTest(type: Test) { + tasks.register('integrationTest', Test) { description = 'Runs integration tests.' group = 'verification' @@ -159,13 +161,13 @@ subprojects { ////// // Parallel build execution - tasks.withType(Test) { + tasks.withType(Test).configureEach { // If GRADLE_MAX_TEST_FORKS is not set, use half the available processors maxParallelForks = (System.getenv('GRADLE_MAX_TEST_FORKS') ?: - (Runtime.runtime.availableProcessors().intdiv(2) ?: 1)).toInteger() + (Runtime.runtime.availableProcessors().intdiv(2) ?: 1)).toInteger() } - tasks.withType(JavaCompile) { + tasks.withType(JavaCompile).configureEach { options.fork = true options.incremental = true options.encoding = 'UTF-8' @@ -208,43 +210,44 @@ allprojects { ////// // Compiler arguments - - sourceCompatibility = '1.17' - targetCompatibility = '1.17' + java { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 + } dependencies { errorprone 'com.google.errorprone:error_prone_core' } - tasks.withType(AbstractArchiveTask) { + tasks.withType(AbstractArchiveTask).configureEach { preserveFileTimestamps = false reproducibleFileOrder = true } - tasks.withType(JavaCompile) { + tasks.withType(JavaCompile).configureEach { options.compilerArgs += [ - '-Xlint:unchecked', - '-Xlint:cast', - '-Xlint:rawtypes', - '-Xlint:overloads', - '-Xlint:divzero', - '-Xlint:finally', - '-Xlint:static', - '-Werror' + '-Xlint:unchecked', + '-Xlint:cast', + '-Xlint:rawtypes', + '-Xlint:overloads', + '-Xlint:divzero', + '-Xlint:finally', + '-Xlint:static', + '-Werror' ] options.errorprone { excludedPaths = '.*/generated-src/.*' - check('FutureReturnValueIgnored', net.ltgt.gradle.errorprone.CheckSeverity.OFF) - check('UnnecessaryParentheses', net.ltgt.gradle.errorprone.CheckSeverity.OFF) + check('FutureReturnValueIgnored', CheckSeverity.OFF) + check('UnnecessaryParentheses', CheckSeverity.OFF) disableWarningsInGeneratedCode = true } } - tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { - kotlinOptions { - jvmTarget = "17" + tasks.withType(KotlinCompile).configureEach { + compilerOptions { + //jvmTarget = JvmTarget.JVM_21 allWarningsAsErrors = true freeCompilerArgs = [ '-Xjsr305=strict', @@ -264,8 +267,8 @@ allprojects { jacocoTestReport { reports { - xml.enabled true - html.enabled true + xml.required = true + html.required = true } getExecutionData().setFrom(fileTree(buildDir).include("/jacoco/*.exec")) } @@ -278,16 +281,17 @@ allprojects { destinationDirectory = file("${rootProject.buildDir}/libs") } - task sourcesJar(type: Jar, dependsOn: classes) { + tasks.register('sourcesJar', Jar) { + dependsOn classes destinationDirectory = file("${rootProject.buildDir}/src") - classifier = 'sources' + archiveClassifier = 'sources' from sourceSets.main.allSource } ////// // Packaging and deployment - tasks.withType(Jar) { + tasks.withType(Jar).configureEach { def moduleName = rootProject.name if (rootProject == project) { archiveBaseName = project.name @@ -297,8 +301,8 @@ allprojects { } manifest { attributes('Implementation-Title': archiveBaseName, - 'Implementation-Version': project.version, - 'Automatic-Module-Name': moduleName.replaceAll("-","_")) + 'Implementation-Version': project.version, + 'Automatic-Module-Name': moduleName.replaceAll("-", "_")) } from(rootProject.projectDir) { include 'DISCLAIMER' @@ -320,6 +324,11 @@ allprojects { sign configurations.archives } + tasks.register('sourceJar', Jar) { + from sourceSets.main.allJava + archiveClassifier = "source" + } + publishing { repositories { maven { @@ -336,7 +345,7 @@ allprojects { project.logger.info('Reading .m2/settings.xml') def serverId = (project.properties['distMgmtServerId'] ?: isRelease ? 'apache.releases.https' : 'apache.snapshots.https') - def m2SettingCreds = new XmlSlurper().parse(settingsXml).servers.server.find { server -> serverId.equals(server.id.text()) } + def m2SettingCreds = new XmlParser().parse(settingsXml).servers.server.find { server -> (serverId == server.id.text()) } if (m2SettingCreds) { project.logger.info('Found matching credentials from .m2/settings.xml') credentials { @@ -370,7 +379,7 @@ allprojects { MavenDeployment(MavenPublication) { publication -> if (project != rootProject) { from components.java - artifact sourcesJar { classifier 'sources' } + artifact sourceJar } groupId 'io.consensys.protocols' artifactId 'tuweni-' + project.name @@ -494,13 +503,13 @@ allprojects { } } - tasks.withType(Sign) { + tasks.withType(Sign).configureEach { onlyIf { System.getenv('ENABLE_SIGNING') == 'true' } } - tasks.withType(GenerateModuleMetadata) { + tasks.withType(GenerateModuleMetadata).configureEach { enabled = false } @@ -573,7 +582,7 @@ dokkaHtml { } } -project.task("checkNotice") { +tasks.register('checkNotice') { def lines = file("NOTICE").readLines() def expected = "Copyright 2023-${LocalDate.now().getYear()} The Machine Consultancy LLC" for (line in lines) { diff --git a/bytes/build.gradle b/bytes/build.gradle index f3f093080..aa2d575c1 100644 --- a/bytes/build.gradle +++ b/bytes/build.gradle @@ -17,7 +17,7 @@ dependencies { implementation 'org.connid:framework-internal' compileOnly 'com.google.code.findbugs:jsr305' compileOnly 'com.google.errorprone:error_prone_annotations' - compileOnly 'io.vertx:vertx-core' + api 'io.vertx:vertx-core' testImplementation 'io.vertx:vertx-core' testImplementation 'org.junit.jupiter:junit-jupiter-api' diff --git a/dependency-versions.gradle b/dependency-versions.gradle index 94822d74a..8ced2060a 100644 --- a/dependency-versions.gradle +++ b/dependency-versions.gradle @@ -117,13 +117,13 @@ dependencyManagement { dependency('org.infinispan:infinispan-cachestore-rocksdb:15.0.0.Dev02') - dependency('org.jetbrains:annotations:23.1.0') - dependencySet(group: 'org.jetbrains.kotlin', version: '1.9.0-Beta') { + dependency('org.jetbrains:annotations:26.0.1') + dependencySet(group: 'org.jetbrains.kotlin', version: '2.0.21') { entry 'kotlin-reflect' entry 'kotlin-stdlib' entry 'kotlin-stdlib-jdk8' } - dependencySet(group: 'org.jetbrains.kotlinx', version: '1.7.3') { + dependencySet(group: 'org.jetbrains.kotlinx', version: '1.9.0') { entry 'kotlinx-coroutines-core' entry 'kotlinx-coroutines-jdk8' } diff --git a/devp2p/build.gradle b/devp2p/build.gradle index 9e9b4d2d4..5aa45d930 100644 --- a/devp2p/build.gradle +++ b/devp2p/build.gradle @@ -31,7 +31,6 @@ dependencies { implementation 'org.slf4j:slf4j-api' implementation 'org.jetbrains.kotlin:kotlin-stdlib' - compileOnly 'org.bouncycastle:bcprov-jdk15on' testImplementation project(':junit') @@ -44,11 +43,11 @@ dependencies { } application { - mainClassName = 'org.apache.tuweni.devp2p.v5.ScraperApp' + mainClass = 'org.apache.tuweni.devp2p.v5.ScraperApp' applicationName = 'scraper' } -task v4ScraperApp(type: CreateStartScripts) { +tasks.register('v4ScraperApp', CreateStartScripts) { mainClass = "org.apache.tuweni.devp2p.ScraperApp" applicationName = "v4scraper" diff --git a/devp2p/src/main/kotlin/org/apache/tuweni/devp2p/PacketType.kt b/devp2p/src/main/kotlin/org/apache/tuweni/devp2p/PacketType.kt index ff34ff764..0f31bdab1 100644 --- a/devp2p/src/main/kotlin/org/apache/tuweni/devp2p/PacketType.kt +++ b/devp2p/src/main/kotlin/org/apache/tuweni/devp2p/PacketType.kt @@ -100,7 +100,7 @@ internal enum class PacketType( } init { - require(typeId <= PacketType.MAX_VALUE) { "Packet typeId must be in range [0x00, 0x80)" } + require(typeId <= 0x7F) { "Packet typeId must be in range [0x00, 0x80)" } } abstract fun decode( diff --git a/dist/build.gradle b/dist/build.gradle index 234bccc4a..8875c4d25 100644 --- a/dist/build.gradle +++ b/dist/build.gradle @@ -22,7 +22,7 @@ apply plugin: 'distribution' jar { enabled = false } -task createBinaryLicense { +tasks.register('createBinaryLicense') { description "Create a LICENSE file with all dependencies" doLast { @@ -33,7 +33,7 @@ task createBinaryLicense { } } -task createBinaryNotice { +tasks.register('createBinaryNotice') { description "Create a NOTICE file with all dependencies" doLast { @@ -52,7 +52,7 @@ static def mandatoryFiles(CopySpec spec) { spec.into('license-reports') { from '../build/dependency-license' } } -task builtGradleProperties() { +tasks.register('builtGradleProperties') { doLast { project.buildDir.mkdirs() new File(project.buildDir, "gradle.properties").text = """ @@ -132,7 +132,7 @@ distributions { from { project(':eth-crawler').startScripts.outputs.files } from { project(':jsonrpc-app').startScripts.outputs.files } from { project(':stratum-proxy').startScripts.outputs.files } - fileMode = 0755 + dirPermissions { unix(0755) } } } } @@ -175,7 +175,7 @@ distributions { } } -task addDependencies() { +tasks.register('addDependencies') { doLast { def deps = [] rootProject.subprojects.each { s -> diff --git a/eth-client-app/build.gradle b/eth-client-app/build.gradle index 5a20d0a81..08940b03a 100644 --- a/eth-client-app/build.gradle +++ b/eth-client-app/build.gradle @@ -39,15 +39,17 @@ dependencies { } application { - mainClassName = 'org.apache.tuweni.ethclient.EthereumClientAppKt' + mainClass = 'org.apache.tuweni.ethclient.EthereumClientAppKt' applicationName = 'tuweni' } tasks.register("bootnode", CreateStartScripts) { applicationName = "bootnode" outputDir = file("build/scripts") - mainClassName = 'org.apache.tuweni.ethclient.BootnodeAppKt' + mainClass = 'org.apache.tuweni.ethclient.BootnodeAppKt' classpath = project.tasks.getAt(JavaPlugin.JAR_TASK_NAME).outputs.files.plus(project.configurations.getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME)) } +distTar.dependsOn "bootnode" +distZip.dependsOn "bootnode" assemble.dependsOn "bootnode" diff --git a/eth-crawler/build.gradle b/eth-crawler/build.gradle index 4ce017791..baf0b7fd8 100644 --- a/eth-crawler/build.gradle +++ b/eth-crawler/build.gradle @@ -72,6 +72,6 @@ dependencies { } application { - mainClassName = 'org.apache.tuweni.eth.crawler.CrawlerApp' + mainClass = 'org.apache.tuweni.eth.crawler.CrawlerApp' applicationName = 'crawler' } diff --git a/eth-faucet/build.gradle b/eth-faucet/build.gradle index 09a657a7c..09370f68c 100644 --- a/eth-faucet/build.gradle +++ b/eth-faucet/build.gradle @@ -22,10 +22,12 @@ bootJar { jar { enabled = true - classifier = '' + archiveClassifier = '' } -mainClassName = 'org.apache.tuweni.faucet.FaucetApplicationKt' +application { + mainClass = 'org.apache.tuweni.faucet.FaucetApplicationKt' +} dependencies { implementation 'com.fasterxml.jackson.core:jackson-databind' diff --git a/gossip/build.gradle b/gossip/build.gradle index ed09e5348..29463cd40 100644 --- a/gossip/build.gradle +++ b/gossip/build.gradle @@ -37,5 +37,8 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter-engine' } -application { mainClassName = 'org.apache.tuweni.gossip.GossipApp' } -applicationDefaultJvmArgs = ["-Xms512m", "-Xmx1g"] +application { + mainClass = 'org.apache.tuweni.gossip.GossipApp' + applicationDefaultJvmArgs = ["-Xms512m", "-Xmx1g"] +} + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2b22d057a..1ed247ec1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-all.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 798d4b390..873afe3e0 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,10 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -146,10 +147,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -157,7 +161,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -165,7 +169,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -210,11 +214,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index a556b295a..1baeffe8a 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/hobbits-relayer/build.gradle b/hobbits-relayer/build.gradle index 354c1869a..066943135 100644 --- a/hobbits-relayer/build.gradle +++ b/hobbits-relayer/build.gradle @@ -32,6 +32,8 @@ dependencies { testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' } +application { + mainClass = 'org.apache.tuweni.relayer.RelayerApp' + applicationDefaultJvmArgs = ["-Xms512m", "-Xmx1g"] +} -application { mainClassName = 'org.apache.tuweni.relayer.RelayerApp' } -applicationDefaultJvmArgs = ["-Xms512m", "-Xmx1g"] diff --git a/jsonrpc-app/build.gradle b/jsonrpc-app/build.gradle index e2d8e3440..d75423462 100644 --- a/jsonrpc-app/build.gradle +++ b/jsonrpc-app/build.gradle @@ -65,6 +65,6 @@ dependencies { } application { - mainClassName = 'org.apache.tuweni.jsonrpc.app.JSONRPCApp' + mainClass = 'org.apache.tuweni.jsonrpc.app.JSONRPCApp' applicationName = 'jsonrpc' } diff --git a/jsonrpc-downloader/build.gradle b/jsonrpc-downloader/build.gradle index e05625284..4ec394b91 100644 --- a/jsonrpc-downloader/build.gradle +++ b/jsonrpc-downloader/build.gradle @@ -47,6 +47,6 @@ dependencies { } application { - mainClassName = 'org.apache.tuweni.jsonrpc.downloader.DownloaderApp' + mainClass = 'org.apache.tuweni.jsonrpc.downloader.DownloaderApp' applicationName = 'jsonrpc-downloader' } diff --git a/jsonrpc/src/main/kotlin/org/apache/tuweni/jsonrpc/JSONRPCServer.kt b/jsonrpc/src/main/kotlin/org/apache/tuweni/jsonrpc/JSONRPCServer.kt index c97cf738f..991400db5 100644 --- a/jsonrpc/src/main/kotlin/org/apache/tuweni/jsonrpc/JSONRPCServer.kt +++ b/jsonrpc/src/main/kotlin/org/apache/tuweni/jsonrpc/JSONRPCServer.kt @@ -185,17 +185,21 @@ private class JSONRPCUser(val principal: JsonObject) : User { return JsonObject() } + + @Deprecated("Deprecated in Java") override fun isAuthorized(authority: Authorization?, resultHandler: Handler>?): User { resultHandler?.handle(Future.succeededFuture(true)) return this } + @Deprecated("Deprecated in Java") override fun clearCache(): User { return this } override fun principal(): JsonObject = principal + @Deprecated("Deprecated in Java") override fun setAuthProvider(authProvider: AuthProvider?) { } diff --git a/stratum-proxy/build.gradle b/stratum-proxy/build.gradle index 6cbe74efe..906c63a5c 100644 --- a/stratum-proxy/build.gradle +++ b/stratum-proxy/build.gradle @@ -40,6 +40,6 @@ dependencies { } application { - mainClassName = 'org.apache.tuweni.stratum.StratumServerAppKt' + mainClass = 'org.apache.tuweni.stratum.StratumServerAppKt' applicationName = 'stratum-proxy' }