• 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 ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Conditional Target Ran.

Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I am using Ant version 1.9.4.

I have a build-standard-targets.xml which gets imported into the build.xml for a number of projects - cars, bicycles and buses.

The build-standard-targets.xml has a target "generate-from-wsdl" which gets ran if the
condition of presence of a wsdl directory in "C:/resource" is met.

Below is a snippet of what I have.

This conditional behaviour needs to be changed such that the target "generate-from-wsdl"
is ran if the wsdl is present AND if build.xml is that of the Cars project ONLY.
So we don't need to ran this for the other projects ie bicycles and buses.

Any suggestion as to how I can modify the behaviour to met the new condition behaviour would be veyr much appreciated.

Thank you for your help.



build.xml for Cars project

build.xml for Bicycles project

build.xml for Buses project
author & internet detective
Posts: 40913
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you allowed to use ant contrib? IT has an if statement so you can easily put anything you want in the condition?

If not, you need to use a <condition tag in Ant to merge the two conditions into one property that you put in the if attribute of your target.>
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic