forked from cadence-workflow/cadence-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
139 lines (111 loc) · 3.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
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
.PHONY: test bins clean
PROJECT_ROOT = github.com/samarabbas/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 \
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/pickfirst \
./cmd/samples/recipes/retryactivity \
./cmd/samples/recipes/splitmerge \
./cmd/samples/recipes/timer \
./cmd/samples/recipes/localactivity \
./cmd/samples/recipes/query \
./cmd/samples/recovery \
dep-ensured:
dep ensure
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
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
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
bins: helloworld \
branch \
childworkflow \
choice \
dynamic \
greetings \
pickfirst \
retryactivity \
splitmerge \
timer \
cron \
dsl \
fileprocessing \
dummy \
expense \
localactivity \
query \
recovery \
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)