Repository navigation
Expand file tree
/
Copy pathbuild.xml
More file actions
156 lines (119 loc) · 5.33 KB
/
Copy pathbuild.xml
File metadata and controls
156 lines (119 loc) · 5.33 KB
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
<?xml version='1.0' encoding='UTF-8'?>
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="springServiceContacts" default="compile" basedir=".">
<property name="app.name" value="springServiceContacts"/>
<property name="app.path" value="/${app.name}"/>
<property name="app.version" value="1.0"/>
<property name="ivy.install.version" value="2.3.0-rc1"/>
<property name="ivy.jar.dir" value="${basedir}/ivy"/>
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>
<property name="build.home" value="${basedir}/build"/>
<property name="build.dir" value="${basedir}/build/WEB-INF/classes"/>
<property name="src.home" value="${basedir}/src"/>
<property name="web.home" value="${basedir}/WebContent"/>
<property name="dist.home" value="${basedir}/dist"/>
<property name="compile.debug" value="true"/>
<property name="compile.deprecation" value="false"/>
<property name="compile.optimize" value="true"/>
<property name="tools.eclipse" value="${basedir}/tools/ide/eclipse" />
<target name="download-ivy" unless="skip.download">
<mkdir dir="${ivy.jar.dir}"/>
<!--
download Ivy from web site so that it can be used even without any special installation
-->
<echo message="installing ivy..."/>
<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
<target name="install-ivy" depends="download-ivy" description="--> install ivy">
<!--
try to load ivy here from local ivy dir, in case the user has not already dropped it into
ant's lib dir (note that the latter copy will always take precedence). We will not fail as
long as local lib dir exists (it may be empty) and ivy is in at least one of ant's lib dir
or the local lib dir.
-->
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>
<!-- ==================== resolve ivy dependencies Target ================================== -->
<target name="resolve" description="--> resolve ivy dependencies">
<property name="ivy.dep.file" value="${basedir}/ivy.xml" />
<property name="ivy.lib.dir" value="${build.home}/WEB-INF/lib" />
<ivy:retrieve />
</target>
<!-- ==================== Prepare Target ================================== -->
<target name="prepare" depends="install-ivy, resolve">
<!-- Create build directories as needed -->
<mkdir dir="${build.home}"/>
<mkdir dir="${build.home}/WEB-INF"/>
<mkdir dir="${build.home}/WEB-INF/classes"/>
<copy todir="${build.home}">
<fileset dir="${web.home}"/>
</copy>
<!-- Copy external dependencies as required -->
<mkdir dir="${build.home}/WEB-INF/lib"/>
<copy todir="${build.home}/WEB-INF" >
<fileset dir="${web.home}/WEB-INF" excludes="**/*.classes"/>
</copy>
<!--
<copy todir="${build.home}/WEB-INF/lib" >
<fileset dir="${web.home}/WEB-INF/lib"/>
</copy>
-->
</target>
<!-- ==================== Compilation Classpath =========================== -->
<path id="compile.classpath">
<fileset dir="${build.home}/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
<pathelement location="${src.home}"/>
</path>
<!-- ==================== All Target ====================================== -->
<target name="all" depends="clean,compile"
description="Clean build and dist directories, then compile"/>
<!-- ==================== Clean Target ==================================== -->
<target name="clean"
description="Delete old build and dist directories">
<delete dir="${build.home}"/>
<delete dir="${dist.home}"/>
</target>
<!-- ==================== Compile Target ================================== -->
<target name="compile" depends="prepare"
description="Compile Java sources">
<!-- Compile Java classes as necessary -->
<mkdir dir="${build.home}/WEB-INF/classes"/>
<javac srcdir="${src.home}"
destdir="${build.home}/WEB-INF/classes"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}"
includeantruntime="false">
<classpath refid="compile.classpath"/>
<compilerarg value="-Xlint:unchecked" />
</javac>
<!-- Copy application resources -->
<copy todir="${build.home}/WEB-INF/classes">
<fileset dir="${src.home}" excludes="**/*.java"/>
</copy>
</target>
<!-- ==================== Dist Target ===================================== -->
<target name="builddb" depends="prepare, compile">
<ant antfile="${basedir}/build-db.xml" target="setupDB" />
</target>
<target name="dist" depends="prepare, compile"
description="Create binary distribution">
<!-- Copy documentation subdirectories -->
<mkdir dir="${dist.home}"/>
<!-- Create application JAR file -->
<jar jarfile="${dist.home}/${app.name}.war"
basedir="${build.home}"/>
<!-- Copy additional files to ${dist.home} as necessary -->
</target>
<target name="eclipse"
description="setup eclipse project files">
<copy todir="${basedir}" >
<fileset dir="${tools.eclipse}"/>
<mapper type="glob" from="*" to=".*" />
</copy>
</target>
</project>