From 18f9ef0c2e4af3e6298fa3fc10ebed0bb91bdb39 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 1 May 2013 17:07:31 +0100 Subject: [PATCH] update build.py for fdroid - a 'copyonly' mode that prepares the mobile/assets folder but doesn't run 'ant' --- build.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/build.py b/build.py index a7ace7e2..55ac2f0a 100755 --- a/build.py +++ b/build.py @@ -202,8 +202,8 @@ def copytree(src, dst, symlinks=False, ignore=None): # if we're building mobile too if buildMobile: - if buildMobile not in ['debug','release']: - raise Exception("Error: buildMobile must be 'debug' or 'release'") + if buildMobile not in ['debug','release','copyonly']: + raise Exception("Error: buildMobile must be 'debug' or 'release' or 'copyonly'") # compile the user location script fn = "user-location.user.js" @@ -232,13 +232,14 @@ if buildMobile: copytree(os.path.join(outDir,"plugins"), "mobile/assets/plugins") - # now launch 'ant' to build the mobile project - retcode = os.system("ant -buildfile mobile/build.xml %s" % buildMobile) + if buildMobile != 'copyonly': + # now launch 'ant' to build the mobile project + retcode = os.system("ant -buildfile mobile/build.xml %s" % buildMobile) - if retcode != 0: - print ("Error: mobile app failed to build. ant returned %d" % retcode) - else: - shutil.copy("mobile/bin/IITC_Mobile-%s.apk" % buildMobile, os.path.join(outDir,"IITC_Mobile-%s.apk" % buildMobile) ) + if retcode != 0: + print ("Error: mobile app failed to build. ant returned %d" % retcode) + else: + shutil.copy("mobile/bin/IITC_Mobile-%s.apk" % buildMobile, os.path.join(outDir,"IITC_Mobile-%s.apk" % buildMobile) ) # vim: ai si ts=4 sw=4 sts=4 et