-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (47 loc) · 1.76 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
-include .env
_:
mkdir web/dist -p && touch web/dist/index.html
generate:
go generate ./...
run:
go run ./cmd/radiomux
preview: generate run
gen: gen-proto gen-openapi gen-webrpc
tooling: tooling-air tooling-goreleaser tooling-protoc-gen-go tooling-oapi-codegen tooling-webrpc tooling-java tooling-taskfile
build:
task build
# Docker
docker-build-demo:
docker build . -f docker/radiomux-demo.Dockerfile -t itsnotgoodname/radiomux-demo
# Development
dev:
air
dev-demo:
air -build.cmd="go build -o ./tmp/main ./cmd/radiomux-demo"
dev-web:
cd web && pnpm install && pnpm run dev
# Generation
gen-proto:
protoc --java_out=lite:android/app/src/main/java shared/message.proto
protoc --go_out=. shared/message.proto
gen-openapi:
oapi-codegen -config shared/server.cfg.yaml shared/openapi.yaml
cd web && pnpm run generate-openapi
gen-webrpc:
webrpc-gen -schema=./shared/api.ridl -target=golang -pkg=webrpc -server -out=./internal/webrpc/webrpc.gen.go
webrpc-gen -schema=./shared/api.ridl -target=typescript -client -out=./web/src/api/client.gen.ts
# Convert interface to type unless it is a Service
awk '/interface/ && !/Service / { gsub(/interface/, "type"); gsub(/{/, "= {");} 1' ./web/src/api/client.gen.ts > tmp-3842984 && mv tmp-3842984 ./web/src/api/client.gen.ts
# Tooling
tooling-air:
go install github.com/cosmtrek/air@latest
tooling-protoc-gen-go:
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
tooling-oapi-codegen:
go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@latest
tooling-webrpc:
go install -ldflags="-s -w -X github.com/webrpc/webrpc.VERSION=v0.13.1" github.com/webrpc/webrpc/cmd/webrpc-gen@v0.13.1
tooling-java:
$(info Please install Java 17.)
tooling-task:
go install github.com/go-task/task/v3/cmd/task@latest