forked from EmergentIdeas/webhandle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
170 lines (132 loc) · 5.14 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
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="webhandle" default="pub" basedir=".">
<description>
a build for the webhandle system
</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="compiled"/>
<property name="dist" location="dist"/>
<ivy:settings file="settings.xml" />
<target name="increment">
<propertyfile file="buildNumber.properties">
<entry key="build.number" type="int" operation="+" default="0" />
</propertyfile>
<property file="buildNumber.properties" />
</target>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<property file="buildNumber.properties" />
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<mkdir dir="${build}/classes"/>
</target>
<target name="compile" depends="init"
description="compile the source " >
<ivy:cachepath pathid="ivy.cachepath.dep" conf="deployment"/>
<ivy:cachepath pathid="ivy.cachepath.build" conf="build"/>
<path id="ivy.deps">
<path refid="ivy.cachepath.dep" />
<path refid="ivy.cachepath.build" />
<fileset dir="lib" >
<include name="*.jar"/>
</fileset>
</path>
<!-- Compile the java code from ${src} into ${build} -->
<javac nowarn="on" srcdir="${src}" destdir="${build}/classes" target="1.6" debug="true" debuglevel="lines,vars,source">
<classpath refid="ivy.deps" />
</javac>
<!-- copy properties and other non-java files from the src directory -->
<copy todir="${build}/classes">
<fileset dir="${src}" >
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<target name="copy-templates" depends="init" >
<copy todir="${build}/classes/com/emergentideas/webhandle/templates/oak">
<fileset dir="WebContent/WEB-INF/oakTemplates" />
</copy>
<copy todir="${build}/classes/com/emergentideas/webhandle/resources/oak">
<fileset dir="WebContent/oakContent" />
</copy>
</target>
<target name="copy-test-templates" depends="init" >
<copy todir="${build}/classes/com/emergentideas/webhandle/templates/oak">
<fileset dir="WebContent/WEB-INF/appTestTemplates" />
</copy>
</target>
<target name="compile-test" depends="init"
description="compile the source " >
<ivy:cachepath pathid="ivy.cachepath.dep" conf="deployment"/>
<ivy:cachepath pathid="ivy.cachepath.build" conf="build"/>
<ivy:cachepath pathid="ivy.cachepath.test" conf="test"/>
<path id="ivy.deps.test">
<path refid="ivy.cachepath.dep" />
<path refid="ivy.cachepath.build" />
<path refid="ivy.cachepath.test" />
<fileset dir="lib" >
<include name="*.jar"/>
</fileset>
</path>
<!-- Compile the java code from ${src} into ${build} -->
<javac nowarn="on" srcdir="test-src" destdir="${build}/classes" target="1.6" debug="true" debuglevel="lines,vars,source">
<classpath refid="ivy.deps.test" />
</javac>
<!-- copy properties and other non-java files from the src directory -->
<copy todir="${build}/classes">
<fileset dir="test-src" >
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<target name="web-app-test" depends="compile,compile-test,copy-templates,copy-test-templates" description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
<jar jarfile="${dist}/WEB-INF/lib/webhandle.jar" basedir="${build}/classes"/>
<ivy:retrieve pattern="${dist}/WEB-INF/lib/[artifact](-[classifier]).jar" type="jar" conf="deployment"/>
<copy todir="${dist}/WEB-INF/lib">
<fileset dir="lib" >
<include name="*.jar"/>
</fileset>
</copy>
<copy todir="${dist}">
<fileset dir="WebContent" >
</fileset>
</copy>
</target>
<target name="web-app-acorn" depends="compile,copy-templates,copy-test-templates" description="generates a war usable for acorns" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
<jar jarfile="${dist}/WEB-INF/lib/webhandle.jar" basedir="${build}/classes"/>
<ivy:retrieve pattern="${dist}/WEB-INF/lib/[artifact](-[classifier]).jar" type="jar" conf="deployment"/>
<copy todir="${dist}/WEB-INF/lib">
<fileset dir="lib" >
<include name="*.jar"/>
</fileset>
</copy>
<copy todir="${dist}">
<fileset dir="AcornWebContent" >
</fileset>
</copy>
</target>
<target name="web-app-acorn-war" depends="clean,web-app-acorn" >
<zip destfile="webhandle.war" basedir="${dist}" />
</target>
<target name="dist" depends="web-app-acorn" description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
<copy tofile="${dist}/lib/com.emergentideas-webhandle.jar" file="${dist}/WEB-INF/lib/webhandle.jar" />
</target>
<target name="pub" depends="dist" >
<ivy:publish resolver="eico_local" pubrevision="1.0.0.${build.number}" update="true" overwrite="true">
<artifacts pattern="${dist}/lib/com.emergentideas-[artifact].[ext]" />
</ivy:publish>
</target>
<target name="clean" description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
<delete file="webhandle.war" />
</target>
</project>