Fix build crash introduced in 3768d7a4

get_ndk_path was removed long ago when App and Build were introduced.
Now Build.ndk_path() should be used. Trying to use the object as a dict
resulted in a nasty crash:

	TypeError: 'Build' object is not subscriptable

This is probably a result from faulty rebasing and not enough test
coverage.
This commit is contained in:
Daniel Martí 2016-03-30 22:54:37 +01:00
parent 7082e2f209
commit e822627fd1

View file

@ -262,21 +262,6 @@ def read_config(opts, config_file='config.py'):
return config
def get_ndk_path(version):
if config is None or 'ndk_paths' not in config:
ndk_path = os.getenv('ANDROID_NDK_HOME')
if ndk_path is None:
logging.error('No NDK found! Either set ANDROID_NDK_HOME or add ndk_path to your config.py')
else:
return ndk_path
if version is None:
version = 'r10e' # falls back to latest
paths = config['ndk_paths']
if version not in paths:
return ''
return paths[version] or ''
def find_sdk_tools_cmd(cmd):
'''find a working path to a tool from the Android SDK'''
@ -1834,7 +1819,7 @@ def set_FDroidPopen_env(build=None):
def replace_config_vars(cmd, build):
cmd = cmd.replace('$$SDK$$', config['sdk_path'])
cmd = cmd.replace('$$NDK$$', get_ndk_path(build['ndk']))
cmd = cmd.replace('$$NDK$$', build.ndk_path())
cmd = cmd.replace('$$MVN3$$', config['mvn3'])
if build is not None:
cmd = cmd.replace('$$COMMIT$$', build.commit)