diff options
Diffstat (limited to '')
| -rw-r--r-- | build.zig | 27 | ||||
| -rw-r--r-- | build.zig.zon | 4 |
2 files changed, 13 insertions, 18 deletions
| @@ -20,14 +20,18 @@ pub fn build(b: *Build) void { | |||
| 20 | const exe = b.addExecutable(.{ | 20 | const exe = b.addExecutable(.{ |
| 21 | .name = "zup", | 21 | .name = "zup", |
| 22 | .version = version, | 22 | .version = version, |
| 23 | .root_source_file = b.path("src/main.zig"), | 23 | .root_module = b.createModule(.{ |
| 24 | .target = target, | 24 | .root_source_file = b.path("src/main.zig"), |
| 25 | .optimize = optimize, | 25 | .target = target, |
| 26 | .optimize = optimize, | ||
| 27 | .imports = &.{ | ||
| 28 | .{ .name = "clap", .module = clap.module("clap") }, | ||
| 29 | .{ .name = "libarchive", .module = libarchive.module("libarchive") }, | ||
| 30 | .{ .name = "xdg", .module = xdg.module("xdg") }, | ||
| 31 | }, | ||
| 32 | }), | ||
| 26 | }); | 33 | }); |
| 27 | exe.root_module.addOptions("zup-config", config); | 34 | exe.root_module.addOptions("zup-config", config); |
| 28 | exe.root_module.addImport("clap", clap.module("clap")); | ||
| 29 | exe.root_module.addImport("libarchive", libarchive.module("libarchive")); | ||
| 30 | exe.root_module.addImport("xdg", xdg.module("xdg")); | ||
| 31 | b.installArtifact(exe); | 35 | b.installArtifact(exe); |
| 32 | 36 | ||
| 33 | const run_cmd = b.addRunArtifact(exe); | 37 | const run_cmd = b.addRunArtifact(exe); |
| @@ -38,18 +42,9 @@ pub fn build(b: *Build) void { | |||
| 38 | 42 | ||
| 39 | const run_step = b.step("run", "Run the app"); | 43 | const run_step = b.step("run", "Run the app"); |
| 40 | run_step.dependOn(&run_cmd.step); | 44 | run_step.dependOn(&run_cmd.step); |
| 41 | |||
| 42 | const exe_tests = b.addTest(.{ | ||
| 43 | .root_source_file = b.path("src/main.zig"), | ||
| 44 | .target = target, | ||
| 45 | .optimize = optimize, | ||
| 46 | }); | ||
| 47 | |||
| 48 | const test_step = b.step("test", "Run unit tests"); | ||
| 49 | test_step.dependOn(&exe_tests.step); | ||
| 50 | } | 45 | } |
| 51 | 46 | ||
| 52 | const default_version = SemanticVersion.parse("0.5.0") catch unreachable; | 47 | const default_version = SemanticVersion.parse("0.7.0-indev") catch unreachable; |
| 53 | 48 | ||
| 54 | fn getVersion(b: *Build) SemanticVersion { | 49 | fn getVersion(b: *Build) SemanticVersion { |
| 55 | var out_code: u8 = undefined; | 50 | var out_code: u8 = undefined; |
diff --git a/build.zig.zon b/build.zig.zon index 53324aa..1f2f04d 100644 --- a/build.zig.zon +++ b/build.zig.zon | |||
| @@ -6,8 +6,8 @@ | |||
| 6 | .paths = .{""}, | 6 | .paths = .{""}, |
| 7 | .dependencies = .{ | 7 | .dependencies = .{ |
| 8 | .clap = .{ | 8 | .clap = .{ |
| 9 | .url = "https://git.enes.lv/zig-clap/snapshot/zig-clap-0.10.0.tar.xz", | 9 | .url = "https://git.enes.lv/zig-clap/snapshot/zig-clap-6f103922a8133ba11773e6ad9a52e26e1d99b3e7.tar.xz", |
| 10 | .hash = "clap-0.10.0-oBajB434AQBDh-Ei3YtoKIRxZacVPF1iSwp3IX_ZB8f0", | 10 | .hash = "clap-0.10.0-oBajB0nsAQAlef8ldBenH89XSJNc_x1rVNkpHK2Y2tHg", |
| 11 | }, | 11 | }, |
| 12 | .libarchive = .{ | 12 | .libarchive = .{ |
| 13 | // .path = "../zig-libarchive", | 13 | // .path = "../zig-libarchive", |