Skip to content

Commit

Permalink
Merge branch 'develop' into 8768-resolve-issue2051spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivo-Yankov committed Nov 21, 2023
2 parents e9b577a + 7055bf6 commit b95bbf7
Show file tree
Hide file tree
Showing 432 changed files with 14,051 additions and 4,107 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@
/platform-sdk/swirlds-fchashmap/ @hashgraph/platform-data @hashgraph/platform-architects
/platform-sdk/swirlds-fcqueue/ @hashgraph/platform-data @hashgraph/platform-architects
/platform-sdk/swirlds-jasperdb/ @hashgraph/platform-data @hashgraph/platform-architects
/platform-sdk/swirlds-logging/ @hashgraph/platform-hashgraph
/platform-sdk/swirlds-logging/ @hashgraph/platform-hashgraph @hashgraph/platform-base
/platform-sdk/swirlds-merkle/ @hashgraph/platform-data @hashgraph/platform-architects
/platform-sdk/swirlds-platform-core/ @hashgraph/platform-hashgraph
/platform-sdk/swirlds-sign-tool/ @hashgraph/platform-hashgraph
/platform-sdk/swirlds-unit-tests/common/ @hashgraph/platform-hashgraph @hashgraph/platform-base
/platform-sdk/swirlds-unit-tests/core/ @hashgraph/platform-hashgraph
/platform-sdk/swirlds-unit-tests/structures/ @hashgraph/platform-data @hashgraph/platform-architects
/platform-sdk/swirlds-virtualmap/ @hashgraph/platform-data @hashgraph/platform-architects
/platform-sdk/**/module-info.java @hashgraph/platform-hashgraph @hashgraph/release-engineering @hashgraph/release-engineering-managers
/platform-sdk/**/module-info.java @hashgraph/platform-hashgraph @hashgraph/platform-base @hashgraph/release-engineering @hashgraph/release-engineering-managers

#########################
##### Core Files ######
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/node-zxc-build-release-artifact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ jobs:
OSSRH_PASSWORD: ${{ secrets.svcs-ossrh-password }}
with:
gradle-version: ${{ inputs.gradle-version }}
arguments: "releaseEvmMavenCentral --scan -PpublishSigningEnabled=true"
arguments: "releaseEvmMavenCentral --scan -PpublishSigningEnabled=true --no-configuration-cache"

- name: Gradle Maven Central Snapshot
uses: gradle/gradle-build-action@842c587ad8aa4c68eeba24c396e15af4c2e9f30a # v2.9.0
Expand All @@ -620,7 +620,7 @@ jobs:
OSSRH_PASSWORD: ${{ secrets.svcs-ossrh-password }}
with:
gradle-version: ${{ inputs.gradle-version }}
arguments: "releaseEvmMavenCentralSnapshot --scan -PpublishSigningEnabled=true"
arguments: "releaseEvmMavenCentralSnapshot --scan -PpublishSigningEnabled=true --no-configuration-cache"

sdk-publish:
name: Publish Platform to ${{ inputs.version-policy == 'specified' && 'Maven Central' || 'GCP Registry' }}
Expand Down Expand Up @@ -776,7 +776,7 @@ jobs:
OSSRH_PASSWORD: ${{ secrets.sdk-ossrh-password }}
with:
gradle-version: ${{ inputs.gradle-version }}
arguments: "release${{ inputs.sdk-release-profile }} --scan -PpublishSigningEnabled=true"
arguments: "release${{ inputs.sdk-release-profile }} --scan -PpublishSigningEnabled=true --no-configuration-cache"

