Merge branch 'rel/1.0.0' into dev/jgoshi/issue5343

This commit is contained in:
Justin Goshi 2017-01-20 12:21:43 -08:00
commit 33c962a481
8 changed files with 398 additions and 101 deletions

View file

@ -0,0 +1,12 @@
using System;
namespace App.Tests
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}

View file

@ -0,0 +1,15 @@
{
"frameworks": {
"netcoreapp1.0": {
"imports": [
"portable-net451+win8"
],
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
}
}
}
}
}

View file

@ -86,40 +86,14 @@
</Target>
<Target Name="RestoreTests"
DependsOnTargets="CreateTestAssetPackageNuPkgs;
CleanTestProjectsBinObj;
SetupRestoreTestsInputs;"
Inputs="@(RestoreTestsInputs)"
Outputs="@(RestoreTestsInputs->'%(RelativeDir)/obj/project.assets.json');@(RestoreTestsInputs->'%(RelativeDir)/obj/%(Filename).csproj.nuget.g.props');@(RestoreTestsInputs->'%(RelativeDir)/obj/%(Filename).csproj.nuget.g.targets')">
DependsOnTargets="CreateTestAssetPackageNuPkgs;">
<CallTarget Targets="CleanTestProjectsLockFiles"/>
<DotNetRestore ToolPath="$(Stage0Directory)"
ProjectPath="&quot;%(RestoreTestsInputs.FullPath)&quot;" />
ProjectPath="&quot;$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln&quot;" />
</Target>
<Target Name="CleanTestProjectsBinObj"
DependsOnTargets="SetupRestoreTestsInputs;">
<ItemGroup>
<FilesToDelete Include="$(TestDirectory)**/bin/**/project.assets.json;$(TestDirectory)**/bin/**/*.csproj.nuget.g.props;$(TestDirectory)**/bin/**/*.csproj.nuget.g.targets" />
<FilesToDelete Include="$(TestDirectory)**/obj/**/project.assets.json;$(TestDirectory)**/obj/**/*.csproj.nuget.g.props;$(TestDirectory)**/obj/**/*.csproj.nuget.g.targets" />
</ItemGroup>
<Delete Files="@(FilesToDelete)" />
<ItemGroup>
<FilesToDelete Remove="*" />
</ItemGroup>
</Target>
<Target Name="SetupRestoreTestsInputs"
DependsOnTargets="PrepareTests;" >
<ItemGroup>
<RestoreTestsInputs Include="$(TestDirectory)/**/*.csproj"
Exclude="$(TestDirectory)/**/bin/**/*.csproj" />
</ItemGroup>
</Target>
<Target Name="BuildTestAssets"
<Target Name="BuildTestAssets"
DependsOnTargets="BuildTestAssetProjects;
BuildDesktopTestAssetProjects;">
</Target>

View file

