add Make target for lib.go, def vars for experiments
This commit is contained in:
parent
50c853afb6
commit
e5e4084fae
13
.drone.yml
13
.drone.yml
|
@ -28,7 +28,6 @@ steps:
|
||||||
commands:
|
commands:
|
||||||
- make clean
|
- make clean
|
||||||
# Compile Server Experiments
|
# Compile Server Experiments
|
||||||
- go run generate/generate_bindings.go --experiments "serverExperiment"
|
|
||||||
- make linux
|
- make linux
|
||||||
|
|
||||||
- name: build-android
|
- name: build-android
|
||||||
|
@ -38,7 +37,8 @@ steps:
|
||||||
path: /go
|
path: /go
|
||||||
commands:
|
commands:
|
||||||
# Build Android without Server Experiment
|
# Build Android without Server Experiment
|
||||||
- go run generate/generate_bindings.go
|
- make clean-autobindings
|
||||||
|
- env EXPERIMENTS="" make lib.go
|
||||||
- go mod download
|
- go mod download
|
||||||
- gomobile init
|
- gomobile init
|
||||||
- make android
|
- make android
|
||||||
|
@ -51,7 +51,7 @@ steps:
|
||||||
- name: deps
|
- name: deps
|
||||||
path: /go
|
path: /go
|
||||||
commands:
|
commands:
|
||||||
- go run generate/generate_bindings.go --experiments "serverExperiment"
|
- make clean-autobindings
|
||||||
- make windows
|
- make windows
|
||||||
|
|
||||||
- name: deploy-buildfiles
|
- name: deploy-buildfiles
|
||||||
|
@ -123,7 +123,7 @@ steps:
|
||||||
- name: build-macos-x64
|
- name: build-macos-x64
|
||||||
commands:
|
commands:
|
||||||
- export PATH=$PATH:/usr/local/go/bin/
|
- export PATH=$PATH:/usr/local/go/bin/
|
||||||
- go run generate/generate_bindings.go --experiments "serverExperiment"
|
- env EXPERIMENTS="serverExperiment" lib.go
|
||||||
- make libCwtch.x64.dylib
|
- make libCwtch.x64.dylib
|
||||||
- name: build-macos-arm64
|
- name: build-macos-arm64
|
||||||
when:
|
when:
|
||||||
|
@ -132,7 +132,8 @@ steps:
|
||||||
status: [ success ]
|
status: [ success ]
|
||||||
commands:
|
commands:
|
||||||
- export PATH=$PATH:/usr/local/go/bin/
|
- export PATH=$PATH:/usr/local/go/bin/
|
||||||
- go run generate/generate_bindings.go --experiments "serverExperiment"
|
- make clean-autobindings
|
||||||
|
- env EXPERIMENTS="serverExperiment" make lib.go
|
||||||
- go mod download
|
- go mod download
|
||||||
- make libCwtch.arm64.dylib
|
- make libCwtch.arm64.dylib
|
||||||
- name: deploy-buildfiles
|
- name: deploy-buildfiles
|
||||||
|
@ -161,4 +162,4 @@ trigger:
|
||||||
branch: main
|
branch: main
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
- pull_request
|
- pull_request
|
||||||
|
|
16
Makefile
16
Makefile
|
@ -2,18 +2,29 @@ IOS_OUT := ./ios
|
||||||
|
|
||||||
.PHONY: all linux android windows macos clean ios
|
.PHONY: all linux android windows macos clean ios
|
||||||
|
|
||||||
|
|
||||||
DEFAULT_GOAL: linux
|
DEFAULT_GOAL: linux
|
||||||
|
|
||||||
all: linux android windows
|
all: linux android windows
|
||||||
|
|
||||||
|
linux: EXPERIMENTS ?= serverExperiment
|
||||||
linux: libCwtch.so
|
linux: libCwtch.so
|
||||||
|
|
||||||
|
macos: EXPERIMENTS ?= serverExperiment
|
||||||
macos: libCwtch.x64.dylib libCwtch.arm64.dylib
|
macos: libCwtch.x64.dylib libCwtch.arm64.dylib
|
||||||
|
|
||||||
|
android: EXPERIMENTS ?=
|
||||||
android: cwtch.aar
|
android: cwtch.aar
|
||||||
|
|
||||||
|
windows: EXPERIMENTS ?= serverExperiment
|
||||||
windows: libCwtch.dll
|
windows: libCwtch.dll
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
lib.go: generate/generate_bindings.go spec
|
||||||
|
go run generate/generate_bindings.go --experiments "$(EXPERIMENTS)"
|
||||||
|
|
||||||
|
|
||||||
libCwtch.so: lib.go
|
libCwtch.so: lib.go
|
||||||
./switch-ffi.sh
|
./switch-ffi.sh
|
||||||
go build -trimpath -ldflags "-buildid=autobindings-$(shell git describe --tags) -X main.buildVer=autobindings-$(shell git describe --tags) -X main.buildDate=$(shell git log -1 --format=%cd --date=format:%G-%m-%d-%H-%M)" -buildmode c-shared -o libCwtch.so
|
go build -trimpath -ldflags "-buildid=autobindings-$(shell git describe --tags) -X main.buildVer=autobindings-$(shell git describe --tags) -X main.buildDate=$(shell git log -1 --format=%cd --date=format:%G-%m-%d-%H-%M)" -buildmode c-shared -o libCwtch.so
|
||||||
|
@ -51,8 +62,11 @@ libCwtch.dll: lib.go
|
||||||
mv libCwtch.dll build/windows/
|
mv libCwtch.dll build/windows/
|
||||||
mv libCwtch.h build/windows/
|
mv libCwtch.h build/windows/
|
||||||
|
|
||||||
|
clean-autobindings:
|
||||||
|
rm -f lib.go
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -fr cwtch.aar cwtch_go.apk libCwtch.h libCwtch.so cwtch-sources.jar libCwtch.dll libCwtch.*.dylib build
|
rm -fr lib.go cwtch.aar cwtch_go.apk libCwtch.h libCwtch.so cwtch-sources.jar libCwtch.dll libCwtch.*.dylib build
|
||||||
|
|
||||||
# iOS - for testing purposes only for now, not officially supported
|
# iOS - for testing purposes only for now, not officially supported
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,12 @@ Note for the Flutter-based Cwtch UI Application see: https://git.openprivacy.ca/
|
||||||
|
|
||||||
**NOTE:** Autobindings currently depends on an unreleased version of Cwtch (`cwtch.im/cwtch v0.18.10-0.20230221235514-49e0d849fa3e`).
|
**NOTE:** Autobindings currently depends on an unreleased version of Cwtch (`cwtch.im/cwtch v0.18.10-0.20230221235514-49e0d849fa3e`).
|
||||||
|
|
||||||
|
### Experiments
|
||||||
|
|
||||||
|
Autobindings allow for comile time selection of experiments. Default selections for each target platform are supplied in Makefile but can be overridden with:
|
||||||
|
|
||||||
|
env EXPERIMENTS="serverExperiment otherExperiment" make android
|
||||||
|
|
||||||
## Spec File Format
|
## Spec File Format
|
||||||
|
|
||||||
The current Cwtch Bindings Specification is defined in [spec](./spec)
|
The current Cwtch Bindings Specification is defined in [spec](./spec)
|
||||||
|
|
Loading…
Reference in New Issue