On 3/13/16, 1:08 PM, "Christofer Dutz" <christofer.d...@c-ware.de> wrote:

>Thanks for the explanation :-)
>
>And what's actually happening in GCL? Here I can see a whole bunch of
>JavaScript files as well as matching ActionScript sources. Here the
>out/as sort of contains the same classes as the src directory, but the
>ones in the src contain Apache headers and some imports. Is this
>eventually a relic because the generated code had problems, that the
>generated code was checked in in order to manually fix stuff. The
>generated code isn't picked up as it is not mentioned in the source-path
>of the compile-config.xml file. So actually downloading the lib,
>processing it and generating the AS is simply obsolete now?

There shouldn't be stuff in GCL/out/as.  Could a Maven goal have tried to
generate it from the .js files you found?
It might be best to just eliminate the .js files in GCL.  More below...

>
>The "js" extern directory seems to be similar, but in this case it seems
>that only a hand full of classes are manually added. Is this too just a
>"monkey patch" of falsely generated code and the "src" directory has
>precedence before the "out/as" one?

The js/externs folder is legitimate.  It contains the .js files from
Google Closure Compiler.  The missing.js file is sort of like a patch to
those .js files.  The src folder contains a few things that are required
to get Vector to appear in js.swc.

As some have mentioned,  externs are sort of like header files.  They
specify the public API but not the implementation. ExternC processes the
extern .js files and generates .AS files.  The .js files you saw in GCL
was someone's attempt to see if ExternC could eat implementation files
(the Google Closure Library).  It couldn't and we decided not to spend any
more time trying to get it to work, so we punted and wrote .AS files.  For
createJS, I found I could get what I wanted for now by doing a bunch of
sed manipulations (via Ant Replace and ReplaceRegEx).

I have not looked to see if there is a subset of code that could create
ExternC without creating all of FalconJX.  So a refactor might be another
option.

I think you understand the pieces.  One way to think about it is to work
backwards:  

-The final goal is a SWC.
-The SWC is created by CompC compiling a bunch of .AS files.
-Sometimes the AS files are generated by ExternC, sometimes they are
handwritten, sometimes both.
-If AS files are generated, it is generated by ExternC processing .JS
files.
-Most of the .JS files are downloaded, some are handwritten, some are
downloaded and then pre-processed with sed (or Ant Replace/ReplaceRegEx)

HTH,
-Alex

Reply via email to