Skip to content

Commit 15e51f0

Browse files
committed
Fixed setting of env attributes in ToolchainCL
1 parent 3469f7a commit 15e51f0

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

pythonforandroid/toolchain.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -566,9 +566,9 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
566566
if sdk_dir is None:
567567
warning('Android SDK dir was not specified, exiting.')
568568
exit(1)
569+
self.sdk_dir = sdk_dir
569570

570-
# Check what Android API we're using, and install platform
571-
# tools if necessary
571+
# Check what Android API we're using
572572
android_api = None
573573
if user_android_api:
574574
android_api = user_android_api
@@ -583,6 +583,7 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
583583
'the default of {}'.format(DEFAULT_ANDROID_API))
584584
android_api = DEFAULT_ANDROID_API
585585
android_api = int(android_api)
586+
self.android_api = android_api
586587

587588
android = sh.Command(join(sdk_dir, 'tools', 'android'))
588589
targets = android('list').stdout.split('\n')
@@ -596,16 +597,10 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
596597
'it with the SDK android tool.'.format(android_api))
597598
warning('Exiting.')
598599
exit(1)
599-
600-
exit(1)
601-
602-
603-
604-
605-
self.sdk_dir = environ.get('ANDROIDSDK', None)
600+
# AND: If the android api target doesn't exist, we should
601+
# offer to install it here
606602

607603
# AND: We should check for ndk-build and ant?
608-
self.android_api = environ.get('ANDROIDAPI', '14')
609604
self.ndk_ver = environ.get('ANDROIDNDKVER', 'r9')
610605
if self.sdk_dir is None:
611606
ok = False

0 commit comments

Comments
 (0)