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

<project default="rerun" name="codex-game">

<!-- project  property -->

<property name="lib.dir" value="../third-libs" />

<property name="src.dir" value="src" />

<!--

<property name="core.moniter.dir" value="../dawn-core/moniter" />

<property name="core.src.dir" value="../dawn-core/src" />

<property name="dbs.src.dir" value="../dawn-dbs/src" />

<property name="dbs.test.dir" value="../dawn-dbs/test" />

<property name="logserver.src.dir" value="../logserver/src" />

-->

<property name="deploy.dir" value="deploy" />

<property name="classes.dir" value="deploy/classes" />

<property name="jarname" value="codex-game.jar" />

<property name="mainclass" value="com.mop.game.gameserver.GameServer" />

<property name="core.jar" value="codex-core/deploy/codex-core.jar" />

<property name="dbs.jar" value="codex-db/deploy/codex-db.jar" />

<property name="battle.jar" value="codex-battle/deploy/codex-battle.jar" />

<property name="log.jar" value="logserver/deploy/logserver.jar" />

<!-- third jar path -->

<path id="lib-classpath">

<fileset dir="${lib.dir}">

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

</fileset>

<fileset dir="../">

<include name="${core.jar}" />

</fileset>

<fileset dir="../">

<include name="${dbs.jar}" />

</fileset>

<fileset dir="../">

<include name="${battle.jar}" />

</fileset>

<fileset dir="../">

<include name="${log.jar}" />

</fileset>

</path>

<!-- 1. init, eg.create path -->

<target name="init">

<mkdir dir="${deploy.dir}" />

<mkdir dir="${classes.dir}" />

</target>

<!-- 2. compile -->

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

<javac destdir="${classes.dir}" includeantruntime="on">

<src path="${src.dir}" />

<compilerarg line="-encoding UTF-8" />

<classpath refid="lib-classpath" />

</javac>

</target>

<!-- 3. build jar -->

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

<copy todir="${deploy.dir}/lib">

<fileset dir="${lib.dir}" />

<file name="../${core.jar}" />

<file name="../${dbs.jar}" />

<file name="../${battle.jar}" />

<file name="../${log.jar}" />

</copy>

<copy todir="${deploy.dir}">

<fileset dir="../codex-db/resource" />

</copy>

<copy todir="${deploy.dir}">

<fileset dir="resource" />

</copy>

<!--Create a property containing all .jar files, prefix lib/, and seperated with a space-->

<pathconvert property="mf.classpath" pathsep=" ">

<mapper>

<chainedmapper>

<!-- jar包文件只留文件名,去掉目录信息 -->

<flattenmapper />

<!-- add lib/ prefix -->

<globmapper from="*" to="lib/*" />

</chainedmapper>

</mapper>

<path refid="lib-classpath" />

</pathconvert>

<!-- jar文件的输出路径 -->

<jar destfile="${deploy.dir}/${jarname}" basedir="${classes.dir}">

<manifest>

<attribute name="Main-class" value="${mainclass}" />

<attribute name="Class-Path" value="${mf.classpath}" />

</manifest>

</jar>

<delete dir="${classes.dir}" />

</target>

<!-- run -->

<target name="run" depends="build">

<java classname="${mainclass}" classpath="${deploy.dir}/${jarname}" fork="true" failonerror="true">

<classpath>

<pathelement path="${deploy.dir}" />

</classpath>

</java>

</target>

<target name="clean">

<delete file="${deploy.dir}/${jarname}" />

<delete dir="${deploy.dir}/lib" />

<delete dir="${classes.dir}" />

</target>

<target name="rebuild">

<ant target="clean" />

<ant target="build" />

</target>

<target name="rerun">

<!--ant target="clean" /-->

<ant target="run" />

</target>

</project>

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

<project default="rebuild" name="codex-core">

<!-- project  property -->

<property name="lib.dir" value="../third-libs" />

<property name="src.dir" value="src" />

<property name="moniter.dir" value="moniter" />

<property name="deploy.dir" value="deploy" />

<property name="classes.dir" value="deploy/classes" />

<property name="jarname" value="codex-core.jar" />

<!-- third jar path -->

<path id="lib-classpath">

<fileset dir="${lib.dir}">

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

</fileset>

</path>

<!-- 1. init, eg.create path -->

<target name="init">

<mkdir dir="${deploy.dir}" />

<mkdir dir="${classes.dir}" />

</target>

<!-- 2. compile -->

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

<javac destdir="${classes.dir}" includeantruntime="on" debug="on" optimize="true">

<src path="${src.dir}" />

<src path="${moniter.dir}" />

<compilerarg line="-encoding UTF-8" />

<classpath refid="lib-classpath" />

</javac>

</target>

<!-- 3. build jar -->

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

<copy todir="${deploy.dir}/lib">

<fileset dir="${lib.dir}" />

</copy>

<!--Create a property containing all .jar files, prefix lib/, and seperated with a space-->

<pathconvert property="mf.classpath" pathsep=" ">

<mapper>

<chainedmapper>

<!-- jar包文件只留文件名,去掉目录信息 -->

<flattenmapper />

<!-- add lib/ prefix -->

<globmapper from="*" to="lib/*" />

</chainedmapper>

</mapper>

<path refid="lib-classpath" />

</pathconvert>

<!-- jar file output -->

<jar destfile="${deploy.dir}/${jarname}" basedir="${classes.dir}">

<manifest>

<attribute name="Class-Path" value="${mf.classpath}" />

</manifest>

</jar>

<delete dir="${deploy.dir}/lib" />

<delete dir="${classes.dir}" />

</target>

<target name="clean">

<delete file="${deploy.dir}/${jarname}" />

<delete dir="${deploy.dir}/lib" />

<delete dir="${classes.dir}" />

</target>

<target name="rebuild">

<ant target="clean" />

<ant target="build" />

</target>

</project>

ant的build.xml备份的更多相关文章

  1. Ant之build.xml详解---可用

    Ant的概念 :在Eclipse中使用Ant Ant是Java平台下非常棒的批处理命令执行程序,能非常方便地自动完成编译,测试,打包,部署等等一系列任务,大大提高开发效率. Ant和make命令很像. ...

  2. Eclipse 自动生成 Ant的Build.xml 配置文件

    Eclipse 自动生成 Ant的Build.xml 配置文件,生成的方法很隐蔽 选择你要生成Build.xml文件的项目,右键. Export-> General -> Ant Buil ...

  3. Ant之build.xml详解

    Ant之build.xml详解 关键字: ant build.xml Ant的概念 可能有些读者并不连接什么是Ant以及入可使用它,但只要使用通过Linux系统得读者,应该知道make这个命令.当编译 ...

  4. Ant运行build.xml执行服务器scp,异常解决jsch.jar

    公司ant打包上线 一直出现这个问题. Ant运行build.xml执行服务器scp,异常解决jsch.jar BUILD FAILEDD:\eclipse\eclipse-jee-luna-SR2- ...

  5. Ant:build.xml 结构

     Ant build.xml 结构 project target task data property datatype v\:* {behavior:url(#default#VML);} o\:* ...

  6. ANT编译build.xml

    一,体验ant就像每个语言都有HelloWorld一样,一个最简单的应用能让人感受一下Ant1,首先你要知道你要干什么,我现在想做的事情是:编写一些程序编译它们把它打包成jar包把他们放在应该放置的地 ...

  7. java应用测试报告生成(二):利用ant的build.xml生成测试报告

    1.将写好的项目导出 在工程下会生成一个build.xml的蚂蚁图标的文件. 2.右击该文件,选择run as Ant build 其中的测试目录是可以选择的,如果涉及到顺序也可以调整顺序 3.执行后 ...

  8. 【转】Ant之build.xml详解

    关键字: ant build.xml Ant的概念 可能有些读者并不连接什么是Ant以及入可使用它,但只要使用通过Linux系统得读者,应该知道make这个命令.当编译Linux内核及一些软件的源程序 ...

  9. 使用.bat文件运行ant的build.xml

    1.新建一个txt文件 2.复制下面命令到txt文件 echo "Start build..." call ant.bat -f "E:\build.xml" ...

随机推荐

  1. java之短路与&&和短路或||

    短路的意思就是惰性计算,符号右边的就不进行计算了. ||和&&就是这样,

  2. NX二次开发-算法篇-冒泡排序(例子:遍历所有点并排序)

    NX9+VS2012 #include <uf.h> #include <uf_ui.h> #include <uf_curve.h> #include <u ...

  3. 牛客多校第十场 E Hilbert Sort 递归,排序

    题意: 给你一个方阵,再在方阵上给定一些点,按照希尔伯特曲线经过的先后顺序为这些点排序 题解: 定义好比较函数后直接调用排序算法即可. 希尔伯特曲线本来就是用于二维到一维的映射的,因此我们可以考虑对于 ...

  4. P1613 跑路(倍增)

    P1613 跑路(倍增) 题目描述 小A的工作不仅繁琐,更有苛刻的规定,要求小A每天早上在6:00之前到达公司,否则这个月工资清零.可是小A偏偏又有赖床的坏毛病.于是为了保住自己的工资,小A买了一个十 ...

  5. sparkStreaming的transformation和action详解

    根据Spark官方文档中的描述,在Spark Streaming应用中,一个DStream对象可以调用多种操作,主要分为以下几类 Transformations Window Operations J ...

  6. iOS进阶四-自动释放池原理

    概述 AutoreleasePool(自动释放池)是OC中的一种内存自动回收机制,它可以延迟加入AutoreleasePool中的变量release的时机.在正常情况下,创建的变量会在超出其作用域的时 ...

  7. iOS开发系列-UIImageView的contentMode

    typedef NS_ENUM(NSInteger, UIViewContentMode) { UIViewContentModeScaleToFill, UIViewContentModeScale ...

  8. 2019-8-27-静默命令行安装-Visual-C++-发行包

    title author date CreateTime categories 静默命令行安装 Visual C++ 发行包 lindexi 2019-8-27 15:39:3 +0800 2019- ...

  9. K8S之WebApi部署

    转载声明 本文转自:ASP.NET Core on K8S学习初探(3)部署API到K8S 1.下载镜像 docker pull edisonsaonian/k8s-demo 因为是测试流程,直接把文 ...

  10. sql (9) COUNT

    COUNT() 函数返回匹配指定条件的行数.语法SQL COUNT(column_name) 语法COUNT(column_name) 函数返回指定列的值的数目(NULL 不计入):新建表 Stude ...