ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frederic Lavigne" <f...@L2FProd.com>
Subject [PATCH] Automatic loading of classes
Date Thu, 03 Aug 2000 20:27:17 GMT
Hi,

I extracted the code from AntHill (the gui tool I'm working on). See email
attachment.

I use a modified org.apache.tools.ant.Project class to setup the extra tasks
loading:

	    Project project = new Project() {
		    boolean extraLoaded = false;
		    public Task createTask(String taskType) throws BuildException {
			if (!extraLoaded) {
			    try {
				// here comes the extra task loading
				ExtraTask.load(this);
			    } catch (Exception e) { throw new BuildException("Failed to load
addins", e); }
			    extraLoaded = true;
			}
			return super.createTask(taskType);
		    }
		};

Don't know yet where it can be included in Ant code, I'm sure Ant gurus will
find out.
But ExtraTask.load(Project) needs to be called only when basedir has been
set by ant.
ExtraTask uses AntClassLoader and Path and they rely on the basedir
attribute.

Hope this helps,

Frederic Lavigne, fred@L2FProd.com
java software at http://www.L2FProd.com

Mime
View raw message