I have an Eclipse Plugin that has extended the org.eclipse.ui.newWizards Extension Point and includes a wizard that builds a new java project in the correct structure that we need it to for our project types.
During project creation, we add natures to the project and one of those natures was the STS Gradle nature, which worked fine and no additional work was needed to configure the project to be a ‘gradle project’. I tried to simply do the same thing with the new Buildship gradle nature and ran into problems. The Builder is added correctly to the .project file, but as soon as the project is created, I get an error saying that the .prefs file for the project is missing. Is there something else I need to do during project creation that can set up a default .prefs file for my project? And once that is completed, will there be anything else I need to account for?
Ideally, there would be something like the JavaCore.create() has that evaluates and creates an instance of the the Project with the necessary configuration. Does anything like this exist?
If you are okay with depending on an implementation detail, you can write the ‘org.eclipse.buildship.core.prefs’ yourself. Just use the “New Gradle Project” wizard and you’ll see the default values you need to put into that file for a single-module project.
Thanks for the quick response. It would be great if something like this could be added a future release instead of having to re-implement a solution that you guys have already completed.
For now, If I implement the creation of that preferences file, do you know of any other ‘mandatory’ elements of the gradle project that Buildship requires? The project already contains a build.gradle file and a settings.gradle file that gets generated and was used when creating the Gradle STS project. I assume these should port directly over to working in a Buildship project. Can you think of anything I may have missed?