-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (47 loc) · 1.23 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
GOPATH = $(shell go env GOPATH)
setup-ide:
pre-commit install
go install golang.org/x/tools/cmd/goimports@latest
go mod tidy
cd test; go mod tidy
cd cli; go mod tidy
# Test SDK
test:
cd test; go test -v .
test-codecov:
cd test; go test -v -race -coverprofile=coverage.out -covermode=atomic .
# GO SDK
sdk: *.go
go build .
# CLI App
$(GOPATH)/bin/sqlc: *.go cli/sqlc.go
cd cli; go build -o $(GOPATH)/bin/sqlc
cli: $(GOPATH)/bin/sqlc
github:
open https://github.com/sqlitecloud/sqlitecloud-go
diff:
git difftool
# gosec
gosec:
ifeq ($(wildcard $(GOPATH)/bin/gosec),)
curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin
endif
checksec: gosec *.go cli/*.go
$(GOPATH)/bin/gosec -exclude=G304 .
cd cli; $(GOPATH)/bin/gosec -exclude=G304,G302 .
# Documentation
godoc:
ifeq ($(wildcard $(GOPATH)/bin/godoc),)
go install golang.org/x/tools/cmd/godoc
endif
doc: godoc
ifeq ($(wildcard ./src),)
ln -s . src
endif
@echo "Hit CRTL-C to stop the documentation server..."
@( sleep 1 && open http://localhost:6060/pkg/github.com/sqlitecloud/sqlitecloud-go/ ) &
@$(GOPATH)/bin/godoc -http=:6060 -index -play
clean:
rm -rf $(GOPATH)/bin/sqlc*
all: sdk cli test
.PHONY: test sdk