Change 20100527-hqm-G by [email protected] on 2010-05-27 17:34:59 EDT
    in /Users/hqm/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary:  'fat lzo' binary libraries, containing swf10 and dhtml object code

New Features:

Bugs Fixed: LPP-9022

Technical Reviewer: ptw
QA Reviewer: max
Doc Reviewer: (pending)


Documentation:

Release Notes:

Overview:

+ lzo files are now implemented as zip archives,  and contain optional .swc 
(flash 10) and .js (dhtml) object code files,
with filenames based on the compiler flags (e.g., "swc", "swc-debug", 
"swc-backtrace", etc)
    
When targeting swf10 and dhtml, the if the compiler sees the
platform-specific entry in the lzo file, and matches current
compilation flags. It will link against it directly, rather than
compiling the lzs script code block from the lzo.

+ new comand line arg added to lzc, "--lzolibs". Takes a comma
separated list of external lzo files to link against when building
your own lzo library. This will be needed by the swf10 backend when
resolving externals from other swf-10-binary-compiled lzo libs (like maybe 
the lz components library someday).

Details:
    
*** utils/FileUtils.java: 

makeXMLReaderForFile() needs to understand new zipfile format for lzo
files. This scans through and returns the generic LZX file portion of
the lib (as opposed to the optional binary-runtime-specific entries)


*** /sc/JavascriptGenerator.java:

Add a ';' to the end of a block of javascript output, if it does not already 
have one


*** sc/SWF10Compiler.java:

Don't generate  application framework boilerplate code if we're just building a 
library.

*** sc/SWF9External.java        (revision 16441)

Make compileTranslationUnits() accept optional list of external swc libs to 
link against

*** sc/DHTMLCompiler.java       (revision 16441)

Add hook to allow copying raw byte stream to output, so we can insert
DHTML-specific precompiled javascript from lzo lib if available.

*** compiler/ObjectWriter.java  (working copy)

added schemaDone() API, called by compiler when the schema has been computed 
(all classes
have been entered into class map)

*** compiler/DHTMLWriter.java   (working copy)

If an lzo is being used and is contains a fully-compiled DHTML object file, 
append that to
the compiler output verbatim.

*** compiler/CanvasCompiler.java        (working copy)
moved code that adds Flash8 LFC to the SWFWriter

*** compiler/LibraryWriter.java (working copy)
Write out zipfile format archives for lzo libraries.

If runtime targets are specified (e.g., "lzc -c --runtimes=swf10,dhtml"),
we create ObjectWriters for SWF10 and/or
DHTML, so that we compile runtime-specific object code and store it in
entries in the lzo. This will speed up compiling/linking lzo's for
DHTML and SWF10.

Calls to addScript are forwarded to the runtime-specific ObjectWriters
if they are present.


Tests:

ant lztest
smokecheck swf10/dhtml
amazon in dhtml/swf10

test case in test/lzotest/makefile: compiles the libraries below with these 
flags

  lzc -c --runtime=swf10,dhtml libglobal.lzx 
  lzc -c --runtime=swf10,dhtml extclass.lzx 
  lzc -c --runtime=swf10,dhtml libdir/lib1.lzx
  ## test compiling a swf10 lzo which subclasses something from an external lzo 
library
  lzc -c --runtime=swf10,dhtml --lzolibs extclass.lzo libdir/lib2.lzx

  then compile main app for all runtimes
  lzc --runtime=swf8 main.lzx
  lzc --runtime=swf10 main.lzx
  lzc --runtime=dhtml main.lzx

  also compile via the LPS server, ensure behavior identical
  http://127.0.0.1:8080/trunk/test/testlzo/main.lzx?lzr=swf10&debug=true
  http://127.0.0.1:8080/trunk/test/testlzo/main.lzx?lzr=swf10
  http://127.0.0.1:8080/trunk/test/testlzo/main.lzx?lzr=dhtml&debug=true
  http://127.0.0.1:8080/trunk/test/testlzo/main.lzx?lzr=dhtml
  http://127.0.0.1:8080/trunk/test/testlzo/main.lzx?lzr=swf8&debug=true
  http://127.0.0.1:8080/trunk/test/testlzo/main.lzx?lzr=swf8


Files:
M       test/testlzo/libglobal.lzx
A       test/testlzo/simple.lzx
A       WEB-INF/lps/lfc/kernel/swf9/LZOApplication.as
M       WEB-INF/lps/lfc/kernel/swf9/Library.lzs
M       WEB-INF/lps/server/src/org/openlaszlo/utils/FileUtils.java
M       WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java
M       WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9External.java
M       WEB-INF/lps/server/src/org/openlaszlo/sc/SWF10Compiler.java
M       WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9Generator.java
M       WEB-INF/lps/server/src/org/openlaszlo/sc/DHTMLCompiler.java
M       WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9ParseTreePrinter.java
M       WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java
M       WEB-INF/lps/server/src/org/openlaszlo/sc/lzsc.java
M       WEB-INF/lps/server/src/org/openlaszlo/compiler/ObjectWriter.java
M       WEB-INF/lps/server/src/org/openlaszlo/compiler/DHTMLWriter.java
M       WEB-INF/lps/server/src/org/openlaszlo/compiler/CanvasCompiler.java
M       WEB-INF/lps/server/src/org/openlaszlo/compiler/ResourceCompiler.java
M       WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFWriter.java
M       WEB-INF/lps/server/src/org/openlaszlo/compiler/FileResolver.java
M       WEB-INF/lps/server/src/org/openlaszlo/compiler/LibraryWriter.java
M       
WEB-INF/lps/server/src/org/openlaszlo/compiler/CompilationEnvironment.java
M       WEB-INF/lps/server/src/org/openlaszlo/compiler/ImportCompiler.java
M       WEB-INF/lps/server/src/org/openlaszlo/compiler/IntermediateWriter.java
M       
WEB-INF/lps/server/src/org/openlaszlo/compiler/ScriptElementCompiler.java
M       WEB-INF/lps/server/src/org/openlaszlo/compiler/Compiler.java
M       WEB-INF/lps/server/src/org/openlaszlo/compiler/Main.java
M       WEB-INF/lps/server/src/org/openlaszlo/compiler/SWF9Writer.java
M       WEB-INF/lps/server/src/org/openlaszlo/compiler/Parser.java


Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20100527-hqm-G.tar

Reply via email to