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
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
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
):
22 self
.topsrcdir
, "services", "sync", "tps", "extensions", "tps"
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
):
35 for p
, f
in FileFinder(src
).find("*"):
39 print("Built TPS add-on as %s" % dest
)