first attempt to adjust build to create a JS-only package

Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/fc887368
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/fc887368
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/fc887368

Branch: refs/heads/packaging
Commit: fc8873680dd3e58434264894e72b71458fce6958
Parents: 3a7b062
Author: Alex Harui <[email protected]>
Authored: Thu Sep 14 21:04:49 2017 -0700
Committer: Alex Harui <[email protected]>
Committed: Thu Sep 14 21:04:49 2017 -0700

----------------------------------------------------------------------
 .gitignore           |   8 +++
 READme               | 134 +++++++++++++++++++++++-----------------------
 build.xml            | 132 ++++++++++++++++++++++++++++++++++++++++++---
 frameworks/build.xml |  31 ++++++++++-
 4 files changed, 229 insertions(+), 76 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc887368/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 9aea94a..7ae1130 100644
--- a/.gitignore
+++ b/.gitignore
@@ -73,6 +73,14 @@ local.properties
 [Tt]humbs.db
 *.DS_Store
 
+#Files we fake for Flash Builder SDKs
+frameworks/airmobile-config.xml
+frameworks/mxml-manifest.xml
+frameworks/spark-manifest.xml
+frameworks/themes/Halo/Halo.swc
+frameworks/themes/Spark/spark.css
+ide/flashbuilder/flashbuilder-config.xml
+
 #Visual Studio files
 *.[Oo]bj
 *.user

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc887368/READme
----------------------------------------------------------------------
diff --git a/READme b/READme
index 1262829..0871428 100644
--- a/READme
+++ b/READme
@@ -19,8 +19,9 @@ Getting the latest sources via git
 ==================================
 
     Getting the source code is the recommended way to get Apache FlexJS.  
-    We also offer an automated installer along with binary distributions on 
our 
-    website at http://flex.apache.org/.
+    You may also use a precompiled binary convenience package to develop
+    FlexJS applications using your favorite IDE.  FlexJS is also
+    available as Maven artifacts and via Node Package Manager (NPM).
 
     You can always checkout the latest source via git using the following
     command:
@@ -29,6 +30,9 @@ Getting the latest sources via git
         cd flex-asjs
         git checkout develop
 
+Building Apache FlexJS via Ant
+==============================
+
     Apache FlexJS also requires code from several other Apache Flex git
     repositories.  To get the latest sources via git, first follow the
     instructions in ‘Install Prerequisites’, then from the flex-asjs
@@ -39,8 +43,6 @@ Getting the latest sources via git
     This will clone all of the upstream repositories, checkout the develop 
branches
     then run the builds in those repositories in the correct order.
 
-Building Apache FlexJS
-======================
 
     Apache FlexJS is a large project. It requires some build tools 
     which must be installed prior to building the SDK.  
@@ -55,33 +57,34 @@ Install Prerequisites
 
     Before building Apache FlexJS you must install the following software 
     and set the corresponding environment variables using absolute file paths. 
 
-    Relative file paths will result in build errors.
+    Relative file paths will result in build errors.  The set of prerequisites
+    is different depending on whether you want to compile to SWF or not.
 
     
==================================================================================
-    SOFTWARE                                    ENVIRONMENT VARIABLE (absolute 
paths)
+    SOFTWARE                                    ENVIRONMENT VARIABLE       
REQUIRED
     
==================================================================================
 
-    Java SDK 1.6 or greater (*1)                JAVA_HOME
+    Java SDK 1.6 or greater (*1)                JAVA_HOME                    
Yes
         (for Java 1.7 see note at (*2))
 
-    Ant 1.7.1 or greater (*1)                   ANT_HOME
+    Ant 1.7.1 or greater (*1)                   ANT_HOME                     
Yes
         (for Java 1.7 see note at (*2))
 
-    Google Closure Library (*3)                 GOOG_HOME
+    Apache Flex 'Falcon' Compiler (*3)          FALCON_HOME                  
Yes
 
-    Adobe Flash Player playerglobal swcs (*4)   PLAYERGLOBAL_HOME
+    Apache Flex 'FalconJX' Compiler (*4)        FALCONJX_HOME                
Yes
 
-    Adobe AIR Integration Kit (*5)             AIR_HOME
+    Google Closure Library (*5)                 GOOG_HOME                    No
 
-    Adobe Flash Player Content Debugger (*6)   FLASHPLAYER_DEBUGGER
+    Adobe Flash Player playerglobal swcs (*6)   PLAYERGLOBAL_HOME            
SWF
 
-    Apache Flex 'Falcon' Compiler (*7)          FALCON_HOME
+    Adobe AIR Integration Kit (*7)              AIR_HOME                     
SWF
 
-    Apache Flex 'FalconJX' Compiler (*8)       FALCONJX_HOME
+    Adobe Flash Player Content Debugger (*8)    FLASHPLAYER_DEBUGGER         
SWF
 
-    Apache Flex FlexUnit (*9)                  FLEXUNIT_HOME
+    Apache Flex SDK or repository               FLEX_HOME                    
SWF
 
-    Apache Flex SDK or repository               FLEX_HOME
+    Apache Flex FlexUnit (*9)                   FLEXUNIT_HOME                
SWF
 
     
==================================================================================
 
@@ -96,25 +99,43 @@ Install Prerequisites
 
             export PATH="$PATH:$ANT_HOME/bin:$JAVA_HOME/bin"
 
-         On Linux make sure you path include ANT_HOME and JAVA_HOME.
+        On Linux make sure you path include ANT_HOME and JAVA_HOME.
+
+    *2) If you are using Java SDK 1.7 or greater on a Mac you must use Ant 1.8
+        or greater. If you use Java 1.7 with Ant 1.7, ant reports the java
+        version as 1.6 so the JVM args for the data model (-d32/-d64) will not
+        be set correctly and you will get compile errors.
 
-    *2)  If you are using Java SDK 1.7 or greater on a Mac you must use Ant 1.8
-         or greater. If you use Java 1.7 with Ant 1.7, ant reports the java
-         version as 1.6 so the JVM args for the data model (-d32/-d64) will not
-         be set correctly and you will get compile errors.
+    *3) If you are going to run "ant all", you can skip this step.
+        If you have cloned the flex-falcon repository as a sibling of the
+        flex-asjs repository, you don’t need to set this variable, 
+        otherwise, set it as: 
+             FALCON_HOME=<flex-falcon repo-path>/compiler
+                        
+       See flex-falcon/README for instructions on how to build Falcon 
separately.
 
-    *3) The Google Closure Library can be downloaded or cloned from GitHub:
+    *4) If you are going to run "ant all", you can skip this step.
+        If you have cloned the flex-falcon repository as a sibling of the 
+        flex-asjs repository, you don’t need to set this variable, 
+        otherwise, set it as
+             FALCONJX_HOME=<flex-falcon repo-path>/compiler-jx
+        
+       See flex-falcon/README_JX for instructions on how to build FalconJX 
separately.
+                        
+    *5) The Google Closure Library will be downloaded automatically as part of
+        the build.  To use a different version of Google Closure Library,
+        download a release or clone from GitHub from:
            https://github.com/google/closure-library
 
         Set GOOG_HOME to the absolute path of the folder that contains the 
         third_party and closure sub-folders.
 
-    *4) The Adobe Flash Player playerglobal.swc for 11.1 can be downloaded 
from:
+    *6) The Adobe Flash Player playerglobal.swc for 11.1 can be downloaded 
from:
             
http://download.macromedia.com/get/flashplayer/updaters/11/playerglobal11_1.swc
 
-        Use URL above to download playerglobal11_1.swc. Create the directory,
-        player/11.1 and copy playerglobal11_1.swc to
-        player/11.1/playerglobal.swc.
+        Use the URL above to download playerglobal11_1.swc. Create a directory,
+        create a folder path in that directory for player/11.1 and copy
+        playerglobal11_1.swc to player/11.1/playerglobal.swc.
 
         Set PLAYERGLOBAL_HOME to the absolute path of the player directory (not
         including the version subdirectory). The target-player option controls
@@ -130,11 +151,11 @@ Install Prerequisites
         tested.
 
 
-         Copy the target playerglobal.swc to the directory:
+        Copy the target playerglobal.swc to the directory:
 
             
frameworks/libs/player/<version.major>.<version.minor>/playerglobal.swc
 
-    *5) The Adobe AIR integration kit for Windows can be downloaded from:
+    *7) The Adobe AIR integration kit for Windows can be downloaded from:
 
            http://airdownload.adobe.com/air/win/download/16.0/AdobeAIRSDK.zip
 
@@ -152,7 +173,7 @@ Install Prerequisites
         This version of Apache FlexJS was certified for use with Adobe AIR 16
         and is compatible with version 3.1 and up.
 
-    *6) The Adobe Flash Player content debuggers can be found here:
+    *8) The Adobe Flash Player content debuggers can be found here:
 
            http://www.adobe.com/support/flashplayer/downloads.html
 
@@ -171,52 +192,18 @@ Install Prerequisites
 
         On Linux, set FLASHPLAYER_DEBUGGER to the absolute path of 
flashplayerdebugger.
 
-    *7) Set FALCON_HOME to the root of its SDK.  If you have cloned the 
flex-falcon
-        repository as a sibling of the flex-asjs repository, you don’t need 
to
-        set this variable, otherwise, set it as: 
-             FALCON_HOME=<repo-path>/compiler
-                        
-           Look at flex-falcon/README for instructions on how to build Falcon
+    *9) If you are going to run "ant all" you can skip this step.
+        If you have cloned the flex-flexunit repository as a sibling of the 
flex-asjs
+        repository, you don’t need to set this variable.  Otherwise, Set 
+        FLEXUNIT_HOME to the root of a FlexUnit release or repo.  
 
-    *8) Set FALCONJX_HOME to the root of its SDK.  If you have cloned the 
flex-falcon
-         repository as a sibling of the flex-asjs repository, you don’t need 
to
-         set this variable, otherwise, set it as
-             FALCONJX_HOME=<repo-path>/compiler-jx
-        
-        Look at flex-falcon/README_JX for instructions on how to build FalconJX
-                        
-    *9) Set FLEXUNIT_HOME to the root of a FlexUnit release or repo.  If you
-         have cloned the flex-flexunit repository as a sibling of the flex-asjs
-         repository, you don’t need to set this variable. 
-        Look at flex-flexunit/README for instructions on how to build FlexUnit
+       See flex-flexunit/README for instructions on how to build FlexUnit 
separately.
 
 Software Dependencies
 ---------------------
 
     The Apache FlexJS framework depends on the Google Closure Library.
 
-Using the Binary Distribution
------------------------------
-
-    The binary distribution requires the download and installation of the 
third-party
-    dependencies before it can be used.
-
-    There is an Apache Ant script in the binary distribution that will copy 
the 
-    files into the right places.
-
-    To run it, use:
-        ant -f installer.xml
-
-    Another option is to use the InstallApacheFlex (version 3.0 or higher).
-
-    Other Ant targets, such as the examples target, expect certain environment
-    variables to be set as described earlier in this README.  However, because
-    the installer copies various SDKs into an IDE compatible SDK, you can set
-    PLAYERGLOBAL_HOME to the absolute path of the distribution's 
-    frameworks/libs/player folder, set FALCON_HOME to the SDK's root folder,
-    set FALCONJX_HOME to the SDK's js folder, and set GOOG_HOME to the SDK's
-    js/lib/google/closure-library folder. 
-
 Building the Source in the Source Distribution
 ----------------------------------------------
 
@@ -224,6 +211,7 @@ Building the Source in the Source Distribution
     set (see Install Prerequisites above), use
 
         cd <flex-asjs.dir>
+        ant all         (to clone upstream repos, build them and then FlexJS) 
or
         ant main        (or just ant since the default target is main)
 
     To clean the build, of everything other than the downloaded third-party
@@ -242,6 +230,16 @@ Building the Source in the Source Distribution
 
         ant -projecthelp
 
