* @param proj IProject Project
* @return IConfiguration[] Build configurations
*/
private static IConfiguration[] getAllBuildConfigs(IProject proj) {
IConfiguration[] configurations = new IConfiguration[] {};
IManagedBuildInfo info = null;
//try to get Managed build info
try {
info = ManagedBuildManager.getBuildInfo(proj); //null if doesn't exists
} catch (Exception e) { //if not a managed build project
//print error
e.printStackTrace();
return configurations;
}
//info can be null for projects without build info. For example, when creating a project
//from Import >�C/C++ Executable
if(info == null) {
return configurations;
}
//get ManagedProject associated with build info
IManagedProject mProj = info.getManagedProject();
//get all build configurations of the project
configurations = mProj.getConfigurations();
return configurations;
}