| author | |
| committer | |
| log | 791f4831c20376be1511bef09eb018533a3cdcbf |
| tree | 2e43ac5c3024622d30fe11ce6130cf02a1431ec3 |
| parent | 6fd42714e7ec2ab81732770c6eebc9ff7a683b5e |
7 files changed, 16 insertions(+), 14 deletions(-)
src/cmd/aquila/install.zig+2-1| ... | ... | @@ -4,6 +4,7 @@ const gpa = std.heap.c_allocator; |
| 4 | 4 | |
| 5 | 5 | const knownfolders = @import("known-folders"); |
| 6 | 6 | |
| 7 | const zigmod = @import("../../lib.zig"); | |
| 7 | 8 | const u = @import("./../../util/index.zig"); |
| 8 | 9 | const common = @import("./../../common.zig"); |
| 9 | 10 | |
| ... | ... | @@ -29,7 +30,7 @@ pub fn execute(args: [][]u8) !void { |
| 29 | 30 | |
| 30 | 31 | // get modfile and dep |
| 31 | 32 | const m = try u.ModFile.from_dir(gpa, homedir); |
| 32 | var dep: u.Dep = undefined; | |
| 33 | var dep: zigmod.Dep = undefined; | |
| 33 | 34 | for (m.devdeps) |d| { |
| 34 | 35 | if (std.mem.eql(u8, d.path, pkgurl)) { |
| 35 | 36 | dep = d; |
src/common.zig+4-4| ... | ... | @@ -94,7 +94,7 @@ pub fn collect_pkgs(mod: u.Module, list: *std.ArrayList(u.Module)) anyerror!void |
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | pub fn get_modpath(cachepath: string, d: u.Dep, options: *CollectOptions) !string { | |
| 97 | pub fn get_modpath(cachepath: string, d: zigmod.Dep, options: *CollectOptions) !string { | |
| 98 | 98 | const p = try std.fs.path.join(gpa, &.{ cachepath, try d.clean_path() }); |
| 99 | 99 | const pv = try std.fs.path.join(gpa, &.{ cachepath, try d.clean_path_v() }); |
| 100 | 100 | |
| ... | ... | @@ -198,7 +198,7 @@ pub fn get_modpath(cachepath: string, d: u.Dep, options: *CollectOptions) !strin |
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | pub fn get_module_from_dep(d: *u.Dep, cachepath: string, options: *CollectOptions) anyerror!?u.Module { | |
| 201 | pub fn get_module_from_dep(d: *zigmod.Dep, cachepath: string, options: *CollectOptions) anyerror!?u.Module { | |
| 202 | 202 | if (options.lock) |lock| { |
| 203 | 203 | for (lock) |item| { |
| 204 | 204 | if (std.mem.eql(u8, item[0], try d.clean_path())) { |
| ... | ... | @@ -326,7 +326,7 @@ pub fn add_files_package(pkg_name: string, mdir: std.fs.Dir, dirs: []const strin |
| 326 | 326 | \\ |
| 327 | 327 | ); |
| 328 | 328 | |
| 329 | var d: u.Dep = .{ | |
| 329 | var d: zigmod.Dep = .{ | |
| 330 | 330 | .type = .local, |
| 331 | 331 | .path = "files", |
| 332 | 332 | .id = "", |
| ... | ... | @@ -367,7 +367,7 @@ pub fn parse_lockfile(dir: std.fs.Dir) ![]const [4]string { |
| 367 | 367 | }, |
| 368 | 368 | 2 => { |
| 369 | 369 | var iter = std.mem.split(u8, line, " "); |
| 370 | const asdep = u.Dep{ | |
| 370 | const asdep = zigmod.Dep{ | |
| 371 | 371 | .type = std.meta.stringToEnum(zigmod.DepType, iter.next().?).?, |
| 372 | 372 | .path = iter.next().?, |
| 373 | 373 | .version = iter.next().?, |
src/lib.zig+1| ... | ... | @@ -24,3 +24,4 @@ pub fn deinit() void { |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | pub const DepType = @import("./util/dep_type.zig").DepType; |
| 27 | pub const Dep = @import("./util/dep.zig").Dep; |
src/util/dep.zig+1-1| ... | ... | @@ -26,7 +26,7 @@ pub const Dep = struct { |
| 26 | 26 | only_os: []const string = &.{}, |
| 27 | 27 | except_os: []const string = &.{}, |
| 28 | 28 | yaml: ?yaml.Mapping, |
| 29 | deps: []u.Dep, | |
| 29 | deps: []zigmod.Dep, | |
| 30 | 30 | |
| 31 | 31 | pub fn clean_path(self: Dep) !string { |
| 32 | 32 | if (self.type == .local) { |
src/util/index.zig-1| ... | ... | @@ -1,4 +1,3 @@ |
| 1 | 1 | usingnamespace @import("./funcs.zig"); |
| 2 | usingnamespace @import("./dep.zig"); | |
| 3 | 2 | usingnamespace @import("./modfile.zig"); |
| 4 | 3 | usingnamespace @import("./module.zig"); |
src/util/modfile.zig+5-5| ... | ... | @@ -21,9 +21,9 @@ pub const ModFile = struct { |
| 21 | 21 | c_include_dirs: []const string, |
| 22 | 22 | c_source_flags: []const string, |
| 23 | 23 | c_source_files: []const string, |
| 24 | deps: []u.Dep, | |
| 24 | deps: []zigmod.Dep, | |
| 25 | 25 | yaml: yaml.Mapping, |
| 26 | devdeps: []u.Dep, | |
| 26 | devdeps: []zigmod.Dep, | |
| 27 | 27 | root_files: []const string, |
| 28 | 28 | files: []const string, |
| 29 | 29 | |
| ... | ... | @@ -67,8 +67,8 @@ pub const ModFile = struct { |
| 67 | 67 | }; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | fn dep_list_by_name(alloc: *std.mem.Allocator, mapping: yaml.Mapping, prop: string) anyerror![]u.Dep { | |
| 71 | var dep_list = std.ArrayList(u.Dep).init(alloc); | |
| 70 | fn dep_list_by_name(alloc: *std.mem.Allocator, mapping: yaml.Mapping, prop: string) anyerror![]zigmod.Dep { | |
| 71 | var dep_list = std.ArrayList(zigmod.Dep).init(alloc); | |
| 72 | 72 | if (mapping.get(prop)) |dep_seq| { |
| 73 | 73 | if (dep_seq == .sequence) { |
| 74 | 74 | for (dep_seq.sequence) |item| { |
| ... | ... | @@ -107,7 +107,7 @@ pub const ModFile = struct { |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | try dep_list.append(u.Dep{ | |
| 110 | try dep_list.append(zigmod.Dep{ | |
| 111 | 111 | .type = dep_type, |
| 112 | 112 | .path = path, |
| 113 | 113 | .id = item.mapping.get_string("id"), |
src/util/module.zig+3-2| ... | ... | @@ -3,6 +3,7 @@ const string = []const u8; |
| 3 | 3 | const gpa = std.heap.c_allocator; |
| 4 | 4 | const builtin = @import("builtin"); |
| 5 | 5 | |
| 6 | const zigmod = @import("../lib.zig"); | |
| 6 | 7 | const u = @import("index.zig"); |
| 7 | 8 | const yaml = @import("./yaml.zig"); |
| 8 | 9 | const common = @import("./../common.zig"); |
| ... | ... | @@ -23,9 +24,9 @@ pub const Module = struct { |
| 23 | 24 | yaml: ?yaml.Mapping, |
| 24 | 25 | deps: []Module, |
| 25 | 26 | clean_path: string, |
| 26 | dep: ?u.Dep, | |
| 27 | dep: ?zigmod.Dep, | |
| 27 | 28 | |
| 28 | pub fn from(dep: u.Dep, dir: string, options: *common.CollectOptions) !Module { | |
| 29 | pub fn from(dep: zigmod.Dep, dir: string, options: *common.CollectOptions) !Module { | |
| 29 | 30 | var moddeps = std.ArrayList(Module).init(gpa); |
| 30 | 31 | defer moddeps.deinit(); |
| 31 | 32 | for (dep.deps) |*d| { |