I have several Flex Builder projects which depend on each other (both libraries and "applications", i.e. projects which generate an SWF), and want to compile them from commandline. I know there is the fb.exportReleaseBuild ant-Task, but unfortunately it doesn't work on Linux and only comes with Flex Builder.
Is there any other way to build those projects, including their dependencies, from commandline?
One nifty toolset is Antenae which has templates for handling nested project with various library dependencies. It's basically bunch of Ant scripts that provide quite a high level of abstraction to the whole build process.
Yes, use the command line compiler in the Flex SDK. More info
You can use command line to compile flex projects. But you will have to enter the commands manually. Alternatively you can use ant build. Ant is available for GNU/Linux as well. Or which ever build you are comfortable with.
Related
We are using SBT for our Lift project. One of the modules is Flex based and we would like to integrate its build with rest of the project. Is there a way for the same ? I couldn't find much information on the net.
We are using 0.11.0 version for SBT
Best Regards
Narinder
You could use sbt 0.11.0 tasks running mxmlc as an external process.
Don't use Ant to fork new process of mxmlc. Just call Flex compiler API in your project/Build.scala, which is much faster, because it avoids JRE's slow startup.
In working on larger Actionscript/Flash projects, I've started to really feel the need for some kind of "make" system, but I haven't found it yet. Does anyone know if it exists?
Required features:
Ability to associate SWCs with their source code and/or FLAs i.e. "this swc is compiled from this source"
Ability to mark my current project as depending on these SWCs (either as compile-time or runtime libraries)
A single, big shiny button, that when pressed does the following:
Checks to see if any of the source files have changed, and if so, recompiles their associated SWCs
Recompiles and relinks the main .swf, if necessary
Runs the main .swf
Have yet to find a way to get something like FlashDevelop to do this (but I don't know it well enough to be sure). Support for both code and FLA sources is preferred.
You are looking for http://projectsprouts.org/ which is based on Rake the Ruby version of Make. It can do all of that stuff and much more.
If you have Ruby and RubiGems installed which I think are installed by default on Macs you can install it by typing this into your command line.
sudo gem install Sprout
It will take a while because it installs many things. After this is all set you can create a project like this.
sprout -n as3 ProjectName
and then build it with this,
rake deploy
It manges things based on the runtime they are created for, this project was created for as3 but all of the other types of projects also. The build scripts are all writen in Ruby and can be modified to involve more complex multi-step compiles pretty simply. It also has a bunch of generators so that classes automaticly have unit test that are associated with them and many other features.
Might be a stupid suggestion, but if you want make, why not just use "make"? You can use it for any language by defining the right rules.
Apart from that, I've seen a lot of Flex/Actionscript projects use Apache ant, an XML based build system.
As said by wump; why not use Make?
There are some ANT scripts included in the Flex SDK, so you could explore and expand those. I've also spoken to people who use Maven and Cruise Control for automated build process.
Here is some info on Maven Flex: http://code.google.com/p/flex-mojos/
And some info on Cruise Control w/ Flex: http://www.eyefodder.com/blog/2006/05/continuous_integration_with_fl_5.shtml
Well, there are several options. One I would recommend is the Maven plugin for Flex flex-mojos, now maintained on the Sonotype site. If Maven isn't your cup of tea, they do have an Ant plugin, I don't know if NAnt can call Java Ant tasks directly or not. The third is the most complicated, but Adobe does include an OEM version of the compiler, I believe it comes by default with the SDK download. This is the one I used in the Maven plugin I developed for my company. The reason we didn't use the flex-mojos one basically boils down to a...disagreement about the "Maven way" of one project = one artifact. Their interpretation is that 1 SWF file is one artifact, so is one Maven project. My definition for my project is that all 80+ modules, each a SWF file, are no different than JSPs, all bundled in the same WAR file. So I've got one project with a LOT of modules and 1 maven pom.
You could check out Antpile which according to said link "is a collection of Ant Scripts which cover everything from building a SWF, SWC, AIR, Android and even Unit Testing."
I don't have eclipse on my system at all, but I have on my hands an eclipse project (flex) that I would like to compile and I was wondering if there was any way to do it with minimal to no changes having to be made. Is this possible?
I am not aware of a full automatic process which would take a Flex Eclipse project and generate the build.xml.
You could try and take advantage of your eclipse environment to write a ant builder:
You can also try flex2ant to add a specific Ant task to the Ant installation that is part of the Eclipse IDE, therefore making this task visible to the Eclipse environment.
That would facilitate the manual process mentioned above.
I'm using Flexbuilder as an IDE, and I'm working on automating the process of building my application.
In the process of setting up the ant build file, I noticed that there's no way to call the project using the list of dependancies that Flex builder stores - each library or library project has to be added to the flex compiler commands manually. This creates an enormous burden on the developers to update the build scripts, and makes the build process very uncomfortably fragile.
Is there an option or third party project that addresses this? Failing that, is it possible to build using Flex builder's process via command line?
This answer might be of use.
automating component libraries
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.
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.
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).
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
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