goals.add( "build:end" );
}
transientMapper.merge( mapper );
WerkzProject werkzProject = new WerkzProject();
baseContext.setWerkzProject( werkzProject );
Set pluginSet = new HashSet();
// poor mans stack - only pop when you finish the same frame that the plugin was lazily init in
Set oldDelayedPops = new HashSet( delayedPops );
delayedPops.clear();
Thread.currentThread().setContextClassLoader( null );
try
{
runScript( driverHousing, baseContext );
transientMapper.addResolvedPlugins( Collections.singletonList( driverHousing ) );
// Dependencies must be processed after the driver is run for compatibility
// FIXME: From attainGoals angle, how does it know the project needs to
// to be verified, or that the project object hasn't been used before
project.verifyDependencies();
processDependencies( project );
for ( Iterator j = projectHousings.iterator(); j.hasNext(); )
{
JellyScriptHousing housing = (JellyScriptHousing) j.next();
runScript( housing, baseContext );
}
transientMapper.addResolvedPlugins( projectHousings );
// Plugin Jelly scripts
for ( Iterator i = goals.iterator(); i.hasNext(); )
{
String goalName = (String) i.next();
pluginSet.addAll( prepAttainGoal( goalName, baseContext, transientMapper ) );
}
// Plugin Jelly scripts
for ( Iterator i = goals.iterator(); i.hasNext(); )
{
String goalName = (String) i.next();
log.debug( "attaining goal " + goalName );
try
{
Goal goal = werkzProject.getGoal( goalName );
if ( goal == null || goal.getAction() == null )
{
throw new NoSuchGoalException( goalName );
}
goal.attain( session );