You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cf...@apache.org on 2012/05/03 23:57:03 UTC

svn commit: r1333648 - in /incubator/flex/trunk: bin/aasdoc.bat bin/acompc.bat bin/amxmlc.bat bin/compc.bat bin/mxmlc.bat frameworks/air-config.xml modules/compiler/src/java/flex2/compiler/common/CompilerConfiguration.java mustella/

Author: cframpton
Date: Thu May  3 21:57:02 2012
New Revision: 1333648

URL: http://svn.apache.org/viewvc?rev=1333648&view=rev
Log:
Fix up air bat files to use jars rather than exes, put relevant checks for AIR_HOME and PLAYERGLOBAL_HOME in the bat files that need them, and add support for {airHome} in the config files.  In the mustella directory ignore mustella.swc and the class file(s).

Note: on Windows when setting the environment variables the convention is to not use quotes even if the path has a space in it.

Modified:
    incubator/flex/trunk/bin/aasdoc.bat
    incubator/flex/trunk/bin/acompc.bat
    incubator/flex/trunk/bin/amxmlc.bat
    incubator/flex/trunk/bin/compc.bat
    incubator/flex/trunk/bin/mxmlc.bat
    incubator/flex/trunk/frameworks/air-config.xml
    incubator/flex/trunk/modules/compiler/src/java/flex2/compiler/common/CompilerConfiguration.java
    incubator/flex/trunk/mustella/   (props changed)

Modified: incubator/flex/trunk/bin/aasdoc.bat
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/bin/aasdoc.bat?rev=1333648&r1=1333647&r2=1333648&view=diff
==============================================================================
--- incubator/flex/trunk/bin/aasdoc.bat (original)
+++ incubator/flex/trunk/bin/aasdoc.bat Thu May  3 21:57:02 2012
@@ -17,11 +17,19 @@ rem limitations under the License.
 
 rem
 rem aasdoc.bat script for Windows.
-rem This simply executes asdoc.exe in the same directory,
+rem This simply executes asdoc.jar in the same directory,
 rem inserting the option +configname=air, which makes
-rem asdoc.exe use air-config.xml instead of flex-config.xml.
+rem asdoc use air-config.xml instead of flex-config.xml.
 rem On Unix, aasdoc is used instead.
 rem
 
-"%~dp0asdoc.exe" +configname=air %*
+if "%AIR_HOME%"=="" goto NO_AIR_HOME
+if "%FLEX_HOME%"=="" set FLEX_HOME=%~dp0\..
 
+java -Xmx1024m -Dsun.io.useCanonCaches=false -Xbootclasspath/p:"%FLEX_HOME%\lib\xalan.jar" -classpath "%FLEX_HOME%\lib\asdoc.jar" flex2.tools.ASDoc +configname=air +flexlib="%FLEX_HOME%\frameworks" %*
+goto END
+
+:NO_AIR_HOME
+echo error: AIR_HOME not set
+
+:END
\ No newline at end of file

Modified: incubator/flex/trunk/bin/acompc.bat
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/bin/acompc.bat?rev=1333648&r1=1333647&r2=1333648&view=diff
==============================================================================
--- incubator/flex/trunk/bin/acompc.bat (original)
+++ incubator/flex/trunk/bin/acompc.bat Thu May  3 21:57:02 2012
@@ -17,11 +17,19 @@ rem limitations under the License.
 
 rem
 rem acompc.bat script for Windows.
-rem This simply executes compc.exe in the same directory,
+rem This simply executes compc.jar in the same directory,
 rem inserting the option +configname=air, which makes
-rem compc.exe use air-config.xml instead of flex-config.xml.
+rem compc use air-config.xml instead of flex-config.xml.
 rem On Unix, acompc is used instead.
 rem
 
-"%~dp0compc.exe" +configname=air %*
+if "%AIR_HOME%"=="" goto NO_AIR_HOME
+if "%FLEX_HOME%"=="" set FLEX_HOME=%~dp0\..
 
+java -Xmx384m -Dsun.io.useCanonCaches=false -jar "%FLEX_HOME%\lib\compc.jar" +configname=air +flexlib="%FLEX_HOME%\frameworks" %*
+goto END
+
+:NO_AIR_HOME
+echo error: AIR_HOME not set
+
+:END
\ No newline at end of file

