diff options
Diffstat (limited to 'examples/monorepo/build.zig')
| -rw-r--r-- | examples/monorepo/build.zig | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/monorepo/build.zig b/examples/monorepo/build.zig new file mode 100644 index 0000000..f565154 --- /dev/null +++ b/examples/monorepo/build.zig @@ -0,0 +1,30 @@ +const std = @import("std"); + +// Root build.zig for a two-package monorepo. +// Open the workspace root in Nova → discovers "test-all" and "gen-docs" steps. +// Open packages/beta/ separately → discovers that package's own "test" step. +pub fn build(b: *std.Build) void { + const target = b.standardTargetOptions(.{}); + const optimize = b.standardOptimizeOption(.{}); + + const exe = b.addExecutable(.{ + .name = "monorepo-root", + .root_module = b.createModule(.{ + .root_source_file = b.path("src/main.zig"), + .target = target, + .optimize = optimize, + }), + }); + b.installArtifact(exe); + + const run_cmd = b.addRunArtifact(exe); + const run_step = b.step("run", "Run the root executable"); + run_step.dependOn(&run_cmd.step); + + // Placeholder step that would orchestrate sub-package tests in a real monorepo. + const test_all_step = b.step("test-all", "Run tests for all packages"); + _ = test_all_step; + + const docs_step = b.step("gen-docs", "Generate docs for all packages"); + _ = docs_step; +} |
