blob: 0df629cfa1c8f236ea5255ae762b55da3ce2b24c [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="LOGGING Build" default="build" basedir=".">
<description>Build for LOGGING component</description>
<!-- import common properties -->
<property name="hy.hdk" location="${basedir}/../../deploy" />
<import file="${hy.hdk}/build/ant/properties.xml" />
<!-- set global properties for this build. -->
<xmlproperty file="make/hyproperties.xml" semanticAttributes="true" />
<fileset id="classes" dir="${hy.build}">
<or>
<present targetdir="${hy.logging.src.main.java}" />
<present targetdir="${hy.logging.src.main.java}">
<mapper type="regexp"
from="^(.*?)(\$$[^/\\\.]*)?\.class$$"
to="\1.java"/>
</present>
</or>
</fileset>
<property name="logging.exclude.file" location="${hy.hdk}/build/logging.exclude" />
<target name="build" depends="compile-java, copy-jar-resources, build-jar, copy-resources" />
<target name="test" depends="-test-module">
<fail message="Some tests failed">
<condition>
<or>
<isset property="test.failures" />
<isset property="test.errors" />
</or>
</condition>
</fail>
</target>
<!-- internal target for local and global test run sequence -->
<target name="-test-module" depends="build, compile-tests, prepare-exclude, run-tests" />
<target name="clean">
<delete file="${hy.jdk}/jre/lib/boot/logging.jar" />
<delete file="${hy.jdk}/jre/lib/boot/logging-src.jar" />
<delete failonerror="false">
<fileset refid="classes" />
<fileset dir="${hy.logging.bin.test}" />
</delete>
</target>
<target name="compile-java">
<echo message="Compiling LOGGING classes" />
<mkdir dir="${hy.build}" />
<javac sourcepath=""
srcdir="${hy.logging.src.main.java}"
destdir="${hy.build}"
compiler="${hy.javac.compiler}"
memoryMaximumSize="${hy.javac.maxmem}"
source="${hy.javac.source}"
target="${hy.javac.target}"
debug="${hy.javac.debug}">
<compilerarg line="${build.compilerarg}" />
<bootclasspath>
<fileset dir="${hy.jdk}/jre/lib/boot">
<include name="**/*.jar" />
</fileset>
</bootclasspath>
</javac>
</target>
<target name="build-jar" depends="svn-info">
<jar destfile="${hy.jdk}/jre/lib/boot/logging.jar"
manifest="${hy.logging}/META-INF/MANIFEST.MF">
<fileset refid="classes" />
<manifest>
<attribute name="Implementation-Version" value="${svn.info}"/>
</manifest>
<metainf refid="hy.required.metainf-files"/>
</jar>
<jar destfile="${hy.jdk}/jre/lib/boot/logging-src.jar">
<fileset dir="${hy.logging.src.main.java}" />
<manifest>
<attribute name="Implementation-Version" value="${svn.info}"/>
</manifest>
<metainf refid="hy.required.metainf-files"/>
</jar>
</target>
<target name="compile-tests" depends="copy-test-resources" >
<echo message="Compiling LOGGING tests" />
<mkdir dir="${hy.logging.bin.internal}" />
<mkdir dir="${hy.logging.bin.test}" />
<javac srcdir="${hy.logging.src.test.internal}"
destdir="${hy.logging.bin.internal}"
sourcepath=""
compiler="${hy.javac.compiler}"
memoryMaximumSize="${hy.javac.maxmem}"
source="${hy.javac.source}"
target="${hy.javac.target}"
debug="${hy.javac.debug}">
<compilerarg line="${build.compilerarg}" />
<bootclasspath>
<fileset dir="${hy.jdk}/jre/lib/boot">
<include name="**/*.jar" />
</fileset>
</bootclasspath>
<classpath location="${hy.hdk}/build/test/support.jar" />
<classpath location="../../build/tests" />
</javac>
<javac srcdir="${hy.logging.src.test.java}"
destdir="${hy.logging.bin.test}"
sourcepath=""
compiler="${hy.javac.compiler}"
memoryMaximumSize="${hy.javac.maxmem}"
source="${hy.javac.source}"
target="${hy.javac.target}"
debug="${hy.javac.debug}">
<compilerarg line="${build.compilerarg}" />
<bootclasspath>
<fileset dir="${hy.jdk}/jre/lib/boot">
<include name="**/*.jar" />
</fileset>
<pathelement path="${hy.logging.bin.internal}"/>
</bootclasspath>
<classpath location="${hy.hdk}/build/test/support.jar" />
<classpath location="../../build/tests" />
</javac>
</target>
<target name="prepare-exclude">
<prepare-exclude-list moduleName="logging" dir="./make"
result="${logging.exclude.file}"/>
</target>
<target name="run-tests">
<mkdir dir="${hy.tests.reports}" />
<property name="test.jre.home" value="${hy.jdk}/jre" />
<junit fork="yes"
forkmode="${hy.test.forkmode}"
timeout="${hy.test.timeout}"
printsummary="withOutAndErr"
errorproperty="test.errors"
failureproperty="test.failures"
showoutput="on"
dir="${basedir}"
jvm="${test.jre.home}/bin/java">
<jvmarg line="${hy.test.vmargs}" />
<!-- Used by Support_Exec.execJava() -->
<jvmarg value="-Dhy.test.vmargs=${hy.test.vmargs}" />
<!-- Required by various tests that set security manager etc -->
<jvmarg value="-Djava.security.policy=../../support/src/test/resources/config/testing.policy" />
<jvmarg value="-Xbootclasspath/a:${hy.logging.bin.internal}"/>
<classpath>
<pathelement path="${hy.logging.bin.test}"/>
</classpath>
<classpath location="${hy.hdk}/build/test/support.jar" />
<classpath location="../../build/tests" />
<formatter type="xml" />
<!-- run LogManagerTest in separated VM -->
<batchtest todir="${hy.tests.reports}" haltonfailure="no"
unless="test.case">
<fileset dir="${hy.logging.src.test.java}">
<include name="org/apache/harmony/logging/tests/java/util/logging/LogManagerTest.java"/>
<excludesfile name="${logging.exclude.file}" />
</fileset>
</batchtest>
<batchtest todir="${hy.tests.reports}" haltonfailure="no" >
<fileset dir="${hy.logging.src.test.java}">
<!-- if ${test.case} -->
<include name="${converted.tc}" if="test.case" />
<!-- unless ${test.case} -->
<include name="org/apache/harmony/logging/tests/java/util/logging/*Test.java" unless="test.case" />
<excludesfile name="${logging.exclude.file}" unless="test.case" />
<exclude name="org/apache/harmony/logging/tests/java/util/logging/LogManagerTest.java" unless="test.case" />
</fileset>
</batchtest>
</junit>
<antcall target="touch-failures-file" />
<antcall target="touch-errors-file" />
</target>
<target name="touch-failures-file" if="test.failures">
<echo file="${hy.tests.reports}/test.failures"
append="true">logging${line.separator}</echo>
</target>
<target name="touch-errors-file" if="test.errors">
<echo file="${hy.tests.reports}/test.errors"
append="true">logging${line.separator}</echo>
</target>
<target name="copy-jar-resources">
<mkdir dir="${hy.build}" />
<copy todir="${hy.build}" includeemptydirs="false">
<fileset dir="${hy.logging.src.main.java}">
<exclude name="**/*.java" />
<exclude name="**/logging.properties" />
</fileset>
</copy>
</target>
<target name="copy-resources">
<copy todir="${hy.jdk}/jre/lib" flatten="yes">
<fileset dir="${hy.logging.src.main.java}">
<include name="**/logging.properties" />
</fileset>
</copy>
</target>
<target name="copy-test-resources">
<mkdir dir="${hy.logging.bin.test}" />
<copy todir="${hy.logging.bin.test}" includeemptydirs="false">
<fileset dir="${hy.logging.src.test.resources}">
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
</project>