Set min_sdk_version for java imports in pom2bp

Previously min_sdk_version was only set for *_library build rules, and
not for *_import targets. This made min_sdk_version default to
sdk_version, which is usually "current", which is not correct for these
libraries.

Test: pom2bp -default-min_sdk_version 24 for androidx
Change-Id: I3b029315abeb559e66efad847ae664efb79f4509
This commit is contained in:
Anton Hansson 2021-03-29 16:11:35 +01:00
parent 6d15d63556
commit 5d8652fcaf
1 changed files with 4 additions and 0 deletions

View File

@ -401,6 +401,8 @@ var bpTemplate = template.Must(template.New("bp").Parse(`
{{- end}}
],
{{- end}}
{{- else if not .IsHostOnly}}
min_sdk_version: "{{.DefaultMinSdkVersion}}",
{{- end}}
}
`))
@ -442,6 +444,8 @@ var bpDepsTemplate = template.Must(template.New("bp").Parse(`
{{- end}}
],
{{- end}}
{{- else if not .IsHostOnly}}
min_sdk_version: "{{.DefaultMinSdkVersion}}",
{{- end}}
}