IT:AD:TeamCity:Nuget
Installation
- Procedure:
- Find TeamCity Data directory
- C:_System\TeamCity.BuildServer\plugins\
- Stick downloaded zip there
- Stop TeamCity server
- Start TeamCity server
- You'll see a new tab on Server Administrator page
- Using NuGet Install option from behind Proxy failed.
- Instead:
- chose
Customand defined a path. That said space inc:\Program Files\caused it to fail. Worked when installed toc:\Nuget\. Might have worked as well if I chosen an %env….% defined path. - Found this alternate Workaround mentioned on web: http://bit.ly/tfQEHR that led to http://bit.ly/sEvdSG
Packaging
There are two ways of doing it:
- Getting TC to do a build of the .sln first, and then invoke Nuget against a
*.nuspecfor a project within the solution. Getting TC to invoke Nuget directly against a*.csprojfile, and it will build the project, then the*.nupkg. - Using
*.nuspec:XAct.Core.nuspecplaced besideXAct.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 isnugetthat 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