ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Leonhardt" <leonha...@informatik.tu-darmstadt.de>
Subject [ANN] Collecting requirements for Ant2
Date Thu, 15 Mar 2001 15:09:19 GMT
Two more things that came to my mind.

It would be nice to have more flexibility
in respect of the dependencies between the targets.

I got the following problem.

I have a target which checks out a cvs repository
and compiles it.
Now I want to be able to tell the user whether the files
in the cvs repository contain errors by sending him an e-mail.
I have found no way to do this with ant. Because there is no
flag telling me if another target finished successfully or not.

I tried to build a workaround by setting a property but the problem
is that I can't override properties and properties defined inside
a target seem to be local, I can't use them in other targets.

The next thing is that the if-clause of the target only checks if the
property is set but not to what value.

I put a sample xml file at the end of this mail.

Greetings Thomas


  <!--
       ===================================================================
         Check if contents of CVS repository compiles
       ===================================================================
  -->


  <target name="cvs-check" if="cvs.user">

    <property name="cvs-check.succeeded" value="false" />
    <antcall target="cvs-check-sub" />

    <echo message="${cvs-check.succeeded}" />

    <antcall target="cvs-check-succeeded" />
    <antcall target="cvs-check-failed" />
  </target >


  <target name="cvs-check-sub" depends="build-clean" if="cvs.user">
    <property name="cvs-check.succeeded" value="true" />
    <echo message="${cvs-check.succeeded}" />
  </target >

  <target name="build-clean" if="cvs.user">
    <tstamp/>

    <!-- Dateien vom letzten Check wegwerfen -->
    <!--
    <delete dir="${cvs-check.src.dir}" />
    <delete dir="${cvs-check.build.dir}" />
    -->

    <!-- Verzeichnisse erzeugen, die fuer den Check benoetigt werden. -->
    <!--
    <mkdir dir="${cvs-check.src.dir}" />
    <mkdir dir="${cvs-check.build.dir}" />
    -->

    <!--
    <cvs command="-d :pserver:${cvs.user}@${cvs.server}:${cvs.repository}
checkout -P -d '${cvs-check.src.dir}' src" />
    -->

    <javac srcdir="${cvs-check.src.dir}"
           destdir="${cvs-check.build.dir}"
    >
    </javac >
  </target >

  <target name="cvs-check-succeeded" if="cvs-check.succeeded">
    <echo message="Sources in cvs repository compiled without errors." />
  </target >

  <target name="cvs-check-failed" unless="cvs-check.succeeded">
    <echo message="Sources in cvs repository contain errors." />
  </target >


Mime
View raw message