# Wednesday, August 12, 2009

So I decided to take the Horn project for a test drive after repaving a number of machines to Windows 7 RTM and waiting for things to install.

After Horn’s initial announcement this year I was excited, but it didn’t really do anything at that stage (and I didn’t have enough time to assist with the dev work / patches)... so I put it on the back burner.  But I found myself need to rebuild Rhino Tools, Castle and NHibernate today from trunk and thought I would give it a try.

At any rate, this is a post covering my “noob” observations as I walk through building horn, and then using horn to build Rhino Tools.

Background

As a little background, Horn was started by the Scotland ALT.Net group, it was kicked off on the scotaltdotnet google code project, and later moved to the hornget project, also on google code. The projects Initial mission statement is to “take control of building a common set of open source packages that are probably similar to many in the ALT.NET space” which I think it’s coming close to realising, but they also have a grander vision of “providing a standard mechanism for easy installation of .Net Packages” – something I definitely think .Net needs, and that dynamic languages lord over us currently with their gem’s and egg’s (and incidentally it is a much trickier problem to solve when you need to produce compiled assemblies, think signing vs. unsigned, ability to specify x86/x64/any platform flags and the way in which assembly versioning in .Net works).

Building Horn

Assuming you have the Subversion command line tools installed (or tortoise svn) - it’s pretty easy.  First off check out the horn trunk…

svn checkout http://hornget.googlecode.com/svn/trunk/ hornget-read-only

Once all the files have been pulled down, you need to then build horn, using the following batch file:

cd hornget-read-only\src
hornbuild.bat

hornbuild.bat will execute Nant, and the total build takes about 15 to 20 seconds. It dumps the outputs into a \build\net-3.5\debug\ folder, including horn.exe which is the command line client (Horn package manager).  I would assume as Horn matures we will see an installer / binary release on the horn website, which should hopefully make this even easier.

Running Horn

Now jump into the outputs directory...and run horn for the first time.

cd build\net-3.5\debug\
horn

At which point you will be rewarded with the usage screen:

THE HORN PACKAGE MANAGER

http://code.google.com/p/hornget/

Usage : horn -install:
Options :
    -rebuildonly     Do not check for the latest source code.
    -version:        The specific version of a package.

Now it's just a matter of building the project you want.. in this case let's build rhino tools (which in turn will build Nhibernate and some parts of the castle project).  Might pay to go make a coffee at this point, as there's going to be a lot going on while you wait patiently.

horn -install:rhino

Oh, and expect to see a lot of this if your connection to the various project’s SVN repositories is slow..

Reading the current revision for castle
working......
working......
working......
working......
working......
working......
working......
working......
working......
working......

Also, as an aside - there's a cyclic relationship between Castle and NHibernate (i.e. Nhibernate relies on Castle Core & Dynamic Proxy, while Castle relies on NHibernate to build) - it's not truly cyclic as such though, just that if you attempt to build either set of project in it's entirety, you will need the outputs of the other. In Horn things like dynamic proxy are broken out into separate projects ie. "castle.tools" rather then just "castle" (though a castle package exists as well, which does build castle in it’s entirety).

It seems to handle this scenario well, and this was certainly a failing of most home-grown solutions I’ve put together over the years which relied on nant or msbuild files… Right, so after about 5 minutes, you should see the horn executable run to completion, like this:

BUILD SUCCEEDED

Total time: 46.6 seconds.


HORN HAS FINISHED INSTALLING rhino.

Note: The "BUILD SUCCEEDED" message is from rhino tools, which was the last project to be built, rather then telling us how long the process took in total.

Locating Outputs

At this point Horn has finished doing it's job, but... if you do a quick directory search, you probably won't find any output binaries. What gives? Well Horn in fact stores all it's files under a directory against the user's profile. So in the case of windows 7 / Vista, that means I can just change directory to find them:

c:\dev\OtherOpenSource\hornget-read-only\src\build\net-3.5\debug>cd %USERPROFILE%\.horn

C:\Users\alex\.horn>_

If we grab a quick directory listing... we can see there's a few folders in there.

C:\Users\alex\.horn>dir * /A
 Volume in drive C has no label.
 Volume Serial Number is 6AFA-976C

 Directory of C:\Users\alex\.horn

12/08/2009  09:39 p.m.    <DIR>          .
12/08/2009  09:39 p.m.    <DIR>          ..
12/08/2009  09:37 p.m.    <DIR>          .svn
10/08/2009  03:47 p.m.    <DIR>          buildengines
10/08/2009  03:47 p.m.    <DIR>          builders
10/08/2009  03:47 p.m.    <DIR>          esbs
10/08/2009  03:46 p.m.    <DIR>          frameworks
10/08/2009  03:47 p.m.    <DIR>          ioc
10/08/2009  03:46 p.m.    <DIR>          languages
10/08/2009  03:46 p.m.    <DIR>          loggers
10/08/2009  03:46 p.m.    <DIR>          mappers
10/08/2009  03:47 p.m.    <DIR>          mocks
10/08/2009  03:47 p.m.    <DIR>          orm
12/08/2009  09:45 p.m.    <DIR>          result
12/08/2009  09:37 p.m.                15 revision.horn
10/08/2009  03:47 p.m.    <DIR>          web
10/08/2009  03:47 p.m.    <DIR>          wpf
               1 File(s)             15 bytes
              16 Dir(s)  578,876,366,848 bytes free

