-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
103 lines (90 loc) · 4.3 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?xml version="1.0" encoding="utf-8"?>
<project name="TicTacToe" default="build" basedir=".">
<description>
This script will build the Tic-Tac-Toe Game.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
http://www.gnu.org/copyleft/gpl.html
</description>
<property name="src" location="src" />
<property name="build" location="build" />
<property name="build.bin" location="${build}/bin" />
<property name="build.dist" location="${build}/dist" />
<property name="build.libs" location="${build.dist}/libs" />
<property name="version" location="0.1" />
<path id="classpath">
<fileset dir="${build.libs}">
<include name="*.jar" />
</fileset>
</path>
<pathconvert property="manifest.libs" pathsep=" ">
<path refid="classpath" />
<mapper>
<chainedmapper>
<flattenmapper />
<globmapper from="*.jar" to="../libs/*.jar" />
</chainedmapper>
</mapper>
</pathconvert>
<target name="init" depends="check" description="Create the output directories.">
<delete dir="${build.bin}" quiet="true" />
<mkdir dir="${build.bin}" />
</target>
<target name="dist" depends="init" description="Export the files to the output directory.">
<sync todir="${build.dist}" includeemptydirs="true">
<fileset dir="dist" />
</sync>
</target>
<target name="compile" depends="dist" description="Compile the source.">
<javac srcdir="${src}" classpathref="classpath" destdir="${build.bin}" compiler="javac1.7" debug="true" debuglevel="lines,vars,source" includeantruntime="false" source="1.7" target="1.7" />
</target>
<target name="jar" depends="compile" description="Create the jar files.">
<jar destfile="${build.dist}/client.jar" level="9">
<fileset dir="${build.bin}">
<exclude name="**/server/**" />
</fileset>
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Built-Date" value="${build.tstamp}" />
<attribute name="Class-Path" value="${manifest.libs}" />
<attribute name="Implementation-URL" value="http://github.com/yangshenghan" />
<attribute name="Implementation-Version" value="${version}" />
<attribute name="Main-Class" value="cn.client.Client" />
</manifest>
</jar>
<jar destfile="${build.dist}/server.jar" level="9">
<fileset dir="${build.bin}">
<exclude name="**/client/**" />
</fileset>
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Built-Date" value="${build.tstamp}" />
<attribute name="Implementation-URL" value="http://github.com/yangshenghan" />
<attribute name="Implementation-Version" value="${version}" />
<attribute name="Main-Class" value="cn.server.Server" />
</manifest>
</jar>
</target>
<target name="build" depends="jar" description="Create the Zip file.">
<zip destfile="${build}/Tic-Tac-Toe.zip" basedir="${build.dist}" level="9" />
</target>
<target name="check" description="Check Requirements.">
<fail message="Ant 1.8.2 is required. But your version is ${ant.version} and if you are using Eclipse probably is outdated.">
<condition>
<not>
<antversion atleast="1.8.2" />
</not>
</condition>
</fail>
</target>
</project>