Skip to content
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

Avoid android private API: variant.variantData #235

Merged
merged 4 commits into from
Jun 5, 2018

Conversation

zpencer
Copy link
Contributor

@zpencer zpencer commented Jun 4, 2018

This returns an internal class and we should avoid this call.

It makes sense just to query for variant.sourceSets
or variant.productFlavors rather than building up the source sets
ourselves.

It actually looks like the list that we create ourselves is missing a source
set during testing:
Example 1

variant.sourceSets
0 = "main"
1 = "freeapp"
2 = "x86"
3 = "x86Freeapp"
4 = "debug"
5 = "x86FreeappDebug"

sourceSetNames
 0 = "main"
 1 = "main"
 2 = "x86FreeappDebug"
 3 = "debug"
 4 = "x86"
 5 = "freeapp"

Example 2

variant.sourceSets
 0 = "main"
 1 = "retailapp"
 2 = "x86"
 3 = "x86Retailapp"
 4 = "release"
 5 = "x86RetailappRelease"

sourceSetNames
 0 = "main"
 1 = "main"
 2 = "x86RetailappRelease"
 3 = "release"
 4 = "x86"
 5 = "retailapp"

zpencer added 2 commits June 4, 2018 11:17
This returns an internal class and we should avoid this call.

In some places, it makes sense just to query for `variant.sourceSets`
or `variant.productFlavors`.
@zpencer zpencer merged commit a7109ed into google:master Jun 5, 2018
@zpencer zpencer deleted the avoid-android-internal-api branch June 5, 2018 00:45
zhangkun83 pushed a commit to zhangkun83/protobuf-gradle-plugin-1 that referenced this pull request Nov 7, 2018
This returns an internal class and we should avoid this call.

In some places, it makes sense just to query for `variant.sourceSets`
or `variant.productFlavors`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants