-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
152 lines (137 loc) · 5.44 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"?>
<project name="Rest-OFAR" default="compile" basedir=".">
<!-- set global properties for this build -->
<property name="name" value="Optimized-Firewall-Anomaly-Resolution"/>
<property name="src.dir" location="src"/>
<property name="gen-src.dir" location="gen-src"/>
<property name="build.dir" location="build"/>
<property name="resources.dir" location="${src.dir}/rest/resources"/>
<property name="schema.dir" location="xsd"/>
<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}/${name}"/>
<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>
<fileset dir="${build.dir}">
<include name="**/*.class"/>
</fileset>
</delete>
<delete>
<fileset dir="${target.dir}"/>
</delete>
<!--
<delete dir="${gen-src.dir}" />
-->
</target>
<target name="init">
<tstamp/>
<mkdir dir="${build.dir}"/>
</target>
<target name="-chk-bindings">
<uptodate property="generate-bindings.notRequired" targetfile="${src.dir}/.flagfile">
<srcfiles dir="${schema.dir}" includes="**/*.xsd"/>
</uptodate>
</target>
<target name="generate-bindings" depends="init,-chk-bindings" description="Generate bindings from schema">
<exec executable="xjc" failonerror="true">
<arg value="-d"/>
<arg value="${gen-src.dir}"/>
<arg value="-p"/>
<arg value="ofar.generated.classes.conflicts"/>
<arg value="${schema.dir}/conflict_schema.xsd"/>
</exec>
<exec executable="xjc" failonerror="true">
<arg value="-d"/>
<arg value="${gen-src.dir}"/>
<arg value="-p"/>
<arg value="ofar.generated.classes.contradiction"/>
<arg value="${schema.dir}/contradict_solution.xsd"/>
</exec>
<exec executable="xjc" failonerror="true">
<arg value="-d"/>
<arg value="${gen-src.dir}"/>
<arg value="-p"/>
<arg value="ofar.generated.classes.correlation"/>
<arg value="${schema.dir}/correlation_solution.xsd"/>
</exec>
<exec executable="xjc" failonerror="true">
<arg value="-d"/>
<arg value="${gen-src.dir}"/>
<arg value="-p"/>
<arg value="ofar.generated.classes.input"/>
<arg value="${schema.dir}/webservice_input_schema.xsd"/>
</exec>
<exec executable="xjc" failonerror="true">
<arg value="-d"/>
<arg value="${gen-src.dir}"/>
<arg value="-p"/>
<arg value="ofar.generated.classes.solveRequest"/>
<arg value="${schema.dir}/solve_request.xsd"/>
</exec>
<exec executable="xjc" failonerror="true">
<arg value="-d"/>
<arg value="${gen-src.dir}"/>
<arg value="-p"/>
<arg value="ofar.generated.classes.rules"/>
<arg value="${schema.dir}/firewall_rules.xsd"/>
</exec>
<exec executable="xjc" failonerror="true">
<arg value="-d"/>
<arg value="${gen-src.dir}"/>
<arg value="-p"/>
<arg value="ofar.generated.classes.shadowingConflict"/>
<arg value="${schema.dir}/shadowing_conflict_solution.xsd"/>
</exec>
<touch file="${gen-src.dir}/.flagfile"/>
</target>
<!-- Target: Compile -->
<target name="compile" depends="init" 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}:${gen-src.dir}" destdir="${build.dir}"
debug="on" debuglevel="${debuglevel}">
<classpath refid="class.path"/>
</javac>
</target>
<!-- Target: generate war file -->
<target name="war" depends="compile">
<war destfile="${target.dir}/${name}.war" webxml="WebContent/WEB-INF/web.xml">
<fileset dir="WebContent">
<include name="**/*.*"/>
</fileset>
<classes dir="${build.dir}"/>
<zipfileset dir="." includes="xsd/**" prefix="WEB-INF/classes"/>
</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>
<!-- Tomcat Properties -->
<property name="service.name" value="${name}"/>
<property name="root.location" value="${basedir}"/>
<import file="tomcat-build.xml"/>
<!-- Ant Script for controlling Tomcat-->
</project>