forked from mgenov/gwt-scheduler
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
118 lines (103 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?xml version="1.0" encoding="utf-8" ?>
<project name="GwtScheduler" default="build" basedir=".">
<!-- main project props -->
<property environment="env" />
<property name="src.dir" value="src" />
<property name="test.dir" value="test" />
<property name="experimental.dir" value="experimental" />
<property name="lib.dir" value="lib" />
<property name="war.dir" value="war" />
<property name="reports.dir" value="reports" />
<!-- main props -->
<echo message=" OS: ${env.OS}" />
<echo message="JAVA HOME: ${env.JAVA_HOME}" />
<echo message=" GWT HOME: ${env.GWT_HOME}" />
<!-- checks if GWT_HOME is defined -->
<target name="validate-gwt-home" unless="env.GWT_HOME">
<fail message="Please define the GWT_HOME environment property" />
</target>
<!-- main class path -->
<path id="project.class.path">
<pathelement location="${src.dir}" />
<pathelement location="${experimental.dir}" />
<pathelement location="${war.dir}/WEB-INF/classes" />
<pathelement location="${env.GWT_HOME}/gwt-user.jar" />
<pathelement location="${env.GWT_HOME}/gwt-dev-windows.jar" />
<!-- Add any additional non-server libs (such as JUnit) -->
<fileset dir="${war.dir}/WEB-INF/lib" includes="**/*.jar" />
<fileset dir="${lib.dir}" includes="**/*.jar" />
</path>
<!-- test class path -->
<path id="project.test.class.path">
<path refid="project.class.path" />
<pathelement location="${test.dir}" />
</path>
<!-- copy required libs -->
<target name="copy-libs" depends="validate-gwt-home" description="Copy libs to WEB-INF/lib">
<mkdir dir="${war.dir}/WEB-INF/lib" />
<copy todir="${war.dir}/WEB-INF/lib" file="${env.GWT_HOME}/gwt-servlet.jar" />
<!-- Add any additional server libs that need to be copied -->
</target>
<!-- compiles all srcs -->
<target name="compile" depends="copy-libs" description="Compile java source">
<mkdir dir="${war.dir}/WEB-INF/classes" />
<javac includes="**" encoding="utf-8" destdir="${war.dir}/WEB-INF/classes" source="1.5" target="1.5" nowarn="true" debug="true" debuglevel="lines,vars,source">
<classpath refid="project.class.path" />
<src path="${src.dir}" />
<src path="${experimental.dir}" />
<src path="${test.dir}" />
</javac>
</target>
<!-- can add additional arguments like -logLevel INFO or -style PRETTY -->
<target name="gwtc" depends="compile" description="GWT compile to JavaScript">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
<classpath refid="project.class.path" />
<!-- add jvmarg -Xss16M or similar if you see a StackOverflowError -->
<jvmarg value="-Xmx512M" />
<arg value="gwtscheduler.ViewportTests" />
</java>
</target>
<!-- runs hosted mode browser -->
<target name="viewportTests" depends="compile" description="Run hosted mode">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.HostedMode">
<classpath refid="project.class.path" />
<jvmarg value="-Xmx512M" />
<arg value="-startupUrl" />
<arg value="ViewportTests.html" />
<arg value="gwtscheduler.ViewportTests" />
<!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
</java>
</target>
<!-- runs all junit tests -->
<target name="test-all" depends="clean,compile" description="Runs all junit test">
<junit printsummary="yes" haltonfailure="false">
<jvmarg value="-Xmx512M" />
<classpath refid="project.test.class.path" />
<batchtest fork="yes" todir="${reports.dir}">
<fileset dir="${test.dir}" includes="**/*Benchmark.java,**/*Tests.java" />
</batchtest>
</junit>
<!-- generates reports -->
<junitreport todir="${reports.dir}">
<fileset dir="${reports.dir}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${reports.dir}" />
</junitreport>
</target>
<!-- launches benchmark viewer (windows only) -->
<target name="benchmark-viewer" description="Launches the benchmark viewer">
<exec executable="cmd">
<arg value="/c" />
<arg value="benchmarkViewer" />
</exec>
</target>
<!-- builds the project -->
<target name="build" depends="gwtc" description="Build this project" />
<!-- cleans the project -->
<target name="clean" description="Cleans this project">
<delete dir="war/WEB-INF/classes" failonerror="false" />
<delete dir="war/viewporttests" failonerror="false" />
<delete dir="." includes="report-*.xml" />
</target>
</project>