mirror of
https://github.com/jetzig-framework/jetzig.git
synced 2025-05-14 14:06:08 +00:00

Remove old bash script for setting up a new project, do everything in Zig to make it platform agnostic and give us an easy place to add scaffolding commands in future.
34 lines
918 B
Zig
34 lines
918 B
Zig
const std = @import("std");
|
|
|
|
const compile = @import("compile.zig");
|
|
|
|
pub fn build(b: *std.Build) !void {
|
|
const target = b.standardTargetOptions(.{});
|
|
const optimize = b.standardOptimizeOption(.{});
|
|
|
|
const exe = b.addExecutable(.{
|
|
.name = "jetzig",
|
|
.root_source_file = .{ .path = "cli.zig" },
|
|
.target = target,
|
|
.optimize = optimize,
|
|
});
|
|
|
|
const zig_args_dep = b.dependency("args", .{ .target = target, .optimize = optimize });
|
|
|
|
exe.root_module.addImport("args", zig_args_dep.module("args"));
|
|
exe.root_module.addImport(
|
|
"init_data",
|
|
try compile.initDataModule(b),
|
|
);
|
|
|
|
b.installArtifact(exe);
|
|
|
|
const run_cmd = b.addRunArtifact(exe);
|
|
run_cmd.step.dependOn(b.getInstallStep());
|
|
if (b.args) |args| {
|
|
run_cmd.addArgs(args);
|
|
}
|
|
const run_step = b.step("run", "Run the app");
|
|
run_step.dependOn(&run_cmd.step);
|
|
}
|