From 3da3361e5dd98c27ca742090f4d1ee0aefb288f5 Mon Sep 17 00:00:00 2001 From: Evan Wallace Date: Wed, 24 Mar 2021 12:42:20 -0700 Subject: [PATCH] fix #803: add support for android arm64 --- CHANGELOG.md | 4 ++++ Makefile | 17 ++++++++++++----- lib/install.ts | 3 ++- npm/esbuild-android-arm64/README.md | 3 +++ npm/esbuild-android-arm64/package.json | 16 ++++++++++++++++ 5 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 npm/esbuild-android-arm64/README.md create mode 100644 npm/esbuild-android-arm64/package.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c33abc76f7..808c7bc8dd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +* Add support for Android on ARM 64-bit ([#803](https://github.com/evanw/esbuild/issues/803)) + + This release includes support for Android in the official `esbuild` package. It should now be possible to install and run esbuild on Android devices through npm. + * Fix incorrect MIME types on Windows ([#1030](https://github.com/evanw/esbuild/issues/1030)) The web server built into esbuild uses the file extension to determine the value of the `Content-Type` header. This was previously done using the `mime.TypeByExtension()` function from Go's standard library. However, this function is apparently broken on Windows because installed programs can change MIME types in the Windows registry: [golang/go#32350](https://github.com/golang/go/issues/32350). This release fixes the problem by using a copy of Go's `mime.TypeByExtension()` function without the part that reads from the Windows registry. diff --git a/Makefile b/Makefile index 1f03ca7f071..0ccf13dcb4a 100644 --- a/Makefile +++ b/Makefile @@ -102,6 +102,7 @@ platform-all: cmd/esbuild/version.go test-all make -j8 \ platform-windows \ platform-windows-32 \ + platform-android-arm64 \ platform-darwin \ platform-darwin-arm64 \ platform-freebsd \ @@ -129,6 +130,9 @@ platform-unixlike: cd "$(NPMDIR)" && npm version "$(ESBUILD_VERSION)" --allow-same-version GOOS="$(GOOS)" GOARCH="$(GOARCH)" go build "-ldflags=-s -w" -o "$(NPMDIR)/bin/esbuild" ./cmd/esbuild +platform-android-arm64: + make GOOS=android GOARCH=arm64 NPMDIR=npm/esbuild-android-arm64 platform-unixlike + platform-darwin: make GOOS=darwin GOARCH=amd64 NPMDIR=npm/esbuild-darwin-64 platform-unixlike @@ -180,15 +184,14 @@ publish-all: cmd/esbuild/version.go test-prepublish publish-windows \ publish-windows-32 \ publish-freebsd \ - publish-freebsd-arm64 + publish-freebsd-arm64 \ + publish-darwin \ + publish-darwin-arm64 @echo Enter one-time password: @read OTP && OTP="$$OTP" make -j4 \ - publish-darwin \ - publish-darwin-arm64 \ + publish-android-arm64 \ publish-linux \ publish-linux-32 - @echo Enter one-time password: - @read OTP && OTP="$$OTP" make -j4 \ publish-linux-arm \ publish-linux-arm64 \ publish-linux-mips64le \ @@ -208,6 +211,9 @@ publish-windows: platform-windows publish-windows-32: platform-windows-32 test -n "$(OTP)" && cd npm/esbuild-windows-32 && npm publish --otp="$(OTP)" +publish-android-arm64: platform-android-arm64 + test -n "$(OTP)" && cd npm/esbuild-android-arm64 && npm publish --otp="$(OTP)" + publish-darwin: platform-darwin test -n "$(OTP)" && cd npm/esbuild-darwin-64 && npm publish --otp="$(OTP)" @@ -248,6 +254,7 @@ clean: rm -f esbuild rm -f npm/esbuild-windows-32/esbuild.exe rm -f npm/esbuild-windows-64/esbuild.exe + rm -rf npm/esbuild-android-arm64/bin rm -rf npm/esbuild-darwin-64/bin rm -rf npm/esbuild-darwin-arm64/bin rm -rf npm/esbuild-freebsd-64/bin diff --git a/lib/install.ts b/lib/install.ts index 48bd79581fd..269e2fc6f4a 100644 --- a/lib/install.ts +++ b/lib/install.ts @@ -280,8 +280,9 @@ const knownWindowsPackages: Record = { 'win32 x64 LE': 'esbuild-windows-64', }; const knownUnixlikePackages: Record = { - 'darwin x64 LE': 'esbuild-darwin-64', + 'android arm64 LE': 'esbuild-android-arm64', 'darwin arm64 LE': 'esbuild-darwin-arm64', + 'darwin x64 LE': 'esbuild-darwin-64', 'freebsd arm64 LE': 'esbuild-freebsd-arm64', 'freebsd x64 LE': 'esbuild-freebsd-64', 'linux arm LE': 'esbuild-linux-arm', diff --git a/npm/esbuild-android-arm64/README.md b/npm/esbuild-android-arm64/README.md new file mode 100644 index 00000000000..ec71ee6bc27 --- /dev/null +++ b/npm/esbuild-android-arm64/README.md @@ -0,0 +1,3 @@ +# esbuild + +This is the Android ARM 64-bit binary for esbuild, a JavaScript bundler and minifier. See https://github.com/evanw/esbuild for details. diff --git a/npm/esbuild-android-arm64/package.json b/npm/esbuild-android-arm64/package.json new file mode 100644 index 00000000000..ab30ecf59c0 --- /dev/null +++ b/npm/esbuild-android-arm64/package.json @@ -0,0 +1,16 @@ +{ + "name": "esbuild-android-arm64", + "version": "0.9.6", + "description": "The Android ARM 64-bit binary for esbuild, a JavaScript bundler.", + "repository": "https://github.com/evanw/esbuild", + "license": "MIT", + "os": [ + "android" + ], + "cpu": [ + "arm64" + ], + "directories": { + "bin": "bin" + } +}