[Mono-dev] building for Mono under msbuild

Andy Waddell awaddell at fnfr.com
Tue Oct 11 20:47:44 EDT 2005


It's an MSBuild "Transform" that will resolve to a bunch of /reference
arguments to gmcs.  Each one will correspond to a so-call
"ProjectReference" which I assume is just the MS way of specifying
assemblies not in the GAC.  If your project doesn't have any project
references, it will resolve to nothing.  

 

--andy

 

________________________________

From: mono-devel-list-bounces at lists.ximian.com
[mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Gustavo
Guerra
Sent: Tuesday, October 11, 2005 4:56 PM
To: mono-devel-list at lists.ximian.com
Subject: Re: [Mono-dev] building for Mono under msbuild

 

Hi there:

 

Can you please explain this arguments of gmcs?:

@(ProjectReference->'/reference:%(RelativeDir)$(OutputPathMono)\%(Filena
me).dll

Best regards,
Gustavo Guerra

	"Andy Waddell" <awaddell at fnfr.com> wrote in message
news:619FD34741327C47AC7FBA8DBADBF5E04C2F2A at ffex01.fnfr.com...

	I have an application that needs to run under both .NET and Mono
and I came up with a pretty simple way to get MS DevStudio to build
both.  I don't know how others have solved this problem, but I thought I
would offer it up in case it helps someone else with the same issue.
The basic approach I took was to call the Mono compiler after the
Microsoft build has already run.  Microsoft has a well known target
"AfterBuild" which I have hooked to invoke gmcs with pretty much the
same arguments that csc.exe takes with some minor modifications.  I put
all the Mono build stuff in a file called Mono.targets, so it only take
a one line addition to the standard *.csproj file to get the
functionality:

	 

	  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets"
/>

	Add this line-->  <Import Project="<your path>\Mono.targets" />

	 

	This will make your build essentially a dual pass build with all
the Microsoft stuff running and then the Mono compiler running with all
the warnings and erros showing up in the IDE as you would expect.  The
work is not complete (I don't pass all the options possible, etc), but I
think it's fairly obvious how to expand it if needed.  

	 

	I'm sure there are many other ways to skin this cat, but for a
quick and dirty solution, it seems to work pretty well.  

	 

	ToDo: invesitgate xbuild to do my Linux builds.

	 

	--andy

	 

	
________________________________


	_______________________________________________
	Mono-devel-list mailing list
	Mono-devel-list at lists.ximian.com
	http://lists.ximian.com/mailman/listinfo/mono-devel-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20051011/7c929d29/attachment.html 


More information about the Mono-devel-list mailing list