多个版本的类路径

多个版本的类路径

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

问题描述

我是 Ant 脚本的新手.

I am new to Ant scripts.

以下是需求说明

在我的工作区中,有各种项目,我必须在 RAD 和 Eclipse IDE 以及 Websphere 、tomcat 和 jboss 环境上进行我的项目工作.和 eclipse 和 tomcat n 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.

classpathsettings 和一些依赖于运行时的project config xmls.

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

在每个项目中,我们创建了一个 runtime_classpah &每个文件的 runtime_settingsconfigxml_runtime 版本.

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

ant中创建了一个target,它以runtime为参数,遍历每个项目&将 classpath_runtime 的内容复制到 classpathsetting_runtime 到 settings.

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.

还有一个目标用configxml_runtime

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

08-28 16:40