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.

Friday, 7 November 2008

MVC Update

In the real world, which I obviously can't post here, I have a problem where the result of the validation request does three things;

1) Validates the input values
2) Returns other information based on the inputs (i.e. Other client, stock details)
3) Set whether a specific field input is valid or not.

Sunday, 2 November 2008

More MVC!

A client search from would look like this ..


type
TForm3 = class(TForm, IObserver)
Button1: TButton;
Edit1: TEdit;
ListBox1: TListBox;
Button2: TButton;
Button3: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure UpdateView (obj : TObject);
end;

...

procedure TForm3.Button1Click(Sender: TObject);
var
c : TCommand;
o : TCommandParam;

begin
c := TCommand.Create ('SEARCH');

o := TCommandParam.Create;
o.Name := edit1.Text;

c.AddParam(o);

Controller.DoCommand(c);
end;

procedure TForm3.Button2Click(Sender: TObject);
begin
ModalResult := mrOK;
end;

procedure TForm3.Button3Click(Sender: TObject);
begin
ModalResult := mrCancel;
end;

procedure TForm3.FormCreate(Sender: TObject);
begin
Controller.AddView (self);
end;

procedure TForm3.UpdateView (obj : TObject);
var
val : String;

begin
// Update the view here
if ((obj as TDomainModel).ClientSearchResult <> nil) then
begin
for val in (obj as TDomainModel).ClientSearchResult do
begin
ListBox1.AddItem(val, nil);
end;
end;
end;



I have merge the View classes with the actual form, in order to make the code relationships a little clearer.

I'm really happy with all of the, and I think it will be applicable for the requirements I have at work.