-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix P2P migration and migrate folders in global.json #4305
Conversation
41fa05a to
56b0e38
Compare
| namespace Microsoft.DotNet.ProjectJsonMigration | ||
| { | ||
| internal class ProjectDependencyFinder | ||
| public class ProjectDependencyFinder |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| var dependencies = settings["dependencies"] as JObject; | ||
|
|
||
| globalSettings.ProjectPaths = projects == null ? new string[] { } : projects.Select(a => a.Value<string>()).ToArray();; | ||
| globalSettings.ProjectPaths = projects == null ? new string[] { } : projects.Select(a => a.Value<string>()).ToArray(); ; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| var projectDirectory = Path.GetDirectoryName(project); | ||
| var outputDirectory = projectDirectory; | ||
| var migrationSettings = new MigrationSettings(projectDirectory, outputDirectory, sdkVersion, msBuildTemplate, _xprojFilePath); | ||
| var migrationSettings = new MigrationSettings(projectDirectory, outputDirectory, sdkVersion, msBuildTemplate.DeepClone(), _xprojFilePath); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| throw new Exception($"Unable to find global settings file at {globalJson}"); | ||
| } | ||
|
|
||
| var searchPaths = ProjectDependencyFinder.GetGlobalPaths(Path.GetDirectoryName(globalJson)); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| " If a directory is specified, then it will recursively search for project.json files to migrate." + | ||
| " Defaults to current directory if nothing is specified."); | ||
| CommandArgument projectArgument = app.Argument("<PROJECT_JSON/GLOBAL_JSON/PROJECT_DIR>", | ||
| "The path to " + Environment.NewLine + |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| Exception exc = null; | ||
| IEnumerable<ProjectDependency> projectDependencies = null; | ||
|
|
||
| var tempMSBuildProjectTemplate = rootSettings.MSBuildProjectTemplate.DeepClone(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
1 similar comment
|
|
| var projectExportName = projectExport.Library.Identity.Name; | ||
| ProjectDependency projectDependency; | ||
|
|
||
| if (preResolvedProjects.Contains(projectExportName)) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Fixes #4269 by deep cloning the MsbuildTemplateProject for each P2P reference. Add test which migrates and builds P2P references.
56b0e38 to
15a6730
Compare
|
@dotnet-bot Test OSX x64 Release Build |
15a6730 to
c606467
Compare
Fixes #4269 by deep cloning the MsbuildTemplateProject for each P2P reference. Add test which migrates and builds P2P references.
@brthor @livarcocc @eerhardt