Skip to content

Commit 6efb6f1

Browse files
willdurandjuliandescottes
authored andcommitted
Refactor Makefile to build a unique XPI per arch
1 parent 6aa0d34 commit 6efb6f1

6 files changed

Lines changed: 47 additions & 224 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
*.xpi
1+
dist/

Makefile

Lines changed: 19 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,44 @@
11
ARCHS=linux linux64 mac64 win32
22

33
EXTENSION_NAME=adb-extension
4-
VERSION=0.0.6pre
5-
XPI_NAME=$(EXTENSION_NAME)-$(VERSION)
4+
# Please keep only three parts in the value of this `VERSION` variable.
5+
# `build-xpis` below will automatically add a forth part.
6+
VERSION=0.0.7
67

78
ROOT_PATH=pub/labs/devtools/$(EXTENSION_NAME)
89
ROOT_UPDATE_URL=https://ftp.mozilla.org/$(ROOT_PATH)
9-
S3_BASE_URL=s3://net-mozaws-prod-delivery-contrib/$(ROOT_PATH)
1010

1111
define build-xpis
1212
pushd extension; \
13+
index=0; \
1314
for arch in $(ARCHS); do \
15+
xpi_name=$(EXTENSION_NAME)-$(VERSION).$$index; \
16+
echo "[release-$$arch] Create dist/$$arch/ folder"; \
17+
mkdir -p ../dist/$$arch; \
1418
echo "[release-$$arch] Create manifest.json"; \
1519
sed \
20+
-e "s#@@ARCH@@#$$arch#" \
1621
-e "s#@@UPDATE_URL@@#$(ROOT_UPDATE_URL)/$$arch/update.json#" \
17-
-e "s#@@VERSION@@#$(VERSION)#" \
22+
-e "s#@@VERSION@@#$(VERSION).$$index#" \
1823
template-manifest.json > manifest.json; \
19-
echo "[release-$$arch] ZIP to $(XPI_NAME)-$$arch.xpi"; \
20-
zip ../dist/$(XPI_NAME)-$$arch.xpi -r $$arch adb.json manifest.json; \
24+
echo "[release-$$arch] ZIP to $$xpi_name-$$arch.xpi"; \
25+
zip ../dist/$$arch/$$xpi_name-$$arch.xpi -r $$arch adb.json manifest.json; \
2126
echo "[release-$$arch] Delete temporary manifest.json"; \
2227
rm manifest.json; \
28+
echo "[release-$$arch] Create update.json"; \
29+
sed \
30+
-e "s#@@UPDATE_LINK@@#$(ROOT_UPDATE_URL)/$$arch/$$xpi_name-$$arch.xpi#" \
31+
-e "s#@@VERSION@@#$(VERSION).$$index#" \
32+
../template-update.json > ../dist/$$arch/update.json; \
33+
index=$$((index + 1)); \
2334
done; \
2435
popd
2536
endef
2637

2738
define clean
28-
echo "Remove previous xpi files"; \
29-
rm -f **/*.xpi
30-
endef
31-
32-
define release
33-
pushd dist; \
3439
for arch in $(ARCHS); do \
35-
echo "[release-$$arch] Sign .xpi"; \
36-
../sign.sh $(XPI_NAME)-$$arch.xpi; \
37-
echo "[release-$$arch] Upload .xpi"; \
38-
aws s3 cp \
39-
$(XPI_NAME)-$$arch.xpi \
40-
$(S3_BASE_URL)/$$arch/$(XPI_NAME)-$$arch.xpi; \
41-
echo "[release-$$arch] Copy to 'latest' .xpi"; \
42-
aws s3 cp \
43-
$(S3_BASE_URL)/$$arch/$(XPI_NAME)-$$arch.xpi \
44-
$(S3_BASE_URL)/$$arch/adb-extension-latest-$$arch.xpi; \
45-
echo "[release-$$arch] Create update.json"; \
46-
sed \
47-
-e "s#@@UPDATE_LINK@@#$(ROOT_UPDATE_URL)/$$arch/$(XPI_NAME)-$$arch.xpi#" \
48-
-e "s#@@VERSION@@#$(VERSION)#" \
49-
../template-update.json > update.json; \
50-
echo "[release-$$arch] Upload update.json"; \
51-
aws s3 cp --cache-control max-age=3600 \
52-
update.json \
53-
$(S3_BASE_URL)/$$arch/update.json; \
54-
echo "[release-$$arch] Delete temporary update.json"; \
55-
rm update.json; \
56-
done; \
57-
popd
40+
rm -rf dist/$$arch/; \
41+
done
5842
endef
5943

6044
package:
@@ -63,6 +47,3 @@ package:
6347

6448
clean:
6549
@$(call clean)
66-
67-
release:
68-
@$(call release)

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,27 @@ It provides ADB binaries used by DevTools to connect to Firefox/GeckoView produc
55

66
### Releases
77

8-
For documentation about releases check out [RELEASE.md](./RELEASE.md)
8+
1. Update the value of the `VERSION` variable in the `Makefile` (and commit the change)
9+
2. Run `make package`. The following files should have been generated in the `dist/` folder:
10+
11+
```
12+
dist
13+
├── linux
14+
│   ├── adb-extension-0.0.7.0-linux.xpi
15+
│   └── update.json
16+
├── linux64
17+
│   ├── adb-extension-0.0.7.1-linux64.xpi
18+
│   └── update.json
19+
├── mac64
20+
│   ├── adb-extension-0.0.7.2-mac64.xpi
21+
│   └── update.json
22+
└── win32
23+
├── adb-extension-0.0.7.3-win32.xpi
24+
└── update.json
25+
```
26+
27+
3. Upload the different XPI files to AMO (as unlisted versions). Download the signed XPI files.
28+
4. Upload the signed XPI files and their `update.json` files to the FTP server. Note that we'll want to upload the versioned XPIs (e.g. `adb-extension-0.0.7.3-win32.xpi`) as well as "latest" copies (e.g. `adb-extension-latest-win32.xpi`).
929
1030
### Discussion
1131

RELEASE.md

Lines changed: 0 additions & 127 deletions
This file was deleted.

extension/template-manifest.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"manifest_version": 2,
33
"name": "Firefox DevTools ADB Extension",
4-
"author": "Mozilla & Android Open Source Project",
54
"version": "@@VERSION@@",
6-
"description": "An extension providing ADB binaries for Android remote debugging in Firefox DevTools. May be automatically installed when using about:debugging.",
7-
"applications": {
5+
"description": "An extension providing (@@ARCH@@) ADB binaries for Android remote debugging in Firefox DevTools. May be automatically installed when using about:debugging.",
6+
"browser_specific_settings": {
87
"gecko": {
98
"id": "adb@mozilla.org",
109
"strict_min_version": "64.0a1",
1110
"update_url": "@@UPDATE_URL@@"
1211
}
1312
},
14-
"permissions": [
15-
],
16-
"homepage_url": "https://github.com/mozilla/devtools-adb-extension"
13+
"developer": {
14+
"name": "Mozilla & Android Open Source Project",
15+
"url": "https://github.com/mozilla-extensions/devtools-adb-extension"
16+
}
1717
}

sign.sh

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)