MCPcopy Index your code
hub / github.com/kivy/python-for-android / _unpack_aar

Method _unpack_aar

pythonforandroid/bootstrap.py:392–417  ·  view source on GitHub ↗

Unpack content of .aar bundle and copy to current dist dir.

(self, aar, arch)

Source from the content-addressed store, hash-verified

390 self._unpack_aar(aar, arch)
391
392 def _unpack_aar(self, aar, arch):
393 '''Unpack content of .aar bundle and copy to current dist dir.'''
394 with temp_directory() as temp_dir:
395 name = splitext(basename(aar))[0]
396 jar_name = name + '.jar'
397 info("unpack {} aar".format(name))
398 debug(" from {}".format(aar))
399 debug(" to {}".format(temp_dir))
400 shprint(sh.unzip, '-o', aar, '-d', temp_dir)
401
402 jar_src = join(temp_dir, 'classes.jar')
403 jar_tgt = join('libs', jar_name)
404 debug("copy {} jar".format(name))
405 debug(" from {}".format(jar_src))
406 debug(" to {}".format(jar_tgt))
407 ensure_dir('libs')
408 shprint(sh.cp, '-a', jar_src, jar_tgt)
409
410 so_src_dir = join(temp_dir, 'jni', arch.arch)
411 so_tgt_dir = join('libs', arch.arch)
412 debug("copy {} .so".format(name))
413 debug(" from {}".format(so_src_dir))
414 debug(" to {}".format(so_tgt_dir))
415 ensure_dir(so_tgt_dir)
416 so_files = glob.glob(join(so_src_dir, '*.so'))
417 shprint(sh.cp, '-a', *so_files, so_tgt_dir)
418
419 def strip_libraries(self, arch):
420 info('Stripping libraries')

Callers 1

distribute_aarsMethod · 0.95

Calls 4

temp_directoryFunction · 0.90
shprintFunction · 0.90
ensure_dirFunction · 0.90
formatMethod · 0.80

Tested by

no test coverage detected