Search code examples
eclipseantrad

Ant script to choose between multiple version of classpaths


I am new to Ant scripts.

below is description of requirement

in my workspace, there are various projects and I have to have my project work on RAD and eclipse IDE as well as Websphere , tomcat and jboss environment.. i have made project specific settings to make the project work on RAD and websphere and eclipse and tomcat n jboss..

but there are changes in several files like classpath n few config files.

this leaves me with three versions of workspace.

but my idea is to have one workspace with multiple version of classpath for eg. classpath_eclipse, classpath_rad etc.. and have an ant script that will choose between the right files during build depending on which ide.

So guys please suggest some approach how can i implement this approach. totally new to ant. .:/


Solution

  • I would like to share the approach that I finally implemented.

    There were classpath, settings and some project config xmls that were dependent on runtime.

    In each project we created a runtime_classpah & runtime_settings and configxml_runtime version of each file.

    Created a target in ant that takes in runtime as param ,itrates over each project & copies contents of classpath_runtime to classpath ,setting_runtime to settings.

    And a target that overrites configxml with contents of configxml_runtime