| author | |
| committer | |
| log | 70ce68b8e7b7f00821d74b4f559ef80bfacdaed4 |
| tree | 84f39370dc9d8d24c6c7af3f26223d25352322ab |
| parent | 791f4831c20376be1511bef09eb018533a3cdcbf |
6 files changed, 8 insertions(+), 6 deletions(-)
src/cmd/aquila/add.zig+2-1| ... | @@ -2,6 +2,7 @@ const std = @import("std"); | ... | @@ -2,6 +2,7 @@ const std = @import("std"); |
| 2 | const string = []const u8; | 2 | const string = []const u8; |
| 3 | const gpa = std.heap.c_allocator; | 3 | const gpa = std.heap.c_allocator; |
| 4 | 4 | ||
| 5 | const zigmod = @import("../../lib.zig"); | ||
| 5 | const u = @import("./../../util/index.zig"); | 6 | const u = @import("./../../util/index.zig"); |
| 6 | const aq = @import("./../aq.zig"); | 7 | const aq = @import("./../aq.zig"); |
| 7 | 8 | ||
| ... | @@ -23,7 +24,7 @@ pub fn do(dir: std.fs.Dir, pkg_id: string) !string { | ... | @@ -23,7 +24,7 @@ pub fn do(dir: std.fs.Dir, pkg_id: string) !string { |
| 23 | val.getT(.{ "pkg", "RemoteName" }, .String).?, | 24 | val.getT(.{ "pkg", "RemoteName" }, .String).?, |
| 24 | }); | 25 | }); |
| 25 | 26 | ||
| 26 | const m = try u.ModFile.from_dir(gpa, dir); | 27 | const m = try zigmod.ModFile.from_dir(gpa, dir); |
| 27 | for (m.devdeps) |d| { | 28 | for (m.devdeps) |d| { |
| 28 | if (std.mem.eql(u8, d.path, pkg_url)) { | 29 | if (std.mem.eql(u8, d.path, pkg_url)) { |
| 29 | return pkg_url; | 30 | return pkg_url; |
src/cmd/aquila/install.zig+1-1| ... | @@ -29,7 +29,7 @@ pub fn execute(args: [][]u8) !void { | ... | @@ -29,7 +29,7 @@ pub fn execute(args: [][]u8) !void { |
| 29 | }; | 29 | }; |
| 30 | 30 | ||
| 31 | // get modfile and dep | 31 | // get modfile and dep |
| 32 | const m = try u.ModFile.from_dir(gpa, homedir); | 32 | const m = try zigmod.ModFile.from_dir(gpa, homedir); |
| 33 | var dep: zigmod.Dep = undefined; | 33 | var dep: zigmod.Dep = undefined; |
| 34 | for (m.devdeps) |d| { | 34 | for (m.devdeps) |d| { |
| 35 | if (std.mem.eql(u8, d.path, pkgurl)) { | 35 | if (std.mem.eql(u8, d.path, pkgurl)) { |
src/cmd/zpm/add.zig+2-1| ... | @@ -3,6 +3,7 @@ const gpa = std.heap.c_allocator; | ... | @@ -3,6 +3,7 @@ const gpa = std.heap.c_allocator; |
| 3 | 3 | ||
| 4 | const zfetch = @import("zfetch"); | 4 | const zfetch = @import("zfetch"); |
| 5 | 5 | ||
| 6 | const zigmod = @import("../../lib.zig"); | ||
| 6 | const u = @import("./../../util/index.zig"); | 7 | const u = @import("./../../util/index.zig"); |
| 7 | const zpm = @import("./../zpm.zig"); | 8 | const zpm = @import("./../zpm.zig"); |
| 8 | 9 | ||
| ... | @@ -33,7 +34,7 @@ pub fn execute(args: [][]u8) !void { | ... | @@ -33,7 +34,7 @@ pub fn execute(args: [][]u8) !void { |
| 33 | 34 | ||
| 34 | u.assert(found.root_file != null, "package must have an entry point to be able to be added to your dependencies", .{}); | 35 | u.assert(found.root_file != null, "package must have an entry point to be able to be added to your dependencies", .{}); |
| 35 | 36 | ||
| 36 | const self_module = try u.ModFile.init(gpa, "zig.mod"); | 37 | const self_module = try zigmod.ModFile.init(gpa, "zig.mod"); |
| 37 | for (self_module.deps) |dep| { | 38 | for (self_module.deps) |dep| { |
| 38 | if (std.mem.eql(u8, dep.name, found.name)) { | 39 | if (std.mem.eql(u8, dep.name, found.name)) { |
| 39 | std.log.warn("dependency with name '{s}' already exists in your dependencies", .{found.name}); | 40 | std.log.warn("dependency with name '{s}' already exists in your dependencies", .{found.name}); |
src/common.zig+2-2| ... | @@ -30,7 +30,7 @@ pub const CollectOptions = struct { | ... | @@ -30,7 +30,7 @@ pub const CollectOptions = struct { |
| 30 | }; | 30 | }; |
| 31 | 31 | ||
| 32 | pub fn collect_deps_deep(cachepath: string, mdir: std.fs.Dir, options: *CollectOptions) !u.Module { | 32 | pub fn collect_deps_deep(cachepath: string, mdir: std.fs.Dir, options: *CollectOptions) !u.Module { |
| 33 | const m = try u.ModFile.from_dir(gpa, mdir); | 33 | const m = try zigmod.ModFile.from_dir(gpa, mdir); |
| 34 | try options.init(); | 34 | try options.init(); |
| 35 | var moduledeps = std.ArrayList(u.Module).init(gpa); | 35 | var moduledeps = std.ArrayList(u.Module).init(gpa); |
| 36 | defer moduledeps.deinit(); | 36 | defer moduledeps.deinit(); |
| ... | @@ -57,7 +57,7 @@ pub fn collect_deps_deep(cachepath: string, mdir: std.fs.Dir, options: *CollectO | ... | @@ -57,7 +57,7 @@ pub fn collect_deps_deep(cachepath: string, mdir: std.fs.Dir, options: *CollectO |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | pub fn collect_deps(cachepath: string, mdir: std.fs.Dir, options: *CollectOptions) anyerror!u.Module { | 59 | pub fn collect_deps(cachepath: string, mdir: std.fs.Dir, options: *CollectOptions) anyerror!u.Module { |
| 60 | const m = try u.ModFile.from_dir(gpa, mdir); | 60 | const m = try zigmod.ModFile.from_dir(gpa, mdir); |
| 61 | var moduledeps = std.ArrayList(u.Module).init(gpa); | 61 | var moduledeps = std.ArrayList(u.Module).init(gpa); |
| 62 | defer moduledeps.deinit(); | 62 | defer moduledeps.deinit(); |
| 63 | if (m.files.len > 0) { | 63 | if (m.files.len > 0) { |
src/lib.zig+1| ... | @@ -25,3 +25,4 @@ pub fn deinit() void { | ... | @@ -25,3 +25,4 @@ pub fn deinit() void { |
| 25 | 25 | ||
| 26 | pub const DepType = @import("./util/dep_type.zig").DepType; | 26 | pub const DepType = @import("./util/dep_type.zig").DepType; |
| 27 | pub const Dep = @import("./util/dep.zig").Dep; | 27 | pub const Dep = @import("./util/dep.zig").Dep; |
| 28 | pub const ModFile = @import("./util/modfile.zig").ModFile; |
src/util/index.zig-1| ... | @@ -1,3 +1,2 @@ | ... | @@ -1,3 +1,2 @@ |
| 1 | usingnamespace @import("./funcs.zig"); | 1 | usingnamespace @import("./funcs.zig"); |
| 2 | usingnamespace @import("./modfile.zig"); | ||
| 3 | usingnamespace @import("./module.zig"); | 2 | usingnamespace @import("./module.zig"); |