16. April 2011 21:37
I've created a solution template as a that may form the basis of reference solution to be used in my company. It's available to view here
Requirements & Design decisions:
- To be used in a corp environment.
- No packages / wraps / dependencies / tools are committed to version control, except the bare minimum to bootstrap the build and/or restore dependencies.
- Packages / wraps / dependencies / tools may come from a variety of sources - nuget galley, local nuget repo, local openwrap repo.
- Anyone should be able to download the source and single click build the solution with no additional effort, friction or setup. (i.e. just run Build.ps1 )
- Easily managed via CI without addition setup and minimal coupling (i.e. .\Build.ps1 -buildNumber 2 )
- Sticking with released version of tools.
- I am using NuGet as my 'tools' manager. OpenWrap does not appear to be suitable for this purpose.
- OpenWrap seems to want to be responsible for compiling, running tests and creating the package. I already have psake for that. In my mind, creating a packages is a post-build step. Anyway, build: none to the rescue.
- A psake build task sets the version number (using a build number if supplied) and keeps SharedAssemblyInfo.cs and the version file in sync.
- We use code contracts and the contract assemblies must be shipped in the wrap.
Some of the things I don't like:
- There is a bit too much going on in the root of the project, but at least Build.ps1 is at the top.
- Would rather not have to commit warps\openwrap-22.214.171.124270092.wrap to support the bootstrap.
- ... and I'd like to add wraps/* to .hgignore.
- Can't isolate XUnit to only the DH.SolutionTemplate.Tests project (I know something is in the pipeline for this).
- Explicitly defining what goes into the resulting wrap may be a place where mistakes can easily happen. Not sure how to mitigate that.
- Having to use ;-shellInstall none; everywhere. I think o.exe default behaviour should be 'do nothing' and installation is an explicit step. I don't know enough of OpenWraps's architecture or intention to hold that belief firmly though :)
- In RestoreDependencies.ps1 I am deliberately adding the NuGet gallery remote source. This will add it permanently to the users remote list which I'd prefer not to affect. (I know there is something in OpenWrap's pipeline for this).
So, if there are any places this could be improved, let me know.