<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Simon Gregory &#187; Flex</title>
	<atom:link href="http://blog.simongregory.com/category/flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.simongregory.com</link>
	<description>Flash, Flex and TextMate</description>
	<lastBuildDate>Tue, 27 Jul 2010 08:12:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Static code validation with FlexPMD</title>
		<link>http://blog.simongregory.com/07/static-code-validation-with-flexpmd/</link>
		<comments>http://blog.simongregory.com/07/static-code-validation-with-flexpmd/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 08:12:02 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[TextMate]]></category>
		<category><![CDATA[actionscript3 flex textmate]]></category>

		<guid isPermaLink="false">http://blog.simongregory.com/?p=185</guid>
		<description><![CDATA[A code validator was for a long time one of the tools missing from the ActionScript developers toolbox. Last year that changed and we can now benefit by keeping a robotic eye on our projects. One that helps improve style and consistency, and avoid complexity. Something even more important in team or distributed code environments. [...]]]></description>
			<content:encoded><![CDATA[<p>A code validator was for a long time one of the tools missing from the ActionScript developers toolbox. Last year that changed and we can now benefit by keeping a robotic eye on our projects. One that helps improve style and consistency, and avoid complexity. Something even more important in team or distributed code environments. Hooking validation up to a continuous integration server is even better as the audit triggers automatically, problems get reported and graphed, and builds can be failed when maximum limits are breached &#8211; a clear signal that it&#8217;s time to review and refactor.</p>

<p><a href="http://blog.joa-ebert.com/">Joa Ebert</a> was first to the market with <a href="http://blog.joa-ebert.com/2008/10/06/as3v/">AS3V</a> and I quickly <a href="http://github.com/simongregory/actionscript3-validator.tmbundle">wired it up</a> to run with <a href="http://macromates.com/">TextMate</a>. AS3V is 90% to 95% there, but still needs a couple of features. My guess is that Joa is now focusing on <a href="http://code.google.com/p/apparat/">other things</a>.</p>

<p>Since then <a href="http://www.adobe.com/">Adobe</a> have open sourced <a href="http://opensource.adobe.com/wiki/display/flexpmd/FlexPMD">FlexPMD</a>. After a couple of false starts I was able run the RC4 build against the codebase I was working with at the time. Even though we&#8217;d been through and fixed most of the 3,000 odd issues reported by <a href="http://blog.joa-ebert.com/2008/10/06/as3v/">AS3V</a>, <a href="http://opensource.adobe.com/wiki/display/flexpmd/FlexPMD">FlexPMD</a> kicked out over 5,000 &#8216;violations&#8217;. The code had been worked on by around 20 developers over a 3 year period so it&#8217;s likely to be an extreme case, but still my advice is to use it from the start of a project.</p>

<p>For <a href="http://macromates.com/">TextMate</a> users the <a href="http://github.com/simongregory/flexpmd.tmbundle">FlexPMD.tmbundle</a> should help make the process easier. Installation and usage details are covered in the <a href="http://github.com/simongregory/flexpmd.tmbundle/blob/master/README.mdown">README</a>. They boil down to using <strong>⇧⌃v</strong> then selecting &#8216;Project&#8217;, &#8216;Document&#8217; or &#8216;Show Report&#8217;.</p>

<p>Finally its worth saying that being pragmatic is a sensible option when working with validation tools. They aren&#8217;t a substitute for a good programmer. So blindly accepting the default ruleset and fixing everything won&#8217;t necessarily be productive. You can and should consider modifying the rules to get what suits you and your team, and there&#8217;s always going to be exceptions to the rule. Which is what <code>//NO PMD</code> is for.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.simongregory.com/07/static-code-validation-with-flexpmd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test driving Maven for Flex, AIR and ActionScript projects.</title>
		<link>http://blog.simongregory.com/07/test-driving-maven-for-flex-air-and-actionscript-projects/</link>
		<comments>http://blog.simongregory.com/07/test-driving-maven-for-flex-air-and-actionscript-projects/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 23:07:02 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://blog.simongregory.com/?p=225</guid>
		<description><![CDATA[Being a Ruby lover I&#8217;ve always intended on using Sprouts for project management. But when I was last looking for a solution you couldn&#8217;t easily specify which revision of a Flex SDK a project should be built with. This was something we needed to do. Access to the continuos integration box was limited which also [...]]]></description>
			<content:encoded><![CDATA[<p>Being a <a href="http://www.ruby-lang.org/">Ruby</a> lover I&#8217;ve always intended on using <a href="http://projectsprouts.org/">Sprouts</a> for project management. But when I was <a href="http://en.wikipedia.org/wiki/2008">last</a> looking for a solution you couldn&#8217;t easily specify which revision of a Flex SDK a project should be built with. This was something we needed to do. Access to the continuos integration box was limited which also caused problems, so we went with <a href="http://ant.apache.org/">ant</a>. I&#8217;ve been rolling out the same ant scripts and associated libraries into projects ever since. Code should be <a href="http://en.wikipedia.org/wiki/Don't_repeat_yourself">DRY</a>, so why not your projects?</p>

<h2>Minimalism in action</h2>

<p><a href="http://maven.apache.org/">Maven</a> has always been on the radar, but <a href="http://flexmojos.sonatype.org/">Flexmojos</a> has made it all the more attractive to flash developers so there&#8217;s been more and more chatter about it recently. At <a href="http://www.bbc.co.uk/iplayer">work</a> it&#8217;s been talked about for while, and after a sales pitch from <a href="http://github.com/freeformsystems">Mischa</a>, I&#8217;ve finally started to put it into action. So far it&#8217;s really cool, simple, clean, and consistent. The projects I&#8217;ve converted just end up with test and src directories. A lot of junk is gone, reduced to a few lines in a pom.xml file. They&#8217;re smaller and easier to understand. Just the kind of minimalism I like.</p>

<h2>Getting an overview</h2>

<p>Starting by understanding how Maven works is a sensible idea, for this try <a href="http://www.sonatype.com/books/mvnref-book/reference/public-book.html">Maven:The Complete Reference</a>. Then, for flex related tasks the <a href="http://flexmojos.sonatype.org/">Flexmojos</a> site is a good source of information. Keeping an eye on the <a href="http://groups.google.com/group/flex-mojos">Flexmojos mailing list</a> also helps.</p>

<h2>Installing maven 2 + 3</h2>

<p><a href="http://maven.apache.org/">Maven</a> comes preinstalled on OS X so type <code>mvn --version</code> into the <a href="http://en.wikipedia.org/wiki/Apple_Terminal">Terminal</a> and you&#8217;re likely to see this:</p>

<pre><code>Apache Maven 2.2.1 (r801777; 2009-08-06 20:16:01+0100)
Java version: 1.6.0_20
Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
Default locale: en_GB, platform encoding: MacRoman
OS name: "mac os x" version: "10.6.4" arch: "x86_64" Family: "mac" 
</code></pre>

<p>This means you&#8217;re good to go with all versions of <a href="http://flexmojos.sonatype.org/">Flexmojos</a> prior to 4.x but you&#8217;ll need to install <a href="http://maven.apache.org/">Maven</a> 3 if you need to use any of the features in 4, as I&#8217;m after <a href="http://www.adobe.com/products/air/">AIR</a> compilation, and ASDOC builds against <a href="http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK">Flex SDK</a> 4 I needed to install the <a href="http://maven.apache.org/download.html">Maven 3 beta</a>.</p>

<p>To start with <a href="http://maven.apache.org/download.html">download it</a>, then unzip to <code>/usr/local/apache-maven/apache-maven-3.0-beta-1</code>. You&#8217;ll then need to edit your <code>~/.profile</code> to include the following:</p>

<pre><code>export M2_HOME=/usr/local/apache-maven/apache-maven-3.0-beta-1
M2="$M2_HOME/bin"
PATH="$M2:$PATH"
MAVEN_OPTS=-Xmx1024m
</code></pre>

<p>The last line isn&#8217;t necessary, but I added it to give Maven a little more memory to work with. The install notes also say you need to set <code>JAVA_HOME</code>. I didn&#8217;t find it necessary, but if you want to then finding out where <code>JAVA_HOME</code> is on a mac means running <code>/usr/libexec/java_home</code> (should be the same as what Maven&#8217;s just told you above) and adding the results to your <code>~/.profile</code>. For me this was:</p>

<pre><code>export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
</code></pre>

<p>Running tests also meant doing a little bit of work. If they don&#8217;t work for you then you may need to tell <a href="http://flexmojos.sonatype.org/">Flexmojos</a> where to find your install of the standalone flash player. So going back to your <code>~/.profile</code> you will need add the following:</p>

<pre><code>PATH="$PATH:/Applications/Flash Player Debugger.app/Contents/MacOS/"
</code></pre>

<p>Then your pom file needs the following added to the <code>flexmojos-maven-plugin</code> configuration node. </p>

<pre><code>&lt;flashPlayerCommand&gt;Flash Player Debugger&lt;/flashPlayerCommand&gt;
</code></pre>

<p>There&#8217;s a full example of this <a href="http://github.com/simongregory/hel-log/blob/master/pom.xml">here</a></p>

<h2>Concluding with poms</h2>

<p>Once installed maven is designed to automatically fetch all the resources it needs. This is done via configuring your pom files to reference the right artifacts so that maven can retrieve them. Where a dependency can&#8217;t be found online you have the opportunity to install it locally. So far I&#8217;ve used the documentation and found example files and have been reasonably productive. This <a href="http://github.com/simongregory/hel-log/blob/master/pom.xml">example pom</a> tests, compiles, validates and generates asdocs for a swc library I&#8217;m experimenting with. I&#8217;m looking to expand this to include swf + air compilation, and test coverage reports.</p>

<p>As <a href="https://docs.sonatype.org/display/FLEXMOJOS/Release+4.x">Flexmojos 4.x</a> is still under active development it can be tricky to get something to work as expected, you do need a little patience. But that is to be expected with alpha software. Version 3 doesn&#8217;t offer the full feature set I&#8217;d like so at the moment maven doesn&#8217;t feel like the complete solution. But as the source is now on <a href="http://github.com/velo/Flexmojos">github</a> so maybe I can find some time to help out. Overall I&#8217;m totally sold on the concept and am looking forward to 4.x moving into stability.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.simongregory.com/07/test-driving-maven-for-flex-air-and-actionscript-projects/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Moving the Ant.tmbundle</title>
		<link>http://blog.simongregory.com/02/moving-the-ant-tmbundle/</link>
		<comments>http://blog.simongregory.com/02/moving-the-ant-tmbundle/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 23:23:50 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[TextMate]]></category>

		<guid isPermaLink="false">http://blog.simongregory.com/?p=208</guid>
		<description><![CDATA[Moving TextMate's Ant Bundle around on github (a git puzzle solved).]]></description>
			<content:encoded><![CDATA[<p>Initially I set out with the aim to switch from <a href="http://subversion.tigris.org/">Subversion</a> to <a href="http://git.or.cz">Git</a> before
there was an official plan from the <a href="http://macromates.com/">TextMate</a> crew. This has now 
<a href="http://old.nabble.com/The-GitHub-Mirror-p25941986.html">changed</a>, and all bundles that show <a href="http://github.com">Github</a> activity are being
removed from the TextMate <a href="http://svn.textmate.org/">svn repository</a>. Which means that the official
bundles I mirrored now have a duplicate Github <a href="http://github.com/textmate/">mirror</a>, and one that is more
central for TextMate users and should be the root of all development. The Apache bundle was easy to sort, as there were no forks I could simply delete my copy. The Ant bundle wasn&#8217;t so straightforward.</p>

<p>Theoretically there&#8217;s no reason why two mirrored repositories couldn&#8217;t be used as each can be
added as a <code>remote</code>. But because of their independent initialisation against the 
svn repo their histories aren&#8217;t identical this doesn&#8217;t work correctly in practice. Even though the file contents are identical at each commit git still recognises separate commits because git-svn appends unique metadata. So you end up with a lot of messy duplication in the history tree.</p>

<p>The fastest solution is to <code>rebase</code> one mirror into the other. Public rebasing 
isn&#8217;t the done thing as it&#8217;s bad practice to be changing the repository history 
when others could be working against it. However in this case we are looking to
retire one history completely. I think, given that there&#8217;s only a little work
in the forks, and the file content is the same it is the right solution.</p>

<p>So here are the steps I took to merge my mirror into the official one</p>

<ul>
<li>Forked and cloned the <a href="http://github.com/textmate/ant.tmbundle/master">official</a> bundle on <a href="http://github.com">github</a></li>
<li><code>cd</code>&#8216;d to the root of the clone</li>
<li>Added new remote using <code>git remote add old-origin git@github.com:simongregory/ant-tmbundle.git</code></li>
<li>Fetch the remote data <code>git fetch old-origin</code></li>
<li>Created old-master branch from the old-origin/master with <code>git br old-master old-origin/master</code></li>
<li>Checked out old-master <code>git co old-master</code></li>
<li>Rebased old-master onto master using <code>git rebase master</code></li>
<li>Switched back to master <code>git co master</code></li>
<li>Merged master with old-master <code>git merge old-master</code> </li>
<li>Deleted the old-master branch <code>git br -D old-master</code></li>
<li>Created new sg branch <code>git co -b sg</code></li>
<li>Cherry picked the one commit I needed <code>git cherry-pick 91f598</code></li>
<li>Pushed the branch <code>git push origin sg</code></li>
<li>Removed the old-origin remote using <code>git remote rm old-origin</code></li>
</ul>

<p>Then to linked to the official <a href="http://github.com/textmate/ant.tmbundle/master">TextMate</a> remote using</p>

<ul>
<li>git remote add tm git@github.com:textmate/ant.tmbundle.git</li>
<li>Fetched the remote data <code>git fetch tm</code></li>
<li>Checked master out <code>git co master</code></li>
<li>Synced master branches by pushing <code>git push tm</code> (only possible if you have write access)</li>
</ul>

<p>One extra thing to note is the change from the old naming convention using a hyphen to a period.</p>

<p>There&#8217;s likely to be a better way of achieving this, but this is what worked for 
me. It won&#8217;t work if you have any private branches as you wouldn&#8217;t be able to 
pull them across. In this case I&#8217;d look at inverting the process and adding the 
new fork as a remote to the existing repository and merging from there.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.simongregory.com/02/moving-the-ant-tmbundle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HelvectorLight Theme</title>
		<link>http://blog.simongregory.com/12/helvectorlight-theme/</link>
		<comments>http://blog.simongregory.com/12/helvectorlight-theme/#comments</comments>
		<pubDate>Sun, 23 Dec 2007 00:28:11 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[TextMate]]></category>
		<category><![CDATA[language definition]]></category>
		<category><![CDATA[syntax colouring]]></category>
		<category><![CDATA[tmtheme]]></category>

		<guid isPermaLink="false">http://blog.simongregory.com/12/helvectorlight-theme/</guid>
		<description><![CDATA[I&#8217;ve just updated the ActionScript 3 Bundle to include an ASDoc language definition. This is essentially a scope change of Luke Daley&#8217;s JavaDoc language definition. The result is that the following scopes within the documentation blocks are brought under new colour jurisdictions. keyword.other entity.name.tag punctuation.definition.tag For me, using my favourite theme &#8211; Twilight &#8211; the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just updated the ActionScript 3 Bundle to include an ASDoc language definition. This is essentially a scope change of Luke Daley&#8217;s JavaDoc language definition. The result is that the following scopes within the documentation blocks are brought under new colour jurisdictions.  </p>

<p><code>keyword.other</code>
<code>entity.name.tag</code>
<code>punctuation.definition.tag</code></p>

<p>For me, using my favourite theme &#8211; Twilight &#8211; the extra colour where I was so used to seeing grey wasn&#8217;t working. To combat it, and get things greyscale again, I added 3 new theme elements and applied them to the following scopes:</p>

<p><code>comment.block.documentation keyword.other</code>
<code>comment.block.documentation entity.name.tag</code>
<code>comment.block.documentation punctuation.definition.tag</code></p>

<p>The results are the <a href="/wp-content/assets/themes/HelvectorLight.tmTheme.zip">HelvectorLight.tmTheme</a> which calms things down again.</p>

<p><a href="/wp-content/assets/themes/HelvectorLight.tmTheme.zip"><span class="shift_for_inline_32">Download </span><img src="/wp-content/assets/images/tm/theme_32x32.png"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.simongregory.com/12/helvectorlight-theme/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>TextMate ActionScript 3 and Flex Bundles</title>
		<link>http://blog.simongregory.com/10/textmate-actionscript-3-and-flex-bundles/</link>
		<comments>http://blog.simongregory.com/10/textmate-actionscript-3-and-flex-bundles/#comments</comments>
		<pubDate>Tue, 30 Oct 2007 22:21:49 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[TextMate]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Ant]]></category>
		<category><![CDATA[bundle]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[tmbundle]]></category>

		<guid isPermaLink="false">http://blog.simongregory.com/10/textmate-actionscript-3-and-flex-bundles/</guid>
		<description><![CDATA[As a Flash developer who&#8217;s been working with Flex and ActionScript 3 since late last year I found I couldn&#8217;t settle down and use the Flex Builder Eclipse plug-in. Previously I had acquired the habit of editing ActionScript using TextMate and compiled using the lightning fast MTASC, and although there were alternatives (FDT, Sepy), I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>As a Flash developer who&#8217;s been working with Flex and ActionScript 3 since late last year I found I couldn&#8217;t settle down and use the <a href="http://www.adobe.com/products/flex/flexbuilder/">Flex Builder</a> <a href="http://www.eclipse.org/">Eclipse</a> plug-in. Previously I had acquired the habit of editing ActionScript using <a href="http://macromates.com">TextMate</a> and compiled using the lightning fast <a href="http://www.mtasc.org/">MTASC</a>, and although there were alternatives (<a href="http://fdt.powerflasher.com/">FDT</a>, <a href="http://www.sephiroth.it/python/sepy.php">Sepy</a>), I&#8217;ve always preferred the lightweight flexibility and crisp feel that TextMate has. As a result I&#8217;m responsible for <a href="http://macromates.com/">TextMate&#8217;s</a> ActionScript 3 and Flex bundles.</p>

<p>At the moment the bundles are in the review section of the TextMate <a href="http://svn.textmate.org/trunk/Review/Bundles/">Repository</a>. Once installed the bundle help covers how to set up (primarily to download the <a href="http://www.adobe.com/products/flex/downloads/">flex sdk</a>) and outlines the non-obvious commands. </p>

<p>The main highlights of the bundles are:</p>

<ul>
<li>MXMLC and FCSH Build Commands.</li>
<li>Function, Tag, Import Auto Completion.</li>
<li>ActionScript 3 and Flex documentation search.</li>
<li>Drag and Drop of imports, includes, embed assets, css, xml.</li>
<li>ASDoc Support.</li>
<li>MXML Validation.</li>
<li>Manifest Generation.</li>
<li>Class and Component Templates.</li>
<li>Flex Builder compatible project creation.</li>
<li>Unused Import statement removal.</li>
<li>Shortcut Key Super Class, Code Behind and Import file opening.</li>
</ul>

<p>Thanks to the following people who have all had a hand, although they may not know it, in the creation of the bundles:</p>

<ul>
<li><a href="http://blog.danielparnell.com/">Daniel Parnell</a></li>
<li><a href="http://blog.iconara.net/">Theo Hultberg</a></li>
<li><a href="http://www.dirtystylus.com/blog/">Mark Llobrera</a></li>
<li><a href="http://www.4d.be/">Joachim</a></li>
<li>ChromaticRain </li>
<li><a href="http://subtlegradient.com/">Thomas Aylott</a></li>
</ul>

<p>For those of you who don&#8217;t use subversion the following zip&#8217;s can be downloaded, but they won&#8217;t necessarily be the latest version :</p>

<p><a href="/wp-content/assets/bundles/ActionScript%203.tmbundle.zip" title="ActionScript 3.tmbundle"><span class="shift_for_inline_bundle_icon_32">ActionScript 3 Bundle </span><img src="/wp-content/assets/images/tm/tm_bundle_32x32.png"/></a>
<a href="/wp-content/assets/bundles/Flex.tmbundle.zip" title="Flex.tmbundle"><span class="shift_for_inline_bundle_icon_32">Flex Bundle </span><img src="/wp-content/assets/images/tm/tm_bundle_32x32.png"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.simongregory.com/10/textmate-actionscript-3-and-flex-bundles/feed/</wfw:commentRss>
		<slash:comments>110</slash:comments>
		</item>
	</channel>
</rss>
