Skip to content

Commit

Permalink
(NuGet#9) Renamed NuGet.Frameworks project
Browse files Browse the repository at this point in the history
To be Chocolatey.NuGet.Frameworks. Due to a transitive dependency from
one of the Microsoft Unit Testing libraries on the NuGet.Frameworks
NuGet package, it wasn't possible to directly renamed the
NuGet.Frameworks project to Chocolatey.NuGet.Frameworks in the same way
that we have done the other projects.  When we tried this, there was a
conflict between the assemblies, and it wasn't possible to compile.

We attempted to use the standard solutions like introduce an app.config
file to redirect the binding, but none of these approches worked.
Various solutions were put forward, including using an assembly alias
and extern inclusion, as well as completely removing the
NuGet.Frameworks project reference in favour of the upstream
NuGet.Frameworks NuGet package, but all of these were rulred out in
favour of renaming the project and the assemblies, and then updating
the using statements and various other places where the name is used.

It is understood that there will likely be similar changes required
when we pull in upstream code from the NuGet.Client GitHub repository.
  • Loading branch information
gep13 committed Dec 2, 2022
1 parent b400373 commit 44e751b
Show file tree
Hide file tree
Showing 484 changed files with 6,977 additions and 2,046 deletions.
70 changes: 63 additions & 7 deletions scripts/nuget-debug-helpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,25 @@ Function Invoke-NuGetCustom()
{
$packDllPath = Join-Path $NuGetClientRoot "artifacts\NuGet.Build.Tasks.Pack\bin\$Configuration\$NETFramework\NuGet.Build.Tasks.Pack.dll"
$packTargetsPath = Join-Path $NuGetClientRoot "src\NuGet.Core\NuGet.Build.Tasks.Pack\NuGet.Build.Tasks.Pack.targets"
$restoreDllPath = Join-Path $NuGetClientRoot "artifacts\NuGet.Build.Tasks\bin\$Configuration\$NETFramework\NuGet.Build.Tasks.dll"
<# //////////////////////////////////////////////////////////
// Start - Chocolatey Specific Modification
//////////////////////////////////////////////////////////
#>
$restoreDllPath = Join-Path $NuGetClientRoot "artifacts\NuGet.Build.Tasks\bin\$Configuration\$NETFramework\Chocolatey.NuGet.Build.Tasks.dll"
<# //////////////////////////////////////////////////////////
// End - Chocolatey Specific Modification
//////////////////////////////////////////////////////////
#>
$nugetRestoreTargetsPath = Join-Path $NuGetClientRoot "src\NuGet.Core\NuGet.Build.Tasks\NuGet.targets"
$consoleExePath = Join-Path $NuGetClientRoot "artifacts\NuGet.Build.Tasks.Console\bin\$Configuration\$NETFramework\NuGet.Build.Tasks.Console.exe"
<# //////////////////////////////////////////////////////////
// Start - Chocolatey Specific Modification
//////////////////////////////////////////////////////////
#>
$consoleExePath = Join-Path $NuGetClientRoot "artifacts\NuGet.Build.Tasks.Console\bin\$Configuration\$NETFramework\Chocolatey.NuGet.Build.Tasks.Console.exe"
<# //////////////////////////////////////////////////////////
// End - Chocolatey Specific Modification
//////////////////////////////////////////////////////////
#>
Write-Host "msbuild /p:NuGetRestoreTargets=$nugetRestoreTargetsPath /p:RestoreTaskAssemblyFile=$restoreDllPath /p:NuGetBuildTasksPackTargets=$packTargetsPath /p:NuGetConsoleProcessFileName=$consoleExePath /p:ImportNuGetBuildTasksPackTargetsFromSdk=true /p:NuGetPackTaskAssemblyFile=$packDllPath $($args[0..$args.Count])"
& msbuild /p:NuGetRestoreTargets=$nugetRestoreTargetsPath /p:RestoreTaskAssemblyFile=$restoreDllPath /p:NuGetBuildTasksPackTargets=$packTargetsPath /p:NuGetConsoleProcessFileName=$consoleExePath /p:ImportNuGetBuildTasksPackTargetsFromSdk=true /p:NuGetPackTaskAssemblyFile=$packDllPath $args[0..$args.Count]
}
Expand All @@ -31,7 +47,15 @@ Auto bootstraps NuGet for debugging the restore targets only (this doesn't inclu
#>
Function Invoke-NuGetRestoreCustom()
{
$restoreDllPath = Join-Path $NuGetClientRoot "artifacts\NuGet.Build.Tasks\bin\$Configuration\$NETFramework\NuGet.Build.Tasks.dll"
<# //////////////////////////////////////////////////////////
// Start - Chocolatey Specific Modification
//////////////////////////////////////////////////////////
#>
$restoreDllPath = Join-Path $NuGetClientRoot "artifacts\NuGet.Build.Tasks\bin\$Configuration\$NETFramework\Chocolatey.NuGet.Build.Tasks.dll"
<# //////////////////////////////////////////////////////////
// End - Chocolatey Specific Modification
//////////////////////////////////////////////////////////
#>
$nugetRestoreTargetsPath = Join-Path $NuGetClientRoot "src\NuGet.Core\NuGet.Build.Tasks\NuGet.targets"
$consoleExePath = Join-Path $NuGetClientRoot "artifacts\NuGet.Build.Tasks.Console\bin\$Configuration\$NETFramework\NuGet.Build.Console.exe"
Write-Host "msbuild /p:NuGetRestoreTargets=$nugetRestoreTargetsPath /p:RestoreTaskAssemblyFile=$restoreDllPath /p:NuGetConsoleProcessFileName=$consoleExePath $($args[0..$args.Count])"
Expand Down Expand Up @@ -80,14 +104,30 @@ Function Add-NuGetToCLI {
$sdk_path = $sdkLocation

$nugetXplatArtifactsPath = [System.IO.Path]::Combine($NuGetClientRoot, 'artifacts', 'NuGet.CommandLine.XPlat', 'bin', $Configuration, $NETCoreApp)
$nugetBuildTasks = [System.IO.Path]::Combine($NuGetClientRoot, 'artifacts', 'NuGet.Build.Tasks', 'bin', $Configuration, $NETCoreApp, 'NuGet.Build.Tasks.dll')
<# //////////////////////////////////////////////////////////
// Start - Chocolatey Specific Modification
//////////////////////////////////////////////////////////
#>
$nugetBuildTasks = [System.IO.Path]::Combine($NuGetClientRoot, 'artifacts', 'NuGet.Build.Tasks', 'bin', $Configuration, $NETCoreApp, 'Chocolatey.NuGet.Build.Tasks.dll')
<# //////////////////////////////////////////////////////////
// End - Chocolatey Specific Modification
//////////////////////////////////////////////////////////
#>
$nugetBuildTasksConsole = [System.IO.Path]::Combine($NuGetClientRoot, 'artifacts', 'NuGet.Build.Tasks.Console', 'bin', $Configuration, $NETCoreApp, 'NuGet.Build.Tasks.Console.dll')
$nugetTargets = [System.IO.Path]::Combine($NuGetClientRoot, 'src', 'NuGet.Core', 'NuGet.Build.Tasks', 'NuGet.targets')
$nugetExTargets = [System.IO.Path]::Combine($NuGetClientRoot, 'src', 'NuGet.Core', 'NuGet.Build.Tasks', 'NuGet.RestoreEx.targets')
$ilmergedCorePackTasks = [System.IO.Path]::Combine($NuGetClientRoot, 'artifacts', 'NuGet.Build.Tasks.Pack', 'bin', $Configuration, $NETStandard, "ilmerge", "NuGet.Build.Tasks.Pack.dll")
$ilmergedFrameworkPackTasks = [System.IO.Path]::Combine($NuGetClientRoot, 'artifacts', 'NuGet.Build.Tasks.Pack', 'bin', $Configuration, $NETFramework, "ilmerge", "NuGet.Build.Tasks.Pack.dll")
$nugetPackTargets = [System.IO.Path]::Combine($NuGetClientRoot, 'src', 'NuGet.Core', 'NuGet.Build.Tasks.Pack', 'NuGet.Build.Tasks.Pack.targets')
$msbuildSdkResolverTasks = [System.IO.Path]::Combine($NuGetClientRoot, 'artifacts', 'Microsoft.Build.NuGetSdkResolver', 'bin', $Configuration, $NETCoreApp, 'Microsoft.Build.NuGetSdkResolver.dll')
<# //////////////////////////////////////////////////////////
// Start - Chocolatey Specific Modification
//////////////////////////////////////////////////////////
#>
$msbuildSdkResolverTasks = [System.IO.Path]::Combine($NuGetClientRoot, 'artifacts', 'Microsoft.Build.NuGetSdkResolver', 'bin', $Configuration, $NETCoreApp, 'Chocolatey.Microsoft.Build.NuGetSdkResolver.dll')
<# //////////////////////////////////////////////////////////
// End - Chocolatey Specific Modification
//////////////////////////////////////////////////////////
#>


if (-Not (Test-Path $nugetXplatArtifactsPath)) {
Expand Down Expand Up @@ -152,7 +192,15 @@ Function Add-NuGetToCLI {

## Copy the restore artifacts

$buildTasksDest = "$($sdk_path)\NuGet.Build.Tasks.dll"
<# //////////////////////////////////////////////////////////
// Start - Chocolatey Specific Modification
//////////////////////////////////////////////////////////
#>
$buildTasksDest = "$($sdk_path)\Chocolatey.NuGet.Build.Tasks.dll"
<# //////////////////////////////////////////////////////////
// End - Chocolatey Specific Modification
//////////////////////////////////////////////////////////
#>
Write-Host "Moving to - $($buildTasksDest)"
Copy-Item $nugetBuildTasks $buildTasksDest

Expand Down Expand Up @@ -190,7 +238,15 @@ Function Add-NuGetToCLI {

## Copy the resolver

$msbuildSdkResolverTasksDest = "$($sdk_path)\Microsoft.Build.NuGetSdkResolver.dll"
<# //////////////////////////////////////////////////////////
// Start - Chocolatey Specific Modification
//////////////////////////////////////////////////////////
#>
$msbuildSdkResolverTasksDest = "$($sdk_path)\Chocolatey.Microsoft.Build.NuGetSdkResolver.dll"
<# //////////////////////////////////////////////////////////
// End - Chocolatey Specific Modification
//////////////////////////////////////////////////////////
#>
Write-Host "Moving to - $($msbuildSdkResolverTasksDest)"
Copy-Item $msbuildSdkResolverTasks $msbuildSdkResolverTasksDest
}
Expand Down
10 changes: 9 additions & 1 deletion scripts/perftests/PerformanceTestUtilities.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,15 @@ Function GetClientVersion([string] $nugetClientFilePath)
ElseIf($(IsClientMSBuildExe $nugetClientFilePath))
{
$clientDir = Split-Path -Path $nugetClientFilePath
$nugetClientPath = Resolve-Path (Join-Path -Path $clientDir -ChildPath "../../../Common7/IDE/CommonExtensions/Microsoft/NuGet/NuGet.Build.Tasks.dll")
<# //////////////////////////////////////////////////////////
// Start - Chocolatey Specific Modification
//////////////////////////////////////////////////////////
#>
$nugetClientPath = Resolve-Path (Join-Path -Path $clientDir -ChildPath "../../../Common7/IDE/CommonExtensions/Microsoft/NuGet/Chocolatey.NuGet.Build.Tasks.dll")
<# //////////////////////////////////////////////////////////
// End - Chocolatey Specific Modification
//////////////////////////////////////////////////////////
#>
$versionInfo = Get-ChildItem $nugetClientPath | % versioninfo | Select-Object FileVersion
Return $(($versionInfo -split '\n')[0]).TrimStart("@{").TrimEnd('}').Substring("FileVersion=".Length)
}
Expand Down
Loading

0 comments on commit 44e751b

Please sign in to comment.