MessageImpl impl = Message.getImpl(); ant.execute(); markBuilt(f);   Message.setImpl(impl);
MessageImpl impl = IvyContext.getContext().getMessageImpl(); try { IvyContext.getContext().setMessageImpl(null); ant.execute(); markBuilt(f); } finally { IvyContext.getContext().setMessageImpl(impl); }
	public void progress(IvyEvent event) {		File f = getBuildFile(event);		if (f.exists()) {			if (_onlyonce && isBuilt(f)) {				Message.verbose("target build file already built, skipping: "+f);			} else {				Ant ant = new Ant();				Project project = (Project)IvyContext.getContext().get(IvyTask.ANT_PROJECT_CONTEXT_KEY);				if (project == null) {					project = new Project();					project.init();				}								ant.setProject(project);				ant.setTaskName("ant");								ant.setAntfile(f.getAbsolutePath());				ant.setInheritAll(false);				String target = getTarget();				if (target != null) {					ant.setTarget(target);				}				Map atts = event.getAttributes();				for (Iterator iter = atts.keySet().iterator(); iter.hasNext();) {					String key = (String) iter.next();					String value = (String) atts.get(key);					Property p = ant.createProperty();					p.setName(_prefix == null?key:_prefix+key);					p.setValue(value);				}								Message.verbose("triggering build: "+f+" target="+target+" for "+event);				MessageImpl impl = Message.getImpl();				ant.execute();				markBuilt(f);				// we restore previous message impl, cause the triggered ant build 				// may have modified it (damned static use !)				Message.setImpl(impl); 				Message.debug("triggered build finished: "+f+" target="+target+" for "+event);			}		} else {			Message.verbose("no build file found for dependency, skipping: "+f);		}	}