Update app build scripts for new combined repo

Also:

- Replace `install.rdf` with `version` file
- Remove lots of obsolete logic in `prepare_build` (formerly
  `build_xpi`)
This commit is contained in:
Dan Stillman 2023-04-24 04:09:36 -04:00 committed by Dan Stillman
parent 1ab041ef55
commit c55ef8714b
13 changed files with 102 additions and 235 deletions

2
app/.gitignore vendored
View file

@ -2,7 +2,9 @@
cache cache
config-custom.sh config-custom.sh
dist dist
lastrev
staging staging
tmp
xulrunner xulrunner
pdftools pdftools
win/resource_hacker win/resource_hacker

View file

@ -266,14 +266,14 @@ if [ $DEVTOOLS -eq 1 ]; then
fi fi
# 5.0.96.3 / 5.0.97-beta.37+ddc7be75c # 5.0.96.3 / 5.0.97-beta.37+ddc7be75c
VERSION=`perl -ne 'print and last if s/.*<em:version>(.+)<\/em:version>.*/\1/;' install.rdf` VERSION=`cat version`
# 5.0.96 / 5.0.97 # 5.0.96 / 5.0.97
VERSION_NUMERIC=`perl -ne 'print and last if s/.*<em:version>(\d+\.\d+(\.\d+)?).*<\/em:version>.*/\1/;' install.rdf` VERSION_NUMERIC=`perl -ne 'print and last if s/^(\d+\.\d+(\.\d+)?).*/\1/;' version`
if [ -z "$VERSION" ]; then if [ -z "$VERSION" ]; then
echo "Version number not found in install.rdf" echo "Version number not found in version file"
exit 1 exit 1
fi fi
rm install.rdf rm version
echo echo
echo "Version: $VERSION" echo "Version: $VERSION"

View file

@ -38,12 +38,6 @@ SIGNTOOL_CERT_SUBJECT="Corporation for Digital Scholarship"
SIGNTOOL_TIMESTAMP_SERVER="http://timestamp.sectigo.com" SIGNTOOL_TIMESTAMP_SERVER="http://timestamp.sectigo.com"
SIGNTOOL_DELAY=15 SIGNTOOL_DELAY=15
# Directory for Zotero code repos
repo_dir=$( cd "$DIR"/.. && pwd )
# Directory for Zotero source code
ZOTERO_SOURCE_DIR="$repo_dir"/zotero-client
# Directory for Zotero build files (needed for scripts/*_build_and_deploy)
ZOTERO_BUILD_DIR="$repo_dir"/zotero-build
# Directory for unpacked binaries # Directory for unpacked binaries
STAGE_DIR="$DIR/staging" STAGE_DIR="$DIR/staging"
# Directory for packed binaries # Directory for packed binaries

View file

@ -2,8 +2,9 @@
set -euo pipefail set -euo pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="$(dirname "$SCRIPT_DIR")" APP_ROOT_DIR="$(dirname "$SCRIPT_DIR")"
. "$ROOT_DIR/config.sh" ROOT_DIR="$(dirname "$(dirname "$SCRIPT_DIR")")"
. "$APP_ROOT_DIR/config.sh"
CHANNEL="beta" CHANNEL="beta"
export SAFARI_APPEX="$ROOT_DIR/../safari-app-extension-builds/beta/ZoteroSafariExtension.appex" export SAFARI_APPEX="$ROOT_DIR/../safari-app-extension-builds/beta/ZoteroSafariExtension.appex"
@ -13,11 +14,13 @@ cd "$SCRIPT_DIR"
hash=`./get_repo_branch_hash master` hash=`./get_repo_branch_hash master`
source_dir=`./get_commit_files $hash` source_dir=`./get_commit_files $hash`
build_dir=`mktemp -d`
function cleanup { function cleanup {
rm -rf $source_dir rm -rf "$source_dir"
rm -rf "$build_dir"
} }
trap cleanup EXIT trap cleanup EXIT
"$ZOTERO_BUILD_DIR/xpi/build_xpi" -s "$source_dir" -c $CHANNEL -m $hash ./prepare_build -s "$source_dir" -o "$build_dir" -c $CHANNEL -m $hash
./build_and_deploy -d "$ZOTERO_BUILD_DIR/xpi/build/staging" -p $BUILD_PLATFORMS -c $CHANNEL ./build_and_deploy -d "$build_dir" -p $BUILD_PLATFORMS -c $CHANNEL

