Bug 1040945 - Part 2: Copy native libraries by name in AndroidEclipse backend make target. r=rnewman

This commit is contained in:
Nick Alexander 2014-09-04 20:11:15 -07:00
parent 04b45e0f6c
commit e51fe094e6
2 changed files with 18 additions and 12 deletions

View File

@ -691,7 +691,12 @@ main.recursive_make_targets += ['generated/' + f for f in gbjar.generated_source
main.extra_jars += [CONFIG['ANDROID_COMPAT_LIB']]
main.assets = TOPOBJDIR + '/dist/' + CONFIG['MOZ_APP_NAME'] + '/assets'
main.libs = TOPOBJDIR + '/dist/' + CONFIG['MOZ_APP_NAME'] + '/lib'
main.libs = [
(TOPOBJDIR + '/dist/' + CONFIG['MOZ_APP_NAME'] + '/lib/' + CONFIG['ANDROID_CPU_ARCH'] + '/libmozglue.so',
'libs/' + CONFIG['ANDROID_CPU_ARCH'] + '/libmozglue.so'),
(TOPOBJDIR + '/dist/' + CONFIG['MOZ_APP_NAME'] + '/lib/' + CONFIG['ANDROID_CPU_ARCH'] + '/libplugin-container.so',
'libs/' + CONFIG['ANDROID_CPU_ARCH'] + '/libplugin-container.so'),
]
main.res = None
cpe = main.add_classpathentry('src', SRCDIR,

View File

@ -176,17 +176,18 @@ class AndroidEclipseBackend(CommonBackend):
for cpe in project._classpathentries:
manifest.add_symlink(mozpath.join(srcdir, cpe.srcdir), cpe.dstdir)
# JARs and native libraries go in the same place. For now,
# we're adding class path entries with the full path to
# required JAR files (which makes sense for JARs in the source
# directory, but probably doesn't for JARs in the object
# directory). This could be a problem because we only know
# the contents of (a subdirectory of) libs/ after a successful
# build and package, which is after build-backend time. So we
# use a pattern symlink that is resolved at manifest install
# time.
if project.libs:
manifest.add_pattern_copy(mozpath.join(srcdir, project.libs), '**', 'libs')
# JARs and native libraries go in the same place. For now, we're adding
# class path entries with the full path to required JAR files (which
# makes sense for JARs in the source directory, but probably doesn't for
# JARs in the object directory). This could be a problem because we only
# know the contents of (a subdirectory of) libs/ after a successful
# build and package, which is after build-backend time. At the cost of
# some flexibility, we explicitly copy certain libraries here; if the
# libraries aren't present -- namely, when the tree hasn't been packaged
# -- this fails. That's by design, to avoid crashes on device caused by
# missing native libraries.
for src, dst in project.libs:
manifest.add_copy(mozpath.join(srcdir, src), dst)
return manifest