@ -138,50 +138,6 @@ namespace Microsoft.DotNet.TestFramework
return new DirectoryInfo(Path.Combine(baseDirectory, callingMethod + identifier, _assetName));
}
private IEnumerable<FileInfo> LoadInventory(FileInfo file)
{
if (!file.Exists)
{
return Enumerable.Empty<FileInfo>();
}
var inventory = new List<FileInfo>();
var lines = file.OpenText();
while (lines.Peek() > 0)
{
inventory.Add(new FileInfo(lines.ReadLine()));
}
return inventory;
}
private void SaveInventory(FileInfo file, IEnumerable<FileInfo> inventory)
{
FileUtility.ReplaceWithLock(
filePath =>
{
if (!_dataDirectory.Exists)
{
_dataDirectory.Create();
}
using (var stream =
new FileStream(filePath, FileMode.Create, FileAccess.Write, FileShare.None))
{
using (var writer = new StreamWriter(stream))
{
foreach (var path in inventory.Select(i => i.FullName))
{
writer.WriteLine(path);
}
}
}
},
file.FullName);
}
private IEnumerable<FileInfo> GetFileList()
{
return _root.GetFiles("*.*", SearchOption.AllDirectories)
@ -195,15 +151,6 @@ namespace Microsoft.DotNet.TestFramework
Action action)
{
var inventory = Enumerable.Empty<FileInfo>();
if (file.Exists)
{
inventory = LoadInventory(file);
}
if(inventory.Any())
{
return inventory;
}
IEnumerable<FileInfo> preInventory;
@ -216,26 +163,21 @@ namespace Microsoft.DotNet.TestFramework
preInventory = beforeAction();
}
Task.Run(async () => await ConcurrencyUtilities.ExecuteWithFileLockedAsync<object>(
_dataDirectory.FullName,
lockedToken =>
ExclusiveFolderAccess.Do(_dataDirectory, (folder) => {
file.Refresh();
if (file.Exists)
{
if (file.Exists)
{
inventory = LoadInventory(file);
}
else
{
action();
inventory = folder.LoadInventory(file);
}
else
{
action();
inventory = GetFileList().Where(i => !preInventory.Select(p => p.FullName).Contains(i.FullName));
inventory = GetFileList().Where(i => !preInventory.Select(p => p.FullName).Contains(i.FullName));
SaveInventory(file, inventory);
}
return Task.FromResult(new Object());
},
CancellationToken.None)).Wait();
folder.SaveInventory(file, inventory);
}
});
return inventory;
}
@ -310,7 +252,10 @@ namespace Microsoft.DotNet.TestFramework
return;
}
var trackedFiles = _inventoryFiles.AllInventoryFiles.SelectMany(f => LoadInventory(f));
IEnumerable<FileInfo> trackedFiles = null;
ExclusiveFolderAccess.Do(_dataDirectory, (folder) => {
trackedFiles = _inventoryFiles.AllInventoryFiles.SelectMany(f => folder.LoadInventory(f));
});
var assetFiles = GetFileList();
@ -340,7 +285,7 @@ namespace Microsoft.DotNet.TestFramework
return;
}
var updatedSourceFiles = LoadInventory(_inventoryFiles.Source)
var updatedSourceFiles = ExclusiveFolderAccess.Read(_inventoryFiles.Source)
.Where(f => f.LastWriteTime > earliestDataDirectoryTimestamp);
if (updatedSourceFiles.Any())
@ -364,5 +309,65 @@ namespace Microsoft.DotNet.TestFramework
throw new DirectoryNotFoundException($"Directory not found at '{_root.FullName}'");
}
}
private class ExclusiveFolderAccess
{
private DirectoryInfo _directory;
private ExclusiveFolderAccess(DirectoryInfo directory)
{
_directory = directory;
}
public static void Do(DirectoryInfo directory, Action<ExclusiveFolderAccess> action)
{
Task.Run(async () => await ConcurrencyUtilities.ExecuteWithFileLockedAsync<object>(
directory.FullName,
lockedToken =>
{
action(new ExclusiveFolderAccess(directory));
return Task.FromResult(new Object());
},
CancellationToken.None)).Wait();
}
public static IEnumerable<FileInfo> Read(FileInfo file)
{
IEnumerable<FileInfo> ret = null;
Do(file.Directory, (folder) => {
ret = folder.LoadInventory(file);
});
return ret;
}
public IEnumerable<FileInfo> LoadInventory(FileInfo file)
{
file.Refresh();
if (!file.Exists)
{
throw new ArgumentException("Inventory file should exist.");
}
var inventory = new List<FileInfo>();
foreach (var p in File.ReadAllLines(file.FullName))
{
inventory.Add(new FileInfo(p));
}
return inventory;
}
public void SaveInventory(FileInfo file, IEnumerable<FileInfo> inventory)
{
_directory.Refresh();
if (!_directory.Exists)
{
_directory.Create();
}
File.WriteAllLines(file.FullName, inventory.Select((fi) => fi.FullName).ToList());
}
}
}
}

