Ant 知识

 

<?xml version="1.0" encoding="Shift_JIS"?>

 

<project name="SWEC-DEVELOP" default="lw" basedir=".">

 

 

<property name="common" value="/SWECTool/ICF_AutoCapsule_disabled/develop"/>

<property name="lib" value="/SWECTool/ICF_AutoCapsule_disabled/exec/lib"/>

<property name="src" value="${common}/source"/>

<property name="build" value="${common}/classes"/>

<property name="war" value="${common}/webapps"/>

<property name="doc" value="${common}/doc"/>

 

 

<property name="coverage" value="${common}/coverage/classes"/>

 

<property name="line" value="${common}/coverage/line"/>

 

<property name="tracePath" value="${common}/coverage/trace"/>

 

<property name="profile" value="${common}/coverage/profile"/>

 

<property name="jcoverage" value="${common}/coverage/bin/JCoverage.exe"/>

 

<property name="jprofile"  value="${common}/coverage/bin/JProfile.exe"/>

 

<path id="Third-Part Lib">

            <fileset dir="${lib}">

                  <include name="**/*.jar" />

            </fileset>

      </path>

 

 

<taskdef name="coverage" classname="jp.co.nec.necst.swe.tools.anttask.jcoverage.JCoverageTask"/>

 

 

<target name="init">

</target>

 

<!-- コンパイル -->

<target name="compile" depends="init">

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

<javac 

srcdir="${src}" 

destdir="${build}"

debug="yes" 

encoding="MS932"

>

<patternset>

<include name="**/*.java"/>

</patternset>

<classpath refid="Third-Part Lib"/> 

</javac>

</target>

 

 

<target name="lw" depends="compile,coverage">

<mkdir dir="${war}/LWDefault/WEB-INF/classes"/>

<copy preservelastmodified="yes" todir="${war}/LWDefault/WEB-INF/classes">

<fileset dir="${coverage}">

<patternset>

<include name="**/*.class"/>

</patternset>

</fileset>

</copy>

<copy preservelastmodified="yes" todir="${war}/LWDefault/WEB-INF/classes">

<fileset dir="${build}">

<patternset>

<include name="**/*.class"/>

</patternset>

</fileset>

</copy>

<touch file="${war}/LWDefault/WEB-INF/jrun-web.xml"/>

</target>

 

<property name="findbugs" value="${common}/build/findbugs/bin/findbugs.bat"/>

        <property name="auxclasspath" value="${common}/classes;${java.class.path}"/>

<property name="fblog" value="${common}/logs/fblog"/>

<property name="DAOconfigfile" value="${common}/build/findbugs/config/configfile.xml"/>

 

<target name="findbugs" depends="compile">

<mkdir dir="${fblog}"/>

<apply executable="${common}/bin/JCommandBase" parallel="false">

<arg line="${findbugs} -jcbdpd ${fblog} -jcbcls ${build} -jcbsrc ${src} -jcbout ${fblog}/%FILENAME%.html -html -textui -maxHeap 512 -effort:max -onlyAnalyze %CLASSNAME% -low -configfile ${DAOconfigfile} -auxclasspath &quot;${auxclasspath}&quot; %CLASSFILE% "/>

<fileset dir="${build}">

<patternset>

<include name="**/*.class"/>

</patternset>

</fileset>

</apply>

</target>

 

<target name="coverage" depends="compile">

<coverage command="${jcoverage}" outputPath="${coverage}" linePath="${line}" tracePath="${tracePath}">

<fileset dir="${build}">

<patternset>

<include name="**/*.class"/>

</patternset>

</fileset>

</coverage>

</target>

 

 


<property name="ncmeterlog"  value="${common}/logs/ncmeter"/>

<!-- Ncmeter -->

<target name="ncmeter">

<exec dir="${common}/build/ncmeter/bin" executable="${common}/build/ncmeter/bin/ncmeter.bat" spawn="false">

<env key="src"         path="${src}"/>

<env key="des_size"    path="${ncmeterlog}/ncmeter_size.csv"/>

<env key="des_struct"  path="${ncmeterlog}/ncmeter_struct.csv"/>

</exec>

</target>

 

<target name="clean">

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

<delete>

<fileset dir="${build}" includes="**/*"/>

</delete>

<delete>

<fileset dir="${coverage}" includes="**/*"/>

</delete>

<delete>

<fileset dir="${tracePath}" includes="**/*"/>

</delete>

<mkdir dir="${war}/LWDefault/WEB-INF/classes"/>

<delete>

<fileset dir="${war}/LWDefault/WEB-INF/classes" includes="**/*"/>

</delete>

<delete>

<fileset dir="${ncmeterlog}" includes="**/*"/>

</delete>

<delete>

<fileset dir="${fblog}" includes="**/*"/>

</delete>

</target>

 

</project>


你可能感兴趣的:(ant)