xgo: Use statusteam/xgo Docker image, based on Go 1.9.2 instead of 1.8.3 (#520)

This commit is contained in:
Pedro Pombeiro 2018-01-04 10:47:10 +01:00 committed by Adam Babik
parent 5c8b7758d5
commit a79b1f6f7b
3 changed files with 18 additions and 10 deletions

View File

@ -14,6 +14,9 @@ endif
CGO_CFLAGS=-I/$(JAVA_HOME)/include -I/$(JAVA_HOME)/include/darwin CGO_CFLAGS=-I/$(JAVA_HOME)/include -I/$(JAVA_HOME)/include/darwin
GOBIN = build/bin GOBIN = build/bin
GO ?= latest GO ?= latest
XGOVERSION ?= 1.9.2
XGOIMAGE = statusteam/xgo:$(XGOVERSION)
XGOIMAGEIOSSIM = statusteam/xgo-ios-simulator:$(XGOVERSION)
DOCKER_IMAGE_NAME ?= status-go DOCKER_IMAGE_NAME ?= status-go
@ -52,16 +55,16 @@ statusgo-cross: statusgo-android statusgo-ios
@ls -ld $(GOBIN)/statusgo-* @ls -ld $(GOBIN)/statusgo-*
statusgo-android: xgo ##@cross-compile Build status-go for Android statusgo-android: xgo ##@cross-compile Build status-go for Android
$(GOPATH)/bin/xgo --image farazdagi/xgo --go=$(GO) -out statusgo --dest=$(GOBIN) --targets=android-16/aar -v $(shell build/testnet-flags.sh) ./lib $(GOPATH)/bin/xgo --image $(XGOIMAGE) --go=$(GO) -out statusgo --dest=$(GOBIN) --targets=android-16/aar -v $(shell build/testnet-flags.sh) ./lib
@echo "Android cross compilation done." @echo "Android cross compilation done."
statusgo-ios: xgo ##@cross-compile Build status-go for iOS statusgo-ios: xgo ##@cross-compile Build status-go for iOS
$(GOPATH)/bin/xgo --image farazdagi/xgo --go=$(GO) -out statusgo --dest=$(GOBIN) --targets=ios-9.3/framework -v $(shell build/testnet-flags.sh) ./lib $(GOPATH)/bin/xgo --image $(XGOIMAGE) --go=$(GO) -out statusgo --dest=$(GOBIN) --targets=ios-9.3/framework -v $(shell build/testnet-flags.sh) ./lib
@echo "iOS framework cross compilation done." @echo "iOS framework cross compilation done."
statusgo-ios-simulator: xgo ##@cross-compile Build status-go for iOS Simulator statusgo-ios-simulator: xgo ##@cross-compile Build status-go for iOS Simulator
@docker pull farazdagi/xgo-ios-simulator @docker pull $(XGOIMAGEIOSSIM)
$(GOPATH)/bin/xgo --image farazdagi/xgo-ios-simulator --go=$(GO) -out statusgo --dest=$(GOBIN) --targets=ios-9.3/framework -v $(shell build/testnet-flags.sh) ./lib $(GOPATH)/bin/xgo --image $(XGOIMAGEIOSSIM) --go=$(GO) -out statusgo --dest=$(GOBIN) --targets=ios-9.3/framework -v $(shell build/testnet-flags.sh) ./lib
@echo "iOS framework cross compilation done." @echo "iOS framework cross compilation done."
statusgo-library: ##@cross-compile Build status-go as static library for current platform statusgo-library: ##@cross-compile Build status-go as static library for current platform
@ -74,8 +77,13 @@ docker-image: ##@docker Build docker image (use DOCKER_IMAGE_NAME to set the ima
@echo "Building docker image..." @echo "Building docker image..."
docker build . -t $(DOCKER_IMAGE_NAME) docker build . -t $(DOCKER_IMAGE_NAME)
xgo-docker-images: ##@docker Build xgo docker images
@echo "Building xgo docker images..."
docker build xgo/base -t $(XGOIMAGE)
docker build xgo/ios-simulator -t $(XGOIMAGEIOSSIM)
xgo: xgo:
docker pull farazdagi/xgo docker pull $(XGOIMAGE)
go get github.com/karalabe/xgo go get github.com/karalabe/xgo
statusgo-mainnet: statusgo-mainnet:
@ -84,15 +92,15 @@ statusgo-mainnet:
@echo "Run \"build/bin/statusgo\" to view available commands" @echo "Run \"build/bin/statusgo\" to view available commands"
statusgo-android-mainnet: xgo statusgo-android-mainnet: xgo
$(GOPATH)/bin/xgo --image farazdagi/xgo --go=$(GO) -out statusgo --dest=$(GOBIN) --targets=android-16/aar -v $(shell build/mainnet-flags.sh) ./lib $(GOPATH)/bin/xgo --image $(XGOIMAGE) --go=$(GO) -out statusgo --dest=$(GOBIN) --targets=android-16/aar -v $(shell build/mainnet-flags.sh) ./lib
@echo "Android cross compilation done (mainnet)." @echo "Android cross compilation done (mainnet)."
statusgo-ios-mainnet: xgo statusgo-ios-mainnet: xgo
$(GOPATH)/bin/xgo --image farazdagi/xgo --go=$(GO) -out statusgo --dest=$(GOBIN) --targets=ios-9.3/framework -v $(shell build/mainnet-flags.sh) ./lib $(GOPATH)/bin/xgo --image $(XGOIMAGE) --go=$(GO) -out statusgo --dest=$(GOBIN) --targets=ios-9.3/framework -v $(shell build/mainnet-flags.sh) ./lib
@echo "iOS framework cross compilation done (mainnet)." @echo "iOS framework cross compilation done (mainnet)."
statusgo-ios-simulator-mainnet: xgo statusgo-ios-simulator-mainnet: xgo
$(GOPATH)/bin/xgo --image farazdagi/xgo-ios-simulator --go=$(GO) -out statusgo --dest=$(GOBIN) --targets=ios-9.3/framework -v $(shell build/mainnet-flags.sh) ./lib $(GOPATH)/bin/xgo --image $(XGOIMAGEIOSSIM) --go=$(GO) -out statusgo --dest=$(GOBIN) --targets=ios-9.3/framework -v $(shell build/mainnet-flags.sh) ./lib
@echo "iOS framework cross compilation done (mainnet)." @echo "iOS framework cross compilation done (mainnet)."
generate: ##@other Regenerate assets and other auto-generated stuff generate: ##@other Regenerate assets and other auto-generated stuff

View File

@ -1,4 +1,4 @@
FROM karalabe/xgo-1.7.1 FROM karalabe/xgo-1.9.2
# Inject the container entry point, the build script (patched for Status bindings conditional builds of C code) # Inject the container entry point, the build script (patched for Status bindings conditional builds of C code)
ADD build.sh /build.sh ADD build.sh /build.sh

View File

@ -1,4 +1,4 @@
FROM farazdagi/xgo FROM statusteam/xgo:1.9.2
RUN \ RUN \
IOS_SDK_PATH=https://s3.amazonaws.com/farazdagi/status-im/iPhoneSimulator9.3.sdk.tar.gz && \ IOS_SDK_PATH=https://s3.amazonaws.com/farazdagi/status-im/iPhoneSimulator9.3.sdk.tar.gz && \