mobile: deprecate Dockerfile and document gomobile
Keeping the Dockerfile as a reference to setup a working dev env without gomobile init. Fixes #10523 Change-Id: Ie5a359baff2c3b65ac34045fb8ab5560a23c0e22 Reviewed-on: https://go-review.googlesource.com/9686 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This commit is contained in:
parent
66ea9e5b49
commit
a849359c3b
44
README.md
44
README.md
@ -2,45 +2,11 @@
|
|||||||
|
|
||||||
The Go mobile repository holds packages and build tools for using Go on Android.
|
The Go mobile repository holds packages and build tools for using Go on Android.
|
||||||
|
|
||||||
This is early work and the build system is a bumpy ride. Building a binary for
|
This is early work and installing the build system requires Go 1.5.
|
||||||
Android requires using a Go cross compiler and an external linker from the NDK.
|
Follow the build instructions on
|
||||||
|
[godoc.org/golang.org/x/mobile/cmd/gomobile](http://godoc.org/golang.org/x/mobile/cmd/gomobile)
|
||||||
For now, the easiest way to setup a build environment is using the provided
|
to install the gomobile command and
|
||||||
Dockerfile:
|
[build the basic example](http://godoc.org/golang.org/x/mobile/example/basic).
|
||||||
|
|
||||||
docker pull golang/mobile
|
|
||||||
|
|
||||||
Get the sample applications.
|
|
||||||
|
|
||||||
go get -d golang.org/x/mobile/example/...
|
|
||||||
|
|
||||||
In your app directory under your `$GOPATH`, copy the following files from either
|
|
||||||
the [golang.org/x/mobile/example/basic](https://github.com/golang/mobile/tree/master/example/basic)
|
|
||||||
or [golang.org/x/mobile/example/libhello](https://github.com/golang/mobile/tree/master/example/libhello)
|
|
||||||
apps:
|
|
||||||
|
|
||||||
AndroidManifest.xml
|
|
||||||
all.bash
|
|
||||||
build.xml
|
|
||||||
jni/Android.mk
|
|
||||||
make.bash
|
|
||||||
|
|
||||||
Start with `basic` if you are writing an all-Go application (that is, an OpenGL game)
|
|
||||||
or libhello if you are building a `.so` file for use from Java via
|
|
||||||
[gobind](https://godoc.org/golang.org/x/mobile/cmd/gobind). Edit the files to change
|
|
||||||
the name of your app.
|
|
||||||
|
|
||||||
To build, run:
|
|
||||||
|
|
||||||
docker run -v $GOPATH/src:/src golang/mobile /bin/bash -c 'cd /src/your/project && ./make.bash'
|
|
||||||
|
|
||||||
Note the use of -v option to mount $GOPATH/src to /src of the container.
|
|
||||||
The above command will fail if the -v option is missing or the specified
|
|
||||||
volume is not accessible from the container.
|
|
||||||
|
|
||||||
When working with an all-Go application, this will produce a binary at
|
|
||||||
`$GOPATH/src/your/project/bin/name-debug.apk`. You can use the adb tool to install
|
|
||||||
and run this app. See all.bash for an example.
|
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user