add vscode config generation to zig build gen (#862)

* add vscode config generation to `zig build gen`

* correctly handle removing configs in config_gen.zig

* update log messages in config_gen.zig
This commit is contained in:
Techatrix
2022-12-30 23:45:31 +00:00
committed by GitHub
parent d86d05d969
commit 417bf9bd0a
4 changed files with 115 additions and 120 deletions

View File

@@ -133,6 +133,7 @@ pub fn build(b: *std.build.Builder) !void {
exe.install();
const gen_exe = b.addExecutable("zls_gen", "src/config_gen/config_gen.zig");
gen_exe.addPackage(.{ .name = "tres", .source = .{ .path = "src/tres/tres.zig" } });
const gen_cmd = gen_exe.run();
gen_cmd.addArgs(&.{
@@ -141,6 +142,10 @@ pub fn build(b: *std.build.Builder) !void {
b.fmt("{s}/README.md", .{b.build_root}),
});
if (b.option([]const u8, "vscode-config-path", "Output path to vscode-config")) |path| {
gen_cmd.addArg(b.pathFromRoot(path));
}
const gen_step = b.step("gen", "Regenerate config files");
gen_step.dependOn(&gen_cmd.step);