| <?xml version="1.0"?> |
| <!-- |
| |
| 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="HTML.test" default="main" basedir="."> |
| <property name="ROYALE_HOME" location="../../../../../.."/> |
| |
| <property file="${ROYALE_HOME}/env.properties"/> |
| <property environment="env"/> |
| <property file="${ROYALE_HOME}/build.properties"/> |
| <property name="ROYALE_HOME" value="${env.ROYALE_HOME}"/> |
| <property name="ROYALE_SWF_COMPILER_HOME" value="${env.ROYALE_SWF_COMPILER_HOME}"/> |
| <property name="target.name" value="Core-${release.version}.swc" /> |
| |
| <condition property="browser" value="C:/Program Files/Internet Explorer/iexplore.exe"> |
| <os family="windows"/> |
| </condition> |
| <condition property="browser" value="/Applications/Safari.app/Contents/MacOS/Safari"> |
| <os family="mac"/> |
| </condition> |
| |
| <property name="report.dir" value="${basedir}/out" /> |
| |
| <available file="${ROYALE_HOME}/in/flexunit" |
| type="dir" |
| property="FLEXUNIT_HOME" |
| value="${ROYALE_HOME}/in/flexunit" /> |
| |
| <available file="${env.FLEXUNIT_HOME}" |
| type="dir" |
| property="FLEXUNIT_HOME" |
| value="${env.FLEXUNIT_HOME}"/> |
| |
| <available file="${FLEXUNIT_HOME}/FlexUnit4/target" |
| type="dir" |
| property="FLEXUNIT_LIBPATH1" |
| value="-library-path+=${FLEXUNIT_HOME}/FlexUnit4/target/flexunit-4.3.0-20140410-as3_4.12.0.swc" /> |
| <property name="FLEXUNIT_LIBPATH1" value="-library-path+=${FLEXUNIT_HOME}/flexunit" /> |
| |
| <available file="${FLEXUNIT_HOME}/FlexUnit4CIListener/target" |
| type="dir" |
| property="FLEXUNIT_LIBPATH2" |
| value="-library-path+=${FLEXUNIT_HOME}/FlexUnit4CIListener/target" /> |
| <property name="FLEXUNIT_LIBPATH2" value="-define+=CONFIG::dummy,false" /> |
| |
| <available file="${FLEXUNIT_HOME}/FlexUnit4AntTasks/target" |
| type="dir" |
| property="FLEXUNIT_CLASSPATH" |
| value="${FLEXUNIT_HOME}/FlexUnit4AntTasks/target" /> |
| <property name="FLEXUNIT_CLASSPATH" value="${FLEXUNIT_HOME}/flexunit" /> |
| |
| <target name="main" depends="clean,compile,test" description="Clean test of ${target.name}"> |
| </target> |
| |
| <target name="clean"> |
| <delete failonerror="false"> |
| <fileset dir="${basedir}"> |
| <include name="FlexUnitRoyaleApplication.swf"/> |
| </fileset> |
| </delete> |
| <delete failonerror="false" includeemptydirs="true"> |
| <fileset dir="${report.dir}"> |
| <include name="**/**"/> |
| </fileset> |
| </delete> |
| </target> |
| |
| <path id="lib.path"> |
| <fileset dir="${ROYALE_COMPILER_HOME}/lib" includes="compiler-royaleTasks.jar"/> |
| </path> |
| |
| <target name="compile" description="Compiles FlexUnitApplication.swf"> |
| <echo message="Compiling FlexUnitRoyaleApplication.swf"/> |
| <echo message="ROYALE_HOME: ${ROYALE_HOME}"/> |
| <echo message="ROYALE_SWF_COMPILER_HOME: ${ROYALE_SWF_COMPILER_HOME}"/> |
| <echo message="FLEXUNIT_HOME: ${FLEXUNIT_HOME}"/> |
| <echo message="playerglobal.version: ${playerglobal.version}"/> |
| |
| <!-- Load the <compc> task. We can't do this at the <project> level --> |
| <!-- because targets that run before flexTasks.jar gets built would fail. --> |
| <taskdef resource="flexTasks.tasks" classpathref="lib.path"/> |
| <!-- |
| Link in the classes (and their dependencies) for the MXML tags |
| listed in this project's manifest.xml. |
| Also link the additional classes (and their dependencies) |
| listed in RoyaleUIClasses.as, |
| because these aren't referenced by the manifest classes. |
| Keep the standard metadata when compiling. |
| Include the appropriate CSS files and assets in the SWC. |
| Don't include any resources in the SWC. |
| Write a bundle list of referenced resource bundles |
| into the file bundles.properties in this directory. |
| --> |
| <mxmlc fork="true" |
| file="${basedir}/FlexUnitRoyaleApplication.mxml" |
| output="${basedir}/FlexUnitRoyaleApplication.swf"> |
| <jvmarg line="${mxmlc.jvm.args}"/> |
| <arg value="+royalelib=${ROYALE_HOME}/frameworks" /> |
| <arg value="-debug" /> |
| <arg value="-compiler.mxml.children-as-data" /> |
| <arg value="-compiler.binding-value-change-event=org.apache.royale.events.ValueChangeEvent" /> |
| <arg value="-compiler.binding-value-change-event-kind=org.apache.royale.events.ValueChangeEvent" /> |
| <arg value="-compiler.binding-value-change-event-type=valueChange" /> |
| <arg value="-define=COMPILE::SWF,true" /> |
| <arg value="-define=COMPILE::JS,false" /> |
| <arg value="+playerglobal.version=${playerglobal.version}" /> |
| <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" /> |
| <arg value="-source-path+=${ROYALE_HOME}/frameworks/projects/HTML/src/main/royale" /> |
| <arg value="-library-path+=${ROYALE_HOME}/frameworks/libs" /> |
| <arg value="${FLEXUNIT_LIBPATH1}" /> |
| <arg value="${FLEXUNIT_LIBPATH2}" /> |
| </mxmlc> |
| </target> |
| |
| <target name="test"> |
| <taskdef resource="flexUnitTasks.tasks"> |
| <classpath> |
| <fileset dir="${FLEXUNIT_CLASSPATH}"> |
| <include name="flexUnitTasks*.jar" /> |
| </fileset> |
| </classpath> |
| </taskdef> |
| <mkdir dir="${report.dir}" /> |
| <flexunit |
| swf="${basedir}/FlexUnitRoyaleApplication.swf" |
| workingDir="${basedir}" |
| toDir="${report.dir}" |
| haltonfailure="false" |
| verbose="true" |
| localTrusted="true" |
| timeout="90000"> |
| <source dir="${ROYALE_HOME}/frameworks/projects/HTML/src/main/royale" /> |
| <library dir="${ROYALE_HOME}/frameworks/libs" /> |
| </flexunit> |
| |
| <!-- Generate readable JUnit-style reports --> |
| <junitreport todir="${report.dir}"> |
| <fileset dir="${report.dir}"> |
| <include name="TEST-*.xml" /> |
| </fileset> |
| <report format="frames" todir="${report.dir}/html" /> |
| </junitreport> |
| |
| </target> |
| </project> |