Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 353
Herms Avatar asked Feb 23 '09 15:02

Herms


3 Answers

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.

like image 103
dw.mackie Avatar answered Nov 03 '22 18:11

dw.mackie


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).

like image 1
erikprice Avatar answered Nov 03 '22 17:11

erikprice


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

like image 1
mmattax Avatar answered Nov 03 '22 18:11

mmattax