1. Igor Baidiuk
  2. ant-events

Commits

Igor Baidiuk  committed 0cba9c3 Draft

Added local context and event's properties to fire-event, but no actual assignment

  • Participants
  • Parent commits 03bb212
  • Branches default

Comments (0)

Files changed (1)

File src/org/antcontrib/events/FireEvent.java

View file
 
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Task;
+import org.apache.tools.ant.property.LocalProperties;
 
 import org.antcontrib.events.EventList;
 
 		List events = EventList.get(getProject(), name).getEvents();
 		sortEvents(events);
 		
-		for (Iterator i = events.iterator(); i.hasNext(); )
-			((Event)i.next()).performTasks();
+		LocalProperties lp = LocalProperties.get(getProject());
+		lp.enterScope();
+		try
+		{
+			lp.addLocal("event.name");
+			lp.addLocal("event.priority");
+			lp.addLocal("event.description");
+			
+			for (Iterator i = events.iterator(); i.hasNext(); )
+			{
+				((Event)i.next()).performTasks();
+			}
+		}
+		finally
+		{
+			lp.exitScope();
+		}
 	}
 }