gen_runtime.zig (1489B)
1 const std = @import("std"); 2 const LazyPath = std.Build.LazyPath; 3 4 pub const SourceItem = struct { name: []u8, api_export: bool }; 5 6 pub fn nvim_gen_runtime( 7 b: *std.Build, 8 nlua0: *std.Build.Step.Compile, 9 funcs_data: LazyPath, 10 ) !*std.Build.Step.WriteFile { 11 const gen_runtime = b.addWriteFiles(); 12 13 { 14 const gen_step = b.addRunArtifact(nlua0); 15 gen_step.addFileArg(b.path("src/gen/gen_vimvim.lua")); 16 const file = gen_step.addOutputFileArg("generated.vim"); 17 _ = gen_runtime.addCopyFile(file, "syntax/vim/generated.vim"); 18 gen_step.addFileArg(funcs_data); 19 gen_step.addFileArg(b.path("src/nvim/options.lua")); 20 gen_step.addFileArg(b.path("src/nvim/auevents.lua")); 21 gen_step.addFileArg(b.path("src/nvim/ex_cmds.lua")); 22 gen_step.addFileArg(b.path("src/nvim/vvars.lua")); 23 } 24 25 { 26 const install_doc_files = b.addInstallDirectory(.{ .source_dir = b.path("runtime/doc"), .install_dir = .prefix, .install_subdir = "runtime/doc" }); 27 gen_runtime.step.dependOn(&install_doc_files.step); 28 29 const gen_step = b.addRunArtifact(nlua0); 30 gen_step.addFileArg(b.path("src/gen/gen_helptags.lua")); 31 const file = gen_step.addOutputFileArg("tags"); 32 _ = gen_runtime.addCopyFile(file, "doc/tags"); 33 gen_step.addDirectoryArg(b.path("runtime/doc")); 34 gen_step.has_side_effects = true; // workaround: missing detection of input changes 35 } 36 37 return gen_runtime; 38 }