Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Import File Ant Scirpt

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have one replace.xml with Task1 and MainBuild.xml , SubBuild1.xml , SubBuild2.xml

The replace.xml:
<target name="task1"></target>
<target name="task2"></target>

In the MainBuild.xml
<import file="replace.xml">
<target name="">
<ant antfile="/sample/SubBuild1.xml" target="build"/>
<ant antfile="/sample/SubBuild1.xml" target="build"/>
</target>

But i need to call replace.xml targets from the Sub Build files and need not imported replace.xml in sub build files.
Is it posiible by using ANT script and could you please let me know any other ways to achive this task.
It would be great help.

Regards,
Sam

 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do not think that what you want to do is possible. If you want to invoke any of the targets in replace.xml from the SubBuild1.xml, then SubBuild1.xml will have to include replace.xml. For what I can tell, when you use the ant task, your current set of properties is passed to ant build you are invoking, but it reads the specified build file (SubBuild1.xml, for example) and acts only on targets and definitions it finds there.

Perhaps if you would describe why you have several build files and sub build files, we might be able to come up with some other mechanism.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic