build.properties
delete.dir=d\:\\Resources\\SSH完成项目\\crm_grails
build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="ant" default="dist" basedir=".">
<description>
simple ant build file
</description>
<!-- set global properties for this build -->
<property file="build.properties"></property>
<property name="src" location="src"></property>
<property name="build" location="build"></property>
<property name="dist" location="dist"></property>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure by compile -->
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="init" description="compile the source">
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}"></javac>
</target>
<target name="dist" depends="compile" description="generate the distribution">
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
<!-- Put everything in ${build} into the ant -${DSTAMP}.jar file -->
<jar jarfile="${dist}/lib/ant-${DSTAMP}.jar" basedir="${build}">
<manifest>
<attribute name="Built-By" value="RayooTech"/>
<attribute name="Main-Class" value="cn.ant.test.TestOut"/>
</manifest>
</jar>
</target>
<target name="clean" description="clean up">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<target name="javadoc" description="generate the javadoc">
<mkdir dir="docs/api"/>
<javadoc packagenames="cn.ant.*"
sourcepath="src"
excludepackagenames="cn.ant.other.*"
defaultexcludes="yes"
destdir="docs/api"
author="true"
version="true"
use="true"
windowtitle="RayooTech API">
<doctitle><![CDATA[<h1>Ant_Test</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2011 Ant_Test. All Rights Reserved.</i>]]></bottom>
<tag name="todo" scope="all" description="To do:"/>
<group title="Group 1 Packages" packages="cn.ant.test.Test1*"/>
<group title="Group 2 Packages" packages="cn.ant.test2.Test3*"/>
<link offline="true" href="http://rayoo.iteye.com" packagelistLoc="C:\tmp"/>
<link href="http://blog.163.com/rayoo_tech"/>
</javadoc>
</target>
<target name="copy" description="copy task">
<mkdir dir="${dist}/docs"/>
<copy toDir="${dist}/docs">
<fileset dir="docs">
<include name="**/*.html"/>
</fileset>
<filterset begintoken="%" endtoken="*">
<filtersfile file="${user.dir}/dist.properties"/>
</filterset>
</copy>
</target>
<target name="initdb" description="initialize the mysql db">
<sql
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/test"
userid="root"
password="root"
src="data.sql" >
<classpath>
<pathelement location="lib/mysql-connector-java-5.1.3-rc-bin.jar"/>
</classpath>
</sql>
</target>
<target name="delsvn" description="delete the svn files in the project">
<delete includeemptydirs="true">
<fileset dir="${delete.dir}" includes="**/.svn/**" defaultexcludes="false"/>
</delete>
</target>
</project>
其它build.xml见附件:
分享到:
相关推荐
15.2. Importing XML Configuration 16. Auto-configuration 16.1. Gradually Replacing Auto-configuration 16.2. Disabling Specific Auto-configuration Classes 17. Spring Beans and Dependency Injection 18. ...
在“build.xml”文件中,会包含编译、打包、测试等步骤的指令,其中包括了如何使用JMeter的结果XML文件生成HTML报告的配置。 Jenkins则是一个持续集成服务器,它可以自动化各种任务,包括构建、测试和部署软件。在...