diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3aa14155bf85..9bca0086f871 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,12 +1,7 @@ version: 2 updates: - package-ecosystem: "gradle" - directory: "/hedera-dependency-versions" - schedule: - interval: "daily" - open-pull-requests-limit: 10 - - package-ecosystem: "gradle" - directory: "/gradle/plugins" + directory: "/hiero-dependency-versions" schedule: interval: "daily" open-pull-requests-limit: 10 diff --git a/.github/workflows/node-zxc-build-release-artifact.yaml b/.github/workflows/node-zxc-build-release-artifact.yaml index 1534a2fb3e84..3d1fe85f9667 100644 --- a/.github/workflows/node-zxc-build-release-artifact.yaml +++ b/.github/workflows/node-zxc-build-release-artifact.yaml @@ -1,19 +1,4 @@ -## -# 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. -## - +# SPDX-License-Identifier: Apache-2.0 name: "ZXC: [Node] Deploy Release Artifacts" on: workflow_call: diff --git a/.github/workflows/zxc-publish-production-image.yaml b/.github/workflows/zxc-publish-production-image.yaml index 3fe6d8e0b53e..c9e24795a909 100644 --- a/.github/workflows/zxc-publish-production-image.yaml +++ b/.github/workflows/zxc-publish-production-image.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: "ZXC: Publish Production Image" on: workflow_call: diff --git a/example-apps/swirlds-platform-base-example/build.gradle.kts b/example-apps/swirlds-platform-base-example/build.gradle.kts index 7f3e5f02a809..d7db028f8a6f 100644 --- a/example-apps/swirlds-platform-base-example/build.gradle.kts +++ b/example-apps/swirlds-platform-base-example/build.gradle.kts @@ -1,23 +1,5 @@ -/* - * Copyright (C) 2020-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.gradle.platform") -} +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.module.application") } mainModuleInfo { annotationProcessor("com.swirlds.config.processor") @@ -25,4 +7,4 @@ mainModuleInfo { runtimeOnly("com.swirlds.config.impl") } -application.mainClass.set("com.swirlds.platform.base.example.Application") +application.mainClass = "com.swirlds.platform.base.example.Application" diff --git a/gradle/aggregation/build.gradle.kts b/gradle/aggregation/build.gradle.kts index c553de85fb04..e03445d5ff03 100644 --- a/gradle/aggregation/build.gradle.kts +++ b/gradle/aggregation/build.gradle.kts @@ -1,20 +1,10 @@ -/* - * 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.gradle.reports") } +// SPDX-License-Identifier: Apache-2.0 +plugins { + id("org.hiero.gradle.base.lifecycle") + id("org.hiero.gradle.report.code-coverage") + id("org.hiero.gradle.check.spotless") + id("org.hiero.gradle.check.spotless-kotlin") +} dependencies { implementation(project(":app")) @@ -29,9 +19,26 @@ dependencies { implementation(project(":test-clients")) } -tasks.named("testCodeCoverageReport") { - val exclusions = listOf("test-clients", "testFixtures", "statedumpers", "example-apps") - classDirectories.setFrom( - classDirectories.files.filterNot { file -> exclusions.any { file.path.contains(it) } } - ) +tasks.testCodeCoverageReport { + // Redo the setup done in 'JacocoReportAggregationPlugin', but gather the class files in the + // file tree and filter out selected classes by path. + val filteredClassFiles = + configurations.aggregateCodeCoverageReportResults + .get() + .incoming + .artifactView { + componentFilter { id -> id is ProjectComponentIdentifier } + attributes.attribute( + LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, + objects.named(LibraryElements.CLASSES) + ) + } + .files + .asFileTree + .filter { file -> + listOf("test-clients", "testFixtures", "statedumpers", "example-apps").none { + file.path.contains(it) + } + } + classDirectories.setFrom(filteredClassFiles) } diff --git a/gradle/development-branch.txt b/gradle/development-branch.txt new file mode 100644 index 000000000000..ce57f6456319 --- /dev/null +++ b/gradle/development-branch.txt @@ -0,0 +1 @@ +develop \ No newline at end of file diff --git a/gradle/plugins/build.gradle.kts b/gradle/plugins/build.gradle.kts deleted file mode 100644 index fc93ac5a4da1..000000000000 --- a/gradle/plugins/build.gradle.kts +++ /dev/null @@ -1,42 +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. - */ - -plugins { - // Support convention plugins written in Kotlin. Convention plugins are build scripts in - // 'src/main' that automatically become available as plugins in the main build. - `kotlin-dsl` -} - -repositories { gradlePluginPortal() } - -dependencies { - implementation("com.adarshr:gradle-test-logger-plugin:4.0.0") - implementation("com.autonomousapps:dependency-analysis-gradle-plugin:2.6.1") - implementation("com.diffplug.spotless:spotless-plugin-gradle:6.25.0") - implementation("com.github.johnrengelman:shadow:8.1.1") - implementation("com.google.protobuf:protobuf-gradle-plugin:0.9.4") - implementation("com.gradle:develocity-gradle-plugin:3.18") - implementation( - "gradle.plugin.com.google.cloud.artifactregistry:artifactregistry-gradle-plugin:2.2.2" - ) - implementation("io.freefair.gradle:maven-plugin:8.11") // for POM validation - 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.9") - implementation("org.gradlex:jvm-dependency-conflict-resolution:2.1.2") - implementation("org.gradlex:java-module-dependencies:1.8") -} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.application.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.application.gradle.kts deleted file mode 100644 index b821df2958c4..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.application.gradle.kts +++ /dev/null @@ -1,56 +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("application") - id("com.hedera.gradle.java") -} - -// Find the central SDK deployment dir by searching up the folder hierarchy -fun sdkDir(dir: Directory): Directory = - if (dir.dir("sdk").asFile.exists()) dir.dir("sdk") else sdkDir(dir.dir("..")) - -// Copy dependencies into `sdk/data/lib` -val copyLib = - tasks.register("copyLib") { - from(project.configurations.runtimeClasspath) - into(sdkDir(layout.projectDirectory).dir("data/lib")) - } - -// Copy built jar into `data/apps` and rename -val copyApp = - tasks.register("copyApp") { - inputs.property("projectName", project.name) - - from(tasks.jar) - into(sdkDir(layout.projectDirectory).dir("data/apps")) - rename { "${inputs.properties["projectName"]}.jar" } - } - -tasks.assemble { - dependsOn(copyLib) - dependsOn(copyApp) -} - -// The 'application' plugin activates the following tasks as part of 'assemble'. -// As we do not use these results right now, disable them: -tasks.startScripts { enabled = false } - -tasks.distTar { enabled = false } - -tasks.distZip { enabled = false } - -tasks.jar { manifest { attributes("Main-Class" to application.mainClass) } } diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.feature.benchmark.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.feature.benchmark.gradle.kts deleted file mode 100644 index 22388926226e..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.feature.benchmark.gradle.kts +++ /dev/null @@ -1,56 +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. - */ - -import me.champeau.jmh.JMHTask - -plugins { id("me.champeau.jmh") } - -jmh { - jmhVersion = "1.37" - includeTests = false - // Filter JMH tests from command line via -PjmhTests=... - val commandLineIncludes = providers.gradleProperty("jmhTests") - if (commandLineIncludes.isPresent) { - includes.add(commandLineIncludes.get()) - } -} - -dependencies { - // Required for the JMH IDEA plugin: - // https://plugins.jetbrains.com/plugin/7529-jmh-java-microbenchmark-harness - jmhAnnotationProcessor("org.openjdk.jmh:jmh-generator-annprocess:${jmh.jmhVersion.get()}") -} - -tasks.jmh { outputs.upToDateWhen { false } } - -tasks.withType().configureEach { - group = "jmh" - jarArchive = tasks.jmhJar.flatMap { it.archiveFile } - jvm = javaToolchains.launcherFor(java.toolchain).map { it.executablePath }.get().asFile.path -} - -tasks.jmhJar { manifest { attributes(mapOf("Multi-Release" to true)) } } - -configurations { - // Disable module Jar patching for the JMH runtime classpath. - // The way the JMH plugin interacts with this in the 'jmhJar' task triggers this Gradle issue: - // https://github.com/gradle/gradle/issues/27372 - // And since 'jmhJar' builds a fat jar, module information is not needed here anyway. - val javaModule = Attribute.of("javaModule", Boolean::class.javaObjectType) - jmhRuntimeClasspath { attributes { attribute(javaModule, false) } } - jmhCompileClasspath { attributes { attribute(javaModule, false) } } - jmhAnnotationProcessor { attributes { attribute(javaModule, false) } } -} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.feature.test-fixtures.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.feature.test-fixtures.gradle.kts deleted file mode 100644 index dfb4f6cb1da8..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.feature.test-fixtures.gradle.kts +++ /dev/null @@ -1,28 +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 org.gradle.api.component.AdhocComponentWithVariants - -plugins { id("java-test-fixtures") } - -tasks.testFixturesJar { setGroup(null) } - -// Disable publishing of test fixture if 'java-test-fixtures' plugin is used -// https://docs.gradle.org/current/userguide/java_testing.html#ex-disable-publishing-of-test-fixtures-variants -(components["java"] as AdhocComponentWithVariants).apply { - withVariantsFromConfiguration(configurations["testFixturesApiElements"]) { skip() } - withVariantsFromConfiguration(configurations["testFixturesRuntimeElements"]) { skip() } -} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.feature.test-hammer.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.feature.test-hammer.gradle.kts deleted file mode 100644 index 2d9aaba59527..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.feature.test-hammer.gradle.kts +++ /dev/null @@ -1,40 +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. - */ - -import com.hedera.gradle.services.TaskLockService - -plugins { id("java") } - -// Test functionally correct behavior under stress/loads with many repeated iterations. -@Suppress("UnstableApiUsage") -testing.suites { - register("hammer") { - testType = "hammer" - targets.all { - testTask { - group = "build" - usesService( - gradle.sharedServices.registerIfAbsent("lock", TaskLockService::class) { - maxParallelUsages = 1 - } - ) - maxHeapSize = "8g" - } - } - } -} - -tasks.assemble { dependsOn(tasks.named("hammerClasses")) } diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.feature.test-time-consuming.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.feature.test-time-consuming.gradle.kts deleted file mode 100644 index 156b2d85b2b1..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.feature.test-time-consuming.gradle.kts +++ /dev/null @@ -1,31 +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. - */ - -plugins { id("java") } - -// Tests that could be in the default "test" set but take more than 100ms to execute. -@Suppress("UnstableApiUsage") -testing.suites { - register("timeConsuming") { - testType = "timing-consuming" - targets.all { - testTask { - group = "build" - maxHeapSize = "4g" - } - } - } -} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.feature.test-timing-sensitive.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.feature.test-timing-sensitive.gradle.kts deleted file mode 100644 index c567609a0422..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.feature.test-timing-sensitive.gradle.kts +++ /dev/null @@ -1,39 +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. - */ - -import com.hedera.gradle.services.TaskLockService - -plugins { id("java") } - -// Tests that are resource sensitive (e.g. use Thread.sleep()) and thus need to run without anything -// in parallel. -@Suppress("UnstableApiUsage") -testing.suites { - register("timingSensitive") { - testType = "timing-sensitive" - targets.all { - testTask { - group = "build" - maxHeapSize = "4g" - usesService( - gradle.sharedServices.registerIfAbsent("lock", TaskLockService::class) { - maxParallelUsages = 1 - } - ) - } - } - } -} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.java.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.java.gradle.kts deleted file mode 100644 index 5a4e2fd4cd2c..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.java.gradle.kts +++ /dev/null @@ -1,330 +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. - */ - -import com.adarshr.gradle.testlogger.theme.ThemeType -import com.autonomousapps.DependencyAnalysisSubExtension -import com.hedera.gradle.services.TaskLockService -import com.hedera.gradle.utils.Utils.versionTxt -import org.gradlex.javamodule.dependencies.tasks.ModuleDirectivesOrderingCheck -import org.gradlex.javamodule.dependencies.tasks.ModuleDirectivesScopeCheck - -plugins { - id("java") - id("jacoco") - id("checkstyle") - id("com.adarshr.test-logger") - id("com.autonomousapps.dependency-analysis") - id("com.hedera.gradle.lifecycle") - id("com.hedera.gradle.jpms-modules") - id("com.hedera.gradle.repositories") - id("com.hedera.gradle.spotless-java") - id("com.hedera.gradle.spotless-kotlin") -} - -version = - providers.fileContents(rootProject.layout.projectDirectory.versionTxt()).asText.get().trim() - -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 = javaVersionMajor - targetCompatibility = javaVersionMajor -} - -configurations.all { - // In case published versions of a module are also available, always prefer the local one - resolutionStrategy.preferProjectModules() -} - -jvmDependencyConflicts { - consistentResolution { - providesVersions(":aggregation") - platform(":hedera-dependency-versions") - } -} - -val consistentResolutionAttribute = Attribute.of("consistent-resolution", String::class.java) - -configurations.create("allDependencies") { - isCanBeConsumed = true - isCanBeResolved = false - sourceSets.all { - extendsFrom( - configurations[this.implementationConfigurationName], - configurations[this.compileOnlyConfigurationName], - configurations[this.runtimeOnlyConfigurationName], - configurations[this.annotationProcessorConfigurationName] - ) - } - attributes { - attribute(consistentResolutionAttribute, "global") - attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME)) - attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.LIBRARY)) - attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.JAR)) - attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL)) - } -} - -configurations.getByName("mainRuntimeClasspath") { - attributes.attribute(consistentResolutionAttribute, "global") -} - -tasks.buildDependents { setGroup(null) } - -tasks.buildNeeded { setGroup(null) } - -tasks.jar { setGroup(null) } - -sourceSets.all { - // Remove 'classes' tasks from 'build' group to keep it cleaned up - tasks.named(classesTaskName) { group = null } - - // 'assemble' compiles all sources, including all test sources - tasks.assemble { dependsOn(tasks.named(classesTaskName)) } -} - -val writeGitProperties = - tasks.register("writeGitProperties") { - property("git.build.version", project.version) - @Suppress("UnstableApiUsage") - property( - "git.commit.id", - providers - .exec { commandLine("git", "rev-parse", "HEAD") } - .standardOutput - .asText - .map { it.trim() } - ) - @Suppress("UnstableApiUsage") - property( - "git.commit.id.abbrev", - providers - .exec { commandLine("git", "rev-parse", "HEAD") } - .standardOutput - .asText - .map { it.trim().substring(0, 7) } - ) - - destinationFile = layout.buildDirectory.file("generated/git/git.properties") - } - -tasks.processResources { from(writeGitProperties) } - -// ignore the content of 'git.properties' when using a classpath as task input -normalization.runtimeClasspath { ignore("git.properties") } - -tasks.withType().configureEach { - isPreserveFileTimestamps = false - isReproducibleFileOrder = true - filePermissions { unix("0664") } - dirPermissions { unix("0775") } -} - -tasks.jar { exclude("**/classpath.index") } - -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") - options.compilerArgs.add("-Werror") - options.compilerArgs.add("-Xlint:all,-" + deactivatedCompileLintOptions.joinToString(",-")) - - 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 Consensus Node" - options.memberLevel = JavadocMemberLevel.PACKAGE - addStringOption("Xdoclint:all,-missing", "-Xwerror") - } -} - -@Suppress("UnstableApiUsage") -testing.suites { - named("test") { - useJUnitJupiter() - targets.all { - testTask { - group = "build" - maxHeapSize = "4g" - // Some tests overlap due to using the same temp folders within one project - // maxParallelForks = 4 <- set this, once tests can run in parallel - - // Enable dynamic agent loading for tests - eg: Mockito, ByteBuddy - jvmArgs("-XX:+EnableDynamicAgentLoading") - } - } - } - // remove automatically added compile time dependencies, as we want to define them all - // explicitly - withType { - configurations.getByName(sources.implementationConfigurationName) { - withDependencies { - removeIf { it.group == "org.junit.jupiter" && it.name == "junit-jupiter" } - } - } - dependencies { runtimeOnly("org.junit.jupiter:junit-jupiter-engine") } - } -} - -// If user gave the argument '-PactiveProcessorCount', then do: -// - run all test tasks in sequence -// - give the -XX:ActiveProcessorCount argument to the test JVMs -val activeProcessorCount = providers.gradleProperty("activeProcessorCount") - -if (activeProcessorCount.isPresent) { - tasks.withType().configureEach { - usesService( - gradle.sharedServices.registerIfAbsent("lock", TaskLockService::class) { - maxParallelUsages = 1 - } - ) - jvmArgs("-XX:ActiveProcessorCount=${activeProcessorCount.get()}") - } -} - -tasks.jacocoTestReport { - // Configure Jacoco so it outputs XML reports (needed by SonarCloud) - reports { - xml.required = true - html.required = true - } -} - -testlogger { - theme = ThemeType.MOCHA_PARALLEL - slowThreshold = 10000 - showPassed = false - showSkipped = false - showStandardStreams = true - showPassedStandardStreams = false - showSkippedStandardStreams = false - showFailedStandardStreams = true -} - -tasks.assemble { dependsOn(tasks.javadoc) } - -tasks.check { dependsOn(tasks.jacocoTestReport) } - -tasks.named("qualityGate") { dependsOn(tasks.withType()) } - -// ordering check is done by SortModuleInfoRequiresStep -tasks.withType { enabled = false } - -tasks.withType().configureEach { - // When doing a 'qualityGate' run, make sure spotlessApply is done before doing compilation and - // other checks based on compiled code - mustRunAfter(tasks.spotlessApply) -} - -// Do not report dependencies from one source set to another as 'required'. -// In particular, in case of test fixtures, the analysis would suggest to -// add as testModuleInfo { require(...) } to the main module. This is -// conceptually wrong, because in whitebox testing the 'main' and 'test' -// module are conceptually considered one module (main module extended with tests) -configure { issues { onAny { exclude(project.path) } } } - -checkstyle { toolVersion = "10.12.7" } - -tasks.withType().configureEach { - reports { - xml.required = true - html.required = true - sarif.required = true - } -} - -tasks.withType().configureEach { - // Do not yet run things on the '--module-path' - modularity.inferModulePath = false - if (name.endsWith("main()")) { - notCompatibleWithConfigurationCache("JavaExec created by IntelliJ") - } -} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.jpms-modules.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.jpms-modules.gradle.kts deleted file mode 100644 index 7a53b9644424..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.jpms-modules.gradle.kts +++ /dev/null @@ -1,257 +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.netty:netty-transport-native-epoll") { - addFeature("linux-x86_64") - addFeature("linux-aarch_64") - } - 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-netty") { annotationLibraries.forEach { removeDependency(it) } } - module("io.grpc:grpc-protobuf") { annotationLibraries.forEach { removeDependency(it) } } - module("io.grpc:grpc-protobuf-lite") { - annotationLibraries.forEach { removeDependency(it) } - removeDependency("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.github.ben-manes.caffeine:caffeine") { - 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("org.apache.tuweni:tuweni-bytes") { removeDependency("com.google.code.findbugs:jsr305") } - module("org.apache.tuweni:tuweni-units") { removeDependency("com.google.code.findbugs:jsr305") } - 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 - versionsProvidingConfiguration = "mainRuntimeClasspath" - - module("io.grpc:grpc-api", "io.grpc") - module("io.grpc:grpc-core", "io.grpc.internal") - module("io.grpc:grpc-context", "io.grpc.context") - module("io.grpc:grpc-netty", "io.grpc.netty") { - exportAllPackages() - requireAllDefinedDependencies() - requires("java.logging") - } - module("io.grpc:grpc-stub", "io.grpc.stub") { - exportAllPackages() - requireAllDefinedDependencies() - requires("java.logging") - } - 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.helidon.common:helidon-common", "io.helidon.common") { - exportAllPackages() - patchRealModule() - } - module("io.helidon.webclient:helidon-webclient", "io.helidon.webclient") { - requireAllDefinedDependencies() - patchRealModule() - } - module("io.helidon.webclient:helidon-webclient-grpc", "io.helidon.webclient.grpc") { - exportAllPackages() - requireAllDefinedDependencies() - patchRealModule() - } - module("com.github.spotbugs:spotbugs-annotations", "com.github.spotbugs.annotations") - module("com.google.code.findbugs:jsr305", "java.annotation") - 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("com.esaulpaugh:headlong", "headlong") - module("org.checkerframework:checker-qual", "org.checkerframework.checker.qual") - module("org.connid:framework", "org.connid.framework") - module("org.connid:framework-internal", "org.connid.framework.internal") { - exportAllPackages() - requires("org.connid.framework") // this is missing in POM - } - module("org.jetbrains:annotations", "org.jetbrains.annotations") - module("io.tmio:tuweni-units", "tuweni.units") - module("io.tmio:tuweni-bytes", "tuweni.bytes") - module("net.i2p.crypto:eddsa", "net.i2p.crypto.eddsa") - module("io.netty:netty-codec-http", "io.netty.codec.http") - module("io.netty:netty-codec-http2", "io.netty.codec.http2") - module("io.netty:netty-codec-socks", "io.netty.codec.socks") - module("io.netty:netty-handler-proxy", "io.netty.handler.proxy") - module("io.netty:netty-transport-native-unix-common", "io.netty.transport.unix.common") - module("io.netty:netty-buffer", "io.netty.buffer") - module("io.netty:netty-codec", "io.netty.codec") - module("io.netty:netty-common", "io.netty.common") { - exportAllPackages() - requireAllDefinedDependencies() - requires("java.logging") - requires("jdk.unsupported") - ignoreServiceProvider("reactor.blockhound.integration.BlockHoundIntegration") - } - module("io.netty:netty-handler", "io.netty.handler") - module("io.netty:netty-resolver", "io.netty.resolver") - module("io.netty:netty-transport", "io.netty.transport") - module("io.netty:netty-transport-classes-epoll", "io.netty.transport.classes.epoll") - module("org.antlr:antlr4-runtime", "org.antlr.antlr4.runtime") - module("org.hyperledger.besu.internal:algorithms", "org.hyperledger.besu.internal.crypto") - module("org.hyperledger.besu.internal:rlp", "org.hyperledger.besu.internal.rlp") - module("org.hyperledger.besu:arithmetic", "org.hyperledger.besu.nativelib.arithmetic") - module("org.hyperledger.besu:blake2bf", "org.hyperledger.besu.nativelib.blake2bf") - module("org.hyperledger.besu:bls12-381", "org.hyperledger.besu.nativelib.bls12_381") - module("org.hyperledger.besu:besu-datatypes", "org.hyperledger.besu.datatypes") - module("org.hyperledger.besu:evm", "org.hyperledger.besu.evm") { - exportAllPackages() - requireAllDefinedDependencies() - requiresStatic("com.fasterxml.jackson.annotation") - } - module("org.hyperledger.besu:secp256k1", "org.hyperledger.besu.nativelib.secp256k1") - module("org.hyperledger.besu:secp256r1", "org.hyperledger.besu.nativelib.secp256r1") - module("com.goterl:resource-loader", "resource.loader") - module("com.goterl:lazysodium-java", "lazysodium.java") - module("tech.pegasys:jc-kzg-4844", "tech.pegasys.jckzg4844") - module("net.java.dev.jna:jna", "com.sun.jna") { - exportAllPackages() - requires("java.logging") - } - module("org.eclipse.collections:eclipse-collections-api", "org.eclipse.collections.api") - module("org.eclipse.collections:eclipse-collections", "org.eclipse.collections.impl") - 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") - } - - // Need to use Jar file names here as there is currently no other way to address Jar with - // classifier directly for patching - module( - "io.netty:netty-transport-native-epoll|linux-x86_64", - "io.netty.transport.epoll.linux.x86_64" - ) - module( - "io.netty:netty-transport-native-epoll|linux-aarch_64", - "io.netty.transport.epoll.linux.aarch_64" - ) - - // 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") - - // Testing only - module("com.google.jimfs:jimfs", "com.google.jimfs") - module("org.awaitility:awaitility", "awaitility") - module("uk.org.webcompere:system-stubs-core", "uk.org.webcompere.systemstubs.core") - module("uk.org.webcompere:system-stubs-jupiter", "uk.org.webcompere.systemstubs.jupiter") - - // 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.docker.java.transport") - module( - "com.github.docker-java:docker-java-transport-zerodep", - "com.github.docker.transport.zerodep" - ) - 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:testcontainers", "org.testcontainers") - module("org.mockito:mockito-junit-jupiter", "org.mockito.junit.jupiter") -} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.lifecycle.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.lifecycle.gradle.kts deleted file mode 100644 index 1c74e298998c..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.lifecycle.gradle.kts +++ /dev/null @@ -1,33 +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("base") - id("com.diffplug.spotless") -} - -// Convenience for local development: when running './gradlew' without any parameters just show the -// tasks from the 'build' group -defaultTasks("tasks") - -tasks.register("qualityGate") { - group = "build" - description = "Apply spotless rules and run all quality checks." - dependsOn(tasks.spotlessApply) - dependsOn(tasks.assemble) -} - -tasks.register("releaseMavenCentral") diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.maven-publish.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.maven-publish.gradle.kts deleted file mode 100644 index 32e73b2f57b3..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.maven-publish.gradle.kts +++ /dev/null @@ -1,135 +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. - */ - -import java.util.Properties - -plugins { - id("java") - id("maven-publish") - id("signing") - id("io.freefair.maven-central.validate-poms") -} - -tasks.withType().configureEach { - // Publishing tasks are only enabled if we publish to the matching group. - // Otherwise, Nexus configuration and credentials do not fit. - val publishingPackageGroup = providers.gradleProperty("publishingPackageGroup").orNull - enabled = publishingPackageGroup == project.group -} - -java { - withJavadocJar() - withSourcesJar() -} - -tasks.withType().configureEach { setGroup(null) } - -tasks.named("releaseMavenCentral") { - group = "release" - dependsOn(tasks.named("publishToSonatype")) -} - -val maven = - publishing.publications.create("maven") { - from(components["java"]) - versionMapping { - // Everything published takes the versions from the resolution result. - // These are the versions we define in 'hedera-dependency-versions' - // and use consistently in all modules. - allVariants { fromResolutionResult() } - } - - suppressAllPomMetadataWarnings() - - pom { - val devGroups = Properties() - val developerProperties = layout.projectDirectory.file("../developers.properties") - devGroups.load( - providers - .fileContents(developerProperties) - .asText - .orElse( - provider { - throw RuntimeException("${developerProperties.asFile} does not exist") - } - ) - .get() - .reader() - ) - - name.set(project.name) - url = "https://www.hashgraph.com/" - inceptionYear = "2016" - - // this field must be present. Default to empty string. - description = - providers - .fileContents(layout.projectDirectory.file("../description.txt")) - .asText - .orElse(provider(project::getDescription)) - .map { it.replace("\n", " ").trim() } - .orElse("") - - organization { - name = "Hedera Hashgraph, LLC" - url = "https://www.hedera.com" - } - - val repoName = isolated.rootProject.name - - issueManagement { - system = "GitHub" - url = "https://github.com/hashgraph/$repoName/issues" - } - - licenses { - license { - name = "Apache License, Version 2.0" - url = "https://raw.githubusercontent.com/hashgraph/$repoName/main/LICENSE" - } - } - - scm { - connection = "scm:git:git://github.com/hashgraph/$repoName.git" - developerConnection = "scm:git:ssh://github.com:hashgraph/$repoName.git" - url = "https://github.com/hashgraph/$repoName" - } - - developers { - devGroups.forEach { mail, team -> - developer { - id = team as String - name = team as String - email = mail as String - organization = "Hedera Hashgraph" - organizationUrl = "https://www.hedera.com" - } - } - } - } - } - -val publishSigningEnabled = - providers.gradleProperty("publishSigningEnabled").getOrElse("false").toBoolean() - -if (publishSigningEnabled) { - signing { - sign(maven) - useGpgCmd() - } -} - -tasks.named("qualityGate") { dependsOn(tasks.validatePomFiles) } diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.nexus-publish.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.nexus-publish.gradle.kts deleted file mode 100644 index 429566cb793a..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.nexus-publish.gradle.kts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2023-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.gradle.lifecycle") - id("io.github.gradle-nexus.publish-plugin") -} - -nexusPublishing { - val s01SonatypeHost = providers.gradleProperty("s01SonatypeHost").getOrElse("false").toBoolean() - packageGroup = providers.gradleProperty("publishingPackageGroup").getOrElse("") - - repositories { - sonatype { - username = System.getenv("NEXUS_USERNAME") - password = System.getenv("NEXUS_PASSWORD") - if (s01SonatypeHost) { - nexusUrl = uri("https://s01.oss.sonatype.org/service/local/") - snapshotRepositoryUrl = - uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") - } - } - } -} - -tasks.named("closeSonatypeStagingRepository") { - // The publishing of all components to Maven Central is automatically done before close (which - // is done before release). - dependsOn(subprojects.map { ":${it.name}:releaseMavenCentral" }) -} - -tasks.named("releaseMavenCentral") { - group = "release" - dependsOn(tasks.closeAndReleaseStagingRepository) -} - -tasks.register("releaseMavenCentralSnapshot") { - group = "release" - dependsOn(subprojects.map { ":${it.name}:releaseMavenCentral" }) -} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.platform-publish.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.platform-publish.gradle.kts deleted file mode 100644 index e2983169da5f..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.platform-publish.gradle.kts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2023-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("com.hedera.gradle.maven-publish") -} - -if ( - gradle.startParameter.taskNames.any { it.startsWith("release") || it.contains("MavenCentral") } -) { - // We apply the 'artifactregistry' plugin conditionally, as there are two issues: - // 1. It does not support configuration cache. - // https://github.com/GoogleCloudPlatform/artifact-registry-maven-tools/issues/85 - // 2. It does not interact well with the 'gradle-nexus.publish-plugin' plugin, causing: - // 'No staging repository with name sonatype created' during IDE import - publishing.repositories.remove(publishing.repositories.getByName("sonatype")) - apply(plugin = "com.google.cloud.artifactregistry.gradle-plugin") -} - -publishing.repositories { - maven("artifactregistry://us-maven.pkg.dev/swirlds-registry/maven-prerelease-channel") { - name = "prereleaseChannel" - } - maven("artifactregistry://us-maven.pkg.dev/swirlds-registry/maven-develop-snapshots") { - name = "developSnapshot" - } - maven("artifactregistry://us-maven.pkg.dev/swirlds-registry/maven-develop-daily-snapshots") { - name = "developDailySnapshot" - } - maven("artifactregistry://us-maven.pkg.dev/swirlds-registry/maven-develop-commits") { - name = "developCommit" - } - maven("artifactregistry://us-maven.pkg.dev/swirlds-registry/maven-adhoc-commits") { - name = "adhocCommit" - } -} - -// Register one 'release*' task for each publishing repository -publishing.repositories.all { - val ucName = name.replaceFirstChar { it.titlecase() } - tasks.register("release$ucName") { - group = "release" - dependsOn(tasks.named("publishMavenPublicationTo${ucName}Repository")) - } -} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.platform.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.platform.gradle.kts deleted file mode 100644 index b12ff59f1ee7..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.platform.gradle.kts +++ /dev/null @@ -1,20 +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. - */ - -plugins { - id("java-library") - id("com.hedera.gradle.java") -} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.protobuf.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.protobuf.gradle.kts deleted file mode 100644 index 1ef21c4c2ea0..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.protobuf.gradle.kts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2023-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 - -plugins { - id("com.hedera.gradle.services") - id("com.google.protobuf") -} - -// Configure Protobuf Plugin to download protoc executable rather than using local installed version -protobuf { - protoc { artifact = "com.google.protobuf:protoc" } - plugins { - // Add GRPC plugin as we need to generate GRPC services - id("grpc") { artifact = "io.grpc:protoc-gen-grpc-java" } - } - generateProtoTasks { - all().configureEach { plugins { id("grpc") { option("@generated=omit") } } } - } -} - -configurations.configureEach { - if (name.startsWith("protobufToolsLocator") || name.endsWith("ProtoPath")) { - @Suppress("UnstableApiUsage") - shouldResolveConsistentlyWith(configurations.getByName("mainRuntimeClasspath")) - attributes { attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_API)) } - exclude(group = project.group.toString(), module = project.name) - withDependencies { - isTransitive = true - extendsFrom(configurations["internal"]) - } - } -} - -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" - // us parallel GC to keep up with high temporary garbage creation, - // and allow GC to use 40% of CPU if needed - jvmArgs("-XX:+UseParallelGC", "-XX:GCTimeRatio=90") -} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.reports.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.reports.gradle.kts deleted file mode 100644 index 3cef369974a5..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.reports.gradle.kts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2023-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 org.gradlex.javamodule.dependencies.tasks.ModuleDirectivesScopeCheck - -plugins { - id("com.hedera.gradle.java") - id("jacoco-report-aggregation") -} - -tasks.withType { enabled = false } - -// Make aggregation "classpath" use the platform for versions (gradle/versions) -configurations.aggregateCodeCoverageReportResults { extendsFrom(configurations["internal"]) } diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.repositories.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.repositories.gradle.kts deleted file mode 100644 index 734cf240f7eb..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.repositories.gradle.kts +++ /dev/null @@ -1,35 +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. - */ - -repositories { - mavenCentral() - maven { url = uri("https://us-maven.pkg.dev/swirlds-registry/maven-prerelease-channel") } - maven { url = uri("https://us-maven.pkg.dev/swirlds-registry/maven-develop-commits") } - maven { url = uri("https://us-maven.pkg.dev/swirlds-registry/maven-adhoc-commits") } - maven { url = uri("https://us-maven.pkg.dev/swirlds-registry/maven-develop-daily-snapshots") } - maven { url = uri("https://us-maven.pkg.dev/swirlds-registry/maven-develop-snapshots") } - maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") } - maven { - url = uri("https://hyperledger.jfrog.io/artifactory/besu-maven") - content { includeGroupByRegex("org\\.hyperledger\\..*") } - } - maven { - url = uri("https://artifacts.consensys.net/public/maven/maven/") - content { includeGroupByRegex("tech\\.pegasys(\\..*)?") } - } - maven { url = uri("https://oss.sonatype.org/content/repositories/comhederahashgraph-1502") } - maven { url = uri("https://oss.sonatype.org/content/repositories/comhederahashgraph-1531") } -} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.root.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.root.gradle.kts deleted file mode 100644 index a429661c9721..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.root.gradle.kts +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (C) 2023-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.hedera.gradle.utils.Utils.generateProjectVersionReport -import com.hedera.gradle.utils.Utils.versionTxt -import net.swiftzer.semver.SemVer - -plugins { - id("com.hedera.gradle.lifecycle") - id("com.hedera.gradle.repositories") - id("com.hedera.gradle.nexus-publish") - id("com.hedera.gradle.spotless-kotlin") - id("com.hedera.gradle.spotless-markdown") -} - -spotless { - kotlinGradle { target("gradle/plugins/**/*.gradle.kts") } - kotlin { - // For the Kotlin classes (*.kt files) - ktfmt().kotlinlangStyle() - target("gradle/plugins/**/*.kt") - } -} - -val productVersion = layout.projectDirectory.versionTxt().asFile.readText().trim() - -tasks.register("githubVersionSummary") { - group = "github" - - inputs.property("version", productVersion) - - if (!providers.environmentVariable("GITHUB_STEP_SUMMARY").isPresent) { - // Do not throw an exception if running the `gradlew tasks` task - if (project.gradle.startParameter.taskNames.contains("githubVersionSummary")) { - throw IllegalArgumentException( - "This task may only be run in a Github Actions CI environment! " + - "Unable to locate the GITHUB_STEP_SUMMARY environment variable." - ) - } - } - outputs.file(providers.environmentVariable("GITHUB_STEP_SUMMARY")) - - doLast { - generateProjectVersionReport( - inputs.properties["version"] as String, - outputs.files.singleFile.outputStream().buffered() - ) - } -} - -tasks.register("showVersion") { - group = "versioning" - - inputs.property("version", productVersion) - - doLast { println(inputs.properties["version"]) } -} - -tasks.register("versionAsPrefixedCommit") { - group = "versioning" - - @Suppress("UnstableApiUsage") - inputs.property( - "commit", - providers - .exec { commandLine("git", "rev-parse", "HEAD") } - .standardOutput - .asText - .map { it.trim().substring(0, 7) } - ) - inputs.property("commitPrefix", providers.gradleProperty("commitPrefix").orElse("adhoc")) - inputs.property("version", productVersion) - outputs.file(layout.projectDirectory.versionTxt()) - - doLast { - val newPrerel = - inputs.properties["commitPrefix"].toString() + - ".x" + - inputs.properties["commit"].toString().take(8) - val currVer = SemVer.parse(inputs.properties["version"] as String) - val newVer = SemVer(currVer.major, currVer.minor, currVer.patch, newPrerel) - outputs.files.singleFile.writeText(newVer.toString()) - } -} - -tasks.register("versionAsSnapshot") { - group = "versioning" - - inputs.property("version", productVersion) - outputs.file(layout.projectDirectory.versionTxt()) - - doLast { - val currVer = SemVer.parse(inputs.properties["version"] as String) - val newVer = SemVer(currVer.major, currVer.minor, currVer.patch, "SNAPSHOT") - - outputs.files.singleFile.writeText(newVer.toString()) - } -} - -tasks.register("versionAsSpecified") { - group = "versioning" - - inputs.property("newVersion", providers.gradleProperty("newVersion").orNull) - - if (inputs.properties["newVersion"] == null) { - // Do not throw an exception if running the `gradlew tasks` task - if (project.gradle.startParameter.taskNames.contains("versionAsSpecified")) { - throw IllegalArgumentException( - "No newVersion property provided! " + - "Please add the parameter -PnewVersion= when running this task." - ) - } - } - outputs.file(layout.projectDirectory.versionTxt()) - - doLast { - val newVer = SemVer.parse(inputs.properties["newVersion"] as String) - outputs.files.singleFile.writeText(newVer.toString()) - } -} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.services-publish.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.services-publish.gradle.kts deleted file mode 100644 index 57ed149ed3de..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.services-publish.gradle.kts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2023-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("com.hedera.gradle.maven-publish") -} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.services.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.services.gradle.kts deleted file mode 100644 index b12ff59f1ee7..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.services.gradle.kts +++ /dev/null @@ -1,20 +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. - */ - -plugins { - id("java-library") - id("com.hedera.gradle.java") -} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.settings.settings.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.settings.settings.gradle.kts deleted file mode 100644 index 5da00ecb2321..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.settings.settings.gradle.kts +++ /dev/null @@ -1,80 +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. - */ - -import org.gradlex.javamodule.dependencies.initialization.JavaModulesExtension -import org.gradlex.javamodule.dependencies.initialization.RootPluginsExtension - -pluginManagement { - repositories { - gradlePluginPortal() - mavenCentral() - maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") } - } -} - -plugins { - id("com.gradle.develocity") - id("org.gradlex.java-module-dependencies") -} - -// Plugins that are global, but are applied to the "root project" instead of settings. -// by having this block here, we do not require a "build.gradle.kts" in the repository roots. -configure { id("com.hedera.gradle.root") } - -// Enable Gradle Build Scan -develocity { - buildScan { - termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use" - termsOfUseAgree = "yes" - publishing.onlyIf { false } // only publish with explicit '--scan' - } -} - -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 - - isUseExpectContinue = true - isEnabled = !gradle.startParameter.isOffline - - if (isCiServer && gradleCacheAuthorized) { - credentials { - username = gradleCacheUsername - password = gradleCachePassword - } - } - } -} - -// Allow projects inside a build to be addressed by dependency coordinates notation. -// https://docs.gradle.org/current/userguide/composite_builds.html#included_build_declaring_substitutions -// Some functionality of the 'java-module-dependencies' plugin relies on this. -includeBuild(".") - -configure { - // Project to aggregate code coverage data for the whole repository into one report - module("gradle/aggregation") - - // "BOM" with versions of 3rd party dependencies - versions("hedera-dependency-versions") -} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.shadow-jar.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.shadow-jar.gradle.kts deleted file mode 100644 index d2bf1148e4d5..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.shadow-jar.gradle.kts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2023-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.github.jengelman.gradle.plugins.shadow.internal.DefaultDependencyFilter -import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar - -plugins { - id("java") - id("com.github.johnrengelman.shadow") -} - -tasks.withType().configureEach { - group = "shadow" - from(sourceSets.main.get().output) - mergeServiceFiles() - - // There is an issue in the shadow plugin that it automatically accesses the - // files in 'runtimeClasspath' while Gradle is building the task graph. - // See: https://github.com/johnrengelman/shadow/issues/882 - dependencyFilter = NoResolveDependencyFilter() -} - -class NoResolveDependencyFilter : DefaultDependencyFilter(project) { - override fun resolve(configuration: FileCollection): FileCollection { - return configuration - } -} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.spotless-java.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.spotless-java.gradle.kts deleted file mode 100644 index 984b2cece001..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.spotless-java.gradle.kts +++ /dev/null @@ -1,67 +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. - */ - -import com.hedera.gradle.spotless.RepairDashedCommentsFormatterStep -import com.hedera.gradle.spotless.SortModuleInfoRequiresStep -import com.hedera.gradle.spotless.StripOldLicenseFormatterStep - -plugins { id("com.hedera.gradle.spotless") } - -spotless { - java { - targetExclude("build/generated/sources/**/*.java", "build/generated/source/**/*.java") - - // fix errors due to dashed comment blocks (eg: /*-, /*--, etc) - addStep(RepairDashedCommentsFormatterStep.create()) - // Remove the old license headers as the spotless licenseHeader formatter - // cannot find them if they are located between the package and import statements. - addStep(StripOldLicenseFormatterStep.create()) - // Sort the 'requires' entries in Module Info files - addStep(SortModuleInfoRequiresStep.create()) - // enable toggle comment support - toggleOffOn() - // don't need to set target, it is inferred from java - // apply a specific flavor of google-java-format - palantirJavaFormat() - // 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)" - ) - .updateYearWithLatest(true) - } -} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.spotless-kotlin.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.spotless-kotlin.gradle.kts deleted file mode 100644 index 68fcb3923015..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.spotless-kotlin.gradle.kts +++ /dev/null @@ -1,46 +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. - */ - -plugins { id("com.hedera.gradle.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|pluginManagement|dependencyResolutionManagement|repositories|tasks|allprojects|subprojects)" - ) - .updateYearWithLatest(true) - } -} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.spotless-markdown.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.spotless-markdown.gradle.kts deleted file mode 100644 index 1505c1a7c80e..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.spotless-markdown.gradle.kts +++ /dev/null @@ -1,27 +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. - */ - -plugins { id("com.hedera.gradle.spotless") } - -spotless { - flexmark { - target("**/*.md") - flexmark() - trimTrailingWhitespace() - indentWithSpaces() - endWithNewline() - } -} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.spotless.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.spotless.gradle.kts deleted file mode 100644 index 4c027596fe37..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.spotless.gradle.kts +++ /dev/null @@ -1,75 +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. - */ - -plugins { id("com.diffplug.spotless") } - -spotless { - // Disable the automatic application of Spotless to all source sets when the check task is run. - isEnforceCheck = false - - // optional: limit format enforcement to just the files changed by this feature branch - ratchetFrom("origin/develop") - - format("misc") { - // define the files to apply `misc` to - target(".gitignore") - - // define the steps to apply to those files - trimTrailingWhitespace() - indentWithSpaces() - endWithNewline() - } - - format("actionYaml") { - target(".github/workflows/*.yaml") - /* - * Prettier requires NodeJS and NPM installed; however, the NodeJS Gradle plugin and Spotless do not yet - * integrate with each other. Currently there is an open issue report against spotless. - * - * *** Please see for more information: https://github.com/diffplug/spotless/issues/728 *** - * - * The workaround provided in the above issue does not work in Gradle 7.5+ and therefore is not a viable solution. - */ - // prettier() - - 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. - ##${"\n\n"} - """ - .trimIndent(), - "(name)" - ) - .updateYearWithLatest(true) - } -} diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.versions.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.versions.gradle.kts deleted file mode 100644 index 661037d92d75..000000000000 --- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.versions.gradle.kts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2023-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-platform") - id("com.hedera.gradle.jpms-modules") - id("org.gradlex.java-module-versions") -} - -javaPlatform { allowDependencies() } - -tasks.register("releaseMavenCentral") diff --git a/gradle/plugins/src/main/kotlin/com/hedera/gradle/services/TaskLockService.kt b/gradle/plugins/src/main/kotlin/com/hedera/gradle/services/TaskLockService.kt deleted file mode 100644 index 7b9b5c77aee0..000000000000 --- a/gradle/plugins/src/main/kotlin/com/hedera/gradle/services/TaskLockService.kt +++ /dev/null @@ -1,22 +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.gradle.services - -import org.gradle.api.services.BuildService -import org.gradle.api.services.BuildServiceParameters - -abstract class TaskLockService : BuildService diff --git a/gradle/plugins/src/main/kotlin/com/hedera/gradle/spotless/RepairDashedCommentsFormatterStep.kt b/gradle/plugins/src/main/kotlin/com/hedera/gradle/spotless/RepairDashedCommentsFormatterStep.kt deleted file mode 100644 index 5a3efd96c1c2..000000000000 --- a/gradle/plugins/src/main/kotlin/com/hedera/gradle/spotless/RepairDashedCommentsFormatterStep.kt +++ /dev/null @@ -1,73 +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.gradle.spotless - -import com.diffplug.spotless.FormatterFunc -import com.diffplug.spotless.FormatterStep - -/** - * Adds self-correcting behavior as spotless step which properly removes the comments which causes - * the google-java-formatter plugin to rupture (eg: \/\*-). - */ -class RepairDashedCommentsFormatterStep { - companion object { - private const val NAME = "RepairDashedComments" - private const val OPENING_COMMENT_REGEX = "/\\*-+" - private const val CLOSING_COMMENT_REGEX = "-+\\*/" - - fun create(): FormatterStep { - val openingCommentRegex = Regex(OPENING_COMMENT_REGEX, setOf(RegexOption.IGNORE_CASE)) - val closingCommentRegex = Regex(CLOSING_COMMENT_REGEX, setOf(RegexOption.IGNORE_CASE)) - return FormatterStep.create( - NAME, - State(openingCommentRegex, closingCommentRegex), - State::toFormatter - ) - } - } - - private class State(val openingCommentRegex: Regex, val closingCommentRegex: Regex) : - java.io.Serializable { - - fun toFormatter(): FormatterFunc { - return FormatterFunc { unixStr -> - val lines = unixStr.split('\n') - val result = ArrayList(lines.size) - var inLicenseBlock = false - - lines.forEach { s -> - if (!inLicenseBlock && s.trim().equals("/*-")) { - inLicenseBlock = true - } else if (inLicenseBlock && s.trim().equals("*/")) { - inLicenseBlock = false - } - - if (inLicenseBlock) { - result.add(s) - } else { - result.add( - s.replace(openingCommentRegex, "/*").replace(closingCommentRegex, "*/") - ) - } - } - - val finalStr = result.joinToString("\n") - finalStr - } - } - } -} diff --git a/gradle/plugins/src/main/kotlin/com/hedera/gradle/spotless/SortModuleInfoRequiresStep.kt b/gradle/plugins/src/main/kotlin/com/hedera/gradle/spotless/SortModuleInfoRequiresStep.kt deleted file mode 100644 index e744208eb681..000000000000 --- a/gradle/plugins/src/main/kotlin/com/hedera/gradle/spotless/SortModuleInfoRequiresStep.kt +++ /dev/null @@ -1,102 +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. - */ - -package com.hedera.gradle.spotless - -import com.diffplug.spotless.FormatterFunc -import com.diffplug.spotless.FormatterStep - -class SortModuleInfoRequiresStep { - companion object { - private const val NAME = "SortModuleInfoRequires" - private val OWN_PACKAGES = listOf("com.swirlds.", "com.hedera.node.", "com.hedera.storage.") - - fun create(): FormatterStep { - return FormatterStep.create(NAME, State(), State::toFormatter) - } - } - - private class State : java.io.Serializable { - - fun toFormatter(): FormatterFunc { - return FormatterFunc { unixStr -> - val lines = unixStr.split('\n') - val blockStartIndex = lines.indexOfFirst { it.trim().startsWith("requires") } - val blockEndIndex = lines.indexOfLast { it.trim().startsWith("requires") } - - if (blockStartIndex == -1) { - unixStr // not a module-info.java or no 'requires' - } else { - val nonRequiresLines = mutableListOf() - - val requiresTransitive = mutableListOf() - val requires = mutableListOf() - val requiresStaticTransitive = mutableListOf() - val requiresStatic = mutableListOf() - - lines.subList(blockStartIndex, blockEndIndex + 1).forEach { line -> - when { - line.trim().startsWith("requires static transitive") -> - requiresStaticTransitive.add(line) - line.trim().startsWith("requires static") -> requiresStatic.add(line) - line.trim().startsWith("requires transitive") -> - requiresTransitive.add(line) - line.trim().startsWith("requires") -> requires.add(line) - line.isNotBlank() && !line.trim().startsWith("requires") -> - nonRequiresLines.add(line) - } - } - - val comparator = - Comparator { a, b -> - val nameA = a.split(" ").first { it.endsWith(";") } - val nameB = b.split(" ").first { it.endsWith(";") } - if ( - OWN_PACKAGES.any { nameA.startsWith(it) } && - OWN_PACKAGES.none { nameB.startsWith(it) } - ) { - -1 - } else if ( - OWN_PACKAGES.none { nameA.startsWith(it) } && - OWN_PACKAGES.any { nameB.startsWith(it) } - ) { - 1 - } else { - nameA.compareTo(nameB) - } - } - - requiresTransitive.sortWith(comparator) - requires.sortWith(comparator) - requiresStaticTransitive.sortWith(comparator) - requiresStatic.sortWith(comparator) - - val blockStart = lines.subList(0, blockStartIndex) - val blockEnd = lines.subList(blockEndIndex + 1, lines.size) - - (blockStart + - nonRequiresLines + - requiresTransitive + - requires + - requiresStaticTransitive + - requiresStatic + - blockEnd) - .joinToString("\n") - } - } - } - } -} diff --git a/gradle/plugins/src/main/kotlin/com/hedera/gradle/spotless/StripOldLicenseFormatterStep.kt b/gradle/plugins/src/main/kotlin/com/hedera/gradle/spotless/StripOldLicenseFormatterStep.kt deleted file mode 100644 index e9aedfac0bdb..000000000000 --- a/gradle/plugins/src/main/kotlin/com/hedera/gradle/spotless/StripOldLicenseFormatterStep.kt +++ /dev/null @@ -1,58 +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.gradle.spotless - -import com.diffplug.spotless.FormatterFunc -import com.diffplug.spotless.FormatterStep - -/** - * Removes the old copyright statements which were incorrectly located between the package and - * import statements. These legacy copyright blocks also uses with an unexpected opening comment - * tag. This FormatterStep removes those comment blocks using a very conservative approach to avoid - * mutilating actual code. - */ -class StripOldLicenseFormatterStep { - companion object { - private const val NAME = "StripOldLicense" - - fun create(): FormatterStep { - return FormatterStep.create(NAME, State(), State::toFormatter) - } - } - - private class State : java.io.Serializable { - - fun toFormatter(): FormatterFunc { - return FormatterFunc { unixStr -> - val lines = unixStr.split('\n') - val result = ArrayList(lines.size) - var inComment = false - lines.forEach { s -> - if (!inComment && s.trim().startsWith("/*-")) { - inComment = true - } else if (inComment && s.trim().startsWith("*/")) { - inComment = false - } else if (!inComment) { - result.add(s) - } - } - - result.joinToString("\n") - } - } - } -} diff --git a/gradle/plugins/src/main/kotlin/com/hedera/gradle/utils/Utils.kt b/gradle/plugins/src/main/kotlin/com/hedera/gradle/utils/Utils.kt deleted file mode 100644 index 948ce171e8b6..000000000000 --- a/gradle/plugins/src/main/kotlin/com/hedera/gradle/utils/Utils.kt +++ /dev/null @@ -1,50 +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.gradle.utils - -import java.io.OutputStream -import java.io.PrintStream -import org.gradle.api.file.Directory -import org.gradle.api.file.RegularFile - -object Utils { - // Find the version.txt in the root of the repository, independent of - // which build is started from where. - @JvmStatic - fun Directory.versionTxt(): RegularFile = - file("version.txt").let { if (it.asFile.exists()) it else this.dir("..").versionTxt() } - - @JvmStatic - fun generateProjectVersionReport(version: String, 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 - writer.printf("| %s | %s |\n", "hedera-node", version) - writer.printf("| %s | %s |\n", "platform-sdk", version) - writer.flush() - ostream.flush() - } - } - } -} diff --git a/gradle/toolchain-versions.properties b/gradle/toolchain-versions.properties new file mode 100644 index 000000000000..04e458faeff5 --- /dev/null +++ b/gradle/toolchain-versions.properties @@ -0,0 +1 @@ +jdk=21.0.4 diff --git a/hapi/build.gradle.kts b/hapi/build.gradle.kts index 4f27c86b57eb..812f5752b0ea 100644 --- a/hapi/build.gradle.kts +++ b/hapi/build.gradle.kts @@ -1,23 +1,8 @@ -/* - * 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. - */ - +// SPDX-License-Identifier: Apache-2.0 plugins { - id("com.hedera.gradle.protobuf") - id("com.hedera.gradle.services-publish") - id("com.hedera.gradle.feature.test-fixtures") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.protobuf") + id("org.hiero.gradle.feature.test-fixtures") id("com.hedera.pbj.pbj-compiler") version "0.9.2" } @@ -56,3 +41,15 @@ testModuleInfo { requires("org.junit.jupiter.api") requires("org.junit.jupiter.params") } + +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" + // us parallel GC to keep up with high temporary garbage creation, + // and allow GC to use 40% of CPU if needed + jvmArgs("-XX:+UseParallelGC", "-XX:GCTimeRatio=90") +} diff --git a/hedera-dependency-versions/build.gradle.kts b/hedera-dependency-versions/build.gradle.kts deleted file mode 100644 index 5b08c4be413f..000000000000 --- a/hedera-dependency-versions/build.gradle.kts +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Copyright (C) 2023 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.gradle.versions") -} - -dependencies { - api(enforcedPlatform("io.netty:netty-bom:4.1.110.Final")) - - // forward logging from modules using SLF4J (e.g. 'org.hyperledger.besu.evm') to Log4J - runtime("org.apache.logging.log4j:log4j-slf4j2-impl") { - because("org.apache.logging.log4j.slf4j2.impl") - } -} - -dependencies.constraints { - api("io.helidon.common:helidon-common:4.1.1") { - because("io.helidon.common") - } - api("io.helidon.webclient:helidon-webclient:4.1.1") { - because("io.helidon.webclient") - } - api("io.helidon.webclient:helidon-webclient-grpc:4.1.1") { - because("io.helidon.webclient.grpc") - } - api("org.awaitility:awaitility:4.2.0") { - because("awaitility") - } - api("com.fasterxml.jackson.core:jackson-core:2.16.0") { - because("com.fasterxml.jackson.core") - } - api("com.fasterxml.jackson.core:jackson-databind:2.16.0") { - because("com.fasterxml.jackson.databind") - } - api("com.github.ben-manes.caffeine:caffeine:3.1.1") { - because("com.github.benmanes.caffeine") - } - api("com.github.docker-java:docker-java-api:3.2.13") { - because("com.github.dockerjava.api") - } - 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.auto.service:auto-service:1.1.1") { - because("com.google.auto.service.processor") - } - api("com.google.guava:guava:33.1.0-jre") { - because("com.google.common") - } - api("com.google.j2objc:j2objc-annotations:3.0.0") { - because("com.google.j2objc.annotations") - } - api("com.google.jimfs:jimfs:1.2") { - because("com.google.jimfs") - } - api("com.google.protobuf:protobuf-java:4.28.2") { - because("com.google.protobuf") - } - api("com.google.protobuf:protobuf-java-util:4.28.2") { - because("com.google.protobuf.util") - } - api("com.hedera.pbj:pbj-runtime:0.9.2") { - because("com.hedera.pbj.runtime") - } - api("com.squareup:javapoet:1.13.0") { - because("com.squareup.javapoet") - } - api("net.java.dev.jna:jna:5.12.1") { - because("com.sun.jna") - } - api("com.google.dagger:dagger:2.42") { - because("dagger") - } - api("com.google.dagger:dagger-compiler:2.42") { - because("dagger.compiler") - } - api("io.grpc:grpc-netty:1.64.0") { - because("io.grpc.netty") - } - api("io.grpc:grpc-protobuf:1.64.0") { - because("io.grpc.protobuf") - } - api("io.grpc:grpc-stub:1.64.0") { - because("io.grpc.stub") - } - api("com.esaulpaugh:headlong:6.1.1") { - because("headlong") - } - api("info.picocli:picocli:4.6.3") { - because("info.picocli") - } - api("io.github.classgraph:classgraph:4.8.65") { - because("io.github.classgraph") - } - api("io.netty:netty-handler:4.1.115.Final") { - because("io.netty.handler") - } - api("io.netty:netty-transport:4.1.111.Final") { - because("io.netty.transport") - } - api("io.netty:netty-transport-classes-epoll:4.1.111.Final") { - because("io.netty.transport.classes.epoll") - } - api("io.perfmark:perfmark-api:0.25.0") { - because("io.perfmark") - } - api("io.prometheus:simpleclient:0.16.0") { - because("io.prometheus.simpleclient") - } - api("io.prometheus:simpleclient_httpserver:0.16.0") { - because("io.prometheus.simpleclient.httpserver") - } - api("jakarta.inject:jakarta.inject-api:2.0.1") { - because("jakarta.inject") - } - api("javax.inject:javax.inject:1") { - because("javax.inject") - } - api("com.goterl:lazysodium-java:5.1.4") { - because("lazysodium.java") - } - api("net.i2p.crypto:eddsa:0.3.0") { - because("net.i2p.crypto.eddsa") - } - api("org.antlr:antlr4-runtime:4.13.1") { - because("org.antlr.antlr4.runtime") - } - api("commons-codec:commons-codec:1.15") { - because("org.apache.commons.codec") - } - api("org.apache.commons:commons-collections4:4.4") { - because("org.apache.commons.collections4") - } - api("commons-io:commons-io:2.15.1") { - because("org.apache.commons.io") - } - api("org.apache.commons:commons-lang3:3.14.0") { - because("org.apache.commons.lang3") - } - api("org.apache.commons:commons-compress:1.26.0") { - because("org.apache.commons.compress") - } - api("org.apache.logging.log4j:log4j-api:2.21.1") { - because("org.apache.logging.log4j") - } - api("org.apache.logging.log4j:log4j-core:2.21.1") { - because("org.apache.logging.log4j.core") - } - api("org.apache.logging.log4j:log4j-slf4j2-impl:2.21.1") { - because("org.apache.logging.log4j.slf4j2.impl") - } - api("org.assertj:assertj-core:3.23.1") { - because("org.assertj.core") - } - api("org.bouncycastle:bcpkix-jdk18on:1.79") { - because("org.bouncycastle.pkix") - } - api("org.bouncycastle:bcprov-jdk18on:1.78") { - because("org.bouncycastle.provider") - } - api("org.eclipse.collections:eclipse-collections-api:10.4.0") { - because("org.eclipse.collections.api") - } - api("org.eclipse.collections:eclipse-collections:10.4.0") { - because("org.eclipse.collections.impl") - } - api("org.hamcrest:hamcrest:2.2") { - because("org.hamcrest") - } - api("org.hyperledger.besu:besu-datatypes:24.3.3") { - because("org.hyperledger.besu.datatypes") - } - api("org.hyperledger.besu:evm:24.3.3") { - because("org.hyperledger.besu.evm") - } - api("org.hyperledger.besu:secp256k1:0.8.2") { - because("org.hyperledger.besu.nativelib.secp256k1") - } - api("org.json:json:20231013") { - because("org.json") - } - api("org.junit.jupiter:junit-jupiter-api:5.10.2") { - because("org.junit.jupiter.api") - } - api("org.junit.jupiter:junit-jupiter-engine:5.10.2") { - because("org.junit.jupiter.engine") - } - api("org.junit-pioneer:junit-pioneer:2.0.1") { - because("org.junitpioneer") - } - 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.opentest4j:opentest4j:1.2.0") { - because("org.opentest4j") - } - api("org.testcontainers:testcontainers:1.17.2") { - because("org.testcontainers") - } - api("org.testcontainers:junit-jupiter:1.17.2") { - because("org.testcontainers.junit.jupiter") - } - api("org.yaml:snakeyaml:2.2") { - because("org.yaml.snakeyaml") - } - api("io.tmio:tuweni-bytes:2.4.2") { - because("tuweni.bytes") - } - api("io.tmio:tuweni-units:2.4.2") { - because("tuweni.units") - } - api("uk.org.webcompere:system-stubs-core:2.1.5") { - because("uk.org.webcompere.systemstubs.core") - } - api("uk.org.webcompere:system-stubs-jupiter:2.1.5") { - because("uk.org.webcompere.systemstubs.jupiter") - } - api("com.google.protobuf:protoc:3.25.4") - api("io.grpc:protoc-gen-grpc-java:1.66.0") - - api("com.hedera.cryptography:hedera-cryptography-pairings-api:0.1.1-SNAPSHOT") { - because("com.hedera.cryptography.pairings.api") - } - api("com.hedera.cryptography:hedera-cryptography-altbn128:0.1.1-SNAPSHOT") { - because("com.hedera.cryptography.altbn128") - } - api("com.hedera.cryptography:hedera-cryptography-bls:0.1.1-SNAPSHOT") { - because("com.hedera.cryptography.bls") - } - api("com.hedera.cryptography:hedera-cryptography-tss:0.1.1-SNAPSHOT") { - because("com.hedera.cryptography.tss") - } -} diff --git a/hedera-node/hapi-fees/build.gradle.kts b/hedera-node/hapi-fees/build.gradle.kts index 05a8a548c047..46e7dc30a6c9 100644 --- a/hedera-node/hapi-fees/build.gradle.kts +++ b/hedera-node/hapi-fees/build.gradle.kts @@ -1,23 +1,5 @@ -/* - * Copyright (C) 2020-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.gradle.services") - id("com.hedera.gradle.services-publish") -} +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.module.library") } description = "Hedera Services API Fees" diff --git a/hedera-node/hapi-utils/build.gradle.kts b/hedera-node/hapi-utils/build.gradle.kts index 8efcebff1949..c5a12228e970 100644 --- a/hedera-node/hapi-utils/build.gradle.kts +++ b/hedera-node/hapi-utils/build.gradle.kts @@ -1,23 +1,5 @@ -/* - * Copyright (C) 2020-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.gradle.services") - id("com.hedera.gradle.services-publish") -} +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.module.library") } description = "Hedera Services API Utilities" diff --git a/hedera-node/hapi-utils/src/main/java/module-info.java b/hedera-node/hapi-utils/src/main/java/module-info.java index d1e778ce3a49..c86fcb960ade 100644 --- a/hedera-node/hapi-utils/src/main/java/module-info.java +++ b/hedera-node/hapi-utils/src/main/java/module-info.java @@ -16,11 +16,11 @@ exports com.hedera.node.app.hapi.utils.sysfiles.validation; requires transitive com.hedera.node.hapi; + requires transitive com.hedera.pbj.runtime; requires transitive com.swirlds.common; + requires transitive com.esaulpaugh.headlong; requires transitive com.google.protobuf; - requires transitive com.hedera.pbj.runtime; requires transitive dagger; - requires transitive headlong; requires transitive java.compiler; requires transitive javax.inject; requires transitive net.i2p.crypto.eddsa; diff --git a/hedera-node/hedera-addressbook-service-impl/build.gradle.kts b/hedera-node/hedera-addressbook-service-impl/build.gradle.kts index 6c467b8d103b..2488f678ea55 100644 --- a/hedera-node/hedera-addressbook-service-impl/build.gradle.kts +++ b/hedera-node/hedera-addressbook-service-impl/build.gradle.kts @@ -1,23 +1,5 @@ -/* - * Copyright (C) 2020-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.gradle.services") - id("com.hedera.gradle.services-publish") -} +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.module.library") } description = "Default Hedera AddressBook Service Implementation" diff --git a/hedera-node/hedera-addressbook-service/build.gradle.kts b/hedera-node/hedera-addressbook-service/build.gradle.kts index 2d0fd03761ac..4a6257b4d836 100644 --- a/hedera-node/hedera-addressbook-service/build.gradle.kts +++ b/hedera-node/hedera-addressbook-service/build.gradle.kts @@ -1,23 +1,5 @@ -/* - * 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.gradle.services") - id("com.hedera.gradle.services-publish") -} +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.module.library") } description = "Hedera AddressBook Service API" diff --git a/hedera-node/hedera-app-spi/build.gradle.kts b/hedera-node/hedera-app-spi/build.gradle.kts index 15c75ed4f248..4b9eb3f1c42c 100644 --- a/hedera-node/hedera-app-spi/build.gradle.kts +++ b/hedera-node/hedera-app-spi/build.gradle.kts @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2020-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("com.hedera.gradle.services") - id("com.hedera.gradle.services-publish") - id("com.hedera.gradle.feature.test-fixtures") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.test-fixtures") } description = "Hedera Application - SPI" diff --git a/hedera-node/hedera-app/build.gradle.kts b/hedera-node/hedera-app/build.gradle.kts index 6fed947beaa7..ebcf3e45a546 100644 --- a/hedera-node/hedera-app/build.gradle.kts +++ b/hedera-node/hedera-app/build.gradle.kts @@ -1,24 +1,8 @@ -/* - * Copyright (C) 2020-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("com.hedera.gradle.services") - id("com.hedera.gradle.services-publish") - id("com.hedera.gradle.feature.benchmark") - id("com.hedera.gradle.feature.test-fixtures") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.benchmark") + id("org.hiero.gradle.feature.test-fixtures") } description = "Hedera Application - Implementation" @@ -48,7 +32,7 @@ testModuleInfo { requires("com.swirlds.state.api.test.fixtures") requires("com.swirlds.state.impl.test.fixtures") requires("com.swirlds.base.test.fixtures") - requires("headlong") + requires("com.esaulpaugh.headlong") requires("org.assertj.core") requires("org.bouncycastle.provider") requires("org.junit.jupiter.api") diff --git a/hedera-node/hedera-app/src/main/java/module-info.java b/hedera-node/hedera-app/src/main/java/module-info.java index d8f36a06acf0..4a1d2c813bbe 100644 --- a/hedera-node/hedera-app/src/main/java/module-info.java +++ b/hedera-node/hedera-app/src/main/java/module-info.java @@ -2,6 +2,9 @@ import com.swirlds.config.api.ConfigurationExtension; module com.hedera.node.app { + requires transitive com.hedera.cryptography.bls; + requires transitive com.hedera.cryptography.pairings.api; + requires transitive com.hedera.cryptography.tss; requires transitive com.hedera.node.app.hapi.utils; requires transitive com.hedera.node.app.service.addressbook.impl; requires transitive com.hedera.node.app.service.addressbook; @@ -17,16 +20,13 @@ requires transitive com.hedera.node.app.spi; requires transitive com.hedera.node.config; requires transitive com.hedera.node.hapi; + requires transitive com.hedera.pbj.runtime; requires transitive com.swirlds.common; requires transitive com.swirlds.config.api; requires transitive com.swirlds.metrics.api; requires transitive com.swirlds.platform.core; requires transitive com.swirlds.state.api; requires transitive com.swirlds.state.impl; - requires transitive com.hedera.cryptography.bls; - requires transitive com.hedera.cryptography.pairings.api; - requires transitive com.hedera.cryptography.tss; - requires transitive com.hedera.pbj.runtime; requires transitive dagger; requires transitive io.grpc.stub; requires transitive javax.inject; diff --git a/hedera-node/hedera-config/build.gradle.kts b/hedera-node/hedera-config/build.gradle.kts index 7485155dc32f..2c631f903e67 100644 --- a/hedera-node/hedera-config/build.gradle.kts +++ b/hedera-node/hedera-config/build.gradle.kts @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2020-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("com.hedera.gradle.services") - id("com.hedera.gradle.services-publish") - id("com.hedera.gradle.feature.test-fixtures") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.test-fixtures") } description = "Hedera Configuration" diff --git a/hedera-node/hedera-consensus-service-impl/build.gradle.kts b/hedera-node/hedera-consensus-service-impl/build.gradle.kts index 67f55402d6f2..6b62f1b9378d 100644 --- a/hedera-node/hedera-consensus-service-impl/build.gradle.kts +++ b/hedera-node/hedera-consensus-service-impl/build.gradle.kts @@ -1,23 +1,5 @@ -/* - * Copyright (C) 2020-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.gradle.services") - id("com.hedera.gradle.services-publish") -} +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.module.library") } description = "Default Hedera Consensus Service Implementation" diff --git a/hedera-node/hedera-consensus-service/build.gradle.kts b/hedera-node/hedera-consensus-service/build.gradle.kts index 04a3aa43ffc0..b9cb9549942e 100644 --- a/hedera-node/hedera-consensus-service/build.gradle.kts +++ b/hedera-node/hedera-consensus-service/build.gradle.kts @@ -1,23 +1,5 @@ -/* - * Copyright (C) 2020-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.gradle.services") - id("com.hedera.gradle.services-publish") -} +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.module.library") } description = "Hedera Consensus Service API" diff --git a/hedera-node/hedera-file-service-impl/build.gradle.kts b/hedera-node/hedera-file-service-impl/build.gradle.kts index 0eeaea14bdac..70616c177b01 100644 --- a/hedera-node/hedera-file-service-impl/build.gradle.kts +++ b/hedera-node/hedera-file-service-impl/build.gradle.kts @@ -1,23 +1,5 @@ -/* - * Copyright (C) 2020-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.gradle.services") - id("com.hedera.gradle.services-publish") -} +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.module.library") } description = "Default Hedera File Service Implementation" diff --git a/hedera-node/hedera-file-service/build.gradle.kts b/hedera-node/hedera-file-service/build.gradle.kts index 8a4a2c69c71a..4052e8cbec2f 100644 --- a/hedera-node/hedera-file-service/build.gradle.kts +++ b/hedera-node/hedera-file-service/build.gradle.kts @@ -1,23 +1,5 @@ -/* - * Copyright (C) 2020-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.gradle.services") - id("com.hedera.gradle.services-publish") -} +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.module.library") } description = "Hedera File Service API" diff --git a/hedera-node/hedera-network-admin-service-impl/build.gradle.kts b/hedera-node/hedera-network-admin-service-impl/build.gradle.kts index 07590e13359a..1ee96862d441 100644 --- a/hedera-node/hedera-network-admin-service-impl/build.gradle.kts +++ b/hedera-node/hedera-network-admin-service-impl/build.gradle.kts @@ -1,23 +1,5 @@ -/* - * Copyright (C) 2020-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.gradle.services") - id("com.hedera.gradle.services-publish") -} +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.module.library") } description = "Default Hedera Network Admin Service Implementation" diff --git a/hedera-node/hedera-network-admin-service/build.gradle.kts b/hedera-node/hedera-network-admin-service/build.gradle.kts index e4844ed09c55..a68487744e76 100644 --- a/hedera-node/hedera-network-admin-service/build.gradle.kts +++ b/hedera-node/hedera-network-admin-service/build.gradle.kts @@ -1,23 +1,5 @@ -/* - * Copyright (C) 2020-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.gradle.services") - id("com.hedera.gradle.services-publish") -} +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.module.library") } description = "Hedera NetworkAdmin Service API" diff --git a/hedera-node/hedera-schedule-service-impl/build.gradle.kts b/hedera-node/hedera-schedule-service-impl/build.gradle.kts index 149f263fe93f..5a076bb811e5 100644 --- a/hedera-node/hedera-schedule-service-impl/build.gradle.kts +++ b/hedera-node/hedera-schedule-service-impl/build.gradle.kts @@ -1,23 +1,5 @@ -/* - * Copyright (C) 2020-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.gradle.services") - id("com.hedera.gradle.services-publish") -} +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.module.library") } description = "Default Hedera Schedule Service Implementation" diff --git a/hedera-node/hedera-schedule-service/build.gradle.kts b/hedera-node/hedera-schedule-service/build.gradle.kts index b187f3d2a100..7e5424f5e6e9 100644 --- a/hedera-node/hedera-schedule-service/build.gradle.kts +++ b/hedera-node/hedera-schedule-service/build.gradle.kts @@ -1,23 +1,5 @@ -/* - * Copyright (C) 2020-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.gradle.services") - id("com.hedera.gradle.services-publish") -} +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.module.library") } description = "Hedera Schedule Service API" diff --git a/hedera-node/hedera-smart-contract-service-impl/build.gradle.kts b/hedera-node/hedera-smart-contract-service-impl/build.gradle.kts index 694111ddf40e..55fad9948bde 100644 --- a/hedera-node/hedera-smart-contract-service-impl/build.gradle.kts +++ b/hedera-node/hedera-smart-contract-service-impl/build.gradle.kts @@ -1,23 +1,5 @@ -/* - * Copyright (C) 2020-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.gradle.services") - id("com.hedera.gradle.services-publish") -} +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.module.library") } description = "Default Hedera Smart Contract Service Implementation" diff --git a/hedera-node/hedera-smart-contract-service-impl/src/main/java/module-info.java b/hedera-node/hedera-smart-contract-service-impl/src/main/java/module-info.java index 67f84fa6aea4..a8fd4cac7bfa 100644 --- a/hedera-node/hedera-smart-contract-service-impl/src/main/java/module-info.java +++ b/hedera-node/hedera-smart-contract-service-impl/src/main/java/module-info.java @@ -11,12 +11,12 @@ requires transitive com.hedera.node.app.spi; requires transitive com.hedera.node.config; requires transitive com.hedera.node.hapi; + requires transitive com.hedera.pbj.runtime; requires transitive com.swirlds.config.api; requires transitive com.swirlds.metrics.api; requires transitive com.swirlds.state.api; - requires transitive com.hedera.pbj.runtime; + requires transitive com.esaulpaugh.headlong; requires transitive dagger; - requires transitive headlong; requires transitive javax.inject; requires transitive org.apache.logging.log4j; requires transitive org.hyperledger.besu.datatypes; diff --git a/hedera-node/hedera-smart-contract-service/build.gradle.kts b/hedera-node/hedera-smart-contract-service/build.gradle.kts index d855b687dbf0..408ec1528a01 100644 --- a/hedera-node/hedera-smart-contract-service/build.gradle.kts +++ b/hedera-node/hedera-smart-contract-service/build.gradle.kts @@ -1,23 +1,5 @@ -/* - * Copyright (C) 2020-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.gradle.services") - id("com.hedera.gradle.services-publish") -} +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.module.library") } description = "Hedera Smart Contract Service API" diff --git a/hedera-node/hedera-token-service-impl/build.gradle.kts b/hedera-node/hedera-token-service-impl/build.gradle.kts index 7c29af184a48..57f0dc52559c 100644 --- a/hedera-node/hedera-token-service-impl/build.gradle.kts +++ b/hedera-node/hedera-token-service-impl/build.gradle.kts @@ -1,23 +1,5 @@ -/* - * Copyright (C) 2020-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.gradle.services") - id("com.hedera.gradle.services-publish") -} +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.module.library") } description = "Default Hedera Token Service Implementation" diff --git a/hedera-node/hedera-token-service/build.gradle.kts b/hedera-node/hedera-token-service/build.gradle.kts index f8e09e6d5f3f..aa46421f1e9c 100644 --- a/hedera-node/hedera-token-service/build.gradle.kts +++ b/hedera-node/hedera-token-service/build.gradle.kts @@ -1,23 +1,7 @@ -/* - * Copyright (C) 2020-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("com.hedera.gradle.services") - id("com.hedera.gradle.services-publish") - id("com.hedera.gradle.feature.test-fixtures") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.test-fixtures") } description = "Hedera Token Service API" diff --git a/hedera-node/hedera-util-service-impl/build.gradle.kts b/hedera-node/hedera-util-service-impl/build.gradle.kts index e76f4f360ac1..203d36538fff 100644 --- a/hedera-node/hedera-util-service-impl/build.gradle.kts +++ b/hedera-node/hedera-util-service-impl/build.gradle.kts @@ -1,23 +1,5 @@ -/* - * Copyright (C) 2020-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.gradle.services") - id("com.hedera.gradle.services-publish") -} +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.module.library") } description = "Default Hedera Util Service Implementation" diff --git a/hedera-node/hedera-util-service/build.gradle.kts b/hedera-node/hedera-util-service/build.gradle.kts index 3ce441d52601..ed5583a0b20b 100644 --- a/hedera-node/hedera-util-service/build.gradle.kts +++ b/hedera-node/hedera-util-service/build.gradle.kts @@ -1,23 +1,5 @@ -/* - * Copyright (C) 2020-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.gradle.services") - id("com.hedera.gradle.services-publish") -} +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.module.library") } description = "Hedera Util Service API" diff --git a/hedera-node/test-clients/build.gradle.kts b/hedera-node/test-clients/build.gradle.kts index d1917f4b9be6..85d1781bb14d 100644 --- a/hedera-node/test-clients/build.gradle.kts +++ b/hedera-node/test-clients/build.gradle.kts @@ -1,24 +1,10 @@ -/* - * 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. - */ - +// 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("com.hedera.gradle.services") - id("com.hedera.gradle.shadow-jar") + id("org.hiero.gradle.module.application") + id("com.gradleup.shadow") version "8.3.0" } description = "Hedera Services Test Clients for End to End Tests (EET)" @@ -37,6 +23,8 @@ sourceSets { create("yahcli") } +tasks.withType().configureEach { options.compilerArgs.add("-Xlint:-exports") } + tasks.register("runTestClient") { group = "build" description = "Run a test client via -PtestClient=" @@ -271,17 +259,23 @@ tasks.register("testRepeatable") { modularity.inferModulePath.set(false) } -tasks.shadowJar { - archiveFileName.set("SuiteRunner.jar") +tasks.withType().configureEach { + group = "shadow" + from(sourceSets.main.get().output) + mergeServiceFiles() - manifest { - attributes( - "Main-Class" to "com.hedera.services.bdd.suites.SuiteRunner", - "Multi-Release" to "true" - ) - } + manifest { attributes("Multi-Release" to "true") } + + // There is an issue in the shadow plugin that it automatically accesses the + // files in 'runtimeClasspath' while Gradle is building the task graph. + // See: https://github.com/GradleUp/shadow/issues/882 + dependencyFilter = NoResolveDependencyFilter() } +application.mainClass = "com.hedera.services.bdd.suites.SuiteRunner" + +tasks.shadowJar { archiveFileName.set("SuiteRunner.jar") } + val yahCliJar = tasks.register("yahCliJar") { exclude(listOf("META-INF/*.DSA", "META-INF/*.RSA", "META-INF/*.SF", "META-INF/INDEX.LIST")) @@ -289,12 +283,7 @@ val yahCliJar = archiveClassifier.set("yahcli") configurations = listOf(project.configurations.getByName("yahcliRuntimeClasspath")) - manifest { - attributes( - "Main-Class" to "com.hedera.services.yahcli.Yahcli", - "Multi-Release" to "true" - ) - } + manifest { attributes("Main-Class" to "com.hedera.services.yahcli.Yahcli") } } val rcdiffJar = @@ -306,12 +295,7 @@ val rcdiffJar = archiveFileName.set("rcdiff.jar") configurations = listOf(project.configurations.getByName("rcdiffRuntimeClasspath")) - manifest { - attributes( - "Main-Class" to "com.hedera.services.rcdiff.RcDiffCmdWrapper", - "Multi-Release" to "true" - ) - } + manifest { attributes("Main-Class" to "com.hedera.services.rcdiff.RcDiffCmdWrapper") } } val validationJar = @@ -323,8 +307,7 @@ val validationJar = manifest { attributes( "Main-Class" to - "com.hedera.services.bdd.suites.utils.validation.ValidationScenarios", - "Multi-Release" to "true" + "com.hedera.services.bdd.suites.utils.validation.ValidationScenarios" ) } } @@ -360,3 +343,9 @@ tasks.clean { dependsOn(cleanYahCli) dependsOn(cleanValidation) } + +class NoResolveDependencyFilter : DefaultDependencyFilter(project) { + override fun resolve(configuration: FileCollection): FileCollection { + return configuration + } +} diff --git a/hedera-node/test-clients/src/main/java/module-info.java b/hedera-node/test-clients/src/main/java/module-info.java index 9a86ac44db27..3ccf526dd253 100644 --- a/hedera-node/test-clients/src/main/java/module-info.java +++ b/hedera-node/test-clients/src/main/java/module-info.java @@ -64,33 +64,11 @@ exports com.hedera.services.bdd.utils; exports com.hedera.services.bdd.junit.restart; - requires transitive com.hedera.node.app.hapi.fees; - requires transitive com.hedera.node.app.hapi.utils; - requires transitive com.hedera.node.app.spi; - requires transitive com.hedera.node.app.test.fixtures; - requires transitive com.hedera.node.app; - requires transitive com.hedera.node.config; - requires transitive com.hedera.node.hapi; - requires transitive com.swirlds.base; - requires transitive com.swirlds.common; - requires transitive com.swirlds.config.api; - requires transitive com.swirlds.metrics.api; - requires transitive com.swirlds.platform.core; - requires transitive com.swirlds.state.api; - requires transitive com.fasterxml.jackson.annotation; - requires transitive com.google.common; - requires transitive com.google.protobuf; - requires transitive com.hedera.cryptography.bls; - requires transitive com.hedera.cryptography.tss; - requires transitive headlong; - requires transitive io.grpc; - requires transitive net.i2p.crypto.eddsa; - requires transitive org.apache.commons.io; - requires transitive org.apache.logging.log4j; - requires transitive org.junit.jupiter.api; - requires transitive org.junit.platform.launcher; - requires transitive org.testcontainers; - requires transitive tuweni.bytes; + requires com.hedera.cryptography.bls; + requires com.hedera.cryptography.pairings.api; + requires com.hedera.cryptography.tss; + requires com.hedera.node.app.hapi.fees; + requires com.hedera.node.app.hapi.utils; requires com.hedera.node.app.service.addressbook.impl; requires com.hedera.node.app.service.addressbook; requires com.hedera.node.app.service.contract.impl; @@ -98,34 +76,56 @@ requires com.hedera.node.app.service.schedule; requires com.hedera.node.app.service.token.impl; requires com.hedera.node.app.service.token; + requires com.hedera.node.app.spi; + requires com.hedera.node.app.test.fixtures; + requires com.hedera.node.app; + requires com.hedera.node.config; + requires com.hedera.node.hapi; requires com.swirlds.base.test.fixtures; + requires com.swirlds.base; + requires com.swirlds.common; + requires com.swirlds.config.api; requires com.swirlds.merkledb; + requires com.swirlds.metrics.api; requires com.swirlds.platform.core.test.fixtures; + requires com.swirlds.platform.core; + requires com.swirlds.state.api; requires com.swirlds.state.impl; requires com.swirlds.virtualmap; + requires com.esaulpaugh.headlong; + requires com.fasterxml.jackson.annotation; requires com.fasterxml.jackson.core; requires com.fasterxml.jackson.databind; requires com.github.dockerjava.api; - requires com.hedera.cryptography.pairings.api; + requires com.google.common; + requires com.google.protobuf; requires com.sun.jna; requires io.grpc.netty; requires io.grpc.stub; + requires io.grpc; requires io.netty.handler; requires java.desktop; requires java.net.http; + requires net.i2p.crypto.eddsa; + requires org.apache.commons.io; requires org.apache.commons.lang3; requires org.apache.logging.log4j.core; + requires org.apache.logging.log4j; requires org.assertj.core; requires org.bouncycastle.provider; requires org.hyperledger.besu.datatypes; requires org.hyperledger.besu.internal.crypto; requires org.hyperledger.besu.nativelib.secp256k1; requires org.json; + requires org.junit.jupiter.api; requires org.junit.platform.commons; + requires org.junit.platform.launcher; requires org.opentest4j; + requires org.testcontainers; requires org.yaml.snakeyaml; + requires tuweni.bytes; requires tuweni.units; - requires static com.github.spotbugs.annotations; requires static com.hedera.pbj.runtime; + requires static com.github.spotbugs.annotations; requires static org.junit.platform.engine; } diff --git a/hedera-node/test-clients/src/yahcli/java/module-info.java b/hedera-node/test-clients/src/yahcli/java/module-info.java index c0e5cc0e5bd3..be9118c3c2ad 100644 --- a/hedera-node/test-clients/src/yahcli/java/module-info.java +++ b/hedera-node/test-clients/src/yahcli/java/module-info.java @@ -7,6 +7,7 @@ requires com.swirlds.common; requires com.github.spotbugs.annotations; requires com.google.common; + requires com.google.protobuf; requires info.picocli; requires net.i2p.crypto.eddsa; requires org.apache.logging.log4j; diff --git a/hiero-dependency-versions/build.gradle.kts b/hiero-dependency-versions/build.gradle.kts new file mode 100644 index 000000000000..540699572d2e --- /dev/null +++ b/hiero-dependency-versions/build.gradle.kts @@ -0,0 +1,126 @@ +// SPDX-License-Identifier: Apache-2.0 +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 { + api(enforcedPlatform("io.netty:netty-bom:4.1.110.Final")) + + // forward logging from modules using SLF4J (e.g. 'org.hyperledger.besu.evm') to Log4J + runtime("org.apache.logging.log4j:log4j-slf4j2-impl") { + because("org.apache.logging.log4j.slf4j2.impl") + } +} + +dependencies.constraints { + api("io.helidon.common:helidon-common:4.1.1") { because("io.helidon.common") } + api("io.helidon.webclient:helidon-webclient:4.1.1") { because("io.helidon.webclient") } + api("io.helidon.webclient:helidon-webclient-grpc:4.1.1") { + because("io.helidon.webclient.grpc") + } + api("org.awaitility:awaitility:4.2.0") { because("awaitility") } + api("com.fasterxml.jackson.core:jackson-core:2.16.0") { because("com.fasterxml.jackson.core") } + api("com.fasterxml.jackson.core:jackson-databind:2.16.0") { + because("com.fasterxml.jackson.databind") + } + api("com.github.ben-manes.caffeine:caffeine:3.1.1") { because("com.github.benmanes.caffeine") } + api("com.github.docker-java:docker-java-api:3.2.13") { because("com.github.dockerjava.api") } + 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.auto.service:auto-service:1.1.1") { + because("com.google.auto.service.processor") + } + 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.jimfs:jimfs:1.2") { because("com.google.jimfs") } + api("com.google.protobuf:protobuf-java:4.28.2") { because("com.google.protobuf") } + api("com.google.protobuf:protobuf-java-util:4.28.2") { because("com.google.protobuf.util") } + api("com.hedera.pbj:pbj-runtime:0.9.2") { because("com.hedera.pbj.runtime") } + api("com.squareup:javapoet:1.13.0") { because("com.squareup.javapoet") } + api("net.java.dev.jna:jna:5.12.1") { because("com.sun.jna") } + api("com.google.dagger:dagger:2.42") { because("dagger") } + api("com.google.dagger:dagger-compiler:2.42") { because("dagger.compiler") } + api("io.grpc:grpc-netty:1.64.0") { because("io.grpc.netty") } + api("io.grpc:grpc-protobuf:1.64.0") { because("io.grpc.protobuf") } + api("io.grpc:grpc-stub:1.64.0") { because("io.grpc.stub") } + api("com.esaulpaugh:headlong:6.1.1") { because("com.esaulpaugh.headlong") } + api("info.picocli:picocli:4.6.3") { because("info.picocli") } + api("io.github.classgraph:classgraph:4.8.65") { because("io.github.classgraph") } + api("io.perfmark:perfmark-api:0.25.0") { because("io.perfmark") } + api("io.prometheus:simpleclient:0.16.0") { because("io.prometheus.simpleclient") } + api("io.prometheus:simpleclient_httpserver:0.16.0") { + because("io.prometheus.simpleclient.httpserver") + } + api("jakarta.inject:jakarta.inject-api:2.0.1") { because("jakarta.inject") } + api("javax.inject:javax.inject:1") { because("javax.inject") } + api("com.goterl:lazysodium-java:5.1.4") { because("lazysodium.java") } + api("net.i2p.crypto:eddsa:0.3.0") { because("net.i2p.crypto.eddsa") } + api("org.antlr:antlr4-runtime:4.13.1") { because("org.antlr.antlr4.runtime") } + api("commons-codec:commons-codec:1.15") { because("org.apache.commons.codec") } + api("org.apache.commons:commons-collections4:4.4") { + because("org.apache.commons.collections4") + } + api("commons-io:commons-io:2.15.1") { because("org.apache.commons.io") } + api("org.apache.commons:commons-lang3:3.14.0") { because("org.apache.commons.lang3") } + api("org.apache.commons:commons-compress:1.26.0") { because("org.apache.commons.compress") } + api("org.apache.logging.log4j:log4j-api:2.21.1") { because("org.apache.logging.log4j") } + api("org.apache.logging.log4j:log4j-core:2.21.1") { because("org.apache.logging.log4j.core") } + api("org.apache.logging.log4j:log4j-slf4j2-impl:2.21.1") { + because("org.apache.logging.log4j.slf4j2.impl") + } + api("org.assertj:assertj-core:3.23.1") { because("org.assertj.core") } + api("org.bouncycastle:bcpkix-jdk18on:1.79") { because("org.bouncycastle.pkix") } + api("org.bouncycastle:bcprov-jdk18on:1.78") { because("org.bouncycastle.provider") } + api("org.eclipse.collections:eclipse-collections-api:10.4.0") { + because("org.eclipse.collections.api") + } + api("org.eclipse.collections:eclipse-collections:10.4.0") { + because("org.eclipse.collections.impl") + } + api("org.hamcrest:hamcrest:2.2") { because("org.hamcrest") } + api("org.hyperledger.besu:besu-datatypes:24.3.3") { because("org.hyperledger.besu.datatypes") } + api("org.hyperledger.besu:evm:24.3.3") { because("org.hyperledger.besu.evm") } + api("org.hyperledger.besu:secp256k1:0.8.2") { + because("org.hyperledger.besu.nativelib.secp256k1") + } + api("org.json:json:20231013") { because("org.json") } + api("org.junit.jupiter:junit-jupiter-api:5.10.2") { because("org.junit.jupiter.api") } + api("org.junit.jupiter:junit-jupiter-engine:5.10.2") { because("org.junit.jupiter.engine") } + api("org.junit-pioneer:junit-pioneer:2.0.1") { because("org.junitpioneer") } + 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.opentest4j:opentest4j:1.2.0") { because("org.opentest4j") } + api("org.testcontainers:testcontainers:1.17.2") { because("org.testcontainers") } + api("org.testcontainers:junit-jupiter:1.17.2") { because("org.testcontainers.junit.jupiter") } + api("org.yaml:snakeyaml:2.2") { because("org.yaml.snakeyaml") } + api("io.tmio:tuweni-bytes:2.4.2") { because("tuweni.bytes") } + api("io.tmio:tuweni-units:2.4.2") { because("tuweni.units") } + api("uk.org.webcompere:system-stubs-core:2.1.5") { + because("uk.org.webcompere.systemstubs.core") + } + api("uk.org.webcompere:system-stubs-jupiter:2.1.5") { + because("uk.org.webcompere.systemstubs.jupiter") + } + api("com.google.protobuf:protoc:3.25.4") + api("io.grpc:protoc-gen-grpc-java:1.66.0") + + api("com.hedera.cryptography:hedera-cryptography-pairings-api:0.1.1-SNAPSHOT") { + because("com.hedera.cryptography.pairings.api") + } + api("com.hedera.cryptography:hedera-cryptography-altbn128:0.1.1-SNAPSHOT") { + because("com.hedera.cryptography.altbn128") + } + api("com.hedera.cryptography:hedera-cryptography-bls:0.1.1-SNAPSHOT") { + because("com.hedera.cryptography.bls") + } + api("com.hedera.cryptography:hedera-cryptography-tss:0.1.1-SNAPSHOT") { + because("com.hedera.cryptography.tss") + } +} diff --git a/platform-sdk/build.gradle.kts b/platform-sdk/build.gradle.kts index c88872a30022..9a0d74b3c0c4 100644 --- a/platform-sdk/build.gradle.kts +++ b/platform-sdk/build.gradle.kts @@ -1,38 +1,17 @@ -/* - * Copyright (C) 2020-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.gradle.java") } +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.module.application") } val sdkDir = layout.projectDirectory.dir("sdk") -tasks.register("run") { - group = "application" +tasks.named("run") { workingDir = sdkDir.asFile - mainClass.set("com.swirlds.platform.Browser") + mainClass = "com.swirlds.platform.Browser" classpath = sdkDir.asFileTree.matching { include("*.jar") } jvmArgs = listOf("-agentlib:jdwp=transport=dt_socket,address=8888,server=y,suspend=n") maxHeapSize = "8g" - // Running ':assemble' of all 'platform-sdk' subprojects before, will trigger - // copyLib/copyApp, of all projects that provide an application. - dependsOn( - rootProject.subprojects - .filter { it.projectDir.absolutePath.contains("/platform-sdk/") } - .map { "${it.path}:assemble" } - ) + // Build everything for the 'sdk' folder + dependsOn(":swirlds:assemble") } val cleanRun = diff --git a/platform-sdk/consensus-gossip-impl/build.gradle.kts b/platform-sdk/consensus-gossip-impl/build.gradle.kts index 3310d8eeef45..0769a89aa6e0 100644 --- a/platform-sdk/consensus-gossip-impl/build.gradle.kts +++ b/platform-sdk/consensus-gossip-impl/build.gradle.kts @@ -1,22 +1,7 @@ -/* - * 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("com.hedera.gradle.services") - id("com.hedera.gradle.services-publish") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") } description = "Default Consensus Gossip Implementation" diff --git a/platform-sdk/consensus-gossip/build.gradle.kts b/platform-sdk/consensus-gossip/build.gradle.kts index d00919743eeb..eb94da04c3b7 100644 --- a/platform-sdk/consensus-gossip/build.gradle.kts +++ b/platform-sdk/consensus-gossip/build.gradle.kts @@ -1,22 +1,7 @@ -/* - * 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("com.hedera.gradle.services") - id("com.hedera.gradle.services-publish") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") } description = "Consensus Gossip API" diff --git a/platform-sdk/event-creator-impl/build.gradle.kts b/platform-sdk/event-creator-impl/build.gradle.kts index a8896b79d773..405e48608336 100644 --- a/platform-sdk/event-creator-impl/build.gradle.kts +++ b/platform-sdk/event-creator-impl/build.gradle.kts @@ -1,22 +1,7 @@ -/* - * 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("com.hedera.gradle.services") - id("com.hedera.gradle.services-publish") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") } mainModuleInfo { annotationProcessor("com.swirlds.config.processor") } diff --git a/platform-sdk/event-creator/build.gradle.kts b/platform-sdk/event-creator/build.gradle.kts index 004e5295ff57..eeb057d77da7 100644 --- a/platform-sdk/event-creator/build.gradle.kts +++ b/platform-sdk/event-creator/build.gradle.kts @@ -1,22 +1,7 @@ -/* - * 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("com.hedera.gradle.services") - id("com.hedera.gradle.services-publish") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") } description = "Event Creator API" diff --git a/platform-sdk/platform-apps/demos/CryptocurrencyDemo/build.gradle.kts b/platform-sdk/platform-apps/demos/CryptocurrencyDemo/build.gradle.kts index 96c6c136e38b..cb18a268ed98 100644 --- a/platform-sdk/platform-apps/demos/CryptocurrencyDemo/build.gradle.kts +++ b/platform-sdk/platform-apps/demos/CryptocurrencyDemo/build.gradle.kts @@ -1,19 +1,4 @@ -/* - * Copyright (C) 2020-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.application") } -plugins { id("com.hedera.gradle.application") } - -application.mainClass.set("com.swirlds.demo.crypto.CryptocurrencyDemoMain") +application.mainClass = "com.swirlds.demo.crypto.CryptocurrencyDemoMain" diff --git a/platform-sdk/platform-apps/demos/HelloSwirldDemo/build.gradle.kts b/platform-sdk/platform-apps/demos/HelloSwirldDemo/build.gradle.kts index 076aa930d40c..8b5bb9e58f29 100644 --- a/platform-sdk/platform-apps/demos/HelloSwirldDemo/build.gradle.kts +++ b/platform-sdk/platform-apps/demos/HelloSwirldDemo/build.gradle.kts @@ -1,19 +1,4 @@ -/* - * Copyright (C) 2020-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.application") } -plugins { id("com.hedera.gradle.application") } - -application.mainClass.set("com.swirlds.demo.hello.HelloSwirldDemoMain") +application.mainClass = "com.swirlds.demo.hello.HelloSwirldDemoMain" diff --git a/platform-sdk/platform-apps/demos/StatsDemo/build.gradle.kts b/platform-sdk/platform-apps/demos/StatsDemo/build.gradle.kts index 2a6bd33eb2c3..a5c9f650e67d 100644 --- a/platform-sdk/platform-apps/demos/StatsDemo/build.gradle.kts +++ b/platform-sdk/platform-apps/demos/StatsDemo/build.gradle.kts @@ -1,19 +1,4 @@ -/* - * Copyright (C) 2020-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.application") } -plugins { id("com.hedera.gradle.application") } - -application.mainClass.set("com.swirlds.demo.stats.StatsDemoMain") +application.mainClass = "com.swirlds.demo.stats.StatsDemoMain" diff --git a/platform-sdk/platform-apps/tests/AddressBookTestingTool/build.gradle.kts b/platform-sdk/platform-apps/tests/AddressBookTestingTool/build.gradle.kts index 6bb16a68e867..39ec1c99fb74 100644 --- a/platform-sdk/platform-apps/tests/AddressBookTestingTool/build.gradle.kts +++ b/platform-sdk/platform-apps/tests/AddressBookTestingTool/build.gradle.kts @@ -1,19 +1,4 @@ -/* - * Copyright (C) 2020-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.application") } -plugins { id("com.hedera.gradle.application") } - -application.mainClass.set("com.swirlds.demo.addressbook.AddressBookTestingToolMain") +application.mainClass = "com.swirlds.demo.addressbook.AddressBookTestingToolMain" diff --git a/platform-sdk/platform-apps/tests/ConsistencyTestingTool/build.gradle.kts b/platform-sdk/platform-apps/tests/ConsistencyTestingTool/build.gradle.kts index f5c63ad195c7..963444f299ae 100644 --- a/platform-sdk/platform-apps/tests/ConsistencyTestingTool/build.gradle.kts +++ b/platform-sdk/platform-apps/tests/ConsistencyTestingTool/build.gradle.kts @@ -1,22 +1,7 @@ -/* - * Copyright (C) 2020-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.application") } -plugins { id("com.hedera.gradle.application") } - -application.mainClass.set("com.swirlds.demo.consistency.ConsistencyTestingToolMain") +application.mainClass = "com.swirlds.demo.consistency.ConsistencyTestingToolMain" mainModuleInfo { annotationProcessor("com.swirlds.config.processor") } diff --git a/platform-sdk/platform-apps/tests/ISSTestingTool/build.gradle.kts b/platform-sdk/platform-apps/tests/ISSTestingTool/build.gradle.kts index 0ccf911efacb..25eac23b95bf 100644 --- a/platform-sdk/platform-apps/tests/ISSTestingTool/build.gradle.kts +++ b/platform-sdk/platform-apps/tests/ISSTestingTool/build.gradle.kts @@ -1,21 +1,6 @@ -/* - * Copyright (C) 2020-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.application") } -plugins { id("com.hedera.gradle.application") } - -application.mainClass.set("com.swirlds.demo.iss.ISSTestingToolMain") +application.mainClass = "com.swirlds.demo.iss.ISSTestingToolMain" mainModuleInfo { annotationProcessor("com.swirlds.config.processor") } diff --git a/platform-sdk/platform-apps/tests/MigrationTestingTool/build.gradle.kts b/platform-sdk/platform-apps/tests/MigrationTestingTool/build.gradle.kts index faf0295e6b51..e3fca20be0ff 100644 --- a/platform-sdk/platform-apps/tests/MigrationTestingTool/build.gradle.kts +++ b/platform-sdk/platform-apps/tests/MigrationTestingTool/build.gradle.kts @@ -1,22 +1,7 @@ -/* - * Copyright (C) 2020-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.application") } -plugins { id("com.hedera.gradle.application") } - -application.mainClass.set("com.swirlds.demo.migration.MigrationTestingToolMain") +application.mainClass = "com.swirlds.demo.migration.MigrationTestingToolMain" testModuleInfo { requires("org.junit.jupiter.api") diff --git a/platform-sdk/platform-apps/tests/PlatformTestingTool/build.gradle.kts b/platform-sdk/platform-apps/tests/PlatformTestingTool/build.gradle.kts index b579310c4b1a..20931d097e0c 100644 --- a/platform-sdk/platform-apps/tests/PlatformTestingTool/build.gradle.kts +++ b/platform-sdk/platform-apps/tests/PlatformTestingTool/build.gradle.kts @@ -1,22 +1,8 @@ -/* - * Copyright (C) 2020-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("com.hedera.gradle.application") - id("com.hedera.gradle.feature.test-timing-sensitive") + id("org.hiero.gradle.module.application") + id("org.hiero.gradle.feature.test-timing-sensitive") + id("com.google.protobuf") } diff --git a/platform-sdk/platform-apps/tests/StatsSigningTestingTool/build.gradle.kts b/platform-sdk/platform-apps/tests/StatsSigningTestingTool/build.gradle.kts index 110a05eb2d7a..2a4f4cf630fa 100644 --- a/platform-sdk/platform-apps/tests/StatsSigningTestingTool/build.gradle.kts +++ b/platform-sdk/platform-apps/tests/StatsSigningTestingTool/build.gradle.kts @@ -1,23 +1,8 @@ -/* - * Copyright (C) 2020-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.gradle.application") } +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.module.application") } // 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:-cast") } -application.mainClass.set("com.swirlds.demo.stats.signing.StatsSigningTestingToolMain") +application.mainClass = "com.swirlds.demo.stats.signing.StatsSigningTestingToolMain" diff --git a/platform-sdk/platform-apps/tests/StressTestingTool/build.gradle.kts b/platform-sdk/platform-apps/tests/StressTestingTool/build.gradle.kts index 780a202ff27d..240c46a781f5 100644 --- a/platform-sdk/platform-apps/tests/StressTestingTool/build.gradle.kts +++ b/platform-sdk/platform-apps/tests/StressTestingTool/build.gradle.kts @@ -1,21 +1,6 @@ -/* - * Copyright (C) 2020-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.application") } -plugins { id("com.hedera.gradle.application") } - -application.mainClass.set("com.swirlds.demo.stress.StressTestingToolMain") +application.mainClass = "com.swirlds.demo.stress.StressTestingToolMain" mainModuleInfo { annotationProcessor("com.swirlds.config.processor") } diff --git a/platform-sdk/swirlds-base/build.gradle.kts b/platform-sdk/swirlds-base/build.gradle.kts index 0393e4a78e6b..75f05600c980 100644 --- a/platform-sdk/swirlds-base/build.gradle.kts +++ b/platform-sdk/swirlds-base/build.gradle.kts @@ -1,25 +1,10 @@ -/* - * 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. - */ - +// SPDX-License-Identifier: Apache-2.0 plugins { - id("com.hedera.gradle.platform") - id("com.hedera.gradle.platform-publish") - id("com.hedera.gradle.feature.benchmark") - id("com.hedera.gradle.feature.test-fixtures") - id("com.hedera.gradle.feature.test-timing-sensitive") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") + id("org.hiero.gradle.feature.benchmark") + id("org.hiero.gradle.feature.test-fixtures") + id("org.hiero.gradle.feature.test-timing-sensitive") } // Remove the following line to enable all 'javac' lint checks that we have turned on by default diff --git a/platform-sdk/swirlds-benchmarks/build.gradle.kts b/platform-sdk/swirlds-benchmarks/build.gradle.kts index 28429d4ebed1..301cc838c712 100644 --- a/platform-sdk/swirlds-benchmarks/build.gradle.kts +++ b/platform-sdk/swirlds-benchmarks/build.gradle.kts @@ -1,24 +1,9 @@ -/* - * Copyright (C) 2020-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 me.champeau.jmh.JMHTask plugins { - id("com.hedera.gradle.platform") - id("com.hedera.gradle.feature.benchmark") + id("org.hiero.gradle.module.application") + id("org.hiero.gradle.feature.benchmark") } // Remove the following line to enable all 'javac' lint checks that we have turned on by default diff --git a/platform-sdk/swirlds-cli/build.gradle.kts b/platform-sdk/swirlds-cli/build.gradle.kts index 6daacca0a6da..162e49c8825d 100644 --- a/platform-sdk/swirlds-cli/build.gradle.kts +++ b/platform-sdk/swirlds-cli/build.gradle.kts @@ -1,22 +1,7 @@ -/* - * Copyright (C) 2020-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("com.hedera.gradle.platform") - id("com.hedera.gradle.platform-publish") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") } testModuleInfo { requires("org.junit.jupiter.api") } diff --git a/platform-sdk/swirlds-common/build.gradle.kts b/platform-sdk/swirlds-common/build.gradle.kts index 7a3984f114ef..57efac79eec7 100644 --- a/platform-sdk/swirlds-common/build.gradle.kts +++ b/platform-sdk/swirlds-common/build.gradle.kts @@ -1,24 +1,9 @@ -/* - * Copyright (C) 2020-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("com.hedera.gradle.platform") - id("com.hedera.gradle.platform-publish") - id("com.hedera.gradle.feature.test-fixtures") - id("com.hedera.gradle.feature.test-timing-sensitive") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") + id("org.hiero.gradle.feature.test-fixtures") + id("org.hiero.gradle.feature.test-timing-sensitive") } // Remove the following line to enable all 'javac' lint checks that we have turned on by default diff --git a/platform-sdk/swirlds-config-api/build.gradle.kts b/platform-sdk/swirlds-config-api/build.gradle.kts index 673cff9e1397..8220dbff3885 100644 --- a/platform-sdk/swirlds-config-api/build.gradle.kts +++ b/platform-sdk/swirlds-config-api/build.gradle.kts @@ -1,21 +1,6 @@ -/* - * 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. - */ - +// SPDX-License-Identifier: Apache-2.0 plugins { - id("com.hedera.gradle.platform") - id("com.hedera.gradle.platform-publish") - id("com.hedera.gradle.feature.test-fixtures") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") + id("org.hiero.gradle.feature.test-fixtures") } diff --git a/platform-sdk/swirlds-config-extensions/build.gradle.kts b/platform-sdk/swirlds-config-extensions/build.gradle.kts index f11a3d013c15..3c70a61a4b56 100644 --- a/platform-sdk/swirlds-config-extensions/build.gradle.kts +++ b/platform-sdk/swirlds-config-extensions/build.gradle.kts @@ -1,23 +1,8 @@ -/* - * 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. - */ - +// SPDX-License-Identifier: Apache-2.0 plugins { - id("com.hedera.gradle.platform") - id("com.hedera.gradle.platform-publish") - id("com.hedera.gradle.feature.test-fixtures") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") + id("org.hiero.gradle.feature.test-fixtures") } testModuleInfo { diff --git a/platform-sdk/swirlds-config-impl/build.gradle.kts b/platform-sdk/swirlds-config-impl/build.gradle.kts index 8b88116a6706..759600f40c22 100644 --- a/platform-sdk/swirlds-config-impl/build.gradle.kts +++ b/platform-sdk/swirlds-config-impl/build.gradle.kts @@ -1,23 +1,8 @@ -/* - * Copyright (C) 2020-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("com.hedera.gradle.platform") - id("com.hedera.gradle.platform-publish") - id("com.hedera.gradle.feature.benchmark") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") + id("org.hiero.gradle.feature.benchmark") } mainModuleInfo { annotationProcessor("com.google.auto.service.processor") } diff --git a/platform-sdk/swirlds-config-processor/build.gradle.kts b/platform-sdk/swirlds-config-processor/build.gradle.kts index 19b3d4822b37..55c249de0db4 100644 --- a/platform-sdk/swirlds-config-processor/build.gradle.kts +++ b/platform-sdk/swirlds-config-processor/build.gradle.kts @@ -1,22 +1,7 @@ -/* - * Copyright (C) 2020-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("com.hedera.gradle.platform") - id("com.hedera.gradle.platform-publish") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") } mainModuleInfo { annotationProcessor("com.google.auto.service.processor") } diff --git a/platform-sdk/swirlds-fchashmap/build.gradle.kts b/platform-sdk/swirlds-fchashmap/build.gradle.kts index 2ea867132dcc..c1580956b106 100644 --- a/platform-sdk/swirlds-fchashmap/build.gradle.kts +++ b/platform-sdk/swirlds-fchashmap/build.gradle.kts @@ -1,22 +1,7 @@ -/* - * Copyright (C) 2020-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("com.hedera.gradle.platform") - id("com.hedera.gradle.platform-publish") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") } mainModuleInfo { annotationProcessor("com.swirlds.config.processor") } diff --git a/platform-sdk/swirlds-fcqueue/build.gradle.kts b/platform-sdk/swirlds-fcqueue/build.gradle.kts index e1675a00ef13..bc0e4af8b62d 100644 --- a/platform-sdk/swirlds-fcqueue/build.gradle.kts +++ b/platform-sdk/swirlds-fcqueue/build.gradle.kts @@ -1,22 +1,7 @@ -/* - * Copyright (C) 2020-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("com.hedera.gradle.platform") - id("com.hedera.gradle.platform-publish") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") } testModuleInfo { diff --git a/platform-sdk/swirlds-logging-log4j-appender/build.gradle.kts b/platform-sdk/swirlds-logging-log4j-appender/build.gradle.kts index 6c7b688ba995..b6cabb30d2b4 100644 --- a/platform-sdk/swirlds-logging-log4j-appender/build.gradle.kts +++ b/platform-sdk/swirlds-logging-log4j-appender/build.gradle.kts @@ -1,22 +1,7 @@ -/* - * Copyright (C) 2020-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("com.hedera.gradle.platform") - id("com.hedera.gradle.platform-publish") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") } mainModuleInfo { diff --git a/platform-sdk/swirlds-logging/build.gradle.kts b/platform-sdk/swirlds-logging/build.gradle.kts index fdaa4647d989..551625be0364 100644 --- a/platform-sdk/swirlds-logging/build.gradle.kts +++ b/platform-sdk/swirlds-logging/build.gradle.kts @@ -1,26 +1,11 @@ -/* - * Copyright (C) 2020-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("com.hedera.gradle.platform") - id("com.hedera.gradle.platform-publish") - id("com.hedera.gradle.feature.benchmark") - id("com.hedera.gradle.feature.test-fixtures") - id("com.hedera.gradle.feature.test-time-consuming") - id("com.hedera.gradle.feature.test-timing-sensitive") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") + id("org.hiero.gradle.feature.benchmark") + id("org.hiero.gradle.feature.test-fixtures") + id("org.hiero.gradle.feature.test-time-consuming") + id("org.hiero.gradle.feature.test-timing-sensitive") } // Remove the following line to enable all 'javac' lint checks that we have turned on by default diff --git a/platform-sdk/swirlds-merkle/build.gradle.kts b/platform-sdk/swirlds-merkle/build.gradle.kts index 5db6bc803b11..17603b2ce2c2 100644 --- a/platform-sdk/swirlds-merkle/build.gradle.kts +++ b/platform-sdk/swirlds-merkle/build.gradle.kts @@ -1,24 +1,9 @@ -/* - * Copyright (C) 2020-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("com.hedera.gradle.platform") - id("com.hedera.gradle.platform-publish") - id("com.hedera.gradle.feature.test-fixtures") - id("com.hedera.gradle.feature.test-timing-sensitive") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") + id("org.hiero.gradle.feature.test-fixtures") + id("org.hiero.gradle.feature.test-timing-sensitive") } testModuleInfo { diff --git a/platform-sdk/swirlds-merkledb/build.gradle.kts b/platform-sdk/swirlds-merkledb/build.gradle.kts index 654d938c0731..00bf7837ba81 100644 --- a/platform-sdk/swirlds-merkledb/build.gradle.kts +++ b/platform-sdk/swirlds-merkledb/build.gradle.kts @@ -1,26 +1,11 @@ -/* - * 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. - */ - +// SPDX-License-Identifier: Apache-2.0 plugins { - id("com.hedera.gradle.platform") - id("com.hedera.gradle.platform-publish") - id("com.hedera.gradle.feature.benchmark") - id("com.hedera.gradle.feature.test-fixtures") - id("com.hedera.gradle.feature.test-hammer") - id("com.hedera.gradle.feature.test-timing-sensitive") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") + id("org.hiero.gradle.feature.benchmark") + id("org.hiero.gradle.feature.test-fixtures") + id("org.hiero.gradle.feature.test-hammer") + id("org.hiero.gradle.feature.test-timing-sensitive") } // Remove the following line to enable all 'javac' lint checks that we have turned on by default diff --git a/platform-sdk/swirlds-merkledb/src/testFixtures/java/module-info.java b/platform-sdk/swirlds-merkledb/src/testFixtures/java/module-info.java index 2c00d64fde8f..cf9f9e9d2939 100644 --- a/platform-sdk/swirlds-merkledb/src/testFixtures/java/module-info.java +++ b/platform-sdk/swirlds-merkledb/src/testFixtures/java/module-info.java @@ -1,11 +1,11 @@ module com.swirlds.merkledb.test.fixtures { exports com.swirlds.merkledb.test.fixtures; + requires transitive com.hedera.pbj.runtime; requires transitive com.swirlds.common; requires transitive com.swirlds.config.api; requires transitive com.swirlds.metrics.api; requires transitive com.swirlds.virtualmap; - requires transitive com.hedera.pbj.runtime; requires transitive org.apache.logging.log4j.core; requires com.swirlds.base; requires com.swirlds.config.extensions.test.fixtures; diff --git a/platform-sdk/swirlds-metrics-api/build.gradle.kts b/platform-sdk/swirlds-metrics-api/build.gradle.kts index 278ebab31a3a..6f1b6f2acce6 100644 --- a/platform-sdk/swirlds-metrics-api/build.gradle.kts +++ b/platform-sdk/swirlds-metrics-api/build.gradle.kts @@ -1,22 +1,7 @@ -/* - * 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. - */ - +// SPDX-License-Identifier: Apache-2.0 plugins { - id("com.hedera.gradle.platform") - id("com.hedera.gradle.platform-publish") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") } testModuleInfo { diff --git a/platform-sdk/swirlds-metrics-impl/build.gradle.kts b/platform-sdk/swirlds-metrics-impl/build.gradle.kts index 278ebab31a3a..6f1b6f2acce6 100644 --- a/platform-sdk/swirlds-metrics-impl/build.gradle.kts +++ b/platform-sdk/swirlds-metrics-impl/build.gradle.kts @@ -1,22 +1,7 @@ -/* - * 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. - */ - +// SPDX-License-Identifier: Apache-2.0 plugins { - id("com.hedera.gradle.platform") - id("com.hedera.gradle.platform-publish") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") } testModuleInfo { diff --git a/platform-sdk/swirlds-platform-core/build.gradle.kts b/platform-sdk/swirlds-platform-core/build.gradle.kts index 3297b008d327..7a0d06d2ea97 100644 --- a/platform-sdk/swirlds-platform-core/build.gradle.kts +++ b/platform-sdk/swirlds-platform-core/build.gradle.kts @@ -1,25 +1,10 @@ -/* - * Copyright (C) 2020-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("com.hedera.gradle.platform") - id("com.hedera.gradle.platform-publish") - id("com.hedera.gradle.feature.benchmark") - id("com.hedera.gradle.feature.test-fixtures") - id("com.hedera.gradle.feature.test-timing-sensitive") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") + id("org.hiero.gradle.feature.benchmark") + id("org.hiero.gradle.feature.test-fixtures") + id("org.hiero.gradle.feature.test-timing-sensitive") } // Remove the following line to enable all 'javac' lint checks that we have turned on by default diff --git a/platform-sdk/swirlds-state-api/build.gradle.kts b/platform-sdk/swirlds-state-api/build.gradle.kts index 5a247350d816..d147c770b11e 100644 --- a/platform-sdk/swirlds-state-api/build.gradle.kts +++ b/platform-sdk/swirlds-state-api/build.gradle.kts @@ -1,23 +1,8 @@ -/* - * 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("com.hedera.gradle.platform") - id("com.hedera.gradle.platform-publish") - id("com.hedera.gradle.feature.test-fixtures") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") + id("org.hiero.gradle.feature.test-fixtures") } testModuleInfo { diff --git a/platform-sdk/swirlds-state-impl/build.gradle.kts b/platform-sdk/swirlds-state-impl/build.gradle.kts index 399424faf0df..bf6a5d6bd5ad 100644 --- a/platform-sdk/swirlds-state-impl/build.gradle.kts +++ b/platform-sdk/swirlds-state-impl/build.gradle.kts @@ -1,23 +1,8 @@ -/* - * 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("com.hedera.gradle.platform") - id("com.hedera.gradle.platform-publish") - id("com.hedera.gradle.feature.test-fixtures") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") + id("org.hiero.gradle.feature.test-fixtures") } testModuleInfo { diff --git a/platform-sdk/swirlds-unit-tests/core/swirlds-platform-test/build.gradle.kts b/platform-sdk/swirlds-unit-tests/core/swirlds-platform-test/build.gradle.kts index 01ce14f8f2de..5e3e64c3dda1 100644 --- a/platform-sdk/swirlds-unit-tests/core/swirlds-platform-test/build.gradle.kts +++ b/platform-sdk/swirlds-unit-tests/core/swirlds-platform-test/build.gradle.kts @@ -1,22 +1,21 @@ -/* - * 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. - */ - +// SPDX-License-Identifier: Apache-2.0 plugins { - id("com.hedera.gradle.platform") - id("com.hedera.gradle.feature.benchmark") + id("java-library") + id("jacoco") + id("org.hiero.gradle.base.jpms-modules") + id("org.hiero.gradle.base.lifecycle") + id("org.hiero.gradle.base.version") + id("org.hiero.gradle.check.dependencies") + id("org.hiero.gradle.check.javac-lint") + id("org.hiero.gradle.check.spotless") + id("org.hiero.gradle.check.spotless-java") + id("org.hiero.gradle.check.spotless-kotlin") + id("org.hiero.gradle.feature.git-properties-file") + id("org.hiero.gradle.feature.java-compile") + id("org.hiero.gradle.feature.java-doc") + id("org.hiero.gradle.feature.java-execute") + id("org.hiero.gradle.feature.test") + id("org.hiero.gradle.report.test-logger") } // Remove the following line to enable all 'javac' lint checks that we have turned on by default diff --git a/platform-sdk/swirlds-virtualmap/build.gradle.kts b/platform-sdk/swirlds-virtualmap/build.gradle.kts index 83239810a946..7c4fee24e8aa 100644 --- a/platform-sdk/swirlds-virtualmap/build.gradle.kts +++ b/platform-sdk/swirlds-virtualmap/build.gradle.kts @@ -1,28 +1,13 @@ -/* - * Copyright (C) 2020-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 me.champeau.jmh.JMHTask plugins { - id("com.hedera.gradle.platform") - id("com.hedera.gradle.platform-publish") - id("com.hedera.gradle.feature.benchmark") - id("com.hedera.gradle.feature.test-fixtures") - id("com.hedera.gradle.feature.test-hammer") - id("com.hedera.gradle.feature.test-timing-sensitive") + id("org.hiero.gradle.module.library") + id("org.hiero.gradle.feature.publish-artifactregistry") + id("org.hiero.gradle.feature.benchmark") + id("org.hiero.gradle.feature.test-fixtures") + id("org.hiero.gradle.feature.test-hammer") + id("org.hiero.gradle.feature.test-timing-sensitive") } // Remove the following line to enable all 'javac' lint checks that we have turned on by default diff --git a/platform-sdk/swirlds/build.gradle.kts b/platform-sdk/swirlds/build.gradle.kts index f2726a41736f..ff8165738a19 100644 --- a/platform-sdk/swirlds/build.gradle.kts +++ b/platform-sdk/swirlds/build.gradle.kts @@ -1,20 +1,5 @@ -/* - * Copyright (C) 2020-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.gradle.application") } +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.module.application") } mainModuleInfo { runtimeOnly("com.swirlds.platform.core") @@ -24,16 +9,12 @@ mainModuleInfo { application.mainClass.set("com.swirlds.platform.Browser") -tasks.copyApp { - // Adjust configuration from 'com.hedera.hashgraph.application': - // Copy directly into 'sdk' and not 'sdk/data/apps' - into(layout.projectDirectory.dir("../sdk")) -} - tasks.jar { // Gradle fails to track 'configurations.runtimeClasspath' as an input to the task if it is // only used in the 'manifest.attributes'. Hence, we explicitly add it as input. inputs.files(configurations.runtimeClasspath) + + archiveVersion.convention(null as String?) doFirst { manifest { attributes( @@ -47,3 +28,55 @@ tasks.jar { } } } + +// Copy this app () and the demo apps into 'sdk' folder +val demoApp = configurations.dependencyScope("demoApp") + +dependencies { + demoApp(project(":AddressBookTestingTool")) + demoApp(project(":ConsistencyTestingTool")) + demoApp(project(":CryptocurrencyDemo")) + demoApp(project(":HelloSwirldDemo")) + demoApp(project(":ISSTestingTool")) + demoApp(project(":MigrationTestingTool")) + demoApp(project(":PlatformTestingTool")) + demoApp(project(":StatsDemo")) + demoApp(project(":StatsSigningTestingTool")) + demoApp(project(":StressTestingTool")) +} + +val demoAppsRuntimeClasspath = + configurations.resolvable("demoAppsRuntimeClasspath") { + extendsFrom(demoApp.get()) + shouldResolveConsistentlyWith(configurations.mainRuntimeClasspath.get()) + attributes.attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME)) + attributes.attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.LIBRARY)) + attributes.attribute( + LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, + objects.named(LibraryElements.JAR) + ) + attributes.attribute(Attribute.of("javaModule", Boolean::class.javaObjectType), true) + } +val demoAppsJars = + configurations.resolvable("demoAppsJars") { + extendsFrom(demoApp.get(), configurations.internal.get()) + attributes.attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME)) + isTransitive = false // only the application Jars, not the dependencies + } + +tasks.register("copyApps") { + destinationDir = layout.projectDirectory.dir("../sdk").asFile + from(tasks.jar) // 'swirlds.jar' goes in directly into 'sdk' + into("data/apps") { + // Copy built jar into `data/apps` and rename + from(demoAppsJars) + rename { "${it.substring(0, it.indexOf("-"))}.jar" } + } + into("data/lib") { + // Copy dependencies into `sdk/data/lib` + from(project.configurations.runtimeClasspath) + from(demoAppsRuntimeClasspath.get().minus(demoAppsJars.get())) + } +} + +tasks.assemble { dependsOn(tasks.named("copyApps")) } diff --git a/settings.gradle.kts b/settings.gradle.kts index 26e94be8c18f..1ad8b9c04676 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,49 +1,28 @@ -/* - * Copyright (C) 2022-2023 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. - */ - -pluginManagement { includeBuild("gradle/plugins") } - -plugins { id("com.hedera.gradle.settings") } +// SPDX-License-Identifier: Apache-2.0 +plugins { id("org.hiero.gradle.build") version "0.1.1" } javaModules { // This "intermediate parent project" should be removed module("platform-sdk") { artifact = "swirlds-platform" } // The Hedera API module - module("hapi") { - group = "com.hedera.hashgraph" - } + module("hapi") { group = "com.hedera.hashgraph" } // The Hedera platform modules directory("platform-sdk") { group = "com.swirlds" module("swirlds") // not actually a Module as it has no module-info.java module("swirlds-benchmarks") // not actually a Module as it has no module-info.java - module("swirlds-unit-tests/core/swirlds-platform-test") // nested module is not found automatically - module("consensus-gossip") { artifact = "consensus-gossip" } - module("consensus-gossip-impl") { artifact = "consensus-gossip-impl" } - module("event-creator") { artifact = "event-creator" } - module("event-creator-impl") { artifact = "event-creator-impl" } + module( + "swirlds-unit-tests/core/swirlds-platform-test" + ) // nested module is not found automatically } // The Hedera services modules directory("hedera-node") { group = "com.hedera.hashgraph" - // Configure 'artifact' for projects where the folder does not correspond to the artifact name + // Configure 'artifact' for projects where folder does not correspond to artifact name module("hapi-fees") { artifact = "app-hapi-fees" } module("hapi-utils") { artifact = "app-hapi-utils" } module("hedera-addressbook-service") { artifact = "app-service-addressbook" } @@ -68,17 +47,11 @@ javaModules { } // Platform-base demo applications - directory("example-apps") { - group = "com.swirlds" - } + directory("example-apps") { group = "com.swirlds" } // Platform demo applications - directory("platform-sdk/platform-apps/demos") { - group = "com.swirlds" - } + directory("platform-sdk/platform-apps/demos") { group = "com.swirlds" } // Platform test applications - directory("platform-sdk/platform-apps/tests") { - group = "com.swirlds" - } + directory("platform-sdk/platform-apps/tests") { group = "com.swirlds" } }