Lines Matching +full:go +full:- +full:version
2 # -*- coding: utf-8 -*-
4 # Use of this source code is governed by a BSD-style license that can be
20 "--config",
25 "--use_ccache", required=True, choices=["true", "false"]
28 "--version_suffix",
29 help="A string appended to the computed version of the wrapper. This "
33 "--use_llvm_next", required=True, choices=["true", "false"]
35 parser.add_argument("--output_file", required=True, type=str)
37 "--static",
52 def calc_go_args(args, version, build_dir): argument
53 # These seem unnecessary, and might lead to breakages with Go's ldflag
55 if "'" in version:
56 raise ValueError("`version` should not contain single quotes")
59 "-X",
61 "-X",
63 "-X",
65 "-X",
66 # Quote this, as `version` may have spaces in it.
67 "'main.Version=" + version + "'",
73 extra_args += ["-tags", "libc_exec"]
76 # If android_llvm_next_flags.go DNE, we'll get an obscure "no
79 os.path.join(build_dir, "android_llvm_next_flags.go")
83 "android_llvm_next_flags.go file; please see "
84 "cros_llvm_next_flags.go."
86 extra_args += ["-tags", "android_llvm_next_flags"]
89 "go",
91 "-o",
93 "-ldflags",
99 version_path = os.path.join(build_dir, "VERSION")
105 ["git", "-C", build_dir, "log", "-1", "--pretty=%B"], encoding="utf-8"
108 change_ids = re.findall(r"Change-Id: (\w+)", last_commit_msg)
110 sys.exit("Couldn't find Change-Id in last commit message.")
111 return change_ids[-1]
117 version = read_version(build_dir)
119 version += args.version_suffix
120 # Note: Go does not support using absolute package names.
121 # So we run go inside the directory of the the build file.
123 subprocess.call(calc_go_args(args, version, build_dir), cwd=build_dir)