forked from ezbuy/tgen
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
70 lines (55 loc) · 2.19 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
all:
init:
rm -f .git/hooks/pre-push
rm -f .git/hooks/pre-commit
ln -s ../../githooks/pre-push .git/hooks/pre-push
ln -s ../../githooks/pre-commit .git/hooks/pre-commit
go get github.com/samuel/go-thrift/parser
go get github.com/spf13/cobra/cobra
go get github.com/jteeuwen/go-bindata/...
test: buildTpl
go test ./...
test-go-gen: buildTpl
rm -rf thriftgotest
go build
./tgen gen -l go -i example/golang/Enum.thrift -o ../../../
./tgen gen -l go -i example/golang/Const.thrift -o ../../../
./tgen gen -l go -i example/golang/IncludeEnum.thrift -o ../../../
./tgen gen -l go -i example/golang/Types.thrift -o ../../../
./tgen gen -l go -r --validate -i example/golang/Service.thrift -o ../../../
./tgen gen -l go -i example/golang/SimpleArguments.thrift -o ../../../
./tgen gen -l go -w=false -i example/golang/UnusedInclude.thrift -o ../../../
go install github.com/ezbuy/tgen/thriftgotest/...
test-go-ezrpc: test-go-gen
ezrpc gen -l go -i example/golang/Service.thrift -o ../../../
go install github.com/ezbuy/tgen/thriftgotest/...
buildTpl:
go-bindata -o tmpl/bindata.go -ignore bindata.go -ignore .DS_Store -pkg tmpl tmpl/*
debugTpl:
go-bindata -o tmpl/bindata.go -ignore bindata.go -ignore .DS_Store -pkg tmpl -debug tmpl/*
gen-java: gen-java-rest gen-java-jsonrpc
gen-java-jsonrpc: buildTpl
rm -rf output-java-jsonrpc
go run main.go gen -l java -m jsonrpc -i example/java/ShipForMe.thrift -o ./output-java-jsonrpc
gen-java-rest: buildTpl
rm -rf output-java-rest
go run main.go gen -l java -m rest -i example/java/ShipForMe.thrift -o ./output-java-rest
gen-swift-rest: buildTpl
rm -rf output-swift-rest
go run main.go gen -l swift -m rest -i example/swift/Example.thrift -o ./output-swift-rest
gen-swift-jsonrpc: buildTpl
rm -rf output-swift-jsonrpc
go run main.go gen -l swift -m jsonrpc -i example/swift/Example.thrift -o ./output-swift-jsonrpc
gen-swift: gen-swift-rest gen-swift-jsonrpc
genjavascriptrest: buildTpl
go build
./tgen gen -l javascript -m rest -i example/javascript/FlashSales.thrift -o ./javascriptoutputrest
clean:
go clean
rm -rf ./output-swift-rest
rm -rf ./output-swift-jsonrpc
rm -rf ./output-java-rest
rm -rf ./output-java-jsonrpc
build: buildTpl
go clean
go build