{"id":184,"date":"2009-10-21T11:46:37","date_gmt":"2009-10-21T09:46:37","guid":{"rendered":"http:\/\/blog.ansuz.nl\/?p=184"},"modified":"2009-10-21T11:46:37","modified_gmt":"2009-10-21T09:46:37","slug":"as3-version-injection-flex-pmd-tdsi-rock-n-roll","status":"publish","type":"post","link":"http:\/\/blog.ansuz.nl\/index.php\/2009\/10\/21\/as3-version-injection-flex-pmd-tdsi-rock-n-roll\/","title":{"rendered":"AS3 Version Injection + Flex PMD + TDSI = Rock &#8216;n Roll! \\m\/"},"content":{"rendered":"<p><strong>AS3 Version Injection<\/strong><\/p>\n<p>Ever been annoyed by Project Managers telling you that a bug you fixed is still in the latest release you did and after some investigation find out that they forgot to clear their cache? Well, fear not! An AS3 Version Injection script is here! \ud83d\ude1b<br \/>\nI&#8217;ve created a simple AS3 class called Version that will add a time stamp to the context menu. All you need to do is instantiate the Version class once and pass it a reference to you Document Class. On top of the AS I&#8217;ve written a little Ant script that will take a template of the Version class, insert the current date and time and write out the Version class. This way you can just make it part of your Ant build and don&#8217;t need to worry about manually updating the version number. Also, now you&#8217;ll have a way of quickly identifying what version somebody is looking at. \ud83d\ude42<\/p>\n<p><strong>Flex PMD<\/strong><\/p>\n<p>This is great for auditing your own code as well as other people&#8217;s code. I&#8217;ve written a small Ant task that can be ran as part of a build that will run your project through Flex PMD and create a PMD file for you. The PMD file will have a time stamp suffix so you don&#8217;t overwrite your old file and you can compare issues. To use this Ant script make sure you&#8217;ve downloaded PMD for Ant.<\/p>\n<p><strong>TDSI<\/strong><\/p>\n<p>Another piece of very useful technology. Up to 20% performance increase just by passing your SWF through it. I downloaded the Apparat source (where TDSI is part of) from Google Code and compiled it. Built another little Ant script to use TDSI with Ant. Just specify the input and the output file and you&#8217;re done!<\/p>\n<p><strong>Bringing it all together<\/strong><\/p>\n<p>All the above Ant scripts are saved in a separate file. This way I can import whatever piece I want in my build script, example:<\/p>\n<div id=\"ig-sh-1\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">xml<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"xml\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #ddbb00\">&amp;lt;<\/span>import file=&quot;as3_version.xml&quot; \/<span style=\"color: #ddbb00\">&amp;gt;<\/span><\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<p><em>TIP:<\/em> Place the import after you have defined your properties in the build script, this way the imported scripts can use the properties set in the build script.<\/p>\n<p><strong>Links<\/strong><\/p>\n<ul>\n<li><a href=\"http:\/\/github.com\/wjwarren\/valhalla\/tree\/master\/as3\/nl\/ansuz\/util\/\" target=\"_blank\">AS3 Version Injection &#8211; AS files<\/a><\/li>\n<li><a href=\"http:\/\/github.com\/wjwarren\/valhalla\/blob\/master\/ant\/as3_version.xml\" target=\"_blank\">AS3 Version Injection &#8211; Ant<\/a><\/li>\n<li><a href=\"http:\/\/github.com\/wjwarren\/valhalla\/blob\/master\/ant\/flex_pmd.xml\" target=\"_blank\">Flex PMD Ant Script<\/a><\/li>\n<li><a href=\"http:\/\/github.com\/wjwarren\/valhalla\/blob\/master\/ant\/tdsi.xml\" target=\"_blank\">TDSI Ant Script<\/a><\/li>\n<li><a href=\"http:\/\/github.com\/wjwarren\/valhalla\/blob\/master\/ant\/build.xml\" target=\"_blank\">Example Ant Build Script using the scripts above<\/a><\/li>\n<\/ul>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>AS3 Version Injection Ever been annoyed by Project Managers telling you that a bug you fixed is still in the latest release you did and after some investigation find out that they forgot to clear their cache? Well, fear not! &hellip; <a href=\"http:\/\/blog.ansuz.nl\/index.php\/2009\/10\/21\/as3-version-injection-flex-pmd-tdsi-rock-n-roll\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,65],"tags":[],"class_list":["post-184","post","type-post","status-publish","format-standard","hentry","category-actionscript-30","category-flex"],"_links":{"self":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts\/184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/comments?post=184"}],"version-history":[{"count":6,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts\/184\/revisions"}],"predecessor-version":[{"id":190,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts\/184\/revisions\/190"}],"wp:attachment":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/media?parent=184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/categories?post=184"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/tags?post=184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}