qileilove

blog已经转移至github,大家请访问 http://qaseven.github.io/

Ant编译时遇到的问题记录

 1. 需要使用svnant,从SVN中获取源码
  需要使用的扩展包:svnant-1.3.1.zip里所有的jar
  下载地址:http://subclipse.tigris.org/files/documents/906/49042/svnant-1.3.1.zip
  build.xml中的写法
<!--定义SVN地址-->
<property name="svnurl" value="http://xx/svn/projectName"/>
<!-- -->
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" />
<!--定义访问SVN的账号和密码-->
<svnSetting id="svn.setting" svnkit="true" username="username" password="password"  javahl="false" />
<!--检出代码到${project.dir}变量定义的目录下-->
<target name="export">
<delete dir="${project.dir}" />
<mkdir dir="${project.dir}" />
<svn refid="svn.setting">
<export srcUrl="${svnurl}" destPath="${project.dir}" force="true"/>
</svn>
</target>
  2.foreach循环需要使用ant-contrib-1.0b3.jar
  下载地址请百度
  build.xml中的写法
  <target name="loop" >
  <foreach list="src" target="all" param="src_loop" delimiter=","></foreach>
  </target>
  3. yguard代码混淆
  具体介绍参见:http://blog.csdn.net/vrix/article/details/7604636
  官网下载地址:http://www.yworks.com/en/downloads.html
  build.xml中的写法
<taskdef name="yguard" classname="com.yworks.yguard.YGuardTask"/>
<yguard>
<inoutpair in="${输入.jar}" out="${输出.jar}"/>
<shrink logfile="${build.dir}/shrink.xml">
<keep>
<class classes="friendly" methods="private" fields="friendly"/>
<field name="serialVersionUID"/>
</keep>
</shrink>
</yguard>
  4.执行脚本操作
  启动tomcat在build.xml中的写法
linux
<target name="start" >
<echo>start tomcat</echo>
<exec executable = "${tomcat.dir}/bin/startup.sh" />
</target>
windows
<target name="stop" >
<echo>stop tomcat</echo>
<exec executable="cmd" dir="${tomcat.dir}/bin" failonerror="false"  append="true">
<env key="CATALINA_HOME" path="${tomcat.dir}"/>
<arg value="/c startup.bat" />
</exec>
</target>

posted on 2014-07-07 21:28 顺其自然EVO 阅读(181) 评论(0)  编辑  收藏 所属分类: 测试学习专栏


只有注册用户登录后才能发表评论。


网站导航:
 
<2014年7月>
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

导航

统计

常用链接

留言簿(55)

随笔分类

随笔档案

文章分类

文章档案

搜索

最新评论

阅读排行榜

评论排行榜