Add script to generate cgmanifest.json (#16278)

This commit is contained in:
Travis Plunk 2021-10-19 17:27:44 -07:00 committed by GitHub
parent 5d447cb773
commit b08ab5afea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 2134 additions and 1692 deletions

File diff suppressed because it is too large Load diff

View file

@ -2,47 +2,40 @@
## Copy this into the additional attributions fields
## Copy everything below here, but do not include this line
---------------------------------------------
File: PSReadLine
---------------------------------------------
-------------------------------------------------
Microsoft.PowerShell.Archive
-------------------------------------------------
https://github.com/lzybkr/PSReadLine
Copyright (c) 2016 Microsoft Corporation.
Copyright (c) 2013, Jason Shirk
The MIT License (MIT)
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
BSD License
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
-------------------------------------------------
Microsoft.Management.Infrastructure.Runtime.Unix
Microsoft.Management.Infrastructure
-------------------------------------------------
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (c) Microsoft Corporation
----------------------------------------------
File: Hashtables from ConvertFrom-json
----------------------------------------------
https://stackoverflow.com/questions/22002748/hashtables-from-convertfrom-json-have-different-type-from-powershells-built-in-h
Copyright (c) 2015 Dave Wyatt. All rights reserved.
All rights reserved.
All rights reserved.
MIT License
@ -52,33 +45,6 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-------------------------------------------------
PackageManagement
-------------------------------------------------
Copyright (c) Microsoft Corporation
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the Software), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
--------------------------------------------------------
• NuGet.Common
• NuGet.Configuration
@ -108,3 +74,116 @@ Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-------------------------------------------------
PackageManagement
-------------------------------------------------
Copyright (c) Microsoft Corporation
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the Software), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-------------------------------------------------
PowerShellGet
-------------------------------------------------
Copyright (c) Microsoft Corporation
All rights reserved.
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---------------------------------------------
File: PSReadLine
---------------------------------------------
https://github.com/PowerShell/PSReadLine
Copyright (c) 2013, Jason Shirk
All rights reserved.
BSD License
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------
ThreadJob
-------------------------------------------------
Copyright (c) 2018 Paul Higinbotham
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -4,68 +4,8 @@
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "Microsoft.Management.Infrastructure.Runtime.Unix",
"Version": "2.0.0"
}
},
"DevelopmentDependency": true
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "Microsoft.Management.Infrastructure",
"Version": "2.0.0"
}
},
"DevelopmentDependency": true
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "ThreadJob",
"Version": "2.0.3"
}
},
"DevelopmentDependency": true
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "Microsoft.PowerShell.Archive",
"Version": "1.2.5"
}
},
"DevelopmentDependency": true
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "PackageManagement",
"Version": "1.4.7"
}
},
"DevelopmentDependency": true
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "PowerShellGet",
"Version": "2.2.5"
}
},
"DevelopmentDependency": true
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "PSReadLine",
"Version": "2.1.0"
"Name": "Microsoft.CodeAnalysis.Common",
"Version": "4.0.0-5.final"
}
},
"DevelopmentDependency": false
@ -78,7 +18,607 @@
"Version": "4.0.0-5.final"
}
},
"DevelopmentDependency": true
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "Microsoft.CSharp",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "Microsoft.Management.Infrastructure.Runtime.Unix",
"Version": "2.0.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "Microsoft.Management.Infrastructure.Runtime.Win",
"Version": "2.0.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "Microsoft.Management.Infrastructure",
"Version": "2.0.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "Microsoft.NETCore.Platforms",
"Version": "1.1.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "Microsoft.NETCore.Targets",
"Version": "1.1.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "Microsoft.NETCore.Windows.ApiSets",
"Version": "1.0.1"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "Microsoft.Win32.Registry",
"Version": "4.7.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "runtime.any.System.Collections",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "runtime.any.System.Globalization",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "runtime.any.System.IO",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "runtime.any.System.Reflection.Extensions",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "runtime.any.System.Reflection.Primitives",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "runtime.any.System.Reflection",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "runtime.any.System.Resources.ResourceManager",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "runtime.any.System.Runtime.Handles",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "runtime.any.System.Runtime.InteropServices",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "runtime.any.System.Runtime",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "runtime.any.System.Text.Encoding",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "runtime.any.System.Threading.Tasks",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "runtime.win-arm64.runtime.native.System.Data.SqlClient.sni",
"Version": "4.4.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "runtime.win-x64.runtime.native.System.Data.SqlClient.sni",
"Version": "4.4.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "runtime.win-x86.runtime.native.System.Data.SqlClient.sni",
"Version": "4.4.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "runtime.win.System.Diagnostics.Debug",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "runtime.win.System.Runtime.Extensions",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "runtime.win7-x64.Microsoft.NETCore.Windows.ApiSets",
"Version": "1.0.1"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "runtime.win7.System.Private.Uri",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Collections.Immutable",
"Version": "5.0.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Collections",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Diagnostics.Debug",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Diagnostics.DiagnosticSource",
"Version": "5.0.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Dynamic.Runtime",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Globalization",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.IO",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Linq.Expressions",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Linq",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Memory",
"Version": "4.5.4"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Numerics.Vectors",
"Version": "4.5.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.ObjectModel",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Private.Uri",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Reflection.DispatchProxy",
"Version": "4.7.1"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Reflection.Emit.ILGeneration",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Reflection.Emit.Lightweight",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Reflection.Emit",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Reflection.Extensions",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Reflection.Metadata",
"Version": "5.0.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Reflection.Primitives",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Reflection.TypeExtensions",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Reflection",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Resources.ResourceManager",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Runtime.Extensions",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Runtime.Handles",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Runtime.InteropServices",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Runtime",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Security.Principal.Windows",
"Version": "6.0.0-preview.5.21301.5"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Text.Encoding.CodePages",
"Version": "6.0.0-rc.2.21480.5"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Text.Encoding",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Threading.Tasks.Extensions",
"Version": "4.5.4"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Threading.Tasks",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "nuget",
"Nuget": {
"Name": "System.Threading",
"Version": "4.3.0"
}
},
"DevelopmentDependency": false
}
]
}

