Instead of the ad-hoc output directory structure to hold java source code
and compiled .so files, this change makes the bind command create an AAR
bundle. AAR is the format for Android library project/module outputs.
AAR is similar to .jar except that includes resource files.
http://tools.android.com/tech-docs/new-build-system/aar-format
This AAR format is in the Android's new build system's roadmap (
http://tools.android.com/tech-docs/jackandjill) and Android IDEs
are likely supporting the format.
For integration with Android Studio project, the user is expected to place
the .aar file to the main app's libs directory and specify the dependency
in the gradle rule. This can be done through a gradle plugin or with Android
Studio integration. For Buck, the .aar file can be the input of the
android_prebuilt_aar rule.
This depends on the availability of javac and android SDK -
which may not be an issue because the bind users will need them anyway
to build their main app.
Change-Id: I635902e994d002bb875c7838e19f172e187b0b87
Reviewed-on: https://go-review.googlesource.com/8084
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Change-Id: I2a41cf0f16dcefe87c73ab0a8f02a251c1243157
Reviewed-on: https://go-review.googlesource.com/8121
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
filepath.Join returns a Cleaned path that went through FromSlash.
Change-Id: I23afeea32453c3eb271d4e4bf47147940061c20f
Reviewed-on: https://go-review.googlesource.com/7161
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Change-Id: I415a6c4693be340ff8236d5f56c3c00fa95ce2e0
Reviewed-on: https://go-review.googlesource.com/6822
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: I1a7282fcb31d778ff12d7a655eadbac1a01e584b
Reviewed-on: https://go-review.googlesource.com/6720
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Also moved the full ndk fetch into a separate function.
Change-Id: Ib5c4687e98a5d92ff3aa3ca99ec0ebee85d31f86
Reviewed-on: https://go-review.googlesource.com/6662
Reviewed-by: David Crawshaw <crawshaw@golang.org>
context: https://go-review.googlesource.com/6510
Windows env var names are case insensitive and may contain "=".
Before merging, apply strings.ToUpper. Pass env vars that are not
in "key=value" form untouched.
Change-Id: I0d51d2f3bc64fcee72f765c04c550299d7b285e9
Reviewed-on: https://go-review.googlesource.com/6513
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This change makes bind remove existing symlinks to Go.java, Seq.java in outdir
and overwrites them with new paths.
Change-Id: I2d24fbfd04a2bee94c0fa220fa0bba2ec600ae4c
Reviewed-on: https://go-review.googlesource.com/5883
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This brings the semantics a little closer to the Go tool.
I find it surprisingly useful for testing if android-specific
changes to a package compile.
Change-Id: I9f5730f678eb418fc5659fa82c1fe9b78a084e33
Reviewed-on: https://go-review.googlesource.com/5741
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
The State can be used in the Start callback (and lazily-initialized
packages) instead of JavaInit. This stores a reference to the
android.context.Context for the (future) keyboard package and for
setting TMPDIR.
Second attempt at https://golang.org/cl/4400.
Change-Id: I673997b26ab25ce5140cb31950593d8c6dbd9c51
Reviewed-on: https://go-review.googlesource.com/5555
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Compare the output of gomobile init -x -n with what's expected.
Change-Id: Ib797c900b0a4cf1573395f8ffeb9a662a0fd6154
Reviewed-on: https://go-review.googlesource.com/5080
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This feature is necessary when the cross compilers need to be rebuilt
because the goroot has been updated but the ndk version has not changed, or
when rebuilding is required but there is no network.
Currently the test for usable ndk compilers is simply checking
the presence of a file that's created after the ndk tool chain is installed
in the $GOPATH/pkg/gomobile/androind-<ndkversion> directory.
The -u option forces update of the ndk tool chain regardless.
Change-Id: I3d4f62266d436ddc52d158877f08481f92a6a690
Reviewed-on: https://go-review.googlesource.com/5140
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Each cross compiler needs tools that are stored under
GOROOT/pkg/tool/GOHOSTOS_GOHOSTARCH: 5g, 5l, etc. This means a
single GOROOT is incompatible with multiple cross compilers for
different GOOS targets that share a GOARCH. In particular, it
means android/arm and darwin/arm cannot co-exist.
To avoid conflicting paths, this CL installs the cross-compiler
tools under GOPATH/pkg/gomobile. The Go tool is instructed to
use them using the new -toolexec flag. This means far less
meddling in the user's GOROOT.
Unfortunately, the standard library .a files (and textflag.h/funcdata.h)
must still be installed under GOROOT/pkg/GOOS_GOARCH. However this path
does not conflict across cross compiler toolchains, nor with the host
toolchain.
Change-Id: I088142281cf441365072c77f4cb73683b5ffd0ce
Reviewed-on: https://go-review.googlesource.com/5040
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
1) add subcommand in the usage printout.
2) exit after printing out usage during flag parsing.
Change-Id: I57da849eca3c297f67437bdee1d36e5d340c2a58
Reviewed-on: https://go-review.googlesource.com/4836
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Change-Id: Iaaf72a06cc64e50e62c9282c95ab28317e4c915a
Reviewed-on: https://go-review.googlesource.com/4740
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: Ia325048a565ece9f606363869fb4e27e04c7513a
Reviewed-on: https://go-review.googlesource.com/4741
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Besides being useful for debugging, I intend to use these in a
followup CL to write some simple tests.
Change-Id: I9420c0b72111bcc86ce0330886106221aab533ba
Reviewed-on: https://go-review.googlesource.com/4690
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
debugCert is now defined in build.go.
Change-Id: Iaa3d2257cb48378991ae03c99d0c71d8506281c2
Reviewed-on: https://go-review.googlesource.com/4600
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Change-Id: I8c74a3fd52e0978349061c53dd3305174ea441ee
Reviewed-on: https://go-review.googlesource.com/4580
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
init command uses the first path in the GOPATH path list.
build command searches all path elements until it finds the one
with the compiler tool chain.
Change-Id: Ia2914243965a5ef56546ff6e75af22f49457d07d
Reviewed-on: https://go-review.googlesource.com/4560
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Several standard Go tool flags are not supported yet, those will
come in followup CLs.
Change-Id: I1d98afccf3063d7a3313f66b9fd57067fcfa5297
Reviewed-on: https://go-review.googlesource.com/4450
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: I52dcc241e340813ff2cc575c42d92c59bef91ce1
Reviewed-on: https://go-review.googlesource.com/4410
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
For some target languages, gobind will need to output multiple files.
(e.g. objective-c) -output flag is not compatible with such cases.
Change-Id: I6da6109ae75c3aaa7d7379d411df2bb14c88bbc2
Reviewed-on: https://go-review.googlesource.com/4120
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Change-Id: I879e51834726c8713c5befeb4be2e328d5295af4
Reviewed-on: https://go-review.googlesource.com/4110
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: I792edeed6bf8309084281eebcdba7d4b6c6a0818
Reviewed-on: https://go-review.googlesource.com/4181
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Files go in, a .apk file comes out. Effective testing depends
on the aapt tool being installed.
Change-Id: I10daaabe9090c10181d9a83b876a934d540023d3
Reviewed-on: https://go-review.googlesource.com/3049
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Does the equivalent of jarsigner for APKs.
Change-Id: Ie55ddb22ef9f56062034b091c9477fd9e9196310
Reviewed-on: https://go-review.googlesource.com/2904
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: Ibbdd19990ecb64535baa55f81bbe7f2abcf118fd
Reviewed-on: https://go-review.googlesource.com/2653
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: Ieac721b486155679f3de2baa13c69d50d63dce3b
Reviewed-on: https://go-review.googlesource.com/2652
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>