2
0
mirror of synced 2025-02-23 14:58:12 +00:00

817 Commits

Author SHA1 Message Date
Elias Naur
4db6347e33 misc/androidstudio: add support for the android gradle plugin
The gobind plugin exposes a set of Go packages as a AAR file ready to be
used by and Android project. Unfortunately, being a library project
limits the Go packages to access only the Java API from the standard
library and the Android SDK.

This CL tightens the integration with the Android plugin to support access
to project dependencies such as the Android Support Library, to the generated
R.* resource classes and finally to the Android databinding classes.

When the gradle project has loaded the Android plugin, the generation of
the Go library is split in two.
First, the gobind tool generates the Java classes for the bound Go
packages. In this step, Go packages can access the standard Java and Android
libraries as well as project dependencies. After this step, Android
databinding layout files can refer to Go classes.
In step two, the gomobile tool generates the JNI libraries
with the Go implementation of the generated Java classes. In this
step, Go can access the standard Java and Android libraries,
dependencies as well as R.* and generated databinding classes.

Change-Id: If853ecabdbd01eec5f89d064a6bc715cb20a4d83
Reviewed-on: https://go-review.googlesource.com/30094
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-10-05 13:08:54 +00:00
Elias Naur
e76ec53021 bind: support casting of Java objects
Generate Cast functions that take a proxy for a Java class or interface,
and return a new proxy with the same reference. The Cast functions
panic if the underlying Java object is not an instance of the expected
type.

Change-Id: I08a5bf9a79139f0fac5dd102c7b028c8c989fc6d
Reviewed-on: https://go-review.googlesource.com/30095
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-10-05 08:40:06 +00:00
Elias Naur
69dc8e1c38 bind: allow implicit this argument on every exported method
Before this CL, the implicit `this` arguments to methods on Java classes
implemented in Go was only supported on overriding methods, because
their parameter count are known. This CL expands support for the `this`
parameter to every exported method. It only recognizes parameters named
`this` declared with a Java wrapper type.

Change-Id: I8a9d3417d259bdfcc28512a72f07d6a05f483adc
Reviewed-on: https://go-review.googlesource.com/30276
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-10-05 07:49:55 +00:00
Elias Naur
3f7b83ffd4 bind: generate Java constructors for every exported struct
A recent CL added Java constructors to generated classes that extends
or implements other Java classes and interfaces. Constructors for a
struct S are Go functions on the form

func NewS...(...) *S

If no such constructors exists, a default empty constructor is
generated.

Expand that to cover every exported Go struct.

Fixes golang/go#17086

Change-Id: I910aba13d5884c3f67c946c62a8ac4a3db8e2ea7
Reviewed-on: https://go-review.googlesource.com/29710
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-10-05 07:47:24 +00:00
Elias Naur
89b8360218 bind: remove error wrappers to preserve error instance identity
CL 24800 changed the error representation from strings to objects.
However, since native errors types are not immediately compatible
across languages, wrapper types were introduced to bridge the gap.

This CL remove those wrappers and instead special case the error
proxy types to conform to their language error protocol.

Specifically:

 - The ObjC proxy for Go errors now extends NSError and calls
   initWithDomain to store the error message.
 - The Go proxy for ObjC NSError return the localizedDescription
    property for calls to Error.
 - The Java proxy for Go errors ow extends Exception and
   overrides getMessage() to return the error message.
 - The Go proxy for Java Exceptions returns getMessage whenever
   Error is called.

The end result is that error values behave more like normal objects
across the language boundary. In particular, instance identity is
now preserved: an error passed across the boundary and back will
result in the same instance.

There are two semantic changes that followed this change:

 - The domain for wrapped Go errors is now always "go".
   The domain wasn't useful before this CL: the domains were set to
   the package name of function or method where the error happened
   to cross the language boundary.
 - If a Go method that returns an error is implemented in ObjC, the
   implementation must now both return NO _and_ set the error result
   for the calling Go code to receive a non-nil error.
   Before this CL, because errors were always wrapped, a nil ObjC
   could be represented with a non-nil wrapper.

