Flex: Annoyed with COMPC Ant task
Posted by Steve Brownlee on February 5, 2010Feb 5
In my continuing journey with TeamCity, I’ve discovered something highly annoying… not with TeamCity but with Adobe.
I’m trying to build a master configuration with an Ant script that will automatically build several child modules. First thing I realize is that I have to override the path properties of the child Ant script with relatives paths from the parent script. Ok, that makes sense since it’s a subtask being called from the scope of the parent, so the paths have to be from that directory.
Then I try to call COMPC in the child Ant script. It chokes hard with:
[compc] command line: Error: unable to open 'api/src/Manifest.xml'
“That’s odd,” I think. I know I’m passing it the right path (contained in the ${src.dir} property). However, just to check, let’s echo out the contents of the path I’m sending to the child script.
<fileset id="dir.contents" dir="${src.dir}" includes="*"/>
<property name="file.name" refid="dir.contents"/>
<echo>${file.name}</echo>
I run the script again, and lo and behold, guess what echoes out?
[echo] Manifest.xml
wtf?
Ant says that the file exists in the path contained in the ${src.dir} property, but the COMPC task says it doesn’t exist?
<compc output="${build.dir}/${build.file}" debug="false">
<include-namespaces uri="${namespace}" />
<namespace uri="${namespace}" manifest="${src.dir}/${manifest.filename}" />
...
Still haven’t figured this one out, because I’m now stuck in the process of throwing darts with a blindfold on, simply guessing which directory COMPC thinks it’s starting from, because, of course, there’s no way to output anything from inside the COMPC task.
ARGH!!!


That is why I do love maven =D
Never used Maven, so no idea how it would solve this problem.
Compc belows in general (all 5 or so arguments
. Doesn’t even have a way to suppress warnings, what’s sad is I don’t see this improving for Flex 4 either.
I did something a bit different on a script I did a while back. Where it got the entire list of names from the project.
then my compc looked more like this:
I can not take full credit it for it I saw pieces of it here and there on the web, but thought it might help
hmm! seems it removed my code….
<!–
–>
<!– –>
Well send me an email and I would be happy to send you what I did, it basically is a target that loops through the code getting any files and excluding ones you don’t want. Then it uses this to be an input to the compc
elewis00@gmail.com
http://eric-lewis.blogspot.com/ here is a posting I just did of it