Hi,

Some more info.

Here is the complete build file.

<project name="test" default="dist" basedir=".">

  <!-- set global properties for this build -->
  <property name="src" value="."/>
  <property name="build" value="build"/>
  <property name="dist"  value="dist"/>
  <property name="tools.jar" value="${java.home}/lib/tools.jar"/>

  <!-- Build classpath -->
  <path id="classpath">
   <fileset dir="./lib">
    <include name="**/*.jar"/>
   </fileset>
     <pathelement location="${tools.jar}"/>
  </path>

  <target name="init">
    <!-- Create the time stamp -->
    <tstamp/>
    <!-- Create the build directory structure used by compile -->
    <mkdir dir="${build}"/>
  </target>

  <target name="compile" depends="init">
    <!-- Compile the java code from ${src} into ${build} -->
    <javac srcdir="${src}" destdir="${build}">
        <classpath refid="classpath"/>
    </javac>
  </target>

  <target name="dist" depends="compile">
    <!-- Create the distribution directory -->
    <mkdir dir="${dist}/lib"/>

    <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file 
-->
    <jar jarfile="${dist}/lib/test.jar" basedir="${build}"/>
  </target>

  <target name="clean">
    <!-- Delete the ${build} and ${dist} directory trees -->
    <delete dir="${build}"/>
  </target>

</project>



As you can see it the build file is the simpelest possible. I copied it 
from the documentation.

The property build is know to the clean tak.

The output I get is this:

c:\jdk1.3.1\lib\tools.jar;.\lib\ant-1.3.jar;.\lib\xerces.jar
c:\jdk1.3.1\lib\tools.jar;.\lib\ant-1.3.jar;.\lib\xerces.jar;.\lib\ant-1  
.3.jar;.\lib\xerces.jar
Buildfile: build.xml

init:

compile:
    [javac] Compiling 1 source file to C:\_test\build

dist:
      [jar] Building jar: C:\_test\dist\lib\Test.jar

BUILD SUCCESSFUL

Total time: 3 seconds



So it does not seem to execute the target clean or it has not result. I 
assume you also see clean: in the output? It is the last target but I do 
not see a reason why ant would not execute it. I assume the expected result 
of the clean task is that it would delete the 1 class file that it 
contains. The test.class. I would expect it would simply delete any file in 
the build directory but it does not delete any file. Or is that not the 
case in normal behavior? Is there a way to display errormessage on the 
clean task or should it do this already and are there simply no 
errormessages.


I am using windows 2000 with SP1 and jdk 1.3.1. Using ant 1.3. I already 
tried moving the clean task to right after the properties but that does not 
matter.


Greetings,

Martin van Wieringen

> I am also using w2k sp1 and the delete task works just as
> advertised (on
> different windows machines, and even on a linux box). I don't
> know what the
> problem is, but I guess it is specific to your environment.
> Do you have any
> more info we can work with?
>
> Ylan Segal.
>


> Maybe you havent defined the properties at this point

Steve Loughran


>What does the output look like? Do you see the [delete]? Are you sure the
>target is actually being run?
>Diane

>=====
>([EMAIL PROTECTED])



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to