You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Alex Harui <ah...@adobe.com> on 2017/02/03 19:24:53 UTC

Multi-Platform SWCs (was Re: About legacy IDEs (Re: AW: [FALCONJX] Combining SWF and JS compilers))


On 2/3/17, 10:22 AM, "Christofer Dutz" <ch...@c-ware.de> wrote:
>
>I mentioned the descriptor thing often enough, but for example having
>self-contained SWCs definitely makes it easier for people with new IDEs
>or build tools

Just trying to wrap my head around this idea and get a sense for how much
work it will be without committing to doing it...

Let's assume we try to do this (packing a library-js.swf alongside
library.swf in a single SWF).  The -compiler.targets feature I'm finishing
up essentially means that one launch of MXMLJSC or COMPJSC actually runs
multiple compilers, so if you set -compiler.targets="SWF,JSFlex", it is
essentially the same as what we do now in our SWC builds:  It runs COMPC
for SWF and what is current COMPJSC for JS.

Right now I know the Ant script presumes you will run COMPC first and
point the output of COMPJSC to the same SWC so it can inject the JS files
into that one SWC.  I think Maven also makes sure COMPC runs first.

Should we try to implement this as a compiler option or a build sequence?

If compiler option, I guess we'd have to add a new compiler option to
COMPC like -library-name=library-js.  That would instruct COMPC to look
for an existing SWC instead of blowing away the one it finds, and adding
the output SWF with a different name.  Then, to build both the
multi-platform SWC and the IDE-compatible JS SWC the sequence would be

-Compile source for SWF, blowing away the old SWC.
-Compile source for JS, with -library-name=library-js
-Compile source for JS, with output=XXXJS.swc
-Transpile source to JS, injecting into main SWF
-Transpile source to JS, injecting into XXXJS.swc.

That is 5 compiles of the source.

However, a SWC is really a ZIP file.  It might be possible with Ant to do
only three compiles (which is how many are done today):
-Compile source for SWF, blowing away the old SWC.
-Compile source for JS, with output=XXXJS.swc
-Transpile source to JS, injecting into XXXJS.swc.


Then Ant could unzip the XXXJS.swc and repackage the main SWC.  And no new
compiler option is needed.  But what would be the Maven way of doing this?
 Or should we teach the compiler or a new tool to repackage SWCs?

Thoughts?
-Alex