简体   繁体   中英

Get information from Gradle eclipse plugin

I'm developing an Eclipse plugin. In my plugin I run a Gradle task.

The Gradle is executed when the user clicks on a button.

I want to let the user to choose whether he want to use the Gradle wrapper, local Gradle installation directory or a specific Gradle version.

I noticed that in Eclipse preferences under Gradle, there is an option to choose between each one of them. I want to read this configuration from my plugin. Does somebody knows how to read this configuration?

Thanks!

日食偏好

To anyone who encounter this issue, I found the answer myself:

IPreferencesService service = Platform.getPreferencesService();
service.getString("org.eclipse.buildship.core", "gradle.distribution", "", null)

This returns, for example:

GRADLE_DISTRIBUTION(WRAPPER)

or

GRADLE_DISTRIBUTION(VERSION(6.4))

...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM