2
0
mirror of synced 2025-02-22 22:38:18 +00:00

16 Commits

Author SHA1 Message Date
Hyang-Ah (Hana) Kim
60728759f9 bind: add const type support
Update golang/go#12475

Change-Id: I7fdc22462b5925c84ebbeb54517032c2fbd0545b
Reviewed-on: https://go-review.googlesource.com/15120
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-09-30 20:56:48 +00:00
Meir Fischer
00865a642f bind: improve readability for float default values
To improve readability for default numeric types
represented as strings, use 0.0 for floating point types.
(No tests make use of this change so golden update
not necessary; not significant enough for new test/test mod.)
Fix spelling on error statement; this was the only
instance of that spelling error in the repository.

Change-Id: I373890725b33da11c6780ba93674d89541bf758c
Reviewed-on: https://go-review.googlesource.com/13645
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-09-01 18:16:37 +00:00
Hyang-Ah (Hana) Kim
c384607ef3 bind: support for custom java package name and objective-c prefix.
Introduce options -javapkg and -prefix for gobind command.

The following generates java class Testpkg with package name com.example.

gobind -lang=java -javapkg=com.example testpkg

The following generates objective-c files where function and type names
are prefixed with ExampleTestpkg.

gobind -lang=objc -prefix=Example testpkg

As discussed in golang/go#9660 and golang/go#12245.

Gomobile support is not yet implemented.

Change-Id: Ib9e39997ce915580a5a2e25643c0c28373f27ee1
Reviewed-on: https://go-review.googlesource.com/13969
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-08-28 13:57:06 +00:00
David Crawshaw
4628c38e0f bind: handle unimplementable interfaces
Fixes golang/go#12330

Change-Id: I1568d04b7e48242105a7028ca471e2138f684eeb
Reviewed-on: https://go-review.googlesource.com/13946
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-08-27 21:36:14 +00:00
David Crawshaw
11fe695b54 bind: support fields with type error
Fixes golang/go#12328

Change-Id: I42872d26acb1c44522a64405cfa2d0f10fb24485
Reviewed-on: https://go-review.googlesource.com/13919
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-08-26 20:25:55 +00:00
David Crawshaw
48bd7cbbc7 bind: adjust invalid java package names
Updates golang/go#12273

Change-Id: I8eac3e84d5a473e9ffe45705cea88537573aef61
Reviewed-on: https://go-review.googlesource.com/13873
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-08-24 21:08:09 +00:00
David Crawshaw
b780379135 bind: vendor x/tools/go/loader
This breaks our dependency on the x/tools repository, which has a
tendency to change in unexpected ways. It also means we can use the
version of go/types that ships with Go 1.5.

Along the way, it appears that cgo processing has changed slightly.
The old check for cgo files apparently wasn't working, so I removed
it.

Change-Id: I14378e9df9cd65c5ab61b47728ba0d56f31cdf76
Reviewed-on: https://go-review.googlesource.com/12680
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-07-28 18:02:47 +00:00
David Crawshaw
f373bd373c bind: rename parameter p
Fixes golang/go#11064.

Change-Id: Idb4376f0143b0d1c8e87e7ccc54aae343b504e4a
Reviewed-on: https://go-review.googlesource.com/10689
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-06-04 17:29:43 +00:00
Hyang-Ah (Hana) Kim
d8725953a1 bind: remove an unused field from javaGen.
Change-Id: If1eab27d334c38288fb0c7cec3e4bf2143ddaf91
Reviewed-on: https://go-review.googlesource.com/10637
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-06-03 14:31:32 +00:00
Hyang-Ah (Hana) Kim
b658bfdf39 bind: support reference types as struct fields.
Reference types here mean pointers to struct types and
exported interface types. Previously, gobind generated invalid
go/java sources.

Change-Id: Icd666ebbb8edb70c613311798d602fd88cb4479c
Reviewed-on: https://go-review.googlesource.com/9997
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-05-14 19:48:46 +00:00
Hyang-Ah (Hana) Kim
4f4272d70b bind: fix Java code generation that takes reference type params.
Also fixes a parameter name handling problem when processing a
function signature that omits parameter names.

Fixes golang/go#10788.

Change-Id: I65273d330bbf3a836ec9e4ffb691927970d795d8
Reviewed-on: https://go-review.googlesource.com/9926
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-05-12 22:05:40 +00:00
Hyang-Ah (Hana) Kim
334412418f bind: replace {Read,Write}UTF16 with {Read,Write}String for string.
This is to enable more flexible encoding/decoding of Go string.
For Java, we use UTF16 to be compatible with java string.
For other languages, we will want other way to represent a string.

Change-Id: Iccd53e2eea18d37636c3c619d06cb473facef0cd
Reviewed-on: https://go-review.googlesource.com/8628
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-04-09 12:44:56 +00:00
Hyang-Ah Hana Kim
2b3c96656c cmd/gobind: implement interface method binding.
This change makes gobind to generate proper Go-side proxy code to
handle interface methods that have parameters and return values.

It allows gobind to accept struct pointer types as parameters
or a return value of a method.

Fixes golang/go#9487, golang/go#9488.

Change-Id: Id243c42ee0701d40e3871e392140368c2f8f9bc6
Reviewed-on: https://go-review.googlesource.com/2348
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-01-07 18:26:42 +00:00
Hana Kim
32f2370535 go.mobile/bind: include the bind invocation command in generated files.
This change also updates bind/testdata/*.golden.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/167160043
2014-11-10 13:46:47 -05:00
Andrew Gerrand
9470e0ba58 go.mobile: use golang.org/x/... import paths
LGTM=bradfitz, rsc
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/162710043
2014-11-10 08:55:57 +11:00
David Crawshaw
9f144f9410 go.mobile/bind: language binding generator
Details: http://golang.org/s/gobind

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/118240044
2014-07-31 15:09:13 -04:00