mirror of
https://github.moeyy.xyz/https://github.com/GeWuYou/forgeboot
synced 2025-10-27 13:26:40 +08:00
- Create project build scripts and configuration files - Define module paths and project flags - Set up Kotlin and Spring Boot plugins - Configure Maven publishing and semantic versioning plugins - Add a source code packaging task - Set up the project dependency repositories - Initialize gradle-wrapper
17 lines
670 B
Groovy
17 lines
670 B
Groovy
// This task creates a jar file with the source code of the project
|
|
tasks.register("sourceTask", Jar, { Jar jar ->
|
|
logger.info("正在配置${project.name}源代码 jar 文件...")
|
|
|
|
// 单独添加 Kotlin 源代码目录
|
|
from(sourceSets.main.kotlin.srcDirs) {
|
|
into("kotlin") // 将 Kotlin 源代码放入子目录 kotlin
|
|
}
|
|
|
|
archiveClassifier.set("sources") // 设置生成文件的分类标识
|
|
|
|
logger.info("正在创建${project.name}源代码 jar 文件...")
|
|
logger.info("创建${project.name}源代码 jar 文件完成!")
|
|
}).configure {
|
|
group = "build"
|
|
description = "使用项目的源代码创建源代码 jar 文件"
|
|
} |