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-126.96.36.199270092.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.
16. April 2011 21:25
Well shortly after my last post on getting OpenWrap to work with TeamCity I was told that one can just include o.exe with your solution and use the switch
o -shellInstall none [rest of args]
This made me face-palm :)
In my defence, this switch is not shown via 'o', or 'o get-help'. Nor is it easily discoverable via the documentation / wiki when following links from openwrap.org. I also thought that because the default action of 'o' is to prompt you to install, I thought one had to.
And with that, I am of the opinion that 'o''s default action shouldn't prompt to install, and that installing should instead be an explicit switch ( '-install' ).