build.xml 1.72 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<project>
  <path id="master-classpath">
    <fileset dir="lib">
      <include name="*.jar"/>
    </fileset>
    <fileset dir="bin">
      <include name="*.jar"/>
    </fileset>
  </path>

  <target name="clean">
    <delete dir="build"/>
    <delete dir="testResults"/>
  </target>

  <target name="compile">
    <mkdir dir="build/classes"/>

19
    <javac sourcepath="" srcdir="src" destdir="build/classes" includeantruntime="false" >
20 21 22 23 24 25 26 27 28
      <include name="**/*.java"/>
      <classpath refid="master-classpath"/>
    </javac>
  </target>

  <target name="jar">
    <mkdir dir="build/jar"/>
    <jar destfile="build/jar/opencv-test.jar" basedir="build/classes">
      <manifest>
29
        <attribute name="Main-Class" value="org.opencv.test.OpenCVTestRunner"/>
30 31 32 33 34 35
      </manifest>
    </jar>
  </target>

  <target name="test">
    <mkdir dir="testResults"/>
36
    <junit printsummary="true" haltonfailure="false" haltonerror="false" showoutput="false" logfailedtests="true" maxmemory="256m">
37
      <sysproperty key="java.library.path" path="${javaLibraryPath}"/>
38
      <env key="PATH" path="${javaLibraryPath}"/>
39 40
      <classpath refid="master-classpath"/>
      <classpath>
41
        <pathelement location="build/classes"/>
42 43 44 45 46
      </classpath>

      <formatter type="xml"/>

      <batchtest fork="yes" todir="testResults">
47 48 49
        <zipfileset src="build/jar/opencv-test.jar" includes="**/*.class" excludes="**/OpenCVTest*">
          <exclude name="**/*$*.class"/>
        </zipfileset>
50 51 52 53
      </batchtest>
    </junit>
  </target>

54 55 56 57 58
  <target name="build">
    <antcall target="compile"/>
    <antcall target="jar"/>
  </target>

59 60 61 62 63 64
  <target name="buildAndTest">
    <antcall target="compile"/>
    <antcall target="jar"/>
    <antcall target="test"/>
  </target>
</project>