File tree 4 files changed +22
-17
lines changed
4 files changed +22
-17
lines changed Original file line number Diff line number Diff line change 1
1
zml /
2
- workspace /
2
+ WORKSPACE /
3
+
4
+ .zig-cache /
5
+ zig-out /
Original file line number Diff line number Diff line change 10
10
mkdir $WORKSPACE
11
11
fi
12
12
13
+ curl https://ziglang.org/documentation/0.13.0/std/main.wasm -s -o WORKSPACE/main.wasm
14
+ curl https://ziglang.org/documentation/0.13.0/std/main.js -s -o WORKSPACE/main.js
15
+
13
16
# link-in the assets and layouts
14
17
for d in assets layouts ; do
15
18
if [ ! -h ${WORKSPACE} /$d ] ; then
Original file line number Diff line number Diff line change 1
1
cd zml
2
2
echo " Starting Bazel build..."
3
- bazel build //zml:docs
3
+ bazel build //zml:sources
4
4
cd ..
5
- # we reference these outputs in build.zig
6
- # - ./zml/bazel-bin/zml/docs.docs/sources.tar
7
- # - ./zml/bazel-bin/zml/docs.docs/main.wasm
5
+ cp ./zml/bazel-bin/zml/sources.tar WORKSPACE/
6
+
8
7
cd WORKSPACE
9
8
echo " Starting Zine build..."
10
9
zig build $@
Original file line number Diff line number Diff line change @@ -13,19 +13,19 @@ pub fn build(b: *std.Build) !void {
13
13
"zml.no_light.svg" ,
14
14
},
15
15
.build_assets = &.{
16
- .{
17
- .name = "main_wasm" ,
18
- .lp = b .path ("../zml/bazel-bin/zml/docs.docs/main.wasm" ),
19
- .install_path = "main.wasm" ,
20
- .install_always = true ,
21
- },
22
- .{
23
- .name = "sources" ,
24
- .lp = b .path ("../zml/bazel-bin/zml/docs.docs/sources.tar" ),
25
- .install_path = "sources.tar" ,
26
- .install_always = true ,
27
- },
16
+ staticAsset (b , "main.wasm" ),
17
+ staticAsset (b , "main.js" ),
18
+ staticAsset (b , "sources.tar" ),
28
19
},
29
20
.debug = true ,
30
21
});
31
22
}
23
+
24
+ fn staticAsset (b : * std.Build , name : []const u8 ) zine.BuildAsset {
25
+ return .{
26
+ .name = name ,
27
+ .lp = b .path (name ),
28
+ .install_path = name ,
29
+ .install_always = true ,
30
+ };
31
+ }
You can’t perform that action at this time.
0 commit comments