Skip to content

Commit

Permalink
chore: configure ldflags on gomobile bind to inject build context
Browse files Browse the repository at this point in the history
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
  • Loading branch information
moul committed Jun 19, 2020
1 parent 1b58fa1 commit 95d82f6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions js/packages/go-bridge/Makefile
Expand Up @@ -19,6 +19,11 @@ GO_VENDOR := $(GOPATH)/src/berty.tech/berty/vendor
GOMOBILE := $(GOPATH)/bin/gomobile
GOBIND := $(GOPATH)/bin/gobind

VERSION ?= `git describe --tags --always`
VCS_REF ?= `git rev-parse --short HEAD`
BUILD_DATE ?= `date +%s`
EXT_LDFLAGS = -ldflags="-X berty.tech/berty/go/pkg/bertymessenger.VcsRef=$(VCS_REF) -X berty.tech/berty/go/pkg/bertymessenger.Version=$(VERSION) -X berty.tech/berty/go/pkg/bertymessenger.BuildTime=$(BUILD_DATE)"

deps.gobridge: $(GOMOBILE) $(GO_VENDOR)
cd $(PWD) && gomobile init

Expand All @@ -42,12 +47,12 @@ build.gobridge.android: $(AAR_TARGETS)

build.framework:
@mkdir -p "$(FRAMEWORK_DIR)"
GO111MODULE=off gomobile bind -o $(FRAMEWORK) -v -target ios berty.tech/berty/go/framework/bertybridge
GO111MODULE=off gomobile bind -o $(FRAMEWORK) -v $(EXT_LDFLAGS) -target ios berty.tech/berty/go/framework/bertybridge
touch "$(FRAMEWORK_DIR)"

build.aar:
@mkdir -p "$(AAR_DIR)"
GO111MODULE=off gomobile bind -o $(AAR) -v -target android berty.tech/berty/go/framework/bertybridge
GO111MODULE=off gomobile bind -o $(AAR) -v $(EXT_LDFLAGS) -target android berty.tech/berty/go/framework/bertybridge
touch "$(AAR_DIR)"


Expand Down

0 comments on commit 95d82f6

Please sign in to comment.