-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.xml
223 lines (196 loc) · 8.83 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
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
<!--
Licensed to Jasig under one or more contributor license
agreements. See the NOTICE file distributed with this work
for additional information regarding copyright ownership.
Jasig licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a
copy of the License at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project name="sched-assist" basedir="." xmlns:artifact="urn:maven-artifact-ant">
<fail message="build.properties does not exist, please copy build-SAMPLE.properties as build.properties and modify for your environment">
<condition>
<not>
<available file="${basedir}/build.properties" />
</not>
</condition>
</fail>
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${basedir}/bootstrap/lib/ant-contrib-1.0b3.jar" />
</classpath>
</taskdef>
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant">
<classpath>
<pathelement location="${basedir}/bootstrap/lib/maven-ant-tasks-2.0.10.jar" />
</classpath>
</typedef>
<property file="${basedir}/build.properties" />
<artifact:dependencies pathid="hsql.classpath">
<dependency groupId="org.hsqldb" artifactId="hsqldb" version="2.2.9" />
<dependency groupId="org.hsqldb" artifactId="sqltool" version="2.2.9" />
</artifact:dependencies>
<artifact:dependencies pathid="parent.maven.classpath">
<pom file="${basedir}/pom.xml" />
</artifact:dependencies>
<artifact:dependencies pathid="spi.maven.classpath">
<pom file="${basedir}/sched-assist-spi/pom.xml" />
</artifact:dependencies>
<target name="hsql" description="Start a HSQLDB instance consistent with the default RDBMS requirements of Available">
<property name="spawn" value="false" />
<condition property="failonerror" value="false">
<equals arg1="${spawn}" arg2="true" />
</condition>
<property name="failonerror" value="true" />
<property name="port" value="${hsql.localhost.port}" />
<echo message="Starting HSQL" />
<echo message="Using: ${hsql.data.directory}" />
<java fork="true" spawn="${spawn}" maxmemory="96M" classname="org.hsqldb.server.Server" failonerror="${failonerror}">
<classpath refid="hsql.classpath" />
<arg value="--database.0" />
<arg value="${hsql.data.directory}/schedassistdb;hsqldb.tx=mvcc" />
<arg value="--dbname.0" />
<arg value="schedassistdb" />
<arg value="--address" />
<arg value="localhost" />
<arg value="-port" />
<arg value="${port}" />
</java>
</target>
<target name="hsql-help" description="Print HSQLDB help">
<java fork="true" classname="org.hsqldb.Server" failonerror="${failonerror}">
<classpath refid="hsql.classpath" />
<arg value="-?" />
</java>
</target>
<target name="hsql-shutdown" description="Compacts then cleanly shuts down HSQL database">
<echo message="Stopping HSQL" />
<trycatch reference="hsql-shutdown.exceptionId">
<try>
<java fork="true" dir="." classname="org.hsqldb.cmdline.SqlTool" timeout="5000" errorproperty="hsql-shutdown.err.out" failonerror="true">
<classpath refid="hsql.classpath" />
<arg value="--rcFile" />
<arg value="${basedir}/bootstrap/hsqldb.sqltool.rc" />
<arg value="--sql" />
<arg value="shutdown compact;" />
<arg value="schedassistdb" />
</java>
</try>
<catch>
<if>
<contains string="${hsql-shutdown.err.out}" substring="socket creation error" />
<then>
<echo>HSQL is not running</echo>
</then>
<else>
<echo>${hsql-shutdown.err.out}</echo>
<throw refid="hsql-shutdown.exceptionId" />
</else>
</if>
</catch>
</trycatch>
</target>
<target name="hsql-initialize-firstrun" description="Initializes the Scheduling Assistant HSQL database for the first time.">
<java classname="org.jasig.schedassist.impl.InitializeSchedulingAssistantDatabase" fork="true" dir=".">
<!-- first argument is 'firstRun' - if true, skips the drop statements -->
<arg value="true" />
<jvmarg value="-Dorg.jasig.schedassist.impl.InitializeSchedulingAssistantDatabase.CONFIG=${database.config}" />
<classpath>
<path refid="spi.maven.classpath" />
<fileset dir="${basedir}/sched-assist-spi/target">
<include name="*.jar" />
</fileset>
<pathelement location="${basedir}/bootstrap" />
<pathelement location="${basedir}/sched-assist-spi/src/main/resources" />
<pathelement location="${basedir}/sched-assist-spi/src/main/sql" />
<pathelement location="${basedir}/sched-assist-spi/src/test/resources" />
</classpath>
</java>
</target>
<target name="hsql-rebuild" description="Re-initializes the Scheduling Assistant HSQL database (caution: destroys existing tables first!)">
<echo>hsql-rebuild will remove any data in the database</echo>
<input message="Are you sure you want to continue?" validargs="y,n" addproperty="confirmed" />
<condition property="do.abort">
<equals arg1="n" arg2="${confirmed}" />
</condition>
<fail if="do.abort">hsql-rebuild aborted.</fail>
<java classname="org.jasig.schedassist.impl.InitializeSchedulingAssistantDatabase" fork="true" dir=".">
<!-- firstRun=false will trigger drop ddl commands -->
<arg value="false" />
<jvmarg value="-Dorg.jasig.schedassist.impl.InitializeSchedulingAssistantDatabase.CONFIG=${database.config}" />
<classpath>
<path refid="spi.maven.classpath" />
<fileset dir="${basedir}/sched-assist-spi/target">
<include name="*.jar" />
</fileset>
<pathelement location="${basedir}/bootstrap" />
<pathelement location="${basedir}/sched-assist-spi/src/main/resources" />
<pathelement location="${basedir}/sched-assist-spi/src/main/sql" />
<pathelement location="${basedir}/sched-assist-spi/src/test/resources" />
</classpath>
</java>
</target>
<!-- This target removes the web application from the tomcat installation
you defined in build.properties -->
<target name="clean-webapp" description="Removes Scheduling Assistant from Tomcat webapps directory">
<delete file="${tomcat.home}/webapps/scheduling-assistant.war" />
<delete dir="${tomcat.home}/webapps/scheduling-assistant" />
</target>
<!-- this target copies the war file you built (using mvn package) to the
tomcat installation you defined in build.properties -->
<target name="deploy-war" description="Copies the Scheduling Assistant war to the Tomcat webapps directory">
<copy file="${basedir}/sched-assist-war/target/scheduling-assistant.war" todir="${tomcat.home}/webapps" />
</target>
<target name="redeploy-war" description="Shortcut to invoke 'clean-webapp' and 'deploy-war' targets">
<antcall target="clean-webapp" />
<antcall target="deploy-war" />
</target>
<target name="hot-deploy-log4j.properties">
<copy file="${basedir}/sched-assist-war/src/main/resources/log4j.properties" todir="${tomcat.home}/webapps/scheduling-assistant/WEB-INF/classes/">
</copy>
</target>
<target name="run-integration-test">
<artifact:dependencies pathid="integrationtest.maven.classpath" >
<dependency groupId="org.jasig.sched-assist" artifactId="sched-assist-spi-caldav-integrationtest" version="1.1.0-SNAPSHOT" />
</artifact:dependencies>
<junit fork="true" printsummary="withOutAndErr" haltonfailure="true">
<classpath>
<path refid="integrationtest.maven.classpath" />
<pathelement location="bootstrap" />
</classpath>
<formatter type="plain" usefile="off" />
<test name="org.jasig.schedassist.impl.caldav.integration.CaldavIntegrationTest">
</test>
</junit>
</target>
<!--
<target name="audit-schedule-owners" description="Audits the ScheduleOwner database">
<java classname="org.jasig.schedassist.impl.owner.ScheduleOwnerAuditor" fork="true" dir="." jvm="${cli.jvm}">
<jvmarg value="-Dorg.jasig.schedassist.impl.owner.ScheduleOwnerAuditor.CONFIG=${cli-tools.config}" />
<jvmarg value="-Djavax.net.ssl.keyStore=${keystore.file}" />
<jvmarg value="-Djavax.net.ssl.trustStore=${keystore.file}" />
<jvmarg value="-Djavax.net.ssl.keyStorePassword=${keystore.pass}" />
<jvmarg value="-Djavax.net.ssl.trustStorePassword=${keystore.pass}" />
<jvmarg value="-Djava.library.path=${java_library_path}" />
<env key="LD_LIBRARY_PATH" value="${ld_library_path}" />
<classpath>
<path refid="mavenproject.classpath" />
<fileset dir="sched-assist-api/target">
<include name="*.jar" />
</fileset>
<fileset dir="sched-assist-spi/target">
<include name="*.jar" />
</fileset>
<pathelement location="bootstrap" />
</classpath>
</java>
</target>
-->
</project>