Create mach fetch command

This commit is contained in:
UK992 2016-08-12 04:23:30 +02:00
parent 7afe037625
commit d805e855a9

View file

@ -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')