Backed out 2 changesets (bug 1848257, bug 1848254) for causing multiple failures...
[gecko.git] / testing / tps / mach_commands.py
blob34b20ff7996df2b1b0c9b20d6b7bd23e9a4b12a1
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/.
6 import os
8 from mach.decorators import Command, CommandArgument
9 from mozpack.copier import Jarrer
10 from mozpack.files import FileFinder
13 @Command("tps-build", category="testing", description="Build TPS add-on.")
14 @CommandArgument("--dest", default=None, help="Where to write add-on.")
15 def build(command_context, dest):
16 src = os.path.join(
17 command_context.topsrcdir, "services", "sync", "tps", "extensions", "tps"
19 dest = os.path.join(
20 dest or os.path.join(command_context.topobjdir, "services", "sync"),
21 "tps.xpi",
24 if not os.path.exists(os.path.dirname(dest)):
25 os.makedirs(os.path.dirname(dest))
27 if os.path.isfile(dest):
28 os.unlink(dest)
30 jarrer = Jarrer()
31 for p, f in FileFinder(src).find("*"):
32 jarrer.add(p, f)
33 jarrer.copy(dest)
35 print("Built TPS add-on as %s" % dest)