Modified: incubator/flex/trunk/bin/amxmlc.bat
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/bin/amxmlc.bat?rev=1333648&r1=1333647&r2=1333648&view=diff
==============================================================================
--- incubator/flex/trunk/bin/amxmlc.bat (original)
+++ incubator/flex/trunk/bin/amxmlc.bat Thu May  3 21:57:02 2012
@@ -1,4 +1,4 @@
-@echo off
+@echo on
 rem Licensed to the Apache Software Foundation (ASF) under one or more
 rem contributor license agreements.  See the NOTICE file distributed with
 rem this work for additional information regarding copyright ownership.
@@ -17,11 +17,19 @@ rem limitations under the License.
 
 rem
 rem amxmlc.bat script for Windows.
-rem This simply executes mxmlc.exe in the same directory,
+rem This simply executes mxmlc.jar in the same directory,
 rem inserting the option +configname=air, which makes
-rem mxmlc.exe use air-config.xml instead of flex-config.xml.
+rem mxmlc use air-config.xml instead of flex-config.xml.
 rem On Unix, amxmlc is used instead.
 rem
 
-"%~dp0mxmlc.exe" +configname=air %*
+if "%AIR_HOME%"=="" goto NO_AIR_HOME
+if "%FLEX_HOME%"=="" set FLEX_HOME=%~dp0\..
 
+java -Xmx384m -Dsun.io.useCanonCaches=false -jar "%FLEX_HOME%\lib\mxmlc.jar" +configname=air +flexlib="%FLEX_HOME%\frameworks" %*
+goto END
+
+:NO_AIR_HOME
+echo error: AIR_HOME not set
+
+:END
\ No newline at end of file

Modified: incubator/flex/trunk/bin/compc.bat
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/bin/compc.bat?rev=1333648&r1=1333647&r2=1333648&view=diff
==============================================================================
--- incubator/flex/trunk/bin/compc.bat (original)
+++ incubator/flex/trunk/bin/compc.bat Thu May  3 21:57:02 2012
@@ -14,5 +14,13 @@ rem WITHOUT WARRANTIES OR CONDITIONS OF 
 rem See the License for the specific language governing permissions and
 rem limitations under the License.
 
+if "%PLAYERGLOBAL_HOME%"=="" goto NO_PLAYERGLOBAL_HOME
 if "%FLEX_HOME%"=="" set FLEX_HOME=%~dp0\..
-java -Xmx384m -Dsun.io.useCanonCaches=false -jar "%FLEX_HOME%\lib\compc.jar" +flexlib="%FLEX_HOME%\frameworks" %*
\ No newline at end of file
+
+java -Xmx384m -Dsun.io.useCanonCaches=false -jar "%FLEX_HOME%\lib\compc.jar" +flexlib="%FLEX_HOME%\frameworks" %*
+goto END
+
+:NO_PLAYERGLOBAL_HOME
+echo error: PLAYERGLOBAL_HOME not set
+
+:END
\ No newline at end of file

Modified: incubator/flex/trunk/bin/mxmlc.bat
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/bin/mxmlc.bat?rev=1333648&r1=1333647&r2=1333648&view=diff
==============================================================================
--- incubator/flex/trunk/bin/mxmlc.bat (original)
+++ incubator/flex/trunk/bin/mxmlc.bat Thu May  3 21:57:02 2012
@@ -14,5 +14,13 @@ rem WITHOUT WARRANTIES OR CONDITIONS OF 
 rem See the License for the specific language governing permissions and
 rem limitations under the License.
 
+if "%PLAYERGLOBAL_HOME%"=="" goto NO_PLAYERGLOBAL_HOME
 if "%FLEX_HOME%"=="" set FLEX_HOME=%~dp0\..
-java -Xmx384m -Dsun.io.useCanonCaches=false -jar "%FLEX_HOME%\lib\mxmlc.jar" +flexlib="%FLEX_HOME%\frameworks" %*
\ No newline at end of file
+
+java -Xmx384m -Dsun.io.useCanonCaches=false -jar "%FLEX_HOME%\lib\mxmlc.jar" +flexlib="%FLEX_HOME%\frameworks" %*
+goto END
+
+:NO_PLAYERGLOBAL_HOME
+echo error: PLAYERGLOBAL_HOME not set
+
+:END
\ No newline at end of file

