amri (1) [Avatar] Offline
#1
Hi all,
I'm new here, I maked a file build.xml like this

<?xml version="1.0" encoding="UTF-8"?>
<project name="helloworld" default="compile" basedir=".">
<description>
Build file for the Hello World application.
</description>
</project>

and I saved it in c:/

and I went to command prompt, and did like this

c:/ ant build.xml

but i get this error

BUILD FAILED
Tareget "build.xml" does not exist in the project "helloworld".
Total time : 0 seconds

can anyone help me please

omer
javaburre (1) [Avatar] Offline
#2
Re: I need help
ant by default searches for a build.xml file in your current directory. So no need to mention it:

c:/ ant

This will launch ant using the build.xml file. Because you set a default target named 'compile' it will launch this one. Your build.xml file needs a 'compile' target:
<target name="compile">
<!-- see javac for example -->
</target>

If you want to use a build file other the build.xml you have to use following syntax:

c:/ ant -f other.xml

(note the -f )

To launch a target 'unittest' defined in build.xml:

c:/ ant unittest

hope it helped.