automatically generate config associated files (#813)

This commit is contained in:
Techatrix
2022-12-11 12:10:48 +01:00
committed by GitHub
parent 9e658cdbb6
commit 1ae341850e
11 changed files with 772 additions and 472 deletions

View File

@@ -116,6 +116,18 @@ pub fn build(b: *std.build.Builder) !void {
exe.setBuildMode(mode);
exe.install();
const gen_exe = b.addExecutable("zls_gen", "src/config_gen/config_gen.zig");
const gen_cmd = gen_exe.run();
gen_cmd.addArgs(&.{
b.fmt("{s}/src/Config.zig", .{b.build_root}),
b.fmt("{s}/schema.json", .{b.build_root}),
b.fmt("{s}/README.md", .{b.build_root}),
});
const gen_step = b.step("gen", "Regenerate config files");
gen_step.dependOn(&gen_cmd.step);
const test_step = b.step("test", "Run all the tests");
test_step.dependOn(b.getInstallStep());