You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2016/05/19 05:15:26 UTC
[2/6] git commit: [flex-asjs] [refs/heads/develop] - clean up build
scripts
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a72a205c/frameworks/projects/Mobile/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Mobile/build.xml b/frameworks/projects/Mobile/build.xml
index f2f6a3a..a570197 100644
--- a/frameworks/projects/Mobile/build.xml
+++ b/frameworks/projects/Mobile/build.xml
@@ -26,13 +26,12 @@
<property environment="env"/>
<property file="${FLEXJS_HOME}/build.properties"/>
<property name="FLEX_HOME" value="${FLEXJS_HOME}"/>
- <property name="FALCON_HOME" value="${env.FALCON_HOME}"/>
- <property name="target.name" value="Mobile.swc" />
- <property name="target.name.no.version" value="Mobile.swc" />
-
- <target name="main" depends="clean,js-if-needed,compile,test" description="Full build of Mobile.swc">
+
+ <property name="target.name" value="${ant.project.name}.swc" />
+
+ <target name="main" depends="clean,check-compiler,js-if-needed,compile,test" description="Full build of ${ant.project.name}.swc">
</target>
-
+
<target name="check-js">
<uptodate property="js-not-needed" targetfile="${FLEXJS_HOME}/frameworks/js/FlexJS/projects/${ant.project.name}JS/target/${ant.project.name}JS.swc">
<srcfiles dir="${basedir}/src/main/flex" includes="**/**"/>
@@ -42,16 +41,22 @@
<ant dir="${FLEXJS_HOME}/frameworks/js/FlexJS/projects/${ant.project.name}JS/" inheritAll="false" />
</target>
- <target name="test" unless="is.jenkins">
- <!-- no tests yet
- <ant dir="as/tests" />
- -->
+ <target name="check-for-tests" >
+ <condition property="skip-tests" >
+ <not>
+ <available file="${basedir}/src/test/flex/build.xml" />
+ </not>
+ </condition>
+ </target>
+
+ <target name="test" depends="check-for-tests" unless="skip-tests">
+ <ant dir="src/test/flex" />
</target>
<target name="clean">
<delete failonerror="false">
<fileset dir="${FLEXJS_HOME}/frameworks/libs">
- <include name="${target.name.no.version}"/>
+ <include name="${target.name}"/>
</fileset>
</delete>
<delete failonerror="false" includeemptydirs="true">
@@ -59,34 +64,20 @@
<include name="**/**"/>
</fileset>
</delete>
+ <antcall target="clean-tests" />
</target>
- <path id="lib.path">
- <fileset dir="${FALCON_HOME}/lib" includes="falcon-flexTasks.jar"/>
- </path>
+ <target name="clean-tests" depends="check-for-tests" unless="skip-tests">
+ <ant dir="src/test/flex" target="clean"/>
+ </target>
<target name="compile" description="Compiles .as files into .swc">
- <echo message="Compiling target/${target.name}"/>
+ <echo message="Compiling libs/${ant.project.name}.swc"/>
<echo message="FLEX_HOME: ${FLEX_HOME}"/>
<echo message="FALCON_HOME: ${FALCON_HOME}"/>
<!-- make JS output folder now so include-file doesn't error -->
- <mkdir dir="${basedir}/target/generated-sources/flexjs"/>
+ <mkdir dir="${basedir}/target/generated-sources/flexjs" />
- <!-- 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 CoreClasses.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.
- -->
<compc fork="true"
output="${basedir}/target/${target.name}">
<jvmarg line="${compc.jvm.args}"/>
@@ -96,7 +87,33 @@
<arg value="-define=COMPILE::AS3,true" />
<arg value="-define=COMPILE::JS,false" />
</compc>
- <copy file="${basedir}/target/${target.name}" tofile="${FLEXJS_HOME}/frameworks/libs/${target.name.no.version}" />
+ <copy file="${basedir}/target/${target.name}" tofile="${FLEXJS_HOME}/frameworks/libs/${target.name}" />
</target>
-
+
+ <target name="check-compiler" depends="check-falcon-home">
+ <path id="lib.path">
+ <fileset dir="${FALCON_HOME}/lib" includes="falcon-flexTasks.jar"/>
+ </path>
+ <taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
+ </target>
+
+ <target name="check-falcon-home" unless="FALCON_HOME"
+ description="Check FALCON_HOME is a directory.">
+
+ <echo message="FALCON_HOME is ${env.FALCON_HOME}"/>
+
+ <available file="${env.FALCON_HOME}/lib/falcon-mxmlc.jar"
+ type="file"
+ property="FALCON_HOME"
+ value="${env.FALCON_HOME}"/>
+
+ <available file="${FLEXJS_HOME}/../flex-falcon/compiler/lib/falcon-mxmlc.jar"
+ type="file"
+ property="FALCON_HOME"
+ value="${FLEXJS_HOME}/../flex-falcon/compiler"/>
+
+ <fail message="FALCON_HOME must be set to a folder with a lib sub-folder containing falcon-mxmlc.jar such as the compiler folder in flex-falcon repo or a FlexJS SDK folder"
+ unless="FALCON_HOME"/>
+ </target>
+
</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a72a205c/frameworks/projects/Network/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/build.xml b/frameworks/projects/Network/build.xml
index 1032681..dc1222e 100644
--- a/frameworks/projects/Network/build.xml
+++ b/frameworks/projects/Network/build.xml
@@ -26,11 +26,10 @@
<property environment="env"/>
<property file="${FLEXJS_HOME}/build.properties"/>
<property name="FLEX_HOME" value="${FLEXJS_HOME}"/>
- <property name="FALCON_HOME" value="${env.FALCON_HOME}"/>
- <property name="target.name" value="Network.swc" />
- <property name="target.name.no.version" value="Network.swc" />
- <target name="main" depends="clean,js-if-needed,compile" description="Full build of Network.swc">
+ <property name="target.name" value="${ant.project.name}.swc" />
+
+ <target name="main" depends="clean,check-compiler,js-if-needed,compile,test" description="Full build of ${ant.project.name}.swc">
</target>
<target name="check-js">
@@ -41,23 +40,23 @@
<target name="js-if-needed" depends="check-js" unless="js-not-needed">
<ant dir="${FLEXJS_HOME}/frameworks/js/FlexJS/projects/${ant.project.name}JS/" inheritAll="false" />
</target>
-
- <target name="test" unless="is.jenkins">
- <!-- no tests yet
- <ant dir="as/tests" />
- -->
+
+ <target name="check-for-tests" >
+ <condition property="skip-tests" >
+ <not>
+ <available file="${basedir}/src/test/flex/build.xml" />
+ </not>
+ </condition>
</target>
- <target name="test-js" unless="is.jenkins">
- <!-- no tests yet
- <ant dir="js/tests" />
- -->
+ <target name="test" depends="check-for-tests" unless="skip-tests">
+ <ant dir="src/test/flex" />
</target>
<target name="clean">
<delete failonerror="false">
<fileset dir="${FLEXJS_HOME}/frameworks/libs">
- <include name="${target.name.no.version}"/>
+ <include name="${target.name}"/>
</fileset>
</delete>
<delete failonerror="false" includeemptydirs="true">
@@ -65,34 +64,20 @@
<include name="**/**"/>
</fileset>
</delete>
+ <antcall target="clean-tests" />
</target>
- <path id="lib.path">
- <fileset dir="${FALCON_HOME}/lib" includes="falcon-flexTasks.jar"/>
- </path>
+ <target name="clean-tests" depends="check-for-tests" unless="skip-tests">
+ <ant dir="src/test/flex" target="clean"/>
+ </target>
<target name="compile" description="Compiles .as files into .swc">
- <echo message="Compiling target/${target.name}"/>
+ <echo message="Compiling libs/${ant.project.name}.swc"/>
<echo message="FLEX_HOME: ${FLEX_HOME}"/>
<echo message="FALCON_HOME: ${FALCON_HOME}"/>
<!-- make JS output folder now so include-file doesn't error -->
- <mkdir dir="${basedir}/target/generated-sources/flexjs"/>
+ <mkdir dir="${basedir}/target/generated-sources/flexjs" />
- <!-- 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 CoreClasses.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.
- -->
<compc fork="true"
output="${basedir}/target/${target.name}">
<jvmarg line="${compc.jvm.args}"/>
@@ -102,7 +87,33 @@
<arg value="-define=COMPILE::AS3,true" />
<arg value="-define=COMPILE::JS,false" />
</compc>
- <copy file="${basedir}/target/${target.name}" tofile="${FLEXJS_HOME}/frameworks/libs/${target.name.no.version}" />
+ <copy file="${basedir}/target/${target.name}" tofile="${FLEXJS_HOME}/frameworks/libs/${target.name}" />
+ </target>
+
+ <target name="check-compiler" depends="check-falcon-home">
+ <path id="lib.path">
+ <fileset dir="${FALCON_HOME}/lib" includes="falcon-flexTasks.jar"/>
+ </path>
+ <taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
</target>
+
+ <target name="check-falcon-home" unless="FALCON_HOME"
+ description="Check FALCON_HOME is a directory.">
+
+ <echo message="FALCON_HOME is ${env.FALCON_HOME}"/>
+
+ <available file="${env.FALCON_HOME}/lib/falcon-mxmlc.jar"
+ type="file"
+ property="FALCON_HOME"
+ value="${env.FALCON_HOME}"/>
+ <available file="${FLEXJS_HOME}/../flex-falcon/compiler/lib/falcon-mxmlc.jar"
+ type="file"
+ property="FALCON_HOME"
+ value="${FLEXJS_HOME}/../flex-falcon/compiler"/>
+
+ <fail message="FALCON_HOME must be set to a folder with a lib sub-folder containing falcon-mxmlc.jar such as the compiler folder in flex-falcon repo or a FlexJS SDK folder"
+ unless="FALCON_HOME"/>
+ </target>
+
</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a72a205c/frameworks/projects/Reflection/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/build.xml b/frameworks/projects/Reflection/build.xml
index 3a75e35..8a4fdf4 100644
--- a/frameworks/projects/Reflection/build.xml
+++ b/frameworks/projects/Reflection/build.xml
@@ -26,11 +26,10 @@
<property environment="env"/>
<property file="${FLEXJS_HOME}/build.properties"/>
<property name="FLEX_HOME" value="${FLEXJS_HOME}"/>
- <property name="FALCON_HOME" value="${env.FALCON_HOME}"/>
- <property name="target.name" value="Reflection.swc" />
- <property name="target.name.no.version" value="Reflection.swc" />
- <target name="main" depends="clean,js-if-needed,compile,test" description="Full build of Reflection.swc">
+ <property name="target.name" value="${ant.project.name}.swc" />
+
+ <target name="main" depends="clean,check-compiler,js-if-needed,compile,test" description="Full build of ${ant.project.name}.swc">
</target>
<target name="check-js">
@@ -42,22 +41,22 @@
<ant dir="${FLEXJS_HOME}/frameworks/js/FlexJS/projects/${ant.project.name}JS/" inheritAll="false" />
</target>
- <target name="test" unless="is.jenkins">
- <!-- no tests yet
- <ant dir="as/tests" />
- -->
+ <target name="check-for-tests" >
+ <condition property="skip-tests" >
+ <not>
+ <available file="${basedir}/src/test/flex/build.xml" />
+ </not>
+ </condition>
</target>
- <target name="test-js" unless="is.jenkins">
- <!-- no tests yet
- <ant dir="js/tests" />
- -->
+ <target name="test" depends="check-for-tests" unless="skip-tests">
+ <ant dir="src/test/flex" />
</target>
<target name="clean">
<delete failonerror="false">
<fileset dir="${FLEXJS_HOME}/frameworks/libs">
- <include name="${target.name.no.version}"/>
+ <include name="${target.name}"/>
</fileset>
</delete>
<delete failonerror="false" includeemptydirs="true">
@@ -65,34 +64,20 @@
<include name="**/**"/>
</fileset>
</delete>
+ <antcall target="clean-tests" />
</target>
- <path id="lib.path">
- <fileset dir="${FALCON_HOME}/lib" includes="falcon-flexTasks.jar"/>
- </path>
+ <target name="clean-tests" depends="check-for-tests" unless="skip-tests">
+ <ant dir="src/test/flex" target="clean"/>
+ </target>
<target name="compile" description="Compiles .as files into .swc">
- <echo message="Compiling target/${target.name}"/>
+ <echo message="Compiling libs/${ant.project.name}.swc"/>
<echo message="FLEX_HOME: ${FLEX_HOME}"/>
<echo message="FALCON_HOME: ${FALCON_HOME}"/>
<!-- make JS output folder now so include-file doesn't error -->
- <mkdir dir="${basedir}/target/generated-sources/flexjs"/>
+ <mkdir dir="${basedir}/target/generated-sources/flexjs" />
- <!-- 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 CoreClasses.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.
- -->
<compc fork="true"
output="${basedir}/target/${target.name}">
<jvmarg line="${compc.jvm.args}"/>
@@ -102,8 +87,33 @@
<arg value="-define=COMPILE::AS3,true" />
<arg value="-define=COMPILE::JS,false" />
</compc>
- <copy file="${basedir}/target/${target.name}" tofile="${FLEXJS_HOME}/frameworks/libs/${target.name.no.version}" />
+ <copy file="${basedir}/target/${target.name}" tofile="${FLEXJS_HOME}/frameworks/libs/${target.name}" />
+ </target>
+
+ <target name="check-compiler" depends="check-falcon-home">
+ <path id="lib.path">
+ <fileset dir="${FALCON_HOME}/lib" includes="falcon-flexTasks.jar"/>
+ </path>
+ <taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
+ </target>
+
+ <target name="check-falcon-home" unless="FALCON_HOME"
+ description="Check FALCON_HOME is a directory.">
+
+ <echo message="FALCON_HOME is ${env.FALCON_HOME}"/>
+
+ <available file="${env.FALCON_HOME}/lib/falcon-mxmlc.jar"
+ type="file"
+ property="FALCON_HOME"
+ value="${env.FALCON_HOME}"/>
+
+ <available file="${FLEXJS_HOME}/../flex-falcon/compiler/lib/falcon-mxmlc.jar"
+ type="file"
+ property="FALCON_HOME"
+ value="${FLEXJS_HOME}/../flex-falcon/compiler"/>
+
+ <fail message="FALCON_HOME must be set to a folder with a lib sub-folder containing falcon-mxmlc.jar such as the compiler folder in flex-falcon repo or a FlexJS SDK folder"
+ unless="FALCON_HOME"/>
</target>
-
</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a72a205c/frameworks/projects/Storage/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Storage/build.xml b/frameworks/projects/Storage/build.xml
index 57b2aa9..75a8dff 100644
--- a/frameworks/projects/Storage/build.xml
+++ b/frameworks/projects/Storage/build.xml
@@ -21,18 +21,17 @@
<project name="Storage" default="main" basedir=".">
<property name="FLEXJS_HOME" location="../../.."/>
-
+
<property file="${FLEXJS_HOME}/env.properties"/>
<property environment="env"/>
<property file="${FLEXJS_HOME}/build.properties"/>
<property name="FLEX_HOME" value="${FLEXJS_HOME}"/>
- <property name="FALCON_HOME" value="${env.FALCON_HOME}"/>
- <property name="target.name" value="Storage.swc" />
- <property name="target.name.no.version" value="Storage.swc" />
-
- <target name="main" depends="clean,js-if-needed,compile,test" description="Full build of Storage.swc">
+
+ <property name="target.name" value="${ant.project.name}.swc" />
+
+ <target name="main" depends="clean,check-compiler,js-if-needed,compile,test" description="Full build of ${ant.project.name}.swc">
</target>
-
+
<target name="check-js">
<uptodate property="js-not-needed" targetfile="${FLEXJS_HOME}/frameworks/js/FlexJS/projects/${ant.project.name}JS/target/${ant.project.name}JS.swc">
<srcfiles dir="${basedir}/src/main/flex" includes="**/**"/>
@@ -41,23 +40,23 @@
<target name="js-if-needed" depends="check-js" unless="js-not-needed">
<ant dir="${FLEXJS_HOME}/frameworks/js/FlexJS/projects/${ant.project.name}JS/" inheritAll="false" />
</target>
-
- <target name="test" unless="is.jenkins">
- <!-- no tests yet
- <ant dir="as/tests"/>
- -->
+
+ <target name="check-for-tests" >
+ <condition property="skip-tests" >
+ <not>
+ <available file="${basedir}/src/test/flex/build.xml" />
+ </not>
+ </condition>
</target>
-
- <target name="test-js" unless="is.jenkins">
- <!-- no tests yet
- <ant dir="js/tests" />
- -->
+
+ <target name="test" depends="check-for-tests" unless="skip-tests">
+ <ant dir="src/test/flex" />
</target>
-
+
<target name="clean">
<delete failonerror="false">
<fileset dir="${FLEXJS_HOME}/frameworks/libs">
- <include name="${target.name.no.version}"/>
+ <include name="${target.name}"/>
</fileset>
</delete>
<delete failonerror="false" includeemptydirs="true">
@@ -65,34 +64,20 @@
<include name="**/**"/>
</fileset>
</delete>
+ <antcall target="clean-tests" />
</target>
-
- <path id="lib.path">
- <fileset dir="${FALCON_HOME}/lib" includes="falcon-flexTasks.jar"/>
- </path>
-
+
+ <target name="clean-tests" depends="check-for-tests" unless="skip-tests">
+ <ant dir="src/test/flex" target="clean"/>
+ </target>
+
<target name="compile" description="Compiles .as files into .swc">
- <echo message="Compiling target/${target.name}"/>
+ <echo message="Compiling libs/${ant.project.name}.swc"/>
<echo message="FLEX_HOME: ${FLEX_HOME}"/>
<echo message="FALCON_HOME: ${FALCON_HOME}"/>
<!-- make JS output folder now so include-file doesn't error -->
- <mkdir dir="${basedir}/target/generated-sources/flexjs"/>
-
- <!-- 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 StorageClasses.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.
- -->
+ <mkdir dir="${basedir}/target/generated-sources/flexjs" />
+
<compc fork="true"
output="${basedir}/target/${target.name}">
<jvmarg line="${compc.jvm.args}"/>
@@ -102,7 +87,33 @@
<arg value="-define=COMPILE::AS3,true" />
<arg value="-define=COMPILE::JS,false" />
</compc>
- <copy file="${basedir}/target/${target.name}" tofile="${FLEXJS_HOME}/frameworks/libs/${target.name.no.version}" />
+ <copy file="${basedir}/target/${target.name}" tofile="${FLEXJS_HOME}/frameworks/libs/${target.name}" />
</target>
-
+
+ <target name="check-compiler" depends="check-falcon-home">
+ <path id="lib.path">
+ <fileset dir="${FALCON_HOME}/lib" includes="falcon-flexTasks.jar"/>
+ </path>
+ <taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
+ </target>
+
+ <target name="check-falcon-home" unless="FALCON_HOME"
+ description="Check FALCON_HOME is a directory.">
+
+ <echo message="FALCON_HOME is ${env.FALCON_HOME}"/>
+
+ <available file="${env.FALCON_HOME}/lib/falcon-mxmlc.jar"
+ type="file"
+ property="FALCON_HOME"
+ value="${env.FALCON_HOME}"/>
+
+ <available file="${FLEXJS_HOME}/../flex-falcon/compiler/lib/falcon-mxmlc.jar"
+ type="file"
+ property="FALCON_HOME"
+ value="${FLEXJS_HOME}/../flex-falcon/compiler"/>
+
+ <fail message="FALCON_HOME must be set to a folder with a lib sub-folder containing falcon-mxmlc.jar such as the compiler folder in flex-falcon repo or a FlexJS SDK folder"
+ unless="FALCON_HOME"/>
+ </target>
+
</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a72a205c/frameworks/projects/XML/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/XML/build.xml b/frameworks/projects/XML/build.xml
index 749b48a..185cd22 100644
--- a/frameworks/projects/XML/build.xml
+++ b/frameworks/projects/XML/build.xml
@@ -27,35 +27,36 @@
<property file="${FLEXJS_HOME}/build.properties"/>
<property name="FLEX_HOME" value="${FLEXJS_HOME}"/>
- <target name="more-props" >
- <property name="target.name" value="XML.swc" />
- <property name="target.name.no.version" value="XML.swc" />
- <path id="lib.path">
- <fileset dir="${FALCON_HOME}/lib" includes="falcon-flexTasks.jar"/>
- </path>
+ <property name="target.name" value="${ant.project.name}.swc" />
+
+ <target name="main" depends="clean,check-compiler,js-if-needed,compile,test" description="Full build of ${ant.project.name}.swc">
</target>
- <!--<target name="main" depends="clean,check-falcon-home,check-falconjx-home,more-props,compile-asjs,compile-extern-swc,copy-js,compile,test-js" description="Full build of XML.swc">
- </target>-->
- <target name="main" depends="clean,check-falcon-home,check-falconjx-home,more-props,compile,test" description="Full build of XML.swc">
+ <target name="check-js">
+ <uptodate property="js-not-needed" targetfile="${FLEXJS_HOME}/frameworks/js/FlexJS/projects/${ant.project.name}JS/target/${ant.project.name}JS.swc">
+ <srcfiles dir="${basedir}/src/main/flex" includes="**/**"/>
+ </uptodate>
+ </target>
+ <target name="js-if-needed" depends="check-js" unless="js-not-needed">
+ <ant dir="${FLEXJS_HOME}/frameworks/js/FlexJS/projects/${ant.project.name}JS/" inheritAll="false" />
</target>
- <target name="test" unless="is.jenkins">
- <!-- no tests yet
- <ant dir="as/tests" />
- -->
+ <target name="check-for-tests" >
+ <condition property="skip-tests" >
+ <not>
+ <available file="${basedir}/src/test/flex/build.xml" />
+ </not>
+ </condition>
</target>
- <target name="test-js" unless="is.jenkins">
- <!-- no tests yet
- <ant dir="js/tests" />
- -->
+ <target name="test" depends="check-for-tests" unless="skip-tests">
+ <ant dir="src/test/flex" />
</target>
<target name="clean">
<delete failonerror="false">
<fileset dir="${FLEXJS_HOME}/frameworks/libs">
- <include name="${target.name.no.version}"/>
+ <include name="${target.name}"/>
</fileset>
</delete>
<delete failonerror="false" includeemptydirs="true">
@@ -63,30 +64,20 @@
<include name="**/**"/>
</fileset>
</delete>
+ <antcall target="clean-tests" />
+ </target>
+
+ <target name="clean-tests" depends="check-for-tests" unless="skip-tests">
+ <ant dir="src/test/flex" target="clean"/>
</target>
<target name="compile" description="Compiles .as files into .swc">
- <echo message="Compiling libs/XML.swc"/>
+ <echo message="Compiling libs/${ant.project.name}.swc"/>
<echo message="FLEX_HOME: ${FLEX_HOME}"/>
<echo message="FALCON_HOME: ${FALCON_HOME}"/>
<!-- make JS output folder now so include-file doesn't error -->
<mkdir dir="${basedir}/target/generated-sources/flexjs" />
- <!-- 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 XMLClasses.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.
- -->
<compc fork="true"
output="${basedir}/target/${target.name}">
<jvmarg line="${compc.jvm.args}"/>
@@ -96,9 +87,16 @@
<arg value="-define=COMPILE::AS3,true" />
<arg value="-define=COMPILE::JS,false" />
</compc>
- <copy file="${basedir}/target/${target.name}" tofile="${FLEXJS_HOME}/frameworks/libs/${target.name.no.version}" />
+ <copy file="${basedir}/target/${target.name}" tofile="${FLEXJS_HOME}/frameworks/libs/${target.name}" />
</target>
+ <target name="check-compiler" depends="check-falcon-home">
+ <path id="lib.path">
+ <fileset dir="${FALCON_HOME}/lib" includes="falcon-flexTasks.jar"/>
+ </path>
+ <taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
+ </target>
+
<target name="check-falcon-home" unless="FALCON_HOME"
description="Check FALCON_HOME is a directory.">
@@ -109,33 +107,13 @@
property="FALCON_HOME"
value="${env.FALCON_HOME}"/>
- <available file="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk/lib/falcon-mxmlc.jar"
+ <available file="${FLEXJS_HOME}/../flex-falcon/compiler/lib/falcon-mxmlc.jar"
type="file"
property="FALCON_HOME"
- value="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk"/>
+ value="${FLEXJS_HOME}/../flex-falcon/compiler"/>
- <fail message="FALCON_HOME must be set to a folder with a lib sub-folder containing falcon-mxmlc.jar such as the compiler/generated/dist/sdk folder in flex-falcon repo or this folder if it has been converted into an FB-compatible SDK"
+ <fail message="FALCON_HOME must be set to a folder with a lib sub-folder containing falcon-mxmlc.jar such as the compiler folder in flex-falcon repo or a FlexJS SDK folder"
unless="FALCON_HOME"/>
</target>
- <target name="check-falconjx-home" unless="FALCONJX_HOME"
- description="Check FALCON_HOME is a directory.">
-
- <echo message="FALCONJX_HOME is ${env.FALCONJX_HOME}"/>
-
- <available file="${env.FALCONJX_HOME}/lib/jsc.jar"
- type="file"
- property="FALCONJX_HOME"
- value="${env.FALCONJX_HOME}"/>
-
- <available file="${FLEXJS_HOME}/../flex-falcon/compiler.jx/lib/jsc.jar"
- type="file"
- property="FALCONJX_HOME"
- value="${FLEXJS_HOME}/../flex-falcon/compiler.jx"/>
-
- <fail message="FALCONJX_HOME must be set to a folder with a lib sub-folder containing jsc.jar such as the compiler.jx folder in flex-falcon repo or the js folder if it has been converted into an FB-compatible SDK"
- unless="FALCONJX_HOME"/>
- </target>
-
-
</project>