Add the "-trimpath" flag from Go 1.13.

Change-Id: I10938fb5f7efd701f4025e451ddf438dc3e011ee
GitHub-Last-Rev: 4e82381342
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>
This commit is contained in:
Robin Zhong 2019-09-22 14:11:10 +00:00 коммит произвёл Hyang-Ah Hana Kim
Родитель b558ed8633
Коммит d3ece3b6da
4 изменённых файлов: 11 добавлений и 6 удалений

Просмотреть файл

@ -60,7 +60,7 @@ classes.
The -v flag provides verbose output, including the list of packages built.
The build flags -a, -n, -x, -gcflags, -ldflags, -tags, and -work
The build flags -a, -n, -x, -gcflags, -ldflags, -tags, -trimpath, and -work
are shared with the build command. For documentation, see 'go help build'.
`,
}

Просмотреть файл

@ -61,7 +61,7 @@ output file name depends on the package built.
The -v flag provides verbose output, including the list of packages built.
The build flags -a, -i, -n, -x, -gcflags, -ldflags, -tags, and -work are
The build flags -a, -i, -n, -x, -gcflags, -ldflags, -tags, -trimpath, and -work are
shared with the build command. For documentation, see 'go help build'.
`,
}
@ -230,6 +230,7 @@ var (
buildGcflags string // -gcflags
buildLdflags string // -ldflags
buildTarget string // -target
buildTrimpath bool // -trimpath
buildWork bool // -work
buildBundleID string // -bundleid
buildIOSVersion string // -iosversion
@ -247,6 +248,7 @@ func addBuildFlags(cmd *command) {
cmd.flag.BoolVar(&buildA, "a", false, "")
cmd.flag.BoolVar(&buildI, "i", false, "")
cmd.flag.BoolVar(&buildTrimpath, "trimpath", false, "")
cmd.flag.Var((*stringsFlag)(&ctx.BuildTags), "tags", "")
}
@ -308,6 +310,9 @@ func goCmd(subcmd string, srcs []string, env []string, args ...string) error {
if buildLdflags != "" {
cmd.Args = append(cmd.Args, "-ldflags", buildLdflags)
}
if buildTrimpath {
cmd.Args = append(cmd.Args, "-trimpath")
}
if buildWork {
cmd.Args = append(cmd.Args, "-work")
}

Просмотреть файл

@ -73,7 +73,7 @@ classes.
The -v flag provides verbose output, including the list of packages built.
The build flags -a, -n, -x, -gcflags, -ldflags, -tags, and -work
The build flags -a, -n, -x, -gcflags, -ldflags, -tags, -trimpath, and -work
are shared with the build command. For documentation, see 'go help build'.
@ -117,7 +117,7 @@ output file name depends on the package built.
The -v flag provides verbose output, including the list of packages built.
The build flags -a, -i, -n, -x, -gcflags, -ldflags, -tags, and -work are
The build flags -a, -i, -n, -x, -gcflags, -ldflags, -tags, -trimpath, and -work are
shared with the build command. For documentation, see 'go help build'.
@ -152,7 +152,7 @@ attached mobile device.
Only -target android is supported. The 'adb' tool must be on the PATH.
The build flags -a, -i, -n, -x, -gcflags, -ldflags, -tags, and -work are
The build flags -a, -i, -n, -x, -gcflags, -ldflags, -tags, -trimpath, and -work are
shared with the build command.
For documentation, see 'go help build'.

Просмотреть файл

@ -23,7 +23,7 @@ attached mobile device.
Only -target android is supported. The 'adb' tool must be on the PATH.
The build flags -a, -i, -n, -x, -gcflags, -ldflags, -tags, and -work are
The build flags -a, -i, -n, -x, -gcflags, -ldflags, -tags, -trimpath, and -work are
shared with the build command.
For documentation, see 'go help build'.
`,