chiark / gitweb /
Simplify SDK path configuration
authorHenrik Tunedal <tunedal@gmail.com>
Wed, 6 Apr 2011 18:55:27 +0000 (20:55 +0200)
committerHenrik Tunedal <tunedal@gmail.com>
Wed, 6 Apr 2011 21:45:41 +0000 (23:45 +0200)
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.

README
build.py
config.sample.py
update.py

diff --git a/README b/README
index 31afb39d7426b2cc457ee711012bbba62262aef1..dbd86a66fadaf6bc0fb9979d4b955548218ecd45 100644 (file)
--- 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=
 
index 5c0fe6a9c8069ff44376b2e657f7fa1cee537857..94cb179adcd184841f443f58b0ef660764802362 100755 (executable)
--- 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:
index 38917762e4923deb9de5b40d723fcc7b02cd5f4a..bdfc022d8e677fc4548a2518866cc7113b75f61b 100644 (file)
@@ -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"
 
index 07d396f12e1f4074529384f04a1cd85e652a0a24..61598d0146a0050c3e61addeb7ffeb8686c802dd 100755 (executable)
--- 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