diff --git a/src/cmd/aquila/add.zig b/src/cmd/aquila/add.zig index abc95ce5dbed1f447b365d89bb155c9062a3e26a..9bd1b9b3e67db3dbbb5d0791d14f00f3cdf284ec 100644 --- a/src/cmd/aquila/add.zig +++ b/src/cmd/aquila/add.zig @@ -2,6 +2,7 @@ const std = @import("std"); const string = []const u8; const gpa = std.heap.c_allocator; +const zigmod = @import("../../lib.zig"); const u = @import("./../../util/index.zig"); const aq = @import("./../aq.zig"); @@ -23,7 +24,7 @@ pub fn do(dir: std.fs.Dir, pkg_id: string) !string { val.getT(.{ "pkg", "RemoteName" }, .String).?, }); - const m = try u.ModFile.from_dir(gpa, dir); + const m = try zigmod.ModFile.from_dir(gpa, dir); for (m.devdeps) |d| { if (std.mem.eql(u8, d.path, pkg_url)) { return pkg_url; diff --git a/src/cmd/aquila/install.zig b/src/cmd/aquila/install.zig index cd733b28416b0974c858f39c7c01b395d29affdf..eebc5d4659c7281018c400611ff5253c03ffc0f8 100644 --- a/src/cmd/aquila/install.zig +++ b/src/cmd/aquila/install.zig @@ -29,7 +29,7 @@ pub fn execute(args: [][]u8) !void { }; // get modfile and dep - const m = try u.ModFile.from_dir(gpa, homedir); + const m = try zigmod.ModFile.from_dir(gpa, homedir); var dep: zigmod.Dep = undefined; for (m.devdeps) |d| { if (std.mem.eql(u8, d.path, pkgurl)) { diff --git a/src/cmd/zpm/add.zig b/src/cmd/zpm/add.zig index 5fdd7600b2e2934321b062ef65a69e0dadfadbb0..9f25b031ed873b16f67d5138b3912f74da5799d6 100644 --- a/src/cmd/zpm/add.zig +++ b/src/cmd/zpm/add.zig @@ -3,6 +3,7 @@ const gpa = std.heap.c_allocator; const zfetch = @import("zfetch"); +const zigmod = @import("../../lib.zig"); const u = @import("./../../util/index.zig"); const zpm = @import("./../zpm.zig"); @@ -33,7 +34,7 @@ pub fn execute(args: [][]u8) !void { u.assert(found.root_file != null, "package must have an entry point to be able to be added to your dependencies", .{}); - const self_module = try u.ModFile.init(gpa, "zig.mod"); + const self_module = try zigmod.ModFile.init(gpa, "zig.mod"); for (self_module.deps) |dep| { if (std.mem.eql(u8, dep.name, found.name)) { std.log.warn("dependency with name '{s}' already exists in your dependencies", .{found.name}); diff --git a/src/common.zig b/src/common.zig index 75c7af1e6892846fcb73d31b4ad386ab0d0bd12c..8adc396b01ef4484c0a32a9754333f77bf625cd5 100644 --- a/src/common.zig +++ b/src/common.zig @@ -30,7 +30,7 @@ pub const CollectOptions = struct { }; pub fn collect_deps_deep(cachepath: string, mdir: std.fs.Dir, options: *CollectOptions) !u.Module { - const m = try u.ModFile.from_dir(gpa, mdir); + const m = try zigmod.ModFile.from_dir(gpa, mdir); try options.init(); var moduledeps = std.ArrayList(u.Module).init(gpa); defer moduledeps.deinit(); @@ -57,7 +57,7 @@ pub fn collect_deps_deep(cachepath: string, mdir: std.fs.Dir, options: *CollectO } pub fn collect_deps(cachepath: string, mdir: std.fs.Dir, options: *CollectOptions) anyerror!u.Module { - const m = try u.ModFile.from_dir(gpa, mdir); + const m = try zigmod.ModFile.from_dir(gpa, mdir); var moduledeps = std.ArrayList(u.Module).init(gpa); defer moduledeps.deinit(); if (m.files.len > 0) { diff --git a/src/lib.zig b/src/lib.zig index 437c6b0bb85cd129551969e53351dca82217d85d..dcacf761f3697744821cb70c25f3bbf9420367d5 100644 --- a/src/lib.zig +++ b/src/lib.zig @@ -25,3 +25,4 @@ pub fn deinit() void { pub const DepType = @import("./util/dep_type.zig").DepType; pub const Dep = @import("./util/dep.zig").Dep; +pub const ModFile = @import("./util/modfile.zig").ModFile; diff --git a/src/util/index.zig b/src/util/index.zig index 34ca244e2431d5726207b6f4b446cc4d56162723..5b2294e6af433a6f7a882a27618fe1272d3eacd4 100644 --- a/src/util/index.zig +++ b/src/util/index.zig @@ -1,3 +1,2 @@ usingnamespace @import("./funcs.zig"); -usingnamespace @import("./modfile.zig"); usingnamespace @import("./module.zig");