<?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>Peter Mac And Associates&#187; Software Development</title>
	<atom:link href="http://www.petermac.com/category/software-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.petermac.com</link>
	<description>Australian freelance programmer and website design</description>
	<lastBuildDate>Tue, 24 Aug 2010 07:28:43 +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>Is your customer Agile?</title>
		<link>http://www.petermac.com/is-your-customer-agile/</link>
		<comments>http://www.petermac.com/is-your-customer-agile/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 00:54:25 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.petermac.com/?p=460</guid>
		<description><![CDATA[My customers don&#8217;t build software systems for a living. If they did I guess they wouldn&#8217;t need my services. I don&#8217;t fix cars for a living but you can imagine the look of perplexity on my face when a mechanic tells me the slipped diff needs replacing and the alternator bushels are worn right down. [...]]]></description>
			<content:encoded><![CDATA[<p>My customers don&#8217;t build software systems for a living. If they did I guess they wouldn&#8217;t need my services. I don&#8217;t fix cars for a living but you can imagine the look of perplexity on my face when a mechanic tells me the slipped diff needs replacing and the alternator bushels are worn right down.</p>
<p>A customer has an idea of what they want to get built. You meet, discuss. The ball-park figure is 6 months person effort and will cost $100,000. What happens next? Do you tell them you&#8217;ll see them in 6 months time with a product and an invoice?</p>
<p>I think it is one of the most critical factors to the success of a software development project that customers are on the same wavelength as the people they have hired to do the work. I&#8217;m talking about expectation management from both sides of the coin.</p>
<p>If you&#8217;re building an agile project (for argument&#8217;s sake let&#8217;s use &apos;scrum&apos;), your customer needs to be around for sprint planning and review meetings. They need to be made aware of the time and frequency commitment required of their staff for testing. They need to know what can and can&#8217;t be updated in a Product Backlog. For that matter, has anyone explained to them what a product backlog is?</p>
<p>Having been involved in software development since the mid 1990&#8242;s, I&#8217;ve seen lots of changes in the way things are done. I&#8217;ve worked on projects where the 190 page business requirement spec was the bible, and programmers wouldn&#8217;t lift a finger until an equally impressive technical spec was completed. I&#8217;ve also seen projects where the client took up residence on the far side of the room and could be called upon at any time with fingers pointing to a screen and the question &#8220;So&#8230;is that what you mean?&#8221;.</p>
<p>I&#8217;ve worked with a number of agile techniques with different levels of success. Each technique has had it&#8217;s pros and cons from a programmer&#8217;s perspective or as a team leader I&#8217;ve occasionally had to go back to the manual and check if we&#8217;ve been doing things the right way. How long should a sprint run really be? Why do I feel like we&#8217;re pushing requirement changes uphill? Where&#8217;s the customer when you&#8217;re ready to deliver the latest batch of output? Oops, someone forgot to tell the customer.</p>
<p>If your customer is not fully aware of the needs you have of them and can&#8217;t provide the staff to fulfill those needs then your project is going to hit a wall sooner or later.</p>
<p>Tips for managing customer expectations are:</p>
<ul>
<li>Educate your customer in your way of working.</li>
<li>Not all projects fit into a fixed methodology. There&#8217;s no point in trying to shoe-horn all projects into a methodology that won&#8217;t work.</li>
<li>Ensure a customer based subject matter expert is available for requirements gathering and testing.</li>
<li>Ensure mobile phones and other distractions are turned off during meetings.</li>
<li>Draw up a schedule of the deliverables you expect to provide and the user acceptance testing time demands around these deliverables.</li>
<li>If any blockers can be foreseen, tell the customer early. Don&#8217;t procrastinate the bad news.</li>
<li>Try and develop a partnership with staff working as close together as possible.</li>
<li>Stay open to changing requirements.</li>
<li>Score changing requirements in terms of difficulty vs payoff. If it&#8217;s a 8 out of 10 in terms of difficulty to achieve but only gives a 2 out of ten in benefit, the numbers should speak for themselves.</li>
<li>Try and keep your customer informed of what&#8217;s around the corner. If you have 2 week sprint runs, make sure they know what&#8217;s happening in a month&#8217;s time. This helps keeps minds focused on the big picture.</li>
</ul>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.petermac.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.petermac.com/is-your-customer-agile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where&#8217;s the Engineer in Software Engineering gone?</title>
		<link>http://www.petermac.com/wheres-the-engineer-in-software-engineering-gone/</link>
		<comments>http://www.petermac.com/wheres-the-engineer-in-software-engineering-gone/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 00:10:03 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.petermac.com/?p=405</guid>
		<description><![CDATA[I&#8217;m based in Melbourne Australia and I&#8217;ve been witness recently to a number of disastrous high profile IT project failures that leave me wondering; shouldn&#8217;t we be getting better at this technology stuff, not worse? The projects I have in mind are: Queensland Dept of Health payroll system that&#8217;s seen employees go underpaid, overpaid and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m based in Melbourne Australia and I&#8217;ve been witness recently to a number of disastrous high profile IT project failures that leave me wondering; shouldn&#8217;t we be getting better at this technology stuff, not worse?  The projects I have in mind are:</p>
<ul>
<li>Queensland Dept of Health payroll system that&#8217;s seen employees go underpaid, overpaid and without pay. <a href="http://www.computerworld.com.au/article/351608/updated_qld_govt_blames_ibm_health_payroll_bungle/" target="blank">Click here for more info</a></li>
<li>LINK &#8211; The Victoria Police database switch-over that wasn&#8217;t. <a href="http://www.theaustralian.com.au/australian-it/vic-police-halts-criminal-database-overhaul/story-e6frgakx-1225846012484" target="blank">Click here for more info</a></li>
<li>Myki &#8211; The attempt to introduce a single electronic travel ticket to Victorian public transport users.<a href="http://www.theage.com.au/victoria/myki-set-to-go-on-trams-buses-20100722-10ltj.html" target="blank">Click here for more info</a></li>
<li>eHealth &#8211; An attempt to consolidate patient identification thereby enabling easier recording and tracking of patient events.<a href="http://www.theaustralian.com.au/australian-it/developers-warned-against-medicare-contracts-because-of-e-health-safety-concerns/story-e6frgakx-1225897185267" target="blank">Click here for more info</a></li>
</ul>
<p>The details of these projects and their current status is available for anyone who wants to spend 2 minutes browsing with Professor Google, but suffice to say it&#8217;s not a pretty picture.</p>
<p>The upshot of each project&#8217;s failure is the negative image it portrays of the IT sector at large. Although the reasons behind the failures are different, the fact that each project is high profile and that profile goes even higher if it all goes to hell in a hand basket.</p>
<p>Diverse consulting companies, impatient politicians, slick tongued sales teams, uneducated buyers, an overly complex procurement and tendering system, a myriad of antiquated technologies. Take your pick, welcome to Australia!</p>
<p>It&#8217;s almost impossible to dismiss the fact that at the heart of all of the IT projects mentioned above is hardware and software.</p>
<p>As a software engineer, I&#8217;d like to think I build systems that stand the test of time. A customer buys code from me that fits their requirements, or can be configured to suit changing requirements. I don&#8217;t let my work out of the office until a test engineer has given it the stamp of approval and it&#8217;s got the necessary test cases to prove it. Occasionally you may find a difference between the expressed requirement and the executed version. That&#8217;s what we have user acceptance testing for.</p>
<p>You&#8217;ll find the same practices applied across most other engineering disciplines. It&#8217;s no surprise that some of the best programmers have come from the electrical and mechanical engineering schools.</p>
<p>So what&#8217;s going wrong? Why are so many public IT projects failing?</p>
<p>Are the engineers speaking up? Are we being listened to?</p>
<p>It&#8217;s interesting to note that the Australian government commissioned a Fellow of the Royal Academy of Engineering, Sir Peter Gershon to produce a report to tell them what they were doing wrong and how they could do things better.<a href="http://www.finance.gov.au/publications/ict-review/docs/Review-of-the-Australian-Governments-Use-of-Information-and-Communication-Technology.pdf" target="blank">The Gershon Report</a> has a number of recommendations for government ICT spending rationalisation and in many cases proper measurement of cost/benefits or IT projects.</p>
<p>I have no answers here, only questions.</p>
<ul>
<li>Have software engineers got a voice at project and program management level to make a difference?</li>
<li>Have we got enough input at pre-sales meetings to create a realistic impression in our customer&#8217;s mind as to the reality of what they&#8217;re about to buy?</li>
<li>Have we input into the skills that will be used to create or enhance the product or service being offered?</li>
<li>Are we managing the expectations of key project staff correctly and is the message being passed up the line?</li>
</ul>
<p>As a practitioner in the IT business, I don&#8217;t want to see any more debacles reflecting badly on my profession. But as I write the word &#8216;profession&#8217; I am forced to ask myself have we reached the stage yet where we can honestly say we are professional, or are we just the same as the sales rep making their next buck?</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.petermac.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.petermac.com/wheres-the-engineer-in-software-engineering-gone/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Programmers &#8211; Duty Of Care</title>
		<link>http://www.petermac.com/programmers-duty-of-care/</link>
		<comments>http://www.petermac.com/programmers-duty-of-care/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 01:43:42 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.petermac.com/?p=387</guid>
		<description><![CDATA[I was recently asked by a prospective client to have a look at adding a shopping cart to his new website. It turns out he&#8217;d spent 18 months and many thousands of dollars getting the site built by a web design company. The relationship had broken down with them wanting more money than initially agreed [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently asked by a prospective client to have a look at adding a shopping cart to his new website. It turns out he&#8217;d spent 18 months and many thousands of dollars getting the site built by a web design company. The relationship had broken down with them wanting more money than initially agreed to deliver the shopping cart.</p>
<p>I agreed to have a look at the project and was not forceful enough by allowing him to send an email to all and sundry welcoming me to the team.</p>
<p>I got access to the existing code-base over a weekend and spent a full weekend trying to get the site set up in my environment (a typical LAMP config). I threw my hands in the air on the Sunday evening and decided to wait till a programmer who had put in some quick fixes over the last few weeks came around to show me how to set up the website. I&#8217;ve been around the traps for some time now and setting up/administering linux, apache, php and mysql are second nature to me. Why should this site be any different?</p>
<p>Holy heavens above and all the saints preserve us if this wasn&#8217;t the site from hell. There were over 1900 files in the site (remember, the shopping cart wasn&#8217;t included yet..or sort of). There wasn&#8217;t a line of commentary apart from the standard headers the previous developers had copied and pasted from third party systems. In their wisdom, the developers had decided to use the .htaccess file not for it&#8217;s intended purpose (security and file access control) but as the core of their navigation system. In spite being built using a combination of PHP 4 and PHP 5, there wasn&#8217;t one occurrence of a &apos;Class&apos; anywhere to be seen.  When I turned on my E_ALL error constraint, I got more errors and warnings than actual web page when browsing the site, There was no revision control history so no idea of who&#8217;d done what or why?</p>
<p>
I am usually very slow to criticise other programmer&#8217;s work. I realise I wasn&#8217;t there when the client asked for new requirements to be added on a Friday afternoon and expected them to work on the Monday morning. I wasn&#8217;t around when the lead programmer left for a bigger and better challenge, leaving the junior programmer holding the fort. That&#8217;s why I usually stay quiet when looking at other&#8217;s work.</p>
<p>This piece of work on the other hand really took the biscuit. The amount of code that went into producing the amount of output that was a handful of pages was staggering. I firmly believe the entire site could have been built (including a shopping cart) for less than $20K and should have taken 2 months to complete. The cowboys who built what I saw were screwing the site owner for every penny he had and measuring their delivery by the unnecessary lines of code they were producing.
<p>In this instance I had to walk away from the project. I realised I would be the &#8216;goto&#8217; man for all the sites many woes and with pending holidays would be unable to commit to deadlines as required by the client.</p>
<p>Unfortunately this sort of web development effort has left a bad taste in the mouth of the site owner as he now views <strong>all</strong> web/software developers with the same contempt and distrust. So thanks to the cowboys they have now driven an even bigger wedge between the world of software and it&#8217;s lifeblood &#8211; the customer.</p>
<p>As programmers, practicing our craft is a skill that&#8217;s fine-tuned over time, but the technology doesn&#8217;t stand still. It&#8217;s a programmer&#8217;s responsibility to ensure we keep up to date with new features, techniques and practices. Failure to do so results in mediocre code and a guarantee you&#8217;re not going to last the test of time as your skills age while the world moves ahead.</p>
<p>If you&#8217;re a software/web services buyer, please ensure you check the credentials of the people you are dealing with. Pick up the phone to other customers. It&#8217;s your money, you should be confident and comfortable handing over your cash knowing you&#8217;re getting a reliable and competent level of service.</p>
<p>If you&#8217;re a software or web developer, please be open to your clients. It doesn&#8217;t always work out well, but if you have a couple of successful projects under your belt, you should be able to use them (and the customer) as a reference. Expectation management is a key component of this business and it is especially true when you&#8217;re dealing with clients who are not tech savvy. It is your duty of care to educate, illuminate and leave a good IT experience in your client&#8217;s mind for all our sakes.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.petermac.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.petermac.com/programmers-duty-of-care/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IT Managers and the dark ages</title>
		<link>http://www.petermac.com/it-managers-and-the-dark-ages/</link>
		<comments>http://www.petermac.com/it-managers-and-the-dark-ages/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 23:56:42 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.petermac.com/?p=308</guid>
		<description><![CDATA[It&#8217;s a funny old world really. Here we are at the start of the 21st century, with one global financial crisis under our belts. Organisations trying to cut down on waste, no need for flights when you can tele-conference, no need for offices when you can work remotely, no need for&#8230;hold on a second! What [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s a funny old world really. Here we are at the start of the 21st century, with one global financial crisis under our belts. Organisations trying to cut down on waste, no need for flights when you can tele-conference, no need for offices when you can work remotely, no need for&#8230;hold on a second! What did you say you do?</p>
<p><b>Oh, you&#8217;re a programmer. There&#8217;s your desk in the corner.</b></p>
<p>I&#8217;ll feed you three cups of coffee every hour and a pizza on Friday. Did you see the cool hip lava-lamp we have at our reception desk? You&apos;re really going to love working in our studioish office. Now, start coding! If you&#8217;re not sitting at your desk and we can&#8217;t hear you cutting code, we&#8217;re not going to pay you your assorted nuts at the end of the month.</p>
<h2>Why not pay by the line of code</h2>
<p>Maybe the scenario here is a bit pointed, but that&#8217;s the point I guess. There are three issues at play here.</p>
<h3>Non IT management managing IT projects</h3>
<p>I&#8217;ve seen it all over the place, the head accountant is appointed responsibility for the IT department (It&#8217;s a cost centre after all) and as such the decisions are made with this year&#8217;s budget in mind. That&#8217;s fine as long as you don&#8217;t have any projects that run into next year.</p>
<h3>Management&#8217;s misconception that coding is all</h3>
<p>If your programmers aren&#8217;t cutting code, what the hell are they doing? That&#8217;s the second time today I&#8217;ve seen him go for a coffee. This has got to stop!</p>
<h3>Lack of understanding and then trust</h3>
<p>If management has little or no understanding of the domain they have been given to &apos;manage&apos;, imagine the fear and mistrust in the  conversation that takes place when the development manager tells them &quot;We&#8217;re a few days behind because we had to redesign the hibernate files to take into account the changes in table structures brought about by the latest specification changes.&quot;</p>
<p>It&#8217;s might seem a paradox that in this, the age of I.T. off-shoring and the total farming out of the code cutting exercise, many organisations insist their staff sit in cubicles and make key-tapping noises to prove they&#8217;re working. But&#8230;it&#8217;s not a paradox. All that has happened is the task of the circus master has been delegated. The circus monkeys are still in their cubicles. The circus master is now taking his orders by phone or skype or webex.
</p>
<h2>In a perfect world</h2>
<p>I&#8217;d roll out of bed and turn on my computer. After a bit of breakfast, I add a new component to the <a href="http://trac.edgewall.org/" target="blank">Trac</a> project I&#8217;m using to manage my current freelance job.</p>
<p>The client has asked for a new feature to be added to the website I&#8217;m working on. She&#8217;s emailed me with a high level specification so I can estimate how much and how long it will take. I&#8217;ve provided the estimate and got sign-off. The email chain gets attached to the Trac component so the graphic designer gets an automatic notification of the new component&#8217;s go-ahead status.</p>
<p>I start working with a HB pencil and a bit of recycled paper on thoughts as to how the new piece of work will&#8230;work. After due consideration I sit down at the computer and start looking for some code that somebody else wrote and tested already that&#8217;s going to be close to what I want to do. The rest is easy.</p>
<p>It&#8217;s time for the 6 o&#8217;clock news. But not going to watch until I&#8217;ve update my on-line timesheet using <a href="http://www.kimai.org/en/" target="_blank">Kimai</a> with comments on what I was working on today. I see Joel the designer has updated his for 3hrs when he knocked off at 4pm after emailing me with the style sheet changes for the new component.</p>
<p>Component finished, ready for end user testing, uploaded to the test web server where the client can access it and report back (on-line through Trac) on changes and fixes needed.</p>
<p>Client gets an email every Friday showing her what was worked on, who worked on it and how many hours she owes us for.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.petermac.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.petermac.com/it-managers-and-the-dark-ages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java/Hibernate ant build example</title>
		<link>http://www.petermac.com/javahibernate-ant-build-example/</link>
		<comments>http://www.petermac.com/javahibernate-ant-build-example/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 07:30:02 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.petermac.com/?p=271</guid>
		<description><![CDATA[This is the contents of a typical ant build file I use for Java coding projects. It&#8217;s up here in case it can help anyone else, and so I can copy and paste it when working off-site. The process is fairly simple, I have my working area in a ~/projects/myapp folder (where myapp is name [...]]]></description>
			<content:encoded><![CDATA[<p>This is the contents of a typical ant build file I use for Java coding projects. It&#8217;s up here in case it can help anyone else, and so I can copy and paste it when working off-site.</p>
<p>The process is fairly simple, I have my working area in a ~/projects/myapp folder (where myapp is name of current project). I have lib files in ~/projects/java/lib/ </p>
<p>I run the build in the myapp file, the ant file reads the build.properties file for some config info and dumps the build outputs to the $targetdir folder (~/projects/bin)</p>
<p>Firstly, the build.properties file</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># options: linux, windows, mac &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
gwt.os = linux<br />
<br />
#Directories &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
gwt.installation.dir = ~/google/gwt-windows-1.5.3<br />
#note env is defined in build.xml file &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
gwt.dir=${env.GWT_HOME}<br />
tomcat.dir=${env.TOMCAT_HOME}<br />
hibernate.dir=${env.HIBERNATE_HOME}<br />
postgresql.dir=${env.POSTGRES_HOME}<br />
asm.dir=${env.ASM_HOME}<br />
spring.dir=${env.SPRING_HOME}<br />
loglib.dir=${env.LOGLIB_HOME}<br />
junit.dir=${env.JUNIT_HOME}<br />
<br />
#JAR files &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
servlet.api.jar=${tomcat.dir}/lib/servlet-api.jar<br />
gwt.servlet.jar=${gwt.dir}/gwt-servlet.jar<br />
hibernate3.jar=${hibernate.dir}/hibernate3.jar<br />
postgresql.driver.jar=${postgresql.dir}/postgresql-8.3-604.jdbc4.jar<br />
asm.jar=${asm.dir}/asm-3.1.jar<br />
loglib.jar=${loglib.dir}/commons-logging-1.1.1.jar<br />
junit.jar=${junit.dir}/junit-4.5.jar<br />
#google web toolkit jars<br />
gwt.user.jar = ${gwt.installation.dir}/gwt-user.jar<br />
gwt.servlet.jar = ${gwt.installation.dir}/gwt-servlet.jar<br />
gwt.dev.jar = ${gwt.installation.dir}/gwt-dev-${gwt.os}.jar<br />
build.dir = ../build<br />
classes.dir = ${build.dir}/classes<br />
jar.dir = ${build.dir}/jar<br />
gwt.output = ${build.dir}/www<br />
<br />
sourcedir = ${basedir}/src<br />
targetdir = ${basedir}/bin<br />
includedir = c:/projects/java/lib<br />
testdir = ${basedir}/test<br />
resdir = ${basedir}/res<br />
reportsdir = ${basedir}/reports<br />
appdir = ${basedir}<br />
wwwdir = ${appdir}/www/com.petermac.${app}<br />
spring.conf.dir = ${basedir}/src/META-INF/spring<br />
hibernate.conf.dir = ${basedir}/src/META-INF/hibernate</div></div>
<p>Now for the actual ant file. This is specific to a GWT application, but you can easily knock out the google bits and use the rest without any changes.</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;ClaimsManager&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;compile&quot;</span> <span style="color: #000066;">basedir</span>=<span style="color: #ff0000;">&quot;.&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <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;TALK&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- Define the environment property variable --&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">environment</span>=<span style="color: #ff0000;">&quot;env&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- Define where our properties are located --&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;build.properties&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ClaimsManager build file. &nbsp;This is used to package up your project as a jar,<br />
&nbsp; &nbsp; &nbsp; &nbsp; if you want to distribute it. &nbsp;This isn't needed for normal operation.<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>&nbsp; <br />
<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- set classpath --&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;classpath&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${sourcedir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${servlet.api.jar}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${gwt.servlet.jar}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${asm.jar}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${postgresql.driver.jar}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${loglib.jar}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${includedir}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;*.jar&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${spring.dir}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;*.jar&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;gwt.compile.class.path&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${sourcedir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${testdir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;${gwt.user.jar}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;${gwt.dev.jar}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;${wwwdir}/WEB-INF/classes/com/petermac/claimsmanager/server/service&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;test.classpath&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${junit.jar}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${gwt.user.jar}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pathelement</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;${targetdir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${includedir}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;*.jar&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${spring.dir}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;*.jar&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <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;init&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Initialize the build environment&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fail</span> <span style="color: #000066;">unless</span>=<span style="color: #ff0000;">&quot;app&quot;</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;Run ant -Dapp=[applicationName]&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- Create the time stamp --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tstamp</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;Building on ${TODAY} at ${TSTAMP}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- Create directory structures --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${targetdir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${reportsdir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${reportsdir}/raw/&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${reportsdir}/html/&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; <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;">depends</span>=<span style="color: #ff0000;">&quot;clean, init, copy-support&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Compile server side java code&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;javac</span> <span style="color: #000066;">srcdir</span>=<span style="color: #ff0000;">&quot;${sourcedir}&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">destdir</span>=<span style="color: #ff0000;">&quot;${wwwdir}/WEB-INF/classes&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">debug</span>=<span style="color: #ff0000;">&quot;true&quot;</span> </span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">debuglevel</span>=<span style="color: #ff0000;">&quot;lines,vars,source&quot;</span> </span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">source</span>=<span style="color: #ff0000;">&quot;1.6&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">excludes</span>=<span style="color: #ff0000;">&quot;**/client/*.java,**/*.xml&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classpath</span> <span style="color: #000066;">refid</span>=<span style="color: #ff0000;">&quot;classpath&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;compilerarg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-Xlint&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/javac<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- copy www class files to bin folder --&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${targetdir}&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${wwwdir}/WEB-INF/classes/com/petermac/claimsmanager/client&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;*.class&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/copy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${targetdir}&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${wwwdir}/WEB-INF/classes/com/petermac/claimsmanager/server/service&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;*.class&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/copy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; <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;gwt-compile&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;init&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Execute the GWT compiler on client-side code&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- Invoke the GWT compiler --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;java</span> <span style="color: #000066;">classpathref</span>=<span style="color: #ff0000;">&quot;gwt.compile.class.path&quot;</span> <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;com.google.gwt.dev.GWTCompiler&quot;</span> <span style="color: #000066;">fork</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-out&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${gwt.output}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;com.petermac.claimsmanager.${app}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/java<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <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;clean&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;clean-compile-test&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Cleans build system by removing directories created during build&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${targetdir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${targetdir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${reportsdir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${wwwdir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; <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;prepare-www-dir&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;init&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Copy files to ${wwwdir} directory&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>&nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${wwwdir}/WEB-INF/classes&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${wwwdir}/WEB-INF/lib&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- copy all public files to $wwwdir --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${wwwdir}&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${sourcedir}/com/petermac/${app}/public&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/copy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- copy the gwt servlet JAR to /WEB-INF/lib --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${wwwdir}/WEB-INF/lib&quot;</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${gwt.servlet.jar}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- copy web.xml to /WEB-INF --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${wwwdir}/WEB-INF/lib&quot;</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${gwt.servlet.jar}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- copy the web.xml deployment descritpor --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${wwwdir}/WEB-INF/&quot;</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${sourcedir}/web.xml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span> <br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- Copy relevant hibernate and spring files --&gt;</span><br />
&nbsp; &nbsp; <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;copy-support&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;prepare-www-dir&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Copy hibernate/spring support files&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${wwwdir}/WEB-INF/lib&quot;</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${postgresql.driver.jar}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${wwwdir}/WEB-INF/lib&quot;</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${hibernate3.jar}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- copy over the bulk of support jars --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${wwwdir}/WEB-INF/lib&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${hibernate.dir}/&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;*.jar&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/copy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${wwwdir}/WEB-INF/lib&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${spring.dir}/&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;*.jar&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/copy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- copy the hibernate and spring config files --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${wwwdir}/WEB-INF/classes&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${spring.conf.dir}/&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;*.xml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/copy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${wwwdir}/WEB-INF/classes&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${hibernate.conf.dir}/&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;*.xml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/copy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <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;deploy&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;compile,gwt-compile&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Deploy the application&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;war</span> <span style="color: #000066;">destfile</span>=<span style="color: #ff0000;">&quot;${app}.war&quot;</span> <span style="color: #000066;">webxml</span>=<span style="color: #ff0000;">&quot;${wwwdir}/WEB-INF/web.xml&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${wwwdir}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classes</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${wwwdir}/WEB-INF/classes&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;lib</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${wwwdir}/WEB-INF/lib&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/war<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- ////////////////////////// Test related targets /////////////////////////////////--&gt;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <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;clean-compile-test&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Cleans the classes deployed used during unit tests&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">verbose</span>=<span style="color: #ff0000;">&quot;${TALK}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${testdir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;**/*.class&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/delete<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; <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-tests&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Compile unit tests&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;javac</span> <span style="color: #000066;">srcdir</span>=<span style="color: #ff0000;">&quot;${testdir}&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">destdir</span>=<span style="color: #ff0000;">&quot;${targetdir}&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">verbose</span>=<span style="color: #ff0000;">&quot;${TALK}&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">classpathref</span>=<span style="color: #ff0000;">&quot;test.classpath&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/javac<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <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;run-tests&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;compile-tests&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Compiles and runs unit tests&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;junit</span> <span style="color: #000066;">printsummary</span>=<span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #000066;">haltonfailure</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">showoutput</span>=<span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classpath</span> <span style="color: #000066;">refid</span>=<span style="color: #ff0000;">&quot;classpath&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classpath</span> <span style="color: #000066;">refid</span>=<span style="color: #ff0000;">&quot;test.classpath&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;batchtest</span> <span style="color: #000066;">fork</span>=<span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${reportsdir}/raw/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <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;xml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${testdir}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;**/AllTests.java&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/batchtest<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/junit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; <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;">depends</span>=<span style="color: #ff0000;">&quot;run-tests&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Comiles tests, runs them and generates test results in report format&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;junitreport</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${reportsdir}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${reportsdir}/raw/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;TEST-*.xml&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;report</span> <span style="color: #000066;">format</span>=<span style="color: #ff0000;">&quot;frames&quot;</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;${reportsdir}\html\&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/junitreport<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- end test related --&gt;</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!--</span><br />
<span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &lt;target name=&quot;package&quot; depends=&quot;compile&quot; description=&quot;Package up the project as a jar&quot;&gt;</span><br />
<span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;jar destfile=&quot;ClaimsManager.jar&quot;&gt;</span><br />
<span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;fileset dir=&quot;bin&quot;&gt;</span><br />
<span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;include name=&quot;**/*.class&quot;/&gt;</span><br />
<span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/fileset&gt;</span><br />
<span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;fileset dir=&quot;src&quot;&gt;</span><br />
<span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;include name=&quot;**&quot;/&gt;</span><br />
<span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/fileset&gt;</span><br />
<span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;fileset dir=&quot;test&quot;&gt;</span><br />
<span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;include name=&quot;**&quot;/&gt;</span><br />
<span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/fileset&gt;</span><br />
<span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/jar&gt;</span><br />
<span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &lt;/target&gt;</span><br />
<span style="color: #808080; font-style: italic;">&nbsp; &nbsp; --&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!--</span><br />
<span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &lt;target name=&quot;all&quot; depends=&quot;package&quot;/&gt;</span><br />
<span style="color: #808080; font-style: italic;">&nbsp; &nbsp; --&gt;</span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>Feel free to suggest any ways to make this simpler and more automated.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.petermac.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.petermac.com/javahibernate-ant-build-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving from Subversion to Git</title>
		<link>http://www.petermac.com/moving-from-subversion-to-git/</link>
		<comments>http://www.petermac.com/moving-from-subversion-to-git/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 03:47:22 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.petermac.com/?p=239</guid>
		<description><![CDATA[I have been using subversion for a number of years and it wasn&#8217;t until I had seen and sampled the simplicity and power of git that I decided once and for all to bite the bullet and migrate all my subversion repositories to git. I&#8217;d done the same from cvs to subversion in the early [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using subversion for a number of years and it wasn&#8217;t until I had seen and sampled the simplicity and power of git that I decided once and for all to bite the bullet and migrate all my subversion repositories to git.</p>
<p>I&#8217;d done the same from cvs to subversion in the early 2000&#8242;s and still think the move worked out well with a bit of preparation.</p>
<p>An unfortunate side effect of subversion is that it takes a good bit of effort to set up and manage a new repository so I ended up with two somewhat monolithic repositories&#8230;</p>
<p>1. archives<br />
2. projects</p>
<p>The &#8216;archives &#8216; repository contained all old project work and the &#8216;projects&#8217; one contained relevant or current project work.</p>
<p>The result of this was that each archive had a bundle of sub-folders, each containing a project in its&#8217; own right. Although git can handle the concept of sub-modules it&#8217;s not the best way to structure your project. In fact, it was a pretty lazy to structure my subversion projects in the first place but convenience overcame system administrative chores at the time.</p>
<p>This article explains the following:</p>
<p>1. Converting a monolithic subversion repository to a git repository<br />
2. Breaking out the new git repository into a set of discrete repositories.<br />
3. General backup process and scripts to copy the new repositories across to a backup system.</p>
<p>First off, a couple of conventions I keep are&#8230;</p>
<p>My server stores a central set of repositories with the name of myproject.git<br />
My workstations work with their local version of repositories called myproject (no .git)<br />
My server exports it&#8217;s .git repositories to a backup server using the same .git naming convention.<br />
I have created a git.git user.group on my server to run all git processes. File ownership is given to this user so other users can&#8217;t fowl things up at least without thinking about it first.</p>
<p><strong>Step 1 &#8211; Migrating to subversion</strong></p>
<p>I store all my git repositories on a server in the directory</p>
<p>/usr/local/share/gitrepos</p>
<p>All of my subversion repositories are stored in</p>
<p>/usr/local/share/svn</p>
<p>Even though each folder is accessible using standard paths and commands, I have to go through the subversion door using the same mechanism I would access it from a remote box, namely http://.  Other people may use svn:// if that&#8217;s their way of working.</p>
<p>Migration is taken care of with a single command.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">git</span> <span style="color: #c20cb9; font-weight: bold;">svn</span> clone https:<span style="color: #000000; font-weight: bold;">//</span>localhost<span style="color: #000000; font-weight: bold;">/</span>repository<span style="color: #000000; font-weight: bold;">/</span>projects <span style="color: #660033;">--stdlayout</span> <span style="color: #660033;">--authors-file</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>peter<span style="color: #000000; font-weight: bold;">/</span>authors.txt <span style="color: #660033;">-t</span> tags <span style="color: #660033;">-b</span> branches <span style="color: #660033;">-T</span> trunk <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>gitrepos<span style="color: #000000; font-weight: bold;">/</span>projects.git<span style="color: #000000; font-weight: bold;">/</span></div></div>
<p>An explanation of all the bits follow:</p>
<p><strong>sudo</strong> &#8211; because I run everything as unprivileged user, sudo gives me the rights i need to create new files and folders.</p>
<p><strong>git svn</strong> &#8211; this is the git subcommand that manages conversion of subversion repositories.</p>
<p><strong>clone</strong> &#8211; make a copy of the repositories that I&#8217;m pointing at.</p>
<p><strong>https://localhost/repository/projects</strong> &#8211; I access all my subversion repositories using secure http. This allows me to securely browse the content across the Internet and track things easily using Trac.</p>
<p>Depending on your setup, this parameter will contain the path to your svn repository,however you access it.</p>
<p><strong>&#8211;stdlayout</strong> option tells git svn that my subversion repository is in the standard layout of trunk/branch/tags directories.</p>
<p><strong>&#8211;authors file</strong> &#8211; this is a file I created by hand containing a list of all the people who committed project material in the past. It&#8217;d format is as follows:</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">peter</span>= Peter Mac Giollafhearga <span style="color: #000000; font-weight: bold;">&lt;</span>my email at mydomain.com<span style="color: #000000; font-weight: bold;">&gt;</span><br />
<span style="color: #007800;">simon</span>= Simon Shagwell <span style="color: #000000; font-weight: bold;">&lt;</span>simon<span style="color: #000000; font-weight: bold;">\'</span>s email at his domain.com<span style="color: #000000; font-weight: bold;">&gt;</span></div></div>
<p><strong>-t tags -b branches -T trunk</strong> &#8211; these values are for completeness and I&#8217;m not sure they are necessary given the &#8211;stdlayout option, but if you&#8217;ve called your branches, tags and trunks anything different, this is how you find it.</p>
<p>Once the command has completed you should find a projects.git folder has been created and navigating into it you will see all your nasty subversion sub-folders which you should have set up as individual repositories in the first place&#8230;tut tut!</p>
<p><strong>Step 2 &#8211; Breaking out Git into baby gits</strong></p>
<p>The structure of the new git repository is something like this.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gitrepository<span style="color: #000000; font-weight: bold;">/</span><br />
&nbsp; projects.git<span style="color: #000000; font-weight: bold;">/</span><br />
&nbsp; &nbsp; project1<span style="color: #000000; font-weight: bold;">/</span><br />
&nbsp; &nbsp; WorldDomination<span style="color: #000000; font-weight: bold;">/</span><br />
&nbsp; &nbsp; SomeStuff<span style="color: #000000; font-weight: bold;">/</span><br />
&nbsp; &nbsp; SomeotherStuff_V2<span style="color: #000000; font-weight: bold;">/</span><br />
&nbsp; &nbsp; Demos<span style="color: #000000; font-weight: bold;">/</span><br />
&nbsp; &nbsp; Downloads<span style="color: #000000; font-weight: bold;">/</span><br />
&nbsp; &nbsp; .git<span style="color: #000000; font-weight: bold;">/</span></div></div>
<p>The .git folder (you cans see it using ls -a) contains a list of all the git related material such as project history, revisions and tags.<br />
Check you can see your history by typing</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">git</span> log</div></div>
<p>The next task is to break the contents of the rather large &#8216;project&#8217; folder into a git repository per project.<br />
The tool for the job is a combination of the very useful git subtree command and a bit of custom shell scripting specific to this job.</p>
<p>The subtree functionality was written by Avery Pennarun and is hosted by the github site. You can download the git subtree command from the URL <a href="http://github.com/apenwarr/git-subtree" target="blank">http://github.com/apenwarr/git-subtree</a>. Installation instructions are on the same site so I won&#8217;t bore you with it here.</p>
<p>Once you have it installed you&#8217;re almost ready to roll. The following shell script has comments at the top to explain what it does. Save this to your favourite scripts folder and chmod it so it&#8217;s executable (chmod +x git_breakout.sh).</p>
<p>Then cd into the folder you created earlier (in my case /usr/local/share/gitrepository/projects). Run the script and watch the output. Depending on the size of your projects it will take a bit of time to complete; mine took about 20 minutes.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/sh</span><br />
<br />
<span style="color: #666666; font-style: italic;">#git_breakout.sh</span><br />
<span style="color: #666666; font-style: italic;">#This script should be run from within a git repository folder that</span><br />
<span style="color: #666666; font-style: italic;">#contains many child folders.</span><br />
<span style="color: #666666; font-style: italic;">#It will create a branch for every subfolder it finds and a new</span><br />
<span style="color: #666666; font-style: italic;">#top level folder for each.</span><br />
<span style="color: #666666; font-style: italic;">#It then initialises a git respoitory, copying into the relevant branch</span><br />
<br />
<span style="color: #666666; font-style: italic;"># Make sure only root can run our script</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$(id -u)</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;This script must be run as root&quot;</span> <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">2</span><br />
&nbsp; <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span><br />
<span style="color: #000000; font-weight: bold;">fi</span><br />
<br />
<span style="color: #007800;">current_dir</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${PWD##*/}</span><span style="color: #000000; font-weight: bold;">`</span><br />
<span style="color: #007800;">git_user</span>=<span style="color: #c20cb9; font-weight: bold;">git</span><br />
<span style="color: #007800;">git_group</span>=<span style="color: #c20cb9; font-weight: bold;">git</span><br />
<br />
<span style="color: #000000; font-weight: bold;">for</span> project <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #c20cb9; font-weight: bold;">ls</span> . <span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">do</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$project</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; <span style="color: #007800;">project_lower</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$project</span>.git <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>A-Z<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>a-z<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">`</span><br />
&nbsp; &nbsp; <span style="color: #007800;">branchname</span>=<span style="color: #007800;">$project_lower</span>.<span style="color: #ff0000;">&quot;export&quot;</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;performing subtree split...&quot;</span><br />
&nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">git</span> subtree <span style="color: #c20cb9; font-weight: bold;">split</span> <span style="color: #660033;">-P</span> <span style="color: #007800;">$project</span> <span style="color: #660033;">-b</span> <span style="color: #007800;">$branchname</span><br />
&nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">mkdir</span> ..<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$project_lower</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">cd</span> ..<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$project_lower</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;initialising git&quot;</span><br />
&nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">git</span> init<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;fetching branch&quot;</span><br />
&nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">git</span> fetch ..<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$current_dir</span> <span style="color: #007800;">$branchname</span><br />
&nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">git</span> checkout <span style="color: #660033;">-b</span> master FETCH_HEAD <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">cd</span> ..<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;setting appropriate ownership&quot;</span><br />
&nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #007800;">$git_user</span>.<span style="color: #007800;">$git_group</span> <span style="color: #660033;">-R</span> <span style="color: #007800;">$project_lower</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$current_dir</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">fi</span><br />
<span style="color: #000000; font-weight: bold;">done</span></div></div>
<p>Once the script has completed, you should be able to see a new directory structure, something along the following lines.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gitrepository<span style="color: #000000; font-weight: bold;">/</span><br />
&nbsp; projects.git<span style="color: #000000; font-weight: bold;">/</span><br />
&nbsp; project1.git<br />
&nbsp; worlddomination.git<span style="color: #000000; font-weight: bold;">/</span><br />
&nbsp; somestuff.git<span style="color: #000000; font-weight: bold;">/</span><br />
&nbsp; someotherstuff_v2.git<span style="color: #000000; font-weight: bold;">/</span><br />
&nbsp; demos.git<span style="color: #000000; font-weight: bold;">/</span><br />
&nbsp; downloads.git<span style="color: #000000; font-weight: bold;">/</span></div></div>
<p>Each folder is now its&#8217; own git repository with it&#8217;s own internal version history, tags, branches etc.<br />
cd into one of the folders and do a git log just to confirm you still have history.</p>
<p>The original projects.git can be removed (after backing it up for safety&#8217;s sake) if you&#8217;re satisfied everything is in place. We&#8217;re now ready to proceed with the next stage of the game, namely backing up our new git repositories to a remote share.</p>
<p><strong>Step 3 &#8211; Backing up Git</strong></p>
<p>I use a 2TB removable disk as a central data server for sharing files throughout my network. My thinking is that should the place ever burn down and I have the opportunity, there&#8217;s only one box I need to grab before rushing out the door. Of course, I burn frequent snapshots of this box to DVD.</p>
<p>I have created a &#8216;backups&#8217; share on the disk which I map to my physical server using NFS.</p>
<p>The entry in my /etc/fstab file is something like this.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">192.168.0.20:<span style="color: #000000; font-weight: bold;">/</span>DataVolume<span style="color: #000000; font-weight: bold;">/</span>backups &nbsp;<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>backups &nbsp;nfs defaults&nbsp; &nbsp; <span style="color: #000000;">0</span> <span style="color: #000000;">0</span></div></div>
<p>This means I can read/write to my backups folder as if it was a local folder on a local disk.</p>
<p>The job at hand is to be able to backup my git repositories using a cron task scheduled to run when everything is nice and quiet. Below is the script I use to run my git backups.</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/bash</span><br />
<span style="color: #666666; font-style: italic;"># git_backup.sh</span><br />
<span style="color: #666666; font-style: italic;"># Backup git repositories to another folder</span><br />
&nbsp;<br />
<span style="color: #666666; font-style: italic;"># Make sure only root can run our script</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$(id -u)</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;This script must be run as root&quot;</span> <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">2</span><br />
&nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span><br />
<span style="color: #000000; font-weight: bold;">fi</span><br />
<br />
<span style="color: #007800;">git_command</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span><br />
<span style="color: #666666; font-style: italic;">#Where they're going to be backed up</span><br />
<span style="color: #007800;">backup_dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>backups<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span><br />
<span style="color: #666666; font-style: italic;">#Location of current live repositories</span><br />
<span style="color: #007800;">repository_dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>gitrepos<br />
<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$repository_dir</span><br />
<span style="color: #000000; font-weight: bold;">for</span> project <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #c20cb9; font-weight: bold;">ls</span> . <span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">do</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$project</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; <span style="color: #007800;">destination</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$backup_dir</span>/<span style="color: #007800;">$project</span>&quot;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$destination</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$destination</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;pulling <span style="color: #007800;">$project</span>...&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #007800;">$git_command</span> pull<br />
&nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;done.&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$repository_dir</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">else</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;mkdir <span style="color: #007800;">$destination</span>&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #007800;">$destination</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$repository_dir</span>/<span style="color: #007800;">$project</span>&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;cloning <span style="color: #007800;">$project</span>...&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #007800;">$git_command</span> clone <span style="color: #660033;">-v</span> <span style="color: #660033;">-l</span> <span style="color: #660033;">--no-hardlinks</span> . <span style="color: #007800;">$destination</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">cd</span> ..<br />
&nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;done.&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">fi</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">fi</span><br />
<span style="color: #000000; font-weight: bold;">done</span></div></div>
<p>Once this script is run, you &#8216;ll have a copy of all your repositories in the backup folder. The next time it&#8217;s run should only take a fraction of the time as it won&#8217;t have to reestablish the git repository again. </p>
<p>So there you have it, migrating a subversion repository to git is really simple, the fun starts when you try to play with the results. I hope this has been helpful to others faced with the same job. Any improvements please let me know.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.petermac.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.petermac.com/moving-from-subversion-to-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Designing Enterprise Software</title>
		<link>http://www.petermac.com/designing-enterprise-software/</link>
		<comments>http://www.petermac.com/designing-enterprise-software/#comments</comments>
		<pubDate>Mon, 30 Jul 2007 20:36:57 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.petermac.com/?p=22</guid>
		<description><![CDATA[I&#8217;ve just finished reading a little gem of a book. It&#8217;s called &#8216;The Martian Principles for Successful Enterprise Systems&#8217; with a subtitle of &#8217;20 Lessons Learned from NASA&#8217;s Mars Exploration Rover Mission&#8217;. The author is Ronald Mak. Imagine designing an information retrieval, indexing and presentation system for the two Mars rover vehicles that were sent [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just finished reading a little gem of a book. It&#8217;s called &#8216;<strong><em><a onmouseover="mouseOver(this)" onmouseout="mouseOut(this)" href="http://www.amazon.com/exec/obidos/redirect?link_code=as2&amp;path=ASIN/0471789658&amp;tag=aproposlogic-20&amp;camp=1789&amp;creative=9325" target="_blank"><strong><em>The Martian Principles for 								Successful Enterprise Systems&#8217;</em></strong></a></em></strong> with a subtitle of  &#8217;20 Lessons Learned from NASA&#8217;s Mars 		Exploration Rover Mission&#8217;. The author is Ronald Mak.</p>
<p>Imagine designing an information retrieval, indexing and presentation system for the two Mars rover vehicles that were sent on a one-way reconnaissance mission to Mars for a three month mission. The feisty little vehicles kept going for two years and the information systems had to be designed to cope with this unexpected project over-run.</p>
<p>The book runs to 168 pages and is a &#8216;should-read&#8217; for anybody involved in designing or buying large-scale enterprise software.  From an architect&#8217;s perspective, you get a reinforced mental checklist of the aspects of your designs that make them work and ensure they keep working long after you&#8217;ve moved on. From a customer&#8217;s perspective, you gain an appreciation of the effort put into designing such systems. From a developer&#8217;s perspective, now you know why you spend so much time writing and executing unit tests.</p>
<p>The book has short and well directed chapters and is an easy read with coverage of both the technical side of software development and the soft or human side.</p>
<p>As a result of this read, I went back to enhance some application logging classes that I&#8217;ve used on a number of projects to provide more granular output and statistics on usage patterns.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.petermac.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.petermac.com/designing-enterprise-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working with the .Net Compact Framework</title>
		<link>http://www.petermac.com/working-with-the-net-compact-framework/</link>
		<comments>http://www.petermac.com/working-with-the-net-compact-framework/#comments</comments>
		<pubDate>Thu, 09 Nov 2006 05:41:29 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[dotnet]]></category>

		<guid isPermaLink="false">http://www.petermac.com/?p=17</guid>
		<description><![CDATA[The attached files contain binaries and source code for a .Net Compact Framework application we built to enable the input of petrol consumption details and the subsequent downloading of that information to a desktop application. It was written in C# under a Visual Studio 2005 project and makes use of a set of libraries provided [...]]]></description>
			<content:encoded><![CDATA[<p>The attached files contain binaries and source code for a .Net Compact Framework application we built to enable the input of petrol consumption details and the subsequent downloading of that information to a desktop application. It was written in C# under a Visual Studio 2005 project and makes use of a set of libraries provided by <a href="http://www.opennetcf.org/home.ocf">OpenNETCF Consulting</a>.</p>
<p>To develop the application you will need to download the Smart Device Framework libraries from OPenNETCF and add a reference to them in your project. I have included a feature that allows you to dynamically upload all necessary components to your mobile device. This is a cool feature enabled using a .Net custom installer application.</p>
<p>Feel free to download and modify the application to suit your fancy.</p>
<p><a id="p16" href="http://www.petermac.com/wp-content/uploads/2006/11/fuelmonitor-110-src.zip">Fuel Monitor 1.1.0 Source Files</a></p>
<p><a id="p15" href="http://www.petermac.com/wp-content/uploads/2006/11/fuelmonitor-110-bin.zip">Fuel Monitor 1.1.0 Binaries</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.petermac.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.petermac.com/working-with-the-net-compact-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validating your PHP Input</title>
		<link>http://www.petermac.com/validating-your-php-input/</link>
		<comments>http://www.petermac.com/validating-your-php-input/#comments</comments>
		<pubDate>Tue, 10 Oct 2006 10:06:37 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.petermac.com/?p=12</guid>
		<description><![CDATA[In this world of bad guys and hackers and crackers, us developers have to be on our guard against all sorts of stuff that tries to break our websites. Validating input using JavaScript alone is not sufficient to gurad against the baddies as it can be worked around by building their own custom forms to [...]]]></description>
			<content:encoded><![CDATA[<p>In this world of bad guys and hackers and crackers, us developers have to be on our guard against all sorts of stuff that tries to break our websites.  Validating input using JavaScript alone is not sufficient to gurad against the baddies as it can be worked around by building their own custom forms to interact with your site and/or disabling JavaScript.</p>
<p class="western">What this means is that every piece of data you accept from a user should be validated against a set of rules for that datatype.</p>
<p class="western">Some general validation rules</p>
<p class="western">If it&#8217;s a text string, does it contain any less than or greater than brackets?</p>
<p class="western">If it&#8217;s a date, are it&#8217;s day, monthy, year parts valid numbers?</p>
<p class="western">If it&#8217;s a credit card number, is there an online number validation algorithm you can use to verify it?</p>
<p class="western"><strong>Regular Expressions in PHP</strong></p>
<p class="western">In order to validate your user-input, you&#8217;ll generally find yourself resorting to regular expressions. In PHP there are two options.<strong>ereg</strong> and <strong>preg</strong>. ereg is older, less sophisticated and somewhat slower than it&#8217;s younger brother. My preference is to use the preg options even though they&#8217;re a little more complicated, the end results is betterer(sic).</p>
<p class="western">An example of using preg to validate a date:</p>
<div class="code">$month = $_GET['cardmonth'];<br />
$year = $_GET['cardyear'];<br />
if (!preg_match(&#8220;/^[0-9]{1,2}$/&#8221;, $month)) die(&#8220;Invalid month, please re-enter.&#8221;);<br />
if (!preg_match(&#8220;/^[0-9]{4}$/&#8221;, $year)) die(&#8220;Invalid year, please re-enter.&#8221;);</div>
<p class="western">An online manual is available from the main php website at <a href="http://www.php.net/manual/en/ref.pcre.php">http://www.php.net/manual/en/ref.pcre.php</a></p>
<p class="western">And some lessons explicitly on how to use the preg function is available here <a href="http://www.php.net/manual/en/function.preg-match.php">http://www.php.net/manual/en/function.preg-match.php</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.petermac.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.petermac.com/validating-your-php-input/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using magic_quotes_gpc or addslashes()</title>
		<link>http://www.petermac.com/using-magic_quotes_gpc-or-addslashes/</link>
		<comments>http://www.petermac.com/using-magic_quotes_gpc-or-addslashes/#comments</comments>
		<pubDate>Tue, 10 Oct 2006 09:18:25 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.petermac.com/?p=11</guid>
		<description><![CDATA[I&#8217;ve worked on a bundle of web based applications over the years and time and time again I&#8217;ve seen the recurring problem of the slash. Yes, we&#8217;ve probably all seen it in one or more forums where the apostrophe some user entered, probably with the name O&#8217;Brein ends up as O\\Brein. Why does this happen [...]]]></description>
			<content:encoded><![CDATA[<p class="western">I&#8217;ve worked on a bundle of web based applications over the years and time and time again I&#8217;ve seen the recurring problem of the slash.  Yes, we&#8217;ve probably all seen it in one or more forums where the apostrophe some user entered, probably with the name O&#8217;Brein ends up as O\\Brein.</p>
<p class="western">Why does this happen in sites running on PHP?  The answer is a duplication of escapes. Yep, a Houdini Supreme.</p>
<p class="western">Firstly a systems administrator has installed PHP and set the value for magic_quotes_gpc = on in the system&#8217;s php.ini (usually located in /etc/).  This will automatically add slashes to all GET/POST/COOKIE data. This makes it safe before writing it to a database. Mr O&#8217;Brein becomes Mr O\\&#8217;Brein when magic_quotes_gpc is set to on.</p>
<p class="western">Secondly, a programmer has come along and thinking they&#8217;re doing the right thing takes all user input and uses the addslashes() funtion to escape all quotes. This results in a doubling of the escapes so, Mr O&#8217;\\Brien now becomes MR O\\\\&#8217;Brein.</p>
<p class="western">When this data is rendered, we see the automatic removal of only one set of escapes but the other set is left behind&#8230;yuck!!</p>
<p class="western">
<p class="western">When programmers see this they think&#8230;”I&#8217;ll just use the stripslashes() method, I mean, that&#8217;s what it&#8217;s there for”.  As the light from the idea bulb fades, they realise they&#8217;re fixing a problem that should never have occurred in the first place. You need to go to the source of your data and clean it up, make sure you&#8217;re either using magic_quotes_gpc=on OR addslashes.  My preference is to use addslashes all the time and turn  magic_quotes_gpc off, this way the logic of your code explicitly sets user input to be what you want.</p>
<p class="western">
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.petermac.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.petermac.com/using-magic_quotes_gpc-or-addslashes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
