authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-02-14 17:58:22 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-02-14 17:58:22 -08:00
log6a348fde80e5d6a3de3b558136e69ae8062c2f67
treeac6c05ffc2c0f7f93222315dd00bbb9598099f09
parent384f757df13e8c2b35dbed5788f27deb9df1dd60

add test program


3 files changed, 38 insertions(+), 0 deletions(-)

.gitignore created+3
......@@ -0,0 +1,3 @@
1/zig-cache
2/deps.zig
3/.zigmod
build.zig created+27
......@@ -0,0 +1,27 @@
1const Builder = @import("std").build.Builder;
2
3pub fn build(b: *Builder) void {
4 // Standard target options allows the person running `zig build` to choose
5 // what target to build for. Here we do not override the defaults, which
6 // means any target is allowed, and the default is native. Other options
7 // for restricting supported target set are available.
8 const target = b.standardTargetOptions(.{});
9
10 // Standard release options allow the person running `zig build` to select
11 // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
12 const mode = b.standardReleaseOptions();
13
14 const exe = b.addExecutable("zig-licenses", "src/main.zig");
15 exe.setTarget(target);
16 exe.setBuildMode(mode);
17 exe.install();
18
19 const run_cmd = exe.run();
20 run_cmd.step.dependOn(b.getInstallStep());
21 if (b.args) |args| {
22 run_cmd.addArgs(args);
23 }
24
25 const run_step = b.step("run", "Run the app");
26 run_step.dependOn(&run_cmd.step);
27}
src/main.zig created+8
......@@ -0,0 +1,8 @@
1const std = @import("std");
2const licenses = @import("./lib.zig");
3
4pub fn main() anyerror!void {
5 inline for (licenses.osi) |item| {
6 std.log.info("{s}", .{@field(licenses.spdx, item).url});
7 }
8}