Lines Matching +full:- +full:p
7 // http://www.apache.org/licenses/LICENSE-2.0
165 BpTarget string `xml:"-"`
184 PomFile string `xml:"-"`
185 ArtifactFile string `xml:"-"`
186 BpTarget string `xml:"-"`
187 MinSdkVersion string `xml:"-"`
197 func (p Pom) IsAar() bool {
198 return p.Packaging == "aar"
201 func (p Pom) IsJar() bool {
202 return p.Packaging == "jar"
205 func (p Pom) IsHostModule() bool {
206 return hostModuleNames.IsHostModule(p.GroupId, p.ArtifactId)
209 func (p Pom) IsDeviceModule() bool {
210 return !p.IsHostModule()
213 func (p Pom) IsHostAndDeviceModule() bool {
214 return hostAndDeviceModuleNames.IsHostAndDeviceModule(p.GroupId, p.ArtifactId)
217 func (p Pom) IsHostOnly() bool {
218 return p.IsHostModule() && !p.IsHostAndDeviceModule()
221 func (p Pom) ModuleType() string {
222 if p.IsAar() {
224 } else if p.IsHostOnly() {
231 func (p Pom) ImportModuleType() string {
232 if p.IsAar() {
234 } else if p.IsHostOnly() {
241 func (p Pom) ImportProperty() string {
242 if p.IsAar() {
249 func (p Pom) BpName() string {
250 if p.BpTarget == "" {
251 p.BpTarget = rewriteNames.MavenToBp(p.GroupId, p.ArtifactId)
253 return p.BpTarget
256 func (p Pom) BpJarDeps() []string {
257 return p.BpDeps("jar", []string{"compile", "runtime"})
260 func (p Pom) BpAarDeps() []string {
261 return p.BpDeps("aar", []string{"compile", "runtime"})
264 func (p Pom) BpExtraStaticLibs() []string {
265 return extraStaticLibs[p.BpName()]
268 func (p Pom) BpExtraLibs() []string {
269 return extraLibs[p.BpName()]
274 func (p Pom) BpDeps(typeExt string, scopes []string) []string {
276 for _, d := range p.Dependencies {
286 func (p Pom) SdkVersion() string {
290 func (p Pom) DefaultMinSdkVersion() string {
294 func (p Pom) Jetifier() bool {
298 func (p *Pom) FixDeps(modules map[string]*Pom) {
299 for _, d := range p.Dependencies {
320 func (p *Pom) ExtractMinSdkVersion() error {
321 aar, err := zip.OpenReader(p.ArtifactFile)
336 return fmt.Errorf("failed to find AndroidManifest.xml in %s", p.ArtifactFile)
351 } `xml:"uses-sdk"`
359 p.MinSdkVersion = manifestData.Uses_sdk.MinSdkVersion
360 if p.MinSdkVersion == "" {
361 p.MinSdkVersion = "current"
372 {{- if .Jetifier}}
374 {{- end}}
375 {{- if .IsHostAndDeviceModule}}
377 {{- end}}
378 {{- if not .IsHostOnly}}
383 {{- end}}
384 {{- if .IsAar}}
387 {{- range .BpJarDeps}}
389 {{- end}}
390 {{- range .BpAarDeps}}
392 {{- end}}
393 {{- range .BpExtraStaticLibs}}
395 {{- end}}
397 {{- if .BpExtraLibs}}
399 {{- range .BpExtraLibs}}
401 {{- end}}
403 {{- end}}
404 {{- else if not .IsHostOnly}}
406 {{- end}}
412 name: "{{.BpName}}-nodeps",
415 {{- if .Jetifier}}
417 {{- end}}
418 {{- if .IsHostAndDeviceModule}}
420 {{- end}}
421 {{- if not .IsHostOnly}}
426 {{- end}}
427 {{- if .IsAar}}
430 {{- range .BpJarDeps}}
432 {{- end}}
433 {{- range .BpAarDeps}}
435 {{- end}}
436 {{- range .BpExtraStaticLibs}}
438 {{- end}}
440 {{- if .BpExtraLibs}}
442 {{- range .BpExtraLibs}}
444 {{- end}}
446 {{- end}}
447 {{- else if not .IsHostOnly}}
449 {{- end}}
454 {{- if .IsDeviceModule}}
456 {{- if .IsHostAndDeviceModule}}
458 {{- end}}
459 {{- if not .IsHostOnly}}
464 {{- end}}
465 {{- if .IsAar}}
468 {{- else if not .IsHostOnly}}
470 {{- end}}
471 {{- end}}
473 "{{.BpName}}-nodeps",
474 {{- range .BpJarDeps}}
476 {{- end}}
477 {{- range .BpAarDeps}}
479 {{- end}}
480 {{- range .BpExtraStaticLibs}}
482 {{- end}}
484 {{- if .BpExtraLibs}}
486 {{- range .BpExtraLibs}}
488 {{- end}}
490 {{- end}}
552 lastArg := args[len(args)-1]
553 args = args[:len(args)-1]
555 // Append all current command line args except -regen <file> to the ones from the file
557 if os.Args[i] == "-regen" || os.Args[i] == "--regen" {
566 // Re-exec pom2bp with the new arguments
567 output, err := exec.Command("/bin/sh", "-c", cmd).Output()
590 …--rewrite <regex>=<replace>] [-exclude <module>] [--extra-static-libs <module>=<module>[,<module>]…
592 -rewrite <regex>=<replace>
593 …rewrite can be used to specify mappings between Maven projects and Android.bp modules. The -rewrite
598 -exclude <module>
600 -extra-static-libs <module>=<module>[,<module>]
602 are depended upon (like android-support-v7-mediarouter requires android-support-v7-appcompat).
604 -extra-libs <module>=<module>[,<module>]
608 -sdk-version <version>
610 -default-min-sdk-version
612 -use-version <version>
614 … -use-version can be used to only write Android.bp files for a specific version of those artifacts.
615 -jetifier
620 -regen <file>
630 …flag.Var(&extraStaticLibs, "extra-static-libs", "Extra static dependencies needed when depending o…
631 flag.Var(&extraLibs, "extra-libs", "Extra runtime dependencies needed when depending on a module")
634 …flag.Var(&hostAndDeviceModuleNames, "host-and-device", "Specifies that the corresponding module (s…
635 flag.StringVar(&sdkVersion, "sdk-version", "", "What to write to sdk_version")
636 …flag.StringVar(&defaultMinSdkVersion, "default-min-sdk-version", "24", "Default min_sdk_version to…
637 flag.StringVar(&useVersion, "use-version", "", "Only read artifacts of a specific version")
638 flag.BoolVar(&staticDeps, "static-deps", false, "Statically include direct dependencies")