Skip to content

Instantly share code, notes, and snippets.

@jankeesvw
Created June 30, 2010 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jankeesvw/458749 to your computer and use it in GitHub Desktop.
Save jankeesvw/458749 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<project name="Create version file" default="Create version.as file" basedir="../../">
<target name="Create version.as file">
<tstamp>
<format property="TODAY" pattern="dd/MM/yyyy - HH:mm" locale="en,UK" />
</tstamp>
<echo file="flash/source/Version.as">package {
import flash.display.Sprite;
import flash.ui.ContextMenu;
import flash.ui.ContextMenuItem;
public class Version
{
public static var DATE:String = "${TODAY}";
public static var PROJECT_NAME:String = "Musis";
public static var BUILT_ON:String = "${os.name} ${os.version}";
public function Version(inContextMenuSprite : Sprite) {
var cm : ContextMenu = new ContextMenu();
cm.hideBuiltInItems();
cm.customItems.push(new ContextMenuItem("Project: " + PROJECT_NAME));
cm.customItems.push(new ContextMenuItem("Date: " + DATE));
cm.customItems.push(new ContextMenuItem("Built on: " + BUILT_ON));
inContextMenuSprite.contextMenu = cm;
}
public static function toString():String {
return "[DATE: " + Version.DATE + ", BUILT_ON: " + BUILT_ON + "]";
}
}
}</echo>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment