/
makefile
32 lines (25 loc) · 866 Bytes
/
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
.SHELLFLAGS := -eu -c
.ONESHELL: # all things in a rule run in one shell, rather than shell per line
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
.PHONY: build
build: dist/index.js
dist/index.js: $(shell ./build/cas.sh $(shell find src -iname "*.ts" -not -iname "*.test.ts"))
@echo "==> Building"
@sleep 3s
@mkdir -p "dist"
@echo "compiled at $(shell date)" > "$@"
@echo "==> Done"
@./build/artifact.sh "$<" "$@"
.PHONY: test
test: artifacts/test-report.json
artifacts/test-report.json: $(shell ./build/cas.sh $(shell find src -iname "*.ts"))
@echo "==> Running Tests"
@sleep 1s
@mkdir -p artifacts/
@echo '{"tests": 10, "lastRun": "$(shell date)"}' > "$@"
@echo '{}' > "artifacts/coverage.json"
@echo "==> Passed"
@./build/artifact.sh "$<" "$@"
@./build/artifact.sh "$<" "artifacts/coverage.json"