View file

@ -30,5 +30,7 @@ Defaults to current directory if nothing is specified.";
public const string CmdSkipBackupDescription = "Skip moving project.json, global.json, and *.xproj to a `backup` directory after successful migration.";
public const string MigrationFailedError = "Migration failed.";
public const string MigrationAdditionalHelp = "Your project has been migrated to the .csproj format and can be used with this build of the .NET Core Tools. Please visit https://aka.ms/coremigration to report issues or ask for help.";
}
}

View file

@ -244,6 +244,8 @@ namespace Microsoft.DotNet.Tools.Migrate
}
Reporter.Output.WriteLine(GetReportSummary(migrationReport));
Reporter.Output.WriteLine(LocalizableStrings.MigrationAdditionalHelp);
}
private string GetReportContent(MigrationReport migrationReport, bool colored = false)

View file

@ -0,0 +1,258 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-add-reference.Tests", "dotnet-add-reference.Tests\dotnet-add-reference.Tests.csproj", "{AB63A3E5-76A3-4EE9-A380-8E0C7B7644DC}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-restore.Tests", "dotnet-restore.Tests\dotnet-restore.Tests.csproj", "{44942A2B-EA59-4E47-A6E7-8D7CF82EC825}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-build.Tests", "dotnet-build.Tests\dotnet-build.Tests.csproj", "{A918B35C-0E62-44A5-94A1-111B82C67310}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-help.Tests", "dotnet-help.Tests\dotnet-help.Tests.csproj", "{97267605-66B9-48B3-9D27-C253EEEC00D5}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-list-reference.Tests", "dotnet-list-reference.Tests\dotnet-list-reference.Tests.csproj", "{1D6C9AA7-4830-4BF0-AE55-1F20102DEBC3}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-migrate.Tests", "dotnet-migrate.Tests\dotnet-migrate.Tests.csproj", "{394A9E3B-2E01-4FA2-A47A-2E26308E975E}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-msbuild.Tests", "dotnet-msbuild.Tests\dotnet-msbuild.Tests.csproj", "{68420EEE-D084-4809-B2EB-C5EE22A6D827}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-new.Tests", "dotnet-new.Tests\dotnet-new.Tests.csproj", "{A616564F-53D5-4394-B7EC-C373CCAE92F8}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-nuget.UnitTests", "dotnet-nuget.UnitTests\dotnet-nuget.UnitTests.csproj", "{CC6F63B6-FE02-4561-BCBB-062DBFF8F758}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-pack.Tests", "dotnet-pack.Tests\dotnet-pack.Tests.csproj", "{21C09199-7F81-494B-9100-6C4A74EFFB7F}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-publish.Tests", "dotnet-publish.Tests\dotnet-publish.Tests.csproj", "{C60AF72E-52FA-4D32-8483-ACA508A9CC98}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-remove-reference.Tests", "dotnet-remove-reference.Tests\dotnet-remove-reference.Tests.csproj", "{40962934-929D-434D-B2C7-76341B387A46}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-run.Tests", "dotnet-run.Tests\dotnet-run.Tests.csproj", "{948FCF35-9FE5-4ACF-9CF6-B65C20805DDD}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-test.Tests", "dotnet-test.Tests\dotnet-test.Tests.csproj", "{128917C9-F2CD-4C98-9BD3-20D0F0B13D61}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-vstest.Tests", "dotnet-vstest.Tests\dotnet-vstest.Tests.csproj", "{B4D339C2-21E7-4EAE-8BDD-2A7DAF88AFDF}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "msbuild.IntegrationTests", "msbuild.IntegrationTests\msbuild.IntegrationTests.csproj", "{CC1EAB87-2A9E-4F05-99EA-5B0F14031D78}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "crossgen.Tests", "crossgen.Tests\crossgen.Tests.csproj", "{B45638FC-D4F6-47E7-9440-C1D65F0492C2}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "binding-redirects.Tests", "binding-redirects.Tests\binding-redirects.Tests.csproj", "{18702FC5-7B1A-49B7-A335-A926064D577A}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Microsoft.DotNet.Cli.Msi.Tests", "Installer\Microsoft.DotNet.Cli.Msi.Tests\Microsoft.DotNet.Cli.Msi.Tests.csproj", "{2867CE61-92A5-49EC-B9F5-424655257069}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Kestrel.Tests", "Kestrel.Tests\Kestrel.Tests.csproj", "{642A0997-86E6-40E6-8E74-BFE2DC7C4A58}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "ArgumentForwardingTests", "ArgumentForwardingTests\ArgumentForwardingTests.csproj", "{67418187-0CF6-4213-87D0-5B9B841FD755}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "ArgumentsReflector", "ArgumentsReflector\ArgumentsReflector.csproj", "{8818FEBB-7243-4AB5-9E1C-179F5189FBD7}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Microsoft.DotNet.Cli.Sln.Internal.Tests", "Microsoft.DotNet.Cli.Sln.Internal.Tests\Microsoft.DotNet.Cli.Sln.Internal.Tests.csproj", "{BF42BEE8-3E23-44EB-B226-3859029A0BF5}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Microsoft.DotNet.Cli.Utils.Tests", "Microsoft.DotNet.Cli.Utils.Tests\Microsoft.DotNet.Cli.Utils.Tests.csproj", "{7C460953-7E23-436E-9EA9-E4CF37A919B7}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Microsoft.DotNet.Configurer.UnitTests", "Microsoft.DotNet.Configurer.UnitTests\Microsoft.DotNet.Configurer.UnitTests.csproj", "{91CBD27F-5069-4FD2-AC61-15A69D65E202}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Microsoft.DotNet.ProjectJsonMigration.Tests", "Microsoft.DotNet.ProjectJsonMigration.Tests\Microsoft.DotNet.ProjectJsonMigration.Tests.csproj", "{4CCE366D-7438-40FB-A868-57D6ACD505BF}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Microsoft.DotNet.Tools.Tests.Utilities", "Microsoft.DotNet.Tools.Tests.Utilities\Microsoft.DotNet.Tools.Tests.Utilities.csproj", "{D399E9DD-3049-47A2-8BFF-CBE26EACED7E}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Msbuild.Tests.Utilities", "Msbuild.Tests.Utilities\Msbuild.Tests.Utilities.csproj", "{F5A9E29F-B47B-47F4-A25B-BC991DE3369C}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "EndToEnd", "EndToEnd\EndToEnd.csproj", "{BB8A1F16-614A-428F-970F-CD5F1A981343}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet.Tests", "dotnet.Tests\dotnet.Tests.csproj", "{B4B5DA8E-E2EA-49CB-8B8C-4E157D42E710}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Performance", "Performance\Performance.csproj", "{2CD55F27-3755-4E7D-8524-81B0BBCB93A4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnet-sln-add.Tests", "dotnet-sln-add.Tests", "{5FF48976-B083-4E3B-A8E7-6FCD225D5C8E}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-sln-add.Tests", "dotnet-sln-add.Tests\dotnet-sln-add.Tests.csproj", "{FC849626-89C9-4F50-A2CA-53C4315A87F8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnet-sln-list.Tests", "dotnet-sln-list.Tests", "{15DDC326-69C3-4081-8AA1-B578B2BDE2C6}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-sln-list.Tests", "dotnet-sln-list.Tests\dotnet-sln-list.Tests.csproj", "{5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnet-sln-remove.Tests", "dotnet-sln-remove.Tests", "{BB393A93-1770-4753-B7D6-56F0DD378177}"
EndProject
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-sln-remove.Tests", "dotnet-sln-remove.Tests\dotnet-sln-remove.Tests.csproj", "{92BA9F90-E25B-4A1C-9598-2295D3DFC12F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AB63A3E5-76A3-4EE9-A380-8E0C7B7644DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AB63A3E5-76A3-4EE9-A380-8E0C7B7644DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB63A3E5-76A3-4EE9-A380-8E0C7B7644DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB63A3E5-76A3-4EE9-A380-8E0C7B7644DC}.Release|Any CPU.Build.0 = Release|Any CPU
{44942A2B-EA59-4E47-A6E7-8D7CF82EC825}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{44942A2B-EA59-4E47-A6E7-8D7CF82EC825}.Debug|Any CPU.Build.0 = Debug|Any CPU
{44942A2B-EA59-4E47-A6E7-8D7CF82EC825}.Release|Any CPU.ActiveCfg = Release|Any CPU
{44942A2B-EA59-4E47-A6E7-8D7CF82EC825}.Release|Any CPU.Build.0 = Release|Any CPU
{A918B35C-0E62-44A5-94A1-111B82C67310}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A918B35C-0E62-44A5-94A1-111B82C67310}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A918B35C-0E62-44A5-94A1-111B82C67310}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A918B35C-0E62-44A5-94A1-111B82C67310}.Release|Any CPU.Build.0 = Release|Any CPU
{97267605-66B9-48B3-9D27-C253EEEC00D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{97267605-66B9-48B3-9D27-C253EEEC00D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{97267605-66B9-48B3-9D27-C253EEEC00D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{97267605-66B9-48B3-9D27-C253EEEC00D5}.Release|Any CPU.Build.0 = Release|Any CPU
{1D6C9AA7-4830-4BF0-AE55-1F20102DEBC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1D6C9AA7-4830-4BF0-AE55-1F20102DEBC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1D6C9AA7-4830-4BF0-AE55-1F20102DEBC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1D6C9AA7-4830-4BF0-AE55-1F20102DEBC3}.Release|Any CPU.Build.0 = Release|Any CPU
{394A9E3B-2E01-4FA2-A47A-2E26308E975E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{394A9E3B-2E01-4FA2-A47A-2E26308E975E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{394A9E3B-2E01-4FA2-A47A-2E26308E975E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{394A9E3B-2E01-4FA2-A47A-2E26308E975E}.Release|Any CPU.Build.0 = Release|Any CPU
{68420EEE-D084-4809-B2EB-C5EE22A6D827}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{68420EEE-D084-4809-B2EB-C5EE22A6D827}.Debug|Any CPU.Build.0 = Debug|Any CPU
{68420EEE-D084-4809-B2EB-C5EE22A6D827}.Release|Any CPU.ActiveCfg = Release|Any CPU
{68420EEE-D084-4809-B2EB-C5EE22A6D827}.Release|Any CPU.Build.0 = Release|Any CPU
{A616564F-53D5-4394-B7EC-C373CCAE92F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A616564F-53D5-4394-B7EC-C373CCAE92F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A616564F-53D5-4394-B7EC-C373CCAE92F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A616564F-53D5-4394-B7EC-C373CCAE92F8}.Release|Any CPU.Build.0 = Release|Any CPU
{CC6F63B6-FE02-4561-BCBB-062DBFF8F758}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CC6F63B6-FE02-4561-BCBB-062DBFF8F758}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CC6F63B6-FE02-4561-BCBB-062DBFF8F758}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CC6F63B6-FE02-4561-BCBB-062DBFF8F758}.Release|Any CPU.Build.0 = Release|Any CPU
{21C09199-7F81-494B-9100-6C4A74EFFB7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{21C09199-7F81-494B-9100-6C4A74EFFB7F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{21C09199-7F81-494B-9100-6C4A74EFFB7F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{21C09199-7F81-494B-9100-6C4A74EFFB7F}.Release|Any CPU.Build.0 = Release|Any CPU
{C60AF72E-52FA-4D32-8483-ACA508A9CC98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C60AF72E-52FA-4D32-8483-ACA508A9CC98}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C60AF72E-52FA-4D32-8483-ACA508A9CC98}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C60AF72E-52FA-4D32-8483-ACA508A9CC98}.Release|Any CPU.Build.0 = Release|Any CPU
{40962934-929D-434D-B2C7-76341B387A46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{40962934-929D-434D-B2C7-76341B387A46}.Debug|Any CPU.Build.0 = Debug|Any CPU
{40962934-929D-434D-B2C7-76341B387A46}.Release|Any CPU.ActiveCfg = Release|Any CPU
{40962934-929D-434D-B2C7-76341B387A46}.Release|Any CPU.Build.0 = Release|Any CPU
{948FCF35-9FE5-4ACF-9CF6-B65C20805DDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{948FCF35-9FE5-4ACF-9CF6-B65C20805DDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{948FCF35-9FE5-4ACF-9CF6-B65C20805DDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{948FCF35-9FE5-4ACF-9CF6-B65C20805DDD}.Release|Any CPU.Build.0 = Release|Any CPU
{128917C9-F2CD-4C98-9BD3-20D0F0B13D61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{128917C9-F2CD-4C98-9BD3-20D0F0B13D61}.Debug|Any CPU.Build.0 = Debug|Any CPU
{128917C9-F2CD-4C98-9BD3-20D0F0B13D61}.Release|Any CPU.ActiveCfg = Release|Any CPU
{128917C9-F2CD-4C98-9BD3-20D0F0B13D61}.Release|Any CPU.Build.0 = Release|Any CPU
{B4D339C2-21E7-4EAE-8BDD-2A7DAF88AFDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B4D339C2-21E7-4EAE-8BDD-2A7DAF88AFDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B4D339C2-21E7-4EAE-8BDD-2A7DAF88AFDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B4D339C2-21E7-4EAE-8BDD-2A7DAF88AFDF}.Release|Any CPU.Build.0 = Release|Any CPU
{CC1EAB87-2A9E-4F05-99EA-5B0F14031D78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CC1EAB87-2A9E-4F05-99EA-5B0F14031D78}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CC1EAB87-2A9E-4F05-99EA-5B0F14031D78}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CC1EAB87-2A9E-4F05-99EA-5B0F14031D78}.Release|Any CPU.Build.0 = Release|Any CPU
{B45638FC-D4F6-47E7-9440-C1D65F0492C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B45638FC-D4F6-47E7-9440-C1D65F0492C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B45638FC-D4F6-47E7-9440-C1D65F0492C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B45638FC-D4F6-47E7-9440-C1D65F0492C2}.Release|Any CPU.Build.0 = Release|Any CPU
{18702FC5-7B1A-49B7-A335-A926064D577A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{18702FC5-7B1A-49B7-A335-A926064D577A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{18702FC5-7B1A-49B7-A335-A926064D577A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{18702FC5-7B1A-49B7-A335-A926064D577A}.Release|Any CPU.Build.0 = Release|Any CPU
{2867CE61-92A5-49EC-B9F5-424655257069}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2867CE61-92A5-49EC-B9F5-424655257069}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2867CE61-92A5-49EC-B9F5-424655257069}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2867CE61-92A5-49EC-B9F5-424655257069}.Release|Any CPU.Build.0 = Release|Any CPU
{642A0997-86E6-40E6-8E74-BFE2DC7C4A58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{642A0997-86E6-40E6-8E74-BFE2DC7C4A58}.Debug|Any CPU.Build.0 = Debug|Any CPU
{642A0997-86E6-40E6-8E74-BFE2DC7C4A58}.Release|Any CPU.ActiveCfg = Release|Any CPU
{642A0997-86E6-40E6-8E74-BFE2DC7C4A58}.Release|Any CPU.Build.0 = Release|Any CPU
{67418187-0CF6-4213-87D0-5B9B841FD755}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{67418187-0CF6-4213-87D0-5B9B841FD755}.Debug|Any CPU.Build.0 = Debug|Any CPU
{67418187-0CF6-4213-87D0-5B9B841FD755}.Release|Any CPU.ActiveCfg = Release|Any CPU
{67418187-0CF6-4213-87D0-5B9B841FD755}.Release|Any CPU.Build.0 = Release|Any CPU
{8818FEBB-7243-4AB5-9E1C-179F5189FBD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8818FEBB-7243-4AB5-9E1C-179F5189FBD7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8818FEBB-7243-4AB5-9E1C-179F5189FBD7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8818FEBB-7243-4AB5-9E1C-179F5189FBD7}.Release|Any CPU.Build.0 = Release|Any CPU
{BF42BEE8-3E23-44EB-B226-3859029A0BF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BF42BEE8-3E23-44EB-B226-3859029A0BF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BF42BEE8-3E23-44EB-B226-3859029A0BF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BF42BEE8-3E23-44EB-B226-3859029A0BF5}.Release|Any CPU.Build.0 = Release|Any CPU
{7C460953-7E23-436E-9EA9-E4CF37A919B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7C460953-7E23-436E-9EA9-E4CF37A919B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7C460953-7E23-436E-9EA9-E4CF37A919B7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7C460953-7E23-436E-9EA9-E4CF37A919B7}.Release|Any CPU.Build.0 = Release|Any CPU
{91CBD27F-5069-4FD2-AC61-15A69D65E202}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{91CBD27F-5069-4FD2-AC61-15A69D65E202}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91CBD27F-5069-4FD2-AC61-15A69D65E202}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91CBD27F-5069-4FD2-AC61-15A69D65E202}.Release|Any CPU.Build.0 = Release|Any CPU
{4CCE366D-7438-40FB-A868-57D6ACD505BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CCE366D-7438-40FB-A868-57D6ACD505BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CCE366D-7438-40FB-A868-57D6ACD505BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4CCE366D-7438-40FB-A868-57D6ACD505BF}.Release|Any CPU.Build.0 = Release|Any CPU
{D399E9DD-3049-47A2-8BFF-CBE26EACED7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D399E9DD-3049-47A2-8BFF-CBE26EACED7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D399E9DD-3049-47A2-8BFF-CBE26EACED7E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D399E9DD-3049-47A2-8BFF-CBE26EACED7E}.Release|Any CPU.Build.0 = Release|Any CPU
{F5A9E29F-B47B-47F4-A25B-BC991DE3369C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F5A9E29F-B47B-47F4-A25B-BC991DE3369C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F5A9E29F-B47B-47F4-A25B-BC991DE3369C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F5A9E29F-B47B-47F4-A25B-BC991DE3369C}.Release|Any CPU.Build.0 = Release|Any CPU
{BB8A1F16-614A-428F-970F-CD5F1A981343}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BB8A1F16-614A-428F-970F-CD5F1A981343}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BB8A1F16-614A-428F-970F-CD5F1A981343}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BB8A1F16-614A-428F-970F-CD5F1A981343}.Release|Any CPU.Build.0 = Release|Any CPU
{B4B5DA8E-E2EA-49CB-8B8C-4E157D42E710}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B4B5DA8E-E2EA-49CB-8B8C-4E157D42E710}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B4B5DA8E-E2EA-49CB-8B8C-4E157D42E710}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B4B5DA8E-E2EA-49CB-8B8C-4E157D42E710}.Release|Any CPU.Build.0 = Release|Any CPU
{2CD55F27-3755-4E7D-8524-81B0BBCB93A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2CD55F27-3755-4E7D-8524-81B0BBCB93A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2CD55F27-3755-4E7D-8524-81B0BBCB93A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2CD55F27-3755-4E7D-8524-81B0BBCB93A4}.Release|Any CPU.Build.0 = Release|Any CPU
{FC849626-89C9-4F50-A2CA-53C4315A87F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FC849626-89C9-4F50-A2CA-53C4315A87F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC849626-89C9-4F50-A2CA-53C4315A87F8}.Debug|x64.ActiveCfg = Debug|x64
{FC849626-89C9-4F50-A2CA-53C4315A87F8}.Debug|x64.Build.0 = Debug|x64
{FC849626-89C9-4F50-A2CA-53C4315A87F8}.Debug|x86.ActiveCfg = Debug|x86
{FC849626-89C9-4F50-A2CA-53C4315A87F8}.Debug|x86.Build.0 = Debug|x86
{FC849626-89C9-4F50-A2CA-53C4315A87F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FC849626-89C9-4F50-A2CA-53C4315A87F8}.Release|Any CPU.Build.0 = Release|Any CPU
{FC849626-89C9-4F50-A2CA-53C4315A87F8}.Release|x64.ActiveCfg = Release|x64
{FC849626-89C9-4F50-A2CA-53C4315A87F8}.Release|x64.Build.0 = Release|x64
{FC849626-89C9-4F50-A2CA-53C4315A87F8}.Release|x86.ActiveCfg = Release|x86
{FC849626-89C9-4F50-A2CA-53C4315A87F8}.Release|x86.Build.0 = Release|x86
{5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Debug|x64.ActiveCfg = Debug|x64
{5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Debug|x64.Build.0 = Debug|x64
{5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Debug|x86.ActiveCfg = Debug|x86
{5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Debug|x86.Build.0 = Debug|x86
{5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Release|Any CPU.Build.0 = Release|Any CPU
{5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Release|x64.ActiveCfg = Release|x64
{5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Release|x64.Build.0 = Release|x64
{5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Release|x86.ActiveCfg = Release|x86
{5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Release|x86.Build.0 = Release|x86
{92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Debug|x64.ActiveCfg = Debug|x64
{92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Debug|x64.Build.0 = Debug|x64
{92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Debug|x86.ActiveCfg = Debug|x86
{92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Debug|x86.Build.0 = Debug|x86
{92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Release|Any CPU.Build.0 = Release|Any CPU
{92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Release|x64.ActiveCfg = Release|x64
{92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Release|x64.Build.0 = Release|x64
{92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Release|x86.ActiveCfg = Release|x86
{92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{FC849626-89C9-4F50-A2CA-53C4315A87F8} = {5FF48976-B083-4E3B-A8E7-6FCD225D5C8E}
{5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF} = {15DDC326-69C3-4081-8AA1-B578B2BDE2C6}
{92BA9F90-E25B-4A1C-9598-2295D3DFC12F} = {BB393A93-1770-4753-B7D6-56F0DD378177}
EndGlobalSection
EndGlobal

View file

@ -51,6 +51,35 @@ namespace Microsoft.DotNet.Migration.Tests
"PJAppWithSlnAndXprojRefs");
}
[Fact]
public void ItOnlyMigratesProjectsInTheSlnFile()
{
var projectDirectory = TestAssets
.Get("NonRestoredTestProjects", "PJAppWithSlnAndXprojRefs")
.CreateInstance()
.WithSourceFiles()
.Root;
var solutionRelPath = Path.Combine("TestApp", "TestApp.sln");
new DotnetCommand()
.WithWorkingDirectory(projectDirectory)
.Execute($"migrate \"{solutionRelPath}\"")
.Should().Pass();
new DirectoryInfo(projectDirectory.FullName)
.Should().HaveFiles(new []
{
Path.Combine("TestApp", "TestApp.csproj"),
Path.Combine("TestLibrary", "TestLibrary.csproj"),
Path.Combine("TestApp", "src", "subdir", "subdir.csproj"),
Path.Combine("TestApp", "TestAssets", "TestAsset", "project.json")
});
new DirectoryInfo(projectDirectory.FullName)
.Should().NotHaveFile(Path.Combine("TestApp", "TestAssets", "TestAsset", "TestAsset.csproj"));
}
[Fact]
public void WhenDirectoryAlreadyContainsCsprojFileItMigratesAndBuildsSln()
{