public void addGoal( String name, String prereqs, String description, JellyScriptHousing jellyScriptHousing )
{
// We load plugins in order of priority, so don't add goals that already exist.
if ( !goalPluginMap.containsKey( name ) )
{
Goal goal = goalProject.getGoal( name, true );
goal.setDescription( description );
goalProject.addGoal( goal );
// Add to the goal -> plugin map.
goalPluginMap.put( name, jellyScriptHousing );
if ( prereqs != null )
{
String[] s = StringUtils.split( prereqs, "," );
for ( int i = 0; i < s.length; i++ )
{
try
{
Goal prereq = goalProject.getGoal( s[i].trim(), true );
goal.addPrecursor( prereq );
}
catch ( CyclicGoalChainException e )
{
// do nothing.