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
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0
version: master

- name: Generate Documentation
run: zig build docs --summary all
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0
version: master

- name: Setup kcov
if: github.repository_owner == 'zigtools' && matrix.os == 'ubuntu-22.04'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Provides the necessary building blocks to develop Language Server Protocol imple
# Installation

> [!NOTE]
> The default branch requires Zig `0.16.0` or later.
> The default branch requires Zig `0.17.0-dev.607+456b2ec07` or later.

```bash
# Initialize a `zig build` project if you haven't already
Expand Down
20 changes: 12 additions & 8 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,13 @@ pub fn build(b: *std.Build) void {
b.installArtifact(hello_client_exe);

const run_hello_client = b.addRunArtifact(hello_client_exe);
if (b.args) |args| {
run_hello_client.addArgs(args);
if (args.len == 1) {
run_hello_client.addArtifactArg(hello_server_exe);
}
run_hello_client.addPassthruArgs();

const server_path_opt = b.option([]const u8, "server_path", "Set server path for run-hello-client");
if (server_path_opt) |server_path| {
run_hello_client.addArg(server_path);
} else {
run_hello_client.addArtifactArg(hello_server_exe);
}

const run_hello_client_step = b.step("run-hello-client", "Run the hello-client example");
Expand Down Expand Up @@ -166,17 +168,19 @@ pub fn build(b: *std.Build) void {

// ----------------------------- Code Coverage -----------------------------

const kcov_bin = b.findProgram(&.{"kcov"}, &.{}) catch "kcov";
const kcov_bin = b.findProgramLazy(.{
.names = &.{"kcov"},
});

const kcov_merge = std.Build.Step.Run.create(b, "kcov merge coverage");
kcov_merge.rename_step_with_output_arg = false;
kcov_merge.addArg(kcov_bin);
kcov_merge.addFileArg(kcov_bin);
kcov_merge.addArg("--merge");
const coverage_output = kcov_merge.addOutputDirectoryArg(".");

for ([_]*std.Build.Step.Compile{ lsp_tests, lsp_parser_tests }) |test_artifact| {
const kcov_collect = std.Build.Step.Run.create(b, "kcov collect coverage");
kcov_collect.addArg(kcov_bin);
kcov_collect.addFileArg(kcov_bin);
kcov_collect.addArg("--collect-only");
kcov_collect.addPrefixedDirectoryArg("--include-path=", b.path("."));
kcov_merge.addDirectoryArg(kcov_collect.addOutputDirectoryArg(test_artifact.name));
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 = .lsp_kit,
.version = "0.1.0",
.minimum_zig_version = "0.16.0",
.minimum_zig_version = "0.17.0-dev.607+456b2ec07",
.dependencies = .{},
.paths = .{
"build.zig",
Expand Down
Loading