| ... | ... | @@ -25,6 +25,8 @@ pub fn execute(args: [][]u8) !void { |
| 25 | 25 | |
| 26 | 26 | const w = f.writer(); |
| 27 | 27 | try w.writeAll("const std = @import(\"std\");\n"); |
| 28 | try w.writeAll("const Pkg = std.build.Pkg;\n"); |
| 29 | try w.writeAll("const FileSource = std.build.FileSource;\n"); |
| 28 | 30 | try w.writeAll("\n"); |
| 29 | 31 | try w.print("pub const cache = \"{}\";\n", .{std.zig.fmtEscapes(dir)}); |
| 30 | 32 | try w.writeAll("\n"); |
| ... | ... | @@ -139,7 +141,7 @@ fn print_deps(w: std.fs.File.Writer, dir: []const u8, m: u.Module, tabs: i32, ar |
| 139 | 141 | return; |
| 140 | 142 | } |
| 141 | 143 | if (array) { |
| 142 | | try u.print_all(w, .{"&[_]std.build.Pkg{"}, true); |
| 144 | try u.print_all(w, .{"&[_]Pkg{"}, true); |
| 143 | 145 | } else { |
| 144 | 146 | try u.print_all(w, .{"struct {"}, true); |
| 145 | 147 | } |
| ... | ... | @@ -220,7 +222,7 @@ fn print_pkg_data_to(w: std.fs.File.Writer, notdone: *std.ArrayList(u.Module), d |
| 220 | 222 | while (notdone.items.len > 0) { |
| 221 | 223 | for (notdone.items) |mod, i| { |
| 222 | 224 | if (contains_all(mod.deps, done.items)) { |
| 223 | | try w.print(" pub const _{s} = std.build.Pkg{{ .name = \"{s}\", .path = std.build.FileSource{{ .path = cache ++ \"/{}/{s}\" }}, .dependencies = &[_]std.build.Pkg{{", .{ mod.id[0..12], mod.name, std.zig.fmtEscapes(mod.clean_path), mod.main }); |
| 225 | try w.print(" pub const _{s} = Pkg{{ .name = \"{s}\", .path = FileSource{{ .path = cache ++ \"/{}/{s}\" }}, .dependencies = &[_]Pkg{{", .{ mod.id[0..12], mod.name, std.zig.fmtEscapes(mod.clean_path), mod.main }); |
| 224 | 226 | for (mod.deps) |d| { |
| 225 | 227 | if (d.main.len > 0) { |
| 226 | 228 | try w.print(" _{s},", .{d.id[0..12]}); |