Skip to content

Commit

Permalink
turn 64bit android package into a simple shim
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Sep 10, 2022
1 parent a849b7a commit 112a033
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 20 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
/deno/
/esbuild
/github/
/npm/esbuild-android-64/esbuild.wasm
/npm/esbuild-android-64/exit0.js
/npm/esbuild-android-64/wasm_exec_node.js
/npm/esbuild-android-64/wasm_exec.js
/npm/esbuild-wasm/browser.js
/npm/esbuild-wasm/esbuild.wasm
/npm/esbuild-wasm/esm/
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ platform-unixlike: version-go
node scripts/esbuild.js "$(NPMDIR)/package.json" --version
CGO_ENABLED=0 GOOS="$(GOOS)" GOARCH="$(GOARCH)" go build $(GO_FLAGS) -o "$(NPMDIR)/bin/esbuild" ./cmd/esbuild

platform-android: platform-wasm
platform-android:
node scripts/esbuild.js npm/esbuild-android-64/package.json --version

platform-android-arm:
Expand Down Expand Up @@ -533,7 +533,6 @@ validate-build:
# This checks that the published binaries are bitwise-identical to the locally-build binaries
validate-builds:
git fetch --all --tags && git checkout "v$(ESBUILD_VERSION)"
@$(MAKE) --no-print-directory TARGET=platform-android PACKAGE=esbuild-android-64 SUBPATH=esbuild.wasm validate-build
@$(MAKE) --no-print-directory TARGET=platform-android-arm64 PACKAGE=esbuild-android-arm64 SUBPATH=bin/esbuild validate-build
@$(MAKE) --no-print-directory TARGET=platform-darwin PACKAGE=esbuild-darwin-64 SUBPATH=bin/esbuild validate-build
@$(MAKE) --no-print-directory TARGET=platform-darwin-arm64 PACKAGE=esbuild-darwin-arm64 SUBPATH=bin/esbuild validate-build
Expand Down Expand Up @@ -564,8 +563,6 @@ clean:
rm -f npm/esbuild-windows-arm64/esbuild.exe
rm -f npm/esbuild/install.js
rm -rf npm/@esbuild/linux-loong64/bin
rm -rf npm/esbuild-android-64/bin
rm -rf npm/esbuild-android-64/esbuild.wasm npm/esbuild-android-64/wasm_exec.js npm/esbuild-android-64/wasm_exec_node.js npm/esbuild-android-64/exit0.js
rm -rf npm/esbuild-android-arm64/bin
rm -rf npm/esbuild-darwin-64/bin
rm -rf npm/esbuild-darwin-arm64/bin
Expand Down
2 changes: 2 additions & 0 deletions npm/esbuild-android-64/bin/esbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env node
require('esbuild-wasm/bin/esbuild')
3 changes: 3 additions & 0 deletions npm/esbuild-android-64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"engines": {
"node": ">=12"
},
"dependencies": {
"esbuild-wasm": "0.15.7"
},
"os": [
"android"
],
Expand Down
12 changes: 0 additions & 12 deletions scripts/esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,18 +208,6 @@ module.exports = ${JSON.stringify(exit0Map, null, 2)};

// Join with the asynchronous WebAssembly build
await goBuildPromise;

// Also copy this into the WebAssembly shim directories
for (const dir of [
path.join(repoDir, 'npm', 'esbuild-android-64'),
]) {
fs.mkdirSync(path.join(dir, 'bin'), { recursive: true })
fs.writeFileSync(path.join(dir, 'wasm_exec.js'), wasm_exec_js);
fs.writeFileSync(path.join(dir, 'wasm_exec_node.js'), wasm_exec_node_js);
fs.writeFileSync(path.join(dir, 'exit0.js'), exit0Code);
fs.copyFileSync(path.join(npmWasmDir, 'bin', 'esbuild'), path.join(dir, 'bin', 'esbuild'));
fs.copyFileSync(path.join(npmWasmDir, 'esbuild.wasm'), path.join(dir, 'esbuild.wasm'));
}
}

const buildDenoLib = (esbuildPath) => {
Expand Down

0 comments on commit 112a033

Please sign in to comment.