This repository was archived by the owner on Mar 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (52 loc) · 1.54 KB
/
Copy pathMakefile
File metadata and controls
61 lines (52 loc) · 1.54 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
NODE_BIN_DIR = ./node_modules/.bin
lib_files = $(shell find lib -name "*.js")
test_files = $(shell find test -name "*.spec.js")
covered_files = $(addprefix build/covered/,$(lib_files))
build: build/install build/macgyver.js
lint: build/install build/lint
test: build/install build/test
dist: dist/macgyver.js
clean:
rm -rfv build
dist/macgyver.js: build/install build/lint build/test
ifneq ($(shell git status -s),)
$(error Working directory not clean)
else ifndef VERSION
$(error VERSION is not defined. Usage: VERSION=X.X.X make dist)
else
mkdir -p $(dir $@)
$(NODE_BIN_DIR)/webpack \
--entry=./lib/macgyver.js \
--output-library=macgyver \
--output-library-target=umd \
--output-filename=$@
git add $@
npm version $(VERSION) -f -m "Releasing MacGyver %s"
endif
build/install: package.json
mkdir -p $(dir $@)
npm install
touch $@
build/lint: $(lib_files) $(test_files)
mkdir -p $(dir $@)
$(NODE_BIN_DIR)/eslint ./
touch $@
build/test: build/macgyver.js $(test_files) karma.conf-base.js karma.conf-travis.js
mkdir -p $@
ifdef TRAVIS
$(NODE_BIN_DIR)/karma start karma.conf-travis.js
else
$(NODE_BIN_DIR)/karma start karma.conf-base.js
endif
$(NODE_BIN_DIR)/istanbul report --dir $@/coverage --root $@ html
touch $@
build/macgyver.js: $(covered_files)
mkdir -p $(dir $@)
$(NODE_BIN_DIR)/webpack \
--entry=./build/covered/lib/macgyver.js \
--output-library=macgyver \
--output-library-target=umd \
--output-filename=$@
$(covered_files): build/covered/%.js: %.js
mkdir -p $(dir $@)
$(NODE_BIN_DIR)/istanbul instrument $^ --output $@