Move Generation Destinations

This commit is contained in:
2026-04-18 10:24:34 +02:00
parent 897776f432
commit 6f6bf7080a
10 changed files with 166 additions and 91 deletions
+8 -5
View File
@@ -4030,12 +4030,15 @@ func TestBuildNativeRemovesStaleTopdataOutputs(t *testing.T) {
if err != nil {
t.Fatalf("BuildNative failed: %v", err)
}
if got, want := result.Output2DADir, filepath.Join(root, ".cache", "topdata", "2da"); got != want {
t.Fatalf("unexpected cached 2da output dir: got %q want %q", got, want)
}
if _, err := os.Stat(filepath.Join(result.Output2DADir, "stale.2da")); !os.IsNotExist(err) {
t.Fatalf("expected stale topdata output to be removed, stat err=%v", err)
t.Fatalf("expected stale legacy topdata output to be ignored, stat err=%v", err)
}
}
func TestBuildNativeWritesCompiledOutputsToAssetsAndBuild(t *testing.T) {
func TestBuildNativeWritesCompiledOutputsToCache(t *testing.T) {
root := testProjectRoot(t)
mkdirAll(t, filepath.Join(root, "topdata", "data", "repadjust"))
writeFile(t, filepath.Join(root, "topdata", "base_dialog.json"), "{}\n")
@@ -4053,10 +4056,10 @@ func TestBuildNativeWritesCompiledOutputsToAssetsAndBuild(t *testing.T) {
if err != nil {
t.Fatalf("BuildNative failed: %v", err)
}
if got, want := result.Output2DADir, filepath.Join(root, "topdata", "assets", "2da"); got != want {
if got, want := result.Output2DADir, filepath.Join(root, ".cache", "topdata", "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 {
if got, want := result.OutputTLKDir, filepath.Join(root, ".cache", "topdata", "tlk"); 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 {
@@ -9522,7 +9525,7 @@ func testProject(root string) *project.Project {
Paths: project.PathConfig{Source: "src", Assets: "assets", Build: "build"},
TopData: project.TopDataConfig{
Source: "topdata",
Build: "build/topdata",
Build: ".cache/topdata",
ReferenceBuilder: "reference",
Assets: ".",
},