<?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>Fusioncube &#187; build automation</title>
	<atom:link href="http://www.fusioncube.net/index.php/category/tools/build-automation/feed" rel="self" type="application/rss+xml" />
	<link>http://www.fusioncube.net</link>
	<description>The online journey of a technophile, by Steve Brownlee</description>
	<lastBuildDate>Wed, 01 Feb 2012 04:17:42 +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>Old School Programming &#8211; circa 1992</title>
		<link>http://www.fusioncube.net/index.php/old-school-programming-circa-1992</link>
		<comments>http://www.fusioncube.net/index.php/old-school-programming-circa-1992#comments</comments>
		<pubDate>Wed, 28 Apr 2010 20:18:42 +0000</pubDate>
		<dc:creator>Steve Brownlee</dc:creator>
				<category><![CDATA[build automation]]></category>
		<category><![CDATA[MSDOS]]></category>

		<guid isPermaLink="false">http://www.fusioncube.net/?p=852</guid>
		<description><![CDATA[Well, today was a fun exercise in a language I have not used in a while… MS-DOS batch files. We author batch files that our Build Managers can use to compile all of our binaries, but I recently ran into a issue where I wanted to give them an option of providing some, or all, [...]]]></description>
			<content:encoded><![CDATA[<p>Well, today was a fun exercise in a language I have not used in a while… MS-DOS batch files.</p>
<p>We author batch files that our Build Managers can use to compile all of our binaries, but I recently ran into a issue where I wanted to give them an option of providing some, or all, of the arguments needed to run the batch file.&#160; If some were left out, then I would use some kind of default values.</p>
<p>Because of this, I wanted to use the command line pattern of -<em>arg1=value1 -arg2=value2</em>, which is not natively supported in a simple batch file.&#160; Furthermore, I didn’t want to force a set sequence, so they could also use <em>-arg2=value2 -arg1=value1</em>.</p>
<p>It took some creative license (i.e. hacks) to get this to work correctly, but now I can use a standard command line argument pattern when creating these batch files.</p>
<p>Here’s the complete solution.</p>
<p>************************   <br />UPDATE: I also added in the ability to provide option flags in addition to name/value pairs.</p>
<p>Syntax:&#160; BATCH -project=MyProject -target=compile -sdkpath=C:\Flex\sdk -e -o   <br />************************</p>
<pre class="code"><code>ECHO OFF
CLS

REM =============================================================================
REM  Set default (empty) values for the variables that will be used to hold the
REM  values specified in the command line arguments.
REM =============================================================================
SET PROJECT=
SET TARGET=
SET SDKPATH=
SET EMAILLOG=
SET REMOTE=false

:PARSEARGUMENTS

REM =============================================================================
REM  Concatenate arguments 1 and 2 with an equals sign unless it is an option
REM  flag which we determine by looking at %2 and seeing if it starts with -
REM =============================================================================
SET ARGUMENT2=%2
if "%ARGUMENT2:~0,1%" == "-" (
    SET commandline=%1=
    SET ARGUMENTTYPE=single
) else (
    SET commandline=%1=%2
    SET ARGUMENTTYPE=double
)

REM =============================================================================
REM  If the first argument is just an equals sign, we've parsed all the arguments
REM =============================================================================
IF "commandline%" == "=" GOTO DONEPARSING

REM =============================================================================
REM  Clear out the values for the switch and the value
REM =============================================================================
SET SWITCH=
SET VALUE=

REM =============================================================================
REM  Using the equals sign as the delimiter, set the SWITCH variable to the
REM  argument name, and the VALUE variable to the argument value
REM =============================================================================
FOR /f "tokens=1,2 delims==" %%a IN ("%commandline%") DO SET SWITCH=%%a&amp;amp;SET VALUE=%%b

REM =============================================================================
REM  Put an IF condition for each command line argument that you are expecting
REM  on the command line, and set the corresponding variable to what's contained
REM  in the VALUE variable.
REM
REM  Then use the SHIFT command twice to move to the next name/value pair.
REM =============================================================================
IF "%SWITCH%" == "-sdkpath" (
    SET SDKPATH=%VALUE%
    GOTO SHIFTER
) 

IF "%SWITCH%" == "-target" (
    SET TARGET=%VALUE%
    GOTO SHIFTER
)

IF "%SWITCH%" == "-project" (
    SET PROJECT=%VALUE%
    GOTO SHIFTER
)

IF "%SWITCH%" == "-e" (
    SET EMAILLOG=yes
    GOTO SHIFTER
)

:SHIFTER
IF "%ARGUMENTTYPE%" == "single" (
    SHIFT
) ELSE (
    SHIFT
    SHIFT
)

REM =============================================================================
REM  Start the parsing process all over again.
REM =============================================================================
GOTO PARSEARGUMENTS

:DONEPARSING</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.fusioncube.net/index.php/old-school-programming-circa-1992/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mad love for TeamCity &#8211; Automated Builds and Continuous Integration</title>
		<link>http://www.fusioncube.net/index.php/mad-love-for-teamcity-automated-builds-and-continuous-integration</link>
		<comments>http://www.fusioncube.net/index.php/mad-love-for-teamcity-automated-builds-and-continuous-integration#comments</comments>
		<pubDate>Thu, 04 Feb 2010 18:40:27 +0000</pubDate>
		<dc:creator>Steve Brownlee</dc:creator>
				<category><![CDATA[build automation]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[teamcity]]></category>

		<guid isPermaLink="false">http://www.fusioncube.net/?p=724</guid>
		<description><![CDATA[I installed TeamCity - a build management and continuous integration application - last night, and I already know it's the one I want to use moving forward.]]></description>
			<content:encoded><![CDATA[<p>First, the link: <a href="http://www.jetbrains.com/teamcity/">TeamCity</a></p>
<p>I&#8217;ve used several automated build tools over these many years, and even though I&#8217;ve only been using TeamCity for <24 hours, I can honestly say it's the easiest one I've ever used.</p>
<p>During 2 hours last night, and 3 hours this morning, I was able to set up every project we have, convert the Ant scripts, establish the proper dependencies, and have build triggers set up for each one.  </p>
<p>Additionally, the Eclipse plugin they made is professional and bug-free.  Here's a quick screenshot I took last night while I was getting all the projects configured.</p>
<p><a href="http://www.fusioncube.net/wp-content/uploads/2010/02/teamcity_eclipse_plugin.png"><img src="http://www.fusioncube.net/wp-content/uploads/2010/02/teamcity_eclipse_plugin.png" alt="teamcity_eclipse_plugin" title="teamcity_eclipse_plugin" width="584" height="856" class="alignnone size-full wp-image-725" /></a></p>
<p>It even includes support for Jabber, so I&#8217;m installing a test server on my machine to see how that works.  Hard to imagine that I could have a complete build management server set up, including notifications, and integration with task management within 48 hours &#8211; cuz that&#8217;s how long I think it&#8217;s going to take.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fusioncube.net/index.php/mad-love-for-teamcity-automated-builds-and-continuous-integration/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

