Add flags needed to switch Jack to 1.8 for CTS targets

When linking against .jack files that contain 1.8 language
features Jack (currently) requires -D jack.java.source.version=1.8.
This requirement may be dropped in future and then this change
might be reverted. It may also be removed once 1.8 becomes
the default. See bug 27113322.

"core-tests" includes 1.8 language features.

Bug: 26814204
Bug: 27113322
Bug: 26953739
(cherry-picked from commit 54caafeab5f38bcd2f6fc07de771666dc922c34d)

Change-Id: I036a241025781b1db09858678a90948e4311c36a
diff --git a/apps/CtsVerifier/Android.mk b/apps/CtsVerifier/Android.mk
index 812ca03..2bdde83 100644
--- a/apps/CtsVerifier/Android.mk
+++ b/apps/CtsVerifier/Android.mk
@@ -51,6 +51,8 @@
 
 LOCAL_DEX_PREOPT := false
 
+LOCAL_JAVA_LANGUAGE_VERSION := 1.8
+
 include $(BUILD_PACKAGE)
 
 
diff --git a/tests/core/libcore/com/Android.mk b/tests/core/libcore/com/Android.mk
index db08dbd..c1df39a 100644
--- a/tests/core/libcore/com/Android.mk
+++ b/tests/core/libcore/com/Android.mk
@@ -17,4 +17,5 @@
 include $(CLEAR_VARS)
 LOCAL_PACKAGE_NAME := android.core.tests.libcore.package.com
 LOCAL_STATIC_JAVA_LIBRARIES := core-tests
+LOCAL_JAVA_LANGUAGE_VERSION := 1.8
 include $(BUILD_CTSCORE_PACKAGE)
diff --git a/tests/core/libcore/conscrypt/Android.mk b/tests/core/libcore/conscrypt/Android.mk
index bcfd3a4..cd8559c 100644
--- a/tests/core/libcore/conscrypt/Android.mk
+++ b/tests/core/libcore/conscrypt/Android.mk
@@ -21,4 +21,5 @@
 include $(CLEAR_VARS)
 LOCAL_PACKAGE_NAME := android.core.tests.libcore.package.conscrypt
 LOCAL_STATIC_JAVA_LIBRARIES := core-tests conscrypt-tests
+LOCAL_JAVA_LANGUAGE_VERSION := 1.8
 include $(BUILD_CTSCORE_PACKAGE)
diff --git a/tests/core/libcore/dalvik/Android.mk b/tests/core/libcore/dalvik/Android.mk
index 42d14f3..501c674 100644
--- a/tests/core/libcore/dalvik/Android.mk
+++ b/tests/core/libcore/dalvik/Android.mk
@@ -17,4 +17,5 @@
 include $(CLEAR_VARS)
 LOCAL_PACKAGE_NAME := android.core.tests.libcore.package.dalvik
 LOCAL_STATIC_JAVA_LIBRARIES := core-tests
+LOCAL_JAVA_LANGUAGE_VERSION := 1.8
 include $(BUILD_CTSCORE_PACKAGE)
diff --git a/tests/core/libcore/harmony_annotation/Android.mk b/tests/core/libcore/harmony_annotation/Android.mk
index e9f716e..6746cf3 100644
--- a/tests/core/libcore/harmony_annotation/Android.mk
+++ b/tests/core/libcore/harmony_annotation/Android.mk
@@ -21,4 +21,5 @@
 include $(CLEAR_VARS)
 LOCAL_PACKAGE_NAME := android.core.tests.libcore.package.harmony_annotation
 LOCAL_STATIC_JAVA_LIBRARIES := core-tests
+LOCAL_JAVA_LANGUAGE_VERSION := 1.8
 include $(BUILD_CTSCORE_PACKAGE)
diff --git a/tests/core/libcore/harmony_java_io/Android.mk b/tests/core/libcore/harmony_java_io/Android.mk
index a8d4fa0..3108f30 100644
--- a/tests/core/libcore/harmony_java_io/Android.mk
+++ b/tests/core/libcore/harmony_java_io/Android.mk
@@ -21,4 +21,5 @@
 include $(CLEAR_VARS)
 LOCAL_PACKAGE_NAME := android.core.tests.libcore.package.harmony_java_io
 LOCAL_STATIC_JAVA_LIBRARIES := core-tests
