<?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>Sebastiaan Holtrop &#187; Ant</title>
	<atom:link href="http://www.sebastiaanholtrop.com/archives/category/ant/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sebastiaanholtrop.com</link>
	<description>Creating stuff that works...</description>
	<lastBuildDate>Mon, 08 Feb 2010 11:39:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Create ASDoc code documentation with ANT</title>
		<link>http://www.sebastiaanholtrop.com/archives/38</link>
		<comments>http://www.sebastiaanholtrop.com/archives/38#comments</comments>
		<pubDate>Tue, 10 Feb 2009 09:48:56 +0000</pubDate>
		<dc:creator>Sebastiaan</dc:creator>
				<category><![CDATA[ASDoc]]></category>
		<category><![CDATA[Adobe Flex 3]]></category>
		<category><![CDATA[Ant]]></category>

		<guid isPermaLink="false">http://www.sebastiaanholtrop.com/?p=38</guid>
		<description><![CDATA[Working with command lines really sucks, so prefer automating any of those boring tasks by using any kind of script. Back when I was running Windows XP on a PC, I used batch files to do some of those tasks, but since I&#8217;m using a mac I can&#8217;t run batch files anymore. Furthermore, it was [...]]]></description>
			<content:encoded><![CDATA[<p>Working with command lines really sucks, so prefer automating any of those boring tasks by using any kind of script. Back when I was running Windows XP on a PC, I used batch files to do some of those tasks, but since I&#8217;m using a mac I can&#8217;t run batch files anymore. Furthermore, it was time to switch to something more professional than those oldschool batch files. I&#8217;ve been using ANT for quite some time now and I&#8217;ve created a really simple ANT script to create ASDoc documentation.</p>
<p><strong>What is ANT?</strong><br />
You can do about anyting with ANT by creating an ANT Script (xml) that tells ANT what to do. ANT can do anyting with files (copy, paste, move, duplicate, extract zip files, etc) and with ANT you can execute applications which you would normally use through the command line (or Terminal on a Mac).</p>
<p><strong>ASDoc ANT Script</strong><br />
Ok, back to the ASDoc ant script. Click &#8220;File -&gt; New -&gt; File&#8221; and create a file called asdocbuild.xml. Paste this code into the xml file:</p>

<div class="wp_codebox"><table><tr id="p382"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code" id="p38code2"><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: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&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;">name</span>=<span style="color: #ff0000;">&quot;ASDoc build&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;createdocs&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;asdoc.properties&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;createdocs&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;${asdoc.dir}/asdoc&quot;</span> <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-doc-sources 'src/'&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-main-title 'Undercore, a Flash and Flex development 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;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-window-title 'Undercore'&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-output 'docs'&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<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>Some explanation of what happens in the xml file above: Obviously it&#8217;s an xml file (line 1).  The project tag defines the projectname of the build and the default target to execute, in this case the target on line 5 called createdocs. This node contains an exec node which tells ANT to execute a command line statement with the arguments contained in the exec tag. This is the actual asdoc execution.</p>
<p>Before it executes any of the targets, it loads a properties file. You can define variables in a properties file, such as ${asdoc.dir} which is defined as asdoc.dir in the property file. This is the properties file content:</p>
<pre>asdoc.dir=/Applications/Adobe Flex Builder 3 Plug-in/sdks/3.2.0/bin</pre>
<p>Just create a file named asdoc.properties and paste the code above in it. Your project should look something like this:</p>
<p><img class="alignnone size-full wp-image-73" title="ANT Project" src="http://www.sebastiaanholtrop.com/wp-content/antproject.gif" alt="ANT Project" width="196" height="164" /></p>
<p>Now right-click the asdocbuild.xml file and choose Run As -&gt; Ant Build. Your documentation&#8217;s being created.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastiaanholtrop.com/archives/38/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
