mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-13 02:14:17 +01:00
rename "webext" target to more accurate "firefox"
This commit is contained in:
parent
c9b14e201a
commit
0bf2f27d87
2 changed files with 21 additions and 21 deletions
|
@ -15,10 +15,10 @@ version = ''
|
||||||
with open(os.path.join(proj_dir, 'dist', 'version')) as f:
|
with open(os.path.join(proj_dir, 'dist', 'version')) as f:
|
||||||
version = f.read().strip()
|
version = f.read().strip()
|
||||||
|
|
||||||
webext_manifest = {}
|
firefox_manifest = {}
|
||||||
webext_manifest_file = os.path.join(build_dir, 'manifest.json')
|
firefox_manifest_file = os.path.join(build_dir, 'manifest.json')
|
||||||
with open(webext_manifest_file) as f2:
|
with open(firefox_manifest_file) as f2:
|
||||||
webext_manifest = json.load(f2)
|
firefox_manifest = json.load(f2)
|
||||||
|
|
||||||
match = re.search('^(\d+\.\d+\.\d+)(\.\d+)$', version)
|
match = re.search('^(\d+\.\d+\.\d+)(\.\d+)$', version)
|
||||||
if match:
|
if match:
|
||||||
|
@ -27,10 +27,10 @@ if match:
|
||||||
builttype = 'b' + str(buildtype)
|
builttype = 'b' + str(buildtype)
|
||||||
else:
|
else:
|
||||||
builttype = 'rc' + str(buildtype - 100)
|
builttype = 'rc' + str(buildtype - 100)
|
||||||
webext_manifest['version'] = match.group(1) + builttype
|
firefox_manifest['version'] = match.group(1) + builttype
|
||||||
else:
|
else:
|
||||||
webext_manifest['version'] = version
|
firefox_manifest['version'] = version
|
||||||
|
|
||||||
with open(webext_manifest_file, 'w') as f2:
|
with open(firefox_manifest_file, 'w') as f2:
|
||||||
json.dump(webext_manifest, f2, indent=2, separators=(',', ': '), sort_keys=True)
|
json.dump(firefox_manifest, f2, indent=2, separators=(',', ': '), sort_keys=True)
|
||||||
f2.write('\n')
|
f2.write('\n')
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
#
|
#
|
||||||
# This script assumes a linux environment
|
# This script assumes a linux environment
|
||||||
|
|
||||||
echo "*** uBlock0.webext: Creating web store package"
|
echo "*** uBlock0.firefox: Creating web store package"
|
||||||
echo "*** uBlock0.webext: Copying files"
|
echo "*** uBlock0.firefox: Copying files"
|
||||||
|
|
||||||
DES=dist/build/uBlock0.webext
|
DES=dist/build/uBlock0.firefox
|
||||||
rm -rf $DES
|
rm -rf $DES
|
||||||
mkdir -p $DES
|
mkdir -p $DES
|
||||||
|
|
||||||
|
@ -24,11 +24,11 @@ cp platform/chromium/*.html $DES/
|
||||||
cp platform/chromium/*.json $DES/
|
cp platform/chromium/*.json $DES/
|
||||||
cp LICENSE.txt $DES/
|
cp LICENSE.txt $DES/
|
||||||
|
|
||||||
cp platform/webext/manifest.json $DES/
|
cp platform/firefox/manifest.json $DES/
|
||||||
cp platform/webext/vapi-usercss.js $DES/js/
|
cp platform/firefox/vapi-usercss.js $DES/js/
|
||||||
cp platform/webext/vapi-webrequest.js $DES/js/
|
cp platform/firefox/vapi-webrequest.js $DES/js/
|
||||||
|
|
||||||
echo "*** uBlock0.webext: concatenating content scripts"
|
echo "*** uBlock0.firefox: concatenating content scripts"
|
||||||
cat $DES/js/vapi-usercss.js > /tmp/contentscript.js
|
cat $DES/js/vapi-usercss.js > /tmp/contentscript.js
|
||||||
echo >> /tmp/contentscript.js
|
echo >> /tmp/contentscript.js
|
||||||
grep -v "^'use strict';$" $DES/js/vapi-usercss.real.js >> /tmp/contentscript.js
|
grep -v "^'use strict';$" $DES/js/vapi-usercss.real.js >> /tmp/contentscript.js
|
||||||
|
@ -39,23 +39,23 @@ rm $DES/js/vapi-usercss.js
|
||||||
rm $DES/js/vapi-usercss.real.js
|
rm $DES/js/vapi-usercss.real.js
|
||||||
rm $DES/js/vapi-usercss.pseudo.js
|
rm $DES/js/vapi-usercss.pseudo.js
|
||||||
|
|
||||||
# Webext-specific
|
# Firefox/webext-specific
|
||||||
rm $DES/img/icon_128.png
|
rm $DES/img/icon_128.png
|
||||||
rm $DES/options_ui.html
|
rm $DES/options_ui.html
|
||||||
rm $DES/js/options_ui.js
|
rm $DES/js/options_ui.js
|
||||||
|
|
||||||
echo "*** uBlock0.chromium: Generating web accessible resources..."
|
echo "*** uBlock0.firefox: Generating web accessible resources..."
|
||||||
cp -R src/web_accessible_resources $DES/
|
cp -R src/web_accessible_resources $DES/
|
||||||
python3 tools/import-war.py $DES/
|
python3 tools/import-war.py $DES/
|
||||||
|
|
||||||
echo "*** uBlock0.webext: Generating meta..."
|
echo "*** uBlock0.firefox: Generating meta..."
|
||||||
python tools/make-webext-meta.py $DES/
|
python tools/make-firefox-meta.py $DES/
|
||||||
|
|
||||||
if [ "$1" = all ]; then
|
if [ "$1" = all ]; then
|
||||||
echo "*** uBlock0.webext: Creating package..."
|
echo "*** uBlock0.firefox: Creating package..."
|
||||||
pushd $DES > /dev/null
|
pushd $DES > /dev/null
|
||||||
zip ../$(basename $DES).xpi -qr *
|
zip ../$(basename $DES).xpi -qr *
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "*** uBlock0.webext: Package done."
|
echo "*** uBlock0.firefox: Package done."
|
||||||
|
|
Loading…
Reference in a new issue