From 2f9c3b805675f02653a433637b33188b61f90c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Thu, 5 Jun 2014 10:32:57 +0200 Subject: [PATCH] Switch to java 1.7 Taken from the gradle plugin user guide: With Android KitKat (buildToolsVersion 19) you can use the diamond operator, multi-catch, strings in switches, try with resources, etc. Note that you can use minSdkVersion with a value earlier than 19, for all language features except try with resources. If you want to use try with resources, you will need to also use a minSdkVersion of 19. You also need to make sure that Gradle is using version 1.7 or later of the JDK. (And version 0.6.1 or later of the Android Gradle plugin.) --- ant.properties | 2 ++ build.gradle | 4 ++-- project.properties | 2 -- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ant.properties b/ant.properties index 54f6fd670..e5d868bde 100644 --- a/ant.properties +++ b/ant.properties @@ -1 +1,3 @@ java.encoding=UTF-8 +java.source=1.7 +java.target=1.7 diff --git a/build.gradle b/build.gradle index 2b2fb0754..27404771a 100644 --- a/build.gradle +++ b/build.gradle @@ -78,8 +78,8 @@ android { buildToolsVersion toolVersion compileOptions { - sourceCompatibility = "1.6" - targetCompatibility = "1.6" + sourceCompatibility JavaVersion.VERSION_1_7 + targetCompatibility JavaVersion.VERSION_1_7 } sourceSets { diff --git a/project.properties b/project.properties index a9b6cb869..41cb681d3 100644 --- a/project.properties +++ b/project.properties @@ -1,8 +1,6 @@ proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt target=android-19 -compile.source=1.6 -compile.target=1.6 android.library.reference.1=extern/UniversalImageLoader/library android.library.reference.2=extern/MemorizingTrustManager