Skip to content

fix(android): automatically configure Gradle wrapper - #1935

Merged
Tommy Nguyen (tido64) merged 2 commits into
trunkfrom
tido/manage-gradle-version
Mar 26, 2024
Merged

Tommy Nguyen (tido64) merged 2 commits into
trunkfrom
tido/manage-gradle-version

Conversation

@tido64

@tido64 Tommy Nguyen (tido64) commented Mar 25, 2024 •

Copy link
Copy Markdown
Member

Description

Automatically configure Gradle wrapper. To disable this behavior, set RNTA_CONFIGURE_GRADLE_WRAPPER=0.

Basically, this is what the script does:

  • If 0.74 or greater (including nightlies), set Gradle version to 8.6 if the current version is lower
  • If 0.73, set Gradle version to 8.3 if the current version is lower
  • If 0.72, set Gradle version to 8.1.1 if the current version is lower
  • Else, set Gradle version to 7.6.4 if the current version is <7.5.1 or >=8.0.0

Platforms affected

  • Android
  • iOS
  • macOS
  • visionOS
  • Windows

Test plan

  1. Switch to 0.71: npm run set-react-version 0.71 -- --core-only
  2. Verify that example/android/gradle/wrapper/gradle-wrapper.properties is unmodified
  3. Install npm dependencies: yarn
  4. Build the Android app: cd example && yarn android
  5. In a separate terminal, verify that the Gradle version changed to 7.6.4 (in example/android/gradle/wrapper/gradle-wrapper.properties)
  6. Switch to 0.73: npm run set-react-version 0.73 -- --core-only
  7. Verify that the Gradle version is still 7.6.4
  8. Install npm dependencies: yarn
  9. Build the Android app: cd example && yarn android
  10. In a separate terminal, verify that the Gradle version changed to 8.3
  11. Switch to 0.72: npm run set-react-version 0.72 -- --core-only
  12. Verify that the Gradle version is still 8.3
  13. Install npm dependencies: yarn
  14. Build the Android app: cd example && yarn android
  15. In a separate terminal, verify that the Gradle version is still 8.3
  16. Switch to 0.71: npm run set-react-version 0.71 -- --core-only
  17. Verify that the Gradle version is still 8.3
  18. Install npm dependencies: yarn
  19. Build the Android app but disable the behavior: cd example && RNTA_CONFIGURE_GRADLE_WRAPPER=0 yarn android
  20. Verify that the Gradle version is still 8.3

To disable this behavior, set `RNTA_CONFIGURE_GRADLE_WRAPPER=0`.
@tido64
Tommy Nguyen (tido64) force-pushed the tido/manage-gradle-version branch from 1687f97 to 5d788b8 Compare March 26, 2024 10:14
Comment thread scripts/configure-projects.js Outdated

@kelset Lorenzo Sciandra (kelset) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good stuff!

Tested the whole flow locally and it works great.

Let's :shipit:

@github-actions github-actions Bot added platform: iOS This affects iOS platform: macOS This affects macOS platform: Windows This affects Windows platform: visionOS labels Mar 26, 2024
@tido64
Tommy Nguyen (tido64) enabled auto-merge (squash) March 26, 2024 16:16
@tido64
Tommy Nguyen (tido64) merged commit 7a85942 into trunk Mar 26, 2024
@tido64
Tommy Nguyen (tido64) deleted the tido/manage-gradle-version branch March 26, 2024 16:30
@tido64 Tommy Nguyen (tido64) mentioned this pull request Apr 2, 2025
11 of 25 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform: Android This affects Android platform: iOS This affects iOS platform: macOS This affects macOS platform: visionOS platform: Windows This affects Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants