-
Notifications
You must be signed in to change notification settings - Fork 653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix duplicate class generation in test folders #2106
Conversation
@@ -55,7 +55,7 @@ subprojects { | |||
} | |||
|
|||
plugins.withType(com.android.build.gradle.BasePlugin::class.java) { | |||
extension.compileOptions { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that this is deprecated in AGP 3.6.1 and removed in 4.0
|
||
private fun SourceDirectorySet.findSources(schemaFile: RegularFileProperty) { | ||
when { | ||
apolloVariant.isTest -> srcDirFromVariant(apolloVariant) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Starting from suggestions in the IDE, I ended up refactoring this to make it easier to follow. This is the only behavior change.
I recommend reviewing this in "split" view.
* Replace deprecated AGP function * Modify and auto-add sourceSets only for non-test variants * Add tests to verify the fix * Revert change in Plugin and adjust finding soources based on test sources * Do not take sourceFolder into account (cherry picked from commit 10c04ee)
Modify and auto-add sourceSets only for non-test variants