-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use hiero-gradle-conventions to build hiero-gradle-conventions (…
…#36) Signed-off-by: Jendrik Johannes <[email protected]>
- Loading branch information
Showing
6 changed files
with
18 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,13 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
plugins { | ||
id("org.hiero.gradle.module.gradle-plugin") | ||
`kotlin-dsl` | ||
id("signing") | ||
id("com.gradle.plugin-publish") version "1.3.0" | ||
id("com.diffplug.spotless") version "6.25.0" | ||
} | ||
|
||
version = "0.1.1" | ||
|
||
group = "org.hiero.gradle" | ||
|
||
description = "Gradle convention plugins used by Hiero projects" | ||
|
||
java { toolchain.languageVersion = JavaLanguageVersion.of(17) } | ||
|
||
dependencies { | ||
implementation("com.adarshr:gradle-test-logger-plugin:4.0.0") | ||
implementation("com.autonomousapps:dependency-analysis-gradle-plugin:2.6.0") | ||
|
@@ -32,6 +26,12 @@ dependencies { | |
implementation("org.gradlex:java-module-dependencies:1.8") | ||
implementation("org.gradlex:jvm-dependency-conflict-resolution:2.1.2") | ||
implementation("org.gradlex:reproducible-builds:1.0") | ||
|
||
implementation(platform("org.jetbrains.kotlin:kotlin-bom:${embeddedKotlinVersion}")) | ||
|
||
testImplementation(platform("org.junit:junit-bom:5.11.3")) | ||
testImplementation("org.assertj:assertj-core:3.26.3") | ||
testImplementation("org.junit.jupiter:junit-jupiter-params") | ||
} | ||
|
||
gradlePlugin { | ||
|
@@ -59,80 +59,16 @@ gradlePlugin { | |
plugins.configureEach { displayName = name } | ||
} | ||
|
||
publishing.publications.withType<MavenPublication>().configureEach { | ||
pom { | ||
url = "https://hiero.org/" | ||
inceptionYear = "2024" | ||
description = project.description | ||
name = project.name | ||
organization { | ||
name = "Hiero - a Linux Foundation Decentralized Trust project" | ||
url = "https://hiero.org/" | ||
} | ||
|
||
val repoName = project.name | ||
issueManagement { | ||
system = "GitHub" | ||
url = "https://github.com/hiero-ledger/$repoName/issues" | ||
} | ||
|
||
licenses { | ||
license { | ||
name = "Apache License, Version 2.0" | ||
url = "https://raw.githubusercontent.com/hiero-ledger/$repoName/main/LICENSE" | ||
} | ||
} | ||
|
||
scm { | ||
connection = "scm:git:git://github.com/hiero-ledger/$repoName.git" | ||
developerConnection = "scm:git:ssh://github.com:hiero-ledger/$repoName.git" | ||
url = "https://github.com/hiero-ledger/$repoName" | ||
} | ||
|
||
developers { | ||
developer { | ||
id = "Release Engineering Team" | ||
name = "Release Engineering Team" | ||
email = "[email protected]" | ||
organization = "Hiero - a Linux Foundation Decentralized Trust project" | ||
organizationUrl = "https://hiero.org/" | ||
} | ||
} | ||
} | ||
} | ||
|
||
val publishSigningEnabled = | ||
providers.gradleProperty("publishSigningEnabled").getOrElse("false").toBoolean() | ||
|
||
if (publishSigningEnabled) { | ||
signing { | ||
sign(publishing.publications) | ||
useGpgCmd() | ||
} | ||
} | ||
|
||
testing { | ||
@Suppress("UnstableApiUsage") | ||
suites.named<JvmTestSuite>("test") { | ||
useJUnitJupiter() | ||
dependencies { | ||
implementation("org.junit.jupiter:junit-jupiter-params") | ||
implementation("org.assertj:assertj-core:3.26.3") | ||
} | ||
// If success, delete all test projects | ||
targets.all { testTask { doLast { File("build/test-projects").deleteRecursively() } } } | ||
} | ||
tasks.test { | ||
// If success, delete all test projects | ||
doLast { File("build/test-projects").deleteRecursively() } | ||
} | ||
|
||
spotless { | ||
// Format '*.kts' and '*.kt' in 'src/main/kotlin' | ||
val header = "// SPDX-License-Identifier: Apache-2.0\n" | ||
val delimiter = | ||
"(import|package|plugins|pluginManagement|dependencyResolutionManagement|repositories|tasks|allprojects|subprojects|buildCache|version)" | ||
|
||
kotlinGradle { | ||
ktfmt().kotlinlangStyle() | ||
licenseHeader(header, delimiter) | ||
} | ||
kotlin { | ||
ktfmt().kotlinlangStyle() | ||
targetExclude("build/**") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
release-engineering@hiero.org=Release Engineering Team |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx2g | ||
org.gradle.caching=true | ||
org.gradle.configuration-cache=true | ||
org.gradle.parallel=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
jdk=17.0.12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,7 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
plugins { id("com.gradle.develocity") version "3.18.2" } | ||
|
||
rootProject.name = "hiero-gradle-conventions" | ||
|
||
develocity { | ||
buildScan { | ||
termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use" | ||
termsOfUseAgree = "yes" | ||
// Enable Gradle Build Scan only with explicit '--scan' | ||
publishing.onlyIf { false } | ||
} | ||
plugins { | ||
id("org.hiero.gradle.build") version "0.1.1" | ||
`kotlin-dsl` apply false | ||
} | ||
|
||
dependencyResolutionManagement { @Suppress("UnstableApiUsage") repositories.gradlePluginPortal() } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.2.0 |