public static void addBuilderToProject(IProject project,String builderId) throws CoreException {
  if (hasBuilder(project,builderId)) {
    return;
  }
  IProjectDescription description=project.getDescription();
  List<ICommand> builders=new ArrayList<ICommand>(Arrays.asList(description.getBuildSpec()));
  ICommand newBuilder=description.newCommand();
  newBuilder.setBuilderName(builderId);
  builders.add(newBuilder);
  description.setBuildSpec(builders.toArray(new ICommand[builders.size()]));
  project.setDescription(description,null);
}

public static void addBuilderToProject ( IProject project , String builderId ) throws CoreException { if ( hasBuilder ( project , builderId ) ) { return ; } IProjectDescription description = project . getDescription ( ) ; List < ICommand > builders = new ArrayList < ICommand > ( Arrays . asList ( description . getBuildSpec ( ) ) ) ; ICommand newBuilder = description . newCommand ( ) ; newBuilder . setBuilderName ( builderId ) ; builders . add ( newBuilder ) ; description . setBuildSpec ( builders . toArray ( new ICommand [ builders . size ( ) ] ) ) ; project . setDescription ( description , null ) ; }
adds a builder with the specified id to the project if the project does not already have the builder .
