Move the servo crate from root to components/servo

This commit is contained in:
Simon Sapin 2014-11-28 08:16:02 +00:00
parent b2b6d4d0d1
commit 2f413c8937
15 changed files with 55 additions and 45 deletions

View file

@ -73,7 +73,7 @@ class MachCommands(CommandBase):
else:
status = subprocess.call(
["cargo", "build"] + opts,
env=self.build_env())
env=self.build_env(), cwd="components/servo")
elapsed = time() - build_start
print("Build completed in %0.2fs" % elapsed)
@ -105,7 +105,8 @@ class MachCommands(CommandBase):
build_start = time()
with cd(path.join("ports", "cef")):
ret = subprocess.call(["cargo", "build"], env=self.build_env())
ret = subprocess.call(["cargo", "build"],
env=self.build_env(), cwd="components/servo")
elapsed = time() - build_start
print("CEF build completed in %0.2fs" % elapsed)
@ -124,7 +125,8 @@ class MachCommands(CommandBase):
if jobs is not None:
opts += ["-j", jobs]
return subprocess.call(
["cargo", "test", "--no-run"], env=self.build_env())
["cargo", "test", "--no-run"],
env=self.build_env(), cwd="components/servo")
@Command('clean',
description='Clean the build directory.',
@ -144,4 +146,5 @@ class MachCommands(CommandBase):
if verbose:
opts += ["-v"]
return subprocess.call(["cargo", "clean"] + opts, env=self.build_env())
return subprocess.call(["cargo", "clean"] + opts,
env=self.build_env(), cwd="components/servo")

View file

@ -22,7 +22,7 @@ class MachCommands(CommandBase):
help="Command-line arguments to be passed through to Cargo")
def cargo(self, params):
return subprocess.call(["cargo"] + params,
env=self.build_env())
env=self.build_env(), cwd="components/servo")
@Command('update-cargo',
description='Update Cargo dependencies',

View file

@ -37,7 +37,7 @@ class MachCommands(CommandBase):
env = self.build_env()
env["RUST_BACKTRACE"] = "1"
args = [path.join("target", "servo")]
args = [path.join("components", "servo", "target", "servo")]
# Borrowed and modified from:
# http://hg.mozilla.org/mozilla-central/file/c9cfa9b91dea/python/mozbuild/mozbuild/mach_commands.py#l883
@ -71,7 +71,7 @@ class MachCommands(CommandBase):
def doc(self, params):
self.ensure_bootstrapped()
return subprocess.call(["cargo", "doc"] + params,
env=self.build_env())
env=self.build_env(), cwd="components/servo")
@Command('serve-docs',
description='Locally serve Servo and Rust documentation',
@ -81,13 +81,13 @@ class MachCommands(CommandBase):
help="Port to serve documentation at (default is 8888)")
def serve_docs(self, port):
self.doc([])
servedir = path.join("target", "serve-docs")
docdir = path.join("target", "doc")
servedir = path.join("components", "servo", "target", "serve-docs")
docdir = path.join("components", "servo", "target", "doc")
rmtree(servedir, True)
copytree(docdir, servedir, ignore=ignore_patterns('.*'))
rustdocs = path.join("rust", self.rust_snapshot_path(), "doc")
rustdocs = path.join(self.config["tools"]["rust-root"], "doc")
copytree(rustdocs, path.join(servedir, "rust"), ignore=ignore_patterns('.*'))
chdir(servedir)

View file

@ -31,10 +31,12 @@ class MachCommands(CommandBase):
self.context.built_tests = True
def find_test(self, prefix):
target_contents = os.listdir(path.join(self.context.topdir, "target"))
target_contents = os.listdir(path.join(
self.context.topdir, "components", "servo", "target"))
for filename in target_contents:
if filename.startswith(prefix + "-"):
filepath = path.join(self.context.topdir, "target", filename)
filepath = path.join(
self.context.topdir, "components", "servo", "target", filename)
if path.isfile(filepath) and os.access(filepath, os.X_OK):
return filepath
@ -104,7 +106,8 @@ class MachCommands(CommandBase):
def cargo_test(component):
return 0 != subprocess.call(
["cargo", "test", "-p", component] + test_name, env=self.build_env())
["cargo", "test", "-p", component] + test_name,
env=self.build_env(), cwd="components/servo")
for component in os.listdir("components"):
ret = ret or cargo_test(component)