hack/update-vendor.sh

This commit is contained in:
Jordan Liggitt
2019-11-05 14:11:10 -05:00
parent 9a5b7c24ad
commit 297570e06a
932 changed files with 77190 additions and 28219 deletions

View File

@@ -20,11 +20,16 @@ import (
"os"
"strings"
"github.com/bazelbuild/buildtools/build"
"github.com/bazelbuild/buildtools/edit"
"github.com/bazelbuild/buildtools/tables"
)
var (
buildVersion = "redacted"
buildScmRevision = "redacted"
version = flag.Bool("version", false, "Print the version of buildozer")
stdout = flag.Bool("stdout", false, "write changed BUILD file to stdout")
buildifier = flag.String("buildifier", "", "format output using a specific buildifier binary. If empty, use built-in formatter")
parallelism = flag.Int("P", 0, "number of cores to use for concurrent actions")
@@ -61,6 +66,12 @@ func stringList(name, help string) func() []string {
func main() {
flag.Parse()
if *version {
fmt.Printf("buildozer version: %s \n", buildVersion)
fmt.Printf("buildozer scm revision: %s \n", buildScmRevision)
os.Exit(0)
}
if *tablesPath != "" {
if err := tables.ParseAndUpdateJSONDefinitions(*tablesPath, false); err != nil {
fmt.Fprintf(os.Stderr, "buildifier: failed to parse %s for -tables: %s\n", *tablesPath, err)
@@ -75,6 +86,9 @@ func main() {
}
}
if !(*shortenLabelsFlag) {
build.DisableRewrites = []string{"label"}
}
edit.ShortenLabelsFlag = *shortenLabelsFlag
edit.DeleteWithComments = *deleteWithComments
opts := &edit.Options{