Compile Eclipse Project With Ant - apache-flex

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.

Related

Is it necessary to use gradle with roboelectric for android unit testing?

I and my team have built up an android library project. it is built up on eclipse but we are using ant to build it. Presently we aren't using gradle. I have a roboelectric with dependencies jar file instead. But when I use this, while running the unit tests, the following error comes up
WARNING: multiple versions of ant detected in path for junit
[junit] jar:file:/Users/prateekarora/Desktop/eclipse/plugins/org.apache.ant_1.9.2.v201404171502/lib/ant.jar!/org/apache/tools/ant/Project.class
[junit] and jar:file:/Users/prateekarora/trunk/client/android/MCCMobileClient/test2/libs/robolectric-2.3-with-dependencies.jar!/org/apache/tools/ant/Project.class
When I remove the apache ant from eclipse's plugin folder, this stops working.
Can Anybody explain why this is happening?
Also, is it necessary to use roboelectric with gradle? If no, where can I find the roboelectric's jar files with/without dependencies?
It is not necessary to use gradle with robolectric. It is just about running specified java class (from junit) with proper classpath (including you source, test code and dependencies). Fixing your case is not something that is easy to make over stackoverflow (it will be some challenge even if you sit behind same computer).
Here are possible solutions:
Migrate your project build to the gradle
Keep using ant but move from dependency management from manuals jars to ivy
Keep using ant and manual jars dependency, but try to get robolectric.jar with all dependencies except ant one
The first one option is the easiest option as for me. It will require to change mindset a bit but this is officially only one supported build tool by Google as well there are a lot of examples and people that could help.
The second one also require you to learn how to use new tool. As well there less examples about ivy usage especially in android projects.
The third one will require to write custom script that removes ant from jar file or to rebuild robolectric-all.jar without one (ant) dependency. This will require to dive into maven build tool learning

Building Flex Builder projects from commandline

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.

How can I use the same buildscript for Flash Builder 4 and Ant/Mvn?

I'm setting up a build system for a Flash Builder 4 (Flex 4) based project; and I'm struggling to get a setup that compiles in the IDE the same as it does from the command line on the build server.
I come from a C# background; and my expectation is that I'll be able to create a "solution" with a collection of "projects" that I can compile from the IDE, or from the command line on the build server.
The best I've managed sofar is 2 separate build "scripts", a custom ant script for the build server, and the default Flash Builder IDE config based on a workspace; but this is making my DRY daemons jump around in fury.
Please can someone point me in the right direction :)
If you use Maven and flex-mojos for your command line builds, then you can use the flexbuilder mojo to generate the Eclipse project files from your Maven build scripts. I'm sure there are some rough edges with the process, but at least it's DRY.
You might also check out IntelliJ IDEA. It can open the Maven project directly, and will create the Flex facets and configuration from the Maven build script. It will auto-detect when the pom.xml file changes, and prompt for re-import (which is nice). You can enable auto-import, too. The down side is that it doesn't have the profiler or nice GUI editor that Flash Builder has.

Building Flexbuilder projects in ant

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

Continuous integration servers for Flex

Which CI server do you use for Flex? My main contenders are currently
Hudson
TeamCity
Both seem to be popular on the general level but have you got some direct experience with using one or both with Flex development? Or would you recommend some other tool?
We use Hudson in combination with SVN and it works quite well. Both the Java code and the Flex code is built using Maven and the Flex Mojos plugin. The build also runs the unit tests for the Flex code and it integrates the results in the build reports. The Flex Mojos plugin makes this really easy.
We use Hudson.
We are working on a Java/Flex application.
Ant is the build system. SVN the source manager.
We have a ant task for compiling the mxml and the actionScript.
Hudson is on a virtual machine, SVN on another, and the build are archived / deployed on a third.
Hudson call the ant task on due time. ( After each commit on the flex code )
No Unit test are call for flex. For java yes. But you can call FlexUnit ( or FlexMonkey ) throught a ant script as well.
After running the test, the build is deployed on another VM.
It's run with no pain. You just have to have a working ant task for compilling the flex part of your application.
If your using maven, hudson handle it too. He can also play .bat or .sh script and check the output.
About your choice between teamcity / hudson, i think the two of them are very close.

Resources