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

How to centralize artifact library versions? #356

Closed
necatisozer opened this issue May 18, 2021 · 3 comments
Closed

How to centralize artifact library versions? #356

necatisozer opened this issue May 18, 2021 · 3 comments
Labels

Comments

@necatisozer
Copy link
Contributor

When I use built-in Hilt dependencies

implementation(Google.dagger.hilt.android)
kapt(Google.dagger.hilt.compiler)

this is generated in versions.properties

version.google.dagger=2.35.1

However when I use these dependencies

io.github.reactivecircus.flowbinding:flowbinding-android:_
io.github.reactivecircus.flowbinding:flowbinding-appcompat:_

these are generated in versions.properties

version.io.github.reactivecircus.flowbinding..flowbinding-android=1.0.0

version.io.github.reactivecircus.flowbinding..flowbinding-appcompat=1.0.0

Is there any way to centralize these versions?

@jmfayard
Copy link
Member

jmfayard commented May 18, 2021

There are rules embedded in the plugin, see here https://github.com/jmfayard/refreshVersions/tree/main/plugins/dependencies/src/main/resources/refreshVersions-rules

You can add your own rules with extraArtifactVersionKeyRules()

https://jmfayard.github.io/refreshVersions/setup/#configure-the-plugin

for example

// settings.gradle.kts
refreshVersions {
    extraArtifactVersionKeyRules(file("refreshVersions-extra-rules.txt"))
}

In the file refreshVersions-extra-rules.txt

org.apache.poi:poi(-*)
    ^^^^^^.^^^

the key generated will be version.apache.poi

@necatisozer
Copy link
Contributor Author

Got it. Thank you.

@jmfayard
Copy link
Member

I want to provide a simpler API for rules.
No promise for when that will come but you can have a look here

#580

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

No branches or pull requests

2 participants