Uncategorized
Compiling Flex 2 Beta with Ant
Well I had an ant script working with the Flex 2 alpha, but it seems enough has changed in the new beta that some config options need to change. I dont quite have it working but to find out more…
Previously I used a command in ant that looked similiar to this:
-jar ${basedir}/flex/lib/mxmlc.jar -flexlib ${basedir}/flex/frameworks -file-specs ${basedir}/${fileName}
I wont take credit for this, as i found an example of it on another blog while I was at max. I probably posted before about it. Anyway, to get started I moved the “frameworks” and “lib” folder from the “tools” directory of my Flex Enterprise Services install, into a local directory. In my previous setup I had these 2 folders as well.
Thinking these files might be a drop in replacement, I copied over my build.xml and a test.mxml file. After running my build i found taht -flexlib was not considered a valid option anymore. Removing it caused another error that the compiler couldnt fine my flex-config.xml. The error tells me to run the compiler with -help. In the help on the complier I saw a new option for -load-config which after I added it in place of -flexlib got me to another error.
The compiler was looking for a framework_rb.swc file in and en_EN folder. The path in my flex-config for this file was incorrect so i changed it to ./locale/en_EN/framework_rb.swc which got me a little further.
Now through all of that, i finally get a message in my ant output that I am compiling. And after a very short feeling of accomplishment, I got the error that ended it all for me.
“Error: unable to resolve frame class ‘null’”
Unfortunately, I dont know what this means, and I dont know how to fix it. So If you have a better idea about what this means, please, PLEASE let me know.
As the Mac version of Flex Builder 2 isnt due out until a while after the final draft of the windows version, I need this to make my development environment happy. I feel like i am very close, but i am not sure what the next step needs to be.
Oh well. Time for bed anyway. Heres what my command looks like now:
-jar ${basedir}/flex/lib/mxmlc.jar -load-config ${basedir}/flex/frameworks/flex-config.xml -file-specs ${basedir}/${fileName}
31 Jan 2006 Simeon

This ant file worked for me:
<project name="dar" default="build" basedir=".">
<property file="build.properties"/>
<!– build –>
<target name="build">
<java jar="${mxmlc}"
fork="true"
failonerror="true"
maxmemory="128m"
>
<arg value="-keep=false"/>
<arg value="-load-config"/>
<arg value="${frameworks.dir}/flex-config.xml"/>
<arg value="-file-specs"/>
<arg value="DAR.mxml"/>
</java>
</target>
</project>