I have a mixed Java / C# project and use an ant script that contains a csc task to compile the dll. This works, but I get a warning
[csc] This task is deprecated and will be removed in a future version
[csc] of Ant. It is now part of the .NET Antlib:
[csc] http://ant.apache.org/antlibs/dotnet/index.html
How can I replace the csc task? I can surely create an exec task calling nant with a project.build file, but that feels completely wrong.
EDIT To clarify: I am mainly using this on Linux and writing the Nant script to compile the C# part of the project is no problem. Currently I call it from the Ant script by
<target name="build-mono-stuff">
<exec executable="nant">
<arg value="build-stuff"/>
</exec>
</target>
but I hoped to find a better solution than invoking an exec.
EDIT 2 So I tried get the nant from .NET AntLib to work. This is how far I got:
<taskdef name="mono-compile" classname="org.apache.ant.dotnet.build.NAntTask">
<classpath location="lib/ant-dotnet-1.0.jar" />
</taskdef>
<target name="build-mono-stuff">
<mono-compile buildfile="mono.build"></mono-compile>
</target>
First run:
[mono-compile] Cannot open assembly 'NAnt.exe': No such file or directory.
Then I put NAnt.exe from the Ubuntu nant package into the PATH and I get
[mono-compile] The "nant" section in the NAnt configuration file (/bin/NAnt.exe.config) is not available.
Any ideas?