Skip to content

Commit

Permalink
fix: tmp fix for gomobile build
Browse files Browse the repository at this point in the history
  • Loading branch information
aeddi committed Dec 1, 2019
1 parent ce3415d commit e3af32d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
21 changes: 11 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
MAKEFILE_DIR = $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
GO_SRC = $(shell find . -not \( -path ./vendor -prune \) -not \( -path ./example -prune \) -not \( -path ./build -prune \) -name \*.go)
GO_DIR = $(MAKEFILE_DIR)/go
GO_SRC = $(shell find $(GO_DIR) -not \( -path $(GO_DIR)/vendor -prune \) -name \*.go)

GOMOBILE = $(GOPATH)/bin/gomobile
GOMOBILE_OPT ?=

VENDOR = $(MAKEFILE_DIR)/vendor
MOD_FILES = $(MAKEFILE_DIR)/go.mod $(MAKEFILE_DIR)/go.mod
VENDOR = $(GO_DIR)/vendor
MOD_FILES = $(GO_DIR)/go.mod $(GO_DIR)/go.mod

BUILD_DIR_IOS = $(MAKEFILE_DIR)/build/ios
BUILD_DIR_IOS = $(GO_DIR)/build/ios
BUILD_LIB_IOS = $(BUILD_DIR_IOS)/Mobile.framework
BUILD_DIR_ANDROID = $(MAKEFILE_DIR)/build/android
BUILD_DIR_ANDROID = $(GO_DIR)/build/android
BUILD_LIB_ANDROID = $(BUILD_DIR_ANDROID)/ipfs.aar

.PHONY: help build build.android build.ios test deps clean clean.android clean.ios re re.ios re.android
Expand All @@ -23,21 +24,21 @@ build: build.android build.ios
build.android: $(BUILD_LIB_ANDROID)

$(BUILD_LIB_ANDROID): $(BUILD_DIR_ANDROID) $(GO_SRC) $(VENDOR) | $(GOMOBILE)
GO111MODULE=off $(GOMOBILE) bind -v $(GOMOBILE_OPT) -target=android -o $(BUILD_LIB_ANDROID) github.com/berty/gomobile-ipfs
GO111MODULE=off $(GOMOBILE) bind -v $(GOMOBILE_OPT) -target=android -o $(BUILD_LIB_ANDROID) github.com/berty/gomobile-ipfs/go

$(BUILD_DIR_ANDROID):
mkdir -p $(BUILD_DIR_ANDROID)

build.ios: $(BUILD_LIB_IOS)

$(BUILD_LIB_IOS): $(BUILD_DIR_IOS) $(GO_SRC) $(VENDOR) | $(GOMOBILE)
GO111MODULE=off $(GOMOBILE) bind -v $(GOMOBILE_OPT) -target=ios -o $(BUILD_LIB_IOS) github.com/berty/gomobile-ipfs
GO111MODULE=off $(GOMOBILE) bind -v $(GOMOBILE_OPT) -target=ios -o $(BUILD_LIB_IOS) github.com/berty/gomobile-ipfs/go

$(BUILD_DIR_IOS):
mkdir -p $(BUILD_DIR_IOS)

test: $(VENDOR)
go test -v $(MAKEFILE_DIR)/...
go test -v $(GO_DIR)/...

deps: $(VENDOR)

Expand All @@ -47,9 +48,9 @@ $(GOMOBILE):

$(VENDOR): $(MOD_FILES)
ifneq ($(wildcard /bin/bash),)
@bash -c 'echo "GO111MODULE=on go mod vendor" && GO111MODULE=on go mod vendor 2> >(grep -v "warning: ignoring symlink" 1>&2)'
@bash -c 'echo "GO111MODULE=on go mod vendor" && cd $(GO_DIR) && GO111MODULE=on go mod vendor 2> >(grep -v "warning: ignoring symlink" 1>&2)'
else
GO111MODULE=on go mod vendor
cd $(GO_DIR) && GO111MODULE=on go mod vendor
endif

clean: clean.android clean.ios
Expand Down
2 changes: 1 addition & 1 deletion go/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/berty/gomobile-ipfs
module github.com/berty/gomobile-ipfs/go

go 1.12

Expand Down
4 changes: 2 additions & 2 deletions go/mobile.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"os/signal"
"syscall"

host "github.com/berty/gomobile-ipfs/host"
node "github.com/berty/gomobile-ipfs/node"
host "github.com/berty/gomobile-ipfs/go/host"
node "github.com/berty/gomobile-ipfs/go/node"

ipfs_bs "github.com/ipfs/go-ipfs/core/bootstrap"
// ipfs_log "github.com/ipfs/go-log"
Expand Down
2 changes: 1 addition & 1 deletion go/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"sync"

host "github.com/berty/gomobile-ipfs/host"
host "github.com/berty/gomobile-ipfs/go/host"

ipfs_config "github.com/ipfs/go-ipfs-config"
ipfs_oldcmds "github.com/ipfs/go-ipfs/commands"
Expand Down

0 comments on commit e3af32d

Please sign in to comment.