ant compile任务(javac)

<target name="compile" description="Compile main source tree java files">
           <!--compile source code-->
        
<mkdir dir="${build.dir}/classes"/>
        
<javac destdir="${build.dir}/classes" target="1.4" debug="true"
            deprecation
="false" optimize="false" failonerror="true">
            
<src path="${src.dir}"/>
            
<classpath refid="classpath"/>
        
</javac>
        
<!-- compile tests -->
        
<mkdir dir="${test.dir}/classes"/>
        
<javac destdir="${test.dir}/classes" target="1.4" debug="true"
            deprecation
="false" optimize="false" failonerror="true">
            
<src path="${test.src}"/>
            
<classpath>
                
<path refid="classpath"/>
                
<path location="${build.dir}/classes"/>
            
</classpath>
        
</javac>
        
<!-- Copy hibernate mapping files to ${build.dir}/classes -->
        
<copy todir="${build.dir}/classes">
            
<fileset dir="${src.dir}" includes="**/*.hbm.xml"/>
        
</copy>
    
</target>
posted on 2007-05-28 16:36  灵风  阅读(4496)  评论(0编辑  收藏  举报