-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
230 lines (213 loc) · 11.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
<?xml version="1.0"?>
<project name="Rest-nfv" default="compile" basedir=".">
<!-- set global properties for this build -->
<property name="src.dir" location="src"/>
<property name="build.dir" location="build"/>
<property name="resources.dir" location="resources"/>
<property name="javadoc.dir" location="docs"/>
<property name="dist.dir" location="dist"/>
<property name="schema.dir" location="WebContent/WEB-INF/classes/xsd" />
<property name="report.dir" location="log" />
<property name="gen_lib.dir" location="lib" />
<property name="lib.dir" location="WebContent/WEB-INF/lib" />
<property name="target.dir" location="target" />
<property name="PORT" value="8080"/>
<property name="URL" value="http://localhost:${PORT}/Rest-nfv"/>
<property name="URL_j2ee" value="http://localhost:${PORT}/Rest-nfv_j2ee"/>
<path id="class.path">
<fileset dir="${gen_lib.dir}">
<include name="**/*.jar" />
</fileset>
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
</path>
<!-- Target: Clean directory -->
<target name="clean" description="clean up">
<!-- Delete the ${build} and ${dist} directories -->
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
<delete>
<fileset dir="${report.dir}" includes="**/*.txt,**/*.xml"/>
</delete>
<delete file="${target.dir}/Rest-nfv.war"/>
</target>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used
by compile -->
<mkdir dir="${build.dir}"/>
<mkdir dir="${report.dir}"/>
<mkdir dir="${javadoc.dir}"/>
<mkdir dir="${target.dir}"/>
</target>
<!-- Target: chk-bindings -->
<target name="-chk-bindings">
<uptodate property="generate-bindings.notRequired" targetfile="${src.dir}/.flagfile">
<srcfiles dir="${schema.dir}" includes="**/*.xsd" />
</uptodate>
</target>
<!-- Target: generate-bindings
insert: unless="generate-bindings.notRequired" to generate if required only
-->
<target name="generate-bindings" depends="init,-chk-bindings" description="Generate bindings from schema">
<exec executable="xjc" failonerror="true" >
<arg value="-d" />
<arg value="${src.dir}" />
<arg value="-p" />
<arg value="it.polito.dp2.rest.nfv.jaxb" />
<arg value="${schema.dir}/nfv.xsd" />
</exec>
<touch file="${src.dir}/.flagfile" />
</target>
<!-- Target: Compile -->
<target name="compile" depends="init, generate-bindings" description="compile the source ">
<property name="debug" value="off"/>
<property name="debuglevel" value="lines,vars,source"/>
<!-- Compile the code from ${src} into ${build} -->
<javac
encoding="ISO-8859-1"
includeantruntime="false"
srcdir="${src.dir}"
destdir="${build.dir}"
debug="on"
debuglevel="${debuglevel}">
<classpath refid="class.path" />
</javac>
</target>
<!-- Target: Automatically generate the javadoc -->
<target name="javadoc" depends="compile" description="generate the javadoc">
<javadoc access="public" author="false"
classpath="WebContent/WEB-INF/lib/com.microsoft.z3.jar;WebContent/WEB-INF/lib/hk2-api-2.5.0-b42.jar;lib/junit/junit.jar;WebContent/WEB-INF/lib/yasson-1.0.jar;WebContent/WEB-INF/lib/jersey-common.jar;WebContent/WEB-INF/lib/jersey-server.jar;WebContent/WEB-INF/lib/javassist-3.22.0-CR2.jar;WebContent/WEB-INF/lib/swagger-jaxrs-1.5.0.jar;WebContent/WEB-INF/lib/persistence-api-1.0.jar;WebContent/WEB-INF/lib/jersey-media-json-binding.jar;WebContent/WEB-INF/lib/swagger-jersey2-jaxrs-1.5.0.jar;WebContent/WEB-INF/lib/javax.inject-1.jar;WebContent/WEB-INF/lib/jaxb-api-2.2.7.jar;WebContent/WEB-INF/lib/hk2-utils-2.5.0-b42.jar;WebContent/WEB-INF/lib/javax.json-1.1.jar;WebContent/WEB-INF/lib/jersey-media-sse.jar;WebContent/WEB-INF/lib/jsr250-api-1.0.jar;WebContent/WEB-INF/lib/hk2-locator-2.5.0-b42.jar;WebContent/WEB-INF/lib/org.osgi.core-4.2.0.jar;lib/com.microsoft.z3.jar;WebContent/WEB-INF/lib/jersey-container-servlet.jar;WebContent/WEB-INF/lib/validation-api-1.1.0.Final.jar;lib/junit/org.hamcrest.core_1.3.0.v201303031735.jar;WebContent/WEB-INF/lib/jersey-media-jaxb.jar;WebContent/WEB-INF/lib/javax.inject-2.5.0-b42.jar;lib/lib4j/log4j-api-2.9.1.jar;WebContent/WEB-INF/lib/jackson-annotations-2.9.3.jar;WebContent/WEB-INF/lib/jackson-core-2.9.3.jar;WebContent/WEB-INF/lib/jboss-interceptors-api_1.1_spec-1.0.0.Beta1.jar;WebContent/WEB-INF/lib/javax.annotation-api-1.2.jar;WebContent/WEB-INF/lib/swagger-annotations-1.5.0.jar;WebContent/WEB-INF/lib/javax.json.bind-api-1.0.jar;WebContent/WEB-INF/lib/commons-lang3-3.7.jar;WebContent/WEB-INF/lib/osgi-resource-locator-1.0.1.jar;WebContent/WEB-INF/lib/jersey-hk2.jar;WebContent/WEB-INF/lib/swagger-core-1.5.0.jar;WebContent/WEB-INF/lib/jersey-container-servlet-core.jar;WebContent/WEB-INF/lib/javax.servlet-api-3.0.1.jar;WebContent/WEB-INF/lib/jersey-client.jar;WebContent/WEB-INF/lib/reflections-0.9.11.jar;WebContent/WEB-INF/lib/slf4j-simple-1.7.25.jar;lib/lib4j/log4j-core-2.9.1.jar;WebContent/WEB-INF/lib/log4j-api-2.9.1.jar;WebContent/WEB-INF/lib/slf4j-api-1.7.25.jar;WebContent/WEB-INF/lib/el-api-2.2.jar;WebContent/WEB-INF/lib/swagger-models-1.5.0.jar;lib/junit/concurrent-junit-1.0.0.jar;WebContent/WEB-INF/lib/javax.ws.rs-api-2.1.jar;WebContent/WEB-INF/lib/jackson-databind-2.9.3.jar;WebContent/WEB-INF/lib/aopalliance-repackaged-2.5.0-b42.jar;WebContent/WEB-INF/lib/jersey-media-multipart-2.26.jar;WebContent/WEB-INF/lib/javax.json-api-1.1.jar;WebContent/WEB-INF/lib/log4j-core-2.9.1.jar;WebContent/WEB-INF/lib/guava-23.6-jre.jar;WebContent/WEB-INF/lib/cdi-api-1.1.jar"
destdir="${javadoc.dir}" nodeprecated="false" nodeprecatedlist="false"
noindex="false" nonavbar="false" notree="false"
packagenames="it.polito.dp2.rest.nfv.client, it.polito.dp2.rest.nfv.db, it.polito.dp2.rest.nfv.jaxb, it.polito.dp2.rest.nfv.resources, it.polito.dp2.rest.nfv.services, it.polito.dp2.rest.nfv.test" source="1.8" sourcepath="src;resources" splitindex="true" use="true" version="true"/>
</target>
<target name="test">
<junit printsummary="yes" haltonfailure="no" showoutput="true">
<!-- test class declaration -->
<classpath location="${build.dir}" />
<test name="it.polito.dp2.rest.nfv.test.TestFromObj"
haltonfailure="no" todir="${report.dir}">
<formatter type="plain" />
<formatter type="xml" />
</test>
<test name="it.polito.dp2.rest.nfv.test.TestFromXml"
haltonfailure="no" todir="${report.dir}">
<formatter type="plain" />
<formatter type="xml" />
</test>
</junit>
<fail if="test_failed" message="*** Some Tests FAILED ***"/>
</target>
<!-- Target: generate war file -->
<target name="war" depends="compile">
<war destfile="${target.dir}/Rest-nfv.war" webxml="WebContent/WEB-INF/web.xml">
<fileset dir = "WebContent">
<include name = "**/*.*"/>
</fileset>
<classes dir="${build.dir}"/>
<classes dir="${resources.dir}"/>
</war>
</target>
<!-- Target: generate war file for j2ee -->
<target name="war_j2ee" depends="compile">
<war destfile="${target.dir}/Rest-nfv_j2ee.war" webxml="WebContent/WEB-INF/web.xml">
<fileset dir = "WebContent">
<exclude name = "WEB-INF/lib/aopalliance-repackaged-2.5.0-b32.jar"/>
<exclude name = "WEB-INF/lib/commons-lang3-3.2.1.jar"/>
<exclude name = "WEB-INF/lib/guava-15.0.jar"/>
<exclude name = "WEB-INF/lib/hk2-api-2.5.0-b32.jar"/>
<exclude name = "WEB-INF/lib/hk2-locator-2.5.0-b32.jar"/>
<exclude name = "WEB-INF/lib/hk2-utils-2.5.0-b32.jar"/>
<exclude name = "WEB-INF/lib/jackson-annotations-2.4.0.jar"/>
<exclude name = "WEB-INF/lib/jackson-core-2.4.2.jar"/>
<exclude name = "WEB-INF/lib/jackson-databind-2.4.2.jar"/>
<exclude name = "WEB-INF/lib/javassist-3.20.0-GA.jar"/>
<exclude name = "WEB-INF/lib/javax.annotation-api-1.2.jar"/>
<exclude name = "WEB-INF/lib/javax.inject-2.5.0-b32.jar"/>
<exclude name = "WEB-INF/lib/javax.ws.rs-api-2.0.1.jar"/>
<exclude name = "WEB-INF/lib/jaxb-api-2.2.12-b140109.1041.jar"/>
<exclude name = "WEB-INF/lib/jersey-client-2.25.1.jar"/>
<exclude name = "WEB-INF/lib/jersey-common-2.25.1.jar"/>
<exclude name = "WEB-INF/lib/jersey-container-servlet-2.25.1.jar"/>
<exclude name = "WEB-INF/lib/jersey-container-servlet-core-2.25.1.jar"/>
<exclude name = "WEB-INF/lib/jersey-core-1.19.1.jar"/>
<exclude name = "WEB-INF/lib/jersey-entity-filtering-2.25.1.jar"/>
<exclude name = "WEB-INF/lib/jersey-guava-2.25.1.jar"/>
<exclude name = "WEB-INF/lib/jersey-media-jaxb-2.25.1.jar"/>
<exclude name = "WEB-INF/lib/jersey-media-moxy-2.25.1.jar"/>
<exclude name = "WEB-INF/lib/jersey-media-multipart-2.25.1.jar"/>
<exclude name = "WEB-INF/lib/jersey-server-2.25.1.jar"/>
<exclude name = "WEB-INF/lib/org.eclipse.persistence.moxy-2.6.0.jar"/>
<exclude name = "WEB-INF/lib/osgi-resource-locator-1.0.1.jar"/>
<exclude name = "WEB-INF/lib/reflections-0.9.9.jar"/>
<exclude name = "WEB-INF/lib/swagger-annotations-1.5.0.jar"/>
<exclude name = "WEB-INF/lib/swagger-core-1.5.0.jar"/>
<exclude name = "WEB-INF/lib/swagger-jaxrs-1.5.0.jar"/>
<exclude name = "WEB-INF/lib/swagger-jersey2-jaxrs-1.5.0.jar"/>
<exclude name = "WEB-INF/lib/swagger-models-1.5.0.jar"/>
<exclude name = "WEB-INF/lib/validation-api-1.1.0.Final.jar"/>
</fileset>
<classes dir="${build.dir}"/>
<classes dir="${resources.dir}"/>
</war>
</target>
<!-- Target: deploy war -->
<target name="deploy" depends="war" >
<sequential>
<antcall target="deployWS"/>
</sequential>
</target>
<!-- Target: deploy war -->
<target name="redeploy" depends="war" >
<sequential>
<antcall target="undeployWS"/>
<antcall target="deployWS"/>
</sequential>
</target>
<!-- Target: deploy war_j2ee -->
<target name="deploy_j2ee" depends="war_j2ee">
<sequential>
<antcall target="deployWS">
<param name="service.name" value="Rest-nfv_j2ee" />
</antcall>
</sequential>
</target>
<!-- Tomcat Properties -->
<property name="service.name" value="Rest-nfv"/>
<property name="root.location" value="${basedir}"/>
<import file="tomcat-build.xml"/>
<!-- Ant Script for controlling Tomcat-->
<target name="testWS">
<junit printsummary="yes" haltonfailure="no" showoutput="true">
<!-- Project classpath, must include junit.jar -->
<classpath location="lib/junit/junit.jar" />
<classpath location="lib/junit/concurrent-junit-1.0.0.jar" />
<classpath location="lib/junit/org.hamcrest.core_1.3.0.v201303031735.jar" />
<classpath location="lib/com.microsoft.z3.jar" />
<classpath location="lib/lib4j/log4j-api-2.9.1.jar" />
<classpath location="lib/lib4j/log4j-core-2.9.1.jar" />
<classpath>
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
</classpath>
<!-- test class -->
<sysproperty key="it.polito.dp2.rest.nfv.test.URL" value="${URL}"/>
<classpath location="${build.dir}" />
<test name="it.polito.dp2.rest.nfv.test.TestFromObj"
haltonfailure="no" todir="${report.dir}">
<formatter type="plain" />
<formatter type="xml" />
</test>
<test name="it.polito.dp2.rest.nfv.test.TestFromXml"
haltonfailure="no" todir="${report.dir}">
<formatter type="plain" />
<formatter type="xml" />
</test>
</junit>
<fail if="test_failed" message="*** Some Tests FAILED ***"/>
</target>
</project>