mirror of
https://github.com/servo/servo.git
synced 2025-07-26 16:50:23 +01:00
Cargoify servo
This commit is contained in:
parent
db2f642c32
commit
c6ab60dbfc
1761 changed files with 8423 additions and 2294 deletions
44
python/servo/post_build_commands.py
Normal file
44
python/servo/post_build_commands.py
Normal file
|
@ -0,0 +1,44 @@
|
|||
from __future__ import print_function, unicode_literals
|
||||
|
||||
import json
|
||||
import os
|
||||
import os.path as path
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tarfile
|
||||
from time import time
|
||||
import urllib
|
||||
|
||||
from mach.registrar import Registrar
|
||||
from mach.decorators import (
|
||||
CommandArgument,
|
||||
CommandProvider,
|
||||
Command,
|
||||
)
|
||||
|
||||
from servo.command_base import CommandBase
|
||||
|
||||
@CommandProvider
|
||||
class MachCommands(CommandBase):
|
||||
@Command('run',
|
||||
description='Run Servo',
|
||||
category='post-build',
|
||||
allow_all_args=True)
|
||||
@CommandArgument('params', default=None, nargs='...',
|
||||
help="Command-line arguments to be passed through to Servo")
|
||||
def run(self, params):
|
||||
subprocess.check_call([path.join("target", "servo")] + params,
|
||||
env=self.build_env())
|
||||
|
||||
@Command('doc',
|
||||
description='Generate documentation',
|
||||
category='post-build',
|
||||
allow_all_args=True)
|
||||
@CommandArgument('params', default=None, nargs='...',
|
||||
help="Command-line arguments to be passed through to cargo doc")
|
||||
def doc(self, params):
|
||||
self.ensure_bootstrapped()
|
||||
return subprocess.call(["cargo", "doc"] + params,
|
||||
env=self.build_env())
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue