summaryrefslogtreecommitdiff
path: root/java/proto.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2023-12-07 13:10:56 -0800
committer Colin Cross <ccross@android.com> 2023-12-08 13:51:05 -0800
commit8ff105860d20f2ccbb8d8044bf562f94100b7f6a (patch)
treeb01575cd628eb36807b7ca274de28fd6a1971e17 /java/proto.go
parente51c6e4109e8063e54cf7d8ced1b7da7f9359c34 (diff)
Remove ConvertWithBp2build implementations
Remove the ConvertWithBp2build implementations from all the module types, along with the related code. Bug: 315353489 Test: m blueprint_tests Change-Id: I212672286686a318893bc7348ddd5a5ec51e77a7
Diffstat (limited to 'java/proto.go')
-rw-r--r--java/proto.go79
1 files changed, 0 insertions, 79 deletions
diff --git a/java/proto.go b/java/proto.go
index c88d3d7fc..e27ef2c41 100644
--- a/java/proto.go
+++ b/java/proto.go
@@ -19,9 +19,6 @@ import (
"strconv"
"android/soong/android"
- "android/soong/bazel"
-
- "github.com/google/blueprint/proptools"
)
const (
@@ -141,79 +138,3 @@ func protoFlags(ctx android.ModuleContext, j *CommonProperties, p *android.Proto
return flags
}
-
-type protoAttributes struct {
- Deps bazel.LabelListAttribute
-
- // A list of proto_library targets that the proto_library in `deps` depends on
- // This list is overestimation.
- // Overestimation is necessary since Soong includes other protos via proto.include_dirs and not
- // a specific .proto file module explicitly.
- Transitive_deps bazel.LabelListAttribute
-
- // This is the libs and the static_libs of the original java_library module.
- // On the bazel side, after proto sources are generated in java_*_proto_library, a java_library
- // will compile them. The libs and static_libs from the original java_library module need
- // to be linked because they are necessary in compile-time classpath.
- Additional_proto_deps bazel.LabelListAttribute
-
- Sdk_version bazel.StringAttribute
- Java_version bazel.StringAttribute
-
- Plugin bazel.LabelAttribute
-}
-
-func bp2buildProto(ctx android.Bp2buildMutatorContext, m *Module, protoSrcs bazel.LabelListAttribute, AdditionalProtoDeps bazel.LabelListAttribute) *bazel.Label {
- protoInfo, ok := android.Bp2buildProtoProperties(ctx, &m.ModuleBase, protoSrcs)
- if !ok {
- return nil
- }
-
- typ := proptools.StringDefault(protoInfo.Type, protoTypeDefault)
- var rule_class string
- suffix := "_java_proto"
- switch typ {
- case "nano":
- suffix += "_nano"
- rule_class = "java_nano_proto_library"
- case "micro":
- suffix += "_micro"
- rule_class = "java_micro_proto_library"
- case "lite":
- suffix += "_lite"
- rule_class = "java_lite_proto_library"
- case "stream":
- suffix += "_stream"
- rule_class = "java_stream_proto_library"
- case "full":
- rule_class = "java_proto_library"
- default:
- ctx.PropertyErrorf("proto.type", "cannot handle conversion at this time: %q", typ)
- }
-
- plugin := bazel.LabelAttribute{}
- if m.protoProperties.Proto.Plugin != nil {
- plugin.SetValue(android.BazelLabelForModuleDepSingle(ctx, "protoc-gen-"+*m.protoProperties.Proto.Plugin))
- }
-
- protoAttrs := &protoAttributes{
- Deps: bazel.MakeLabelListAttribute(protoInfo.Proto_libs),
- Transitive_deps: bazel.MakeLabelListAttribute(protoInfo.Transitive_proto_libs),
- Additional_proto_deps: AdditionalProtoDeps,
- Java_version: bazel.StringAttribute{Value: m.properties.Java_version},
- Sdk_version: bazel.StringAttribute{Value: m.deviceProperties.Sdk_version},
- Plugin: plugin,
- }
-
- name := m.Name() + suffix
-
- ctx.CreateBazelTargetModule(
- bazel.BazelTargetModuleProperties{
- Rule_class: rule_class,
- Bzl_load_location: "//build/bazel/rules/java:proto.bzl",
- },
- android.CommonAttributes{Name: name},
- protoAttrs)
-
- return &bazel.Label{Label: ":" + name}
-}