<?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/"
	
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>igorbrejc.net &#187; documentation</title>
	<atom:link href="http://igorbrejc.net/category/development/documentation/feed" rel="self" type="application/rss+xml" />
	<link>http://igorbrejc.net</link>
	<description>Just another developer's weblog</description>
	<lastBuildDate>Sun, 12 Feb 2012 06:47:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Tip: How To Speed-Up Sandcastle</title>
		<link>http://igorbrejc.net/development/continuous-integration/tip-how-to-speed-up-sandcastle</link>
		<comments>http://igorbrejc.net/development/continuous-integration/tip-how-to-speed-up-sandcastle#comments</comments>
		<pubDate>Mon, 31 Mar 2008 07:55:49 +0000</pubDate>
		<dc:creator>breki</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[Sandcastle]]></category>

		<guid isPermaLink="false">http://igorbrejc.net/development/continuous-integration/tip-how-to-speed-up-sandcastle</guid>
		<description><![CDATA[Simply remove (or rename) the Data/Reflection directory, so that Sandcastle cannot find the information about .NET Framework libraries. You will loose the ability to have MSDN help on .NET Framework classes links in your documentation, but I think this is not crucial for day-to-day builds, compared to the substantial increase in your build speed. And [...]]]></description>
			<content:encoded><![CDATA[<p>Simply remove (or rename) the <strong>Data/Reflection</strong> directory, so that Sandcastle cannot find the information about .NET Framework libraries. You will loose the ability to have MSDN help on .NET Framework classes links in your documentation, but I think this is not crucial for day-to-day builds, compared to the substantial increase in your build speed. And also, by deleting the contents of the <strong>Reflection</strong> folder you&#8217;ll gain some 200 MB of space on your disk.</p>
]]></content:encoded>
			<wfw:commentRss>http://igorbrejc.net/development/continuous-integration/tip-how-to-speed-up-sandcastle/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
	</item>
		<item>
		<title>Generating WSDL documentation as part of the NAnt build</title>
		<link>http://igorbrejc.net/development/continuous-integration/generating-wsdl-documentation-as-part-of-the-nant-build</link>
		<comments>http://igorbrejc.net/development/continuous-integration/generating-wsdl-documentation-as-part-of-the-nant-build#comments</comments>
		<pubDate>Thu, 31 Jan 2008 07:56:54 +0000</pubDate>
		<dc:creator>breki</dc:creator>
				<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[NAnt]]></category>
		<category><![CDATA[web services]]></category>

		<guid isPermaLink="false">http://igorbrejc.net/development/continuous-integration/generating-wsdl-documentation-as-part-of-the-nant-build</guid>
		<description><![CDATA[WSDLs are not very readable, so I wanted to have some sort of developer-friendly documentation for web services as part of our CI build. I found a simple but effective solution: WSDL viewer (by Tomi Vanek), which is an XSLT transformation file that produces nice HTML documentation. I had to create a custom NAnt task [...]]]></description>
			<content:encoded><![CDATA[<p>WSDLs are not very readable, so I wanted to have some sort of developer-friendly documentation for web services as part of our CI build. I found a simple but effective solution: <a href="http://tomi.vanek.sk/index.php?page=wsdl-viewer">WSDL viewer</a> (by Tomi Vanek), which is an XSLT transformation file that produces nice HTML documentation.</p>

<p>I had to create a custom NAnt task for XSLT transformations since <strong>&lt;style&gt;</strong> task failed when I tried to do transformations using the WSDL viewer XSLT (it was complaining about some XML elements not being declared):</p>

<div class="dean_ch" style="white-space: wrap;"><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;script</span> <span class="re0">language</span>=<span class="st0">&quot;C#&quot;</span> <span class="re0">prefix</span>=<span class="st0">&quot;Brejc.NAntTasks.&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;code<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;![CDATA[</span><br />
<span class="sc2"> &nbsp; &nbsp;[TaskName(&quot;xslt&quot;)]</span><br />
<span class="sc2"> &nbsp; &nbsp;public class XsltTask : Task</span><br />
<span class="sc2"> &nbsp; &nbsp;{</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp;[TaskAttribute (&quot;inputfile&quot;, Required = true)]</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp;public string InputFile</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp;{</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;get { return inputFile; }</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;set { inputFile = value; }</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp;}</span><br />
<br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp;[TaskAttribute (&quot;outputfile&quot;, Required = true)]</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp;public string OutputFile</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp;{</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;get { return outputFile; }</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;set { outputFile = value; }</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp;}</span><br />
<br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp;[TaskAttribute (&quot;xsltfile&quot;, Required = true)]</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp;public string XsltFile</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp;{</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;get { return xsltFile; }</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;set { xsltFile = value; }</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp;}</span><br />
<br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp;protected override void ExecuteTask ()</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp;{</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;XsltSettings xsltSettings = new XsltSettings (true, true);</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;XmlDocument xsltDoc = new XmlDocument();</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xsltDoc.Load (xsltFile);</span><br />
<br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;XmlUrlResolver resolver = new XmlUrlResolver ();</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;XslCompiledTransform transform = new XslCompiledTransform (true);</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;transform.Load (xsltDoc, xsltSettings, resolver);</span><br />
<br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;using (Stream inputStream = File.Open (inputFile, FileMode.Open, FileAccess.Read))</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;XmlReader reader = XmlReader.Create (inputStream);</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;using (XmlWriter writer = XmlWriter.Create (outputFile))</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;transform.Transform (reader, writer);</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp;}</span><br />
<br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp;private string inputFile;</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp;private string outputFile;</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp;private string xsltFile;</span><br />
<span class="sc2"> &nbsp; &nbsp;}</span><br />
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;]]&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/code<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;references<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;include</span> <span class="re0">name</span>=<span class="st0">&quot;System.Xml.dll&quot;</span><span class="re2">&gt;</span></span><span class="sc3"><span class="re1">&lt;/include<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/references<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;imports<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;import</span> <span class="re0">namespace</span>=<span class="st0">&quot;System.IO&quot;</span><span class="re2">&gt;</span></span><span class="sc3"><span class="re1">&lt;/import<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;import</span> <span class="re0">namespace</span>=<span class="st0">&quot;System.Xml&quot;</span><span class="re2">&gt;</span></span><span class="sc3"><span class="re1">&lt;/import<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;import</span> <span class="re0">namespace</span>=<span class="st0">&quot;System.Xml.Xsl&quot;</span><span class="re2">&gt;</span></span><span class="sc3"><span class="re1">&lt;/import<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/imports<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/script<span class="re2">&gt;</span></span></span></div>

