forked from ovh-ux/ovh-module-emailpro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
99 lines (77 loc) · 2.09 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
89
90
91
92
93
94
95
96
97
98
99
#### SYSTEM COMMAND ####
NODE=node
NPM=npm
GRUNT=grunt
BOWER=bower
GIT=git
CD=cd
ECHO=@echo
TAR=tar -czf
DEL=rm -rf
MAKE=make
MV=mv
RSYNC=rsync -av --delete --exclude=".git"
#### FOLDERS ####
BOWER_DIR=bower_components
NODE_DIR=node_modules
GRUNT_DEP=$(NODE_DIR)/grunt
#### MACRO ####
NAME=`grep -Po '(?<="name": ")[^"]*' package.json`
VERSION=`grep -Po '(?<="version": ")[^"]*' package.json`
#### OTHER ####
ifneq ($(strip $(bower_registry)),)
BOWER_PARAM=--config.registry=$(bower_registry)
endif
#########
# Tasks #
#########
help:
$(ECHO) "_____________________________"
$(ECHO) "$(NAME)"
$(ECHO) "Version $(VERSION)"
$(ECHO) "Copyright (c) OVH SAS."
$(ECHO) "All rights reserved."
$(ECHO) "_____________________________"
$(ECHO) " -- AVAILABLE TARGETS --"
$(ECHO) "make version => get the current version"
$(ECHO) "make clean => clean the sources"
$(ECHO) "make install => install deps"
$(ECHO) "make dev => launch the project (development)"
$(ECHO) "make test => launch the tests"
$(ECHO) "make build => build the project and generate dist"
$(ECHO) "make release type=major|minor|patch|prerelease => build the project, generate build folder, increment release and commit the dist"
$(ECHO) "_____________________________"
version:
$(ECHO) $(VERSION)
clean:
$(DEL) $(NODE_DIR)
$(DEL) $(BOWER_DIR)
install:
$(NPM) install
$(BOWER) install $(BOWER_PARAM)
dev: deps
$(GRUNT) build --mode=dev
$(GRUNT) watch
build: deps
$(GRUNT) build --mode=prod
release: update-release build commit-release
###############
# Tests tasks #
###############
test: deps
$(GRUNT) test
#############
# Sub tasks #
#############
# Dependencies of the project
deps: $(GRUNT_DEP) $(BOWER_DIR)
$(BOWER_DIR):
$(MAKE) install
$(NODE_DIR)/%:
$(MAKE) install
clean-dist: deps
$(GRUNT) clean
update-release: deps
$(GRUNT) release --type=$(type)
commit-release: deps
$(GRUNT) bump-commit