Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Upgrade Gradle to 7.4 & AGP to 7.1.1 (& Disable Jetifier)#9

Closed
ParaskP7 wants to merge 22 commits intowp-forkfrom
update/gradle-to-7.3.3-agp-to-7.0.4
Closed

Upgrade Gradle to 7.4 & AGP to 7.1.1 (& Disable Jetifier)#9
ParaskP7 wants to merge 22 commits intowp-forkfrom
update/gradle-to-7.3.3-agp-to-7.0.4

Conversation

@ParaskP7
Copy link
Copy Markdown

@ParaskP7 ParaskP7 commented Feb 16, 2022

This PR is part of Upgrade Gradle to 7.4 & AGP to 7.1.1 (& Disable Jetifier) PR. There are 13 libraries that are upgraded to Gradle 7.4 & AGP 7.1.1 (& Disable Jetifier).


All those PRs follow the general outline below:

  • Gradle version upgraded to 7.3.3 with the ./gradlew wrapper --gradle-version=7.3.3 --distribution-type=all command.
  • AGP version upgrade to 7.0.4 (see android/settings.gradle.kts change).
  • Build output diff:
    • To identify and fix new warnings/errors that got added.
    • To identify and verify old warnings/errors that got removed.
  • Lint output diff
    • To identify and fix new warnings/errors that got added.
    • To identify and verify old warnings/errors that got removed.
  • The above 4 steps were redone with a follow-up update to Gradle 7.4 & AGP 7.1.1.
  • Jetifier drop (see android/gradle.properties change).
  • OUTDATED
    • Version bump to 1.9.0-wp-3 (see package.json).
    • Tarball update to 1.9.0-wp-3 (see react-native-reanimated-1.9.0-wp-3.tgz).
    • The build was also verified through Jitpack (see build.log).
  • OUTDATED
    • AGP version upgrade to 7.1.1 (from 4.2.2) (within android/build.gradle). Cc @oguzkocer
    • Version bump to 2.2.4-wp-2 (see package.json).
    • Tarball update to 2.2.4-wp-2 (see react-native-reanimated-2.2.4-wp-2.tgz).
    • The build was also verified through Jitpack (see build.log).
  • UPDATED
    • Spotless configuration change (within settings.gradle.kts and android/gradle).
    • Version bump to 2.4.1-wp-2 (see package.json).
    • Tarball update to 2.4.1-wp-2 (see react-native-reanimated-2.4.1-wp-2.tgz).
    • The build was also verified through Jitpack (see build.log).

To test - Now

These changes can be tested as part of the gutenberg PR which is updated to use the temporarily non-tagged node module project dependencies generated with these changes.

To test - Later ⚙️

These changes can be tested as part of the gutenberg-mobile PR ⚙️ or WordPress-Android PR ⚙️ which is updated to use the bundle ⚙️ generated with these changes.

FYI: It's best to leave the testing step to the gutenberg PR review since even if these PRs are merged, they won't impact anything until the package.json file is updated. Worst case scenario, a follow up PR will get opened to fix any issues that are found during testing.


Follow up

Once these PRs are merged in, a new tag will get created for each library and the package.json file will be again updated accordingly.

@ParaskP7 ParaskP7 added the enhancement New feature or request label Feb 16, 2022
@ParaskP7 ParaskP7 requested a review from oguzkocer February 16, 2022 10:56
@ParaskP7 ParaskP7 self-assigned this Feb 16, 2022
@ParaskP7
Copy link
Copy Markdown
Author

👋 @oguzkocer !

Do you have any idea why the Autosquash checks fail, what are they, or why are they utilized? 🤔

I get the below and I am not sure what I need to be doing with the github_token, which token, etc:

Run tibdex/autosquash@v2
Error: Error: Input required and not supplied: github_token

Many thanks for your support and guidance! 🙏

@oguzkocer
Copy link
Copy Markdown

I get the below and I am not sure what I need to be doing with the github_token, which token, etc:

The workflow seems to be from the original repo and the secret is not configured in this repo. I think it's safe to ignore it.

@ParaskP7
Copy link
Copy Markdown
Author

The workflow seems to be from the original repo and the secret is not configured in this repo. I think it's safe to ignore it.

Ignore it it is then, at least for now, thanks Oguz! 🙇

The 'com.dipien.byebyejetifier' plugin was used to determine whether
Jetifier can be disable for this project.

After configuring 'Bye Bye Jetifier' and running the below command:
./gradlew canISayByeByeJetifier -Pandroid.enableJetifier=false

