<?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>Enigmatic Thought &#187; svn</title>
	<atom:link href="http://blog.enigmaticthought.com/tag/svn/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.enigmaticthought.com</link>
	<description>import com.enigmaticThought.blog;</description>
	<lastBuildDate>Fri, 25 Jun 2010 19:54:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Bug hunting in the Flex SDK (part 1)</title>
		<link>http://blog.enigmaticthought.com/2009/07/bug-hunting-fx-1/</link>
		<comments>http://blog.enigmaticthought.com/2009/07/bug-hunting-fx-1/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 16:42:53 +0000</pubDate>
		<dc:creator>Matt C</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[360Flex]]></category>
		<category><![CDATA[FlexSDK]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[svn]]></category>
		<guid isPermaLink="false">http://enigmaticthought.com/?p=134</guid>
		<description><![CDATA[At the 360&#124;Flex BugQuash, I discovered that killing bugs in the Flex framework can actually be easier that trying to decipher some bugs in my own code. How is that possible? Thanks to Adobe&#8217;s bug system, some problems are already solved for you, it&#8217;s just a matter of initiative to submit the fix to Adobe. [...]]]></description>
			<content:encoded><![CDATA[<p>At the 360|Flex <a href="http://www.bugquash.com/">BugQuash</a>, I discovered that killing bugs in the Flex framework can actually be easier that trying to decipher some bugs in my own code.  How is that possible?  Thanks to <a href="https://bugs.adobe.com/flex/">Adobe&#8217;s bug system</a>, some problems are already solved for you, it&#8217;s just a matter of initiative to submit the fix to Adobe. Of course it&#8217;s not just that easy because there are a few hoops to jump through, but they&#8217;re not flaming, and are at ground level.  The BugQuash even has a <a href="http://bugquash.com/documents/Flex_BugQuash_PEK.pdf">Pre-Event Kit</a> that gets you ready as well.  Since Flex 4 is about to go through another cycle, it&#8217;s a great time to either fix a nagging bug in Flex 3 (and let it merge down to Flex 4) or, if your feeling feisty, jump into the Flex 4 world.  I&#8217;m going to put this out in multiple parts so I can hit the details.</p>
<p>The first step is to get familiar with the <a href="http://opensource.adobe.com/wiki/display/flexsdk/Developer+Documentation">Flex SDK</a>.  If you&#8217;re a Flex developer, you&#8217;re likely already there, but you haven&#8217;t gotten your hands dirty inside the SDK code.  Maybe you&#8217;ve monkey patched a flex bug.  Regardless, working with the SDK is key to the bug fix.</p>
<p>I&#8217;m working on a windows client, so I am going to talk windows on the SDK setup.  Fortunately, it&#8217;s easier to get up and running on OS X thanks to it&#8217;s Unix roots. </p>
<ol>
<li>Download the <a href="http://opensource.adobe.com/wiki/display/flexsdk/Get+Source+Code">Source Code</a>. That means getting into the subversion database itself and checking out the latest code there.
<ol>
<li>Install <a href="http://tortoisesvn.tigris.org/">TortiseSVN</a>, a tool that uses windows explorer as the window to the source control world.</li>
<li>Create a directory (I used C:\osFlexSDK) to svn the source code to.</li>
<li>Download <a href="http://opensource.adobe.com/wiki/download/attachments/2392224/flex-svn.zip?version=1">Adobe&#8217;s Flex project skeleton</a> and unzip it to the directory.  This will give you the trunk, branches, &#038; tags directories</li>
<li>(for Flex 4 work) navigate to the flex\sdk folder and right click on the trunk.  Select &#8220;SVN Update&#8221;</li>
<li>(for Flex 3 work) right click on the branches directory and hover over &#8220;Tortoise SVN&#8221; and select repo-browser. right click on the 3.x folder and select checkout.  Click &#8220;OK&#8221;.</li>
</ol>
</li>
<li>Now that we have the source, it&#8217;s time to make sure <a href="http://opensource.adobe.com/wiki/display/flexsdk/Setup">we can build it</a>.  This is where I tripped up and saw some others tripped up at the BugQuash. Building should be a simple affair, especially since it&#8217;s just running ant from the command line.  I&#8217;m using Adobe&#8217;s <a href="http://opensource.adobe.com/wiki/display/flexsdk/Setup+on+Windows">Setup on Windows</a> guide as a baseline.
<ol>
<li>Install <a href="http://www.cygwin.com/">Cygwin</a>.  The key is on the screen where you select the directory.  On the bottom right of the screen there is a selection for Default Text File Type.  You must select DOS/text.<br />
<img src="http://enigmaticthought.com/blog/wp-content/uploads/2009/07/CygwinInstall-300x234.png" alt="Cygwin Install" title="Cygwin Install" width="300" height="234" class="alignnone size-medium wp-image-135" /></li>
<li>Install the proper Java SDK for your build <a href="http://java.sun.com/products/archive/j2se/1.4.2_14/index.html">2.4.2_14</a> into C:\j2sdk1.4.2_14 for Flex 3 and <a href="http://java.sun.com/products/archive/j2se/5.0_13/index.html">5.0_13</a> into C:\Program Files\Java\jdk1.5.0_13 for Flex 4</li>
<li>Install Ant (a straight unzip) for your build <a href="http://archive.apache.org/dist/ant/binaries/apache-ant-1.6.2-bin.zip">1.6.2</a> unzipped into C:/apache-ant-1.6.2/ for Flex 3 and <a href="http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.0-bin.zip">1.7.0</a> unzipped into C:/apache-ant-1.7.0/ for Flex 4</li>
</ol>
</li>
<li>Now rig up the flash player for development use.
<ol>
<li>Create the mm.cfg file in the C:\Documents and Settings\<username> directory if needed and add the following lines to it:
<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://blog.enigmaticthought.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=134&amp;download=mm.cfg">mm.cfg</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1343"><td class="code" id="p134code3"><pre class="text" style="font-family:monospace;">ErrorReportingEnable=1
TraceOutputFileEnable=1</pre></td></tr></table></div>
</li>
<li>navigate to the C:\WINDOWS\system32\Macromed\Flash directory.  Create a FlashPlayerTrust directory is there isn&#8217;t one there already and create a FlexSDK.cfg file with the following line:
<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://blog.enigmaticthought.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=134&amp;download=FlexSDK.cfg">FlexSDK.cfg</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1344"><td class="code" id="p134code4"><pre class="text" style="font-family:monospace;">C:\</pre></td></tr></table></div>
<p>You can change drives or even directories if you aren&#8217;t using the C drive for development, or even have multiple drives.  Adobe suggests being as restrictive as possible for security reasons.</li>
</ol>
</li>
<li>Test your setup.  This is the &#8220;easiest&#8221; part since it&#8217;s pretty much a pass/fail.
<ol>
<li>Run cygwin shell and navigate to the folder you want to build.  Note: All drives are under /cygdrive so c:\osFlexSDK\flex\sdk\trunk is /cygdrive/c/osFlexSDK/flex/sdk/trunk.</li>
<li>Type &#8220;source setup.sh&#8217; to set up the environment variables</li>
<li>Test Java by typing &#8220;java -version&#8221; and make sure you&#8217;re on the right version for your build.  If it reports and error, make sure you installed Java in the correct directory.</li>
<li>Test ant by typing &#8220;ant-version&#8221; and make sure you&#8217;re on the right version for your build. If it reports and error, make sure you unzipped ant in the correct directory.</li>
<li>If everything checks out, type &#8220;ant&#8221; and let the build happen</li>
</ol>
</li>
<li>You should now have a built Flex SDK in the bin directory.  Congratulations!</li>
</ol>
<p>This is continued in <a href="http://enigmaticthought.com/2009/07/bug-hunting-fx-2/">part 2</a><br />
<h3 class='related_post_title'>Related Posts (generated):</h3>
<ul class='related_post'>
<li><a href='http://enigmaticthought.com/2009/07/flash-builder-4-delay-doesnt-impact-catalyst/' title='Flash Builder 4 delay doesn&#8217;t impact Catalyst'>Flash Builder 4 delay doesn&#8217;t impact Catalyst</a></li>
<li><a href='http://enigmaticthought.com/2009/07/autobuilding-from-a-svn-repository/' title='Autobuilding a Flex app from an svn repository'>Autobuilding a Flex app from an svn repository</a></li>
<li><a href='http://enigmaticthought.com/2009/05/bug-quash/' title='Bug Quash'>Bug Quash</a></li>
<li><a href='http://enigmaticthought.com/2009/11/scientific-notation-patch-accepted/' title='Scientific Notation Patch Accepted'>Scientific Notation Patch Accepted</a></li>
<li><a href='http://enigmaticthought.com/2009/08/flex-open-iteration-meeting-2/' title='Flex OIM review'>Flex OIM review</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.enigmaticthought.com/2009/07/bug-hunting-fx-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Autobuilding a Flex app from an svn repository</title>
		<link>http://blog.enigmaticthought.com/2009/07/autobuilding-from-a-svn-repository/</link>
		<comments>http://blog.enigmaticthought.com/2009/07/autobuilding-from-a-svn-repository/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 15:30:23 +0000</pubDate>
		<dc:creator>Matt C</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[FlexSDK]]></category>
		<category><![CDATA[svn]]></category>
		<guid isPermaLink="false">http://enigmaticthought.com/?p=110</guid>
		<description><![CDATA[Where I work we have a couple of servers for testing, one of which is the &#8220;cutting edge&#8221; server that holds the latest swf from subversion. I use a couple of tools that keep it as up to date as possible thanks to an automated build &#038; deploy process that is triggered through SVN updates. [...]]]></description>
			<content:encoded><![CDATA[<p>Where I work we have a couple of servers for testing, one of which is the &#8220;cutting edge&#8221; server that holds the latest swf from subversion.  I use a couple of tools that keep it as up to date as possible thanks to an automated build &#038; deploy process that is triggered through SVN updates.  So let&#8217;s walk through everything and make it happen.</p>
<ol>
<li>Install <a href="http://ant.apache.org/">Apache Ant</a> &#8211; The build tool that binds it all together.  If you&#8217;re not familiar with Ant, it makes Flex compiling much easier.  It&#8217;s somewhat like Make, but with plugins that make magic work (as we&#8217;ll see) so we can use ant to do everything rather than worry about command line tools.</li>
<li>Test ant out by opening a command line and typing &#8220;ant&#8221;.  You should get a message about a build.xml file not existing.</li>
<li>Create your working directory.  Something like &#8220;C:\autobuild\&#8221;.  I&#8217;ll refer to it as the <i>autobuild</i> directory from here out</li>
<li>Create a &#8220;libs&#8221; directory under <i>autobuild</i>.  Since we don&#8217;t want to mess up your ant installation, we&#8217;re going to leave it alone.</li>
<li>Create a &#8220;source&#8221; directory under <i>autobuild</i>.  Go ahead and check out you latest into it since we&#8217;ll use it to test the flex copiler.</li>
<li>Install the <a href="http://www.adobe.com/products/flex/flexdownloads/">Flex SDK</a> &#8211; Since you&#8217;re reading this, you&#8217;ve probably already got this going.  This is so we can use the <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_1.html">Flex Ant Tasks</a> to automate the compilation of the source code.  To do this, goto you <i>flex_builder_install</i>/sdks/<i>version</i>/ant directory and copy the flexTasks.jar files to <i>autobuild</i>/libs directory you just created.</li>
<li>Create a text file named build.properties in the <i>autobuild</i> directory. This is where the ant global variables are defined.  You must have a FLEX_HOME defined to use the Flex And Tasks and can define others to make your build file easier to understand.  This is probably something along the lines of:
<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p110code15'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p11015"><td class="code" id="p110code15"><pre class="text" style="font-family:monospace;"> # Where Flex lives
 FLEX_HOME=C:/Program Files/Adobe/Flex Builder 3 Plug-in/sdks/3.2.0
&nbsp;
 # Where the Flex framework we want to compile with lives
 FRAMEWORK=${FLEX_HOME}/frameworks
&nbsp;
 # Directory where the app will be deployed
 DEPLOY_DIR=./deploy
&nbsp;
# Directory where the app will be deployed
SVN_DIR=./code</pre></td></tr></table></div>
</li>
<li>Create a text file named build.xml in the <i>autobuild</i> directory.  This is where you can define all your settings to make ant work.  The file should just be a reference to the build.properties, flexTasks, and then the mxmlc command:
<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p110code16'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p11016"><td class="code" id="p110code16"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;main&quot;</span> <span style="color: #000066;">basedir</span>=<span style="color: #ff0000;">&quot;.&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;classpath&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${basedir}/libs/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;*.jar&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${basedir}/build.properties&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">resource</span>=<span style="color: #ff0000;">&quot;flexTasks.tasks&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;main&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>Using framework from: ${FLEX_HOME}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mxmlc</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${SVN_DIR}/FlexApp.mxml&quot;</span> </span>
<span style="color: #009900;">				<span style="color: #000066;">output</span>=<span style="color: #ff0000;">&quot;${DEPLOY_DIR}/FlexApp.swf&quot;</span> </span>
<span style="color: #009900;">				<span style="color: #000066;">use-network</span>=<span style="color: #ff0000;">&quot;true&quot;</span> </span>
<span style="color: #009900;">				<span style="color: #000066;">actionscript-file-encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span> </span>
<span style="color: #009900;">				<span style="color: #000066;">keep-generated-actionscript</span>=<span style="color: #ff0000;">&quot;false&quot;</span> </span>
<span style="color: #009900;">				<span style="color: #000066;">debug</span>=<span style="color: #ff0000;">&quot;false&quot;</span> </span>
<span style="color: #009900;">				<span style="color: #000066;">locale</span>=<span style="color: #ff0000;">&quot;en_US&quot;</span></span>
<span style="color: #009900;">				<span style="color: #000066;">incremental</span>=<span style="color: #ff0000;">&quot;true&quot;</span> </span>
<span style="color: #009900;">				<span style="color: #000066;">show-actionscript-warnings</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;load-config</span> <span style="color: #000066;">filename</span>=<span style="color: #ff0000;">&quot;${FRAMEWORK}/flex-config.xml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;source-path</span> <span style="color: #000066;">path-element</span>=<span style="color: #ff0000;">&quot;${FRAMEWORK}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mxmlc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>
<p>Then, from the <i>autobuild</i> directory run &#8220;ant&#8221; and make sure you get a swf in the <i>autobuild</i>/bin directory.  If you get a Java heap space error, you&#8217;ll have to increase Ant&#8217;s memory with a &#8220;set ANT_OPTS=-Xmx1024m&#8221; command on the command line before running ant to create an environment variable that will make Ant use more memory.</li>
<li>Now that we can compile the source, it&#8217;s time to make svn work.  This is a little trickier but <a href="http://subclipse.tigris.org/svnant.html">SvnAnt</a> helps out.  SvnAnt is the most complicated step, but it&#8217;s what makes the magic happen.  Go ahead and download the zip file, and copy the svnant.jar, svnClientAdapter.jar, and scnjavahl.jar files into your libs directory</li>
<li>You&#8217;ll also need a <a href="http://subclipse.tigris.org/wiki/JavaHL">JavaHL</a> to make it work.  Specifically the libsvnjavahl-1.dll from <a href="http://subversion.tigris.org/files/documents/15/43936/svn-win32-1.5.3_javahl.zip">this zip</a> will work.  If there&#8217;s a better route to the file, let me know.  Place the libsvnjavahl-1.dll file in the <i>autobuild</i> directory</li>
<li>Finally update your build.xml file.  Below the project tag add
<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p110code17'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p11017"><td class="code" id="p110code17"><pre class="xml" style="font-family:monospace;">	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;classpath&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${basedir}/libs/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;*.jar&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;typedef</span> <span style="color: #000066;">resource</span>=<span style="color: #ff0000;">&quot;org/tigris/subversion/svnant/svnantlib.xml&quot;</span> <span style="color: #000066;">classpathref</span>=<span style="color: #ff0000;">&quot;classpath&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></td></tr></table></div>
<p>And then, between your target and mxmlc tags add</p>
<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p110code18'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p11018"><td class="code" id="p110code18"><pre class="xml" style="font-family:monospace;">		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;svn</span> <span style="color: #000066;">username</span>=<span style="color: #ff0000;">&quot;svnuser&quot;</span> <span style="color: #000066;">password</span>=<span style="color: #ff0000;">&quot;svnpass&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;checkout</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;url/to/Repos&quot;</span> <span style="color: #000066;">destPath</span>=<span style="color: #ff0000;">&quot;${SVN_DIR}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/svn<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>
</li>
<li>Now to test SVN. go ahead and delete everything in your bin and source directories and type &#8220;ant&#8221; from the command line.  You should see a big checkout, then a compile, and get a swf in the bin directory.  if there was a problem, check your svn path and make sure you&#8217;re checking out the proper directory and not getting the full svn tree</li>
<li>Now that we have a checkout and build, we just need to ftp the swf onto our server.  <a href="http://ant.apache.org/manual/OptionalTasks/ftp.html">Ant&#8217;s FTP lib</a> will do that wonderfully, we just have to get the proper jar files since they&#8217;re not included in the default ant setup.  You can download the <a href="http://commons.apache.org/net/index.html">Jakarta Commons Net</a> binary and then copy the commons-net-2.0.jar and commons-net-ftp-2.0.jar file to your <i>autobuild</i>/libs directory</li>
<li>Update your build.xml file with a new taskdef (just place it below the flexTasks one):
<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p110code19'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p11019"><td class="code" id="p110code19"><pre class="xml" style="font-family:monospace;">	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;ftp&quot;</span> <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;org.apache.tools.ant.taskdefs.optional.net.FTP&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></td></tr></table></div>
<p>And then actually create an ftp task after the build step:</p>
<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p110code20'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p11020"><td class="code" id="p110code20"><pre class="xml" style="font-family:monospace;">		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ftp</span> 	<span style="color: #000066;">server</span>=<span style="color: #ff0000;">&quot;{server}&quot;</span></span>
<span style="color: #009900;">				<span style="color: #000066;">userid</span>=<span style="color: #ff0000;">&quot;{server}&quot;</span></span>
<span style="color: #009900;">				<span style="color: #000066;">password</span>=<span style="color: #ff0000;">&quot;{ftpPassword}&quot;</span></span>
<span style="color: #009900;">				<span style="color: #000066;">remotedir</span>=<span style="color: #ff0000;">&quot;{dir for swf}&quot;</span></span>
<span style="color: #009900;">				<span style="color: #000066;">passive</span>=<span style="color: #ff0000;">&quot;yes&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${DEPLOY_DIR}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;**/*.swf&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ftp<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>
</li>
<li>The final Ant step is to test it all.  Because of the way the Ant FTP library works you have to use &#8220;ant -lib libs&#8221; to load the commons-net files.  You should see a [ftp] action after the [mxmlc] reports the file name and the file should show up on your server.  If it does, everything worked out and you&#8217;ve automated your build &#038; deployment.  Now you just need to trigger it</li>
<li>First, create a batch file to call Ant and make sure everythings set up properly.  Mine looks like this:
<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p110code21'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p11021"><td class="code" id="p110code21"><pre class="text" style="font-family:monospace;">c:
cd C:\autobuild
set ANT_OPTS=-Xmx1024m
ant -lib &quot;libs&quot;</pre></td></tr></table></div>
</li>
<li>I use <a href="http://tools.tortoisesvn.net/CommitMonitor">Commit Monitor</a> which is a SVN repository monitor than can be set up to check the repository on a schedule and, if changes are found, run a program (or in this case, a batch file).  Go ahead and install it and set the batch file to run when new commits are detected.</li>
<li>Sit back and watch the magic happen</li>
</ol>
<p>Just to make it simpler, here are the files we created:</p>
<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://blog.enigmaticthought.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=110&amp;download=build.properties">build.properties</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p11022"><td class="code" id="p110code22"><pre class="text" style="font-family:monospace;"> #SVN location
 urlRepos=&lt;svn address&gt;
&nbsp;
 # Where Flex lives
 FLEX_HOME=C:/Program Files/Adobe/Flex Builder 3 Plug-in/sdks/3.2.0
&nbsp;
 # Where the Flex framework we want to compile with lives
 FRAMEWORK=${FLEX_HOME}/frameworks
&nbsp;
 # Directory where the app will be deployed
 DEPLOY_DIR=./bin
&nbsp;
 # Directory where the app will be deployed
 SVN_DIR=./source
&nbsp;
 # Server to upload completed swf
  HOST_SERVER=&lt;serverURL&gt;</pre></td></tr></table></div>
<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://blog.enigmaticthought.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=110&amp;download=build.xml">build.xml</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p11023"><td class="code" id="p110code23"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;main&quot;</span> <span style="color: #000066;">basedir</span>=<span style="color: #ff0000;">&quot;.&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;classpath&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${basedir}/libs/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;*.jar&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;typedef</span> <span style="color: #000066;">resource</span>=<span style="color: #ff0000;">&quot;org/tigris/subversion/svnant/svnantlib.xml&quot;</span> <span style="color: #000066;">classpathref</span>=<span style="color: #ff0000;">&quot;classpath&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${basedir}/build.properties&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">resource</span>=<span style="color: #ff0000;">&quot;flexTasks.tasks&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;ftp&quot;</span> <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;org.apache.tools.ant.taskdefs.optional.net.FTP&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;main&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;svn</span> <span style="color: #000066;">username</span>=<span style="color: #ff0000;">&quot;svnuser&quot;</span> <span style="color: #000066;">password</span>=<span style="color: #ff0000;">&quot;svnpass&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;checkout</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;${urlRepos}&quot;</span> <span style="color: #000066;">destPath</span>=<span style="color: #ff0000;">&quot;${SVN_DIR}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/svn<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>Using framework from: ${FLEX_HOME}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mxmlc</span> 	<span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${SVN_DIR}/FlexApp.mxml&quot;</span> </span>
<span style="color: #009900;">				<span style="color: #000066;">output</span>=<span style="color: #ff0000;">&quot;${DEPLOY_DIR}/FlexApp.swf&quot;</span> </span>
<span style="color: #009900;">				<span style="color: #000066;">use-network</span>=<span style="color: #ff0000;">&quot;true&quot;</span> </span>
<span style="color: #009900;">				<span style="color: #000066;">actionscript-file-encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span> </span>
<span style="color: #009900;">				<span style="color: #000066;">keep-generated-actionscript</span>=<span style="color: #ff0000;">&quot;false&quot;</span> </span>
<span style="color: #009900;">				<span style="color: #000066;">debug</span>=<span style="color: #ff0000;">&quot;false&quot;</span> </span>
<span style="color: #009900;">				<span style="color: #000066;">locale</span>=<span style="color: #ff0000;">&quot;en_US&quot;</span></span>
<span style="color: #009900;">				<span style="color: #000066;">incremental</span>=<span style="color: #ff0000;">&quot;true&quot;</span> </span>
<span style="color: #009900;">				<span style="color: #000066;">show-actionscript-warnings</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;load-config</span> <span style="color: #000066;">filename</span>=<span style="color: #ff0000;">&quot;${FRAMEWORK}/flex-config.xml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;source-path</span> <span style="color: #000066;">path-element</span>=<span style="color: #ff0000;">&quot;${FRAMEWORK}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mxmlc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ftp</span> 	<span style="color: #000066;">server</span>=<span style="color: #ff0000;">&quot;{server}&quot;</span></span>
<span style="color: #009900;">				<span style="color: #000066;">userid</span>=<span style="color: #ff0000;">&quot;{server}&quot;</span></span>
<span style="color: #009900;">				<span style="color: #000066;">password</span>=<span style="color: #ff0000;">&quot;{ftpPassword}&quot;</span></span>
<span style="color: #009900;">				<span style="color: #000066;">remotedir</span>=<span style="color: #ff0000;">&quot;{dir for swf}&quot;</span></span>
<span style="color: #009900;">				<span style="color: #000066;">passive</span>=<span style="color: #ff0000;">&quot;yes&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${DEPLOY_DIR}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;**/*.swf&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ftp<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>
<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://blog.enigmaticthought.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=110&amp;download=build.bat">build.bat</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p11024"><td class="code" id="p110code24"><pre class="text" style="font-family:monospace;">c:
cd C:\autobuild
set ANT_OPTS=-Xmx1024m
ant -lib &quot;libs&quot;</pre></td></tr></table></div>
<h3 class='related_post_title'>Related Posts (generated):</h3>
<ul class='related_post'>
<li><a href='http://enigmaticthought.com/2009/07/bug-hunting-fx-1/' title='Bug hunting in the Flex SDK (part 1)'>Bug hunting in the Flex SDK (part 1)</a></li>
<li><a href='http://enigmaticthought.com/2009/11/scientific-notation-patch-accepted/' title='Scientific Notation Patch Accepted'>Scientific Notation Patch Accepted</a></li>
<li><a href='http://enigmaticthought.com/2009/08/flex-open-iteration-meeting-2/' title='Flex OIM review'>Flex OIM review</a></li>
<li><a href='http://enigmaticthought.com/2009/08/flex-open-iteration-meeting/' title='Flex Open Iteration Meeting'>Flex Open Iteration Meeting</a></li>
<li><a href='http://enigmaticthought.com/2009/08/objectutil-compare-patch-3-with-feeling/' title='ObjectUtil.compare() Patch 3 (with feeling!)'>ObjectUtil.compare() Patch 3 (with feeling!)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.enigmaticthought.com/2009/07/autobuilding-from-a-svn-repository/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
