forked from finos/morphir
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start of using zig to orchestrate the build
- Loading branch information
1 parent
511c4fc
commit 6f3402c
Showing
4 changed files
with
45 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
# Node, Bun, and Deno Related | ||
package-lock.json | ||
node_modules/ | ||
|
||
# IDE Related | ||
.idea/ | ||
.fake | ||
.ionide | ||
|
||
.vscode/ | ||
package-lock.json | ||
node_modules/ | ||
|
||
|
||
# Elm related | ||
elm-stuff/ | ||
|
||
# Zig related | ||
zig-cache/ | ||
zig-out/ | ||
|
||
# Build Artifacts | ||
out/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const std = @import("std"); | ||
|
||
pub fn build(b: *std.Build) void { | ||
const run_tool = b.option(JavascriptRunTool, "js-runtool", "JavaScript run tool, such as npx or bun.") orelse JavascriptRunTool.bunx; | ||
|
||
// Setup verification step for the elm package | ||
const verify_elm_package = b.step("verify-elm-package", "Verify that the finos/morphir Elm package is valid and okay to publish."); | ||
const check_elm_docs = b.step("check-elm-docs", "Check that the Elm package documentation is in a valid state."); | ||
|
||
const elm_make_docs = switch (run_tool) { | ||
JavascriptRunTool.bunx => b.addSystemCommand(&.{ "bunx", "elm", "make" }), | ||
JavascriptRunTool.npx => b.addSystemCommand(&.{ "npx", "elm", "make" }), | ||
}; | ||
elm_make_docs.addArg("--docs"); | ||
|
||
const elm_docs_output = elm_make_docs.addOutputFileArg("docs.json"); | ||
|
||
check_elm_docs | ||
.dependOn(&b.addInstallFileWithDir(elm_docs_output, .prefix, b.pathJoin(&.{ "elm-out/finos/morphir", "docs.json" })).step); | ||
|
||
verify_elm_package.dependOn(check_elm_docs); | ||
} | ||
|
||
const JavascriptRunTool = enum { bunx, npx }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters