mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #14737 - UK992:package-prefs, r=Wafflespeanut
Package: Various improvements Fixes https://github.com/servo/servo/issues/11966 Fixes https://github.com/servo/servo/issues/12707 Also adds simple mechanism to set os specific prefs, by adding like `os:macosx,os:windows;` before pref name. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14737) <!-- Reviewable:end -->
This commit is contained in:
commit
b5f3d7dd41
9 changed files with 73 additions and 128 deletions
|
@ -3,7 +3,7 @@
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>run-servo</string>
|
<string>servo</string>
|
||||||
<key>CFBundleGetInfoString</key>
|
<key>CFBundleGetInfoString</key>
|
||||||
<string>Servo</string>
|
<string>Servo</string>
|
||||||
<key>CFBundleIconFile</key>
|
<key>CFBundleIconFile</key>
|
||||||
|
|
|
@ -13,6 +13,7 @@ import sys
|
||||||
import os.path as path
|
import os.path as path
|
||||||
sys.path.append(path.join(path.dirname(sys.argv[0]), "components", "style", "properties", "Mako-0.9.1.zip"))
|
sys.path.append(path.join(path.dirname(sys.argv[0]), "components", "style", "properties", "Mako-0.9.1.zip"))
|
||||||
|
|
||||||
|
import json
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
|
@ -78,7 +79,6 @@ def change_non_system_libraries_path(libraries, relative_path, binary):
|
||||||
|
|
||||||
|
|
||||||
def copy_dependencies(binary_path, lib_path):
|
def copy_dependencies(binary_path, lib_path):
|
||||||
|
|
||||||
relative_path = path.relpath(lib_path, path.dirname(binary_path)) + "/"
|
relative_path = path.relpath(lib_path, path.dirname(binary_path)) + "/"
|
||||||
|
|
||||||
# Update binary libraries
|
# Update binary libraries
|
||||||
|
@ -105,6 +105,31 @@ def copy_dependencies(binary_path, lib_path):
|
||||||
need_checked.difference_update(checked)
|
need_checked.difference_update(checked)
|
||||||
|
|
||||||
|
|
||||||
|
def change_prefs(resources_path, platform):
|
||||||
|
print("Swapping prefs")
|
||||||
|
prefs_path = path.join(resources_path, "prefs.json")
|
||||||
|
package_prefs_path = path.join(resources_path, "package-prefs.json")
|
||||||
|
os_type = "os:{}".format(platform)
|
||||||
|
with open(prefs_path) as prefs, open(package_prefs_path) as package_prefs:
|
||||||
|
prefs = json.load(prefs)
|
||||||
|
package_prefs = json.load(package_prefs)
|
||||||
|
for pref in package_prefs:
|
||||||
|
if os_type in pref:
|
||||||
|
prefs[pref.split(";")[1]] = package_prefs[pref]
|
||||||
|
if pref in prefs:
|
||||||
|
prefs[pref] = package_prefs[pref]
|
||||||
|
with open(prefs_path, "w") as out:
|
||||||
|
json.dump(prefs, out, sort_keys=True, indent=2)
|
||||||
|
delete(package_prefs_path)
|
||||||
|
|
||||||
|
|
||||||
|
def get_browserhtml_path(binary_path):
|
||||||
|
browserhtml_path = find_dep_path_newest('browserhtml', binary_path)
|
||||||
|
if browserhtml_path:
|
||||||
|
return path.join(browserhtml_path, "out")
|
||||||
|
sys.exit("Could not find browserhtml package; perhaps you haven't built Servo.")
|
||||||
|
|
||||||
|
|
||||||
@CommandProvider
|
@CommandProvider
|
||||||
class PackageCommands(CommandBase):
|
class PackageCommands(CommandBase):
|
||||||
@Command('package',
|
@Command('package',
|
||||||
|
@ -123,6 +148,8 @@ class PackageCommands(CommandBase):
|
||||||
if android is None:
|
if android is None:
|
||||||
android = self.config["build"]["android"]
|
android = self.config["build"]["android"]
|
||||||
binary_path = self.get_binary_path(release, dev, android=android)
|
binary_path = self.get_binary_path(release, dev, android=android)
|
||||||
|
dir_to_root = self.get_top_dir()
|
||||||
|
target_dir = path.dirname(binary_path)
|
||||||
if android:
|
if android:
|
||||||
if dev:
|
if dev:
|
||||||
env["NDK_DEBUG"] = "1"
|
env["NDK_DEBUG"] = "1"
|
||||||
|
@ -132,56 +159,50 @@ class PackageCommands(CommandBase):
|
||||||
env["ANT_FLAVOR"] = "release"
|
env["ANT_FLAVOR"] = "release"
|
||||||
dev_flag = ""
|
dev_flag = ""
|
||||||
|
|
||||||
target_dir = path.dirname(binary_path)
|
|
||||||
output_apk = "{}.apk".format(binary_path)
|
output_apk = "{}.apk".format(binary_path)
|
||||||
|
|
||||||
|
dir_to_apk = path.join(target_dir, "apk")
|
||||||
|
if path.exists(dir_to_apk):
|
||||||
|
print("Cleaning up from previous packaging")
|
||||||
|
delete(dir_to_apk)
|
||||||
|
shutil.copytree(path.join(dir_to_root, "support", "android", "apk"), dir_to_apk)
|
||||||
|
|
||||||
blurdroid_path = find_dep_path_newest('blurdroid', binary_path)
|
blurdroid_path = find_dep_path_newest('blurdroid', binary_path)
|
||||||
if blurdroid_path is None:
|
if blurdroid_path is None:
|
||||||
print("Could not find blurdroid package; perhaps you haven't built Servo.")
|
print("Could not find blurdroid package; perhaps you haven't built Servo.")
|
||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
dir_to_libs = path.join("support", "android", "apk", "libs")
|
dir_to_libs = path.join(dir_to_apk, "libs")
|
||||||
if not path.exists(dir_to_libs):
|
if not path.exists(dir_to_libs):
|
||||||
os.makedirs(dir_to_libs)
|
os.makedirs(dir_to_libs)
|
||||||
shutil.copy2(blurdroid_path + '/out/blurdroid.jar', dir_to_libs)
|
shutil.copy2(blurdroid_path + '/out/blurdroid.jar', dir_to_libs)
|
||||||
try:
|
try:
|
||||||
with cd(path.join("support", "android", "build-apk")):
|
with cd(path.join("support", "android", "build-apk")):
|
||||||
subprocess.check_call(["cargo", "run", "--", dev_flag, "-o", output_apk, "-t", target_dir,
|
subprocess.check_call(["cargo", "run", "--", dev_flag, "-o", output_apk, "-t", target_dir,
|
||||||
"-r", self.get_top_dir()], env=env)
|
"-r", dir_to_root], env=env)
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
print("Packaging Android exited with return value %d" % e.returncode)
|
print("Packaging Android exited with return value %d" % e.returncode)
|
||||||
return e.returncode
|
return e.returncode
|
||||||
elif is_macosx():
|
elif is_macosx():
|
||||||
|
|
||||||
dir_to_build = path.dirname(binary_path)
|
|
||||||
dir_to_root = self.get_top_dir()
|
|
||||||
|
|
||||||
print("Creating Servo.app")
|
print("Creating Servo.app")
|
||||||
dir_to_dmg = path.join(dir_to_build, 'dmg')
|
dir_to_dmg = path.join(target_dir, 'dmg')
|
||||||
dir_to_app = path.join(dir_to_dmg, 'Servo.app')
|
dir_to_app = path.join(dir_to_dmg, 'Servo.app')
|
||||||
dir_to_resources = path.join(dir_to_app, 'Contents', 'Resources')
|
dir_to_resources = path.join(dir_to_app, 'Contents', 'Resources')
|
||||||
if path.exists(dir_to_dmg):
|
if path.exists(dir_to_dmg):
|
||||||
print("Cleaning up from previous packaging")
|
print("Cleaning up from previous packaging")
|
||||||
delete(dir_to_dmg)
|
delete(dir_to_dmg)
|
||||||
browserhtml_path = find_dep_path_newest('browserhtml', binary_path)
|
browserhtml_path = get_browserhtml_path(binary_path)
|
||||||
if browserhtml_path is None:
|
|
||||||
print("Could not find browserhtml package; perhaps you haven't built Servo.")
|
|
||||||
return 1
|
|
||||||
|
|
||||||
print("Copying files")
|
print("Copying files")
|
||||||
shutil.copytree(path.join(dir_to_root, 'resources'), dir_to_resources)
|
shutil.copytree(path.join(dir_to_root, 'resources'), dir_to_resources)
|
||||||
shutil.copytree(browserhtml_path, path.join(dir_to_resources, path.basename(browserhtml_path)))
|
shutil.copytree(browserhtml_path, path.join(dir_to_resources, 'browserhtml'))
|
||||||
shutil.copy2(path.join(dir_to_root, 'Info.plist'), path.join(dir_to_app, 'Contents', 'Info.plist'))
|
shutil.copy2(path.join(dir_to_root, 'Info.plist'), path.join(dir_to_app, 'Contents', 'Info.plist'))
|
||||||
|
|
||||||
content_dir = path.join(dir_to_app, 'Contents', 'MacOS')
|
content_dir = path.join(dir_to_app, 'Contents', 'MacOS')
|
||||||
os.makedirs(content_dir)
|
os.makedirs(content_dir)
|
||||||
shutil.copy2(binary_path, content_dir)
|
shutil.copy2(binary_path, content_dir)
|
||||||
|
|
||||||
print("Swapping prefs")
|
change_prefs(dir_to_resources, "macosx")
|
||||||
package_prefs_path = path.join(dir_to_resources, 'package-prefs.json')
|
|
||||||
prefs_path = path.join(dir_to_resources, 'prefs.json')
|
|
||||||
delete(prefs_path)
|
|
||||||
shutil.copy2(package_prefs_path, prefs_path)
|
|
||||||
delete(package_prefs_path)
|
|
||||||
|
|
||||||
print("Finding dylibs and relinking")
|
print("Finding dylibs and relinking")
|
||||||
copy_dependencies(path.join(content_dir, 'servo'), content_dir)
|
copy_dependencies(path.join(content_dir, 'servo'), content_dir)
|
||||||
|
@ -205,19 +226,9 @@ class PackageCommands(CommandBase):
|
||||||
credits_file.write(template.render(version=version))
|
credits_file.write(template.render(version=version))
|
||||||
delete(template_path)
|
delete(template_path)
|
||||||
|
|
||||||
print("Writing run-servo")
|
|
||||||
bhtml_path = path.join('${0%/*}', '..', 'Resources', path.basename(browserhtml_path), 'out', 'index.html')
|
|
||||||
runservo = os.open(
|
|
||||||
path.join(content_dir, 'run-servo'),
|
|
||||||
os.O_WRONLY | os.O_CREAT,
|
|
||||||
int("0755", 8)
|
|
||||||
)
|
|
||||||
os.write(runservo, '#!/bin/bash\nexec ${0%/*}/servo ' + bhtml_path)
|
|
||||||
os.close(runservo)
|
|
||||||
|
|
||||||
print("Creating dmg")
|
print("Creating dmg")
|
||||||
os.symlink('/Applications', path.join(dir_to_dmg, 'Applications'))
|
os.symlink('/Applications', path.join(dir_to_dmg, 'Applications'))
|
||||||
dmg_path = path.join(dir_to_build, "servo-tech-demo.dmg")
|
dmg_path = path.join(target_dir, "servo-tech-demo.dmg")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
subprocess.check_call(['hdiutil', 'create', '-volname', 'Servo', dmg_path, '-srcfolder', dir_to_dmg])
|
subprocess.check_call(['hdiutil', 'create', '-volname', 'Servo', dmg_path, '-srcfolder', dir_to_dmg])
|
||||||
|
@ -229,8 +240,8 @@ class PackageCommands(CommandBase):
|
||||||
print("Packaged Servo into " + dmg_path)
|
print("Packaged Servo into " + dmg_path)
|
||||||
|
|
||||||
print("Creating brew package")
|
print("Creating brew package")
|
||||||
dir_to_brew = path.join(dir_to_build, 'brew_tmp')
|
dir_to_brew = path.join(target_dir, 'brew_tmp')
|
||||||
dir_to_tar = path.join(dir_to_build, 'brew')
|
dir_to_tar = path.join(target_dir, 'brew')
|
||||||
if not path.exists(dir_to_tar):
|
if not path.exists(dir_to_tar):
|
||||||
os.makedirs(dir_to_tar)
|
os.makedirs(dir_to_tar)
|
||||||
tar_path = path.join(dir_to_tar, "servo.tar.gz")
|
tar_path = path.join(dir_to_tar, "servo.tar.gz")
|
||||||
|
@ -250,29 +261,29 @@ class PackageCommands(CommandBase):
|
||||||
archive_deterministically(dir_to_brew, tar_path, prepend_path='servo/')
|
archive_deterministically(dir_to_brew, tar_path, prepend_path='servo/')
|
||||||
delete(dir_to_brew)
|
delete(dir_to_brew)
|
||||||
print("Packaged Servo into " + tar_path)
|
print("Packaged Servo into " + tar_path)
|
||||||
|
|
||||||
elif is_windows():
|
elif is_windows():
|
||||||
dir_to_package = path.dirname(binary_path)
|
dir_to_msi = path.join(target_dir, 'msi')
|
||||||
dir_to_root = self.get_top_dir()
|
|
||||||
dir_to_msi = path.join(dir_to_package, 'msi')
|
|
||||||
if path.exists(dir_to_msi):
|
if path.exists(dir_to_msi):
|
||||||
print("Cleaning up from previous packaging")
|
print("Cleaning up from previous packaging")
|
||||||
delete(dir_to_msi)
|
delete(dir_to_msi)
|
||||||
os.makedirs(dir_to_msi)
|
os.makedirs(dir_to_msi)
|
||||||
top_path = dir_to_root
|
browserhtml_path = get_browserhtml_path(binary_path)
|
||||||
browserhtml_path = find_dep_path_newest('browserhtml', binary_path)
|
|
||||||
if browserhtml_path is None:
|
print("Copying files")
|
||||||
print("Could not find browserhtml package; perhaps you haven't built Servo.")
|
dir_to_resources = path.join(dir_to_msi, 'resources')
|
||||||
return 1
|
shutil.copytree(path.join(dir_to_root, 'resources'), dir_to_resources)
|
||||||
browserhtml_path = path.join(browserhtml_path, "out")
|
|
||||||
|
change_prefs(dir_to_resources, "windows")
|
||||||
|
|
||||||
# generate Servo.wxs
|
# generate Servo.wxs
|
||||||
template_path = path.join(dir_to_root, "support", "windows", "Servo.wxs.mako")
|
template_path = path.join(dir_to_root, "support", "windows", "Servo.wxs.mako")
|
||||||
template = Template(open(template_path).read())
|
template = Template(open(template_path).read())
|
||||||
wxs_path = path.join(dir_to_msi, "Servo.wxs")
|
wxs_path = path.join(dir_to_msi, "Servo.wxs")
|
||||||
open(wxs_path, "w").write(template.render(
|
open(wxs_path, "w").write(template.render(
|
||||||
exe_path=dir_to_package,
|
exe_path=target_dir,
|
||||||
top_path=top_path,
|
resources_path=dir_to_resources,
|
||||||
browserhtml_path=browserhtml_path))
|
browserhtml_path=browserhtml_path))
|
||||||
|
|
||||||
# run candle and light
|
# run candle and light
|
||||||
print("Creating MSI")
|
print("Creating MSI")
|
||||||
try:
|
try:
|
||||||
|
@ -291,11 +302,8 @@ class PackageCommands(CommandBase):
|
||||||
msi_path = path.join(dir_to_msi, "Servo.msi")
|
msi_path = path.join(dir_to_msi, "Servo.msi")
|
||||||
print("Packaged Servo into {}".format(msi_path))
|
print("Packaged Servo into {}".format(msi_path))
|
||||||
else:
|
else:
|
||||||
dir_to_temp = path.join(path.dirname(binary_path), 'packaging-temp')
|
dir_to_temp = path.join(target_dir, 'packaging-temp')
|
||||||
browserhtml_path = find_dep_path_newest('browserhtml', binary_path)
|
browserhtml_path = get_browserhtml_path(binary_path)
|
||||||
if browserhtml_path is None:
|
|
||||||
print("Could not find browserhtml package; perhaps you haven't built Servo.")
|
|
||||||
return 1
|
|
||||||
if path.exists(dir_to_temp):
|
if path.exists(dir_to_temp):
|
||||||
# TODO(aneeshusa): lock dir_to_temp to prevent simultaneous builds
|
# TODO(aneeshusa): lock dir_to_temp to prevent simultaneous builds
|
||||||
print("Cleaning up from previous packaging")
|
print("Cleaning up from previous packaging")
|
||||||
|
@ -303,24 +311,14 @@ class PackageCommands(CommandBase):
|
||||||
|
|
||||||
print("Copying files")
|
print("Copying files")
|
||||||
dir_to_resources = path.join(dir_to_temp, 'resources')
|
dir_to_resources = path.join(dir_to_temp, 'resources')
|
||||||
shutil.copytree(path.join(self.get_top_dir(), 'resources'), dir_to_resources)
|
shutil.copytree(path.join(dir_to_root, 'resources'), dir_to_resources)
|
||||||
shutil.copytree(browserhtml_path, path.join(dir_to_temp, 'browserhtml'))
|
shutil.copytree(browserhtml_path, path.join(dir_to_temp, 'browserhtml'))
|
||||||
shutil.copy(binary_path, dir_to_temp)
|
shutil.copy(binary_path, dir_to_temp)
|
||||||
|
|
||||||
print("Writing runservo.sh")
|
change_prefs(dir_to_resources, "linux")
|
||||||
# TODO: deduplicate this arg list from post_build_commands
|
|
||||||
servo_args = ['-b',
|
|
||||||
'--pref', 'dom.mozbrowser.enabled',
|
|
||||||
'--pref', 'dom.forcetouch.enabled',
|
|
||||||
'--pref', 'shell.builtin-key-shortcuts.enabled=false',
|
|
||||||
path.join('./browserhtml', 'out', 'index.html')]
|
|
||||||
|
|
||||||
runservo = os.open(path.join(dir_to_temp, 'runservo.sh'), os.O_WRONLY | os.O_CREAT, int("0755", 8))
|
|
||||||
os.write(runservo, "#!/usr/bin/env sh\n./servo " + ' '.join(servo_args))
|
|
||||||
os.close(runservo)
|
|
||||||
|
|
||||||
print("Creating tarball")
|
print("Creating tarball")
|
||||||
tar_path = path.join(path.dirname(binary_path), 'servo-tech-demo.tar.gz')
|
tar_path = path.join(target_dir, 'servo-tech-demo.tar.gz')
|
||||||
|
|
||||||
archive_deterministically(dir_to_temp, tar_path, prepend_path='servo/')
|
archive_deterministically(dir_to_temp, tar_path, prepend_path='servo/')
|
||||||
|
|
||||||
|
|
|
@ -734,7 +734,7 @@ def check_for_alphabetical_sorted_json_keys(key_value_pairs):
|
||||||
def check_json_requirements(filename):
|
def check_json_requirements(filename):
|
||||||
def check_fn(key_value_pairs):
|
def check_fn(key_value_pairs):
|
||||||
check_for_possible_duplicate_json_keys(key_value_pairs)
|
check_for_possible_duplicate_json_keys(key_value_pairs)
|
||||||
if filename in config["check-ordered-json-keys"]:
|
if filename in normilize_paths(config["check-ordered-json-keys"]):
|
||||||
check_for_alphabetical_sorted_json_keys(key_value_pairs)
|
check_for_alphabetical_sorted_json_keys(key_value_pairs)
|
||||||
return check_fn
|
return check_fn
|
||||||
|
|
||||||
|
|
|
@ -1,59 +1,8 @@
|
||||||
{
|
{
|
||||||
"dom.bluetooth.enabled": false,
|
|
||||||
"dom.bluetooth.testing.enabled": false,
|
|
||||||
"dom.forcetouch.enabled": true,
|
"dom.forcetouch.enabled": true,
|
||||||
"dom.mouseevent.which.enabled": false,
|
|
||||||
"dom.mozbrowser.enabled": true,
|
"dom.mozbrowser.enabled": true,
|
||||||
"dom.serviceworker.timeout_seconds": 60,
|
|
||||||
"dom.testable_crash.enabled": false,
|
|
||||||
"dom.testbinding.enabled": false,
|
|
||||||
"js.asmjs.enabled": true,
|
|
||||||
"js.asyncstack.enabled": false,
|
|
||||||
"js.baseline.enabled": true,
|
|
||||||
"js.baseline.unsafe_eager_compilation.enabled": false,
|
|
||||||
"js.discard_system_source.enabled": false,
|
|
||||||
"js.dump_stack_on_debuggee_would_run.enabled": false,
|
|
||||||
"js.ion.enabled": true,
|
|
||||||
"js.ion.offthread_compilation.enabled": true,
|
|
||||||
"js.ion.unsafe_eager_compilation.enabled": false,
|
|
||||||
"js.mem.gc.allocation_threshold_mb": 30,
|
|
||||||
"js.mem.gc.compacting.enabled": true,
|
|
||||||
"js.mem.gc.decommit_threshold_mb": 32,
|
|
||||||
"js.mem.gc.dynamic_heap_growth.enabled": true,
|
|
||||||
"js.mem.gc.dynamic_mark_slice.enabled": true,
|
|
||||||
"js.mem.gc.empty_chunk_count_max": 30,
|
|
||||||
"js.mem.gc.empty_chunk_count_min": 1,
|
|
||||||
"js.mem.gc.high_frequency_heap_growth_max": 300,
|
|
||||||
"js.mem.gc.high_frequency_heap_growth_min": 150,
|
|
||||||
"js.mem.gc.high_frequency_high_limit_mb": 500,
|
|
||||||
"js.mem.gc.high_frequency_low_limit_mb": 100,
|
|
||||||
"js.mem.gc.high_frequency_time_limit_ms": 1000,
|
|
||||||
"js.mem.gc.incremental.enabled": true,
|
|
||||||
"js.mem.gc.incremental.slice_ms": 10,
|
|
||||||
"js.mem.gc.low_frequency_heap_growth": 150,
|
|
||||||
"js.mem.gc.per_compartment.enabled": true,
|
|
||||||
"js.mem.gc.refresh_frame_slices.enabled": true,
|
|
||||||
"js.mem.gc.zeal.frequency": 100,
|
|
||||||
"js.mem.gc.zeal.level": 0,
|
|
||||||
"js.mem.high_water_mark": 128,
|
|
||||||
"js.mem.max": -1,
|
|
||||||
"js.native_regexp.enabled": true,
|
|
||||||
"js.parallel_parsing.enabled": true,
|
|
||||||
"js.shared_memory.enabled": true,
|
|
||||||
"js.strict.debug.enabled": false,
|
|
||||||
"js.strict.enabled": false,
|
|
||||||
"js.throw_on_asmjs_validation_failure.enabled": false,
|
|
||||||
"js.throw_on_debuggee_would_run.enabled": false,
|
|
||||||
"js.werror.enabled": false,
|
|
||||||
"layout.column-count.enabled": false,
|
|
||||||
"layout.column-gap.enabled": false,
|
|
||||||
"layout.column-width.enabled": false,
|
|
||||||
"layout.columns.enabled": false,
|
|
||||||
"layout.text-orientation.enabled": false,
|
|
||||||
"layout.viewport.enabled": false,
|
|
||||||
"layout.writing-mode.enabled": false,
|
|
||||||
"network.mime.sniff": false,
|
|
||||||
"shell.builtin-key-shortcuts.enabled": false,
|
"shell.builtin-key-shortcuts.enabled": false,
|
||||||
"shell.homepage": "https://servo.org",
|
"os:windows,os:linux;shell.homepage": "browserhtml/index.html",
|
||||||
"shell.native-titlebar.enabled": false
|
"os:macosx;shell.homepage": "../Resources/browserhtml/index.html",
|
||||||
|
"os:macosx;shell.native-titlebar.enabled": false
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,6 @@
|
||||||
"layout.writing-mode.enabled": false,
|
"layout.writing-mode.enabled": false,
|
||||||
"network.mime.sniff": false,
|
"network.mime.sniff": false,
|
||||||
"shell.builtin-key-shortcuts.enabled": true,
|
"shell.builtin-key-shortcuts.enabled": true,
|
||||||
"shell.homepage": "http://servo.org",
|
"shell.homepage": "https://servo.org",
|
||||||
"shell.native-titlebar.enabled": true
|
"shell.native-titlebar.enabled": true
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ skip-check-length = false
|
||||||
skip-check-licenses = false
|
skip-check-licenses = false
|
||||||
check-ordered-json-keys = [
|
check-ordered-json-keys = [
|
||||||
"./resources/prefs.json",
|
"./resources/prefs.json",
|
||||||
"./resources/package-prefs.json",
|
|
||||||
]
|
]
|
||||||
lint-scripts = [
|
lint-scripts = [
|
||||||
"./python/servo/lints/wpt_lint.py",
|
"./python/servo/lints/wpt_lint.py",
|
||||||
|
|
|
@ -47,7 +47,7 @@ fn main() {
|
||||||
let debug = passthrough.contains(&"-d".to_string());
|
let debug = passthrough.contains(&"-d".to_string());
|
||||||
|
|
||||||
// Set the build directory that will contain all the necessary files to create the apk
|
// Set the build directory that will contain all the necessary files to create the apk
|
||||||
let directory = args.root_path.join("support").join("android").join("apk");
|
let directory = args.target_path.join("apk");
|
||||||
let resdir = args.root_path.join("resources/");
|
let resdir = args.root_path.join("resources/");
|
||||||
|
|
||||||
// executing ndk-build
|
// executing ndk-build
|
||||||
|
|
|
@ -38,7 +38,6 @@
|
||||||
WorkingDirectory="INSTALLDIR"
|
WorkingDirectory="INSTALLDIR"
|
||||||
Icon="Servo.ico"
|
Icon="Servo.ico"
|
||||||
IconIndex="0"
|
IconIndex="0"
|
||||||
Arguments="-w --pref dom.mozbrowser.enabled --pref shell.builtin-key-shortcuts.enabled=false browserhtml\index.html"
|
|
||||||
Advertise="yes"/>
|
Advertise="yes"/>
|
||||||
</File>
|
</File>
|
||||||
<File Id="ServoManifest"
|
<File Id="ServoManifest"
|
||||||
|
@ -49,7 +48,7 @@
|
||||||
${include_dependencies()}
|
${include_dependencies()}
|
||||||
</Component>
|
</Component>
|
||||||
|
|
||||||
${include_directory(path.join(top_path, "resources"), "resources")}
|
${include_directory(resources_path, "resources")}
|
||||||
${include_directory(browserhtml_path, "browserhtml")}
|
${include_directory(browserhtml_path, "browserhtml")}
|
||||||
</Directory>
|
</Directory>
|
||||||
</Directory>
|
</Directory>
|
||||||
|
@ -77,7 +76,7 @@
|
||||||
<ComponentRef Id="ProgramMenuDir"/>
|
<ComponentRef Id="ProgramMenuDir"/>
|
||||||
</Feature>
|
</Feature>
|
||||||
|
|
||||||
<Icon Id="Servo.ico" SourceFile="${windowize(top_path)}\resources\Servo.ico"/>
|
<Icon Id="Servo.ico" SourceFile="${windowize(resources_path)}\Servo.ico"/>
|
||||||
</Product>
|
</Product>
|
||||||
</Wix>
|
</Wix>
|
||||||
<%!
|
<%!
|
||||||
|
|
|
@ -12,7 +12,7 @@ fn test_create_pref() {
|
||||||
let json_str = "{\
|
let json_str = "{\
|
||||||
\"layout.writing-mode.enabled\": true,\
|
\"layout.writing-mode.enabled\": true,\
|
||||||
\"network.mime.sniff\": false,\
|
\"network.mime.sniff\": false,\
|
||||||
\"shell.homepage\": \"http://servo.org\"\
|
\"shell.homepage\": \"https://servo.org\"\
|
||||||
}";
|
}";
|
||||||
|
|
||||||
let prefs = read_prefs_from_file(json_str.as_bytes());
|
let prefs = read_prefs_from_file(json_str.as_bytes());
|
||||||
|
@ -33,11 +33,11 @@ fn test_get_set_reset_extend() {
|
||||||
assert_eq!(*PREFS.get("test"), PrefValue::Missing);
|
assert_eq!(*PREFS.get("test"), PrefValue::Missing);
|
||||||
PREFS.set("test", PrefValue::String("hi".to_owned()));
|
PREFS.set("test", PrefValue::String("hi".to_owned()));
|
||||||
assert_eq!(*PREFS.get("test"), PrefValue::String("hi".to_owned()));
|
assert_eq!(*PREFS.get("test"), PrefValue::String("hi".to_owned()));
|
||||||
assert_eq!(*PREFS.get("shell.homepage"), PrefValue::String("http://servo.org".to_owned()));
|
assert_eq!(*PREFS.get("shell.homepage"), PrefValue::String("https://servo.org".to_owned()));
|
||||||
PREFS.set("shell.homepage", PrefValue::Boolean(true));
|
PREFS.set("shell.homepage", PrefValue::Boolean(true));
|
||||||
assert_eq!(*PREFS.get("shell.homepage"), PrefValue::Boolean(true));
|
assert_eq!(*PREFS.get("shell.homepage"), PrefValue::Boolean(true));
|
||||||
PREFS.reset("shell.homepage");
|
PREFS.reset("shell.homepage");
|
||||||
assert_eq!(*PREFS.get("shell.homepage"), PrefValue::String("http://servo.org".to_owned()));
|
assert_eq!(*PREFS.get("shell.homepage"), PrefValue::String("https://servo.org".to_owned()));
|
||||||
|
|
||||||
let extension = read_prefs_from_file(json_str.as_bytes()).unwrap();
|
let extension = read_prefs_from_file(json_str.as_bytes()).unwrap();
|
||||||
PREFS.extend(extension);
|
PREFS.extend(extension);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue