-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·78 lines (73 loc) · 3.35 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
<?xml version="1.0"?>
<project name="BuildTutorial" basedir="." default="war">
<property name="gwt.module.name" value="cqfportal.CQFPortal"/>
<property name="server.resources.name" value="server"/>
<property name="jar.name" value="CQFPortal.jar"/>
<property name="war.name" value="CQFPortal.war"/>
<property name="src.dir" location="./src"/>
<property name="server.resources.dir" location="./src/cqfportal/${server.resources.name}"/>
<property name="build.dir" location="./build"/>
<property name="build.server.resources.dir" location="./war/WEB-INF/cqfportal/server"/>
<property name="build.shared.resources.dir" location="./war/WEB-INF/cqfportal/shared"/>
<property name="lib.dir" location="./war/WEB-INF/lib"/>
<property name="web.dir" location="./war/WEB-INF/"/>
<property name="gwt.client.dir" location="./src/cqfportal/client"/>
<property name="shared.resources.dir" location="./src/cqfportal/shared"/>
<path id="project.classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<echo>project.classpath</echo>
<target name="prepare">
<mkdir dir="${build.dir}"/>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<!-- Compile the java source code using javac -->
<target name="compile" depends="prepare">
<javac srcdir="${src.dir}" destdir="${build.dir}">
<classpath refid="project.classpath"/>
</javac>
</target>
<!-- Invoke the GWT compiler to create the Javascript for us -->
<target name="gwt-compile" depends="compile">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
<classpath>
<!-- src dir is added to ensure the module.xml file(s) are on the classpath -->
<pathelement location="${src.dir}"/>
<pathelement location="${build.dir}"/>
<path refid="project.classpath"/>
</classpath>
<jvmarg value="-Xmx256M"/>
<arg value="${gwt.module.name}"/>
</java>
</target>
<!-- Package the compiled Java source into a JAR file -->
<target name="jar" depends="compile">
<jar jarfile="${lib.dir}/${jar.name}" basedir="${build.dir}/">
<!-- Don't wrap any of the client only code into the JAR -->
<exclude name="${gwt.client.dir}/**/*.class"/>
</jar>
</target>
<!-- Copy the static server resources into the required
directory ready for packaging -->
<!-- <target name="copy-resources">
<copy todir="${build.server.resources.dir}" preservelastmodified="true">
<fileset dir="${server.resources.dir}"/>
</copy>
</target> -->
<!-- Package the JAR file, Javascript, static resources
and external libraries into a WAR file -->
<target name="war" depends="gwt-compile, jar">
<war basedir="war" destfile="CQFPortal.war" webxml="war/WEB-INF/web.xml">
<exclude name="WEB-INF/**" />
<webinf dir="war/WEB-INF/">
<include name="**/*.jar" />
<exclude name="**/gwt-dev.jar" />
<exclude name="**/gwt-user.jar" />
</webinf>
</war>
</target>
</project>