-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
100 lines (83 loc) · 1.97 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
.PHONY: lib action screen speech sound run actionbank 3rdparty/cycle-posenet-driver 3rdparty/cycle-meyda-driver
ROOTDIR=$(shell pwd)
BINDIR=node_modules/.bin
BUMP=.scripts/bump.js
JASE=$(BINDIR)/jase
ARG=$(filter-out $@,$(MAKECMDGOALS))
PACKAGES := action screen speech sound run actionbank 3rdparty/cycle-posenet-driver 3rdparty/cycle-meyda-driver
all:
@echo "npm ci"
@npm ci
@echo ""
@for d in $(PACKAGES); do \
echo "$$d: npm ci"; \
cd $$d && npm ci && cd $(ROOTDIR) && \
echo ""; \
done
@make lib
lib:
@if [ "$(ARG)" = "" ]; then \
for d in $(PACKAGES); do \
echo "Compiling $$d"; \
make lib $$d; \
done; \
else \
rm -rf $(ARG)/lib && \
mkdir -p $(ARG)/lib && \
cd $(ARG) && \
npm run build:cjs && \
npm run build:es6 && \
echo "✓ Compiled TypeScript to lib\n"; \
fi
doc:
@if [ "$(ARG)" = "" ]; then \
exitcode=0; \
for d in $(PACKAGES); do \
make doc $$d || exitcode=$$?; \
done; \
exit $$exitcode; \
else \
cd $(ARG) && npm run build:doc && \
echo "✓ Docs for $(ARG)"; \
fi
test:
@if [ "$(ARG)" = "" ]; then \
exitcode=0; \
for d in $(PACKAGES); do \
make test $$d || exitcode=$$?; \
done; \
exit $$exitcode; \
else \
cd $(ARG) && npm run test && \
echo "✓ Tested $(ARG)"; \
fi
postbump:
cd $(ARG) && rm -rf node_modules package-lock.json && npm ci && \
cd $(ROOTDIR) && make lib $(ARG) && make doc $(ARG) && \
git add -A && git commit -m "Release $(ARG) $(shell cat $(ARG)/package.json | $(JASE) version)" && \
cd $(ROOTDIR) && cd $(ARG) && npm publish --access public;
release-patch:
@if [ "$(ARG)" = "" ]; then \
echo "Error: please call 'make release-patch' with an argument, like 'make release-patch action'"; \
else \
$(BUMP) $(ARG)/package.json --patch && \
make postbump $(ARG) && \
echo "✓ Released new patch for $(ARG)"; \
fi
# catch and do nothing
action:
@:
actionbank:
@:
screen:
@:
sound:
@:
speech:
@:
run:
@:
3rdparty/cycle-posenet-driver:
@:
3rdparty/cycle-meyda-driver:
@: