Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 5th, 2012  |  syntax: None  |  size: 0.70 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Modifying an existing task to add a new dependency
  2. |-- build-common.xml
  3. `-- build.xml
  4.        
  5. $ ant debug
  6. Buildfile: /home/mark/tmp/build.xml
  7.  
  8. -prebuild-copy:
  9.      [echo] PREBUILD TARGET
  10.  
  11. common.debug:
  12.      [echo] I AM A DEBUG TARGET
  13.  
  14. debug:
  15.      [echo] MY DEBUG TASK
  16.        
  17. <project name="build-common">
  18.  
  19.     <target name="debug">
  20.         <echo message="I AM A DEBUG TARGET"/>
  21.     </target>
  22.  
  23. </project>
  24.        
  25. <project name="demo" default="debug">
  26.  
  27.     <include file="build-common.xml" as="common"/>
  28.  
  29.     <target name="-prebuild-copy">
  30.         <echo message="PREBUILD TARGET"/>
  31.     </target>
  32.  
  33.     <target name="debug" depends="-prebuild-copy, common.debug">
  34.         <echo message="MY DEBUG TASK"/>
  35.     </target>
  36.  
  37. </project>