gradle-retrolambda
gradle-retrolambda copied to clipboard
Unclear usage description
For using me.tatarka.retrolambda, one should add the classpath into the top build.gradle file and the plugin is applied as single element into the module build.gradle file. These information are ambiguous in the current description. Moreover, where the alternative declaration of the new plugin (for gradle 2.1+) must be written, e.g. which file, under which element, is totally unknown. The current usage description as it is now, is at best sloppy if not useless.
one should add the classpath into the top build.gradle file and the plugin is applied as single element into the module build.gradle file.
This is not necessarily the case and depends on how you have your project set up. You could have only one build.gradle file, or you can only be applying gradle-retrolambda to a single one of your modules. I don't think it's fair to assume anything about your project setup in the README instructions. For the new plugin format, it's a top-level item in your file, not sure how else to represent that.
I'm not a gradle guru and you might be right by saying that the location of these declarations may change depending the project setup. However, this does not justify that there is no info at all where the configurations should be made. You may not assume anything about the project structure and setup but for me you assume a lot about the knowledge of the users about gradle. In any case, I believe it's important to have some hints for the users where to put the configuration declarations. A declaration or a line code may make only sense in the right place. At last, the alternative declaration for the plugin is still ambiguous for me. I could not get it working neither in my module nor in the top level. If it does replace only the plugin declaration or should substitute also the classpath declaration, as well as if it ever works, is still unclear for me.
At last, once you know how things work, it's always easy. The essential point is not to make too much assumption about your audience. Only then you can generate instructions that are genuinely easy to understand and straightforward to apply.
On Wed, Oct 5, 2016 at 4:31 PM, Evan Tatarka [email protected] wrote:
one should add the classpath into the top build.gradle file and the plugin is applied as single element into the module build.gradle file.
This is not necessarily the case and depends on how you have your project set up. You could have only one build.gradle file, or you can only be applying gradle-retrolambda to a single one of your modules. I don't think it's fair to assume anything about your project setup in the README instructions. For the new plugin format, it's a top-level item in your file, not sure how else to represent that.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/evant/gradle-retrolambda/issues/212#issuecomment-251691811, or mute the thread https://github.com/notifications/unsubscribe-auth/AFsX_FdfFHyUpEaq1eDw1j-8qxR5_xmLks5qw7S2gaJpZM4KO2ym .
That's fair, you are correct when saying that "you assume a lot about the knowledge of the users about gradle". If it get some time, I'll work on trying to make the instructions a little more helpful, as always, pull requests welcome!
Although I have been able to add the dependencies without getting an error upon Gradle-sync, it would be great if there was a description regarding what goes where (build.gradle(Project) or build.gradle(Module)).
I'd be glad to submit a PR , if you could just confirm whether I've done it correctly. Added this to build.gradle (Project) :
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'me.tatarka:gradle-retrolambda:3.4.0'
}
}
And this in build.gradle (Module) :
repositories {
mavenCentral()
}
apply plugin: 'com.android.application' //or apply plugin: 'java'
apply plugin: 'me.tatarka.retrolambda'
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
If this is correct just let me know I'll submit a PR with enhanced instructions.