Looks like the binary is present on OS X even when Java is not
installed, and it returns an error when called.
Change-Id: Icbd42637f718a4fc05e65ea3973a584d1f24850e
Reviewed-on: https://go-review.googlesource.com/12743
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
windows and other non-mobile os support is not there yet.
Change-Id: Ie9c456b646bfa0b0c489e1b6344b5afca4801c5f
Reviewed-on: https://go-review.googlesource.com/12744
Reviewed-by: David Crawshaw <crawshaw@golang.org>
In order to make the artifacts of go build command preserved under WORK
directory, this change modifies TMPDIR (TEMP/TMP for windows)
environment variables to point to gomobile's tmpdir if -work flag is set.
> gomobile init -work
WORK=/gopath/pkg/gomobile/work-276689736
> ls /gopath/pkg/gomobile/work-276689736
README go-build823903592 openal
android-ndk-r10e go-build858075903
go-build365743399 go-build921886344
> gomobile build -work golang.org/x/mobile/example/basic
WORK=/tmp/gomobile-work-863381843
> ls /tmp/gomobile-work-863381843
go-build102034516 libbasic.so
> gomobile bind -work github.com/hyangah/ivy
WORK=/tmp/gomobile-work-355100962
> ls /tmp/gomobile-work-355100962
android go-build284034365 javac-output
androidlib go_ivy
Change-Id: I2f467e0063bc1c8b8c636a8cd6d100e86a99a91a
Reviewed-on: https://go-review.googlesource.com/12720
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Builders only have p=4.
Change-Id: I3e5d57579d26cb26f4ce29817a7bbdd8c34ad2ae
Reviewed-on: https://go-review.googlesource.com/12742
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Today we only look at direct imports of package main for an import of
golang.org/x/mobile/app, which is unfortunate. We also do a complete
package tree load using go/build looking for the OpenAL import when
building for android, which involves reading a lot of files.
The compiler and linker have already done all of this work for us.
Run nm on the output binary and extract package names from it.
Change-Id: Ie4f07befede5017bbca7d24325062369d4b5c30d
Reviewed-on: https://go-review.googlesource.com/12645
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This deflakes the TestIOSBuild test, which relies on the iteration
order. While here, use the existing contents to shorten the test
output comparison.
Fixesgolang/go#11889
Change-Id: Ib8c9592d07c53a12eee1f40267eaa2074b8d71cc
Reviewed-on: https://go-review.googlesource.com/12679
Reviewed-by: Burcu Dogan <jbd@google.com>
gomobile init should force download the NDK or the OpenAL package
if -u is set. -x should not print `curl` lines if cached archives
are being used.
Change-Id: I82ceb28540c22a0579ba9969bcf11477f1da81fb
Reviewed-on: https://go-review.googlesource.com/12701
Reviewed-by: David Crawshaw <crawshaw@golang.org>
seq.Transact is called when Go calls a method of a foreign object
that implements a Go interface. Currently, we assume that the foreign
object has an instance method that can conduct the message routing,
so the object id and the method code is sufficient for transact.
Passing the interface descriptor (e.g. go.testpkg.I) however allows
the bind internal to use non-instance methods to implement the routing.
Change-Id: I1f61a04f919fbd09117ea332d678cd50e4861e46
Reviewed-on: https://go-review.googlesource.com/12685
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This lets `gomobile build` work on a package that contains files all
protected as '// +build android'.
Change-Id: I22915aecda8674597cfe18e1f75d30e6bfc4aab7
Reviewed-on: https://go-review.googlesource.com/12640
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Drops the time for `gomobile init` on my machine from 46s to 30s.
Change-Id: Iab89f2e1d1cee4b414dc2fb1c735b4167aef9036
Reviewed-on: https://go-review.googlesource.com/12641
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Also add a few missing codes.
Change-Id: I26b6db31067c67107fe4db142ec9f48ff13cc53e
Reviewed-on: https://go-review.googlesource.com/12536
Reviewed-by: Nigel Tao <nigeltao@golang.org>
There is no way to distinguish an unknown format from
Mono8 because Mono8 is zero. The current CL fixes this
issue by starting the format constants from iota + 1.
Change-Id: I8c709cdaff3bc46bcc15ab770cfcfd04c186034d
Reviewed-on: https://go-review.googlesource.com/12386
Reviewed-by: Burcu Dogan <jbd@google.com>
Embedding is more trouble than it's worth. For example, the image/draw
package will pick the slow code paths for an embedded *image.RGBA.
Change-Id: I64bd20a80814b838850950c05dd8257e5901aef7
Reviewed-on: https://go-review.googlesource.com/12567
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Also, fixes the memory allocation bug - misuse of mem_ensure that caused
to allocate 72 bytes of memory to carry 16 bytes of data for instance.
Fixesgolang/go#11842.
Change-Id: I21798be2ec7adfb68cc2897bb46a924f05f3478c
Reviewed-on: https://go-review.googlesource.com/12577
Reviewed-by: David Crawshaw <crawshaw@golang.org>
mem_ensure is to ensure the remaining space in buffer
is large enough to hold extra size bytes. We've been passing
the target capacity instead of the number of extra bytes we
need.
Change-Id: Ic6f6ddb4ad22cbcdbc44eb4a58e6a415ae771fb2
Reviewed-on: https://go-review.googlesource.com/12578
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Finding the revision info from compiled binary (gomobile) built with
'go get' is not currently possible. What we can do instead is to check
if the current mobile repository found from GOPATH builds the same
binary by running 'go install -x -n' and checking if it outputs any
output. If so, this command prints out the revision info of the
repository. Otherwise, prints 'unknown'.
Sample output:
./gomobile version
gomobile version +27329c5 Wed Jul 22 19:29:08 2015 -0400 (android,ios);
androidSDK=/Users/hakim/Library/Android/sdk/platforms/android-22
./gomobile version
gomobile version unknown
Change-Id: Idc26c8a1dd3b43cc47a5c15ce130e2b97a460cec
Reviewed-on: https://go-review.googlesource.com/12455
Reviewed-by: David Crawshaw <crawshaw@golang.org>
The property was only introduced in 10.10, and doesn't offer us
anything more than what the method gives us.
Fixesgolang/go#11827.
Change-Id: I5a9f9b068b9f18acc85a68a37dae11f19df686a1
Reviewed-on: https://go-review.googlesource.com/12552
Reviewed-by: Andrey Petrov <shazow@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Currently version 0.2.1
I messed up previous versions and plugins.gradle.org doesn't let me
remove the bad versions.
Change-Id: I9eef512633b461ff5a7fcbe11a3e104efb250d61
Reviewed-on: https://go-review.googlesource.com/12538
Reviewed-by: David Crawshaw <crawshaw@golang.org>
non-varargs call of varargs method with inexact argument type for last
parameter
Change-Id: I7623951c365b8cf899a17ee784c8d4f3b4bdb198
Reviewed-on: https://go-review.googlesource.com/12528
Reviewed-by: David Crawshaw <crawshaw@golang.org>
First cut of events from physical keyboards.
Simple darwin/amd64 implementation.
Change-Id: I6e9d0a253387c841864ca9845ee729ea4f7573c7
Reviewed-on: https://go-review.googlesource.com/11815
Reviewed-by: Nigel Tao <nigeltao@golang.org>
EGL is a poor source of window dimensions. On some fraction of
rotations, it reported the old dimensions. Switch to extracting the
data from ANativeWindow, which appears to be more reliable.
While here, plumb through orientation, and follow the recommendation
in the Android platform docs to block onNativeWindowRedrawNeeded
until the draw is complete.
Fixesgolang/go#11741.
Change-Id: I6b29b6a1e5743c612c9af2a8cce4260c5d7e9ca6
Reviewed-on: https://go-review.googlesource.com/12381
Reviewed-by: Nigel Tao <nigeltao@golang.org>
iOS builds have been broken due to missing main executable. Xcode
doesn't complain and buildling the target .app bundle even if a
referenced objects doesn't exist.
Fixing .app builds and adding a unit test.
Change-Id: Ie9aec6c8c982a96c10bf07344e44bd501fcabd19
Reviewed-on: https://go-review.googlesource.com/12492
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
If the application main package is in
golang.org/x/mobile/example/basic
the generated application will have "Basic" as its name.
Change-Id: Ic59fae6e18c26e406ab352265aa2d6b11619c102
Reviewed-on: https://go-review.googlesource.com/12435
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This change allows the example/network from gomobile to compile
correctly.
Change-Id: Id0f722796e0224ec4a7c06b163a25a4f3a5fbcb3
Reviewed-on: https://go-review.googlesource.com/12471
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Tested manually, I can bind github.com/hyangah/ivy and include it
in an Xcode project.
Change-Id: I7dfa7828da7288841bc930d3e506ee97bf2ca520
Reviewed-on: https://go-review.googlesource.com/12388
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Tested:
go test golang.org/x/mobile/bind/java
gomobile bind -target={ios,android} github.com/hyangah/ivy
gobuild build -target={ios,android} golang.org/x/mobile/example/basic
(With various takes on -x and -v.)
Change-Id: I15c8f605490381feb6fefb482110f2a1c210529d
Reviewed-on: https://go-review.googlesource.com/12411
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Allows the use of -X, and similar flags.
Fixesgolang/go#11645.
Change-Id: I0ca097059f5f70c277c79eb89f2cbb10890db802
Reviewed-on: https://go-review.googlesource.com/12333
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This is done by moving app.Context to internal/mobileinit,
introducing mobileinit.SetCurrentContext and,
making bind/java depend on it.
TODO: check gomobile bind's proguard rule - context lookup
was implemented through reflection on android.app.AppGlobals class.
Change-Id: Ieb6ad503eeef8c2c1c5836a21c667938c5a701a2
Reviewed-on: https://go-review.googlesource.com/12279
Reviewed-by: David Crawshaw <crawshaw@golang.org>
The go command now has a -pkgdir flag, which specifies a directory
for all install output, including the standard library. Use it to
build the mobile compilers under $GOMOBILE, so that targets like
the iOS simulator (darwin/386) do not conflict with system targets.
The result is we no longer need GOROOT to be writable.
The iOS simulator now works with gomobile bind.
Fixesgolang/go#11342.
Change-Id: I0bc6378e0cb82e3175b2a1efe355e3ce39533649
Reviewed-on: https://go-review.googlesource.com/12303
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
First pass at bind support, simply produces .a/.h files.
In future CLs:
- Take the type defintion from seq.h and place it directly in the
generated header, breaking the user's dependency on seq.h.
Open question for future CLs:
- Should we create a framework directory?
If we bundle assets in the directory, can the asset package
find them automatically?
In 1.6: support multiple archives.
Change-Id: I7c3f655e7653018333e3ce3c89807edfcf62906d
Reviewed-on: https://go-review.googlesource.com/12199
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This allows gomobile bind to stop copying seq.h to the destination.
Change-Id: I4a23613fe0407500ad483ae9d8f6bb823d82f082
Reviewed-on: https://go-review.googlesource.com/12300
Reviewed-by: David Crawshaw <crawshaw@golang.org>