aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/devenv_commands.py
diff options
context:
space:
mode:
authorUK992 <urbankrajnc92@gmail.com>2016-08-12 04:23:30 +0200
committerUK992 <urbankrajnc92@gmail.com>2016-08-12 16:13:39 +0200
commitd805e855a9492a3c2ffd1c009f7de4d2b8d75f2f (patch)
tree251998265ccd71aff446029a97e2363f65c6b013 /python/servo/devenv_commands.py
parent7afe0376259e7460461410da03523ebec2f86c8f (diff)
downloadservo-d805e855a9492a3c2ffd1c009f7de4d2b8d75f2f.tar.gz
servo-d805e855a9492a3c2ffd1c009f7de4d2b8d75f2f.zip
Create `mach fetch` command
Diffstat (limited to 'python/servo/devenv_commands.py')
-rw-r--r--python/servo/devenv_commands.py25
1 files changed, 20 insertions, 5 deletions
diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py
index a4bfa5c5df1..2fc4a08e434 100644
--- a/python/servo/devenv_commands.py
+++ b/python/servo/devenv_commands.py
@@ -21,6 +21,12 @@ from mach.decorators import (
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 @@ class MachCommands(CommandBase):
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 @@ class MachCommands(CommandBase):
["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')