aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/devenv_commands.py
blob: f186427ba4a9888082b2159ef16095c337ca3db5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from __future__ import print_function, unicode_literals

import subprocess

from mach.decorators import (
    CommandArgument,
    CommandProvider,
    Command,
)

from servo.command_base import CommandBase


@CommandProvider
class MachCommands(CommandBase):
    @Command('cargo',
             description='Run Cargo',
             category='devenv',
             allow_all_args=True)
    @CommandArgument(
        'params', default=None, nargs='...',
        help="Command-line arguments to be passed through to Cargo")
    def cargo(self, params):
        return subprocess.call(["cargo"] + params,
                               env=self.build_env())

    @Command('rustc',
             description='Run the Rust compiler',
             category='devenv',
             allow_all_args=True)
    @CommandArgument(
        'params', default=None, nargs='...',
        help="Command-line arguments to be passed through to rustc")
    def rustc(self, params):
        return subprocess.call(["rustc"] + params, env=self.build_env())