-
Notifications
You must be signed in to change notification settings - Fork 13
/
build_wiki.xml
225 lines (177 loc) · 8.83 KB
/
build_wiki.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<project name="topcoder" default="main" basedir=".">
<property name="Name" value="TopCoder"/>
<property name="build" value="build"/>
<property name="classes" value="${build}/classes"/>
<property name="testclasses" value="${build}/testcases"/>
<property name="lib.dir" value="lib"/>
<property name="jars.dir" value="${lib.dir}/jars"/>
<property name="bin" value="lib/bin"/>
<property name="src.dir" value="src"/>
<property name="java" value="${src.dir}/main"/>
<property name="shared" value="../shared/src/main"/>
<property name="testjava" value="${src.dir}/testcases"/>
<property name="resources" value="resources"/>
<property name="conf" value="conf"/>
<property name="shared.jar" value="${bin}/shared.jar"/>
<property name="common.jar" value="${bin}/tcwebcommon.jar"/>
<property name="tc_theme.jar" value="${bin}/tc_theme.jar"/>
<property name="web" value="src/main/com/topcoder/web"/>
<property name="jboss_home" value="../jboss-4.2.0.GA"/>
<property name="jboss_deploy" value="${jboss_home}/server/wiki/deploy"/>
<property name="jboss_lib" value="${jboss_home}/server/wiki/lib"/>
<property name="jboss_conf" value="${jboss_home}/server/wiki/conf"/>
<property name="confluence.version" value="2.7"/>
<property name="confluence.jars" value="${jars.dir}/confluence-${confluence.version}"/>
<property name="confluence_home" value="../confluence-${confluence.version}"/>
<property name="confluence_war_name" value="confluence-${confluence.version}.war"/>
<property name="confluence_jar_name" value="confluence-${confluence.version}.jar"/>
<property name="confluence_jar" value="${confluence.jars}/${confluence_jar_name}"/>
<property name="shared.build" value="${basedir}/../shared"/>
<property name="global-dist.dir" value="${basedir}/../dist/artifacts"/>
<property environment="env"/>
<property name="deprecation" value="true"/>
<property name="debug" value="true"/>
<property name="junitsummary" value="on"/>
<target name="main" depends="compile">
</target>
<path id="class.path">
<pathelement location="${classes}"/>
<pathelement location="${testclasses}"/>
<pathelement location="${resources}"/>
<pathelement location="${shared.jar}"/>
<pathelement location="${jars.dir}/log4j-1.2.7.jar"/>
<pathelement location="${jars.dir}/jboss/javax.servlet.jar"/>
<pathelement location="${jars.dir}/jboss/jbossall-client.jar"/>
<fileset dir="${confluence.jars}">
<include name="*.jar"/>
</fileset>
<pathelement location="${jars.dir}/tcs/base_exception/2.0.0/base_exception.jar"/>
</path>
<!-- adding this here because i can't figure out how to use the above path element in other path elements-->
<property name="class.path" refid="class.path"/>
<target name="init">
<mkdir dir="${classes}"/>
<mkdir dir="${testclasses}"/>
<mkdir dir="${bin}"/>
</target>
<target name="compile_common" depends="init" unless="compile_common_set">
<ant antfile="build_common.xml" target="build-dist"/>
<property name="compile_common_set" value="true"/>
</target>
<target name="compile" depends="init,compile_common" unless="compile_set">
<ant antfile="build_security.xml" target="build-security"/>
<javac
srcdir="${java}"
destdir="${classes}"
classpathref="class.path"
deprecation="${deprecation}"
debug="${debug}"
source="1.5"
target="1.5" memoryMaximumSize="380m" memoryInitialSize="380m" fork="true">
<include name="com/topcoder/web/wiki/**"/>
</javac>
<property name="compile_set" value="true"/>
</target>
<target name="clean">
<!-- kill the entire build dir -->
<delete dir="${build}"/>
<delete dir="${bin}"/>
</target>
<target name="copy-to-confluence" depends="jar-tc-theme">
<copy todir="${confluence_home}/confluence/WEB-INF/classes" overwrite="yes">
<fileset dir="${classes}">
<include name="com/topcoder/web/wiki/**/*.class"/>
</fileset>
</copy>
<copy todir="${confluence_home}/confluence/WEB-INF/lib" file="${tc_theme.jar}" overwrite="yes"/>
<copy todir="${confluence_home}/confluence" file="${resources}/wiki/login.vm" overwrite="yes"/>
<copy todir="${confluence_home}/confluence/template/includes" file="${resources}/wiki/macros.vm" overwrite="yes"/>
<copy todir="${confluence_home}/confluence/WEB-INF" file="${resources}/wiki/jboss-web.xml" overwrite="yes"/>
</target>
<target name="jar-tc-theme" depends="compile">
<jar destfile="${tc_theme.jar}" update="false">
<fileset dir="${resources}/wiki/themes/tc/">
<include name="**/*"/>
</fileset>
<fileset dir="${classes}">
<include name="com/topcoder/web/wiki/themes/tc/**/*.class"/>
</fileset>
</jar>
</target>
<target name="move-conf">
<copy todir="${jboss_conf}">
<fileset dir="${resources}">
<include name="ApplicationServer.properties"/>
<include name="cache.properties"/>
<include name="DBMS.properties"/>
<include name="DataAccess.properties"/>
</fileset>
</copy>
<mkdir dir="${jboss_conf}/com/topcoder/security"/>
<mkdir dir="${jboss_conf}/com/topcoder/util/config"/>
<copy todir="${jboss_conf}/com/topcoder/security">
<fileset dir="${resources}/com/topcoder/security">
<include name="Util.properties"/>
</fileset>
</copy>
<copy todir="${jboss_conf}/com/topcoder/util/config">
<fileset dir="${resources}/com/topcoder/util/config">
<include name="ConfigManager.properties"/>
</fileset>
</copy>
<!--
<mkdir dir="${jboss_conf}/com/topcoder/servlet/request"/>
<copy todir="${jboss_conf}/com/topcoder/servlet/request">
<fileset dir="${resources}/com/topcoder/servlet/request">
<include name="FileUpload.xml"/>
</fileset>
</copy>
-->
</target>
<target name="move-lib">
<copy todir="${jboss_lib}">
<fileset dir="${jars.dir}">
<include name="postgresql-8.2-506.jdbc3.jar"/>
</fileset>
</copy>
<copy todir="${jboss_lib}" file="${bin}/shared.jar" overwrite="yes"/>
<copy todir="${jboss_lib}" file="${common.jar}" overwrite="yes"/>
<copy todir="${jboss_lib}" file="${jars.dir}/tcs/base_exception.jar" overwrite="yes"/>
<copy todir="${jboss_lib}" file="${build}/ejb_jars/security.jar" overwrite="yes"/>
<!--
<copy todir="${jboss_lib}" file="${jars.dir}/tcs/file_upload/2.0.2.0/file_upload.jar"/>
<copy todir="${jboss_lib}" file="${jars.dir}/tcs/guid_generator/1.0/guid_generator.jar"/>
<copy todir="${jboss_lib}" file="${jars.dir}/tcs/heartbeat/1.0/heartbeat.jar"/>
<copy todir="${jboss_lib}" file="${jars.dir}/tcs/ip_server/2.0.1/ip_server.jar"/>
<copy todir="${jboss_lib}" file="${jars.dir}/tcs/typesafe_enum/1.0/typesafe_enum.jar"/>
-->
</target>
<target name="deploy" depends="copy-to-confluence,move-conf,move-lib,setup-pdf-header-footer">
<!--
<antcall target="copy-to-confluence"/>
<antcall target="move-conf"/>
<antcall target="move-lib"/>
-->
<copy todir="${jboss_deploy}" file="${build}/ears/security.ear" overwrite="yes"/>
<!--
<exec executable="build.sh" dir="/home/wiki/confluence-2.5.6"/>
-->
<exec executable="build.sh" dir="${confluence_home}"/>
<antcall target="expand-confluence"/>
</target>
<target name="expand-confluence">
<unwar src="${confluence_home}/dist/${confluence_war_name}" dest="${jboss_deploy}/${confluence_war_name}/" overwrite="yes"/>
<delete dir="${jboss_deploy}/${confluence_war_name}/META-INF"/>
</target>
<target name="setup-pdf-header-footer">
<unjar src="${confluence_jar}" dest="${build}/tempconfluence"/>
<copy file="${resources}/wiki/common_footer_fop.vm" tofile="${build}/tempconfluence/com/atlassian/confluence/importexport/common_footer_fop.vm" overwrite="true"/>
<copy file="${resources}/wiki/common_header_fop.vm" tofile="${build}/tempconfluence/com/atlassian/confluence/importexport/common_header_fop.vm" overwrite="true"/>
<jar destfile="${bin}/${confluence_jar_name}">
<fileset dir="${build}/tempconfluence/">
<include name="**/*"/>
</fileset>
</jar>
<copy file="${bin}/${confluence_jar_name}" tofile="${confluence_home}/confluence/WEB-INF/lib/${confluence_jar_name}"/>
</target>
</project>