, msbuild, / p: OutputPath és CCNetArtifactDirectory

original title: ", msbuild, /p:OutputPath and CCNetArtifactDirectory"


I'm trying to setup at the moment. So far it works nice, but I have a Problem with the MSBuild Task.

According to the Documentation, it passes CCNetArtifactDirectory to MSBuild. But how do I use it?

I tried this:

   /noconsolelogger /p:OutputPath=$(CCNetArtifactDirectory)\test

But that does not work. In fact, it kills the service with this error:

ThoughtWorks.CruiseControl.Core.Config.Preprocessor.EvaluationException: Reference to unknown symbol CCNetArtifactDirectory

Documentation is rather sparse, and google und mainly offers modifying the .sln Project file, which is what I want to avoid in order to be able to manually build this project later - I would really prefer /p:OutputPath.

Jelenleg megpróbálom beállítani a alkalmazást. Eddig jól működik, de nekem van egy problémám az MSBuild Feladattal. A dokumentáció szerint továbbítja a CCNetArtifactDirectory-t az MSBuild-hez ....

Ez az összefoglalás a fordítás után. Ha meg szeretné tekinteni a teljes fordítást, kattintson a "fordítás" ikonra

Minden válasz
  • Translate

    The CCNetArtifactDirectory is passed to the MSBuild by default, so you dont need to worry about it. MSBuild will place the build output in the "bin location" relevant to the working directory that you have specified.

    <buildArgs>/noconsolelogger /p:Configuration=Debug </buildArgs>

    So in the above example your build output will be put in C:\data\projects\FooSolution[ProjectName]\bin\Debug. Should you want to output to a different location you may want to look at of the tag in CCNET.

      <xmllogger />

    This will allow you to publish your output to a different location.

  • Translate

    You can use the artifact directory variable inside the MSBuild script itself. Here's an example of how I'm running FxCop right now from my CC.Net MSBuild script (this script is what CC.Net points to - there is also a "Build" target in the script that includes an MSBuild task against the SLN to do the actual compilation):

      Command='FxCopCmd.exe /project:"$(MSBuildProjectDirectory)\FXCopRules.FxCop" /out:"$(CCNetArtifactDirectory)\ProjectName.FxCop.xml"'
      WorkingDirectory="C:\Program Files\Microsoft FxCop 1.35"

  • Translate

    Parameters like CCNetArtifactDirectory are passed to external programs using environment variables. They are available in the external program but they aren't inside CCNET configuration. This often leads to confusion.

    You can use a preprocessor constant instead:

    <cb:define project.artifactDirectory="C:\foo">
      <!-- [...] -->
      <!-- [...] -->
        <!-- [...] -->
          <!-- [...] -->
          <buildArgs>/noconsolelogger /p:OutputPath=$(project.artifactDirectory)\test</buildArgs>
          <!-- [...] -->
        <!-- [...] -->
      <!-- [...] -->