Merge pull request #79 from kivy/buildozer_clean

implement the `clean` command.
This commit is contained in:
Mathieu Virbel 2014-04-08 17:59:56 +02:00
commit 8b15dcf1fa

View file

@ -78,7 +78,7 @@ class BuildozerCommandException(BuildozerException):
class Buildozer(object):
standard_cmds = ('clean', 'update', 'debug', 'release',
standard_cmds = ('distclean', 'update', 'debug', 'release',
'deploy', 'run', 'serve')
def __init__(self, filename='buildozer.spec', target=None):
@ -333,7 +333,7 @@ class Buildozer(object):
adderror('[app] "title" is missing')
if not get('app', 'source.dir', ''):
adderror('[app] "source.dir" is missing')
package_name = get('app', 'package.name', '')
if not package_name:
adderror('[app] "package.name" is missing')
@ -926,10 +926,17 @@ class Buildozer(object):
copyfile(join(dirname(__file__), 'default.spec'), 'buildozer.spec')
print 'File buildozer.spec created, ready to customize!'
def cmd_clean(self, *args):
def cmd_distclean(self, *args):
'''Clean the whole Buildozer environment.
'''
pass
import sys
print("Warning: Your ndk, sdk and all other cached packages will be"+\
" removed. Continue? (y/n)")
if sys.stdin.readline().lower()[0] == 'y':
self.info('Clean the global build directory')
if not exists(self.global_buildozer_dir):
return
rmtree(self.global_buildozer_dir)
def cmd_help(self, *args):
'''Show the Buildozer help.