Skip to content

Instantly share code, notes, and snippets.

@sergiandreplace
Last active April 1, 2016 07:53
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 sergiandreplace/c3c2767c273dfd3412b6a315f14ec0cf to your computer and use it in GitHub Desktop.
Save sergiandreplace/c3c2767c273dfd3412b6a315f14ec0cf to your computer and use it in GitHub Desktop.
Adding Rx and Retrolambda in an Android project
apply plugin: 'me.tatarka.retrolambda' //actives use of Retrolambda
buildscript {
repositories {
jcenter(); // to find plugins
}
dependencies {
classpath 'me.tatarka:gradle-retrolambda:3.3.0-beta4' //retrolambda
classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2' //lombok for that makes lint work with retrolambda
}
configurations.classpath.exclude group: 'com.android.tools.external.lombok' //lombok package to exclude to make it work
}
retrolambda {
javaVersion JavaVersion.VERSION_1_7 //what version should retrolambda generate
}
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8 //to be able to use lambdas and stuff
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compile 'io.reactivex:rxjava:1.0.10' //RxJava
compile 'io.reactivex:rxandroid:1.1.0' //AndroidSchedulers.UiThread()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment