It was not too painful. Here’s a generalize ant build for js-compatible library SWCs.[1]
All you need to do is point the value at the beginning of the build script to a valid FlexJS SDK, and you’re good to go. You need to do the following to use these files on other projects: In build.xml: 1. Change the project name. 2. Set the location of FLEXJS_HOME to your installd FlexJS SDK. In compile_config.xml: 3. In external-library-path set the required external swcs. At the very least you will need js.swc and/or playerglobal.swc/ariglobal.swc 4. In include-classes, add your main class name. If the source path is not “src”, you will need to change that as well. Using Sublime Text, producing SWCs with this is really painless. [1]https://github.com/unhurdle/cep-flexjs/tree/master/CEPTools On Nov 22, 2016, at 10:49 PM, Harbs <harbs.li...@gmail.com> wrote: > OK. I’ll see if I can get it right… > > We’ll see tomorrow. > > Thanks, > Harbs > > On Nov 22, 2016, at 10:06 PM, Alex Harui <aha...@adobe.com> wrote: > >> >> >> On 11/22/16, 11:04 AM, "Harbs" <harbs.li...@gmail.com> wrote: >> >>> I see. I totally did not understand how it’s working. The js build puts >>> the js files into the swc which is (also?) built by the non-js build. >>> >>> There are two targets there and I’m not sure I understand what they are >>> both doing: compile-js-swc and compile-asjs. >>> >>> It looks like compile-asjs is what puts the js files into the swc. >> >> Correct, and the other one builds the xxxJS.swc >> >>> >>> I’m totally confused. >>> >>> What’s the minimal command I need to build a JS-compatible swc with the >>> JS files inside for distribution to include in a FlexJS project? In that >>> Github project, I’m trying to produce two SWCs. CEP.swc is meant to be >>> used as an extern with no executable code going into the end app. >>> CEPTools.swc should have code which is used when cross-compiling the end >>> app. What’s the correct way to set up those two projects to get the >>> correct swc output? >> >> Well, it depends. The reason there are two folders for each SWC for >> FlexJS is so we can have separate Flash Builder project files, each one >> tuned to building SWF or JS. So, if you need separate projects >> per-platform, you should probably follow the two folder pattern. >> >> Otherwise, it is (in theory) pretty simple: >> >> 1) use COMPC to compile the .as files into a SWC. The ABC code in the SWC >> must represent the APIs the SWC users will compile against. >> 2) use COMPJSC to inject the JS files from the same .as files into the >> same SWC. >> >> The parameters to COMPC and COMPJSC should be almost identical. COMPJSC >> needs the js-output-type and maybe different upstream SWCs in the >> library-path and external-library-path. >> >> HTH, >> -Alex >> >