aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
Diffstat (limited to 'example')
-rw-r--r--example/build.gradle.kts14
-rw-r--r--example/src/main/kotlin/test.kt2
2 files changed, 8 insertions, 8 deletions
diff --git a/example/build.gradle.kts b/example/build.gradle.kts
index 99b62f9..7732e0a 100644
--- a/example/build.gradle.kts
+++ b/example/build.gradle.kts
@@ -1,5 +1,3 @@
-import moe.nea.mcautotranslations.gradle.CollectTranslations
-
plugins {
kotlin("jvm") version "2.0.20"
id("moe.nea.mc-auto-translations")
@@ -18,10 +16,12 @@ mcAutoTranslations {
translationFunctionResolved.set("moe.nea.mcautotranslations.example.trResolved")
}
-val collectTranslations by tasks.registering(CollectTranslations::class) {
+mcAutoTranslations.collectTranslationsTaskFor(sourceSets.main.get()) {
this.baseTranslations.from(file("en_us.json"))
- this.classes.from(sourceSets.main.map { it.kotlin.classesDirectory })
- this.outputFile.set(layout.buildDirectory.file("en_us.json"))
+ outputFileName("en_us.json")
+}
+tasks.processResources {
+ from(mcAutoTranslations.collectTranslationsTaskFor(sourceSets.main.get())) {
+ into("assets/minecraft/lang")
+ }
}
-
-tasks.processResources { from(collectTranslations) }
diff --git a/example/src/main/kotlin/test.kt b/example/src/main/kotlin/test.kt
index 7702dad..7c0c88c 100644
--- a/example/src/main/kotlin/test.kt
+++ b/example/src/main/kotlin/test.kt
@@ -4,7 +4,7 @@ import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
val resources =
- Text::class.java.classLoader.getResourceAsStream("en_us.json")!!.reader().use {
+ Text::class.java.classLoader.getResourceAsStream("assets/minecraft/lang/en_us.json")!!.reader().use {
Gson().fromJson(it, object : TypeToken<HashMap<String, String>>() {})
}