mirror of
https://github.com/aphrody-labs/NuGet.Client.git
synced 2026-10-14 13:29:05 +00:00
* shuffled some types into different assemblies in n.client assemblies so that they can be shared from n.tools and n.vs.oe.client * Improve error output in E2E tests * add trap to RealTimeLogResults * fix null ref in e2e tests and improve trap * ensure DLL is built before we try to load it during build to get strong name * Use BuildVariationFolder instead of VisualStudioVersion property
48 lines
1.7 KiB
PowerShell
48 lines
1.7 KiB
PowerShell
param (
|
|
[Parameter(Mandatory = $True)]
|
|
[string] $NuGetPackageManagementPowerShellCmdletsFilePath,
|
|
[Parameter(Mandatory = $True)]
|
|
[string] $ManifestModuleSourceFilePath,
|
|
[Parameter(Mandatory = $True)]
|
|
[string] $ManifestModuleDestinationFilePath)
|
|
|
|
trap
|
|
{
|
|
Write-Error ($_.Exception | Format-List -Force | Out-String) -ErrorAction Continue
|
|
Write-Error ($_.InvocationInfo | Format-List -Force | Out-String) -ErrorAction Continue
|
|
exit 1
|
|
}
|
|
|
|
$assembly = [System.Reflection.Assembly]::LoadFile($NuGetPackageManagementPowerShellCmdletsFilePath)
|
|
|
|
[string] $manifestModuleFileContents = [System.IO.File]::ReadAllText($ManifestModuleSourceFilePath)
|
|
|
|
$from = 'NuGet.PackageManagement.PowerShellCmdlets.dll'
|
|
$to = $assembly.FullName
|
|
|
|
Write-Host "Source file: $ManifestModuleSourceFilePath"
|
|
Write-Host "Destination file: $ManifestModuleSourceFilePath"
|
|
Write-Host "Replacing `'$from`' with `'$to`'"
|
|
|
|
$startIndex = $manifestModuleFileContents.IndexOf($from)
|
|
|
|
If ($startIndex -eq -1)
|
|
{
|
|
Throw [System.Exception]::new("No occurrences of `'$from`' found in $ManifestModuleSourceFilePath")
|
|
}
|
|
|
|
$manifestModuleFileContents = $manifestModuleFileContents.Replace($from, $to)
|
|
|
|
$startIndex = $manifestModuleFileContents.IndexOf($from, $startIndex + 1)
|
|
|
|
If ($startIndex -ne -1)
|
|
{
|
|
Throw [System.Exception]::new("Extra occurrences of `'$from`' found in $ManifestModuleSourceFilePath")
|
|
}
|
|
|
|
$ManifestModuleDestinationFile = [System.IO.FileInfo]::new($ManifestModuleDestinationFilePath)
|
|
|
|
[System.IO.Directory]::CreateDirectory($ManifestModuleDestinationFile.DirectoryName) | Out-Null
|
|
|
|
[System.IO.File]::WriteAllText($ManifestModuleDestinationFilePath, $manifestModuleFileContents)
|