| <?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="AWT Build" default="build" basedir="."> |
| <description>Build for AWT 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" /> |
| |
| <property name="hy.awt.src.main.java.platform" |
| value="${hy.awt.src.main.java}/../${hy.os.family}" /> |
| |
| <property name="hy.awt.src.test.api.java.platform" |
| value="${hy.awt.src.test.api}/java/${hy.os.family}" /> |
| |
| <fileset id="classes" dir="${hy.build}"> |
| <or> |
| <present targetdir="${hy.awt.src.main.java}" /> |
| <present targetdir="${hy.awt.src.main.java}"> |
| <mapper type="regexp" |
| from="^(.*?)(\$$[^/\\\.]*)?\.class$$" |
| to="\1.java"/> |
| </present> |
| <present targetdir="${hy.awt.src.main.java.platform}" /> |
| <present targetdir="${hy.awt.src.main.java.platform}"> |
| <mapper type="regexp" |
| from="^(.*?)(\$$[^/\\\.]*)?\.class$$" |
| to="\1.java"/> |
| </present> |
| </or> |
| </fileset> |
| |
| <property file="../../make/depends.properties" /> |
| |
| <property name="awt.exclude.file" location="${hy.hdk}/build/awt.exclude" /> |
| |
| <target name="build" depends="compile-java, copy-resources, build-jar" /> |
| |
| <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/awt.jar" /> |
| <delete file="${hy.jdk}/jre/lib/boot/awt-src.jar" /> |
| <delete failonerror="false"> |
| <fileset refid="classes" /> |
| <fileset dir="${hy.awt.bin.test}" /> |
| </delete> |
| </target> |
| |
| <target name="compile-java"> |
| <echo message="Compiling AWT classes" /> |
| |
| <mkdir dir="${hy.build}" /> |
| |
| <javac sourcepath="" |
| 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}" /> |
| |
| <src> |
| <pathelement location="${hy.awt.src.main.java}"/> |
| <pathelement location="${hy.awt.src.main.java.platform}" /> |
| </src> |
| |
| <bootclasspath> |
| <fileset dir="${hy.jdk}/jre/lib/boot"> |
| <include name="**/*.jar" /> |
| </fileset> |
| </bootclasspath> |
| </javac> |
| </target> |
| |
| <target name="copy-resources"> |
| <mkdir dir="${hy.build}" /> |
| <copy todir="${hy.build}" includeemptydirs="false"> |
| <fileset dir="${hy.awt.src.main.java}"> |
| <exclude name="**/*.java" /> |
| </fileset> |
| </copy> |
| </target> |
| |
| <target name="build-jar" depends="svn-info"> |
| <jar destfile="${hy.jdk}/jre/lib/boot/awt.jar" |
| manifest="${hy.awt}/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/awt-src.jar"> |
| <fileset dir="${hy.awt.src.main.java}" /> |
| <fileset dir="${hy.awt.src.main.java.platform}" /> |
| <manifest> |
| <attribute name="Implementation-Version" value="${svn.info}"/> |
| </manifest> |
| |
| <metainf refid="hy.required.metainf-files"/> |
| </jar> |
| </target> |
| |
| <target name="build-native" |
| depends="-build-native-unix,-build-native-windows"> |
| <make dir="${hy.awt.src.main.native}/lcmm/${hy.os.family}" /> |
| <!-- Copy the built shared libs over to the jre/bin dir --> |
| <copy todir="${hy.jdk}/jre/bin" overwrite="yes"> |
| <fileset dir="${hy.awt.src.main.native}/lcmm"> |
| <include name="*${shlib.suffix}*"/> |
| <include name="*${progdb.suffix}*" if="is.windows" /> |
| <exclude name="*${manifest.suffix}"/> |
| </fileset> |
| </copy> |
| |
| <make dir="${hy.awt.src.main.native}/jpegdecoder/${hy.os.family}" /> |
| <!-- Copy the built shared libs over to the jre/bin dir --> |
| <copy todir="${hy.jdk}/jre/bin" overwrite="yes"> |
| <fileset dir="${hy.awt.src.main.native}/jpegdecoder"> |
| <include name="*${shlib.suffix}*"/> |
| <include name="*${progdb.suffix}*" if="is.windows" /> |
| <exclude name="*${manifest.suffix}"/> |
| </fileset> |
| </copy> |
| |
| <make dir="${hy.awt.src.main.native}/gl/${hy.os.family}" /> |
| <!-- Copy the built shared libs over to the jre/bin dir --> |
| <copy todir="${hy.jdk}/jre/bin" overwrite="yes"> |
| <fileset dir="${hy.awt.src.main.native}/gl"> |
| <include name="*${shlib.suffix}*"/> |
| <include name="*${progdb.suffix}*" if="is.windows" /> |
| <exclude name="*${manifest.suffix}"/> |
| </fileset> |
| </copy> |
| |
| <make dir="${hy.awt.src.main.native}/oglwrapper/${hy.os.family}" /> |
| <!-- Copy the built shared libs over to the jre/bin dir --> |
| <copy todir="${hy.jdk}/jre/bin" overwrite="yes"> |
| <fileset dir="${hy.awt.src.main.native}/oglwrapper"> |
| <include name="*${shlib.suffix}*"/> |
| <include name="*${progdb.suffix}*" if="is.windows" /> |
| <exclude name="*${manifest.suffix}"/> |
| </fileset> |
| </copy> |
| </target> |
| |
| <target name="-build-native-unix" if="is.unix"> |
| <make dir="${hy.awt.src.main.native}/x11wrapper/${hy.os.family}" /> |
| <!-- Copy the built shared libs over to the jre/bin dir --> |
| <copy todir="${hy.jdk}/jre/bin" overwrite="yes"> |
| <fileset dir="${hy.awt.src.main.native}/x11wrapper"> |
| <include name="*${shlib.suffix}*"/> |
| </fileset> |
| </copy> |
| |
| <make dir="${hy.awt.src.main.native}/linuxfont/${hy.os.family}" /> |
| <!-- Copy the built shared libs over to the jre/bin dir --> |
| <copy todir="${hy.jdk}/jre/bin" overwrite="yes"> |
| <fileset dir="${hy.awt.src.main.native}/linuxfont"> |
| <include name="*${shlib.suffix}*"/> |
| </fileset> |
| </copy> |
| </target> |
| |
| <target name="-build-native-windows" if="is.windows"> |
| <make dir="${hy.awt.src.main.native}/win32wrapper/${hy.os.family}" /> |
| <!-- Copy the built shared libs over to the jre/bin dir --> |
| <copy todir="${hy.jdk}/jre/bin" overwrite="yes"> |
| <fileset dir="${hy.awt.src.main.native}/win32wrapper"> |
| <include name="*${shlib.suffix}*"/> |
| <include name="*${progdb.suffix}*" /> |
| <exclude name="*${manifest.suffix}"/> |
| </fileset> |
| </copy> |
| |
| <make dir="${hy.awt.src.main.native}/winfont/${hy.os.family}" /> |
| <!-- Copy the built shared libs over to the jre/bin dir --> |
| <copy todir="${hy.jdk}/jre/bin" overwrite="yes"> |
| <fileset dir="${hy.awt.src.main.native}/winfont"> |
| <include name="*${shlib.suffix}*"/> |
| <include name="*${progdb.suffix}*" /> |
| <exclude name="*${manifest.suffix}"/> |
| </fileset> |
| </copy> |
| </target> |
| |
| <target name="clean-native" |
| depends="-clean-native-unix,-clean-native-windows"> |
| <make dir="${hy.awt.src.main.native}/lcmm/${hy.os.family}" |
| target="clean"/> |
| <make dir="${hy.awt.src.main.native}/jpegdecoder/${hy.os.family}" |
| target="clean"/> |
| <make dir="${hy.awt.src.main.native}/gl/${hy.os.family}" |
| target="clean"/> |
| <make dir="${hy.awt.src.main.native}/oglwrapper/${hy.os.family}" |
| target="clean"/> |
| </target> |
| |
| <target name="-clean-native-unix" if="is.unix"> |
| <make dir="${hy.awt.src.main.native}/x11wrapper/${hy.os.family}" |
| target="clean"/> |
| <make dir="${hy.awt.src.main.native}/linuxfont/${hy.os.family}" |
| target="clean"/> |
| </target> |
| |
| <target name="-clean-native-windows" if="is.windows"> |
| <make dir="${hy.awt.src.main.native}/win32wrapper/${hy.os.family}" |
| target="clean"/> |
| <make dir="${hy.awt.src.main.native}/winfont/${hy.os.family}" |
| target="clean"/> |
| </target> |
| |
| <target name="compile-tests" depends="copy-test-resources"> |
| <echo message="Compiling AWT tests" /> |
| |
| <mkdir dir="${hy.awt.bin.test}" /> |
| |
| <javac destdir="${hy.awt.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}" /> |
| |
| <src> |
| <pathelement location="${hy.awt.src.test.api}/java/common" /> |
| <pathelement location="${hy.awt.src.test.api.java.platform}" /> |
| </src> |
| |
| <bootclasspath> |
| <fileset dir="${hy.jdk}/jre/lib/boot"> |
| <include name="**/*.jar" /> |
| </fileset> |
| </bootclasspath> |
| <classpath location="../../build/tests" /> |
| </javac> |
| <!--mkdir dir="${hy.awt.src.test.api}/java/common/java/awt/geom/shapes" /> |
| <copy todir="${hy.awt.bin.test}/java/awt/geom/shapes" overwrite="yes"> |
| <fileset dir="${hy.awt.src.test.api}/java/common/java/awt/geom/shapes" /> |
| </copy> |
| <mkdir dir="${hy.awt.src.test.api}/java/common/java/awt/geom/serialization" /> |
| <copy todir="${hy.awt.bin.test}/java/awt/geom/serialization" overwrite="yes"> |
| <fileset dir="${hy.awt.src.test.api}/java/common/java/awt/geom/serialization" /> |
| </copy> |
| <mkdir dir="${hy.awt.src.test.api}/java/common/java/awt/shapes" /> |
| <copy todir="${hy.awt.bin.test}/java/awt/shapes" overwrite="yes"> |
| <fileset dir="${hy.awt.src.test.api}/java/common/java/awt/shapes" /> |
| </copy> |
| <mkdir dir="${hy.awt.src.test.api}/java/common/java/java/serialization" /> |
| <copy todir="${hy.awt.bin.test}/java/awt/serialization" overwrite="yes"> |
| <fileset dir="${hy.awt.src.test.api}/java/common/java/awt/serialization" /> |
| </copy> |
| <mkdir dir="${hy.awt.src.test.api}/java/common/org/apache/harmony/awt/gl/resources" /> |
| <copy todir="${hy.awt.bin.test}/org/apache/harmony/awt/gl/resources" overwrite="yes"> |
| <fileset dir="${hy.awt.src.test.api}/java/common/org/apache/harmony/awt/gl/resources" /> |
| </copy--> |
| </target> |
| |
| <target name="copy-test-resources"> |
| <mkdir dir="${hy.awt.bin.test}" /> |
| <copy todir="${hy.awt.bin.test}" includeemptydirs="false"> |
| <fileset dir="${hy.awt.src.test.resources}"> |
| <exclude name="**/*.java" /> |
| </fileset> |
| </copy> |
| </target> |
| |
| <target name="prepare-exclude"> |
| <prepare-exclude-list moduleName="awt" dir="./make" |
| result="${awt.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}" /> |
| |
| <jvmarg value="-DTEST_SRC_DIR=${hy.awt.bin.test}"/> |
| <!-- <jvmarg value="-Djava2d.opengl=true"/> --> |
| <jvmarg value="-Xbootclasspath/a:${hy.awt.bin.test}${path.separator}${basedir}/../../${junit.jar}"/> |
| |
| <formatter type="xml" /> |
| |
| <batchtest todir="${hy.tests.reports}" haltonfailure="no" > |
| |
| <!-- if ${test.case} --> |
| <fileset dir="${hy.awt.src.test.api}/java/common"> |
| <include name="${converted.tc}" if="test.case" /> |
| </fileset> |
| <fileset dir="${hy.awt.src.test.api.java.platform}"> |
| <include name="${converted.tc}" if="test.case" /> |
| </fileset> |
| <!-- unless ${test.case} --> |
| <fileset dir="${hy.awt.src.test.api}/java/common"> |
| <include name="**/*Test.java" unless="test.case" /> |
| <excludesfile name="${awt.exclude.file}" unless="test.case"/> |
| <exclude name="**/*Headless*Test.java"/> |
| </fileset> |
| <fileset dir="${hy.awt.src.test.api.java.platform}"> |
| <include name="**/*Test.java" unless="test.case" /> |
| <excludesfile name="${awt.exclude.file}" unless="test.case"/> |
| <exclude name="**/*Headless*Test.java"/> |
| </fileset> |
| </batchtest> |
| </junit> |
| |
| <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}" /> |
| |
| <jvmarg value="-DTEST_SRC_DIR=${hy.awt.bin.test}"/> |
| <jvmarg value="-Djava.awt.headless=true"/> |
| <jvmarg value="-Xbootclasspath/a:${hy.awt.bin.test}${path.separator}${basedir}/../../${junit.jar}"/> |
| |
| <formatter type="xml" /> |
| |
| <batchtest todir="${hy.tests.reports}" haltonfailure="no" > |
| |
| <fileset dir="${hy.awt.src.test.api}/java/common"> |
| <include name="**/*Headless*Test.java" unless="test.case" /> |
| <excludesfile name="${awt.exclude.file}" unless="test.case"/> |
| </fileset> |
| <fileset dir="${hy.awt.src.test.api.java.platform}"> |
| <include name="**/*Headless*Test.java" unless="test.case" /> |
| <excludesfile name="${awt.exclude.file}" 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">awt${line.separator}</echo> |
| </target> |
| |
| <target name="touch-errors-file" if="test.errors"> |
| <echo file="${hy.tests.reports}/test.errors" |
| append="true">awt${line.separator}</echo> |
| </target> |
| |
| </project> |