-
Notifications
You must be signed in to change notification settings - Fork 927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update referenced projects during a run of NuGetUpdater. #9097
Conversation
764cfc1
to
7eacd94
Compare
|
||
// update all dependencies, including transitive | ||
var buildFiles = await MSBuildHelper.LoadBuildFiles(repoRootPath, projectPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in this file are mostly just grouping logic into methods to make this more readable.
var projectRootElement = ProjectRootElement.Open(projFilePath); | ||
projectStack.Push((Path.GetFullPath(Path.GetDirectoryName(projFilePath)!), projectRootElement)); | ||
} | ||
catch (InvalidProjectFileException) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed to guard against invalid projects in this method because we are now looking for project paths before processing the project.
var projectFilePaths = MSBuildHelper.GetProjectPathsFromProject(projectPath); | ||
foreach (var projectFullPath in projectFilePaths.Concat([projectPath])) | ||
{ | ||
// If there is some MSBuild logic that needs to run to fully resolve the path skip the project | ||
if (File.Exists(projectFullPath)) | ||
{ | ||
await RunUpdaterAsync(repoRootPath, projectFullPath, dependencyName, previousDependencyVersion, newDependencyVersion, isTransitive); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the heart of the change. We now collect referenced projects and update them as we do for dirs.proj.
…dabot/dependabot-core into joerobich/updateReferencedProjects
Hi I'll merge this once CI is passing |
There was an assumption being made in the Ruby side of the NuGet updater that runs of the native updater were updating the target project and referenced projects. The ruby side would then mark the referenced projects as processed and not attempt to update them separately. Whereas this assumption was true for dirs.proj files it was not true for .csproj, .vbproj, etc... This PR bring the two different ways of processing into alignment and makes the assumption true for all project files.