summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-10-01 01:01:52 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-10-01 01:01:52 +0000
commit1c6c996d2d7043a94e65b105aaa1f403bd308b8f (patch)
tree64553992f644df2b6130345a12f7a52691bda7eb
parent866bcc461565e5331f0789c9c3256ce2903f076c (diff)
parent234f595cce32003645b3d93aa8d055b532923e4f (diff)
Snap for 9127121 from 234f595cce32003645b3d93aa8d055b532923e4f to tm-qpr1-release
Change-Id: I7d7826944b22caf933be2469e6b8315b7ef42527
-rw-r--r--cmd/pom2bp/pom2bp.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/cmd/pom2bp/pom2bp.go b/cmd/pom2bp/pom2bp.go
index f8844fc94..e0638b8ed 100644
--- a/cmd/pom2bp/pom2bp.go
+++ b/cmd/pom2bp/pom2bp.go
@@ -150,6 +150,7 @@ var sdkVersion string
var defaultMinSdkVersion string
var useVersion string
var staticDeps bool
+var writeCmd bool
var jetifier bool
func InList(s string, list []string) bool {
@@ -810,6 +811,9 @@ Usage: %s [--rewrite <regex>=<replace>] [--exclude <module>] [--extra-static-lib
-use-version <version>
If the maven directory contains multiple versions of artifacts and their pom files,
-use-version can be used to only write Android.bp files for a specific version of those artifacts.
+ -write-cmd
+ Whether to write the command line arguments used to generate the build file as a comment at
+ the top of the build file itself.
-jetifier
Sets jetifier: true for all modules.
<dir>
@@ -836,6 +840,7 @@ Usage: %s [--rewrite <regex>=<replace>] [--exclude <module>] [--extra-static-lib
flag.StringVar(&defaultMinSdkVersion, "default-min-sdk-version", "24", "Default min_sdk_version to use, if one is not available from AndroidManifest.xml. Default: 24")
flag.StringVar(&useVersion, "use-version", "", "Only read artifacts of a specific version")
flag.BoolVar(&staticDeps, "static-deps", false, "Statically include direct dependencies")
+ flag.BoolVar(&writeCmd, "write-cmd", true, "Write command line arguments as a comment")
flag.BoolVar(&jetifier, "jetifier", false, "Sets jetifier: true on all modules")
flag.StringVar(&regen, "regen", "", "Rewrite specified file")
flag.BoolVar(&pom2build, "pom2build", false, "If true, will generate a Bazel BUILD file *instead* of a .bp file")
@@ -962,8 +967,13 @@ Usage: %s [--rewrite <regex>=<replace>] [--exclude <module>] [--extra-static-lib
if pom2build {
commentString = "#"
}
- fmt.Fprintln(buf, commentString, "Automatically generated with:")
- fmt.Fprintln(buf, commentString, "pom2bp", strings.Join(proptools.ShellEscapeList(os.Args[1:]), " "))
+
+ fmt.Fprintln(buf, commentString, "This is a generated file. Do not modify directly.")
+
+ if writeCmd {
+ fmt.Fprintln(buf, commentString, "Automatically generated with:")
+ fmt.Fprintln(buf, commentString, "pom2bp", strings.Join(proptools.ShellEscapeList(os.Args[1:]), " "))
+ }
depsTemplate := bpDepsTemplate
template := bpTemplate