Notice the .svn folder, the .horn directory is actually populated from this subversion repository, which stores all the package descriptions etc. (I’m not entirely clear on the terminology here, documentation is fairly sparse on the website – they’re almost more like package build scripts, because they’re a DSL outlining the steps required to build the outputs, required dependencies and so on).

The one folder not under version control is "result" - which is where our outputs are actually stored. So let's take a quick look...

C:\Users\alex\.horn>cd result

C:\Users\alex\.horn\result>dir
 Volume in drive C has no label.
 Volume Serial Number is 6AFA-976C

 Directory of C:\Users\alex\.horn\result

12/08/2009  09:45 p.m.    <DIR>          .
12/08/2009  09:45 p.m.    <DIR>          ..
10/08/2009  03:56 p.m.             1,997 ABC.hbm.xml
10/08/2009  03:48 p.m.           110,592 adodb.dll
10/08/2009  04:07 p.m.               568 AnotherBus.config
10/08/2009  03:48 p.m.            40,960 anrControls.Markdown.NET.dll
10/08/2009  03:58 p.m.           106,496 antlr.runtime.dll
10/08/2009  04:01 p.m.           116,736 Antlr3.Runtime.dll
10/08/2009  03:59 p.m.            40,960 Bamboo.Prevalence.dll
10/08/2009  03:59 p.m.             6,656 Bamboo.Prevalence.Util.dll
10/08/2009  04:01 p.m.            40,960 Boo.Lang.CodeDom.dll
10/08/2009  04:01 p.m.           753,664 Boo.Lang.Compiler.dll
10/08/2009  04:01 p.m.           118,784 Boo.Lang.dll
10/08/2009  04:01 p.m.            32,768 Boo.Lang.Extensions.dll
10/08/2009  04:01 p.m.            86,016 Boo.Lang.Interpreter.dll
10/08/2009  04:01 p.m.           425,984 Boo.Lang.Parser.dll
10/08/2009  03:48 p.m.            28,672 Boo.Lang.PatternMatching.dll
10/08/2009  04:01 p.m.            81,920 Boo.Lang.Useful.dll
10/08/2009  04:01 p.m.            32,768 Boo.Microsoft.Build.Tasks.dll
10/08/2009  04:01 p.m.            28,672 Boo.NAnt.Tasks.dll
10/08/2009  04:07 p.m.               393 BusOnTransactionalQueue.config
10/08/2009  04:07 p.m.               405 BusWithLogging.config
10/08/2009  03:48 p.m.            45,056 Cassini.dll
12/08/2009  09:43 p.m.           249,856 Castle.ActiveRecord.dll
12/08/2009  09:43 p.m.             6,656 Castle.ActiveRecord.Linq.dll
12/08/2009  09:43 p.m.            17,920 Castle.ActiveRecord.Linq.pdb
12/08/2009  09:43 p.m.             4,736 Castle.ActiveRecord.Linq.xml
12/08/2009  09:43 p.m.           960,000 Castle.ActiveRecord.pdb
10/08/2009  04:02 p.m.           543,085 Castle.ActiveRecord.XML
12/08/2009  09:42 p.m.            49,152 Castle.Components.Binder.dll
12/08/2009  09:42 p.m.           138,752 Castle.Components.Binder.pdb
12/08/2009  09:42 p.m.            17,275 Castle.Components.Binder.xml
                 ... And the list goes ...





353 File(s) 67,002,734 bytes 2 Dir(s) 578,875,887,616 bytes free

Not bad for what was effectively just a single command line.

Where to from here

I strongly suggest giving Horn a go – not just because it’s useful, but I think that it fills a real hole in the .Net developer open source space, removing one of the barriers to entry – making it easier for people to develop applications against the trunk, or a specific version, of many popular open source projects, will definitely drive up adoption of these projects.

It’s worth noting that currently “Horn” is considered a “developer-only” release at the moment, though I think it’s current state is useful enough to warrant giving it a try, and providing feedback to the Horn dev team etc. so umm… Check it out, if you haven’t already.  I think you’ll be pleasantly surprised.

posted @ Wednesday, August 12, 2009 11:31:53 PM (New Zealand Standard Time, UTC+12:00)    Comments [3] | |
# Friday, August 15, 2008
Yesterday afternoon I presented a quick 20 minute presentation to the Enterprise Architect user group - it was an interesting opportunity to talk with both an Enterprise Architect lead developer and analysts/BA's etc. who are using Enterprise Architect on a daily basis - there's nothing quite like doing something and then even more so presenting on what you've done to really firm up some conclusions / ideas around it (and as is often the case with me, spark 20 ideas for new products I could build to make it better/smarter).

