Bug 1700051: part 36) Reduce accessibility of `SoftText::mBegin` to `private`. r...
[gecko.git] / testing / tps / mach_commands.py
blobd389cac4623ac23b82f4309b85c9ed3c9aff8ca2
1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, # You can obtain one at http://mozilla.org/MPL/2.0/.
5 from __future__ import absolute_import, print_function
6 import os
8 from mach.decorators import Command, CommandArgument, CommandProvider
9 from mozbuild.base import MachCommandBase
10 from mozpack.copier import Jarrer
11 from mozpack.files import FileFinder
14 @CommandProvider
15 class MachCommands(MachCommandBase):
16 """TPS tests for Sync."""
18 @Command("tps-build", category="testing", description="Build TPS add-on.")
19 @CommandArgument("--dest", default=None, help="Where to write add-on.")
20 def build(self, dest):
21 src = os.path.join(
22 self.topsrcdir, "services", "sync", "tps", "extensions", "tps"
24 dest = os.path.join(
25 dest or os.path.join(self.topobjdir, "services", "sync"), "tps.xpi"
28 if not os.path.exists(os.path.dirname(dest)):
29 os.makedirs(os.path.dirname(dest))
31 if os.path.isfile(dest):
32 os.unlink(dest)
34 jarrer = Jarrer()
35 for p, f in FileFinder(src).find("*"):
36 jarrer.add(p, f)
37 jarrer.copy(dest)
39 print("Built TPS add-on as %s" % dest)