Ant脚本类路径的多个版本之间进行选择 [英] Ant script to choose between multiple version of classpaths

查看:188
本文介绍了Ant脚本类路径的多个版本之间进行选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的Ant脚本。

I am new to Ant scripts.

下面是需求描述

在我的工作区,有各种各样的项目,我必须对我的RAD项目工作和Eclipse IDE中,以及在WebSphere,Tomcat和JBoss的环境..我所做项目的具体设置,使对RAD和WebSphere项目工作和eclipse和tomcatñJBoss的。

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.

但我的想法是有一个工作区与类路径的多个版本,例如。 classpath_eclipse,classpath_rad等,并有一个Ant脚本,将正确的文件之间的构建过程中,这取决于IDE选择。

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. .:/

推荐答案

我想和大家分享,我终于实现了办法。

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

的classpath 设置有的项目配置XML的那些依赖于运行时。

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

在每个项目,我们创建了一个 runtime_classpah &安培; runtime_settings configxml_runtime 版本的每个文件。

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

创建一个目标蚂蚁,它接受运行作为参数,itrates在每个项目&放大器; classpath_runtime 的内容复制到的classpath setting_runtime来设置

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.

和目标是overrites configxml configxml_runtime

And a target that overrites configxml with contents of configxml_runtime

这篇关于Ant脚本类路径的多个版本之间进行选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