xref: /aoo4110/test/build.xml (revision b1cdbd2c)
1*b1cdbd2cSJim Jagielski<?xml version="1.0"?>
2*b1cdbd2cSJim Jagielski<!--***********************************************************
3*b1cdbd2cSJim Jagielski *
4*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one
5*b1cdbd2cSJim Jagielski * or more contributor license agreements.  See the NOTICE file
6*b1cdbd2cSJim Jagielski * distributed with this work for additional information
7*b1cdbd2cSJim Jagielski * regarding copyright ownership.  The ASF licenses this file
8*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the
9*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance
10*b1cdbd2cSJim Jagielski * with the License.  You may obtain a copy of the License at
11*b1cdbd2cSJim Jagielski *
12*b1cdbd2cSJim Jagielski *   http://www.apache.org/licenses/LICENSE-2.0
13*b1cdbd2cSJim Jagielski *
14*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing,
15*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an
16*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17*b1cdbd2cSJim Jagielski * KIND, either express or implied.  See the License for the
18*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations
19*b1cdbd2cSJim Jagielski * under the License.
20*b1cdbd2cSJim Jagielski *
21*b1cdbd2cSJim Jagielski ***********************************************************-->
22*b1cdbd2cSJim Jagielski
23*b1cdbd2cSJim Jagielski
24*b1cdbd2cSJim Jagielski
25*b1cdbd2cSJim Jagielski<project basedir="." default="test">
26*b1cdbd2cSJim Jagielski    <property environment="env" />
27*b1cdbd2cSJim Jagielski	<property name="junit.home" value="${env.JUNIT_HOME}" />
28*b1cdbd2cSJim Jagielski	<property name="dist.dir" value="." />
29*b1cdbd2cSJim Jagielski	<property name="dist.name" value="aoo_test" />
30*b1cdbd2cSJim Jagielski	<property name="junit.jar.repos" value="https://repo1.maven.org/maven2/junit/junit/4.10/junit-4.10.jar" />
31*b1cdbd2cSJim Jagielski
32*b1cdbd2cSJim Jagielski	<path id="uno.classpath">
33*b1cdbd2cSJim Jagielski		<fileset dir="${env.OUTDIR}/bin" erroronmissingdir="false">
34*b1cdbd2cSJim Jagielski			<include name="juh.jar" />
35*b1cdbd2cSJim Jagielski			<include name="unoil.jar" />
36*b1cdbd2cSJim Jagielski			<include name="ridl.jar" />
37*b1cdbd2cSJim Jagielski			<include name="jurt.jar" />
38*b1cdbd2cSJim Jagielski		</fileset>
39*b1cdbd2cSJim Jagielski		<fileset dir="${openoffice.home}" erroronmissingdir="false">
40*b1cdbd2cSJim Jagielski			<include name="**/juh.jar" />
41*b1cdbd2cSJim Jagielski			<include name="**/unoil.jar" />
42*b1cdbd2cSJim Jagielski			<include name="**/ridl.jar" />
43*b1cdbd2cSJim Jagielski			<include name="**/jurt.jar" />
44*b1cdbd2cSJim Jagielski		</fileset>
45*b1cdbd2cSJim Jagielski	</path>
46*b1cdbd2cSJim Jagielski
47*b1cdbd2cSJim Jagielski	<target name="check.junit">
48*b1cdbd2cSJim Jagielski	    <copy todir="lib" >
49*b1cdbd2cSJim Jagielski	        <fileset dir="${junit.home}" erroronmissingdir="false">
50*b1cdbd2cSJim Jagielski	            <include name="junit*.jar" />
51*b1cdbd2cSJim Jagielski			</fileset>
52*b1cdbd2cSJim Jagielski			<globmapper from="*" to="junit.jar" />
53*b1cdbd2cSJim Jagielski        </copy>
54*b1cdbd2cSJim Jagielski		<available file="lib/junit.jar" property="junit.jar.exists"/>
55*b1cdbd2cSJim Jagielski	</target>
56*b1cdbd2cSJim Jagielski
57*b1cdbd2cSJim Jagielski	<target name="prepare.junit" depends="check.junit" unless="junit.jar.exists">
58*b1cdbd2cSJim Jagielski		<mkdir dir="lib" />
59*b1cdbd2cSJim Jagielski		<get src="${junit.jar.repos}" dest="lib/junit.jar" skipexisting="true" />
60*b1cdbd2cSJim Jagielski	</target>
61*b1cdbd2cSJim Jagielski
62*b1cdbd2cSJim Jagielski	<target name="testcommon.init">
63*b1cdbd2cSJim Jagielski		<mkdir dir="testcommon/bin" />
64*b1cdbd2cSJim Jagielski		<copy includeemptydirs="false" todir="testcommon/bin">
65*b1cdbd2cSJim Jagielski			<fileset dir="testcommon/source">
66*b1cdbd2cSJim Jagielski				<exclude name="**/*.java" />
67*b1cdbd2cSJim Jagielski			</fileset>
68*b1cdbd2cSJim Jagielski		</copy>
69*b1cdbd2cSJim Jagielski	</target>
70*b1cdbd2cSJim Jagielski
71*b1cdbd2cSJim Jagielski	<target name="testcommon.compile" depends="testcommon.init, prepare.junit">
72*b1cdbd2cSJim Jagielski		<javac destdir="testcommon/bin" debug="on" source="1.6" target="1.6" encoding="utf-8" includeantruntime="false">
73*b1cdbd2cSJim Jagielski			<src path="testcommon/source"/>
74*b1cdbd2cSJim Jagielski			<classpath>
75*b1cdbd2cSJim Jagielski				<fileset dir="lib">
76*b1cdbd2cSJim Jagielski					<include name="*.jar" />
77*b1cdbd2cSJim Jagielski				</fileset>
78*b1cdbd2cSJim Jagielski			</classpath>
79*b1cdbd2cSJim Jagielski		</javac>
80*b1cdbd2cSJim Jagielski	</target>
81*b1cdbd2cSJim Jagielski
82*b1cdbd2cSJim Jagielski	<target name="testgui.init">
83*b1cdbd2cSJim Jagielski		<mkdir dir="testgui/bin" />
84*b1cdbd2cSJim Jagielski		<copy includeemptydirs="false" todir="testgui/bin">
85*b1cdbd2cSJim Jagielski			<fileset dir="testgui/source">
86*b1cdbd2cSJim Jagielski				<exclude name="**/*.java" />
87*b1cdbd2cSJim Jagielski			</fileset>
88*b1cdbd2cSJim Jagielski		</copy>
89*b1cdbd2cSJim Jagielski	</target>
90*b1cdbd2cSJim Jagielski
91*b1cdbd2cSJim Jagielski	<target name="testgui.compile" depends="testcommon.compile, testgui.init">
92*b1cdbd2cSJim Jagielski		<javac destdir="testgui/bin" debug="on" source="1.6" target="1.6" encoding="utf-8" includeantruntime="false">
93*b1cdbd2cSJim Jagielski			<src path="testgui/source"/>
94*b1cdbd2cSJim Jagielski			<classpath>
95*b1cdbd2cSJim Jagielski				<fileset dir="lib">
96*b1cdbd2cSJim Jagielski				    <include name="*.jar" />
97*b1cdbd2cSJim Jagielski				</fileset>
98*b1cdbd2cSJim Jagielski				<pathelement location="testcommon/bin" />
99*b1cdbd2cSJim Jagielski			</classpath>
100*b1cdbd2cSJim Jagielski		</javac>
101*b1cdbd2cSJim Jagielski	</target>
102*b1cdbd2cSJim Jagielski
103*b1cdbd2cSJim Jagielski	<target name="testuno.init">
104*b1cdbd2cSJim Jagielski		<mkdir dir="testuno/bin" />
105*b1cdbd2cSJim Jagielski		<copy includeemptydirs="false" todir="testuno/bin">
106*b1cdbd2cSJim Jagielski			<fileset dir="testuno/source">
107*b1cdbd2cSJim Jagielski				<exclude name="**/*.java" />
108*b1cdbd2cSJim Jagielski			</fileset>
109*b1cdbd2cSJim Jagielski		</copy>
110*b1cdbd2cSJim Jagielski	</target>
111*b1cdbd2cSJim Jagielski
112*b1cdbd2cSJim Jagielski	<target name="testuno.compile" depends="testcommon.compile, testuno.init">
113*b1cdbd2cSJim Jagielski		<javac destdir="testuno/bin" debug="on" source="1.6" target="1.6" encoding="utf-8" includeantruntime="false">
114*b1cdbd2cSJim Jagielski			<src path="testuno/source"/>
115*b1cdbd2cSJim Jagielski			<classpath>
116*b1cdbd2cSJim Jagielski				<fileset dir="lib">
117*b1cdbd2cSJim Jagielski					<include name="*.jar" />
118*b1cdbd2cSJim Jagielski				</fileset>
119*b1cdbd2cSJim Jagielski				<pathelement location="testcommon/bin" />
120*b1cdbd2cSJim Jagielski				<path refid="uno.classpath"/>
121*b1cdbd2cSJim Jagielski			</classpath>
122*b1cdbd2cSJim Jagielski		</javac>
123*b1cdbd2cSJim Jagielski	</target>
124*b1cdbd2cSJim Jagielski
125*b1cdbd2cSJim Jagielski	<target name="clean" description="Clean all output">
126*b1cdbd2cSJim Jagielski		<delete dir="testcommon/bin" />
127*b1cdbd2cSJim Jagielski		<delete dir="testgui/bin" />
128*b1cdbd2cSJim Jagielski		<delete dir="testuno/bin" />
129*b1cdbd2cSJim Jagielski	</target>
130*b1cdbd2cSJim Jagielski
131*b1cdbd2cSJim Jagielski	<target name="compile" depends="testcommon.compile,testgui.compile,testuno.compile" description="Compile source code">
132*b1cdbd2cSJim Jagielski	</target>
133*b1cdbd2cSJim Jagielski
134*b1cdbd2cSJim Jagielski	<target name="dist" depends="clean,compile">
135*b1cdbd2cSJim Jagielski		<tstamp/>
136*b1cdbd2cSJim Jagielski        	<zip destfile="${dist.dir}/${dist.name}_${DSTAMP}.zip" update="false">
137*b1cdbd2cSJim Jagielski			<zipfileset dir="." includes="lib/**, testcommon/**,testgui/**,testuno/**,build.xml,run,run.bat" filemode="751" prefix="aoo_test/"/>
138*b1cdbd2cSJim Jagielski		</zip>
139*b1cdbd2cSJim Jagielski	</target>
140*b1cdbd2cSJim Jagielski
141*b1cdbd2cSJim Jagielski	<target name="test" depends="compile" description="start test">
142*b1cdbd2cSJim Jagielski		<condition property="test.arg0" value="-Dopenoffice.home=${openoffice.home}">
143*b1cdbd2cSJim Jagielski			<isset property="openoffice.home" />
144*b1cdbd2cSJim Jagielski		</condition>
145*b1cdbd2cSJim Jagielski		<pathconvert property="openoffice.pack" setonempty="false">
146*b1cdbd2cSJim Jagielski			<path>
147*b1cdbd2cSJim Jagielski				<fileset dir="${env.SRC_ROOT}/instsetoo_native/${env.INPATH}/Apache_OpenOffice/archive/install/en-US" includes="*.tar.gz,*.zip"  erroronmissingdir="false"/>
148*b1cdbd2cSJim Jagielski			</path>
149*b1cdbd2cSJim Jagielski		</pathconvert>
150*b1cdbd2cSJim Jagielski		<condition property="test.arg0" value="-Dopenoffice.pack=${openoffice.pack}">
151*b1cdbd2cSJim Jagielski			<isset property="openoffice.pack" />
152*b1cdbd2cSJim Jagielski		</condition>
153*b1cdbd2cSJim Jagielski		<fail message="No OpenOffice available!" unless="test.arg0"/>
154*b1cdbd2cSJim Jagielski		<condition property="test.executable" value="./run.bat">
155*b1cdbd2cSJim Jagielski			<os family="windows" />
156*b1cdbd2cSJim Jagielski		</condition>
157*b1cdbd2cSJim Jagielski		<property name="test.executable" value="./run"/>
158*b1cdbd2cSJim Jagielski		<property name="test.args" value="-tp bvt"/>
159*b1cdbd2cSJim Jagielski		<exec executable="${test.executable}">
160*b1cdbd2cSJim Jagielski			<arg value="${test.arg0}"/>
161*b1cdbd2cSJim Jagielski			<arg line="${test.args}"/>
162*b1cdbd2cSJim Jagielski		</exec>
163*b1cdbd2cSJim Jagielski	</target>
164*b1cdbd2cSJim Jagielski</project>
165