-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
168 lines (153 loc) · 6.9 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<?xml version="1.0" encoding="UTF-8"?>
<project name="Mobius" default="dist" basedir=".">
<property name="debug" value="on" />
<property name="src.gameserver" location="java/lineage2/gameserver" />
<property name="src.loginserver" location="java/lineage2/loginserver" />
<property name="src.commons" location="java/lineage2/commons" />
<property name="dist" location="dist" />
<property name="libraries" location="dist/libs" />
<property name="build" location="../build" />
<property name="build.classes" location="${build}/classes" />
<property name="build.dist" location="${build}/dist" />
<property name="build.dist.loginserver" location="${build.dist}/loginserver" />
<property name="build.dist.gameserver" location="${build.dist}/gameserver" />
<property name="build.dist.tools" location="${build.dist}/tools" />
<path id="classpath">
<fileset dir="${libraries}">
<include name="**/*.jar" />
</fileset>
</path>
<property name="build.classpath" refid="classpath" />
<pathconvert property="jar.list" pathsep=" " refid="classpath">
<mapper type="flatten" />
</pathconvert>
<tstamp>
<format property="build.tstamp" pattern="yyyy.MM.dd HH:mm" />
</tstamp>
<target name="checkRequirements" 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>
<available classname="java.util.stream.Stream" property="JDK8.present" />
<fail unless="JDK8.present" message="Java 1.8 is required. But your version is Java ${ant.java.version} and probably JDK is not installed." />
</target>
<target name="clean" depends="checkRequirements" description="Remove the output directories.">
<delete dir="${build}" />
</target>
<target name="init" depends="clean" description="Create the output directories.">
<mkdir dir="${build}" />
</target>
<target name="compile-commons" depends="init">
<delete dir="${build.classes}" />
<mkdir dir="${build.classes}" />
<javac srcdir="${src.commons}" destdir="${build.classes}" compiler="modern" debug="${debug}" debuglevel="lines,vars,source" optimize="on" source="1.8" target="1.8" includeantruntime="false" encoding="UTF-8" nowarn="off" classpath="${build.classpath}">
<compilerarg value="-Xlint:unchecked,-serial" />
</javac>
</target>
<target name="commons-jar" depends="compile-commons">
<jar destfile="${build}/lineage2-commons.jar">
<fileset dir="${build.classes}" />
<manifest>
<attribute name="Build-By" value="${user.name}" />
<attribute name="Build-Date" value="${build.tstamp}" />
</manifest>
</jar>
</target>
<target name="compile-gameserver" depends="commons-jar">
<delete dir="${build.classes}" />
<mkdir dir="${build.classes}" />
<javac srcdir="${src.gameserver}" destdir="${build.classes}" compiler="modern" debug="${debug}" debuglevel="lines,vars,source" optimize="on" source="1.8" target="1.8" includeantruntime="false" encoding="UTF-8" nowarn="off" classpath="${build.classpath}:${build}/lineage2-commons.jar">
<compilerarg value="-Xlint:unchecked,-serial" />
</javac>
</target>
<target name="gameserver-jar" depends="compile-gameserver">
<jar destfile="${build}/lineage2-gameserver.jar">
<fileset dir="${build.classes}" />
<manifest>
<attribute name="Main-Class" value="lineage2.gameserver.GameServer" />
<attribute name="Class-Path" value="${jar.list} lineage2-commons.jar" />
<attribute name="Build-By" value="${user.name}" />
<attribute name="Build-Date" value="${build.tstamp}" />
</manifest>
</jar>
</target>
<target name="gameserver" depends="gameserver-jar">
<mkdir dir="${build.dist}" />
<mkdir dir="${build.dist.tools}" />
<mkdir dir="${build.dist.gameserver}" />
<mkdir dir="${build.dist.gameserver}/geodata" />
<mkdir dir="${build.dist.gameserver}/log" />
<copy todir="${build.dist}/libs">
<fileset dir="${build}">
<include name="lineage2-gameserver.jar" />
</fileset>
</copy>
<fixcrlf srcdir="${build.dist.gameserver}" eol="lf" eof="remove" includes="**/*.sh"/>
<fixcrlf srcdir="${build.dist.gameserver}" eol="crlf" eof="remove" includes="**/*.bat"/>
<delete dir="${build.classes}" />
<copy todir="${build.dist.gameserver}" preservelastmodified="true">
<fileset dir="${dist}/gameserver">
<include name="**/*.*" />
</fileset>
</copy>
<copy todir="${build.dist.tools}" preservelastmodified="true">
<fileset dir="${dist}/tools">
<include name="**/*.*" />
</fileset>
</copy>
</target>
<target name="compile-loginserver" depends="commons-jar">
<delete dir="${build.classes}" />
<mkdir dir="${build.classes}" />
<javac srcdir="${src.loginserver}" destdir="${build.classes}" compiler="modern" debug="${debug}" debuglevel="lines,vars,source" optimize="on" source="1.8" target="1.8" includeantruntime="false" encoding="UTF-8" nowarn="off" classpath="${build.classpath}:${build}/lineage2-commons.jar">
<compilerarg value="-Xlint:unchecked,-serial" />
</javac>
</target>
<target name="loginserver-jar" depends="compile-loginserver">
<jar destfile="${build}/lineage2-loginserver.jar">
<fileset dir="${build.classes}" />
<manifest>
<attribute name="Main-Class" value="lineage2.loginserver.LoginServer" />
<attribute name="Class-Path" value="${jar.list} lineage2-commons.jar" />
<attribute name="Build-By" value="${user.name}" />
<attribute name="Build-Date" value="${build.tstamp}" />
</manifest>
</jar>
</target>
<target name="loginserver" depends="loginserver-jar">
<mkdir dir="${build.dist}" />
<mkdir dir="${build.dist.loginserver}" />
<mkdir dir="${build.dist}/libs" />
<mkdir dir="${build.dist.loginserver}/log" />
<copy todir="${build.dist}/libs">
<fileset dir="${build}">
<include name="lineage2-loginserver.jar" />
<include name="lineage2-commons.jar" />
</fileset>
</copy>
<copy todir="${build.dist}/libs">
<fileset dir="${libraries}">
<include name="*.jar" />
<exclude name="lineage2-gameserver.jar" />
</fileset>
</copy>
<copy todir="${build.dist.loginserver}">
<fileset dir="${dist}/loginserver" />
</copy>
<fixcrlf srcdir="${build.dist.loginserver}" eol="lf" eof="remove" includes="**/*.sh"/>
<fixcrlf srcdir="${build.dist.loginserver}" eol="crlf" eof="remove" includes="**/*.bat"/>
</target>
<target name="dist" depends="gameserver, loginserver" description="Create the Zip file.">
<!-- cleanup -->
<delete file="${build}/lineage2-gameserver.jar" />
<delete file="${build}/lineage2-loginserver.jar" />
<delete file="${build}/lineage2-commons.jar" />
<delete dir="${build.classes}" />
<!-- create the zip file -->
<zip destfile="${build}/Lineage2Lindvior.zip" basedir="${build.dist}" level="9" />
</target>
</project>