Question

I am setting up a new project to play around with the CLR and mono versus .NET. As a build environment/tool I chose NAnt, because I am familiar with Ant and it seemed best suiting.

While this is working very nice on different machines with different OSs, I am worried that some day, while I develop on a Windows machine, gmcs may not be able to build my sources, making them unavailable to other platforms using mono. So my idea to get around this is telling NAnt to always use gmcs inside the <csc> task. Is there a way to set the build script up that way? Or another workaround for my problem?

Was it helpful?

Solution

You can select the desired compiler using the default attribute of the plateform element in the configuration file Nant.exe.config.

You can also choose at runtime by using the -t switch. In example :

  • nant -t:net-4.0 will use csc and will target the .NET framework 4.0
  • nant -t:mono-2.0 will use mcs and will target the .NET framework 2.0
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top