-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
46 lines (34 loc) · 1.02 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
BROWSERS = chrome firefox
BUILDS := $(patsubst %, build-%,$(BROWSERS))
COPIES := $(patsubst %, copy-%,$(BROWSERS))
CLEANS := $(patsubst %, clean-%,$(BROWSERS))
BUMP_VERSIONS := $(patsubst %, bump-version-%,$(BROWSERS))
.PHONY: $(COPIES) $(CLEANS) $(BUILDS) $(BUMP_VERSIONS)\
build-all\
format-all\
bump-all
$(CLEANS): clean-%:
@echo Cleaning $* folder...
@find $*/* | grep -v -E "browser.js|manifest.json" | xargs rm -rf
@echo ... Clean Done
$(COPIES): copy-%: clean-%
@echo Copying source files...
@cp src/* $*
@cp -r images $*
@echo ... Copy Done
$(BUMP_VERSIONS): bump-version-%:
@tmp=$(mktemp)
@version=$(cat VERSION)
@jq '.version = "'$$(< VERSION)'"' $*/manifest.json > "$tmp" && mv "$tmp" $*/manifest.json
build-chrome: copy-chrome
build-firefox: copy-firefox
@echo Zipping...
@cd firefox; zip -r airflow-extension.zip *; cd ..
@echo ... Zip Done
clean-all: $(CLEANS)
build-all: $(BUILDS)
bump-all: $(BUMP_VERSIONS)
format-all:
@echo Formatting src files...
@prettier --write src
@echo ... Format Done