blob: ba2ad086449f10c9f1c6cf85b799df1e7f1d0d0d [file] [log] [blame]
Adrià Vilanova Martínezb4af9752022-06-21 12:09:58 +02001.PHONY: node_deps clean_dist deps clean_deps serve_chromium serve_chromium_mv3 serve_gecko release release_chromium_stable release_chromium_beta release_chromium_canary release_gecko_stable build_test_extension clean_releases clean trigger_nightly_build
avm999636c357302020-08-09 19:54:08 +02002
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +02003WEBPACK := ./node_modules/webpack-cli/bin/cli.js
4RELEASE_SCRIPT := bash tools/release.bash
avm999636c357302020-08-09 19:54:08 +02005
Adrià Vilanova Martínez413cb442021-09-06 00:30:45 +02006grpc_proto_gen:
7 (cd src/killSwitch && \
8 protoc -I=. --js_out=import_style=commonjs_strict:. api_proto/*.proto && \
Adrià Vilanova Martínez50435f82022-01-21 19:33:36 +01009 protoc -I. --grpc-web_out=import_style=commonjs,mode=grpcwebtext:. api_proto/*.proto)
Adrià Vilanova Martínez41188592022-01-21 19:47:41 +010010 (cd src/workflows && \
11 protoc -I=. --js_out=import_style=commonjs_strict:. proto/*.proto)
Adrià Vilanova Martínez413cb442021-09-06 00:30:45 +020012
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +020013node_deps:
14 npm ci --no-save
avm999636c357302020-08-09 19:54:08 +020015
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +020016clean_dist:
17 rm -rf dist
avm999636c357302020-08-09 19:54:08 +020018
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +020019deps: node_deps
20 mkdir -p dist
avm99963bbc88c62020-12-25 03:44:41 +010021
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +020022clean_deps:
23 rm -rf node_modules
avm999636c357302020-08-09 19:54:08 +020024
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +020025serve_chromium: deps
26 $(WEBPACK) --mode development --env browser_target=chromium --watch
27
28serve_chromium_mv3: deps
29 $(WEBPACK) --mode development --env browser_target=chromium_mv3 --watch
30
31serve_gecko: deps
32 $(WEBPACK) --mode development --env browser_target=gecko --watch
33
34release: release_chromium_stable release_chromium_beta release_gecko_stable
35
36release_chromium_stable: deps
37 $(WEBPACK) --mode production --env browser_target=chromium
38 $(RELEASE_SCRIPT) -c stable -b chromium
39 rm -rf dist/chromium
40
41release_chromium_beta: deps
Adrià Vilanova Martínezd4a4f3d2021-10-23 18:25:39 +020042 $(WEBPACK) --mode production --env browser_target=chromium_mv3
43 $(RELEASE_SCRIPT) -c beta -b chromium_mv3
44 rm -rf dist/chromium_mv3
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +020045
Adrià Vilanova Martínez9aa29312022-01-16 02:42:46 +010046release_chromium_canary: deps
47 $(WEBPACK) --mode production --env browser_target=chromium_mv3 --env canary
48 $(RELEASE_SCRIPT) -c canary -b chromium_mv3
49 rm -rf dist/chromium_mv3
50
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +020051release_gecko_stable: deps
52 $(WEBPACK) --mode production --env browser_target=gecko
53 $(RELEASE_SCRIPT) -c stable -b gecko
54 rm -rf dist/gecko
55
56# Target to build the extension for webext lint in the Zuul Check Pipeline.
57build_test_extension: deps
58 $(WEBPACK) --mode production --env browser_target=gecko
59 $(RELEASE_SCRIPT) -c stable -b gecko
60
61clean_releases:
avm999636c357302020-08-09 19:54:08 +020062 rm -rf out
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +020063
64clean: clean_deps clean_dist clean_releases
Adrià Vilanova Martínezb4af9752022-06-21 12:09:58 +020065
66# Manually trigger the nightly build. It also makes sure the tracked master branch is up to update
67trigger_nightly_build:
68 git fetch
69 zuul-client enqueue-ref --tenant gerrit --pipeline nightly-build --project infinitegforums --ref refs/heads/master --newrev $$(git rev-parse gerrit/master)