|
本帖最后由 arda 于 2015-1-12 16:56 编辑
发一个小工具,当代码采用SVN管理的时候如果指定了SVN keyword Id属性, 可以用这个小工具快速查询并自动生成全局版本编号(即最后修改文件版本及日期)
Feature:
1. 可以指定查询根目录及查询过滤扩展名
2. 可以指定输出文件名
3. 可以使用简单字符串指定输出格式
4. 可以使用模版文件指定输出格式
5. 可以指定调试信息输出级别
6. 可以使用扩展的正则查询表达式
Requirement:
.Net Framework 4.5.1
帮助信息如下:
- This utility is used to parse svn version id string like this:
- $Id:: comm_package.h 883 2014-12-09 04:13:54Z apra $
- usage: ArdaGlobalVerGen [-options]
- options:
- -i inpath , defines the INPUT search path.
- -o outflie , defines the OUTPUT result header file.
- -s formatstring , defines the output string format.
- using keyword $version$ $datetime$ for replacement.
- -f formatfile , defines the output format templet file.
- using keyword $version$ $datetime$ for replacement.
- -t tracelevel , defines trace level of output infos, silence = 0.
- -e extstring , defines file ext filter string. default:"c,h,cpp,cs,s,asm"
- -r regexstring , defines regex string for match svn id string. Regex string
- should include match group'file'/'version'/''datetime
- -h , show this help.
- If no arguments, search current folder with default ext filter and generates
- VersionInfo.h in current folder. This file will define two micro named as
- GlobalVersion and GlobalDateTimeTag
- Examples:
- ArdaGlobalVerGen -i "D\:\Proj_xxx\src" -o "D\:\Proj_xxx\inc\ver.h"
- ArdaGlobalVerGen -s " const unsigned char* verstr = "Ver: $version$";" -t 1
复制代码
生成的代码示例如下:
- //------------------------------------------------------------------------------
- // Copyright(C) Arda Technologies, 2007-2015. All rights reserved.
- //------------------------------------------------------------------------------
- // Description: Global Version Informations
- // Author: XXXX
- // DateTime: 2015/01/12 03:49:16
- //------------------------------------------------------------------------------
- // This file is auto generated by ArdaGlobalVerGen utility.
- //------------------------------------------------------------------------------
- #ifndef __VERSIONINFO_H_
- #define __VERSIONINFO_H_
- #define GlobalVersion 931
- #define GlobalDateTimeTag "2015/1/12 12:54:01"
- #endif //__VERSIONINFO_H_
复制代码
附件包含
1. 查询工具ArdaGlobalVerGen,
2. 两个脚本,分别采用格式字符串及文件模版定义输出格式
3. 一个文件模版
下载链接:
使用方法:
在编译前从前端自动调用此小工具生成版本信息,再启动编译。 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
阿莫论坛20周年了!感谢大家的支持与爱护!!
月入3000的是反美的。收入3万是亲美的。收入30万是移民美国的。收入300万是取得绿卡后回国,教唆那些3000来反美的!
|