Skip to content

Commit de3284d

Browse files
committed
refactor: changed glflag to golistflags
1 parent 1d3b1e5 commit de3284d

File tree

2 files changed

+25
-21
lines changed

2 files changed

+25
-21
lines changed

cmd/gomobile/bind.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,14 @@ For -target android, the -bootclasspath and -classpath flags are used to
6363
control the bootstrap classpath and the classpath for Go wrappers to Java
6464
classes.
6565
66+
The -golistflags flag passes args to the go list command.
67+
Example: -golistflags="-mod=readonly"
68+
6669
The -v flag provides verbose output, including the list of packages built.
6770
68-
The build flags -a, -n, -x, -gcflags, -ldflags, -tags, -glflags, -trimpath, and -work
69-
are shared with the build command. For documentation, see 'go help build'.
71+
The build flags -a, -n, -x, -gcflags, -ldflags, -tags,
72+
-trimpath, and -work are shared with the build command. For documentation,
73+
see 'go help build'.
7074
`,
7175
}
7276

@@ -231,10 +235,10 @@ func getModuleVersions(targetPlatform string, targetArch string, src string) (*m
231235
cmd.Env = append(os.Environ(), "GOOS="+platformOS(targetPlatform), "GOARCH="+targetArch)
232236

233237
tags := append(buildTags[:], platformTags(targetPlatform)...)
234-
glflags := buildGoListFlags
238+
golistflags := buildGoListFlags
235239

236240
// TODO(hyangah): probably we don't need to add all the dependencies.
237-
cmd.Args = append(cmd.Args, glflags, "-m", "-json", "-tags="+strings.Join(tags, ","), "all")
241+
cmd.Args = append(cmd.Args, golistflags, "-m", "-json", "-tags="+strings.Join(tags, ","), "all")
238242
cmd.Dir = src
239243

240244
output, err := cmd.Output()

cmd/gomobile/build.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -233,29 +233,29 @@ func printcmd(format string, args ...interface{}) {
233233

234234
// "Build flags", used by multiple commands.
235235
var (
236-
buildA bool // -a
237-
buildI bool // -i
238-
buildN bool // -n
239-
buildV bool // -v
240-
buildX bool // -x
241-
buildO string // -o
242-
buildGcflags string // -gcflags
243-
buildLdflags string // -ldflags
244-
buildTarget string // -target
245-
buildTrimpath bool // -trimpath
246-
buildWork bool // -work
247-
buildBundleID string // -bundleid
248-
buildIOSVersion string // -iosversion
249-
buildAndroidAPI int // -androidapi
250-
buildTags stringsFlag // -tags
251-
buildGoListFlags string // -glflags
236+
buildA bool // -a
237+
buildI bool // -i
238+
buildN bool // -n
239+
buildV bool // -v
240+
buildX bool // -x
241+
buildO string // -o
242+
buildGcflags string // -gcflags
243+
buildLdflags string // -ldflags
244+
buildTarget string // -target
245+
buildTrimpath bool // -trimpath
246+
buildWork bool // -work
247+
buildBundleID string // -bundleid
248+
buildIOSVersion string // -iosversion
249+
buildAndroidAPI int // -androidapi
250+
buildTags stringsFlag // -tags
251+
buildGoListFlags string // -golistflags
252252
)
253253

254254
func addBuildFlags(cmd *command) {
255255
cmd.flag.StringVar(&buildO, "o", "", "")
256256
cmd.flag.StringVar(&buildGcflags, "gcflags", "", "")
257257
cmd.flag.StringVar(&buildLdflags, "ldflags", "", "")
258-
cmd.flag.StringVar(&buildGoListFlags, "glflags", "", "")
258+
cmd.flag.StringVar(&buildGoListFlags, "golistflags", "", "")
259259
cmd.flag.StringVar(&buildTarget, "target", "android", "")
260260
cmd.flag.StringVar(&buildBundleID, "bundleid", "", "")
261261
cmd.flag.StringVar(&buildIOSVersion, "iosversion", "13.0", "")

0 commit comments

Comments
 (0)