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

Simpler API for configuring simple rules #580

Open
jmfayard opened this issue Sep 5, 2022 · 3 comments · May be fixed by #581
Open

Simpler API for configuring simple rules #580

jmfayard opened this issue Sep 5, 2022 · 3 comments · May be fixed by #581
Labels
core feature needs-feedback not enough feedback to start working on this

Comments

@jmfayard
Copy link
Member

jmfayard commented Sep 5, 2022

I opened a small PR to demo how we could simplify configuring the rules
#581

My vue (stolen from the Perl community) is that:

Simple things should be easy ; complex things should be possible

Rules files do the second half right, the first half not so much.

We have issues like #575 that show people would like for a way to avoid/simplify need for rules files.

I did a GitHub code search on refreshVerisons.extraArtifactVersionKeyRules see here and only 4 people have configured one during the last month.

If you look at the rules we have, some are powerful like in AndroidX but most rules are super simple and could be modeled this way:

refreshVersions {
	extraVersionRules(
		PrefixRule("koin", "io.insert-koin", "koin"),  
		PrefixRule("ktor", "io.ktor", null),
	)
}

That would not change anything fundamental for refreshVersions, the PrefixRule would simply be converted to a rules file in the background.

PrefixRule("koin", "io.insert-koin", "koin").toRawRules().shouldBe """
io.insert-koin:koin(-*)  
          ^^^^
""")

(I started to write this code already, it works)

Things to consider

  • syntax for Groovy users who don't have named arguments?
@LouisCAD
Copy link
Member

Wouldn't this be obsolete with version references support in versions catalogs?

@jmfayard
Copy link
Member Author

No, not for versions.properties
Also it could be used later in the dependencies notations themselves

@jmfayard
Copy link
Member Author

One thing that #211 reminded me is that once we have that,
I want to look at whether all dependencies with a common prefix share a common version,
and automatically suggest to add something like PrefixRule("ktor", "io.ktor", null),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core feature needs-feedback not enough feedback to start working on this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants