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

Gradle 4.8-rc-1 compat fix - use def when finding the buildType #110

Merged
merged 3 commits into from
May 24, 2018

Conversation

fractalwrench
Copy link
Contributor

@fractalwrench fractalwrench commented May 22, 2018

Goal

Gradle 4.8-rc-1 changes project.android.buildTypes.store to return an Iterable rather than a Set, which can lead to a runtime error within the plugin. This changeset prevents the runtime error by using def instead.

Changeset

Changed

Altered affected types from specific Set implementation to def.

Tests

Mazerunner was run locally after running ./gradlew wrapper --gradle-version 4.8-rc-1 in each of the fixture projects.

Discussion

Alternative Approaches

We could use Iterable instead of def.

Linked issues

#109

Review

For the submitter, initial self-review:

  • Commented on code changes inline explain the reasoning behind the approach
  • Reviewed the test cases added for completeness and possible points for discussion
  • A changelog entry was added for the goal of this pull request
  • Check the scope of the changeset - is everything in the diff required for the pull request?
  • This pull request is ready for:
    • Initial review of the intended approach, not yet feature complete
    • Structural review of the classes, functions, and properties modified
    • Final review

For the pull request reviewer(s), this changeset has been reviewed for:

  • Consistency across platforms for structures or concepts added or modified
  • Consistency between the changeset and the goal stated above
  • Internal consistency with the rest of the library - is there any overlap between existing interfaces and any which have been added?
  • Usage friction - is the proposed change in usage cumbersome or complicated?
  • Performance and complexity - are there any cases of unexpected O(n^3) when iterating, recursing, flat mapping, etc?
  • Concurrency concerns - if components are accessed asynchronously, what issues will arise
  • Thoroughness of added tests and any missing edge cases
  • Idiomatic use of the language

4.8-rc-1 changes the buildtypes store to return an iterable rather than a set, which would
previously lead to a runtime error with the plugin.
@fractalwrench fractalwrench requested a review from a team May 22, 2018 09:51
@fractalwrench fractalwrench changed the title fix: Use def rather than specific type Gradle 4.8-rc-1 compat fix - use def when finding the buildType May 22, 2018
@@ -259,7 +259,7 @@ class BugsnagPlugin implements Plugin<Project> {
private static boolean isJackEnabled(Project project, BaseVariant variant) {

// First check the selected build type to see if there are jack settings
TreeSet buildTypes = project.android.buildTypes.store
def buildTypes = project.android.buildTypes.store

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha, Groovy is helpful sometimes right

kattrali
kattrali previously approved these changes May 23, 2018
Copy link
Contributor

@kattrali kattrali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, I'm unsure what's up with the CI suite though.

CHANGELOG.md Outdated

### Bug fixes

* Gradle 4.8-rc-1 compat fix - use def when finding the buildType
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This summary seems unclear. It should say is happening from a user perspective, e.g. "Add compatibility with Gradle 4.8-rc1"

@fractalwrench
Copy link
Contributor Author

Looks like whatever is wrong with CI is wrong on master also.

@kattrali kattrali merged commit 7b4226d into master May 24, 2018
@kattrali kattrali deleted the 4.8-rc-1-compat-fix branch May 24, 2018 02:15
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.

3 participants