add support for copying libraries for armeabi, armeabi-v7a, x86, mips. closes #63
This commit is contained in:
parent
4ad75994d7
commit
fbab0f2163
3 changed files with 29 additions and 13 deletions
|
@ -535,6 +535,16 @@ class Buildozer(object):
|
||||||
self.debug('Remove directory and subdirectory {}'.format(dn))
|
self.debug('Remove directory and subdirectory {}'.format(dn))
|
||||||
rmtree(dn)
|
rmtree(dn)
|
||||||
|
|
||||||
|
def file_matches(self, patterns):
|
||||||
|
from glob import glob
|
||||||
|
result = []
|
||||||
|
for pattern in patterns:
|
||||||
|
matches = glob(expanduser(pattern.strip()))
|
||||||
|
if not matches:
|
||||||
|
return
|
||||||
|
result.extend(matches)
|
||||||
|
return result
|
||||||
|
|
||||||
def file_exists(self, *args):
|
def file_exists(self, *args):
|
||||||
return exists(join(*args))
|
return exists(join(*args))
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,9 @@ fullscreen = 1
|
||||||
|
|
||||||
# (list) Android additionnal libraries to copy into libs/armeabi
|
# (list) Android additionnal libraries to copy into libs/armeabi
|
||||||
#android.add_libs_armeabi = libs/android/*.so
|
#android.add_libs_armeabi = libs/android/*.so
|
||||||
|
#android.add_libs_armeabi_v7a = libs/android-v7/*.so
|
||||||
|
#android.add_libs_x86 = libs/android-x86/*.so
|
||||||
|
#android.add_libs_mips = libs/android-mips/*.so
|
||||||
|
|
||||||
# (bool) Indicate whether the screen should stay on
|
# (bool) Indicate whether the screen should stay on
|
||||||
# Don't forget to add the WAKE_LOCK permission if you set this to True
|
# Don't forget to add the WAKE_LOCK permission if you set this to True
|
||||||
|
|
|
@ -450,19 +450,22 @@ class TargetAndroid(Target):
|
||||||
version = self.buildozer.get_version()
|
version = self.buildozer.get_version()
|
||||||
|
|
||||||
# add extra libs/armeabi files in dist/default/libs/armeabi
|
# add extra libs/armeabi files in dist/default/libs/armeabi
|
||||||
# XXX to the same for x86 and v7a
|
# (same for armeabi-v7a, x86, mips)
|
||||||
add_libs_armeabi = config.getlist('app', 'android.add_libs_armeabi', [])
|
for config_key, lib_dir in (
|
||||||
for pattern in add_libs_armeabi:
|
('android.add_libs_armeabi', 'armeabi'),
|
||||||
matches = glob(expanduser(pattern.strip()))
|
('android.add_libs_armeabi_v7a', 'armeabi-v7a'),
|
||||||
if matches:
|
('android.add_libs_x86', 'x86'),
|
||||||
for fn in matches:
|
('android.add_libs_mips', 'mips')):
|
||||||
self.buildozer.file_copy(
|
|
||||||
join(self.buildozer.root_dir, fn),
|
patterns = config.getlist('app', config_key, [])
|
||||||
join(dist_dir, 'libs', 'armeabi', basename(fn)))
|
if not patterns:
|
||||||
else:
|
continue
|
||||||
raise SystemError(
|
|
||||||
'Failed to find libs_armeabi files: {}'.format(
|
self.debug('Search and copy libs for {}'.format(lib_dir))
|
||||||
pattern))
|
for fn in self.buildozer.file_matches(patterns):
|
||||||
|
self.buildozer.file_copy(
|
||||||
|
join(self.buildozer.root_dir, fn),
|
||||||
|
join(dist_dir, 'libs', lib_dir, basename(fn)))
|
||||||
|
|
||||||
# update the project.properties libraries references
|
# update the project.properties libraries references
|
||||||
self._update_libraries_references(dist_dir)
|
self._update_libraries_references(dist_dir)
|
||||||
|
|
Loading…
Add table
Reference in a new issue