diff options
| author | David Czihak <git@dcz.at> | 2026-05-09 13:01:50 +0200 |
|---|---|---|
| committer | David Czihak <git@dcz.at> | 2026-05-09 13:01:50 +0200 |
| commit | 4b6f66fd512c254b5a82220dc77411fe391dd258 (patch) | |
| tree | 7d77d7966e9ad2e296986ea8cfeb607088028195 /examples/monorepo/build.zig | |
| parent | 64e9c56fc665972fdde5234c4fb2f2a882e237dc (diff) | |
Chore: Rework examples for thorough extension testing
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; +} |
