Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the value of the current target ant?

Tags:

target

ant

How can I get the value of the current target ant?

Does it exist a special variable something called TARGET?

like image 424
pindare Avatar asked Sep 15 '09 15:09

pindare


2 Answers

Based on the issue you have to patch ant or used javascript:

<target name="test">
  <script language="javascript">
    project.setNewProperty("current_target", self.getOwningTarget());
  </script>
  <echo>${current_target}</echo>
</target>
like image 167
FoxyBOA Avatar answered Nov 17 '22 00:11

FoxyBOA


In ant 1.8.2 you can use ${ant.project.invoked-targets}

However, looking at the commit logs http://svn.apache.org/viewvc?view=revision&revision=663061 I'm guessing its been available since 1.7.1

like image 22
David Laing Avatar answered Nov 17 '22 01:11

David Laing