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}/bin" erroronmissingdir="false"> 34 <include name="juh.jar" /> 35 <include name="noil.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 <condition property="test.arg0" value="-Dopenoffice.home=${openoffice.home}"> 144 <isset property="openoffice.home" /> 145 </condition> 146 <pathconvert property="openoffice.pack" setonempty="false"> 147 <path> 148 <fileset dir="${env.SRC_ROOT}/instsetoo_native/${env.INPATH}/OpenOffice/archive/install/en-US" includes="*.tar.gz,*.zip" erroronmissingdir="false"/> 149 </path> 150 </pathconvert> 151 <condition property="test.arg0" value="-Dopenoffice.pack=${openoffice.pack}"> 152 <isset property="openoffice.pack" /> 153 </condition> 154 <fail message="No OpenOffice available!" unless="test.arg0"/> 155 <condition property="test.executable" value="./test.bat"> 156 <os family="windows" /> 157 </condition> 158 <echo>${test.arg0}</echo> 159 <property name="test.executable" value="./test"/> 160 <exec executable="${test.executable}"> 161 <arg value="${test.arg0}"/> 162 <arg value="-tp"/> 163 <arg value="bvt"/> 164 </exec> 165 </target> 166 167 <target name="upgrade"> 168 <property name="upgrade.script" location="${java.io.tmpdir}/aoo_test_upgrade.xml"/> 169 <property name="upgrade.to" location="."/> 170 <copy file="build.xml" tofile="${upgrade.script}"/> 171 <condition property="ant.executable" value="ant.bat"> 172 <os family="windows" /> 173 </condition> 174 <property name="ant.executable" value="ant"/> 175 <exec executable="${ant.executable}" spawn="true"> 176 <arg value="-Dupgrade.to=${upgrade.to}"/> 177 <arg value="-f"/> 178 <arg value="${upgrade.script}"/> 179 <arg value="upgrade.run"/> 180 </exec> 181 </target> 182 183 <target name="upgrade.run"> 184 <property name="testpack.url" value="http://9.123.117.85/testpack/trunk/aoo_test.zip"/> 185 <property name="testack.temp" location="${java.io.tmpdir}/aoo_test.zip"/> 186 <get src="${testpack.url}" dest="${testack.temp}"/> 187 <delete dir="${upgrade.to}" failonerror="false"/> 188 <mkdir dir="${upgrade.to}"/> 189 <unzip src="${testack.temp}" dest="${upgrade.to}"/> 190 </target> 191 192 193 194 <target name="check.build" description="Check the build context"> 195 <condition property="openoffice.pack.dir" value="${env.SRC_ROOT}/instsetoo_native/${env.INPATH}/OpenOffice/archive/install/en-US"> 196 <isset property="env.SRC_ROOT" /> 197 </condition> 198 <condition property="find.build.skip"> 199 <or> 200 <isset property="openoffice.pack.url" /> 201 <isset property="openoffice.pack.dir" /> 202 <isset property="openoffice.home" /> 203 </or> 204 </condition> 205 <condition property="download.build.skip"> 206 <or> 207 <isset property="openoffice.pack.dir" /> 208 <isset property="openoffice.home" /> 209 </or> 210 </condition> 211 <condition property="install.build.skip"> 212 <isset property="openoffice.home" /> 213 </condition> 214 </target> 215</project> 216