+LOCAL_JAVA_LANGUAGE_VERSION := 1.8
 include $(BUILD_CTSCORE_PACKAGE)
diff --git a/tests/core/libcore/harmony_java_lang/Android.mk b/tests/core/libcore/harmony_java_lang/Android.mk
index 8b1bdff..e333708 100644
--- a/tests/core/libcore/harmony_java_lang/Android.mk
+++ b/tests/core/libcore/harmony_java_lang/Android.mk
@@ -21,4 +21,5 @@
 include $(CLEAR_VARS)
 LOCAL_PACKAGE_NAME := android.core.tests.libcore.package.harmony_java_lang
 LOCAL_STATIC_JAVA_LIBRARIES := core-tests
+LOCAL_JAVA_LANGUAGE_VERSION := 1.8
 include $(BUILD_CTSCORE_PACKAGE)
diff --git a/tests/core/libcore/harmony_java_math/Android.mk b/tests/core/libcore/harmony_java_math/Android.mk
index 8310743..5889f85 100644
--- a/tests/core/libcore/harmony_java_math/Android.mk
+++ b/tests/core/libcore/harmony_java_math/Android.mk
@@ -21,4 +21,5 @@
 include $(CLEAR_VARS)
 LOCAL_PACKAGE_NAME := android.core.tests.libcore.package.harmony_java_math
 LOCAL_STATIC_JAVA_LIBRARIES := core-tests
+LOCAL_JAVA_LANGUAGE_VERSION := 1.8
 include $(BUILD_CTSCORE_PACKAGE)
diff --git a/tests/core/libcore/harmony_java_net/Android.mk b/tests/core/libcore/harmony_java_net/Android.mk
index 7917bcc..95218c4 100644
--- a/tests/core/libcore/harmony_java_net/Android.mk
+++ b/tests/core/libcore/harmony_java_net/Android.mk
@@ -21,4 +21,5 @@
 include $(CLEAR_VARS)
 LOCAL_PACKAGE_NAME := android.core.tests.libcore.package.harmony_java_net
 LOCAL_STATIC_JAVA_LIBRARIES := core-tests
+LOCAL_JAVA_LANGUAGE_VERSION := 1.8
 include $(BUILD_CTSCORE_PACKAGE)
diff --git a/tests/core/libcore/harmony_java_nio/Android.mk b/tests/core/libcore/harmony_java_nio/Android.mk
index 2c6f673..5bdfd17 100644
--- a/tests/core/libcore/harmony_java_nio/Android.mk
+++ b/tests/core/libcore/harmony_java_nio/Android.mk
@@ -21,4 +21,5 @@
 include $(CLEAR_VARS)
 LOCAL_PACKAGE_NAME := android.core.tests.libcore.package.harmony_java_nio
 LOCAL_STATIC_JAVA_LIBRARIES := core-tests
+LOCAL_JAVA_LANGUAGE_VERSION := 1.8
 include $(BUILD_CTSCORE_PACKAGE)
diff --git a/tests/core/libcore/harmony_java_text/Android.mk b/tests/core/libcore/harmony_java_text/Android.mk
index ecd1574..21113e5 100644
--- a/tests/core/libcore/harmony_java_text/Android.mk
+++ b/tests/core/libcore/harmony_java_text/Android.mk
@@ -21,4 +21,5 @@
 include $(CLEAR_VARS)
 LOCAL_PACKAGE_NAME := android.core.tests.libcore.package.harmony_java_text
 LOCAL_STATIC_JAVA_LIBRARIES := core-tests
+LOCAL_JAVA_LANGUAGE_VERSION := 1.8
 include $(BUILD_CTSCORE_PACKAGE)
diff --git a/tests/core/libcore/harmony_java_util/Android.mk b/tests/core/libcore/harmony_java_util/Android.mk
index 6d7bded..f34295e 100644
--- a/tests/core/libcore/harmony_java_util/Android.mk
+++ b/tests/core/libcore/harmony_java_util/Android.mk
@@ -21,4 +21,5 @@
 include $(CLEAR_VARS)
 LOCAL_PACKAGE_NAME := android.core.tests.libcore.package.harmony_java_util
 LOCAL_STATIC_JAVA_LIBRARIES := core-tests
+LOCAL_JAVA_LANGUAGE_VERSION := 1.8
 include $(BUILD_CTSCORE_PACKAGE)
