• 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:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

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

Hi,

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.

Pete

build-standard-targets.xml


build.xml for Cars project


build.xml for Bicycles project


build.xml for Buses project
 
author & internet detective
Posts: 42200
937
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
Pete,
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.>
 
This is my favorite show. And this is my favorite tiny ad:
Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders
https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing
reply
    Bookmark Topic Watch Topic
  • New Topic