How to get the SVN info use ANT
来源:互联网 发布:sql object id 编辑:程序博客网 时间:2024/05/18 00:26
1.How to get the SVN info
There are two ways to get the SVN info:
Ø Add some tags in one file and hope SVN willupdate them, but if this file is not get updated, it the tag will not changedneither, and we are not sure how to get those values though java codes.
Ø The other one is retrieve the info at thebuilding stage using ant task, and store them into one specified files, andread those files when needed.
There are two options when we choose the second approach.
1)Exec ”svn.exe” in Subversion Client folder
Pre-condition:
You must install Command-line SVN (CollabNet) firstly. Downloadfrom http://www.collab.net/downloads/subversion/.
Maybe TortoiseSVN(Download from: http://tortoisesvn.net/downloads)and setup the user accounts is also a must, because this ant task doesn’t needto input any user info.
<property file="local.properties" />
<target name="generate_svn_info" description="generate an info file which contains the svn info">
<exec dir="${SVN_HOME}" executable="${SVN_CLIENT_HOME}/svn.exe" output="svn_info.txt" >
<arg line="info" />
</exec>
</target>
Below is a sample generated by this script
Path: .
URL: http://xxxxxxxxxxxxx/xxxxxxxxxxxxx/xxxxxxxxxxxxx
Repository Root: http://xxx/xxxxx/xxxx
Repository UUIDxxxx-xxx-x-x-x-x-x-xxxx-xxxxx:
Revision: 41454
Node Kind: directory
Schedule: normal
Last Changed Author: xxxxx
Last Changed Rev: 41453
Last Changed Date: 2010-10-20 08:29:46 +0800 (Wed, 20 Oct 2010)
2) Use ant jar files provide by CollabNet
Use the ant jar files provided by CollabNet (Download from: http://subclipse.tigris.org/servlets/ProjectDocumentList?folderID=1731&expandFolder=1731&folderID=0).The shortages are we need to include new jar files and we need to set theusername and password in the build script.
<path id="svnant.lib" >
<fileset>
<include name="svnant.jar"/>
<include name="svnClientAdapter.jar"/>
<include name="svnjavahl.jar"/>
</fileset>
</path>
<taskdef name="svn" classpathref="project.classpath" classname="org.tigris.subversion.svnant.SvnTask" />
<target name="ant_generate_svn_info">
<svn username="xxxx" password="xxxxxx">
<status urlProperty="http://axxxx/xxxx/xxxxxx/xxxx" path="." revisionProperty="svn.revision" />
</svn>
<echo>lastChangedRevisionProperty ${svn.revision}</echo>
</target>
- How to get the SVN info use ANT
- Use jcvsii to get the cvs info
- [PHP]How to get the system info?
- How to use Ant
- How to get battery info
- Learn How TO Use SSH To Get Through the GFW
- How to get the media length use directshow
- How To Get System Info In Linux
- How to use ant delete exclude attribute
- How to use the CAknWaitDialog
- how to use the CAknwaitDialog
- How to use the CAknWaitDialog
- How to use the BAPI_BUPA_ADDRESS_CHANGE
- how to config and use apt-get
- How use NotifyChange to get camera clicks
- How to Get the WDK
- How to use http-proxy for svn
- How to use svn in Linux
- android学习笔记之3D--(03)-Renderer类 渲染类
- EJB中事务处理的两种方式
- Flex 菜单效果
- 进制转化算法(C++实现)——创新工场笔试归来
- SAP-CO.创建成本中心,作业类型,内部订单
- How to get the SVN info use ANT
- 去掉数据库导出的乱码(GBK版)
- 谈谈需求分析
- java中MD5加密
- jquery基础(九)
- 搜狐畅游 程序 笔试题
- javascript打开模式窗口的用法
- 设计模式之Facade-外观模式
- Getting "Debug Info" for a Sharepoint error!