mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2024-12-15 06:50:12 +08:00
5d3660ffb8
* Enable HMCL to create game thread dump while game is running * Fix checkstyle * Hide accessToken * Code cleanup * Code cleanup * Enhance I18N and declare the charset (UTF-8) of output file * Inline variables * Update the modifier of org.jackhuang.hmcl.game.GameDumpCreator#writeDumpHeadTo from public to private * Refactor * Add license for GameDumpCreator, remove support for Java 8 * Remove unnecessary Arrays.copyOf * Fix checkstyle * Use system charset to read the inputstream from JVM * opt GameDumpCreator * retry on failed attach to vm * update GameDumpCreator * Opt GameDumpCreator * Fix * Include BCIG * Use BCIG to get PID. * Fix. * Fix again. * Code cleanup. Fix bugs. --------- Co-authored-by: Glavo <zjx001202@gmail.com>
108 lines
2.5 KiB
Plaintext
108 lines
2.5 KiB
Plaintext
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"))
|
|
}
|
|
mavenCentral()
|
|
maven(url = "https://jitpack.io")
|
|
maven(url = "https://libraries.minecraft.net")
|
|
}
|
|
|
|
tasks.withType<JavaCompile> {
|
|
sourceCompatibility = "1.8"
|
|
targetCompatibility = "1.8"
|
|
|
|
options.encoding = "UTF-8"
|
|
}
|
|
|
|
configure<CheckstyleExtension> {
|
|
sourceSets = setOf()
|
|
}
|
|
|
|
dependencies {
|
|
"testImplementation"("org.junit.jupiter:junit-jupiter:5.9.1")
|
|
}
|
|
|
|
tasks.withType<Test> {
|
|
useJUnitPlatform()
|
|
testLogging.showStandardStreams = true
|
|
}
|
|
|
|
configure<PublishingExtension> {
|
|
publications {
|
|
create<MavenPublication>("maven") {
|
|
from(components["java"])
|
|
}
|
|
}
|
|
repositories {
|
|
mavenLocal()
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.create("checkTranslations") {
|
|
doLast {
|
|
val hmclLangDir = file("HMCL/src/main/resources/assets/lang")
|
|
|
|
val en = java.util.Properties().apply {
|
|
hmclLangDir.resolve("I18N.properties").bufferedReader().use { load(it) }
|
|
}
|
|
|
|
val zh = java.util.Properties().apply {
|
|
hmclLangDir.resolve("I18N_zh.properties").bufferedReader().use { load(it) }
|
|
}
|
|
|
|
val zh_CN = java.util.Properties().apply {
|
|
hmclLangDir.resolve("I18N_zh_CN.properties").bufferedReader().use { load(it) }
|
|
}
|
|
|
|
var success = true
|
|
|
|
zh_CN.forEach {
|
|
if (!en.containsKey(it.key)) {
|
|
project.logger.warn("I18N.properties missing key '${it.key}'")
|
|
success = false
|
|
}
|
|
}
|
|
|
|
zh_CN.forEach {
|
|
if (!zh.containsKey(it.key)) {
|
|
project.logger.warn("I18N_zh.properties missing key '${it.key}'")
|
|
success = false
|
|
}
|
|
}
|
|
|
|
zh_CN.forEach {
|
|
if (it.value.toString().contains("帐户")) {
|
|
project.logger.warn("The misspelled '帐户' in '${it.key}' should be replaced by '账户'")
|
|
success = false
|
|
}
|
|
}
|
|
|
|
if (!success) {
|
|
throw GradleException("Part of the translation is missing")
|
|
}
|
|
}
|
|
}
|
|
|
|
apply {
|
|
from("javafx.gradle.kts")
|
|
}
|
|
|
|
defaultTasks("clean", "build")
|