-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
152 lines (131 loc) · 5.76 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
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<project basedir="." default="build" name="gwt-oauth2">
<property environment="env" />
<property name="gwtdir" value="${env.GWT_DIR}" />
<property name="junitdir" value="${env.JUNIT_DIR}" />
<property name="release" value="0.1-alpha" />
<property name="src.dir" value="${basedir}/src" />
<property name="test.dir" value="${basedir}/test" />
<property name="build.dir" value="${basedir}/build" />
<property name="build.classes.dir" value="${basedir}/build/classes" />
<property name="build.javadoc.dir" value="${basedir}/build/javadoc" />
<property name="build.test.classes.dir" value="${basedir}/build/test/classes" />
<property name="build.dist.dir" value="${basedir}/build/dist" />
<target name="verify" description="Check that necessary dependencies were found">
<available file="${gwtdir}/gwt-user.jar" property="foundgwtuserjar" />
<fail unless="foundgwtuserjar" message="Cannot find gwt-user.jar" />
<available file="${gwtdir}/gwt-dev.jar" property="foundgwtdevjar" />
<fail unless="foundgwtdevjar" message="Cannot find gwt-dev.jar" />
</target>
<target name="test.verify" description="Check that necessary test dependencies were found">
<available file="${junitdir}/junit.jar" property="foundjunitjar" />
<fail unless="foundjunitjar" message="Cannot find junit.jar" />
</target>
<target name="build" depends="clean, verify" description="Compile GWT sources with javac">
<mkdir dir="${build.classes.dir}"/>
<copy includeemptydirs="false" todir="${build.classes.dir}">
<fileset dir="${src.dir}" />
</copy>
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="${build.classes.dir}">
<src path="${src.dir}"/>
<classpath>
<pathelement location="${build.classes.dir}"/>
<pathelement location="${gwtdir}/gwt-user.jar" />
</classpath>
</javac>
</target>
<target name="jar" depends="build" description="Generate a JAR of the library">
<mkdir dir="${build.dist.dir}/gwt-oauth2-${release}" />
<jar jarfile="${build.dist.dir}/gwt-oauth2-${release}/gwt-oauth2-${release}.jar">
<fileset dir="${build.classes.dir}" />
</jar>
</target>
<target name="test.build" depends="jar, test.verify" description="Compile JUnit tests">
<mkdir dir="${build.test.classes.dir}" />
<javac srcdir="${test.dir}" debug="on" destdir="${build.test.classes.dir}">
<compilerarg value="-Xlint:all" />
<classpath>
<pathelement location="${build.dist.dir}/gwt-oauth2-${release}.jar" />
<pathelement location="${build.classes.dir}"/>
<pathelement location="${gwtdir}/gwt-user.jar" />
<pathelement location="${junitdir}/junit.jar" />
</classpath>
</javac>
</target>
<!-- TODO(jasonhall): This fails because we don't include a junit.jar with the
ant task definition... -->
<target name="test" depends="test.build" description="Run JUnit tests">
<junit showoutput="true">
<classpath>
<pathelement location="${build.dist.dir}/gwt-oauth2-${release}.jar" />
<pathelement location="${test.dir}" />
<pathelement location="${build.test.classes.dir}" />
<pathelement location="${build.classes.dir}"/>
<pathelement location="${gwtdir}/gwt-user.jar" />
<pathelement location="${gwtdir}/gwt-dev.jar" />
<pathelement location="${junitdir}/junit.jar" />
</classpath>
<formatter type="plain" usefile="false" />
<batchtest>
<fileset dir="${test.dir}">
</fileset>
</batchtest>
</junit>
</target>
<target name="javadoc">
<delete dir="${build.javadoc.dir}" />
<mkdir dir="${build.javadoc.dir}" />
<javadoc packagenames="com.google.api.gwt.oauth2.*"
destdir="${build.javadoc.dir}"
encoding="UTF-8"
docencoding="UTF-8"
charset="UTF-8"
use="true"
author="true"
protected="true"
linksource="true"
additionalparam="-notimestamp"
windowtitle="OAuth 2.0 client library for GWT - ${release}">
<sourcepath>
<pathelement location="src" />
</sourcepath>
<link href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/" />
<link href="http://java.sun.com/javase/6/docs/api" />
</javadoc>
</target>
<target name="script-javac" depends="clean, verify" description="Compile sources with javac">
<mkdir dir="${build.classes.dir}" />
<javac srcdir="${src.dir}" includes="${src.dir}/**/*.java" encoding="UTF-8"
destdir="${build.classes.dir}">
<classpath>
<pathelement location="${build.classes.dir}" />
<pathelement location="${src.dir}" />
<pathelement location="../../src/" />
<pathelement location="${gwtdir}/gwt-user.jar" />
</classpath>
</javac>
<copy todir="${build.classes.dir}">
<fileset dir="${src.dir}" />
</copy>
</target>
<target name="script-build" depends="script-javac" description="Compile sources with GWT compiler">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
<classpath>
<pathelement location="${build.classes.dir}" />
<pathelement location="${src.dir}" />
<pathelement location="${src.dir}/script/" />
<pathelement location="${gwtdir}/gwt-user.jar" />
<pathelement location="${gwtdir}/gwt-dev.jar" />
</classpath>
<jvmarg value="-Xmx256M" />
<arg value="com.google.api.gwt.oauth2.script.OAuth2Script" />
<arg value="-XdisableClassMetadata" />
<arg value="-XdisableCastChecking" />
</java>
</target>
<target name="clean" description="Remove generated files">
<delete dir="war" />
<delete dir="${build.classes.dir}" />
</target>
</project>