-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
877018f
commit 55ca2a6
Showing
40 changed files
with
264 additions
and
258 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
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,12 +1 @@ | ||
.idea/* | ||
linux-compiler-musl-x86/* | ||
!.idea/codeStyles/ | ||
*.iml | ||
debug/ | ||
target/ | ||
|
||
Cargo.lock | ||
|
||
**/*.rs.bk | ||
|
||
*.pdb | ||
libs/* |
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,207 +1,12 @@ | ||
all: | ||
@set -e; | ||
|
||
setup: | ||
@rustup target add x86_64-unknown-linux-musl | ||
@rustup target add armv7-linux-androideabi | ||
@rustup target add i686-linux-android | ||
@rustup target add aarch64-linux-android | ||
@rustup target add x86_64-linux-android | ||
@rustup target add aarch64-apple-ios | ||
@rustup target add x86_64-apple-ios | ||
@rustup target add x86_64-apple-darwin | ||
@rustup target add x86_64-apple-darwin | ||
@rustup target add x86_64-pc-windows-gnu | ||
|
||
build-linux-amd64-musl: | ||
env TARGET_CC=x86_64-linux-musl-gcc cargo build --release --target x86_64-unknown-linux-musl | ||
|
||
install-linux-amd64-musl: build-linux-amd64-musl | ||
@mkdir -p go/libs/linux-amd64-musl | ||
@cp target/x86_64-unknown-linux-musl/release/libtantivy_go.a go/libs/linux-amd64-musl | ||
|
||
build-debug-linux-amd64-musl: | ||
env TARGET_CC=x86_64-linux-musl-gcc cargo build --target x86_64-unknown-linux-musl | ||
|
||
install-debug-linux-amd64-musl: build-debug-linux-amd64-musl | ||
@mkdir -p go/libs/linux-amd64-musl | ||
@cp target/x86_64-unknown-linux-musl/debug/libtantivy_go.a go/libs/linux-amd64-musl | ||
|
||
build-android-arm: | ||
env TARGET_CC=armv7a-linux-androideabi26-clang cargo build --release --target armv7-linux-androideabi | ||
|
||
install-android-arm: build-android-arm | ||
@mkdir -p go/libs/android-arm | ||
@cp target/armv7-linux-androideabi/release/libtantivy_go.a go/libs/android-arm | ||
|
||
build-debug-android-arm: | ||
env TARGET_CC=armv7a-linux-androideabi26-clang cargo build --target armv7-linux-androideabi | ||
|
||
install-debug-android-arm: build-debug-android-arm | ||
@mkdir -p go/libs/android-arm | ||
@cp target/armv7-linux-androideabi/debug/libtantivy_go.a go/libs/android-arm | ||
|
||
build-android-386: | ||
env TARGET_CC=i686-linux-android26-clang cargo build --release --target i686-linux-android | ||
|
||
install-android-386: build-android-386 | ||
@mkdir -p go/libs/android-386 | ||
@cp target/i686-linux-android/release/libtantivy_go.a go/libs/android-386 | ||
|
||
build-debug-android-386: | ||
env TARGET_CC=i686-linux-android26-clang cargo build --target i686-linux-android | ||
|
||
install-debug-android-386: build-debug-android-386 | ||
@mkdir -p go/libs/android-386 | ||
@cp target/i686-linux-android/debug/libtantivy_go.a go/libs/android-386 | ||
|
||
build-android-arm64: | ||
cargo build --release --target aarch64-linux-android | ||
|
||
install-android-arm64: build-android-arm64 | ||
@mkdir -p go/libs/android-arm64 | ||
@cp target/aarch64-linux-android/release/libtantivy_go.a go/libs/android-arm64 | ||
|
||
build-debug-android-arm64: | ||
cargo build --target aarch64-linux-android | ||
|
||
install-debug-android-arm64: build-debug-android-arm64 | ||
@mkdir -p go/libs/android-arm64 | ||
@cp target/aarch64-linux-android/debug/libtantivy_go.a go/libs/android-arm64 | ||
|
||
build-android-amd64: | ||
cargo build --release --target x86_64-linux-android | ||
|
||
install-android-amd64: build-android-amd64 | ||
@mkdir -p go/libs/android-amd64 | ||
@cp target/x86_64-linux-android/release/libtantivy_go.a go/libs/android-amd64 | ||
|
||
build-debug-android-amd64: | ||
cargo build --target x86_64-linux-android | ||
|
||
install-debug-android-amd64: build-debug-android-amd64 | ||
@mkdir -p go/libs/android-amd64 | ||
@cp target/x86_64-linux-android/debug/libtantivy_go.a go/libs/android-amd64 | ||
|
||
build-ios-arm64: | ||
cargo build --release --target aarch64-apple-ios | ||
|
||
install-ios-arm64: build-ios-arm64 | ||
@mkdir -p go/libs/ios-arm64 | ||
@cp target/aarch64-apple-ios/release/libtantivy_go.a go/libs/ios-arm64 | ||
|
||
build-debug-ios-arm64: | ||
cargo build --target aarch64-apple-ios | ||
|
||
install-debug-ios-arm64: build-debug-ios-arm64 | ||
@mkdir -p go/libs/ios-arm64 | ||
@cp target/aarch64-apple-ios/debug/libtantivy_go.a go/libs/ios-arm64 | ||
|
||
build-ios-amd64: | ||
cargo build --release --target x86_64-apple-ios | ||
|
||
install-ios-amd64: build-ios-amd64 | ||
@mkdir -p go/libs/ios-amd64 | ||
@cp target/x86_64-apple-ios/release/libtantivy_go.a go/libs/ios-amd64 | ||
|
||
build-debug-ios-amd64: | ||
cargo build --target x86_64-apple-ios | ||
|
||
install-debug-ios-amd64: build-debug-ios-amd64 | ||
@mkdir -p go/libs/ios-amd64 | ||
@cp target/x86_64-apple-ios/debug/libtantivy_go.a go/libs/ios-amd64 | ||
|
||
build-darwin-amd64: | ||
ENV MACOSX_DEPLOYMENT_TARGET=10.15 cargo build --release --target x86_64-apple-darwin | ||
|
||
install-darwin-amd64: build-darwin-amd64 | ||
@mkdir -p go/libs/darwin-amd64 | ||
@cp target/x86_64-apple-darwin/release/libtantivy_go.a go/libs/darwin-amd64 | ||
|
||
build-debug-darwin-amd64: | ||
ENV MACOSX_DEPLOYMENT_TARGET=10.15 cargo build --target x86_64-apple-darwin | ||
|
||
install-debug-darwin-amd64: build-debug-darwin-amd64 | ||
@mkdir -p go/libs/darwin-amd64 | ||
@cp target/x86_64-apple-darwin/debug/libtantivy_go.a go/libs/darwin-amd64 | ||
|
||
build-darwin-arm64: | ||
ENV MACOSX_DEPLOYMENT_TARGET=10.15 cargo build --release --target aarch64-apple-darwin | ||
|
||
install-darwin-arm64: build-darwin-arm64 | ||
@mkdir -p go/libs/darwin-arm64 | ||
@cp target/aarch64-apple-darwin/release/libtantivy_go.a go/libs/darwin-arm64 | ||
|
||
build-debug-darwin-arm64: | ||
ENV MACOSX_DEPLOYMENT_TARGET=10.15 cargo build --target aarch64-apple-darwin | ||
|
||
install-debug-darwin-arm64: build-debug-darwin-arm64 | ||
@mkdir -p go/libs/darwin-arm64 | ||
@cp target/aarch64-apple-darwin/debug/libtantivy_go.a go/libs/darwin-arm64 | ||
|
||
build-windows-amd64: | ||
cargo build --release --target x86_64-pc-windows-gnu | ||
|
||
install-windows-amd64: build-windows-amd64 | ||
@mkdir -p go/libs/windows-amd64 | ||
@cp target/x86_64-pc-windows-gnu/release/libtantivy_go.a go/libs/windows-amd64 | ||
|
||
build-debug-windows-amd64: | ||
cargo build --target x86_64-pc-windows-gnu | ||
|
||
install-debug-windows-amd64: build-debug-windows-amd64 | ||
@mkdir -p go/libs/windows-amd64 | ||
@cp target/x86_64-pc-windows-gnu/debug/libtantivy_go.a go/libs/windows-amd64 | ||
|
||
install-all: \ | ||
install-linux-amd64-musl \ | ||
install-android-arm \ | ||
install-android-386 \ | ||
install-android-arm64 \ | ||
install-android-amd64 \ | ||
install-ios-arm64 \ | ||
install-ios-amd64 \ | ||
install-darwin-amd64 \ | ||
install-darwin-arm64 \ | ||
install-windows-amd64 | ||
|
||
install-debug-all: \ | ||
install-debug-linux-amd64-musl \ | ||
install-debug-android-arm \ | ||
install-debug-android-386 \ | ||
install-debug-android-arm64 \ | ||
install-debug-android-amd64 \ | ||
install-debug-ios-arm64 \ | ||
install-debug-ios-amd64 \ | ||
install-debug-darwin-amd64 \ | ||
install-debug-darwin-arm64 \ | ||
install-debug-windows-amd64 | ||
|
||
### Download release | ||
REPO := anyproto/tantivy-go | ||
VERSION := go/v0.0.3 | ||
OUTPUT_DIR := go/libs | ||
|
||
TANTIVY_LIBS := android-386.tar.gz \ | ||
android-amd64.tar.gz \ | ||
android-arm.tar.gz \ | ||
android-arm64.tar.gz \ | ||
darwin-amd64.tar.gz \ | ||
darwin-arm64.tar.gz \ | ||
ios-amd64.tar.gz \ | ||
ios-arm64.tar.gz \ | ||
linux-amd64-musl.tar.gz \ | ||
windows-amd64.tar.gz | ||
|
||
define download_tantivy_lib | ||
curl -L -o $(OUTPUT_DIR)/$(1) https://github.com/$(REPO)/releases/download/$(VERSION)/$(1) | ||
endef | ||
|
||
download-tantivy-all: $(TANTIVY_LIBS) | ||
|
||
$(TANTIVY_LIBS): | ||
@mkdir -p $(OUTPUT_DIR)/$(shell echo $@ | cut -d'.' -f1) | ||
$(call download_tantivy_lib,$@) | ||
@tar -C $(OUTPUT_DIR)/$(shell echo $@ | cut -d'.' -f1) -xvzf $(OUTPUT_DIR)/$@ | ||
@rm -f $(OUTPUT_DIR)/$@ | ||
@echo "Extracted $@" | ||
build-verify: | ||
CGO_LDFLAGS='-static' GOOS="windows" GOARCH="amd64" CGO_ENABLED="1" CC="x86_64-w64-mingw32-gcc" go build -v main.go | ||
CGO_LDFLAGS='-static' GOOS="linux" GOARCH="amd64" CGO_ENABLED="1" CC="x86_64-linux-musl-gcc" go build -v main.go | ||
CGO_ENABLED="1" gomobile bind -v -target=android -androidapi 26 -o lib.aar github.com/anyproto/tantivy-go/tantivy/gomobile | ||
CGO_ENABLED="1" gomobile bind -v -target=ios -o Lib.xcframework github.com/anyproto/tantivy-go/tantivy/gomobile | ||
|
||
test: | ||
@echo 'Running tests...' | ||
go test ./... |
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
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
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,4 +1,4 @@ | ||
module github.com/anyproto/tantivy-go/go | ||
module github.com/anyproto/tantivy-go | ||
|
||
go 1.22 | ||
|
||
|
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,12 @@ | ||
.idea/* | ||
linux-compiler-musl-x86/* | ||
!.idea/codeStyles/ | ||
*.iml | ||
debug/ | ||
target/ | ||
|
||
Cargo.lock | ||
|
||
**/*.rs.bk | ||
|
||
*.pdb |
File renamed without changes.
Oops, something went wrong.