Skip to content

Commit c817ad0

Browse files
committed
Restructured discovery of android-api and ndk-api inputs
1 parent 54c5b38 commit c817ad0

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

pythonforandroid/build.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,11 @@ def prepare_build_environment(self,
231231
android_api = None
232232
if user_android_api:
233233
android_api = user_android_api
234-
if android_api is not None:
235-
info('Getting Android API version from user argument')
236-
if android_api is None:
237-
android_api = environ.get('ANDROIDAPI', None)
238-
if android_api is not None:
239-
info('Found Android API target in $ANDROIDAPI')
240-
if android_api is None:
234+
info('Getting Android API version from user argument')
235+
elif 'ANDROIDAPI' in environ:
236+
android_api = environ['ANDROIDAPI']
237+
info('Found Android API target in $ANDROIDAPI')
238+
else:
241239
info('Android API target was not set manually, using '
242240
'the default of {}'.format(DEFAULT_ANDROID_API))
243241
android_api = DEFAULT_ANDROID_API
@@ -357,11 +355,10 @@ def prepare_build_environment(self,
357355
if user_ndk_api:
358356
ndk_api = user_ndk_api
359357
info('Getting NDK API version (i.e. minimum supported API) from user argument')
360-
if ndk_api is None:
358+
elif 'NDKAPI' in environ:
361359
ndk_api = environ.get('NDKAPI', None)
362-
if ndk_api is not None:
363-
info('Found Android API target in $NDKAPI')
364-
if ndk_api is None:
360+
info('Found Android API target in $NDKAPI')
361+
else:
365362
ndk_api = min(self.android_api, DEFAULT_NDK_API)
366363
warning('NDK API target was not set manually, using '
367364
'the default of {} = min(android-api={}, default ndk-api={})'.format(

0 commit comments

Comments
 (0)