forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-common-web.xml
170 lines (153 loc) · 4.15 KB
/
build-common-web.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
<?xml version="1.0"?>
<project name="build-common-web" xmlns:antelope="antlib:ise.antelope.tasks">
<import file="build-common.xml" />
<target name="clean">
<delete dir="docroot/WEB-INF/classes" />
<delete file="${war.file}.war" failonerror="false" />
<delete>
<fileset dir="docroot" includes="**/.sprite.png" />
<fileset dir="docroot" includes="**/.sprite.properties" />
<fileset dir="docroot" includes="**/Thumbs.db" />
</delete>
</target>
<target name="compile">
<if>
<available file="docroot/WEB-INF/src" />
<then>
<if>
<available file="tmp" type="dir" />
<then>
<property name="compile.file.dest" value="tmp/WEB-INF/classes" />
</then>
<else>
<property name="compile.file.dest" value="docroot/WEB-INF/classes" />
</else>
</if>
<mkdir dir="${compile.file.dest}" />
<copy todir="${compile.file.dest}">
<fileset dir="docroot/WEB-INF/src" excludes="**/*.java,**/*.javadoc" />
</copy>
<javac
classpathref="web.classpath"
compiler="${javac.compiler}"
debug="${javac.debug}"
deprecation="${javac.deprecation}"
destdir="${compile.file.dest}"
nowarn="${javac.nowarn}"
srcdir="docroot/WEB-INF/src"
/>
</then>
</if>
</target>
<target name="war" depends="compile">
<if>
<available file="docroot" />
<then>
<war
basedir="docroot"
destfile="${war.file}.war"
excludes="WEB-INF/web.xml"
webxml="docroot/WEB-INF/web.xml"
/>
</then>
</if>
</target>
<target name="deploy" depends="compile">
<if>
<equals arg1="${war.file}" arg2="portal-web" />
<then>
<property name="war.file.dest" value="${app.server.portal.dir}" />
</then>
<else>
<if>
<or>
<equals arg1="${app.server.type}" arg2="geronimo-tomcat" />
<equals arg1="${app.server.type}" arg2="glassfish" />
<equals arg1="${app.server.type}" arg2="jboss-tomcat" />
<equals arg1="${app.server.type}" arg2="jonas-jetty" />
<equals arg1="${app.server.type}" arg2="jonas-tomcat" />
</or>
<then>
<property name="war.file.dest" value="${app.server.deploy.dir}/${war.file}.war" />
</then>
<else>
<property name="war.file.dest" value="${app.server.deploy.dir}/${war.file}" />
</else>
</if>
</else>
</if>
<if>
<and>
<equals arg1="${war.file}" arg2="portal-web" />
<equals arg1="${app.server.type}" arg2="tomcat" />
<antelope:endswith string="${app.server.portal.dir}" with="/portal-web/docroot" />
</and>
<then>
</then>
<else>
<if>
<available file="${war.file.dest}" type="file" />
<then>
<delete file="${war.file.dest}" />
</then>
</if>
<if>
<available file="tmp" type="dir" />
<then>
<copy todir="${war.file.dest}" preservelastmodified="true">
<fileset dir="tmp" />
</copy>
</then>
<elseif>
<available file="docroot" type="dir" />
<then>
<copy todir="${war.file.dest}" preservelastmodified="true">
<fileset dir="docroot" excludes="/html/js/editor/_fckeditor/**" />
</copy>
</then>
</elseif>
<else>
<unwar src="${war.file}.war" dest="${war.file.dest}" />
</else>
</if>
</else>
</if>
<if>
<and>
<equals arg1="${app.server.type}" arg2="glassfish" />
<available file="${war.file.dest}" type="dir" />
<not>
<equals arg1="${war.file}" arg2="portal-web" />
</not>
</and>
<then>
<tstamp>
<format property="tstamp.value" pattern="yyyyMMddkkmmssSSS" />
</tstamp>
<jar
basedir="${war.file.dest}"
jarfile="${tstamp.value}"
/>
<delete dir="${war.file.dest}" />
<move file="${tstamp.value}" tofile="${war.file.dest}" />
</then>
</if>
<if>
<equals arg1="${app.server.type}" arg2="jonas-jetty" />
<then>
<copy
file="${war.file.dest}/WEB-INF/web-jetty.xml.jonas-jetty"
tofile="${war.file.dest}/WEB-INF/web-jetty.xml"
overwrite="yes"
failonerror="false"
/>
</then>
</if>
<if>
<equals arg1="${app.server.type}" arg2="jonas-tomcat" />
<then>
<delete file="${war.file.dest}/META-INF/context.xml" />
</then>
</if>
</target>
</project>