diff options
author | 2023-02-24 12:07:08 -0500 | |
---|---|---|
committer | 2023-04-11 21:05:48 -0400 | |
commit | 2eef2e13e997b75d089606913d96b36cac22b6e2 (patch) | |
tree | c5ada46cf99aafd92b5fbbb77bd78a3e471c2387 /java/device_host_converter.go | |
parent | 15807fa7ed5a9c1bbc6f40866ef285e70cf1d5e2 (diff) |
Bp2build support for sdk_version and java_version.
This CL adds java_version and sdk_version support to bp2build
converters for
- java library
- java binary
- android library
- android binary
- android library import
Although java import doesn't support java_version and sdk_version, the
neverlink java_library wrapper around a java_import must specify a
sdk_version when targetting a device. "none" is used by convention.
Change-Id: I22a69dea2e351858368df69ed6a703b568d613ea
Bug: 215230098
Test: Presubmits
Diffstat (limited to 'java/device_host_converter.go')
-rw-r--r-- | java/device_host_converter.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/java/device_host_converter.go b/java/device_host_converter.go index 656c866ed..3581040f8 100644 --- a/java/device_host_converter.go +++ b/java/device_host_converter.go @@ -21,6 +21,8 @@ import ( "android/soong/android" "android/soong/bazel" "android/soong/dexpreopt" + + "github.com/google/blueprint/proptools" ) type DeviceHostConverter struct { @@ -191,7 +193,7 @@ func (d *DeviceHostConverter) AndroidMk() android.AndroidMkData { } type bazelDeviceHostConverterAttributes struct { - Deps bazel.LabelListAttribute + Exports bazel.LabelListAttribute } func (d *DeviceHostConverter) ConvertWithBp2build(ctx android.TopDownMutatorContext) { @@ -202,13 +204,15 @@ func (d *DeviceHostConverter) ConvertWithBp2build(ctx android.TopDownMutatorCont }, android.CommonAttributes{Name: d.Name()}, &bazelDeviceHostConverterAttributes{ - Deps: bazel.MakeLabelListAttribute(android.BazelLabelForModuleDeps(ctx, d.properties.Libs)), + Exports: bazel.MakeLabelListAttribute(android.BazelLabelForModuleDeps(ctx, d.properties.Libs)), }, ) - neverlinkProp := true neverLinkAttrs := &javaLibraryAttributes{ Exports: bazel.MakeSingleLabelListAttribute(bazel.Label{Label: ":" + d.Name()}), - Neverlink: bazel.BoolAttribute{Value: &neverlinkProp}, + Neverlink: bazel.BoolAttribute{Value: proptools.BoolPtr(true)}, + javaCommonAttributes: &javaCommonAttributes{ + Sdk_version: bazel.StringAttribute{Value: proptools.StringPtr("none")}, + }, } ctx.CreateBazelTargetModule( javaLibraryBazelTargetModuleProperties(), |