Change Output Locations

This commit is contained in:
2026-04-13 15:05:43 +02:00
parent a4fa2156ca
commit 129602a482
6 changed files with 107 additions and 25 deletions
+34 -2
View File
@@ -3640,8 +3640,8 @@ func TestBuildNativeRemovesStaleTopdataOutputs(t *testing.T) {
]
}`+"\n")
writeFile(t, filepath.Join(root, "topdata", "data", "repadjust", "lock.json"), "{}\n")
mkdirAll(t, filepath.Join(root, "build", "topdata", "2da"))
writeFile(t, filepath.Join(root, "build", "topdata", "2da", "stale.2da"), "stale\n")
mkdirAll(t, filepath.Join(root, "topdata", "assets", "2da"))
writeFile(t, filepath.Join(root, "topdata", "assets", "2da", "stale.2da"), "stale\n")
p := testProject(root)
p.Config.TopData.ReferenceBuilder = ""
@@ -3654,6 +3654,38 @@ func TestBuildNativeRemovesStaleTopdataOutputs(t *testing.T) {
}
}
func TestBuildNativeWritesCompiledOutputsToAssetsAndBuild(t *testing.T) {
root := testProjectRoot(t)
mkdirAll(t, filepath.Join(root, "topdata", "data", "repadjust"))
writeFile(t, filepath.Join(root, "topdata", "base_dialog.json"), "{}\n")
writeFile(t, filepath.Join(root, "topdata", "data", "repadjust", "base.json"), `{
"output": "repadjust.2da",
"columns": ["LABEL"],
"rows": [
{"id": 0, "LABEL": "TEST"}
]
}`+"\n")
p := testProject(root)
p.Config.TopData.ReferenceBuilder = ""
result, err := BuildNative(p, nil)
if err != nil {
t.Fatalf("BuildNative failed: %v", err)
}
if got, want := result.Output2DADir, filepath.Join(root, "topdata", "assets", "2da"); got != want {
t.Fatalf("unexpected 2da output dir: got %q want %q", got, want)
}
if got, want := result.OutputTLKDir, filepath.Join(root, "build"); got != want {
t.Fatalf("unexpected tlk output dir: got %q want %q", got, want)
}
if _, err := os.Stat(filepath.Join(result.Output2DADir, "repadjust.2da")); err != nil {
t.Fatalf("expected compiled 2da output: %v", err)
}
if _, err := os.Stat(filepath.Join(result.OutputTLKDir, defaultTLKName)); err != nil {
t.Fatalf("expected compiled tlk output: %v", err)
}
}
func TestValidateAndBuildTopdataDoNotRequireReferenceBuilder(t *testing.T) {
root := testProjectRoot(t)
mkdirAll(t, filepath.Join(root, "topdata", "data", "repadjust"))