views:

228

answers:

2

Does anyone know of a way to use the mxmlc task of the Flex Ant tasks with a user-definable list of source path or library paths? The idea is that the user can define an arbitrary list of source paths and/or library (swc) paths into an Ant properties file and the build file takes these values and evaluates them for use in the mxmlc task. Just wondering if there are any tricks (maybe utilizing filtering/string replacing) to get this working?

A: 

I don't know if it is possible to do it from properties file.

You can use in your Ant script:

<source-path>
    <source-path path-element="my/src/dir" />
</source-path>
<library-path dir="my/libs/dir" append="true">
    <include name="*.swc" />
</library-path>

Or maybe develop some ant module able to simulate this from your properties file.

Although I am not able to understand why you want to make your properties file dynamic, it is the role of your build.xml normally, but hey :)

HTH

Adnan Doric
I don't want to make the properties file dynamic. I'm trying to create a 'relatively' universal build file combination where the user only changes values in the properties file and can leave the build.xml untouched. But as it stands right now it seems there's no way to define an arbitrary list of source/library paths in the properties file and then have the build file evaluate them somehow and feed them to the compile task. I wish the Ant syntax had some means to iterate over properties but since this seems not to be possible I'm looking for a workaround.
loungelizard
+1  A: 

Don't know if this helps (and this coming a month later), but check out http://ant.apache.org/faq.html#xml-entity-include ... I ran across your question looking for the same sort of answer, but I am going to try setting up something similar so I can define the library (and source path) definitions in external files. Looping through a list of defined properties seems somewhat problematic to me, since you would possibly have to define a list of library paths as well as sub-lists of files in each defined path in the list. Seems that allowing for inclusion of external files defining the library and various source paths might be a better and just as extensible way to go.

cheers –®–

ryto