Delete generated BuildTypeAttr in module file to not force the build type to app consumer#425
Open
DevHugo wants to merge 1 commit intoairbnb:masterfrom
Open
Delete generated BuildTypeAttr in module file to not force the build type to app consumer#425DevHugo wants to merge 1 commit intoairbnb:masterfrom
DevHugo wants to merge 1 commit intoairbnb:masterfrom
Conversation
…type to app consumer Fix airbnb#416, airbnb#274 Due to commit e7f105f the module file generated by the plugin gradle-maven-publish-plugin contains com.android.build.api.attributes.BuildTypeAttr attribute. This attribute force consumer of the library to use only the build types specified by the attribute: "debug" and "release". Reproduction case is to create an app with a specific buildTypes (not debug and release) and try to compile. Example on https://github.com/DevHugo/ReproProjectShowkase with command ./gradlew clean assemblePaid --rerun-tasks --no-configuration-cache It also avoid publishing debug artefact, that was not needed.
584f80e to
be28a3c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #416, #274.
Due to commit e7f105f the module file generated by the plugin gradle-maven-publish-plugin contains
com.android.build.api.attributes.BuildTypeAttrattribute. This attribute force consumer of the library to use only the build types specified by the attribute: "debug" and "release".See this medium article, if you want to have more details on the issue.
Reproduction case is to create an app with a specific buildTypes (not debug and release) and try to compile. Example on ReproProjectShowkase with command
./gradlew clean assemblePaid --rerun-tasks --no-configuration-cacheBefore the PR, the module file look like this.
After this PR, the module generated by the plugin should look like the 1.0.4 version module file. You can attest that by checking the diff between the 1.0.4 version and the fixed module file 1.0.5: https://www.diffchecker.com/dn2JxDwe/ (external website diffchecker.com).
It also avoid publishing debug artefact, that was not needed. See this PR and issue 274.
You can find documentation on AndroidSingleVariantLibrary or source code, if you want to deep-dive a little.
Non regression test done: see that it works in the demo project ReproProjectShowkase and test the sample app.