Pin Java bindings to 1.7

The android_library bazel rule currently enforces Java 7
6c1106b1a7/src/main/java/com/google/devtools/build/lib/bazel/rules/android/BazelAndroidSemantics.java (L73)

More generally, to enable broader use we pin the source and artifacts
to 1.7 till Java 8 gains wider adoption across Android.
This commit is contained in:
KB Sriram 2017-06-09 10:11:34 -07:00
parent 4c0052dc4b
commit c9efdaf468
3 changed files with 14 additions and 5 deletions

View File

@ -1,5 +1,14 @@
# -*- Python -*-
# Pin to Java 1.7 to ensure broader compatibility for the Java bindings on
# Android. Note also that the android_library bazel rule currently enforces
# java 7
# https://github.com/bazelbuild/bazel/blob/6c1106b1a721516d3b3db54d2e1c31b44a76fbb1/src/main/java/com/google/devtools/build/lib/bazel/rules/android/BazelAndroidSemantics.java#L73
JAVA_VERSION_OPTS = [
"-source 7 -target 7",
]
# A more robust set of lint and errorprone checks when building
# Java source to improve code consistency.
@ -151,4 +160,4 @@ EP_DISABLED_CHECKS = [
EP_OPTS = EP_ENABLED_WARNINGS + EP_DISABLED_CHECKS
JAVACOPTS = XLINT_OPTS + EP_OPTS
JAVACOPTS = JAVA_VERSION_OPTS + XLINT_OPTS + EP_OPTS

View File

@ -19,8 +19,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>

View File

@ -27,8 +27,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>