dependency checking
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Brian_Brian
Posted On:   Monday, November 24, 2003 08:49 AM

how can I induce Ant to evaluate dependencies correctly for multiple levels of project hierarchy? for example, I have 3 modules, A, B, and C, each with a separate build file. C has no dependencies. B depends on C. A depends on B and C. I want the build file targets in A to call the targets in B and C, but avoid duplicate invocation of C's targets when B evaluates them. (as is, invoking A.x invokes C.x and B.x, but then B.x also invokes C.x again) eg. I don't want to have A know what B depends on, otherwise the build files become a huge mess since every module needs to have the complete dependency tree enumerated within it, which is a maintenance nightmare.    More>>

how can I induce Ant to evaluate dependencies correctly for multiple levels of project hierarchy?


for example, I have 3 modules, A, B, and C, each with a separate build file.

C has no dependencies.

B depends on C.

A depends on B and C.


I want the build file targets in A to call the targets in B and C, but avoid duplicate invocation of C's targets when B evaluates them. (as is, invoking A.x invokes C.x and B.x, but then B.x also invokes C.x again)


eg. I don't want to have A know what B depends on, otherwise the build files become a huge mess since every module needs to have the complete dependency tree enumerated within it, which is a maintenance nightmare.


I'm restricted to Ant 1.5.x until 1.6 goes to release, so I'm hoping there is a 1.5 solution.

   <<Less

Re: dependency checking

Posted By:   Anonymous  
Posted On:   Tuesday, November 25, 2003 11:13 PM

Just an idea: a target checks the existing of a flag (file). If it already exists, it does nothing. If not it sets the flag and does it work.

A.xml






B.xml





C.xml





  1. a: call b.compile

  2. b: check file existence

  3. b: call c.compile

  4. c: check file existence

  5. c: compile

  6. c: create file

  7. b: compile B

  8. b: create file

  9. a: call c.compile

  10. c: check file existence

  11. a: compile A


But´ll get a lot of files :-)
About | Sitemap | Contact