+Using the Binary Distribution
+-----------------------------
+
+    If you are not interested in SWF output, the binary distribution can just 
+    be unzipped into a folder.
+
+    If you want SWF output, use NPM.  Type:
+
+        sudo npm install flexjs -g
+
 
 Thanks for using Apache FlexJS.  Enjoy!
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc887368/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index 17cc3bf..d835542 100644
--- a/build.xml
+++ b/build.xml
@@ -183,7 +183,7 @@
         <property name="no.thirdparty-downloads" value="set" />
     </target>
 
-    <target name="prebuild" 
depends="check-compile-env,thirdparty-downloads,create-description,create-config,copy-externs"
+    <target name="prebuild" 
depends="check-compile-env,thirdparty-downloads,create-description,create-config,copy-externs,copy-compiler"
         description="Stuff that needs to be done before any builds." 
unless="airsdk.found"/>
 
     <target name="check-compile-env" 
depends="check-playerglobal-home,check-air-home,check-falcon-home,check-falconjx-home"
 unless="airsdk.found"
@@ -299,7 +299,7 @@
     </target>
 
     <target name="check-falconjx-home" unless="FALCONJX_HOME"
-        description="Check FALCON_HOME is a directory.">
+        description="Check FALCONJX_HOME is a directory.">
         
         <echo message="FALCONJX_HOME is ${env.FALCONJX_HOME}"/>
 
@@ -323,7 +323,7 @@
     </target>
 
     <target name="check-typedefs-home" unless="FLEXJS_TYPEDEFS_HOME"
-        description="Check FALCON_HOME is a directory.">
+        description="Check FLEXJS_TYPEDEFS_HOME is a directory.">
         
         <echo message="FLEXJS_TYPEDEFS_HOME is ${env.FLEXJS_TYPEDEFS_HOME}"/>
         
@@ -391,6 +391,9 @@
         <ant dir="${basedir}/frameworks" target="jquery-config" />
         <ant dir="${basedir}/frameworks" target="createjs-config" />
         <ant dir="${basedir}/frameworks" target="node-config" />
+        <!-- hack to keep compiler happy -->
+        <mkdir dir="${FLEXJS_HOME}/frameworks/themes/Spark" />
+        <touch file="${FLEXJS_HOME}/frameworks/themes/Spark/spark.css" />
     </target>
        
     <target name="copy-externs" depends="check-typedefs-home" 
description="Copy extern swcs into this folder">
@@ -403,6 +406,24 @@
         <antcall target="rename_jquery" />
     </target>
     
+    <target name="copy-compiler" depends="check-falcon-home, 
check-falconjx-home" description="Copy compiler jars to where they are supposed 
to go">
+        <mkdir dir="${basedir}/lib" />
+        <copy todir="${basedir}/lib">
+            <fileset dir="${FALCON_HOME}/lib">
+                <include name="**"/>
+            </fileset>
+        </copy>
+        <mkdir dir="${basedir}/js/lib" />
+        <copy todir="${basedir}/js/lib">
+            <fileset dir="${FALCONJX_HOME}/lib">
+                <include name="**"/>
+            </fileset>
+        </copy>
+        <!-- needed to make Flash Builder accept folder as a Flex SDK -->
+        <copy file="${FALCON_HOME}/lib/falcon-mxmlc.jar" 
tofile="${basedir}/lib/mxmlc.jar" />
+        <copy file="${FALCON_HOME}/lib/falcon-mxmlc.jar" 
tofile="${basedir}/lib/adt.jar" />
+    </target>
+    
     <target name="check_jquery" >
         <condition property="jquery_exists">
             <available file="${basedir}/js/libs/jquery.swc" />
@@ -432,6 +453,22 @@
     
     <target name="super-clean" depends="thirdparty-clean,clean" 
description="Cleans everything including thirdparty downloads.">
         <delete dir="${basedir}/mustella/tests/basicTests/bin"/>
