Skip to content

Commit 858099f

Browse files
committed
cmd,bind: add implicit dependencies
cmd/gomobile depends on cmd/gobind. Code generated by cmd/gobind depends on packages under golang.org/x/mobile/bind. Explicitly list those (with build tags) so the go command can take into account these implicit dependencies (e.g. go mod tidy or go mod vendor). We use tag `mobile_implicit`. Updates golang/go#43736 Change-Id: I09c519556ffe8e8c4db0754571c5173b1613c210 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/377754 Trust: Hyang-Ah Hana Kim <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Bryan Mills <[email protected]>
1 parent 4a8be17 commit 858099f

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

bind/implicit.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// This file imports implicit dependencies required by generated code.
2+
3+
//go:build mobile_implicit
4+
// +build mobile_implicit
5+
6+
package bind
7+
8+
import (
9+
_ "golang.org/x/mobile/bind/seq"
10+
)

cmd/gobind/implicit.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// This file imports implicit dependencies required by generated code.
2+
3+
//go:build mobile_implicit
4+
// +build mobile_implicit
5+
6+
package main
7+
8+
import (
9+
_ "golang.org/x/mobile/bind"
10+
_ "golang.org/x/mobile/bind/java"
11+
_ "golang.org/x/mobile/bind/objc"
12+
)

cmd/gomobile/tools.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// This file includes the tools the gomobile depends on.
2+
3+
//go:build tools
4+
// +build tools
5+
6+
package main
7+
8+
import (
9+
_ "golang.org/x/mobile/cmd/gobind"
10+
)

0 commit comments

Comments
 (0)