Last active
May 10, 2016 05:24
-
-
Save dp-singh/4bcce518edf8ef576656 to your computer and use it in GitHub Desktop.
It is used to setup retrolambda in android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String java8 = getJavaVersion(8) | |
String java7 = getJavaVersion(7) | |
retrolambda { | |
jdk java8 | |
oldJdk java7 | |
javaVersion JavaVersion.VERSION_1_7 | |
// jvmArgs '-arg1', '-arg2' < if I don't comment this line gradle fails | |
defaultMethods false | |
incremental true | |
} | |
String getJavaVersion(Integer v) { | |
def sout = new StringBuffer() | |
def proc = "/usr/libexec/java_home -v 1.$v".execute() | |
proc.consumeProcessOutput(sout, new StringBuffer()) | |
proc.waitForOrKill(1000) | |
return sout.toString().replace("\n", "").replace("\r", "") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
evant/gradle-retrolambda#120
Find it from this issue.