android: dont lookup to android sdk/ndk if we didnt change the buildozer.spec options related to it, and if everything was working in the first time.

This commit is contained in:
Mathieu Virbel 2015-01-27 16:46:17 +01:00
parent b17a0ef6c1
commit 122252f9f7

View file

@ -354,6 +354,19 @@ class TargetAndroid(Target):
return package_versions[-1]
def _install_android_packages(self):
# if any of theses value change into the buildozer.spec, retry the
# update
cache_key = 'android:sdk_installation'
cache_value = [
self.android_api,
self.android_minapi,
self.android_ndk_version,
self.android_sdk_dir,
self.android_ndk_dir]
if self.buildozer.state.get(cache_key, None) == cache_value:
return True
# 3 pass installation.
if not os.access(self.android_cmd, os.X_OK):
self.buildozer.cmd('chmod ug+x {}'.format(self.android_cmd))
@ -382,6 +395,9 @@ class TargetAndroid(Target):
self.buildozer.info('Android packages installation done.')
self.buildozer.state[cache_key] = cache_value
self.buildozer.state.sync()
def install_platform(self):
cmd = self.buildozer.cmd
self.pa_dir = pa_dir = join(self.buildozer.platform_dir, 'python-for-android')