ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conelly, Luis (PS, GNF, Contractor)" <Luis.Cone...@gnf.com>
Subject RE: MailLogger reset in different targets not working
Date Tue, 27 Jan 2004 21:54:47 GMT
Cindy,

	I am using a target like following:

    <target name="Notify" depends="initTimestamp"
            description="Sends Mail messages">
        <mail mailhost="${mail.host}" mailport="${mail.port}"
              subject="${param.mail.subject}"
              encoding="plain"
              from="${param.mail.sender}" tolist="${param.mail.list}"
              files="${param.mail.file}">
              <message src="${param.mail.message}"/>
        </mail>
    </target>

	And I use <antcall> task to invoke it, as follows:

            <antcall target="Notify">
                <param name="param.mail.subject"
                       value="${mail.QA.updated.subject}"/>
                <param name="param.mail.sender"
                       value="me@myhost.com"/>
                <param name="param.mail.reciver"
                       value="${list.UpdateQA}, ${list.UpdateQA.Cc}"/>
                <param name="param.mail.file"
                       value="./logs/builds/${log.filename}-${DSTAMP}.log"/>
                <param name="param.mail.message"
                       value="${mail.text.src.QA}"/>
            </antcall>

	I know it is a bit annoying to set such amount of parameters each time you want to call the
target, but I haven't figured out another way. 

	Regards & HTH
	-Luis

BTW, My config is as follows:

	Ant: 1.6beta2
	Java: JDK 1.4.2


-----Original Message-----
From: Lindsey, Lucinda [mailto:lalinds@sandia.gov]
Sent: Tuesday, January 27, 2004 3:47 PM
To: 'Ant Users List'
Subject: RE: MailLogger reset in different targets not working


Thanks! Thats what I suspected. 

Please help me figure out a way to email different people depending on the
outcome of different targets. These people can be on different email servers
etc.

Thanks,
Cindy

-----Original Message-----
From: Erik Hatcher [mailto:erik@ehatchersolutions.com]
Sent: Tuesday, January 27, 2004 2:26 PM
To: Ant Users List
Subject: Re: MailLogger reset in different targets not working


Welcome to the wonderful world of property immutability.  Once a 
property is set, it may not change value.

	Erik


On Jan 27, 2004, at 3:49 PM, Lindsey, Lucinda wrote:

> Hi,
>
> I would like to email different individuals, based on the 
> success/failure of
> different targets in my build.xml. I have everything set up correctly, 
> but
> am getting strange results (at least I don't understand why it's 
> happening).
> I'm using MailLogger and set the following in each targets such as:
>
>  <target name="make" depends="compile,run"/>
>
> <target name="compile">
>     <property name="MailLogger.mailhost" value="xxxxxx"/>
>     <property name="MailLogger.from" value="lalinds@sandia.gov"/>
>     <property name="MailLogger.success.notify" value="true" />
>     <property name="MailLogger.success.to" value="lalinds@sandia.gov"/>
>     <property name="MailLogger.success.subject" value="helloworld 
> success"
> />
>     <property name="MailLogger.failure.notify" value="true" />
>     <property name="MailLogger.failure.to" value="lalinds@sandia.gov"/>
>     <property name="MailLogger.failure.subject" value="helloworld 
> failure"
> />
>     <exec executable="run_helloworld" failonerror="true"/>
>   </target>
>
> <target name="run">
>     <property name="MailLogger.mailhost" value="xxxxxx"/>
>     <property name="MailLogger.from" value="lalinds@sandia.gov"/>
>     <property name="MailLogger.success.notify" value="true" />
>     <property name="MailLogger.success.to" value="lalinds@sandia.gov"/>
>     <property name="MailLogger.success.subject" value="helloworld run
> success" />
>     <property name="MailLogger.failure.notify" value="true" />
>     <property name="MailLogger.failure.to" value="lalinds@sandia.gov"/>
>     <property name="MailLogger.failure.subject" value="helloworld run
> failure" />
>     <exec executable="run" failonerror="true"/>
>   </target>
>
> When I execute just the compile target I receive as expected a 
> "helloworld
> success". When I execute just the run target I receive as expected a
> "helloworld run failure" (I made it fail on purpose). However, when I
> execute both with the make target, I receive a "helloworld failure". I 
> had
> expected a "helloworld run failure" from the run target because I am 
> forcing
> an error on the run.
>
> The following messages were received when using the -debug flag:
>
> compile:
> Setting project property: MailLogger.mailhost -> xxxxxxxx
> Setting project property: MailLogger.from -> lalinds@sandia.gov
> Setting project property: MailLogger.success.notify -> true
> Setting project property: MailLogger.success.to -> lalinds@sandia.gov
> Setting project property: MailLogger.success.subject -> helloworld 
> success
> Setting project property: MailLogger.failure.notify -> true
> Setting project property: MailLogger.failure.to -> lalinds@sandia.gov
> Setting project property: MailLogger.failure.subject -> helloworld 
> failure
>      [exec] Current OS is SunOS
>      [exec] Executing 'run_helloworld' with
> Execute:Java13CommandLauncher: Executing 'run_helloworld' with
>
> run:
> Override ignored for property MailLogger.mailhost
> Override ignored for property MailLogger.from
> Override ignored for property MailLogger.success.notify
> Override ignored for property MailLogger.success.to
> Override ignored for property MailLogger.success.subject
> Override ignored for property MailLogger.failure.notify
> Override ignored for property MailLogger.failure.to
> Override ignored for property MailLogger.failure.subject
>      [exec] Current OS is SunOS
>      [exec] Executing 'run' with
> Execute:Java13CommandLauncher: Executing 'run' with
>      [exec] Hello World
>
> I can see that all the MailLogger properties were not set in the run 
> target,
> however, if I execute ONLY the run target alone, they are set. Can 
> someone
> help me understand why this is happening.
>
> I'm using Ant 1.5.4, Java 1.4.1, on Solaris 5.8
>
> Thanks for your help,
>
>
>
> Cindy Lindsey
> Sandia National Labs
> (505)844-0548
>
>
>
> ---------------------------------------------------------------------
> 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



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message