我是新來的南特,並已能夠創建一個<target>
其楠<msbuild>自定義輸出目錄
1)刪除任何代碼從當前文件夾
2)出口新鮮代碼從SVN
3)建立默認目錄中的代碼,其是PrecompiledWeb文件夾(其一個Web應用程序)
這:
<target name="export" description="export code from svn">
<delete dir="${Delete.Dir}"></delete>
<exec program="svn" commandline="export ${MySVN.Repos} ${MySVN.Dest}" />
<msbuild project="${Solution.Filename}">
<property name="Configuration" value="Release"/>
</msbuild>
</target>
我要指定一個自定義輸出目錄(不是「PrecompiledWeb」等)。這是可能的,你能告訴我必要的標籤/財產嗎?
謝謝!
編輯
感謝斯科特和Si,我越來越接近一個解決方案,但我仍然沒有任何工作。有評論導致我在MSBuild's Output Path Property這篇文章。使用他們的代碼:
<?xml version="1.0"?>
<project name="test" default="build" basedir="." xmlns="http://nant.sf.net/schemas/nant-0.84.win32.net-1.0.xsd">
<target name="build">
<exec program="${framework::get-framework-directory('net-3.5')}/msbuild.exe">
<arg value="${Full.Path}\Code\MySolution.sln" />
<arg value="/p:OutputPath=${Full.Path}\Output\" />
</exec>
</target>
</project>
這將成功運行;然而,在我的解決方案包含一個網站和一個類庫,它出版的類庫的DLL到指定的輸出路徑,但它仍然發佈實際網站的默認文件夾PrecompiledWeb。
沒有人有如何改變來自南特的PrecompiledWeb文件夾路徑有什麼建議?
再次感謝大家誰的幫助!
編輯2最終解決
這是我最後能得到的工作(更新.NET 4):
<exec program="${framework::get-framework-directory('net-4.0')}/msbuild.exe">
<arg value="${Full.Path}\Code\MySolution.sln" />
<arg value="/t:Rebuild" />
<arg value="/t:ResolveReferences" />
<arg value="/t:_CopyWebApplication" />
<arg value="/p:OutDir=${Build.Output}bin\" />
<arg value="/p:WebProjectOutputDir=${Build.Output}" />
<arg value="/p:Configuration=Release" />
</exec>
如果使用網絡部署項目,您可以定義OutputPath爲整個網站。除此之外,也許您需要深入研究Microsoft MSBuild腳本? – si618 2009-03-13 22:57:51