我有一個混合的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