Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
.imports = imports,
});
// The version of dockyard, from build.zig.zon: the crash reports and
// the MCP server give it.
const opts = b.addOptions();
opts.addOption([]const u8, "version", @import("build.zig.zon").version);
root.addOptions("build_options", opts);
// LLVM and LLD link the system start files, as in the build of ztk.
const exe = b.addExecutable(.{ .name = "dockyard", .root_module = root, .use_llvm = true, .use_lld = use_lld });
b.installArtifact(exe);
Expand Down Expand Up @@ -102,6 +107,7 @@ pub fn build(b: *std.Build) void {
}) });
test_opts.addOptionPath("guest_helper", host_guest.getEmittedBin());
test_module.addOptions("test_options", test_opts);
test_module.addOptions("build_options", opts);
const tests = b.addTest(.{ .root_module = test_module, .use_llvm = true, .use_lld = use_lld });
const run_tests = b.addRunArtifact(tests);
run_tests.step.dependOn(b.getInstallStep());
Expand Down
2 changes: 1 addition & 1 deletion build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.{
.name = .dockyard,
.fingerprint = 0x240b86b880fe647b,
.version = "0.1.0",
.version = "1.0.0-beta.1",
.minimum_zig_version = "0.17.0",
.dependencies = .{
.ztk = .{
Expand Down
2 changes: 1 addition & 1 deletion src/app/crash.zig
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const builtin = @import("builtin");
const ztcl = @import("ztcl");
const Io = std.Io;

pub const version = "0.1.0";
pub const version: []const u8 = @import("build_options").version;
const keep = 20;
const on_posix = builtin.os.tag != .windows;

Expand Down
2 changes: 1 addition & 1 deletion src/app/mcp.zig
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub fn handle(a: std.mem.Allocator, socket_path: [:0]const u8, line: []const u8)
return success(a, id, .{
.protocolVersion = version,
.capabilities = .{ .tools = .{ .listChanged = false } },
.serverInfo = .{ .name = server_name, .version = "0.1.0" },
.serverInfo = .{ .name = server_name, .version = @import("build_options").version },
.instructions = instructions,
});
}
Expand Down
Loading