<?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>non-random ramble &#187; build</title>
	<atom:link href="http://jimbarritt.com/non-random/category/build/feed/" rel="self" type="application/rss+xml" />
	<link>http://jimbarritt.com/non-random</link>
	<description>adventures in code</description>
	<lastBuildDate>Fri, 23 Jul 2010 13:42:14 +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>Installing JRuby with Intellij (OS X)</title>
		<link>http://jimbarritt.com/non-random/2010/07/03/installing-jruby-with-intellij-os-x/</link>
		<comments>http://jimbarritt.com/non-random/2010/07/03/installing-jruby-with-intellij-os-x/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 09:14:25 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[build]]></category>
		<category><![CDATA[intellij]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jruby]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[thoughtblog]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/?p=573</guid>
		<description><![CDATA[GET it from http://jruby.org/ There is a download page, download and exract the tar file somehwere. I put it in /System/Library/Frameworks/JRuby.framework/jruby-1.5.1 I then created a symbolic link to jruby_current And then simply add it to my ~/.bash_profile Now you can add the JRuby SDK to your Java Module in Intellij: Now you can have ruby [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jimbarritt.com/non-random/wp-content/uploads/2010/07/jruby.png" rel="lightbox[573]"><img src="http://jimbarritt.com/non-random/wp-content/uploads/2010/07/jruby.png" alt="" title="jruby" width="235" height="232" class="aligncenter size-full wp-image-574" /></a></p>
<p>GET it from <a href="http://jruby.org/#2">http://jruby.org/</a></p>
<p>There is a download page, download and exract the tar file somehwere.</p>
<p>I put it in <code>/System/Library/Frameworks/JRuby.framework/jruby-1.5.1</code></p>
<p>I then created a symbolic link to <code>jruby_current</code><br />
<pre name='code' class='java:nogutter:nocontrols'>
ln -s jruby-1.5.1/ jruby_current
</pre></p>
<p>And then simply add it to my <code>~/.bash_profile</code></p>
<pre name='code' class='java:nogutter:nocontrols'>
$vi ~/.bash_profile
export PATH=/System/Library/Frameworks/JRuby.framework/jruby_current/bin:$PATH
#Reload the profile&#8230;
$. ~/.bash_profile
#Try out jruby&#8230;
$jruby -v
jruby 1.5.1 (ruby 1.8.7 patchlevel 249) (2010-06-06 f3a3480) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_17) [x86_64-java]
</pre>
<p>Now you can add the JRuby SDK to your Java Module in Intellij:</p>
<p><a href="http://jimbarritt.com/non-random/wp-content/uploads/2010/07/jruby_sdk.png" rel="lightbox[573]"><img src="http://jimbarritt.com/non-random/wp-content/uploads/2010/07/jruby_sdk.png" alt="" title="jruby_sdk" width="600" /></a></p>
<p>Now you can have ruby and Java in the same project. Awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2010/07/03/installing-jruby-with-intellij-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Colorised Build Success Message</title>
		<link>http://jimbarritt.com/non-random/2010/04/25/colorised-build-success-message/</link>
		<comments>http://jimbarritt.com/non-random/2010/04/25/colorised-build-success-message/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 18:05:16 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[linux commands]]></category>
		<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/?p=450</guid>
		<description><![CDATA[My current project has a neat trick we picked up where the build has a red or green banner at the end when you run it locally to give good feedback about the build status. I&#8217;m not sure who originated it, but thanks! I just had to tweak it a bit to get it working [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jimbarritt.com/non-random/wp-content/uploads/2010/04/Build-Result.gif" rel="lightbox[450]"><img src="http://jimbarritt.com/non-random/wp-content/uploads/2010/04/Build-Result.gif" alt="" title="Build Result" width="681" height="248" class="aligncenter size-full wp-image-451" /></a></p>
<p>My current project has a neat trick we picked up where the build has a red or green banner at the end when you run it locally to give good feedback about the build status. I&#8217;m not sure who originated it, but thanks!</p>
<p>I just had to tweak it a bit to get it working on OS X so I thought I would document the trick here.</p>
<p><code>run.sh - OS X</code></p>
<pre name='code' class='java:nogutter:nocontrols'>
CMD=&#8221;./tools/ant/bin/ant -lib ./asl/lib/jdepend $@&#8221;
echo &#8220;Running command [${CMD}] &#8230;&#8221;
$CMD
if [ "$?" -ne 0 ]; then
    echo -e &#8220;`tput setab 1`  `cat ./ci/failed.txt` `tput setab 0`&#8221;
    exit 1
else
    echo -e &#8220;`tput setab 2`  `cat ./ci/passed.txt`  `tput setab 0`&#8221;
    exit 0
fi
</pre>
<p>This assumes you have two supporting files <code>./ci/passed.txt</code> and <code>./ci/failed.txt</code> which contain the message. You can generate messages to your taste <a href="http://www.network-science.de/ascii/">here</a>. </p>
<p>I have provided the files in this example here :</p>
<p><a href='http://jimbarritt.com/non-random/wp-content/uploads/2010/04/passed.txt'>passed.txt</a></p>
<p><a href='http://jimbarritt.com/non-random/wp-content/uploads/2010/04/failed.txt'>failed.txt</a></p>
<p>It has also been run under Ubuntu where the following works (it didnt work on OS X which is why I adapted it), but the <code>tput</code> should also work on Ubuntu. I&#8217;ve not explicitly tested this one!</p>
<pre name='code' class='java:nogutter:nocontrols'>
if [ "$?" -ne 0 ]; then
    echo -e &#8220;\E[30;41m"
    cat ./ci/failed.txt
    echo -e "\E[0m"
    exit 1
else
    echo -e "\E[30;42m"
    cat ./ci/passed.txt
    echo -e "\E[0m"
    exit 0
fi
</pre>
<p>Under windows you can actually make the entire screen of the terminal change color:</p>
<p><code>run.bat - WINDOWS</code></p>
<pre name='code' class='java:nogutter:nocontrols'>
CALL tools\ant\bin\ant %*
IF ERRORLEVEL 1 GOTO RedBuild
IF ERRORLEVEL 0 GOTO GreenBuild
:RedBuild
color 4F
GOTO TheEnd
:GreenBuild
color 2F
:TheEnd
PAUSE
color 07
</pre>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2010/04/25/colorised-build-success-message/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Passing System Properties and Environment Variables to unit tests in Maven &#8211; Update</title>
		<link>http://jimbarritt.com/non-random/2009/09/15/passing-system-properties-and-environment-variables-to-unit-tests-in-maven-update/</link>
		<comments>http://jimbarritt.com/non-random/2009/09/15/passing-system-properties-and-environment-variables-to-unit-tests-in-maven-update/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 18:53:19 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[build]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[thoughtblog]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/2009/09/15/passing-system-properties-and-environment-variables-to-unit-tests-in-maven-update/</guid>
		<description><![CDATA[Unfortunately there was an bug in my previous post. I had naively assumed that the syntax for environment variables was the same as for system properties but alas not. The correct code is:]]></description>
			<content:encoded><![CDATA[<p>Unfortunately there was an bug in my previous post.</p>
<p>I had naively assumed that the syntax for environment variables was the same as for system properties but alas not.</p>
<p>The correct code is:</p>
<pre name='code' class='xml:nogutter:nocontrols'>
<build>
    <defaultgoal>package</defaultgoal>
        &lt;plugins>
        &lt;plugin>
               <groupid>org.apache.maven.plugins</groupid>
               <artifactid>maven-surefire-plugin</artifactid>
               <version>2.4.2</version>
               <configuration>
                   <environmentvariables>
                       <some_env_variable>some value</some_env_variable>
                   </environmentvariables>
                   <systemproperties>
                       &lt;property>
                           <name>acceptance.test.host</name>
                           <value>${acceptance.test.host}</value>
                       &lt;/property>
                   </systemproperties>
                </configuration>
           &lt;/plugin>
       &lt;/plugins>
</build>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2009/09/15/passing-system-properties-and-environment-variables-to-unit-tests-in-maven-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Passing System Properties and Environment Variables to unit tests in Maven</title>
		<link>http://jimbarritt.com/non-random/2009/09/15/passing-system-properties-and-environment-variables-to-unit-tests-in-maven/</link>
		<comments>http://jimbarritt.com/non-random/2009/09/15/passing-system-properties-and-environment-variables-to-unit-tests-in-maven/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 16:06:17 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[build]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[thoughtblog]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/2009/09/15/passing-system-properties-and-environment-variables-to-unit-tests-in-maven/</guid>
		<description><![CDATA[This is a bit of dark magic &#8230; &#60;pre&#62; &#60;build&#62; &#60;defaultGoal&#62;package&#60;/defaultGoal&#62; &#60;plugins&#62; &#60;plugin&#62; &#60;groupId&#62;org.apache.maven.plugins&#60;/groupId&#62; &#60;artifactId&#62;maven-surefire-plugin&#60;/artifactId&#62; &#60;version&#62;2.4.2&#60;/version&#62; &#60;configuration&#62; &#60;environmentVariables&#62; &#60;SOME_ENV_VARIABLE&#62;some value&#60;/SOME_ENV_VARIABLE&#62; &#60;/environmentVariables&#62; &#60;systemProperties&#62; &#60;property&#62; &#60;name&#62;someSystemProperty&#60;/name&#62; &#60;value&#62;${thisCanBePassedIn}&#60;/value&#62; &#60;/property&#62; &#60;/systemProperties&#62; &#60;/configuration&#62; &#60;/plugin&#62; &#60;/plugins&#62; &#60;/build&#62; I'm afraid I had to update this post as initially I naively assumed that the syntax for environment variables was the same as for [...]]]></description>
			<content:encoded><![CDATA[<p>This is a bit of dark magic &#8230;</p>
<p>&lt;pre&gt;<br />
 &lt;build&gt;<br />
        &lt;defaultGoal&gt;package&lt;/defaultGoal&gt;<br />
        &lt;plugins&gt;<br />
            &lt;plugin&gt;<br />
                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br />
                &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;<br />
                &lt;version&gt;2.4.2&lt;/version&gt;<br />
                &lt;configuration&gt;<br />
                    &lt;environmentVariables&gt;<br />
                        &lt;SOME_ENV_VARIABLE&gt;some value&lt;/SOME_ENV_VARIABLE&gt;<br />
                    &lt;/environmentVariables&gt;<br />
                    &lt;systemProperties&gt;<br />
                        &lt;property&gt;<br />
                            &lt;name&gt;someSystemProperty&lt;/name&gt;<br />
                            &lt;value&gt;${thisCanBePassedIn}&lt;/value&gt;<br />
                        &lt;/property&gt;<br />
                    &lt;/systemProperties&gt;<br />
                 &lt;/configuration&gt;<br />
            &lt;/plugin&gt;<br />
        &lt;/plugins&gt;<br />
    &lt;/build&gt;
</pre>
<p>I'm afraid I had to update this post as initially I naively assumed that the syntax for environment variables was the same as for system properties. As you can see from above, you have to actually put a separate xml tag in there for the variable.</p>
<p>By putting the value in ${} you can then pass it in with <code>-DsomeSystemProperty</code> from the command line when you do <code>mvn clean install</code></p>
<p>e.g. :</p>
<pre>
mvn -DsomeSystemProperty=foobar clean install
</pre>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2009/09/15/passing-system-properties-and-environment-variables-to-unit-tests-in-maven/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update the version of ant which is used by Intellij on osx</title>
		<link>http://jimbarritt.com/non-random/2009/06/10/update-the-version-of-ant-which-is-used-by-intellij-on-osx/</link>
		<comments>http://jimbarritt.com/non-random/2009/06/10/update-the-version-of-ant-which-is-used-by-intellij-on-osx/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 12:28:37 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[build]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/2009/06/10/update-the-version-of-ant-which-is-used-by-intellij-on-osx/</guid>
		<description><![CDATA[Open package contents of app. Go into there and replace lib/ant with the version you wnat and downloaded.]]></description>
			<content:encoded><![CDATA[<p>Open package contents of app.</p>
<p>Go into there and replace lib/ant with the version you wnat and downloaded.</p>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2009/06/10/update-the-version-of-ant-which-is-used-by-intellij-on-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change the title of ant junit report</title>
		<link>http://jimbarritt.com/non-random/2009/06/10/change-the-title-of-ant-junit-report/</link>
		<comments>http://jimbarritt.com/non-random/2009/06/10/change-the-title-of-ant-junit-report/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 12:27:19 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[build]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/2009/06/10/change-the-title-of-ant-junit-report/</guid>
		<description><![CDATA[&#60;junitreport todir="${junit.report.html.dir}"&#62; &#60;fileset dir="${junit.report.xml.dir}"&#62; &#60;include name="*.xml"/&#62; &#60;/fileset&#62; &#60;report format="frames" todir="${junit.report.html.dir}"&#62; &#60;param name="TITLE" expression="${junit.configuration} test results." /&#62; &#60;/report&#62; &#60;/junitreport&#62; You can pass parameters to the stylesheet as above, one of which is TITLE. YOu can also change the whole stylesheet by passing &#8220;styledir&#8221; in as a property.]]></description>
			<content:encoded><![CDATA[<pre name="code" class="html">
&lt;junitreport todir="${junit.report.html.dir}"&gt;
                &lt;fileset dir="${junit.report.xml.dir}"&gt;
                    &lt;include name="*.xml"/&gt;
                &lt;/fileset&gt;
                &lt;report format="frames" todir="${junit.report.html.dir}"&gt;
                    &lt;param name="TITLE" expression="${junit.configuration} test results." /&gt;
                &lt;/report&gt;
            &lt;/junitreport&gt;
</pre>
<p>You can pass parameters to the stylesheet as above, one of which is TITLE. YOu can also change the whole stylesheet by passing &#8220;styledir&#8221; in as a property.</p>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2009/06/10/change-the-title-of-ant-junit-report/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cruise / Ant : Could not find log.xml</title>
		<link>http://jimbarritt.com/non-random/2009/01/13/cruise-ant-could-not-find-logxml/</link>
		<comments>http://jimbarritt.com/non-random/2009/01/13/cruise-ant-could-not-find-logxml/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 20:03:22 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[build]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/2009/01/13/cruise-ant-could-not-find-logxml/</guid>
		<description><![CDATA[We just ran into this problem trying to configure ant to run in a different working directory using cruise. Our original snippet looked like this: We then added antWorkingDir="${build.dir}" to the ant target, which failed with a dodgy message like &#8220;could not find log.xml&#8221;. This was because we no longer needed the ${build.dir} when speciying [...]]]></description>
			<content:encoded><![CDATA[<p>We just ran into this problem trying to configure ant to run in a different working directory using cruise.</p>
<p>Our original snippet looked like this:</p>
<pre name="code" class="java">
 <schedule interval="15">
                <ant buildfile="${build.dir}/build.xml" timeout="60" anthome="${build.dir}/tools/apache-ant-1.7.1" target="cruise"/>
        </schedule>
</pre>
<p>We then added <b><code>antWorkingDir="${build.dir}" </code></b> to the ant target, which failed with a dodgy message like &#8220;could not find log.xml&#8221;. This was because we no longer needed the <code>${build.dir}</code> when speciying the buildfile. The error was actually hidden up above in the log and was really saying &#8220;could not find build.xml&#8221;.</p>
<p>working code:</p>
<pre name="code" class="java">
 <schedule interval="15">
                <ant buildfile="build.xml" antWorkingDir="${build.dir}" timeout="60" anthome="${build.dir}/tools/apache-ant-1.7.1" target="cruise"/>
        </schedule>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2009/01/13/cruise-ant-could-not-find-logxml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SCP files to a server using ANT</title>
		<link>http://jimbarritt.com/non-random/2008/12/02/scp-files-to-a-server-using-ant/</link>
		<comments>http://jimbarritt.com/non-random/2008/12/02/scp-files-to-a-server-using-ant/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 14:28:56 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[build]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/2008/12/02/scp-files-to-a-server-using-ant/</guid>
		<description><![CDATA[This is quite easy using the optional &#8216;scp&#8217; task. Under windows, this depends on a java implementation of ssh which is found here Then do something like the following: &#60;!-- On windows, this needs an optional java implementation of ssh which you can get from : http://www.jcraft.com/jsch/index.html download it, build it and then pop the [...]]]></description>
			<content:encoded><![CDATA[<p>This is quite easy using the optional &#8216;scp&#8217; task. </p>
<p>Under windows, this depends on a java implementation of ssh which is found <a href-'http://www.jcraft.com/jsch/index.html'>here</a></p>
<p>Then do something like the following:</p>
<pre name="code" class="xml">
&lt;!-- On windows, this needs an optional java implementation of ssh which you can get from :

http://www.jcraft.com/jsch/index.html

	 download it, build it and then pop the jar file into your ant lib folder
--&gt;
&lt;target name="deploy" description="pushes jar to the test server"&gt;
    &lt;scp trust="true" file="${target.dist.jarfile}"
    todir="${deploy.server.1.username}:${deploy.server.1.password}@${deploy.server.1}:${deploy.server.1.dir}"/&gt;
&lt;/target&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2008/12/02/scp-files-to-a-server-using-ant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
