feat(build): Optimize project construction and add international support

- Add Kotlin JVM plugin and configure source code and documentation Jar
- Added international support module
- Updated project version and naming
- Remove redundant source code task configuration
This commit is contained in:
gewuyou 2025-05-31 22:43:49 +08:00
parent 6e6099b02b
commit 58593f7b21
2 changed files with 26 additions and 5 deletions

View File

@ -9,7 +9,12 @@ plugins {
// Kotlin Spring 支持
alias(libs.plugins.kotlin.plugin.spring)
// Kotlin kapt 支持
alias (libs.plugins.kotlin.kapt)
alias(libs.plugins.kotlin.kapt)
id(libs.plugins.kotlin.jvm.get().pluginId)
}
java {
withSourcesJar()
withJavadocJar()
}
// 配置 SCM 版本插件
@ -59,8 +64,6 @@ allprojects {
// 子项目配置
subprojects {
version = rootProject.version
afterEvaluate {
val isRootModule = project.getPropertyByBoolean(ProjectFlags.IS_ROOT_MODULE)
val parentProject = project.parent
@ -77,6 +80,24 @@ subprojects {
}
// 应用插件和配置
val libs = rootProject.libs
plugins.withId(libs.plugins.java.get().pluginId) {
extensions.configure<JavaPluginExtension> {
withSourcesJar()
withJavadocJar()
}
}
plugins.withId(libs.plugins.forgeboot.i18n.keygen.get().pluginId) {
tasks.named("kotlinSourcesJar") {
dependsOn("generateI18nKeys")
}
tasks.named<Jar>("sourcesJar") {
dependsOn("generateI18nKeys")
}
}
version = rootProject.version
apply {
plugin(libs.plugins.java.get().pluginId)
plugin(libs.plugins.javaLibrary.get().pluginId)
@ -86,8 +107,6 @@ subprojects {
plugin(libs.plugins.kotlin.kapt.get().pluginId)
// 导入仓库配置
from(file("$configDir/repositories.gradle.kts"))
// 导入源代码任务
from(file("$tasksDir/sourceTask.gradle.kts"))
}
// 发布配置
publishing {

View File

@ -29,6 +29,7 @@ include(
":forgeboot-webmvc:version",
":forgeboot-webmvc:logger",
":forgeboot-webmvc:exception",
":forgeboot-webmvc:exception-i18n",
":forgeboot-webmvc:dto",
":forgeboot-webmvc:validation",
":forgeboot-webmvc:spec"
@ -37,6 +38,7 @@ project(":forgeboot-webmvc").name = "forgeboot-webmvc-spring-boot-starter"
project(":forgeboot-webmvc:version").name = "forgeboot-webmvc-version-spring-boot-starter"
project(":forgeboot-webmvc:logger").name = "forgeboot-webmvc-logger-spring-boot-starter"
project(":forgeboot-webmvc:exception").name = "forgeboot-webmvc-exception-spring-boot-starter"
project(":forgeboot-webmvc:exception-i18n").name = "forgeboot-webmvc-exception-i18n-spring-boot-starter"
project(":forgeboot-webmvc:dto").name = "forgeboot-webmvc-dto"
project(":forgeboot-webmvc:validation").name = "forgeboot-webmvc-validation"
project(":forgeboot-webmvc:spec").name = "forgeboot-webmvc-spec"