aboutsummaryrefslogtreecommitdiff
path: root/build.gradle.kts
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-10-30 18:34:52 +0100
committerLinnea Gräf <nea@nea.moe>2024-10-30 18:41:15 +0100
commitb11b12585d3e4dfd67f73beebf7cf950799f087c (patch)
tree5b695f0c03b5e66c65d28092192031cab5f910fb /build.gradle.kts
parentc9c25b61560e6fb4e1ba2dfb1d5cc61b0ec9ddab (diff)
downloadFirmament-b11b12585d3e4dfd67f73beebf7cf950799f087c.tar.gz
Firmament-b11b12585d3e4dfd67f73beebf7cf950799f087c.tar.bz2
Firmament-b11b12585d3e4dfd67f73beebf7cf950799f087c.zip
Add mc auto translations
[no changelog]
Diffstat (limited to 'build.gradle.kts')
-rw-r--r--build.gradle.kts18
1 files changed, 18 insertions, 0 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index 4bcffe8..effa917 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -9,6 +9,7 @@
import com.google.devtools.ksp.gradle.KspTaskJvm
import com.google.gson.JsonArray
import moe.nea.licenseextractificator.LicenseDiscoveryTask
+import moe.nea.mcautotranslations.gradle.CollectTranslations
import net.fabricmc.loom.LoomGradleExtension
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.plugin.SubpluginOption
@@ -24,6 +25,7 @@ plugins {
alias(libs.plugins.loom)
id("com.github.johnrengelman.shadow") version "8.1.1"
id("moe.nea.licenseextractificator")
+ id("moe.nea.mc-auto-translations") version "0.0.1"
}
version = getGitTagInfo()
@@ -110,6 +112,11 @@ fun innerJarsOf(name: String, dependency: Dependency): FileCollection {
return project.files(task)
}
+val collectTranslations by tasks.registering(CollectTranslations::class) {
+ this.baseTranslations.from(file("translations/en_us.json"))
+ this.classes.from(sourceSets.main.get().kotlin.classesDirectory)
+}
+
val compatSourceSets: MutableSet<SourceSet> = mutableSetOf()
fun createIsolatedSourceSet(name: String, path: String = "compat/$name"): SourceSet {
val ss = sourceSets.create(name) {
@@ -146,6 +153,9 @@ fun createIsolatedSourceSet(name: String, path: String = "compat/$name"): Source
tasks.shadowJar {
from(ss.output)
}
+ collectTranslations {
+ this.classes.from(sourceSets.main.get().kotlin.classesDirectory)
+ }
return ss
}
@@ -300,6 +310,11 @@ loom {
}
}
+mcAutoTranslations {
+ translationFunction.set("moe.nea.firmament.util.tr")
+ translationFunctionResolved.set("moe.nea.firmament.util.trResolved")
+}
+
tasks.test {
useJUnitPlatform()
}
@@ -356,6 +371,9 @@ tasks.processResources {
}
exclude("**/*.license")
from(tasks.scanLicenses)
+ from(collectTranslations) {
+ into("assets/firmament/lang")
+ }
}
tasks.scanLicenses {