From e47e5690accce3a21d61195af8e450dbbf69a102 Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Fri, 27 Sep 2024 00:54:25 +0200 Subject: [PATCH 01/15] build: use common Gradle config Signed-off-by: Jendrik Johannes --- .github/dependabot.yml | 11 +- .github/workflows/pr-checks.yaml | 7 +- build.gradle.kts | 19 -- buildSrc/build.gradle.kts | 34 --- buildSrc/src/main/kotlin/Utils.kt | 83 ------- ....hedera.block.aggregate-reports.gradle.kts | 83 ------- .../kotlin/com.hedera.block.common.gradle.kts | 25 -- .../com.hedera.block.conventions.gradle.kts | 177 --------------- .../com.hedera.block.jpms-modules.gradle.kts | 213 ------------------ .../com.hedera.block.maven-publish.gradle.kts | 69 ------ .../com.hedera.block.protobuf.gradle.kts | 62 ----- .../kotlin/com.hedera.block.protos.gradle.kts | 22 -- .../com.hedera.block.repositories.gradle.kts | 23 -- .../kotlin/com.hedera.block.root.gradle.kts | 55 ----- .../kotlin/com.hedera.block.server.gradle.kts | 26 --- .../com.hedera.block.simulator.gradle.kts | 25 -- ...dera.block.spotless-conventions.gradle.kts | 65 ------ ...block.spotless-java-conventions.gradle.kts | 61 ----- ...ock.spotless-kotlin-conventions.gradle.kts | 45 ---- .../kotlin/com.hedera.block.tools.gradle.kts | 21 -- .../kotlin/com/hedera/block/tasks/GitClone.kt | 91 -------- common/build.gradle.kts | 9 +- gradle.properties | 10 +- .../aggregation/build.gradle.kts | 14 +- gradle/modules.properties | 53 ----- gradle/toolchain-versions.properties | 1 + gradle/wrapper/gradle-wrapper.jar | Bin 43453 -> 43583 bytes gradlew | 5 +- gradlew.bat | 2 + hiero-dependency-versions/build.gradle.kts | 94 ++++++++ server/build.gradle.kts | 13 +- server/src/main/java/module-info.java | 9 +- settings.gradle.kts | 136 +---------- simulator/build.gradle.kts | 10 +- simulator/src/main/java/module-info.java | 5 +- stream/build.gradle.kts | 45 ++-- stream/src/main/java/module-info.java | 4 +- suites/build.gradle.kts | 29 ++- suites/src/main/java/module-info.java | 6 +- tools/build.gradle.kts | 6 +- version.txt | 1 + 41 files changed, 218 insertions(+), 1451 deletions(-) delete mode 100644 build.gradle.kts delete mode 100644 buildSrc/build.gradle.kts delete mode 100644 buildSrc/src/main/kotlin/Utils.kt delete mode 100644 buildSrc/src/main/kotlin/com.hedera.block.aggregate-reports.gradle.kts delete mode 100644 buildSrc/src/main/kotlin/com.hedera.block.common.gradle.kts delete mode 100644 buildSrc/src/main/kotlin/com.hedera.block.conventions.gradle.kts delete mode 100644 buildSrc/src/main/kotlin/com.hedera.block.jpms-modules.gradle.kts delete mode 100644 buildSrc/src/main/kotlin/com.hedera.block.maven-publish.gradle.kts delete mode 100644 buildSrc/src/main/kotlin/com.hedera.block.protobuf.gradle.kts delete mode 100644 buildSrc/src/main/kotlin/com.hedera.block.protos.gradle.kts delete mode 100644 buildSrc/src/main/kotlin/com.hedera.block.repositories.gradle.kts delete mode 100644 buildSrc/src/main/kotlin/com.hedera.block.root.gradle.kts delete mode 100644 buildSrc/src/main/kotlin/com.hedera.block.server.gradle.kts delete mode 100644 buildSrc/src/main/kotlin/com.hedera.block.simulator.gradle.kts delete mode 100644 buildSrc/src/main/kotlin/com.hedera.block.spotless-conventions.gradle.kts delete mode 100644 buildSrc/src/main/kotlin/com.hedera.block.spotless-java-conventions.gradle.kts delete mode 100644 buildSrc/src/main/kotlin/com.hedera.block.spotless-kotlin-conventions.gradle.kts delete mode 100644 buildSrc/src/main/kotlin/com.hedera.block.tools.gradle.kts delete mode 100644 buildSrc/src/main/kotlin/com/hedera/block/tasks/GitClone.kt rename buildSrc/src/main/kotlin/com.hedera.block.suites.gradle.kts => gradle/aggregation/build.gradle.kts (69%) delete mode 100644 gradle/modules.properties create mode 100644 gradle/toolchain-versions.properties create mode 100644 hiero-dependency-versions/build.gradle.kts create mode 100644 version.txt diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c08fc5876..9ee1e1b5b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,7 +11,12 @@ updates: schedule: interval: daily - - package-ecosystem: "gradle" - directory: "/" + - package-ecosystem: gradle + directory: /hiero-dependency-versions schedule: - interval: "weekly" \ No newline at end of file + interval: weekly + + - package-ecosystem: gradle + directory: / + schedule: + interval: weekly \ No newline at end of file diff --git a/.github/workflows/pr-checks.yaml b/.github/workflows/pr-checks.yaml index 04a767b98..716804869 100644 --- a/.github/workflows/pr-checks.yaml +++ b/.github/workflows/pr-checks.yaml @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. ## + name: "PR Gradle Checks" on: push: @@ -74,15 +75,15 @@ jobs: - name: Build id: gradle-build - run: ${GRADLE_EXEC} build + run: ${GRADLE_EXEC} assemble --scan - name: Style Check id: spotless-check - run: ${GRADLE_EXEC} spotlessCheck + run: ${GRADLE_EXEC} qualityCheck --continue --scan - name: Unit Tests id: unit-tests - run: ${GRADLE_EXEC} check + run: ${GRADLE_EXEC} check --scan - name: Upload coverage report uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 diff --git a/build.gradle.kts b/build.gradle.kts deleted file mode 100644 index 3bd71c4cd..000000000 --- a/build.gradle.kts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - -plugins { - id("com.hedera.block.root") -} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts deleted file mode 100644 index d9fff832f..000000000 --- a/buildSrc/build.gradle.kts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - -plugins { `kotlin-dsl` } - -repositories { gradlePluginPortal() } - -dependencies { - implementation("com.adarshr:gradle-test-logger-plugin:4.0.0") - implementation("com.autonomousapps:dependency-analysis-gradle-plugin:1.32.0") - implementation("com.diffplug.spotless:spotless-plugin-gradle:6.25.0") - implementation("com.google.protobuf:protobuf-gradle-plugin:0.9.4") - implementation("com.gradle.publish:plugin-publish-plugin:1.2.1") - implementation("gradle.plugin.lazy.zoo.gradle:git-data-plugin:1.2.2") - implementation("io.github.gradle-nexus:publish-plugin:1.3.0") - implementation("me.champeau.jmh:jmh-gradle-plugin:0.7.2") - implementation("net.swiftzer.semver:semver:1.3.0") - implementation("org.gradlex:extra-java-module-info:1.8") - implementation("org.gradlex:jvm-dependency-conflict-resolution:2.0") - implementation("org.gradlex:java-module-dependencies:1.6.5") -} diff --git a/buildSrc/src/main/kotlin/Utils.kt b/buildSrc/src/main/kotlin/Utils.kt deleted file mode 100644 index f6ce8f4bf..000000000 --- a/buildSrc/src/main/kotlin/Utils.kt +++ /dev/null @@ -1,83 +0,0 @@ -import net.swiftzer.semver.SemVer -import org.gradle.api.Project -import java.io.File -import java.io.OutputStream -import java.io.PrintStream - -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - -class Utils { - companion object { - @JvmStatic - fun updateVersion(project: Project, newVersion: SemVer) { - val gradlePropFile = File(project.projectDir, "gradle.properties") - var lines: List = mutableListOf() - - if (gradlePropFile.exists()) { - lines = gradlePropFile.readLines(Charsets.UTF_8) - } - - var versionStr = "version=$newVersion" - val finalLines: List - - - if (lines.isNotEmpty()) { - finalLines = lines.map { - if (it.trimStart().startsWith("version=")) { - versionStr - } else { - it - } - } - } else { - finalLines = listOf(versionStr) - } - - - gradlePropFile.bufferedWriter(Charsets.UTF_8).use { - val writer = it - finalLines.forEach { - writer.write(it) - writer.newLine() - } - writer.flush() - } - } - - @JvmStatic - fun generateProjectVersionReport(rootProject: Project, ostream: OutputStream) { - val writer = PrintStream(ostream, false, Charsets.UTF_8) - - ostream.use { - writer.use { - // Writer headers - writer.println("### Deployed Version Information") - writer.println() - writer.println("| Artifact Name | Version Number |") - writer.println("| --- | --- |") - - // Write table rows - rootProject.childProjects.values.onEach { - writer.printf("| %s | %s |\n", it.name, it.version.toString()) - } - writer.flush() - ostream.flush() - } - } - } - } -} diff --git a/buildSrc/src/main/kotlin/com.hedera.block.aggregate-reports.gradle.kts b/buildSrc/src/main/kotlin/com.hedera.block.aggregate-reports.gradle.kts deleted file mode 100644 index 0a3a6a386..000000000 --- a/buildSrc/src/main/kotlin/com.hedera.block.aggregate-reports.gradle.kts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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 java.io.BufferedOutputStream -import net.swiftzer.semver.SemVer - -plugins { id("lazy.zoo.gradle.git-data-plugin") } - -tasks.register("githubVersionSummary") { - group = "github" - doLast { - val ghStepSummaryPath: String = - System.getenv("GITHUB_STEP_SUMMARY") - ?: throw IllegalArgumentException( - "This task may only be run in a Github Actions CI environment! Unable to locate the GITHUB_STEP_SUMMARY environment variable." - ) - - val ghStepSummaryFile = File(ghStepSummaryPath) - Utils.generateProjectVersionReport( - rootProject, - BufferedOutputStream(ghStepSummaryFile.outputStream()) - ) - } -} - -tasks.register("showVersion") { - group = "versioning" - doLast { println(project.version) } -} - -tasks.register("versionAsPrefixedCommit") { - group = "versioning" - doLast { - gitData.lastCommitHash?.let { - val prefix = findProperty("commitPrefix")?.toString() ?: "adhoc" - val newPrerel = prefix + ".x" + it.take(8) - val currVer = SemVer.parse(project.version.toString()) - try { - val newVer = SemVer(currVer.major, currVer.minor, currVer.patch, newPrerel) - Utils.updateVersion(project, newVer) - } catch (e: java.lang.IllegalArgumentException) { - throw IllegalArgumentException(String.format("%s: %s", e.message, newPrerel), e) - } - } - } -} - -tasks.register("versionAsSnapshot") { - group = "versioning" - doLast { - val currVer = SemVer.parse(project.version.toString()) - val newVer = SemVer(currVer.major, currVer.minor, currVer.patch, "SNAPSHOT") - - Utils.updateVersion(project, newVer) - } -} - -tasks.register("versionAsSpecified") { - group = "versioning" - doLast { - val verStr = - providers.gradleProperty("newVersion").orNull - ?: throw IllegalArgumentException( - "No newVersion property provided! Please add the parameter -PnewVersion= when running this task." - ) - - val newVer = SemVer.parse(verStr) - Utils.updateVersion(project, newVer) - } -} diff --git a/buildSrc/src/main/kotlin/com.hedera.block.common.gradle.kts b/buildSrc/src/main/kotlin/com.hedera.block.common.gradle.kts deleted file mode 100644 index 5fdfbba27..000000000 --- a/buildSrc/src/main/kotlin/com.hedera.block.common.gradle.kts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - -plugins { - id("java-library") - id("com.hedera.block.conventions") - id("me.champeau.jmh") -} - -val maven = publishing.publications.create("maven") { from(components["java"]) } - -signing.sign(maven) diff --git a/buildSrc/src/main/kotlin/com.hedera.block.conventions.gradle.kts b/buildSrc/src/main/kotlin/com.hedera.block.conventions.gradle.kts deleted file mode 100644 index 9b053e332..000000000 --- a/buildSrc/src/main/kotlin/com.hedera.block.conventions.gradle.kts +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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 com.adarshr.gradle.testlogger.theme.ThemeType - -plugins { - id("java") - id("jacoco") - id("org.gradlex.java-module-dependencies") - id("com.adarshr.test-logger") - id("com.hedera.block.repositories") - id("com.hedera.block.jpms-modules") - id("com.hedera.block.spotless-conventions") - id("com.hedera.block.spotless-java-conventions") - id("com.hedera.block.spotless-kotlin-conventions") - id("com.hedera.block.maven-publish") -} - -group = "com.hedera.block" - -val javaVersionMajor = JavaVersion.VERSION_21 -val javaVersionPatch = "0.4" - -val currentJavaVersionMajor = JavaVersion.current() -val currentJavaVersion = providers.systemProperty("java.version").get() -val expectedJavaVersion = "$javaVersionMajor.$javaVersionPatch" - -if (currentJavaVersion != expectedJavaVersion) { - val message = - "Gradle runs with Java $currentJavaVersion. This project works best running with Java $expectedJavaVersion. " + - "\n - From commandline: change JAVA_HOME and/or PATH to point at Java $expectedJavaVersion installation." + - "\n - From IntelliJ: change 'Gradle JVM' in 'Gradle Settings' to point at Java $expectedJavaVersion installation." - - if (currentJavaVersionMajor.ordinal < javaVersionMajor.ordinal) { // fail if version is too old - throw (RuntimeException(message)) - } else { - logger.lifecycle("WARN: $message") - } -} - -java { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 - toolchain { - languageVersion.set(JavaLanguageVersion.of(21)) - vendor.set(JvmVendorSpec.ADOPTIUM) - } - - // Enable JAR file generation required for publishing - withJavadocJar() - withSourcesJar() -} - -testing { - @Suppress("UnstableApiUsage") suites.getByName("test") { useJUnitJupiter() } -} - -tasks.withType { - isPreserveFileTimestamps = false - isReproducibleFileOrder = true - filePermissions { unix("0664") } - dirPermissions { unix("0775") } -} - -val deactivatedCompileLintOptions = - listOf( - // In Gradle, a module does not see the upstream (not-yet-compiled) modules. This could - // only be solved by calling 'javac' with '--source-module-path' to make other sources - // known. But this is at odds with how Gradle's incremental compilation calls the - // compiler for a subset of Java files for each project individually. - "module", // module not found when doing 'exports to ...' - "serial", // serializable class ... has no definition of serialVersionUID - "processing", // No processor claimed any of these annotations: ... - "try", // auto-closeable resource ignore is never referenced... (AutoClosableLock) - "missing-explicit-ctor", // class ... declares no explicit constructors - - // Needed because we use deprecation internally and do not fix all uses right away - "removal", - "deprecation", - - // The following checks could be activated and fixed: - "this-escape", // calling public/protected method in constructor - "overrides", // overrides equals, but neither it ... overrides hashCode method - "unchecked", - "rawtypes" - ) - -tasks.withType().configureEach { - // Track the full Java version as input (e.g. 17.0.3 vs. 17.0.9). - // By default, Gradle only tracks the major version as defined in the toolchain (e.g. 17). - // Since the full version is encoded in 'module-info.class' files, it should be tracked as - // it otherwise leads to wrong build cache hits. - inputs.property("fullJavaVersion", currentJavaVersion) - - options.encoding = "UTF-8" - options.isFork = true // run compiler in separate JVM process (independent of toolchain setup) - options.compilerArgs.add("-implicit:none") - - doLast { - // Make sure consistent line ending are used in files generated by annotation processors by - // rewriting generated files. - // To fix this problem at the root, one of these issues needs to be addressed upstream: - // - https://github.com/google/auto/issues/1656 - // - https://github.com/gradle/gradle/issues/27385 - if (System.lineSeparator() != "\n") { - destinationDirectory - .get() - .asFileTree - .filter { it.extension != "class" } - .forEach { - val content = it.readText() - val normalizedContent = content.replace(System.lineSeparator(), "\n") - if (content != normalizedContent) { - it.writeText(normalizedContent) - } - } - } - } -} - -tasks.withType().configureEach { - options { - this as StandardJavadocDocletOptions - encoding = "UTF-8" - tags( - "apiNote:a:API Note:", - "implSpec:a:Implementation Requirements:", - "implNote:a:Implementation Note:" - ) - options.windowTitle = "Hedera Block Node" - options.memberLevel = JavadocMemberLevel.PACKAGE - // Commenting this so we still get missing javadocs warnings - // addStringOption("Xdoclint:all,-missing", "-Xwerror") - } -} - -testlogger { - theme = ThemeType.MOCHA - slowThreshold = 10000 - showStandardStreams = true - showPassedStandardStreams = false - showSkippedStandardStreams = false - showFailedStandardStreams = true -} - -// Ensure JaCoCo coverage is generated and aggregated -tasks.jacocoTestReport.configure { - reports { - xml.required.set(true) - html.required.set(true) - } - - val testExtension = tasks.test.get().extensions.getByType() - executionData.setFrom(testExtension.destinationFile) - - shouldRunAfter(tasks.named("check")) -} - -tasks.check { - // Ensure the check task also runs the JaCoCo coverage report - dependsOn(tasks.jacocoTestReport) - // Check dependency scopes in module-info.java - dependsOn(tasks.checkAllModuleInfo) -} diff --git a/buildSrc/src/main/kotlin/com.hedera.block.jpms-modules.gradle.kts b/buildSrc/src/main/kotlin/com.hedera.block.jpms-modules.gradle.kts deleted file mode 100644 index 14ae2e6c5..000000000 --- a/buildSrc/src/main/kotlin/com.hedera.block.jpms-modules.gradle.kts +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Copyright (C) 2016-2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - -plugins { - id("org.gradlex.jvm-dependency-conflict-resolution") - id("org.gradlex.extra-java-module-info") -} - -// Fix or enhance the metadata of third-party Modules. This is about the metadata in the -// repositories: '*.pom' and '*.module' files. -jvmDependencyConflicts.patch { - // These compile time annotation libraries are not of interest in our setup and are thus removed - // from the dependencies of all components that bring them in. - val annotationLibraries = - listOf( - "com.google.android:annotations", - "com.google.code.findbugs:annotations", - "com.google.code.findbugs:jsr305", - "com.google.errorprone:error_prone_annotations", - "com.google.guava:listenablefuture", - "org.checkerframework:checker-compat-qual", - "org.checkerframework:checker-qual", - "org.codehaus.mojo:animal-sniffer-annotations" - ) - - module("io.grpc:grpc-netty-shaded") { annotationLibraries.forEach { removeDependency(it) } } - - module("io.grpc:grpc-api") { annotationLibraries.forEach { removeDependency(it) } } - module("io.grpc:grpc-core") { annotationLibraries.forEach { removeDependency(it) } } - module("io.grpc:grpc-context") { annotationLibraries.forEach { removeDependency(it) } } - module("io.grpc:grpc-protobuf") { annotationLibraries.forEach { removeDependency(it) } } - module("io.grpc:grpc-protobuf-lite") { - annotationLibraries.forEach { removeDependency(it) } - removeDependency(/* dependency = */ "com.google.protobuf:protobuf-javalite") - addApiDependency("com.google.protobuf:protobuf-java") - } - module("io.grpc:grpc-services") { annotationLibraries.forEach { removeDependency(it) } } - module("io.grpc:grpc-stub") { annotationLibraries.forEach { removeDependency(it) } } - module("io.grpc:grpc-testing") { annotationLibraries.forEach { removeDependency(it) } } - module("io.grpc:grpc-util") { annotationLibraries.forEach { removeDependency(it) } } - module("com.google.dagger:dagger-compiler") { - annotationLibraries.forEach { removeDependency(it) } - } - module("com.google.dagger:dagger-producers") { - annotationLibraries.forEach { removeDependency(it) } - } - module("com.google.dagger:dagger-spi") { annotationLibraries.forEach { removeDependency(it) } } - module("com.google.guava:guava") { - (annotationLibraries - - "com.google.code.findbugs:jsr305" - - "com.google.errorprone:error_prone_annotations" - - "org.checkerframework:checker-qual") - .forEach { removeDependency(it) } - } - module("com.google.protobuf:protobuf-java-util") { - annotationLibraries.forEach { removeDependency(it) } - } - module("io.prometheus:simpleclient") { - removeDependency("io.prometheus:simpleclient_tracer_otel") - removeDependency("io.prometheus:simpleclient_tracer_otel_agent") - } - module("org.jetbrains.kotlin:kotlin-stdlib") { - removeDependency("org.jetbrains.kotlin:kotlin-stdlib-common") - } - module("junit:junit") { removeDependency("org.hamcrest:hamcrest-core") } - module("org.hyperledger.besu:secp256k1") { addApiDependency("net.java.dev.jna:jna") } -} - -// Fix or enhance the 'module-info.class' of third-party Modules. This is about the -// 'module-info.class' inside the Jar files. In our full Java Modules setup every -// Jar needs to have this file. If it is missing, it is added by what is configured here. -extraJavaModuleInfo { - failOnAutomaticModules = true // Only allow Jars with 'module-info' on all module paths - - module("io.grpc:grpc-api", "io.grpc") { - exportAllPackages() - requireAllDefinedDependencies() - requires("java.logging") - uses("io.grpc.ManagedChannelProvider") - uses("io.grpc.NameResolverProvider") - uses("io.grpc.LoadBalancerProvider") - } - - module("io.grpc:grpc-core", "io.grpc.internal") { - exportAllPackages() - requireAllDefinedDependencies() - requires("java.logging") - } - module("io.grpc:grpc-context", "io.grpc.context") - module("io.grpc:grpc-stub", "io.grpc.stub") { - exportAllPackages() - requireAllDefinedDependencies() - requires("java.logging") - } - module("io.grpc:grpc-testing", "io.grpc.testing") - module("io.grpc:grpc-services", "io.grpc.services") - module("io.grpc:grpc-util", "io.grpc.util") - module("io.grpc:grpc-protobuf", "io.grpc.protobuf") - module("io.grpc:grpc-protobuf-lite", "io.grpc.protobuf.lite") - - module("io.grpc:grpc-netty-shaded", "io.grpc.netty.shaded") { - exportAllPackages() - requireAllDefinedDependencies() - requires("java.logging") - requires("jdk.unsupported") - ignoreServiceProvider("reactor.blockhound.integration.BlockHoundIntegration") - } - - module("com.github.spotbugs:spotbugs-annotations", "com.github.spotbugs.annotations") - module("com.google.code.findbugs:jsr305", "java.annotation") { - exportAllPackages() - mergeJar("javax.annotation:javax.annotation-api") - } - module("com.google.errorprone:error_prone_annotations", "com.google.errorprone.annotations") - module("com.google.j2objc:j2objc-annotations", "com.google.j2objc.annotations") - module("com.google.protobuf:protobuf-java", "com.google.protobuf") { - exportAllPackages() - requireAllDefinedDependencies() - requires("java.logging") - } - module("com.google.guava:guava", "com.google.common") { - exportAllPackages() - requireAllDefinedDependencies() - requires("java.logging") - } - module("com.google.guava:failureaccess", "com.google.common.util.concurrent.internal") - module("com.google.api.grpc:proto-google-common-protos", "com.google.api.grpc.common") - module("com.google.dagger:dagger", "dagger") - module("io.perfmark:perfmark-api", "io.perfmark") - module("javax.inject:javax.inject", "javax.inject") - - module("commons-codec:commons-codec", "org.apache.commons.codec") - module("org.apache.commons:commons-math3", "org.apache.commons.math3") - module("org.apache.commons:commons-collections4", "org.apache.commons.collections4") - module("com.esaulpaugh:headlong", "headlong") - - module("org.checkerframework:checker-qual", "org.checkerframework.checker.qual") - module("net.i2p.crypto:eddsa", "net.i2p.crypto.eddsa") - module("org.jetbrains:annotations", "org.jetbrains.annotations") - module("org.antlr:antlr4-runtime", "org.antlr.antlr4.runtime") - - // needed for metrics and logging, but also several platform classes - module("com.goterl:resource-loader", "resource.loader") - module("com.goterl:lazysodium-java", "lazysodium.java") - module("org.hyperledger.besu:secp256k1", "org.hyperledger.besu.nativelib.secp256k1") - module("net.java.dev.jna:jna", "com.sun.jna") { - exportAllPackages() - requires("java.logging") - } - module("io.prometheus:simpleclient", "io.prometheus.simpleclient") - module("io.prometheus:simpleclient_common", "io.prometheus.simpleclient_common") - module("io.prometheus:simpleclient_httpserver", "io.prometheus.simpleclient.httpserver") { - exportAllPackages() - requireAllDefinedDependencies() - requires("jdk.httpserver") - } - - // Annotation processing only - module("com.google.auto.service:auto-service-annotations", "com.google.auto.service") - module("com.google.auto.service:auto-service", "com.google.auto.service.processor") - module("com.google.auto:auto-common", "com.google.auto.common") - module("com.google.dagger:dagger-compiler", "dagger.compiler") - module("com.google.dagger:dagger-producers", "dagger.producers") - module("com.google.dagger:dagger-spi", "dagger.spi") - module( - "com.google.devtools.ksp:symbol-processing-api", - "com.google.devtools.ksp.symbolprocessingapi" - ) - module("com.google.errorprone:javac-shaded", "com.google.errorprone.javac.shaded") - module("com.google.googlejavaformat:google-java-format", "com.google.googlejavaformat") - module("net.ltgt.gradle.incap:incap", "net.ltgt.gradle.incap") - module("org.jetbrains.kotlinx:kotlinx-metadata-jvm", "kotlinx.metadata.jvm") - - // Test clients only - module("com.github.docker-java:docker-java-api", "com.github.dockerjava.api") - module("com.github.docker-java:docker-java-transport", "com.github.dockerjava.transport") - module( - "com.github.docker-java:docker-java-transport-zerodep", - "com.github.dockerjava.transport.zerodep" - ) - module("io.github.cdimascio:java-dotenv", "io.github.cdimascio") - module("com.google.protobuf:protobuf-java-util", "com.google.protobuf.util") - module("com.squareup:javapoet", "com.squareup.javapoet") { - exportAllPackages() - requires("java.compiler") - } - module("junit:junit", "junit") - module("org.hamcrest:hamcrest", "org.hamcrest") - module("org.json:json", "org.json") - module("org.mockito:mockito-core", "org.mockito") - module("org.objenesis:objenesis", "org.objenesis") - module("org.rnorth.duct-tape:duct-tape", "org.rnorth.ducttape") - module("org.testcontainers:junit-jupiter", "org.testcontainers.junit.jupiter") - module("org.testcontainers:testcontainers", "org.testcontainers") - module("org.mockito:mockito-junit-jupiter", "org.mockito.junit.jupiter") -} - -// Make 'javax.annotation:javax.annotation-api' discoverable for merging it into -// 'com.google.code.findbugs:jsr305' -dependencies { "javaModulesMergeJars"("javax.annotation:javax.annotation-api:1.3.2") } diff --git a/buildSrc/src/main/kotlin/com.hedera.block.maven-publish.gradle.kts b/buildSrc/src/main/kotlin/com.hedera.block.maven-publish.gradle.kts deleted file mode 100644 index 4e6aaabfd..000000000 --- a/buildSrc/src/main/kotlin/com.hedera.block.maven-publish.gradle.kts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - -plugins { - id("java") - id("maven-publish") - id("signing") -} - -publishing { - publications.withType().configureEach { - pom { - packaging = findProperty("maven.project.packaging")?.toString() ?: "jar" - name.set(project.name) - url.set("https://www.hedera.com/") - inceptionYear.set("2024") - - description.set( - "An implementation of a Block Node for the Hedera public distributed ledger." - ) - - organization { - name.set("Hedera Hashgraph, LLC") - url.set("https://www.hedera.com") - } - - licenses { - license { - name.set("Apache 2.0 License") - url.set("https://raw.githubusercontent.com/hashgraph/pbj/main/LICENSE") - } - } - - developers { - developer { - name.set("Jasper Potts") - email.set("jasper.potts@swirldslabs.com") - organization.set("Swirlds Labs, Inc.") - organizationUrl.set("https://www.swirldslabs.com") - } - } - - scm { - connection.set("scm:git:git://github.com/hashgraph/hedera-block-node.git") - developerConnection.set("scm:git:ssh://github.com:hashgraph/hedera-block-node.git") - url.set("https://github.com/hashgraph/hedera-block-node") - } - } - } -} - -signing { useGpgCmd() } - -tasks.withType { - onlyIf { providers.gradleProperty("publishSigningEnabled").getOrElse("false").toBoolean() } -} diff --git a/buildSrc/src/main/kotlin/com.hedera.block.protobuf.gradle.kts b/buildSrc/src/main/kotlin/com.hedera.block.protobuf.gradle.kts deleted file mode 100644 index 359e50c5c..000000000 --- a/buildSrc/src/main/kotlin/com.hedera.block.protobuf.gradle.kts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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 com.google.protobuf.gradle.id -import com.hedera.block.tasks.GitClone - -plugins { - id("java-library") - id("com.hedera.block.conventions") - id("com.google.protobuf") -} - -tasks.register("cloneHederaProtobufs") { - url = "https://github.com/hashgraph/hedera-protobufs.git" - offline = gradle.startParameter.isOffline - localCloneDirectory = layout.buildDirectory.dir("hedera-protobufs") -} - -// Configure Protobuf Plugin to download protoc executable rather than using local installed version -protobuf { - val libs = the().named("libs") - protoc { artifact = "com.google.protobuf:protoc:" + libs.findVersion("google.proto").get() } - plugins { - // Add GRPC plugin as we need to generate GRPC services - id("grpc") { - artifact = - "io.grpc:protoc-gen-grpc-java:" + libs.findVersion("grpc.protobuf.grpc").get() - } - } - generateProtoTasks { all().forEach { it.plugins { id("grpc") } } } -} - -tasks.javadoc { - options { - this as StandardJavadocDocletOptions - // There are violations in the generated protobuf code - addStringOption("Xdoclint:-reference,-html", "-quiet") - } -} - -// Give JUnit more ram and make it execute tests in parallel -tasks.test { - // We are running a lot of tests 10s of thousands, so they need to run in parallel. Make each - // class run in parallel. - systemProperties["junit.jupiter.execution.parallel.enabled"] = true - systemProperties["junit.jupiter.execution.parallel.mode.default"] = "concurrent" - // limit amount of threads, so we do not use all CPU - systemProperties["junit.jupiter.execution.parallel.config.dynamic.factor"] = "0.9" -} diff --git a/buildSrc/src/main/kotlin/com.hedera.block.protos.gradle.kts b/buildSrc/src/main/kotlin/com.hedera.block.protos.gradle.kts deleted file mode 100644 index 291f89918..000000000 --- a/buildSrc/src/main/kotlin/com.hedera.block.protos.gradle.kts +++ /dev/null @@ -1,22 +0,0 @@ -plugins { - id("java") - id("com.google.protobuf") - id("com.hedera.block.conventions") -} - -sourceSets { - main { - proto { - srcDir("src/main/protobuf") - } - } -} - -protobuf { - // Configure the protoc executable - protoc { - // Download from repositories - artifact = "com.google.protobuf:protoc:3.21.10" - } -} - diff --git a/buildSrc/src/main/kotlin/com.hedera.block.repositories.gradle.kts b/buildSrc/src/main/kotlin/com.hedera.block.repositories.gradle.kts deleted file mode 100644 index 6db244ccd..000000000 --- a/buildSrc/src/main/kotlin/com.hedera.block.repositories.gradle.kts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - -repositories { - mavenCentral() - maven { - url = uri("https://hyperledger.jfrog.io/artifactory/besu-maven") - content { includeGroupByRegex("org\\.hyperledger\\..*") } - } -} diff --git a/buildSrc/src/main/kotlin/com.hedera.block.root.gradle.kts b/buildSrc/src/main/kotlin/com.hedera.block.root.gradle.kts deleted file mode 100644 index fbfa2c467..000000000 --- a/buildSrc/src/main/kotlin/com.hedera.block.root.gradle.kts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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 io.github.gradlenexus.publishplugin.CloseNexusStagingRepository - -plugins { - id("com.hedera.block.repositories") - id("com.hedera.block.aggregate-reports") - id("com.hedera.block.spotless-conventions") - id("com.hedera.block.spotless-kotlin-conventions") - id("com.autonomousapps.dependency-analysis") - id("io.github.gradle-nexus.publish-plugin") -} - -group = "com.hedera.block" - -spotless { kotlinGradle { target("buildSrc/**/*.gradle.kts") } } - -nexusPublishing { - repositories { - sonatype { - username = System.getenv("OSSRH_USERNAME") - password = System.getenv("OSSRH_PASSWORD") - } - } -} - -tasks.withType { - // The publishing of all components to Maven Central (in this case only 'pbj-runtime') is - // automatically done before close (which is done before release). - dependsOn(":server:publishToSonatype") -} - -tasks.register("release") { - group = "release" - dependsOn(tasks.closeAndReleaseStagingRepository) -} - -tasks.register("releaseSnapshot") { - group = "release" - dependsOn(":server:publishToSonatype") -} diff --git a/buildSrc/src/main/kotlin/com.hedera.block.server.gradle.kts b/buildSrc/src/main/kotlin/com.hedera.block.server.gradle.kts deleted file mode 100644 index 5bb202c3b..000000000 --- a/buildSrc/src/main/kotlin/com.hedera.block.server.gradle.kts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - -plugins { - id("application") - id("com.hedera.block.conventions") - id("me.champeau.jmh") -} - -val maven = publishing.publications.create("maven") { from(components["java"]) } - -signing.sign(maven) - diff --git a/buildSrc/src/main/kotlin/com.hedera.block.simulator.gradle.kts b/buildSrc/src/main/kotlin/com.hedera.block.simulator.gradle.kts deleted file mode 100644 index f5361b330..000000000 --- a/buildSrc/src/main/kotlin/com.hedera.block.simulator.gradle.kts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - -plugins { - id("application") - id("com.hedera.block.conventions") - id("me.champeau.jmh") -} - -val maven = publishing.publications.create("maven") { from(components["java"]) } - -signing.sign(maven) diff --git a/buildSrc/src/main/kotlin/com.hedera.block.spotless-conventions.gradle.kts b/buildSrc/src/main/kotlin/com.hedera.block.spotless-conventions.gradle.kts deleted file mode 100644 index f83772726..000000000 --- a/buildSrc/src/main/kotlin/com.hedera.block.spotless-conventions.gradle.kts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - -plugins { id("com.diffplug.spotless") } - -spotless { - // Disable strong enforcement during gradle check tasks - isEnforceCheck = false - - // optional: limit format enforcement to just the files changed by this feature branch - ratchetFrom("origin/main") - - format("misc") { - // define the files to apply `misc` to - target("*.gradle", "*.md", ".gitignore") - - // define the steps to apply to those files - trimTrailingWhitespace() - indentWithSpaces() - endWithNewline() - } - - format("actionYaml") { - target(".github/workflows/*.yaml") - - trimTrailingWhitespace() - indentWithSpaces() - endWithNewline() - - licenseHeader( - """ - ## - # Copyright (C) ${'$'}YEAR Hedera Hashgraph, LLC - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. - # You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, software - # distributed under the License is distributed on 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. - ## - """ - .trimIndent(), - "(name|on)" - ) - } -} diff --git a/buildSrc/src/main/kotlin/com.hedera.block.spotless-java-conventions.gradle.kts b/buildSrc/src/main/kotlin/com.hedera.block.spotless-java-conventions.gradle.kts deleted file mode 100644 index 89ce27de3..000000000 --- a/buildSrc/src/main/kotlin/com.hedera.block.spotless-java-conventions.gradle.kts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - -plugins { id("com.diffplug.spotless") } - -spotless { - java { - targetExclude("build/generated/**/*.java", "build/generated/**/*.proto") - // Enables the spotless:on and spotless:off comments - toggleOffOn() - // don't need to set target, it is inferred from java - // apply a specific flavor of palantir-java-format - // and do not format javadoc because the default setup - // is _very_ bad for javadoc. We need to figure out a - // "correct" _separate_ setup for that. - palantirJavaFormat("2.50.0").formatJavadoc(false) - // Fix some left-out items from the palantir plugin - indentWithSpaces(4) - trimTrailingWhitespace() - endWithNewline() - // make sure every file has the following copyright header. - // optionally, Spotless can set copyright years by digging - // through git history (see "license" section below). - // The delimiter override below is required to support some - // of our test classes which are in the default package. - licenseHeader( - """ - /* - * Copyright (C) ${'$'}YEAR Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */${"\n\n"} - """ - .trimIndent(), - "(package|import)" - ) - } -} diff --git a/buildSrc/src/main/kotlin/com.hedera.block.spotless-kotlin-conventions.gradle.kts b/buildSrc/src/main/kotlin/com.hedera.block.spotless-kotlin-conventions.gradle.kts deleted file mode 100644 index 430a8944f..000000000 --- a/buildSrc/src/main/kotlin/com.hedera.block.spotless-kotlin-conventions.gradle.kts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - -plugins { id("com.diffplug.spotless") } - -spotless { - kotlinGradle { - ktfmt().kotlinlangStyle() - - licenseHeader( - """ - /* - * Copyright (C) ${'$'}YEAR Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */${"\n\n"} - """ - .trimIndent(), - "(import|plugins|repositories)", - ) - } -} diff --git a/buildSrc/src/main/kotlin/com.hedera.block.tools.gradle.kts b/buildSrc/src/main/kotlin/com.hedera.block.tools.gradle.kts deleted file mode 100644 index 0779a3619..000000000 --- a/buildSrc/src/main/kotlin/com.hedera.block.tools.gradle.kts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - -plugins { - id("application") - id("com.hedera.block.conventions") - id("me.champeau.jmh") -} diff --git a/buildSrc/src/main/kotlin/com/hedera/block/tasks/GitClone.kt b/buildSrc/src/main/kotlin/com/hedera/block/tasks/GitClone.kt deleted file mode 100644 index d47c11dc6..000000000 --- a/buildSrc/src/main/kotlin/com/hedera/block/tasks/GitClone.kt +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2022-2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - -package com.hedera.block.tasks - -import javax.inject.Inject -import org.gradle.api.DefaultTask -import org.gradle.api.file.DirectoryProperty -import org.gradle.api.provider.Property -import org.gradle.api.tasks.Input -import org.gradle.api.tasks.Optional -import org.gradle.api.tasks.OutputDirectory -import org.gradle.api.tasks.TaskAction -import org.gradle.process.ExecOperations - -abstract class GitClone : DefaultTask() { - - @get:Input abstract val url: Property - - @get:Input @get:Optional abstract val tag: Property - - @get:Input @get:Optional abstract val branch: Property - - @get:Input abstract val offline: Property - - @get:OutputDirectory abstract val localCloneDirectory: DirectoryProperty - - @get:Inject protected abstract val exec: ExecOperations - - init { - // If a 'branch' is configured, the task is never up-to-date as it may change - outputs.upToDateWhen { !branch.isPresent } - } - - @TaskAction - fun cloneOrUpdate() { - if (!tag.isPresent && !branch.isPresent || tag.isPresent && branch.isPresent) { - throw RuntimeException("Define either 'tag' or 'branch'") - } - - val localClone = localCloneDirectory.get() - if (!offline.get()) { - exec.exec { - if (!localClone.dir(".git").asFile.exists()) { - workingDir = localClone.asFile.parentFile - commandLine( - "git", - "clone", - url.get(), - "-q" - ) - } else { - workingDir = localClone.asFile - commandLine("git", "fetch", "-q") - } - } - } - if (tag.isPresent) { - exec.exec { - workingDir = localClone.asFile - commandLine("git", "checkout", tag.get(), "-q") - } - exec.exec { - workingDir = localClone.asFile - commandLine("git", "reset", "--hard", tag.get(), "-q") - } - } else { - exec.exec { - workingDir = localClone.asFile - commandLine("git", "checkout", branch.get(), "-q") - } - exec.exec { - workingDir = localClone.asFile - commandLine("git", "reset", "--hard", "origin/${branch.get()}", "-q") - } - } - } -} diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 59f22acc5..a9785a8ac 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -14,13 +14,14 @@ * limitations under the License. */ -plugins { - id("java-library") - id("com.hedera.block.common") -} +plugins { id("org.hiero.gradle.module.library") } description = "Commons module with logic that could be abstracted and reused." +// Remove the following line to enable all 'javac' lint checks that we have turned on by default +// and then fix the reported issues. +tasks.withType().configureEach { options.compilerArgs.add("-Xlint:-exports") } + testModuleInfo { requiresStatic("com.github.spotbugs.annotations") requires("org.junit.jupiter.api") diff --git a/gradle.properties b/gradle.properties index 5ac5f9e14..4fac13161 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,11 +1,11 @@ -# Version number -version=0.3.0-SNAPSHOT - # Need increased heap for running Gradle itself, or SonarQube will run the JVM out of metaspace -org.gradle.jvmargs=-Xmx2048m +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -# Enable Gradle Caching +# Enable Gradle caching +org.gradle.configuration-cache=true org.gradle.caching=true + +# Enable parallel workers org.gradle.parallel=true # Disable publish signing by default diff --git a/buildSrc/src/main/kotlin/com.hedera.block.suites.gradle.kts b/gradle/aggregation/build.gradle.kts similarity index 69% rename from buildSrc/src/main/kotlin/com.hedera.block.suites.gradle.kts rename to gradle/aggregation/build.gradle.kts index f5361b330..a68ece888 100644 --- a/buildSrc/src/main/kotlin/com.hedera.block.suites.gradle.kts +++ b/gradle/aggregation/build.gradle.kts @@ -15,11 +15,13 @@ */ plugins { - id("application") - id("com.hedera.block.conventions") - id("me.champeau.jmh") + id("org.hiero.gradle.report.code-coverage") + id("org.hiero.gradle.check.spotless") + id("org.hiero.gradle.check.spotless-kotlin") } -val maven = publishing.publications.create("maven") { from(components["java"]) } - -signing.sign(maven) +dependencies { + implementation(project(":server")) + implementation(project(":simulator")) + implementation(project(":suites")) +} diff --git a/gradle/modules.properties b/gradle/modules.properties deleted file mode 100644 index 1aa3f5dd0..000000000 --- a/gradle/modules.properties +++ /dev/null @@ -1,53 +0,0 @@ -com.swirlds.metrics.api=com.swirlds:swirlds-metrics-api -com.swirlds.metrics.impl=com.swirlds:swirlds-metrics-impl -com.swirlds.common=com.swirlds:swirlds-common -com.swirlds.config.impl=com.swirlds:swirlds-config-impl -com.swirlds.config.extensions=com.swirlds:swirlds-config-extensions -com.swirlds.config.processor=com.swirlds:swirlds-config-processor -com.google.auto.service=com.google.auto.service:auto-service-annotations -com.google.auto.service.processor=com.google.auto.service:auto-service -com.google.auto.common=com.google.auto:auto-common -com.github.spotbugs.annotations=com.github.spotbugs:spotbugs-annotations -com.lmax.disruptor=com.lmax:disruptor -io.helidon.webserver=io.helidon.webserver:helidon-webserver - -io.helidon.webserver.testing.junit5=io.helidon.webserver.testing.junit5:helidon-webserver-testing-junit5 -io.helidon.logging=io.helidon.logging:helidon-logging-jul -org.antlr.antlr4.runtime=org.antlr:antlr4-runtime -com.google.common=com.google.guava:guava - -com.hedera.pbj.runtime=com.hedera.pbj:pbj-runtime -com.hedera.pbj.grpc.helidon=com.hedera.pbj:pbj-grpc-helidon -com.hedera.pbj.grpc.helidon.config=com.hedera.pbj:pbj-grpc-helidon-config - -google.proto=com.google.protobuf:protoc -io.grpc=io.grpc:grpc-api -io.grpc.protobuf=io.grpc:grpc-protobuf -io.grpc.stub=io.grpc:grpc-stub -io.grpc.netty.shaded=io.grpc:grpc-netty-shaded - -com.google.protobuf=com.google.protobuf:protobuf-java -com.google.protobuf.util=com.google.protobuf:protobuf-java-util -com.apache.commons.codec=commons-codec:commons-codec -org.apache.commons.collections4=org.apache.commons:commons-collections4 -org.apache.commons.io=commons-io:commons-io -org.apache.commons.lang3=org.apache.commons:commons-lang3 -org.apache.commons.compress=org.apache.commons:commons-compress - -org.testcontainers=org.testcontainers:testcontainers -org.testcontainers.junit-jupiter=org.testcontainers:junit-jupiter -com.github.dockerjava.api=com.github.docker-java:docker-java-api -com.github.docker-java.transport.zerodep=com.github.docker-java:docker-java-transport-zerodep -com.github.docker-java.transport.httpclient5=com.github.docker-java:docker-java-transport-httpclient5 -io.github.cdimascio=io.github.cdimascio:java-dotenv - -java.annotation=javax.annotation:javax.annotation-api -org.apache.logging.log4j.slf4j2.impl=org.apache.logging.log4j:log4j-slf4j2-impl - -dagger=com.google.dagger:dagger -dagger.compiler=com.google.dagger:dagger-compiler -com.squareup.javapoet=com.squareup:javapoet -javax.inject=javax.inject:javax.inject -org.checkerframework.checker.qual=org.checkerframework:checker-qual - -com.github.luben.zstd_jni=com.github.luben:zstd-jni diff --git a/gradle/toolchain-versions.properties b/gradle/toolchain-versions.properties new file mode 100644 index 000000000..04e458fae --- /dev/null +++ b/gradle/toolchain-versions.properties @@ -0,0 +1 @@ +jdk=21.0.4 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e6441136f3d4ba8a0da8d277868979cfbc8ad796..a4b76b9530d66f5e68d973ea569d8e19de379189 100644 GIT binary patch delta 12612 zcmY+pRa6|n(lttO3GVLh?(Xh3xVuAe26uONcL=V5;I6?T_zdn2`Oi5I_gl9gx~lft zRjVKRp?B~8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zI~LgAO7E0qxK(uRTM;IgJ}+z^gD+bi-6I!3x{r9`l~%8TRP%UE0V8E*Sz>Nl1NVG<<7(wDHZ+HcOkQm$O&k+vyx)y)x{Pz!U8hS$*m zByc0h6BUI*BOpuL==P+H|Hx%`>7!W+1H!l9vi&)`V zyn2o9{z=lc+VX*!Vh~SF=)L}Z40XeG>LF6cP^b+R$NxSeUqbK^Q*UTalKzP8X%{9@RSCXm_NhF>{=S2 zi}ezam_^P`S!!-cyEW9y7DBbK93roz@Raccy*v}?mKXScU9E_4g;hBU7}zSofAFda zKYEe?{{I54 diff --git a/gradlew b/gradlew index b740cf133..f5feea6d6 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 +# ############################################################################## # @@ -84,7 +86,8 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +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 diff --git a/gradlew.bat b/gradlew.bat index 7101f8e46..9b42019c7 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 ########################################################################## diff --git a/hiero-dependency-versions/build.gradle.kts b/hiero-dependency-versions/build.gradle.kts new file mode 100644 index 000000000..2a31beb00 --- /dev/null +++ b/hiero-dependency-versions/build.gradle.kts @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on 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. + */ + +plugins { + id("org.hiero.gradle.base.lifecycle") + id("org.hiero.gradle.base.jpms-modules") + id("org.hiero.gradle.check.spotless") + id("org.hiero.gradle.check.spotless-kotlin") +} + +dependencies.constraints { + // Define a constant for the platform SDK version. + // Platform SDK modules are all released together with matching versions. + val daggerVersion = "2.42" + val grpcIoVersion = "1.65.1" + val helidonVersion = "4.1.1" + val pbjVersion = "0.9.11" + val protobufVersion = "4.28.2" + val swirldsVersion = "0.51.5" + + api("com.github.luben:zstd-jni:1.5.6-8") { because("com.github.luben.zstd_jni") } + api("com.github.spotbugs:spotbugs-annotations:4.7.3") { + because("com.github.spotbugs.annotations") + } + api("com.google.auto.service:auto-service-annotations:1.1.1") { + because("com.google.auto.service") + } + api("com.google.guava:guava:33.3.1-jre") { because("com.google.common") } + api("com.google.j2objc:j2objc-annotations:3.0.0") { because("com.google.j2objc.annotations") } + api("com.google.protobuf:protobuf-java-util:$protobufVersion") { + because("com.google.protobuf.util") + } + api("com.google.protobuf:protoc:$protobufVersion") { because("google.proto") } + api("com.hedera.pbj:pbj-grpc-helidon:${pbjVersion}") { because("com.hedera.pbj.grpc.helidon") } + api("com.hedera.pbj:pbj-grpc-helidon-config:${pbjVersion}") { + because("com.hedera.pbj.grpc.helidon.config") + } + api("com.hedera.pbj:pbj-runtime:${pbjVersion}") { because("com.hedera.pbj.runtime") } + api("com.lmax:disruptor:4.0.0") { because("com.lmax.disruptor") } + api("com.swirlds:swirlds-common:$swirldsVersion") { because("com.swirlds.common") } + api("com.swirlds:swirlds-config-impl:$swirldsVersion") { because("com.swirlds.config.impl") } + api("io.helidon.logging:helidon-logging-jul:$helidonVersion") { + because("io.helidon.logging.jul") + } + api("io.helidon.webserver:helidon-webserver-grpc:$helidonVersion") { + because("io.helidon.webserver.grpc") + } + api("io.helidon.webserver:helidon-webserver:$helidonVersion") { + because("io.helidon.webserver") + } + + // gRPC dependencies + api("io.grpc:grpc-api:$grpcIoVersion") { because("io.grpc") } + api("io.grpc:grpc-stub:$grpcIoVersion") { because("io.grpc.stub") } + api("io.grpc:grpc-protobuf:$grpcIoVersion") { because("io.grpc.protobuf") } + api("io.grpc:grpc-netty:$grpcIoVersion") { because("io.grpc.netty") } + api("io.grpc:protoc-gen-grpc-java:1.66.0") + + // command line tool + api("info.picocli:picocli:4.7.6") { because("info.picocli") } + + // needed for dagger + api("com.google.dagger:dagger:$daggerVersion") { because("dagger") } + api("com.google.dagger:dagger-compiler:$daggerVersion") { because("dagger.compiler") } + api("com.squareup:javapoet:1.13.0") { because("com.squareup.javapoet") } + + // Testing only versions + api("com.github.docker-java:docker-java-api:3.4.0") { because("com.github.dockerjava.api") } + api("io.github.cdimascio:dotenv-java:3.0.2") { because("io.github.cdimascio.dotenv.java") } + api("org.assertj:assertj-core:3.23.1") { because("org.assertj.core") } + api("org.junit.jupiter:junit-jupiter-api:5.10.2") { because("org.junit.jupiter.api") } + api("org.mockito:mockito-core:5.8.0") { because("org.mockito") } + api("org.mockito:mockito-junit-jupiter:5.8.0") { because("org.mockito.junit.jupiter") } + api("org.testcontainers:junit-jupiter:1.20.1") { because("org.testcontainers.junit.jupiter") } + api("org.testcontainers:testcontainers:1.20.1") { because("org.testcontainers") } + + api("com.google.auto.service:auto-service:1.1.1") { + because("com.google.auto.service.processor") + } + api("com.google.dagger:dagger-compiler:$daggerVersion") { because("dagger.compiler") } +} diff --git a/server/build.gradle.kts b/server/build.gradle.kts index 25592c617..62002092d 100644 --- a/server/build.gradle.kts +++ b/server/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2024 Hedera Hashgraph, LLC + * Copyright (C) 2024 Hedera Hashgraph, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,17 @@ */ plugins { + id("org.hiero.gradle.module.library") id("application") - id("com.hedera.block.server") } +// Description is added to POM metadata +description = "Hedera Block Node Server" + +// Remove the following line to enable all 'javac' lint checks that we have turned on by default +// and then fix the reported issues. +tasks.withType().configureEach { options.compilerArgs.add("-Xlint:-exports") } + application { mainModule = "com.hedera.block.server" mainClass = "com.hedera.block.server.Server" @@ -29,7 +36,7 @@ mainModuleInfo { annotationProcessor("com.google.auto.service.processor") runtimeOnly("com.swirlds.config.impl") runtimeOnly("org.apache.logging.log4j.slf4j2.impl") - runtimeOnly("io.helidon.logging") + runtimeOnly("io.helidon.logging.jul") runtimeOnly("com.hedera.pbj.grpc.helidon.config") } diff --git a/server/src/main/java/module-info.java b/server/src/main/java/module-info.java index dda0c6d22..447ba5eb6 100644 --- a/server/src/main/java/module-info.java +++ b/server/src/main/java/module-info.java @@ -24,22 +24,23 @@ requires com.hedera.block.common; requires com.hedera.block.stream; - requires com.github.luben.zstd_jni; requires com.hedera.pbj.grpc.helidon.config; requires com.hedera.pbj.grpc.helidon; requires com.hedera.pbj.runtime; - requires com.lmax.disruptor; requires com.swirlds.common; requires com.swirlds.config.api; requires com.swirlds.config.extensions; requires com.swirlds.metrics.api; + requires com.github.luben.zstd_jni; + requires com.lmax.disruptor; requires dagger; requires io.helidon.common; requires io.helidon.config; requires io.helidon.webserver; requires javax.inject; - requires static com.github.spotbugs.annotations; - requires static com.google.auto.service; + requires static transitive com.github.spotbugs.annotations; + requires static transitive com.google.auto.service; + requires static java.compiler; // javax.annotation.processing.Generated provides com.swirlds.config.api.ConfigurationExtension with BlockNodeConfigExtension; diff --git a/settings.gradle.kts b/settings.gradle.kts index 37e1a23fb..56149ac28 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -14,137 +14,13 @@ * limitations under the License. */ -plugins { - id("com.gradle.enterprise").version("3.15.1") -} - -// Include the subprojects -include(":common") -include(":suites") -include(":stream") -include(":server") -include(":simulator") -include(":tools") - -includeBuild(".") // https://github.com/gradle/gradle/issues/21490#issuecomment-1458887481 - -gradleEnterprise { - buildScan { - termsOfServiceUrl = "https://gradle.com/terms-of-service" - termsOfServiceAgree = "yes" - } -} - -dependencyResolutionManagement { - versionCatalogs { - create("libs") { - // Define a constant for the platform SDK version. - // Platform SDK modules are all released together with matching versions. - val swirldsVersion = "0.54.1" - - // Define a constant for the Dagger version. - val daggerVersion = "2.42" - - // Define a constant for protobuf version. - val protobufVersion = "4.28.2" - val helidonVersion = "4.1.1" - val grpcIoVersion = "1.65.1" - var pbjVersion = "0.9.11" - - // Compile time dependencies - version("io.helidon.webserver.http2", helidonVersion) - version("io.helidon.webserver", helidonVersion) - version("io.helidon.logging", helidonVersion) - - version("com.lmax.disruptor", "4.0.0") - version("com.github.spotbugs.annotations", "4.7.3") - version("com.swirlds.metrics.api", swirldsVersion) - version("com.swirlds.metrics.impl", swirldsVersion) - version("com.swirlds.common", swirldsVersion) - version("com.swirlds.config.impl", swirldsVersion) - version("com.swirlds.config.processor", swirldsVersion) - version("com.swirlds.config.extensions", swirldsVersion) - version("com.google.auto.service.processor", "1.1.1") - version("com.google.auto.service", "1.1.1") - version("org.hyperledger.besu.nativelib.secp256k1", "0.8.2") - version("info.picocli", "4.7.6") - - // gRPC dependencies for the stream subproject - version("io.grpc", grpcIoVersion) - version("io.grpc.protobuf", grpcIoVersion) - version("io.grpc.stub", grpcIoVersion) - - // netty dependency for the simulator subproject - version("io.grpc.netty.shaded", grpcIoVersion) - - // Reference from the protobuf plugin - version("google.proto", protobufVersion) - version("grpc.protobuf.grpc", grpcIoVersion) - - // Google protobuf dependencies - version("com.google.protobuf", protobufVersion) - version("com.google.protobuf.util", protobufVersion) - - - // PBJ dependencies - plugin("pbj", "com.hedera.pbj.pbj-compiler").version(pbjVersion) - version("com.hedera.pbj.runtime", pbjVersion) - version("com.hedera.pbj.grpc.helidon", pbjVersion) - version("com.hedera.pbj.grpc.helidon.config", pbjVersion) - version("org.antlr.antlr4.runtime", "4.13.1") - - version("java.annotation", "1.3.2") - version("javax.inject", "1") - version("com.google.common", "33.0.0-jre") - - version("org.apache.commons.codec", "1.15") - version("org.apache.commons.collections4", "4.4") - version("org.apache.commons.io", "2.15.1") - version("org.apache.commons.lang3", "3.14.0") - version("org.apache.commons.compress", "1.26.0") - version("org.apache.logging.log4j.slf4j2.impl", "2.21.1") - version("com.github.luben.zstd_jni","1.5.6-8") - - // needed for dagger - version("dagger", daggerVersion) - version("dagger.compiler", daggerVersion) - version("com.squareup.javapoet", "1.13.0") - - // Testing only versions - version("org.assertj.core", "3.23.1") - version("org.junit.jupiter.api", "5.10.2") - version("org.junit.platform", "1.11.0") - version("org.mockito", "5.8.0") - version("org.mockito.junit.jupiter", "5.8.0") - version("org.testcontainers", "1.20.1") - version("org.testcontainers.junit-jupiter", "1.20.1") - version("com.github.docker-java", "3.4.0") - version("io.github.cdimascio", "5.2.2") - } - } -} - - -// Build cache configuration -val isCiServer = System.getenv().containsKey("CI") -val gradleCacheUsername: String? = System.getenv("GRADLE_CACHE_USERNAME") -val gradleCachePassword: String? = System.getenv("GRADLE_CACHE_PASSWORD") -val gradleCacheAuthorized = - (gradleCacheUsername?.isNotEmpty() ?: false) && (gradleCachePassword?.isNotEmpty() ?: false) - -buildCache { - remote { - url = uri("https://cache.gradle.hedera.svcs.eng.swirldslabs.io/cache/") - isPush = isCiServer && gradleCacheAuthorized +plugins { id("org.hiero.gradle.build") version "0.1.2" } - isUseExpectContinue = true - isEnabled = !gradle.startParameter.isOffline +rootProject.name = "hedera-block-node" - if (isCiServer && gradleCacheAuthorized) { - credentials { - username = gradleCacheUsername - password = gradleCachePassword - } - } +javaModules { + directory(".") { + group = "com.hedera.block" + module("suites") // no 'module-info' yet } } diff --git a/simulator/build.gradle.kts b/simulator/build.gradle.kts index 040b539b4..0245955cf 100644 --- a/simulator/build.gradle.kts +++ b/simulator/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2024 Hedera Hashgraph, LLC + * Copyright (C) 2024 Hedera Hashgraph, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,13 +16,17 @@ plugins { id("application") - id("com.hedera.block.simulator") + id("org.hiero.gradle.module.library") } // dependencies { implementation(project(":common")) } description = "Hedera Block Stream Simulator" +// Remove the following line to enable all 'javac' lint checks that we have turned on by default +// and then fix the reported issues. +tasks.withType().configureEach { options.compilerArgs.add("-Xlint:-exports") } + application { mainModule = "com.hedera.block.simulator" mainClass = "com.hedera.block.simulator.BlockStreamSimulator" @@ -33,7 +37,7 @@ mainModuleInfo { annotationProcessor("com.google.auto.service.processor") runtimeOnly("com.swirlds.config.impl") runtimeOnly("org.apache.logging.log4j.slf4j2.impl") - runtimeOnly("io.grpc.netty.shaded") + runtimeOnly("io.grpc.netty") } testModuleInfo { diff --git a/simulator/src/main/java/module-info.java b/simulator/src/main/java/module-info.java index 2da924ff8..c420caccc 100644 --- a/simulator/src/main/java/module-info.java +++ b/simulator/src/main/java/module-info.java @@ -12,8 +12,6 @@ exports com.hedera.block.simulator.metrics; exports com.hedera.block.simulator.grpc.impl; - requires static com.github.spotbugs.annotations; - requires static com.google.auto.service; requires com.hedera.block.common; requires com.hedera.block.stream; requires com.hedera.pbj.runtime; @@ -26,6 +24,9 @@ requires io.grpc; requires java.logging; requires javax.inject; + requires static transitive com.github.spotbugs.annotations; + requires static transitive com.google.auto.service; + requires static java.compiler; // javax.annotation.processing.Generated provides com.swirlds.config.api.ConfigurationExtension with SimulatorConfigExtension; diff --git a/stream/build.gradle.kts b/stream/build.gradle.kts index 64f5f971c..dd8dd8fe7 100644 --- a/stream/build.gradle.kts +++ b/stream/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2024 Hedera Hashgraph, LLC + * Copyright (C) 2024 Hedera Hashgraph, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,14 @@ * limitations under the License. */ +import org.hiero.gradle.tasks.GitClone + plugins { - id("com.hedera.block.protobuf") - alias(libs.plugins.pbj) + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.protobuf") + id("com.hedera.pbj.pbj-compiler") version "0.9.2" } -group = "com.hedera.block" - description = "Hedera API" // Remove the following line to enable all 'javac' lint checks that we have turned on by default @@ -30,28 +31,32 @@ tasks.withType().configureEach { } // Add downloaded HAPI repo protobuf files into build directory and add to sources to build them -tasks.cloneHederaProtobufs { - // uncomment below to use a specific tag - // tag = "v0.53.0" or a specific commit like "0047255" - tag = "1033f10" +val cloneHederaProtobufs = + tasks.register("cloneHederaProtobufs") { + url = "https://github.com/hashgraph/hedera-protobufs.git" + localCloneDirectory = layout.buildDirectory.dir("hedera-protobufs") - // uncomment below to use a specific branch - // branch = "main" -} + // uncomment below to use a specific tag + // tag = "v0.53.0" or a specific commit like "0047255" + tag = "1033f10" + + // uncomment below to use a specific branch + // branch = "main" + } sourceSets { main { pbj { - srcDir(tasks.cloneHederaProtobufs.flatMap { it.localCloneDirectory.dir("services") }) - srcDir(tasks.cloneHederaProtobufs.flatMap { it.localCloneDirectory.dir("block") }) - srcDir(tasks.cloneHederaProtobufs.flatMap { it.localCloneDirectory.dir("platform") }) - srcDir(tasks.cloneHederaProtobufs.flatMap { it.localCloneDirectory.dir("streams") }) + srcDir(cloneHederaProtobufs.flatMap { it.localCloneDirectory.dir("services") }) + srcDir(cloneHederaProtobufs.flatMap { it.localCloneDirectory.dir("block") }) + srcDir(cloneHederaProtobufs.flatMap { it.localCloneDirectory.dir("platform") }) + srcDir(cloneHederaProtobufs.flatMap { it.localCloneDirectory.dir("streams") }) } proto { - srcDir(tasks.cloneHederaProtobufs.flatMap { it.localCloneDirectory.dir("services") }) - srcDir(tasks.cloneHederaProtobufs.flatMap { it.localCloneDirectory.dir("block") }) - srcDir(tasks.cloneHederaProtobufs.flatMap { it.localCloneDirectory.dir("platform") }) - srcDir(tasks.cloneHederaProtobufs.flatMap { it.localCloneDirectory.dir("streams") }) + srcDir(cloneHederaProtobufs.flatMap { it.localCloneDirectory.dir("services") }) + srcDir(cloneHederaProtobufs.flatMap { it.localCloneDirectory.dir("block") }) + srcDir(cloneHederaProtobufs.flatMap { it.localCloneDirectory.dir("platform") }) + srcDir(cloneHederaProtobufs.flatMap { it.localCloneDirectory.dir("streams") }) } } } diff --git a/stream/src/main/java/module-info.java b/stream/src/main/java/module-info.java index 403a6aa44..32b1a00cd 100644 --- a/stream/src/main/java/module-info.java +++ b/stream/src/main/java/module-info.java @@ -1,6 +1,6 @@ module com.hedera.block.stream { exports com.hedera.hapi.block; - exports com.hedera.hapi.block.protoc; + exports com.hedera.hapi.block.protoc; // TODO move to test fixtures exports com.hedera.hapi.block.stream.protoc; exports com.hedera.hapi.block.stream.input.protoc; exports com.hedera.hapi.block.stream.output.protoc; @@ -70,9 +70,9 @@ exports com.hedera.hapi.platform.state.legacy to com.google.protobuf; + requires transitive com.hedera.pbj.runtime; requires transitive com.google.common; requires transitive com.google.protobuf; - requires transitive com.hedera.pbj.runtime; requires transitive io.grpc.stub; requires transitive io.grpc; requires io.grpc.protobuf; diff --git a/suites/build.gradle.kts b/suites/build.gradle.kts index 85af453d4..aea88ecc1 100644 --- a/suites/build.gradle.kts +++ b/suites/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2024 Hedera Hashgraph, LLC + * Copyright (C) 2024 Hedera Hashgraph, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,27 +16,42 @@ plugins { id("application") - id("com.hedera.block.suites") + id("org.hiero.gradle.module.library") } description = "Hedera Block Node E2E Suites" -dependencies { implementation(project(":simulator")) } - application { mainModule = "com.hedera.block.suites" mainClass = "com.hedera.block.suites.BaseSuite" } mainModuleInfo { - runtimeOnly("org.testcontainers.junit-jupiter") + runtimeOnly("org.testcontainers.junit.jupiter") runtimeOnly("org.junit.jupiter.engine") runtimeOnly("org.testcontainers") runtimeOnly("com.swirlds.config.impl") } -// workaround until https://github.com/hashgraph/hedera-block-node/pull/216 is integrated -dependencies.constraints { implementation("org.slf4j:slf4j-api:2.0.6") } +val updateDockerEnv = + tasks.register("updateDockerEnv") { + description = + "Creates the .env file in the docker folder that contains environment variables for Docker" + group = "docker" + + workingDir(layout.projectDirectory.dir("../server/docker")) + commandLine("sh", "-c", "./update-env.sh ${project.version} false false") + } + +// Task to build the Docker image +tasks.register("createDockerImage") { + description = "Creates the Docker image of the Block Node Server based on the current version" + group = "docker" + + dependsOn(updateDockerEnv, tasks.assemble) + workingDir(layout.projectDirectory.dir("../server/docker")) + commandLine("./docker-build.sh", project.version, layout.projectDirectory.dir("..").asFile) +} tasks.register("runSuites") { description = "Runs E2E Test Suites" diff --git a/suites/src/main/java/module-info.java b/suites/src/main/java/module-info.java index 513183446..79b515a85 100644 --- a/suites/src/main/java/module-info.java +++ b/suites/src/main/java/module-info.java @@ -1,14 +1,14 @@ /** Runtime module of the suites. */ module com.hedera.block.node.suites { + // Require testing libraries requires com.hedera.block.simulator; requires com.swirlds.config.api; requires com.swirlds.config.extensions; - - // Require testing libraries - requires io.github.cdimascio; + requires io.github.cdimascio.dotenv.java; requires org.junit.jupiter.api; requires org.junit.platform.suite.api; requires org.testcontainers; + requires static dagger; exports com.hedera.block.suites to org.junit.platform.commons; diff --git a/tools/build.gradle.kts b/tools/build.gradle.kts index 26a09c31b..08cc43e40 100644 --- a/tools/build.gradle.kts +++ b/tools/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2024 Hedera Hashgraph, LLC + * Copyright (C) 2024 Hedera Hashgraph, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ plugins { id("application") - id("com.hedera.block.tools") + id("org.hiero.gradle.module.library") } description = "Hedera Block Stream Tools" @@ -29,7 +29,7 @@ application { mainModuleInfo { runtimeOnly("com.swirlds.config.impl") runtimeOnly("org.apache.logging.log4j.slf4j2.impl") - runtimeOnly("io.grpc.netty.shaded") + runtimeOnly("io.grpc.netty") } testModuleInfo { requiresStatic("com.github.spotbugs.annotations") } diff --git a/version.txt b/version.txt new file mode 100644 index 000000000..daf2bb73d --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +0.3.0-SNAPSHOT From f38f4bcab9ae98f0c9c223fdda6152c046f82bd4 Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Thu, 9 Jan 2025 07:49:56 +0100 Subject: [PATCH 02/15] build: align versions with 'main' Signed-off-by: Jendrik Johannes --- hiero-dependency-versions/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hiero-dependency-versions/build.gradle.kts b/hiero-dependency-versions/build.gradle.kts index 2a31beb00..23f9b1628 100644 --- a/hiero-dependency-versions/build.gradle.kts +++ b/hiero-dependency-versions/build.gradle.kts @@ -26,8 +26,8 @@ dependencies.constraints { // Platform SDK modules are all released together with matching versions. val daggerVersion = "2.42" val grpcIoVersion = "1.65.1" - val helidonVersion = "4.1.1" - val pbjVersion = "0.9.11" + val helidonVersion = "4.1.6" + val pbjVersion = "0.9.12" val protobufVersion = "4.28.2" val swirldsVersion = "0.51.5" From 2523960dc0fca58293f4833056ae030521c5b27d Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Thu, 9 Jan 2025 07:53:22 +0100 Subject: [PATCH 03/15] chore: license Signed-off-by: Jendrik Johannes --- .github/workflows/pr-checks.yaml | 17 +---------------- common/build.gradle.kts | 17 +---------------- gradle/aggregation/build.gradle.kts | 17 +---------------- hiero-dependency-versions/build.gradle.kts | 17 +---------------- server/build.gradle.kts | 17 +---------------- settings.gradle.kts | 17 +---------------- simulator/build.gradle.kts | 17 +---------------- stream/build.gradle.kts | 19 ++----------------- suites/build.gradle.kts | 17 +---------------- 9 files changed, 10 insertions(+), 145 deletions(-) diff --git a/.github/workflows/pr-checks.yaml b/.github/workflows/pr-checks.yaml index 716804869..49c75b2c5 100644 --- a/.github/workflows/pr-checks.yaml +++ b/.github/workflows/pr-checks.yaml @@ -1,19 +1,4 @@ -## -# Copyright (C) 2024 Hedera Hashgraph, LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on 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. -## - +# SPDX-License-Identifier: Apache-2.0 name: "PR Gradle Checks" on: push: diff --git a/common/build.gradle.kts b/common/build.gradle.kts index a9785a8ac..36fdbefbe 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -1,19 +1,4 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - +// SPDX-License-Identifier: Apache-2.0 plugins { id("org.hiero.gradle.module.library") } description = "Commons module with logic that could be abstracted and reused." diff --git a/gradle/aggregation/build.gradle.kts b/gradle/aggregation/build.gradle.kts index a68ece888..6bef5493e 100644 --- a/gradle/aggregation/build.gradle.kts +++ b/gradle/aggregation/build.gradle.kts @@ -1,19 +1,4 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - +// SPDX-License-Identifier: Apache-2.0 plugins { id("org.hiero.gradle.report.code-coverage") id("org.hiero.gradle.check.spotless") diff --git a/hiero-dependency-versions/build.gradle.kts b/hiero-dependency-versions/build.gradle.kts index 23f9b1628..a6ae9593b 100644 --- a/hiero-dependency-versions/build.gradle.kts +++ b/hiero-dependency-versions/build.gradle.kts @@ -1,19 +1,4 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - +// SPDX-License-Identifier: Apache-2.0 plugins { id("org.hiero.gradle.base.lifecycle") id("org.hiero.gradle.base.jpms-modules") diff --git a/server/build.gradle.kts b/server/build.gradle.kts index 62002092d..9c6da3e8f 100644 --- a/server/build.gradle.kts +++ b/server/build.gradle.kts @@ -1,19 +1,4 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - +// SPDX-License-Identifier: Apache-2.0 plugins { id("org.hiero.gradle.module.library") id("application") diff --git a/settings.gradle.kts b/settings.gradle.kts index 56149ac28..53b7e0827 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,19 +1,4 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - +// SPDX-License-Identifier: Apache-2.0 plugins { id("org.hiero.gradle.build") version "0.1.2" } rootProject.name = "hedera-block-node" diff --git a/simulator/build.gradle.kts b/simulator/build.gradle.kts index 9136aaf07..10dc60d10 100644 --- a/simulator/build.gradle.kts +++ b/simulator/build.gradle.kts @@ -1,19 +1,4 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - +// SPDX-License-Identifier: Apache-2.0 plugins { id("application") id("org.hiero.gradle.module.library") diff --git a/stream/build.gradle.kts b/stream/build.gradle.kts index da91563ca..4ab6d84f6 100644 --- a/stream/build.gradle.kts +++ b/stream/build.gradle.kts @@ -1,19 +1,4 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - +// SPDX-License-Identifier: Apache-2.0 import org.hiero.gradle.tasks.GitClone plugins { @@ -27,7 +12,7 @@ description = "Hedera API" // Remove the following line to enable all 'javac' lint checks that we have turned on by default // and then fix the reported issues. tasks.withType().configureEach { - options.compilerArgs.add("-Xlint:-exports,-deprecation,-removal") + options.compilerArgs.add("-Xlint:-exports,-deprecation,-removal,-dep-ann") } // Add downloaded HAPI repo protobuf files into build directory and add to sources to build them diff --git a/suites/build.gradle.kts b/suites/build.gradle.kts index aea88ecc1..7b78845ba 100644 --- a/suites/build.gradle.kts +++ b/suites/build.gradle.kts @@ -1,19 +1,4 @@ -/* - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on 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. - */ - +// SPDX-License-Identifier: Apache-2.0 plugins { id("application") id("org.hiero.gradle.module.library") From ef12288b76e45c8e1fcd22fd26e8f85141e70b0f Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Thu, 9 Jan 2025 08:10:20 +0100 Subject: [PATCH 04/15] build: re-add 'tools' project Signed-off-by: Jendrik Johannes --- gradle/aggregation/build.gradle.kts | 1 + hiero-dependency-versions/build.gradle.kts | 3 +++ settings.gradle.kts | 4 ++-- tools/build.gradle.kts | 1 - 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gradle/aggregation/build.gradle.kts b/gradle/aggregation/build.gradle.kts index 6bef5493e..d54858360 100644 --- a/gradle/aggregation/build.gradle.kts +++ b/gradle/aggregation/build.gradle.kts @@ -9,4 +9,5 @@ dependencies { implementation(project(":server")) implementation(project(":simulator")) implementation(project(":suites")) + implementation(project(":tools")) } diff --git a/hiero-dependency-versions/build.gradle.kts b/hiero-dependency-versions/build.gradle.kts index a6ae9593b..fbfbd89c9 100644 --- a/hiero-dependency-versions/build.gradle.kts +++ b/hiero-dependency-versions/build.gradle.kts @@ -6,6 +6,8 @@ plugins { id("org.hiero.gradle.check.spotless-kotlin") } +dependencies { api(platform("com.google.cloud:libraries-bom:26.49.0")) } + dependencies.constraints { // Define a constant for the platform SDK version. // Platform SDK modules are all released together with matching versions. @@ -46,6 +48,7 @@ dependencies.constraints { api("io.helidon.webserver:helidon-webserver:$helidonVersion") { because("io.helidon.webserver") } + api("org.jetbrains:annotations:26.0.1") { because("org.jetbrains.annotations") } // gRPC dependencies api("io.grpc:grpc-api:$grpcIoVersion") { because("io.grpc") } diff --git a/settings.gradle.kts b/settings.gradle.kts index 53b7e0827..fcfc2e325 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -plugins { id("org.hiero.gradle.build") version "0.1.2" } +plugins { id("org.hiero.gradle.build") version "0.2.0" } rootProject.name = "hedera-block-node" javaModules { directory(".") { group = "com.hedera.block" - module("suites") // no 'module-info' yet + module("tools") // no 'module-info' yet } } diff --git a/tools/build.gradle.kts b/tools/build.gradle.kts index 42f7b9dcc..4d4b16652 100644 --- a/tools/build.gradle.kts +++ b/tools/build.gradle.kts @@ -42,7 +42,6 @@ mainModuleInfo { testModuleInfo { requiresStatic("com.github.spotbugs.annotations") } dependencies { - implementation(platform("com.google.cloud:libraries-bom:26.49.0")) implementation("com.google.cloud:google-cloud-storage") implementation("com.github.luben:zstd-jni:1.5.6-6") implementation("info.picocli:picocli:4.7.6") From 9ca7fcc511d998b4433392003768730950eb7116 Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Thu, 9 Jan 2025 08:14:03 +0100 Subject: [PATCH 05/15] build: use dependency notation baed on Module Names Signed-off-by: Jendrik Johannes --- tools/build.gradle.kts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tools/build.gradle.kts b/tools/build.gradle.kts index 4d4b16652..0aa00ba7b 100644 --- a/tools/build.gradle.kts +++ b/tools/build.gradle.kts @@ -34,6 +34,10 @@ extraJavaModuleInfo { tasks.withType().configureEach { enabled = false } mainModuleInfo { + // depend on peer streams gradle module to get access to protobuf generated classes + requires("com.hedera.block.stream") + requires("com.github.luben.zstd_jni") + requires("info.picocli") runtimeOnly("com.swirlds.config.impl") runtimeOnly("org.apache.logging.log4j.slf4j2.impl") runtimeOnly("io.grpc.netty") @@ -41,13 +45,7 @@ mainModuleInfo { testModuleInfo { requiresStatic("com.github.spotbugs.annotations") } -dependencies { - implementation("com.google.cloud:google-cloud-storage") - implementation("com.github.luben:zstd-jni:1.5.6-6") - implementation("info.picocli:picocli:4.7.6") - // depend on peer streams gradle module to get access to protobuf generated classes - implementation(project(":stream")) -} +dependencies { implementation("com.google.cloud:google-cloud-storage") } tasks.withType().configureEach { group = "shadow" From 3d4e42636dd724052dd5ece4d0266c9fb962258c Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Thu, 9 Jan 2025 08:24:36 +0100 Subject: [PATCH 06/15] build: update Gradle Signed-off-by: Jendrik Johannes --- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e2847c820..cea7a793a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index f5feea6d6..f3b75f3b0 100755 --- a/gradlew +++ b/gradlew @@ -86,8 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # 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 +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum From 33eebf8f3b12d3648648b468b56418a4993577c4 Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Thu, 9 Jan 2025 08:46:29 +0100 Subject: [PATCH 07/15] build: re-activate dependency scope check in 'tools' Signed-off-by: Jendrik Johannes --- gradle/modules.properties | 1 + tools/build.gradle.kts | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 gradle/modules.properties diff --git a/gradle/modules.properties b/gradle/modules.properties new file mode 100644 index 000000000..5d669b4b5 --- /dev/null +++ b/gradle/modules.properties @@ -0,0 +1 @@ +com.google.auth.oauth2=com.google.auth:google-auth-library-oauth2-http \ No newline at end of file diff --git a/tools/build.gradle.kts b/tools/build.gradle.kts index 0aa00ba7b..c0d20b598 100644 --- a/tools/build.gradle.kts +++ b/tools/build.gradle.kts @@ -1,7 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 import com.github.jengelman.gradle.plugins.shadow.internal.DefaultDependencyFilter import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar -import org.gradlex.javamodule.dependencies.tasks.ModuleDirectivesScopeCheck plugins { id("application") @@ -30,13 +29,13 @@ extraJavaModuleInfo { failOnAutomaticModules = false } -// Disable module directives scope check as we are not using modules -tasks.withType().configureEach { enabled = false } - mainModuleInfo { // depend on peer streams gradle module to get access to protobuf generated classes requires("com.hedera.block.stream") + requires("com.hedera.pbj.runtime") requires("com.github.luben.zstd_jni") + requires("com.google.auth.oauth2") + requires("com.google.gson") requires("info.picocli") runtimeOnly("com.swirlds.config.impl") runtimeOnly("org.apache.logging.log4j.slf4j2.impl") @@ -45,7 +44,11 @@ mainModuleInfo { testModuleInfo { requiresStatic("com.github.spotbugs.annotations") } -dependencies { implementation("com.google.cloud:google-cloud-storage") } +dependencies { + implementation("com.google.api:gax") + implementation("com.google.cloud:google-cloud-core") + implementation("com.google.cloud:google-cloud-storage") +} tasks.withType().configureEach { group = "shadow" From 5f390f3161182bc7e5ff8e13debac8393efbab39 Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Thu, 9 Jan 2025 09:02:59 +0100 Subject: [PATCH 08/15] build: streamline tools/build.gradle.kts Signed-off-by: Jendrik Johannes --- tools/build.gradle.kts | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/tools/build.gradle.kts b/tools/build.gradle.kts index c0d20b598..e57956d7f 100644 --- a/tools/build.gradle.kts +++ b/tools/build.gradle.kts @@ -1,10 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 import com.github.jengelman.gradle.plugins.shadow.internal.DefaultDependencyFilter -import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { - id("application") - id("org.hiero.gradle.module.library") + id("org.hiero.gradle.module.application") id("com.gradleup.shadow") version "8.3.5" } @@ -12,17 +10,6 @@ description = "Hedera Block Stream Tools" application { mainClass = "com.hedera.block.tools.BlockStreamTool" } -// Generate Manifest with Main-Class and Implementation-Title -tasks.withType().configureEach { - manifest { - attributes( - "Main-Class" to application.mainClass.get(), - "Implementation-Title" to project.name, - "Implementation-Version" to project.version - ) - } -} - // Allow non-module Jar extraJavaModuleInfo { failOnMissingModuleInfo = false @@ -50,8 +37,16 @@ dependencies { implementation("com.google.cloud:google-cloud-storage") } -tasks.withType().configureEach { - group = "shadow" +// == Shadow plugin configuration == +tasks.shadowJar { + // Generate Manifest with Main-Class and Implementation-Title + manifest { + attributes( + "Main-Class" to application.mainClass, + "Implementation-Title" to project.name, + "Implementation-Version" to project.version + ) + } // There is an issue in the shadow plugin that it automatically accesses the // files in 'runtimeClasspath' while Gradle is building the task graph. @@ -59,7 +54,6 @@ tasks.withType().configureEach { dependencyFilter = NoResolveDependencyFilter() } -// Disable dependency resolution as it conflicts with shadow plugin class NoResolveDependencyFilter : DefaultDependencyFilter(project) { override fun resolve(configuration: FileCollection): FileCollection { return configuration From 73ab847a73aa1ae73313cb3d5bc215a28c7903cc Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Thu, 9 Jan 2025 09:11:26 +0100 Subject: [PATCH 09/15] build: consistently use Module Name dependency notation Signed-off-by: Jendrik Johannes --- gradle/modules.properties | 6 +++++- tools/build.gradle.kts | 14 +++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gradle/modules.properties b/gradle/modules.properties index 5d669b4b5..aa35f5e98 100644 --- a/gradle/modules.properties +++ b/gradle/modules.properties @@ -1 +1,5 @@ -com.google.auth.oauth2=com.google.auth:google-auth-library-oauth2-http \ No newline at end of file +# Jars that are not yet modules used in the 'tools' project +com.google.api.gax=com.google.api:gax +com.google.auth.oauth2=com.google.auth:google-auth-library-oauth2-http +com.google.cloud.core=com.google.cloud:google-cloud-core +com.google.cloud.storage=com.google.cloud:google-cloud-storage diff --git a/tools/build.gradle.kts b/tools/build.gradle.kts index e57956d7f..bfa5d3294 100644 --- a/tools/build.gradle.kts +++ b/tools/build.gradle.kts @@ -10,18 +10,20 @@ description = "Hedera Block Stream Tools" application { mainClass = "com.hedera.block.tools.BlockStreamTool" } -// Allow non-module Jar +// Allow non-module Jars extraJavaModuleInfo { failOnMissingModuleInfo = false failOnAutomaticModules = false } mainModuleInfo { - // depend on peer streams gradle module to get access to protobuf generated classes - requires("com.hedera.block.stream") + requires("com.hedera.block.stream") // use streams module to access protobuf generated classes requires("com.hedera.pbj.runtime") requires("com.github.luben.zstd_jni") + requires("com.google.api.gax") requires("com.google.auth.oauth2") + requires("com.google.cloud.core") + requires("com.google.cloud.storage") requires("com.google.gson") requires("info.picocli") runtimeOnly("com.swirlds.config.impl") @@ -31,12 +33,6 @@ mainModuleInfo { testModuleInfo { requiresStatic("com.github.spotbugs.annotations") } -dependencies { - implementation("com.google.api:gax") - implementation("com.google.cloud:google-cloud-core") - implementation("com.google.cloud:google-cloud-storage") -} - // == Shadow plugin configuration == tasks.shadowJar { // Generate Manifest with Main-Class and Implementation-Title From 8845b23a59893dcffae9c176d336e9797a127367 Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Thu, 9 Jan 2025 09:15:06 +0100 Subject: [PATCH 10/15] chore: revert unnecessary changes to comments Signed-off-by: Jendrik Johannes --- gradle.properties | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 4fac13161..3f98426ab 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,11 +1,9 @@ # Need increased heap for running Gradle itself, or SonarQube will run the JVM out of metaspace org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -# Enable Gradle caching +# Enable Gradle Caching org.gradle.configuration-cache=true org.gradle.caching=true - -# Enable parallel workers org.gradle.parallel=true # Disable publish signing by default From 43f45958c6fd243888c09596ae52676dd46f74ff Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Thu, 9 Jan 2025 09:16:34 +0100 Subject: [PATCH 11/15] chore: remove confusing comment Signed-off-by: Jendrik Johannes --- hiero-dependency-versions/build.gradle.kts | 2 -- 1 file changed, 2 deletions(-) diff --git a/hiero-dependency-versions/build.gradle.kts b/hiero-dependency-versions/build.gradle.kts index fbfbd89c9..11ba01762 100644 --- a/hiero-dependency-versions/build.gradle.kts +++ b/hiero-dependency-versions/build.gradle.kts @@ -9,8 +9,6 @@ plugins { dependencies { api(platform("com.google.cloud:libraries-bom:26.49.0")) } dependencies.constraints { - // Define a constant for the platform SDK version. - // Platform SDK modules are all released together with matching versions. val daggerVersion = "2.42" val grpcIoVersion = "1.65.1" val helidonVersion = "4.1.6" From b0a54eef4977cc1cf6248c04a856e66a9712c9b1 Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Thu, 9 Jan 2025 09:32:40 +0100 Subject: [PATCH 12/15] build: consistent plugin declartions Signed-off-by: Jendrik Johannes --- simulator/build.gradle.kts | 2 +- suites/build.gradle.kts | 2 +- tools/build.gradle.kts | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/simulator/build.gradle.kts b/simulator/build.gradle.kts index 10dc60d10..716beefbe 100644 --- a/simulator/build.gradle.kts +++ b/simulator/build.gradle.kts @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 plugins { - id("application") id("org.hiero.gradle.module.library") + id("application") } // dependencies { implementation(project(":common")) } diff --git a/suites/build.gradle.kts b/suites/build.gradle.kts index 7b78845ba..20c5285fd 100644 --- a/suites/build.gradle.kts +++ b/suites/build.gradle.kts @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 plugins { - id("application") id("org.hiero.gradle.module.library") + id("application") } description = "Hedera Block Node E2E Suites" diff --git a/tools/build.gradle.kts b/tools/build.gradle.kts index bfa5d3294..f64c372a4 100644 --- a/tools/build.gradle.kts +++ b/tools/build.gradle.kts @@ -2,7 +2,8 @@ import com.github.jengelman.gradle.plugins.shadow.internal.DefaultDependencyFilter plugins { - id("org.hiero.gradle.module.application") + id("org.hiero.gradle.module.library") + id("application") id("com.gradleup.shadow") version "8.3.5" } From c62dabfdebc87766fca4bb985c36ab17006833f4 Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Thu, 9 Jan 2025 09:35:59 +0100 Subject: [PATCH 13/15] chore: remove superfluous comments Signed-off-by: Jendrik Johannes --- server/build.gradle.kts | 1 - simulator/build.gradle.kts | 2 -- stream/src/main/java/module-info.java | 2 +- suites/src/main/java/module-info.java | 1 - 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/server/build.gradle.kts b/server/build.gradle.kts index 9c6da3e8f..0ea9210a4 100644 --- a/server/build.gradle.kts +++ b/server/build.gradle.kts @@ -4,7 +4,6 @@ plugins { id("application") } -// Description is added to POM metadata description = "Hedera Block Node Server" // Remove the following line to enable all 'javac' lint checks that we have turned on by default diff --git a/simulator/build.gradle.kts b/simulator/build.gradle.kts index 716beefbe..5464afecf 100644 --- a/simulator/build.gradle.kts +++ b/simulator/build.gradle.kts @@ -4,8 +4,6 @@ plugins { id("application") } -// dependencies { implementation(project(":common")) } - description = "Hedera Block Stream Simulator" // Remove the following line to enable all 'javac' lint checks that we have turned on by default diff --git a/stream/src/main/java/module-info.java b/stream/src/main/java/module-info.java index 32b1a00cd..f3bbe8af2 100644 --- a/stream/src/main/java/module-info.java +++ b/stream/src/main/java/module-info.java @@ -1,6 +1,6 @@ module com.hedera.block.stream { exports com.hedera.hapi.block; - exports com.hedera.hapi.block.protoc; // TODO move to test fixtures + exports com.hedera.hapi.block.protoc; exports com.hedera.hapi.block.stream.protoc; exports com.hedera.hapi.block.stream.input.protoc; exports com.hedera.hapi.block.stream.output.protoc; diff --git a/suites/src/main/java/module-info.java b/suites/src/main/java/module-info.java index 79b515a85..81ddcef13 100644 --- a/suites/src/main/java/module-info.java +++ b/suites/src/main/java/module-info.java @@ -1,6 +1,5 @@ /** Runtime module of the suites. */ module com.hedera.block.node.suites { - // Require testing libraries requires com.hedera.block.simulator; requires com.swirlds.config.api; requires com.swirlds.config.extensions; From fac0c047b0674f48adf7b4190435792f2f940b6b Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Thu, 9 Jan 2025 13:22:10 +0100 Subject: [PATCH 14/15] build: remove mistakenly added config code Signed-off-by: Jendrik Johannes --- .github/dependabot.yml | 2 +- suites/build.gradle.kts | 20 -------------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9ee1e1b5b..b9e4312ba 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -19,4 +19,4 @@ updates: - package-ecosystem: gradle directory: / schedule: - interval: weekly \ No newline at end of file + interval: weekly diff --git a/suites/build.gradle.kts b/suites/build.gradle.kts index 20c5285fd..7a618030f 100644 --- a/suites/build.gradle.kts +++ b/suites/build.gradle.kts @@ -18,26 +18,6 @@ mainModuleInfo { runtimeOnly("com.swirlds.config.impl") } -val updateDockerEnv = - tasks.register("updateDockerEnv") { - description = - "Creates the .env file in the docker folder that contains environment variables for Docker" - group = "docker" - - workingDir(layout.projectDirectory.dir("../server/docker")) - commandLine("sh", "-c", "./update-env.sh ${project.version} false false") - } - -// Task to build the Docker image -tasks.register("createDockerImage") { - description = "Creates the Docker image of the Block Node Server based on the current version" - group = "docker" - - dependsOn(updateDockerEnv, tasks.assemble) - workingDir(layout.projectDirectory.dir("../server/docker")) - commandLine("./docker-build.sh", project.version, layout.projectDirectory.dir("..").asFile) -} - tasks.register("runSuites") { description = "Runs E2E Test Suites" group = "suites" From f2bc04fa92fd1a75f925c4d607d40163ae5180fd Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Thu, 9 Jan 2025 13:25:10 +0100 Subject: [PATCH 15/15] chore: add license headers Signed-off-by: Jendrik Johannes --- .github/dependabot.yml | 1 + common/src/main/java/module-info.java | 4 +--- server/src/main/java/module-info.java | 2 +- simulator/src/main/java/module-info.java | 2 +- stream/src/main/java/module-info.java | 1 + suites/src/main/java/module-info.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b9e4312ba..d6c567986 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 version: 2 updates: - package-ecosystem: github-actions diff --git a/common/src/main/java/module-info.java b/common/src/main/java/module-info.java index 9f80aea65..1ff79d979 100644 --- a/common/src/main/java/module-info.java +++ b/common/src/main/java/module-info.java @@ -1,6 +1,4 @@ -/** - * Module info for common module. - */ +// SPDX-License-Identifier: Apache-2.0 module com.hedera.block.common { exports com.hedera.block.common.constants; exports com.hedera.block.common.utils; diff --git a/server/src/main/java/module-info.java b/server/src/main/java/module-info.java index 447ba5eb6..1e33fd855 100644 --- a/server/src/main/java/module-info.java +++ b/server/src/main/java/module-info.java @@ -1,6 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 import com.hedera.block.server.config.BlockNodeConfigExtension; -/** Runtime module of the server. */ module com.hedera.block.server { exports com.hedera.block.server; exports com.hedera.block.server.consumer; diff --git a/simulator/src/main/java/module-info.java b/simulator/src/main/java/module-info.java index c420caccc..db16c6729 100644 --- a/simulator/src/main/java/module-info.java +++ b/simulator/src/main/java/module-info.java @@ -1,6 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 import com.hedera.block.simulator.config.SimulatorConfigExtension; -/** Runtime module of the simulator. */ module com.hedera.block.simulator { exports com.hedera.block.simulator.config.data; exports com.hedera.block.simulator.exception; diff --git a/stream/src/main/java/module-info.java b/stream/src/main/java/module-info.java index f3bbe8af2..c018ad4a8 100644 --- a/stream/src/main/java/module-info.java +++ b/stream/src/main/java/module-info.java @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 module com.hedera.block.stream { exports com.hedera.hapi.block; exports com.hedera.hapi.block.protoc; diff --git a/suites/src/main/java/module-info.java b/suites/src/main/java/module-info.java index 81ddcef13..605e68984 100644 --- a/suites/src/main/java/module-info.java +++ b/suites/src/main/java/module-info.java @@ -1,4 +1,4 @@ -/** Runtime module of the suites. */ +// SPDX-License-Identifier: Apache-2.0 module com.hedera.block.node.suites { requires com.hedera.block.simulator; requires com.swirlds.config.api;