From a6854fc67cf2c93ae42ff84cc18214b230a4057b Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Mon, 8 Jul 2013 14:03:13 -0500 Subject: [PATCH] force a 1.7 jdk on build --- build.gradle | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 6152f191..cc479c0e 100644 --- a/build.gradle +++ b/build.gradle @@ -25,8 +25,16 @@ repositories { mavenCentral() } -sourceCompatibility = 1.6 -targetCompatibility = 1.6 +sourceCompatibility = 1.7 +targetCompatibility = 1.7 + +build.doFirst { + def javaVersion = System.getProperty("java.version") + //fail the build if we don't have the expected Java version + if (!javaVersion.startsWith("1.7")) { + throw new GradleException("You can fix this problem!\nWe found a " + javaVersion + " JDK\nPlease update JAVA_HOME to use a 1.7 JDK\nCurrently it is set to: " + System.getProperty("java.home")); + } +} class Compatibility { String version