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

support gradle version catalog #80

Merged
merged 3 commits into from
Sep 21, 2022
Merged

Conversation

jbl428
Copy link
Contributor

@jbl428 jbl428 commented Sep 17, 2022

Motivation:

Modifications:

Commit Convention Rule

Commit type Description
feat New Feature
fix Fix bug
docs Documentation only changed
ci Change CI configuration
refactor Not a bug fix or add feature, just refactoring code
test Add Test case or fix wrong test case
style Only change the code style(ex. white-space, formatting)

Closes #78

compileOnly(Dependencies.hibernate)
compileOnly(libs.java.persistence.api)
compileOnly(libs.slf4j)
compileOnly(libs.hibernate)

testImplementation(Modules.testFixtureCore)
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have found that modules is defined in gradle (DependencyHandlerDelegate.getModules())

CleanShot 2022-09-20 at 21 26 30@2x

I could not find a way to solve this problem. 😢

Copy link
Member

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

@shouwn
Copy link
Member

shouwn commented Sep 19, 2022

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.

@cj848
Copy link
Collaborator

cj848 commented Sep 20, 2022

Thank you so much for your contribution. After that, can you handle renovate's automatic dependency update PR github actions with PR?

@jbl428
Copy link
Contributor Author

jbl428 commented Sep 20, 2022

How about install renovate app in this repository instead of using github action?
I think It is much simper and support same functionality (schedule, PR create policy)

@cj848 cj848 added documentation Improvements or additions to documentation enhancement New feature or request and removed documentation Improvements or additions to documentation labels Sep 21, 2022
@shouwn shouwn merged commit a4dfc77 into line:main Sep 21, 2022
@jbl428 jbl428 deleted the feature/version-catalog branch September 25, 2022 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Apply gradle version catalog
4 participants