From 122252f9f71b1e24d48422af54f324bde2b0fca2 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Tue, 27 Jan 2015 16:46:17 +0100 Subject: [PATCH] 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. --- buildozer/targets/android.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index e2fb4e1..38ec580 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -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')