<?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>Gaurav&#039;s Blog &#187; SWC</title>
	<atom:link href="http://gauravj.com/blog/tag/swc/feed/" rel="self" type="application/rss+xml" />
	<link>http://gauravj.com/blog</link>
	<description>Tips and Tools of Flex</description>
	<lastBuildDate>Thu, 18 Mar 2010 18:34:01 +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>Creating SWC files with asdoc comments..</title>
		<link>http://gauravj.com/blog/2010/01/creating-swc-files-with-asdoc-comments/</link>
		<comments>http://gauravj.com/blog/2010/01/creating-swc-files-with-asdoc-comments/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 06:36:28 +0000</pubDate>
		<dc:creator>Gaurav</dc:creator>
				<category><![CDATA[Flex Tools]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[ASDoc]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[MXML]]></category>
		<category><![CDATA[SWC]]></category>

		<guid isPermaLink="false">http://gauravj.com/blog/?p=572</guid>
		<description><![CDATA[<p>Have you tried the latest Flash Builder? If not, the latest beta can be downloaded from http://labs.adobe.com/technologies/flashbuilder4/?sdid=EUHSU</p>
<p>But if you have already tried it, you would have noticed that now ActionScript and MXML editors show ASDoc documentation when you hover over variables/method/class names. See screen shot below:
</p>
<p>This means that you can now see the documentation as you <span style="color:#777"> . . . &#8594; Read More: <a href="http://gauravj.com/blog/2010/01/creating-swc-files-with-asdoc-comments/">Creating SWC files with asdoc comments..</a></span>]]></description>
			<content:encoded><![CDATA[<p>Have you tried the latest Flash Builder? If not, the latest beta can be downloaded from <a href="http://labs.adobe.com/technologies/flashbuilder4/?sdid=EUHSU">http://labs.adobe.com/technologies/flashbuilder4/?sdid=EUHSU</a></p>
<p>But if you have already tried it, you would have noticed that now ActionScript and MXML editors show ASDoc documentation when you hover over variables/method/class names. See screen shot below:<br />
<img src="examples/ASDoc/FlashBuilder_ASDoc_Help.png" /></p>
<p>This means that you can now see the documentation as you are writing code. You can see the method/variable signature or any other documentation associated with any of the class elements. And for all this you don&#8217;t need to open the language reference in a separate browser window or search for the documentation.</p>
<p>Behind the scenes Flash Builder pulls this information from the Flex SDK swc files and the ASDoc info is stored in XML files inside the SWC files. For all nightly builds of Flex SDK, the swcs will come with these ASDoc XML files. In case you want to add similar ASDoc XML files to your custom swcs, you can do that too. Currently there is no single command to generate swc with ASDoc XML files, it is done in three simple steps. And the three steps are:</p>
<ol>
<li>Generate SWC</li>
<li>Generate doc XML Files using ASDoc tool</li>
<li>Update SWC with doc XML fIles</li>
</ol>
<p>I hope you already know how to generate a swc file. If not, take a look at <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_22.html">http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_22.html</a><br />
In order to generate the doc XML files using ASDoc tool, you will have to run the asdoc tool using <strong>-keep-xml=true</strong> and <strong>-skip-xsl=true</strong><br />
A swc file is a compressed file, so to update it (with doc XML files) you can simply use a zip command. </p>
<p>For reference, you can also look at the build.xml file in the framework project of the Flex SDK. Following is the &#8220;doc&#8221; target which performs step #2 and #3:</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;target name=<span style="color: #ff0000;">&quot;doc&quot;</span> depends=<span style="color: #ff0000;">&quot;clean-temp-docs&quot;</span> description=<span style="color: #ff0000;">&quot;updates framework.swc with asdoc xml&quot;</span><span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- Load the &lt;asdoc&gt;</span></span> task. We can't do this at the <span style="color: #000000;">&lt;project<span style="color: #7400FF;">&gt;</span></span> level --&gt;
		<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- because targets that run before flexTasks.jar gets built would fail. --&gt;</span></span>
		<span style="color: #000000;">&lt;taskdef resource=<span style="color: #ff0000;">&quot;flexTasks.tasks&quot;</span> classpath=<span style="color: #ff0000;">&quot;${FLEX_HOME}/lib/flexTasks.jar&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
	    <span style="color: #000000;">&lt;condition property=<span style="color: #ff0000;">&quot;asdoc.jvm.args&quot;</span> value=<span style="color: #ff0000;">&quot;-Xmx384m&quot;</span><span style="color: #7400FF;">&gt;</span></span>
	        <span style="color: #000000;">&lt;os family=<span style="color: #ff0000;">&quot;windows&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
	    <span style="color: #000000;">&lt;/condition<span style="color: #7400FF;">&gt;</span></span>
&nbsp;
	    <span style="color: #000000;">&lt;condition property=<span style="color: #ff0000;">&quot;asdoc.jvm.args&quot;</span> value=<span style="color: #ff0000;">&quot;-Xmx512m&quot;</span><span style="color: #7400FF;">&gt;</span></span>
	        <span style="color: #000000;">&lt;os family=<span style="color: #ff0000;">&quot;mac&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
	    <span style="color: #000000;">&lt;/condition<span style="color: #7400FF;">&gt;</span></span>
&nbsp;
	    <span style="color: #000000;">&lt;condition property=<span style="color: #ff0000;">&quot;asdoc.jvm.args&quot;</span> value=<span style="color: #ff0000;">&quot;-Xmx512m&quot;</span><span style="color: #7400FF;">&gt;</span></span>
	        <span style="color: #000000;">&lt;os family=<span style="color: #ff0000;">&quot;unix&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
	    <span style="color: #000000;">&lt;/condition<span style="color: #7400FF;">&gt;</span></span>
&nbsp;
		<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- Call asdoc to generate dita xml files --&gt;</span></span>
		<span style="color: #000000;">&lt;asdoc output=<span style="color: #ff0000;">&quot;${FLEX_HOME}/tempDoc&quot;</span> lenient=<span style="color: #ff0000;">&quot;true&quot;</span> failonerror=<span style="color: #ff0000;">&quot;true&quot;</span> keep-xml=<span style="color: #ff0000;">&quot;true&quot;</span> skip-xsl=<span style="color: #ff0000;">&quot;true&quot;</span> fork=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
		    <span style="color: #000000;">&lt;compiler.source-path path-element=<span style="color: #ff0000;">&quot;${basedir}/src&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		    <span style="color: #000000;">&lt;doc-classes class=<span style="color: #ff0000;">&quot;FrameworkClasses&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		    <span style="color: #000000;">&lt;doc-namespaces uri=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		    <span style="color: #000000;">&lt;namespace uri=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> manifest=<span style="color: #ff0000;">&quot;${basedir}/manifest.xml&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		    <span style="color: #000000;">&lt;jvmarg line=<span style="color: #ff0000;">&quot;${asdoc.jvm.args}&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		<span style="color: #000000;">&lt;/asdoc<span style="color: #7400FF;">&gt;</span></span>
&nbsp;
		<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- updates framework.swc with asdoc xml --&gt;</span></span>
		<span style="color: #000000;">&lt;zip destfile=<span style="color: #ff0000;">&quot;${FLEX_HOME}/frameworks/locale/en_US/framework_rb.swc&quot;</span> update=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
		    <span style="color: #000000;">&lt;zipfileset dir=<span style="color: #ff0000;">&quot;${FLEX_HOME}/tempDoc/tempdita&quot;</span> prefix=<span style="color: #ff0000;">&quot;docs&quot;</span><span style="color: #7400FF;">&gt;</span></span>
			    <span style="color: #000000;">&lt;include name=<span style="color: #ff0000;">&quot;*.*&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
				<span style="color: #000000;">&lt;exclude name=<span style="color: #ff0000;">&quot;ASDoc_Config.xml&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
				<span style="color: #000000;">&lt;exclude name=<span style="color: #ff0000;">&quot;overviews.xml&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		    <span style="color: #000000;">&lt;/zipfileset<span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;">&lt;/zip<span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;">&lt;/target<span style="color: #7400FF;">&gt;</span></span></pre></div></div>

</blockquote>
<p>So give it a try, and if you find any bugs you can log them at <a href="http://bugs.adobe.com/flex">http://bugs.adobe.com/flex</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gauravj.com/blog/2010/01/creating-swc-files-with-asdoc-comments/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Finding SWC dependencies</title>
		<link>http://gauravj.com/blog/2009/07/finding-swc-dependencies/</link>
		<comments>http://gauravj.com/blog/2009/07/finding-swc-dependencies/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 19:59:02 +0000</pubDate>
		<dc:creator>Gaurav</dc:creator>
				<category><![CDATA[Flex Tools]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[SWC]]></category>

		<guid isPermaLink="false">http://gauravj.com/blog/?p=457</guid>
		<description><![CDATA[<p>The nightly builds for Flex SDK 4 now contain a new tool called swcdepends which can be used to analyze the dependencies between SWC files. This tool can be found under the bin folder of the SDK and the latest nightly builds for Flex SDK 4  is available at http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</p>
Types of Dependencies
<p>There can be four <span style="color:#777"> . . . &#8594; Read More: <a href="http://gauravj.com/blog/2009/07/finding-swc-dependencies/">Finding SWC dependencies</a></span>]]></description>
			<content:encoded><![CDATA[<p>The nightly builds for Flex SDK 4 now contain a new tool called swcdepends which can be used to analyze the dependencies between SWC files. This tool can be found under the <strong>bin</strong> folder of the SDK and the latest nightly builds for Flex SDK 4  is available at <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a></p>
<h3>Types of Dependencies</h3>
<p>There can be four types of dependencies between two action script classes.</p>
<ul>
<li>expression &#8211; e</li>
<li>inheritance &#8211; i</li>
<li>namespace &#8211; n</li>
<li>signature &#8211; s</li>
</ul>
<h3>Using swcdepends</h3>
<p>swcdepends can be used from command line like mxmlc or compc but it also introduces few new options. </p>
<p>If you run the swcdepends without any options then it will display the dependencies for the SWCs present in the Flex SDK. Starting with the ones which have the least dependencies on other SWCs. </p>
<p>But you can also use various options in swcdepends to filter or expand the data you are interested in. Some of them are:</p>
<p><strong>-show-swcs</strong><br />
-show-swcs expects a list of SWCs for which you want to see the dependency info. For example if you run:<br />
$ ./swcdepends -show-swcs framework.swc spark.swc</p>
<p>It will display:</p>
<blockquote><pre>sdk\frameworks\libs\framework.swc:
        sdk\frameworks\libs\player\10\playerglobal.swc
sdk\frameworks\libs\spark.swc:
        sdk\frameworks\libs\textLayout.swc
        sdk\frameworks\libs\framework.swc
        sdk\frameworks\libs\player\10\playerglobal.swc
</pre>
</blockquote>
<p>Notice that it first lists the SWC for which the analysis is requested and then the dependencies are listed  (dependencies are indented)</p>
<p><strong>-show-external-classes</strong><br />
-show-external-classes=true will also display the names of classes which are found as dependencies. For example if you run:<br />
$ ./swcdepends -show-swcs framework.swc -show-external-classes=true</p>
<p>It will show output like:</p>
<blockquote><pre>sdk\frameworks\libs\framework.swc:
        sdk\frameworks\libs\player\10\playerglobal.swc
                flash.utils:Dictionary
                flash.events:MouseEvent
                flash.text:TextFieldAutoSize
                flash.xml:XMLDocument
                Class
                Date
                flash.utils:Timer
                .....
</pre>
</blockquote>
<p><strong>-show-types</strong><br />
-show-types=true will also show the type of dependency next to the class. For example if you run:<br />
$ ./swcdepends -show-swcs framework.swc -show-external-classes=true -show-types=true</p>
<p>It will show output like:</p>
<blockquote><pre>sdk\frameworks\libs\framework.swc:
        sdk\frameworks\libs\player\10\playerglobal.swc
                flash.utils:Dictionary  s e
                flash.events:MouseEvent i s e
                flash.text:TextFieldAutoSize    e
                flash.xml:XMLDocument   s e
                Class   e
                Date    s e
                flash.utils:Timer       s e
                .....
</pre>
</blockquote>
<p>Also when -show-types=true is specified -show-external-classes=true is not required.</p>
<p><strong>-types</strong><br />
-types expects the list the type that should be displayed, so this option can be used to filter the information based on types. The following command:<br />
$ ./swcdepends -show-swcs framework.swc -show-types=true -types=i,s</p>
<p>will display:</p>
<blockquote><pre>sdk\frameworks\libs\framework.swc:
        sdk\frameworks\libs\player\10\playerglobal.swc
                flash.utils:Dictionary  s
                flash.events:MouseEvent i s
                flash.xml:XMLDocument   s
                flash.system:LoaderContext      s
                flash.geom:Point        s
                Date    s
                ....
</pre>
</blockquote>
<p>So it will filter out the dependencies of type <em>expression</em> and <em>namespace</em>.</p>
<p><strong>-minimize-dependency-set</strong><br />
-minimize-dependency-set is true by default and it narrows the results to filter out a SWC, if the scripts resolved in the SWC are subset of the scripts resolved in another dependent SWC</p>
<p>So if you run<br />
$ ./swcdepends -show-swcs spark.swc</p>
<p>It doesn&#8217;t show you flex.swc, because flex.swc is a subset of framework.swc and everything if flex.swc is already present in framework.swc. But if you want you can always see more info using: </p>
<p>$ ./swcdepends -show-swcs spark.swc -minimize-dependency-set=false</p>
<p>Hopefully this tool will provide useful info regarding how SWCs are related to each other. If you run into any bugs, feel free to log them at <a href="http://bugs.adobe.com/flex">http://bugs.adobe.com/flex</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://gauravj.com/blog/2009/07/finding-swc-dependencies/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
