[osflash] Build numbers
Christophe Herreman
lists at herrodius.com
Thu Jun 2 05:11:31 PDT 2005
Hi guys,
Thx to this build file (how cool is Ant?) Daniel sent me, I was able to get
build info in my swf. I added another line which will execute Mtasc and
compile my swf.
Here's the addition to the build file.
<exec executable="C:\Program Files\mtasc\mtasc.exe">
<arg line='-swf
"D:/_PROJECTEN/idiomatic/V4.0/swf/IdiomaticApplication.swf" -main
"D:/_PROJECTEN/idiomatic/V4.0/_source/classes/be/idiomatic/player/view/Appli
cation.as" -separate -mx -cp "D:\_PROJECTEN\idiomatic\V4.0\_source\classes"
-cp "d:/_classes" -cp "C:/Documents and
Settings/christophe-herreman.PX1/Local Settings/Application
Data/Macromedia/Flash MX 2004/en/Configuration/Classes"'/>
</exec>
Here's the complete build file:
<?xml version="1.0" encoding="utf-8"?>
<project name="IdiomaticPlayer" default="buildNumber">
<target name="buildNumber">
<propertyfile file="build.properties" comment="Build version
info">
<entry key="buildDate" type="date" value="now"/>
<entry key="buildNum" default="0" type="int"
operation="+" value="1"/>
</propertyfile>
<copy
file="_source/classes/be/idiomatic/player/BuildInfoTemplate.as"
tofile="_source/classes/be/idiomatic/player/BuildInfo.as" overwrite="true"/>
<replace
file="_source/classes/be/idiomatic/player/BuildInfo.as" value="value not
found in build.properties" propertyFile="build.properties">
<replacefilter token="@buildDate@"
property="buildDate"/>
<replacefilter token="@buildNum@"
property="buildNum"/>
</replace>
<exec executable="C:\Program Files\mtasc\mtasc.exe">
<arg line='-swf
"D:/_PROJECTEN/idiomatic/V4.0/swf/IdiomaticApplication.swf" -main
"D:/_PROJECTEN/idiomatic/V4.0/_source/classes/be/idiomatic/player/view/Appli
cation.as" -separate -mx -cp "D:\_PROJECTEN\idiomatic\V4.0\_source\classes"
-cp "d:/_classes" -cp "C:/Documents and
Settings/christophe-herreman.PX1/Local Settings/Application
Data/Macromedia/Flash MX 2004/en/Configuration/Classes"'/>
</exec>
<!-- Deprecated -->
<!--<exec command='"C:/Program Files/mtasc/mtasc.exe" -swf
"D:/_PROJECTEN/idiomatic/V4.0/swf/IdiomaticApplication.swf" -main
"D:/_PROJECTEN/idiomatic/V4.0/_source/classes/be/idiomatic/player/view/Appli
cation.as" -separate -mx -cp "D:\_PROJECTEN\idiomatic\V4.0\_source\classes"
-cp "d:/_classes" -cp "C:/Documents and
Settings/christophe-herreman.PX1/Local Settings/Application
Data/Macromedia/Flash MX 2004/en/Configuration/Classes"'></exec>-->
</target>
</project>
This will copy the class BuildInfoTemplate.as to BuildInfo.as, replace the
values and compile the swf with mtasc. Sweet potatoe pie!
Here's what the fields in the template class look like.
public static var BUILD_NUMBER:Number = @buildNum@;
public static var BUILD_DATE:String = "@buildDate@";
Thx again!
Christophe
-----Original Message-----
From: osflash-bounces at osflash.org [mailto:osflash-bounces at osflash.org] On
Behalf Of Daniel Fischer
Sent: woensdag 1 juni 2005 14:39
To: Open Source Flash Mailing List
Subject: Re: [osflash] Build numbers
this is not a full solution, but it might give a start. i think it
would be best to keep track of build numbers with ant, the following
task keeps the build number (and date) in a property file
(build.properties), and uses a replace task to modify @buildDate@ and
@buildNum@, taking Main.as as a template and producing Main.as2. Of
course this would have to be a little different...
<code>
<target name="buildNumber">
<propertyfile
file="build.properties" comment="Build version info">
<entry key="buildDate" type="date" value="now"/>
<entry key="buildNum" default="0" type="int"
operation="+" value="1"/>
</propertyfile>
<copy file="Main.as" tofile="Main.as2" overwrite="true"/>
<replace
file="Main.as2"
value="value not found in build.properties"
propertyFile="build.properties">
<replacefilter token="@buildDate@" property="buildDate"/>
<replacefilter token="@buildNum@" property="buildNum"/>
</replace>
</target>
</code>
On 6/1/05, Christophe Herreman <lists at herrodius.com> wrote:
>
>
>
> Hi guys,
>
>
>
> Does anyone know of a way to get a (cummulative) build number into my
> compiled swf's using the whole FAME setup? It would be great to make this
> info available in the contextmenu of the swf's for debugging purposes.
>
>
>
> Thx in advance,
>
> Christophe
> _______________________________________________
> osflash mailing list
> osflash at osflash.org
> http://osflash.org/mailman/listinfo/osflash_osflash.org
>
>
>
On 6/1/05, Christophe Herreman <lists at herrodius.com> wrote:
>
>
>
> Hi guys,
>
>
>
> Does anyone know of a way to get a (cummulative) build number into my
> compiled swf's using the whole FAME setup? It would be great to make this
> info available in the contextmenu of the swf's for debugging purposes.
>
>
>
> Thx in advance,
>
> Christophe
> _______________________________________________
> osflash mailing list
> osflash at osflash.org
> http://osflash.org/mailman/listinfo/osflash_osflash.org
>
>
>
_______________________________________________
osflash mailing list
osflash at osflash.org
http://osflash.org/mailman/listinfo/osflash_osflash.org
More information about the osflash
mailing list