+        <delete dir="${basedir}/lib" failonerror="false" 
includeEmptyDirs="true"/>
+        <delete dir="${basedir}/js/lib" failonerror="false" 
includeEmptyDirs="true"/>
+        <delete dir="${FLEXJS_HOME}/frameworks/libs/player" 
failonerror="false" includeEmptyDirs="true"/>
+        <delete dir="${FLEXJS_HOME}/frameworks/libs/air" failonerror="false" 
includeEmptyDirs="true"/>
+        <delete dir="${FLEXJS_HOME}/frameworks/locale" failonerror="false" 
includeEmptyDirs="true"/>
+        <delete dir="${FLEXJS_HOME}/frameworks/mx" failonerror="false" 
includeEmptyDirs="true"/>
+        <delete dir="${FLEXJS_HOME}/frameworks/rsls" failonerror="false" 
includeEmptyDirs="true"/>
+        <delete dir="${FLEXJS_HOME}/frameworks/themes/Halo" 
failonerror="false" includeEmptyDirs="true"/>
+        <delete dir="${FLEXJS_HOME}/frameworks/themes/Spark" 
failonerror="false" includeEmptyDirs="true"/>
+        <delete file="${FLEXJS_HOME}/frameworks/airmobile-config.xml" 
failonerror="false"/>
+        <delete file="${FLEXJS_HOME}/frameworks/macfonts.ser" 
failonerror="false"/>
+        <delete file="${FLEXJS_HOME}/frameworks/winfonts.ser" 
failonerror="false"/>
+        <delete file="${FLEXJS_HOME}/frameworks/localfonts.ser" 
failonerror="false"/>
+        <delete file="${FLEXJS_HOME}/frameworks/mxml-manifest.xml" 
failonerror="false"/>
+        <delete file="${FLEXJS_HOME}/frameworks/spark-manifest.xml" 
failonerror="false"/>
+        <delete file="${FLEXJS_HOME}/ide/flashbuilder/flashbuilder-config.xml" 
failonerror="false"/>
     </target>
 
     <target name="thirdparty-clean" description="Removes all thirdparty 
downloads.">
@@ -535,7 +572,88 @@
         <!--<ant dir="${basedir}/ide/flashbuilder" />-->
     </target>
     
-    <target name="post-build" depends="ide" description="Handle post-build 
activities" unless="airsdk.found"/>
+    <target name="post-build" depends="ide" description="Handle post-build 
activities" unless="airsdk.found">
+        <!-- fake a bunch of files to make the folder appear like a valid Flex 
SDK to Flash Builder -->
+        <echo 
file="${FLEXJS_HOME}/ide/flashbuilder/flashbuilder-config.xml">&lt;?xml 
version="1.0"?&gt;
+    &lt;!--
+    
+    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.
+    
+    --&gt;
+    &lt;flashbuilder-config&gt;
+    &lt;express-install-swf&gt;expressInstall.swf&lt;/express-install-swf&gt;
+    &lt;/flashbuilder-config&gt;
+</echo>
+        <echo file="${FLEXJS_HOME}/frameworks/mxml-manifest.xml">&lt;?xml 
version="1.0"?&gt;
+    &lt;!--
+    
+    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.
+    
+    --&gt;
+    &lt;componentPackage&gt;
+    &lt;/componentPackage&gt;
+</echo>
+        <echo file="${FLEXJS_HOME}/frameworks/spark-manifest.xml">&lt;?xml 
version="1.0"?&gt;
+    &lt;!--
+    
+    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.
+    
+    --&gt;
+    &lt;componentPackage&gt;
+    &lt;/componentPackage&gt;
+</echo>
+        <mkdir dir="${FLEXJS_HOME}/frameworks/locale" />
+        <mkdir dir="${FLEXJS_HOME}/frameworks/mx" />
+        <mkdir dir="${FLEXJS_HOME}/frameworks/projects" />
+        <mkdir dir="${FLEXJS_HOME}/frameworks/rsls" />
+        <mkdir dir="${FLEXJS_HOME}/frameworks/themes/Halo" />
+        <copy file="${FLEXJS_HOME}/frameworks/libs/Binding.swc"
+        tofile="${FLEXJS_HOME}/frameworks/themes/Halo/Halo.swc" />
+        <copy file="${FLEXJS_HOME}/frameworks/air-config.xml"
+        tofile="${FLEXJS_HOME}/frameworks/airmobile-config.xml" />
+        <touch file="${FLEXJS_HOME}/frameworks/macfonts.ser" />
+        <touch file="${FLEXJS_HOME}/frameworks/winfonts.ser" />
+        <touch file="${FLEXJS_HOME}/frameworks/localfonts.ser" />
+    </target>
 
     <!--
         Build the ASDoc html pages.
