authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-09-15 15:54:27 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-09-15 15:54:27 -07:00
logf842053622e10883b17aec241587cd962c35971b
tree9353d90066bf5c961c30838e4e236298b0ac9780
parent3cffae7e763459d00316e73c623cab10a03dab95

add type field to zigmod.Module


2 files changed, 5 insertions(+), 0 deletions(-)

src/common.zig+3
......@@ -50,6 +50,7 @@ pub fn collect_deps_deep(cachepath: string, mdir: std.fs.Dir, options: *CollectO
5050 return zigmod.Module{
5151 .is_sys_lib = false,
5252 .is_framework = false,
53 .type = .local,
5354 .id = "root",
5455 .name = "root",
5556 .main = m.main,
......@@ -79,6 +80,7 @@ pub fn collect_deps(cachepath: string, mdir: std.fs.Dir, options: *CollectOption
7980 return zigmod.Module{
8081 .is_sys_lib = false,
8182 .is_framework = false,
83 .type = .local,
8284 .id = m.id,
8385 .name = m.name,
8486 .main = m.main,
......@@ -231,6 +233,7 @@ pub fn get_module_from_dep(d: *zigmod.Dep, cachepath: string, options: *CollectO
231233 return zigmod.Module{
232234 .is_sys_lib = d.type == .system_lib,
233235 .is_framework = d.type == .framework,
236 .type = d.type,
234237 .id = try u.do_hash(options.alloc, std.crypto.hash.sha3.Sha3_384, d.path),
235238 .name = d.path,
236239 .only_os = d.only_os,
src/util/module.zig+2
......@@ -13,6 +13,7 @@ const common = @import("./../common.zig");
1313pub const Module = struct {
1414 is_sys_lib: bool,
1515 is_framework: bool,
16 type: zigmod.Dep.Type,
1617 id: string,
1718 name: string,
1819 main: string,
......@@ -41,6 +42,7 @@ pub const Module = struct {
4142 return Module{
4243 .is_sys_lib = false,
4344 .is_framework = false,
45 .type = dep.type,
4446 .id = if (dep.id.len > 0) dep.id else try u.random_string(alloc, 48),
4547 .name = dep.name,
4648 .main = dep.main,