This CL is a pure refactoring to remove a global variable.
Change-Id: I996c6a15354163e90148bc2540bda6b56296271c
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/208057
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This is a preparation to use Go modules at gomobile-bind.
Updates golang/go#27234
Change-Id: I33684888b4181cc1ebd4d3c8872a6b2e62950855
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/206777
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This change removes the usages of go/build and go/import, that don't
work with Go module.
Before this change:
1) Package information is retrieved by go/packages
2) Files for reverse bindings are generated
3) Package information is retrieved by go/imports
After this change, only 3) will be changed:
3) Package information is retrieved by go/packages again only when
reverse binding is used.
This is preparation to support Go modules.
Updates golang/go#27234
Change-Id: I1997f71f23455fdd3b3c6b2643d35ec33ad147a3
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/203399
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This is preparation to support Go module.
Updates golang/go#27234
Change-Id: I8dcaed231e877e81d2072c7c85321c0acb6a8b1b
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/203397
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
bind_test.go compares the generated Go files against golden files
checked in the repository. The bind package formats some of the
generated Go files, so any changes in the go formatter can break
the tests.
This change makes the test more robust by applying formatting based
on the currently used go version. Since a golden file often
includes multiple go files generated by the bind, the `gofmt`
function splits the golden file using the gobindPreamble marker
and then run format.Source for each chunk. In order to ease the
golden file splitting, this CL also moves the gobindPreamble
to the beginning of each generated file consistently.
It turned out bind omits formatting for some go files (generated
for reverse binding). That needs to be fixed but it is a much
bigger fix. Thus, in this CL, we apply the formatting on the
bind's output as well.
This CL also updates the gobindPreamble to follow the style guide
for generated code. https://golang.org/s/generatedcodeFixesgolang/go#34619
Change-Id: Ia2957693154face2848e051ebbb2373e95d79593
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/198322
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Add the "-trimpath" flag from Go 1.13.
Change-Id: I10938fb5f7efd701f4025e451ddf438dc3e011ee
GitHub-Last-Rev: 4e82381342e2c13c318514800bc82af7f6ed9e1a
GitHub-Pull-Request: golang/mobile#39
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/196877
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reverse binding is not available with Go module, and some tests
fail due to this. This CL suppresses the errors by disabling Go
modules explicitly.
Updates golang/go#27234
Change-Id: I7483c1dab468548a2efa05ca426addf5c3d97b6e
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/192599
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
* Correctly format build tags to pass into go/packages
* Removes CGO_ENABLED=0 from a packages.Load configuration
* Calls go/packages.Load twice to work around a build cache
* staleness issue
These bugs were introduced by CL 189597.
Updates golang/go#27234.
Updates golang/go#33687.
Change-Id: I3ae6737bf53bbecda0c7e25885b9c6aea5779332
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/190479
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
This is a non-test code version of CL 191517.
Using 'go' command in tests is confusing when using a different version
of Go (e.g., go1.13rc1). Use GOROOT/bin/go so that the same Go is used.
Change-Id: Id5937cfa6dd6d3164d5f774e3fc0fd15b7f613b5
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/191518
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Using 'go' command in tests is confusing when using a different version
of Go (e.g., go1.13rc1). Use GOROOT/bin/go so that the same Go is used.
Change-Id: I0ca297207acc5e7fd8b291f544302f6c7b0d38e1
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/191517
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
This CL is a pure refactoring to replace go/build usage with
golang.org/x/tools/go/packages. This is a preparation for Go
modules.
Updates golang/go#27234
Change-Id: I3e6a30b962da1a64bc43a89a7f02c03d559f86d3
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/189597
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
The dummy implementation doesn't do anything (at runtime), but it does
compile (when CGO_ENABLED=0), which e.g. unbreaks some build bots.
The work_other.go file is new, faking what's in work.go.
The changes to the other (existing) files simply re-order the
GOOS-related build constraints to be in a consistent order (alphabetical
order), the same as the existing order in work.go.
Fixesgolang/go#32837
Change-Id: I19a196d4307b9ebc2f770fe41e1aec717a699288
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/185017
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Previously any library created using gobind used reflection to get the ApplicationContext. The methods used are disallowed in Android 9 causing any library to crash. However the ApplictionContext is not required and only needed when using RunOnJvm. This change adds an method to set the ApplicationContext when needed, but will not get it by default by using reflection.
Fixes#31364
Change-Id: I83ce69f3b4b59d2cc4a275928f0439e5e4651ba8
GitHub-Last-Rev: b563af1d7fa8f4b3e62751ce9a78c8e2f291d232
GitHub-Pull-Request: golang/mobile#31
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/175103
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
previously package level function comments are ignored. this change
keeps the comment in generated java files
Change-Id: I86dcd93b1026c4455d2c4782cbc9f30b514b3107
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/181038
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
The `TestObjcSeqWrappers` test is failing because there are some missing nullability specifiers:
```
mobile master❯ go test -v ./bind/objc -run TestObjcSeqWrappers
=== RUN TestObjcSeqWrappers
--- FAIL: TestObjcSeqWrappers (5.45s)
seq_test.go:80: tmpdir = /var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/bind-objc-seq-test-434219564
seq_test.go:98: gomobile: darwin-arm: go build -tags aaa bbb ios -buildmode=c-archive -o /var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/objcpkg-arm.a gobind failed: exit status 2
# gobind
In file included from /var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/interfaces_darwin.go:5:
In file included from /var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/interfaces.h:8:
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:26:30: error: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Werror,-Wnullability-completeness]
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:26:30: note: insert '_Nullable' if the pointer may be null
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:26:30: note: insert '_Nonnull' if the pointer should never be null
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:28:11: error: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Werror,-Wnullability-completeness]
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:28:11: note: insert '_Nullable' if the pointer may be null
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:28:11: note: insert '_Nonnull' if the pointer should never be null
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:38:32: error: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Werror,-Wnullability-completeness]
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:38:32: note: insert '_Nullable' if the pointer may be null
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:38:32: note: insert '_Nonnull' if the pointer should never be null
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:39:23: error: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Werror,-Wnullability-completeness]
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:39:34: note: insert '_Nullable' if the pointer may be null
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:39:34: note: insert '_Nonnull' if the pointer should never be null
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:50:35: error: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Werror,-Wnullability-completeness]
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:50:35: note: insert '_Nullable' if the pointer may be null
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:50:35: note: insert '_Nonnull' if the pointer should never be null
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:52:29: error: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Werror,-Wnullability-completeness]
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:52:29: note: insert '_Nullable' if the pointer may be null
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:52:29: note: insert '_Nonnull' if the pointer should never be null
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:52:70: error: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Werror,-Wnullability-completeness]
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:52:70: note: insert '_Nullable' if the pointer may be null
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:52:70: note: insert '_Nonnull' if the pointer should never be null
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:58:52: error: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Werror,-Wnullability-completeness]
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:58:52: note: insert '_Nullable' if the pointer may be null
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:58:52: note: insert '_Nonnull' if the pointer should never be null
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:58:26: error: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Werror,-Wnullability-completeness]
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:58:26: note: insert '_Nullable' if the pointer may be null
/var/folders/cm/184j3xgn311dhh1tpm6cbmyr0000gn/T/gomobile-work-254743475/src/gobind/Objcpkg.objc.h:58:26: note: insert '_Nonnull' if the pointer should never be null
seq_test.go:99: failed to run gomobile bind: exit status 1
FAIL
FAIL golang.org/x/mobile/bind/objc 5.454s
```
I've decided to set them as `_Nullable`. Even if the implementation seems to raise an exception in case the object is `NULL` in all the cases I've checked, .e.g.:
```objc
- (NSDate * _Nullable)getSelf {
int32_t refnum = go_seq_go_to_refnum(self._ref);
int32_t _self = go_seq_to_refnum(self);
int32_t r0 = proxyobjcpkg_GoNSDate_GetSelf(refnum, _self);
NSDate* _ret0_ = nil;
GoSeqRef* _ret0__ref = go_seq_from_refnum(r0);
if (_ret0__ref != NULL) {
_ret0_ = _ret0__ref.obj;
if (_ret0_ == nil) {
LOG_FATAL(@"unexpected NULL reference");
}
}
return _ret0_;
}
```
Because there are cases where we are overriding a method in the superclass that might have different nullability specifiers, .e.g.: 6621de06e1/bind/testdata/testpkg/objcpkg/classes.go (L65)
And I haven't found an easy way to detect those.
Change-Id: I6386e48b1042a234f981fc7c351f54354ebb6cc9
GitHub-Last-Rev: 1cddbaaf785f9daeb1d210e1b6fe17b8ae860698
GitHub-Pull-Request: golang/mobile#32
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/176137
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
After trying $ANDROID_HOME/ndk-bundle, we also try $ANDROID_NDK_HOME.
ANDROID_NDK_HOME is advised in this NDK sample code wiki:
https://github.com/googlesamples/android-ndk/wiki
Mentioned in the Bazel buildsystem Android app tutorial:
https://docs.bazel.build/versions/master/tutorial/android-app.html
On Ubuntu, the google-android-ndk-installer leaves the NDK in
/usr/lib/android-ndk, and it seems to be up to the user to set
ANDROID_NDK_HOME.
On Arch Linux, the android-ndk package installs the NDK into /opt/android-ndk
and sets ANDROID_NDK_HOME to there using an /etc/profile.d/file
Fixesgolang/go#31461
Change-Id: I9f7f7e24b19e0047419f9725b67bd6daf2b1d328
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/171938
Run-TryBot: Elias Naur <mail@eliasnaur.com>
Reviewed-by: Elias Naur <mail@eliasnaur.com>
From Xcode 10.2 onwards, these annotations are required in all interface
declarations. The behaviour can be disabled, but since we were already
annotated most types it made sense to just annotate the rest.
Change-Id: Iacd09a2fea4dfb3e22fec97cf4ca22966fc783bf
GitHub-Last-Rev: a431572a83ea8b29f55813bcdafc9a00f8d15972
GitHub-Pull-Request: golang/mobile#29
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/171957
Reviewed-by: Elias Naur <mail@eliasnaur.com>
The prebuilt toolchains introduced in NDK r19b didn't work on Windows.
NDK r19c contains a fix, so remove our workaround and check for r19c
on Windows.
Change-Id: I3bcfedbc156f10c3cab8e74dcbd7de68575669e7
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/168067
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Add -fembed-bitcode to the host compiler and linker to instruct it
to add bitcode to object files.
Updates golang/go#22395
Change-Id: Ie0297079f27c9b5b8ea55e0a36067dc768342986
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/168062
Run-TryBot: Elias Naur <mail@eliasnaur.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Our Java proxy class defines a constructor which takes a single int
that is the reference number of the Go peer. However, in Go, constructors
of the form NewT(i int32) *T generate the same signature as the internal
constructor.
The longer fix is to avoid using a constructor for initializing
proxies. This CL simply skips clashing Go constructors.
Reported in https://groups.google.com/forum/#!topic/golang-nuts/EKC_gEjaQH4
Change-Id: I1153f71d8b5a757c499b3ce6e18e2ea5d22dc9e5
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/167660
Run-TryBot: Elias Naur <mail@eliasnaur.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Retry a few times to ensure the garbage collector collects what
we expect. Also merge and remove testJavaRefGC which was identical
except for one line.
Updates golang/go#30785
Change-Id: Id6c541b41fe483633c40eeea712c1f43b647e4f4
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/167657
Run-TryBot: Elias Naur <mail@eliasnaur.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Commands run:
go mod init
go mod edit -go=1.11
go mod tidy
go list -m all
go test ./...
Updates golang/go#30228
Updates golang/go#27234
Change-Id: Ibf3b104bfaa037e1a94a5327b5a56983d9744e73
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/167180
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
The builder doesn't have javap nor the Android fonts installed.
Change-Id: Ia3965be967482aa76b0c8c83b951deb30ebe5645
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/167057
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Look for the compiler directly, not just the existence of the
directory containing.
Fixesgolang/go#30637
Change-Id: Iae4429406da8622e7085bf3701c0f84d5c95d2fd
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/165937
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
The naïve string matching of GOROOT fails on the builders where
GOROOT is a string prefix og GOPATH.
We're not manipulating GOROOT in the tools anymore so do the easiest
thing and delete GOROOT matching.
Change-Id: I194883b9c25f38e2bfdd3eb0ccc9fade76f45549
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/165579
Run-TryBot: Elias Naur <mail@eliasnaur.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This highly improves interop with Swift. It would map all
pointers as implicitly unwrapped optionals, which skip all
null safety checks. Adding `_Nullable` to pointer types
makes swift map them as optionals.
Also constructors are now nullable since it's valid to return nil from
Go code.
Change-Id: If0506bb80f31bf36f11522c16a1e66d77be935f8
GitHub-Last-Rev: bd6c30f7f50ef5ea5797b07073f0a4a70d545025
GitHub-Pull-Request: golang/mobile#26
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/159477
Run-TryBot: Elias Naur <mail@eliasnaur.com>
Reviewed-by: Elias Naur <mail@eliasnaur.com>
Some x/mobile tests are designed to run from a host with a device
or emulator attached. Some fail if they run directly from a device,
which is the case when GOOS=android.
Fix the tests by skipping them or adjusting them to work on GOOS=android.
Remove gomobile environment naïve variable expansion for $HOME; on
Android devices HOME=/ so every path separator is replaced with
$HOME.
Fixesgolang/go#30482
Change-Id: I553e708226922f6284163f0b7d7b1011a9502e34
Reviewed-on: https://go-review.googlesource.com/c/164799
Run-TryBot: Elias Naur <mail@eliasnaur.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Recent Xcode versions are unable to build C++ files if the minimum
iOS version is below 7.0. Bump the default version to 7.0; it is
ancient and users can override it with -iosversion.
Fixesgolang/go#29969
Change-Id: I4e35e021e0fa10c1681df1073efa73700c3aae69
Reviewed-on: https://go-review.googlesource.com/c/164800
Run-TryBot: Elias Naur <mail@eliasnaur.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
No test as I couldn't figure out how to persuade gradle test to
strip classes.
Fixesgolang/go#30251
Change-Id: I7dca9169a4a8eb31b981ad49047a6bdfa6f6efd7
Reviewed-on: https://go-review.googlesource.com/c/164798
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Use a temporary location for the gobind and gomobile binaries
during tests.
This avoids depending on the go install path being in PATH and avoids
overwriting any existing gobind or gomobile binary the user have installed.
For the android x/mobile builder.
Change-Id: I98a6767fcff642a7143efc3eeb2cb3aa1f1719cc
Reviewed-on: https://go-review.googlesource.com/c/164797
Run-TryBot: Elias Naur <mail@eliasnaur.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
To use the NDK before version r19b standalone toolchains had to be
generated. Version r19b added prebuilt standalone toolchains.
Use the prebuilt for gomobile build and gomobile bind and
stop generating toolchains during gomobile init.
gomobile init is now only necessary for building OpenAL for
gomobile build programs.
This change is not compatible with NDK versions < r19b, but the
user is instructed how to upgrade when running gomobile build or
gomobile bind.
Change-Id: I96953298ecce42402459a9dd15169c09fe6b6f8b
Reviewed-on: https://go-review.googlesource.com/c/163378
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
The Character.Subset Java class changed between JDK 8 and JDK 11
which is the default JDK on my system. To avoid the golden tests
depend on the JDK version, drop the reference to the Character.Subset
class.
The inner class case is covered by the bind/java runtime tests.
For the upcoming Android container builders.
Change-Id: I05897ff7de7970633176207305099153de2f208c
Reviewed-on: https://go-review.googlesource.com/c/163377
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Current generated headers work because they require `ref.h` to be loaded beforehand by the bridging header. However, in some cases where the bridging header is generated by another tool (such as Bazel), the order can't be guaranteed.
Fix that by explicitly importing `ref.h` in the headers that need it.
Change-Id: I444453a0ebdf53e14ba1b5290f7cc7084eaf2c07
GitHub-Last-Rev: e1e1e915bf0428d871cb1a268c8456cf7051d383
GitHub-Pull-Request: golang/mobile#28
Reviewed-on: https://go-review.googlesource.com/c/159758
Reviewed-by: Elias Naur <mail@eliasnaur.com>
Two things broke the clang ast dump parser:
- clang -cc1 didn't parse headers in iPhone mode automatically anymore.
Add the -triple argument to force it.
- Source positions in the dumps can now contain <scratch space>.
Change-Id: I5d561f781355021f60c94d59e20bf1c1eee76d2a
Reviewed-on: https://go-review.googlesource.com/c/159678
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
The go tool requires either HOME or GOCACHE set, but tests invoking
go install only passed GOPATH. Pass the inherited environment as well.
While here, update the reverse generated java.go.golden file with
additions from the latest Android SDK.
Change-Id: I3567dcc30e588b20266e9ba01d17a0ee547919bc
Reviewed-on: https://go-review.googlesource.com/c/159677
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
The current header generation uses old style Objective C
getters/setters. This causes Swift to incorrectly bridge properties as
methods. Using @property lets you write goObj.str = "value" (vs
goObj.setStr("value")).
Change-Id: I99d63743623734414edd50343dbdded52bdf2bf5
GitHub-Last-Rev: fb0ad7ec50d25ae5aa75ed729b04b95b99672f04
GitHub-Pull-Request: golang/mobile#27
Reviewed-on: https://go-review.googlesource.com/c/159618
Reviewed-by: Elias Naur <mail@eliasnaur.com>
The default, org.golang.todo, is not available outside Google
and the resulting error is confusing.
Fixesgolang/go#26615
Change-Id: I417a2f83bc3755628f1f3541a061c9272eb318c0
Reviewed-on: https://go-review.googlesource.com/c/156498
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>