<?xmlversion="1.0"encoding="UTF-8"?>
<projectname="genwar"default="all"basedir=".">
<description>-Generatewarfile-</description>
<propertyenvironment="env"/>
<propertyname="debuglevel"value="source,lines,vars"/>
<propertyname="target"value="1.6"/>
<propertyname="source"value="1.6"/>
<propertyname="output.dir"location="."/>
<propertyname="output.file"value="new_cos.war"/>
<propertyname="project.build"location="./build"/>
<propertyname="project.src"location="./src"/>
<propertyname="project.web"location="../web"/>
<propertyname="project.lib"location="./lib"/>
<propertyname="project.res"location="./res"/>
<propertyname="project.svc"location="./svc"/>
<propertyname="project.war"location="${project.build}/${output.file}"/>
<propertyname="tmp"location="${project.build}/tmp"/>
<propertyname="tmp.src"location="${tmp}/src"/>
<propertyname="tmp.lib"location="${project.web}/WEB-INF/lib"/>
<propertyname="tmp.bin"location="${tmp}/bin"/>
<propertyname="tmp.web"location="${tmp}/web"/>
<propertyname="tmp.classes"location="${tmp}/classes"/>
<propertyname="checkstyle.dir"location="./ant-task/checkstyle"/>
<propertyname="findbugs.dir"location="./ant-task/findbugs/home"/>
<propertyname="findbugs.report.dir"location="./ant-task/findbugs"/>
<propertyname="junit.reports.dir"value="./ant-task/junit/reports"/>
<propertyname="junit.class.dir"value="./ant-task/junit/bin"/>
<propertyname="junit.test.src"location="./test/java"/>
<propertyname="junit.test.resources"location="./test/resources"/>
<pathid="javaclass.path">
<pathelementpath="${env.classpath}"/>
<pathelementpath="${env.JBOSS_HOME}/server/all/lib/servlet-api.jar"/>
<pathelementpath="${env.JBOSS_HOME}/server/all/lib/jsp-api.jar"/>
<filesetdir="${tmp.lib}"includes="*.jar"/>
<!--<filesetdir="${project.lib}"includes="*.jar"/>-->
</path>
<pathid="findbugs.path">
<filesetdir="${findbugs.dir}"includes="**/*.jar"/>
</path>
<targetname="clean">
<deletefile="${output.dir}/${output.file}"failonerror="false"/>
<deletedir="${project.build}"failonerror="false"/>
<mkdirdir="${project.build}"/>
</target>
<targetname="all"depends="clean,buildwar"/>
<targetname="initdir">
<echomessage="Initdirectories
"/>
<deletedir="${tmp}"failonerror="false"/>
<mkdirdir="${tmp}"/>
<mkdirdir="${tmp.src}"/>
<copytodir="${tmp.src}">
<filesetdir="${project.src}"excludes="**/.svn/**"/>
</copy>
<mkdirdir="${tmp.lib}"/>
<!--
<copytodir="${tmp.lib}">
<filesetdir="${project.web}/WEB-INF/lib"includes="*.jar"/>
</copy>
-->
<mkdirdir="${tmp.bin}"/>
<mkdirdir="${tmp.web}/WEB-INF/lib"/>
<deletedir="${tmp.web}/WEB-INF/classes"failonerror="false"/>
<mkdirdir="${tmp.web}/WEB-INF/classes"/>
</target>
<targetname="compilejava"depends="initdir">
<echomessage="Compilingjavacode
"/>
<javacdebug="true"debuglevel="${debuglevel}"destdir="${tmp.bin}"source="${source}"target="${target}"encoding="UTF-8">
<srcpath="${tmp.src}"/>
<classpathrefid="javaclass.path"/>
</javac>
<copytodir="${tmp.web}/WEB-INF/classes"includeemptydirs="false">
<filesetdir="${tmp.src}">
<excludename="**/*.java"/>
</fileset>
</copy>
<copytodir="${tmp.web}/WEB-INF/classes"includeemptydirs="false">
<filesetdir="${tmp.bin}">
<includename="**/*.class"/>
</fileset>
</copy>
</target>
<targetname="compilejava-without-copy"depends="initdir">
<echomessage="Compilingjavacode
"/>
<javacdebug="true"debuglevel="${debuglevel}"destdir="${tmp.bin}"source="${source}"target="${target}"encoding="UTF-8">
<srcpath="${tmp.src}"/>
<classpathrefid="javaclass.path"/>
</javac>
</target>
<targetname="buildwar"depends="compilejava">
<echomessage="Packingwarfile
"/>
<copytodir="${tmp.web}">
<filesetdir="${project.web}"excludes="**/.svn/**"/>
</copy>
<deletefile="${project.war}"failonerror="false"/>
<wardestfile="${project.war}"basedir="${tmp.web}"webxml="${tmp.web}/WEB-INF/web.xml"encoding="utf-8"/>
<deletedir="${tmp}"failonerror="false"/>
<deletefile="${output.dir}/${output.file}"failonerror="false"/>
<movetodir="${output.dir}"includeemptydirs="false"filtering="true">
<filesetdir="${project.build}">
<includename="**/*.war"/>
</fileset>
</move>
<deletedir="${project.build}"failonerror="false"/>
</target>
<taskdefresource="checkstyletask.properties"
classpath="${checkstyle.dir}/checkstyle-5.5-all.jar"/>
<targetname="checkstyle"
description="Generatesareportofcodeconventionviolations.">
<checkstyleconfig="${checkstyle.dir}/my_check.xml"
failureProperty="checkstyle.failure"failOnViolation="false">
<formattertype="xml"tofile="${checkstyle.dir}/checkstyle_report.xml"/>
<filesetdir="${project.src}"includes="**/*.java"/>
</checkstyle>
<!--stylein="checkstyle_report.xml"out="checkstyle_report.html"
style="checkstyle.xsl"/-->
</target>
<taskdefname="findbugs"classname="edu.umd.cs.findbugs.anttask.FindBugsTask"
classpathref="findbugs.path"/>
<targetname="findbugs"depends="compilejava-without-copy"
description="用Findbugs检查代码错误.">
<echo>开始用Findbugs检查代码错误
</echo>
<findbugshome="${findbugs.dir}"output="xml"
outputFile="${findbugs.report.dir}/findbugs_report.xml">
<auxClasspath>
<pathrefid="junit.test.lib.path"/>
</auxClasspath>
<!--auxClasspathpath="${basedir}/lib/Regex.jar"/-->
<sourcePathpath="${tmp.src}"/>
<classlocation="${tmp.bin}"/>
</findbugs>
<echo>Findbugs检查代码错误完成
</echo>
<deletedir="${project.build}"failonerror="false"/>
</target>
<targetname="junit-init">
<deletedir="${junit.class.dir}"failonerror="false"/>
<mkdirdir="${junit.class.dir}"/>
<deletedir="${junit.reports.dir}/result-xml"failonerror="false"/>
<mkdirdir="${junit.reports.dir}/result-xml"/>
<deletedir="${junit.reports.dir}/html"failonerror="false"/>
<mkdirdir="${junit.reports.dir}/html"/>
<deletedir="${junit.reports.dir}/html-result"failonerror="false"/>
<mkdirdir="${junit.reports.dir}/html-result"/>
</target>
<targetname="junit-compile"depends="junit-init">
<echomessage="${project.web}/WEB-INF/lib"/>
<javacsrcdir="${project.src}"destdir="${junit.class.dir}"source="${source}"target="${target}"encoding="UTF-8">
<classpathrefid="junit.test.lib.path"/>
</javac>
<javacsrcdir="${junit.test.src}"destdir="${junit.class.dir}"source="${source}"target="${target}"encoding="UTF-8">
<classpathrefid="junit.test.lib.path"/>
</javac>
<copytodir="${junit.class.dir}">
<filesetdir="${junit.test.resources}">
<includename="**/*.xml"/>
</fileset>
</copy>
<copytodir="${junit.class.dir}">
<filesetdir="${project.src}">
<includename="**/*.xml"/>
</fileset>
</copy>
</target>
<pathid="junit.test.lib.path">
<pathelementpath="${env.JBOSS_HOME}/server/all/lib/servlet-api.jar"/>
<pathelementpath="${env.JBOSS_HOME}/server/all/lib/jsp-api.jar"/>
<pathelementpath="${env.JBOSS_HOME}/server/all/lib/jboss-j2ee.jar"/>
<filesetdir="${project.web}/WEB-INF/lib"includes="**/*.jar"/>
<filesetdir="${project.lib}"includes="**/*.jar"/>
</path>
<targetname="junit-test"depends="junit-compile">
<junitprintsummary="yes">
<classpath>
<!--指定lib和class路径,class和jar的声明不能混在一起-->
<pathelementlocation="${junit.class.dir}"/>
<pathrefid="junit.test.lib.path"/>
</classpath>
<batchtesttodir="${junit.reports.dir}/result-xml">
<filesetdir="${junit.test.src}"includes="**/*TestCase.java"/>
<formattertype="xml"/>
</batchtest>
</junit>
<junitreporttodir="${junit.reports.dir}/html-result">
<!--指定测试结果的XML,即上一步产生的XML-->
<filesetdir="${junit.reports.dir}/result-xml">
<includename="TEST-*.xml"/>
</fileset>
<!--根据测试结果XML,生成TESTS-TestSuites.xml,并由此产生HTML文件-->
<reportformat="frames"todir="${junit.reports.dir}/html"/>
<!--
-->
</junitreport>
</target>
</project>
<projectname="genwar"default="all"basedir=".">
<description>-Generatewarfile-</description>
<propertyenvironment="env"/>
<propertyname="debuglevel"value="source,lines,vars"/>
<propertyname="target"value="1.6"/>
<propertyname="source"value="1.6"/>
<propertyname="output.dir"location="."/>
<propertyname="output.file"value="new_cos.war"/>
<propertyname="project.build"location="./build"/>
<propertyname="project.src"location="./src"/>
<propertyname="project.web"location="../web"/>
<propertyname="project.lib"location="./lib"/>
<propertyname="project.res"location="./res"/>
<propertyname="project.svc"location="./svc"/>
<propertyname="project.war"location="${project.build}/${output.file}"/>
<propertyname="tmp"location="${project.build}/tmp"/>
<propertyname="tmp.src"location="${tmp}/src"/>
<propertyname="tmp.lib"location="${project.web}/WEB-INF/lib"/>
<propertyname="tmp.bin"location="${tmp}/bin"/>
<propertyname="tmp.web"location="${tmp}/web"/>
<propertyname="tmp.classes"location="${tmp}/classes"/>
<propertyname="checkstyle.dir"location="./ant-task/checkstyle"/>
<propertyname="findbugs.dir"location="./ant-task/findbugs/home"/>
<propertyname="findbugs.report.dir"location="./ant-task/findbugs"/>
<propertyname="junit.reports.dir"value="./ant-task/junit/reports"/>
<propertyname="junit.class.dir"value="./ant-task/junit/bin"/>
<propertyname="junit.test.src"location="./test/java"/>
<propertyname="junit.test.resources"location="./test/resources"/>
<pathid="javaclass.path">
<pathelementpath="${env.classpath}"/>
<pathelementpath="${env.JBOSS_HOME}/server/all/lib/servlet-api.jar"/>
<pathelementpath="${env.JBOSS_HOME}/server/all/lib/jsp-api.jar"/>
<filesetdir="${tmp.lib}"includes="*.jar"/>
<!--<filesetdir="${project.lib}"includes="*.jar"/>-->
</path>
<pathid="findbugs.path">
<filesetdir="${findbugs.dir}"includes="**/*.jar"/>
</path>
<targetname="clean">
<deletefile="${output.dir}/${output.file}"failonerror="false"/>
<deletedir="${project.build}"failonerror="false"/>
<mkdirdir="${project.build}"/>
</target>
<targetname="all"depends="clean,buildwar"/>
<targetname="initdir">
<echomessage="Initdirectories

<deletedir="${tmp}"failonerror="false"/>
<mkdirdir="${tmp}"/>
<mkdirdir="${tmp.src}"/>
<copytodir="${tmp.src}">
<filesetdir="${project.src}"excludes="**/.svn/**"/>
</copy>
<mkdirdir="${tmp.lib}"/>
<!--
<copytodir="${tmp.lib}">
<filesetdir="${project.web}/WEB-INF/lib"includes="*.jar"/>
</copy>
-->
<mkdirdir="${tmp.bin}"/>
<mkdirdir="${tmp.web}/WEB-INF/lib"/>
<deletedir="${tmp.web}/WEB-INF/classes"failonerror="false"/>
<mkdirdir="${tmp.web}/WEB-INF/classes"/>
</target>
<targetname="compilejava"depends="initdir">
<echomessage="Compilingjavacode

<javacdebug="true"debuglevel="${debuglevel}"destdir="${tmp.bin}"source="${source}"target="${target}"encoding="UTF-8">
<srcpath="${tmp.src}"/>
<classpathrefid="javaclass.path"/>
</javac>
<copytodir="${tmp.web}/WEB-INF/classes"includeemptydirs="false">
<filesetdir="${tmp.src}">
<excludename="**/*.java"/>
</fileset>
</copy>
<copytodir="${tmp.web}/WEB-INF/classes"includeemptydirs="false">
<filesetdir="${tmp.bin}">
<includename="**/*.class"/>
</fileset>
</copy>
</target>
<targetname="compilejava-without-copy"depends="initdir">
<echomessage="Compilingjavacode

<javacdebug="true"debuglevel="${debuglevel}"destdir="${tmp.bin}"source="${source}"target="${target}"encoding="UTF-8">
<srcpath="${tmp.src}"/>
<classpathrefid="javaclass.path"/>
</javac>
</target>
<targetname="buildwar"depends="compilejava">
<echomessage="Packingwarfile

<copytodir="${tmp.web}">
<filesetdir="${project.web}"excludes="**/.svn/**"/>
</copy>
<deletefile="${project.war}"failonerror="false"/>
<wardestfile="${project.war}"basedir="${tmp.web}"webxml="${tmp.web}/WEB-INF/web.xml"encoding="utf-8"/>
<deletedir="${tmp}"failonerror="false"/>
<deletefile="${output.dir}/${output.file}"failonerror="false"/>
<movetodir="${output.dir}"includeemptydirs="false"filtering="true">
<filesetdir="${project.build}">
<includename="**/*.war"/>
</fileset>
</move>
<deletedir="${project.build}"failonerror="false"/>
</target>
<taskdefresource="checkstyletask.properties"
classpath="${checkstyle.dir}/checkstyle-5.5-all.jar"/>
<targetname="checkstyle"
description="Generatesareportofcodeconventionviolations.">
<checkstyleconfig="${checkstyle.dir}/my_check.xml"
failureProperty="checkstyle.failure"failOnViolation="false">
<formattertype="xml"tofile="${checkstyle.dir}/checkstyle_report.xml"/>
<filesetdir="${project.src}"includes="**/*.java"/>
</checkstyle>
<!--stylein="checkstyle_report.xml"out="checkstyle_report.html"
style="checkstyle.xsl"/-->
</target>
<taskdefname="findbugs"classname="edu.umd.cs.findbugs.anttask.FindBugsTask"
classpathref="findbugs.path"/>
<targetname="findbugs"depends="compilejava-without-copy"
description="用Findbugs检查代码错误.">
<echo>开始用Findbugs检查代码错误


<findbugshome="${findbugs.dir}"output="xml"
outputFile="${findbugs.report.dir}/findbugs_report.xml">
<auxClasspath>
<pathrefid="junit.test.lib.path"/>
</auxClasspath>
<!--auxClasspathpath="${basedir}/lib/Regex.jar"/-->
<sourcePathpath="${tmp.src}"/>
<classlocation="${tmp.bin}"/>
</findbugs>
<echo>Findbugs检查代码错误完成


<deletedir="${project.build}"failonerror="false"/>
</target>
<targetname="junit-init">
<deletedir="${junit.class.dir}"failonerror="false"/>
<mkdirdir="${junit.class.dir}"/>
<deletedir="${junit.reports.dir}/result-xml"failonerror="false"/>
<mkdirdir="${junit.reports.dir}/result-xml"/>
<deletedir="${junit.reports.dir}/html"failonerror="false"/>
<mkdirdir="${junit.reports.dir}/html"/>
<deletedir="${junit.reports.dir}/html-result"failonerror="false"/>
<mkdirdir="${junit.reports.dir}/html-result"/>
</target>
<targetname="junit-compile"depends="junit-init">
<echomessage="${project.web}/WEB-INF/lib"/>
<javacsrcdir="${project.src}"destdir="${junit.class.dir}"source="${source}"target="${target}"encoding="UTF-8">
<classpathrefid="junit.test.lib.path"/>
</javac>
<javacsrcdir="${junit.test.src}"destdir="${junit.class.dir}"source="${source}"target="${target}"encoding="UTF-8">
<classpathrefid="junit.test.lib.path"/>
</javac>
<copytodir="${junit.class.dir}">
<filesetdir="${junit.test.resources}">
<includename="**/*.xml"/>
</fileset>
</copy>
<copytodir="${junit.class.dir}">
<filesetdir="${project.src}">
<includename="**/*.xml"/>
</fileset>
</copy>
</target>
<pathid="junit.test.lib.path">
<pathelementpath="${env.JBOSS_HOME}/server/all/lib/servlet-api.jar"/>
<pathelementpath="${env.JBOSS_HOME}/server/all/lib/jsp-api.jar"/>
<pathelementpath="${env.JBOSS_HOME}/server/all/lib/jboss-j2ee.jar"/>
<filesetdir="${project.web}/WEB-INF/lib"includes="**/*.jar"/>
<filesetdir="${project.lib}"includes="**/*.jar"/>
</path>
<targetname="junit-test"depends="junit-compile">
<junitprintsummary="yes">
<classpath>
<!--指定lib和class路径,class和jar的声明不能混在一起-->
<pathelementlocation="${junit.class.dir}"/>
<pathrefid="junit.test.lib.path"/>
</classpath>
<batchtesttodir="${junit.reports.dir}/result-xml">
<filesetdir="${junit.test.src}"includes="**/*TestCase.java"/>
<formattertype="xml"/>
</batchtest>
</junit>
<junitreporttodir="${junit.reports.dir}/html-result">
<!--指定测试结果的XML,即上一步产生的XML-->
<filesetdir="${junit.reports.dir}/result-xml">
<includename="TEST-*.xml"/>
</fileset>
<!--根据测试结果XML,生成TESTS-TestSuites.xml,并由此产生HTML文件-->
<reportformat="frames"todir="${junit.reports.dir}/html"/>
<!--
-->
</junitreport>
</target>
</project>