The current TestNdkRoot may fail if ANDROID_HOME and ANDROID_NDK_HOME
are both set from the environment. This is because ndkRoot will first
check ANDROID_HOME, if fails, then check ANDROID_NDK_HOME.
The test was intended to reset the ANDROID_HOME and expecting an error
for fetching ANDROID_NDK_HOME. However, if ANDROID_NDK_HOME is set,
the ndkRoot will not return an error, which may fail the test.
This change moves the environment settings around to permit TestNdkRoot
to pass.
Change-Id: I17ce6dbeec186d35f7a4ba2d8275a43a862c306d
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/346152
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Apple Development Program was introduced in WWDC2015. It is 2021 today,
and there should have no possibility to use iPhone Developer certificate
for code signing.
This CL replaces "iPhone Developer" by "Apple Development" so that
cmd/gomobile can use the correct certificate to sign the building
application. Otherwise, gomobile throws an error gomobile: failed to
pull the signing certificate to determine your team ID: exit status 44
Updates golang/go#47238
Change-Id: Ia48c03ff7cda39a95159e0f77e7ba7042776f9ef
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/346151
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Hajime Hoshi <hajimehoshi@gmail.com>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
This reverts commit 76c259c465.
Reason for revert: Regression. Specifying architectures doesn't work. See golang/go#47212
Change-Id: I3200316cf28535cfb48e37636bc3b9d14d13e91e
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/334590
Trust: Hajime Hoshi <hajimehoshi@gmail.com>
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Add support for macOS (non-Catalyst) and Catalyst targets.
The compiled library is packaged into a "fat" XCFramework file (as
opposed to a Framework), which includes binaries for iOS, macOS,
MacCatalyst (iOS on macOS), and iOS Simulator targets, for amd64 and
arm64 architectures.
The generated XCFramework file is suitable for distribution as a binary
Swift Package Manager package:
https://developer.apple.com/documentation/swift_packages/distributing_binary_frameworks_as_swift_packages
This change is based on earlier work:
https://github.com/golang/mobile/pull/45https://github.com/golang/mobile/pull/63Fixesgolang/go#36856
Change-Id: Iabe535183c7215c68838d6c8f31618d8bceefdcf
GitHub-Last-Rev: 623f8f38653c856d2cd07e721f0932e515b50d02
GitHub-Pull-Request: golang/mobile#65
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/310949
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Trust: Hajime Hoshi <hajimehoshi@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
As golang/go#32963 has been fixed, gomobile-build test on iOS now
works.
Updates golang/go#32963
Change-Id: I96add914d1f97de6506f26e4ae0c07e8c884cb6a
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/214957
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
The check when looking for android platform is unnecessarily stringent
in that the error would be caught by the call to os.Stat, and
it fails when the android platform folder is a symlink,
which is the case when developing on NixOs.
Change-Id: I07a96c969ffa29dea8bf8e353264e8597dcdc550
GitHub-Last-Rev: c684b80402ad30ad52eb854951aab69657ad7a5d
GitHub-Pull-Request: golang/mobile#55
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/267081
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Trust: Heschi Kreinick <heschi@google.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Make all our package sources use Go 1.17 gofmt format
(adding //go:build lines).
Not strictly necessary but will avoid spurious changes
as files are edited.
Part of //go:build change (#41184).
See https://golang.org/design/draft-gobuild
Change-Id: I30822eb504168b037ed3ec0f7759da1f41251f52
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/294374
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
As of Go1.16, `go build` fails if go.sum does not exist. This change
fixes this issue by forcing to create go.sum by calling `go mod tidy`.
Closesgolang/go#44162
Change-Id: Ibba738503d1a58c6533b2427dd4efa6954b8eaa3
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/290409
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
Trust: Than McIntosh <thanm@google.com>
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TestWriter is flaky and often fails on the trybots. Skip this as a
tentative solution.
Updates golang/go#40290
Change-Id: I3a8aa74fb6cb727a216da4046edaa159f9aa2dc3
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/243839
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Go 1.15 no longer supports darwin/386 and supports only arm64 and amd64
for darwin.
Updates golang/go#39575
Change-Id: I89e43f195f87baf5ea647da40614c579fbe45f88
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/243838
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This is a remaining task for golang/go#39575.
Updates golang/go#39575
Change-Id: I10c021a9349461a7a773d4e93e80601b906741b2
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/243837
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Go 1.15 no longer supports darwin/arm. arm64 is still supported by
Android and iOS.
Updates golang/go#39575
Change-Id: I91f09477ae68de148e4d63eef38d7d28f553d16c
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/241717
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Go 1.15 no longer supports darwin/arm. This CL fixes by replacing
'allArchs' variable with a function taking a target OS, and excludes
'arm' when the target OS is iOS.
Updates golang/go#39575
Change-Id: I0623ed4cda2c679d2762fd80a7919f24dd5ce016
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/243477
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
When the module name in *.modulemap and the framework name don't match,
Xcode fails to find the framework.
This CL fixes this issue by using the specified .framework name for the
module name.
Fixesgolang/go#35641
Change-Id: I0df5335f2d64f0529e7357c2d04af5eaf760a879
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/239237
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Before this change, the main module specifies the module version of the
package to bind, the version might not be adopted by gomobile because
gomobile trims some dependencies information. If a dependency is not
a main module nor a replaced module, the dependency information is
omitted.
For example, if you have this go.mod in a workspace:
module example.com/m
requier (
github.com/foo/bar v0.1.0-123456
)
and then run `gomobile bind github.com/foo/bar` there, the specified
version might not be used because github.com/foo/bar is not a main nor
a replaced module.
This change keeps the dependency information as much as possible
to avoid this confusion.
Updates golang/go#37048
Change-Id: I875a1b9485438bdee336f3fc2d131775353004f5
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/226279
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Previously, gomobile bind's go.mod generation logic assumed
replacing module was always located in the disk, but is not
always true. It's valid to replace a module(version) with
another module&version.
For example,
replace golang.org/x/tools => ../
causes:
{
"Path": "golang.org/x/tools",
"Version": "v0.0.0-20191017151554-a3bc800455d5",
"Replace": {
"Path": "../",
"Dir": "/usr/local/google/home/hakim/go/src/golang.org/x/tools",
"GoMod": "/usr/local/google/home/hakim/go/src/golang.org/x/tools/go.mod",
"GoVersion": "1.11"
},
"Dir": "/usr/local/google/home/hakim/go/src/golang.org/x/tools",
"GoMod": "/usr/local/google/home/hakim/go/src/golang.org/x/tools/go.mod",
"GoVersion": "1.11"
}
replace github.com/anacrolix/torrent v1.13.0 => gitlab.com/axet/torrent v0.0.0-20200205141541-92b4b9e7387e
causes:
{
"Path": "github.com/anacrolix/torrent",
"Version": "v1.13.0",
"Replace": {
"Path": "gitlab.com/axet/torrent",
"Version": "v0.0.0-20200205141541-92b4b9e7387e",
"Time": "2020-02-05T14:15:41Z",
"Dir": "/usr/local/google/home/hakim/go/pkg/mod/gitlab.com/axet/torrent@v0.0.0-20200205141541-92b4b9e7387e",
"GoMod": "/usr/local/google/home/hakim/go/pkg/mod/cache/download/gitlab.com/axet/torrent/@v/v0.0.0-20200205141541-92b4b9e7387e.mod"
},
"Dir": "/usr/local/google/home/hakim/go/pkg/mod/gitlab.com/axet/torrent@v0.0.0-20200205141541-92b4b9e7387e",
"GoMod": "/usr/local/google/home/hakim/go/pkg/mod/cache/download/gitlab.com/axet/torrent/@v/v0.0.0-20200205141541-92b4b9e7387e.mod"
}
Also, while we are here, trim down the entries added to the generated
go.mod. We need the main module, and the replaced module info.
We may want to pin golang.org/x/mobile version if possible, but I don't
know a reliable way to achieve that yet.
Fixesgolang/go#37048
Change-Id: Ibd7332338c0a3c4165a642c3e86852061f6ab13b
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/218057
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
go-list without a given module/package tries to analyze the module
at the current directory. If the current directory's module doesn't
have any Go files and is empty, go-list fails. This is the cause
of the problem that gomobile-init fails if the current directory
is such module.
This CL fixes this issue by giving an arbitrary standard library
when executing go-list.
Fixesgolang/go#36668
Change-Id: If72d88081c94c2b9ef19d2870b41956a07102122
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/217700
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
A replative path in go.mod works only in the directory of the
go.mod. When creating go.mod for gobind, copying relative paths
did not work since go.mod is in a different temporary directory.
This CL fixes the issue to use Dir, which is an absolute path to
the module, instead of Path.
Updates golang/go#27234
Change-Id: Ib009ec508aa3ce3d092af14f921a57192feaac61
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/215421
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This CL gives CGO_ENABLED=1 explicitly when executing gobind since
Cgo is disabled by default when GOOS is given.
This CL also adds importing C to the tests to confirm that Cgo
works correctly.
This CL also updates go.mod since this change requries the change
in go/packages: golang.org/cl/214943
Updates golang/go#27234
Updates golang/go#36547
Change-Id: I66f9697f992f15b52fca7871e4e0ed64ca2b4965
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/214498
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
iOS's bitcode conflicts with headerpad on Go 1.13 or older. This
problem is fixed on Go 1.14.
This CL disables bitcode only on Go 1.13 or older.
Fixesgolang/go#32963
Change-Id: Iac9edd56aaf7819288e8f46b9e29d310305acd9d
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/214899
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This CL enables Go modules at gomobile-build command. This CL is
a counterpart for the change gomobile-bind: https://golang.org/cl/210380
This CL also reformats the tests in bind_test.go
Updates golang/go#27234
Change-Id: I9fb9612be6b08f5f61259879f563c8586fb1efef
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/214897
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
This was introduced at https://go-review.googlesource.com/c/mobile/+/191518
originally, but this change was against the decision at
golang/go#26845.
"go" always works even when Go command that name is not "go", like
"go1.14beta1" is used. See also the discussion at golang/go#28043
Change-Id: Ifebe969edaeda0373b2840d25a4f4030509176fa
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/214898
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
This CL fixes an issue that a relative path didn't work with
gomobile. path.Clean removed the prefix './' and this was too
aggressive. path.Clean was needed for go/build.Context.Import
(see golang/go#18876), but they have already been replaced with
packages.Load, so clearning paths is no longer needed.
Updates golang/go#27234
Change-Id: Ife28da6d845baaf94e627a7a44a5e962b8a1d013
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/214497
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This CL enables Go modules in gomobile-bind command. This CL
generates go.mod at $WORK/src based on the modules state of the
working directory, and use it when executing go-build.
Updates golang/go#27234
Change-Id: I6958f29a317c0d2fb9ffa373f6e3c4cabdc4e898
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/210380
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Before this change, all the gomobile commands forced Go modules
to be off internally, regardless of the current Go modules state.
After this change, gomobile-init command follows the current Go
modules state. The other gomobile commands are not changed.
This is also a preparation to support Go modules in gomobile-bind
and gomobile-build.
Updates golang/go#27234
Change-Id: I3d9eedd667cba4d30de3ac0543f037be36cd3e51
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/210477
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
This is a preparation to enable Go modules for gomobile commands.
When Go modules is used, $GOPATH is not available. To build a
local package with Go modules, changing the working directory and
specifying the package by a relative path begining with `./` is
required. Changing the working directory is necessary because
building outside of modules is forbidden.
Specifying $GOPATH is still needed for reverse bindings (i.e.
special packages begining with `Java/` or `ObjC/`). Note that
gomobile with Go modules cannot support reverse bindings so far.
Updates golang/go#27234
Change-Id: Ib19300e1b8a973e76e06d24472c63a98605d65f7
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/209137
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This CL is a pure refactoring. This removes a global variable ctx,
which is a build.Default.
Before this change, ctx was used to keep build tags and its state
affected go command executions. As the variable is mutable, the
code was not readable.
This changes introduces another global variable buildTags instead,
but this is more consistent with other build flags, and this is
immutable.
Updates golang/go#27234
Change-Id: Id8d0c779de21b249e96febd2f40833cd0c84534f
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/208060
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This is a preparation to use Go modules at gomobile command.
Updates golang/go#27234
Change-Id: I8ee47cb53f5b748592a0c8c9f383abab27a7fdad
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/208059
Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
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>
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>
* 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>
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>
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>
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>