ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From RADEMAKERS Tanguy <>
Subject Re: dependency between subdirectories
Date Wed, 28 Jan 2004 19:12:58 GMT

i. A/build.xml should have a target like "check_required" to see if the 
compiled code in A is up to date - see an example below:

<target name="check_required">
    <condition property="generate.required">
                <available file="${COMMON_EAR}"/>
                <uptodate targetfile="${COMMON_EAR}">
                    <srcfiles dir="${COMP_JAVA_SRC}" 
    <echo message="EJBGEN of ${COMP_NAME} required ? ${generate.required}"/>

ii. the build targets of A/build.xml should depend on this 
"check_required" and on the property it sets
<target name="generate" depends="check_required, init" 

iii. B/build.xml has a target like "pre-requisite" that attempts to 
build A/Build.xml:
<target name="pre-requisite">
    <echo message="Pre-requisite for SAP: COMMON"/>
    <ant antfile="build.xml" dir="../common" target="generate" 
(note: to make it neater it could pass through the root build.xml)

iv. the targets of B/build.xml should depend on this "pre-requisite":
<target name="compile" depends="pre-requisite, init">

ie: it's not up to B/build.xml to check if A/build.xml needs to build 
anything - it's up to A/build.xml. In any case, the files will be ready 
by the time B/build.xml gets to work (compile)

/t wrote:

>I am still looking for the answers to resolve the dependencies between two
>subdirectories. Please advice.
>        A/build.xml
>        B/build.xml
>Top/build.xml calling A and B by using <ant dir="./A"/>
>Questions 1) Am I using the right method to compile subdirectories? Please
>keep in mind that developers should be able to go into directory A and build
>just A directory. Thats why there is A/build.xml.
>Question 1) How can B depends on A? Meaning, if A is not built, then when
>building B, B/build.xml will check A and build A if necessary for B.
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message