aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gruver <bgruv@google.com>2015-04-30 23:26:23 -0700
committerBen Gruver <bgruv@google.com>2015-04-30 23:26:23 -0700
commit583079cc43bb329a14281d6ace30196698a53cc0 (patch)
tree83def0c584fc3ade5a03417f83b38d28402b5a9c
parent17828564bae2c03788e5366b73ca9e259f70ca5d (diff)
downloadsmali-583079cc43bb329a14281d6ace30196698a53cc0.tar.gz
Ensure that java 6 is used for release builds
-rw-r--r--build.gradle20
1 files changed, 19 insertions, 1 deletions
diff --git a/build.gradle b/build.gradle
index f0d1e00a..00041fcd 100644
--- a/build.gradle
+++ b/build.gradle
@@ -57,6 +57,11 @@ if (!('release' in gradle.startParameter.taskNames)) {
// use something like module-1.2.3-dev.jar for the jar name, rather than the full
// module-1.2.3-001afe02-dirty.jar
jarVersion = baseVersion + '-dev'
+} else {
+ if (System.env.JDK6_HOME == null && !JavaVersion.current().isJava6()) {
+ throw new InvalidUserDataException("bzzzzzzzt. Release builds must be performed with java 6. " +
+ "Either run gradle with java 6, or define the JDK6_HOME environment variable.")
+ }
}
// Note: please don't use this. This is strictly for the official releases
@@ -79,6 +84,19 @@ subprojects {
}
}
+ if (System.env.JDK6_HOME != null) {
+ sourceCompatibility = 1.6
+ targetCompatibility = 1.6
+
+ tasks.withType(JavaCompile) {
+ doFirst {
+ options.fork = true
+ options.bootClasspath = "$System.env.JDK6_HOME/jre/lib/rt.jar"
+ options.bootClasspath += "$File.pathSeparator$System.env.JDK6_HOME/jre/lib/jsse.jar"
+ }
+ }
+ }
+
version = parent.version
ext {
@@ -90,7 +108,7 @@ subprojects {
stringtemplate: 'org.antlr:stringtemplate:3.2.1',
commons_cli: 'commons-cli:commons-cli:1.2',
jflex: 'de.jflex:jflex:1.4.3',
- jflex_plugin: 'co.tomlee.gradle.plugins:gradle-jflex-plugin:0.0.1',
+ jflex_plugin: 'co.tomlee.gradle.plugins:gradle-jflex-plugin:0.0.2',
proguard_gradle: 'net.sf.proguard:proguard-gradle:5.2.1',
dx: 'com.google.android.tools:dx:1.7'
]