flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Idylog - Nicolas Granon" <ngra...@idylog.com>
Subject RE: [FlexJS] Output folders with FB
Date Tue, 26 Sep 2017 09:44:46 GMT
Hi Alex, (and all!)

I think that I have the solution :

I made a dump of the compiler settings (using the -dump-config option of mxmlc in the js/bin
In the output file, I found a (commented out) -js-output option
I have put the -js-output option in the additional compiler arguments of FB (project settings
> flex compiler) followed by a folder name.

All JS output is now correctly written to the -js-output specified folder.

(note : it seems you can use an "=" sign between the option key and the value (folder name),
*or* a space. Adobe docs suggest that a space should be used for -output, so I guess a space
is preferable for -js-output too.)
(note : no quotes needed for the destination folder, unless the folder name contains spaces)
(note : you can specify a non-existent folder. It will be created automatically).
(note : you specify only the "base" folder name. The "bin" folder and subfolders - js-debug
etc. - will be automatically created inside that base folder).

So, here is the correct settings for output folders when using FB 4.7 (should be the same
for FB 4.6, but I did not check).
Maybe you can use this and update the documentation ?

For debug build :

The SWF output (and related files like html wrapper etc.) will go to the folder specified
under "Project settings > Flex Build Path > Output folder.
The -output argument should *not* (in my opinion) be used under "Flex Compiler > Additional
compiler arguments".
By default, FB suggest "bin-debug" as the name of the last folder of the output folder path,
but any name can be used.

The JS output (and related files and subfolders) will, by default, go under the project root
(in the workspace), unless the -js-output argument is added as an additional compiler argument
(project settings > flex compiler).
The -js-output argument must specify a "base" folder, which can exist or not. If it does not
exists, it will be created automatically.
A bin subfolder and a bin/js-debug folder will be created if necessary inside that base folder.
All JS output will go inside the bin/js-debug subfolder.
The preferred syntax (in my opinion) for the -js-output argument should use a space as the
separator between the option key and the folder name. If the folder name contains spaces,
it must be quoted.

For release build :

JS output goes in js-release subfolder of the SAME base folder as the one used for debug build.
The js-release subfolder will be created automatically if necessary.

This means that you cannot have different base folders *at the same time* for debug and release
build for JS as you can have for SWF.

When outputting SWF, the destination folder is specified under "Export release build" and
can be totally different from the one used for debug build.
When outputting JS, you would have to modify the -js-output compiler option if you do not
want the release build go under the same base folder as the debug build.

Alternatively, one can use a "config.xml" file for the compiler as Alex said.
The content of a "config.xml" file overrides the interval settings of FB.
The additional compiler options from FB (Project settings > Flex compiler) override the
options from the config.xml file, if any.
The name of the config.xml file can be specified in the additional compiler arguments inside
FB (-load-config argument). If a file named {project name}-config.xml is found in the same
folder as the entry point (usually {project_name}/src/) it will be used automatically. If
the -load-config argument is used, any path/filename can be used. Several config.xml files
can be chained using the += operator (instead of a space, which is a bit inconsistent).

If using a config.xml file, the compiler arguments will be <output/> and <js-output>
for SWF output and JS output respectively.
Note that those elements are *outside* of the <compiler/> element.

Of course, the "run configuration(s)" in FB should point to the expected html file(s) !
This allows to have one run config pointing to the HTML/SWF output, and another one pointing
to the HTML/JS output.
The same applies to debug configurations.

Alex, I do not think that filing a bug is necessary : the above explanations should allow
FB users to setup their desired output folders correctly.

Many thanks for your help and to Piotr, too.

Nicolas Granon

View raw message