View file

@ -0,0 +1,136 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# Requires the module dotnet.project.assets from the PowerShell Gallery authored by @TravisEz13
import-module dotnet.project.assets
Class Registration {
[Component]$Component
[bool]$DevelopmentDependency
}
Class Component {
[ValidateSet("nuget")]
[String] $Type
[Nuget]$Nuget
[string]ToString() {
$message = "Type: $($this.Type)"
if ($this.Type -eq "nuget") {
$message += "; $($this.Nuget)"
}
return $message
}
[string]Name() {
switch ($this.Type) {
"nuget" {
return $($this.Nuget.Name)
}
default {
throw "Unknown component type: $($this.Type)"
}
}
throw "How did we get here?!?"
}
[string]Version() {
switch ($this.Type) {
"nuget" {
return $($this.Nuget.Version)
}
default {
throw "Unknown component type: $($this.Type)"
}
}
throw "How did we get here?!?"
}
}
Class Nuget {
[string]$Name
[string]$Version
[string]ToString() {
return "$($this.Name) - $($this.Version)"
}
}
function New-NugetComponent {
param(
[string]$name,
[string]$version
)
$nuget = [Nuget]@{
Name = $name
Version = $version
}
$Component = [Component]@{
Type = "nuget"
Nuget = $nuget
}
$registration = [Registration]@{
Component = $Component
DevelopmentDependency = $false
}
return $registration
}
$existingRegistrationTable = @{}
$newRegistrations = @()
$existingRegistrationsJson = Get-Content $PSScriptRoot\..\cgmanifest.json | ConvertFrom-Json -AsHashtable
$existingRegistrationsJson.Registrations | ForEach-Object {
$registration = [Registration]$_
$existingRegistrationTable.Add($registration.Component.Name(), $registration)
$newRegistrations += $registration
}
Get-PSDrive -Name pwsh-win-core -ErrorAction Ignore | Remove-PSDrive
Push-Location $PSScriptRoot\..\src\powershell-win-core
$null = dotnet restore
$null = New-PADrive -Path $PSScriptRoot\..\src\powershell-win-core\obj\project.assets.json -Name pwsh-win-core
$targets = Get-ChildItem -Path 'pwsh-win-core:/targets/net6.0-windows7.0|win7-x64' | Where-Object {
$_.Type -eq 'package' -and
$_.Name -notlike 'DotNetAnalyzers.DocumentationAnalyzers*' -and
$_.Name -notlike 'StyleCop*' -and
$_.Name -notlike 'Microsoft.CodeAnalysis.Analyzers*' -and
$_.Name -notlike 'Microsoft.CodeAnalysis.NetAnalyzers*'
} | select-object -ExpandProperty name
Pop-Location
Get-PSDrive -Name pwsh-win-core | Remove-PSDrive
$updateRegistrations = @()
$targets | ForEach-Object {
$target = $_
$parts = ($target -split '\|')
$name = $parts[0]
$targetVersion = $parts[1]
$pattern = [regex]::Escape($name) + " "
$tpnMatch = select-string -Path $PSScriptRoot\..\ThirdPartyNotices.txt -Pattern $pattern
if (!$tpnMatch) {
if ($existingRegistrationTable.ContainsKey($name)) {
$registrationVersion = $existingRegistrationTable.$name.Component.Version()
if ($registrationVersion -ne $targetVersion) {
$registration = New-NugetComponent -Name $name -Version $targetVersion
$updateRegistrations += $registration
} else {
Write-Verbose "$target already registered: $registrationVersion" -Verbose
}
} else {
$registration = New-NugetComponent -Name $name -Version $targetVersion
$newRegistrations += $registration
}
}
}
if ($updateRegistrations.count -gt 0) {
#TODO delete existing and add new registration
throw "updating registrations is not implemented"
}
$newCount = $newRegistrations.count - $existingRegistrationTable.count
@{Registrations = $newRegistrations } | ConvertTo-Json -depth 99 | Set-Content $PSScriptRoot\..\cgmanifest.json
Write-Verbose "$newCount registrations added" -Verbose