-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
52 lines (45 loc) · 1.65 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
<project name="vms" default="setupdb">
<property name="db.driver" value="org.postgresql.Driver"/>
<property name="db.url" value="jdbc:postgresql://localhost:5432/GIFTDB"/>
<property name="db.username" value="app_user"/>
<property name="db.password" value="password"/>
<path id="project.classpath">
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
<fileset dir="buildlib">
<include name="*.jar"/>
</fileset>
</path>
<macrodef name="exec_sql">
<attribute name="src"/>
<attribute name="onerror"/>
<sequential>
<sql
classpathref="project.classpath"
driver="${db.driver}"
url="${db.url}"
userid="${db.username}"
password="${db.password}"
src="@{src}"
onerror="@{onerror}"
delimiter=";"
/>
</sequential>
</macrodef>
<taskdef name="dbdeploy" classname="com.dbdeploy.AntTarget" classpathref="project.classpath"/>
<target name="drop.create.schema"
description="drop the current schema and builds the baseline database">
<exec_sql src="sql/schema.sql" onerror="abort"/>
</target>
<target name="metadata">
<exec_sql src="sql/metadata.sql" onerror="abort"/>
</target>
<target name="setupdb" depends="drop.create.schema">
<dbdeploy driver="${db.driver}" url="${db.url}"
userid="app_user"
password="password"
dir="sql"
/>
</target>
</project>