-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
137 lines (120 loc) · 4.37 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
<project name="AntDemo" default="build" basedir=".">
<property name="SrcDir" value="src" />
<property name="BuildDir" value="build" />
<property name="DistDir" value="dist" />
<property name="TestDir" value="tests" />
<property name="DocDir" value="docs" />
<property name="HtmlDoc" value="html" />
<property name="DbDir" value="db" />
<property name="DbName" value="sp2k" />
<property file="build.properties" />
<!-- Sets up PCT for OE compilation and related tasks -->
<taskdef resource="PCT.properties" />
<typedef resource="types.properties" />
<taskdef resource="extras115.properties" />
<DlcHome value="${DLC}" />
<target name="props">
<description>Displays the properties for builds.</description>
<!-- We could also use <echoproperties /> here, but it displays *a lot* of data -->
<echo>Src: ${SrcDir}</echo>
<echo>Build: ${BuildDir}</echo>
<echo>Dist: ${DistDir}</echo>
<echo>DBDir: ${DbDir}</echo>
<echo>DB: ${DbName}</echo>
<echo>Test: ${TestDir}</echo>
<echo>DLC: ${DLC}</echo>
<echo>LOG: ${LOG}</echo>
</target>
<target name="init">
<description>Creates initial directories.</description>
<echo>Creating build directories.</echo>
<mkdir dir="${BuildDir}" />
<mkdir dir="${DistDir}" />
<mkdir dir="${DocDir}" />
<mkdir dir="${DbDir}" />
<mkdir dir="${HtmlDoc}" />
</target>
<target name="initDB" depends="init">
<description>Sets up the database for the project.</description>
<echo>Copying database to ${DbDir}.</echo>
<sports2000 dbName="${DbName}" destDir="${DbDir}" />
</target>
<target name="build" depends="init,initDB">
<description>Compiles source code.</description>
<record name="${LOG}" action="start" append="false" />
<echo>Compiling Source Code from ${SrcDir} into ${BuildDir}</echo>
<PCTCompile destDir="${BuildDir}" preProcessDir="preprocess">
<PCTConnection dbName="${DbDir}/${DbName}" singleUser="True" />
<fileset dir="${SrcDir}">
<include name="**/*.p" />
<include name="**/*.cls" />
</fileset>
<fileset dir="${TestDir}">
<include name="**/*.p" />
<include name="**/*.cls" />
</fileset>
<propath>
<pathelement path="${SrcDir}" />
<pathelement path="${TestDir}" />
</propath>
</PCTCompile>
<antcall target="copy_resx" />
<record name="${LOG}" action="stop" />
</target>
<target name="test" depends="init,build">
<description>Runs project tests.</description>
<echo>Running tests from ${TestDir}.</echo>
<ABLUnit>
<PCTConnection dbName="${DbDir}/${DbName}" singleUser="True" />
<fileset dir="${TestDir}" includes="**/*.cls" />
<propath>
<pathelement path="${BuildDir}" />
</propath>
</ABLUnit>
</target>
<target name="docs" depends="init,build">
<description>Creates HTML docs from class comments.</description>
<echo>Generating Docs.</echo>
<ClassDocumentation destDir="${DocDir}">
<fileset dir="preprocess" includes="**/*.cls" />
</ClassDocumentation>
<HTMLDocumentation sourceDir="${DocDir}" destDir="${HtmlDoc}" />
</target>
<target name="package" depends="init,initDB,build">
<description>Packages the code into a procedure library.</description>
<echo>Packaging ${BuildDir} into ${DistDir}/${ant.project.name}.pl</echo>
<PCTLibrary destfile="${DistDir}/${ant.project.name}.pl" basedir="${BuildDir}" />
</target>
<target name="deploy" depends="init,initDB,build,package">
<description>Deploys the procedure library via SSH</description>
<echo>Deploying Package to ${SSH_SERVER}</echo>
<scp todir="${ant.project.name}" file="${DistDir}/${ant.project.name}.pl" />
</target>
<target name="copy_resx" depends="init">
<description>Copies RESX files to the build directory.</description>
<echo>Copying resx files.</echo>
<copy todir="${BuildDir}">
<fileset dir="${SrcDir}">
<include name="**/*.resx" />
</fileset>
</copy>
</target>
<target name="clean" depends="cleanDB">
<description>Deletes build artifacts.</description>
<echo>Deleting build artifacts.</echo>
<delete dir="${BuildDir}" />
<delete dir="${DistDir}" />
<delete dir="${DocDir}" />
<delete dir="preprocess" />
<delete dir="${HtmlDoc}" />
</target>
<target name="cleanDB">
<description>Deletes the development database.</description>
<echo>Deleting development database.</echo>
<delete dir="${DbDir}" />
</target>
<target name="echo">
<description>Echoes the input parameter.</description>
<echo>${echo}</echo>
</target>
</project>