<?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>Technical Jargon &#187; Phantom</title>
	<atom:link href="http://www.jeremyskinner.co.uk/category/phantom/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jeremyskinner.co.uk</link>
	<description>On Error Resume Coding</description>
	<lastBuildDate>Sun, 08 Aug 2010 13:36:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Phantom 0.2 Released</title>
		<link>http://www.jeremyskinner.co.uk/2009/12/30/phantom-0-2-released/</link>
		<comments>http://www.jeremyskinner.co.uk/2009/12/30/phantom-0-2-released/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 15:29:06 +0000</pubDate>
		<dc:creator>Jeremy Skinner</dc:creator>
				<category><![CDATA[Phantom]]></category>

		<guid isPermaLink="false">http://www.jeremyskinner.co.uk/?p=267</guid>
		<description><![CDATA[Phantom 0.2 is now available to download. A big thanks goes to Andrey Shchekin for this release who contributed the NAnt integration and the Runnable syntax. For those not familiar with Phantom, this is a build system written in C# and Boo. Binaries Documentation Source This release includes: NAnt Integration You can now execute NAnt [...]]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://github.com/JeremySkinner/Phantom">Phantom</a> 0.2 is now <a href="http://http://cloud.github.com/downloads/JeremySkinner/Phantom/Phantom-0.2.zip">available to download</a>. A big thanks goes to <a href="http://blog.ashmind.com/">Andrey Shchekin</a> for this release who contributed the NAnt integration and the Runnable syntax.
</p>
<p>
For those not familiar with Phantom, this is a build system written in C# and Boo.
</p>
<ul>
<li><a href="http://github.com/JeremySkinner/Phantom/downloads">Binaries</a></li>
<li><a href="http://wiki.github.com/JeremySkinner/Phantom">Documentation</a></li>
<li><a href="http://github.com/JeremySkinner/Phantom">Source</a></li>
</ul>
<p>This release includes:</p>
<h2>NAnt Integration</h2>
<p>You can now execute NAnt tasks from within Phantom build scripts. In order for this to work, you&#8217;ll need to drop Phantom.Integration.Nant.dll and NAnt.Core.dll into the same directory as Phantom.exe. Once in place, you can import the NAnt tasks. This example executes the &#8216;echo&#8217; task which is part of NAnt.Core.dll:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> tasks <span style="color: #ff7700;font-weight:bold;">from</span> NAnt.<span style="color: black;">Core</span>
target default:
   echo<span style="color: black;">&#40;</span>message : <span style="color: #483d8b;">&quot;Hello from NAnt!&quot;</span><span style="color: black;">&#41;</span></pre></div></div>

<h2>Runnables</h2>
<p>With v0.1 of Phantom, a lot of options were passed to helper methods via Hashes. For example, if you wanted tell msbuild to compile a project with a particular configuration and verbosity, you&#8217;d have to do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">msbuild<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;foo.sln&quot;</span>, <span style="color: black;">&#123;</span> <span style="color: #483d8b;">&quot;configuration&quot;</span>: <span style="color: #483d8b;">&quot;release&quot;</span>, <span style="color: #483d8b;">&quot;verbosity&quot;</span>: <span style="color: #483d8b;">&quot;normal&quot;</span> <span style="color: black;">&#125;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>
With Phantom 0.2, most of these methods have been converted to classes that define regular properties. You can use Boo&#8217;s object initializer syntax they can still be declared on one line:
</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">msbuild<span style="color: black;">&#40;</span><span style="color: #008000;">file</span>: <span style="color: #483d8b;">&quot;foo.sln&quot;</span>, configuration: <span style="color: #483d8b;">&quot;release&quot;</span>, verbosity: <span style="color: #483d8b;">&quot;normal&quot;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>
This is called a &#8216;runnable&#8217; as the msbuild class implements the IRunnable interface. When Phantom sees an instance of an IRunnable type being created, it will automatically call the &#8216;Run&#8217; method (in this case, to kick off MSbuild). This syntax is equivalent to the following:
</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">m = msbuild<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
m.<span style="color: #008000;">file</span> = <span style="color: #483d8b;">&quot;foo.sln&quot;</span>
m.<span style="color: black;">configuration</span> = <span style="color: #483d8b;">&quot;release&quot;</span>
m.<span style="color: black;">verbosity</span> = <span style="color: #483d8b;">&quot;normal&quot;</span>
m.<span style="color: black;">Run</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Runnables can also be used inside a <a href="http://wiki.github.com/JeremySkinner/Phantom/with-syntax">with block</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">with</span> msbuild<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
  .<span style="color: #008000;">file</span> = <span style="color: #483d8b;">&quot;foo.sln&quot;</span>
  .<span style="color: black;">verbosity</span> = <span style="color: #483d8b;">&quot;normal&quot;</span>
  .<span style="color: black;">configuration</span> = <span style="color: #483d8b;">&quot;release&quot;</span></pre></div></div>

<p>&#8230;and the &#8216;Run&#8217; method will automatically be called at the end of the block. This is particularly useful if you have lots of properties that you want to set that cannot all fit on one line.</p>
<h2>Improved FileList support</h2>
<p>
The 0.1 version of <a href="http://wiki.github.com/JeremySkinner/Phantom/file-lists">FileLists</a> were rather limited. With 0.2 they now support exclusion patterns as well as recursively copying subdirectories:
</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">with</span> FileList<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;path/to/bin/debug&quot;</span><span style="color: black;">&#41;</span>:
  .<span style="color: black;">Include</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;**/*&quot;</span><span style="color: black;">&#41;</span>
  .<span style="color: black;">ForEach</span> <span style="color: #ff7700;font-weight:bold;">def</span><span style="color: black;">&#40;</span><span style="color: #008000;">file</span><span style="color: black;">&#41;</span>:
    <span style="color: #008000;">file</span>.<span style="color: black;">CopyToDirectory</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;directoryToPackage&quot;</span><span style="color: black;">&#41;</span></pre></div></div>

<h2>NCover Integration</h2>
<p>
Phantom 0.2 now includes runnables for executing <a href="http://www.ncover.com">NCover</a> and NCoverExplorer. At present, these only work with the free Community Edition of NCover.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyskinner.co.uk/2009/12/30/phantom-0-2-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Phantom 0.1 released</title>
		<link>http://www.jeremyskinner.co.uk/2009/11/07/phantom-0-1-released/</link>
		<comments>http://www.jeremyskinner.co.uk/2009/11/07/phantom-0-1-released/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 18:29:22 +0000</pubDate>
		<dc:creator>Jeremy Skinner</dc:creator>
				<category><![CDATA[Phantom]]></category>

		<guid isPermaLink="false">http://www.jeremyskinner.co.uk/?p=237</guid>
		<description><![CDATA[Today I&#8217;ve released v0.1 of my Boo-based build system, Phantom. If you are unfamiliar with Phantom, check out my previous post. Binaries Documentation Source Phantom is still very much in its initial stages. There are quite a lot of features still missing, but I now consider it stable enough to be usable.]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;ve released v0.1 of my Boo-based build system, <a href="http://github.com/JeremySkinner/Phantom">Phantom</a>.</p>
<p>If you are unfamiliar with Phantom, check out my <a href="http://www.jeremyskinner.co.uk/2009/08/11/introducing-spectre/">previous post</a>.</p>
<ul>
<li><a href="http://github.com/JeremySkinner/Phantom/downloads">Binaries</a></li>
<li><a href="http://wiki.github.com/JeremySkinner/Phantom">Documentation</a></li>
<li><a href="http://github.com/JeremySkinner/Phantom">Source</a></li>
</ul>
<p>
Phantom is still very much in its initial stages. There are quite a lot of features still missing, but I now consider it stable enough to be usable.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyskinner.co.uk/2009/11/07/phantom-0-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spectre is now known as &#8216;Phantom&#8217;</title>
		<link>http://www.jeremyskinner.co.uk/2009/08/12/spectre-is-now-known-as-phantom/</link>
		<comments>http://www.jeremyskinner.co.uk/2009/08/12/spectre-is-now-known-as-phantom/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 08:25:42 +0000</pubDate>
		<dc:creator>Jeremy Skinner</dc:creator>
				<category><![CDATA[Phantom]]></category>

		<guid isPermaLink="false">http://www.jeremyskinner.co.uk/?p=179</guid>
		<description><![CDATA[Since my last post on my Boo-based build system named &#8216;Spectre&#8217; it was pointed out to me that there is another project called &#8216;Specter&#8217; also written in Boo. To avoid confusion, I have renamed my Spectre to &#8216;Phantom&#8217;. The updated source can be found on GitHub.]]></description>
			<content:encoded><![CDATA[<p>
Since my <a href="http://www.jeremyskinner.co.uk/2009/08/11/introducing-spectre/">last post</a> on my Boo-based build system named &#8216;Spectre&#8217; it was pointed out to me that there is another project called &#8216;Specter&#8217; <a href="http://specter.sourceforge.net">also written in Boo</a>.
</p>
<p>
To avoid confusion, I have renamed my Spectre to &#8216;Phantom&#8217;. The updated source <a href="http://github.com/JeremySkinner/Phantom">can be found on GitHub</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyskinner.co.uk/2009/08/12/spectre-is-now-known-as-phantom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing Phantom &#8211; a build system written in C# and Boo</title>
		<link>http://www.jeremyskinner.co.uk/2009/08/11/introducing-spectre/</link>
		<comments>http://www.jeremyskinner.co.uk/2009/08/11/introducing-spectre/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 16:38:05 +0000</pubDate>
		<dc:creator>Jeremy Skinner</dc:creator>
				<category><![CDATA[Phantom]]></category>

		<guid isPermaLink="false">http://www.jeremyskinner.co.uk/?p=173</guid>
		<description><![CDATA[*Update* Since I published this post, Spectre has been renamed to &#8216;Phantom&#8217; in order to avoid confusion with the Specter BDD framework. *Update 2* The syntax used in this post is out of date and will not work with Phantom v0.2 or later. Please check out the Phantom Documentation to see the updated syntax. I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>
<strong>*Update*</strong> Since I published this post, Spectre has been renamed to &#8216;Phantom&#8217; in order to avoid confusion with the <a href="http://specter.sourceforge.net/">Specter BDD framework</a>.
</p>
<p>
<strong>*Update 2*</strong> The syntax used in this post is out of date and will not work with Phantom v0.2 or later. Please check out the <a href="http://wiki.github.com/JeremySkinner/Phantom">Phantom Documentation</a> to see the updated syntax.
</p>
<p>
I&#8217;ve recently been reading <a href="http://ayende.com/blog">Ayende&#8217;s</a> excellent book <em><a href="http://manning.com/rahien">Building Domain Specific Languages in Boo</a></em> and wanted to try out the techniques I&#8217;ve been learning on a real project. As such, I&#8217;ve created a Boo-based build system called &#8216;<a href="http://github.com/JeremySkinner/Phantom/">Phantom</a>&#8216;.
</p>
<h2>Why a build system?</h2>
<p>
In the past I&#8217;ve tended to use <a href="http://nant.sourceforge.net/">NAnt</a> for building my projects, but I&#8217;ve never really liked the XML-driven build files. I much prefer the approach taken by tools such as <a href="http://rake.rubyforge.org/">Rake</a> that allow you to configure your build through code.
</p>
<p>
While it is possible to use Rake with .NET projects (for example, <a href="http://fluentnhibernate.org">Fluent NHibernate</a> uses Rake), it requires that you have Ruby, Gems and Rake installed in order to use it. One thing that I really like about NAnt is that I can store it alongside my code inside my source control repository. This way, when someone checks out the source code they can run the build without having to install any additional tools.
</p>
<p>
Like Rake, Phantom is completely code-driven and like Nant, it is completely standalone with no installation required.
</p>
<h2>How does a Phantom build script differ from a NAnt script?</h2>
<p>
Here is a typical NAnt build script that declares three targets: &#8216;default&#8217;, &#8216;compile&#8217; and &#8216;test&#8217;. The &#8216;default&#8217; target depends on both &#8216;compile&#8217; and &#8216;test&#8217;. &#8216;Compile&#8217; will build a project using MSBuild and &#8216;test&#8217; will run the project&#8217;s unit tests:
</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://nant.sf.net/release/0.86-beta1/nant.xsd&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;MyProject&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;default&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;default&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;compile test&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;compile&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Compiles the project&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;msbuild</span> <span style="color: #000066;">project</span>=<span style="color: #ff0000;">&quot;path\to\myproject.sln&quot;</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;Build&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;configuration&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;release&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/msbuild<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;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;test&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Runs tests&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;nunit2</span> <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">verbose</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;formatter</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;Plain&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;test</span> <span style="color: #000066;">assemblyname</span>=<span style="color: #ff0000;">&quot;path\to\mytestassembly.dll&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/nunit2<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></div></div>

<p>Here is the same script using Phantom:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">target default, <span style="color: black;">&#40;</span><span style="color: #008000;">compile</span>, <span style="color: #dc143c;">test</span><span style="color: black;">&#41;</span>:
   <span style="color: #ff7700;font-weight:bold;">pass</span>
&nbsp;
desc <span style="color: #483d8b;">&quot;Compiles the project&quot;</span>
target <span style="color: #008000;">compile</span>:
   msbuild<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;path/to/myproject.sln&quot;</span>, <span style="color: black;">&#123;</span> @configuration: <span style="color: #483d8b;">'release'</span> <span style="color: black;">&#125;</span><span style="color: black;">&#41;</span>
&nbsp;
desc <span style="color: #483d8b;">&quot;Runs tests&quot;</span>
target <span style="color: #dc143c;">test</span>:
  nunit<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;path/to/testassembly.dll&quot;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Note that the syntax is very similar to Rake. To run this script you would save it as &#8216;default.boo&#8217; and then run &#8216;Phantom.exe&#8217; in the same directory. Much like Rake, you can run <strong>phantom -t</strong> to get a list of targets in the current project:</p>
<pre>
Phantom v0.1.0.0
Copyright (c) Jeremy Skinner 2009 (http://www.jeremyskinner.co.uk)

http://github.com/JeremySkinner/Phantom

Targets in build.boo:
compile          Compiles the solution
default
package          Creates zip package
test             Executes tests
</pre>
<h2>Utility functions</h2>
<p>
At the moment, Phantom only has a small number of utility functions. Currently these are:
</p>
<ul>
<li><b>msbuild(project, options)</b> &#8211; executes msbuild against a project/solution file.</li>
<li><b>nunit(assemblies, options)</b> &#8211; executes nunit-console.exe against a collection of test assemblies.</li>
<li><b>exec(command, args)</b> &#8211; executes an arbitrary program.</li>
<li><b>env(variable)</b> &#8211; gets an environment variable.</li>
</ul>
<p>These are in addition to Boo&#8217;s built-in functions. I plan to add more over time.</p>
<h2>Does the world really need another build system?</h2>
<p>
Probably not. This more an exercise for me in learning how to build DSLs with Boo and Rhino DSL than anything else. Nevertheless, I plan to use it with a couple of real projects. If anyone else decides to use it, please let me know!
</p>
<h2>Where&#8217;s the source?</h2>
<p>
You can grab the source <a href="http://github.com/JeremySkinner/Phantom">from GitHub</a> and run Build.bat in order to compile the latest binaries.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyskinner.co.uk/2009/08/11/introducing-spectre/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