Modified: incubator/flex/trunk/frameworks/air-config.xml
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/frameworks/air-config.xml?rev=1333648&r1=1333647&r2=1333648&view=diff
==============================================================================
--- incubator/flex/trunk/frameworks/air-config.xml (original)
+++ incubator/flex/trunk/frameworks/air-config.xml Thu May  3 21:57:02 2012
@@ -60,7 +60,7 @@
       <!-- List of SWC files or directories to compile against but to omit from -->
       <!-- linking.                                                             -->
       <external-library-path>
-         <path-element>libs/air/airglobal.swc</path-element>
+          <path-element>{airHome}/frameworks/libs/air/airglobal.swc</path-element>
       </external-library-path>
       
       <!-- Turn on writing of generated/*.as files to disk. These files are generated by -->

Modified: incubator/flex/trunk/modules/compiler/src/java/flex2/compiler/common/CompilerConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/flex/trunk/modules/compiler/src/java/flex2/compiler/common/CompilerConfiguration.java?rev=1333648&r1=1333647&r2=1333648&view=diff
==============================================================================
--- incubator/flex/trunk/modules/compiler/src/java/flex2/compiler/common/CompilerConfiguration.java (original)
+++ incubator/flex/trunk/modules/compiler/src/java/flex2/compiler/common/CompilerConfiguration.java Thu May  3 21:57:02 2012
@@ -65,6 +65,7 @@ public class CompilerConfiguration imple
     public static final String TARGET_PLAYER_MAJOR_VERSION_TOKEN = "{targetPlayerMajorVersion}";
     public static final String TARGET_PLAYER_MINOR_VERSION_TOKEN = "{targetPlayerMinorVersion}";
     public static final String PLAYERGLOBAL_HOME_TOKEN = "{playerglobalHome}";
+    public static final String AIR_HOME_TOKEN = "{airHome}";
     
     // this is passed as the list of soft prerequisites for options like
     // library-path, source-path which need to have {locale}, etc., set already
@@ -131,7 +132,10 @@ public class CompilerConfiguration imple
         pathlist = expandTargetPlayerToken(pathlist, parentConfiguration);
         
         // {playerglobalHome}
-        pathlist = expandPlayerglobalToken(pathlist);
+        pathlist = expandPlayerglobalHomeToken(pathlist);
+
+        // {airHome}
+        pathlist = expandAirHomeToken(pathlist);
         
         // {locale}
         return expandLocaleToken(pathlist, locales, cv);
@@ -168,7 +172,7 @@ public class CompilerConfiguration imple
      * PLAYERGLOBAL_HOME.  Doesn't turn the paths into VirtualFiles (yet, 
      * @see expandLocaleToken()). 
      */
-    private static String[] expandPlayerglobalToken(String[] pathlist)
+    private static String[] expandPlayerglobalHomeToken(String[] pathlist)
     {
         final String[] processed = new String[pathlist.length];
         
@@ -185,6 +189,28 @@ public class CompilerConfiguration imple
         return processed;
     }
 
+    /**
+     * Replaces instances of {airHome} with the environment variable
+     * AIR_HOME.  Doesn't turn the paths into VirtualFiles (yet, 
+     * @see expandLocaleToken()). 
+     */
+    private static String[] expandAirHomeToken(String[] pathlist)
+    {
+        final String[] processed = new String[pathlist.length];
+        
+        String airHome = System.getenv("AIR_HOME");
+        if (airHome == null)
+            airHome = "";
+
+        for (int i = 0; i < pathlist.length; i++)
+        {
+            processed[i] = StringUtils.substitute(pathlist[i], 
+            	AIR_HOME_TOKEN, airHome);
+        }
+
+        return processed;
+    }
+
 	/**
 	 * Expands the {locale} token in a list of path elements
 	 * for the source-path or library-path,

Propchange: incubator/flex/trunk/mustella/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu May  3 21:57:02 2012
@@ -0,0 +1,2 @@
+mustella.swc
+*.class