Change-Id: Idb415b6b13ecf79ccceb60f675059942bfc48fec
Reviewed-on: https://go-review.googlesource.com/29298
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-10-04 09:11:42 +00:00
Elias Naur
84d710de20 bind: don't throw away result values with unknown type
The Java API wrapper generator use interface{} for Java classes
that no Go code references. Return values of unknown types are thrown
away, since they're effectively useless. Since the return values can
be used for nil checks and since casting of Java instances are
supported in CL 30095, this CL returns the naked *seq.Ref results
values instead.

Change-Id: I821b1c344a4c68c57fd34e2b655404e449de4c03
Reviewed-on: https://go-review.googlesource.com/30097
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-10-04 08:12:22 +00:00
Elias Naur
16fd47fa04 bind: don't inherit java.lang.Object methods to Java interfaces
Before, the Java generator let Java interfaces inherit java.lang.Object
methods. However, interfaces strictly doesn't inherit Object and since
the JNI GetMethodID returns NULL for Object methods on interface classes,
stop making Object a super class to interfaces.

Change-Id: I3757c1ed02c07ccffab74a30132d5197742c6513
Reviewed-on: https://go-review.googlesource.com/30096
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-10-01 18:55:04 +00:00
Elias Naur
e04a76eb64 cmd/gomobile,internal: add bootclasspath and classpath flags to gomobile
Add -bootclasspath and -classpath flags to the gomobile tool. In a
follow-up CL, the gobind gradle plugin will use them to support R and
databinding classes from Go.

Change-Id: Id33acf0c3fe1ec3908740b2a736ed241fa6391c2
Reviewed-on: https://go-review.googlesource.com/30092
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-09-30 20:31:20 +00:00
Elias Naur
9d5f7955ff bind: correctly generate methods with implicit this and parameters
Change-Id: I885a21876d9f639bc0996c9279fd0afefa93cef6
Reviewed-on: https://go-review.googlesource.com/29877
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-09-30 14:05:34 +00:00
Elias Naur
2dcaa053a0 bind: preserve no-arg Java constructors
When the Java class parser began culling unused constructors, the
logic for determining whether a given Java class has a no-arg
constructor broke when the no-arg constructor is culled. Add
an explicit field for tracking the no-arg constructor property.

Change-Id: Ib68929ae1108bd6fa1fd23de1d134332eb0d97a2
Reviewed-on: https://go-review.googlesource.com/29875
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-09-30 14:00:14 +00:00
Péter Szilágyi
1663ffa95c bind: initialize JNI library on any class load
With the introduction of constructors Java side, all types
become entry points into the library. However the library
was only initialized by the main class until now, resulting
in all other constructors hitting linker errors until an
interaction with the main library class.

This CL fixes that by changing each generated type to touch
the main library class, ensuring that the underlying native
library is loaded.

Change-Id: I640d1dc329e072f8d0753f74ccce87cd9e5aaea8
Reviewed-on: https://go-review.googlesource.com/29994
Reviewed-by: Elias Naur <elias.naur@gmail.com>
2016-09-29 11:31:45 +00:00
Elias Naur
9640137a86 bind: add missing unsafe import in generated code
The ClassGen.genGo function always uses unsafe, contrary to what
the check in GenGo says. With this CL, generated code always
imports unsafe if there are any classes to be generated.

Change-Id: Ic807111a26e494b4941790830b1950bb8b1f73d5
Reviewed-on: https://go-review.googlesource.com/29873
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-09-27 16:37:51 +00:00
Elias Naur
8b28d19931 example: fix Android examples
The Java methods names were recently changed to lowercase, but the
examples weren't updated. Fix that.

While we're here, comment out the GOPATH and GO settings from
the Go build.gradle file. They're confusing for the newcomer and only
needed in the rare case where GOPATH is wrong or missing or if go is
not in PATH.

Change-Id: Ib795b440a0127c402e56b70529f6bd71c6f1322b
Reviewed-on: https://go-review.googlesource.com/29594
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-09-22 17:09:31 +00:00
Elias Naur
bdf873ed8f bind,cmd: accept Java API in bound packages
Accept Java API interface types as arguments and return values from
bound Go package functions and methods. Also, allow Go structs
to extend Java classes and implement Java interfaces as well as override
and implement methods.

This is the third and final part of the implementation of the golang/go#16876
proposal.

Fixes golang/go#16876

