Issue
I develop an Eclipse plugin, where I need the information, which build configuration is currently active.
I have 4 pre-defined Build configurations which you can see in the Screenshot and I need to get the name of the active one and also the name of the active Project.
Something like that.
String activeBuild = getActiveBuild();
I didn't find any solution at the Internet, so does anybody know how to do that?
Solution
Assuming you can get your IProject
instance as a reference called project
, then do the following to obtain the configuration...
ICProjectDescription desc = CCorePlugin.getDefault().getProjectDescription(project, true);
ICConfigurationDescription cfgDescription = desc.getActiveConfiguration();
IConfiguration configuration = ManagedBuildManager.getConfigurationForDescription(cfgDescription);
// grab what you need from the configuration instance
Answered By - majixin
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.