| ... | @@ -19,7 +19,15 @@ pub fn execute(args: [][]u8) !void { | ... | @@ -19,7 +19,15 @@ pub fn execute(args: [][]u8) !void { |
| 19 | .update = should_update, | 19 | .update = should_update, |
| 20 | }); | 20 | }); |
| 21 | | 21 | |
| 22 | // | 22 | const list = &std.ArrayList(u.Module).init(gpa); |
| | 23 | try common.collect_pkgs(top_module, list); |
| | 24 | |
| | 25 | try create_depszig(dir, top_module, list); |
| | 26 | |
| | 27 | try create_lockfile(list, dir); |
| | 28 | } |
| | 29 | |
| | 30 | pub fn create_depszig(dir: []const u8, top_module: u.Module, list: *std.ArrayList(u.Module)) !void { |
| 23 | const f = try std.fs.cwd().createFile("deps.zig", .{}); | 31 | const f = try std.fs.cwd().createFile("deps.zig", .{}); |
| 24 | defer f.close(); | 32 | defer f.close(); |
| 25 | | 33 | |
| ... | @@ -56,9 +64,6 @@ pub fn execute(args: [][]u8) !void { | ... | @@ -56,9 +64,6 @@ pub fn execute(args: [][]u8) !void { |
| 56 | \\ | 64 | \\ |
| 57 | }); | 65 | }); |
| 58 | | 66 | |
| 59 | const list = &std.ArrayList(u.Module).init(gpa); | | |
| 60 | try common.collect_pkgs(top_module, list); | | |
| 61 | | | |
| 62 | try w.writeAll("pub const _ids = .{\n"); | 67 | try w.writeAll("pub const _ids = .{\n"); |
| 63 | try print_ids(w, list.items); | 68 | try print_ids(w, list.items); |
| 64 | try w.writeAll("};\n\n"); | 69 | try w.writeAll("};\n\n"); |
| ... | @@ -104,10 +109,6 @@ pub fn execute(args: [][]u8) !void { | ... | @@ -104,10 +109,6 @@ pub fn execute(args: [][]u8) !void { |
| 104 | try w.writeAll("pub const system_libs = &[_][]const u8{\n"); | 109 | try w.writeAll("pub const system_libs = &[_][]const u8{\n"); |
| 105 | try print_sys_libs_to(w, list.items, &std.ArrayList([]const u8).init(gpa)); | 110 | try print_sys_libs_to(w, list.items, &std.ArrayList([]const u8).init(gpa)); |
| 106 | try w.writeAll("};\n\n"); | 111 | try w.writeAll("};\n\n"); |
| 107 | | | |
| 108 | // | | |
| 109 | | | |
| 110 | try create_lockfile(list, dir); | | |
| 111 | } | 112 | } |
| 112 | | 113 | |
| 113 | fn create_lockfile(list: *std.ArrayList(u.Module), dir: []const u8) !void { | 114 | fn create_lockfile(list: *std.ArrayList(u.Module), dir: []const u8) !void { |