[Laszlo-checkins] r16772 - in openlaszlo/branches/4.8: . WEB-INF/lps/server/src/org/openlaszlo/compiler

ptw@openlaszlo.org ptw at openlaszlo.org
Tue Jun 22 13:57:03 PDT 2010


Author: ptw
Date: 2010-06-22 13:57:01 -0700 (Tue, 22 Jun 2010)
New Revision: 16772

Modified:
   openlaszlo/branches/4.8/
   openlaszlo/branches/4.8/WEB-INF/lps/server/src/org/openlaszlo/compiler/LibraryWriter.java
   openlaszlo/branches/4.8/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWF9Writer.java
Log:
Merged revisions 16771 via svnmerge from 
http://svn.openlaszlo.org/openlaszlo/trunk

.......
  r16771 | hqm | 2010-06-22 14:27:08 -0400 (Tue, 22 Jun 2010) | 59 lines
  
  Change 20100622-hqm-V by hqm at new-host-4.home on 2010-06-22 13:32:12 EDT
      in /Users/hqm/openlaszlo/trunk3
      for http://svn.openlaszlo.org/openlaszlo/trunk
  
  Summary: fix for lzo pathname bug on windows
  
  New Features:
  
  Bugs Fixed: LPP-9141  cannot compile a .lzo for swf10 on Windows which depends on external include
  
  Technical Reviewer: ptw
  QA Reviewer: (pending)
  Doc Reviewer: (pending)
  
  Documentation:
  
  Release Notes:
  
  Overview:
      
  
  Details:
      
  SWF9Writer.java:
  
  When building an application, if the compiler encounters any swf10
  .swc files in any lzo's it is using, it copies the .swc files out to
  the temp build directory so that the flex compiler can see them. In
  this case, it was constructing a poorly formed pathname, which caused
  an IO error.
  
  This fix uses the "safe name" code from the LibraryWriter, to
  construct the tmp pathname to place the .swc, so that is has no
  special filesystem chars in it.
  
  Tests:
  
  In Windows XP, compile these lzo library files. The compile of lib2.lzx is where the error would
  happen, because it references an external lzo library which needs to be unpacked by the compiler
  and copied to the build directory.
  
  cd test\testlzo
  
  set LPS_HOME=Z:\openlaszlo\trunk3
  
  set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_17
  
  call %LPS_HOME%\WEB-INF\lps\server\bin\lzc.bat "-DJAVA_HOME=%JAVA_HOME%" "-DLPS_HOME=%LPS_HOME%" "-Dnodeploy" "-Dlzproxied=false" "--runtime=swf10" -c --runtime=swf10 extclass.lzx 
  
  call %LPS_HOME%\WEB-INF\lps\server\bin\lzc.bat "-DJAVA_HOME=%JAVA_HOME%" "-DLPS_HOME=%LPS_HOME%" "-Dnodeploy" "-Dlzproxied=false" "--runtime=swf10" -c --runtime=swf10 libdir/lib2.lzx
  
  ^^^^^^ This is the place an error would occur
  
  
  
  call %LPS_HOME%\WEB-INF\lps\server\bin\lzc.bat "-DJAVA_HOME=%JAVA_HOME%" "-DLPS_HOME=%LPS_HOME%" "-Dnodeploy" "-Dlzproxied=false" "--runtime=swf10"  --runtime=swf10 main.lzx
.......



