[Mono-dev] Altering our build system.
kutulu at kutulu.org
Sun May 23 10:10:42 EDT 2010
On 5/20/2010 2:37 PM, Jonathan Chambers wrote:
> I've been looking at a MSBuild based build for the class libs (based upon
> Jonathan Pobst's MonkeyBuilder). To actually make the projects usable in
> visual studio, they need to be one of a list of well known project types.
> While MSBuild can handle an arbitrary .proj file with arbitrary MSBuild
> tasks, to build inside VS you would need to use a .csproj. Currently, I have
> a build basically working using a .proj file with custom MSBuild tasks that
> mirror what MonkeyBuilder does (which mirrors the auto* based build). csproj
> files could be used, but it raises a few questions:
You can insert arbitrary Xml into a .csproj and VS will
maintain it there intact. (This works, at least, for
top-level children of the <Project> node.) MSBuild will
process the Xml as build commands when it loads your project
file. So, for example, you can add additional <Import>
nodes into the projects to pull in custom Mono targets files
to do some of the following things.
> 1. Can we build using either .Net compilers or mono compilers?
The basic definitions for the build are in the file
Microsoft.CSharp.targets in the Framework directory; from a
quick glance over the <CoreCompile> target, you can set the
CscToolExe and CscToolPath variables to whatever you want.
> 2. Is there the concept of make and make install (building class libs versus
> installing them in some location)?
There is a concept of post-build execution; it's not exactly
the same as 'make install' but that's typically what I've
used it for. You do this by creating a post-build event
hook as shown here:
> 3. Running unit tests
This one is a bit trickier; I've never done it outside of
using TFSBuild, which has a custom task for it. But I would
assume you could just launch mstest.exe from a post-build
event, or create a custom Mono target that wraps the logic up.
More information about the Mono-devel-list