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