- name: Upload SDK Release Archives
if: ${{ inputs.dry-run-enabled != true && inputs.version-policy == 'specified' && !cancelled() && !failure() }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/node-zxcron-release-fsts-regression.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
major="${BASH_REMATCH[1]}"
minor="${BASH_REMATCH[2]}"
if [[ "${major}" -eq 0 && "${minor}" -lt 43 ]]; then
if [[ "${major}" -eq 0 && "${minor}" -lt 44 ]]; then
continue
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
major="${BASH_REMATCH[1]}"
minor="${BASH_REMATCH[2]}"
if [[ "${major}" -eq 0 && "${minor}" -lt 43 ]]; then
if [[ "${major}" -eq 0 && "${minor}" -lt 44 ]]; then
continue
fi
Expand Down
6 changes: 2 additions & 4 deletions build-logic/project-plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,15 @@ plugins {
}

dependencies {
implementation("com.adarshr:gradle-test-logger-plugin:3.2.0")
implementation("com.adarshr:gradle-test-logger-plugin:4.0.0")
implementation("com.autonomousapps:dependency-analysis-gradle-plugin:1.25.0")
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.22.0")
implementation("com.github.johnrengelman:shadow:8.1.1")
implementation("com.google.protobuf:protobuf-gradle-plugin:0.9.4")
implementation("com.gorylenko.gradle-git-properties:gradle-git-properties:2.4.1")
implementation(
"gradle.plugin.com.google.cloud.artifactregistry:artifactregistry-gradle-plugin:2.2.1"
)
implementation("gradle.plugin.lazy.zoo.gradle:git-data-plugin:1.2.2")
implementation("me.champeau.jmh:jmh-gradle-plugin:0.7.1")
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.5")
implementation("org.gradlex:java-ecosystem-capabilities:1.3.1")
Expand Down
10 changes: 1 addition & 9 deletions build-logic/project-plugins/src/main/kotlin/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* limitations under the License.
*/

import net.swiftzer.semver.SemVer
import org.gradle.api.Project
import org.gradle.api.file.Directory
import org.gradle.api.file.RegularFile
import java.io.OutputStream
Expand All @@ -32,14 +30,8 @@ class Utils {
file("version.txt").let { if (it.asFile.exists()) it else this.dir("..").versionTxt() }

@JvmStatic
fun updateVersion(project: Project, newVersion: SemVer) {
project.layout.projectDirectory.versionTxt().asFile.writeText(newVersion.toString())
}

@JvmStatic
fun generateProjectVersionReport(rootProject: Project, ostream: OutputStream) {
fun generateProjectVersionReport(version: String, ostream: OutputStream) {
val writer = PrintStream(ostream, false, Charsets.UTF_8)
val version = rootProject.layout.projectDirectory.versionTxt().asFile.readText().trim()

ostream.use {
writer.use {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@
plugins {
id("application")
id("com.hedera.hashgraph.java")
id("com.gorylenko.gradle-git-properties")
}

group = "com.swirlds"

gitProperties { keys = listOf("git.build.version", "git.commit.id", "git.commit.id.abbrev") }

// 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(".."))
Expand All @@ -38,9 +35,11 @@ val copyLib =
// Copy built jar into `data/apps` and rename
val copyApp =
tasks.register<Copy>("copyApp") {
inputs.property("projectName", project.name)

from(tasks.jar)
into(sdkDir(layout.projectDirectory).dir("data/apps"))
rename { "${project.name}.jar" }
rename { "${inputs.properties["projectName"]}.jar" }
}

tasks.assemble {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,3 @@ sourceSets.all {
}
}
}

tasks.withType<Jar>().configureEach {
dependsOn(tasks.named("generatePbjSource"))
dependsOn(tasks.named("generateTestPbjSource"))
dependsOn(tasks.named("generateTestFixturesPbjSource"))
dependsOn(tasks.named("generateItestPbjSource"))
dependsOn(tasks.named("generateEetPbjSource"))
dependsOn(tasks.named("generateXtestPbjSource"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,33 @@ sourceSets.all {
}
}

val writeGitProperties =
tasks.register<WriteProperties>("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", "--short", "HEAD") }
.standardOutput
.asText
.map { it.trim() }
)

destinationFile.set(layout.buildDirectory.file("generated/git/git.properties"))
}

tasks.processResources { from(writeGitProperties) }

tasks.withType<AbstractArchiveTask>().configureEach {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ javaModuleDependencies {
moduleNameToGA.put("com.swirlds.common.testing", "com.swirlds:swirlds-common-testing")
moduleNameToGA.put("com.swirlds.config.api", "com.swirlds:swirlds-config-api")
moduleNameToGA.put("com.swirlds.config.impl", "com.swirlds:swirlds-config-impl")
moduleNameToGA.put("com.swirlds.config.extensions", "com.swirlds:swirlds-config-extensions")
moduleNameToGA.put("com.swirlds.merkle.test", "com.swirlds:swirlds-merkle-test")
moduleNameToGA.put("com.swirlds.merkledb", "com.swirlds:swirlds-merkledb")
moduleNameToGA.put("com.swirlds.platform.core", "com.swirlds:swirlds-platform-core")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ plugins {
}

dependencies.components {
// TODO remove, once a new version of 'com.hedera.pbj.runtime' has been
// published with fix from https://github.com/hashgraph/pbj/pull/92
withModule("com.hedera.pbj:pbj-runtime") {
allVariants { withDependencies { removeAll { it.name != "antlr4-runtime" } } }
}

withModule<IoGrpcDependencyMetadataRule>("io.grpc:grpc-netty")
withModule<IoGrpcDependencyMetadataRule>("io.grpc:grpc-protobuf")
withModule<IoGrpcDependencyMetadataRule>("io.grpc:grpc-protobuf-lite")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ plugins {
id("java")
id("maven-publish")
id("signing")
id("com.google.cloud.artifactregistry.gradle-plugin")
}

java {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ plugins {
id("com.hedera.hashgraph.maven-publish")
}

@Suppress("UnstableApiUsage")
if (!gradle.startParameter.isConfigurationCacheRequested) {
// plugin to support 'artifactregistry' repositories that currently only works without
// configuration cache
// https://github.com/GoogleCloudPlatform/artifact-registry-maven-tools/issues/85
apply(plugin = "com.google.cloud.artifactregistry.gradle-plugin")
}

publishing {
publications {
named<MavenPublication>("maven") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ plugins {
id("com.hedera.hashgraph.spotless-conventions")
id("com.hedera.hashgraph.spotless-kotlin-conventions")
id("com.hedera.hashgraph.dependency-analysis")
id("lazy.zoo.gradle.git-data-plugin")
}

spotless { kotlinGradle { target("build-logic/**/*.gradle.kts") } }
Expand All @@ -32,65 +31,98 @@ val productVersion = layout.projectDirectory.versionTxt().asFile.readText().trim

tasks.register("githubVersionSummary") {
group = "github"
doLast {
val ghStepSummaryPath: String =
providers.environmentVariable("GITHUB_STEP_SUMMARY").orNull
?: throw IllegalArgumentException(
"This task may only be run in a Github Actions CI environment!" +
"Unable to locate the GITHUB_STEP_SUMMARY environment variable."
)

inputs.property("version", productVersion)
outputs.file(
providers
.environmentVariable("GITHUB_STEP_SUMMARY")
.orElse(
provider {
throw IllegalArgumentException(
"This task may only be run in a Github Actions CI environment! " +
"Unable to locate the GITHUB_STEP_SUMMARY environment variable."
)
}
)
)

doLast {
Utils.generateProjectVersionReport(
rootProject,
File(ghStepSummaryPath).outputStream().buffered()
inputs.properties["version"] as String,
outputs.files.singleFile.outputStream().buffered()
)
}
}

tasks.register("showVersion") {
group = "versioning"
doLast { println(productVersion) }

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", "--short", "HEAD") }
.standardOutput
.asText
.map { it.trim() }
)
inputs.property("commitPrefix", providers.gradleProperty("commitPrefix").orElse("adhoc"))
inputs.property("version", productVersion)
outputs.file(layout.projectDirectory.versionTxt())

doLast {
gitData.lastCommitHash?.let {
val prefix = providers.gradleProperty("commitPrefix").getOrElse("adhoc")
val newPrerel = prefix + ".x" + it.take(8)
val currVer = SemVer.parse(productVersion)
try {
val newVer = SemVer(currVer.major, currVer.minor, currVer.patch, newPrerel)
Utils.updateVersion(rootProject, newVer)
} catch (e: java.lang.IllegalArgumentException) {
throw IllegalArgumentException(String.format("%s: %s", e.message, newPrerel), e)
}
}
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(productVersion)
val currVer = SemVer.parse(inputs.properties["version"] as String)
val newVer = SemVer(currVer.major, currVer.minor, currVer.patch, "SNAPSHOT")

Utils.updateVersion(rootProject, newVer)
outputs.files.singleFile.writeText(newVer.toString())
}
}

tasks.register("versionAsSpecified") {
group = "versioning"
doLast {
val verStr = providers.gradleProperty("newVersion")

if (!verStr.isPresent) {
throw IllegalArgumentException(
"No newVersion property provided! Please add the parameter -PnewVersion=<version> when running this task."
inputs.property(
"newVersion",
providers
.gradleProperty("newVersion")
.orElse(
provider {
throw IllegalArgumentException(
"No newVersion property provided! " +
"Please add the parameter -PnewVersion=<version> when running this task."
)
}
)
}
)
outputs.file(layout.projectDirectory.versionTxt())

val newVer = SemVer.parse(verStr.get())
Utils.updateVersion(rootProject, newVer)
doLast {
val newVer = SemVer.parse(inputs.properties["newVersion"] as String)
outputs.files.singleFile.writeText(newVer.toString())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,18 @@
plugins {
id("java-library")
id("com.hedera.hashgraph.java")
id("com.gorylenko.gradle-git-properties")
}

group = "com.swirlds"

tasks.checkModuleInfo { moduleNamePrefix = "com.swirlds" }

javaModuleDependencies { versionsFromConsistentResolution(":swirlds-platform-core") }

configurations.getByName("mainRuntimeClasspath") {
extendsFrom(configurations.getByName("internal"))
}

gitProperties { keys = listOf("git.build.version", "git.commit.id", "git.commit.id.abbrev") }

// !!! Remove the following once 'test' tasks are allowed to run in parallel ===
val allPlatformSdkProjects =
rootProject.subprojects
Expand Down

0 comments on commit b95bbf7

Please sign in to comment.