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: Dependencies between two subdirectories
Date Fri, 12 Mar 2004 15:29:39 GMT
Baz wrote:

>The first thing comes to my head is to do <ant dir="../B"
>Target="compile"/> from directory A. Is it the right way to do it?
>
>  
>

Baz,

That's how i do it, plus the compile target in /B/build.xml looks like:

<target name="compile" depends="check.required" if="compile.required">
...
</target>

where the "check.required" targets checks if a compile is required:

    <target name="check.required">
        <condition property="compile.required">
            <not>
                <and>
                    <available file="${SAP_EAR}"/>
                    <uptodate targetfile="${SAP_EAR}">
                        <srcfiles dir="${COMP_JAVA_SRC}" 
includes="**/*.java"/>          
                        <srcfiles dir="${COMP_SRC}/META-INF" 
includes="*.xml"/>
                        <srcfiles file="${COMMON_JAR}"/>
                        <srcfiles file="${EJBMSG_JAR}"/>
                    </uptodate>
                </and>
            </not>
        </condition>
        <echo message="Build of ${COMP_NAME} required ? 
${compile.required}"/>
    </target>


so that B only rebuilds itself if it has to but A is guaranteed that the 
latest version of B will be available when A is built.

Regs,
/t

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


Mime
View raw message