Author: dda
Date: 2008-02-27 11:40:44 -0800 (Wed, 27 Feb 2008)
New Revision: 8115

Modified:
   openlaszlo/branches/devildog/WEB-INF/lps/config/lps.properties
   
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9External.java
Log:
Change 20080227-dda-V by [EMAIL PROTECTED] on 2008-02-27 14:29:11 EST
    in /Users/dda/laszlo/src/svn/openlaszlo/branches/devildogm
    for http://svn.openlaszlo.org/openlaszlo/branches/devildog

Summary: Use FLEX_HOME to find flex tools, instead of lps.properties

New Features:

Bugs Fixed: LPP-5476

Technical Reviewer: hminsky (pending)
QA Reviewer: mayme (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
    These changes remove the lps.properties that were previously used to
    find the flex compiler.  Now the user must have an environment variable
    FLEX_HOME set in order to find the top of the flex sdk.

    If it is not set, an exception is thrown during compilation.

Tests:
    regression + test functionality: henry's hello SWF9
    regression: {smokecheck,weather,lzpix} x {SWF8,DHTML}
    negative test: don't set FLEX_HOME and see the exception when running SWF9



Modified: openlaszlo/branches/devildog/WEB-INF/lps/config/lps.properties
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/config/lps.properties      
2008-02-27 19:39:59 UTC (rev 8114)
+++ openlaszlo/branches/devildog/WEB-INF/lps/config/lps.properties      
2008-02-27 19:40:44 UTC (rev 8115)
@@ -161,11 +161,7 @@
 #compiler.debug.safari=true
 # Warn on global assignments (off by default)
 #compiler.warn.globalassignments=true
-# Where the SWF9 external library compiler lives (relative to HOME, or 
absolute)
-compiler.swf9.lib.builder=../../flex2/bin/compc
-# Where the SWF9 external application compiler lives (relative to HOME, or 
absolute)
-compiler.swf9.app.builder=../../flex2/bin/mxmlc
-# Tell extern compiler to issue warnings.
+# Tell SWF9 external compiler to issue warnings.
 compiler.swf9.warnings=false
 
 
#===============================================================================

Modified: 
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9External.java
===================================================================
--- 
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9External.java
     2008-02-27 19:39:59 UTC (rev 8114)
+++ 
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9External.java
     2008-02-27 19:40:44 UTC (rev 8115)
@@ -442,7 +442,7 @@
   {
     String[] cmdstr = (String[])cmd.toArray(new String[0]);
     String prettycmd = prettyCommand(cmd);
-    System.err.println("Executing compiuler: (cd " + dir + "; " + prettycmd + 
")");
+    System.err.println("Executing compiler: (cd " + dir + "; " + prettycmd + 
")");
     String bigErrorString = "";
     int bigErrorCount = 0;
 
@@ -453,7 +453,7 @@
       emitFile(workDirectoryName("build.sh"), buildsh);
     }
 
-    Process proc = Runtime.getRuntime().exec(cmdstr, null, new File(dir));
+    Process proc = Runtime.getRuntime().exec(cmdstr, null, null);
     try {
       OutputStream os = proc.getOutputStream();
       OutputCollector outcollect = new OutputCollector(proc.getInputStream());
@@ -554,14 +554,13 @@
    * Return a pathname given by a property in the LPS properties.
    * If the path not absolute, it is relative to the LFC directory.
    */
-  public static String getLPSPathname(String propname) {
-    String path = LPS.getProperty(propname);
-    if (path == null)
-      throw new CompilerError("missing \"" + propname + "\" property in LPS 
properties file");
-    if (!(new File(path)).isAbsolute()) {
-      path = LPS.getLFCDirectory() + File.separator + path;
+  public static String getFlexPathname(String subpath) {
+    // System.getenv is deprecated in java 1.4, but undeprecated again in 1.5.
+    String flexhome = System.getenv("FLEX_HOME");
+    if (flexhome == null) {
+      throw new CompilerError("The FLEX_HOME environment variable must be 
set");
     }
-    return path;
+    return flexhome + File.separator + subpath;
   }
 
   /**
@@ -588,32 +587,31 @@
   public byte[] compileTranslationUnits(List tunits, boolean 
buildSharedLibrary)
     throws IOException
   {
-    String builderCmd;
+    List cmd = new ArrayList();
     String outfilebase;
     
     if (buildSharedLibrary) {
       outfilebase = "app.swc";
-      builderCmd = getLPSPathname("compiler.swf9.lib.builder");
+      cmd.add(getFlexPathname("bin/compc"));
     }
     else {
       outfilebase = "app.swf";
-      builderCmd = getLPSPathname("compiler.swf9.app.builder");
+      cmd.add(getFlexPathname("bin/mxmlc"));
     }
+
     String outfilename = tempdir.getPath() + File.separator + outfilebase;
     boolean swf9Warnings = getLPSBoolean("compiler.swf9.warnings", true);
     
-    List cmd = new ArrayList();
-    cmd.add(builderCmd);
     if (!swf9Warnings) {
       cmd.add("-compiler.show-actionscript-warnings=false");
     }
     
-    cmd.add("-compiler.source-path+=.");
+    cmd.add("-compiler.source-path+=" + tempdir.getPath());
     if (USE_COMPILER_DEBUG_FLAG) {
       cmd.add("-debug=true");
     }
     cmd.add("-output");
-    cmd.add(outfilebase);
+    cmd.add(outfilename);
     
     if (!buildSharedLibrary) {
       cmd.add("-default-size");
@@ -633,7 +631,7 @@
       // For a library, we list all the classes.
       if (!buildSharedLibrary) {
         if (tunit.isMainTranslationUnit()) {
-          cmd.add(tunit.getName()+".as");
+          cmd.add(tempdir.getPath() + File.separator + tunit.getName()+".as");
         }
       }
       else {


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to