Property changes on: openlaszlo/branches/4.8
___________________________________________________________________
Name: svnmerge-integrated
   - /openlaszlo/trunk:1-3892,3894-3952,3954-4393,4395-4461,4463-4467,4469-4471,4473-5085,5087-5171,5173-5203,5205-5209,5211-5331,5333-5334,16597,16605,16610,16628,16650,16724,16767 /openlaszlo/branches/4.7:1-15424,15759-15761,16592,16634 /openlaszlo/branches/4.2:1-12154,12181,13205,13778,14112,14287,14316,14508,14517-14590 /openlaszlo/branches/4.1:1-10153 /openlaszlo/branches/4.4:1-13936,14007 /openlaszlo/branches/devildog:1-8432 /openlaszlo/branches/pagan-deities:1-7955,8825,10756-10920,10922-10928,10930-10935,11151,11207,11554,13476,13629,15650,15685 /openlaszlo/branches/paperpie:1-6504,6506-6574,6576-7135,7137-7235 /openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497,6509,6661,7097,7872
   + /openlaszlo/trunk:1-3892,3894-3952,3954-4393,4395-4461,4463-4467,4469-4471,4473-5085,5087-5171,5173-5203,5205-5209,5211-5331,5333-5334,16597,16605,16610,16628,16650,16724,16767,16771 /openlaszlo/branches/4.7:1-15424,15759-15761,16592,16634 /openlaszlo/branches/4.2:1-12154,12181,13205,13778,14112,14287,14316,14508,14517-14590 /openlaszlo/branches/4.1:1-10153 /openlaszlo/branches/4.4:1-13936,14007 /openlaszlo/branches/devildog:1-8432 /openlaszlo/branches/pagan-deities:1-7955,8825,10756-10920,10922-10928,10930-10935,11151,11207,11554,13476,13629,15650,15685 /openlaszlo/branches/paperpie:1-6504,6506-6574,6576-7135,7137-7235 /openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497,6509,6661,7097,7872

Modified: openlaszlo/branches/4.8/WEB-INF/lps/server/src/org/openlaszlo/compiler/LibraryWriter.java
===================================================================
--- openlaszlo/branches/4.8/WEB-INF/lps/server/src/org/openlaszlo/compiler/LibraryWriter.java	2010-06-22 18:27:08 UTC (rev 16771)
+++ openlaszlo/branches/4.8/WEB-INF/lps/server/src/org/openlaszlo/compiler/LibraryWriter.java	2010-06-22 20:57:01 UTC (rev 16772)
@@ -109,7 +109,7 @@
     }
   }
 
-  public static String makeLZOClassname(File appfile) {
+  public static String fileToSymbol(File appfile) {
     try {
       String lzoAbsPath = appfile.getCanonicalPath();
       lzoAbsPath = lzoAbsPath.substring(0,lzoAbsPath.length()-4);
@@ -129,7 +129,7 @@
   public void open(String compileType) {
     CompilerMediaCache mcache = mEnv.getMediaCache();
     if (mSWF10Writer != null) {
-      String safename = makeLZOClassname(mEnv.getApplicationFile());
+      String safename = fileToSymbol(mEnv.getApplicationFile());
       mSWF10Writer.mAppMainClassname = safename;
       mSWF10Writer.mAppPreamble = makeLZOPreamble(safename);
 

Modified: openlaszlo/branches/4.8/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWF9Writer.java
===================================================================
--- openlaszlo/branches/4.8/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWF9Writer.java	2010-06-22 18:27:08 UTC (rev 16771)
+++ openlaszlo/branches/4.8/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWF9Writer.java	2010-06-22 20:57:01 UTC (rev 16772)
@@ -521,7 +521,7 @@
                 File lzo = new File((String)e.next());
                 // Add in a top level all in the main app to invoke the lzo
                 // lib's runtToplevel Definitions method
-                addScript("(new "+ LibraryWriter.makeLZOClassname(lzo)+"()).runToplevelDefinitions();\n");
+                addScript("(new "+ LibraryWriter.fileToSymbol(lzo)+"()).runToplevelDefinitions();\n");
             }
 
 
@@ -607,12 +607,11 @@
                 }
             }
         }
-        File dirfile = mEnv.getApplicationFile().getParentFile();
-        File appdir = dirfile != null ? dirfile : new File(".");
-        String relPath = FileUtils.relativePath(lzofile, appdir);
-        String fprefix = relPath.replace(File.separator, "_");
+        String fprefix = LibraryWriter.fileToSymbol(lzofile);
+
         //System.err.println("lzo pathname prefix = "+fprefix);
         File swc = new File(workdir, fprefix + ".swc");
+
         FileUtils.send(zis, new FileOutputStream(swc));
         zis.close();
         //System.err.println("swc file copied to "+swc);



More information about the Laszlo-checkins mailing list