Files

107 lines
2.9 KiB
Kotlin
Raw Permalink Normal View History

2025-09-28 20:29:07 +08:00
import org.jackhuang.hmcl.gradle.ci.CheckUpdate
import org.jackhuang.hmcl.gradle.docs.UpdateDocuments
import org.jackhuang.hmcl.gradle.l10n.UpdateLanguageSubtagRegistry
import org.jackhuang.hmcl.gradle.l10n.UpdateTimeZoneRegions
2022-01-01 13:43:54 +08:00
plugins {
id("checkstyle")
2026-07-14 00:06:56 +08:00
id("org.glavo.gradle-wrapper-neo") version "0.2.0"
2022-01-01 13:43:54 +08:00
}
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"))
}
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")
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")
setConfigProperties("licenseHeaderFile" to rootProject.rootDir.resolve("config/checkstyle/license-header.txt"))
2025-10-03 20:01:08 +08:00
}
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")
tasks.register<UpdateLanguageSubtagRegistry>("updateLanguageSubtagRegistry") {
description = "Update the checked-in IANA sublanguage and default-script mappings"
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"))
}
tasks.register<UpdateTimeZoneRegions>("updateTimeZoneRegions") {
description = "Update the checked-in IANA time zone to region mapping"
tzdbVersion.set("2026e")
outputFile.set(layout.projectDirectory.file("HMCL/src/main/resources/assets/timezone_regions.csv"))
}
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") {
uri.set("https://ci.huangyuhui.net/job/HMCL-stable")
2025-09-28 20:29:07 +08:00
}