Update csproj files to the latest version of the package references (#5961)

* Add function which tells you packages which probably need to be updated
This commit is contained in:
Travis Plunk
2018-01-22 12:06:50 -08:00
committed by GitHub
parent 4b09a93676
commit a603cf3867
9 changed files with 75 additions and 18 deletions
@@ -68,7 +68,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.ServiceProcess.ServiceController" Version="4.4.0" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="4.4.1" />
</ItemGroup>
</Project>
@@ -77,7 +77,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.3.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.6.1" />
</ItemGroup>
</Project>
@@ -23,7 +23,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Security.Principal.Windows" Version="4.4.0" />
<PackageReference Include="System.Security.Principal.Windows" Version="4.4.1" />
</ItemGroup>
</Project>
@@ -15,17 +15,17 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Data.SqlClient" Version="4.4.0" />
<PackageReference Include="System.IO.Packaging" Version="4.4.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.4.2" />
<PackageReference Include="System.IO.Packaging" Version="4.4.1" />
<PackageReference Include="System.Net.Http.WinHttpHandler" Version="4.4.0" />
<PackageReference Include="System.ServiceModel.Duplex" Version="4.4.0" />
<PackageReference Include="System.ServiceModel.Http" Version="4.4.0" />
<PackageReference Include="System.ServiceModel.NetTcp" Version="4.4.0" />
<PackageReference Include="System.ServiceModel.Primitives" Version="4.4.0" />
<PackageReference Include="System.ServiceModel.Security" Version="4.4.0" />
<PackageReference Include="System.ServiceModel.Duplex" Version="4.4.1" />
<PackageReference Include="System.ServiceModel.Http" Version="4.4.1" />
<PackageReference Include="System.ServiceModel.NetTcp" Version="4.4.1" />
<PackageReference Include="System.ServiceModel.Primitives" Version="4.4.1" />
<PackageReference Include="System.ServiceModel.Security" Version="4.4.1" />
<PackageReference Include="System.Text.Encodings.Web" Version="4.4.0" />
<PackageReference Include="System.Threading.AccessControl" Version="4.4.0" />
<PackageReference Include="System.Private.ServiceModel" Version="4.4.0" />
<PackageReference Include="System.Private.ServiceModel" Version="4.4.1" />
<PackageReference Include="Microsoft.NETCore.Windows.ApiSets" Version="1.0.1" />
</ItemGroup>
@@ -8,7 +8,7 @@
<ItemGroup>
<ProjectReference Include="..\System.Management.Automation\System.Management.Automation.csproj" />
<ProjectReference Include="..\Microsoft.WSMan.Runtime\Microsoft.WSMan.Runtime.csproj" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="4.4.0" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="4.4.1" />
</ItemGroup>
<PropertyGroup>
@@ -11,9 +11,9 @@
<PackageReference Include="Microsoft.Win32.Registry.AccessControl" Version="4.4.0" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="4.4.0" />
<PackageReference Include="System.Security.AccessControl" Version="4.4.0" />
<PackageReference Include="System.Security.AccessControl" Version="4.4.1" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="4.4.0" />
<PackageReference Include="System.Security.Permissions" Version="4.4.0" />
<PackageReference Include="System.Security.Permissions" Version="4.4.1" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.4.0" />
<PackageReference Include="Microsoft.Management.Infrastructure" Version="1.0.0-alpha*" />
<PackageReference Include="PowerShell.Core.Instrumentation" Version="6.0.0-beta*" />
+2 -2
View File
@@ -21,9 +21,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="xunit" Version="2.3.0" />
<PackageReference Include="xunit" Version="2.3.1" />
<!-- DotNetCliToolReference element specifies the CLI tool that the user wants to restore in the context of the project. -->
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
<PackageReference Include="Xunit.SkippableFact" Version="1.3.3" />
</ItemGroup>
+1 -1
View File
@@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.5" />
</ItemGroup>
<ItemGroup>
+58 -1
View File
@@ -189,4 +189,61 @@ function Get-ChangeLog
$new_commits | Sort-Object -Descending -Property IsBreakingChange | ForEach-Object -MemberName ChangeLogMessage
}
Export-ModuleMember -Function Get-ChangeLog
##############################
#.SYNOPSIS
#Gets packages which have newer packages in nuget.org
#
#.PARAMETER Path
#The path to check for csproj files with packagse
#
#.OUTPUTS
#Objects which represet the csproj package ref, with the current and new version
##############################
function Get-NewOfficalPackage
{
param(
[String]
$Path = (Join-path -Path $PSScriptRoot -ChildPath '..')
)
# Calculate the filter to find the CSProj files
$filter = Join-Path -Path $Path -ChildPath '*.csproj'
$csproj = Get-ChildItem $filter -Recurse
$csproj | ForEach-Object{
$file = $_
# parse the csproj
[xml] $csprojXml = (Get-content -Raw -Path $_)
# get the package references
$packages=$csprojXml.Project.ItemGroup.PackageReference
# check to see if there is a newer package for each refernce
foreach($package in $packages)
{
# Get the name of the package
$name = $package.Include
# don't pull 'Microsoft.Management.Infrastructure' from nuget
if($name -and $name -ne 'Microsoft.Management.Infrastructure')
{
# Get the current package from nuget
$newPackage = find-package -Name $name -Source https://nuget.org/api/v2/ -ErrorAction SilentlyContinue
# If the current package has a different version from the version in the csproj, print the details
if($newPackage -and $newPackage.Version.ToString() -ne $package.version)
{
[pscustomobject]@{
Csproj = $file
PackageName = $name
CsProjVersion = $Package.Version
NuGetVersion = $newPackage.Version
}
}
}
}
}
}
Export-ModuleMember -Function Get-ChangeLog, Get-NewOfficalPackage