This repository has been archived by the owner on Apr 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
89 lines (67 loc) · 2.06 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
#### SYSTEM COMMAND ####
NODE=node
NPM=npm
GRUNT=grunt
BOWER=bower
GIT=git
CD=cd
ECHO=@echo
TAR=tar -zcvf
DEL=rm -rf
MAKE=make
MV=mv
RSYNC=rsync -av --delete --exclude=".git"
#### FOLDERS ####
BOWER_DIR=client/bower_components
NODE_DIR=node_modules
GRUNT_DEP=$(NODE_DIR)/grunt
#### MACRO ####
VERSION=`grep -Po '(?<="version": ")[^"]*' package.json`
#### OTHER ####
ifneq ($(strip $(bower_registry)),)
BOWER_PARAM=--config.registry=$(bower_registry)
endif
help:
$(ECHO) "_____________________________"
$(ECHO) "Current version is $(VERSION)"
$(ECHO) "_____________________________"
$(ECHO) " -- AVAILABLE TARGETS --"
$(ECHO) "make clean => clean the sources"
$(ECHO) "make install => install deps"
$(ECHO) "make dev => launch the project (development)"
$(ECHO) "make prod => launch the project (production) - For testing purpose only"
$(ECHO) "make test => launch the tests"
$(ECHO) "make version => get the current version"
$(ECHO) "make build => build the project and generate build folder"
$(ECHO) "make release type=patch|minor|major => build the project, generate build folder, increment release and commit the source"
$(ECHO) "_____________________________"
clean:
$(DEL) $(NODE_DIR)
$(DEL) $(BOWER_DIR)
install:
$(NPM) install
$(BOWER) install $(BOWER_PARAM)
dev:
$(GRUNT) serve
prod:
$(GRUNT) serve:dist
test: $(GRUNT_DEP) $(BOWER_DIR)
$(GRUNT) test
build: $(GRUNT_DEP) $(BOWER_DIR)
$(GRUNT) build
version:
$(ECHO) $(VERSION)
release: update-release build commit-release
#############
# Sub tasks #
#############
$(BOWER_DIR): install
$(NODE_DIR)/%: install
# DO NOT DELETE - this comment is needed because make does not process this step
# if there's no task def; seems to be related to the % suffix.
clean-dist: $(GRUNT_DEP)
$(GRUNT) clean
update-release: $(GRUNT_DEP)
$(GRUNT) release --type=$(type)
commit-release: $(GRUNT_DEP)
$(GRUNT) bump-commit