Native Workflow Support

This commit is contained in:
2026-04-09 11:01:39 +02:00
parent dc93feb176
commit 4f8bfc133a
9 changed files with 912 additions and 17 deletions
+39
View File
@@ -74,6 +74,11 @@ var commands = []command{
description: "Build canonical topdata outputs from topdata/data into build/topdata.",
run: runBuildTopData,
},
{
name: "build-top-package",
description: "Build sow_top.hak and sow_tlk.tlk from native topdata output and topdata/assets.",
run: runBuildTopPackage,
},
{
name: "compare-topdata",
description: "Rebuild topdata natively and compare the current build output against that fresh native result.",
@@ -143,6 +148,10 @@ func runBuild(ctx context) error {
fmt.Fprintf(ctx.stdout, "project: %s\n", p.Config.Module.Name)
fmt.Fprintf(ctx.stdout, "module: %s\n", result.ModulePath)
fmt.Fprintf(ctx.stdout, "resources: %d\n", result.Resources)
if result.TopPackageHAK != "" {
fmt.Fprintf(ctx.stdout, "top package hak: %s\n", result.TopPackageHAK)
fmt.Fprintf(ctx.stdout, "top package tlk: %s\n", result.TopPackageTLK)
}
if len(result.HAKPaths) > 0 {
fmt.Fprintf(ctx.stdout, "hak archives: %d\n", len(result.HAKPaths))
fmt.Fprintf(ctx.stdout, "hak assets: %d\n", result.HAKAssets)
@@ -167,6 +176,10 @@ func runBuildModule(ctx context) error {
fmt.Fprintf(ctx.stdout, "project: %s\n", p.Config.Module.Name)
fmt.Fprintf(ctx.stdout, "module: %s\n", result.ModulePath)
fmt.Fprintf(ctx.stdout, "resources: %d\n", result.Resources)
if result.TopPackageHAK != "" {
fmt.Fprintf(ctx.stdout, "top package hak: %s\n", result.TopPackageHAK)
fmt.Fprintf(ctx.stdout, "top package tlk: %s\n", result.TopPackageTLK)
}
return nil
}
@@ -378,6 +391,32 @@ func runBuildTopData(ctx context) error {
return nil
}
func runBuildTopPackage(ctx context) error {
p, err := loadProject(ctx.cwd)
if err != nil {
return err
}
result, err := topdata.BuildPackage(p, func(message string) {
fmt.Fprintf(ctx.stdout, "[build-top-package] %s\n", message)
})
if err != nil {
return err
}
fmt.Fprintf(ctx.stdout, "project: %s\n", p.Config.Module.Name)
fmt.Fprintf(ctx.stdout, "mode: %s\n", result.Mode)
fmt.Fprintf(ctx.stdout, "topdata 2da output: %s\n", result.Output2DADir)
fmt.Fprintf(ctx.stdout, "topdata tlk output: %s\n", result.OutputTLKDir)
fmt.Fprintf(ctx.stdout, "top package hak: %s\n", result.OutputHAKPath)
fmt.Fprintf(ctx.stdout, "top package tlk: %s\n", result.OutputTLKPath)
fmt.Fprintf(ctx.stdout, "2da files: %d\n", result.Files2DA)
fmt.Fprintf(ctx.stdout, "tlk files: %d\n", result.FilesTLK)
fmt.Fprintf(ctx.stdout, "top package resources: %d\n", result.HAKResources)
fmt.Fprintf(ctx.stdout, "top package assets: %d\n", result.AssetFiles)
return nil
}
func runCompareTopData(ctx context) error {
p, err := loadProject(ctx.cwd)
if err != nil {