<?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; ASDoc</title>
	<atom:link href="http://www.sebastiaanholtrop.com/archives/category/asdoc/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>
		<item>
		<title>How to use ASDoc with external libraries</title>
		<link>http://www.sebastiaanholtrop.com/archives/25</link>
		<comments>http://www.sebastiaanholtrop.com/archives/25#comments</comments>
		<pubDate>Thu, 11 Sep 2008 18:57:09 +0000</pubDate>
		<dc:creator>Sebastiaan</dc:creator>
				<category><![CDATA[ASDoc]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Adobe Flex 2]]></category>

		<guid isPermaLink="false">http://www.sebastiaanholtrop.com/?p=25</guid>
		<description><![CDATA[Because documenting your code itself isn&#8217;t a really fun job you don&#8217;t want to spend to much time fiddling around with ASDoc as well, so here&#8217;s a short description of how you can generate the documentation simple and easy;
To conveniently call the asdoc.exe command from every folder on your system you have to add the [...]]]></description>
			<content:encoded><![CDATA[<p>Because documenting your code itself isn&#8217;t a really fun job you don&#8217;t want to spend to much time fiddling around with ASDoc as well, so here&#8217;s a short description of how you can generate the documentation simple and easy;</p>
<p>To conveniently call the asdoc.exe command from every folder on your system you have to add the path to the folder asdoc.exe is in to the PATH system variable. Here&#8217;s how: Go to your Control Panel and click System. Go to the Advanced tab and click Environment Variables. In the System Variables list locate the Path variable. If it doesn&#8217;t exist create it. Doubleclick the variable to edit the value and add the location of your Flex bin folder, in my case it is: &#8220;d:\Program Files\Adobe\Flex Builder 2\Flex SDK 2\bin&#8221;. Don&#8217;t replace any of the other values in the variable, the value of the variable is semicolon-separated, so just add the path at the end of the value. Now click OK OK and reboot. After the reboot you should be able to just enter this in the command line: c:\asdoc, and ASDoc should respond with a beautiful error.</p>
<p>I hate typing in a command prompt (I don&#8217;t like typing at all), so I create a batch file to call ASDoc so I can create and recreate my documentation again and again. I place the batch file in the root of my project, so here&#8217;s what my project looks like:</p>
<p><a href="http://www.sebastiaanholtrop.com/wp-content/exampleproject.jpg"><img class="alignleft size-full wp-image-26" title="Flex Library Project" src="http://www.sebastiaanholtrop.com/wp-content/exampleproject.jpg" alt="" width="204" height="193" /></a></p>

<div class="wp_codebox"><table><tr id="p254"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p25code4"><pre class="actionscript" style="font-family:monospace;">asdoc -source-path . -doc-sources . -output asdoc -external-library-path=lib -main-title <span style="color: #ff0000;">&quot;My work API documentation&quot;</span> -window-title <span style="color: #ff0000;">&quot;My work API documentation&quot;</span></pre></td></tr></table></div>

<p>Some explanation about the switches in this command:</p>
<ul>
<li> asdoc: this calls the asdoc command</li>
<li>-source-path: Enter a dot to tell ASDoc that the current folder is the source path</li>
<li>-doc-sources: Enter a dot to tell ASDoc to document all of the sources in the current Folder</li>
<li>-output asdoc: This is the name of the Folder in which the documentation will be generated</li>
<li> -external-library-path: If you use external swc&#8217;s, ASDoc wants to know about them, so enter the Folder in which they are located. In my project above I&#8217;ve used Away3D and Tweener, they are located in the lib folder</li>
<li>-main-title: The title at the top of the document</li>
<li>-window-title: The title the browser window displays</li>
</ul>
<p>Note that the -external-library-path is an undocumented switch, I&#8217;ve spent an hour to get ASDoc to work properly with external libraries. Using -library-path won&#8217;t work, you&#8217;ll replace the Flex Framework by doing that, so ASDoc will say something like &#8220;Hey, what&#8217;s a UIComponent?&#8221;.</p>
<p>Everything should work fine, but with ASDoc you&#8217;re never sure. Just run the batch file from the command line and see what happens.</p>
<p>By the way: don&#8217;t use unsupported tags in your code. The @description tag for instance is not supported, which will result in ASDoc throwing a useless xml parser error.</p>
<p>Good luck, you&#8217;re on your own now&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastiaanholtrop.com/archives/25/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
