diff --git a/.gitignore b/.gitignore index 27def2cb6..3fc22dc00 100644 --- a/.gitignore +++ b/.gitignore @@ -295,4 +295,9 @@ test/PackagedCommands/Consumers/*/project.json *.*~ # VS generated files -launchSettings.json \ No newline at end of file +launchSettings.json + +# user files used in tests +!TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/TestLibrary.xproj.user +!TestAssets/TestProjects/TestAppWithLibrary/TestApp/TestApp.xproj.user +!TestAssets/TestProjects/PJTestAppSimple/PJTestAppSimple.xproj.user diff --git a/TestAssets/TestProjects/PJTestAppSimple/PJTestAppSimple.xproj b/TestAssets/TestProjects/PJTestAppSimple/PJTestAppSimple.xproj new file mode 100644 index 000000000..53f0c8b7a --- /dev/null +++ b/TestAssets/TestProjects/PJTestAppSimple/PJTestAppSimple.xproj @@ -0,0 +1,18 @@ + + + + 14.0.23107 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + 0138cb8f-4aa9-4029-a21e-c07c30f425ba + TestAppWithContents + ..\..\..\artifacts\obj\$(MSBuildProjectName) + ..\..\..\artifacts\ + + + 2.0 + + + \ No newline at end of file diff --git a/TestAssets/TestProjects/PJTestAppSimple/PJTestAppSimple.xproj.user b/TestAssets/TestProjects/PJTestAppSimple/PJTestAppSimple.xproj.user new file mode 100644 index 000000000..efbe88aa6 --- /dev/null +++ b/TestAssets/TestProjects/PJTestAppSimple/PJTestAppSimple.xproj.user @@ -0,0 +1 @@ +Ok, it's true. Didn't have an xproj user file handy and needed the file to exist so a test can show it gets moved to backup. \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppWithLibrary/TestApp/TestApp.xproj b/TestAssets/TestProjects/TestAppWithLibrary/TestApp/TestApp.xproj new file mode 100644 index 000000000..53f0c8b7a --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithLibrary/TestApp/TestApp.xproj @@ -0,0 +1,18 @@ + + + + 14.0.23107 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + 0138cb8f-4aa9-4029-a21e-c07c30f425ba + TestAppWithContents + ..\..\..\artifacts\obj\$(MSBuildProjectName) + ..\..\..\artifacts\ + + + 2.0 + + + \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppWithLibrary/TestApp/TestApp.xproj.user b/TestAssets/TestProjects/TestAppWithLibrary/TestApp/TestApp.xproj.user new file mode 100644 index 000000000..efbe88aa6 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithLibrary/TestApp/TestApp.xproj.user @@ -0,0 +1 @@ +Ok, it's true. Didn't have an xproj user file handy and needed the file to exist so a test can show it gets moved to backup. \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/TestLibrary.xproj b/TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/TestLibrary.xproj new file mode 100644 index 000000000..53f0c8b7a --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/TestLibrary.xproj @@ -0,0 +1,18 @@ + + + + 14.0.23107 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + 0138cb8f-4aa9-4029-a21e-c07c30f425ba + TestAppWithContents + ..\..\..\artifacts\obj\$(MSBuildProjectName) + ..\..\..\artifacts\ + + + 2.0 + + + \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/TestLibrary.xproj.user b/TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/TestLibrary.xproj.user new file mode 100644 index 000000000..efbe88aa6 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/TestLibrary.xproj.user @@ -0,0 +1 @@ +Ok, it's true. Didn't have an xproj user file handy and needed the file to exist so a test can show it gets moved to backup. \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/MigrateCommand.cs b/src/dotnet/commands/dotnet-migrate/MigrateCommand.cs index 420dc1e1b..dead19440 100644 --- a/src/dotnet/commands/dotnet-migrate/MigrateCommand.cs +++ b/src/dotnet/commands/dotnet-migrate/MigrateCommand.cs @@ -149,7 +149,8 @@ namespace Microsoft.DotNet.Tools.Migrate var movableFiles = new DirectoryInfo(projectDirectory) .EnumerateFiles() - .Where(f => f.Name == Project.FileName || f.Extension == ".xproj"); + .Where(f => f.Name == Project.FileName || f.Extension == ".xproj" || + f.FullName.EndsWith(".xproj.user")); foreach (var movableFile in movableFiles) { diff --git a/test/dotnet-migrate.Tests/GivenThatAnAppWasMigrated.cs b/test/dotnet-migrate.Tests/GivenThatAnAppWasMigrated.cs index a402ee770..801283473 100644 --- a/test/dotnet-migrate.Tests/GivenThatAnAppWasMigrated.cs +++ b/test/dotnet-migrate.Tests/GivenThatAnAppWasMigrated.cs @@ -84,7 +84,7 @@ namespace Microsoft.DotNet.Migration.Tests { var catalog = new Dictionary(); - var patterns = new [] { "global.json", "project.json", "*.xproj" }; + var patterns = new [] { "global.json", "project.json", "*.xproj", "*.xproj.user" }; foreach (var pattern in patterns) {