[GitHub] kennylerma commented on issue #57: Dependency error when extending class and implementing interface from "external" SWC library
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-440408808 Thanks @aharui I think what you have is an excellent solution. Being able to do all this all with the compiler is all I needed regardless of the how. I'll check this out as soon as I can. This is highly needed for larger applications like mine. 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
[GitHub] kennylerma commented on issue #57: Dependency error when extending class and implementing interface from "external" SWC library
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-439943075 They definitely work as externs. I'm doing this is my production currently. Also, I made a small test app for you. The only issue that I forgot here is that you need load the Language.js and closure's base.js file in the html page first. Normally, these are compiled into the whole build, but if you're splitting up the build, these need to be loaded separately. What I do, is compile the Language, base and extern files into a single file using Closure to have a single file to load upfront first. [ClosureTest.zip](https://github.com/apache/royale-compiler/files/2596039/ClosureTest.zip) 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
[GitHub] kennylerma commented on issue #57: Dependency error when extending class and implementing interface from "external" SWC library
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
[GitHub] kennylerma commented on issue #57: Dependency error when extending class and implementing interface from "external" SWC library
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-439623103 To be clear, this is the workflow that is working for me now, but I would like to see it handled by the compiler along with correcting the dependency issue. 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
[GitHub] kennylerma commented on issue #57: Dependency error when extending class and implementing interface from "external" SWC library
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-437539707 Thanks @aharui. I have a work-around, but it's not very elegant. I have a large project that loads many separate projects from a menu. It's just like loading SWF files. Each project shares the same base classes, so I need to exclude those base classes in each project and create a separate javascript file to use as the base library for all projects. This way I don't load the same classes again and cause conflicts. I do this by using the --externs argument for the closure compiler as below in a batch file. I make a debug build and then use the closure compiler to combine the js files, but exclude the classes in the extern file. Perhaps there could be a way to generate the single js extern file in the compiler when generating swcs. ``` @echo off set ARGS=--externs ../../../BaseClasses.js set ARGS=%ARGS% --js bin\js-debug\com\test\*.js set ARGS=%ARGS% --js bin\js-debug\com\test\test_Main.js set ARGS=%ARGS% --dependency_mode=STRICT --entry_point=test_Main @echo on java -jar %1/js/lib/google/closure-compiler/compiler.jar %ARGS% --compilation_level WHITESPACE_ONLY --js_output_file=test_Module.js ``` 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