kennylerma commented on issue #57: Dependency error when extending class and 
implementing interface from "external" SWC library
URL: https://github.com/apache/royale-compiler/issues/57#issuecomment-439703474
 
 
   Yeah, I think you're misunderstanding and over-complicating the issue. 
Currently, creating a Royale SWC already has the generated javascript files 
included in the swc which can also be used as externs.  So, no need to create 
extern files. 
   
   When using the swc as an external library in a project, those included 
javascript files in the swc can be used as externs for Closure.  We just need 
the royale compiler to tell closure how to use those files.  As in, which files 
should be compiled source and which should just be used as an extern for 
exclusion.  If the js files came from an external library swc when building a 
project, they should be used as a closure extern in the release build.
   
   Here's my workflow now
   1. Create a debug build to generate all the js files in the js-debug folder 
(this is part of making a release build already)
   2. Build the files in js-debug with closure using --externs for files they 
are needed, but excluded in the finale output and --js for the source to be 
included in the final output.
   
   `
   java -jar compiler.jar --externs js-debug/class1.js --externs 
js-debug/class2.js --js js-debug/class3 --js js-debug/class4.js 
--compilation_level WHITESPACE_ONLY --dependency_mode=STRICT 
--entry_point=class4.js --js_output_file=module.js
   `
   
   The only additional thing I'm doing in my workflow is that I have my 
javascript files that are needed for --extern compiled by closure into a single 
javascript file.  So, I only have to list the one file like --extern 
myexternallibrary.js  This could be easily generated into the swc too.
   
   Even if it was required to make SWC files bigger, it doesn't really matter.  
Most as3 devs are not frequently re-building swc files as it's a shared library 
for other projects and doesn't add to the size of the release build simply by 
being a swc vs as3 files.
   
   I hope I'm making a little more sense :)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to