我有一个.Net 4.0项目,我希望在CruiseControl.Net中构建。
它现在已经设置好了,所以它构建了一个发布版本,并且除了版本号之外完全正常工作,我不能引用CCNetLabel,我希望将其用于版本号的最后一位。
当我尝试引用字段/变量时,我被告知它是未知的。
似乎CC.Net没有将值“转移”到我的脚本中,但我做错了什么?
在ccnet.config和product-ci.config下面
感谢您的任何建议,
丹麦安德斯
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<cb:include
href="configs/product-ci.config"
xmlns:cb="urn:ccnet.config.builder"/>
</cruisecontrol>
<cb:scope xmlns:cb="urn:ccnet.config.builder"
CCNetWebServer="dkapp04"
TriggerInterval="10"
WorkingDir="d:\ccnet.output\product"
msBuildTargets="Publish"
excludedNunitCategories=""
publishUrl="http://dkapp04/product/Dev/"
destinationFolder="d:\ccnet.output\product\Dev"
version ="1.0.0.${CCNetLabel}"
>
<project
name="product"
webURL="http://$(CCNetWebServer)/ccnet/server/local/project/product-ci/ViewLatestBuildReport.aspx"
queue="default">
<state type="state" directory="C:\Program Files\CruiseControl.NET\server\States\" />
<triggers>
<intervalTrigger seconds="$(TriggerInterval)" />
</triggers>
<sourcecontrol type="svn">
<trunkUrl>https://dkapp04.company.com/svn/product/trunk</trunkUrl>
<workingDirectory>$(WorkingDir)</workingDirectory>
<cleanCopy>false</cleanCopy>
<executable>C:\Program Files\VisualSVN Server\bin\svn.exe</executable>
</sourcecontrol>
<tasks>
<msbuild
executable = "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
workingDirectory = "$(WorkingDir)\src"
projectFile="BuildScript.proj"
buildArgs = "/p:Configuration=Debug /p:excludedNunitCategories=$(excludedNunitCategories) /p:DestinationFolder=$(destinationFolder) /p:PublishUrl=$(publishUrl) /p:ApplicationVersion=$(version)"
targets = "$(msBuildTargets)"
timeout = "100"
logger = "C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll"
/>
</tasks>
</project>
</cb:scope>
答案 0 :(得分:0)
CCNetLabel作为属性传递给MSBuild项目文件,并在其中可供使用。我像这样使用默认值。
<PropertyGroup>
<CCNetLabel Condition="$(CCNetLabel)==''">0.0.0.0</CCNetLabel>
</PropertyGroup>