diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/servo/build_commands.py | 2 | ||||
-rw-r--r-- | python/servo/command_base.py | 11 | ||||
-rw-r--r-- | python/servo/post_build_commands.py | 5 | ||||
-rw-r--r-- | python/servo/testing_commands.py | 5 | ||||
-rw-r--r-- | python/tidy.py | 3 |
5 files changed, 16 insertions, 10 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index 6167431ac61..6fd44653603 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -147,7 +147,7 @@ class MachCommands(CommandBase): opts = params or [] features = [] - base_path = path.join("components", "servo", "target") + base_path = self.get_target_dir() release_path = path.join(base_path, "release", "servo") dev_path = path.join(base_path, "debug", "servo") diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 5369b3e47f9..c6d46fc3de8 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -130,8 +130,14 @@ class CommandBase(object): self._cargo_build_id = open(filename).read().strip() return self._cargo_build_id + def get_target_dir(self): + if "CARGO_TARGET_DIR" in os.environ: + return os.environ["CARGO_TARGET_DIR"] + else: + return path.join(self.context.topdir, "target") + def get_binary_path(self, release, dev): - base_path = path.join("components", "servo", "target") + base_path = self.get_target_dir() release_path = path.join(base_path, "release", "servo") dev_path = path.join(base_path, "debug", "servo") @@ -199,6 +205,9 @@ class CommandBase(object): if "CARGO_HOME" not in env: env["CARGO_HOME"] = self.config["tools"]["cargo-home-dir"] + if "CARGO_TARGET_DIR" not in env: + env["CARGO_TARGET_DIR"] = path.join(self.context.topdir, "target") + if extra_lib: if sys.platform == "darwin": env["DYLD_LIBRARY_PATH"] = "%s%s%s" % \ diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py index 927b425efe8..efa315158f8 100644 --- a/python/servo/post_build_commands.py +++ b/python/servo/post_build_commands.py @@ -137,8 +137,7 @@ class MachCommands(CommandBase): if not path.exists(path.join(self.config["tools"]["rust-root"], "doc")): Registrar.dispatch("bootstrap-rust-docs", context=self.context) rust_docs = path.join(self.config["tools"]["rust-root"], "doc") - docs = path.join( - self.context.topdir, "components", "servo", "target", "doc") + docs = path.join(self.get_target_dir(), "doc") if not path.exists(docs): os.makedirs(docs) @@ -167,4 +166,4 @@ class MachCommands(CommandBase): self.doc([]) import webbrowser webbrowser.open("file://" + path.abspath(path.join( - self.servo_crate(), "target", "doc", "servo", "index.html"))) + self.get_target_dir(), "doc", "servo", "index.html"))) diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index 0daefd277b6..4d8a2e2778a 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -50,12 +50,11 @@ class MachCommands(CommandBase): def find_test(self, prefix): target_contents = os.listdir(path.join( - self.context.topdir, "components", "servo", "target", "debug")) + self.get_target_dir(), "debug")) for filename in target_contents: if filename.startswith(prefix + "-"): filepath = path.join( - self.context.topdir, "components", "servo", - "target", "debug", filename) + self.get_target_dir(), "debug", filename) if path.isfile(filepath) and os.access(filepath, os.X_OK): return filepath diff --git a/python/tidy.py b/python/tidy.py index 6f4dc9778e8..75b372995e1 100644 --- a/python/tidy.py +++ b/python/tidy.py @@ -36,8 +36,7 @@ ignored_files = [ # Generated and upstream code combined with our own. Could use cleanup "components/script/dom/bindings/codegen/*", "components/style/properties/mod.rs", - "components/servo/target/*", - "ports/gonk/target/*", + "target/*", "ports/gonk/src/native_window_glue.cpp", "ports/cef/*", |