Reputation: 57974
I would like to include the compilation date with the version number in my flex/air app.
I do not know how I could get this, or if its even possible. Is there a way?
Thanks.
Upvotes: 1
Views: 1539
Reputation: 11
There is a way to do this using only ActionScript which involves loading the source using ByteArray. It's not for the faint of heart but works independently of ANT or other third-party applications: http://www.actionscript.org/forums/showthread.php3?t=239907
Upvotes: 1
Reputation: 1996
We are using Ant for our build system, and it has a capability of updating some property files automatically. We set a date/timestamp to record the time of compilation. It can also recognize a property as a number and increment it each time - we use this as a build number. Our Flex app then just loads this property and displays it as needed.
<target name="update-version-info">
<property environment="env"/>
<property file="${file.props.versioninfo}" prefix="old"/>
<propertyfile file="${file.props.versioninfo}">
<entry key="system.build.user" value="${env.USER}"/>
<entry key="system.build.host" value="${env.COMPUTERNAME}"/>
<entry key="system.build.date" value="${DSTAMP}-${TSTAMP}"/>
<entry key="system.build.number" value="${old.system.build.number.next}"/>
<entry key="system.build.number.next" default="${old.system.build.number.next}" type="int" operation="+"/>
</propertyfile>
</target>
For extra points, tie the build process back into the source control system and check in the updated property file - this makes it pretty much automatic for us. If you use Ant, this might help you out.
Note that the {DSTAMP} and {TSTAMP} Ant properties are set at Ant invocation with the <tstamp> task.
Upvotes: 1
Reputation: 10409
To the best of my knowledge, no -- not unless you write it into your app yourself manually at compile-time, or have your build scripts do it automatically somehow. Neither FlexBuilder nor Flash support appending that sort of metadata. At least not yet.
Upvotes: 0