Hi,

ANT can do this quite easily.

If we change all Version.as files to be like so:
mx_internal static const VERSION:String = "@release@";

Then this target will inject the version number into all Version.as files:
<target name="setFlexSDKVersion">
        <replace dir="${basedir}" includes="**/Version.as" token="@release@" 
value="${release.version}.${build.number}" />
</target>

We have these currently in the build file:
<property name="release.version" value="4.6.0"/>    
<property name="build.number" value="0"/> 

So that would replace every occurrence of "@release@" with "4.6.0.0".

Minor issue with this is that now the Version.as files are out of sync with 
SVN, could accidentally be checked back in with wrong version numbers or the 
like. 

I guess there's the more philosophical  question of do we really want ANT 
scripts that modify the source code?

Justin 



Reply via email to