View file

@ -2,8 +2,9 @@
set -euo pipefail set -euo pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="$(dirname "$SCRIPT_DIR")" APP_ROOT_DIR="$(dirname "$SCRIPT_DIR")"
. "$ROOT_DIR/config.sh" ROOT_DIR="$(dirname "$(dirname "$SCRIPT_DIR")")"
. "$APP_ROOT_DIR/config.sh"
CHANNEL="dev" CHANNEL="dev"
BRANCH="master" BRANCH="master"
@ -14,11 +15,13 @@ cd "$SCRIPT_DIR"
hash=`./get_repo_branch_hash $BRANCH` hash=`./get_repo_branch_hash $BRANCH`
source_dir=`./get_commit_files $hash` source_dir=`./get_commit_files $hash`
build_dir=`mktemp -d`
function cleanup { function cleanup {
rm -rf $source_dir rm -rf "$source_dir"
rm -rf "$build_dir"
} }
trap cleanup EXIT trap cleanup EXIT
"$ZOTERO_BUILD_DIR/xpi/build_xpi" -s "$source_dir" -c $CHANNEL -m $hash ./prepare_build -s "$source_dir" -o "$build_dir" -c $CHANNEL -m $hash
./build_and_deploy -d "$ZOTERO_BUILD_DIR/xpi/build/staging" -p $BUILD_PLATFORMS -c $CHANNEL -i 1 ./build_and_deploy -d "$build_dir" -p $BUILD_PLATFORMS -c $CHANNEL -i 1

View file

@ -2,8 +2,9 @@
set -euo pipefail set -euo pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="$(dirname "$SCRIPT_DIR")" APP_ROOT_DIR="$(dirname "$SCRIPT_DIR")"
. "$ROOT_DIR/config.sh" ROOT_DIR="$(dirname "$(dirname "$SCRIPT_DIR")")"
. "$APP_ROOT_DIR/config.sh"
CHANNEL="release" CHANNEL="release"
BRANCH="master" BRANCH="master"
@ -13,11 +14,13 @@ cd "$SCRIPT_DIR"
hash=`./get_repo_branch_hash $BRANCH` hash=`./get_repo_branch_hash $BRANCH`
source_dir=`./get_commit_files $hash` source_dir=`./get_commit_files $hash`
build_dir=`mktemp -d`
function cleanup { function cleanup {
rm -rf $source_dir rm -rf "$source_dir"
rm -rf "$build_dir"
} }
trap cleanup EXIT trap cleanup EXIT
"$ZOTERO_BUILD_DIR/xpi/build_xpi" -s "$source_dir" -c $CHANNEL -m $hash ./prepare_build -s "$source_dir" -o "$build_dir" -c $CHANNEL -m $hash
./build_and_deploy -d "$ZOTERO_BUILD_DIR/xpi/build/staging" -p $BUILD_PLATFORMS -c $CHANNEL ./build_and_deploy -d "$build_dir" -p $BUILD_PLATFORMS -c $CHANNEL

View file

@ -54,9 +54,9 @@ fi
"$SCRIPT_DIR"/check_requirements "$SCRIPT_DIR"/check_requirements
VERSION="`perl -ne 'print and last if s/.*<em:version>(.*)<\/em:version>.*/\1/;' \"$SOURCE_DIR\"/install.rdf`" VERSION="`cat \"$SOURCE_DIR\"/version`"
if [ -z "$VERSION" ]; then if [ -z "$VERSION" ]; then
echo "Error getting version from $SOURCE_DIR/install.rdf" echo "Error getting version from $SOURCE_DIR/version"
exit 1 exit 1
fi fi

