Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Bug 937594 - Create a mach clobber command for B2G, r=jgriffin
Browse files Browse the repository at this point in the history
  • Loading branch information
ahal-test committed Nov 13, 2013
1 parent 4b21a68 commit c923761
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tools/mach_b2g_bootstrap.py
Expand Up @@ -53,7 +53,7 @@

# Individual files providing mach commands.
MACH_MODULES = [
'python/mach/mach/commands/commandinfo.py',
'tools/mach_commands.py',
]

CATEGORIES = {
Expand Down
35 changes: 35 additions & 0 deletions tools/mach_commands.py
@@ -0,0 +1,35 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from __future__ import print_function, unicode_literals

import mozfile
import os

from mach.decorators import (
CommandProvider,
Command,
)
from mozbuild.base import (
MachCommandBase,
MachCommandConditions as conditions
)

@CommandProvider
class Build(MachCommandBase):
"""Interface for build related commands."""

def __init__(self, context):
MachCommandBase.__init__(self, context)
self.b2g_home = context.b2g_home

@Command('clobber', category='build',
conditions=[conditions.is_b2g],
description='Clobber the tree (delete the objdir and out directory).')
def clobber(self):
self.remove_objdir()
outdir = os.path.join(self.b2g_home, 'out')
if os.path.isdir(outdir):
mozfile.rmtree(outdir)
return 0

0 comments on commit c923761

Please sign in to comment.