Skip to content

Instantly share code, notes, and snippets.

@afshin-hoseini
Created February 23, 2017 05:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afshin-hoseini/ca3a80532a93c050b8fd0afeedd8e197 to your computer and use it in GitHub Desktop.
Save afshin-hoseini/ca3a80532a93c050b8fd0afeedd8e197 to your computer and use it in GitHub Desktop.
How to enable lambda in Android library
// Java8 not fully supported in library projects yet, https://code.google.com/p/android/issues/detail?id=211386
// this is a temporary workaround to get at least lambdas compiling
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xbootclasspath/a:" + System.properties.get("java.home") + "/lib/rt.jar"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment