mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-23 01:34:19 +08:00
Add a way to use only NuGet feed sources (#24528)
* Update build.psm1 * update default feeds * fix issue with cgmanifest having duplicate existing entries * update pattern
This commit is contained in:
parent
3f51dfa603
commit
adac4c7117
15
build.psm1
15
build.psm1
@ -740,7 +740,7 @@ function Switch-PSNugetConfig {
|
|||||||
param(
|
param(
|
||||||
[Parameter(Mandatory = $true, ParameterSetName = 'user')]
|
[Parameter(Mandatory = $true, ParameterSetName = 'user')]
|
||||||
[Parameter(Mandatory = $true, ParameterSetName = 'nouser')]
|
[Parameter(Mandatory = $true, ParameterSetName = 'nouser')]
|
||||||
[ValidateSet('Public', 'Private')]
|
[ValidateSet('Public', 'Private', 'NuGetOnly')]
|
||||||
[string] $Source,
|
[string] $Source,
|
||||||
|
|
||||||
[Parameter(Mandatory = $true, ParameterSetName = 'user')]
|
[Parameter(Mandatory = $true, ParameterSetName = 'user')]
|
||||||
@ -760,16 +760,19 @@ function Switch-PSNugetConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$dotnetSdk = [NugetPackageSource] @{Url = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v2'; Name = 'dotnet' }
|
||||||
|
$gallery = [NugetPackageSource] @{Url = 'https://www.powershellgallery.com/api/v2/'; Name = 'psgallery' }
|
||||||
|
$nugetorg = [NugetPackageSource] @{Url = 'https://api.nuget.org/v3/index.json'; Name = 'nuget.org' }
|
||||||
if ( $Source -eq 'Public') {
|
if ( $Source -eq 'Public') {
|
||||||
$dotnetSdk = [NugetPackageSource] @{Url = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v2'; Name = 'dotnet' }
|
|
||||||
$gallery = [NugetPackageSource] @{Url = 'https://www.powershellgallery.com/api/v2/'; Name = 'psgallery' }
|
|
||||||
$nugetorg = [NugetPackageSource] @{Url = 'https://api.nuget.org/v3/index.json'; Name = 'nuget.org' }
|
|
||||||
|
|
||||||
New-NugetConfigFile -NugetPackageSource $nugetorg, $dotnetSdk -Destination "$PSScriptRoot/" @extraParams
|
New-NugetConfigFile -NugetPackageSource $nugetorg, $dotnetSdk -Destination "$PSScriptRoot/" @extraParams
|
||||||
New-NugetConfigFile -NugetPackageSource $gallery -Destination "$PSScriptRoot/src/Modules/" @extraParams
|
New-NugetConfigFile -NugetPackageSource $gallery -Destination "$PSScriptRoot/src/Modules/" @extraParams
|
||||||
New-NugetConfigFile -NugetPackageSource $gallery -Destination "$PSScriptRoot/test/tools/Modules/" @extraParams
|
New-NugetConfigFile -NugetPackageSource $gallery -Destination "$PSScriptRoot/test/tools/Modules/" @extraParams
|
||||||
|
} elseif ( $Source -eq 'NuGetOnly') {
|
||||||
|
New-NugetConfigFile -NugetPackageSource $nugetorg -Destination "$PSScriptRoot/" @extraParams
|
||||||
|
New-NugetConfigFile -NugetPackageSource $gallery -Destination "$PSScriptRoot/src/Modules/" @extraParams
|
||||||
|
New-NugetConfigFile -NugetPackageSource $gallery -Destination "$PSScriptRoot/test/tools/Modules/" @extraParams
|
||||||
} elseif ( $Source -eq 'Private') {
|
} elseif ( $Source -eq 'Private') {
|
||||||
$powerShellPackages = [NugetPackageSource] @{Url = 'https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShell-7-5-preview-test-2/nuget/v3/index.json'; Name = 'powershell' }
|
$powerShellPackages = [NugetPackageSource] @{Url = 'https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShell/nuget/v3/index.json'; Name = 'powershell' }
|
||||||
|
|
||||||
New-NugetConfigFile -NugetPackageSource $powerShellPackages -Destination "$PSScriptRoot/" @extraParams
|
New-NugetConfigFile -NugetPackageSource $powerShellPackages -Destination "$PSScriptRoot/" @extraParams
|
||||||
New-NugetConfigFile -NugetPackageSource $powerShellPackages -Destination "$PSScriptRoot/src/Modules/" @extraParams
|
New-NugetConfigFile -NugetPackageSource $powerShellPackages -Destination "$PSScriptRoot/src/Modules/" @extraParams
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<packageSources>
|
<packageSources>
|
||||||
<clear />
|
<clear />
|
||||||
<add key="powershell" value="https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShell-7-5-preview-test-2/nuget/v3/index.json" />
|
<add key="powershell" value="https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShell/nuget/v3/index.json" />
|
||||||
</packageSources>
|
</packageSources>
|
||||||
<disabledPackageSources>
|
<disabledPackageSources>
|
||||||
<clear />
|
<clear />
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<packageSources>
|
<packageSources>
|
||||||
<clear />
|
<clear />
|
||||||
<add key="powershell" value="https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShell-7-5-preview-test-2/nuget/v3/index.json" />
|
<add key="powershell" value="https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShell/nuget/v3/index.json" />
|
||||||
</packageSources>
|
</packageSources>
|
||||||
<disabledPackageSources>
|
<disabledPackageSources>
|
||||||
<clear />
|
<clear />
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<packageSources>
|
<packageSources>
|
||||||
<clear />
|
<clear />
|
||||||
<add key="powershell" value="https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShell-7-5-preview-test-2/nuget/v3/index.json" />
|
<add key="powershell" value="https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShell/nuget/v3/index.json" />
|
||||||
</packageSources>
|
</packageSources>
|
||||||
<disabledPackageSources>
|
<disabledPackageSources>
|
||||||
<clear />
|
<clear />
|
||||||
|
@ -26,7 +26,9 @@ $existingRegistrationsJson.Registrations | ForEach-Object {
|
|||||||
$registration = [Registration]$_
|
$registration = [Registration]$_
|
||||||
if ($registration.Component) {
|
if ($registration.Component) {
|
||||||
$name = $registration.Component.Name()
|
$name = $registration.Component.Name()
|
||||||
$existingRegistrationTable.Add($name, $registration)
|
if (!$existingRegistrationTable.ContainsKey($name)) {
|
||||||
|
$existingRegistrationTable.Add($name, $registration)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,7 +105,7 @@ function ConvertTo-SemVer {
|
|||||||
So, I'm making the logic work for that scenario by
|
So, I'm making the logic work for that scenario by
|
||||||
thorwing away any part that doesn't match non-pre-release semver portion
|
thorwing away any part that doesn't match non-pre-release semver portion
|
||||||
#>
|
#>
|
||||||
$null = $Version -match '^(\d+\.\d+\.\d+)).*'
|
$null = $Version -match '^(\d+\.\d+\.\d+).*'
|
||||||
$desiredVersion = $matches[1]
|
$desiredVersion = $matches[1]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user