diff options
| author | 2022-04-22 19:09:58 -0400 | |
|---|---|---|
| committer | 2022-04-28 18:52:48 -0400 | |
| commit | 3ac6daf47c5699f9e0e7878b3c97882c498ab898 (patch) | |
| tree | db68a4350503d5e4e9fdde6082767b6594e81158 /java/java.go | |
| parent | 184a6b87e54b8f0c050ac285ac7bb9a6b68ad973 (diff) | |
bp2build converts java_version property to javacopts attribute
This CL also converts `external/rappor` (which already set `java_version` to `1.7`) to be bazelable to testify the changes.
Results from `b build //external/rappor && cat bazel-bin/external/rappor/librappor.jar-0.params`: https://paste.googleplex.com/5518725462622208.
Test: go test ./bp2build/...
Bug: 227618664
Change-Id: I8d370d4639f70fba51e6de6ceb7bcb5ace9ccd91
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/java/java.go b/java/java.go index b34d6de8a..4e7e14c07 100644 --- a/java/java.go +++ b/java/java.go @@ -2089,6 +2089,11 @@ func (m *Library) convertLibraryAttrsBp2Build(ctx android.TopDownMutatorContext) if m.properties.Javacflags != nil { javacopts = append(javacopts, m.properties.Javacflags...) } + if m.properties.Java_version != nil { + javaVersion := normalizeJavaVersion(ctx, *m.properties.Java_version).String() + javacopts = append(javacopts, fmt.Sprintf("-source %s -target %s", javaVersion, javaVersion)) + } + epEnabled := m.properties.Errorprone.Enabled //TODO(b/227504307) add configuration that depends on RUN_ERROR_PRONE environment variable if Bool(epEnabled) { |