1
這是我的情景:傳遞參數給南特構建腳本
我有一個build.bat
保存:
call tools\nant-0.92\bin\nant.exe -buildfile:deploy.build %* -logfile:deploy_NAnt.log
的deploy.build
部分成立:
<project
name="EdpClient"
basedir="." default="build"
xmlns="http://nant.sf.net/release/0.92/nantContrib.xsd">
<!--INIT -->
...
<property name="version" value="1.48.0.4" />
...
<!--RELEVANT TARGET-->
<target name="BuildProductionApplication" description="Build">
<property
name="publishFolderParameter"
value="/p:PublishDir=${productionPublishFolder}" />
<echo message="Building..." />
<exec
program="${msbuildExe}"
workingdir="." verbose="true">
<arg value="${projectFile}" />
<arg value="/target:Clean;Publish" />
<arg value="${publishFolderParameter}" />
<arg value="/property:ApplicationVersion=${version}" />
<arg value="/property:PublisherName="${publisherName}"" />
</exec>
<echo message="Built" />
</target>
...
</project>
現在我的問題是:
- 如何在我的結構中調用
"build.bat -version 1.48.0.4"
並替換參數 ? - 如果沒有提供
-version
參數,腳本應該在命令行中輸入一些 msg?
感謝所有幫助!
可能重複的[是否有可能發送參數到Nant任務?](http://stackoverflow.com/questions/3335698/is-it-possible-to-send-parameters-into-nant-task) – CloudyMarble