-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-local.xml
266 lines (234 loc) · 9.91 KB
/
build-local.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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
<project name="${webapp}" default="compile" basedir=".">
<import file="${catalina.home}/bin/catalina-tasks.xml" />
<property name="app.name" value="masonic" />
<!-- Local things -->
<property name="tomcat.home" value="tomcat/" />
<property name="user.home" value="C:/solo-dev/" />
<!-- tomcat.home should be set by build.bat or build.csh. -->
<property name="domain.dir" value="${tomcat.home}/webapps/${webapp}" />
<property name="webinf.dir" value="${domain.dir}/WEB-INF" />
<!-- build.dir contains the classes for the main application -->
<property name="build.dir" value="${webinf.dir}/classes/" />
<property name="tomcat.lib.dir" value="${tomcat.home}/lib" />
<!-- lib.dir contains the library files (mostly .jars) that are not custom code -->
<property name="lib.dir" value="${webinf.dir}/lib" />
<property name="etc.dir" value="${user.home}/masonic/etc" />
<property name="opals.generated.to" value="${user.home}/masonic/src" />
<property name="javadoc.dir" value="${domain.dir}/admin/javadoc" />
<property name="masonic.source.dir" value="${user.home}/masonic/src/" />
<property name="doclib.dir" value="doclib"/>
<property name="doclib.temp.dir" value="${doclib.dir}/temp" />
<property name="grunt.path" value="/usr/bin/grunt" />
<property name="foundation.base" value="${user.home}/masonic/foundation/" />
<property name="foundation.vendor.base" value="${user.home}/masonic/foundation/bower_components/foundation/" />
<property name="foundation.target" value="${user.home}/masonic/web/template/foundation/" />
<path id="project.class.path">
<fileset dir="${tomcat.lib.dir}">
<include name="*.jar" />
</fileset>
<pathelement location="${lib.dir}/commons-codec-1.10.jar" />
<pathelement location="${lib.dir}/commons-collections4-4.1.jar" />
<pathelement location="${lib.dir}/commons-email-1.4.jar" />
<pathelement location="${lib.dir}/commons-exec-1.3.jar" />
<pathelement location="${lib.dir}/commons-fileupload-1.3.2.jar" />
<pathelement location="${lib.dir}/commons-io-2.5.jar" />
<pathelement location="${lib.dir}/commons-lang3-3.4.jar" />
<pathelement location="${lib.dir}/commons-logging-1.2.jar" />
<pathelement location="${lib.dir}/commons-math3-3.6.1.jar" />
<pathelement location="${lib.dir}/commons-validator-1.5.1.jar" />
<pathelement location="${lib.dir}/dom4j-1.6.1.jar" />
<pathelement location="${lib.dir}/fluent-hc-4.5.2.jar" />
<pathelement location="${lib.dir}/gson-2.6.2.jar" />
<pathelement location="${lib.dir}/guava-19.0.jar" />
<pathelement location="${lib.dir}/httpclient-4.5.2.jar" />
<pathelement location="${lib.dir}/httpclient-cache-4.5.2.jar" />
<pathelement location="${lib.dir}/httpcore-4.4.4.jar" />
<pathelement location="${lib.dir}/httpmime-4.5.2.jar" />
<pathelement location="${lib.dir}/javax.mail.jar" />
<pathelement location="${lib.dir}/jtds-1.3.1.jar" />
<pathelement location="${lib.dir}/log4j-1.2.17.jar" />
<pathelement location="${lib.dir}/poi-3.14.jar" />
<pathelement location="${lib.dir}/poi-excelant-3.14.jar" />
<pathelement location="${lib.dir}/poi-ooxml-3.14.jar" />
<pathelement location="${lib.dir}/poi-ooxml-schemas-3.14.jar" />
<pathelement location="${lib.dir}/postgresql-9.4.1208.jar" />
<pathelement location="${lib.dir}/sendgrid-java.jar" />
<pathelement location="${lib.dir}/stax-api-1.0.1.jar" />
<pathelement location="${lib.dir}/xmlbeans-2.3.0.jar" />
<pathelement location="${lib.dir}/siliconage.jar" />
<pathelement location="${lib.dir}/opal.jar" />
</path>
<property name="jsp.dir" value="${domain.dir}" />
<property name="jsp.src.dir" value="${jsp.dir}/WEB-INF/src" />
<target name="clean">
<delete dir="${tomcat.home}/work" />
<delete dir="${lib.dir}" />
<delete dir="${build.dir}" />
<delete dir="${jsp.src.dir}" />
</target>
<target name="prepare">
<copy file="etc/web.xml" tofile="${webinf.dir}/web.xml" />
<filter token="WEBAPP_DOMAIN" value="${webapp.domain}" />
<copy file="etc/rewrite.config" tofile="${webinf.dir}/rewrite.config" filtering="true" />
<mkdir dir="${build.dir}" />
<mkdir dir="${lib.dir}" />
<sync todir="${lib.dir}">
<fileset dir="lib">
<exclude name="**/*.bak,**/*~" />
</fileset>
<preserveintarget>
<include name="masonic-bcrypt.jar" />
</preserveintarget>
</sync>
<copy file="${server.properties.file}" tofile="${build.dir}/com/masonic/server.properties" />
<copy file="etc/masonic/application.properties" tofile="${build.dir}/com/masonic/application.properties" />
<copy file="etc/masonic/authentication.properties" tofile="${build.dir}/com/masonic/authentication.properties" />
<copy file="etc/log4j.properties" tofile="${build.dir}/log4j.properties" />
<sync todir="${jsp.dir}">
<fileset dir="web" includes="**/*" />
<preserveintarget>
<include name="WEB-INF/" />
<include name="admin/javadoc/**" />
</preserveintarget>
</sync>
</target>
<!-- This compiles the .jsp pages to .java files in the ${jsp.src.dir} directory.
The regular javac task will then compile them, but the compiled .class files are not
used by the Tomcat engine. -->
<target name="jspc" depends="prepare">
<mkdir dir="${jsp.src.dir}" />
<jasper
validateXml="false"
uriroot="${jsp.dir}"
webXmlFragment="${jsp.dir}/WEB-INF/generated_web.xml"
outputDir="${jsp.src.dir}"
/>
</target>
<target name="warnings" depends="prepare,jspc">
<javac
srcdir="src"
destdir="${build.dir}"
debug="on"
optimize="off"
deprecation="on"
includeantruntime="false"
excludes="**/package.html,**.*.bak,**/*~,"
verbose="off"
>
<classpath refid="project.class.path" />
<src path="src" />
<src path="${jsp.dir}/WEB-INF/src" />
<compilerarg value="-Xlint:cast" />
<compilerarg value="-Xlint:divzero" />
<compilerarg value="-Xlint:empty" />
<compilerarg value="-Xlint:fallthrough" />
<compilerarg value="-Xlint:finally" />
<compilerarg value="-Xlint:overrides" />
<compilerarg value="-Xlint:path" />
<compilerarg value="-Xlint:unchecked" />
</javac>
<jar destfile="${lib.dir}/masonic-bcrypt.jar">
<fileset dir="${build.dir}" includes="com/masonic/security/BCrypt.class,com/masonic/security/BCryptDataSourceRealm.class" />
</jar>
</target>
<target name="compile" depends="foundation,prepare,jspc">
<javac
srcdir="src"
destdir="${build.dir}"
debug="on"
optimize="off"
deprecation="off"
includeantruntime="false"
excludes="**/package.html,**.*.bak,**/*~,**/statistics/**"
encoding="UTF-8"
verbose="off"
>
<classpath refid="project.class.path" />
<src path="src" />
<src path="${jsp.dir}/WEB-INF/src" />
</javac>
<jar destfile="${lib.dir}/masonic-bcrypt.jar">
<fileset dir="${build.dir}" includes="com/masonic/security/BCrypt.class,com/masonic/security/BCryptDataSourceRealm.class" />
</jar>
</target>
<target name="all" depends="clean,compile">
</target>
<target name="opals">
<java classname="com.opal.creator.XMLCreator">
<classpath>
<path refid="project.class.path" />
<pathelement location="${webinf.dir}/classes/" />
</classpath>
<arg value="${etc.dir}/opal-configuration.xml" />
<arg value="${opals.generated.to}" />
<arg value="${database.username}" />
<arg value="${database.password}" />
</java>
</target>
<target name="tomcat-setup">
<mkdir dir="${tomcat.home}" />
<symlink overwrite="true" link="${tomcat.home}/bin" resource="${catalina.home}/bin" />
<mkdir dir="${tomcat.lib.dir}" />
<sync todir="${tomcat.lib.dir}">
<fileset dir="${catalina.home}/lib" />
</sync>
<mkdir dir="${tomcat.home}/logs" />
<mkdir dir="${tomcat.home}/temp" />
<mkdir dir="${tomcat.home}/work" />
<mkdir dir="${tomcat.home}/webapps" />
<mkdir dir="${tomcat.home}/conf" />
<copy todir="${tomcat.home}/conf">
<!-- Copy production configuration, except for server.xml -->
<fileset dir="${catalina.home}/conf">
<exclude name="server.xml" />
<exclude name="Catalina" />
<exclude name="Catalina/**" />
</fileset>
</copy>
<!-- Use the server.xml template for development environments -->
<filter token="TOMCAT_HTTP_PORT" value="${tomcat.http.port}" />
<filter token="SHUTDOWN_PORT" value="${tomcat.shutdown.port}" />
<filter token="TOMCAT_HOME" value="${tomcat.home}" />
<filter token="DATABASE_USERNAME" value="${database.username}" />
<filter token="DATABASE_PASSWORD" value="${database.password}" />
<copy file="etc/server.xml" tofile="${tomcat.home}/conf/server.xml" overwrite="true" filtering="true" />
</target>
<target name="instance" depends="tomcat-setup,compile" />
<target name="javadoc" depends="prepare">
<!-- javadoc can't operate on the .jar files, so unjar them temporarily to be used as source inputs -->
<delete dir="${doclib.temp.dir}"/>
<delete dir="${javadoc.dir}" />
<unjar dest="${doclib.temp.dir}">
<fileset dir="${doclib.dir}">
<include name="*.jar"/>
</fileset>
</unjar>
<javadoc destdir="${javadoc.dir}"
author="false"
version="false"
use="true"
windowtitle="Masonic Javadoc"
bottom="Copyright Jonah Greenthal"
access="private">
<classpath refid="project.class.path"/>
<fileset dir="${masonic.source.dir}"/>
<fileset dir="doclib/temp"/>
</javadoc>
<delete dir="${doclib.temp.dir}"/>
</target>
<target name="foundation">
<exec dir="${foundation.base}" executable="${grunt.path}">
<arg value="build" />
</exec>
<copy todir="${foundation.target}/css" overwrite="true">
<fileset dir="${foundation.base}/css/" />
</copy>
<copy todir="${foundation.target}/js" overwrite="true">
<fileset dir="${foundation.base}/js/" />
<fileset file="${foundation.vendor.base}/js/foundation.min.js" />
<fileset dir="${foundation.vendor.base}/js/foundation/" />
<fileset dir="${foundation.vendor.base}/js/foundation/" />
<fileset dir="${foundation.vendor.base}/js/vendor/" />
</copy>
</target>
</project>