ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 1509] New - Project object not fully functional in BuildEvents
Date Wed, 25 Apr 2001 18:47:25 GMT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1509

*** shadow/1509	Wed Apr 25 11:47:25 2001
--- shadow/1509.tmp.3678	Wed Apr 25 11:47:25 2001
***************
*** 0 ****
--- 1,44 ----
+ +============================================================================+
+ | Project object not fully functional in BuildEvents                         |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 1509                        Product: Ant                     |
+ |       Status: NEW                         Version: 1.3                     |
+ |   Resolution:                            Platform: PC                      |
+ |     Severity: Normal                   OS/Version: Windows NT/2K           |
+ |     Priority: Medium                    Component: Core                    |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: ant-dev@jakarta.apache.org                                   |
+ |  Reported By: arosen@silverstream.com                                      |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ For example, in the buildStarted() method of my logger, getName(), 
+ getDefaultTarget(), and getUserProperty("ant.file") on the project object all 
+ return null. 
+ 
+ import org.apache.tools.ant.*;
+ public class TestLogger extends DefaultLogger
+ {
+ 	public void buildStarted(BuildEvent event)
+ 	{
+ 		out.println(event.getProject());
+ 		out.println(event.getProject().getBaseDir());
+ 		out.println(event.getProject().getName());
+ 		out.println(event.getProject().getDefaultTarget());
+ 		out.println(event.getProject().getUserProperty("ant.file"));
+ 		out.println(event.getProject().getProperty("ant.file"));
+ 
+ 		super.buildStarted(event);
+ 	}
+ }
+ 
+ Output is:
+ 
+ org.apache.tools.ant.Project@58610
+ D:\z\Test2
+ null
+ null
+ null
+ null

Mime
View raw message