View file

@ -1,21 +1,8 @@
#!/bin/bash -e #!/bin/bash -e
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="$(dirname "$SCRIPT_DIR")" APP_ROOT_DIR="$(dirname "$SCRIPT_DIR")"
ROOT_DIR="$(dirname $APP_ROOT_DIR)"
# Set ZOTERO_REPOS_DIR to use directory other than $HOME for zotero-client and zotero-standalone-build
if [ -n "${ZOTERO_REPOS_DIR:-}" ]; then
repos_dir=$ZOTERO_REPOS_DIR
else
repos_dir=$HOME
fi
for dir in zotero-client zotero-standalone-build; do
if [ ! -d "$repos_dir/$dir" ]; then
echo "$repos_dir/$dir not found" >&2
exit 1
fi
done
# Set ZOTERO_PROFILE environment variable to choose profile # Set ZOTERO_PROFILE environment variable to choose profile
if [ -n "${ZOTERO_PROFILE:-}" ]; then if [ -n "${ZOTERO_PROFILE:-}" ]; then
@ -57,16 +44,16 @@ if [ $REBUILD -eq 1 ]; then
if ! ps u | grep scripts/build.js | grep -v grep > /dev/null; then if ! ps u | grep scripts/build.js | grep -v grep > /dev/null; then
echo "Running JS build process" echo "Running JS build process"
echo echo
cd $repos_dir/zotero-client cd $ROOT_DIR
npm run build npm run build
echo echo
fi fi
$repos_dir/zotero-standalone-build/scripts/dir_build -q $PARAMS "$SCRIPT_DIR/dir_build" -q $PARAMS
if [ "`uname`" = "Darwin" ]; then if [ "`uname`" = "Darwin" ]; then
# Sign the Word dylib so it works on Apple Silicon # Sign the Word dylib so it works on Apple Silicon
$SCRIPT_DIR/codesign_local $repos_dir/zotero-standalone-build/staging/Zotero.app "$SCRIPT_DIR/codesign_local" "$APP_ROOT_DIR/staging/Zotero.app"
fi fi
fi fi
@ -89,4 +76,4 @@ else
exit 1 exit 1
fi fi
$repos_dir/zotero-standalone-build/staging/$command $profile -ZoteroDebugText -jsconsole -purgecaches $PARAMS "$@" "$APP_ROOT_DIR/staging/$command" $profile -ZoteroDebugText -jsconsole -purgecaches $PARAMS "$@"

View file

