批处理解决Ant自动下载CVS项目并打包
来源:互联网 发布:个体工商户域名备案 编辑:程序博客网 时间:2024/05/22 06:27
预装环境:CVS、Ant
实现功能:批处理传递项目名称进去,自动从 CVS server 获取工程并压缩。
主要代码:
@echo offif "%1"=="-h" goto helpif "%1"=="-p" if "%2" neq "" (set proname=%2goto useage) else (goto help):helpecho checkout project from cvsecho getProjectFromCVS [-p] [-h]echo -p specify the project name which you want to checkoutecho -h help doucumentgoto end:useageset tmpfile1=tmptmpbuild.propertiesset tmpfile2=tmptmpbuild.xmlrem generate prop fileecho cvs.user = build>>%tmpfile1%echo cvs.pass = temp4now>>%tmpfile1%echo cvs.repository = :pserver:${cvs.user}:${cvs.pass}@192.168.42.248:/var/cvs>>%tmpfile1%echo ci.root = ../CodeRepository>>%tmpfile1%echo check.outdir = ${ci.root}/CheckOut>>%tmpfile1%echo build.path = C:/Users/Cui/Desktop>>%tmpfile1%echo project.name = %proname%>>%tmpfile1%rem build xml file echo ^<?xml version="1.0"?^>>>%tmpfile2%echo ^<project name="AntCVS" basedir="." default="clean"^>>>%tmpfile2%echo ^<property file="%tmpfile1%" /^>>>%tmpfile2%echo ^<target name="init"^>>>%tmpfile2%echo ^<mkdir dir="${checkout.dir}" /^>>>%tmpfile2%echo ^<mkdir dir="${build.path}/${project.name}-build" /^>>>%tmpfile2%echo ^</target^>>>%tmpfile2%echo ^<target name="checkOut" depends="init" description="CheckOut sources "^>>>%tmpfile2%echo ^<cvs cvsRoot="${cvs.repository}" package="${project.name}" dest="${checkout.dir}" /^>>>%tmpfile2%echo ^</target^>>>%tmpfile2%echo ^<target name="build" depends="checkOut"^>>>%tmpfile2%echo ^<tstamp^>>>%tmpfile2%echo ^<format property="CurTime" pattern="yyyy-MM-dd-hh-mm" locale="us"/^>>>%tmpfile2%echo ^</tstamp^>>>%tmpfile2%echo ^<tar destfile="${build.path}/${project.name}-build/${project.name}-${CurTime}.tar.gz" basedir="${checkout.dir}"/^>>>%tmpfile2%echo ^</target^>>>%tmpfile2%echo ^<target name="clean" depends="build" description=""^>>>%tmpfile2%echo ^<delete dir="${checkout.dir}" /^>>>%tmpfile2%echo ^</target^>>>%tmpfile2%echo ^</project^>>>%tmpfile2%echo start checkout project %project.name% ...cmd /c ant -buildfile %tmpfile2%echo end checkout project ...echo delete temple file ...del /f %tmpfile1%del /f %tmpfile2%:endpause
黑体的部分可以自行更改。也可以把这些做成配置文件或者参数。Ant 可以直接获取 *.properties 的 “变量名字=变量值” 的 “键值对”。
运行方式:
0 0
- 批处理解决Ant自动下载CVS项目并打包
- ant实现java项目自动构建并打包war
- Ant自动编译打包android项目
- Ant自动编译打包&发布 android项目
- Ant自动编译打包&发布 android项目
- Ant自动编译打包&发布 android项目
- Ant自动编译打包android项目
- ant工具-多渠道自动打包android项目
- Ant自动编译打包&发布 android项目
- Ant自动编译打包&发布 android项目
- Ant自动编译打包android项目
- Ant自动编译打包android项目
- Ant自动编译打包&发布 android项目
- Ant自动编译打包&发布 android项目
- Ant自动编译打包&发布 android项目
- Ant自动编译打包&发布 android项目
- Ant自动编译打包&发布 android项目
- Ant自动编译打包&发布 android项目
- 【环境配置】SVN图标不显示问题终极解决方案
- Java接口和Java抽象类
- 求子数组的最大和
- One-day-one-program(7)之顺序栈的实现
- Android应用程序图标大小说明
- 批处理解决Ant自动下载CVS项目并打包
- 获取DataRow[]的值
- ios--OpenCV--标记姿态的模拟
- 截图工具类【】待修改
- performSelector调用方法和直接self 调用方法的区别
- IOS的NSUserDefaults和 android 的SharedPreference
- mysql中的coalesce用法
- 检查网站中没用到的css
- 如何强制关闭Tomcat,同时杀死进程