Adrià Vilanova Martínez | 3465e77 | 2021-07-11 19:18:41 +0200 | [diff] [blame^] | 1 | .PHONY: node_deps clean_dist deps clean_deps serve_chromium serve_chromium_mv3 serve_gecko release release_chromium_stable release_chromium_beta release_gecko_stable build_test_extension clean_releases clean |
avm99963 | 6c35730 | 2020-08-09 19:54:08 +0200 | [diff] [blame] | 2 | |
Adrià Vilanova Martínez | 3465e77 | 2021-07-11 19:18:41 +0200 | [diff] [blame^] | 3 | WEBPACK := ./node_modules/webpack-cli/bin/cli.js |
| 4 | RELEASE_SCRIPT := bash tools/release.bash |
avm99963 | 6c35730 | 2020-08-09 19:54:08 +0200 | [diff] [blame] | 5 | |
Adrià Vilanova Martínez | 3465e77 | 2021-07-11 19:18:41 +0200 | [diff] [blame^] | 6 | node_deps: |
| 7 | npm ci --no-save |
avm99963 | 6c35730 | 2020-08-09 19:54:08 +0200 | [diff] [blame] | 8 | |
Adrià Vilanova Martínez | 3465e77 | 2021-07-11 19:18:41 +0200 | [diff] [blame^] | 9 | clean_dist: |
| 10 | rm -rf dist |
avm99963 | 6c35730 | 2020-08-09 19:54:08 +0200 | [diff] [blame] | 11 | |
Adrià Vilanova Martínez | 3465e77 | 2021-07-11 19:18:41 +0200 | [diff] [blame^] | 12 | deps: node_deps |
| 13 | mkdir -p dist |
avm99963 | bbc88c6 | 2020-12-25 03:44:41 +0100 | [diff] [blame] | 14 | |
Adrià Vilanova Martínez | 3465e77 | 2021-07-11 19:18:41 +0200 | [diff] [blame^] | 15 | clean_deps: |
| 16 | rm -rf node_modules |
avm99963 | 6c35730 | 2020-08-09 19:54:08 +0200 | [diff] [blame] | 17 | |
Adrià Vilanova Martínez | 3465e77 | 2021-07-11 19:18:41 +0200 | [diff] [blame^] | 18 | serve_chromium: deps |
| 19 | $(WEBPACK) --mode development --env browser_target=chromium --watch |
| 20 | |
| 21 | serve_chromium_mv3: deps |
| 22 | $(WEBPACK) --mode development --env browser_target=chromium_mv3 --watch |
| 23 | |
| 24 | serve_gecko: deps |
| 25 | $(WEBPACK) --mode development --env browser_target=gecko --watch |
| 26 | |
| 27 | release: release_chromium_stable release_chromium_beta release_gecko_stable |
| 28 | |
| 29 | release_chromium_stable: deps |
| 30 | $(WEBPACK) --mode production --env browser_target=chromium |
| 31 | $(RELEASE_SCRIPT) -c stable -b chromium |
| 32 | rm -rf dist/chromium |
| 33 | |
| 34 | release_chromium_beta: deps |
| 35 | $(WEBPACK) --mode production --env browser_target=chromium |
| 36 | $(RELEASE_SCRIPT) -c beta -b chromium |
| 37 | rm -rf dist/chromium |
| 38 | |
| 39 | release_gecko_stable: deps |
| 40 | $(WEBPACK) --mode production --env browser_target=gecko |
| 41 | $(RELEASE_SCRIPT) -c stable -b gecko |
| 42 | rm -rf dist/gecko |
| 43 | |
| 44 | # Target to build the extension for webext lint in the Zuul Check Pipeline. |
| 45 | build_test_extension: deps |
| 46 | $(WEBPACK) --mode production --env browser_target=gecko |
| 47 | $(RELEASE_SCRIPT) -c stable -b gecko |
| 48 | |
| 49 | clean_releases: |
avm99963 | 6c35730 | 2020-08-09 19:54:08 +0200 | [diff] [blame] | 50 | rm -rf out |
Adrià Vilanova Martínez | 3465e77 | 2021-07-11 19:18:41 +0200 | [diff] [blame^] | 51 | |
| 52 | clean: clean_deps clean_dist clean_releases |