• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

tasks as subroutines

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This probably isn't ant-like, I'd like to hear suggestions.

I have several projects each with a build.xml file in the same relative place, and each build.xml has a task called (shock) "build". I want to be able to fetch each project out of CVS and invoke each project's build file.

Here's what I have which doesn't work:



The idea was to use 'go' as a subroutine, effectively. But it looks like once 'go' has been invoked once it doesn't get invoked again.

Antcall seems like real overkill. Can someone suggest a more elegant method?
 
author & internet detective
Posts: 42055
926
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
Tony,
You could make "go" a macrodef (like a function) or you could make a list of projects and loop through them using "for" (of ant-contrib).

Note that there is another problem with the code above. Properties are immutable. So once you set the property once, it will never be set to the next value.
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You may want to checkout my article on Ant in this month's JavaRanch Journal, especially the section on chaining and auto discovering.

Good luck!
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic