Skip to content

Commit

Permalink
Merge branch 'release/0.9.0' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
farazdagi committed Sep 21, 2016
2 parents 3675e09 + 376f8a6 commit 7cbf155
Show file tree
Hide file tree
Showing 1,354 changed files with 97,430 additions and 118,262 deletions.
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
.ethtest
*/**/*tx_database*
*/**/*dapps*
Godeps/_workspace/pkg
Godeps/_workspace/bin

#*
.#*
Expand All @@ -33,3 +31,11 @@ profile.cov

# vagrant
.vagrant

# tests
.ethereumtest/
#
# golang
coverage.out
coverage-all.out
coverage.html
42 changes: 36 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ GOBIN = build/bin
GO ?= latest

statusgo:
build/env.sh go build -i -o $(GOBIN)/statusgo ./src
build/env.sh go build -i -o $(GOBIN)/statusgo -v $(shell build/flags.sh) ./cmd/status
@echo "status go compilation done."
@echo "Run \"build/bin/statusgo\" to view available commands"

Expand All @@ -14,18 +14,48 @@ statusgo-cross: statusgo-android statusgo-ios
@ls -ld $(GOBIN)/statusgo-*

statusgo-android: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) -out statusgo --dest=$(GOBIN) --targets=android-16/aar -v $(shell build/flags.sh) ./src
build/env.sh $(GOBIN)/xgo --image farazdagi/xgo --go=$(GO) -out statusgo --dest=$(GOBIN) --targets=android-16/aar -v $(shell build/flags.sh) ./cmd/status
@echo "Android cross compilation done:"

statusgo-ios: xgo
build/env.sh $(GOBIN)/xgo --go=$(GO) -out statusgo --dest=$(GOBIN) --targets=ios-7.0/framework -v $(shell build/flags.sh) ./src
build/env.sh $(GOBIN)/xgo --image farazdagi/xgo --go=$(GO) -out statusgo --dest=$(GOBIN) --targets=ios-9.3/framework -v $(shell build/flags.sh) ./cmd/status
@echo "iOS framework cross compilation done:"

statusgo-ios-simulator: xgo
build/env.sh $(GOBIN)/xgo --image farazdagi/xgo-ios-simulator --go=$(GO) -out statusgo --dest=$(GOBIN) --targets=ios-9.3/framework -v $(shell build/flags.sh) ./cmd/status
@echo "iOS framework cross compilation done:"

xgo:
build/env.sh go get github.com/karalabe/xgo

test:
build/env.sh go test ./...
test-all:
@build/env.sh echo "mode: set" > coverage-all.out
build/env.sh go test -coverprofile=coverage.out -covermode=set ./geth
@build/env.sh tail -n +2 coverage.out >> coverage-all.out
build/env.sh go test -coverprofile=coverage.out -covermode=set ./jail
@build/env.sh tail -n +2 coverage.out >> coverage-all.out
build/env.sh go test -coverprofile=coverage.out -covermode=set ./extkeys
@build/env.sh tail -n +2 coverage.out >> coverage-all.out
@build/env.sh go tool cover -html=coverage-all.out -o coverage.html
@build/env.sh go tool cover -func=coverage-all.out

test: test-all

test-geth:
build/env.sh go test -v -coverprofile=coverage.out ./geth
@build/env.sh go tool cover -html=coverage.out -o coverage.html
@build/env.sh go tool cover -func=coverage.out

test-jail:
build/env.sh go test -v -coverprofile=coverage.out ./jail
@build/env.sh go tool cover -html=coverage.out -o coverage.html
@build/env.sh go tool cover -func=coverage.out

test-extkeys:
build/env.sh go test -v -coverprofile=coverage.out ./extkeys
@build/env.sh go tool cover -html=coverage.out -o coverage.html
@build/env.sh go tool cover -func=coverage.out

clean:
rm -fr $(GOBIN)/*
rm -fr build/bin/*
rm coverage.out coverage-all.out coverage.html
37 changes: 25 additions & 12 deletions build/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,39 @@ if [ ! -f "build/env.sh" ]; then
exit 2
fi

# Create fake Go workspace if it doesn't exist yet.
workspace="$PWD/build/_workspace"
root="$PWD"
ethdir="$workspace/src/github.com/status-im"
if [ ! -L "$ethdir/status-go" ]; then
mkdir -p "$ethdir"
cd "$ethdir"
ln -s ../../../../../. status-go
# Create workspace (if necessary) and dump all dependencies to it
ROOT=$PWD
WS1="$ROOT/build/_workspace/deps"
WS2="$ROOT/build/_workspace/project"

# expose all vendored packages
if [ ! -d "$WS1/src" ]; then
mkdir -p "$WS1"
cd "$WS1"
ln -s "$ROOT/vendor" src
cd "$ROOT"
fi

# expose project itself
PROJECTDIR="$WS2/src/github.com/status-im"
if [ ! -L "$PROJECTDIR/status-go" ]; then
mkdir -p "$PROJECTDIR"
cd "$PROJECTDIR"
ln -s "$ROOT" status-go
cd "$root"
fi

# Set up the environment to use the workspace.
# Also add Godeps workspace so we build using canned dependencies.
GOPATH="$ethdir/go-ethereum/Godeps/_workspace:$workspace"
GOPATH="$WS1:$WS2"
GOBIN="$PWD/build/bin"
export GOPATH GOBIN

# Run the command inside the workspace.
cd "$ethdir/status-go"
PWD="$ethdir/status-go"
cd "$PROJECTDIR/status-go"

# Linker options
export CGO_CFLAGS="-I/$JAVA_HOME/include -I/$JAVA_HOME/include/darwin"

# Launch the arguments with the configured environment.
exec "$@"

11 changes: 1 addition & 10 deletions build/flags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,7 @@ if [ ! -f "build/env.sh" ]; then
exit 2
fi

# Since Go 1.5, the separator char for link time assignments
# is '=' and using ' ' prints a warning. However, Go < 1.5 does
# not support using '='.
sep=$(go version | awk '{ if ($3 >= "go1.5" || index($3, "devel")) print "="; else print " "; }' -)

# set gitCommit when running from a Git checkout.
if [ -f ".git/HEAD" ]; then
echo "-ldflags '-X main.gitCommit$sep$(git rev-parse HEAD)'"
fi

if [ ! -z "$GO_OPENCL" ]; then
echo "-tags opencl"
echo "-ldflags '-X main.buildStamp=`date -u '+%Y-%m-%d.%H:%M:%S'` -X main.gitCommit=$(git rev-parse HEAD)'"
fi
Loading

0 comments on commit 7cbf155

Please sign in to comment.