forked from 480Oswego2013/CSC-HCI-480-2013-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
149 lines (130 loc) · 6.13 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
A few quick pointers...
- The default "compile" target will run the full GWT compiler.
This could take a while (30+ seconds) so if you only want to
compile the H2O wrapper, run the "compile-h2owrapper" target.
- For testing and debugging GWT, you can streamline the process
by running the application in hosted mode. Simply call the
"run-hosted" target and it will do the rest.
- If you run into GWT-related build problems, shoot Nick Ibarluzea
an email and I'll try to help.
-->
<project name="CSC480_HCI521_2013" default="dist" basedir="."
xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<!-- source directories -->
<property name="src" location="src" />
<property name="src.h2owrapper" location="${src}/edu/oswego/csc480_hci521_2013/h2owrapper" />
<property name="src.gwt.client" location="${src}/edu/oswego/csc480_hci521_2013/client" />
<property name="webcontent" location="war" />
<!-- build directories -->
<property name="build" location="build" />
<property name="build.gwt" location="${webcontent}/WEB-INF/classes" />
<property name="dist" location="dist" />
<!-- declare typedef for maven ant tasks -->
<path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.1.3.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="antlib:org.apache.maven.artifact.ant"
classpathref="maven-ant-tasks.classpath" />
<property name="project.warfile" value="${ant.project.name}.war" />
<target name="dist" description="Generate the war file" depends="compile">
<war destfile="${dist}/${project.warfile}" webxml="${webcontent}/WEB-INF/web.xml">
<fileset dir="${webcontent}"/>
<lib dir="${webcontent}/WEB-INF/lib"/>
<classes dir="${build.gwt}"/>
</war>
</target>
<target name="clean" description="Clean up temporary files">
<delete dir="${build}" />
<delete dir="${build.gwt}" />
<delete dir="${webcontent}/Main" />
<delete dir="${webcontent}/WEB-INF/deploy" />
<delete dir="${dist}" />
</target>
<target name="compile" description="Compile the sources"
depends="compile-gwt-gwtc" />
<!-- Compile GWT sources -->
<target name="compile-gwt" description="Compile GWT sources" depends="init">
<mkdir dir="${build.gwt}" />
<!-- NOTE: source set to 1.6 for gwt compatability -->
<javac destdir="${build.gwt}" srcdir="${src}"
source="1.6" target="1.7"
includeantruntime="false"
classpathref="project.classpath" />
</target>
<target name="compile-tests" description="Compile test sources" depends="compile-gwt">
<mkdir dir="${build}/test" />
<!-- NOTE: source set to 1.6 for gwt compatability -->
<javac destdir="${build}/test" srcdir="test"
source="1.6" target="1.7"
includeantruntime="false">
<classpath>
<pathelement location="${build.gwt}"/>
<path refid="project.classpath"/>
</classpath>
</javac>
</target>
<!-- Compile GWT module to JavaScript -->
<target name="compile-gwt-gwtc" depends="compile-gwt" description="GWT compile to JavaScript">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
<classpath>
<pathelement location="${src}"/>
<path refid="project.classpath"/>
</classpath>
<!-- add jvmarg -Xss16M or similar if you see a StackOverflowError -->
<jvmarg value="-Xmx256M"/>
<!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
<arg value="edu.oswego.csc480_hci521_2013.Main"/>
</java>
</target>
<!-- Run GWT module in hosted mode -->
<target name="run-hosted" depends="compile-gwt" description="Run the webapp in hosted mode">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.HostedMode">
<classpath>
<pathelement location="${src}"/>
<path refid="project.classpath"/>
</classpath>
<jvmarg value="-Xmx256M"/>
<arg value="-startupUrl"/>
<arg value="Main.html"/>
<!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
<arg value="edu.oswego.csc480_hci521_2013.Main"/>
</java>
</target>
<!-- Initialize GWT compilation. Create build dir, fetch Maven dependencies -->
<target name="init">
<mkdir dir="${build.gwt}" />
<artifact:dependencies pathId="dependency.classpath">
<dependency groupId="com.google.gwt" artifactId="gwt-user" version="2.5.0" />
<dependency groupId="com.google.gwt" artifactId="gwt-dev" version="2.5.0" />
<dependency groupId="com.google.code.gson" artifactId="gson" version="2.2.2" />
<dependency groupId="junit" artifactId="junit" version="4.11" />
</artifact:dependencies>
<path id="project.classpath">
<path refid="dependency.classpath" />
</path>
</target>
<target name="run-h2owrapper" depends="compile-gwt" description="Run the h2o wrapper sample">
<java classname="edu.oswego.csc480_hci521_2013.h2owrapper.Main">
<classpath>
<pathelement location="${build.gwt}"/>
<path refid="project.classpath"/>
</classpath>
</java>
</target>
<target name="test" depends="compile-tests" description="Run unit tests">
<junit fork="true" haltonfailure="yes">
<batchtest>
<fileset dir="${build}/test">
<include name="**/*Test.class" />
</fileset>
</batchtest>
<formatter type="plain" usefile="false"/>
<classpath>
<pathelement location="${build.gwt}"/>
<pathelement location="${build}/test"/>
<path refid="project.classpath"/>
</classpath>
</junit>
</target>
</project>