Change-Id: I6951dd87235553ce09abe5117a39a503466163c0
Reviewed-on: https://go-review.googlesource.com/28597
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-09-22 10:16:33 +00:00
Elias Naur
08c3b2f4a5 bind: fix generated declaration of GoUniverseerror
GoUniverseerror is a (generated) protocol type, and variables of
protocol types use id<> notation.

Change-Id: I3d36b3ba634c10f0e59424faf71809c94df52cc6
Reviewed-on: https://go-review.googlesource.com/29052
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-09-21 06:52:53 +00:00
Elias Naur
bf31dd1a5e bind,cmd/gomobile: add a new generator for Java API wrappers
Using the new Java class analyzer API, scan the bound packages
for references to Java classes and interfaces and generate Go
wrappers for them.

This is the second part of the implementation of proposal golang/go#16876.

For golang/go#16876

Change-Id: I59ec0ebdae0081a615dc34d450f344c20c03f871
Reviewed-on: https://go-review.googlesource.com/28596
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-09-16 17:25:25 +00:00
Elias Naur
e4531be66f internal/importers: introduce package to analyze Java classes
The importers package adds functions to traverse the AST of a Go
file or set of packages and extract references to Java packages and
types.

The java package adds a parser that uses the javap command to extract
type information about Java classes and interfaces.

The resulting type information is needed to generate Java API wrappers
in Go.

This is the first part of the implementation of proposal golang/go#16876.

For golang/go#16876

Change-Id: Ic844472a1101354d61401d9e8c120acdee2519df
Reviewed-on: https://go-review.googlesource.com/28595
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-09-16 17:24:51 +00:00
Elias Naur
61011ba584 bind: fix error type
Errors was recently converted to use objects as representation instead
of strings. Issue golang/go#17073 exposed a few places that wasn't properly
updated. Fix them and add the test case from the the issue.

Fixes golang/go#17073

Change-Id: I0191993a8427d930540716407fc09032f282fc66
Reviewed-on: https://go-review.googlesource.com/29176
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-09-16 13:52:19 +00:00
Elias Naur
e99a906c3a bind: avoid ObjC reserved names
The new tests in CL 28494 exposed a bug: the ObjC generator does
not avoid reserved names and names with special meaning ("init").
Generalize the name sanitizer from the Java generator and use that.

Also, move the lowerFirst function to gen.go since it is now used
by both generators.

Change-Id: I25b7af2594b2ea136f05d2bab1cfdc66ba169859
Reviewed-on: https://go-review.googlesource.com/28592
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-09-07 14:13:50 +00:00
Elias Naur
7f59993615 bind/objc: fix tests
CL 24792 changed Go's int type to be represented in ObjC as long.
Change SeqTest.m accordingly.

