forked from cadence-workflow/cadence-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
162 lines (129 loc) · 3.84 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
.PHONY: test bins clean
PROJECT_ROOT = github.com/uber-common/cadence-samples
export PATH := $(GOPATH)/bin:$(PATH)
# default target
default: test
PROGS = helloworld \
branch \
childworkflow \
choice \
dynamic \
greetings \
pickfirst \
retryactivity \
splitmerge \
timer \
localactivity \
query \
cron \
dsl \
fileprocessing \
dummy \
expense \
recovery \
cancelactivity \
ctxpropagation \
pso \
TEST_ARG ?= -race -v -timeout 5m
BUILD := ./build
SAMPLES_DIR=./cmd/samples
export PATH := $(GOPATH)/bin:$(PATH)
# Automatically gather all srcs
ALL_SRC := $(shell find ./cmd/samples/common -name "*.go")
# all directories with *_test.go files in them
TEST_DIRS=./cmd/samples/cron \
./cmd/samples/dsl \
./cmd/samples/expense \
./cmd/samples/fileprocessing \
./cmd/samples/recipes/branch \
./cmd/samples/recipes/choice \
./cmd/samples/recipes/greetings \
./cmd/samples/recipes/helloworld \
./cmd/samples/recipes/cancelactivity \
./cmd/samples/recipes/pickfirst \
./cmd/samples/recipes/retryactivity \
./cmd/samples/recipes/splitmerge \
./cmd/samples/recipes/timer \
./cmd/samples/recipes/localactivity \
./cmd/samples/recipes/query \
./cmd/samples/recipes/ctxpropagation \
./cmd/samples/recipes/searchattributes \
./cmd/samples/recovery \
./cmd/samples/pso \
dep-ensured:
dep ensure
cancelactivity: dep-ensured $(ALL_SRC)
go build -i -o bin/cancelactivity cmd/samples/recipes/cancelactivity/*.go
helloworld: dep-ensured $(ALL_SRC)
go build -i -o bin/helloworld cmd/samples/recipes/helloworld/*.go
branch: dep-ensured $(ALL_SRC)
go build -i -o bin/branch cmd/samples/recipes/branch/*.go
childworkflow: dep-ensured $(ALL_SRC)
go build -i -o bin/childworkflow cmd/samples/recipes/childworkflow/*.go
choice: dep-ensured $(ALL_SRC)
go build -i -o bin/choice cmd/samples/recipes/choice/*.go
dynamic: dep-ensured $(ALL_SRC)
go build -i -o bin/dynamic cmd/samples/recipes/dynamic/*.go
greetings: dep-ensured $(ALL_SRC)
go build -i -o bin/greetings cmd/samples/recipes/greetings/*.go
pickfirst: dep-ensured $(ALL_SRC)
go build -i -o bin/pickfirst cmd/samples/recipes/pickfirst/*.go
retryactivity: dep-ensured $(ALL_SRC)
go build -i -o bin/retryactivity cmd/samples/recipes/retryactivity/*.go
splitmerge: dep-ensured $(ALL_SRC)
go build -i -o bin/splitmerge cmd/samples/recipes/splitmerge/*.go
searchattributes: dep-ensured $(ALL_SRC)
go build -i -o bin/searchattributes cmd/samples/recipes/searchattributes/*.go
timer: dep-ensured $(ALL_SRC)
go build -i -o bin/timer cmd/samples/recipes/timer/*.go
localactivity: dep-ensured $(ALL_SRC)
go build -i -o bin/localactivity cmd/samples/recipes/localactivity/*.go
query: dep-ensured $(ALL_SRC)
go build -i -o bin/query cmd/samples/recipes/query/*.go
ctxpropagation: dep-ensured $(ALL_SRC)
go build -i -o bin/ctxpropagation cmd/samples/recipes/ctxpropagation/*.go
cron: dep-ensured $(ALL_SRC)
go build -i -o bin/cron cmd/samples/cron/*.go
dsl: dep-ensured $(ALL_SRC)
go build -i -o bin/dsl cmd/samples/dsl/*.go
fileprocessing: dep-ensured $(ALL_SRC)
go build -i -o bin/fileprocessing cmd/samples/fileprocessing/*.go
dummy: dep-ensured $(ALL_SRC)
go build -i -o bin/dummy cmd/samples/expense/server/*.go
expense: dep-ensured $(ALL_SRC)
go build -i -o bin/expense cmd/samples/expense/*.go
recovery: dep-ensured $(ALL_SRC)
go build -i -o bin/recovery cmd/samples/recovery/*.go
pso: dep-ensured $(ALL_SRC)
go build -i -o bin/pso cmd/samples/pso/*.go
bins: helloworld \
branch \
childworkflow \
choice \
dynamic \
greetings \
pickfirst \
retryactivity \
splitmerge \
searchattributes \
timer \
cron \
dsl \
fileprocessing \
dummy \
expense \
localactivity \
query \
recovery \
ctxpropagation \
pso \
test: bins
@rm -f test
@rm -f test.log
@echo $(TEST_DIRS)
@for dir in $(TEST_DIRS); do \
go test -coverprofile=$@ "$$dir" | tee -a test.log; \
done;
clean:
rm -rf bin
rm -Rf $(BUILD)