-
Notifications
You must be signed in to change notification settings - Fork 158
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (34 loc) · 1.48 KB
/
Makefile
File metadata and controls
39 lines (34 loc) · 1.48 KB
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
.PHONY: all fmt test test-ci gen run
all: gen fmt test
fmt:
gofmt -s -l -w $$(go list -f {{.Dir}} ./... | grep -v /vendor/)
test:
which go
go test $$(go list ./... | grep -v /vendor/) -race -coverprofile cover.out
# test-ci runs tests without coverage to avoid needing the covdata tool in CI (e.g. GitHub Actions).
test-ci:
which go
TEST_CI=1 go test -v $$(go list ./... | grep -v /vendor/) -race
gen:
go generate
collect_i18n:
goi18n extract -outdir pkg/api/i18n/translations -packagepath "github.com/tonkeeper/opentonapi/pkg/api/i18n" -messagetype M
#go run github.com/nicksnyder/go-i18n/v2/goi18n extract -outdir pkg/api/i18n/translations todo: switch to this version after https://github.com/nicksnyder/go-i18n/pull/295
translate:
goi18n merge -outdir pkg/api/i18n/translations/ pkg/api/i18n/translations/active.en.toml pkg/api/i18n/translations/active.ru.toml
install_i18n:
git clone https://github.com/mr-tron/go-i18n/
cd go-i18n/v2 && go build -o $$GOPATH/bin/goi18n github.com/nicksnyder/go-i18n/v2/goi18n ; cd ../.. ; rm -rf go-i18n
run:
go run cmd/api/main.go
TMPDIR := $(shell mktemp -d)
update-sdk:
git clone git@github.com:tonkeeper/tonapi-go.git $(TMPDIR) \
&& cp -v api/openapi.yml $(TMPDIR)/api/openapi.yml \
&& cd $(TMPDIR) \
&& git checkout -b update \
&& go generate \
&& git add . \
&& git commit -m "update sdk" \
&& git push -u origin update -f \
&& gh pr create --title "Update TonAPI SDK" --body "This PR was created automatically" --head update --base main