-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.xml
287 lines (261 loc) · 13.1 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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. -->
<project basedir="." default="build" name="flowspace_firewall">
<property environment="env"/>
<property name="floodlight.location" value="../floodlight"/>
<property name="ECLIPSE_HOME" value="../../../Applications/eclipse"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.6"/>
<property name="source" value="1.6"/>
<path id="floodlight.classpath">
<pathelement location="lib/commons-collections4-4.0.jar" />
<pathelement location="${floodlight.location}/target/bin" />
<pathelement location="${floodlight.location}/target/bin-test" />
<pathelement location="${floodlight.location}/lib/args4j-2.0.16.jar"/>
<pathelement location="${floodlight.location}/lib/cglib-nodep-2.2.2.jar"/>
<pathelement location="${floodlight.location}/lib/concurrentlinkedhashmap-lru-1.2.jar"/>
<pathelement location="${floodlight.location}/lib/derby-10.9.1.0.jar"/>
<pathelement location="${floodlight.location}/lib/commons-collections4-4.0.jar"/>
<pathelement location="${floodlight.location}/lib/findbugs-annotations-2.0.1.jar"/>
<pathelement location="${floodlight.location}/lib/findbugs-jsr305-2.0.1.jar"/>
<pathelement location="${floodlight.location}/lib/guava-13.0.1.jar"/>
<pathelement location="${floodlight.location}/lib/jackson-annotations-2.1.4.jar"/>
<pathelement location="${floodlight.location}/lib/jackson-core-2.1.4.jar"/>
<pathelement location="${floodlight.location}/lib/jackson-databind-2.1.4.jar"/>
<pathelement location="${floodlight.location}/lib/jackson-dataformat-csv-2.1.4.jar"/>
<pathelement location="${floodlight.location}/lib/jackson-dataformat-smile-2.1.4.jar"/>
<pathelement location="${floodlight.location}/lib/jackson-dataformat-xml-2.1.4.jar"/>
<pathelement location="${floodlight.location}/lib/jackson-dataformat-yaml-2.1.4.jar"/>
<pathelement location="${floodlight.location}/lib/junit-4.8.2.jar"/>
<pathelement location="${floodlight.location}/lib/jython-2.5.2.jar"/>
<pathelement location="${floodlight.location}/lib/libthrift-0.9.0.jar"/>
<pathelement location="${floodlight.location}/lib/logback-classic-1.0.0.jar"/>
<pathelement location="${floodlight.location}/lib/logback-core-1.0.0.jar"/>
<pathelement location="${floodlight.location}/lib/netty-3.2.6.Final.jar"/>
<pathelement location="${floodlight.location}/lib/objenesis-1.2.jar"/>
<pathelement location="${floodlight.location}/lib/org.easymock-3.1.jar"/>
<pathelement location="${floodlight.location}/lib/org.restlet-2.2M3.jar"/>
<pathelement location="${floodlight.location}/lib/org.restlet.ext.jackson-2.2M3.jar"/>
<pathelement location="${floodlight.location}/lib/org.restlet.ext.simple-2.2M3.jar"/>
<pathelement location="${floodlight.location}/lib/org.restlet.ext.slf4j-2.2M3.jar"/>
<pathelement location="${floodlight.location}/lib/simple-5.1.1.jar"/>
<pathelement location="${floodlight.location}/lib/slf4j-api-1.6.4.jar"/>
</path>
<path id="flowspace_firewall.classpath">
<pathelement location="bin"/>
<pathelement location="${floodlight.location}/lib"/>
<path refid="floodlight.classpath"/>
</path>
<path id="run.FloodlightLaunch.bootclasspath">
<fileset dir="${java.home}/lib" includes="*.jar"/>
<fileset dir="${java.home}/lib/ext" includes="*.jar"/>
</path>
<path id="classpath-test">
<pathelement location="${floodlight.location}/lib"/>
<path refid="floodlight.classpath"/>
<pathelement location="bin"/>
</path>
<patternset id="lib">
<include name="commons-collections4-4.0.jar"/>
</patternset>
<patternset id="lib-test">
<include name="junit-4.8.2.jar"/>
<include name="org.easymock-3.1.jar"/>
<include name="objenesis-1.2.jar"/> <!-- required by easymock to mock classes -->
<include name="cglib-nodep-2.2.2.jar"/> <!-- required by easymock to mock classes -->
</patternset>
<patternset id="lib-cobertura">
<include name="cobertura-1.9.4.1.jar"/>
<include name="asm-3.0.jar"/>
<include name="asm-tree-3.0.jar"/>
<include name="oro/jakarta-oro-2.0.8.jar"/>
<include name="log4j-1.2.9.jar"/>
</patternset>
<path id="classpath-cobertura">
<fileset dir="${floodlight.location}/lib/">
<patternset refid="lib-cobertura"/>
</fileset>
</path>
<taskdef classpathref="classpath-cobertura" resource="tasks.properties"/>
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="src/main/java">
<exclude name="**/*.java"/>
</fileset>
</copy>
<mkdir dir="bin-test"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="src/test/java">
<exclude name="**/*.java"/>
</fileset>
</copy>
<mkdir dir="test"/>
<mkdir dir="reports/"/>
</target>
<target name="clean" depends="clean-instrument,clean-test">
<delete dir="bin"/>
</target>
<target depends="clean" name="cleanall">
<ant antfile="build.xml" dir="${floodlight.location}" inheritAll="false" target="clean"/>
</target>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects">
<ant antfile="build.xml" dir="${floodlight.location}" inheritAll="false" target="dist">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
</target>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
<src path="src/main/java"/>
<classpath refid="flowspace_firewall.classpath"/>
</javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="build"/>
</target>
<target name="FloodlightLaunch">
<java classname="net.floodlightcontroller.core.Main" failonerror="true" fork="yes">
<classpath refid="flowspace_firewall.classpath"/>
<bootclasspath>
<path refid="run.FloodlightLaunch.bootclasspath"/>
</bootclasspath>
</java>
</target>
<target name="compile-tests" depends="compile-test"/>
<target name="compile-test" depends="build-project">
<javac includeAntRuntime="false" debug="true"
srcdir="src/test/java"
classpath="bin/"
classpathref="flowspace_firewall.classpath"
destdir="bin-test/"/>
</target>
<target name="test" depends="compile-test">
<junit fork="true" forkmode="once"
failureproperty="junit.failure"
printsummary="on">
<sysproperty key="net.sourceforge.cobertura.datafile"
file="${target}/cobertura.ser" />
<classpath>
<pathelement location="reports/coverage"/>
<pathelement location="bin-coverage/" />
<pathelement location="bin/"/>
<pathelement location="bin-test/"/>
<path refid="classpath-test"/>
<path refid="classpath-cobertura"/>
</classpath>
<formatter type="xml" usefile="true" />
<batchtest todir="test/">
<fileset dir="src/test/java/">
<include name="**/*.java"/>
</fileset>
</batchtest>
</junit>
<mkdir dir="reports/" />
<junitreport todir="reports/">
<fileset dir="test/">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="reports/html"/>
</junitreport>
<fail if="junit.failure" message="Unit test(s) failed. See reports!"/>
</target>
<target name="dist" depends="build-project,compile-test">
<jar destfile="bin/flowspace_firewall.jar" filesetmanifest="mergewithoutmain">
<fileset dir="bin/"/>
<zipgroupfileset dir="lib/">
<patternset refid="lib"/>
</zipgroupfileset>
</jar>
<jar destfile="bin/config_test.jar" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Main-Class" value="ConfigTest"/>
<attribute name="Class-Path" value="."/>
</manifest>
<fileset dir="bin"/>
<fileset dir="${floodlight.location}/target/bin"/>
<fileset dir="${floodlight.location}/target/bin-test"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/args4j-2.0.16.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/cglib-nodep-2.2.2.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/concurrentlinkedhashmap-lru-1.2.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/derby-10.9.1.0.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/findbugs-annotations-2.0.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/findbugs-jsr305-2.0.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/guava-13.0.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/jackson-annotations-2.1.4.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/jackson-core-2.1.4.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/jackson-databind-2.1.4.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/jackson-dataformat-csv-2.1.4.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/jackson-dataformat-smile-2.1.4.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/jackson-dataformat-xml-2.1.4.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/jackson-dataformat-yaml-2.1.4.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/junit-4.8.2.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/jython-2.5.2.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/libthrift-0.9.0.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/logback-classic-1.0.0.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/logback-core-1.0.0.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/netty-3.2.6.Final.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/objenesis-1.2.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/org.easymock-3.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/org.restlet-2.2M3.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/org.restlet.ext.jackson-2.2M3.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/org.restlet.ext.simple-2.2M3.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/org.restlet.ext.slf4j-2.2M3.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/simple-5.1.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${floodlight.location}/lib/slf4j-api-1.6.4.jar"/>
<zipfileset excludes="META-INF/*.SF" src="lib/commons-collections4-4.0.jar"/>
</jar>
</target>
<target name="clean-test">
<delete dir="test/" />
<delete dir="bin-test/" />
</target>
<target name="clean-instrument">
<delete file="${target}/cobertura.ser"/>
<delete dir="bin-coverage/" />
<delete dir="reports/"/>
<delete dir="coverage/"/>
</target>
<target name="instrument" depends="build-project,compile-test,clean-instrument">
<mkdir dir="bin-coverage"/>
<mkdir dir="${target}"/>
<cobertura-instrument datafile="${target}/cobertura.ser"
todir="bin-coverage/"
classpathref="classpath-cobertura">
<ignore regex="edu.iu.grnoc.flowspace_firewall.web.*" />
<fileset dir="bin/">
<include name="**/*.class"/>
</fileset>
</cobertura-instrument>
</target>
<target name="coverage-report">
<mkdir dir="coverage/" />
<cobertura-report format="html"
datafile="${target}/cobertura.ser"
destdir="coverage/"
srcdir="src/main/java"/>
<cobertura-report format="xml"
datafile="${target}/cobertura.ser"
destdir="coverage/"
srcdir="src/main/java"/>
</target>
<target name="coverage" depends="instrument,test,coverage-report"/>
</project>