[Mono-dev] building for Mono under msbuild

Gustavo Guerra gmcg at acm.org
Tue Oct 11 22:25:18 EDT 2005


I'm working on .targets file toosupports multiple configurations.
I'll post here when finished. Keep posting yours too.

Best regards,
Gustavo Guerra

"Andy Waddell" <awaddell at fnfr.com> wrote in message 
news:619FD34741327C47AC7FBA8DBADBF5E04C2F5F at ffex01.fnfr.com...
Right, sorry.  If you right click on the References folder and then "Add 
Reference" you get a form with a Projects tab.  I guess these are all the 
projects in your solution.  If you add one of those, then a ProjectReference 
Item will get added to the project.  I think the way the MS targets get 
around to doing it is a bit more complicated, but I just made the assumption 
that the referenced project was generating a dll, and used the transform to 
get the path I would need.  It ends up being the same as the portion of the 
Csc.exe command line that I seen when I do the MS compile.

By the way I just did a little more work on my Mono.targets file to copy the 
ProjectRefernce'd dll's into the local output directory so if you're 
building an executable, you'll have all the stuff you need to run in one 
place (no need to set MONO_PATH).  I'll post if there is interest.

--andy

-----Original Message-----
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 6:51 PM
To: mono-devel-list at lists.ximian.com
Subject: Re: [Mono-dev] building for Mono under msbuild

My question was not about the transform, but about what the
"ProjectReference" item is, as I've only seen the "Reference" item. I've
searched in Microsoft.Common.Targest, and it seems to apply to VC??

Regards,
Gustavo Guerra


"Andy Waddell" <awaddell at fnfr.com> wrote in message
news:619FD34741327C47AC7FBA8DBADBF5E04C2F5C at ffex01.fnfr.com...
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)\%(Filename).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



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



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






More information about the Mono-devel-list mailing list