<?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. NX二次开发-UFUN设置视图边界线显示隐藏UF_DRAW_set_border_display

    #include <uf.h> #include <uf_draw.h> #include <uf_drf.h> #include <uf_obj.h> ...

  2. php 类静态变量 和 常量消耗内存及时间对比

    在对类执行100w次循环后, 常量最快,变量其次,静态变量消耗时间最高 其中: 常量消耗:101.1739毫秒 变量消耗:2039.7689毫秒 静态变量消耗:4084.8911毫秒 测试代码: cl ...

  3. Go中的switch fallthrough

      Go基础 switch sExpr { case expr1: some instructions case expr2: some other instructions case expr3: ...

  4. fedora23上安装和运行MySQL server (MySQL 已经被MariaDB取代)

    [root@localhost kemin]# dnf install mysql-server Fedora 23 - x86_64 - Updates                        ...

  5. hexo中加入点击出现小红心的特效会导致无法双击选中和连续点击三次选中一整行的操作

    文章目录 问题描述 解决 个人博客:https://mmmmmm.me 源码:https://github.com/dataiyangu/dataiyangu.github.io 问题描述 如题,我们 ...

  6. 20140316 window live write 插件 推荐代码高亮插件 构造函数只能用初始化成员列表方式的例子

    1.window live write 插件:http://www.cnblogs.com/liuxianan/archive/2013/04/13/3018732.html 2.推荐代码高亮插件:W ...

  7. 分享一套高级Java笔试题(实拍高清图)

    分享一套高级Java笔试题 微信群里群友分享的 刚好他在笔试 有些问题不会发到群里求助 如果你最近正好在面试 需要参考需要提升 这套试题或许对你有用 下面是部分分享原图 下面是微信群中群友的热议 非常 ...

  8. 计算a,b,c的排列组合

    递归实现,思路的确有点难得想: public void SortAll(List<string> list,int start,int end) { if (start==end) { f ...

  9. android studio 一个项目如何打包多个apk

    1.修改app的build.gradle文件 假设我们同一套代码编译2个app:demo1和demo2 android { ... productFlavors { // demo1 demo1 { ...

  10. vue type check failed for prop . Expected Number, got String

    代码是:fileNumLimit接收的类型是Number <vue-upload fileNumLimit='100'/> 改为 <vue-upload :fileNumLimit= ...