Change-Id: Ifd34787db713444fc729b497ed72b62688384bc8
Reviewed-on: https://go-review.googlesource.com/28591
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-09-07 12:53:58 +00:00
Elias Naur
f52baf9a56 mobile/cmd/gomobile: fix test
Change-Id: I4c790d2156e6b167244ce3e4f5a37c1253e6e152
Reviewed-on: https://go-review.googlesource.com/28590
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-09-07 12:53:10 +00:00
Péter Szilágyi
2f75be449f bind: use lowercase method names for Java binds
There was a discussion a year ago about making methods and types
lowercase in ObjC (https://github.com/golang/go/issues/12889),
which was done (https://go-review.googlesource.com/#/c/15780/),
alas the suggested Java lower casing was never addressed.

This CL converts all generated Java methods to lower case.

Change-Id: Ia2f28519bc59362877881636109ddfc651b24960
Reviewed-on: https://go-review.googlesource.com/28494
Reviewed-by: Elias Naur <elias.naur@gmail.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-09-07 12:52:06 +00:00
Péter Szilágyi
f7e06c9519 exp/font: droid->noto fallback in tests
The Droid font has been superseeded by the Noto family upstream in
Android. This resulted in Debian and inherently Ubuntu too dropping
support for the first in favor of the latter. This CL ensures that
tests will pass on both older and newer debian based distros.

Refs:
 * https://github.com/googlei18n/noto-fonts/blob/master/FAQ.md#how-does-noto-relate-to-droid
 * https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804683

Fixes golang/go#16990

Change-Id: Id0820d6c3bfde7822984fac58054f7dcc4625685
Reviewed-on: https://go-review.googlesource.com/28495
Reviewed-by: Elias Naur <elias.naur@gmail.com>
2016-09-06 08:36:09 +00:00
Jaana Burcu Dogan
7573efae75 exp/audio: remove the high-level player
Since nothing about this high-level player will stay the same after
the audio work core types are finalized, there is no good point in
keeping the naive implementation around.

Removing also the audio example.

Updates golang/go#9551.

Change-Id: I5a7666c77e043aeacf44356e20e8d90822fd78e7
Reviewed-on: https://go-review.googlesource.com/27671
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: Jaana Burcu Dogan <jbd@google.com>
2016-08-24 22:21:38 +00:00
Elias Naur
ed036a869f mobile/bind: fix comment
Change-Id: I100d1a32da7ec4f6b29f3590f23ca0a9ddbf230a
Reviewed-on: https://go-review.googlesource.com/27442
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Sebastien Binet <seb.binet@gmail.com>
2016-08-22 14:31:51 +00:00
Elias Naur
80e11ad074 mobile/bind: move generated Java classes to package level
Before this CL, generated Java classes or interfaces were inner
classes to the top package class. That is both unnecessary and creates
ugly class names. Instead, move every generated class and interface to its
own package level class.

NOTE: This is a backwards incompatible change and requires every client
of gomobile APIs to be updated to leave out the package class in the
type names. For example, the Go type

package pkg

type S struct {
}

now generates (with the default java package name go) a Java class named
go.pkg.S. The name before this CL was go.pkg.Pkg.S.

Also, change the custom java package to specify the package prefix and
not the full package as before. This is an unfortunate change needed
to avoid name clashes between two bound packages. On the plus side,
the change brings the custom package case closer to the default behaviour,
which is a commen prefix, "go.", and a distinct java package for every
Go package bound.

Change-Id: Iadfaad56e101d1caf7e2a05006f4d384859a20fe
Reviewed-on: https://go-review.googlesource.com/27436
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-08-22 07:41:35 +00:00
Elias Naur
0ba4e6463d mobile/cmd/gomobile: remove explicit -p argument to the go cmd
Now that darwin/arm no longer use an explicit -p=1 in the go command
remove the explicit -p=<num cpus> from gomobile as well.

While we're here, fix the init test templates to reflect the new
clang based build.

Fixes golang/go#10477

Change-Id: I29a179e628466ae0c591620f485194b80e310811
Reviewed-on: https://go-review.googlesource.com/21186
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-08-16 10:53:25 +00:00
Daniel Skinner
8ab5dbbea1 event/size: document size pt approximation
Fixes golang/go#13366

Change-Id: I2af5e2492450ab5b5996fa5926460b62ce9d9bf5
Reviewed-on: https://go-review.googlesource.com/24865
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2016-08-04 01:15:58 +00:00
Hana Kim
f58d095fc5 exp/audio: add instruction for installing required package
The error message from cgo will print the line, which now
includes the instruction as a comment.

Change-Id: I208365b5b1e4da0bd6df89882586fe438f7391b4
Reviewed-on: https://go-review.googlesource.com/25384
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-08-01 16:20:48 +00:00
Alessandro Arzilli
cf96d36e8f event/key: add Compose key
Fixes #16332

Change-Id: I4fcd9c4c60fb5c32abaab5b68d3036d536ab2b69
Reviewed-on: https://go-review.googlesource.com/24880
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2016-07-21 02:17:49 +00:00
Elias Naur
efd7eed289 mobile/cmd/gomobile: upgrade to NDK r12b and add nm
gomobile build uses the nm tool which was missing from the NDK r12
upgrade. I missed it because gomobile bind works without it.

Make release.go include nm and upgrade to NDK r12b to make avoid
name clashes with the already released, but inadequate, NDK r12
files.

Finally, update the cmd/gomobile tests to match the new clang
reality.

Fixes golang/go#16268

Change-Id: Ic0cbf75785baace1fe6e88c8dc72d83ce2e13b35
Reviewed-on: https://go-review.googlesource.com/24724
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-07-11 14:34:23 +00:00
Hana Kim
f229b06003 cmd/gomobile: update doc and specify the min android API level
Change-Id: Ia065722ba3f6c793d19ecd05953f840beb0bdafb
Reviewed-on: https://go-review.googlesource.com/24791
Reviewed-by: Elias Naur <elias.naur@gmail.com>
2016-07-07 16:20:36 +00:00
Hana Kim
d38f5ba53d bind: map Go's int type to Objective-C's long type
https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/Major64-BitChanges/Major64-BitChanges.html

Fixes golang/go#16182

Change-Id: I312749e8a7113bf9231eb3896f801e450f46a410
Reviewed-on: https://go-review.googlesource.com/24792
Reviewed-by: Elias Naur <elias.naur@gmail.com>
2016-07-07 16:20:08 +00:00
Elias Naur
44ce26ee94 mobile/bind: fix gomobile bind with custom Java package
The change from using strings to objects for passing errors across
the language barrier broke the custom java package mode of gombile
bind. Fix it and add a runtime test to make sure it won't happen
again.

Fixes golang/go#16262

Change-Id: Ia7f8afb79556798056f0755758052190081a2dbb
Reviewed-on: https://go-review.googlesource.com/24800
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-07-07 16:08:17 +00:00
Elias Naur
8d3035464e mobile/cmd/gomobile: fix gomobile init on Windows
My previous CL, 24490, broke gomobile init for Windows users because
it failed to take the Windows ".exe" postfix into account everywhere.
Fix it by copying the entire "bin" directory from the llvm toolchain
instead of picking out certain named binaries.

Also, symlink (or, in Windows, copy) the clang lib64 directory into
each target platform where clang expects it.

Fixes golang/go#16233

Change-Id: I8d966ca76bd22403ac2eacef3da7aae59e698059
Reviewed-on: https://go-review.googlesource.com/24720
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
2016-07-07 08:58:53 +00:00
Nigel Tao
204c03cc80 event/mouse: add Button.IsWheel, ButtonWheelLeft and ButtonWheelRight.
Horizontal wheel events can come from some tilting scroll wheels, as
well as trackpoints (pointing sticks).

Change-Id: I02be43d44a65123e2d58539e291e9e6ac7e6bff4
Reviewed-on: https://go-review.googlesource.com/24633
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-07-02 00:00:04 +00:00
Nigel Tao
2d0a4d3322 event/mouse: add DirStep.
Change-Id: I4f9295ac2855928ecd43a5888ed776195c3129a5
Reviewed-on: https://go-review.googlesource.com/24639
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-07-01 22:50:24 +00:00
Elias Naur
34d472ecb6 mobile/cmd/gomobile: use NDK r12
Also:

- Replace GCC with Clang. GCC is slated for removal in future NDK
releases.
- Replace the deprecated obsoleted make-standalone-toolchain.sh
script with the new make_standalone_toolchain.py script.
- Add the NDK version to OpenAL tarball name, to avoid name clashes
with previous builds of the same OpenAL version.
- Removed obsolete workaround for a linker problem with NDK r10c.
- Update the URLs and unpack logic for the full NDK mode.

Change-Id: Ifeec6fee624862ba2ff2d4520dab42f800414f7b
Reviewed-on: https://go-review.googlesource.com/24490
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-06-29 15:33:04 +00:00
Elias Naur
d5b8fb1623 mobile/bind/java: fix compiler warnings
Add a missing #include to declare the exported Go function
setContext, and replace old GNU-style struct initializers.

Change-Id: Id1660559236c39505a47368a700c8e0ad834cf6c
Reviewed-on: https://go-review.googlesource.com/24491
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-06-28 17:54:14 +00:00
Elias Naur
a3e0621280 mobile/bind: use objects to pass errors across the language barrier
Gobind uses strings for passing errors across the language barrier.
However, since Gobind doesn't have a concept of a nil string, it
can't separate an empty native string from a nil string.

In turn, that means that empty errors, exceptions or NSError * with
an empty description are treated as no error. With ObjC, empty errors
are replaced with a default string to workaround the issue, while
with Java empty errors are silently ignored.

Fix this by replacing strings with actual error objects, wrapping
the Go error, Java Throwable or ObjC NSError *, and letting the
existing bind machinery take care of passing the references across.

It's a large change for a small corner case, but I believe objects
are a better fit for exception that strings. Error objects also
naturally leads to future additions, for example accessing the
exception class name or chained exception.

Change-Id: Ie03b47cafcb231ad1e12a80195693fa7459c6265
Reviewed-on: https://go-review.googlesource.com/24100
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-06-23 18:55:48 +00:00
Nigel Tao
3465f91246 app: change default window size to 600x800, on desktop.
The 3:4 aspect ratio is more phone-like than the 1:1 400x400.

Change-Id: Ifbc800b853159ea9eb4f255cb0acad2b34996ce6
Reviewed-on: https://go-review.googlesource.com/24143
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-06-16 23:44:42 +00:00
David Crawshaw
2bbe618778 gl: fix build on OS X
Also add missing switch cases which cause a compiler warning on OS X.
They are unused so far.

Fixes golang/go#16071

Change-Id: I5ced5a814a7abc956b0b0cdad211ecd69a54a95b
Reviewed-on: https://go-review.googlesource.com/24177
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-06-16 22:06:45 +00:00
David Crawshaw
3919ffce20 gl: a few more ES 3.0 functions
Nothing exciting, just exercising the layout of the functions.

Change-Id: I460fdc1c9596968bbdfdafe7d068ea393e0029ed
Reviewed-on: https://go-review.googlesource.com/24051
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2016-06-15 17:57:41 +00:00
David Crawshaw
4409fe621c gl: ES 3.0 constants
Change-Id: I3d2335948e88c21aa7da7c5d022da59f7fcbddc5
Reviewed-on: https://go-review.googlesource.com/24073
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2016-06-15 15:09:55 +00:00
Hajime Hoshi
d5e078356c x/mobile/gl: Fix macro definitions for iOS
Now `gomobile bind -target ios` tries to compile a lib with
`darwin/arm`, `darwin/arm64`, and `darwin/amd64`. In the last
case, a tag `ios` is always added. In `x/mobile/gl`, the last case
`darwin/arm64` was not considered well and causes a compile error.
This CL fixes this compile error.

Fixes golang/go#16067

Change-Id: I56be73f373d9985c067a07e5084fa6b9f1ef76a0
Reviewed-on: https://go-review.googlesource.com/24140
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-06-15 15:09:20 +00:00
Elias Naur
d53576ecbc bind: replace an incorrect return with continue
Change-Id: Ie929e60614b7a42ab7f65b500725168015946f87
Reviewed-on: https://go-review.googlesource.com/24080
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-06-14 16:25:23 +00:00
Hana Kim
6837d85185 cmd/gomobile: introduce the 'clean' command
The command deletes all files under $GOPATH/pkg/gomobile dir
that keeps downloaded files and precompiled objects during the
last gomobile init run.

'gomobile clean' will be suggested in case of gomobile init
failures due to downloaded file hash mismatch.

For golang/go#15973

Change-Id: Ie9d3cfa7aef9d68931fd68f7b58d1a18c9d4b3b8
Reviewed-on: https://go-review.googlesource.com/24074
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-06-14 16:05:07 +00:00
Hana Kim
1decf4c941 cmd/gomobile: mention how to specify target arch for bind
Change-Id: I7c2dd984e810165dc126ae1f65d72d8bba804e04
Reviewed-on: https://go-review.googlesource.com/24072
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-06-14 15:08:02 +00:00
Hana Kim
40167cfb81 example/ivy/android: fix a typo that caused a program bug
Additional '=' was added after '&',
but 0 != (a &= b) is still valid in java

Change-Id: I9c7b524941e0553c9fc5095adc5fc7819c4823b0
Reviewed-on: https://go-review.googlesource.com/23950
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-06-09 16:57:57 +00:00
David Crawshaw
b8e0f58304 gl: support for GL ES 3.0
This CL covers the basic structure for supporting ES 3.0 where the
platform provides it, and includes one ES 3.0 function as a
proof-of-concept. The rest of the functions and constant values will
follow in later CLs.

ES 3.0 is available everywhere except Android older than
version 4.3, approximately half of Android devices today:

https://developer.android.com/about/dashboards/index.html#OpenGL

Change-Id: Ief7714131227c447a0c603dadad0bd5285999bb3
Reviewed-on: https://go-review.googlesource.com/23821
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2016-06-09 14:35:26 +00:00