-
Notifications
You must be signed in to change notification settings - Fork 93
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
support gradle version catalog #80
Conversation
compileOnly(Dependencies.hibernate) | ||
compileOnly(libs.java.persistence.api) | ||
compileOnly(libs.slf4j) | ||
compileOnly(libs.hibernate) | ||
|
||
testImplementation(Modules.testFixtureCore) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to define the val modules
in BuildSrc so that Module
can also be imported in a usage similar to libs
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Module can also be imported in a usage similar to libs.
Could you explain that in a little more detail?
What is difference between object modules
and val modules
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As shown below, it meant that it would be good to use the �Modules
as modules
. I thought there would be uniformity when we used both the libs
and modules
in lowercase letters
val modules = Modules
object Modules : Iterable<Module> {
private val modules = mutableListOf<Module>()
val api = module(path = "order-api")
val autoconfigure = module(path = "order-autoconfigure")
val batch = module(path = "order-batch")
val crypto = module(path = "order-crypto")
val log = module(path = "order-log")
val externalClient = module(path = "order-external-client")
val jpa = module(path = "order-jpa")
val json = module(path = "order-json")
val kafka = module(path = "order-kafka")
val lock = module(path = "order-lock")
val redis = module(path = "order-redis")
val support = module(path = "order-support")
val testFixture = module(path = "order-test-fixtures")
val xlt = module(path = "order-xlt")
private fun module(path: String, name: String = ":lcp-$path"): Module =
Module(path, name).also { modules.add(it) }
override fun iterator(): Iterator<Module> =
modules.iterator()
}
testImplementation(modules.testFixtureCore) // Before Modules.testFixtureCore
testImplementation(modules.testFixtureEntity) // Before Modules.testFixtureEntity
testImplementation(libs.java.persistence.api)
testImplementation(libs.hibernate)
testImplementation(libs.h2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh... it's already been declared in gradle. Then there's nothing we can do. Thank you for checking
I pulled your repo and tested it. After modifying the TOML file and reload gradle, the modification will be reflected in the libs and it can be autocompleted. I think this is really good. |
Thank you so much for your contribution. After that, can you handle renovate's automatic dependency update PR github actions with PR? |
How about install renovate app in this repository instead of using github action? |
Motivation:
renovate
does not supportbuildSrc
(related issue: multimodule gradle (kotlin) with versions defined as constants in buildSrc renovatebot/renovate#5480)renovate
supports version catalogModifications:
buildSrc/src/main/kotlin/Dependencies.kt buildSrc/src/main/kotlin/Dependencies.kt
tolibs.version.toml
Commit Convention Rule
Closes #78