build.xml实例:清目录、编译java、编译scala、打包

<?xml version="1.0" encoding="utf-8"?>

<project basedir="src" default="build">

<property name="web.dir" value="big"/>
<property name="src.dir" value="${basedir}/main/scala"/>
<property name="srcjava.dir" value="${basedir}/main/java"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="build.dir" value="${web.dir}/classes"/>
<property name="temp.dir" value="${web.dir}/temp"/>

<path id="build.classpath">
<fileset dir="${lib.dir}/repository">
<include name="**/*.jar"/>
</fileset>
</path>
<taskdef resource="scala/tools/ant/antlib.xml" classpathref="build.classpath" />
<target name="compile" >
<mkdir dir="${build.dir}" />
<javac destdir="${build.dir}" source="1.7" target="1.7" debug="true"
encoding="utf-8" deprecation="false" optimize="false" failonerror="true" includeantruntime="false">
<src path="${srcjava.dir}" />
<classpath refid="build.classpath"/>
</javac>
<scalac srcdir="${src.dir}"
destdir="${build.dir}"
classpathref="build.classpath" scalacdebugging="true" >
<include name="**/*.scala" />
</scalac>
</target>

<target name="build" depends="compile" >
<jar jarfile="${web.dir}/scala.jar" basedir="${build.dir}">
</jar>
</target>

</project>

posted @ 2018-04-20 11:21  君临裙下  阅读(244)  评论(0编辑  收藏  举报