ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 9159] New: - User Properties set after the BuildStarted event has been fired. (Main.java)
Date Thu, 16 May 2002 14:53:09 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9159>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9159

User Properties set after the BuildStarted event has been fired. (Main.java)

           Summary: User Properties set after the BuildStarted event has
                    been fired. (Main.java)
           Product: Ant
           Version: 1.4.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Core
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: kriskeller@mindspring.com
                CC: kriskeller@mindspring.com


Listener will not have access to user (command line) properties until after the 
BuildStarted event has been fired.  It would be nice if the listners had access 
to these properties prior to BuildStarted.

Current code snipet of Main.java
        try {
            addBuildListeners(project);

            PrintStream err = System.err;
            PrintStream out = System.out;
            SecurityManager oldsm = System.getSecurityManager();

            try {
                System.setOut(new PrintStream(new DemuxOutputStream(project, 
false)));
                System.setErr(new PrintStream(new DemuxOutputStream(project, 
true)));
                project.fireBuildStarted();
                project.init();
                project.setUserProperty("ant.version", getAntVersion());

                // set user-define properties
                Enumeration e = definedProps.keys();
                while (e.hasMoreElements()) {
                    String arg = (String)e.nextElement();
                    String value = (String)definedProps.get(arg);
                    project.setUserProperty(arg, value);
                }
                
                project.setUserProperty("ant.file" , buildFile.getAbsolutePath
() );



These methods calls should not be made until after the properties have been set.
project.fireBuildStarted();
project.init();

I hope this description is helpful,
Kristopher Keller
678 351-7555

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message