Auto merge of #12821 - UK992:mach-update, r=aneeshusa

Create `mach fetch` command

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12775.

r? @larsbergstrom

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12821)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-08-12 17:18:43 -05:00 committed by GitHub
commit b4695541ae

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