forked from mint-ntua/Mint2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
185 lines (166 loc) · 5.9 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
<project name="mint" default="dist" basedir=".">
<description>
Mint build file
</description>
<!-- set global properties for this build -->
<property name="src" location="WEB-INF/src/java"/>
<property name="custom-src" location="WEB-INF/custom/${custom}/java"/>
<property name="build" location="WEB-INF/classes"/>
<property name="lib" location="WEB-INF/lib"/>
<property name="dist" location="work/dist"/>
<property environment="env"/>
<property name="tomcat.home" location="${env.TOMCAT_HOME}" />
<path id="srcpath" >
<dirset dir="${src}" />
<dirset dir="WEB-INF/custom">
<include name="${custom}/java" if="custom" />
</dirset>
</path>
<property name="allSrc" refid="srcpath"/>
<target name="init">
<fail unless="appname" message="Please call ant with -Dappname=something. This is used as subdir in dist and for tomcat deploy." />
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="init"
description="compile the source " >
<echo message="Compiling source code..." />
<!-- Compile the java code from ${src} into ${build} -->
<javac destdir="${build}"
encoding = "utf-8"
source="1.6" debug="true" debuglevel="lines,source"
includeAntRuntime="no" srcdir="${allSrc}" >
<classpath>
<pathelement path="${classpath}"/>
<fileset dir="WEB-INF/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
<echo message="Source code compile completed!" />
<copy todir="${build}">
<fileset dir="${src}"
excludes="**/*.java" />
</copy>
<copy todir="${build}" flatten="true" >
<fileset dir="WEB-INF/custom" >
<include name="${custom}/java/*" if="custom"/>
<exclude name="**/*.java" />
</fileset>
</copy>
<echo message="Resources copied to class folder." />
</target>
<target name="instrument" depends="compile">
<echo message="Instrumenting domain..." />
<taskdef name="instrument" classname="org.hibernate.tool.instrument.javassist.InstrumentTask">
<classpath >
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</classpath>
<classpath path="${build}"/>
</taskdef>
<instrument verbose="true">
<fileset dir="${build}/gr/ntua/ivml/mint/persistent">
<include name="Mapping.class"/>
</fileset>
</instrument>
</target>
<target name="properties" depends="init" description="Build a build.properties file" >
<tstamp>
<format property="NOW" pattern="d-MMM-yyyy HH:mm:ss" locale="en,UK"/>
</tstamp>
<echo file="build.properties" message="svn-revision=" />
<exec executable="svnversion" output="build.properties" append="true"/>
<echo file="build.properties" append="true" >appname=${appname}
deploy_target=${deploy_target}
build-time=${NOW}</echo>
</target>
<target name="dist" depends="dist_base, dist_custom" />
<target name="dist_custom" depends="dist_base" if="custom" >
<echo message="Copying custom resources..." />
<copy todir="${dist}/${appname}/custom/${custom}">
<fileset dir="custom/${custom}" />
</copy>
</target>
<target name="dist_base" depends="instrument, properties"
description="generate the distribution" >
<echo message="Generating distribution..." />
<mkdir dir="${dist}/${appname}"/>
<echo message="Copying css..." />
<copy todir="${dist}/${appname}/css">
<fileset dir="css" />
</copy>
<echo message="Copying report_template..." />
<copy todir="${dist}/${appname}/report_templates" >
<fileset dir="report_templates" />
</copy>
<echo message="Copying template..." />
<copy todir="${dist}/${appname}/template" >
<fileset dir="template" />
</copy>
<echo message="Copying images..." />
<copy todir="${dist}/${appname}/images" >
<fileset dir="images" />
</copy>
<echo message="Copying js..." />
<copy todir="${dist}/${appname}/js">
<fileset dir="js" />
</copy>
<echo message="Copying logo..." />
<copy todir="${dist}/${appname}/logo">
<fileset dir="logo" />
</copy>
<echo message="Copying schemas..." />
<copy todir="${dist}/${appname}/schemas">
<fileset dir="schemas" />
</copy>
<echo message="Copying xsl..." />
<copy todir="${dist}/${appname}/xsl">
<fileset dir="xsl" />
</copy>
<echo message="Copying scripts..." />
<copy todir="${dist}/${appname}/scripts">
<fileset dir="scripts" />
</copy>
<echo message="Copying WEB-INF..." />
<copy todir="${dist}/${appname}/WEB-INF">
<fileset dir="WEB-INF" />
</copy>
<echo message="Copying index.html..." />
<copy tofile="${dist}/${appname}/index.html" file="index.html"/>
<copy tofile="${dist}/${appname}/build.properties" file="build.properties"/>
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<import file="WEB-INF/deploy/${deploy_target}/deploy.xml" optional="true" />
<target name="modify" depends="dist" >
<antcall target="modify-specific"/>
</target>
<target name="deploy" depends="modify, dist" if="deploy_target">
<antcall target="deploy-specific"/>
</target>
<target name="doc">
<javadoc destdir="docs/mint2"
sourcepath="WEB-INF/src/java"
packagenames="gr.ntua.ivml.mint.*"
windowtitle="Mint2 Javadoc"
>
<classpath>
<pathelement path="${classpath}"/>
<fileset dir="WEB-INF/lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javadoc>
</target>
</project>