You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by An...@bcbsil.com on 2004/04/30 16:16:08 UTC
?? Available Task ??
Hi all,
I'm probably using the "available" task incorrectly. Basically, I want to
set a property if a file whose name matches a pattern is found.
Here is what I have, which does not work:
<available property="class.files.exist"
classpathref="classesDir"
file="test\hcsc\**\*_Trigger.class"/>
I am trying to set the property if any file matching the "*_Trigger.class"
pattern exists *anywhere* in the directory structures.
Is there an easy way to do this?
Thanks...
**********
The information contained in this communication is confidential, private,
proprietary, or otherwise privileged and is intended only for the use of the
addressee. Unauthorized use, disclosure, distribution or copying is strictly
prohibited and may be unlawful. If you have received this communication in
error, please notify the sender immediately at (312)653-6000 in Illinois;
(972)766-6900 in Texas; or (800)835-8699 in New Mexico.
**********
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: How do I configure ant for the sources of Thinking in Java's book?
Posted by Darin Swanson <Da...@us.ibm.com>.
Eclipse questions are likely better to be asked in an Eclipse
forum...check out the Eclipse newsgroups.
Since you neglected to indicate the Eclipse build you are using I will
give you the easiest solution that is common between all Eclipse builds.
One solution is to include a tools.jar in your ant runtime classpath.
http://www.eclipse.org/eclipse/faq/eclipse-faq.html#users_16
In the Eclipse 3.0 stream, if you have JAVA_HOME set to point to a JDK
install, this tools.jar will be added to the Ant runtime classpath
automatically.
HTH
Darins
Gabriel Solari <so...@auto.ucl.ac.be>
04/30/2004 08:26 AM
Please respond to "Ant Users List"
To: Ant Users List <us...@ant.apache.org>
cc:
Subject: How do I configure ant for the sources of Thinking
in Java's book?
I have the sources from Thinking in Java's book written by Bruce Eckels
and I've used the Eclipse editor to run some classes. The question is
how to include and build the classes that come with these sources inside
Eclipse?. I've tried to used the External tool from Eclipse but it
didn't work. The error that I have is
JDK.version.check:
[javac] Compiling 1 source file
[javac] BUILD FAILED: file:C:/Program
Files/eclipse/plugins/Code/c02/build.xml:31: Unable to find a javac
compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
I know that I have to set the CLASSPATH but I don't know how. It is
clear that Java doesn't recognize the path indicated by the .xml file.
So, could you explain me which CLASSPATH file update and how must I
accomplish the task.
Regards,
Gabriel
How do I configure ant for the sources of Thinking in Java's book?
Posted by Gabriel Solari <so...@auto.ucl.ac.be>.
I have the sources from Thinking in Java's book written by Bruce Eckels
and I've used the Eclipse editor to run some classes. The question is
how to include and build the classes that come with these sources inside
Eclipse?. I've tried to used the External tool from Eclipse but it
didn't work. The error that I have is
JDK.version.check:
[javac] Compiling 1 source file
[javac] BUILD FAILED: file:C:/Program
Files/eclipse/plugins/Code/c02/build.xml:31: Unable to find a javac
compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
I know that I have to set the CLASSPATH but I don't know how. It is
clear that Java doesn't recognize the path indicated by the .xml file.
So, could you explain me which CLASSPATH file update and how must I
accomplish the task.
Regards,
Gabriel
Re: ?? Available Task ??
Posted by Matt Benson <gu...@yahoo.com>.
--- Anthony_Lapaso@bcbsil.com wrote:
[SNIP]
> I'm probably using the "available" task incorrectly.
> Basically, I want to
> set a property if a file whose name matches a
> pattern is found.
>
> Here is what I have, which does not work:
>
>
> <available property="class.files.exist"
> classpathref="classesDir"
> file="test\hcsc\**\*_Trigger.class"/>
>
>
> I am trying to set the property if any file matching
> the "*_Trigger.class"
> pattern exists *anywhere* in the directory
> structures.
<available> was not designed with wildcards in mind...
that said, in this particular case, you could work
around something like this:
<pathconvert property="class.files.exist"
setonempty="false"
pathsep=" ">
<fileset
dir="classesDirIfItIsASingleDirectoryAsItsNameImplies"
includes="test\hcsc\**\*_Trigger.class" />
</pathconvert>
HTH,
Matt
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org