From: Henrik Tunedal Date: Wed, 6 Apr 2011 18:55:27 +0000 (+0200) Subject: Simplify SDK path configuration X-Git-Tag: 0.1~1414 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=4cfc02ae9df8c1cae628edda1190d29941c92721;p=fdroidserver.git Simplify SDK path configuration As long as we're making the user specify the path to the SDK, we can use that information to find all the tools - there's no need for specifying the location of aapt separately or requiring the tools to be in $PATH. --- diff --git a/README b/README index 31afb39d..dbd86a66 100644 --- a/README +++ b/README @@ -31,7 +31,6 @@ To be able to auto-build packages, you're going to need: You then need to create a config.py (copy config.sample.py and follow the instructions) to specify the locations of some of these things. -Also make sure the SDK tools - found in $SDK/tools/ - are in your $PATH. =MetaData= diff --git a/build.py b/build.py index 5c0fe6a9..94cb179a 100755 --- a/build.py +++ b/build.py @@ -195,7 +195,8 @@ for app in apps: # Generate (or update) the ant build file, build.xml... if thisbuild.get('update', 'yes') == 'yes': - parms = ['android','update','project','-p','.'] + parms = [os.path.join(sdk_path, 'tools', 'android'), + 'update', 'project', '-p', '.'] parms.append('--subprojects') if thisbuild.has_key('target'): parms.append('-t') @@ -449,8 +450,10 @@ for app in apps: # By way of a sanity check, make sure the version and version # code in our new apk match what we expect... - p = subprocess.Popen([aapt_path,'dump','badging', - src], stdout=subprocess.PIPE) + p = subprocess.Popen([os.path.join(sdk_path, 'platform-tools', + 'aapt'), + 'dump', 'badging', src], + stdout=subprocess.PIPE) output = p.communicate()[0] if thisbuild.get('novcheck', 'no') == "yes": vercode = thisbuild['vercode'] @@ -531,8 +534,9 @@ for app in apps: sys.exit(1) # Zipalign it... - p = subprocess.Popen(['zipalign', '-v', '4', - dest_unsigned, dest], stdout=subprocess.PIPE) + p = subprocess.Popen([os.path.join(sdk_path,'tools','zipalign'), + '-v', '4', dest_unsigned, dest], + stdout=subprocess.PIPE) output = p.communicate()[0] print output if p.returncode != 0: diff --git a/config.sample.py b/config.sample.py index 38917762..bdfc022d 100644 --- a/config.sample.py +++ b/config.sample.py @@ -2,7 +2,6 @@ #Copy this file to config.py, then amend the settings below according to #your system configuration. -aapt_path = "/path/to/android-sdk-linux_86/platform-tools/aapt" sdk_path = "/path/to/android-sdk-linux_86" ndk_path = "/path/to/android-ndk-r5" diff --git a/update.py b/update.py index 07d396f1..61598d01 100755 --- a/update.py +++ b/update.py @@ -95,8 +95,9 @@ for apkfile in glob.glob(os.path.join('repo','*.apk')): thisinfo['size'] = os.path.getsize(apkfile) thisinfo['permissions'] = [] thisinfo['features'] = [] - p = subprocess.Popen([aapt_path,'dump','badging', - apkfile], stdout=subprocess.PIPE) + p = subprocess.Popen([os.path.join(sdk_path, 'platform-tools', 'aapt'), + 'dump', 'badging', apkfile], + stdout=subprocess.PIPE) output = p.communicate()[0] if options.verbose: print output