1

I have multiple custom Build Configurations in my project as shown below: Screenshot of build configurations

On workspace setup by default it opens up in 'Debug' configuration. I must have this changed to 'Rev8 Release' (one of my custom configuration) instead.

One way I could achieve this by manually editing .cprojects file(the auto generated project settings file) and pasting the 'Rev8 Release' configuration before the 'Debug'. But I need a proper method(by changing project settings) to do this without manually editing the '.cprojects'

jasmin maria
  • 33
  • 1
  • 6

1 Answers1

0

I propose checking out ManagedBuildManager. It can be used to retrieve / modify the Build Info of your project.

IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(iproject); //iproject is the currently selected project in Project Explorer
IConfiguration [] buildConfigs = info.getManagedProject().getConfigurations(); //Get the available build configurations of the project
info.setDefaultConfiguration(buildConfigs[i] ); //Set default build configuration
try {
ManagedBuildManager.saveBuildInfo(iproject, true); //Apply changes
} catch (Exception e) {
}
artpap
  • 136
  • 6