Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle 脚本优化 #17

Merged
merged 4 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
plugins {
id 'groovy-gradle-plugin'
id 'java-library'
}

repositories {
mavenCentral()
gradlePluginPortal()
}

dependencies {
implementation gradleApi()
implementation 'org.kordamp.gradle:jandex-gradle-plugin:2.0.0'
}
7 changes: 7 additions & 0 deletions buildSrc/src/main/groovy/configure-jandex.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
id 'org.kordamp.gradle.jandex'
}

tasks.named('checkstyleMain').configure {
dependsOn 'jandex'
}
6 changes: 0 additions & 6 deletions gradle.properties

This file was deleted.

7 changes: 7 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
[versions]
testcontainers = "1.20.0"

quarkus = "3.12.3"
gtn1024 marked this conversation as resolved.
Show resolved Hide resolved

[libraries]
testcontainers-postgresql = { module = "org.testcontainers:postgresql", version.ref = "testcontainers" }

quarkus-platform-bom = { module = "io.quarkus.platform:quarkus-bom", version.ref = "quarkus" }

[plugins]
quarkus = { id = "io.quarkus", version.ref = "quarkus" }
4 changes: 2 additions & 2 deletions my-boot/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
plugins {
id 'java'
id 'io.quarkus'
id 'checkstyle'
alias libs.plugins.quarkus
}


dependencies {
implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")
implementation enforcedPlatform(libs.quarkus.platform.bom)
implementation project(":my-core")
implementation project(":my-platform")
// implementation project(":my-msg")
Expand Down
9 changes: 2 additions & 7 deletions my-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
plugins {
id 'java'
id 'java-library'
id 'org.kordamp.gradle.jandex' version '2.0.0'
id 'checkstyle'
id 'configure-jandex'
}


dependencies {
api enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")
api enforcedPlatform(libs.quarkus.platform.bom)

api project(':my-database')

api 'io.quarkus:quarkus-rest'
api 'io.quarkus:quarkus-arc'
api 'io.quarkus:quarkus-rest-jackson'


testImplementation 'io.quarkus:quarkus-junit5'
testImplementation 'io.rest-assured:rest-assured'
}

tasks.named('checkstyleMain').configure {
dependsOn 'jandex'
}
8 changes: 2 additions & 6 deletions my-database-standard/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
plugins {
id 'java'
id 'java-library'
id 'org.kordamp.gradle.jandex' version '2.0.0'
id 'checkstyle'
id 'configure-jandex'
}


dependencies {
api enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")
api enforcedPlatform(libs.quarkus.platform.bom)
implementation project(':my-database')

api "io.quarkus:quarkus-jdbc-postgresql"
}

tasks.named('checkstyleMain').configure {
dependsOn 'jandex'
}
6 changes: 1 addition & 5 deletions my-database-uni/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
plugins {
id 'java'
id 'org.kordamp.gradle.jandex' version '2.0.0'
id 'checkstyle'
id 'configure-jandex'
}


dependencies {
implementation project(':my-database')
// implementation project(':my-core-uni')
}

tasks.named('checkstyleMain').configure {
dependsOn 'jandex'
}
2 changes: 1 addition & 1 deletion my-database/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {


dependencies {
api enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")
api enforcedPlatform(libs.quarkus.platform.bom)
// implementation project(':my-core')
// implementation project(':my-core-uni')

Expand Down
6 changes: 1 addition & 5 deletions my-platform/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'java'
id 'org.kordamp.gradle.jandex' version '2.0.0'
id 'checkstyle'
id 'configure-jandex'
}


Expand All @@ -10,7 +10,3 @@ dependencies {
implementation project(':my-database-standard')
// implementation project(':my-core-uni')
}

tasks.named('checkstyleMain').configure {
dependsOn 'jandex'
}
11 changes: 0 additions & 11 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
mavenLocal()
}
plugins {
id "${quarkusPluginId}" version "${quarkusPluginVersion}"
}
}

plugins {
id "com.gradle.develocity" version "3.17.5"
}
Expand Down
Loading