-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
204 lines (189 loc) · 9.61 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<?xml version="1.0"?>
<project name="guice" default="compile">
<property name="DynamicImport-Package" value="org.aopalliance.intercept"/>
<property name="exclude.imports" value="!com.google.common.*,!net.sf.*,!org.objectweb.*"/>
<import file="common.xml"/>
<path id="compile.classpath">
<fileset dir="${lib.dir}" includes="*.jar"/>
<fileset dir="${lib.dir}/build" includes="*.jar"/>
</path>
<target name="jar" depends="jar.withdeps, manifest" description="Build jar.">
<jar jarfile="${build.dir}/dist/guice-${version}.jar"
manifest="${build.dir}/META-INF/MANIFEST.MF">
<zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"/>
</jar>
</target>
<target name="dist" depends="distjars, javadoc"
description="Build entire distribution.">
<ant antfile="servlet/build.xml" target="distjars" inheritAll="false"/>
<ant antfile="spring/build.xml" target="distjars" inheritAll="false"/>
<ant antfile="struts2/plugin/build.xml" target="distjars" inheritAll="false"/>
<ant antfile="extensions/assistedinject/build.xml" target="distjars" inheritAll="false"/>
<ant antfile="extensions/jmx/build.xml" target="distjars" inheritAll="false"/>
<ant antfile="extensions/jndi/build.xml" target="distjars" inheritAll="false"/>
<ant antfile="extensions/throwingproviders/build.xml" target="distjars" inheritAll="false"/>
<ant antfile="extensions/multibindings/build.xml" target="distjars" inheritAll="false"/>
<copy toDir="${build.dir}/dist">
<fileset dir="servlet/build" includes="*.jar" excludes="*-with-deps.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
<fileset dir="spring/build" includes="*.jar" excludes="*-with-deps.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
<fileset dir="struts2/plugin/build" includes="*.jar" excludes="*-with-deps.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
<fileset dir="extensions/assistedinject/build" includes="*.jar" excludes="*-with-deps.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
<fileset dir="extensions/jmx/build" includes="*.jar" excludes="*-with-deps.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
<fileset dir="extensions/jndi/build" includes="*.jar" excludes="*-with-deps.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
<fileset dir="extensions/throwingproviders/build" includes="*.jar" excludes="*-with-deps.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
<fileset dir="extensions/multibindings/build" includes="*.jar" excludes="*-with-deps.jar"/>
</copy>
<copy toDir="${build.dir}/dist" file="COPYING"/>
<copy toDir="${build.dir}/dist">
<fileset dir="${lib.dir}"
includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
<fileset dir="${build.dir}" includes="javadoc/**/*"/>
</copy>
<zip destfile="${build.dir}/guice-${version}.zip">
<zipfileset dir="${build.dir}/dist" prefix="guice-${version}" excludes="*-src.jar"/>
</zip>
<zip destfile="${build.dir}/guice-${version}-src.zip">
<zipfileset dir="." prefix="guice-${version}-src"
excludes="build/**/*,build,.svn,.svn/**/*,**/.svn,classes,classes/**/*"/>
</zip>
</target>
<target name="test.dist"
depends="jar, test.compile"
description="Execute JUnit tests against distribution jar.">
<java fork="true"
classname="junit.textui.TestRunner"
failonerror="true"
taskname="junit">
<classpath>
<pathelement location="${build.dir}/test"/>
<pathelement location="${build.dir}/dist/guice-${version}.jar"/>
<pathelement location="lib/aopalliance.jar"/>
<pathelement location="lib/build/junit.jar"/>
<pathelement location="lib/build/servlet-api-2.5.jar"/>
<pathelement location="lib/build/easymock.jar"/>
</classpath>
<arg value="com.google.inject.AllTests"/>
<syspropertyset>
<propertyref name="guice.custom.loader"/>
</syspropertyset>
</java>
</target>
<target name="javadoc"
description="Generate Javadocs.">
<mkdir dir="${build.dir}/javadoc"/>
<javadoc packagenames="${javadoc.packagenames}"
destdir="${build.dir}/javadoc"
author="false"
protected="true"
windowtitle="Guice 2.0 API">
<sourcepath>
<pathelement location="${src.dir}"/>
<pathelement location="${servlet.src.dir}"/>
<pathelement location="${spring.src.dir}"/>
<pathelement location="${assistedinject.src.dir}"/>
<pathelement location="${jmx.src.dir}"/>
<pathelement location="${jndi.src.dir}"/>
<pathelement location="${throwingproviders.src.dir}"/>
<pathelement location="${multibindings.src.dir}"/>
</sourcepath>
<classpath refid="compile.classpath"/>
<classpath>
<fileset dir="servlet/lib/build" includes="*.jar"/>
</classpath>
<link href="http://aopalliance.sourceforge.net/doc"/>
<link href="http://java.sun.com/javase/6/docs/api"/>
<link href="http://www.springframework.org/docs/api/"/>
</javadoc>
<!-- generate core javadocs, used only for its left-side nav -->
<mkdir dir="${build.dir}/javadoc-core"/>
<javadoc packagenames="${javadoc.packagenames}"
destdir="${build.dir}/javadoc-core"
author="false"
protected="true"
windowtitle="Guice 2.0 Core API"
sourcepath="${src.dir}">
<classpath refid="compile.classpath"/>
<link href="http://aopalliance.sourceforge.net/doc"/>
<link href="http://java.sun.com/javase/6/docs/api"/>
</javadoc>
<!-- setup the left-side navigation frames to toggle between core and all classes -->
<move file="${build.dir}/javadoc/overview-frame.html" tofile="${build.dir}/javadoc/overview-frame-with-extensions.html"/>
<copy file="${build.dir}/javadoc-core/overview-frame.html" tofile="${build.dir}/javadoc/overview-frame.html"/>
<replace file="${build.dir}/javadoc/overview-frame.html" token="<A HREF="allclasses-frame.html" target="packageFrame">All Classes</A></FONT>"
value="<A HREF="allclasses-frame.html" target="packageFrame"><b>Core</b></A>
&nbsp;
<a href='overview-frame-with-extensions.html'>Show Extensions</a>
</FONT>"/>
<replace file="${build.dir}/javadoc/overview-frame-with-extensions.html" token="<A HREF="allclasses-frame.html" target="packageFrame">All Classes</A></FONT>"
value="<A HREF="allclasses-frame-with-extensions.html" target="packageFrame"><b>All</b></A>
&nbsp;
<a href='overview-frame.html'>Hide Extensions</a>
</FONT>"/>
<move file="${build.dir}/javadoc/allclasses-frame.html" tofile="${build.dir}/javadoc/allclasses-frame-with-extensions.html"/>
<copy file="${build.dir}/javadoc-core/allclasses-frame.html" tofile="${build.dir}/javadoc/allclasses-frame.html"/>
<replace file="${build.dir}/javadoc/allclasses-frame.html" token="All Classes" value="Core Classes"/>
<move file="${build.dir}/javadoc-core/overview-summary.html" tofile="${build.dir}/javadoc/overview-summary.html"/>
</target>
<target name="no_aop"
description="Create a copy of the Guice source that doesn't do bytecode generation.">
<taskdef name="munge" classname="MungeTask" classpath="lib/build/munge.jar"/>
<mkdir dir="build/no_aop"/>
<munge todir="build/no_aop">
<fileset dir=".">
<!-- exclude generated files -->
<exclude name="build/**"/>
<exclude name="classes/**"/>
<exclude name="latest-api-diffs/**"/>
<exclude name="javadoc/**"/>
<exclude name="latest-javadoc/**"/>
<!-- exclude AOP-specific libraries -->
<exclude name="lib/aopalliance.jar"/>
<exclude name="lib/build/asm-*.jar"/>
<exclude name="lib/build/cglib-*.jar"/>
<!-- exclude AOP-specific classes -->
<exclude name="**/LineNumbers.java"/>
<exclude name="**/InterceptorBindingProcessor.java"/>
<exclude name="**/ProxyFactory.java"/>
<exclude name="**/ProxyFactoryTest.java"/>
<exclude name="**/InterceptorStackCallback.java"/>
<exclude name="**/InterceptorBinding.java"/>
<exclude name="**/MethodAspect.java"/>
<exclude name="**/MethodInterceptionTest.java"/>
<exclude name="**/BytecodeGenTest.java"/>
<exclude name="**/IntegrationTest.java"/>
<exclude name="**/MethodInterceptionTest.java"/>
</fileset>
<arg value="-DNO_AOP" />
</munge>
<replace file="build/no_aop/common.xml" token="<zipfileset src="${common.basedir}/lib/build/asm-3.1.jar"/>" value=""/>
<replace file="build/no_aop/common.xml" token="<zipfileset src="${common.basedir}/lib/build/cglib-2.2.1-snapshot.jar"/>" value=""/>
</target>
<target name="clean.all"
depends="clean"
description="Remove generated files.">
<ant dir="servlet" antfile="build.xml" target="clean"/>
<ant dir="spring" antfile="build.xml" target="clean"/>
<ant dir="struts2/plugin" antfile="build.xml" target="clean"/>
<ant dir="extensions/assistedinject" antfile="build.xml" target="clean"/>
<ant dir="extensions/jmx" antfile="build.xml" target="clean"/>
<ant dir="extensions/jndi" antfile="build.xml" target="clean"/>
<ant dir="extensions/throwingproviders" antfile="build.xml" target="clean"/>
<ant dir="extensions/multibindings" antfile="build.xml" target="clean"/>
</target>
</project>