Herms
Herms

Reputation: 38868

Compile Flex Builder project from command line

Is there an easy way to build projects created in FlexBuilder via the command line?

I'm beginning to work on adding a couple Flex components to the project I have at work. Currently the rest of the project (some java, some C++) is built via an ant script. I'd really like to be able to integrate the builds for the Flex components I'm working on into that ant script, but I'm not sure how to build the Flex projects from the command line.

Is there a way to invoke the flex compiler from the command line such that it uses the flex builder's project as its configuration? Or is there a way to modify FlexBuilder's compilation so that I could write a build script for the project and then have it use that (so that I'd only have one way to build and have both ant and FB use that, instead of separate build processes)?

While a flex ant task would be preferable it's not really necessary, as I can create custom tasks from command line apps easily enough.

EDIT:

One additional thing that I should probably mention. While I have FlexBuilder installed some of the people who run that ant script do not. They would just have the normal Flex SDK.

Upvotes: 17

Views: 17178

Answers (4)

Clayton
Clayton

Reputation: 1

I started out with Antennae and was pretty disappointed when I realized it does not use the Flex Ant Tasks. To get what I needed I would've needed to hack the command line parameters it passes to mxmlc... and antennae doesn't support modules among other things that are easier to accomplish with the Flex Ant Tasks. anyway, what I did come up with is a mash up of the good aspects I found in antennae and the good aspects of the build files from this blog post: http://jvalentino.blogspot.com/2010/03/flex-ant-build-optimized-modules_24.html

Upvotes: 0

mmattax
mmattax

Reputation: 27710

I wrote a blog post on exactly how to do this (set Flex up with Ant) and have a sample build file. while I wrote this for Linux, the Ant part is platform agnostic. (see step 4):

http://blog.apterainc.com/software/setting-up-a-flex-development-enviroment-in-gnulinux/

If you need any help, leave comments and I can troubleshoot any problems you are having.

EDIT: Documentation for Flex's ant tasks are a bit sparse, but here are the official documentation from Adobe, is was enough to get me on my way: http://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_1.html

Upvotes: 1

dw.mackie
dw.mackie

Reputation: 2025

You can use the -dump-config option in FB to dump the config.xml that FB is using to compile your project, and then use that (using the -load-config option) with your command-line build.

I know in regular Eclipse you can build from an ant file, and I'm pretty sure that you can do the same with FB.

Although the doc kind of stinks for the flex ant tasks, they work ok.

[EDIT]- I replied in the comments, but I wanted to flesh out my reply.
Herms is having a problem using -dump-config and -load-config and it kind of points out why the flex ant tasks are better. (I didn't want to be the guy who says "why do you want to do X?", so I just answered the asked question).

Even though their doc is subpar (imo), they're better suited for the task of building your projects.
There are a couple of gotchas using the flex ant tasks, but for the most part, it's not brain surgery (and really the gotchas are more because the doc sucks).

When I started working on the automated build for our project, I found this site:
http://www.nabble.com/FlexCoders-f16212.html

to be invaluable.

Upvotes: 9

erikprice
erikprice

Reputation: 6308

Flex 3 comes with Ant tasks for building Flex applications from the command line. The documentation is available here. In addition, there is a great open source build framework called Antennae which can help a lot in organizing and building Flex applications from the command line (it is Ant-based).

Upvotes: 1

Related Questions