forked from BitBoxSwiss/bitbox-wallet-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
101 lines (99 loc) · 3.34 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Copyright 2018 Shift Devices AG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
SHELL := /bin/bash
WEBROOT := frontends/web
GOPATH ?= $(HOME)/go
PATH := $(PATH):$(GOPATH)/bin
catch:
@echo "Choose a make target."
envinit:
# Keep golangci-lint version in sync with what's in .github/workflows/ci.yml.
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(GOPATH)/bin v1.51.1
go install github.com/vektra/mockery/v2@latest
go install github.com/matryer/moq@latest
go install golang.org/x/tools/cmd/goimports@latest
go install golang.org/x/mobile/cmd/gomobile@latest
# The gomobile/gobind libs are also needed when using `gomobile bind`, but it's not compatible with vendoring:
# https://github.com/golang/go/issues/50994#issuecomment-1032754206
GO111MODULE=off go get -u golang.org/x/mobile/cmd/gomobile
gomobile init
# Initializiation on MacOS
# - run make from $GOPATH/src/github.com/digitalbitbox/bitbox-wallet-app
# - additional dependencies: Qt 5.15 & Xcode command line tools
# - add to $PATH: /usr/local/opt/[email protected]/bin
osx-init:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install [email protected]
brew install qt@5
$(MAKE) envinit
servewallet:
go run -mod=vendor ./cmd/servewallet
servewallet-mainnet:
go run -mod=vendor ./cmd/servewallet -mainnet
servewallet-regtest:
rm -f appfolder.dev/cache/headers-rbtc.bin && rm -rf appfolder.dev/cache/account-*rbtc* && go run -mod=vendor ./cmd/servewallet -regtest
servewallet-prodservers:
go run -mod=vendor ./cmd/servewallet -devservers=false
servewallet-mainnet-prodservers:
go run -mod=vendor ./cmd/servewallet -mainnet -devservers=false
buildweb:
node --version
npm --version
rm -rf ${WEBROOT}/build
cd ${WEBROOT} && npm ci --ignore-scripts
cd ${WEBROOT} && npm run build
webdev:
cd ${WEBROOT} && $(MAKE) dev
weblint:
cd ${WEBROOT} && $(MAKE) lint
webfix:
cd ${WEBROOT} && $(MAKE) fix
webtest:
cd ${WEBROOT} && $(MAKE) jstest
webtestwatch:
cd ${WEBROOT} && $(MAKE) jstest-watch
qt-linux: # run inside dockerdev
$(MAKE) buildweb
cd frontends/qt && $(MAKE) linux
qt-osx: # run on OSX.
$(MAKE) buildweb
cd frontends/qt && $(MAKE) osx
$(MAKE) osx-sec-check
qt-windows:
$(MAKE) buildweb
cd frontends/qt && $(MAKE) windows
android:
$(MAKE) buildweb
cd frontends/android && ${MAKE} apk-debug
osx-sec-check:
@echo "Checking build output"
./scripts/osx-build-check.sh
ci:
./scripts/ci.sh
clean:
rm -rf ${WEBROOT}/build
cd frontends/qt && $(MAKE) clean
cd frontends/android && $(MAKE) clean
dockerinit:
./scripts/container.sh build --pull --force-rm -t shiftcrypto/bitbox-wallet-app .
dockerdev:
./scripts/dockerdev.sh
locize-push:
cd ${WEBROOT}/src/locales && locize sync
locize-pull:
cd ${WEBROOT}/src/locales && locize download
locize-fix:
locize format ${WEBROOT}/src/locales --format json
go-vendor:
go mod vendor