mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Auto merge of #14817 - teosz:master, r=Wafflespeanut
Remove duplicate code in mach <!-- Please describe your changes on the following line: --> Move get_browserhtml_path to command_base --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #14815 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because removing the duplicate code doesn't affect the behavior itself <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/14817) <!-- Reviewable:end -->
This commit is contained in:
commit
2bf71800ef
3 changed files with 12 additions and 14 deletions
|
@ -61,6 +61,13 @@ def find_dep_path_newest(package, bin_path):
|
|||
return None
|
||||
|
||||
|
||||
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.")
|
||||
|
||||
|
||||
def archive_deterministically(dir_to_archive, dest_archive, prepend_path=None):
|
||||
"""Create a .tar.gz archive in a deterministic (reproducible) manner.
|
||||
|
||||
|
|
|
@ -36,8 +36,9 @@ from servo.command_base import (
|
|||
CommandBase,
|
||||
is_macosx,
|
||||
is_windows,
|
||||
get_browserhtml_path,
|
||||
)
|
||||
from servo.post_build_commands import find_dep_path_newest
|
||||
from servo.command_base import find_dep_path_newest
|
||||
|
||||
|
||||
def delete(path):
|
||||
|
@ -123,13 +124,6 @@ def change_prefs(resources_path, platform):
|
|||
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
|
||||
class PackageCommands(CommandBase):
|
||||
@Command('package',
|
||||
|
|
|
@ -24,8 +24,9 @@ from mach.decorators import (
|
|||
|
||||
from servo.command_base import (
|
||||
CommandBase,
|
||||
call, check_call, find_dep_path_newest,
|
||||
call, check_call,
|
||||
is_windows, is_macosx, set_osmesa_env,
|
||||
get_browserhtml_path,
|
||||
)
|
||||
|
||||
|
||||
|
@ -97,11 +98,7 @@ class PostBuildCommands(CommandBase):
|
|||
args = [self.get_binary_path(release, dev)]
|
||||
|
||||
if browserhtml:
|
||||
browserhtml_path = find_dep_path_newest('browserhtml', args[0])
|
||||
if browserhtml_path is None:
|
||||
print("Could not find browserhtml package; perhaps you haven't built Servo.")
|
||||
return 1
|
||||
|
||||
browserhtml_path = get_browserhtml_path('browserhtml', args[0])
|
||||
if is_macosx():
|
||||
# Enable borderless on OSX
|
||||
args = args + ['-b']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue