<?xml version="1.0" encoding="utf-8" ?>
<project default="all" basedir=".">
	<property environment="env" />
	<property name="appname" value="virt" />
	<property name="jarname" value="yoyo-virt" />
	<property name="mainclass" value="com.yoyosys.virt.navigation.service.SystemResourceMonitor" />
	<property name="src" value="src" />
	<property name="conf" value="conf" />
	<property name="build" value="${basedir}/build" />
	<property name="build.src" value="${build}/src" />
	<property name="build.class" value="${build}/class" />
	<property name="build.doc" value="${build}/doc" />
	<property name="debug" value="off" />
	<property name="optimize" value="on" />
	<property name="deprecation" value="on" />
	<property name="packages" value="com.yoyosys.virt.*" />
	<path id="classpath">
		<fileset dir="./WebContent/WEB-INF/lib">
			<include name="*.jar" />
		</fileset>
		<fileset dir="./lib">
			<include name="*.jar" />
		</fileset>
	</path>
	<target name="all" depends="init,build,jar" description="make all task." />
	<target name="init" depends="clean">
		<mkdir dir="${build}" />
		<mkdir dir="${build.src}" />
		<mkdir dir="${build.class}" />
		<mkdir dir="${build.doc}" />
		<copy todir="${build.src}">
			<fileset dir="${src}" />
			<fileset dir="${conf}" />
		</copy>
	</target>
	<target name="build" depends="init">
		<javac srcdir="${build.src}" destdir="${build.class}" encoding="UTF-8" debug="${debug}" optimize="${optimize}" deprecation="${deprecation}" includeantruntime="on">
			<include name="com/**/*.java" />
			<classpath refid="classpath" />
		</javac>
		<copy todir="${build.class}">
			<fileset dir="${build.src}">
				<include name="handlers/*" />
				<include name="rdb/*" />
			</fileset>
		</copy>
	</target>
	<target name="javadoc" depends="init">
		<javadoc packagenames="${packages}" sourcepath="${build.src}" destdir="${build.doc}" author="true" version="true" use="true" splitindex="true" windowtitle="${appname} API" doctitle="${appname}" charset="UTF-8" encoding="UTF-8" docencoding="UTF-8">
			<classpath refid="classpath" />
		</javadoc>
	</target>
	<target name="jar" depends="build">
		<pathconvert property="libs.project" pathsep=" ">
			<mapper>
				<chainedmapper>
					<!-- remove absolute path -->
					<flattenmapper />
					<!-- add lib/ prefix -->
					<globmapper from="*" to="lib/*" />
				</chainedmapper>
			</mapper>
			<path refid="classpath" />
		</pathconvert>
		<jar jarfile="${build}/${jarname}.jar" basedir="${build.class}" includes="**">
			<manifest>
				<attribute name="Main-Class" value="${mainclass}" />
				<attribute name="Class-Path" value="${libs.project}" />
			</manifest>
		</jar>
		<jar jarfile="${build}/${jarname}-doc.jar" basedir="${build.doc}" includes="**" />
		<jar jarfile="${build}/${jarname}-src.jar" basedir="${build.src}" includes="**" />
	</target>
	<target name="clean" description="clean up">
		<delete dir="${build}" />
	</target>
	<!-- checkstyle -->
	<property name="checkstyle-5.3.home" value="${env.YOYO_SVN_HOME}/app/java/checkstyle/checkstyle-5.3" />
	<fileset id="checkstyle-5.3.jar" dir="${checkstyle-5.3.home}">
		<include name="checkstyle-5.3-all.jar" />
	</fileset>
	<property name="checkstyle-latest.home" value="${checkstyle-5.3.home}" />
	<fileset id="checkstyle-latest.jar" refid="checkstyle-5.3.jar" />
	<taskdef resource="checkstyletask.properties" classpath="${checkstyle-5.3.home}/checkstyle-5.3-all.jar" />
	<target name="checkstyle" depends="build">
		<checkstyle config="${env.YOYO_SVN_HOME}/app/java/checkstyle/checkstyle.xml" failOnViolation="false">
			<fileset dir="${build.src}/com/yoyosys/virt">
				<include name="**/*.java" />
			</fileset>
			<formatter type="plain" />
			<formatter type="xml" toFile="${build}/checkstyle_report.xml" />
		</checkstyle>
		<xslt in="${build}/checkstyle_report.xml" out="${build}/checkstyle_report.html" style="${basedir}/checkstyle-noframes-severity-sorted.xsl" />
		<delete file="${build}/checkstyle_report.xml" />
	</target>
	<!-- findbugs -->
	<property name="findbugs.home" value="${env.YOYO_SVN_HOME}/app/java/findbugs/findbugs-2.0.0" />
	<path id="findbugs-jar">
		<pathelement path="${findbugs.home}/lib/findbugs-ant.jar" />
	</path>
	<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="findbugs-jar" />
	<target name="findbugs" depends="build">
		<findbugs home="${findbugs.home}" jvmargs="-server -Xss512m -Xmx1024m" output="xml:withMessages" outputFile="${build}/findbugs_report.xml" excludefilter="${basedir}/findbugs_exclude.xml" auxClasspathRef="classpath">
			<sourcePath path="${build.src}" />
			<class location="${build.class}" />
		</findbugs>
		<xslt in="${build}/findbugs_report.xml" out="${build}/findbugs_report.html" style="${basedir}/findbugs-fancy-hist.xsl" />
		<delete file="${build}/findbugs_report.xml" />
	</target>
</project>
 
                    详细解决方案
                ant build.xml示范
热度:859   发布时间:2013-12-21 20:16:01.0
                    相关解决方案
                
                - \nbproject\build-impl.xml:332: Preverification failed with error code 1. 异常
- 请问ant build.xml中怎么把properties文件打入jar包
- Build path specifies execution environment J2SE-1.4 异常
- VS, build 与 publish有什么区别?解决办法
- 项目“H:\Program Files\Microsoft\PetShop\Pre-Build\Pre-Build.vcproj”所需的应用程序未安装。确保已解决思路
- Vista+Visual Studio.net 2003+Symbian SDK9.2,输入abld build wins udeb命令出现异常
- 新手请问:abld build wins udeb后出现异常
- ubuntu9.04上安装mic2 出错 (python setup.py build)
- ubuntu9.04下安装mic2 出错 (python setup.py build),该如何解决
- 如何在bat中对New Build Window Wizard进行设置
- ejbca ant bootstrap 构建失败(BUILD FAILED),该怎么处理
- build.xml
- 404 File Not Found Host by NetBox Version 2.8 Build 4128 如何解决
- PHP新手问:build path与include path什么区别?该怎么处理
- 解决 MyEclipse build workspace 慢,validation javascript 更慢的有关问题
- ant build.xml示范
- Build path entry is missing: frameworkv2.00.006解决方案
- 从网上下载的Middlegen-2.1.zip,解压后,build.xml文件有异常
- 请问daily build 高手
- []NETBEANS 5.5 罕见异常!build-impl.xml文件已经在外部修改
- java 项目 新建了一个工程 然后在工程下建了个lib文件夹 然后把jar放进来 小弟我记得以前可以直接右键 build path的
- ant build 构建有关问题
- 怎么配置JDBC Sun Java System Application Server 9.1_02 (build b04-fcs)
- ant build jrxml解决思路
- Ant Build.xml配置文件解决方法
- android初学者寻找帮助【Warning: Ignoring platform 'android-9' build.prop is m】,那位给点帮组?
- myeclipse导maven项目 怎么加载缺少的JAR 报错“Project build error: Non-resolvable parent POM”
- eclipse中ant build 控制台乱码解决解决办法(ant执行java)
- myeclipse中增加user libraries时出现“ One or more selected libraries are already on the build path”时的解决方法
- eclipse怎么导入jar包 BUILD PATH