This is not specific to Buildship, but how the wrapper works:
The wrapper task does not define the version of Gradle, it is just a utility to update it. You have to actually run the wrapper task to re-generate the wrapper.properties file.
Thank you for the answer. But the wrapper.properties is also pro project. Is there a central setting with which I can trigger Buildship to use the same Gradle version if not other set? A default Gradle version.
This is intended. Each project should define which Gradle version it uses.
A setting in Buildship wouldn’t help. You’d get a different version on the command line/build server if you don’t configure the wrapper properly. You want the same reproducible build everywhere.
This is the point. That we want set the version centrally. Our projects contains only a very small build file which has no version relevance. But this projects apply a very large shared script plugins. This global code base depends on the version of Gradle. That we have the requirement to switch all projects in one branch.
For the build system this is not a problem because we have also checkin which Docker swarm is used.
No, not a remote script. A Gradle build script project. This is parallel to all the other projects. If a project will be branch then this project will also be branch.
It is not a git repository. It is a SVN repository. The location in the repository is not relevant. To build you need to checkout 2 projects in one root folder. The script project with the build environment and the real project.
The solution is to use the Gradle wrapper. All Gradle builds should use the wrapper, otherwise they are not reproducible.
Changing the build logic is a change that needs to be tested. Otherwise you are just pushing stuff onto the developers without even knowing if it’s gonna break their build.
I recommend building a custom Gradle distribution containing your script plugins and referencing that custom distribution in all wrappers. Then either the developers update it on demand or you have a CI job that does it automatically as I outlined before. You could even add a check in your custom plugin which fails the build if a newer version of that plugin is available.
I recommend building a custom Gradle distribution containing your script plugins and referencing that custom distribution in all wrappers. Then either the developers update it on demand or you have a CI job that does it automatically as I outlined before. You could even add a check in your custom plugin which fails the build if a newer version of that plugin is available.
This does not solve the problem of the branches. Also the company base build scripts can change frequently. There can change server name, passwords, etc. This would produce a large count of distributions every day. Also on testing the developer can change for debugging some things on the scripts. And I have no idea how I create such distribution.
Our current solution is to break the Gradle script with an exact error message and handling tips for the develiopers if the running Gradle version is wrong.
The next step will be to patch the file .settings/org.eclipse.buildship.core.prefs if exists. The result is that Gradle Job fail only on the first run.
Instead of patching the .prefs file (which is an implementation detail of Buildship and will likely change), you could patch the wrapper.properties and save yourself some headache. Just check what Gradle version you’re running on, patch the wrapper.properties and fail if it was the the wrong version. That’s exactly what I meant above with an “on demand” update.