const std = @import("std"); pub fn build(b: *std.Build) void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); const mod = b.addModule("spacez", .{ .root_source_file = b.path("src/spacez.zig"), .target = target, .optimize = optimize, }); const tests = b.addTest(.{ .root_module = mod }); const run_tests = b.addRunArtifact(tests); const test_step = b.step("test", "run unit tests"); test_step.dependOn(&run_tests.step); const demo = b.addExecutable(.{ .name = "spacez-demo", .root_module = b.createModule(.{ .root_source_file = b.path("examples/demo.zig"), .target = target, .optimize = optimize, .imports = &.{.{ .name = "spacez", .module = mod }}, }), }); b.installArtifact(demo); const run_demo = b.addRunArtifact(demo); run_demo.step.dependOn(b.getInstallStep()); const run_step = b.step("run", "run the demo"); run_step.dependOn(&run_demo.step); const ner_exe = b.addExecutable(.{ .name = "spacez-ner", .root_module = b.createModule(.{ .root_source_file = b.path("examples/ner.zig"), .target = target, .optimize = optimize, .imports = &.{.{ .name = "spacez", .module = mod }}, }), }); b.installArtifact(ner_exe); const ner_step = b.step("ner", "build the NER CLI"); ner_step.dependOn(b.getInstallStep()); const dump_exe = b.addExecutable(.{ .name = "spacez-dump", .root_module = b.createModule(.{ .root_source_file = b.path("examples/dump_tokvecs.zig"), .target = target, .optimize = optimize, .imports = &.{.{ .name = "spacez", .module = mod }}, }), }); b.installArtifact(dump_exe); const xval = b.addExecutable(.{ .name = "spacez-xval", .root_module = b.createModule(.{ .root_source_file = b.path("examples/cross_validate.zig"), .target = target, .optimize = optimize, .imports = &.{.{ .name = "spacez", .module = mod }}, }), }); b.installArtifact(xval); const run_xval = b.addRunArtifact(xval); run_xval.step.dependOn(b.getInstallStep()); const xval_step = b.step("xval", "cross-validate tokenizer against spaCy"); xval_step.dependOn(&run_xval.step); }