authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-10-28 02:41:32 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-10-28 02:41:32 -07:00
log70ce68b8e7b7f00821d74b4f559ef80bfacdaed4
tree84f39370dc9d8d24c6c7af3f26223d25352322ab
parent791f4831c20376be1511bef09eb018533a3cdcbf

move ModFile to lib entry point


6 files changed, 8 insertions(+), 6 deletions(-)

src/cmd/aquila/add.zig+2-1
......@@ -2,6 +2,7 @@ const std = @import("std");
22const string = []const u8;
33const gpa = std.heap.c_allocator;
44
5const zigmod = @import("../../lib.zig");
56const u = @import("./../../util/index.zig");
67const aq = @import("./../aq.zig");
78
......@@ -23,7 +24,7 @@ pub fn do(dir: std.fs.Dir, pkg_id: string) !string {
2324 val.getT(.{ "pkg", "RemoteName" }, .String).?,
2425 });
2526
26 const m = try u.ModFile.from_dir(gpa, dir);
27 const m = try zigmod.ModFile.from_dir(gpa, dir);
2728 for (m.devdeps) |d| {
2829 if (std.mem.eql(u8, d.path, pkg_url)) {
2930 return pkg_url;
src/cmd/aquila/install.zig+1-1
......@@ -29,7 +29,7 @@ pub fn execute(args: [][]u8) !void {
2929 };
3030
3131 // get modfile and dep
32 const m = try u.ModFile.from_dir(gpa, homedir);
32 const m = try zigmod.ModFile.from_dir(gpa, homedir);
3333 var dep: zigmod.Dep = undefined;
3434 for (m.devdeps) |d| {
3535 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;
33
44const zfetch = @import("zfetch");
55
6const zigmod = @import("../../lib.zig");
67const u = @import("./../../util/index.zig");
78const zpm = @import("./../zpm.zig");
89
......@@ -33,7 +34,7 @@ pub fn execute(args: [][]u8) !void {
3334
3435 u.assert(found.root_file != null, "package must have an entry point to be able to be added to your dependencies", .{});
3536
36 const self_module = try u.ModFile.init(gpa, "zig.mod");
37 const self_module = try zigmod.ModFile.init(gpa, "zig.mod");
3738 for (self_module.deps) |dep| {
3839 if (std.mem.eql(u8, dep.name, found.name)) {
3940 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 {
3030};
3131
3232pub 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);
3434 try options.init();
3535 var moduledeps = std.ArrayList(u.Module).init(gpa);
3636 defer moduledeps.deinit();
......@@ -57,7 +57,7 @@ pub fn collect_deps_deep(cachepath: string, mdir: std.fs.Dir, options: *CollectO
5757}
5858
5959pub 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);
6161 var moduledeps = std.ArrayList(u.Module).init(gpa);
6262 defer moduledeps.deinit();
6363 if (m.files.len > 0) {
src/lib.zig+1
......@@ -25,3 +25,4 @@ pub fn deinit() void {
2525
2626pub const DepType = @import("./util/dep_type.zig").DepType;
2727pub const Dep = @import("./util/dep.zig").Dep;
28pub const ModFile = @import("./util/modfile.zig").ModFile;
src/util/index.zig-1
......@@ -1,3 +1,2 @@
11usingnamespace @import("./funcs.zig");
2usingnamespace @import("./modfile.zig");
32usingnamespace @import("./module.zig");