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
Use gradle model instead of string parsing for manipulating gradle files #3497
Comments
could you add gradle label. and maybe assign to me if nobody want it. |
In fact I am thinking my self, it could be interesting to have an independent project wich manage all kind of model externaly (maven, gradle, ivy , sbt ...) out of quarkus.... but for now I will manage gradle first |
The Gradle Tooling API could help here, but it also has a lot of limitations. When I worked on the add extension feature, I tried to push the tooling API usage as much as I could, but it didn't help that much. |
The gradle approch is based on script not on model.: I don't how you try to start but GradleConnector and projectConnection seems to be too limited for us. So I think, we can choose one of this option :
|
There's also a model approach in Gradle using the Tooling API, this is what I used. We're already using some parts of it in One example of its limitations is the ability to list the dependencies of a Gradle build. The API can do that, but can't differentiate the direct dependencies from the transitive dependencies (which is the kind of info we'd want while adding a Quarkus extension). |
You are right. I forget to write it. I see it. The connector. It seems limited but I think it must be our first approach
Le mar. 13 août 2019 à 20:07, Gwenneg Lepage <notifications@github.com> a
écrit :
… There's also a model approach in Gradle using the Tooling API
<https://docs.gradle.org/current/javadoc/org/gradle/api/Project.html>,
this is what I used. We're already using some parts of it in
quarkus-gradle-plugin.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#3497?email_source=notifications&email_token=AABZ5GZWKRVNGJW45OOMZODQELZ67A5CNFSM4ILIU4T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4GPVWY#issuecomment-520944347>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABZ5GYHFUWOIOWUZLJ6WBDQELZ67ANCNFSM4ILIU4TQ>
.
|
The more I think about it, the more I think we must not integrate gradle but just the AST of groovy and Kotlin. |
I test 2 approachs. On différent branches. I will push the gradle tooling api version. But we have a small limitation: we cannot get dependencies from zipped project. It’s not used. So we can go for it I think |
@Dufgui Could we try to use 5.6 straight away? It has more in common with upcoming 6.0.I am eager for better Gradle support as now it's really a room for improvement. Can't really run non simplistic Quarkus projects with Gradle now. Great work. Any other plans for Gradle? So we can form issues/PR out of those? |
Description
Actually we use string parsing and manipulation to add extension, complete existing gradle file, or simply read gradle files. It's fragil, On maven side, we use an external model and parser.
Implementation ideas
I am just dig a little more to not use string and delegate parse of model to gradle lib.
I see how eclipse do it:
https://github.com/eclipse/buildship/blob/master/org.eclipse.buildship.kotlin/build.gradle
https://github.com/eclipse/buildship/blob/master/org.eclipse.buildship.kotlin/src/main/java/org/eclipse/buildship/kotlin/internal/GradleKotlinScriptTemplateProvider.java#L80
And with ProjectConnection we can load the groovy model too, but I don't know the limitation and we need all gradle core as dependency.
see #3475 (comment)
The text was updated successfully, but these errors were encountered: