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 Edit Starters for gradle project #113

Open
bkbonner opened this issue Feb 24, 2019 · 5 comments
Open

Support Edit Starters for gradle project #113

bkbonner opened this issue Feb 24, 2019 · 5 comments

Comments

@bkbonner
Copy link

bkbonner commented Feb 24, 2019

I'd like Edit Starters command to support gradle projects. It appears to only support maven projects (searches for pom.xml) files. It says it works by clicking on build.gradle and running Edit Starters, but I don't believe it works.

I think the gradle language server could help in this regard. I posted a question to their repository to ask them about it. It seems like the parsing of gradle files is something that we wouldn't want to just do a search and replace on. It seems like it would be straightforward based upon the dependencies that it pulls down. i.e. we'd need to map runtime -> runtimeOnly, compile -> compileOnly, etc. and handle the toRemove and to Add by appropriately.

How should it decide to handle the maven or gradle project? Should we only look for build.gradle if pom.xml can't be found? We could change the error msg to cannot find pom.xml or build.gradle. If it finds build.gradle, we'll use the language server to remove unwanted dependencies and add needed ones.

Is this something we can implement?

@Eskibear
Copy link
Member

It says it works by clicking on build.gradle and running Edit Starters, but I don't believe it works.

The README is wrong. The command is enabled only for pom.xml for the moment, see
https://github.com/Microsoft/vscode-spring-initializr/blob/481d1f9f7cd7d4a3151c045c93de83c0b5e93df0/package.json#L57-L69

To enable Gradle support, we need to 1) parse build.gradle, 2) judge if it's a spring-boot project, 3) apply edits on it. This can be implemented in the language server or this extension itself (VS Code has exposed related APIs). I prefer not to add gradle extension as a dependency, because it's optional for Maven users. And I don't see any advanced features in that extension, AFAIK it now provides tasks and syntax highlighting, and there's no dependency we can leverage.

If there's simple and concise build.gradle parser, I think gradle support would be not hard to implement.

@Susukkekki
Copy link

I prefer gradle project to maven project. Please fix this issue asap.

@ayasrah
Copy link

ayasrah commented Jan 19, 2020

I think this is a needed feature, lets try to upvote this issue to get it implemented.

@lagerbjelke
Copy link

Any plans on fixing this?

@Eskibear
Copy link
Member

Edit Starters: Gradle project is not supported yet, PR is welcome for it.

If there's simple and concise build.gradle parser, I think gradle support would be not hard to implement.

Any help is welcome, PRs, ideas, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants