ant 几个有用的用法

import:
<import file="properties.xml" />


mkdir:
<mkdir dir="${build.dir}" />


javac:

<!-- javac -->
<property name="compile.debug" value="true" />
<property name="compile.deprecation" value="true" />
<property name="compile.optimize" value="true" />

<target name="compile-java"
depends="prepare"
description="Compile main code">

<tstamp>
<format property="class.tstamp" pattern="MM/dd/yyyy kk:mm:ss" />
</tstamp>

<javac srcdir="${src.java}"
destdir="${build.classes}"
classpathref="project.classpath"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}"
target="${src.level}"
source="${src.level}"
encoding="${src.encoding}">
<!--compilerarg value="-Xlint:unchecked"/-->
</javac>
</target>



native2asc:

<target name="native2asc" description="Convert resources file">
<native2ascii encoding="${resources.encoding}"
src="${src.etc}"
dest="${src.etc}"
includes="**/*.draft"
ext=".properties" />

<copy todir="${src.java}">
<fileset dir="${src.etc}">
<include name="*.properties" />
</fileset>
</copy>

<copy todir="${src.test}">
<fileset dir="${src.etc}">
<include name="*.properties" />
</fileset>
</copy>
</target>



schema:

<target name="schema-export"
depends="compile-java"
description="Schema Export">
<echo message="Exporting schema..." />

<hibernatetool destdir="${src.etc}">
<classpath path="${build.classes}" />
<annotationconfiguration configurationfile="${src.java}/hibernate.cfg.xml" />
<hbm2ddl export="false" drop="true" outputfilename="schema.sql" />
</hibernatetool>
</target>



SQL:

<path id="project.classpath">
<fileset dir="${lib.dir}" includes="**/*.jar" />
<fileset dir="${weblib.dir}" includes="**/*.jar" />
</path>

<target name="create-init-data"
depends="schema-export"
description="Create Initial Data">
<echo message="Creating initial data..." />

<sql driver="${database.driverClass}"
url="${database.url}"
userid="${database.username}"
password="${database.password}"
onerror="continue">

<classpath>
<path refid="project.classpath" />
</classpath>

<transaction src="${src.etc}/schema.sql" />
<transaction src="${src.etc}/initUserData.sql" />
<transaction src="${src.etc}/initData.sql" />
<transaction src="${src.etc}/initSendBookSortData.sql" />
</sql>
</target>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值