我有一个混合的Java/C#项目,并使用包含csc任务的ant脚本来编译dll。这工作,但我得到一个警告如何替换已弃用的csc ant任务
[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
我该如何更换csc任务?我肯定可以创建一个exec任务,调用nant与project.build文件,但是这种感觉完全错误。
编辑澄清:我主要在Linux上使用这种编写Nant脚本来编译项目的C#部分是没有问题的。目前我从蚂蚁脚本中调用它
<target name="build-mono-stuff">
<exec executable="nant">
<arg value="build-stuff"/>
</exec>
</target>
但我希望找到比调用exec更好的解决方案。
编辑2所以我试着从.NET AntLib中得到nant的工作。这是我在多大程度上得到:
<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>
首先运行:
[mono-compile] Cannot open assembly 'NAnt.exe': No such file or directory.
然后我把NAnt.exe从Ubuntu楠包到路径,我得到
[mono-compile] The "nant" section in the NAnt configuration file (/bin/NAnt.exe.config) is not available.
任何想法?
它指向你的.NET Antlib不适合? – 2010-03-12 18:44:52
我不确定,这是如何工作的。我会很高兴,如果你能给我一个调用这个.NET Antlib任务的例子(如果可能的话从我的ant脚本中)。 – GrGr 2010-03-12 22:00:05