diff --git a/.drone.yml b/.drone.yml index f37de30..e97e607 100644 --- a/.drone.yml +++ b/.drone.yml @@ -18,8 +18,8 @@ steps: - rm /usr/local/bin/zig - ln -s /usr/local/zig-linux-x86_64-0.9.0-dev.321+15a030ef3/zig /usr/local/bin/zig - (cd codegen && zig build test) + - zig build # implicitly does a codegen - zig build test - - zig build - name: notify image: plugins/matrix when: diff --git a/build.zig b/build.zig index 144275a..bb3b698 100644 --- a/build.zig +++ b/build.zig @@ -17,20 +17,6 @@ pub fn build(b: *Builder) !void { // https://github.com/ziglang/zig/issues/855 exe.addPackagePath("smithy", "smithy/src/smithy.zig"); - // TODO: Support > linux - // TODO: Get a better cache in place - if (std.builtin.os.tag == .linux) { - const codegen = b.step("gen", "Generate zig service code from smithy models"); - codegen.dependOn(&b.addSystemCommand(&.{ "/bin/sh", "-c", "cd codegen && zig build" }).step); - codegen.dependOn(&b.addSystemCommand(&.{ - "/bin/sh", "-c", - \\ mkdir -p src/models/ && \ - \\ [ -f src/models/service_manifest.zig ] || \ - \\ ( cd codegen/models && ../codegen *.json && mv *.zig ../../src/models ) - }).step); - b.getInstallStep().dependOn(codegen); - } - exe.addCSourceFile("src/bitfield-workaround.c", &[_][]const u8{"-std=c99"}); const c_include_dirs = .{ "./src/", @@ -96,4 +82,19 @@ pub fn build(b: *Builder) !void { test_step.dependOn(&t.step); } } + + // TODO: Support > linux + // TODO: Get a better cache in place + if (std.builtin.os.tag == .linux) { + const codegen = b.step("gen", "Generate zig service code from smithy models"); + codegen.dependOn(&b.addSystemCommand(&.{ "/bin/sh", "-c", "cd codegen && zig build" }).step); + codegen.dependOn(&b.addSystemCommand(&.{ + "/bin/sh", "-c", + \\ mkdir -p src/models/ && \ + \\ [ -f src/models/service_manifest.zig ] || \ + \\ ( cd codegen/models && ../codegen *.json && mv *.zig ../../src/models ) + }).step); + b.getInstallStep().dependOn(codegen); + test_step.dependOn(codegen); + } }