aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/post_build_commands.py
diff options
context:
space:
mode:
authorJack Moffitt <jack@metajack.im>2014-08-28 09:34:23 -0600
committerJack Moffitt <jack@metajack.im>2014-09-08 20:21:42 -0600
commitc6ab60dbfc6da7b4f800c9e40893c8b58413960c (patch)
treed1d74076cf7fa20e4f77ec7cb82cae98b67362cb /python/servo/post_build_commands.py
parentdb2f642c32fc5bed445bb6f2e45b0f6f0b4342cf (diff)
downloadservo-c6ab60dbfc6da7b4f800c9e40893c8b58413960c.tar.gz
servo-c6ab60dbfc6da7b4f800c9e40893c8b58413960c.zip
Cargoify servo
Diffstat (limited to 'python/servo/post_build_commands.py')
-rw-r--r--python/servo/post_build_commands.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py
new file mode 100644
index 00000000000..276a772c787
--- /dev/null
+++ b/python/servo/post_build_commands.py
@@ -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())
+