This repository has been archived by the owner on Mar 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathMakefile
51 lines (41 loc) · 1.94 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
setup:
go mod download
go install github.com/ahmetb/govvv
test:
./test_compile
format:
goimports -w -l `find . -type f -name '*.go' -not -path './vendor/*'`
lint:
echo 'Linting with prettier...'
npx prettier --check "./**" 2> /dev/null || true
echo 'Linting with golint...'
golint `go list ./... | grep -v /vendor/`
textile:
$(eval FLAGS := $$(shell govvv -flags | sed 's/main/github.com\/textileio\/go-textile\/common/g'))
go install -ldflags "-w $(FLAGS)" github.com/textileio/go-textile/cmd/textile
ios:
$(eval FLAGS := $$(shell govvv -flags | sed 's/main/github.com\/textileio\/go-textile\/common/g'))
env go111module=off gomobile bind -ldflags "-w $(FLAGS)" -v -target=ios github.com/textileio/go-textile/mobile github.com/textileio/go-textile/core
mkdir -p mobile/dist/ios/ && cp -r Mobile.framework mobile/dist/ios/
rm -rf Mobile.framework
android:
$(eval FLAGS := $$(shell govvv -flags | sed 's/main/github.com\/textileio\/go-textile\/common/g'))
env go111module=off gomobile bind -ldflags "-w $(FLAGS)" -v -target=android -o mobile.aar github.com/textileio/go-textile/mobile github.com/textileio/go-textile/core
mkdir -p mobile/dist/android/ && mv mobile.aar mobile/dist/android/
protos:
$(eval P_TIMESTAMP := Mgoogle/protobuf/timestamp.proto=github.com/golang/protobuf/ptypes/timestamp)
$(eval P_ANY := Mgoogle/protobuf/any.proto=github.com/golang/protobuf/ptypes/any)
$(eval PKGMAP := $$(P_TIMESTAMP),$$(P_ANY))
cd pb/protos; protoc --go_out=$(PKGMAP):.. *.proto
.PHONY: docs
docs:
go get github.com/swaggo/swag/cmd/swag
swag init -g api/api.go -o api/docs
npm i -g swagger-markdown
swagger-markdown -i api/docs/swagger.yaml -o api/docs/swagger.md
docker:
$(eval VERSION := $$(shell ggrep -oP 'const Version = "\K[^"]+' common/version.go))
docker build -t go-textile:$(VERSION) .
docker_cafe:
$(eval VERSION := $$(shell ggrep -oP 'const Version = "\K[^"]+' common/version.go))
docker build -t go-textile:$(VERSION)-cafe -f Dockerfile.cafe .