ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mika Moilanen <>
Subject A strategy to deal with platform specific stuff?
Date Wed, 24 Sep 2003 08:44:24 GMT

I have been figuring out the best way to organize ANT systems in
multi-platform cases: Where to store those differences, and how to
control them? 

A simplistic example is a property, let's say
"application.classpath"; This needs to be different on UNIX and on
Windows. This property is used in a target called "run_application".

Instead of setting/evaluating "application.classpath" in the body of
"run_application" target, I've removed it out as a target of it's own:

<target name="set_application.classpath">
  <condition property="application.classpath" value="...">

...and made "run_application" target to depend on this:

<target name="set_application.classpath" depends="set_application.classpath>

This "separation" of differences to a smaller targets of their own
frees me from having one huge "init" block in my ANT system, which
would evalluate and set all the platform specific stuff...Or is this
"one init block wehere we set all the stuff" a common approach?

My approach creates a bit of more work since I've to think the
dependency relationships between targets and the platform specific
aspects they potentially use.

What do you think, it this level of "control" a madness not going to
give any benefits after all, or are there any other users building a
similar system?

Best Regards, 
----------------------------------------------------------  phone: +358-0-511-23587
Nokia Networks, PO box 320, FIN-00045 NOKIA GROUP, Finland

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message