diff options
| author | Sam Delmerico <delmerico@google.com> | 2022-03-15 21:02:09 +0000 |
|---|---|---|
| committer | Sam Delmerico <delmerico@google.com> | 2022-03-31 14:38:07 +0000 |
| commit | 58614c04148fde0871ceba72db213c9d4761de20 (patch) | |
| tree | 14be331a18402883a6f23797b65f97bed98e80bf /java/java.go | |
| parent | 76ff96f88584282e89c7d5f8f2e73a35710ab358 (diff) | |
support errorprone javacflags
Soong has a separate property specifically for errorprone javacflags
that we need to add to the Bazel javacopts.
Test: go test ./bp2build
Change-Id: I5299f45793d2b05a6a71b94dd17ceb797f407846
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/java/java.go b/java/java.go index 1b6e559b3..5afa2db01 100644 --- a/java/java.go +++ b/java/java.go @@ -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{} |
