aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/devenv_commands.py
diff options
context:
space:
mode:
authorMatthew Rasmus <mattr@zzntd.com>2014-11-19 20:53:50 -0800
committerMatthew Rasmus <mattr@zzntd.com>2014-11-19 20:55:04 -0800
commit3a43abfa35fcec1822ebe13c4aa27c35cb883c13 (patch)
tree900fdf75242538fc15b3f54d7878309649d7b7f1 /python/servo/devenv_commands.py
parent7eeec45a4e93fe52e83440c304a36befdd0c7d27 (diff)
downloadservo-3a43abfa35fcec1822ebe13c4aa27c35cb883c13.tar.gz
servo-3a43abfa35fcec1822ebe13c4aa27c35cb883c13.zip
Added a mach command for cargo update
As proposed in #3736 Example usage: ``` sh $ ./mach update-cargo -p rust-xml . Updating git repository `https://github.com/netvl/rust-xml` ports/cef Updating git repository `https://github.com/netvl/rust-xml` ports/android/glut_app Updating git repository `https://github.com/netvl/rust-xml` ```
Diffstat (limited to 'python/servo/devenv_commands.py')
-rw-r--r--python/servo/devenv_commands.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py
index 199471a6023..5b4e14c1e3e 100644
--- a/python/servo/devenv_commands.py
+++ b/python/servo/devenv_commands.py
@@ -1,4 +1,5 @@
from __future__ import print_function, unicode_literals
+from os import path
import subprocess
@@ -8,7 +9,7 @@ from mach.decorators import (
Command,
)
-from servo.command_base import CommandBase
+from servo.command_base import CommandBase, cd
@CommandProvider
@@ -24,6 +25,24 @@ class MachCommands(CommandBase):
return subprocess.call(["cargo"] + params,
env=self.build_env())
+ @Command('update-cargo',
+ description='Update Cargo dependencies',
+ category='devenv',
+ allow_all_args=True)
+ @CommandArgument(
+ 'params', default=None, nargs='...',
+ help='Command-line arguments to be passed through to cargo update')
+ def update_cargo(self, params):
+ cargo_paths = [path.join('.'),
+ path.join('ports', 'cef'),
+ path.join('ports', 'android', 'glut_app')]
+
+ for cargo_path in cargo_paths:
+ with cd(cargo_path):
+ print(cargo_path)
+ subprocess.call(["cargo", "update"] + params,
+ env=self.build_env())
+
@Command('rustc',
description='Run the Rust compiler',
category='devenv',