Add -b/--build-vendor flag to add-on build scripts, disable auto-build.

This commit is contained in:
Michael Kelly 2017-07-26 19:48:37 -07:00
Родитель 3d5e41c8f3
Коммит d3ad54e74c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 972176E09570E68A
6 изменённых файлов: 59 добавлений и 15 удалений

Просмотреть файл

@ -71,6 +71,9 @@ files:
cd recipe-client-addon
./bin/make-xpi.sh # Creates /recipe-client-addon/shield-recipe-client.xpi
Pass the ``-b``/``--build-vendor`` flag to auto-build vendor dependencies before
creating the XPI.
.. _recipe-client-sync:
Sync changes to mozilla-central
@ -84,6 +87,9 @@ checkout of mozilla-central. The files that are copied over are determined by
cd recipe-client-addon
./bin/update-mozilla-central.sh /path/to/mozilla-central
Pass the ``-b``/``--build-vendor`` flag to auto-build vendor dependencies before
copying the files to the checkout.
.. _recipe-client-tests:
Writing and Running Tests

Просмотреть файл

@ -5,6 +5,22 @@ set -eu
BASE_DIR="$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")"
TMP_DIR=$(mktemp -d)
DEST="${TMP_DIR}/shield-recipe-client"
BUILD_VENDOR=false
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-b|--build-vendor)
BUILD_VENDOR=true
;;
*)
# unknown option
;;
esac
shift # past argument
done
mkdir -p $DEST
@ -15,9 +31,11 @@ function cleanup {
trap cleanup EXIT
# Build vendor files
pushd $BASE_DIR
npm run build
popd
if [[ "$BUILD_VENDOR" = true ]]; then
pushd $BASE_DIR
npm run build
popd
fi
while read -r LINE || [[ -n "${LINE}" ]]; do
mkdir -p "$(dirname "${DEST}/${LINE}")"

Просмотреть файл

@ -17,7 +17,7 @@ popd
echo 'Syncing recipe-client-addon to mozilla-central...'
pushd normandy/recipe-client-addon
npm install
./bin/update-mozilla-central.sh ../../mozilla-central/
./bin/update-mozilla-central.sh --build-vendor ../../mozilla-central/
popd
echo 'Setting up environment'

Просмотреть файл

@ -17,7 +17,7 @@ popd
echo 'Syncing recipe-client-addon to mozilla-central...'
pushd normandy/recipe-client-addon
npm install
./bin/update-mozilla-central.sh ../../mozilla-central/
./bin/update-mozilla-central.sh --build-vendor ../../mozilla-central/
popd
echo 'Setting up environment'

Просмотреть файл

@ -6,6 +6,6 @@ echo 'NPM install'
npm install
echo 'Making XPI'
./bin/make-xpi.sh
./bin/make-xpi.sh --build-vendor
cp shield-recipe-client.xpi /artifacts/
popd

Просмотреть файл

@ -2,26 +2,46 @@
set -eu
if [[ $# -lt 1 ]]; then
echo "usage: $(basename $0) MOZ-CENTRAL" >&2
baseDir="$(dirname "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )")"
mozCentral=""
buildVendor=false
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-b|--build-vendor)
buildVendor=true
;;
*)
# Assumed to be the path to mozilla-central
mozCentral=$key
;;
esac
shift # past argument
done
if [[ -z "$mozCentral" ]]; then
echo "usage: $(basename $0) [-b|--build-vendor] MOZ-CENTRAL" >&2
exit 1
fi
baseDir="$(dirname "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )")"
mozCentral="$1"
dest="${mozCentral}/browser/extensions/shield-recipe-client"
if [[ ! -d "$dest" ]]; then
echo "Sync destination $dest does not exist" >&2
exit 1
echo "Sync destination $dest does not exist" >&2
exit 1
fi
rm -rf "${dest}"/*
# Build vendor files
pushd $baseDir
npm run build
popd
if [[ "$buildVendor" = true ]]; then
pushd $baseDir
npm run build
popd
fi
while read -r line || [[ -n "${line}" ]]; do
mkdir -p "$(dirname "${dest}/${line}")"