it:ad:teamcity:nuget

IT:AD:TeamCity:Nuget

There are two ways of doing it:

  • Getting TC to do a build of the .sln first, and then invoke Nuget against a *.nuspec for a project within the solution. Getting TC to invoke Nuget directly against a *.csproj file, and it will build the project, then the *.nupkg.
  • Using *.nuspec:
    • XAct.Core.nuspec placed beside XAct.Core.csproj
    • TeamCity settings:
      • Specification file: XAct.Core\XAct.Core\XAct.Core_Debug.nuspec
      • Base Directory= XAct.Core\XAct.Core
      • Path = (Custom) c:\Nuget\Nuget.exe
    • Pros:
      • Works.
      • Total control
      • Cons:
      • A lot of custom work in the .nuspec
        Using .csproj: * As it is nuget that is running the build, and it's entry point is the *.csproj ([CHECKOUTDIR]\XAct.Core\XAct.Core\XAct.Core.csproj), it artificially sets the SolutionDir to the folder above it (eg: [CHECKOUTDIR]\XAct.Core\). * As the SolutionDir is used by the *.csproj to import the Nuget.target file (<Import Project="$(SolutionDir)\.nuget\NuGet.targets" />), it is never found (one dir to deep): '…The imported project “…\work\f5a3a0936d0bc94c\xact.core.nuget\NuGet.targets” was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk." * Tried: * Setting CommandLine to /Property:SolutionDir=<sln Dir>` didn't work (the COmmand Line is for the NuGet – not the MSBuild?) * Benefits: * Once working, it would be automated. * Cons: * Couldn't get it to work without a hack: had to put the .nuget directory in the the XAct.Core directory otherwise never found it. * Much more difficult to get right. http://bit.ly/sFBEk2 andhttp://bit.ly/rAXjKX
  • /home/skysigal/public_html/data/pages/it/ad/teamcity/nuget.txt
  • Last modified: 2023/11/04 03:32
  • by 127.0.0.1