Skip to content

Commit 53b5862

Browse files
rake format
1 parent cf92cd9 commit 53b5862

File tree

1 file changed

+29
-9
lines changed

1 file changed

+29
-9
lines changed

tasks/packaging.rake

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ tools = {
77

88
def npm_pkg_build_command(pkg)
99
[
10-
"bundle", "exec", "rbwasm",
10+
"bundle",
11+
"exec",
12+
"rbwasm",
1113
"build",
12-
"--ruby-version", pkg[:ruby_version],
13-
"--target", pkg[:target],
14-
"--build-profile", "full",
14+
"--ruby-version",
15+
pkg[:ruby_version],
16+
"--target",
17+
pkg[:target],
18+
"--build-profile",
19+
"full"
1520
]
1621
end
1722

@@ -39,7 +44,7 @@ namespace :npm do
3944
task "ruby" do
4045
env = {
4146
# Share ./build and ./rubies in the same workspace
42-
"RUBY_WASM_ROOT" => base_dir,
47+
"RUBY_WASM_ROOT" => base_dir
4348
}
4449
if gemfile_path = pkg[:gemfile]
4550
env["BUNDLE_GEMFILE"] = File.join(base_dir, gemfile_path)
@@ -50,10 +55,25 @@ namespace :npm do
5055
end
5156
dist_dir = File.join(pkg_dir, "dist")
5257
if pkg[:target] == "wasm32-unknown-wasi"
53-
sh env, *build_command, "--no-stdlib", "-o", File.join(dist_dir, "ruby.wasm")
54-
sh env, *build_command, "-o", File.join(dist_dir, "ruby.debug+stdlib.wasm")
55-
sh wasi_sdk.wasm_opt, "--strip-debug", File.join(dist_dir, "ruby.wasm"), "-o", File.join(dist_dir, "ruby.wasm")
56-
sh wasi_sdk.wasm_opt, "--strip-debug", File.join(dist_dir, "ruby.debug+stdlib.wasm"), "-o", File.join(dist_dir, "ruby+stdlib.wasm")
58+
sh env,
59+
*build_command,
60+
"--no-stdlib",
61+
"-o",
62+
File.join(dist_dir, "ruby.wasm")
63+
sh env,
64+
*build_command,
65+
"-o",
66+
File.join(dist_dir, "ruby.debug+stdlib.wasm")
67+
sh wasi_sdk.wasm_opt,
68+
"--strip-debug",
69+
File.join(dist_dir, "ruby.wasm"),
70+
"-o",
71+
File.join(dist_dir, "ruby.wasm")
72+
sh wasi_sdk.wasm_opt,
73+
"--strip-debug",
74+
File.join(dist_dir, "ruby.debug+stdlib.wasm"),
75+
"-o",
76+
File.join(dist_dir, "ruby+stdlib.wasm")
5777
elsif pkg[:target] == "wasm32-unknown-emscripten"
5878
sh env, *build_command, "-o", "/dev/null"
5979
end

0 commit comments

Comments
 (0)