From 8bec09e869facda6e2263dc4e5a2a8fecc455a4a Mon Sep 17 00:00:00 2001 From: Julian Descottes Date: Fri, 14 Sep 2018 12:05:15 +0200 Subject: [PATCH] Use a manifest template to have different update URL for each xpi --- Makefile | 11 +++++++++-- extension/{manifest.json => template-manifest.json} | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) rename extension/{manifest.json => template-manifest.json} (78%) diff --git a/Makefile b/Makefile index c5050e3..694603d 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,20 @@ ARCHS=linux linux64 mac64 win32 -MANIFEST=extension/manifest.json -VERSION=`grep -Eo '"version"\:\s*"[^"]+' $(MANIFEST) | grep -Eo '[0-9].*'` +ROOT_PATH=/pub/labs/fxos-simulator/adb-helper/ +ROOT_UPDATE_URL=https://ftp.mozilla.org$(ROOT_PATH) + +VERSION=1.0 define build-xpis cd extension; \ for arch in $(ARCHS); do \ echo "build dist/$$arch-$(VERSION).xpi"; \ + sed \ + -e 's#@@UPDATE_URL@@#$(ROOT_UPDATE_URL)$$arch/updates.json#' \ + -e 's#@@VERSION@@#$(VERSION)#' \ + template-manifest.json > manifest.json; \ zip ../dist/$$arch-$(VERSION).xpi -r $$arch adb.json manifest.json; \ + rm manifest.json; \ done endef diff --git a/extension/manifest.json b/extension/template-manifest.json similarity index 78% rename from extension/manifest.json rename to extension/template-manifest.json index 17eb335..6fba220 100644 --- a/extension/manifest.json +++ b/extension/template-manifest.json @@ -2,13 +2,13 @@ "manifest_version": 2, "name": "ADB binary provider", "author": "Mozilla & Android Open Source Project", - "version": "1.0", + "version": "@@VERSION@@", "description": "An extension providing adb blobs for connecting to Firefox for Android", "applications": { "gecko": { "id": "adb@mozilla.org", "strict_min_version": "63.0a1", - "update_url": "https://ftp.mozilla.org/pub/labs/fxos-simulator/adb-helper/updates.json" + "update_url": "@@UPDATE_URL@@" } }, "permissions": [