This allows a subsequent CL to introduce windows support by directly
calling an ANGLE dll.
For golang/go#9306
Change-Id: I7dbe8f2b77b9e2c744f0d848f716ee4448916fe7
Reviewed-on: https://go-review.googlesource.com/17674
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
These tar.gz include x86, x86_64 tools and libraries.
This CL will be submitted once the files are available from dl servers.
Updates golang/go#10743
Change-Id: I4dd59221f392d6daf4d13ab7af38d01b8e6f4546
Reviewed-on: https://go-review.googlesource.com/17560
Reviewed-by: David Crawshaw <crawshaw@golang.org>
3x the stripped ndk size - still smaller than the full NDK archive
(400MB vs 120MB)
Update golang/go#10743
Change-Id: I38e2abb01c64d38adbb5de55347ad92a9031aba6
Reviewed-on: https://go-review.googlesource.com/17502
Reviewed-by: David Crawshaw <crawshaw@golang.org>
As discussed in golang/go#12245
Usage: gomobile bind [options] a.b.c x.y.z
For ObjC, gomobile bind will generate GoC.{h,m} and GoZ.{h,m}. If
-prefix=App is specified it will generate AppC.{h,m} and AppZ.{h,m}.
Tested on Darwin.
Change-Id: I6af8539a0fb7ed6256f3773efc514eff436014b4
Reviewed-on: https://go-review.googlesource.com/17475
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This removes the last dependency on an Android class in the running
gobind code. (Tests still need some work before they will run on the
desktop.)
Change-Id: I49bfb545d4587c6f430c0938fa1ca4d513b56d77
Reviewed-on: https://go-review.googlesource.com/17252
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Fixesgolang/go#13407
Also updates bind test.
'gomobile bind' currently runs 'go install' first and generates code
from the compiled object. This makes the -i option unnecessary.
Updated the bind command doc not to mention the -i option.
The use of -i option from Android Studio GoBind plugin will be removed
in a separate CL.
Change-Id: Ie48c00874219adb5169e01d3ba61930728cf2314
Reviewed-on: https://go-review.googlesource.com/17253
Reviewed-by: David Crawshaw <crawshaw@golang.org>
The aim of the RefTracker is to "... pin Java objects so
they don't get GCed while the only reference to them is
held by Go code." But in the case of null objects there is
nothing to GC. Therefore we do return a single Ref which
contains a null object, but we ignore the logic that is used
to pin for GC purposes.
Change-Id: If3771ec0180d09485963c3297abccb39a1a8d9ab
Reviewed-on: https://go-review.googlesource.com/13647
Reviewed-by: David Crawshaw <crawshaw@golang.org>
As discussed in golang/go#12245
Usage: gomobile bind [options] a.b.c x.y.z
For java gobind and gomobile will generate go.c.C.java and go.z.Z.java.
If -javapkg=com.example is specified they will generate
com.example.C.java and com.example.Z.java.
Tested on Darwin.
Change-Id: Ia8e57c8fec7967131d55de71cc705d9e736ccca0
Reviewed-on: https://go-review.googlesource.com/17023
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html
"This can occur if the domain name contains a hyphen or other special
character, if the package name begins with a digit or other character
that is illegal to use as the beginning of a Java name, or if the
package name contains a reserved Java keyword, such as "int". In this
event, the suggested convention is to add an underscore."
The sanitized name is used for the app package name and the default apk
file name.
Update golang/go#12273
Change-Id: I76d7f423e87c54a5bb7ab71ec251fd3a26da9722
Reviewed-on: https://go-review.googlesource.com/16875
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Replace the vendored version of x/tools/go/loader with the standard
library's go/importer package. This reads the export data from
$GOPATH/pkg/pkgname.a instead of parsing and type checking the source
code. The "go install" subcommand is invoked just prior to reading
the export data to make sure the export data is up to date.
Not yet tested on darwin, but working for android builds.
Change-Id: I24aa60aa46b843d30bc5833e3035699900bf3df4
Reviewed-on: https://go-review.googlesource.com/16913
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Pulled out of golang.org/cl/16913.
Change-Id: I041aba4e8cefed95ee2935139571140164b5d677
Reviewed-on: https://go-review.googlesource.com/17001
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Second attempt at the change reverted in golang.org/cl/16917.
The current code executes go install -buildmode=c-shared std, which
does nothing. (See golang/go#13234.)
Correctly compiling packages for android arm requires different
flags on Go 1.5 and 1.6, as we now build PIC. So we look for go1.5
in the output of "go version", and otherwise assume 1.6+.
Change-Id: If636f52be5019bd179483b8735630a98e6f8d201
Reviewed-on: https://go-review.googlesource.com/16928
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This reverts commit b84795b4945bb0ca4d464ffff3cba37d2ff049c5.
See golang/go#13246
Change-Id: Ie8b89a9ac6e5b6906b3a4de21122d694cf7a2d0a
Reviewed-on: https://go-review.googlesource.com/16917
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Replace the vendored version of x/tools/go/loader with the standard
library's go/importer package. This reads the export data from
$GOPATH/pkg/pkgname.a instead of parsing and type checking the source
code. The "go install" subcommand is invoked just prior to reading the
export data to make sure the export data is up to date.
This has the advantage of relying entirely on the go tool for correctly
resolving and parsing dependencies of the package being bound. (For
example, a bound package can now depend on cgo.) It also removes a class
of bugs where the version of the loader we depend on can get out of sync
with the go tool. (For example, gobind now correctly handles vendor
dependencies.)
As a bonus, for packages with significant dependencies this approach
should also be noticeably faster as we do not need to parse and
typecheck all of the dependencies.
Change-Id: If9a431c137eae2071c1d89be88a4a6a61d6812fa
Reviewed-on: https://go-review.googlesource.com/16911
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Turns out that go install -buildmode=c-shared std does nothing. The go
tool filters all non-main packages from c-shared builds, which for the
standard library is all packages.
This may be a bug in the go tool. I'm not sure yet. But either way, to
make the gomobile tool work with Go 1.5, work around it here.
Change-Id: Ica1e7eeb0f40a21a2c78b0c55bdc54f133a32ee5
Reviewed-on: https://go-review.googlesource.com/16912
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
error message example:
gomobile: unsupported named type github.com/sridharv/bugreports/typealiasmissing.Alias
Objective-C and Java generation code currently panics, which need to be
fixed separately. (See TODO in bind/seq.go)
Fixesgolang/go#13190
Change-Id: Ie46dc58ea800522b8ab7cb8ac662ad561e0ca82e
Reviewed-on: https://go-review.googlesource.com/16780
Reviewed-by: Burcu Dogan <jbd@google.com>
Style identifiers for included themes were selected based on
api level <= 9.
Fixesgolang/go#13018
Change-Id: I6be19a90b65ad5cbd78ff73fe2d9a71b8e3908ca
Reviewed-on: https://go-review.googlesource.com/16159
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Testing BinaryXML for the change was non-trivial as the first 4 bytes
of gomobile output did not match the latest version of aapt's output.
A new approach to testing compatibility was added based on how the
aapt tool pretty prints xmltree of manifest's contents.
Fixesgolang/go#10943
Change-Id: I5c60af10931d9693dbeaff66f23a69042a78e8fa
Reviewed-on: https://go-review.googlesource.com/16150
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
The underlying implementation was not enabling the sensors on a
particular sender even though the Enable signature accepts different
instances of Sender to enable.
Consider the following program:
type A struct{}
func (a A) Send(ev interface{}) {}
type B struct{}
func (b B) Send(ev interface{}) {}
sensor.Enable(A{}, sensor.Gyroscope, time.Millisecond)
sensor.Enable(B{}, sensor.Accelerometer, time.Millisecond)
is going to compile but only A will be notified when there are new
gyroscope and accelerometer events.
In order to improve the misleading APIs, this CL introduces a
Notify function that users can register a Sender implementation to
listen the changes. If set nil, the sensor package will keep
reading the events but will won't notify.
sensor.Notify(A{})
sensor.Enable(sensor.Gyroscope, time.Millisecond)
sensor.Enable(sensor.Accelerometer, time.Millisecond)
Change-Id: I25e43349e4ae682930baa2d32430f46f24b588b7
Reviewed-on: https://go-review.googlesource.com/15650
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Added recently, but I forgot to update the test.
Fixesgolang/go#12983
Change-Id: I668b20d74c6b91d9588e6f252939d36ae780bd77
Reviewed-on: https://go-review.googlesource.com/16052
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
for example,
package testpkg
var AnInt int64
will be mapped to
@interface GoTestpkg: NSObject
+ (int64_t) AnInt;
+ (void) setAnInt:(int64_t)v;
@end
Followup of cl/15340
Update golang/go#12475
Change-Id: Ie26c92af977fc3dd62dcad2b10c6a5c1c1b8941b
Reviewed-on: https://go-review.googlesource.com/15770
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Fixesgolang/go#12911
Note: the x11 support seems outdated in general compared to
android, darwin versions.
Change-Id: I2a80215c62b8c3cf87c5eb054184fea10819abc9
Reviewed-on: https://go-review.googlesource.com/15790
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Naked returns must be used for self-documentary reasons. In this
unexported package, it is not useful to name return values.
The change has been contributed on a previous CL but I don't know
what happened, it should have been lost on a bad merge.
Change-Id: I6cb9c3a58ad397aeb646f3e57e482628fe31ca31
Reviewed-on: https://go-review.googlesource.com/15658
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
readEvents never return an error, readSignal should not have an
error field.
Change-Id: I9566a6905ee678599fdad18f85ae55d1fdc16cc1
Reviewed-on: https://go-review.googlesource.com/15550
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Several notices, notes and questions have become obsolete when
CL/15438 is merged. Removing the TODOs pointing to the bug explained
in CL/15438's description.
Change-Id: I8a94507a6d0aa507a58be451336eba36dd383d64
Reviewed-on: https://go-review.googlesource.com/15551
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>