Closed josh-burton closed 7 years ago
Looks good, can we get a test for this? See https://github.com/evant/gradle-retrolambda/blob/master/gradle-retrolambda/src/test/java/me/tatarka/AndroidLibPluginTest.java for an example.
Hey Evan, I've added tests but they are currently failing.
The UI tests (or the sample projects) are failing due to issues with flavor selection in the latest AGP plugin: https://issuetracker.google.com/issues/62170415
I'm unsure why the unit tests are failing. I am getting the following error:
lambda expressions are not supported in -source 1.7
Perhaps an environment setup issue?
Hm, yep I'm getting the same error. Adding
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
seems to cause I new error
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for java.lang.invoke.MethodType not found
I'm getting that error running trying to run the sample app too.
Figured it out, apprently features have a feature varaint and a library variant. Adding
android.libraryVariants.all { BaseVariant variant ->
configureCompileJavaTask(project, variant, transform)
}
seems to fix it.
Did you add the compile options to the test projects? I'm still getting a myriad of errors with both changes 😕
The remaining tests I see failing don't seem to be related to this change. If this is the case you are seeing, I can merge this and make a sepreate pr for the tests.
ah ok I think that may be the case. I'm happy for this to be merged.
The feature plugin is a new plugin type used in Instant Apps.