-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathMakefile
92 lines (75 loc) · 2.74 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
ENVIRONMENT ?= dev
BROWSER ?= chrome
depcheck:
@cd packages/background && npx depcheck
@cd packages/ui && npx depcheck
test/background:
@cd packages/background && $(MAKE) test/background
test/ui:
@cd packages/ui && $(MAKE) test/ui
test/provider:
@cd packages/provider && $(MAKE) test/provider
test:
$(MAKE) test/background
$(MAKE) test/ui
$(MAKE) test/provider
lint:
@cd packages/background && yarn lint
@cd packages/ui && yarn lint
@cd packages/provider && yarn lint
install:
@cd packages/background && rm -rf node_modules
@cd packages/ui && rm -rf node_modules
@cd packages/provider && rm -rf node_modules
@echo "Installing Background package..."
@cd packages/background && yarn install
@echo "Installing UI package"
@cd packages/ui && yarn install
@echo "Installing Provider package"
@cd packages/provider && yarn install
install/ci:
@cd packages/background && yarn install --prefer-offline --frozen-lockfile --network-concurrency 1
@cd packages/ui && yarn install --prefer-offline --frozen-lockfile --network-concurrency 1
@cd packages/provider && yarn install --prefer-offline --frozen-lockfile --network-concurrency 1
build/ui:
@cd packages/ui && BROWSER=$(BROWSER) $(MAKE) build/ui --no-print-directory
build/background:
@cd packages/background && BROWSER=$(BROWSER) $(MAKE) build/background --no-print-directory
build/provider:
@cd packages/provider && BROWSER=$(BROWSER) $(MAKE) build/provider --no-print-directory
cp/release-notes:
ifeq ($(BROWSER), firefox)
@cp release-notes.json dist-firefox
else
@cp release-notes.json dist
endif
build:
@rm -Rf dist-firefox
@rm -Rf dist
@$(MAKE) ENVIRONMENT=$(ENVIRONMENT) build/background --no-print-directory
@$(MAKE) ENVIRONMENT=$(ENVIRONMENT) build/provider --no-print-directory
@$(MAKE) build/ui --no-print-directory
ifeq ($(BROWSER), firefox)
@mkdir -p dist-firefox && cp -r dist/* dist-firefox/
@rm -Rf dist
endif
@$(MAKE) BROWSER=$(BROWSER) build/manifest --no-print-directory
@$(MAKE) BROWSER=$(BROWSER) cp/release-notes --no-print-directory
build/prod:
@rm -Rf dist/
@rm -Rf dist-firefox/
@$(MAKE) ENVIRONMENT=prod build/background --no-print-directory
@$(MAKE) ENVIRONMENT=prod build/provider --no-print-directory
@$(MAKE) GENERATE_SOURCEMAP=false build/ui --no-print-directory
@mkdir dist-firefox && cp -r dist/* dist-firefox/
@$(MAKE) BROWSER=chrome build/manifest --no-print-directory
@$(MAKE) BROWSER=firefox build/manifest --no-print-directory
@cp release-notes.json dist
@cp release-notes.json dist-firefox
build/manifest:
@cd packages/ui && BROWSER=$(BROWSER) $(MAKE) build/manifest --no-print-directory
build/prod-zip:
@rm -Rf dist/
@$(MAKE) ENVIRONMENT=prod build/prod
@zip -r -D block-extension-chrome.zip dist/
@zip -r -D block-extension-firefox.zip dist-firefox/