ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Macey, Ian" <>
Subject RE: Make Dependencies
Date Fri, 06 Apr 2001 16:27:05 GMT

> -----Original Message-----
> From: Conor MacNeill []
> If you want to create a dependency between A.class and 
> b.class which is not
> reflected in the source, the you are right, and <depend> will 
> not help you.
> I guess you can use uptodate as Diane suggested. 

I've managed to solve my problem using Diane's suggestion.
Here's my initial solution using uptodate:

<project name="Servlets" default="compile" basedir=".">

    <property name="build.dir"  value="classes" />

    <path id="project.class.path"> . . . </path>

    <target name="compile" depends="staticFinalTouch">
        <mkdir dir="${build.dir}"/>
        <javac srcdir="." destdir="${build.dir}" includes="*.java"
            <classpath refid="project.class.path"/>
todir="/prg/jboss_jetty/Jetty-3.0.2/webapps/corma/WEB-INF/classes" >
           <fileset dir="${build.dir}" includes="*.class" />

    <target name="staticFinalTouch" depends="staticFinalCheck"
        <touch file=""/>
        <touch file=""/>

    <target name="staticFinalCheck">
        <javac srcdir="." destdir="${build.dir}" includes=""> 
            <classpath refid="project.class.path"/>
        <uptodate property="staticFinalTouch.required"
targetfile="classes/Common.class" >
            <srcfiles dir="." includes="*.java" excludes="" />


> think it would be rare where you want to set up a compile 
> dependency where
> there is no source relationship between the classes.

As you can probably tell from the build.xml, my problem is with a file
being used to hold a series of static finals which are used in a number
of servlets.

Unfortunately such static finals slip past past depends' relying "upon the
class references encoded into the class files by the compiler" for well
known java-gotcha reasons...

Thanks for the help - if anyone knows of a better way to do this in Ant
let me know, otherwise I think this a workable solution.




This communication is for the attention of the
named recipient only and should not be passed
on to any other person. Information relating to
any company or security, is for information
purposes only and should not be interpreted as
a solicitation or offer to buy or sell any security.
The information on which this communication is based
has been obtained from sources we believe to be reliable,
but we do not guarantee its accuracy or completeness.
All expressions of opinion are subject to change
without notice.

View raw message