<p>Now all you need is to use this task to create the documentation:</p>

<div class="dean_ch" style="white-space: wrap;"><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;target</span> <span class="re0">name</span>=<span class="st0">&quot;docs.wsdl&quot;</span> <span class="re0">description</span>=<span class="st0">&quot;generates wsdl based on the existing web services&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;mkdir</span> <span class="re0">dir</span>=<span class="st0">&quot;doc\wsdl&quot;</span> <span class="re0">unless</span>=<span class="st0">&quot;${directory::exists(&#8216;doc\wsdl&#8217;)}&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;xslt</span> <span class="re0">inputfile</span>=<span class="st0">&quot;SomeWebService.wsdl&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; outputfile=&quot;doc\wsdl\SomeWebService.html&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xsltfile=&quot;lib\WsdlViewer\wsdl-viewer.xsl&quot;/&gt;<br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/xslt<span class="re2">&gt;</span></span></span><br />
<span class="sc3"><span class="re1">&lt;/mkdir<span class="re2">&gt;</span></span></span><span class="sc3"><span class="re1">&lt;/target<span class="re2">&gt;</span></span></span></div>
]]></content:encoded>
			<wfw:commentRss>http://igorbrejc.net/development/continuous-integration/generating-wsdl-documentation-as-part-of-the-nant-build/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
	</item>
		<item>
		<title>C# Source Code Search Engines For Internal Use</title>
		<link>http://igorbrejc.net/development/c/c-source-code-search-engines-for-internal-use</link>
		<comments>http://igorbrejc.net/development/c/c-source-code-search-engines-for-internal-use#comments</comments>
		<pubDate>Tue, 29 Jan 2008 19:20:48 +0000</pubDate>
		<dc:creator>breki</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://igorbrejc.net/development/c/c-source-code-search-engines-for-internal-use</guid>
		<description><![CDATA[I work on a lot of different projects, both in the company I work for and in my spare time. A lot of code has been produced during that time and I constantly find myself searching for that &#8220;I remember I once wrote something like this&#8221; code. Google helps, but its search engine is not [...]]]></description>
			<content:encoded><![CDATA[<p>I work on a lot of different projects, both in the company I work for and in my spare time. A lot of code has been produced during that time and I constantly find myself searching for that &#8220;<em>I remember I once wrote something like this</em>&#8221; code. Google helps, but its search engine is not specialized for C# code and I sometimes have to do a lot of searching before finding a snippet that is perfect for my needs. Snippets in VisualStudio are helpful too, but I use them mostly for really repetitive code which merits taking time to write the snippet.</p>

<p>So I started to look for a search engine that would be able to go through my C# source code (and possibly source code repositories like SVN) and offer more developer-oriented search capabilities (like, for example, searching for all classes that implement a certain interface).</p>

<h4>Desktop Search</h4>

<p>The first thing popping up in my mind was using general desktop search engines (like Google Desktop or similar). In fact I used this approach few years ago when I played around with desktop search engines on my laptop. The problem with general search engines is the fact that they are too general: when you search for code using general search, all kinds of unrelated results pop up. And besides, installing Google Desktop just to search for my source code is a bit of an overkill for me.</p>

<h4>Specialized Search Engines</h4>

<p>My first stop was <a href="http://www.koders.com/corp/products/pro/">Koders Pro</a>. This is a professional solution provided by Koders, an Internet source code search engine which indexes open source projects. I tried Koders Pro beta version just before it went to market and I liked it. It offers most of the features I was looking for. I liked the fact that it knows how to connect to various code versioning systems like SVN. What I didn&#8217;t like is the fact that you have to sign up online on Koders website in order to access your company&#8217;s internal search site. I like to have those things separated: what I do on my (or my company&#8217;s) private network is my own business, thank you (<a href="http://bugsquash.blogspot.com/2007/09/code-search-engines-mini-review.html">looks like someone else agrees with me</a>).</p>

<h4>Open Source Solutions</h4>

<p>But since I wanted to have the search capability available not only on projects I work on professionally, but also for my own personal stuff, I was looking for a free (or not too expensive) preferably open source solution. So I started investigating (more or less googling).</p>

<p>I found a very interesting article called <span id="intelliTxt"><a href="http://www.onjava.com/pub/a/onjava/2006/01/18/using-lucene-to-search-java-source.html?page=1">Using Lucene to Search Java Source Code</a>. As the name says, it describes how to implement a search engine for Java source code using <a href="http://lucene.apache.org/">Lucene</a>, an open source search engine library. The article describes the approach in quite a detail, I won&#8217;t go into it since this is not the purpose of this post. But anyway, it was a good point from which to start searching in a more focused way. I also found a related article, </span><span id="intelliTxt"><a href="http://cs343-spr0607.stanford.edu/index.php/Projects:Source_Code_Search_with_Syntax-Based_Heuristics">Source Code Search with Syntax-Based Heuristics</a>, which builds upon the first article&#8217;s idea, but is more ambitious.</span></p>

<h4><span id="intelliTxt"></span></h4>

<p><span id="intelliTxt"></span></p>

<h4>CS2 Project</h4>

<p>Finally, I stumbled upon <a href="http://code.google.com/p/cs2project/">CS2 Project</a>. This is an open source academic project created by <a href="http://dotnetslackers.com/community/blogs/simoneb/default.aspx">Simone Busoli</a>. It too uses Lucene (<a href="http://incubator.apache.org/lucene.net/">Lucene.Net</a> actually) as a search engine. What I like about CS2 is its extreme simplicity. You just download the zipped binaries package, extract it somewhere on your disk, create an IIS web application for it and that&#8217;s it! No MSI installations, no extra Windows services.</p>

<p>When you browse to the CS2 application page, you get two text boxes: the first one is used for entering search keywords, the second one for registering paths on your disk which contain source code and should be indexed.</p>

<p>CS2 even offers some basic query parameters, like searching for method names, comments etc. It also supports search wildcards.</p>

<p>Okey, it&#8217;s not feature rich as Koders, but on the other hand the basic functionality it offers is a step in the right direction.</p>

<h4>OpenGrok</h4>

<p>While I was writing this post I ran into <a href="http://www.opensolaris.org/os/project/opengrok/">OpenGrok</a>, an open source search engine written in Java. It supports multiple languages search, but I couldn&#8217;t find any information on whether it supports indexing of C# sources.</p>

<p>I will post about any new findings in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://igorbrejc.net/development/c/c-source-code-search-engines-for-internal-use/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
	</item>
	</channel>
</rss>

