Merge "support errorprone javacflags"

This commit is contained in:
Treehugger Robot
2022-04-05 17:46:08 +00:00
committed by Gerrit Code Review
2 changed files with 74 additions and 4 deletions

View File

@@ -2060,15 +2060,22 @@ func (m *Library) convertLibraryAttrsBp2Build(ctx android.TopDownMutatorContext)
protoSrcPartition: android.ProtoSrcLabelPartition,
})
var javacopts []string
if m.properties.Javacflags != nil {
javacopts = append(javacopts, m.properties.Javacflags...)
}
epEnabled := m.properties.Errorprone.Enabled
//TODO(b/227504307) add configuration that depends on RUN_ERROR_PRONE environment variable
if Bool(epEnabled) {
javacopts = append(javacopts, m.properties.Errorprone.Javacflags...)
}
commonAttrs := &javaCommonAttributes{
Srcs: srcPartitions[javaSrcPartition],
Plugins: bazel.MakeLabelListAttribute(
android.BazelLabelForModuleDeps(ctx, m.properties.Plugins),
),
}
if m.properties.Javacflags != nil {
commonAttrs.Javacopts = bazel.MakeStringListAttribute(m.properties.Javacflags)
Javacopts: bazel.MakeStringListAttribute(javacopts),
}
depLabels := &javaDependencyLabels{}