-
Notifications
You must be signed in to change notification settings - Fork 86
/
Makefile
36 lines (30 loc) · 1.29 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
.PHONY: all fmt test 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
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 [email protected]: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