Import a native Gradle build to an IDE

We have a multiplatform open sourced C++ application with a Gradle build file. The application compiles nicely with Gradle, but it’s hard to debug it without having a C++ IDE. So it would be nice to import the Gradle build file in an IDE. I guess Buildship will do this someday. Can you please confirm this? Do you have a roadmap on this?
Until then it would be great to find a workaround. I tried the visual-studio plugin for Gradle which nicely creates an .sln file and the related files. But it is not straightforward how to import them in Eclipse or another IDE. I prefer an automatic way by using free tools than importing the .sln in Microsoft Visual Studio and then export the makefiles.
Probably a similar plugin could do all of that but for Eclipse or oder IDEs. Do you plan adding such a plugin in the near future?

This is a ‘would be nice to have’ feature. We know about it, but it’s not in our pipeline.

The general workaround is to implement the Eclipse project descriptor generation as a custom task, which would be automatically executed upon project synchronization. The latter is yet to be implemented, although we have it as an open-source opportunity proposal.

For the task execution there might be an immediate workaround. I haven’t used it yet, but all the fixtures are available. First you’d have to set up a custom project builder executing the Gradle task as an external command. Then this builder could be defined in the project’s configuration.

1 Like

@kovzol Buildship takes into account all configuration you do in the eclipse plugin. So if all you need are some project natures and builders, you can set that up there.

But I assume you would need more than that to make CDT work? In that case the answer is no, Buildship does not have support for CDT configuration. There are 2 ways we could support it:

  1. Support for task execution on import (something we want for many other reasons). Then you’d write a task that generates the CDT config files as @donat suggested

  2. A CDT extension for Buildship. That would require an extension point and someone willing to put in the resources to write that CDT extension.

1 Like

@donat @st_oehme Thank you! We will try to allocate resources to have a better understanding in this. Maybe we can invite some students to work on these improvements. I’ll send you more info when we can go some steps forward.