| author | |
| committer | |
| log | 55a0abba1dea88b5cb4c05c203bbb87a6c856678 |
| tree | 9425129ca88fdf5680342f442cb8119f488e9f1d |
| parent | 2a940e891dec481e0f33eeebc198bfaee48e7b68 |
4 files changed, 8 insertions(+), 7 deletions(-)
src/common.zig+3-3| ... | @@ -134,7 +134,7 @@ pub fn get_modpath(cachepath: string, d: zigmod.Dep, options: *CollectOptions) ! | ... | @@ -134,7 +134,7 @@ pub fn get_modpath(cachepath: string, d: zigmod.Dep, options: *CollectOptions) ! |
| 134 | }, | 134 | }, |
| 135 | .git => { | 135 | .git => { |
| 136 | if (d.version.len > 0) { | 136 | if (d.version.len > 0) { |
| 137 | const vers = u.parse_split(zigmod.DepType.Version.Git, "-").do(d.version) catch |e| switch (e) { | 137 | const vers = u.parse_split(zigmod.Dep.Type.Version.Git, "-").do(d.version) catch |e| switch (e) { |
| 138 | error.IterEmpty => unreachable, | 138 | error.IterEmpty => unreachable, |
| 139 | error.NoMemberFound => { | 139 | error.NoMemberFound => { |
| 140 | const vtype = d.version[0..std.mem.indexOf(u8, d.version, "-").?]; | 140 | const vtype = d.version[0..std.mem.indexOf(u8, d.version, "-").?]; |
| ... | @@ -212,7 +212,7 @@ pub fn get_module_from_dep(d: *zigmod.Dep, cachepath: string, options: *CollectO | ... | @@ -212,7 +212,7 @@ pub fn get_module_from_dep(d: *zigmod.Dep, cachepath: string, options: *CollectO |
| 212 | if (options.lock) |lock| { | 212 | if (options.lock) |lock| { |
| 213 | for (lock) |item| { | 213 | for (lock) |item| { |
| 214 | if (std.mem.eql(u8, item[0], try d.clean_path(options.alloc))) { | 214 | if (std.mem.eql(u8, item[0], try d.clean_path(options.alloc))) { |
| 215 | d.type = std.meta.stringToEnum(zigmod.DepType, item[1]).?; | 215 | d.type = std.meta.stringToEnum(zigmod.Dep.Type, item[1]).?; |
| 216 | d.path = item[2]; | 216 | d.path = item[2]; |
| 217 | d.version = item[3]; | 217 | d.version = item[3]; |
| 218 | break; | 218 | break; |
| ... | @@ -375,7 +375,7 @@ pub fn parse_lockfile(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]const [4]str | ... | @@ -375,7 +375,7 @@ pub fn parse_lockfile(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]const [4]str |
| 375 | 2 => { | 375 | 2 => { |
| 376 | var iter = std.mem.split(u8, line, " "); | 376 | var iter = std.mem.split(u8, line, " "); |
| 377 | const asdep = zigmod.Dep{ | 377 | const asdep = zigmod.Dep{ |
| 378 | .type = std.meta.stringToEnum(zigmod.DepType, iter.next().?).?, | 378 | .type = std.meta.stringToEnum(zigmod.Dep.Type, iter.next().?).?, |
| 379 | .path = iter.next().?, | 379 | .path = iter.next().?, |
| 380 | .version = iter.next().?, | 380 | .version = iter.next().?, |
| 381 | .id = "", | 381 | .id = "", |
src/lib.zig-1| ... | @@ -23,7 +23,6 @@ pub fn deinit() void { | ... | @@ -23,7 +23,6 @@ pub fn deinit() void { |
| 23 | zfetch.deinit(); | 23 | zfetch.deinit(); |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | pub const DepType = @import("./util/dep_type.zig").DepType; | ||
| 27 | pub const Dep = @import("./util/dep.zig").Dep; | 26 | pub const Dep = @import("./util/dep.zig").Dep; |
| 28 | pub const ModFile = @import("./util/modfile.zig").ModFile; | 27 | pub const ModFile = @import("./util/modfile.zig").ModFile; |
| 29 | pub const Module = @import("./util/module.zig").Module; | 28 | pub const Module = @import("./util/module.zig").Module; |
src/util/dep.zig+4-2| ... | @@ -12,7 +12,7 @@ const yaml = @import("./yaml.zig"); | ... | @@ -12,7 +12,7 @@ const yaml = @import("./yaml.zig"); |
| 12 | pub const Dep = struct { | 12 | pub const Dep = struct { |
| 13 | const Self = @This(); | 13 | const Self = @This(); |
| 14 | 14 | ||
| 15 | type: zigmod.DepType, | 15 | type: Type, |
| 16 | path: string, | 16 | path: string, |
| 17 | id: string, | 17 | id: string, |
| 18 | name: string, | 18 | name: string, |
| ... | @@ -29,6 +29,8 @@ pub const Dep = struct { | ... | @@ -29,6 +29,8 @@ pub const Dep = struct { |
| 29 | vcpkg: bool = false, | 29 | vcpkg: bool = false, |
| 30 | for_build: bool = false, | 30 | for_build: bool = false, |
| 31 | 31 | ||
| 32 | pub const Type = @import("./dep_type.zig").DepType; | ||
| 33 | |||
| 32 | pub fn clean_path(self: Dep, alloc: std.mem.Allocator) !string { | 34 | pub fn clean_path(self: Dep, alloc: std.mem.Allocator) !string { |
| 33 | if (self.type == .local) { | 35 | if (self.type == .local) { |
| 34 | return if (self.path.len == 0) "../.." else self.path; | 36 | return if (self.path.len == 0) "../.." else self.path; |
| ... | @@ -67,7 +69,7 @@ pub const Dep = struct { | ... | @@ -67,7 +69,7 @@ pub const Dep = struct { |
| 67 | } | 69 | } |
| 68 | return switch (self.type) { | 70 | return switch (self.type) { |
| 69 | .git => blk: { | 71 | .git => blk: { |
| 70 | const vers = try u.parse_split(zigmod.DepType.Version.Git, "-").do(self.version); | 72 | const vers = try u.parse_split(zigmod.Dep.Type.Version.Git, "-").do(self.version); |
| 71 | if (vers.id.frozen()) break :blk self.version; | 73 | if (vers.id.frozen()) break :blk self.version; |
| 72 | break :blk try self.type.exact_version(alloc, dpath); | 74 | break :blk try self.type.exact_version(alloc, dpath); |
| 73 | }, | 75 | }, |
src/util/modfile.zig+1-1| ... | @@ -110,7 +110,7 @@ pub const ModFile = struct { | ... | @@ -110,7 +110,7 @@ pub const ModFile = struct { |
| 110 | if (version == null) { | 110 | if (version == null) { |
| 111 | version = ""; | 111 | version = ""; |
| 112 | } | 112 | } |
| 113 | const dep_type = std.meta.stringToEnum(zigmod.DepType, dtype).?; | 113 | const dep_type = std.meta.stringToEnum(zigmod.Dep.Type, dtype).?; |
| 114 | if (dep_type == .local) { | 114 | if (dep_type == .local) { |
| 115 | if (path.len > 0) { | 115 | if (path.len > 0) { |
| 116 | name = path; | 116 | name = path; |