-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Separate gradle build logic (and other features) #19615
Comments
I'm all for simplifying and improving the gradle builds. I think we could
go the direction of generating pligins in buildSrc, i personally don't see
a big issue
…On Wed, 31 Aug 2022, 2:35 pm Frederik Hahne, ***@***.***> wrote:
*Overview of the feature request*
I think our gradle part could have little make over for v8. In particular
I am thinking of using some (precompiled) conventions, which reside in
buildSrc directory. Having this the generated build.gradle file would in
an optimal case just apply a few plugins and thats it.
Furthermore I would like to introduce gradle version catalogs to
centralize the versions in an idiomatic gradle way.
*Motivation for or Use Case*
When talking to the gradle guys in the last couple of years they always
suggested to have specific jhipster plugins. We (or me specific me) have
always rejected this, because it would have created huge maintenance burden
I was not willing to take. Moreover with everything generated we could
easily provide workarounds for our users. Compared to having really
dedicated plugins we would require both a release of the plugin and the
generator.
With using convention plugins in buildSrc directory we can have best of
both approaches. We clearly separate specific build logic, dependencies and
plugins for specific jhipster configurations and as all is generated users
can see everything and opt-out or replace stuff if needed.
This would also simplify our templates as we would try to have e.g.
frontend specific stuff inside a dedicated conventions plugin and not
different if/else switches inside the main build.gradle template file.
This requires also changes to internal apis and needles as such I would
consider this a breaking change and would like to do in v8. This will also
most likely make a lot of blueprints not compatible with gradle anymore
(thinking about the native blueprint), but I hope the required changes are
quite small.
I would try to implement a first prototype for first/initial discussion so
we know everyone is happy with the outcome/result.
CC @mraible <https://github.com/mraible> @jdubois
<https://github.com/jdubois> @DanielFran <https://github.com/DanielFran>
@mshima <https://github.com/mshima> @deepu105
<https://github.com/deepu105> Your view in this is highly appreciated.
—
Reply to this email directly, view it on GitHub
<#19615>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIOKF27JWSIP3VRLDEYSSLV35GQ7ANCNFSM6AAAAAAQBKTP4A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Further documentation to the mentions Gradle features:
|
@mshima @DanielFran I would start with extracting the versions into a version catalog. I hope we can reuse the existing toml file which we use for dependabot already and generate it for an application. With regards to convention plugins I think we might start by creating a convention plugin for gatling for example. |
I don't know how a
|
@mshima I guess it makes sense to create a sub gen for gradle like you've done for maven? It looks pretty cool the current modularization of the generators |
@atomfrede we already have a grade sub-gen, but it's quite different of maven due to design. generator-jhipster/generators/gradle/generator.mts Lines 70 to 75 in 433413f
And dependencies are split in separated files instead of api calls:
Database are not split yet. |
Nice idea with the injection. Maybe we can use the mentioned gradle plugin mechanism for that. I will try something. |
@mshima I think we can really leverage the current modularization approach and define and generate convention plugins which are than applied. That looks cleaner and easier to me compared to the apply from approach. Let me try something tonight |
I really like the thing with the convention plugins. You can have look here. Need to figured out how to proceed with the node stuff and the dev/prod profile right now, but in general it looks very nice (for example) plugins {
id "com.github.node-gradle.node"
id 'jhipster.common-conventions'
id 'jhipster.gatling-conventions'
id 'jhipster.cucumber-conventions'
id 'jhipster.test-conventions'
id 'jhipster.sonar-conventions'
id 'jhipster.cache-conventions'
id 'jhipster.docker-conventions'
id 'jhipster.code-quality-conventions'
id 'jhipster.liquibase-conventions'
// jhipster-needle-gradle-plugins - JHipster will add additional gradle plugins here
} Will try to create a PR in the next couple of days. @mshima As we have removed deprecated deployments, can I safely remove the
|
updates jhipster#19615
updates jhipster#19615
updates jhipster#19615
updates jhipster#19615
* prepare version catalog for convention plugins updates #19615 * initial gradle convention plugin creation updates #19615 * add required dependencies and versions to convention plugin updates #19615 * encapsulate gatling versions in convention plugin updates #19615 * allow curly braces in strings updates #19615 * correct toml needle updates #19615 * fix typo updates #19615 * correct dependency catalog updates #19615 * add gatling gradle snapshot tests updates #19615 * remove obsolete gradle properties from server generator updates #19615
* replace gradle apply from cache with cache convention plugin updates #19615 * drop gradle/cache.gradle.ejs template --------- Co-authored-by: Marcelo Shima <[email protected]>
updates jhipster#19615
@atomfrede I think we can close this. |
Yes let's close it and open dedicated issues for the remaining things. |
Overview of the feature request
I think our gradle part could have little make over for v8. In particular I am thinking of using some (precompiled) conventions, which reside in
buildSrc
directory. Having this the generated build.gradle file would in an optimal case just apply a few plugins and thats it.Furthermore I would like to introduce gradle version catalogs to centralize the versions in an idiomatic gradle way.
Motivation for or Use Case
When talking to the gradle guys in the last couple of years they always suggested to have specific jhipster plugins. We (or me specific me) have always rejected this, because it would have created huge maintenance burden I was not willing to take. Moreover with everything generated we could easily provide workarounds for our users. Compared to having really dedicated plugins we would require both a release of the plugin and the generator.
With using convention plugins in buildSrc directory we can have best of both approaches. We clearly separate specific build logic, dependencies and plugins for specific jhipster configurations and as all is generated users can see everything and opt-out or replace stuff if needed.
This would also simplify our templates as we would try to have e.g. frontend specific stuff inside a dedicated conventions plugin and not different if/else switches inside the main build.gradle template file.
This requires also changes to internal apis and needles as such I would consider this a breaking change and would like to do in v8. This will also most likely make a lot of blueprints not compatible with gradle anymore (thinking about the native blueprint), but I hope the required changes are quite small.
I would try to implement a first prototype for first/initial discussion so we know everyone is happy with the outcome/result.
CC @mraible @jdubois @DanielFran @mshima @deepu105 Your view in this is highly appreciated.
The text was updated successfully, but these errors were encountered: