Skip to content

Commit

Permalink
build: update Gradle configurations and dependencies (#546)
Browse files Browse the repository at this point in the history
- Update Gradle plugins and dependencies to use consistent naming conventions
- Add LinYiPackages Maven repository for publishing
- Update environment variable names for GitHub token and LinYiPackages credentials
- Refactor build.gradle.kts files across multiple modules to use new dependency references
  • Loading branch information
Ahoo-Wang authored Jan 10, 2025
1 parent 41a31d6 commit 792788e
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 39 deletions.
12 changes: 10 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import org.jetbrains.dokka.gradle.DokkaPlugin
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension

plugins {
alias(libs.plugins.publishPlugin)
alias(libs.plugins.publish)
alias(libs.plugins.detekt)
alias(libs.plugins.kotlin)
alias(libs.plugins.dokka)
alias(libs.plugins.jmhPlugin)
alias(libs.plugins.jmh)
jacoco
}
val dependenciesProject = project(":cosky-dependencies")
Expand Down Expand Up @@ -167,6 +167,14 @@ configure(publishProjects) {
password = System.getenv("GITHUB_TOKEN")
}
}
maven {
name = "LinYiPackages"
url = uri(project.properties["linyiPackageReleaseUrl"].toString())
credentials {
username = project.properties["linyiPackageUsername"]?.toString()
password = project.properties["linyiPackagePwd"]?.toString()
}
}
}
publications {
val publishName = if (isBom) "mavenBom" else "mavenLibrary"
Expand Down
20 changes: 10 additions & 10 deletions cosky-dependencies/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
*/

dependencies {
api(platform(libs.springBootDependencies))
api(platform(libs.springCloudDependencies))
api(platform(libs.cosidBom))
api(platform(libs.simbaBom))
api(platform(libs.cosecBom))
api(platform(libs.spring.boot.dependencies))
api(platform(libs.spring.cloud.dependencies))
api(platform(libs.cosid.bom))
api(platform(libs.simba.bom))
api(platform(libs.cosec.bom))
constraints {
api(libs.guava)
api(libs.commonsIo)
api(libs.springDocStarterWebfluxUi)
api(libs.commons.io)
api(libs.springdoc.openapi.starter.webflux.ui)
api(libs.hamcrest)
api(libs.mockk)
api(libs.jmhCore)
api(libs.jmhGeneratorAnnprocess)
api(libs.detektFormatting)
api(libs.jmh.core)
api(libs.jmh.generator.annprocess)
api(libs.detekt.formatting)
}
}
2 changes: 1 addition & 1 deletion cosky-rest-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plugins {
application
alias(libs.plugins.kotlin)
alias(libs.plugins.kotlinSpring)
alias(libs.plugins.kotlin.spring)
kotlin("kapt")
}

Expand Down
2 changes: 1 addition & 1 deletion cosky-spring-cloud-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* limitations under the License.
*/
plugins {
alias(libs.plugins.kotlinSpring)
alias(libs.plugins.kotlin.spring)
kotlin("kapt")
}
dependencies {
Expand Down
2 changes: 1 addition & 1 deletion cosky-spring-cloud-starter-config/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* limitations under the License.
*/
plugins {
alias(libs.plugins.kotlinSpring)
alias(libs.plugins.kotlin.spring)
kotlin("kapt")
}
dependencies {
Expand Down
2 changes: 1 addition & 1 deletion cosky-spring-cloud-starter-discovery/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* limitations under the License.
*/
plugins {
alias(libs.plugins.kotlinSpring)
alias(libs.plugins.kotlin.spring)
kotlin("kapt")
}
dependencies {
Expand Down
2 changes: 1 addition & 1 deletion examples/cosky-service-consumer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plugins {
application
alias(libs.plugins.kotlin)
alias(libs.plugins.kotlinSpring)
alias(libs.plugins.kotlin.spring)
kotlin("kapt")
}

Expand Down
2 changes: 1 addition & 1 deletion examples/cosky-service-provider-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plugins {
`java-library`
alias(libs.plugins.kotlin)
alias(libs.plugins.kotlinSpring)
alias(libs.plugins.kotlin.spring)
}

java {
Expand Down
2 changes: 1 addition & 1 deletion examples/cosky-service-provider/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plugins {
application
alias(libs.plugins.kotlin)
alias(libs.plugins.kotlinSpring)
alias(libs.plugins.kotlin.spring)
kotlin("kapt")
}

Expand Down
40 changes: 20 additions & 20 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
[versions]
# libraries
springBoot = "3.4.1"
springCloud = "2024.0.0"
spring-boot = "3.4.1"
spring-cloud = "2024.0.0"
cosid = "2.10.2"
simba = "2.6.2"
cosec = "2.9.9"
guava = "33.4.0-jre"
commonsIo = "2.18.0"
springDoc = "2.8.1"
commons-io = "2.18.0"
springdoc = "2.8.1"
hamcrest = "3.0"
mockk = "1.13.14"
jmh = "1.37"
# plugins
detekt = "1.23.7"
dokka = "2.0.0"
kotlin = "2.0.21"
publishPlugin = "2.0.0"
jmhPlugin = "0.7.2"
publish-Plugin = "2.0.0"
jmh-plugin = "0.7.2"
[libraries]
springBootDependencies = { module = "org.springframework.boot:spring-boot-dependencies", version.ref = "springBoot" }
springCloudDependencies = { module = "org.springframework.cloud:spring-cloud-dependencies", version.ref = "springCloud" }
cosidBom = { module = "me.ahoo.cosid:cosid-bom", version.ref = "cosid" }
simbaBom = { module = "me.ahoo.simba:simba-bom", version.ref = "simba" }
cosecBom = { module = "me.ahoo.cosec:cosec-bom", version.ref = "cosec" }
spring-boot-dependencies = { module = "org.springframework.boot:spring-boot-dependencies", version.ref = "spring-boot" }
spring-cloud-dependencies = { module = "org.springframework.cloud:spring-cloud-dependencies", version.ref = "spring-cloud" }
cosid-bom = { module = "me.ahoo.cosid:cosid-bom", version.ref = "cosid" }
simba-bom = { module = "me.ahoo.simba:simba-bom", version.ref = "simba" }
cosec-bom = { module = "me.ahoo.cosec:cosec-bom", version.ref = "cosec" }
guava = { module = "com.google.guava:guava", version.ref = "guava" }
commonsIo = { module = "commons-io:commons-io", version.ref = "commonsIo" }
springDocStarterWebfluxUi = { module = "org.springdoc:springdoc-openapi-starter-webflux-ui", version.ref = "springDoc" }
commons-io = { module = "commons-io:commons-io", version.ref = "commons-io" }
springdoc-openapi-starter-webflux-ui = { module = "org.springdoc:springdoc-openapi-starter-webflux-ui", version.ref = "springdoc" }
hamcrest = { module = "org.hamcrest:hamcrest", version.ref = "hamcrest" }
mockk = { module = "io.mockk:mockk", version.ref = "mockk" }
detektFormatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" }
jmhCore = { module = "org.openjdk.jmh:jmh-core", version.ref = "jmh" }
jmhGeneratorAnnprocess = { module = "org.openjdk.jmh:jmh-generator-annprocess", version.ref = "jmh" }
detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" }
jmh-core = { module = "org.openjdk.jmh:jmh-core", version.ref = "jmh" }
jmh-generator-annprocess = { module = "org.openjdk.jmh:jmh-generator-annprocess", version.ref = "jmh" }
[plugins]
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlinSpring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlin" }
kotlinkapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
publishPlugin = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "publishPlugin" }
jmhPlugin = { id = "me.champeau.jmh", version.ref = "jmhPlugin" }
kotlin-spring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlin" }
kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
publish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "publish-Plugin" }
jmh = { id = "me.champeau.jmh", version.ref = "jmh-plugin" }

0 comments on commit 792788e

Please sign in to comment.