forked from Place1/protoc-gen-grpc-ts-web
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (32 loc) · 1.04 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
OUT=bin
BINARY=protoc-gen-grpc-ts-web
PLATFORMS=darwin linux windows
ARCHITECTURES=amd64
build:
echo "running build"
go build -o $(OUT)/$(BINARY) .
release: clean
echo "running release"
mkdir -p $(OUT)
$(foreach GOOS, $(PLATFORMS),\
$(foreach GOARCH, $(ARCHITECTURES), $(shell export GOOS=$(GOOS); export GOARCH=$(GOARCH); go build -o $(OUT)/$(BINARY)-$(GOOS)-$(GOARCH))))
rm -r npm/bin/ || true
cp -r $(OUT)/ npm/$(OUT)/
test: build
echo "running test"
protoc --plugin=$(OUT)/protoc-gen-grpc-ts-web --grpc-ts-web_out=./ ./example/example.proto
test-js:
rm -r out || true
mkdir -p out
protoc -I ./example --js_out=out --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:out ./example/example.proto
clean:
echo "running clean"
rm -r $(OUT) || true
rm -rf npm/$(OUT) || true
publish: release
echo "running publish"
cd npm && npm publish
dump:
# install with the below go get command
# go get -u sourcegraph.com/sourcegraph/prototools/cmd/protoc-gen-dump
protoc --dump_out=out=code-generator-request.bin:./ ./example/example.proto