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

[EXTERNAL] Migrate to Gradle version catalog #1033

Conversation

mikescamell
Copy link
Contributor

@mikescamell mikescamell commented May 30, 2023

Checklist

  • If applicable, unit tests
  • If applicable, create follow-up issues for purchases-ios and hybrids

Motivation

This pull request aims to improve the management of dependencies and plugins in the codebase by migrating them to a .toml file and utilizing Gradle version catalogs. This standardizes the dependencies and plugins across the project and facilitates automated dependency updates through tools like Dependabot or Renovate. I have prior experience using Renovate and find it highly useful, but I see Dependabot enabled in the project and it should also support this

Description

In this pull request, I have relocated all dependencies and plugins to the .toml file. Additionally, I have updated each module accordingly. To ensure independent accessibility, I have also created a separate .toml file for the MagicWeather app.

Versions have only been added to the versions block when used across multiple dependencies.

However, there is one limitation: the plugins block cannot be used in a Gradle init script. As a result, all plugin declarations must be moved to individual modules. Fortunately, this limitation is expected to be removed in the future. On the positive side, this approach allows us to include only the necessary plugins for each module, rather than applying all plugins universally (e.g., the Parcelize plugin may not be needed in every module).

I have a question regarding the stdlib declaration. Is it necessary for us to include it explicitly, or can we rely on the Kotlin plugin to handle it automatically?

It might make sense to merge this after the next release, so there's plenty of time to notice any obvious issues.

Next we'll move all dependencies in
Only use versions where we actually have multiple versions. Next commits will be updating build.gradle with the change in notation
We set all plugins in the base gradle file but we only apply the one's we're actually using in the root build.gradle. We can then use the aliases in other build.gradle and actually apply them where they are actually used.

The pluginManagement block is set the repositories from which we'll fetch the plugin dependencies
Currently it is not possible to specify plugins in an init script: https://docs.gradle.org/current/userguide/plugins.html#sec:build_scripts_only

This is unfortunate but I think this is still worth doing.

We'll apply the plugins to each gradle file in the next commit
Same as all the previous steps just confined to the MagicWeather sample
@mikescamell mikescamell marked this pull request as ready for review May 30, 2023 11:14
@mikescamell mikescamell changed the title [WIP] Migrate to toml version catalog Migrate to Gradle version catalog May 30, 2023
@vegaro
Copy link
Contributor

vegaro commented Jun 12, 2023

Thanks for opening this! We've decided we are going to tackle this. If you don't mind I am going to merge this PR into a branch and I will make some changes into it, like rebasing it and update to the latest versions.

Your name will still appear as contributor in the changelog.

@vegaro vegaro changed the base branch from main to cesar/sdk-3179-migrate-to-gradle-version-catalog June 12, 2023 12:09
@vegaro vegaro merged commit 1b6eb17 into RevenueCat:cesar/sdk-3179-migrate-to-gradle-version-catalog Jun 12, 2023
@vegaro vegaro changed the title Migrate to Gradle version catalog [EXTERNAL] Migrate to Gradle version catalog Jun 12, 2023
vegaro pushed a commit that referenced this pull request Jun 12, 2023
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.

2 participants