-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
68 lines (45 loc) · 1.41 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
SHELL := /bin/bash
NPM = npm
NODE = node
BOWER = node_modules/.bin/bower
JSCS = node_modules/.bin/jscs --esnext --config ./.jscsrc
JSHINT_NODE = node_modules/.bin/jshint --extract=auto --config ./.jshintrc
ISTANBUL = node --harmony node_modules/.bin/istanbul
MOCHA = node --harmony node_modules/.bin/_mocha
SRC = ./*.js
SRC_NODE = $(shell find . \( -path './lib/*' -or -path './tests/*' \) -not -path './lib/views/*')
SRC_BROWSER = $(shell find . -path './public/*' \( -name '*.js' -or -name '*.html' \))
SRC_TEST = $(shell find test -name '*.js' -not -name 'catalog.js' -not -name 'favorite.js')
SRC_TEST_CATALOG = ./test/routes/catalog.js
SRC_TEST_FAVORITE = ./test/routes/favorite.js
.PHONY: start
start:
$(NPM) start
.PHONY: setup
setup: setup-dependencies setup-migrations setup-catalog
.PHONY: setup-migrations
setup-migrations:
$(NPM) run migrate:latest
.PHONY: setup-dependencies
setup-dependencies:
$(NPM) install
$(BOWER) install
.PHONY: setup-catalog
setup-catalog:
@echo 'scraping catalog for Spring (201620)'
$(NODE) --harmony ./lib/scripts/scrape_catalog.js 201620
.PHONY: clean
clean:
$(NPM) rm -rf public/vendor && rm -rf node_modules
.PHONY: lint
lint:
@$(JSHINT_NODE) -- $(SRC_NODE)
@$(JSCS) -- $(SRC_NODE)
.PHONY: test
test: test-basic test-catalog test-favorite
test-basic:
$(MOCHA) $(SRC_TEST)
test-catalog:
$(MOCHA) $(SRC_TEST_CATALOG)
test-favorite:
$(MOCHA) $(SRC_TEST_FAVORITE)