2025-09-28 20:29:07 +08:00
|
|
|
import org.jackhuang.hmcl.gradle.ci.CheckUpdate
|
2025-09-07 15:47:17 +08:00
|
|
|
import org.jackhuang.hmcl.gradle.docs.UpdateDocuments
|
2025-10-21 15:37:32 +08:00
|
|
|
import org.jackhuang.hmcl.gradle.l10n.ParseLanguageSubtagRegistry
|
2025-09-07 15:47:17 +08:00
|
|
|
|
2022-01-01 13:43:54 +08:00
|
|
|
plugins {
|
|
|
|
|
id("checkstyle")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
group = "org.jackhuang"
|
|
|
|
|
version = "3.0"
|
|
|
|
|
|
|
|
|
|
subprojects {
|
|
|
|
|
apply {
|
|
|
|
|
plugin("java")
|
|
|
|
|
plugin("idea")
|
|
|
|
|
plugin("maven-publish")
|
|
|
|
|
plugin("checkstyle")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
|
flatDir {
|
|
|
|
|
name = "libs"
|
|
|
|
|
dirs = setOf(rootProject.file("lib"))
|
|
|
|
|
}
|
2025-10-01 13:04:19 +08:00
|
|
|
|
|
|
|
|
System.getenv("MAVEN_CENTRAL_REPO").let { repo ->
|
|
|
|
|
if (repo.isNullOrBlank())
|
|
|
|
|
mavenCentral()
|
|
|
|
|
else
|
|
|
|
|
maven(url = repo)
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-01 13:43:54 +08:00
|
|
|
maven(url = "https://jitpack.io")
|
2024-01-08 20:35:46 +08:00
|
|
|
maven(url = "https://libraries.minecraft.net")
|
2022-01-01 13:43:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tasks.withType<JavaCompile> {
|
|
|
|
|
options.encoding = "UTF-8"
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-03 20:01:08 +08:00
|
|
|
@Suppress("UnstableApiUsage")
|
|
|
|
|
tasks.withType<Checkstyle> {
|
|
|
|
|
maxHeapSize.set("2g")
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-01 13:43:54 +08:00
|
|
|
configure<CheckstyleExtension> {
|
|
|
|
|
sourceSets = setOf()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dependencies {
|
2025-08-01 19:26:11 +08:00
|
|
|
"testImplementation"(rootProject.libs.junit.jupiter)
|
|
|
|
|
"testRuntimeOnly"("org.junit.platform:junit-platform-launcher")
|
2023-01-14 01:48:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tasks.withType<Test> {
|
|
|
|
|
useJUnitPlatform()
|
|
|
|
|
testLogging.showStandardStreams = true
|
2022-01-01 13:43:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
configure<PublishingExtension> {
|
|
|
|
|
publications {
|
|
|
|
|
create<MavenPublication>("maven") {
|
|
|
|
|
from(components["java"])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
repositories {
|
|
|
|
|
mavenLocal()
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-07-31 19:41:02 +08:00
|
|
|
|
|
|
|
|
tasks.register("checkstyle") {
|
|
|
|
|
dependsOn(tasks["checkstyleMain"], tasks["checkstyleTest"])
|
|
|
|
|
}
|
2022-01-01 13:43:54 +08:00
|
|
|
}
|
|
|
|
|
|
2025-05-20 23:55:24 +08:00
|
|
|
org.jackhuang.hmcl.gradle.javafx.JavaFXUtils.register(rootProject)
|
2022-01-23 19:30:21 +08:00
|
|
|
|
2022-01-01 13:43:54 +08:00
|
|
|
defaultTasks("clean", "build")
|
2025-09-07 15:47:17 +08:00
|
|
|
|
2025-10-21 15:37:32 +08:00
|
|
|
tasks.register<ParseLanguageSubtagRegistry>("parseLanguageSubtagRegistry") {
|
|
|
|
|
languageSubtagRegistryFile.set(layout.projectDirectory.file("language-subtag-registry"))
|
|
|
|
|
|
|
|
|
|
sublanguagesFile.set(layout.projectDirectory.file("HMCLCore/src/main/resources/assets/lang/sublanguages.csv"))
|
|
|
|
|
defaultScriptFile.set(layout.projectDirectory.file("HMCLCore/src/main/resources/assets/lang/default_script.csv"))
|
|
|
|
|
}
|
2025-09-07 15:47:17 +08:00
|
|
|
|
|
|
|
|
tasks.register<UpdateDocuments>("updateDocuments") {
|
|
|
|
|
documentsDir.set(layout.projectDirectory.dir("docs"))
|
2025-09-28 20:29:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tasks.register<CheckUpdate>("checkUpdateDev") {
|
2025-10-02 21:57:44 +08:00
|
|
|
uri.set("https://ci.huangyuhui.net/job/HMCL-nightly")
|
2025-09-28 20:29:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tasks.register<CheckUpdate>("checkUpdateStable") {
|
2025-10-02 15:22:15 +08:00
|
|
|
uri.set("https://ci.huangyuhui.net/job/HMCL-stable")
|
2025-09-28 20:29:07 +08:00
|
|
|
}
|