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/.
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
):
17 command_context
.topsrcdir
, "services", "sync", "tps", "extensions", "tps"
20 dest
or os
.path
.join(command_context
.topobjdir
, "services", "sync"),
24 if not os
.path
.exists(os
.path
.dirname(dest
)):
25 os
.makedirs(os
.path
.dirname(dest
))
27 if os
.path
.isfile(dest
):
31 for p
, f
in FileFinder(src
).find("*"):
35 print("Built TPS add-on as %s" % dest
)