1<project name="testing-log4j-bridge" default="usage" basedir="."> 2 3 <property name="lbversion" value="0.9.8-SNAPSHOT" /> 4 <property name="slf4jversion" value="1.4.2" /> 5 <property name="source.home" value="/src/main/java/" /> 6 <property name="javac.dest.12" value="/target/classes12/" /> 7 <property name="javac.dest.13" value="/target/classes13/" /> 8 <property name="lib" value="/lib" /> 9 10 <property name="deprecation" value="on" /> 11 12 <path id="basic.classpath"> 13 <pathelement location="${source.home}" /> 14 <pathelement location="${lib}/junit-3.8.1.jar" /> 15 </path> 16 17 <path id="log4j12.classpath"> 18 <path refid="basic.classpath" /> 19 <pathelement location="${javac.dest.12}" /> 20 <pathelement location="${lib}/log4j-1.2.14.jar" /> 21 </path> 22 23 <path id="log4j13.classpath"> 24 <path refid="basic.classpath" /> 25 <pathelement location="${javac.dest.13}" /> 26 <pathelement location="${lib}/log4j-1.3alpha-8.jar" /> 27 </path> 28 29 <path id="los.classpath"> 30 <path refid="basic.classpath" /> 31 <pathelement location="${lib}/log4j-over-slf4j-${slf4jversion}.jar" /> 32 <pathelement location="${lib}/logback-classic-${lbversion}.jar" /> 33 <pathelement location="${lib}/logback-core-${lbversion}.jar" /> 34 <pathelement location="${lib}/slf4j-api-${slf4jversion}.jar" /> 35 </path> 36 37 <!-- ================================================================= --> 38 <!-- Default target --> 39 <!-- ================================================================= --> 40 <target name="usage"> 41 <echo> 42 These are some of the targets supported by this ANT build scpript: 43 44 all - run all available tests 45 refresh - copy required jar files to the lib directory 46 </echo> 47 </target> 48 49 <delete> 50 <fileset dir="." includes="**/*.bak"/> 51 </delete> 52 53 <target name="refresh"> 54 <delete> 55 <fileset dir="lib"> 56 <include name="logback-*.jar"/> 57 <include name="log4j-bridge-*.jar"/> 58 </fileset> 59 </delete> 60 <copy file="/slf4j-api/target/slf4j-api-${slf4jversion}.jar" todir="lib/"/> 61 <copy file="/target/log4j-over-slf4j-${slf4jversion}.jar" todir="lib/"/> 62 63 </target> 64 65 66 <target name="init"> 67 <mkdir dir="${javac.dest.12}" /> 68 <mkdir dir="${javac.dest.13}" /> 69 </target> 70 71 <target name="clean"> 72 <delete> 73 <fileset dir="${javac.dest.12}" includes="**" /> 74 <fileset dir="${javac.dest.13}" includes="**" /> 75 </delete> 76 </target> 77 78 <target name="build_log4j12" depends="init"> 79 <javac srcdir="${source.home}" 80 destdir="${javac.dest.12}" 81 includes="**/Log4j12Calls.java" 82 deprecation="${deprecation}" debug="on"> 83 <classpath refid="log4j12.classpath" /> 84 </javac> 85 </target> 86 87 <target name="build_log4j13" depends="init"> 88 <javac srcdir="${source.home}" 89 destdir="${javac.dest.13}" 90 includes="**/Log4j13Calls.java" deprecation="${deprecation}" debug="on"> 91 <classpath refid="log4j13.classpath" /> 92 </javac> 93 </target> 94 95 <target name="build_loggerTest" depends="init"> 96 <javac srcdir="${source.home}" 97 destdir="${javac.dest.12}" 98 includes="**/LoggerTest.java" 99 deprecation="${deprecation}" debug="on"> 100 <classpath refid="los.classpath" /> 101 </javac> 102 </target> 103 104 <!-- ================================================================= --> 105 <!-- Run tests --> 106 <!-- ================================================================= --> 107 <target name="all" depends="test12, test13, loggerTest" /> 108 109 110 <target name="loggerTest" depends="build_loggerTest"> 111 <junit printsummary="yes" fork="yes" haltonfailure="yes"> 112 <classpath refid="los.classpath" /> 113 <classpath location="${javac.dest.12}" /> 114 <formatter type="plain" usefile="false" /> 115 <test name="test.LoggerTest" /> 116 </junit> 117 </target> 118 119 <target name="test12" depends="build_log4j12"> 120 <junit printsummary="yes" fork="yes" haltonfailure="yes"> 121 <classpath refid="los.classpath" /> 122 <classpath location="${javac.dest.12}" /> 123 <formatter type="plain" usefile="false" /> 124 <test name="test.Log4j12Calls" /> 125 </junit> 126 </target> 127 128 <target name="test13" depends="build_log4j13"> 129 <junit printsummary="yes" fork="yes" haltonfailure="yes"> 130 <classpath refid="los.classpath" /> 131 <classpath location="${javac.dest.13}" /> 132 <formatter type="plain" usefile="false" /> 133 <test name="test.Log4j13Calls" /> 134 </junit> 135 </target> 136 137</project> 138