cmd/gomobile: fix bugs introduced by cl/17749

These bugs broke the example/audio app

1) Use of wrong index value for nmpkgs.
2) Must not use both armeabi-v7a and armeabi directories in an app.
   Only one of them will be scanned.

Change-Id: I0180405e35038db152058961a92c41bc39760a10
Reviewed-on: https://go-review.googlesource.com/17860
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Hyang-Ah Hana Kim 2015-12-15 10:54:54 -05:00
parent 6da7fa8e54
commit 1c29ae2e00
1 changed files with 5 additions and 5 deletions

View File

@ -54,7 +54,7 @@ func goAndroidBuild(pkg *build.Package, androidArchs []string) (map[string]bool,
}
libFiles := []string{}
nmpkgs := make(map[string]map[string]bool) // map: goarch -> extractPkgs' output
nmpkgs := make(map[string]map[string]bool) // map: arch -> extractPkgs' output
for _, arch := range androidArchs {
env := androidEnv[arch]
@ -168,13 +168,13 @@ func goAndroidBuild(pkg *build.Package, androidArchs []string) (map[string]bool,
for _, arch := range androidArchs {
toolchain := ndk.Toolchain(arch)
if nmpkgs[goarch]["golang.org/x/mobile/exp/audio/al"] {
if nmpkgs[arch]["golang.org/x/mobile/exp/audio/al"] {
dst := "lib/" + toolchain.arch + "/libopenal.so"
src := dst
if arch == "arm" {
dst = "lib/armeabi/libopenal.so"
src = "lib/armeabi/libopenal.so"
}
src := filepath.Join(ndk.Root(), "openal/"+dst)
if err := apkwWriteFile(dst, src); err != nil {
if err := apkwWriteFile(dst, filepath.Join(ndk.Root(), "openal/"+src)); err != nil {
return nil, err
}
}