The output was clear, Jetifier can be now safely disabled for this
project: > Task :canISayByeByeJetifier

=========================================
Project: :
=========================================
 * No legacy android support usages found

===================================================== ...
* No dependencies with legacy android support usages! ...
===================================================== ...

... ===============================
... You can say Bye Bye Jetifier. *
... ===============================
@ParaskP7 ParaskP7 changed the title Upgrade Gradle to 7.3.3 & AGP to 7.0.4 Upgrade Gradle to 7.4 & AGP to 7.1.1 (& Disable Jetifier) Feb 24, 2022
@ParaskP7
Copy link
Copy Markdown
Author

ParaskP7 commented Mar 9, 2022

👋 @oguzkocer !

As done here, Can you please take a look at this b4be54e commit, which resolves the same issue, and verify that I am not missing anything? 🙇

Cc @fluiddot

PS: Can you also verify this 9bd99f5 commit, were I am re-adding the maven-publish plugin configuration. 🤔

The Android project publishing is now located in 'android-npm', it is
only used for generating the AAR and is invoked when running the
'./createNPMPackage.sh' script.
@oguzkocer
Copy link
Copy Markdown

@ParaskP7 b4be54e looks good to me.

@fluiddot
Copy link
Copy Markdown

@ParaskP7 Heads up that I'm planning to update the version of the package to 2.4.1 in #13. Once I proceed with the merge, I'll update this PR and the companion Gutenberg PR.

@ParaskP7
Copy link
Copy Markdown
Author

👋 @fluiddot !

@ParaskP7 Heads up that I'm planning to update the version of the package to 2.4.1 in #13. Once I proceed with the merge, I'll update this PR and the companion Gutenberg PR.

Thanks for the heads-up and for handling the update on this PR later-on as well, much appreciated! 🙇

# Conflicts:
#	android-npm/react-native-reanimated-66-hermes.aar
#	android/build.gradle
#	createNPMPackage.sh
#	package.json
Comment on lines +10 to +15
id 'com.diffplug.gradle.spotless' apply false
}

if (project == rootProject) {
apply from: 'spotless.gradle'
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@ParaskP7 this plugin has been added in version 2.4.1 (reference), but it's only meant to be applied when building the library. Let me know if this is the proper way to apply it, thanks 🙇.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

👋 @fluiddot !

I am not sure why this Spotless plugin needs to be guarded with this if (project == rootProject) { ... } check, but we could maybe remove that check altogether and just have Spotless enabled by default. Then, this configuration will become much more straightforward. Wdyt? 🤔

Do do so, we would need to:

  1. Use com.diffplug.spotless instead of com.diffplug.gradle.spotless when defying the plugin version (settings.gradle.kts).
  2. Use id 'com.diffplug.spotless' instead of id 'com.diffplug.gradle.spotless' apply false when applying the plugin (build.gradle).
  3. Since the spotless.gradle is only used within the above build.gradle file, to move the spotless { ... } configuration directly into the build.gradle above and removing the spotless.gradle file altogether.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I am not sure why this Spotless plugin needs to be guarded with this if (project == rootProject) { ... } check, but we could maybe remove that check altogether and just have Spotless enabled by default. Then, this configuration will become much more straightforward. Wdyt? 🤔

Me neither to be honest, but I agree about enabling it by default. I'll proceed with the changes, thanks 🙇 .

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@ParaskP7 I've applied your suggestion in 734d446.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Awesome @fluiddot , I double-checked that and can verify this change, thank you!

PS: Now we need to update the aar and tarball once more and we are done, right? 🤔

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

PS: Now we need to update the aar and tarball once more and we are done, right? 🤔

Yep, actually, I ran the createNPMPackage script in 734d446 to generate both AAR and tarball files but there were no modifications.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Btw, I also updated the reference of this package in the Gutenberg PR (reference).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yep, actually, I ran the createNPMPackage script in 734d446 to generate both AAR and tarball files but there were no modifications.

Nice! 👍

Btw, I also updated the reference of this package in the Gutenberg PR (reference).

Awesome! 💯

@ParaskP7
Copy link
Copy Markdown
Author

ParaskP7 commented Apr 6, 2022

Since we removed the source code for these projects from react-native-bridge, we don’t need these updates to happen together with the other projects anymore. That means we can close this draft PR for now and reopen it, if need be, in the future. There is little value in merging this now and diverging from the source repo.

PS: Eventually, we might upgrade Gradle & AGP when using a newer version of React Native if the new RN version requires it.

@ParaskP7 ParaskP7 closed this Apr 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants