summaryrefslogtreecommitdiff
path: root/build.xml
blob: eafc123b5045124c83151fc920409ef1db77f6fd (plain)
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
<?xml version="1.0" encoding="UTF-8"?>

<project name="yalp" default="all" basedir=".">
	<property name="srcInterfaces" value="src/YalpInterfaces"/>

	<property name="srcInputs" value="src/YalpInputs"/>
	<property name="srcOutputs" value="src/YalpOutputs"/>
	<property name="srcAuth" value="src/YalpAuth"/>
	<property name="srcServer" value="src/YalpServer"/>
	<property name="srcClients" value="src/YalpClients"/>

	<property name="srcVlcTelnetOutput" value="${srcOutputs}/YalpVlcTelnetOutput"/>
	<property name="srcPGSqlInput" value="${srcInputs}/YalpPGSqlInput"/>
	<property name="srcPGSqlAuth" value="${srcAuth}/YalpPGSqlAuth"/>

	<property name="srcSwtClient" value="${srcClients}/SwtClient"/>
	<property name="srcSwtClientGUI" value="${srcSwtClient}/GUI"/>

	<property name="src" value="src/"/>
	<property name="doc" value="doc/"/>
	<property name="sqldoc" value="${doc}/sql"/>
	<property name="javadoc" value="${doc}/java"/>
	<property name="build" value="build/"/>
	<property name="lib" value="lib/"/>

	<property name="log4jLibs" value="lib/log4j-1.2.15.jar"/>
	<property name="vlctelnetLibs" value="lib/commons-net-1.4.1.jar"/>
	<property name="swtLibs" value="lib/swt.jar"/>
	<property name="dbLibs" value="lib/postgresql-8.1-404.jdbc3.jar"/>

	<property name="idlj" value="../idlj.sh"/>
	<property name="psqldoc" value="./postgresql_autodoc/postgresql_autodoc"/>

	<path id="project.class.path">
		<pathelement location="{lib}"/>
		<pathelement path="${java.class.path}"/>
		<pathelement path="${additional.path}"/>
	</path>
	
	<target name="all" depends="vlctelnetoutput, pgsqlinput, pgsqlauth, server, swtclient" description="builds server and client">
		<echo>Doing all</echo>
	</target>

	<target name="interfaces" description="Create stubs/skeletons from idl">
		<exec dir="${src}" executable="${idlj}">
			<arg value="yalp.idl"/>
		</exec>
		<javac srcdir="${srcInterfaces}" destdir="${build}"/>
	</target>

	<target name ="server" depends="interfaces" description="builds the Server">
		<javac debug="true" srcdir="${srcServer}" destdir="${build}"/>
		<jar destfile="yalpServer.jar" basedir="${build}">
			<path id="project.class.path">
				<pathelement location="${lib}"/>
				<pathelement path="${java.class.path}"/>
				<pathelement path="${additional.path}"/>
			</path>
			<manifest>
				<attribute name="Built-By" value="${user.name}"/>
				<attribute name="Main-Class" value="YalpServer.YalpServer"/>
				<attribute name="Class-Path" value="${log4jLibs}"/>
			</manifest>
		</jar>
	</target>

	<target name ="outputs" description="builds output base files">
		<javac debug="true" srcdir="${srcOutputs}" destdir="${build}"/>
	</target>

	<target name ="vlctelnetoutput" depends="interfaces, outputs" description="builds the vlctelnetoutput">
		<javac debug="true" srcdir="${srcVlcTelnetOutput}" destdir="${build}"/>
		<jar destfile="yalpVlcTelnetOutput.jar" basedir="${build}">
			<path id="project.class.path">
				<pathelement location="${lib}"/>
				<pathelement path="${java.class.path}"/>
				<pathelement path="${additional.path}"/>
			</path>
			<manifest>
				<attribute name="Built-By" value="${user.name}"/>
				<attribute name="Main-Class" value="YalpOutputs.YalpVlcTelnetOutput.YalpVlcTelnetOutput"/>
				<attribute name="Class-Path" value="${vlctelnetLibs} ${log4jLibs}"/>
			</manifest>
		</jar>
	</target>

	<target name ="inputs" description="builds input base files">
		<javac debug="true" srcdir="${srcInputs}" destdir="${build}"/>
	</target>

	<target name ="pgsqlinput" depends="interfaces, inputs" description="builds the pgsql input plugin">
		<javac debug="true" srcdir="${srcPGSqlInput}" destdir="${build}"/>
		<jar destfile="yalpPGSqlInput.jar" basedir="${build}">
			<path id="project.class.path">
				<pathelement location="${lib}"/>
				<pathelement path="${java.class.path}"/>
				<pathelement path="${additional.path}"/>
			</path>
			<manifest>
				<attribute name="Built-By" value="${user.name}"/>
				<attribute name="Main-Class" value="YalpInputs.YalpPGSqlInput.YalpPGSqlInput"/>
				<attribute name="Class-Path" value="${dbLibs} ${log4jLibs}"/>
			</manifest>
		</jar>
	</target>

	<target name ="auth" description="builds auth base files">
		<javac debug="true" srcdir="${srcAuth}" destdir="${build}"/>
	</target>

	<target name ="pgsqlauth" depends="interfaces, auth" description="builds the pgsql auth plugin">
		<javac debug="true" srcdir="${srcPGSqlAuth}" destdir="${build}"/>
		<jar destfile="yalpPGSqlAuth.jar" basedir="${build}">
			<path id="project.class.path">
				<pathelement location="${lib}"/>
				<pathelement path="${java.class.path}"/>
				<pathelement path="${additional.path}"/>
			</path>
			<manifest>
				<attribute name="Built-By" value="${user.name}"/>
				<attribute name="Main-Class" value="YalpAuth.YalpPGSqlAuth.YalpPGSqlAuth"/>
				<attribute name="Class-Path" value="${dbLibs}"/>
			</manifest>
		</jar>
	</target>

	<target name ="clients" depends="interfaces" description="builds the client bsae files">
			<javac debug="true" srcdir="${srcClients}" destdir="${build}"/>
	</target>

	<target name ="swtclient" depends="clients" description="builds SWT GUI">
			<javac debug="true" srcdir="${srcSwtClient}" destdir="${build}"/>
			<jar destfile="yalpSWTClient.jar" basedir="${build}">
				<path id="project.class.path">
					<pathelement location="${lib}"/>
					<pathelement path="${java.class.path}"/>
					<pathelement path="${additional.path}"/>
				</path>
				<manifest>
					<attribute name="Built-By" value="${user.name}"/>
					<attribute name="Main-Class" value="YalpClients.SwtClient.SwtClient"/>
					<attribute name="Class-Path" value="${swtLibs}"/>
				</manifest>
			</jar>
	</target>

	<target name="swtgui" depends="swtclient">
		<javac debug="true" srcdir="${srcSwtGUI}" destdir="${build}">
			<classpath refid="project.class.path"/>
		</javac>
	</target>

	<target name="clean" depends="cleandoc" description="Removes previous build">
		<delete verbose="true">
			<fileset dir="${build}"/>
			<fileset dir="${srcInterfaces}"/>
		</delete>
	</target>
	
	<target name="runserver" depends="server" description="starts Server">
		<java jar="server.jar" fork="true"/>
	</target>
	
	<target name="runclient" depends="swtclient" description="starts Client">
		<java jar="client.jar" fork="true"/>
	</target>

	<target name="cleandoc" depends="cleansqldoc, cleanjavadoc"/>

	<target name="cleansqldoc" description="Removes previous sqldoc">
		<delete verbose="true">
			<fileset dir="${sqldoc}"/>
		</delete>
	</target>

	<target name="cleanjavadoc" description="Removes previous javadoc">
		<delete verbose="true">
			<fileset dir="${javadoc}"/>
		</delete>
	</target>
	
	<target name="doc" depends="cleandoc" description="generates javadoc">
		<javadoc packagenames="YalpAuth.*, YalpServer, YalpClients.*, YalpInterfaces, YalpOutputs.*, YalpInputs.*" sourcepath="src" author="true" version="true" use="true" destdir="${javadoc}"/>
		<exec dir="." executable="${psqldoc}">
			<arg line="-d yalp -f ${sqldoc}/yalp -h localhost -u yalp --password=yalp -l ./postgresql_autodoc"/>
		</exec>
	</target>

</project>