Skip to content
This repository has been archived by the owner on Oct 31, 2022. It is now read-only.

Upgrade to Gradle 7.0 and AGP 4.2.1 #154

Merged
merged 14 commits into from
Jun 8, 2021
Merged

Upgrade to Gradle 7.0 and AGP 4.2.1 #154

merged 14 commits into from
Jun 8, 2021

Conversation

jkasten2
Copy link
Member

@jkasten2 jkasten2 commented Jun 6, 2021

Description

One Line Summary

Updated to Gradle 7.0 and fixed a number compatibility issues with the upgrade.

Details

  • Upgrade from Gradle 6.7.1 to 7.0.2
  • Fix a number of compatibility issue with our build.gradle, see commit-by-commit for details
  • New required constructor for DefaultVersionSelectorScheme which DefaultVersionSelectorSchemeCompat was added to handle both old a new Gradle versions
  • Upgrade to AGP 4.2.1

This change is Reviewable

jkasten2 added 6 commits June 6, 2021 13:17
* "compile" as been deprecated for awhile and has been completely
dropped in Gradle 7
* Required since Gradle 7 upgraded to Groovy 3.0
* Added required useJUnitPlatform() line for Spock 2
* uploadArchives is no longer supported by Gradle 7
* jcenter is no longer being updated so it should be last in the repo
list
Copy link

@Jeasmine Jeasmine left a comment

Choose a reason for hiding this comment

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

LGTM nit comments

build.gradle Outdated
@@ -82,6 +82,10 @@ test {
}
}

processResources {
// Required by Gradle 7
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
Copy link

Choose a reason for hiding this comment

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

Nit, is this code well code formatted?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in commit c5e3919

@@ -0,0 +1,31 @@
package com.onesignal.androidsdk;
Copy link

Choose a reason for hiding this comment

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

The commit message has some types; maybe you want to update it. 😬

  • DefaultVersionSelectorScheme now requires a VersionParser as part of
    it's constructor parameters.
  • This introduced in Gradle 4.7. or 4.8 but the old deprecated
    constructor was dropped in 7.0
  • Since we want to continue to support Gradle versions older than 4.7
    created DefaultVersionSelectorSchemeCompat to handle constructing
    a DefaultVersionSelectorScheme instance to handle the fallback logic

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catches!
Fixed with git rebase -i on selected reword and force pushed.
See commit 5c44161 for the fix

Base automatically changed from fix/agp_apply_from_version_detection to main June 7, 2021 20:06
jkasten2 added 8 commits June 7, 2021 23:40
* DefaultVersionSelectorScheme now requires a VersionParser as part of
it's constructor parameters.
* This introduced in Gradle 4.7. or 4.8 but the old deprecated
constructor was dropped in 7.0
* Since we want to continue to support Gradle versions older than 4.7
created DefaultVersionSelectorSchemeCompat to handle constructing
a DefaultVersionSelectorScheme instance to handle the fallback logic
* Removed intersectCompat to always use our
VersionCompatHelpers.intersect.
   - Found out that VersionRangeSelector.intersect was an internal method
   and was only present from Gradle 4.3 to 4.9. I was not able to find
   a direct replacement so for consistency always use our
   VersionCompatHelpers
* Added android.enableD8.desugaring=false as it was required for tests
to pass.
   - Nothing a end user has to change, just the way our tests are setup.
* Use Gradle 6.7.1 instead for this test
@jkasten2 jkasten2 merged commit 024e3f1 into main Jun 8, 2021
@jkasten2 jkasten2 deleted the upgrade/gradle_7.0 branch June 8, 2021 18:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants