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

Add support for Versions Catalogs gradle/libs.versions.toml #555

Closed
wants to merge 40 commits into from

Conversation

jmfayard
Copy link
Member

Duplicating #509 in order to play aroung with https://app.crocodile.dev

If your project is using Gradle 7.0, you can use instead [Gradle versions catalog](https://docs.gradle.org/current/userguide/platforms.html)

```bash
$ ./gradlew refreshVersionsCatalog

> Task :refreshVersionsCatalog
        new file:   gradle/libs.versions.toml
        modified:   settings.gradle.kts
        modified:   versions.properties
```

The generated versions catalog looks like this:

```toml
## Generated by $ ./gradlew refreshVersionsCatalog

[libraries]

browser = "androidx.browser:browser:_"

cardview = "androidx.cardview:cardview:_"

okhttp = "com.squareup.okhttp3:okhttp:_"

junit = "junit:junit:_"
```

Like with buildSrcLibs, you get type-safe accessors available in the IDE:

<img width="949" alt="refreshVersions_–_build_gradle_kts__sample-kotlin_" src="https://user-images.githubusercontent.com/459464/128611606-4ce90b01-475d-402a-b223-1757a1c51deb.png">
# Conflicts:
#	sample-kotlin/build.gradle.kts
#	sample-kotlin/gradle/wrapper/gradle-wrapper.properties
#	sample-kotlin/versions.properties
Do not remove keys that were already present
@ghost
Copy link

ghost commented Jun 24, 2022

Review on Crocodile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant