Skip to content

Commit

Permalink
chore: use hiero-gradle-conventions to build hiero-gradle-conventions (
Browse files Browse the repository at this point in the history
…#36)

Signed-off-by: Jendrik Johannes <[email protected]>
  • Loading branch information
jjohannes authored Dec 11, 2024
1 parent c0ca020 commit b54c67a
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 87 deletions.
86 changes: 11 additions & 75 deletions build.gradle.kts
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")
Expand All @@ -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 {
Expand Down Expand Up @@ -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/**")
Expand Down
1 change: 1 addition & 0 deletions developers.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
release-engineering@hiero.org=Release Engineering Team
2 changes: 1 addition & 1 deletion gradle.properties
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
1 change: 1 addition & 0 deletions gradle/toolchain-versions.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jdk=17.0.12
14 changes: 3 additions & 11 deletions settings.gradle.kts
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() }
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.2.0

0 comments on commit b54c67a

Please sign in to comment.