Skip to content

Commit 98dc454

Browse files
gep13vexx32
authored andcommitted
(#3849) Update build for Chocolatey.NuGet.Client
Due to the change to using the new csproj format, and also for using dotnet restore, rather than nuget restore, some changes were required to get the build to complete successfully. A NuGet.config file had to be introduced to use a local packages folder, rather than the global folder cache, and in addition, the folder structure has now changed to the regex for replacing the Chocolatey.NuGet.Client assemblies had to be updated. The folder structure is now: chocolatey.nuget.commands\3.4.3\ rather than: chocolatey.nuget.commands.3.4.3\
1 parent ca16e76 commit 98dc454

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

NuGet.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<config>
4+
<add key="globalPackagesFolder" value=".\src\packages" />
5+
</config>
6+
</configuration>

update-nuget-client.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@ if ($build -or !(Test-Path "$sourceLocation\artifacts")) {
3232
}
3333

3434
Get-ChildItem "$thisLocation\src\packages\Chocolatey.NuGet.*" | ForEach-Object {
35-
$name = $_.Name -replace "^Chocolatey\.NuGet([^\d]+)(\.\d.*)$", "NuGet`$1"
35+
$name = $_.Name -replace "^Chocolatey\.NuGet([^\d]+)$", "NuGet`$1"
36+
37+
$packageDirectory = $_.FullName
38+
$versionDirectory = Get-ChildItem -Path $packageDirectory -Directory | Sort-Object Name -Descending | Select-Object -First 1
39+
$destination = Join-Path $versionDirectory.FullName 'lib'
3640

37-
$destination = "$($_.FullName)\lib"
3841
Remove-Item "$destination\*\*"
3942

4043
Get-ChildItem "$sourceLocation\artifacts\$name\bin\Debug" -Directory | ForEach-Object {

0 commit comments

Comments
 (0)