Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 13972 invoked from network); 24 Feb 2004 14:00:01 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 24 Feb 2004 14:00:01 -0000 Received: (qmail 68394 invoked by uid 500); 24 Feb 2004 13:59:48 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 68361 invoked by uid 500); 24 Feb 2004 13:59:48 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 68339 invoked from network); 24 Feb 2004 13:59:47 -0000 Received: from unknown (HELO corvil.com) (213.94.219.177) by daedalus.apache.org with SMTP; 24 Feb 2004 13:59:47 -0000 Received: from corvil.com (preilly.local.corvil.com [172.18.1.173]) by corvil.com (8.12.9/8.12.5) with ESMTP id i1ODxkjD017137 for ; Tue, 24 Feb 2004 13:59:47 GMT (envelope-from peter.reilly@corvil.com) Message-ID: <403B5893.8080705@corvil.com> Date: Tue, 24 Feb 2004 13:58:43 +0000 From: Peter Reilly User-Agent: Mozilla Thunderbird 0.5 (X11/20040208) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ant Users List Subject: Re: BuildListener in 1.5.4 Has Empty Project In Event On BuildStarted ? References: <20040224134409.12512.qmail@web13426.mail.yahoo.com> In-Reply-To: <20040224134409.12512.qmail@web13426.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Nicholas wrote: >Cool. Thanks. I entered a work around: > > Excellent. Peter >The uninitialized status of the project (and hence the >event) is over by the time the first task start event >fires. For most of my issues, I simply created a class >level boolean in my build listener to track if the >event is populated or not. Then I defer the >buildStarted until the project name comes through. > > public void buildStarted(BuildEvent event) { > if(event.getProject().getName()==null) return; > started = true; > LOG.info("Build Started:" + >event.getProject().getName()); > } > > public void targetStarted(BuildEvent event) { > if(!started) { > buildStarted(event); > } > LOG.info("Target Started:" + >event.getProject().getName() + "." + >event.getTarget().getName()); > } > >Ugly, but seems to work. > > >--- Peter Reilly wrote: > > >>Yes, this is bugzilla report 1509: >> >> >> >> >http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1509 > > >>Peter >>Nicholas wrote: >> >> >> >>>I am debugging a build listener I wrote for our >>>central build system and it looks like Ant fires >>> >>> >>off >> >> >>>the buildStarted event with a project that is not >>>fully intialized. i.e. The project name and >>>description, as well as the properties are all >>> >>> >>null. >> >> >>>Can anyone verify that this is the case ? >>> >>>Any fix or work around ? >>> >>>Thanks. >>> >>>//Nicholas >>> >>>Example: >>> >>> public void buildStarted(BuildEvent event) { >>> LOG.info("Build Started:" + >>>event.getProject().getName()); >>> } >>> >>>Prints: >>> >>>INFO [2004-02-24 07:58:28,919]: Build Started:null >>> >>> >>>===== >>>Nicholas Whitehead >>>Home: (973) 377 9335 >>>Cell: (201) 615 2716 >>>nwhitehe@yahoo.com >>>Get Your News From The Crowbar: >>> >>> >>http://crowbar.dnsalias.com:443/crowbar/ >> >> >>--------------------------------------------------------------------- >> >> >>>To unsubscribe, e-mail: >>> >>> >>user-unsubscribe@ant.apache.org >> >> >>>For additional commands, e-mail: >>> >>> >>user-help@ant.apache.org >> >> >>> >>> >>> >>> >>> >> >> >> >--------------------------------------------------------------------- > > >>To unsubscribe, e-mail: >>user-unsubscribe@ant.apache.org >>For additional commands, e-mail: >>user-help@ant.apache.org >> >> >> > > >===== >Nicholas Whitehead >Home: (973) 377 9335 >Cell: (201) 615 2716 >nwhitehe@yahoo.com >Get Your News From The Crowbar: http://crowbar.dnsalias.com:443/crowbar/ > >--------------------------------------------------------------------- >To unsubscribe, e-mail: user-unsubscribe@ant.apache.org >For additional commands, e-mail: user-help@ant.apache.org > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org