Skip to content

Commit b1917ac

Browse files
fjlkaralabe
authored andcommitted
build: add GOBIN to PATH for gomobile (#16344)
* build: add GOBIN to PATH for gomobile * build: install gobind alongside gomobile
1 parent 1203c6a commit b1917ac

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

build/ci.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ func doAndroidArchive(cmdline []string) {
726726
log.Fatal("Please ensure ANDROID_NDK points to your Android NDK")
727727
}
728728
// Build the Android archive and Maven resources
729-
build.MustRun(goTool("get", "golang.org/x/mobile/cmd/gomobile"))
729+
build.MustRun(goTool("get", "golang.org/x/mobile/cmd/gomobile", "golang.org/x/mobile/cmd/gobind"))
730730
build.MustRun(gomobileTool("init", "--ndk", os.Getenv("ANDROID_NDK")))
731731
build.MustRun(gomobileTool("bind", "--target", "android", "--javapkg", "org.ethereum", "-v", "github.com/ethereum/go-ethereum/mobile"))
732732

@@ -777,9 +777,10 @@ func gomobileTool(subcmd string, args ...string) *exec.Cmd {
777777
cmd.Args = append(cmd.Args, args...)
778778
cmd.Env = []string{
779779
"GOPATH=" + build.GOPATH(),
780+
"PATH=" + GOBIN + string(os.PathListSeparator) + os.Getenv("PATH"),
780781
}
781782
for _, e := range os.Environ() {
782-
if strings.HasPrefix(e, "GOPATH=") {
783+
if strings.HasPrefix(e, "GOPATH=") || strings.HasPrefix(e, "PATH=") {
783784
continue
784785
}
785786
cmd.Env = append(cmd.Env, e)
@@ -846,7 +847,7 @@ func doXCodeFramework(cmdline []string) {
846847
env := build.Env()
847848

848849
// Build the iOS XCode framework
849-
build.MustRun(goTool("get", "golang.org/x/mobile/cmd/gomobile"))
850+
build.MustRun(goTool("get", "golang.org/x/mobile/cmd/gomobile", "golang.org/x/mobile/cmd/gobind"))
850851
build.MustRun(gomobileTool("init"))
851852
bind := gomobileTool("bind", "--target", "ios", "--tags", "ios", "-v", "github.com/ethereum/go-ethereum/mobile")
852853

0 commit comments

Comments
 (0)