-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
169 lines (137 loc) Β· 4.78 KB
/
Makefile
File metadata and controls
169 lines (137 loc) Β· 4.78 KB
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
163
164
165
166
167
168
169
# ChILI Development Makefile
#
# Facilitates the development of the ChILI ecosystem using a "Cooking" metaphor.
#
# Menu (Main Commands):
# make shop - Clone the necessary ingredients (repositories)
# make prep - Install dependencies (npm install)
# make cook - Build the code (compile TypeScript)
# make taste - Run the tests (jest)
# make serve - Link the packages globally for use
# make scrub - Clean up the kitchen (remove build artifacts)
#
# The Full Course:
# make meal - The Chef's Special: scrub, shop, prep, cook, taste, serve
#
# Standard Aliases (for muscle memory):
# make install -> make prep
# make build -> make cook
# make test -> make taste
# make clean -> make scrub
# Directories
CUMIN_DIR := ../cumin
SALSA_DIR := ../salsa
CHILI_DIR := .
# Repository URLs
CUMIN_REPO := https://github.com/FNNDSC/cumin.git
SALSA_REPO := https://github.com/FNNDSC/salsa.git
.PHONY: help shop prep cook taste taste-flight serve scrub meal install build test clean link all
help:
@echo "ChILI Kitchen Makefile πΆοΈ"
@echo ""
@echo "The Menu:"
@echo " make shop - Clone 'cumin' and 'salsa' repositories"
@echo " make prep - Install NPM dependencies for all components"
@echo " make cook - Build (compile) all components in order"
@echo " make taste - Run tests for all components"
@echo " make taste-flight - Run tests with coverage (v8 provider) for all components"
@echo " make serve - Link 'chili' globally (npm link)"
@echo " make scrub - Clean build artifacts and node_modules"
@echo ""
@echo "The Special:"
@echo " make meal - Full setup: scrub, shop, prep, cook, taste, serve"
@echo ""
@echo "Standard Aliases:"
@echo " make install, make build, make test, make clean"
# --- Shopping (Cloning) ---
shop: shop-cumin shop-salsa
shop-cumin:
@if [ ! -d "$(CUMIN_DIR)" ]; then \
echo "π Shopping for cumin..."; \
git clone $(CUMIN_REPO) $(CUMIN_DIR); \
else \
echo "π Updating cumin..."; \
(cd $(CUMIN_DIR) && git pull --rebase --autostash) || echo "β οΈ Failed to update cumin. Please resolve manually."; \
fi
shop-salsa:
@if [ ! -d "$(SALSA_DIR)" ]; then \
echo "π Shopping for salsa..."; \
git clone $(SALSA_REPO) $(SALSA_DIR); \
else \
echo "π Updating salsa..."; \
(cd $(SALSA_DIR) && git pull --rebase --autostash) || echo "β οΈ Failed to update salsa. Please resolve manually."; \
fi
# --- Prep (Install Dependencies) ---
prep: shop prep-cumin prep-salsa prep-chili
prep-cumin:
@echo "πͺ Prepping cumin (installing deps)..."
cd $(CUMIN_DIR) && npm install
prep-salsa:
@echo "πͺ Prepping salsa (installing deps)..."
cd $(SALSA_DIR) && npm install
prep-chili:
@echo "πͺ Prepping chili (installing deps)..."
cd $(CHILI_DIR) && npm install --ignore-scripts
# --- Cook (Build) ---
cook: prep cook-cumin cook-salsa cook-chili
cook-cumin:
@echo "π³ Cooking cumin..."
cd $(CUMIN_DIR) && npm run build
cook-salsa: cook-cumin
@echo "π³ Cooking salsa..."
cd $(SALSA_DIR) && npm run build
cook-chili: cook-salsa
@echo "π³ Cooking chili..."
cd $(CHILI_DIR) && npm run build
# --- Taste (Test) ---
taste: cook taste-cumin taste-salsa taste-chili
taste-cumin:
@echo "π
Tasting cumin..."
cd $(CUMIN_DIR) && npm test
taste-salsa:
@echo "π
Tasting salsa..."
cd $(SALSA_DIR) && npm test
taste-chili:
@echo "π
Tasting chili..."
cd $(CHILI_DIR) && npm test
# Coverage (not part of meal)
taste-flight:
@echo "π
Tasting flight (with coverage) cumin..."
cd $(CUMIN_DIR) && npm test -- --coverage --coverageProvider=v8
@echo "π
Tasting flight (with coverage) salsa..."
cd $(SALSA_DIR) && npm test -- --coverage --coverageProvider=v8
@echo "π
Tasting flight (with coverage) chili..."
cd $(CHILI_DIR) && npm test -- --coverage --coverageProvider=v8
# --- Serve (Link) ---
serve:
@echo "π½οΈ Serving the meal (linking)..."
cd $(CUMIN_DIR) && npm link
cd $(SALSA_DIR) && npm link @fnndsc/cumin && npm link
cd $(CHILI_DIR) && npm link @fnndsc/cumin && npm link @fnndsc/salsa && npm link
@echo "π¨βπ³ Bon AppΓ©tit! 'chili' is ready."
# --- Scrub (Clean) ---
scrub:
@echo "π§½ Scrubbing the kitchen..."
@if [ -d "$(CUMIN_DIR)" ]; then \
echo " - Scrubbing cumin..."; \
cd $(CUMIN_DIR) && rm -rf dist types node_modules package-lock.json; \
else \
echo " - Cumin dir not found, skipping scrub."; \
fi
@if [ -d "$(SALSA_DIR)" ]; then \
echo " - Scrubbing salsa..."; \
cd $(SALSA_DIR) && rm -rf dist types node_modules package-lock.json; \
else \
echo " - Salsa dir not found, skipping scrub."; \
fi
cd $(CHILI_DIR) && rm -rf dist types node_modules package-lock.json
@echo "β¨ Kitchen is clean."
# --- The Big One ---
meal: scrub shop prep cook taste serve
# --- Standard Aliases ---
install: prep
build: cook
test: taste
clean: scrub
link: serve
all: meal