Thursday 7 May 2009

CI Updated

I now have all of our projects in CCNET, and am using this to control the port of code to Delphi 2009. I am also moving code around, so this helps. I had to patch a few things, but I have DUnit outputing xml that is then picked up by CCNET and displayed graphically (this is cool).

I have also taken the Cyclometric Complexity tool that I use and created a command-line version (this used the OTA interface before), which also outputs to XML. I'll then plug this into the projects and this will allow us to automatically measure complexity!

Thursday 16 April 2009

Getting testing working

OK, so I have the source checked out, and then I have built it. I even have a test application, that outputs XML. However, we have a graphical login. So I need to be able to pass in the signon somehow. OK, so I need to think a bit more about this.

Tuesday 7 April 2009

Cruisecontrol.net howto (draft)

This is a draft of what I had to do to get CruiseControl.Net and Delphi to play nicely - I will fill out the details later!

1. Install Apache 2.
2. Install Mod_ASPDotNet.
3. Install CruiseControl.Net.
4. Install CCTray.
5. Create a project to test.
7. Setup connection to Seapine Surround.
8. Setup the MSBuild section to build the application.
9. Modify the DUnit tests to output XML.

This I did using the entry above, and changed the base UnitTest program code to look like this:

var
res : TTestResult;

...

if IsConsole then
if ParamCount <> 0 then
if (copy(ParamStr(1), 0, 5) = '/xml=') then
res := XMLTestRunner.RunRegisteredTests(copy(ParamStr(1), 6, length(ParamStr(1)) -5))
else
res := TextTestRunner.RunRegisteredTests
else
res := TextTestRunner.RunRegisteredTests
else
GUITestRunner.RunRegisteredTests;

if (res.ErrorCount <> 0) then
halt (1);



More later!

Monday 6 April 2009

CI Update

Well, after much messing about I now have CI working for Delphi. It checks out the code from Surround (easy to configure), calls MSBuild (again easy), and this then compiles the Delphi source (tricky and required me to mess about and reinstall CruiseControl.NET). It now checks out 5 projects (3 of which compile, 1 fails due to a missed file, and 1 needs an project to be registered), which is about what I expected.

Hurrah!

Saturday 4 April 2009

Cruisecontrol.net update

Well, I have CCNet working and trying to build (but failing) Delphi 2009 code, using MSBuild, good news I found out what was wrong, the bad news was I had to hack the CC.NET source to get this to work.

The cause of the problems was that Delphi 2009 uses the brcc32.exe to build its resources, which is obviously fine, but when the code is downloaded from Surround, it is read-only, so it create lots of .tmp files, all of which are read-only and so can't be written to. I downloaded the CC.NET source and changed the command line that is passed to Surround to checkout the code as read-write, and now the code compilation gets passed this.

However, I am now stuck with MSBuild working from the command line, but not when run from CC.NET. Ho hum, I'm sure I can figure this out as well. Nothing is ever easy!

Wednesday 1 April 2009

CI with Delphi

I am trying to get CruiseControl.NET to connect to a Surround SCM system and then check out and build (and then test if possible) projects.

It was simple to install, but it needs as ASP.NET server to work (or so it seems). I've installed Apache and the mod_asp (or whatever it is called), and have got a simple ASP script to work, but can't get the CC.NET dashboard application to run.

More news as it breaks.

Update 1

I now have access to the CC.NET dashboard working. I can't get the command line that CC.NET builds to be correct, the settings seem OK, but I get the following ...

Process command: E:\Program Files\Seapine\Surround SCM\sscm.exe cc * -d20090401153253:20090401153326 -r -bXXXX -p"XXXXXX" -x- -zABCABCDABCDEF:4900 -y"XXX:XXX"


Update 2

Fixed the file locations, and started up the VPN, and now CruiseControl downloads the latest source, and tries to rebuild - the MSBuild process now gives the following error:


E:\Documents\Mark\CCBuildDir\SSCMClone\D2009\XXXX\XXXX\XXXXX.dproj (,):

errorMSB4057: The target "Rebuild" does not exist in the project.


So we are getting much closer, and this might be working before I go back to work

Continuous Integration and Delphi

Continuous Integration and Delphi using CruiseControl

Sunday 11 January 2009

Actually implemented

I have started to build a proof of concept that actually implments code that does stuff, so can't actually post that code here, but basically it follows the same structures, with a command being sent via the Controller, and then being run across the model (and hence the data). The notification of errors is done by the Notify mechanism, with whatever view knowing what to do with the errors statuses returned for each possible input.

Once a change to client, stock, buy/sell, etc has been entered, then at the the moment the Notify mechanism is directly fired, but what should happen is that the whole order should be validated at this point, allowing for cascadimg errors to be flagged.

We will see on monday!

Tuesday 6 January 2009

MVC updated

I have had a small rest over Christmas and have decided that the code below needs to be refactored. I broke down all of the interfaces and implementations of them into different units, and begun to separate out the stuff that is MVC and stuff which used by the model.

Specifically I broke down the command stuff and implemented descendants of TCommand that know what to do to the model - i.e. the model doesn't do anything other than respond to the data changes (or not as is the current state).

This means I have ended up with code like this ..

TCalculateCommand = class (TCommand)
procedure Run (model : tObject); override;
end;
..

{ TCalculateCommand }

procedure TCalculateCommand.Run (model : tObject);
begin
(model as TDomainModel).Data.Price := self.Params[0].Value;
(model as TDomainModel).Data.Consideration := ((model as TDomainModel).Data.Size *
(model as TDomainModel).Data.Price) + (model as TDomainModel).Data.Charges;
end;


This is a lot simpler in my view.

However it doesn't solve the problem with how to indicate that a field is invalid?

I might have to register each control with the model, so it knows which fields map to each control. That sounds like a lot to faff, but I don't know how else to do it.