Skip to content

Conversation

@TravisEz13
Copy link
Member

@TravisEz13 TravisEz13 commented Jan 19, 2018

PR Summary

Update csproj files to the lates version of the package references

Fixes #5957

PR Checklist

Note: Please mark anything not applicable to this PR NA.

@bergmeister
Copy link
Contributor

Is this PR also to close #5957 ?

@adityapatwardhan adityapatwardhan changed the title Update csproj files to the lates version of the package references Update csproj files to the latest version of the package references Jan 19, 2018
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
Copy link
Contributor

@bergmeister bergmeister Jan 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'donet add package' apparently handles updating nuget packages as well. We should not re-invent the wheel when it comes to getting/updating nuget packages in csproj (I assume that this is the end goal for which this function is written for)

$Path = (Join-path -Path $PSScriptRoot -ChildPath '..')
)
# Calculate the filter to find the CSProj files
$path = Join-path -Path $PSScriptRoot -ChildPath '..'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You override the path argument passed in by the caller.

)
# Calculate the filter to find the CSProj files
$path = Join-path -Path $PSScriptRoot -ChildPath '..'
$filter = Join-Path -Path $path -ChildPath '*.csproj'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: change $path to $Path because the parameter is $Path

@TravisEz13
Copy link
Member Author

@bergmeister I reverted some of my changes and tried donet add package and it did not update the reference.

@iSazonov
Copy link
Collaborator

What is our policy - how frequently we should check existence of new packages ?

#.OUTPUTS
#Objects which represet the csproj package ref, with the current and new version
##############################
function Get-NewPackage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please change the name to Get-NewOfficalPackage?

Copy link
Member

@daxian-dbw daxian-dbw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Left one unblocking comment

@daxian-dbw
Copy link
Member

@iSazonov The guideline in practice is:

  • When moving powershell to target a preview version of .NET Core runtime, all package references need to be updated to use the versions come from the same build of the .NET Core runtime (will be from the dotnet-core myget feed). This is to guarantee that all packages are in sync.
  • When moving powershell to target an official .NET Core runtime, all package references need to be updated to use the latest stable versions from nuget.org.

@TravisEz13 TravisEz13 merged commit a603cf3 into PowerShell:6.0.1 Jan 22, 2018
@TravisEz13 TravisEz13 deleted the fix_csproj branch January 22, 2018 20:06
@daxian-dbw daxian-dbw mentioned this pull request Jan 23, 2018
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants