ant-user mailing list archives

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

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">
        <not>
            <and>
                <available file="${COMMON_EAR}"/>
                <uptodate targetfile="${COMMON_EAR}">
                    <srcfiles dir="${COMP_JAVA_SRC}" 
includes="**/*Bean.java"/>
                </uptodate>
            </and>
        </not>
    </condition>
    <echo message="EJBGEN of ${COMP_NAME} required ? ${generate.required}"/>
</target>

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" 
if="generate.required">
    ...
</target>

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" 
inheritAll="false"/>
</target>
(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">
    ...
</target>

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)

Regs,
/t

  

barry@goodconsultants.com wrote:

>All,
>
>I am still looking for the answers to resolve the dependencies between two
>subdirectories. Please advice.
>
>top/build.xml
>        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.
>
>Thanks
>
>B.
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message