diff --git a/tests/core/libcore/harmony_javax_security/Android.mk b/tests/core/libcore/harmony_javax_security/Android.mk
index 011940d..fce594b 100644
--- a/tests/core/libcore/harmony_javax_security/Android.mk
+++ b/tests/core/libcore/harmony_javax_security/Android.mk
@@ -21,4 +21,5 @@
 include $(CLEAR_VARS)
 LOCAL_PACKAGE_NAME := android.core.tests.libcore.package.harmony_javax_security
 LOCAL_STATIC_JAVA_LIBRARIES := core-tests
+LOCAL_JAVA_LANGUAGE_VERSION := 1.8
 include $(BUILD_CTSCORE_PACKAGE)
diff --git a/tests/core/libcore/harmony_logging/Android.mk b/tests/core/libcore/harmony_logging/Android.mk
index 2ec10f1..69a8e3a 100644
--- a/tests/core/libcore/harmony_logging/Android.mk
+++ b/tests/core/libcore/harmony_logging/Android.mk
@@ -21,4 +21,5 @@
 include $(CLEAR_VARS)
 LOCAL_PACKAGE_NAME := android.core.tests.libcore.package.harmony_logging
 LOCAL_STATIC_JAVA_LIBRARIES := apache-harmony-tests
+LOCAL_JAVA_LANGUAGE_VERSION := 1.8
 include $(BUILD_CTSCORE_PACKAGE)
diff --git a/tests/core/libcore/libcore/Android.mk b/tests/core/libcore/libcore/Android.mk
index a547166..ec6228b 100644
--- a/tests/core/libcore/libcore/Android.mk
+++ b/tests/core/libcore/libcore/Android.mk
@@ -17,4 +17,5 @@
 include $(CLEAR_VARS)
 LOCAL_PACKAGE_NAME := android.core.tests.libcore.package.libcore
 LOCAL_STATIC_JAVA_LIBRARIES := core-tests mockito-api
+LOCAL_JAVA_LANGUAGE_VERSION := 1.8
 include $(BUILD_CTSCORE_PACKAGE)
diff --git a/tests/core/libcore/org/Android.mk b/tests/core/libcore/org/Android.mk
index 0f3f0ca..d174f98 100644
--- a/tests/core/libcore/org/Android.mk
+++ b/tests/core/libcore/org/Android.mk
@@ -17,4 +17,5 @@
 include $(CLEAR_VARS)
 LOCAL_PACKAGE_NAME := android.core.tests.libcore.package.org
 LOCAL_STATIC_JAVA_LIBRARIES := core-tests
+LOCAL_JAVA_LANGUAGE_VERSION := 1.8
 include $(BUILD_CTSCORE_PACKAGE)
diff --git a/tests/core/libcore/sun/Android.mk b/tests/core/libcore/sun/Android.mk
index ed6d2c7..2fa1520 100644
--- a/tests/core/libcore/sun/Android.mk
+++ b/tests/core/libcore/sun/Android.mk
@@ -17,4 +17,5 @@
 include $(CLEAR_VARS)
 LOCAL_PACKAGE_NAME := android.core.tests.libcore.package.sun
 LOCAL_STATIC_JAVA_LIBRARIES := core-tests
+LOCAL_JAVA_LANGUAGE_VERSION := 1.8
 include $(BUILD_CTSCORE_PACKAGE)
diff --git a/tests/core/libcore/tests/Android.mk b/tests/core/libcore/tests/Android.mk
index 54ffd31..82ab12e 100644
--- a/tests/core/libcore/tests/Android.mk
+++ b/tests/core/libcore/tests/Android.mk
@@ -17,4 +17,5 @@
 include $(CLEAR_VARS)
 LOCAL_PACKAGE_NAME := android.core.tests.libcore.package.tests
 LOCAL_STATIC_JAVA_LIBRARIES := core-tests
+LOCAL_JAVA_LANGUAGE_VERSION := 1.8
 include $(BUILD_CTSCORE_PACKAGE)
diff --git a/tests/core/runner/Android.mk b/tests/core/runner/Android.mk
index 649b3b4..0ca371b 100644
--- a/tests/core/runner/Android.mk
+++ b/tests/core/runner/Android.mk
@@ -29,4 +29,6 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := core-tests android-support-test
 
+LOCAL_JAVA_LANGUAGE_VERSION := 1.8
+
 include $(BUILD_CTSCORE_PACKAGE)