Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: mojo/go/sample_app/README.txt

Issue 647573004: -Add README for building go sample application (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: README modifications. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/go/rules.gni ('k') | mojo/go/tests/README.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/go/sample_app/README.txt
diff --git a/mojo/go/sample_app/README.txt b/mojo/go/sample_app/README.txt
index fbe0c9c3d90494ed32e9844a87437603af335cfa..86c4fb294c774de6822384afbe2e37209c55d25f 100644
--- a/mojo/go/sample_app/README.txt
+++ b/mojo/go/sample_app/README.txt
@@ -2,19 +2,32 @@ Sample Go application that can be loaded into a mojo shell running on Android.
The application exports a MojoMain entry point for the shell and then makes
a GetTimeTicksNow system call.
-Build instructions
-gn args <output_directory>
+Setup instructions
+
+1) Generate the NDK toolchain for the android platform you plan to use.
+
+$ cd mojo/src/third_party/android_tools/ndk
+$ NDK_ROOT=$HOME/android/ndk-toolchain
+$ ./build/tools/make-standalone-toolchain.sh --platform=android-14 --install-dir=$NDK_ROOT
+$ NDK_CC=$NDK_ROOT/bin/arm-linux-androideabi-gcc
+
+2) Download/Install the Go compiler.
+
+$ unset GOBIN GOPATH GOROOT
+$ hg clone https://code.google.com/p/go
+$ cd go/src
+$ CC_FOR_TARGET=$NDK_CC GOOS=android GOARCH=arm GOARM=7 ./make.bash
+$ ls ../bin/go
+
+3) Now, we switch to the Mojo workspace and build the sample application.
+
+$ cd mojo/src
+$ gn args <output_directory>
Set the following arguments
mojo_use_go=true
-go_build_tool=<go_binary_location>
+go_build_tool="<path_to_go_binary>"
os="android"
-gn gen <output_directory>
-ninja -C <output_directory> go_sample_app
-
-You can now following instructions from the below link to run the app.
-http://dev.chromium.org/developers/how-tos/run-mojo-shell
-
-Start the Go application.
-./build/android/adb_run_mojo_shell http://127.0.0.1:4444/go_sample_app
+$ gn gen <output_directory>
+$ ninja -C <output_directory> go_sample_app
« no previous file with comments | « build/go/rules.gni ('k') | mojo/go/tests/README.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698