cmd/gomobile: replace stripped NDK with external NDK

Gomobile has up until now used stripped NDKs hosted by Google. This
arrangement adds maintenance overhead and blocks the use of custom
NDKs or custom API levels. Also, as noted in issue 16211, the stripped
NDK is no longer tiny because Gomobile supports more platforms.

This CL removed the code for generating and packaging stripped NDKs and
adds support for using external NDKs to the gomobile tool.

gomobile init will now use the NDK installed by the Android SDK manager,
if present, or a user specified NDK if the -ndk flag is given. If no
NDK was found or specified, Android initialization is skipped. gomobile
will instruct the user to run init with a valid NDK if bind or build is
invoked without Android initialization.

gomobile init will also attempt to build OpenAL for Android if the -openal
flag specifies a source directory. It needs cmake and, on Windows, nmake
installed. If gomobile build is run on an app that requires
golang.org/x/mobile/exp/audio/al and OpenAL wasn't built by init, the user
is instructed to do so.

Tested on Linux, macOS, Windows.

Fixes golang/go#16211
Fixes golang/go#18522

Change-Id: Ia38f6e43e671a207dad562678c65225b426e7e3e
Reviewed-on: https://go-review.googlesource.com/35173
Reviewed-by: David Crawshaw <crawshaw@golang.org>
10 files changed
tree: e362d6edbea52f18c435e1a59ae5247429b40877
  1. app/
  2. asset/
  3. bind/
  4. cmd/
  5. doc/
  6. event/
  7. example/
  8. exp/
  9. geom/
  10. gl/
  11. internal/
  12. misc/
  13. testdata/
  14. .gitattributes
  15. .gitignore
  16. AUTHORS
  17. codereview.cfg
  18. CONTRIBUTING.md
  19. CONTRIBUTORS
  20. LICENSE
  21. PATENTS
  22. README.md
README.md

Go support for Mobile devices

The Go mobile repository holds packages and build tools for using Go on mobile platforms.

Package documentation as a starting point:

Caution image

The Go Mobile project is experimental. Use this at your own risk. While we are working hard to improve it, neither Google nor the Go team can provide end-user support.

This is early work and installing the build system requires Go 1.5. Follow the instructions on golang.org/wiki/Mobile to install the gomobile command, build the basic and the bind example apps.


Contributions to Go are appreciated. See https://golang.org/doc/contribute.html.