From df8eb07020dabaaad450b4da68debcacb23f5a73 Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Wed, 11 Dec 2024 12:57:12 +0100 Subject: [PATCH] build: replace 'developer.properties' with genera Hiero entry Signed-off-by: Jendrik Johannes --- README.md | 12 +++--- developers.properties | 2 +- example/product-a/developers.properties | 1 - ...eature.publish-maven-repository.gradle.kts | 37 +++---------------- .../gradle/test/MavenCentralPublishTest.kt | 1 - .../gradle/test/fixtures/GradleProject.kt | 2 - 6 files changed, 13 insertions(+), 42 deletions(-) delete mode 100644 example/product-a/developers.properties diff --git a/README.md b/README.md index d7590e9..8b93e3c 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ plugins { There is a [minimal example](example) setup. ``` -├── settings.gradle.kts // Entriy point (see above) +├── settings.gradle.kts // Entriy point (see above) ├── gradle.properties // Turn on Gradle caches ├── gradle/aggregation/build.gradle.kts // List of all product/service modules for consistent resolution ├── gradle/toolchain-versions.properties // JDK version (and other tools if applicable) @@ -61,13 +61,13 @@ There is a [minimal example](example) setup. ├── hiero-dependency-versions/build.gradle.kts // Versions of 3rd-party modules ├── product-a // Folder containing all modules of 'product-a' │ ├── module-app // Example of a Application module -│ │ ├── build.gradle.kts // Select which build features to use in 'plugins {}' (see above) +│ │ ├── build.gradle.kts // Select which build features to use in 'plugins {}' (see above) │ │ └── src/main/java/module-info.java // Define dependencies to other modules │ ├── module-lib // Example of a Library module -│ │ ├── build.gradle.kts // Select which build features to use in 'plugins {}' (see above) +│ │ ├── build.gradle.kts // Select which build features to use in 'plugins {}' (see above) │ │ └── src/main/java/module-info.java // Define dependencies to other modules -│ ├── description.txt // Description of the product (for published metadata) -│ └── developers.properties // Developers of the product (for published metadata) +│ └── description.txt // Description of the product (for published metadata), +│ // or set 'description' for individual module in build.gradle.kts └── version.txt // Version of all modules/products ``` @@ -86,7 +86,7 @@ Each plugin configures a certain build aspect, following this naming pattern: - `org.hiero.gradle.check.*` _Check_ plugins help with keeping the software maintainable over time. They check things like the dependency setup or code formatting. - `org.hiero.gradle.report.*` _Report_ plugins configure the export of information into reports that can be picked -up by other systems - e.g. for code coverage reporting. + up by other systems - e.g. for code coverage reporting. - `org.hiero.gradle.module.*` _Module_ plugins combine plugins from all categories above to define _Module Types_ that are then used in the `build.gradle.kts` files of the individual Modules of our software. diff --git a/developers.properties b/developers.properties index 0a0d0fd..35c183f 100644 --- a/developers.properties +++ b/developers.properties @@ -1 +1 @@ -release-engineering@hiero.org=Release Engineering Team \ No newline at end of file +info@lfdecentralizedtrust.org=The Hiero Team \ No newline at end of file diff --git a/example/product-a/developers.properties b/example/product-a/developers.properties deleted file mode 100644 index 37dcde9..0000000 --- a/example/product-a/developers.properties +++ /dev/null @@ -1 +0,0 @@ -example=contact@example.org \ No newline at end of file diff --git a/src/main/kotlin/org.hiero.gradle.feature.publish-maven-repository.gradle.kts b/src/main/kotlin/org.hiero.gradle.feature.publish-maven-repository.gradle.kts index 1774b84..215198d 100644 --- a/src/main/kotlin/org.hiero.gradle.feature.publish-maven-repository.gradle.kts +++ b/src/main/kotlin/org.hiero.gradle.feature.publish-maven-repository.gradle.kts @@ -1,6 +1,4 @@ // SPDX-License-Identifier: Apache-2.0 -import java.util.Properties - plugins { id("java") id("maven-publish") @@ -35,27 +33,6 @@ publishing.publications.withType().configureEach { suppressAllPomMetadataWarnings() pom { - val devGroups = Properties() - @Suppress("UnstableApiUsage") - val developerProperties = - if (project.path == isolated.rootProject.path) { - layout.projectDirectory.file("developers.properties") - } else { - layout.projectDirectory.file("../developers.properties") - } - devGroups.load( - providers - .fileContents(developerProperties) - .asText - .orElse( - provider { - throw RuntimeException("${developerProperties.asFile} does not exist") - } - ) - .get() - .reader() - ) - name = project.name url = "https://hiero.org/" inceptionYear = "2024" @@ -94,14 +71,12 @@ publishing.publications.withType().configureEach { } developers { - devGroups.forEach { mail, team -> - developer { - id = team as String - name = team as String - email = mail as String - organization = "Hiero - a Linux Foundation Decentralized Trust project" - organizationUrl = "https://hiero.org/" - } + developer { + id = "hiero" + name = "The Hiero Team" + email = "info@lfdecentralizedtrust.org" + organization = "Hiero - a Linux Foundation Decentralized Trust project" + organizationUrl = "https://hiero.org/" } } } diff --git a/src/test/kotlin/org/hiero/gradle/test/MavenCentralPublishTest.kt b/src/test/kotlin/org/hiero/gradle/test/MavenCentralPublishTest.kt index 23ad7d8..fc0609d 100644 --- a/src/test/kotlin/org/hiero/gradle/test/MavenCentralPublishTest.kt +++ b/src/test/kotlin/org/hiero/gradle/test/MavenCentralPublishTest.kt @@ -97,7 +97,6 @@ class MavenCentralPublishTest { p.settingsFile.appendText( """javaModules { directory("product-b") { group = "org.foo" } }""" ) - p.file("product-b/developers.properties", "") p.file("product-b/module-b/src/main/java/module-info.java", "module org.foo.module.b {}") p.file( "product-b/module-b/build.gradle.kts", diff --git a/src/test/kotlin/org/hiero/gradle/test/fixtures/GradleProject.kt b/src/test/kotlin/org/hiero/gradle/test/fixtures/GradleProject.kt index 04cdc23..07f46da 100644 --- a/src/test/kotlin/org/hiero/gradle/test/fixtures/GradleProject.kt +++ b/src/test/kotlin/org/hiero/gradle/test/fixtures/GradleProject.kt @@ -23,7 +23,6 @@ class GradleProject { val versionFile = file("version.txt") private val toolchainVersionsFile = file("gradle/toolchain-versions.properties") - private val developersProperties = file("product/developers.properties") val descriptionTxt = file("product/description.txt") val moduleBuildFile = file("product/module-a/build.gradle.kts") private val moduleInfo = file("product/module-a/src/main/java/module-info.java") @@ -66,7 +65,6 @@ class GradleProject { aggregation.writeFormatted("""plugins { id("org.hiero.gradle.base.lifecycle") }""") versionFile.writeText("1.0") toolchainVersionsFile.writeText("jdk=17.0.12") - developersProperties.writeText("test=test@hiero.org") descriptionTxt.writeText("A module to test hiero-gradle-conventions") moduleInfoFile("module org.hiero.product.module.a {}") javaSourceFile(