diff options
author | 2023-02-24 12:07:08 -0500 | |
---|---|---|
committer | 2023-04-11 21:05:48 -0400 | |
commit | 2eef2e13e997b75d089606913d96b36cac22b6e2 (patch) | |
tree | c5ada46cf99aafd92b5fbbb77bd78a3e471c2387 /java/proto.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/proto.go')
-rw-r--r-- | java/proto.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/java/proto.go b/java/proto.go index 5280077f1..c732d9842 100644 --- a/java/proto.go +++ b/java/proto.go @@ -143,7 +143,9 @@ func protoFlags(ctx android.ModuleContext, j *CommonProperties, p *android.Proto } type protoAttributes struct { - Deps bazel.LabelListAttribute + Deps bazel.LabelListAttribute + Sdk_version bazel.StringAttribute + Java_version bazel.StringAttribute } func bp2buildProto(ctx android.Bp2buildMutatorContext, m *Module, protoSrcs bazel.LabelListAttribute) *bazel.Label { @@ -175,8 +177,11 @@ func bp2buildProto(ctx android.Bp2buildMutatorContext, m *Module, protoSrcs baze } protoLabel := bazel.Label{Label: ":" + m.Name() + "_proto"} - var protoAttrs protoAttributes - protoAttrs.Deps.SetValue(bazel.LabelList{Includes: []bazel.Label{protoLabel}}) + protoAttrs := &protoAttributes{ + Deps: bazel.MakeSingleLabelListAttribute(protoLabel), + Java_version: bazel.StringAttribute{Value: m.properties.Java_version}, + Sdk_version: bazel.StringAttribute{Value: m.deviceProperties.Sdk_version}, + } name := m.Name() + suffix @@ -186,7 +191,7 @@ func bp2buildProto(ctx android.Bp2buildMutatorContext, m *Module, protoSrcs baze Bzl_load_location: "//build/bazel/rules/java:proto.bzl", }, android.CommonAttributes{Name: name}, - &protoAttrs) + protoAttrs) return &bazel.Label{Label: ":" + name} } |