0

file1.xml

<project name="main_file">
  <import file="file2.xml"/>
  ...
</project>

file2.xml

<project name="inc_file">
  <target name="target1">
    ... 
  </target>
</project>

Can I redefine inc_file.target1 in file1.xml? Target in main_file should be called instead of inc_file.target1.

UPD: I didn't want the old target was called. I would like to get a new target replaced the old

  • Possible duplicate of [Target overriding in Ant](http://stackoverflow.com/questions/6979583/target-overriding-in-ant) – dnault Jul 07 '16 at 07:18
  • @dnault I didn't want the old target was called. I would like to get a new target replaced the old –  Jul 07 '16 at 07:21

1 Answers1

1

See Ant documentation for import task. It explains clearly that import behave like you expect (see subsection Target overriding): just redefine your target1 target in main_file and it will override the one defined in inc_file.

P.A. Cros
  • 501
  • 3
  • 6