Fixing not so standard Ant errors in FDT

by Sidney de Koning

For this project i’m doing i needed to generate 10 different/unique class files and then compile 10 SWF’s files with those class files. Ant is perfect candidate for this.
The real test is deploying your solution to the different members of your team. Here are some Ant issues i ran into. Most of them have to do with different versions of FDT Eclipse combo’s.

  1. The use of <fdt.loadProjectProperties /> throws an error.
    Solution: use loadProjectProperties with the projectname parameter; <fdt.loadProjectProperties projectname=”Name of the project” />. Note: This worked for me and my team members. I have however seen comments online where did not do the trick.
  2. Ant throws an error: java.lang.NoSuchMethodError: org.eclipse.core.resources.IPathVariableManager.getURIValue(Ljava/lang/String;)Ljava/net/URI;
    Solution: The minimum required Eclipse version to run FDT is Helios (3.6). If you are getting this error, please make sure you have the latest version of FDT and Eclipse. Updating to only the latest version of FDT should fix this problem.

Not so much a problem I ran into but still something I want to share; Iterating in Ant.

  1. You can’t use ‘for’ or ‘foreach’ to iterate over an collection, property or values in a text file in the standard Ant 1.8 build.
    Solution: Use ant-contrib for this. Documentation can be found here for ‘for‘ and for the ‘foreach‘.
  2. When using the for task from ant-contrib i did not found a way to get the ‘step’ of ‘iteration’ value.
    Solution: I created my own. See snippet here. Note: If someone has a better way of doing this, i’d love to hear because to be quite honest; this feels like a hack…

Hope this helped you solve your problems 🙂