diff options
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 35 |
1 files changed, 20 insertions, 15 deletions
| @@ -48,20 +48,25 @@ pub fn build(b: *std.Build) void { | |||
| 48 | 48 | ||
| 49 | fn readMeStep(b: *std.Build) *std.Build.Step { | 49 | fn readMeStep(b: *std.Build) *std.Build.Step { |
| 50 | const s = b.allocator.create(std.build.Step) catch unreachable; | 50 | const s = b.allocator.create(std.build.Step) catch unreachable; |
| 51 | s.* = std.build.Step.init(.custom, "ReadMeStep", b.allocator, struct { | 51 | s.* = std.build.Step.init(.{ |
| 52 | fn make(step: *std.build.Step) anyerror!void { | 52 | .id = .custom, |
| 53 | @setEvalBranchQuota(10000); | 53 | .name = "ReadMeStep", |
| 54 | _ = step; | 54 | .owner = b, |
| 55 | const file = try std.fs.cwd().createFile("README.md", .{}); | 55 | .makeFn = struct { |
| 56 | const stream = file.writer(); | 56 | fn make(step: *std.build.Step, _: *std.Progress.Node) anyerror!void { |
| 57 | try stream.print(@embedFile("example/README.md.template"), .{ | 57 | @setEvalBranchQuota(10000); |
| 58 | @embedFile("example/simple.zig"), | 58 | _ = step; |
| 59 | @embedFile("example/simple-ex.zig"), | 59 | const file = try std.fs.cwd().createFile("README.md", .{}); |
| 60 | @embedFile("example/streaming-clap.zig"), | 60 | const stream = file.writer(); |
| 61 | @embedFile("example/help.zig"), | 61 | try stream.print(@embedFile("example/README.md.template"), .{ |
| 62 | @embedFile("example/usage.zig"), | 62 | @embedFile("example/simple.zig"), |
| 63 | }); | 63 | @embedFile("example/simple-ex.zig"), |
| 64 | } | 64 | @embedFile("example/streaming-clap.zig"), |
| 65 | }.make); | 65 | @embedFile("example/help.zig"), |
| 66 | @embedFile("example/usage.zig"), | ||
| 67 | }); | ||
| 68 | } | ||
| 69 | }.make, | ||
| 70 | }); | ||
| 66 | return s; | 71 | return s; |
| 67 | } | 72 | } |