-
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.
- Loading branch information
Showing
4 changed files
with
145 additions
and
15 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 |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
*.so | ||
*.h | ||
out.js | ||
.idea | ||
.idea | ||
/build |
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,102 @@ | ||
## Platform Makefile | ||
## | ||
|
||
VERSION=0.19.5 | ||
|
||
platform-all: | ||
@$(MAKE) --no-print-directory -j4 \ | ||
platform-darwin-arm64 \ | ||
platform-darwin-x64 \ | ||
platform-freebsd-arm64 \ | ||
platform-freebsd-x64 \ | ||
platform-linux-arm \ | ||
platform-linux-arm64 \ | ||
platform-linux-ia32 \ | ||
platform-linux-loong64 \ | ||
platform-linux-mips64el \ | ||
platform-linux-ppc64 \ | ||
platform-linux-riscv64 \ | ||
platform-linux-s390x \ | ||
platform-linux-x64 \ | ||
platform-netbsd-x64 \ | ||
platform-openbsd-x64 \ | ||
platform-sunos-x64 \ | ||
platform-wasm \ | ||
platform-win32-arm64 \ | ||
platform-win32-ia32 \ | ||
platform-win32-x64 | ||
|
||
build-win32: | ||
CGO_ENABLED=0 GOOS="$(GOOS)" GOARCH="$(GOARCH)" go build $(GO_FLAGS) -o "$(BUILDDIR)/package/esbuild.exe" ./esbuild_scss.go | ||
tar -czf "build/$(GOOS)-$(GOARCH)-$(VERSION).tgz" --directory $(BUILDDIR) package | ||
|
||
platform-win32-x64: | ||
@$(MAKE) --no-print-directory GOOS=windows GOARCH=amd64 BUILDDIR=build/win32-x64 build-win32 | ||
|
||
platform-win32-ia32: | ||
@$(MAKE) --no-print-directory GOOS=windows GOARCH=386 BUILDDIR=build/win32-ia32 build-win32 | ||
|
||
platform-win32-arm64: | ||
@$(MAKE) --no-print-directory GOOS=windows GOARCH=arm64 BUILDDIR=build/win32-arm64 build-win32 | ||
|
||
build-platform: | ||
@test -n "$(GOOS)" || (echo "The environment variable GOOS must be provided" && false) | ||
@test -n "$(GOARCH)" || (echo "The environment variable GOARCH must be provided" && false) | ||
@test -n "$(BUILDDIR)" || (echo "The environment variable BUILDDIR must be provided" && false) | ||
CGO_ENABLED=0 GOOS="$(GOOS)" GOARCH="$(GOARCH)" go build $(GO_FLAGS) -o "$(BUILDDIR)/package/bin/esbuild" ./esbuild_scss.go | ||
tar -czf "build/$(GOOS)-$(GOARCH)-$(VERSION).tgz" --directory $(BUILDDIR) package | ||
|
||
## Define the build targets for each platform. | ||
platform-darwin-x64: | ||
@$(MAKE) --no-print-directory GOOS=darwin GOARCH=amd64 BUILDDIR=build/darwin-x64 build-platform | ||
|
||
platform-darwin-arm64: | ||
@$(MAKE) --no-print-directory GOOS=darwin GOARCH=arm64 BUILDDIR=build/darwin-arm64 build-platform | ||
|
||
platform-freebsd-x64: | ||
@$(MAKE) --no-print-directory GOOS=freebsd GOARCH=amd64 BUILDDIR=build/freebsd-x64 build-platform | ||
|
||
platform-freebsd-arm64: | ||
@$(MAKE) --no-print-directory GOOS=freebsd GOARCH=arm64 BUILDDIR=build/freebsd-arm64 build-platform | ||
|
||
platform-netbsd-x64: | ||
@$(MAKE) --no-print-directory GOOS=netbsd GOARCH=amd64 BUILDDIR=build/netbsd-x64 build-platform | ||
|
||
platform-openbsd-x64: | ||
@$(MAKE) --no-print-directory GOOS=openbsd GOARCH=amd64 BUILDDIR=build/openbsd-x64 build-platform | ||
|
||
platform-linux-x64: | ||
@$(MAKE) --no-print-directory GOOS=linux GOARCH=amd64 BUILDDIR=build/linux-x64 build-platform | ||
|
||
platform-linux-ia32: | ||
@$(MAKE) --no-print-directory GOOS=linux GOARCH=386 BUILDDIR=build/linux-ia32 build-platform | ||
|
||
platform-linux-arm: | ||
@$(MAKE) --no-print-directory GOOS=linux GOARCH=arm BUILDDIR=build/linux-arm build-platform | ||
|
||
platform-linux-arm64: | ||
@$(MAKE) --no-print-directory GOOS=linux GOARCH=arm64 BUILDDIR=build/linux-arm64 build-platform | ||
|
||
platform-linux-loong64: | ||
@$(MAKE) --no-print-directory GOOS=linux GOARCH=loong64 BUILDDIR=build/linux-loong64 build-platform | ||
|
||
platform-linux-mips64el: | ||
@$(MAKE) --no-print-directory GOOS=linux GOARCH=mips64le BUILDDIR=build/linux-mips64el build-platform | ||
|
||
platform-linux-ppc64: | ||
@$(MAKE) --no-print-directory GOOS=linux GOARCH=ppc64le BUILDDIR=build/linux-ppc64 build-platform | ||
|
||
platform-linux-riscv64: | ||
@$(MAKE) --no-print-directory GOOS=linux GOARCH=riscv64 BUILDDIR=build/linux-riscv64 build-platform | ||
|
||
platform-linux-s390x: | ||
@$(MAKE) --no-print-directory GOOS=linux GOARCH=s390x BUILDDIR=build/linux-s390x build-platform | ||
|
||
platform-sunos-x64: | ||
@$(MAKE) --no-print-directory GOOS=illumos GOARCH=amd64 BUILDDIR=build/sunos-x64 build-platform | ||
|
||
platform-wasm: | ||
@$(MAKE) --no-print-directory GOOS=js GOARCH=wasm BUILDDIR=build/esbuild-wasm build-platform | ||
|
||
clean: | ||
rm -rf build |
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,22 +1,13 @@ | ||
|
||
## POC to use esbuild with java and plugins | ||
## Scss enabled version of esbuild | ||
|
||
This is a poc to see if we can use esbuild in java, but more integrated. | ||
Maybe we can even use esbuild and extend it with Java based plugins. | ||
This project extends esbuild with a scss plugin. | ||
The normal cli still works, but it has a scss plugin added. | ||
|
||
### To build | ||
|
||
```cmd | ||
go build -o libhello.so -buildmode=c-shared hello.go | ||
chmod -x libhello.so | ||
mvn package | ||
export LD_LIBRARY_PATH=<full path to this folder> | ||
java -jar target/go-helloworld-1.0.0-SNAPSHOT-jar-with-dependencies.jar | ||
make platform-all | ||
``` | ||
|
||
### TODO | ||
* rename this project to not be called helloworld | ||
* make the go code call java | ||
* create an interface for the java and go communication | ||
This is used by esbuild-java for the quarkus web bundler |
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