Question

I have a .Net 4.0 project that I wish to build in CruiseControl.Net.

It is now set up, so it builds a publish-build and works perfectly except for the version number, where I can't reference CCNetLabel, that I wish to use for the last digit of the version number.

When I do try to reference the field/variable, I'm told that it's unknown.

It would seem that CC.Net does not 'transfer' the values to my script, but what am I doing wrong?

Below ccnet.config and product-ci.config

Thanks for any suggestions,

Anders, Denmark

<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>
Was it helpful?

Solution

The CCNetLabel is passed as a property to the MSBuild project file and available inside it for use.I use it like this with a default value.

<PropertyGroup>
<CCNetLabel Condition="$(CCNetLabel)==''">0.0.0.0</CCNetLabel>
</PropertyGroup>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top