-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_ff.xml
165 lines (133 loc) · 6.25 KB
/
build_ff.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
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="compile" name="Geograph">
<!-- first, access environment variables as properties -->
<property environment="env"/>
<!-- next, read project's property file -->
<property file="build.properties"/>
<property name="NUM_EBS" value="10" /> <!-- default: 10 -->
<property name="NUM_ITEMS" value="1000" /> <!-- default: 1000 -->
<!-- main src dirs -->
<property name="src.dir" location="src"/>
<property name="common.src.dir" location="${src.dir}/common"/>
<property name="ff.src.dir" location="${src.dir}/common/"/>
<!-- common src dirs -->
<property name="dml.common.src.dir" location="${common.src.dir}/dml"/>
<property name="java.common.src.dir" location="${common.src.dir}/java"/>
<property name="template.common.src.dir" location="${common.src.dir}/template-java"/>
<!-- fenix-framework specific dirs -->
<property name="java.ff.src.dir" location="${ff.src.dir}/java"/>
<!-- other project dirs -->
<property name="lib.dir" location="lib"/>
<property name="config.dir" location="config"/>
<property name="build.dir" location="classes"/>
<property name="dist.dir" location="dist"/>
<property name="domain.dml" location="${dml.common.src.dir}/geograph.dml"/>
<property name="build-devel.dir" location="classes-devel"/>
<property name="src-devel.dir" location="src-devel"/>
<property name="src.gen.dir" location="src_gen"/>
<property name="java.src-devel.dir" location="${src-devel.dir}/java"/>
<!-- The encoding of all the source files should be the same! -->
<property name="javac.encoding" value="UTF-8"/>
<!-- java.file.encoding should match your terminal's encoding -->
<property name="java.file.encoding" value="UTF-8"/>
<import file="dml-generate.xml"/>
<path id="project.class.path">
<pathelement path="${build.dir}"/>
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
<pathelement path="${build-devel.dir}"/>
</path>
<path id="ff.project.class.path">
<pathelement path="${build.dir}"/>
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="clean-all" description="Removes any generated files">
<delete dir="${build.dir}"/>
<delete dir="${build-devel.dir}"/>
<delete dir="${dist.dir}"/>
<delete dir="${src.gen.dir}"/>
</target>
<target name="init" >
<mkdir dir="${build.dir}"/>
<mkdir dir="${build-devel.dir}"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="generate-domain">
<dml-compile dml="${domain.dml}" java-sources="${java.common.src.dir}" java-gen="${src.gen.dir}">
<classpath refid="project.class.path"/>
</dml-compile>
</target>
<target name="generate-templates">
<filter token="sessionIdString" value="${session.id.string}" />
<filter token="num.item" value="${NUM_ITEMS}" />
<copy todir="${src.gen.dir}" filtering="on" overwrite="true">
<fileset dir="${template.common.src.dir}">
<include name="**/*.java" />
</fileset>
</copy>
</target>
<target name="compile" depends="init,generate-domain,generate-templates" description="Compiles all the source code">
<javac destdir="${build.dir}" extdirs="${lib.dir}" target="1.5" debug="on" encoding="${javac.encoding}">
<src path="${java.common.src.dir}"/>
<src path="${java.ff.src.dir}"/>
<src path="${src.gen.dir}"/>
<classpath refid="ff.project.class.path"/>
</javac>
<post-process-domain dir="${build.dir}" dml="${domain.dml}">
<jvmarg value="-Dfile.encoding=${java.file.encoding}" />
<classpath refid="ff.project.class.path"/>
</post-process-domain>
<copy todir="${build.dir}">
<fileset dir="${dml.common.src.dir}" />
<fileset dir="${config.dir}" />
</copy>
</target>
<!-- <target name="generates-db" depends="compile" description="generates the data for the application">
<java classname="it.algo.geograph.populate.Geograph_Populate" fork="true">
<jvmarg value="-Dfile.encoding=${java.file.encoding}" />
<jvmarg value="-Xmx1536m"/>
<jvmarg value="-Xms512m"/>
<classpath refid="ff.project.class.path"/>
<arg value="${NUM_EBS}" />
<arg value="${NUM_ITEMS}" />
</java>
</target>
-->
<property name="app.war.file" location="${dist.dir}/geographFenix.war" />
<target name="create-war" depends="init,compile" description="creates the geographFenix.war file" >
<!-- create new war, deleting previous version first -->
<delete file="${app.war.file}" />
<!-- use tpcw servlets as the base for the war file -->
<copy file="${lib.dir}/geograph_servlets.jar" tofile="${app.war.file}" />
<jar destfile="${app.war.file}" update="true" >
<zipfileset dir="${build.dir}"
prefix="WEB-INF/classes" />
<zipfileset dir="${lib.dir}"
excludes="geograph_servlets.jar,servlet-api.jar"
prefix="WEB-INF/lib" />
</jar>
</target>
<target name="build" depends="compile,create-war" description="Builds the application and creates the .war file" />
<target name="run" depends="compile" description="runs the test script">
<java classname="it.algo.geograph.Main" fork="true">
<classpath refid="ff.project.class.path"/>
<jvmarg value="-Dfile.encoding=${java.file.encoding}" />
</java>
</target>
<!-- The following part of this build file specifies the behaviour for deploying the web application in the tomcat web server -->
<!-- For compatibility with the TPCW client web-app-env.deploy.context must be set to "tpcw". Be careful not to overwrite the original app on deploy -->
<property name="web-app-env.deploy.context" value="geograph" />
<property name="web-app-env.deploy.war.rel-file" value="${app.war.file}" />
<!-- IMPORTS -->
<!-- <import file="build_tomcat.xml" /> -->
<!--
<target name="install" depends="create-war,deploy" description="Creates the war file and install it on the server" />
<target name="remove" depends="undeploy" description="Removes the war file from the server" />
-->
<target name="install" depends="create-war" description="Creates the war file and install it on the server" />
<target name="remove" description="Removes the war file from the server" />
<target name="re-install" depends="remove,install" description="remove -> install" />
</project>