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.
This commit is contained in:
Henrik Tunedal 2011-04-06 20:55:27 +02:00
parent a87532a54c
commit 4cfc02ae9d
4 changed files with 12 additions and 9 deletions

1
README
View file

@ -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 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. 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= =MetaData=

View file

@ -195,7 +195,8 @@ for app in apps:
# Generate (or update) the ant build file, build.xml... # Generate (or update) the ant build file, build.xml...
if thisbuild.get('update', 'yes') == 'yes': 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') parms.append('--subprojects')
if thisbuild.has_key('target'): if thisbuild.has_key('target'):
parms.append('-t') parms.append('-t')
@ -449,8 +450,10 @@ for app in apps:
# By way of a sanity check, make sure the version and version # By way of a sanity check, make sure the version and version
# code in our new apk match what we expect... # code in our new apk match what we expect...
p = subprocess.Popen([aapt_path,'dump','badging', p = subprocess.Popen([os.path.join(sdk_path, 'platform-tools',
src], stdout=subprocess.PIPE) 'aapt'),
'dump', 'badging', src],
stdout=subprocess.PIPE)
output = p.communicate()[0] output = p.communicate()[0]
if thisbuild.get('novcheck', 'no') == "yes": if thisbuild.get('novcheck', 'no') == "yes":
vercode = thisbuild['vercode'] vercode = thisbuild['vercode']
@ -531,8 +534,9 @@ for app in apps:
sys.exit(1) sys.exit(1)
# Zipalign it... # Zipalign it...
p = subprocess.Popen(['zipalign', '-v', '4', p = subprocess.Popen([os.path.join(sdk_path,'tools','zipalign'),
dest_unsigned, dest], stdout=subprocess.PIPE) '-v', '4', dest_unsigned, dest],
stdout=subprocess.PIPE)
output = p.communicate()[0] output = p.communicate()[0]
print output print output
if p.returncode != 0: if p.returncode != 0:

View file

@ -2,7 +2,6 @@
#Copy this file to config.py, then amend the settings below according to #Copy this file to config.py, then amend the settings below according to
#your system configuration. #your system configuration.
aapt_path = "/path/to/android-sdk-linux_86/platform-tools/aapt"
sdk_path = "/path/to/android-sdk-linux_86" sdk_path = "/path/to/android-sdk-linux_86"
ndk_path = "/path/to/android-ndk-r5" ndk_path = "/path/to/android-ndk-r5"

View file

@ -95,8 +95,9 @@ for apkfile in glob.glob(os.path.join('repo','*.apk')):
thisinfo['size'] = os.path.getsize(apkfile) thisinfo['size'] = os.path.getsize(apkfile)
thisinfo['permissions'] = [] thisinfo['permissions'] = []
thisinfo['features'] = [] thisinfo['features'] = []
p = subprocess.Popen([aapt_path,'dump','badging', p = subprocess.Popen([os.path.join(sdk_path, 'platform-tools', 'aapt'),
apkfile], stdout=subprocess.PIPE) 'dump', 'badging', apkfile],
stdout=subprocess.PIPE)
output = p.communicate()[0] output = p.communicate()[0]
if options.verbose: if options.verbose:
print output print output