You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by ba...@goodconsultants.com on 2004/01/28 18:34:53 UTC

dependency between subdirectories


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


Re: dependency between subdirectories

Posted by RADEMAKERS Tanguy <ta...@swift.com>.
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


Re: dependency between subdirectories

Posted by Matt Benson <gu...@yahoo.com>.
--- barry@goodconsultants.com wrote:
> top/build.xml
>         A/build.xml
>         B/build.xml
> 
Have you looked at <subant> (1.6.0)?

-Matt

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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