diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py index a4bfa5c5df14..2fc4a08e434b 100644 --- a/python/servo/devenv_commands.py +++ b/python/servo/devenv_commands.py @@ -21,6 +21,12 @@ from servo.command_base import CommandBase, cd, call +CARGO_PATHS = [ + path.join('components', 'servo'), + path.join('ports', 'cef'), + path.join('ports', 'geckolib'), +] + @CommandProvider class MachCommands(CommandBase): @@ -81,11 +87,7 @@ def update_cargo(self, params=None, package=None, all_packages=None): print("flag or update all packages with --all-packages (-a) flag") sys.exit(1) - cargo_paths = [path.join('components', 'servo'), - path.join('ports', 'cef'), - path.join('ports', 'geckolib')] - - for cargo_path in cargo_paths: + for cargo_path in CARGO_PATHS: with cd(cargo_path): print(cargo_path) call(["cargo", "update"] + params, @@ -153,6 +155,19 @@ def grep(self, params): ["git"] + ["grep"] + params + ['--'] + grep_paths + [':(exclude)*.min.js'], env=self.build_env()) + @Command('fetch', + description='Fetch Rust, Cargo and Cargo dependencies', + category='devenv') + def fetch(self): + # Fetch Rust and Cargo + self.ensure_bootstrapped() + + # Fetch Cargo dependencies + for cargo_path in CARGO_PATHS: + with cd(cargo_path): + print(cargo_path) + call(["cargo", "fetch"], env=self.build_env()) + @Command('wpt-upgrade', description='upgrade wptrunner.', category='devenv')