M build.gradle +12 -2
@@ 1,4 1,14 @@
-import site.srht.hutzdog.yaqol_gradle.DhallReader
+import site.srht.hutzdog.dhall4j.DhallReader
+
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+
+ dependencies {
+ classpath "site.srht.hutzdog:dhall4j:${rootProject.dhall4j_version}"
+ }
+}
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
@@ 16,7 26,7 @@ subprojects {
processResources {
filesMatching('**/*.dhall') {
- filter DhallReader
+ filter(DhallReader, mode: DhallReader.Mode.JSON)
def oldName = getName()
setName "${oldName.substring(0, oldName.length() - ".dhall".length())}.json"
}
R buildSrc/build.gradle => +0 -9
@@ 1,9 0,0 @@
-plugins {}
-
-repositories {
- mavenCentral()
-}
-
-dependencies {
- implementation 'org.jetbrains:annotations:16.0.2'
-}
R buildSrc/src/main/java/site/srht/hutzdog/yaqol_gradle/DhallReader.java => +0 -33
@@ 1,33 0,0 @@
-package site.srht.hutzdog.yaqol_gradle;
-// TODO: this probably should be it's own package, alongside a library of Minecraft specific helpers (in another package)
-
-import org.jetbrains.annotations.NotNull;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.FilterReader;
-import java.io.Reader;
-
-public class DhallReader extends FilterReader {
- public DhallReader(@NotNull Reader in) throws java.io.IOException {
- super(in);
-
- var proc = new ProcessBuilder("dhall-to-json")
- .redirectInput(makeRedirectPipe(in))
- .start();
- this.in = proc.inputReader();
-
- assert proc.exitValue() == 0;
- }
-
- static ProcessBuilder.@NotNull Redirect makeRedirectPipe(@NotNull Reader in) throws java.io.IOException {
- var tmp = File.createTempFile("yaqol-dhall", null);
- tmp.deleteOnExit();
-
- var out = new FileWriter(tmp);
- in.transferTo(out);
- out.close();
-
- return ProcessBuilder.Redirect.from(tmp);
- }
-}
M common/src/main/resources/assets/yaqol/lang/en_us.dhall +15 -16
@@ 1,26 1,25 @@
-let Map = https://prelude.dhall-lang.org/Map/package.dhall in
-let modID = "yaqol" in
-let keyType = \(type : Text) -> \(id : Text) -> Map.keyText "${type}.${modID}.${id}" in
-let item = keyType "item" in
-let itemGroup = keyType "itemGroup" in
-let tag = keyType "tag" in
+let Minecraft = ./dhall/Minecraft.dhall
+let minecraft = Minecraft.Lang.minecraft
+let yaqol = Minecraft.Lang.namespace "yaqol"
+
let boundToolSet = \(unlocalized : Text) -> \(name : Text) ->
- let mkName = \(item : Text) -> "bound_${unlocalized}_${item}" in
- [ item (mkName "axe") "Bound ${name} Axe"
- , item (mkName "hoe") "Bound ${name} Hoe"
- , item (mkName "pickaxe") "Bound ${name} Pickaxe"
- , item (mkName "shovel") "Bound ${name} Shovel"
- , item (mkName "sword") "Bound ${name} Sword" ]
+ let mkName = \(item : Text) -> "bound_${unlocalized}_${item}"
+ in [ yaqol.item (mkName "axe") "Bound ${name} Axe"
+ , yaqol.item (mkName "hoe") "Bound ${name} Hoe"
+ , yaqol.item (mkName "pickaxe") "Bound ${name} Pickaxe"
+ , yaqol.item (mkName "shovel") "Bound ${name} Shovel"
+ , yaqol.item (mkName "sword") "Bound ${name} Sword" ]
in
+
-- Groups
-[ itemGroup "yaqol_group" "YAQOL"
+[ yaqol.itemGroup "yaqol_group" "YAQOL"
-- Trivial items
-, item "coal_chunk" "Coal Chunk"
-, item "charcoal_chunk" "Charcoal Chunk"
+, yaqol.item "coal_chunk" "Coal Chunk"
+, yaqol.item "charcoal_chunk" "Charcoal Chunk"
-- Tags
-, tag "binding_materials" "Tool Binding Materials"
+, yaqol.tag "binding_materials" "Tool Binding Materials"
]
-- Tools
# boundToolSet "wood" "Wooden"
A => dhall/Minecraft.dhall +1 -0
@@ 0,0 1,1 @@
+https://hg.sr.ht/~hutzdog/minecraft.dhall/raw/package.dhall?rev=default
M forge/build.gradle +1 -1
@@ 77,7 77,7 @@ modrinth {
token = System.getenv("MODRINTH_TOKEN")
projectId = rootProject.modrinth_project
uploadFile = remapJar
- gameVersions = ['1.19']
+ gameVersions = ['1.19', '1.19.1']
versionType = 'alpha'
versionNumber = "${rootProject.version}+${rootProject.minecraft_version}-forge"
loaders = ['forge']
M gradle.properties +1 -0
@@ 9,6 9,7 @@ maven_group=site.srht.hutzdog
modrinth_project=G3oSyy0W
architectury_version=5.10.33
+dhall4j_version=0.0.1
parchment_version=2022.07.17
lombok_version=1.18.24
M quilt/build.gradle +1 -1
@@ 82,7 82,7 @@ modrinth {
token = System.getenv("MODRINTH_TOKEN")
projectId = rootProject.modrinth_project
uploadFile = remapJar
- gameVersions = ['1.19']
+ gameVersions = ['1.19', "1.19.1"]
versionNumber = "${rootProject.version}+${rootProject.minecraft_version}-quilt"
versionType = 'alpha'
loaders = ['quilt']