楼主,可否讲一下,CVSNT是用来干什么的?

解决方案 »

  1.   

    不知道,cvs有windows下的服务器版本吗?一般都是unix服务器
    我只见过windows下的客户端版本。至于ant操作cvs,没有用过,应该不难吧,不就是用命令行嘛。
    我们都是手动操作cvs,不可能动不动就连接cvs吧?一天一次应该就差不多了,有必要用ant吗?又不是编译部署那么频繁!
      

  2.   

    windows有cvs,是GUN的wincvs,我用过,但不怎么用得来.ant是靠build.xml管理的,这个你得查ant的API文档,ant功能很大
      

  3.   

    1. 安装cvsnt2. 打开“控制面板”,打开“CVS for NT”3. 切换到"Repositories", 点"Add",选一个硬盘上的目录作为cvsroot4. 打开"服务",重启"CVS for NT"服务
    Ant支持cvs操作,在Ant的文档里有详细说明:Cvs
    Description
    Handles packages/modules retrieved from a CVS repository.When doing automated builds, the get task should be preferred over the checkout command, because of speed.Important: This task needs "cvs" on the path. If it isn't, you will get an error (such as error 2 on windows). If <cvs> doesn't work, try to execute cvs.exe from the command line in the target directory in which you are working. Parameters
    Attribute Description Required 
    command the CVS command to execute. No, default "checkout". 
    compression true or false - if set to true, this is the same as compressionlevel="3" No. Defaults to false. 
    compressionlevel A number between 1 and 9 (corresponding to possible values for CVS' -z# argument). Any other value is treated as compression="false" No. Defaults to no compression. 
    cvsRoot the CVSROOT variable. No 
    cvsRsh the CVS_RSH variable. No 
    dest the directory where the checked out files should be placed. Note that this is different from CVS's -d command line switch as Ant will never shorten pathnames to avoid empty directories. No, default is project's basedir. 
    package the package/module to check out. No 
    tag the tag of the package/module to check out. No 
    date Use the most recent revision no later than the given date No 
    quiet suppress informational messages. This is the same as -q on the command line. No, default "false" 
    reallyquiet suppress all messages. This is the same as -Q on the command line. since Ant 1.6. No, default "false" 
    noexec report only, don't change any files. No, default to "false" 
    output the file to direct standard output from the command. No, default output to ANT Log as MSG_INFO. 
    error the file to direct standard error from the command. No, default error to ANT Log as MSG_WARN. 
    append whether to append output/error when redirecting to a file. No, default to "false". 
    port Port used by CVS to communicate with the server. No, default port 2401. 
    passfile Password file to read passwords from. No, default file ~/.cvspass. 
    failonerror Stop the build process if the command exits with a return code other than 0. Defaults to false No Examples
      <cvs cvsRoot=":pserver:[email protected]:/home/cvspublic"
           package="ant"
           dest="${ws.dir}"
      />
    checks out the package/module "ant" from the CVS repository pointed to by the cvsRoot attribute, and stores the files in "${ws.dir}".  <cvs dest="${ws.dir}" command="update"/>
    updates the package/module that has previously been checked out into "${ws.dir}".  <cvs command="-q diff -u -N" output="patch.txt"/>
    silently (-q) creates a file called patch.txt which contains a unified (-u) diff which includes new files added via "cvs add" (-N) and can be used as input to patch. The equivalent, using <commandline> elements, is: <cvs output="patch">
        <commandline>
            <argument value="-q"/>
            <argument value="diff"/>
            <argument value="-u"/>
            <argument value="-N"/>
        </commandline>
    </cvs>or: 
    <cvs output="patch">
        <commandline>
            <argument line="-q diff -u -N"/>
        </commandline>
    </cvs>You may include as many <commandline> elements as you like. Each will inherit the failonerror, compression, and other "global" parameters from the <cvs> element.   <cvs command="update -A -d"/>
    Updates from the head of repository ignoring sticky bits (-A) and creating any new directories as necessary (-d).Note: the text of the command is passed to cvs "as-is" so any cvs options should appear before the command, and any command options should appear after the command as in the diff example above. See the cvs manual for details, specifically the Guide to CVS commands
      

  4.   

    要把cvsnt的安装目录设置到PATH变量里
      

  5.   

    一小段从自动构建脚本中取出来的,取出源代码并不生成CVS目录。其他命令类似。    <!--
           ========================================================================
           Check out all source from cvs.
           ========================================================================
        -->
        <target name="cvs.checkout" if="cvs.host">
            <delete dir="${java.src.dir}" includeEmptyDirs="true"/>
            <delete dir="${c.src.dir}" includeEmptyDirs="true"/>
            <delete dir="${setup.src.dir}" includeEmptyDirs="true"/>
            <delete dir="${java.lib.dir}" includeEmptyDirs="true"/>
            
            <property name="cvs.root" value=":pserver:${cvs.user}:${cvs.password}@${cvs.host}:${cvs.port}:/${cvs.path}"/>
            <cvs command="export -D 2030-01-01 -d ." cvsRoot="${cvs.root}" package="JavaSource/" dest="${java.src.dir}"/>
            <cvs command="export -D 2030-01-01 -d ." cvsRoot="${cvs.root}" package="CSource/" dest="${c.src.dir}"/>
            <cvs command="export -D 2030-01-01 -d ." cvsRoot="${cvs.root}" package="BuildSource/" dest="${setup.src.dir}"/>
            <cvs command="export -D 2030-01-01 -d ." cvsRoot="${cvs.root}" package="JavaLib/" dest="${java.lib.dir}"/>    </target>