@@ -1421,7 +1539,7 @@
     <target name="load-task" depends="runtime-setup">
         <!-- load the <mxmlc> 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" 
classpath="${FALCONJX_HOME}/lib/falcon-flexTasks.jar"/>
+        <taskdef resource="flexTasks.tasks" 
classpath="${basedir}/lib/falcon-flexTasks.jar"/>
     </target>
 
     <target name="basictests" depends="check-flex-home,load-task" 
description="run basic tests using mustella">
@@ -1931,7 +2049,7 @@
     
     <target name="compile-js" 
depends="check-flex-home,check-falcon-home,check-falconjx-home,check-goog-home" 
description="compile for JS">
         <property name="FLEX_HOME" value="${basedir}" />
-        <java jar="${FALCONJX_HOME}/lib/mxmlc.jar"
+        <java jar="${basedir}/js/lib/mxmlc.jar"
             fork="true">
             <jvmarg line="${mxmlc.jvm.args}"/>
             <jvmarg line="-Dflexlib=${FLEXJS_HOME}/frameworks}"/>
@@ -1951,7 +2069,7 @@
     
     <target name="compile-js-release" 
depends="check-flex-home,check-falcon-home,check-falconjx-home,check-goog-home" 
description="compile for JS">
         <property name="FLEX_HOME" value="${basedir}" />
-        <java jar="${FALCONJX_HOME}/lib/mxmlc.jar"
+        <java jar="${basedir}/js/lib/mxmlc.jar"
             fork="true">
             <jvmarg line="${mxmlc.jvm.args}"/>
             <jvmarg line="-Dflexlib=${FLEXJS_HOME}/frameworks}"/>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc887368/frameworks/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/build.xml b/frameworks/build.xml
index f21e0fb..668b4c4 100644
--- a/frameworks/build.xml
+++ b/frameworks/build.xml
@@ -67,10 +67,39 @@
         <ant antfile="${FLEXJS_HOME}/build.xml" target="check-compile-env" 
dir="${FLEXJS_HOME}"/>
     </target>
 
-    
+    <target name="check-playerglobal" description="Check for the required 
environment variables">
+        <condition property="playerglobal.notneeded">
+            <available 
file="${basedir}/libs/player/${playerglobal.version}/playerglobal.swc" />
+        </condition>
+        <condition property="playerglobal.notneeded">
+            <isset property="env.PLAYERGLOBAL_HOME" />
+        </condition>
+    </target>
+
+    <target name="check-airglobal" description="Check for the required 
environment variables">
+        <condition property="airglobal.notneeded">
+            <available file="${basedir}/libs/air/airglobal.swc" />
+        </condition>
+        <condition property="airglobal.notneeded">
+            <isset property="env.AIR_HOME" />
+        </condition>
+    </target>
+
+    <target name="fake-playerglobal" description="copy js.swc as 
playerglobal.swc if needed" depends="check-playerglobal" 
unless="playerglobal.notneeded">
+        <mkdir dir="${basedir}/libs/player/${playerglobal.version}"/>
+        <copy dir="${basedir}/js/libs/js.swc" 
tofile="${basedir}/libs/player/${playerglobal.version}/playerglobal.swc" />
+    </target>
+
+    <target name="fake-airglobal" description="copy js.swc as airglobal.swc if 
needed" depends="check-airglobal" unless="airglobal.notneeded">
+        <mkdir dir="${basedir}/libs/air"/>
+        <copy dir="${basedir}/js/libs/js.swc" 
tofile="${basedir}/libs/air/airglobal.swc" />
+    </target>
+
     <target name="prepare" depends="thirdparty-downloads">
         <mkdir dir="${basedir}/js/FlexJS/libs" />
         <mkdir dir="${basedir}/libs" />
+        <antcall target="fake-playerglobal" />
+        <antcall target="fake-airglobal" />
     </target>
 
     <target name="thirdparty-downloads" unless="no.thirdparty-downloads" 
description="Downloads all the required thirdparty code.">

Reply via email to