0

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>
hobodave
  • 28,925
  • 4
  • 72
  • 77
Anders Juul
  • 2,407
  • 3
  • 34
  • 56

1 Answers1

0

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>
softveda
  • 10,858
  • 6
  • 42
  • 50
  • Hi Pratik, thanks for taking the time. I would need a bit more help, though. I have now downloaded the svnRevisionLabeller which works like a charm. I get the revisions I aim for. The Published version is still 1.0.0.3 as written in the source files (and displayed in VS). How do I get it the last step into msbuild? I Can't seem to find parameters that fit... – Anders Juul Dec 08 '10 at 10:15
  • My solution was as follows - I did'nt have the version parameter in the line. Thanks for helping out, Anders – Anders Juul Dec 08 '10 at 10:41