For anyone who's interested here's the slide deck I presented - and also some links to things that were discussed:
Thanks to catch for hosting the group and providing the video conferencing facilities to link Auckland / Wellington (small tip, if you are presenting to two groups be sure to sit at the end of the table looking towards the camera, or your spend your whole time ping-ponging your head towards one group and the other ;) - and also thanks to everyone who came along and listened.

Also of interest was the discussion after the presentation around providing a number of example/sample MDA transformations through Sparx Systems New Zealand site - which should mean that before the end of the year you will be seeing both guidance and examples on developing MDA transformations targeting NHibernate, NHibernate search, ActiveRecord, Monorail and RhinoSecurity starting to emerge (what I tend to loosely call the "Castle stack" for want of a better term.) - which I'll post about it as it starts to happen.

posted @ Friday, August 15, 2008 2:19:21 PM (New Zealand Standard Time, UTC+12:00)    Comments [0] | |
# Monday, March 26, 2007

I've got a little project on at the moment which I chose to use ActiveRecord for... this is for a "legacy" database where there are existing nightly data warehousing scripts written against it... The cost of changing the database structure and tables is potentially quite high (it has run on effects to other systems, potentially effects SLA's when the nightly scripts fail.. and a small project ends up having a big impact)

At any rate, I'm just consuming the existing database as-is... which includes a single character status columns i.e. "A" for active, "P" for pending etc... after poking around with a few solutions I ended up creating an NHibernate custom type... first off, this was surprisingly easy... but it annoyed me a little that I had to create a different custom type for each set of enumerated values, and that this information was no longer declarative, compared to the rest of the ActiveRecord implementation...

So I took a few minutes to re-write it as generic solution to the problem today... which at least solves the declarative problem... first off, here's a property with the custom type applied - nothing amazing here, but notice the type is generic... with the type of status field itself qualifying the generic custom type...

 [Property("dBlrStatus", "App.Model.MappedEnumerationHibernateType`1[[App.Model.Status, App.Model]], App.Model")]

 public virtual Status Status

 {

    get { return _status; }

    set { _status = value; }

 }


We then declare the mappings on the enumeration itself...

 public enum Status

 {

    [MapToCharacters('A', 'a', '+')]

    Active,

 

    [MapToCharacters('I', 'i', '-')]

    [Default]

    InActive

 }


I think this is a good fit for ActiveRecord... If anyone wants the code at some point just leave a comment and I'll package it up and post it... it's pretty elementary stuff, though it might save some time if you wanted to re-implement it yourself...

posted @ Monday, March 26, 2007 6:35:27 PM (New Zealand Daylight Time, UTC+13:00)    Comments [0] | |
Search
FeedCount

Tags...
.Net (83) .Net Reactor (4) .net user groups (9) 2008SummerRoadTrip (1) ActiveRecord (1) architecture (1) architecture chat (95) ArchitectureCamp2007 (2) asp.net (1) Astoria (1) Auckland (1) base4 (9) batching (1) binsor (1) blog (4) boo (1) books (1) C# 3.0 (9) cambodia (9) CAML.Net (1) castle (40) china (8) codecamp (3) codeplex (3) dapper.net (1) DevDefined Ltd. (4) DirectShow.Net (1) DLR (1) DSL (4) EAUG (1) Enterprise Architect (5) Enterprise Architecture (1) Enterprise Library (1) F# (1) feedburner (2) first post (1) Friendster (1) generics (1) googlegears (1) hacks (3) hardware (3) hongkong (2) Horn (1) hyper-v (1) ideas (1) IoC (21) IronPython (13) IronRuby (2) jobs (1) Languages (2) laos (8) LINQ (7) LiveId (1) LLU (1) Local Government (1) MDA (1) MDD (1) microsoft (1) Model Driven Development (1) mono (1) monorail (2) Movies (1) Music (1) nDepend (1) news (1) NHibernate (3) NUnit (2) nvelocity (1) OAuth (6) office (1) OpenSocial (1) orcon (1) photos (1) php (1) PostSharp (1) powerpoint (1) presentations (1) ReSharper (1) REST (2) rhino commons (3) rhinomocks (5) Ruby (1) SaaS (1) scm (1) Screen Architect (0) SharePoint (5) silverlight (1) Splicer (4) SQL2008 (1) supcom (1) survey (1) svn (1) Syzmk (4) thailand (6) Tools (2) Tortoise SVN (1) trac (2) Travel (36) Unity (2) vietnam (7) vista (2) visual nhibernate (1) vmware (1) volta (3) VS2008 (1) WCF (3) wiki (2) wikipedia (1) Windows Server 2008 (1) windsor (6) WinForms (1) wix (2) WPF (2) xmlrpc (1) yahoo pipes (1)
Who am I?
Alex Henderson
Alex Henderson
Auckland, New Zealand
Managing Director at Dev|Defined Limited

"Self Confessed Coding Junky for 15 years"
View Alex Henderson's profile on LinkedIn
 
Mobile: +64-21-402-969
Email: bittercoder 'at' gmail 'dot' com
MSN: bittercoder_nz@hotmail
Skype: alex.devdefined
Navigation