Documentation of org.eclipse.buildship.core.prefs


(Horcrux7) #1

It there any documentation for the settings in the configuration file org.eclipse.buildship.core.prefs?

Because there is no GUI currently a text editor is the only option. For this a documentation is needed.


(Stefan Oehme) #2

There is no documentation, because they should never be edited. What is your use case for wanting to edit that file?


(Horcrux7) #3

If I should not edit the file then is there another solution to change gradle settings?

First I want to know which features/options buildship supports. Then I want change things like Java version, Gradle version, Gradle minimum version, memory usage, command line arguments, behavior on refresh, behavior on eclipse start, etc.


(Stefan Oehme) #4

You use the same mechanisms that you would use for Gradle on the command line:

  • Gradle version: Can be changed in your gradle-wrapper.properties

  • Java Home: Can be defined in gradle.properties

  • JVM args: Can be defined in gradle.properties

  • Behavior on refresh: There is nothing to customize yet. We plan to enable Buildship to run tasks on refresh. But these tasks will be defined in your Gradle build, not in Eclipse

  • Behavior on startup: I don’t know what you would want to customize there, can you elaborate?

  • Gradle minimum version: Can you please elaborate what you mean by that? Generally you should be using the wrapper, which specifies exactly which Gradle version your project uses. Buildship will respect that.


(Horcrux7) #5

The wrapper does not work for our company. It is not valid to checkin any compiled binaries in the source code repository. For compiled binaries there are file repositories like maven. With a wrapper there can be problems in the future with future Java versions. Never can warranty that a wrapper from today will run with future Java versions.

java.home: I want use a Java VM that is already configure in Eclipse. I does not want set it on many places.

The setting of gradle.properties will have also an effect on the build system. But I want settings that only work in eclipse. And this settings must be checkin in the repository for all users.

Behavior on startup: Different types of refresh on start of Eclipse are possible. For example after an interval of 12 hours or on every restart of eclipse or never. Or a refresh on update of the project. Or an update on change the gradle files.

I think there are many settings that have only sence for an IDE. I have expect this settings are in the org.eclipse.buildship.core.prefs file.


(Stefan Oehme) #6

You only set it in one place: Your gradle.properties. Both the command line and IDE will respect that.

I don’t understand that part. What kind of settings do you mean?

Buildship only refreshes when you explicitly tell it to do so. This is intentional, as refreshing can be a long-running operation.

I’ve heard this argument a few times and this rule just doesn’t make sense here: The wrapper is a tiny library. If it was a shell script of the same size, nobody would raise an eyebrow. I don’t get why it’s “bad” just because it’s a jar file.

I fully agree that you shouldn’t be checking in libraries for your application, but the wrapper is the boot strapping script that makes sure everyone uses exactly the same Gradle distribution everywhere. I would not give up that convenience and correctness.


(Horcrux7) #7

We have hundreds of project. I need different settings for the project. That a global setting is not possible. If I update the Java VM then the java.home changed. I need to modify all the gradle.properties. If I can use a named VM of Eclipse then I need only to change this setting of Eclipse. Or does I have misunderstand some things?

The java.home is different in my local system and the continuous build system. My understand is that if there is a gradle.properties then Gradle is using it.

Of course this can be a long running operation. That the refresh should be run in the background and does not block Eclipse. But if I update the sources of the project then also the libraries should be updated. This would be my favorite option. Currently we use IVY for dependency and I refresh it on Eclipse start. In the morning I start Eclipse and go to the kitchen and hollow me a coffee. When I get back I have an updated Eclipse.


(Stefan Oehme) #8

Regarding the first two questions: gradle.properties can be defined in your Gradle User Home (~/.gradle). So you can define the java home once and all projects on your machine will use it. On your build server you would define a different one of course.

Regarding the refresh on startup: I see what you mean. Feel free to open an enhancement request on BugZilla. If other users also vote for this feature, we will consider it. But keep in mind that every option we add leads to considerable maintenance overhead, as we have to test all kinds of combinations of options. This is why we have kept the number of options in Buildship to a minimum so far. It allows us to deliver the features we have with very high quality.