chiark / gitweb /
Use config.py to locate aapt
authorFrans Gifford <frans.gifford@cs.ox.ac.uk>
Thu, 18 Jul 2013 17:23:17 +0000 (18:23 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Wed, 31 Jul 2013 17:51:02 +0000 (19:51 +0200)
This uses aapt_path in config.py to locate the aapt command. The latest
Android SDK moved aapt out of platform-tools/ causing builds which depend
on this path to fail.

Signed-off-by: Frans Gifford <frans.gifford@cs.ox.ac.uk>
fdroidserver/build.py
fdroidserver/common.py

index ac040e08bc38e1b2a28a67ce2d23e8725e80dc38..72eba2582863ab85b78f4bb519824113a55ab9cf 100644 (file)
@@ -478,8 +478,14 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d
     print "Checking " + src
     if not os.path.exists(src):
         raise BuildException("Unsigned apk is not at expected location of " + src)
-    p = subprocess.Popen([os.path.join(sdk_path, 'platform-tools',
-                                    'aapt'),
+    if ('aapt_path' not in globals()):
+        # (re-)read configuration
+        execfile('config.py', globals())
+    if not os.path.exists(aapt_path):
+        print "Missing aapt - check aapt_path in your config"
+        sys.exit(1)
+
+    p = subprocess.Popen([aapt_path,
                         'dump', 'badging', src],
                         stdout=subprocess.PIPE)
     output = p.communicate()[0]
index 566284b3c5218ddd6cee675c589ffaa8fa59f0a4..8f3d5551c8c4cb558f883c30ec13a6b45674a9c5 100644 (file)
@@ -1564,9 +1564,16 @@ def isApkDebuggable(apkfile, sdk_path):
     """Returns True if the given apk file is debuggable
 
     :param apkfile: full path to the apk to check
-    :param sdk_path: path to android sdk"""
+    :param sdk_path: path to android sdk (deprecated)"""
 
-    p = subprocess.Popen([os.path.join(sdk_path, 'platform-tools', 'aapt'),
+    if ('aapt_path' not in globals()):
+        # (re-)read configuration
+        execfile('config.py', globals())
+    if not os.path.exists(aapt_path):
+        print "Missing aapt - check aapt_path in your config"
+        sys.exit(1)
+
+    p = subprocess.Popen([aapt_path,
                  'dump', 'xmltree', apkfile, 'AndroidManifest.xml'],
                 stdout=subprocess.PIPE)
     output = p.communicate()[0]