ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmass...@pivolis.com>
Subject RE: How to create paths that depend on a condition?
Date Sun, 23 May 2004 09:05:34 GMT
Hi Neta,

Thanks for the tip. However, I don't want to use <if> as it's not part
of the Ant distribution. Also, I still don't see from your example how
it would for me.

If I understand correctly your strategy you're saying:
1- build different path ids
2- perform the condition when you use them

How do you do the step 2? Is there some "if" attribute available
somewhere that I am missing?

Note: Don't bother looking for a solution if you don't already have it
as I have found something that works (albeit complex) and I've moved on
to other stuff. I'd still to know if there's a simpler solution though
;-)

Thanks
-Vincent

> -----Original Message-----
> From: Neta Bar Tal [mailto:NETAB@Amdocs.com]
> Sent: 23 May 2004 10:00
> To: Ant Users List
> Subject: RE: How to create paths that depend on a condition?
> 
> 
> Hi Vincent,
> I'm doing the opposite I'm starting a property in case the path
exists.
> Try to do it in opposite way.
> Hope it helps...
> 
> <for list="${dynamics}" delimiter=" " param="dir">
> 		  <sequential>
> 			<path id="sources.path.@{dir}">
> 		      		<fileset dir="${env.CCWSCA}/@{dir}">
> 		      			 <include name="*.java" />
> 		      		</fileset>
> 		     	</path>
> 		     	 <property name="sources.@{dir}"
> refid="sources.path.@{dir}"/>
> 		    	<if>
> 				<available file="${sources.@{dir}}"
> property="never.mind"/>
> 
> 			 <then>
> 			  	<echo message="Nothing to do for @{dir}"
> />
> 			 </then>
> 			 <else>
> 			 	<echo>compiling package:@{dir}</echo>
> 			   	<javac debug="${env.JAVA_DEBUG}"
> destdir="${env.CCWPA}/classes" failonerror="false"
> includeantruntime="false" listfiles="no" optimize="on"
> srcdir="${env.CCWSCA}">
> 		                   <include name="@{dir}/*.java" />
> 		            	  <classpath path="${classpath}"/>
> 				</javac>
> 
> 
> 
> 
> 			 </else>
> 
> 
> 
> 			</if>
> 		  </sequential>
> 		</for>
> 
> 
> 
> Neta Bar-Tal
> 
> * 972-9-7960521
> 
> *netab@amdocs.com
> 
> 
> -----Original Message-----
> From: Vincent Massol [mailto:vmassol2@pivolis.com]
> 
> Sent: Saturday: May 22: 2004 12:23 PM
> To: 'Ant Users List'
> Subject: RE: How to create paths that depend on a condition?
> 
> Ok, I've found a solutiob but it looks really ugly:
> 
> <dirset dir="${src.test.dir}/share-13-14">
>   <and>
>     <filename name="share-13-14"/>
>     <or>
>       <selector if="j2ee13.available"/>
>       <selector if="j2ee14.available"/>
>     </or>
>   </and>
> </dirset>
> 
> Any better solution?
> 
> Thanks
> -Vincent
> 
> > -----Original Message-----
> > From: Vincent Massol [mailto:vmassol2@pivolis.com]
> > Sent: 22 May 2004 10:41
> > To: user@ant.apache.org
> > Subject: How to create paths that depend on a condition?
> >
> 
> > Hi,
> >
> 
> > I'd like to create a <path> that depends on some property being
> defined
> > or not. This is for putting inside the <javac> task. I cannot find
the
> 
> > right combination. Here's what I'd like to do:
> >
> 
> >     <javac [...]>
> >       <src>
> >         <pathelement location="${src.test.dir}/share-12-13-14"/>
> > ---> start here
> >         <dirset dir="${src.test.dir}/share-13-14">
> >           <and>
> >             <depth max="0"/>
> >             <or>
> >               <selector if="j2ee13.available"/>
> >               <selector if="j2ee14.available"/>
> >             </or>
> >           </and>
> >         </dirset>
> > ---> stop here
> >
> 
> > The problem is that in order to use a selector (which has a "if"
> > attribute), I need to use direst. However dirset lists all
directories
> 
> > below a base dir. Hence the reason why I've tried using a max
<depth>
> of
> > 0.
> >
> 
> > When I run this I get a "duplicate class" error:
> >
> 
> >     [javac]
> >
>
E:\Dev\jakarta-cactus\framework\src\test\share-13-14\org\apache\cactus\T
> > estAll.java:32:
> > duplicate class: org.apache.cactus.TestAll
> >     [javac] public class TestAll
> >     [javac]        ^
> >     [javac]
> >
>
E:\Dev\jakarta-cactus\framework\src\test\share-13-14\org\apache\cactus\e
> > xtension\jetty\T
> > estJettyTestSetup.java:40: duplicate class:
> > org.apache.cactus.extension.jetty.TestJettyTestSetup
> >     [javac] public class TestJettyTestSetup extends TestCase
> >     [javac]        ^
> >     [javac] 2 errors
> >
> 
> > I think it's because some directories are added several times. Not
> sure
> > why though.
> >
> 
> > Is there a simpler way to achieve this? (it sounds very complex)
> >
> 
> > I'm using Ant 1.6.1.
> >
> 
> > Thanks
> > -Vincent
> >
> 
> >
> 
> >
> 
> >
---------------------------------------------------------------------
> > 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
> 
> 
> 
> The information contained in this message is proprietary of Amdocs,
> protected from disclosure, and may be privileged.
> The information is intended to be conveyed only to the designated
> recipient(s)
> of the message. If the reader of this message is not the intended
> recipient,
> you are hereby notified that any dissemination, use, distribution or
> copying of
> 
> this communication is strictly prohibited and may be unlawful.
> 
> If you have received this communication in error, please notify us
> immediately
> by replying to the message and deleting it from your computer.
> Thank you.
> 
> ---------------------------------------------------------------------
> 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
View raw message