[Laszlo-checkins] r11845 - in openlaszlo/trunk/WEB-INF/lps: lfc/kernel/swf9 server/src/org/openlaszlo/compiler server/src/org/openlaszlo/sc

hqm@openlaszlo.org hqm at openlaszlo.org
Thu Nov 20 11:28:00 PST 2008


Author: hqm
Date: 2008-11-20 11:27:57 -0800 (Thu, 20 Nov 2008)
New Revision: 11845

Removed:
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/DebugExec.as
Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/Library.lzs
   openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/Compiler.java
   openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWF9Writer.java
   openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9External.java
Log:
Change 20081120-hqm-m by hqm at badtzmaru.home on 2008-11-20 14:14:24 EST
    in /Users/hqm/openlaszlo/trunk4
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: more tidying of swf9 loadable libraries

New Features:

Bugs Fixed:

Technical Reviewer: hqm (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:

+ reorganize the if statements in SWF9External to make it a little
more clear what the code path is to compile an app versus the code
path for compiling the LFC .swc library.

Tests:

smokecheck in swf8,swf9



Deleted: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/DebugExec.as

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/Library.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/Library.lzs	2008-11-20 18:53:25 UTC (rev 11844)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/Library.lzs	2008-11-20 19:27:57 UTC (rev 11845)
@@ -9,8 +9,6 @@
   */
 
 // A class for loading and executing debug code at runtime
-#include "kernel/swf9/DebugExec.as"
-
 #include "kernel/swf9/LFCApplication.as"
 #include "kernel/swf9/LzIdleKernel.as"
 #include "kernel/swf9/LzSprite.as"

Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/Compiler.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/Compiler.java	2008-11-20 18:53:25 UTC (rev 11844)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/Compiler.java	2008-11-20 19:27:57 UTC (rev 11845)
@@ -604,9 +604,35 @@
                       " extends " +  SWF9Writer.DEBUG_EVAL_SUPERCLASS + " {\n " + SWF9Writer.imports + "}\n");
 
             byte[] objcode;
-            String prog = "";
+            String prog = "public class DebugExec extends Sprite {\n" +
+                "#passthrough (toplevel:true) {  \n" +
+                "import flash.data.*;\n" +
+                "import flash.desktop.*;\n" +
+                "import flash.display.*;\n" +
+                "import flash.errors.*;\n" +
+                "import flash.events.*;\n" +
+                "import flash.external.*;\n" +
+                "import flash.filesystem.*;\n" +
+                "import flash.filters.*;\n" +
+                "import flash.geom.*;\n" +
+                "import flash.html.*;\n" +
+                "import flash.media.*;\n" +
+                "import flash.net.*;\n" +
+                "import flash.printing.*;\n" +
+                "import flash.profiler.*;\n" +
+                "import flash.sampler.*;\n" +
+                "import flash.security.*;\n" +
+                "import flash.system.*;\n" +
+                "import flash.text.*;\n" +
+                "import flash.ui.*;\n" +
+                "import flash.utils.*;\n" +
+                "import flash.xml.*;\n" +
+                "}#\n" +
+                "public function DebugExec (...ignore) {runToplevelDefinitions();}\n" +
+                "public function write(...args):void {lzconsole.write(args.join(\" \"));}\n" +
+                "public function runToplevelDefinitions() {}\n" +
+                "}\n";
 
-
             // Try compiling as an expression first.  If that fails,
             // compile as sequence of statements.  If that fails too,
             // report the parse error.

Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWF9Writer.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWF9Writer.java	2008-11-20 18:53:25 UTC (rev 11844)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWF9Writer.java	2008-11-20 19:27:57 UTC (rev 11845)
@@ -422,7 +422,8 @@
     public final static String LIBRARY_CLASSNAME = "LzRuntimeLoadableLib";
     
     /** List of AS3 imports needed to compile an app */
-    public static final String imports = "    #passthrough (toplevel:true) {  \n" +
+    public static final String imports =
+            "#passthrough (toplevel:true) {  \n" +
             "import flash.display.*;\n" +
             "import flash.events.*;\n" +
             "import flash.utils.*;\n" +
@@ -430,7 +431,6 @@
             "import flash.system.*;\n" +
             "import flash.net.*;\n" +
             "import flash.ui.*;\n" +
-            "import flash.text.Font;\n" +
             "}#\n";
 
     /** Create swf9 application boilerplate preamble as3 code 

Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9External.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9External.java	2008-11-20 18:53:25 UTC (rev 11844)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9External.java	2008-11-20 19:27:57 UTC (rev 11845)
@@ -891,7 +891,15 @@
     cmd.add(outfilename);
     
 
-    if (!buildSharedLibrary) {
+    if (buildSharedLibrary) {
+      // must be last before list of classes to follow.
+      cmd.add("-include-classes");
+      // For LFC library, we list all the classes.
+      for (Iterator iter = tunits.iterator(); iter.hasNext(); ) {
+        TranslationUnit tunit = (TranslationUnit)iter.next();
+        cmd.add(tunit.getName());
+      }
+    } else {
       cmd.add("-default-size");
       cmd.add(options.get(Compiler.CANVAS_WIDTH, "800"));
       cmd.add(options.get(Compiler.CANVAS_HEIGHT, "600"));
@@ -910,11 +918,10 @@
         cmd.add("-compiler.library-path+=" + getLFCLibrary(debug));
       }
 
-      if (options.getBoolean(Compiler.SWF9_LOADABLE_LIB)) {
-        // Exclude the LFC
+      if (options.getBoolean(Compiler.SWF9_LOADABLE_LIB) ||
+          options.getBoolean(Compiler.DEBUG_EVAL)) {
+        // Don't include the LFC in this app
         cmd.add("-external-library-path+="+getLFCLibrary(debug));
-        cmd.add("-includes");
-        cmd.add("LzLibrary");
       }
 
       // Add in WEB-INF/flexlib and APPDIR/flexlib to flex library search paths if they exist
@@ -924,21 +931,9 @@
       if ((new File(workdir.getPath() + File.separator + "flexlib")).isDirectory()) {
         cmd.add("-compiler.library-path+=" + getFlexPathname("flexlib"));
       } 
-
     }
-    else {
-      // must be last before list of classes to follow.
-      cmd.add("-include-classes");
-    }
     
-    if (buildSharedLibrary) {
-      // For a library, we list all the classes.
-      for (Iterator iter = tunits.iterator(); iter.hasNext(); ) {
-        TranslationUnit tunit = (TranslationUnit)iter.next();
-        cmd.add(tunit.getName());
-      }
-    }
-    else {
+    if (!buildSharedLibrary) {
       String mainclassname = (String) options.get(Compiler.SWF9_WRAPPER_CLASSNAME);
       // For the application, we just list one .as file
       cmd.add(workdir.getPath() + File.separator + mainclassname + ".as");



More information about the Laszlo-checkins mailing list