root/build.xml

Revision a0ba83da7d981610aa0c6e50ee38f16b01b50d5a, 10.8 kB (checked in by Christopher Jung <bktheg@web.de>, 4 months ago)

UTF-8 bei allen javac-kommandos als charset hinzugefuegt.

  • Property mode set to 100644
Line 
1 <!--
2         Drifting Souls 2
3         Copyright (c) 2006 Christopher Jung
4        
5         This library is free software; you can redistribute it and/or
6         modify it under the terms of the GNU Lesser General Public
7         License as published by the Free Software Foundation; either
8         version 2.1 of the License, or (at your option) any later version.
9  
10         This library is distributed in the hope that it will be useful,
11         but WITHOUT ANY WARRANTY; without even the implied warranty of
12         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13         Lesser General Public License for more details.
14  
15         You should have received a copy of the GNU Lesser General Public
16         License along with this library; if not, write to the Free Software
17         Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18 -->
19 <project name="Drifting Souls 2" default="compile" basedir=".">
20         <!-- ===================== Property Definitions =========================== -->
21        
22         <property file="build.properties"/>
23         <property file="${user.home}/build.properties"/>
24        
25        
26         <!-- ==================== File and Directory Names ======================== -->
27
28         <property name="app.name"      value="driftingsouls"/>
29         <property name="app.path"      value="/${app.name}"/>
30         <property name="app.version"   value="2"/>
31         <property name="build.home"    value="${basedir}/build"/>
32         <property name="dist.home"     value="${basedir}/dist"/>
33         <property name="docs.home"     value="${basedir}/docs"/>
34         <property name="manager.url"   value="http://localhost:8080/manager"/>
35         <property name="src.home"      value="${basedir}/src"/>
36         <property name="src.jstarmap"  value="${basedir}/clients/jstarmap"/>
37         <property name="web.home"      value="${basedir}/web"/>
38         <property name="ds2.configdir" value="${basedir}/web/WEB-INF/cfg/"/>
39         <property name="templates.srchome" value="${build.home}/templates"/>
40         <property name="templates.compiledir" value="${templates.srchome}/net/driftingsouls/ds2/server/templates" />
41         <property name="jcsc.home"              value="build-utils/jcsc/"/>
42         <property name="jcsc.report"    value="${build.home}/jcsc-report"/>
43         <property name="jetty.contextpath" value="/driftingsouls"/>
44
45         <!--  ==================== Compilation Control Options ==================== -->
46
47         <property name="compile.debug"       value="true"/>
48         <property name="compile.deprecation" value="false"/>
49         <property name="compile.optimize"    value="true"/>
50
51         <!-- ==================== External Dependencies =========================== -->
52
53         <!-- ==================== Compilation Classpath =========================== -->
54
55         <path id="compile.classpath">
56                 <fileset dir="web/WEB-INF/lib">
57                         <include name="*.jar"/>
58                 </fileset>
59                
60                 <fileset dir="web/java">
61                         <include name="*.jar"/>
62                 </fileset>
63         </path>
64        
65         <path id="ant.classpath">
66                 <fileset dir="build-utils/lib">
67                         <include name="*.jar"/>
68                 </fileset>
69         </path>
70
71         <!-- ================== Custom Ant Task Definitions ======================= -->
72        
73         <!-- ==================== All Target ====================================== -->
74
75         <target name="all" depends="clean,templates,compile"
76                 description="Clean build and dist directories, then compile"/>
77
78         <!-- ==================== Clean Target ==================================== -->
79
80         <target name="clean" description="Delete old build and dist directories">
81                 <delete>
82                         <fileset dir="${build.home}">
83                                 <exclude name="**/data/**" />
84                         </fileset>
85                 </delete>
86                 <delete dir="${build.home}/WEB-INF" />
87                 <delete dir="${dist.home}"/>
88                 <delete dir="${templates.compiledir}" />
89         </target>
90        
91         <!-- ==================== Compile Targets ================================== -->
92        
93         <target name="compile-framework" depends="prepare" description="Compile framework sources">
94                 <javac srcdir="${src.home}"
95                            destdir="${build.home}/WEB-INF/classes"
96                            debug="${compile.debug}"
97                            deprecation="${compile.deprecation}"
98                            optimize="${compile.optimize}"
99                            source="1.6"
100                            target="1.6"
101                            encoding="UTF-8"
102                            includes="**/server/framework/**">
103                         <classpath refid="compile.classpath"/>
104                 </javac>               
105         </target>
106        
107         <target name="compile-templates" depends="prepare" description="Compile template sources">
108                         <javac srcdir="${templates.srchome}"
109                                    destdir="${build.home}/WEB-INF/classes"
110                                    debug="${compile.debug}"
111                                    deprecation="${compile.deprecation}"
112                                    optimize="${compile.optimize}"
113                                    source="1.6"
114                                    target="1.6"
115                                    encoding="UTF-8"
116                                         includes="**/server/templates/**">
117                                 <classpath refid="compile.classpath"/>
118                         </javac>
119         </target>
120        
121         <!-- ==================== Antlr Target ================================== -->
122                        
123         <target name="antlr" depends="prepare">
124                 <echo>Compiliere Grammatik Role.g</echo>
125                 <java classname="org.antlr.Tool" fork="true">
126                         <arg value="-o ${src.home}/net/driftingsouls/ds2/server/scripting/roles/parser" />
127                         <arg value="${src.home}/net/driftingsouls/ds2/server/scripting/roles/parser/Role.g" />
128                         <classpath refid="compile.classpath" />
129                 </java>
130         </target>
131        
132         <!-- ==================== compile-ds Target ================================== -->
133        
134         <target name="compile-ds" depends="prepare,antlr" description="Compile template sources">
135                 <javac srcdir="${src.home}"
136                            destdir="${build.home}/WEB-INF/classes"
137                            debug="${compile.debug}"
138                            deprecation="${compile.deprecation}"
139                            optimize="${compile.optimize}"
140                            source="1.6"
141                            target="1.6"
142                            encoding="UTF-8"
143                                 excludes="**/server/templates/**,**/server/framework/**">
144                         <classpath refid="compile.classpath"/>
145                 </javac>
146         </target>
147        
148         <target name="compile-jstarmap" depends="prepare" description="Compile client jstarmap sources">
149                 <mkdir dir="${build.home}/java/jstarmap"/>
150                 <mkdir dir="${build.home}/java/jstarmap/classes"/>
151                
152                 <javac srcdir="${src.jstarmap}"
153                            destdir="${build.home}/java/jstarmap/classes"
154                            debug="${compile.debug}"
155                            deprecation="${compile.deprecation}"
156                            optimize="${compile.optimize}"
157                            encoding="UTF-8"
158                            source="1.5"
159                            target="1.5">
160                         <classpath refid="compile.classpath"/>
161                 </javac>
162                 <jar jarfile="${build.home}/java/JStarmap.jar" manifest="${src.jstarmap}/jstarmap.manifest" basedir="${build.home}/java/jstarmap/classes" includes="**/ds2/jstarmap/**" />
163                 <jar jarfile="${build.home}/java/JFramework.jar" manifest="${src.jstarmap}/jframework.manifest" basedir="${build.home}/java/jstarmap/classes" includes="**/ds2/framework/**" />
164         </target>
165        
166         <target name="compile-clients" depends="compile-jstarmap" description="Compile client meta target">
167         </target>
168        
169         <target name="compile" depends="compile-framework,compile-templates,compile-ds,compile-clients" description="Compile meta target">
170         </target>
171        
172         <!-- ==================== jar Target ===================================== -->
173         <target name="jar" depends="templates,compile" description="Create a jar">
174                 <jar jarfile="${build.home}/WEB-INF/lib/${app.name}-framework.jar" basedir="${build.home}/WEB-INF/classes" includes="**/server/framework/**" />
175                 <jar jarfile="${build.home}/WEB-INF/lib/${app.name}-templates.jar" basedir="${build.home}/WEB-INF/classes" includes="**/server/templates/**" />
176                 <jar jarfile="${build.home}/WEB-INF/lib/${app.name}-ds-pipeline.jar" basedir="${build.home}/WEB-INF/classes" includes="**/server/modules/**" />
177                 <jar jarfile="${build.home}/WEB-INF/lib/${app.name}-ds-tick.jar" basedir="${build.home}/WEB-INF/classes" includes="**/server/tick/**" />
178                 <jar jarfile="${build.home}/WEB-INF/lib/${app.name}-ds.jar" basedir="${build.home}/WEB-INF/classes" excludes="**/server/framework/**,**/server/templates/**,**/server/modules/**,**/server/tick/**" />
179         </target>
180
181         <!-- ==================== Dist Target ===================================== -->
182
183         <target name="dist" depends="compile,javadoc"
184                 description="Create binary distribution">
185
186                 <mkdir dir="${dist.home}/docs"/>
187                 <copy todir="${dist.home}/docs">
188                         <fileset dir="${docs.home}">
189                                 <exclude name="**/thirdparty/*" />
190                                 <exclude name="**/thirdparty" />
191                         </fileset>
192                 </copy>
193
194                 <jar jarfile="${dist.home}/${app.name}-${app.version}.war" basedir="${build.home}"/>
195         </target>
196
197
198         <!-- ==================== Javadoc Target ================================== -->
199
200         <target name="javadoc" depends="compile" description="Create Javadoc API documentation">
201                 <mkdir dir="${dist.home}/docs/api"/>
202                 <javadoc sourcepath="${src.home}" destdir="${dist.home}/docs/api" packagenames="*">
203                         <classpath refid="compile.classpath" />
204                 </javadoc>
205         </target>
206
207         <!-- ==================== Prepare Target ================================== -->
208
209         <target name="prepare">
210                 <mkdir  dir="${build.home}"/>
211                 <mkdir  dir="${build.home}/WEB-INF"/>
212                 <mkdir  dir="${build.home}/WEB-INF/classes"/>
213
214                 <copy todir="${build.home}">
215                         <fileset dir="${web.home}" followsymlinks="false"/>
216                 </copy>
217
218                 <mkdir  dir="${build.home}/WEB-INF/lib"/>
219
220                 <copy todir="${build.home}/WEB-INF/classes">
221                         <fileset dir="${src.home}" excludes="**/*.java"/>
222                 </copy>
223         </target>
224        
225         <!-- ==================== Template Target ================================== -->
226        
227         <target name="templates" depends="prepare,compile-framework">
228                 <mkdir dir="${templates.compiledir}"/>
229                 <java classname="net.driftingsouls.ds2.server.framework.templates.TemplateCompiler" fork="true">
230                         <arg value="${ds2.configdir}" />
231                         <arg value="${basedir}/templates" />
232                         <arg value="${templates.compiledir}" />
233                         <classpath>
234                                 <pathelement path="${build.home}/WEB-INF/classes" />
235                         </classpath>
236                         <classpath refid="compile.classpath" />
237                 </java>
238         </target>
239
240         <!-- ==================== Validate Target =================================== -->
241
242         <taskdef name="jcsc" classname="rj.tools.jcsc.ant.JCSCTask" classpathref="ant.classpath"/>
243        
244         <target name="validate" description="Ueberprueft den Sourcecode auf Abweichungen vom DS-Standard">
245                 <delete dir="${jcsc.report}" />
246                 <mkdir dir="${jcsc.report}" />
247                
248                 <jcsc rules="rules.jcsc.xml"
249                                 destdir="${jcsc.report}"
250                                 worstcount="20"
251                                 failvalue="0.05"
252                                 failseverity="5"
253                                 copyassociatedfiles="true"
254                                 jcschome="${jcsc.home}">
255                     <fileset dir="${src.home}" includes="net/driftingsouls/**/*.java"/>
256                 </jcsc>
257         </target>
258        
259         <!-- ==================== Check-Install Target ================================== -->
260                
261         <target name="check-install" depends="prepare,compile">
262                 <java classname="net.driftingsouls.ds2.server.install.CheckInstallation" fork="true" dir="${build.home}">
263                         <classpath>
264                                 <pathelement path="${build.home}/WEB-INF/classes" />
265                         </classpath>
266                         <classpath refid="compile.classpath" />
267                 </java>
268         </target>
269        
270         <!-- ==================== Run Target ================================== -->
271        
272         <taskdef classpathref="ant.classpath" resource="tasks.properties" loaderref="jetty.loader" />
273        
274         <target name="run">
275                 <mkdir dir="jetty-temp" />
276                 <jetty tempDirectory="jetty-temp">
277                         <webapp name="ds2j-opensource" warfile="${build.home}" contextPath="/driftingsouls">
278                                 <lib dir="${build.home}/WEB-INF/lib" includes="*.jar" />
279                         </webapp>
280                 </jetty>
281                 <delete dir="jetty-temp" />
282         </target>
283 </project>
284  
Note: See TracBrowser for help on using the browser.