ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neta Bar Tal" <NE...@Amdocs.com>
Subject RE: Want javac task to not fail on non-existent src directories
Date Mon, 21 Jun 2004 14:19:39 GMT

Hi Jeremy,
I did the same . I used <for> of ant-contrib and I'm attaching it here.

<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>

The only thing you need to define is the ${dynamics}, which suppose to
hold all your src dirs.

Regards
netaB



-----Original Message-----
From: JeremyRobert.Smith@med.va.gov
[mailto:JeremyRobert.Smith@med.va.gov]
Sent: Saturday: June 19: 2004 1:59 AM
To: user@ant.apache.org
Subject: Want javac task to not fail on non-existent src directories


Hi Folks,

	This should be a simple one:

I need to call the javac task on several src dirs.  In come cases, some
or all of these directories won't exist. 

Right now I have:

                <javac destdir="${build}" debug="true">
                  <src path="${src}"/>
                  <src path="${test}"/>
                  <src path="${itest}"/>
                  <src path="${ptest}"/>
                  <classpath refid="stdclasspath"/>
                </javac>

I get the error "srcdir does not exist." When any of these directories
are missing.  Sometimes all of them will be missing...but for each that
is there, I want to build the files and put them in destdir.

So what's the best way to do this?

Jer

---------------------------------------------------------------------
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


Mime
View raw message