ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tibor Strausz <Tibor.Stra...@tridion.com>
Subject RE: how can i use a property to enable/disable a general target
Date Thu, 15 Aug 2002 08:50:15 GMT
yes i had that first but i like this better...
ok if there are no better alternetives than its ok

why is it that the if part of a target only looks at if the var is set 
and not if the var is true?? than live would be much easer :-)

tibi

> -----Original Message-----
> From: Matt Benson [mailto:gudnabrsam@yahoo.com]
> Sent: Wednesday, August 14, 2002 5:17 PM
> To: Ant Users List
> Subject: RE: how can i use a property to enable/disable a 
> general target
> 
> 
> I'm sorry, I didn't notice that you were also
> specifying runTarget when you made the antcall to
> router.  I suppose in that case what you're doing
> makes as much sense as anything.  The only alternative
> that springs to mind is putting each antcall to
> CPPProject in a separate task.  Probably simpler but
> quite a bit longer as well.
> 
> -Matt
> 
> 
> --- Tibor  Strausz <Tibor.Strausz@tridion.com> wrote:
> > the run proeprty will change because the param
> > 'runTarget' will change
> > 
> > 
> > > -----Original Message-----
> > > From: Matt Benson [mailto:gudnabrsam@yahoo.com]
> > > Sent: Wednesday, August 14, 2002 3:41 PM
> > > To: Ant Users List
> > > Subject: RE: how can i use a property to
> > enable/disable a 
> > > general target
> > > 
> > > 
> > > Since it seems you are checking more than once the
> > > value of a property which you do not expect to
> > change,
> > > you could do it only once:
> > > 
> > > <target name="buildSources"
> > depends="checkruntarget"
> > >         if="run" description="Building the
> > sources.">
> > >   <!-- antcalls calling CPPProject here -->
> > > </target>
> > > 
> > > <target name="checkruntarget">
> > >   <condition property="run">
> > >     <istrue value="${runTarget}" />
> > >   </condition>
> > > </target>
> > > 
> > > -Matt
> > > 
> > > --- Tibor  Strausz <Tibor.Strausz@tridion.com>
> > wrote:
> > > > yes i want to re-check the same property for now
> > i
> > > > have the following wich
> > > > looks ok to me.
> > > > but if there is a shorter nicer better way i'm
> > hapy
> > > > to hear it :-)
> > > > 
> > > > 
> > > > 
> > > >   <target name="buildSources"
> > description="Building
> > > > the sources.">
> > > >  
> > > >
> > >
> >
> <!--Installers\CustomActions\VC\TDSDialogValidation\TDSDialogV
> > > alidation.dsp-
> > > > ->
> > > >     <antcall target="router">
> > > >       <param name="make"
> > value="TDSDialogValidation
> > > > - Win32 Unicode
> > > > Release"/>
> > > >       <param name="target" value="CPPProject"/> 
> > 
> > > >       <param name="project"
> > > > value="TDSDialogValidation"/>  
> > > >       <param name="runTarget"
> > > > value="${TDSDialogValidation}"/>  
> > > >       <param name="projectFile"
> > > >
> > >
> >
> value="Installers\CustomActions\VC\TDSDialogValidation\TDSDial
> > > ogValidation.d
> > > > sp"/>  
> > > >     </antcall>
> > > > 
> > > >
> > >
> >
> <!--Installers\CustomActions\VC\TDSMSMQ\TDSMSMQ.dsp-->
> > > >     <antcall target="router">
> > > >       <param name="make" value="TDSMSMQ - Win32
> > > > Unicode Release"/>
> > > >       <param name="target" value="CPPProject"/> 
> > 
> > > >       <param name="project" value="TDSMSMQ"/>  
> > > >       <param name="runTarget"
> > value="${TDSMSMQ}"/>  
> > > >       <param name="projectFile"
> > > >
> > >
> >
> value="Installers\CustomActions\VC\TDSMSMQ\TDSMSMQ.dsp"/>
> > > >  
> > > >     </antcall>
> > > > 
> > > >
> > >
> >
> <!--Installers\CustomActions\VC\TDSMTSUsr\TDSMTSUsr.dsp-->
> > > >     <antcall target="router">
> > > >       <param name="make" value="TDSMTSUsr -
> > Win32
> > > > Unicode Release"/>
> > > >       <param name="target" value="CPPProject"/> 
> > 
> > > >       <param name="project" value="TDSMTSUsr"/> 
> > 
> > > >       <param name="runTarget"
> > value="${TDSMTSUsr}"/>
> > > >  
> > > >       <param name="projectFile"
> > > >
> > >
> >
> value="Installers\CustomActions\VC\TDSMTSUsr\TDSMTSUsr.dsp"/>
> > > >     </antcall>
> > > > [...]
> > > > 
> > > >  </target>
> > > > 
> > > > <!--======-->
> > > > <!--router-->
> > > > <!--======-->
> > > >   <target name="router" description="This will
> > set
> > > > the run property if
> > > > runTarget is true and antcall's the target">
> > > >     <condition property="run">
> > > >       <istrue value="${runTarget}" />
> > > >     </condition>
> > > >     <antcall target="${target}">
> > > >     </antcall>
> > > >   </target>
> > > > 
> > > > <!--===================-->
> > > > <!--=BUILD: CPPProject=if="run"-->
> > > > <!--===================-->
> > > >   <target name="CPPProject" description="make a
> > > > CPPProject" if="run">
> > > >     <echo>Project: ${project}
> > > > Make: ${make}
> > > > File: ${projectFile} 
> > > > Log: ${logDir}\${project}.log</echo>
> > > >     <exec executable="${msdevExe}">
> > > >       <arg line="'${srcDir}\${projectFile}'
> > /MAKE
> > > > '${make}' /REBUILD /OUT
> > > > '${logDir}\${project}.log'"/>
> > > >     </exec>
> > > >   </target>
> > > >  
> > > > 
> > > > 
> > > > > -----Original Message-----
> > > > > From: Matt Benson
> > [mailto:gudnabrsam@yahoo.com]
> > > > > Sent: Tuesday, August 13, 2002 11:31 PM
> > > > > To: Ant Users List
> > > > > Subject: RE: how can i use a property to
> > > > enable/disable a 
> > > > > general target
> > > > > 
> > > > > 
> > > > > Okay, I'm not sure what you're after.  Do you
> > want
> > > > to
> > > > > check for the existence of different
> > properties in
> > > > one
> > > > > run of Ant using only one target?  Or are you
> > > > wanting
> > > > > to re-check the same property over and over? 
> > I
> > > > had
> > > > > the problem of getting the reset property
> > warning
> > > > when
> > > > > the same target was invoked twice, so I did
> > this:
> > > > > 
> > > > > <target name="init" unless="init.done">
> > > > >   <!-- do some stuff -->
> > > > >   <property name="init.done" value="true" />
> > > > > </target>
> > > > > 
> > > > > This allowed me to execute only once, but
> > would
> > > > only
> > > > > be good for checking the value of one property
> > one
> > > > > time and using the results throughout the Ant
> > > > process.
> > > > >  If you need to check multiple properties, the
> > > > simple
> > > > > way would be to use a target per each
> > property,
> > > > > although some dynamic way might be devised,
> > quite
> > > > > possibly involving <antcall>?  I dunno...
> > > > > 
> > > > > -Matt
> > > > > 
> > > > > --- Tibor  Strausz <Tibor.Strausz@tridion.com>
> > > > wrote:
> > > > > > well yes but now the value propset is set
> > and
> > > > can't
> > 
> === message truncated ===
> 
> 
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com
> 
> --
> To unsubscribe, e-mail:   
> <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:ant-user-help@jakarta.apache.org>
> 

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


Mime
View raw message