`
famoushz
  • 浏览: 2983878 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

using svnant to implement daily build

阅读更多

实现好的项目程序 ,需要做好:代码管理、命名规范、单元测试、集成测试等,但是如果能把所有这些都集成在一起,在每天晚上空闲时间编译整个项目,查找其中的bug,比再最后集成好多了,这就是我理解的daily build。

        在eclipse中可以结合svnant+husdon实现daily build。

        先把svnant的三个重要的jar包放到ant目录下,这三个包为svnant.jar、svnjavahl.jar、 svnClientAdapter.jar;同时在项目中引用这三个jar file;另外在eclipse 的ant 下面也需要引用,具体的做法 为:eclipse->windows->perferences->ant->runtime->classpath->ant home entries 添加svnant 的jars,并在task中添加svnant.jar的org.tigris.subversion.svnant.SvnTask 类,命名为svn。

         上面将svnant集成到eclipse中了,在build.xml中即可以添加svn的任务,但必须在build.xml中添加一个taskdef,有两种做法:

          1.  <taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask"/>
This requires the lib directory to be included with either “ant -lib lib” or by adding an extra parameter:
<taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/>

project.classpath 定义为:

<path id="project.classpath">
    <fileset dir="lib">
        <include name="**/*.jar"/>
      </fileset>
  </path>
    2.<taskdef resource="svntask.properties" classpathref="project.classpath"/>
这个方法简单些。
    后面就可以添加svn的各种任务了,包括checkout,update,add,commit等等,具体如:
<project name="WordPress" default="update" basedir=".">
  <path id="project.classpath">
    <fileset dir="lib">
        <include name="**/*.jar"/>
      </fileset>
  </path>
  <taskdef resource="svntask.properties" classpathref="project.classpath"/>
  <target name="update" description="Update WordPress from Subversion Repository" >
  <svn>
     <checkout url="http://svn.automattic.com/wordpress/trunk/" destPath="src" />
  </svn>
 </target>
</project>
详细可以参考:http://blog.taragana.com/index.php/archive/how-to-integrate-subversion-version-control-software-with-apache-ant/

分享到:
评论

相关推荐

    Test-Driven iOS Development with Swift

    Learn how to incorporate all of the principles of test-driven development (TDD) in to your daily programming workflow Book Description Test-driven iOS Development with Swift will help you understand...

    Pro Spark Streaming,The Zen of Real-time Analytics using Apache Spark

    On the Spark Streaming front, two major features have been added: mapWithState to maintain state across batches and using back pressure to throttle the input rate in case of queue buildup.2 In ...

    Learning C++ Functional Programming

    The second module explains how to efficiently implement C++ features such as pure functions and immutable states to build robust applications. The last module describes how to achieve concurrency and...

    D3.js 4.x Data Visualization - Third Edition

    Want to get started with impressive interactive visualizations and implement them in your daily tasks? This book offers the perfect solution-D3.js. It has emerged as the most popular tool for data ...

    hands on machine learning on google cloud platform

    Machine Learning on Google Cloud Platform: A hands-on guide to implementing smart and efficient analytics using Cloud ML engine Unleash Google's Cloud Platform to build, train and optimize machine ...

    C# Programming Cookbook [EPUB+MOBI+PDF]

    At the end of the book, we will show you how to create secure and robust code, and will help you ramp up your skills when using the new version of C# 6 and Visual Studio What You Will Learn Write ...

    a project model for the FreeBSD Project.7z

    Ports is the collection of meta-data that is needed to make software packages build correctly on FreeBSD. An example of a port is the port for the web-browser Mozilla. It contains information about ...

Global site tag (gtag.js) - Google Analytics