mirror of
https://github.moeyy.xyz/https://github.com/GeWuYou/forgeboot
synced 2025-10-27 23:08:55 +08:00
build: Add Gitea Private Repository Support
- Added support for Gitea private repository in repositories.gradle.kts - Configure the private repository address through the environment variable GEWUYOU_GITEA_HOST - Update build.gradle.kts, optimize project configuration structure - adjust publishing configuration, remove redundant code
This commit is contained in:
parent
beacb9c856
commit
c89f1f1737
@ -53,13 +53,13 @@ allprojects {
|
|||||||
subprojects {
|
subprojects {
|
||||||
version = rootProject.version
|
version = rootProject.version
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
if(project.getPropertyByBoolean(ProjectFlags.USE_SPRING_BOOT_BOM)){
|
if (project.getPropertyByBoolean(ProjectFlags.USE_SPRING_BOOT_BOM)) {
|
||||||
dependencies{
|
dependencies {
|
||||||
implementation(platform(libs.springBootDependencies.bom))
|
implementation(platform(libs.springBootDependencies.bom))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (project.getPropertyByBoolean(ProjectFlags.USE_SPRING_BOOT_WEB)){
|
if (project.getPropertyByBoolean(ProjectFlags.USE_SPRING_BOOT_WEB)) {
|
||||||
dependencies{
|
dependencies {
|
||||||
compileOnly(libs.springBootStarter.web)
|
compileOnly(libs.springBootStarter.web)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -71,13 +71,12 @@ subprojects {
|
|||||||
plugin(libs.plugins.kotlin.jvm.get().pluginId)
|
plugin(libs.plugins.kotlin.jvm.get().pluginId)
|
||||||
plugin(libs.plugins.axionRelease.get().pluginId)
|
plugin(libs.plugins.axionRelease.get().pluginId)
|
||||||
// plugin(libs.plugins.spring.dependency.management.get().pluginId)
|
// plugin(libs.plugins.spring.dependency.management.get().pluginId)
|
||||||
// 导入仓库配置
|
//导入仓库配置
|
||||||
from(file("$configDir/repositories.gradle.kts"))
|
from(file("$configDir/repositories.gradle.kts"))
|
||||||
// 导入源代码任务
|
// 导入源代码任务
|
||||||
from(file("$tasksDir/sourceTask.gradle.kts"))
|
from(file("$tasksDir/sourceTask.gradle.kts"))
|
||||||
// // 导入发布配置
|
|
||||||
// from(file("$configDir/publishing.gradle.kts"))
|
|
||||||
}
|
}
|
||||||
|
//region publishing
|
||||||
publishing {
|
publishing {
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
@ -127,26 +126,23 @@ subprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
//endregion
|
||||||
|
dependencies {
|
||||||
|
|
||||||
|
}
|
||||||
dependencies {
|
configure<JavaPluginExtension> {
|
||||||
|
toolchain {
|
||||||
}
|
languageVersion.set(JavaLanguageVersion.of(21))
|
||||||
configure<JavaPluginExtension> {
|
|
||||||
toolchain {
|
|
||||||
languageVersion.set(JavaLanguageVersion.of(21))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tasks.withType<Jar> {
|
|
||||||
isEnabled = true
|
|
||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
||||||
}
|
|
||||||
tasks.named<Test>("test") {
|
|
||||||
useJUnitPlatform()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tasks.withType<Jar> {
|
||||||
|
isEnabled = true
|
||||||
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
|
}
|
||||||
|
tasks.named<Test>("test") {
|
||||||
|
useJUnitPlatform()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
fun Project.getPropertyByBoolean(key: String): Boolean {
|
fun Project.getPropertyByBoolean(key: String): Boolean {
|
||||||
return properties[key]?.toString()?.toBoolean() ?: false
|
return properties[key]?.toString()?.toBoolean() ?: false
|
||||||
|
|||||||
@ -1,6 +1,13 @@
|
|||||||
// This file is used to define the repositories used by the project.
|
// This file is used to define the repositories used by the project.
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
|
val host = System.getenv("GEWUYOU_GITEA_HOST")
|
||||||
|
host?.let {
|
||||||
|
maven{
|
||||||
|
url = uri("http://${host}/api/packages/gewuyou/maven")
|
||||||
|
isAllowInsecureProtocol = true
|
||||||
|
}
|
||||||
|
}
|
||||||
maven {
|
maven {
|
||||||
url = uri("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
|
url = uri("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user