From b7425d7253a3fd9aaf7adcd6cbc7fba58f3977d7 Mon Sep 17 00:00:00 2001 From: Ciaran Gultnieks Date: Fri, 25 Oct 2013 11:59:55 +0100 Subject: [PATCH] Be more selective about removing bin directories --- fdroidserver/common.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index f5158288..04fa497b 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -1257,12 +1257,16 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, sdk_path, if os.path.exists(buildxml): print 'Force-removing old build.xml' os.remove(buildxml) - for baddir in [ + + baddirs = [ 'gen', 'bin', 'obj', # ant 'libs/armeabi-v7a', 'libs/armeabi', # jni - 'libs/mips', 'libs/x86', # jni - 'build', # gradle - 'target']: # maven + 'libs/mips', 'libs/x86'] # jni + if 'gradle' in build: + baddirs.append('build') + if 'maven' in build: + baddirs.append('target') + for baddir in baddirs: badpath = os.path.join(build_dir, baddir) if os.path.exists(badpath): print "Removing '%s'" % badpath