From 2fb20b4fc95b0f2fc3dd6487d9ce6763e236856f Mon Sep 17 00:00:00 2001 From: benito Date: Tue, 1 Apr 2014 18:38:14 +0200 Subject: [PATCH] p4a whitelist --- buildozer/default.spec | 9 ++++++--- buildozer/targets/android.py | 9 ++++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/buildozer/default.spec b/buildozer/default.spec index 3661d2e..216992e 100644 --- a/buildozer/default.spec +++ b/buildozer/default.spec @@ -76,11 +76,14 @@ fullscreen = 1 #android.ndk_path = # (str) Android SDK directory (if empty, it will be automatically downloaded.) -#android.sdk_path = +#android.sdk_path = # (str) python-for-android git clone directory (if empty, it will be automatically cloned from github) #android.p4a_dir = +# (list) python-for-android whitelist +#android.p4a_whitelist = + # (str) Android entry point, default is ok for Kivy-based app #android.entrypoint = org.renpy.android.PythonActivity @@ -106,7 +109,7 @@ fullscreen = 1 #android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png # (str) XML file to include as an intent filters in tag -#android.manifest.intent_filters = +#android.manifest.intent_filters = # (list) Android additionnal libraries to copy into libs/armeabi #android.add_libs_armeabi = libs/android/*.so @@ -142,7 +145,7 @@ log_level = 1 # ----------------------------------------------------------------------------- # List as sections -# +# # You can define all the "list" as [section:key]. # Each line will be considered as a option to the list. # Let's take [app] / source.exclude_patterns. diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index 684e4e8..389835b 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -352,7 +352,7 @@ class TargetAndroid(Target): available_modules = self.get_available_packages() onlyname = lambda x: x.split('==')[0] android_requirements = [x for x in app_requirements if onlyname(x) in - available_modules] + available_modules] need_compile = 0 if last_requirements != android_requirements: @@ -362,6 +362,13 @@ class TargetAndroid(Target): if not self.buildozer.file_exists(self.pa_dir, 'dist', dist_name, 'build.py'): need_compile = 1 + # whitelist p4a + p4a_whitelist = self.buildozer.config.getlist('app', 'android.p4a_whitelist') + if p4a_whitelist: + with open(join(self.pa_dir, 'src', 'whitelist.txt'), 'w') as fd: + for wl in p4a_whitelist: + fd.write(wl + '\n') + if not need_compile: self.buildozer.info('Distribution already compiled, pass.') return