I've got some reasonable emacs-fu, and I know how to use the Flash Builder IDE to work in Flex/Actionscript, but I'd like to move to using Emacs to do most of my coding instead of the flash builder. This poses some problems, though, namely that I'm not sure how to go about compiling my flex project from the fcsh-mode command line.
Here's an outline of my setup:
I've never used the command line compilers in this way, so I'm a bit stumped on how to start. I keep reading about compile 1
when people talk about fcsh on the 'net, but that just gives me fcsh: Target 1 not found
which I take to mean that I have to have run the 'right' compilation beforehand. But not a single web site touches on what exact mystical incantation that would be.
So, the basic question here is: What is the minimum complete set of steps starting with opening an actionscript or MXML file to a successful compilation of the file?
Here's the thing - fcsh isn't really for building projects, it's for incremental development.
The best way to figure out fcsh is to first learn how to use the mxmlc and compc on the command line. The verbosity necessary to compile your project using these tools will irritate you at some point, so you'll want to make an ant task or the like as weiji commented above.
So, after you get your ant project set up, you'll start to realize that even when you have everything set up nicely, it still takes a lot longer to recompile than it does when you use Flex Builder. The reason is incremental compilation - FB isn't actually recompiling everything, it's only recompiling the closure of the dependency tree that hangs off whatever files you changed.
Enter fcsh. It's basically a hacked version of mxmlc that includes the same incremental compilation code that's used by FB. It stores sets of partial compilation results into indexed result sets, so that's what the "compile 1" refers to; it means "rebuild the same thing as before, but only recompile the changed stuff".
Ok, that was the fact part, so now onto opinion: don't bother. Although fcsh can greatly speed up recompilation of a big fluffy source tree, the better answer is "don't organize your code that way". I personally believe that more carefully partitioning your source to build SWCs or modules, and setting up multiple independent separately compiled libraries, with interface-biased dependencies between them is a much better route. Then, when you recompile, you're generally either only rebuilding the library, or rebuilding the app, but not all other stuff as well. To me, fcsh takes too much "thinking" mid-compile, whereas a library-based project hierarchy is nearly as fast and I can be more "dumb" about invoking M-x compile.
OH! And don't forget "fdb". It's mostly gdb compatible, so M-x gdb actually works pretty well, or at least it used to when I was still involved. :-D
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With