Flex 3.5, AIR swc & ANT tasks
I am stuck on Flex SDK 3.5 at work.
Today I wanted to create a code library swc file with some AIR-specific classes and I wanted to write a build file.
It seems that there isn’t an acompc-task included in the Flex 3.5 sdk (3.5.0 build 12683), so I was using the exec-task and wrote arg-tags to expand the list of included library-paths.
External-library-path is a nice alternative to library-path if you do not want to redistribute code existing in other swc files, but I got into some problems when I wanted to use -external-library-path, because the syntax apparently has to be a bit different.
This syntax is valid but doesn’t work:
<arg line='-external-library-path "path/to/my.swc"' />
This syntax is also valid, but appears to be similar to setting the attribute append to “true” in the compc ANT-task:
<arg line='-external-library-path+="path/to/my.swc"'/>
If you have tried to substitute the library-path option with external-library-path you might have found that you have to set append=”true” and apparently this is how the command-line version looks like.
September 2, 2010 at 10:35 pm
Hi Andkrup. Is there any chance of you posting a sample build.xml, in particular the part using acompc? Thanks in advance π
September 4, 2010 at 7:39 am
Hi.
Sure.
Please remember to adjust the paths and the acompc executable file to your system. On windows, the executable file is acompc.bat. Mac/*nix users use the acompc.
I hope it helps
September 4, 2010 at 12:53 pm
Thank you Andkrup!! Works perfectly π
October 11, 2010 at 5:16 pm
Here’s a little update:
I didn’t really think about it but it is quite obvious
Since the acompc is only a script, you can of course use the normal compc ant task. The only difference is that you should load the air-config instead of the default flex-config, which is what the acompc script does.