user5955758
user5955758

Reputation:

How to redefine target in Ant?

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

Upvotes: 0

Views: 525

Answers (1)

P.A. Cros
P.A. Cros

Reputation: 511

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.

Upvotes: 1

Related Questions