@ -2,8 +2,9 @@
set -euo pipefail set -euo pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="$(dirname "$SCRIPT_DIR")" APP_ROOT_DIR="$(dirname "$SCRIPT_DIR")"
. "$ROOT_DIR/config.sh" ROOT_DIR="$(dirname "$(dirname "$SCRIPT_DIR")")"
. "$APP_ROOT_DIR/config.sh"
function usage { function usage {
cat >&2 <<DONE cat >&2 <<DONE
@ -60,23 +61,23 @@ fi
CHANNEL="source" CHANNEL="source"
VERSION=`perl -ne 'print and last if s/.*<em:version>(.{3}).+/\1/;' "$ZOTERO_SOURCE_DIR/install.rdf"` PARAMS=""
if [ $VERSION = "4.0" ]; then if [ $DEVTOOLS -eq 1 ]; then
"$ZOTERO_BUILD_DIR/xpi/build_xpi_4.0" "$ZOTERO_SOURCE_DIR" $CHANNEL PARAMS+=" -t"
"$ROOT_DIR/build.sh" -f "$ZOTERO_BUILD_DIR/xpi/build/zotero-build.xpi" -p $PLATFORM -c $CHANNEL -s fi
else if [ $quick_build -eq 1 ]; then
PARAMS="" PARAMS+=" -q"
if [ $DEVTOOLS -eq 1 ]; then
PARAMS+=" -t"
fi
if [ $quick_build -eq 1 ]; then
PARAMS+=" -q"
fi
hash=`git -C "$ZOTERO_SOURCE_DIR" rev-parse --short HEAD`
"$ZOTERO_BUILD_DIR/xpi/build_xpi" -s "$ZOTERO_SOURCE_DIR/build" -c $CHANNEL -m $hash
"$ROOT_DIR/build.sh" -d "$ZOTERO_BUILD_DIR/xpi/build/staging" -p $PLATFORM -c $CHANNEL -s $PARAMS
fi fi
hash=`git -C "$ROOT_DIR" rev-parse --short HEAD`
build_dir=`mktemp -d`
function cleanup {
rm -rf $build_dir
}
trap cleanup EXIT
"$SCRIPT_DIR/prepare_build" -s "$ROOT_DIR/build" -o "$build_dir" -c $CHANNEL -m $hash
"$APP_ROOT_DIR/build.sh" -d "$build_dir" -p $PLATFORM -c $CHANNEL -s $PARAMS
echo Done echo Done

View file

@ -9,7 +9,6 @@ import re
import fileinput import fileinput
from collections import OrderedDict from collections import OrderedDict
import json import json
import hashlib
import traceback import traceback
# Hack to combine two argparse formatters # Hack to combine two argparse formatters
@ -17,101 +16,59 @@ class CustomFormatter(argparse.ArgumentDefaultsHelpFormatter, argparse.RawDescri
pass pass
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description='Build a Zotero XPI', description='Prepare build/ files for the app build process',
formatter_class=CustomFormatter, formatter_class=CustomFormatter)
epilog='''
Example: build_xpi -s ~/zotero-client/build -x 5.0.1 -z
- Builds zotero-build.xpi and update-build.rdf
- Points update-build.rdf to https://download.zotero.org/extension/zotero-5.0.1.xpi
- Points install.rdf to https://www.zotero.org/download/update.rdf
Example: build_xpi -s ~/zotero-client/build -c beta -m 7c27a9bb5 -x 5.0b2 -r beta -z parser.add_argument('--source-dir', '-s', required=True, metavar='BUILD_DIR', help='Directory to build from')
- Builds zotero-build.xpi and update-build.rdf parser.add_argument('--output-dir', '-o', required=True, metavar='OUTPUT_DIR', help='Directory to write files to')
- Points update-build.rdf to https://download.zotero.org/extension/zotero-5.0b2.xpi
- Points install.rdf to https://www.zotero.org/download/update-beta.rdf
Example: build_xpi -s ~/zotero-client/build -c alpha -m 7c27a9bb5 -x 5.0-alpha -r 5.0-branch --xpi-dir dev -z
- Builds zotero-build.xpi and update-build.rdf
- Points update-build.rdf to https://download.zotero.org/extension/dev/zotero-5.0-alpha.xpi
- Points install.rdf to https://zotero.org/download/dev/update-5.0-branch.rdf''')
parser.add_argument('--source-dir', '-s', required=True, metavar='DIR', help='Directory to build from')
parser.add_argument('-c', '--channel', default='source', help='channel to add to dev build version number (e.g., "beta" for "5.0-beta.3+a5f28ca8"), or "release" or "source" to skip') parser.add_argument('-c', '--channel', default='source', help='channel to add to dev build version number (e.g., "beta" for "5.0-beta.3+a5f28ca8"), or "release" or "source" to skip')
parser.add_argument('--commit-hash', '-m', metavar='HASH', help='Commit hash (required for non-release builds)') parser.add_argument('--commit-hash', '-m', metavar='HASH', help='Commit hash (required for non-release builds)')
parser.add_argument('--build-suffix', metavar='SUFFIX', default='build', help='suffix of output XPI')
parser.add_argument('--xpi-suffix', '-x', metavar='SUFFIX', default='', help='suffix of XPI to reference in update.rdf')
parser.add_argument('--rdf-suffix', '-r', metavar='SUFFIX', default='', help='suffix of update.rdf file to reference in install.rdf (e.g., "beta" for "update-beta.rdf")')
parser.add_argument('--xpi-dir', metavar='DIR', default='', help='extra directory to point to when referencing the XPI in update.rdf')
parser.add_argument('--zip', '-z', action='store_true', help="Create XPI instead of leaving files in build/staging")
args = parser.parse_args() args = parser.parse_args()
def main(): def main():
try: try:
if args.xpi_suffix: app_root_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
args.xpi_suffix = "-" + args.xpi_suffix
if args.rdf_suffix:
args.rdf_suffix = "-" + args.rdf_suffix
if args.build_suffix:
args.build_suffix = "-" + args.build_suffix
root_dir = os.path.dirname(os.path.realpath(__file__)) lastrev_dir = os.path.join(app_root_dir, 'lastrev')
if not os.path.exists(lastrev_dir):
# Use BUILD_DIR environmental variable if present, and otherwise ./build os.mkdir(lastrev_dir)
build_dir = os.environ.get('BUILD_DIR', os.path.join(root_dir, 'build')) tmp_dir = os.path.join(app_root_dir, 'tmp')
tmp_dir = os.path.join(build_dir, 'tmp')
if not os.path.isdir(build_dir):
raise Exception(build_dir + " is not a directory")
src_dir = args.source_dir
if not os.path.isdir(src_dir):
raise Exception(src_dir + " is not a directory")
if args.commit_hash: if args.commit_hash:
commit_hash = args.commit_hash[0:9] commit_hash = args.commit_hash[0:9]
elif args.channel != "release": elif args.channel != "release":
raise Exception("--commit-hash must be specified for non-release builds") raise Exception("--commit-hash must be specified for non-release builds")
src_dir = args.source_dir
if not os.path.isdir(src_dir):
raise Exception(src_dir + " is not a directory")
output_dir = args.output_dir
if not os.path.isdir(output_dir):
raise Exception(output_dir + " is not a directory")
if os.listdir(output_dir):
raise Exception(output_dir + " is not empty")
log("Using source directory of " + src_dir) log("Using source directory of " + src_dir)
os.chdir(src_dir) os.chdir(src_dir)
if not os.path.exists('install.rdf'): if not os.path.exists('version'):
raise FileNotFoundError("install.rdf not found in {0}".format(src_dir)) raise FileNotFoundError("version file not found in {0}".format(src_dir))
# Extract version number from install.rdf # Extract version number from version file
with open('install.rdf') as f: with open('version') as f:
rdf = f.read() rdf = f.read()
m = re.search('version>([0-9].+)\\.SOURCE</', rdf) m = re.search('([0-9].+)\\.SOURCE', rdf)
if not m: if not m:
raise Exception("Version number not found in install.rdf") raise Exception("Version number not found in version file")
version = m.group(1) version = m.group(1)
# Determine build targets
target_xpi_file = os.path.join(
build_dir, 'zotero' + args.build_suffix + '.xpi'
)
target_update_file = os.path.join(
build_dir, 'update' + args.build_suffix + '.rdf'
)
staging_dir = os.path.join(build_dir, 'staging')
# Delete any existing build targets
try:
os.remove(target_xpi_file)
except OSError:
pass
try:
os.remove(target_update_file)
except OSError:
pass
if os.path.exists(staging_dir):
shutil.rmtree(staging_dir)
# Remove tmp build directory if it already exists # Remove tmp build directory if it already exists
if os.path.exists(tmp_dir): if os.path.exists(tmp_dir):
shutil.rmtree(tmp_dir) shutil.rmtree(tmp_dir)
os.mkdir(tmp_dir) os.mkdir(tmp_dir)
tmp_src_dir = os.path.join(tmp_dir, 'zotero') tmp_src_dir = os.path.join(tmp_dir, 'zotero')
# Export a clean copy of the source tree # Export a clean copy of the source tree
@ -175,25 +132,21 @@ def main():
with open(os.path.join(tmp_src_dir, 'translators.json'), 'w', encoding='utf-8') as f: with open(os.path.join(tmp_src_dir, 'translators.json'), 'w', encoding='utf-8') as f:
json.dump(index, f, indent=True, ensure_ascii=False) json.dump(index, f, indent=True, ensure_ascii=False)
install_file = os.path.join(tmp_src_dir, 'install.rdf') version_file = os.path.join(tmp_src_dir, 'version')
update_file = os.path.join(tmp_src_dir, 'update.rdf')
log('')
log_line() log_line()
log('Original install.rdf:') log('Original version:\n')
dump_file(install_file) dump_file(version_file)
if args.zip:
log('Original update.rdf:\n')
dump_file(update_file)
log_line()
# Modify install.rdf and update.rdf as necessary # Modify version as necessary
# The dev build revision number is stored in build/lastrev-{version}-{channel}. # The dev build revision number is stored in build/lastrev-{version}-{channel}.
# #
# If we're including it, get the current version number and increment it. # If we're including it, get the current version number and increment it.
if args.channel not in ["release", "source"]: if args.channel not in ["release", "source"]:
lastrev_file = os.path.join( lastrev_file = os.path.join(
build_dir, 'lastrev-{0}-{1}'.format(version, args.channel) lastrev_dir, 'lastrev-{0}-{1}'.format(version, args.channel)
) )
if not os.path.exists(lastrev_file): if not os.path.exists(lastrev_file):
with open(lastrev_file, 'w') as f: with open(lastrev_file, 'w') as f:
@ -210,68 +163,19 @@ def main():
rev_sub_str = ".SOURCE.{0}".format(commit_hash) rev_sub_str = ".SOURCE.{0}".format(commit_hash)
else: else:
rev_sub_str = "-{0}.{1}+{2}".format(args.channel, str(rev), commit_hash) rev_sub_str = "-{0}.{1}+{2}".format(args.channel, str(rev), commit_hash)
if args.xpi_dir: # Update version
xpi_dir = args.xpi_dir + '/' for line in fileinput.FileInput(version_file, inplace=1):
else:
xpi_dir = ''
# Update install.rdf and update.rdf
for line in fileinput.FileInput(install_file, inplace=1):
line = line.replace('.SOURCE', rev_sub_str) line = line.replace('.SOURCE', rev_sub_str)
line = line.replace(
'update-source.rdf',
xpi_dir + 'update' + args.rdf_suffix + '.rdf'
)
print(line, file=sys.stdout, end='')
for line in fileinput.FileInput(update_file, inplace=1):
line = line.replace(".SOURCE", rev_sub_str)
line = line.replace(
'zotero.xpi',
xpi_dir + 'zotero' + args.xpi_suffix + '.xpi'
)
print(line, file=sys.stdout, end='') print(line, file=sys.stdout, end='')
log('Modified version:\n')
dump_file(version_file)
log('')
log_line() log_line()
log('Modified install.rdf:\n')
dump_file(install_file)
# Create XPI # Move source files to output directory
if args.zip: os.rmdir(output_dir)
# Move update.rdf out of code root shutil.move(tmp_src_dir, output_dir)
shutil.move(update_file, tmp_dir)
tmp_update_file = os.path.join(tmp_dir, 'update.rdf')
os.chdir(tmp_src_dir)
tmp_xpi_file = os.path.join(tmp_dir, 'zotero' + args.build_suffix + '.xpi')
subprocess.check_call(['zip', '-r', tmp_xpi_file, '.'])
# Add SHA1 of XPI to update.rdf
sha1 = sha1file(tmp_xpi_file)
for line in fileinput.FileInput(tmp_update_file, inplace=1):
line = line.replace("sha1:", "sha1:" + sha1)
print(line, file=sys.stdout, end='')
log('Modified update.rdf:\n')
dump_file(tmp_update_file)
log_line()
# Move files to build directory
os.rename(tmp_xpi_file, target_xpi_file)
os.rename(tmp_update_file, target_update_file)
log("")
log("zotero{0}.xpi and update{0}.rdf saved to {1}".format(args.build_suffix, build_dir))
log("")
# Leave unzipped in staging directory
else:
# Don't create update.rdf
os.remove(update_file)
# Move source files to staging
shutil.move(tmp_src_dir, staging_dir)
log("")
log("Build files saved to {0}".format(staging_dir))
log("")
# Update lastrev file with new revision number # Update lastrev file with new revision number
if args.channel not in ["release", "source"]: if args.channel not in ["release", "source"]:
@ -286,8 +190,8 @@ def main():
# Clean up # Clean up
finally: finally:
if os.path.exists(tmp_dir): if os.path.exists(tmp_src_dir):
shutil.rmtree(tmp_dir) shutil.rmtree(tmp_src_dir)
def dump_file(f): def dump_file(f):
@ -302,12 +206,5 @@ def log(msg):
def log_line(): def log_line():
log('======================================================\n\n') log('======================================================\n\n')
def sha1file(f):
sha1 = hashlib.sha1()
with open(f, 'rb') as f:
sha1.update(f.read())
return sha1.hexdigest()
if __name__ == '__main__': if __name__ == '__main__':
sys.exit(main()) sys.exit(main())

View file

@ -1,23 +0,0 @@
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>zotero@chnm.gmu.edu</em:id>
<em:name>Zotero</em:name>
<em:version>7.0.0.SOURCE</em:version>
<em:multiprocessCompatible>false</em:multiprocessCompatible>
<em:type>2</em:type> <!-- type=extension -->
<!-- Firefox -->
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>45.0</em:minVersion>
<em:maxVersion>45.*</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>

View file

@ -26,7 +26,6 @@ const copyDirs = [
// list of files from root folder to symlink // list of files from root folder to symlink
const symlinkFiles = [ const symlinkFiles = [
'chrome.manifest', 'chrome.manifest',
'install.rdf',
// React needs to be patched by babel-worker.js, so symlink all files in resource/ except for // React needs to be patched by babel-worker.js, so symlink all files in resource/ except for
// those. Babel transpilation for React is still disabled in .babelrc. // those. Babel transpilation for React is still disabled in .babelrc.
'resource/**/*', 'resource/**/*',
@ -52,7 +51,6 @@ const symlinkFiles = [
'resource/ace/worker-javascript.js', 'resource/ace/worker-javascript.js',
// Feed *.idl files are for documentation only // Feed *.idl files are for documentation only
'!resource/feeds/*.idl', '!resource/feeds/*.idl',
'update.rdf',
'!chrome/skin/default/zotero/**/*.scss', '!chrome/skin/default/zotero/**/*.scss',
'!resource/citeproc_rs_wasm.js', '!resource/citeproc_rs_wasm.js',
// We only need a few Monaco languages // We only need a few Monaco languages
@ -65,6 +63,7 @@ const symlinkFiles = [
'resource/vs/basic-languages/xml/*.js', 'resource/vs/basic-languages/xml/*.js',
'resource/vs/language/typescript/*.js', 'resource/vs/language/typescript/*.js',
'resource/vs/language/json/*.js', 'resource/vs/language/json/*.js',
'version',
]; ];

1
version Normal file
View file

@ -0,0 +1 @@
7.0.0.SOURCE