This repository has been archived by the owner on Jul 4, 2022. It is now read-only.
forked from meganz/webclient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·98 lines (75 loc) · 3.04 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
# User/runtime variables
# For browser-test and headless-browser-test.
# BROWSER = Firefox
# Site-dependent variables
NODE_PATH = ./node_modules
NPM = npm
NODE = node
# Build-depends - make sure you keep BUILD_DEP_ALL and BUILD_DEP_ALL_NAMES up-to-date
KARMA = $(NODE_PATH)/karma/bin/karma
JSDOC = $(NODE_PATH)/.bin/jsdoc
JSHINT = $(NODE_PATH)/.bin/jshint
RSG = $(NODE_PATH)/.bin/rsg
JSCS = $(NODE_PATH)/.bin/jscs
BUILD_DEP_ALL = $(KARMA) $(JSDOC)
BUILD_DEP_ALL_NAMES = karma jsdoc
ASMCRYPTO_MODULES = utils,aes-cbc,aes-ccm,sha1,sha256,sha512,hmac-sha1,hmac-sha256,hmac-sha512,pbkdf2-hmac-sha1,pbkdf2-hmac-sha256,pbkdf2-hmac-sha512,rng,bn,rsa-pkcs1,globals-rng,globals
# If the env variable SILENT is set, silence output of make via `-s` flag.
ifdef SILENT
SILENT_MAKE = "-s"
endif
# If HEADLESS is set, we'll run our browser in headless mode through xvfb-run.
ifneq ($(HEADLESS),)
HEADLESS_RUN = "xvfb-run"
endif
# If no browser set, run on our custom PhantomJS2.
ifeq ($(BROWSER),)
BROWSER = PhantomJS_custom
endif
# If no Karma flags set, set a default.
ifeq ($(KARMA_FLAGS),)
# Set to --preprocessors= to show line numbers, otherwise coverage clobbers them.
KARMA_FLAGS = --preprocessors=
endif
ifdef SINGLE_RUN
SINGLE_RUN_FLAG = "--singleRun=true"
endif
# All browsers to test with on the test-all target.
TESTALL_BROWSERS = PhantomJS_custom,Chrome_Unlimited,Firefox
ifeq ($(OS), Windows_NT)
TESTALL_BROWSERS := $(TESTALL_BROWSERS),IE,FirefoxNightly,FirefoxDeveloper,Firefox_NoCookies,Chrome_NoCookies,Chrome_Incognito
endif
all: test-ci api-doc ui-styleguide dist test-shared
test-no-workflows:
SKIP_WORKFLOWS=true $(MAKE) $(SILENT_MAKE) test
test: $(KARMA)
@rm -rf test/phantomjs-storage
$(HEADLESS_RUN) $(NODE) $(KARMA) start $(KARMA_FLAGS) karma.conf.js --browsers $(BROWSER) $(OPTIONS)
test-ci: $(KARMA)
KARMA_FLAGS="--singleRun=true --no-colors" $(MAKE) $(SILENT_MAKE) test
test-debug: $(KARMA)
KARMA_FLAGS="--preprocessors= --debug ${SINGLE_RUN_FLAG}" $(MAKE) $(SILENT_MAKE) test
test-all:
KARMA_FLAGS="--singleRun=true" BROWSER=$(TESTALL_BROWSERS) $(MAKE) $(SILENT_MAKE) test
api-doc: $(JSDOC)
$(NODE) $(JSDOC) --destination doc/api/ --private \
--configure jsdoc.json \
--recurse
ui-styleguide: $(RSG)
$(RSG) "./dont-deploy/ui/src/**/*.jsx" -c styleguide.json
jshint: $(JSHINT)
@-$(NODE) $(JSHINT) --verbose .
jscs: $(JSCS)
@-$(NODE) $(JSCS) --verbose .
pkg-upgrade:
@npm outdated --depth=0
@npm outdated --depth=0 | grep -v Package | awk '{print $$1}' | xargs -I% npm install %@latest $(OPTIONS)
checks: jshint jscs
clean:
rm -rf doc/api/ coverage/ build/ test-results.xml jscpd-report.xml test/phantomjs-storage dont-deploy/ui/out/
rm -f css/*-group*.css js/*-group*.js js/mega-*.js css/mega-*.css node_modules/banner-*.js html/templates.json secureboot.prod.js
clean-all: clean
rm -f $(BUILD_DEP_ALL)
rm -rf $(BUILD_DEP_ALL_NAMES:%=$(NODE_PATH)/%) $(DEP_ALL_NAMES:%=$(NODE_PATH)/%)
.PHONY: all test test-no-workflows test-all test-ci api-doc jshint jscs checks
.PHONY: clean clean-all pkg-upgrade