diff --git a/.cliversion b/.cliversion
index a0f9a4b4b..70482ffac 100644
--- a/.cliversion
+++ b/.cliversion
@@ -1 +1 @@
-latest
+1.0.0-preview3-003930
diff --git a/.gitignore b/.gitignore
index 9af9fe15f..27def2cb6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,9 @@
# Multicore JIT Optimization profiles
**/optimizationdata/dotnet
+# Test Asset Manager files
+.tam/
+
# NuGet keeps dropping
Library/
diff --git a/TestAssets/DesktopTestProjects/AppWithDirectDepDesktopAndPortable/project.json b/TestAssets/DesktopTestProjects/AppWithDirectDepDesktopAndPortable/project.json
deleted file mode 100644
index 699fa2cc3..000000000
--- a/TestAssets/DesktopTestProjects/AppWithDirectDepDesktopAndPortable/project.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "version": "1.0.0-*",
- "buildOptions": {
- "emitEntryPoint": true
- },
- "dependencies": {
- "dotnet-desktop-and-portable": "1.0.0-*"
- },
- "frameworks": {
- "netcoreapp1.0": {
- "dependencies": {
- "Microsoft.NETCore.App": {
- "type": "platform",
- "version": "1.0.1"
- }
- },
- "imports": [
- "portable-net45+win8",
- "dnxcore50"
- ]
- },
- "net451": {}
- },
- "tools": {
- "dotnet-dependency-tool-invoker": {
- "version": "1.0.0-*",
- "imports": [
- "dnxcore50",
- "portable-net45+win8"
- ]
- }
- }
-}
diff --git a/TestAssets/DesktopTestProjects/AppWithDirectDepDesktopAndPortable/.noautobuild b/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/.noautobuild
similarity index 100%
rename from TestAssets/DesktopTestProjects/AppWithDirectDepDesktopAndPortable/.noautobuild
rename to TestAssets/DesktopTestProjects/AppWithProjTool2Fx/.noautobuild
diff --git a/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/App.csproj b/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/App.csproj
new file mode 100644
index 000000000..110929efb
--- /dev/null
+++ b/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/App.csproj
@@ -0,0 +1,47 @@
+
+
+
+
+ netcoreapp1.0;net451
+ Exe
+ $(PackageTargetFallback);portable-net45+win8;dnxcore50
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+ 1.0.0-*
+
+
+
+
+ 1.0.1
+
+
+
+
+
+
+
+
+ 1.0.0-*
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);NET451
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/NuGet.Config b/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/NuGet.Config
new file mode 100644
index 000000000..b8e876fcb
--- /dev/null
+++ b/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/NuGet.Config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/TestAssets/DesktopTestProjects/AppWithDirectDepDesktopAndPortable/Program.cs b/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/Program.cs
similarity index 100%
rename from TestAssets/DesktopTestProjects/AppWithDirectDepDesktopAndPortable/Program.cs
rename to TestAssets/DesktopTestProjects/AppWithProjTool2Fx/Program.cs
diff --git a/TestAssets/DesktopTestProjects/LibraryWithDirectDependencyDesktopAndPortable/.noautobuild b/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/.noautobuild
similarity index 100%
rename from TestAssets/DesktopTestProjects/LibraryWithDirectDependencyDesktopAndPortable/.noautobuild
rename to TestAssets/DesktopTestProjects/LibWithProjTool2Fx/.noautobuild
diff --git a/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/Lib.csproj b/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/Lib.csproj
new file mode 100644
index 000000000..cecdf152a
--- /dev/null
+++ b/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/Lib.csproj
@@ -0,0 +1,47 @@
+
+
+
+
+ netstandard1.6;net451
+ Library
+ $(PackageTargetFallback);portable-net45+win8;dnxcore50;netcoreapp1.0
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+ 1.0.0-*
+
+
+
+
+ 1.6.0
+
+
+
+
+
+
+
+
+ 1.0.0-*
+
+
+
+ $(DefineConstants);NETSTANDARD1_6
+
+
+ $(DefineConstants);NET451
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/NuGet.Config b/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/NuGet.Config
new file mode 100644
index 000000000..b8e876fcb
--- /dev/null
+++ b/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/NuGet.Config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/TestAssets/DesktopTestProjects/LibraryWithDirectDependencyDesktopAndPortable/Program.cs b/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/Program.cs
similarity index 100%
rename from TestAssets/DesktopTestProjects/LibraryWithDirectDependencyDesktopAndPortable/Program.cs
rename to TestAssets/DesktopTestProjects/LibWithProjTool2Fx/Program.cs
diff --git a/TestAssets/DesktopTestProjects/LibraryWithDirectDependencyDesktopAndPortable/project.json b/TestAssets/DesktopTestProjects/LibraryWithDirectDependencyDesktopAndPortable/project.json
deleted file mode 100644
index 1d8d8a92c..000000000
--- a/TestAssets/DesktopTestProjects/LibraryWithDirectDependencyDesktopAndPortable/project.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "version": "1.0.0-*",
- "buildOptions": {
- "emitEntryPoint": false
- },
- "dependencies": {
- "dotnet-desktop-and-portable": "1.0.0-*"
- },
- "frameworks": {
- "netstandard1.6": {
- "dependencies": {
- "NETStandard.Library": "1.6.0"
- },
- "imports": [
- "portable-net45+win8",
- "dnxcore50",
- "netcoreapp1.0"
- ]
- },
- "net451": {}
- },
- "tools": {
- "dotnet-dependency-tool-invoker": {
- "version": "1.0.0-*",
- "imports": [
- "dnxcore50",
- "portable-net45+win8"
- ]
- }
- }
-}
diff --git a/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedPlatformDependency/TestProjectWithUnresolvedPlatformDependency.csproj b/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedPlatformDependency/TestProjectWithUnresolvedPlatformDependency.csproj
new file mode 100755
index 000000000..0983f08f8
--- /dev/null
+++ b/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedPlatformDependency/TestProjectWithUnresolvedPlatformDependency.csproj
@@ -0,0 +1,30 @@
+
+
+
+
+ netcoreapp1.0
+ Exe
+ $(PackageTargetFallback);dnxcore50
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+ 1.0.0
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedPlatformDependency/project.json b/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedPlatformDependency/project.json
deleted file mode 100644
index 555dd25f4..000000000
--- a/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedPlatformDependency/project.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "version": "1.0.0-*",
- "buildOptions": {
- "emitEntryPoint": true
- },
- "dependencies": {
- "ThisIsNotARealDependencyAndIfSomeoneGoesAndAddsAProjectWithThisNameIWillFindThemAndPunishThem": {
- "type": "platform",
- "version": "1.0.0"
- }
- },
- "frameworks": {
- "netcoreapp1.0": {
- "imports": "dnxcore50"
- }
- }
-}
diff --git a/TestAssets/TestPackages/dotnet-dependency-tool-invoker/Program.cs b/TestAssets/TestPackages/dotnet-dependency-tool-invoker/Program.cs
index 9db2e07b3..17b66d125 100644
--- a/TestAssets/TestPackages/dotnet-dependency-tool-invoker/Program.cs
+++ b/TestAssets/TestPackages/dotnet-dependency-tool-invoker/Program.cs
@@ -2,7 +2,6 @@
using System.IO;
using System.Collections.Generic;
using System.Linq;
-using Microsoft.DotNet.ProjectModel;
using Microsoft.DotNet.Cli.Utils;
using NuGet.Frameworks;
@@ -24,13 +23,7 @@ namespace Microsoft.DotNet.Tools.DependencyInvoker
return 1;
}
-
- var projectContexts =
- CreateProjectContexts(dotnetParams.ProjectPath)
- .Where(p => dotnetParams.Framework == null ||
- dotnetParams.Framework.GetShortFolderName()
- .Equals(p.TargetFramework.GetShortFolderName()));
-
+
var commandFactory =
new ProjectDependenciesCommandFactory(
dotnetParams.Framework,
@@ -39,15 +32,7 @@ namespace Microsoft.DotNet.Tools.DependencyInvoker
dotnetParams.BuildBasePath,
dotnetParams.ProjectPath);
- var result = 0;
- if(projectContexts.Any())
- {
- result = InvokeDependencyToolForProjectJson(projectContexts, commandFactory, dotnetParams);
- }
- else
- {
- result = InvokeDependencyToolForMSBuild(commandFactory, dotnetParams);
- }
+ var result = InvokeDependencyToolForMSBuild(commandFactory, dotnetParams);
return result;
}
@@ -61,24 +46,6 @@ namespace Microsoft.DotNet.Tools.DependencyInvoker
return InvokeDependencyTool(commandFactory, dotnetParams, dotnetParams.Framework);
}
- private static int InvokeDependencyToolForProjectJson(
- IEnumerable projectContexts,
- ProjectDependenciesCommandFactory commandFactory,
- DotnetBaseParams dotnetParams)
- {
- foreach (var projectContext in projectContexts)
- {
- Console.WriteLine($"Invoking '{dotnetParams.Command}' for '{projectContext.TargetFramework}'.");
-
- if (InvokeDependencyTool(commandFactory, dotnetParams, projectContext.TargetFramework) != 0)
- {
- return 1;
- }
- }
-
- return 0;
- }
-
private static int InvokeDependencyTool(
ProjectDependenciesCommandFactory commandFactory,
DotnetBaseParams dotnetParams,
@@ -106,22 +73,5 @@ namespace Microsoft.DotNet.Tools.DependencyInvoker
return 0;
}
-
- private static IEnumerable CreateProjectContexts(string projectPath = null)
- {
- projectPath = projectPath ?? Directory.GetCurrentDirectory();
-
- if (!projectPath.EndsWith(Project.FileName))
- {
- projectPath = Path.Combine(projectPath, Project.FileName);
- }
-
- if (!File.Exists(projectPath))
- {
- return Enumerable.Empty();
- }
-
- return ProjectContext.CreateContextForEachFramework(projectPath);
- }
}
}
diff --git a/TestAssets/TestPackages/dotnet-dependency-tool-invoker/project.json b/TestAssets/TestPackages/dotnet-dependency-tool-invoker/project.json
index 5540f2d1d..1297d1b12 100644
--- a/TestAssets/TestPackages/dotnet-dependency-tool-invoker/project.json
+++ b/TestAssets/TestPackages/dotnet-dependency-tool-invoker/project.json
@@ -17,12 +17,6 @@
"Microsoft.DotNet.Cli.Utils": {
"target": "project"
},
- "Microsoft.DotNet.ProjectModel": {
- "target": "project"
- },
- "Microsoft.DotNet.Compiler.Common": {
- "target": "project"
- },
"NuGet.Frameworks": "3.6.0-rc-1984"
},
"frameworks": {
diff --git a/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/AppWithDepOnToolWithOutputName.csproj b/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/AppWithDepOnToolWithOutputName.csproj
new file mode 100755
index 000000000..0c47bdf3f
--- /dev/null
+++ b/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/AppWithDepOnToolWithOutputName.csproj
@@ -0,0 +1,34 @@
+
+
+
+
+ netcoreapp1.0
+ Exe
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+ 1.0.1
+
+
+
+
+ 1.0.0
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/NuGet.Config b/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/NuGet.Config
new file mode 100644
index 000000000..b8e876fcb
--- /dev/null
+++ b/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/NuGet.Config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/project.json b/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/project.json
deleted file mode 100644
index d514ca588..000000000
--- a/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/project.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "version": "1.0.0-*",
- "buildOptions": {
- "emitEntryPoint": true
- },
- "dependencies": {
- "Microsoft.NETCore.App": {
- "version": "1.0.1",
- "type": "platform"
- }
- },
- "frameworks": {
- "netcoreapp1.0": {}
- },
- "tools": {
- "ToolWithOutputName": {
- "version": "1.0.0",
- "target": "package"
- }
- }
-}
diff --git a/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj b/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj
new file mode 100755
index 000000000..f37b2dba6
--- /dev/null
+++ b/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj
@@ -0,0 +1,37 @@
+
+
+
+
+ netcoreapp1.0
+ Exe
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+ 1.0.1
+
+
+ 1.0.0
+
+
+
+
+ 1.0.0
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/AppWithDirectAndToolDep/NuGet.Config b/TestAssets/TestProjects/AppWithDirectAndToolDep/NuGet.Config
new file mode 100644
index 000000000..b8e876fcb
--- /dev/null
+++ b/TestAssets/TestProjects/AppWithDirectAndToolDep/NuGet.Config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/TestAssets/TestProjects/AppWithDirectAndToolDep/project.json b/TestAssets/TestProjects/AppWithDirectAndToolDep/project.json
deleted file mode 100644
index 403ebe73d..000000000
--- a/TestAssets/TestProjects/AppWithDirectAndToolDep/project.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "version": "1.0.0-*",
- "buildOptions": {
- "emitEntryPoint": true
- },
- "dependencies": {
- "Microsoft.NETCore.App": "1.0.1",
- "dotnet-hello": {
- "version": "1.0.0",
- "target": "package"
- }
- },
- "frameworks": {
- "netcoreapp1.0": {}
- },
- "runtimes": {
- "win7-x64": {},
- "win7-x86": {},
- "osx.10.10-x64": {},
- "osx.10.11-x64": {},
- "ubuntu.14.04-x64": {},
- "ubuntu.16.04-x64": {},
- "centos.7-x64": {},
- "rhel.7.2-x64": {},
- "debian.8-x64": {},
- "fedora.23-x64": {},
- "opensuse.13.2-x64": {}
- },
- "tools": {
- "dotnet-portable": {
- "version": "1.0.0",
- "target": "package"
- }
- }
-}
diff --git a/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj b/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj
new file mode 100755
index 000000000..87e79722c
--- /dev/null
+++ b/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj
@@ -0,0 +1,39 @@
+
+
+
+
+ 1.0.0
+ netcoreapp1.0
+ AppWithDirectDep
+ Exe
+ false
+
+
+
+ 1.0.1
+
+
+ 1.0.0
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161012-3
+ All
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);DEBUG;TRACE
+
+
+ $(DefineConstants);RELEASE;TRACE
+ true
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/AppWithDirectDep/NuGet.Config b/TestAssets/TestProjects/AppWithDirectDep/NuGet.Config
new file mode 100644
index 000000000..b8e876fcb
--- /dev/null
+++ b/TestAssets/TestProjects/AppWithDirectDep/NuGet.Config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/TestAssets/TestProjects/AppWithDirectDep/project.json b/TestAssets/TestProjects/AppWithDirectDep/project.json
deleted file mode 100644
index f18b8124b..000000000
--- a/TestAssets/TestProjects/AppWithDirectDep/project.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "version": "1.0.0-*",
- "buildOptions": {
- "emitEntryPoint": true
- },
- "dependencies": {
- "Microsoft.NETCore.App": "1.0.1",
- "dotnet-hello": {
- "version": "1.0.0",
- "target": "package"
- }
- },
- "frameworks": {
- "netcoreapp1.0": {}
- },
- "runtimes": {
- "win7-x64": {},
- "win7-x86": {},
- "osx.10.10-x64": {},
- "osx.10.11-x64": {},
- "ubuntu.14.04-x64": {},
- "ubuntu.16.04-x64": {},
- "centos.7-x64": {},
- "rhel.7.2-x64": {},
- "debian.8-x64": {},
- "fedora.23-x64": {},
- "opensuse.13.2-x64": {}
- }
-}
diff --git a/TestAssets/TestProjects/AppWithDirectDepAndTypeBuild/NuGet.Config b/TestAssets/TestProjects/AppWithDirectDepAndTypeBuild/NuGet.Config
new file mode 100644
index 000000000..b8e876fcb
--- /dev/null
+++ b/TestAssets/TestProjects/AppWithDirectDepAndTypeBuild/NuGet.Config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/TestAssets/TestProjects/AppWithDirectDepWithOutputName/AppWithDirectDepWithOutputName.csproj b/TestAssets/TestProjects/AppWithDirectDepWithOutputName/AppWithDirectDepWithOutputName.csproj
new file mode 100755
index 000000000..a1803c769
--- /dev/null
+++ b/TestAssets/TestProjects/AppWithDirectDepWithOutputName/AppWithDirectDepWithOutputName.csproj
@@ -0,0 +1,37 @@
+
+
+
+
+ netcoreapp1.0
+ Exe
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+ 1.0.0
+
+
+ 1.0.1
+
+
+
+
+ 1.0.0-*
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/AppWithDirectDepWithOutputName/NuGet.Config b/TestAssets/TestProjects/AppWithDirectDepWithOutputName/NuGet.Config
new file mode 100644
index 000000000..4da396ac8
--- /dev/null
+++ b/TestAssets/TestProjects/AppWithDirectDepWithOutputName/NuGet.Config
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/TestAssets/TestProjects/AppWithDirectDepWithOutputName/project.json b/TestAssets/TestProjects/AppWithDirectDepWithOutputName/project.json
deleted file mode 100644
index 4d050093e..000000000
--- a/TestAssets/TestProjects/AppWithDirectDepWithOutputName/project.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "buildOptions": {
- "emitEntryPoint": true
- },
- "dependencies": {
- "ToolWithOutputName": {
- "version": "1.0.0",
- "target": "package"
- },
- "Microsoft.NETCore.App": {
- "version": "1.0.1",
- "type": "platform"
- }
- },
- "frameworks": {
- "netcoreapp1.0": {}
- },
- "tools": {
- "dotnet-dependency-tool-invoker": {
- "version": "1.0.0-*",
- "imports": [
- "dnxcore50",
- "portable-net45+win8"
- ]
- }
- }
-}
diff --git a/TestAssets/TestProjects/AppWithMultipleFxAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj b/TestAssets/TestProjects/AppWithMultipleFxAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj
new file mode 100644
index 000000000..a7fad9b20
--- /dev/null
+++ b/TestAssets/TestProjects/AppWithMultipleFxAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj
@@ -0,0 +1,37 @@
+
+
+
+
+
+ Exe
+ net451;netcoreapp1.0
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+ 1.0.0-*
+
+
+
+
+ 1.0.1
+
+
+
+
+
+ 1.0.0-*
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/AppWithMultipleFxAndTools/NuGet.Config b/TestAssets/TestProjects/AppWithMultipleFxAndTools/NuGet.Config
new file mode 100644
index 000000000..b8e876fcb
--- /dev/null
+++ b/TestAssets/TestProjects/AppWithMultipleFxAndTools/NuGet.Config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/TestAssets/TestProjects/MSBuildAppWithMultipleFrameworksAndTools/Program.cs b/TestAssets/TestProjects/AppWithMultipleFxAndTools/Program.cs
similarity index 100%
rename from TestAssets/TestProjects/MSBuildAppWithMultipleFrameworksAndTools/Program.cs
rename to TestAssets/TestProjects/AppWithMultipleFxAndTools/Program.cs
diff --git a/TestAssets/TestProjects/AppWithToolDependency/AppWithToolDependency.csproj b/TestAssets/TestProjects/AppWithToolDependency/AppWithToolDependency.csproj
new file mode 100755
index 000000000..28f991567
--- /dev/null
+++ b/TestAssets/TestProjects/AppWithToolDependency/AppWithToolDependency.csproj
@@ -0,0 +1,34 @@
+
+
+
+
+ netcoreapp1.0
+ Exe
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+ 1.0.1
+
+
+
+
+ 1.0.0
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/DependencyContextFromTool/DependencyContextFromTool.csproj b/TestAssets/TestProjects/DependencyContextFromTool/DependencyContextFromTool.csproj
new file mode 100755
index 000000000..7b91a326c
--- /dev/null
+++ b/TestAssets/TestProjects/DependencyContextFromTool/DependencyContextFromTool.csproj
@@ -0,0 +1,42 @@
+
+
+
+
+ 1.0.0
+ netcoreapp1.0
+ DependencyContextFromTool
+ Exe
+ false
+ $(PackageTargetFallback);dnxcore50;portable-net45+win8
+
+
+
+
+
+
+ 1.0.0-alpha-20161012-3
+ All
+
+
+
+
+ 1.0.1
+
+
+
+
+ 1.0.0-*
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);DEBUG;TRACE
+
+
+ $(DefineConstants);RELEASE;TRACE
+ true
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/DependencyContextFromTool/NuGet.Config b/TestAssets/TestProjects/DependencyContextFromTool/NuGet.Config
new file mode 100644
index 000000000..b8e876fcb
--- /dev/null
+++ b/TestAssets/TestProjects/DependencyContextFromTool/NuGet.Config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/TestAssets/TestProjects/DependencyContextFromTool/project.json b/TestAssets/TestProjects/DependencyContextFromTool/project.json
deleted file mode 100644
index cbc889a43..000000000
--- a/TestAssets/TestProjects/DependencyContextFromTool/project.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "buildOptions": {
- "emitEntryPoint": true
- },
- "dependencies": {},
- "frameworks": {
- "netcoreapp1.0": {
- "imports": [
- "dnxcore50",
- "portable-net45+win8"
- ],
- "dependencies": {
- "Microsoft.NETCore.App": {
- "type": "platform",
- "version": "1.0.1"
- }
- }
- }
- },
- "tools": {
- "dotnet-dependency-context-test": {
- "version": "1.0.0-*",
- "imports": [
- "dnxcore50"
- ]
- }
- }
-}
diff --git a/TestAssets/TestProjects/LibraryWithOutputAssemblyName/MyLibrary.csproj b/TestAssets/TestProjects/LibraryWithOutputAssemblyName/MyLibrary.csproj
new file mode 100755
index 000000000..f32fd4d2e
--- /dev/null
+++ b/TestAssets/TestProjects/LibraryWithOutputAssemblyName/MyLibrary.csproj
@@ -0,0 +1,28 @@
+
+
+
+
+ netstandard1.5
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+ 1.6.0
+
+
+
+ $(DefineConstants);NETSTANDARD1_5
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/LibraryWithOutputAssemblyName/project.json b/TestAssets/TestProjects/LibraryWithOutputAssemblyName/project.json
deleted file mode 100644
index c2d11ff89..000000000
--- a/TestAssets/TestProjects/LibraryWithOutputAssemblyName/project.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "buildOptions": {
- "outputName": "MyLibrary"
- },
- "dependencies": {
- "NETStandard.Library": "1.6.0"
- },
- "frameworks": {
- "netstandard1.5": {}
- }
-}
diff --git a/TestAssets/TestProjects/PJTestAppSimple/Program.cs b/TestAssets/TestProjects/PJTestAppSimple/Program.cs
new file mode 100644
index 000000000..51233cffa
--- /dev/null
+++ b/TestAssets/TestProjects/PJTestAppSimple/Program.cs
@@ -0,0 +1,12 @@
+using System;
+
+namespace ConsoleApplication
+{
+ public class Program
+ {
+ public static void Main(string[] args)
+ {
+ Console.WriteLine("Hello World!");
+ }
+ }
+}
diff --git a/TestAssets/TestProjects/AppWithToolDependency/project.json b/TestAssets/TestProjects/PJTestAppSimple/project.json
old mode 100644
new mode 100755
similarity index 81%
rename from TestAssets/TestProjects/AppWithToolDependency/project.json
rename to TestAssets/TestProjects/PJTestAppSimple/project.json
index 61268b24e..5f8329deb
--- a/TestAssets/TestProjects/AppWithToolDependency/project.json
+++ b/TestAssets/TestProjects/PJTestAppSimple/project.json
@@ -1,4 +1,4 @@
-{
+{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true
@@ -9,12 +9,6 @@
"frameworks": {
"netcoreapp1.0": {}
},
- "tools": {
- "dotnet-portable": {
- "version": "1.0.0",
- "target": "package"
- }
- },
"runtimes": {
"win7-x64": {},
"win7-x86": {},
@@ -28,4 +22,4 @@
"fedora.23-x64": {},
"opensuse.13.2-x64": {}
}
-}
+}
\ No newline at end of file
diff --git a/TestAssets/TestProjects/PJTestLibraryWithConfiguration/.noautobuild b/TestAssets/TestProjects/PJTestLibraryWithConfiguration/.noautobuild
new file mode 100644
index 000000000..e69de29bb
diff --git a/TestAssets/TestProjects/PJTestLibraryWithConfiguration/Helper.cs b/TestAssets/TestProjects/PJTestLibraryWithConfiguration/Helper.cs
new file mode 100644
index 000000000..8c643796b
--- /dev/null
+++ b/TestAssets/TestProjects/PJTestLibraryWithConfiguration/Helper.cs
@@ -0,0 +1,24 @@
+// Copyright (c) .NET Foundation and contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System;
+
+namespace TestLibrary
+{
+ public static class Helper
+ {
+ ///
+ /// Gets the message from the helper. This comment is here to help test XML documentation file generation, please do not remove it.
+ ///
+ /// A message
+ public static string GetMessage()
+ {
+ return "This string came from the test library!";
+ }
+
+ public static void SayHi()
+ {
+ Console.WriteLine("Hello there!");
+ }
+ }
+}
diff --git a/TestAssets/TestProjects/TestLibraryWithConfiguration/project.json b/TestAssets/TestProjects/PJTestLibraryWithConfiguration/project.json
old mode 100644
new mode 100755
similarity index 98%
rename from TestAssets/TestProjects/TestLibraryWithConfiguration/project.json
rename to TestAssets/TestProjects/PJTestLibraryWithConfiguration/project.json
index d979400d2..23c4b5057
--- a/TestAssets/TestProjects/TestLibraryWithConfiguration/project.json
+++ b/TestAssets/TestProjects/PJTestLibraryWithConfiguration/project.json
@@ -1,4 +1,4 @@
-{
+{
"version": "1.0.0-*",
"buildOptions": {
"nowarn": [
@@ -18,4 +18,4 @@
"frameworks": {
"netstandard1.5": {}
}
-}
+}
\ No newline at end of file
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetApp/SingleTargetApp.csproj b/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetApp/SingleTargetApp.csproj
new file mode 100755
index 000000000..9fa2cfbb5
--- /dev/null
+++ b/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetApp/SingleTargetApp.csproj
@@ -0,0 +1,29 @@
+
+
+
+
+ netcoreapp1.0
+ Exe
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+ 1.0.1
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetApp/project.json b/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetApp/project.json
deleted file mode 100644
index 6b8b96058..000000000
--- a/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetApp/project.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "version": "1.0.0-*",
- "buildOptions": {
- "emitEntryPoint": true
- },
- "dependencies": {
- "Microsoft.NETCore.App": {
- "type": "platform",
- "version": "1.0.1"
- }
- },
- "frameworks": {
- "netcoreapp1.0": {}
- }
-}
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetGraph/SingleTargetP0/SingleTargetP0.csproj b/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetGraph/SingleTargetP0/SingleTargetP0.csproj
new file mode 100755
index 000000000..4a2c908b0
--- /dev/null
+++ b/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetGraph/SingleTargetP0/SingleTargetP0.csproj
@@ -0,0 +1,32 @@
+
+
+
+
+ netcoreapp1.0
+ Exe
+
+
+
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+ 1.0.1
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetGraph/SingleTargetP0/project.json b/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetGraph/SingleTargetP0/project.json
deleted file mode 100644
index cb916d694..000000000
--- a/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetGraph/SingleTargetP0/project.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "version": "1.0.0-*",
- "buildOptions": {
- "emitEntryPoint": true
- },
- "dependencies": {
- "SingleTargetP1": {
- "target": "project"
- },
- "Microsoft.NETCore.App": {
- "type": "platform",
- "version": "1.0.1"
- }
- },
- "frameworks": {
- "netcoreapp1.0": {}
- }
-}
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetGraph/SingleTargetP1/SingleTargetP1.csproj b/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetGraph/SingleTargetP1/SingleTargetP1.csproj
new file mode 100755
index 000000000..8023a259e
--- /dev/null
+++ b/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetGraph/SingleTargetP1/SingleTargetP1.csproj
@@ -0,0 +1,31 @@
+
+
+
+
+ netcoreapp1.0
+
+
+
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+ 1.0.1
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetGraph/SingleTargetP1/project.json b/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetGraph/SingleTargetP1/project.json
deleted file mode 100644
index 2b9ba42f4..000000000
--- a/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetGraph/SingleTargetP1/project.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "version": "1.0.0-*",
- "dependencies": {
- "SingleTargetP2": {
- "target": "project"
- },
- "Microsoft.NETCore.App": {
- "type": "platform",
- "version": "1.0.1"
- }
- },
- "frameworks": {
- "netcoreapp1.0": {}
- }
-}
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetGraph/SingleTargetP2/SingleTargetP2.csproj b/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetGraph/SingleTargetP2/SingleTargetP2.csproj
new file mode 100755
index 000000000..eb9a36f2a
--- /dev/null
+++ b/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetGraph/SingleTargetP2/SingleTargetP2.csproj
@@ -0,0 +1,28 @@
+
+
+
+
+ netcoreapp1.0
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+ 1.0.1
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetGraph/SingleTargetP2/project.json b/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetGraph/SingleTargetP2/project.json
deleted file mode 100644
index 2f496524b..000000000
--- a/TestAssets/TestProjects/PerformanceTestProjects/SingleTargetGraph/SingleTargetP2/project.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "version": "1.0.0-*",
- "dependencies": {
- "Microsoft.NETCore.App": {
- "type": "platform",
- "version": "1.0.1"
- }
- },
- "frameworks": {
- "netcoreapp1.0": {}
- }
-}
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetApp/TwoTargetApp.csproj b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetApp/TwoTargetApp.csproj
new file mode 100755
index 000000000..fd24d6330
--- /dev/null
+++ b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetApp/TwoTargetApp.csproj
@@ -0,0 +1,42 @@
+
+
+
+
+ netcoreapp1.0;netstandard1.6
+ Exe
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+
+
+ 1.0.1
+
+
+
+
+ 1.6.0
+
+
+ 1.0.4
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);NETSTANDARD1_6
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetApp/project.json b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetApp/project.json
deleted file mode 100644
index 300a13690..000000000
--- a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetApp/project.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "version": "1.0.0-*",
- "buildOptions": {
- "emitEntryPoint": true
- },
- "dependencies": {},
- "frameworks": {
- "netcoreapp1.0": {
- "dependencies": {
- "Microsoft.NETCore.App": {
- "type": "platform",
- "version": "1.0.1"
- }
- }
- },
- "netstandard1.6": {
- "dependencies": {
- "NETStandard.Library": "1.6.0",
- "Microsoft.NETCore.Runtime.CoreCLR": "1.0.4"
- }
- }
- },
- "runtimes": {
- "win7-x64": {},
- "win7-x86": {},
- "osx.10.10-x64": {},
- "osx.10.11-x64": {},
- "ubuntu.14.04-x64": {},
- "ubuntu.16.04-x64": {},
- "centos.7-x64": {},
- "rhel.7.2-x64": {},
- "debian.8-x64": {},
- "fedora.23-x64": {},
- "opensuse.13.2-x64": {}
- }
-}
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraph/TwoTargetP0/TwoTargetP0.csproj b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraph/TwoTargetP0/TwoTargetP0.csproj
new file mode 100755
index 000000000..b122fd66d
--- /dev/null
+++ b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraph/TwoTargetP0/TwoTargetP0.csproj
@@ -0,0 +1,45 @@
+
+
+
+
+ netcoreapp1.0;netstandard1.6
+ Exe
+
+
+
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+
+
+ 1.0.1
+
+
+
+
+ 1.6.0
+
+
+ 1.0.4
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);NETSTANDARD1_6
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraph/TwoTargetP0/project.json b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraph/TwoTargetP0/project.json
deleted file mode 100644
index 13516bc65..000000000
--- a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraph/TwoTargetP0/project.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "version": "1.0.0-*",
- "buildOptions": {
- "emitEntryPoint": true
- },
- "dependencies": {
- "TwoTargetP1": {
- "target": "project"
- }
- },
- "frameworks": {
- "netcoreapp1.0": {
- "dependencies": {
- "Microsoft.NETCore.App": {
- "type": "platform",
- "version": "1.0.1"
- }
- }
- },
- "netstandard1.6": {
- "dependencies": {
- "NETStandard.Library": "1.6.0",
- "Microsoft.NETCore.Runtime.CoreCLR": "1.0.4"
- }
- }
- },
- "runtimes": {
- "win7-x64": {},
- "win7-x86": {},
- "osx.10.10-x64": {},
- "osx.10.11-x64": {},
- "ubuntu.14.04-x64": {},
- "ubuntu.16.04-x64": {},
- "centos.7-x64": {},
- "rhel.7.2-x64": {},
- "debian.8-x64": {},
- "fedora.23-x64": {},
- "opensuse.13.2-x64": {}
- }
-}
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraph/TwoTargetP1/TwoTargetP1.csproj b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraph/TwoTargetP1/TwoTargetP1.csproj
new file mode 100755
index 000000000..3419f1079
--- /dev/null
+++ b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraph/TwoTargetP1/TwoTargetP1.csproj
@@ -0,0 +1,41 @@
+
+
+
+
+ netcoreapp1.0;netstandard1.5
+
+
+
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+
+
+ 1.0.1
+
+
+
+
+ 1.6.0
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);NETSTANDARD1_5
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraph/TwoTargetP1/project.json b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraph/TwoTargetP1/project.json
deleted file mode 100644
index 0cfbc0831..000000000
--- a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraph/TwoTargetP1/project.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "version": "1.0.0-*",
- "dependencies": {
- "TwoTargetP2": {
- "target": "project"
- }
- },
- "frameworks": {
- "netcoreapp1.0": {
- "dependencies": {
- "Microsoft.NETCore.App": {
- "type": "platform",
- "version": "1.0.1"
- }
- }
- },
- "netstandard1.5": {
- "dependencies": {
- "NETStandard.Library": "1.6.0"
- }
- }
- }
-}
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraph/TwoTargetP2/TwoTargetP2.csproj b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraph/TwoTargetP2/TwoTargetP2.csproj
new file mode 100755
index 000000000..cab6d299d
--- /dev/null
+++ b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraph/TwoTargetP2/TwoTargetP2.csproj
@@ -0,0 +1,38 @@
+
+
+
+
+ netcoreapp1.0;netstandard1.5
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+
+
+ 1.0.1
+
+
+
+
+ 1.6.0
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);NETSTANDARD1_5
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraph/TwoTargetP2/project.json b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraph/TwoTargetP2/project.json
deleted file mode 100644
index 2f0604e40..000000000
--- a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraph/TwoTargetP2/project.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "version": "1.0.0-*",
- "dependencies": {},
- "frameworks": {
- "netcoreapp1.0": {
- "dependencies": {
- "Microsoft.NETCore.App": {
- "type": "platform",
- "version": "1.0.1"
- }
- }
- },
- "netstandard1.5": {
- "dependencies": {
- "NETStandard.Library": "1.6.0"
- }
- }
- }
-}
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP0/TwoTargetLargeP0.csproj b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP0/TwoTargetLargeP0.csproj
new file mode 100755
index 000000000..27bd030ab
--- /dev/null
+++ b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP0/TwoTargetLargeP0.csproj
@@ -0,0 +1,45 @@
+
+
+
+
+ netcoreapp1.0;netstandard1.6
+ Exe
+
+
+
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+
+
+ 1.0.1
+
+
+
+
+ 1.6.0
+
+
+ 1.0.4
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);NETSTANDARD1_6
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP0/project.json b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP0/project.json
deleted file mode 100644
index 3d60903c8..000000000
--- a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP0/project.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "version": "1.0.0-*",
- "buildOptions": {
- "emitEntryPoint": true
- },
- "dependencies": {
- "TwoTargetLargeP1": {
- "target": "project"
- }
- },
- "frameworks": {
- "netcoreapp1.0": {
- "dependencies": {
- "Microsoft.NETCore.App": {
- "type": "platform",
- "version": "1.0.1"
- }
- }
- },
- "netstandard1.6": {
- "dependencies": {
- "NETStandard.Library": "1.6.0",
- "Microsoft.NETCore.Runtime.CoreCLR": "1.0.4"
- }
- }
- },
- "runtimes": {
- "win7-x64": {},
- "win7-x86": {},
- "osx.10.10-x64": {},
- "osx.10.11-x64": {},
- "ubuntu.14.04-x64": {},
- "ubuntu.16.04-x64": {},
- "centos.7-x64": {},
- "rhel.7.2-x64": {},
- "debian.8-x64": {},
- "fedora.23-x64": {},
- "opensuse.13.2-x64": {}
- }
-}
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP1/TwoTargetLargeP1.csproj b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP1/TwoTargetLargeP1.csproj
new file mode 100755
index 000000000..2e21d189f
--- /dev/null
+++ b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP1/TwoTargetLargeP1.csproj
@@ -0,0 +1,42 @@
+
+
+
+
+ netcoreapp1.0;netstandard1.5
+
+
+
+
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+
+
+ 1.0.1
+
+
+
+
+ 1.6.0
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);NETSTANDARD1_5
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP1/project.json b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP1/project.json
deleted file mode 100644
index 948c96804..000000000
--- a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP1/project.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "version": "1.0.0-*",
- "dependencies": {
- "TwoTargetLargeP2": {
- "target": "project"
- },
- "TwoTargetLargeP4": {
- "target": "project"
- }
- },
- "frameworks": {
- "netcoreapp1.0": {
- "dependencies": {
- "Microsoft.NETCore.App": {
- "type": "platform",
- "version": "1.0.1"
- }
- }
- },
- "netstandard1.5": {
- "dependencies": {
- "NETStandard.Library": "1.6.0"
- }
- }
- }
-}
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP2/TwoTargetLargeP2.csproj b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP2/TwoTargetLargeP2.csproj
new file mode 100755
index 000000000..60e434ad8
--- /dev/null
+++ b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP2/TwoTargetLargeP2.csproj
@@ -0,0 +1,42 @@
+
+
+
+
+ netcoreapp1.0;netstandard1.5
+
+
+
+
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+
+
+ 1.0.1
+
+
+
+
+ 1.6.0
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);NETSTANDARD1_5
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP2/project.json b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP2/project.json
deleted file mode 100644
index cbb339ed3..000000000
--- a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP2/project.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "version": "1.0.0-*",
- "dependencies": {
- "TwoTargetLargeP3": {
- "target": "project"
- },
- "TwoTargetLargeP4": {
- "target": "project"
- }
- },
- "frameworks": {
- "netcoreapp1.0": {
- "dependencies": {
- "Microsoft.NETCore.App": {
- "type": "platform",
- "version": "1.0.1"
- }
- }
- },
- "netstandard1.5": {
- "dependencies": {
- "NETStandard.Library": "1.6.0"
- }
- }
- }
-}
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP3/TwoTargetLargeP3.csproj b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP3/TwoTargetLargeP3.csproj
new file mode 100755
index 000000000..9fed861a4
--- /dev/null
+++ b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP3/TwoTargetLargeP3.csproj
@@ -0,0 +1,41 @@
+
+
+
+
+ netcoreapp1.0;netstandard1.5
+
+
+
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+
+
+ 1.0.1
+
+
+
+
+ 1.6.0
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);NETSTANDARD1_5
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP3/project.json b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP3/project.json
deleted file mode 100644
index e43f21551..000000000
--- a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP3/project.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "version": "1.0.0-*",
- "dependencies": {
- "TwoTargetLargeP4": {
- "target": "project"
- }
- },
- "frameworks": {
- "netcoreapp1.0": {
- "dependencies": {
- "Microsoft.NETCore.App": {
- "type": "platform",
- "version": "1.0.1"
- }
- }
- },
- "netstandard1.5": {
- "dependencies": {
- "NETStandard.Library": "1.6.0"
- }
- }
- }
-}
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP4/TwoTargetLargeP4.csproj b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP4/TwoTargetLargeP4.csproj
new file mode 100755
index 000000000..d0adfb1b1
--- /dev/null
+++ b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP4/TwoTargetLargeP4.csproj
@@ -0,0 +1,42 @@
+
+
+
+
+ netcoreapp1.0;netstandard1.5
+
+
+
+
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+
+
+ 1.0.1
+
+
+
+
+ 1.6.0
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);NETSTANDARD1_5
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP4/project.json b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP4/project.json
deleted file mode 100644
index 4e413c82b..000000000
--- a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP4/project.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "version": "1.0.0-*",
- "dependencies": {
- "TwoTargetLargeP5": {
- "target": "project"
- },
- "TwoTargetLargeP6": {
- "target": "project"
- }
- },
- "frameworks": {
- "netcoreapp1.0": {
- "dependencies": {
- "Microsoft.NETCore.App": {
- "type": "platform",
- "version": "1.0.1"
- }
- }
- },
- "netstandard1.5": {
- "dependencies": {
- "NETStandard.Library": "1.6.0"
- }
- }
- }
-}
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP5/TwoTargetLargeP5.csproj b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP5/TwoTargetLargeP5.csproj
new file mode 100755
index 000000000..cab6d299d
--- /dev/null
+++ b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP5/TwoTargetLargeP5.csproj
@@ -0,0 +1,38 @@
+
+
+
+
+ netcoreapp1.0;netstandard1.5
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+
+
+ 1.0.1
+
+
+
+
+ 1.6.0
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);NETSTANDARD1_5
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP5/project.json b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP5/project.json
deleted file mode 100644
index 2f0604e40..000000000
--- a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP5/project.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "version": "1.0.0-*",
- "dependencies": {},
- "frameworks": {
- "netcoreapp1.0": {
- "dependencies": {
- "Microsoft.NETCore.App": {
- "type": "platform",
- "version": "1.0.1"
- }
- }
- },
- "netstandard1.5": {
- "dependencies": {
- "NETStandard.Library": "1.6.0"
- }
- }
- }
-}
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP6/TwoTargetLargeP6.csproj b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP6/TwoTargetLargeP6.csproj
new file mode 100755
index 000000000..cab6d299d
--- /dev/null
+++ b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP6/TwoTargetLargeP6.csproj
@@ -0,0 +1,38 @@
+
+
+
+
+ netcoreapp1.0;netstandard1.5
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+
+
+ 1.0.1
+
+
+
+
+ 1.6.0
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);NETSTANDARD1_5
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP6/project.json b/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP6/project.json
deleted file mode 100644
index 2f0604e40..000000000
--- a/TestAssets/TestProjects/PerformanceTestProjects/TwoTargetGraphLarge/TwoTargetLargeP6/project.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "version": "1.0.0-*",
- "dependencies": {},
- "frameworks": {
- "netcoreapp1.0": {
- "dependencies": {
- "Microsoft.NETCore.App": {
- "type": "platform",
- "version": "1.0.1"
- }
- }
- },
- "netstandard1.5": {
- "dependencies": {
- "NETStandard.Library": "1.6.0"
- }
- }
- }
-}
diff --git a/TestAssets/TestProjects/TestAppSimple/TestAppSimple.csproj b/TestAssets/TestProjects/TestAppSimple/TestAppSimple.csproj
new file mode 100755
index 000000000..9fa2cfbb5
--- /dev/null
+++ b/TestAssets/TestProjects/TestAppSimple/TestAppSimple.csproj
@@ -0,0 +1,29 @@
+
+
+
+
+ netcoreapp1.0
+ Exe
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+ 1.0.1
+
+
+
+ $(DefineConstants);NETCOREAPP1_0
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/TestAssets/TestProjects/TestAppWithProjDepTool/NuGet.Config b/TestAssets/TestProjects/TestAppWithProjDepTool/NuGet.Config
new file mode 100644
index 000000000..b8e876fcb
--- /dev/null
+++ b/TestAssets/TestProjects/TestAppWithProjDepTool/NuGet.Config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/TestAssets/TestProjects/MSBuildTestAppWithToolInDependencies/Program.cs b/TestAssets/TestProjects/TestAppWithProjDepTool/Program.cs
similarity index 100%
rename from TestAssets/TestProjects/MSBuildTestAppWithToolInDependencies/Program.cs
rename to TestAssets/TestProjects/TestAppWithProjDepTool/Program.cs
diff --git a/TestAssets/TestProjects/MSBuildTestAppWithToolInDependencies/MSBuildTestAppWithToolInDependencies.csproj b/TestAssets/TestProjects/TestAppWithProjDepTool/TestAppWithProjDepTool.csproj
similarity index 100%
rename from TestAssets/TestProjects/MSBuildTestAppWithToolInDependencies/MSBuildTestAppWithToolInDependencies.csproj
rename to TestAssets/TestProjects/TestAppWithProjDepTool/TestAppWithProjDepTool.csproj
diff --git a/TestAssets/TestProjects/TestAppWithUnicodéPath/Program.cs b/TestAssets/TestProjects/TestAppWithUnicodéPath/Program.cs
new file mode 100644
index 000000000..dcdd3eaa1
--- /dev/null
+++ b/TestAssets/TestProjects/TestAppWithUnicodéPath/Program.cs
@@ -0,0 +1,12 @@
+using System;
+
+namespace ConsoleApplication
+{
+ public class Program
+ {
+ public static void Main(string[] args)
+ {
+ Console.WriteLine("Hélló Wórld!");
+ }
+ }
+}
diff --git a/TestAssets/TestProjects/TestAppSimple/project.json b/TestAssets/TestProjects/TestAppWithUnicodéPath/project.json
similarity index 100%
rename from TestAssets/TestProjects/TestAppSimple/project.json
rename to TestAssets/TestProjects/TestAppWithUnicodéPath/project.json
diff --git a/TestAssets/TestProjects/TestLibraryWithConfiguration/TestLibraryWithConfiguration.csproj b/TestAssets/TestProjects/TestLibraryWithConfiguration/TestLibraryWithConfiguration.csproj
new file mode 100755
index 000000000..c69ce99dd
--- /dev/null
+++ b/TestAssets/TestProjects/TestLibraryWithConfiguration/TestLibraryWithConfiguration.csproj
@@ -0,0 +1,31 @@
+
+
+
+
+ netstandard1.5
+ $(NoWarn);CS1591
+ true
+ $(OutputPath)\$(TargetFramework)\$(AssemblyName).xml
+
+
+
+
+
+
+
+
+ 1.0.0-alpha-20161019-1
+ All
+
+
+ 1.6.0
+
+
+
+ $(DefineConstants);NETSTANDARD1_5
+
+
+ $(DefineConstants);RELEASE
+
+
+
\ No newline at end of file
diff --git a/build/Microsoft.DotNet.Cli.Compile.targets b/build/Microsoft.DotNet.Cli.Compile.targets
index 037253813..d80737214 100644
--- a/build/Microsoft.DotNet.Cli.Compile.targets
+++ b/build/Microsoft.DotNet.Cli.Compile.targets
@@ -41,7 +41,7 @@
@(CompileStageInputs)
$(Stage2Directory)
$(Stage2SymbolsDirectory)
- $(Stage1Directory)
+ $(Stage0Directory)
diff --git a/build/Microsoft.DotNet.Cli.Prepare.targets b/build/Microsoft.DotNet.Cli.Prepare.targets
index d5311419d..22a03036f 100644
--- a/build/Microsoft.DotNet.Cli.Prepare.targets
+++ b/build/Microsoft.DotNet.Cli.Prepare.targets
@@ -188,6 +188,7 @@
Outputs="@(RestorePackagesInput->'%(RelativeDir)/project.lock.json')">
+
diff --git a/build/Microsoft.DotNet.Cli.Test.targets b/build/Microsoft.DotNet.Cli.Test.targets
index b8de69a9c..45d6db400 100644
--- a/build/Microsoft.DotNet.Cli.Test.targets
+++ b/build/Microsoft.DotNet.Cli.Test.targets
@@ -39,7 +39,7 @@
EnvironmentVariables=$(RunTestEnvironmentVariables);
TestProjectName=%(TestProjects.OutputName);
TestResultXmlDir=$(TestResultXmlDir);
- ToolPath=$(Stage2Directory);
+ ToolPath=$(Stage0Directory);
WorkingDirectory=%(TestProjects.ProjectDir)
@@ -55,7 +55,7 @@
DependsOnTargets="Init">
$(CommitCount)
- $(BaseOutputDirectory)/tests/
+ $(RepoRoot)/artifacts/testpackages/
$(TestOutputDir)/packagesBuild/
$(TestOutputDir)/packages/
$(TestOutputDir)/artifacts/
@@ -72,7 +72,7 @@
Outputs="%(TestProjects.BuildOutput)">
@@ -84,9 +84,9 @@
Outputs="@(RestoreTestsInputs->'%(RelativeDir)project.lock.json')">
-
+
@@ -136,9 +136,9 @@
Inputs="@(RestoreTestAssetProjectsInputs)"
Outputs="@(RestoreTestAssetProjectsInputs->'%(RelativeDir)/project.lock.json')">
-
+
@@ -177,7 +177,7 @@
@@ -188,9 +188,9 @@
Inputs="@(RestoreDesktopTestAssetProjectsInputs)"
Outputs="@(RestoreDesktopTestAssetProjectsInputs->'%(RelativeDir)/project.lock.json')">
-
+
@@ -209,7 +209,7 @@
NoBuild="True"
Output="$(TestPackagesDir)"
ProjectPath="%(TestPackageProject.FullPath)"
- ToolPath="$(DotnetUnderTest)"
+ ToolPath="$(Stage0Directory)"
VersionSuffix="%(TestPackageProject.VersionSuffix)" />
@@ -222,7 +222,7 @@
@@ -232,8 +232,8 @@
Inputs="@(RestoreTestAssetPackageProjectsInputs)"
Outputs="@(RestoreTestAssetPackageProjectsInputs->'%(RelativeDir)/project.lock.json')">
-
+
-
+
diff --git a/build/compile/Microsoft.DotNet.Cli.LzmaArchive.targets b/build/compile/Microsoft.DotNet.Cli.LzmaArchive.targets
index 056d0e6ee..eb048d8a2 100644
--- a/build/compile/Microsoft.DotNet.Cli.LzmaArchive.targets
+++ b/build/compile/Microsoft.DotNet.Cli.LzmaArchive.targets
@@ -16,7 +16,7 @@
-
@@ -25,7 +25,7 @@
-
diff --git a/build/package/Microsoft.DotNet.Cli.Installer.DEB.proj b/build/package/Microsoft.DotNet.Cli.Installer.DEB.proj
index 0c13f7029..a14369b3e 100644
--- a/build/package/Microsoft.DotNet.Cli.Installer.DEB.proj
+++ b/build/package/Microsoft.DotNet.Cli.Installer.DEB.proj
@@ -49,7 +49,7 @@
ReplacementStrings="@(DebianConfigTokenValues -> '%(ReplacementString)')" />
-
@@ -135,9 +135,9 @@
-
+
+ -DotnetDir '$(Stage0Directory)'" />
Microsoft.DotNet.Cli.Utils
$(SdkNugetVersion)
-
- Microsoft.DotNet.Compiler.Common
- $(SdkNugetVersion)
-
-
- Microsoft.DotNet.Files
- $(SdkNugetVersion)
-
Microsoft.DotNet.InternalAbstractions
$(DependencyModelAndInternalAbstractionsNugetVersion)
-
- Microsoft.DotNet.ProjectModel
- $(ProjectModelNugetVersion)
-
-
- Microsoft.DotNet.ProjectModel.Loader
- $(SdkNugetVersion)
-
-
- Microsoft.DotNet.ProjectModel.Workspaces
- $(SdkNugetVersion)
-
-
- Microsoft.Extensions.Testing.Abstractions
- $(SdkNugetVersion)
-
-
- Microsoft.DotNet.Tools.Test
- $(SdkNugetVersion)
-
Microsoft.DotNet.ProjectJsonMigration
$(SdkNugetVersion)
@@ -71,7 +43,7 @@
NoBuild="True"
Output="$(NupkgOutputDirectory)"
ProjectPath="%(ProjectsToPack.Identity)"
- ToolPath="$(Stage2Directory)"
+ ToolPath="$(Stage0Directory)"
VersionSuffix="$(NupkgVersionSuffix)"
Configuration="$(Configuration)" />
@@ -82,7 +54,7 @@
Condition=" '$(OS)' == 'Windows_NT' ">
-
diff --git a/build/test/TestPackageProjects.targets b/build/test/TestPackageProjects.targets
index a22571df6..ddf129f79 100644
--- a/build/test/TestPackageProjects.targets
+++ b/build/test/TestPackageProjects.targets
@@ -161,33 +161,6 @@
False
netstandard1.5
-
- Microsoft.DotNet.ProjectModel
- True
- True
- 1.0.0-rc4-
- $(TestPackageBuildVersionSuffix)
- False
- netstandard1.3
-
-
- Microsoft.DotNet.ProjectModel.Loader
- True
- True
- 1.0.0-preview3-
- $(TestPackageBuildVersionSuffix)
- False
- netstandard1.6
-
-
- Microsoft.DotNet.ProjectModel.Workspaces
- True
- True
- 1.0.0-preview3-
- $(TestPackageBuildVersionSuffix)
- False
- netstandard1.5
-
Microsoft.DotNet.InternalAbstractions
True
@@ -197,33 +170,6 @@
False
netstandard1.3
-
- Microsoft.Extensions.Testing.Abstractions
- True
- True
- 1.0.0-preview3-
- $(TestPackageBuildVersionSuffix)
- False
- netstandard1.3
-
-
- Microsoft.DotNet.Compiler.Common
- True
- True
- 1.0.0-preview3-
- $(TestPackageBuildVersionSuffix)
- False
- netstandard1.5
-
-
- Microsoft.DotNet.Files
- True
- True
- 1.0.0-preview3-
- $(TestPackageBuildVersionSuffix)
- False
- netstandard1.5
-
diff --git a/build_projects/dotnet-cli-build/DotNetRestore.cs b/build_projects/dotnet-cli-build/DotNetRestore.cs
index 234bb5835..cb75d513a 100644
--- a/build_projects/dotnet-cli-build/DotNetRestore.cs
+++ b/build_projects/dotnet-cli-build/DotNetRestore.cs
@@ -12,20 +12,20 @@ namespace Microsoft.DotNet.Cli.Build
protected override string Args
{
- get { return $"{GetVerbosity()} {GetFallbackSource()} {GetPackages()}"; }
+ get { return $"{GetSource()} {GetPackages()} {GetSkipInvalidConfigurations()}"; }
}
- public string FallbackSource { get; set; }
+ public string Source { get; set; }
public string Packages { get; set; }
- public string Verbosity { get; set; }
+ public bool SkipInvalidConfigurations { get; set; }
- private string GetFallbackSource()
+ private string GetSource()
{
- if (!string.IsNullOrEmpty(FallbackSource))
+ if (!string.IsNullOrEmpty(Source))
{
- return $"--fallbacksource {FallbackSource}";
+ return $"--source {Source}";
}
return null;
@@ -41,11 +41,11 @@ namespace Microsoft.DotNet.Cli.Build
return null;
}
- private string GetVerbosity()
+ private string GetSkipInvalidConfigurations()
{
- if (!string.IsNullOrEmpty(Verbosity))
+ if (SkipInvalidConfigurations)
{
- return $"--verbosity {Verbosity}";
+ return "/p:SkipInvalidConfigurations=true";
}
return null;
diff --git a/build_projects/dotnet-cli-build/DotNetRestore3.cs b/build_projects/dotnet-cli-build/DotNetRestoreProjectJson.cs
similarity index 56%
rename from build_projects/dotnet-cli-build/DotNetRestore3.cs
rename to build_projects/dotnet-cli-build/DotNetRestoreProjectJson.cs
index 571ccc16e..d22982093 100644
--- a/build_projects/dotnet-cli-build/DotNetRestore3.cs
+++ b/build_projects/dotnet-cli-build/DotNetRestoreProjectJson.cs
@@ -3,29 +3,29 @@
namespace Microsoft.DotNet.Cli.Build
{
- public class DotNetRestore3 : DotNetTool
+ public class DotNetRestoreProjectJson : DotNetTool
{
protected override string Command
{
- get { return "restore3"; }
+ get { return "restore-projectjson"; }
}
protected override string Args
{
- get { return $"{GetSource()} {GetPackages()} {GetSkipInvalidConfigurations()}"; }
+ get { return $"{GetVerbosity()} {GetFallbackSource()} {GetPackages()}"; }
}
- public string Source { get; set; }
+ public string FallbackSource { get; set; }
public string Packages { get; set; }
- public bool SkipInvalidConfigurations { get; set; }
+ public string Verbosity { get; set; }
- private string GetSource()
+ private string GetFallbackSource()
{
- if (!string.IsNullOrEmpty(Source))
+ if (!string.IsNullOrEmpty(FallbackSource))
{
- return $"--source {Source}";
+ return $"--fallbacksource {FallbackSource}";
}
return null;
@@ -41,11 +41,11 @@ namespace Microsoft.DotNet.Cli.Build
return null;
}
- private string GetSkipInvalidConfigurations()
+ private string GetVerbosity()
{
- if (SkipInvalidConfigurations)
+ if (!string.IsNullOrEmpty(Verbosity))
{
- return "/p:SkipInvalidConfigurations=true";
+ return $"--verbosity {Verbosity}";
}
return null;
diff --git a/src/Microsoft.DotNet.Cli.Utils/Command.cs b/src/Microsoft.DotNet.Cli.Utils/Command.cs
index 67cec543e..212f8e138 100644
--- a/src/Microsoft.DotNet.Cli.Utils/Command.cs
+++ b/src/Microsoft.DotNet.Cli.Utils/Command.cs
@@ -7,7 +7,6 @@ using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
-using Microsoft.DotNet.ProjectModel;
using NuGet.Frameworks;
namespace Microsoft.DotNet.Cli.Utils
@@ -15,7 +14,9 @@ namespace Microsoft.DotNet.Cli.Utils
public class Command : ICommand
{
private readonly Process _process;
+
private StreamForwarder _stdOut;
+
private StreamForwarder _stdErr;
private bool _running = false;
@@ -114,39 +115,20 @@ namespace Microsoft.DotNet.Cli.Utils
return new Command(commandSpec);
}
- public static Command CreateForScript(
- string commandName,
- IEnumerable args,
- Project project,
- string[] inferredExtensionList)
- {
- var commandSpec = CommandResolver.TryResolveScriptCommandSpec(commandName,
- args,
- project,
- inferredExtensionList);
-
- if (commandSpec == null)
- {
- throw new CommandUnknownException(commandName);
- }
-
- var command = new Command(commandSpec);
-
- return command;
- }
-
public CommandResult Execute()
{
Reporter.Verbose.WriteLine($"Running {_process.StartInfo.FileName} {_process.StartInfo.Arguments}");
ThrowIfRunning();
+
_running = true;
_process.EnableRaisingEvents = true;
#if DEBUG
var sw = Stopwatch.StartNew();
+
Reporter.Verbose.WriteLine($"> {FormatProcessInfo(_process.StartInfo)}".White());
#endif
using (PerfTrace.Current.CaptureTiming($"{Path.GetFileNameWithoutExtension(_process.StartInfo.FileName)} {_process.StartInfo.Arguments}"))
diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandContext.cs b/src/Microsoft.DotNet.Cli.Utils/CommandContext.cs
index 8209dd2f7..9913cde73 100644
--- a/src/Microsoft.DotNet.Cli.Utils/CommandContext.cs
+++ b/src/Microsoft.DotNet.Cli.Utils/CommandContext.cs
@@ -25,6 +25,11 @@ namespace Microsoft.DotNet.Cli.Utils
public static bool ShouldPassAnsiCodesThrough()
{
return _ansiPassThru.Value;
- }
+ }
+
+ public static void SetVerbose(bool value)
+ {
+ _verbose = new Lazy(() => value);
+ }
}
}
diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/AppBaseDllCommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/AppBaseDllCommandResolver.cs
index 50e2020a2..eb495c103 100644
--- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/AppBaseDllCommandResolver.cs
+++ b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/AppBaseDllCommandResolver.cs
@@ -1,7 +1,6 @@
using System.IO;
using System.Linq;
using Microsoft.DotNet.PlatformAbstractions;
-using Microsoft.DotNet.ProjectModel;
namespace Microsoft.DotNet.Cli.Utils
{
diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/DepsJsonCommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/DepsJsonCommandResolver.cs
index 6c67bd2b1..201a3eecd 100644
--- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/DepsJsonCommandResolver.cs
+++ b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/DepsJsonCommandResolver.cs
@@ -2,7 +2,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using Microsoft.DotNet.ProjectModel;
+
using Microsoft.Extensions.DependencyModel;
namespace Microsoft.DotNet.Cli.Utils
diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/IProject.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/IProject.cs
index 206c0bcde..d0d43dc57 100644
--- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/IProject.cs
+++ b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/IProject.cs
@@ -14,6 +14,8 @@ namespace Microsoft.DotNet.Cli.Utils
string DepsJsonPath { get; }
+ string ProjectRoot { get; }
+
string RuntimeConfigJsonPath { get; }
string FullOutputPath { get; }
diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/MSBuildProject.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/MSBuildProject.cs
index e1a81e787..8be1d4bd0 100644
--- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/MSBuildProject.cs
+++ b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/MSBuildProject.cs
@@ -15,6 +15,8 @@ namespace Microsoft.DotNet.Cli.Utils
{
private Project _project;
+ private string _projectRoot;
+
private string _msBuildExePath;
public string DepsJsonPath
@@ -50,6 +52,14 @@ namespace Microsoft.DotNet.Cli.Utils
}
}
+ public string ProjectRoot
+ {
+ get
+ {
+ return _projectRoot;
+ }
+ }
+
public Dictionary EnvironmentVariables
{
get
@@ -68,6 +78,8 @@ namespace Microsoft.DotNet.Cli.Utils
string outputPath,
string msBuildExePath)
{
+ _projectRoot = msBuildExePath;
+
var globalProperties = new Dictionary()
{
{ "MSBuildExtensionsPath", Path.GetDirectoryName(msBuildExePath) }
diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/OutputPathCommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/OutputPathCommandResolver.cs
index cdf3aec58..33998f0e3 100644
--- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/OutputPathCommandResolver.cs
+++ b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/OutputPathCommandResolver.cs
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using System.IO;
-using Microsoft.DotNet.InternalAbstractions;
-using Microsoft.DotNet.ProjectModel;
+using Microsoft.DotNet.Cli.Utils;
using NuGet.Frameworks;
namespace Microsoft.DotNet.Cli.Utils
@@ -43,6 +42,7 @@ namespace Microsoft.DotNet.Cli.Utils
string buildBasePath)
{
var projectFactory = new ProjectFactory(_environment);
+
var project = projectFactory.GetProject(
projectDirectory,
framework,
diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PackagedCommandSpecFactory.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PackagedCommandSpecFactory.cs
index bb12b14f1..18aefdebf 100644
--- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PackagedCommandSpecFactory.cs
+++ b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PackagedCommandSpecFactory.cs
@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using Microsoft.DotNet.ProjectModel;
using Microsoft.DotNet.Tools.Common;
using NuGet.Packaging;
using NuGet.ProjectModel;
@@ -21,12 +20,15 @@ namespace Microsoft.DotNet.Cli.Utils
string depsFilePath,
string runtimeConfigPath)
{
+ Reporter.Verbose.WriteLine($"packagedcommandspecfactory: attempting to find command {commandName} in {toolLibrary.Name}");
var toolAssembly = toolLibrary?.RuntimeAssemblies
.FirstOrDefault(r => Path.GetFileNameWithoutExtension(r.Path) == commandName);
if (toolAssembly == null)
{
+ Reporter.Verbose.WriteLine($"packagedcommandspecfactory: failed to find toolAssembly for {commandName}");
+
return null;
}
@@ -34,6 +36,8 @@ namespace Microsoft.DotNet.Cli.Utils
if (!File.Exists(commandPath))
{
+ Reporter.Verbose.WriteLine($"packagedcommandspecfactory: failed to find commandPath {commandPath}");
+
return null;
}
diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PathCommandResolverPolicy.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PathCommandResolverPolicy.cs
new file mode 100644
index 000000000..874c79639
--- /dev/null
+++ b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PathCommandResolverPolicy.cs
@@ -0,0 +1,43 @@
+using Microsoft.DotNet.PlatformAbstractions;
+
+namespace Microsoft.DotNet.Cli.Utils
+{
+ public class PathCommandResolverPolicy : ICommandResolverPolicy
+ {
+ public CompositeCommandResolver CreateCommandResolver()
+ {
+ return Create();
+ }
+
+ public static CompositeCommandResolver Create()
+ {
+ var environment = new EnvironmentProvider();
+
+ var platformCommandSpecFactory = default(IPlatformCommandSpecFactory);
+ if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows)
+ {
+ platformCommandSpecFactory = new WindowsExePreferredCommandSpecFactory();
+ }
+ else
+ {
+ platformCommandSpecFactory = new GenericPlatformCommandSpecFactory();
+ }
+
+ return CreatePathCommandResolverPolicy(
+ environment,
+ platformCommandSpecFactory);
+ }
+
+ public static CompositeCommandResolver CreatePathCommandResolverPolicy(
+ IEnvironmentProvider environment,
+ IPlatformCommandSpecFactory platformCommandSpecFactory)
+ {
+ var compositeCommandResolver = new CompositeCommandResolver();
+
+ compositeCommandResolver.AddCommandResolver(
+ new PathCommandResolver(environment, platformCommandSpecFactory));
+
+ return compositeCommandResolver;
+ }
+ }
+}
diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectDependenciesCommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectDependenciesCommandResolver.cs
index 29d40a042..b2a06ec29 100644
--- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectDependenciesCommandResolver.cs
+++ b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectDependenciesCommandResolver.cs
@@ -2,9 +2,6 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using Microsoft.DotNet.Cli.Utils;
-using Microsoft.DotNet.InternalAbstractions;
-using Microsoft.DotNet.ProjectModel;
using Microsoft.DotNet.Tools.Common;
using NuGet.Frameworks;
using NuGet.ProjectModel;
@@ -39,11 +36,15 @@ namespace Microsoft.DotNet.Cli.Utils
public CommandSpec Resolve(CommandResolverArguments commandResolverArguments)
{
+ Reporter.Verbose.WriteLine($"projectdependenciescommandresolver: attempting to resolve {commandResolverArguments.CommandName}");
+
if (commandResolverArguments.Framework == null
|| commandResolverArguments.ProjectDirectory == null
|| commandResolverArguments.Configuration == null
|| commandResolverArguments.CommandName == null)
{
+ Reporter.Verbose.WriteLine($"projectdependenciescommandresolver: invalid commandResolverArguments");
+
return null;
}
diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectFactory.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectFactory.cs
index 80bdc5e7f..4a7cf2c64 100644
--- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectFactory.cs
+++ b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectFactory.cs
@@ -6,7 +6,6 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.Build.Exceptions;
-using Microsoft.DotNet.ProjectModel;
using NuGet.Frameworks;
namespace Microsoft.DotNet.Cli.Utils
@@ -27,13 +26,13 @@ namespace Microsoft.DotNet.Cli.Utils
string buildBasePath,
string outputPath)
{
- return GetMSBuildProj(projectDirectory, framework, configuration, outputPath) ??
- GetProjectJsonProject(projectDirectory, framework, configuration, buildBasePath, outputPath);
+ return GetMSBuildProj(projectDirectory, framework, configuration, outputPath);
}
private IProject GetMSBuildProj(string projectDirectory, NuGetFramework framework, string configuration, string outputPath)
{
var msBuildExePath = _environment.GetEnvironmentVariable(Constants.MSBUILD_EXE_PATH);
+
msBuildExePath = string.IsNullOrEmpty(msBuildExePath) ?
Path.Combine(AppContext.BaseDirectory, "MSBuild.dll") :
msBuildExePath;
@@ -41,7 +40,9 @@ namespace Microsoft.DotNet.Cli.Utils
Reporter.Verbose.WriteLine($"projetfactory: MSBUILD_EXE_PATH = {msBuildExePath}");
string msBuildProjectPath = GetMSBuildProjPath(projectDirectory);
+
Reporter.Verbose.WriteLine($"projetfactory: MSBuild project path = {msBuildProjectPath}");
+
if(msBuildProjectPath == null)
{
return null;
@@ -54,25 +55,11 @@ namespace Microsoft.DotNet.Cli.Utils
catch (InvalidProjectFileException ex)
{
Reporter.Verbose.WriteLine(ex.ToString().Red());
+
return null;
}
}
- private IProject GetProjectJsonProject(
- string projectDirectory,
- NuGetFramework framework,
- string configuration,
- string buildBasePath,
- string outputPath)
- {
- if (!File.Exists(Path.Combine(projectDirectory, Project.FileName)))
- {
- return null;
- }
-
- return new ProjectJsonProject(projectDirectory, framework, configuration, buildBasePath, outputPath);
- }
-
private string GetMSBuildProjPath(string projectDirectory)
{
IEnumerable projectFiles = Directory
diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectJsonProject.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectJsonProject.cs
deleted file mode 100644
index 10ea486fe..000000000
--- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectJsonProject.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using Microsoft.DotNet.Cli.Utils;
-using Microsoft.DotNet.InternalAbstractions;
-using Microsoft.DotNet.ProjectModel;
-using NuGet.Frameworks;
-using NuGet.ProjectModel;
-
-namespace Microsoft.DotNet.Cli.Utils
-{
- internal class ProjectJsonProject : IProject
- {
- private LockFile _lockFile;
-
- private ProjectContext _projectContext;
-
- private string _projectDirectory;
-
- private string _configuration;
-
- private string _outputPath;
-
- private string _buildBasePath;
-
- private NuGetFramework _framework;
-
- private ProjectContext ProjectContext
- {
- get
- {
- if(_projectContext == null)
- {
- _projectContext = ProjectContext.Create(
- _projectDirectory,
- _framework,
- RuntimeEnvironmentRidExtensions.GetAllCandidateRuntimeIdentifiers());
- }
-
- return _projectContext;
- }
- }
-
- public string DepsJsonPath
- {
- get
- {
- return ProjectContext.GetOutputPaths(
- _configuration,
- _buildBasePath,
- _outputPath).RuntimeFiles.DepsJson;
- }
- }
-
- public string RuntimeConfigJsonPath
- {
- get
- {
- return ProjectContext.GetOutputPaths(
- _configuration,
- _buildBasePath,
- _outputPath).RuntimeFiles.RuntimeConfigJson;
- }
- }
-
- public string FullOutputPath
- {
- get
- {
- return
- ProjectContext.GetOutputPaths(_configuration, _buildBasePath, _outputPath).RuntimeFiles.BasePath;
- }
- }
-
- public Dictionary EnvironmentVariables
- {
- get
- {
- return new Dictionary();
- }
- }
-
- public ProjectJsonProject(
- string projectDirectory,
- NuGetFramework framework,
- string configuration,
- string buildBasePath,
- string outputPath)
- {
- var lockFilePath = Path.Combine(projectDirectory, LockFileFormat.LockFileName);
- _lockFile = new LockFileFormat().Read(lockFilePath);
-
- _projectDirectory = projectDirectory;
- _framework = framework;
- _configuration = configuration;
- _buildBasePath = buildBasePath;
- _outputPath = outputPath;
- }
-
- public LockFile GetLockFile()
- {
- return _lockFile;
- }
-
- public IEnumerable GetTools()
- {
- var tools = _lockFile.Tools.Where(t => t.Name.Contains(".NETCoreApp")).SelectMany(t => t.Libraries);
-
- return tools.Select(t => new SingleProjectInfo(
- t.Name,
- t.Version.ToFullString(),
- Enumerable.Empty()));
- }
- }
-}
\ No newline at end of file
diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsCommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsCommandResolver.cs
index fce36d55e..2e5b3263f 100644
--- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsCommandResolver.cs
+++ b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsCommandResolver.cs
@@ -5,13 +5,12 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using Microsoft.DotNet.ProjectModel;
using Microsoft.DotNet.Tools.Common;
using Microsoft.Extensions.DependencyModel;
+using NuGet.Configuration;
using NuGet.Frameworks;
using NuGet.ProjectModel;
using NuGet.Versioning;
-using FileFormatException = Microsoft.DotNet.ProjectModel.FileFormatException;
namespace Microsoft.DotNet.Cli.Utils
{
@@ -45,6 +44,8 @@ namespace Microsoft.DotNet.Cli.Utils
if (commandResolverArguments.CommandName == null
|| commandResolverArguments.ProjectDirectory == null)
{
+ Reporter.Verbose.WriteLine($"projecttoolscommandresolver: Invalid CommandResolverArguments");
+
return null;
}
@@ -54,12 +55,21 @@ namespace Microsoft.DotNet.Cli.Utils
private CommandSpec ResolveFromProjectTools(CommandResolverArguments commandResolverArguments)
{
var projectFactory = new ProjectFactory(_environment);
+
var project = projectFactory.GetProject(
commandResolverArguments.ProjectDirectory,
commandResolverArguments.Framework,
commandResolverArguments.Configuration,
commandResolverArguments.BuildBasePath,
commandResolverArguments.OutputPath);
+
+ if (project == null)
+ {
+ Reporter.Verbose.WriteLine($"projecttoolscommandresolver: ProjectFactory did not find Project.");
+
+ return null;
+ }
+
var tools = project.GetTools();
return ResolveCommandSpecFromAllToolLibraries(
@@ -77,6 +87,8 @@ namespace Microsoft.DotNet.Cli.Utils
LockFile lockFile,
IProject project)
{
+ Reporter.Verbose.WriteLine($"projecttoolscommandresolver: resolving commandspec from {toolsLibraries.Count()} Tool Libraries.");
+
foreach (var toolLibrary in toolsLibraries)
{
var commandSpec = ResolveCommandSpecFromToolLibrary(
@@ -92,6 +104,8 @@ namespace Microsoft.DotNet.Cli.Utils
}
}
+ Reporter.Verbose.WriteLine($"projecttoolscommandresolver: failed to resolve commandspec from library.");
+
return null;
}
@@ -102,10 +116,18 @@ namespace Microsoft.DotNet.Cli.Utils
LockFile lockFile,
IProject project)
{
- var nugetPackagesRoot = lockFile.PackageFolders.First().Path;
+ Reporter.Verbose.WriteLine($"projecttoolscommandresolver: Attempting to resolve command spec from tool {toolLibraryRange.Name}");
+
+ var nuGetPathContext = NuGetPathContext.Create(project.ProjectRoot);
+
+ var nugetPackagesRoot = nuGetPathContext.UserPackageFolder;
+
+ Reporter.Verbose.WriteLine($"projecttoolscommandresolver: nuget packages root:\n{nugetPackagesRoot}");
var toolLockFile = GetToolLockFile(toolLibraryRange, nugetPackagesRoot);
+ Reporter.Verbose.WriteLine($"projecttoolscommandresolver: found tool lockfile at : {toolLockFile.Path}");
+
var toolLibrary = toolLockFile.Targets
.FirstOrDefault(
t => t.TargetFramework.GetShortFolderName().Equals(s_toolPackageFramework.GetShortFolderName()))
@@ -113,14 +135,19 @@ namespace Microsoft.DotNet.Cli.Utils
if (toolLibrary == null)
{
+ Reporter.Verbose.WriteLine($"projecttoolscommandresolver: library not found in lock file.");
+
return null;
}
var depsFileRoot = Path.GetDirectoryName(toolLockFile.Path);
+
var depsFilePath = GetToolDepsFilePath(toolLibraryRange, toolLockFile, depsFileRoot);
var normalizedNugetPackagesRoot = PathUtility.EnsureNoTrailingDirectorySeparator(nugetPackagesRoot);
+ Reporter.Verbose.WriteLine($"projecttoolscommandresolver: attempting to create commandspec");
+
var commandSpec = _packagedCommandSpecFactory.CreateCommandSpecFromLibrary(
toolLibrary,
commandName,
@@ -131,6 +158,11 @@ namespace Microsoft.DotNet.Cli.Utils
depsFilePath,
null);
+ if (commandSpec == null)
+ {
+ Reporter.Verbose.WriteLine($"projecttoolscommandresolver: commandSpec is null.");
+ }
+
commandSpec?.AddEnvironmentVariablesFromProject(project);
return commandSpec;
@@ -182,6 +214,8 @@ namespace Microsoft.DotNet.Cli.Utils
depsPathRoot,
toolLibrary.Name + FileNameSuffixes.DepsJson);
+ Reporter.Verbose.WriteLine($"projecttoolscommandresolver: expect deps.json at: {depsJsonPath}");
+
EnsureToolJsonDepsFileExists(toolLockFile, depsJsonPath, toolLibrary);
return depsJsonPath;
diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PublishPathCommandSpecFactory.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PublishPathCommandSpecFactory.cs
index 54a9c68f2..4de59a1eb 100644
--- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PublishPathCommandSpecFactory.cs
+++ b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PublishPathCommandSpecFactory.cs
@@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.IO;
-using Microsoft.DotNet.ProjectModel;
namespace Microsoft.DotNet.Cli.Utils
{
diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolver.cs
index 8b2b7db97..a740278b3 100644
--- a/src/Microsoft.DotNet.Cli.Utils/CommandResolver.cs
+++ b/src/Microsoft.DotNet.Cli.Utils/CommandResolver.cs
@@ -1,6 +1,5 @@
using System.Collections.Generic;
using System.IO;
-using Microsoft.DotNet.ProjectModel;
using NuGet.Frameworks;
namespace Microsoft.DotNet.Cli.Utils
@@ -49,25 +48,6 @@ namespace Microsoft.DotNet.Cli.Utils
return defaultCommandResolver.Resolve(commandResolverArgs);
}
-
- public static CommandSpec TryResolveScriptCommandSpec(
- string commandName,
- IEnumerable args,
- Project project,
- string[] inferredExtensionList)
- {
- var commandResolverArgs = new CommandResolverArguments
- {
- CommandName = commandName,
- CommandArguments = args,
- ProjectDirectory = project.ProjectDirectory,
- InferredExtensions = inferredExtensionList
- };
-
- var scriptCommandResolver = ScriptCommandResolverPolicy.Create();
-
- return scriptCommandResolver.Resolve(commandResolverArgs);
- }
}
}
diff --git a/src/Microsoft.DotNet.Cli.Utils/DotnetRuntimeIdentifiers.cs b/src/Microsoft.DotNet.Cli.Utils/DotnetRuntimeIdentifiers.cs
index 00427a890..747fa8901 100644
--- a/src/Microsoft.DotNet.Cli.Utils/DotnetRuntimeIdentifiers.cs
+++ b/src/Microsoft.DotNet.Cli.Utils/DotnetRuntimeIdentifiers.cs
@@ -2,7 +2,6 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Collections.Generic;
-using Microsoft.DotNet.InternalAbstractions;
namespace Microsoft.DotNet.Cli.Utils
{
diff --git a/src/Microsoft.DotNet.Cli.Utils/Extensions/ProjectContextCollectionExtensions.cs b/src/Microsoft.DotNet.Cli.Utils/Extensions/ProjectContextCollectionExtensions.cs
deleted file mode 100644
index 249df0e2c..000000000
--- a/src/Microsoft.DotNet.Cli.Utils/Extensions/ProjectContextCollectionExtensions.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.DotNet.ProjectModel;
-
-namespace Microsoft.DotNet.Cli.Utils
-{
- public static class ProjectContextCollectionExtensions
- {
- public static ProjectContextCollection EnsureValid(this ProjectContextCollection contextCollection, string projectFilePath)
- {
- IEnumerable errors;
-
- if (contextCollection == null)
- {
- errors = new[]
- {
- new DiagnosticMessage(
- ErrorCodes.DOTNET1017,
- $"Project file does not exist '{ProjectPathHelper.NormalizeProjectFilePath(projectFilePath)}'.",
- projectFilePath,
- DiagnosticMessageSeverity.Error)
- };
- }
- else
- {
- errors = contextCollection
- .ProjectDiagnostics
- .Where(d => d.Severity == DiagnosticMessageSeverity.Error);
- }
-
- if (errors.Any())
- {
- StringBuilder errorMessage = new StringBuilder($"The current project is not valid because of the following errors:{Environment.NewLine}");
-
- foreach (DiagnosticMessage message in errors)
- {
- errorMessage.AppendLine(message.FormattedMessage);
- }
-
- throw new GracefulException(errorMessage.ToString());
- }
-
- return contextCollection;
- }
- }
-}
diff --git a/src/Microsoft.DotNet.ProjectModel/FileNameSuffixes.cs b/src/Microsoft.DotNet.Cli.Utils/FileNameSuffixes.cs
similarity index 98%
rename from src/Microsoft.DotNet.ProjectModel/FileNameSuffixes.cs
rename to src/Microsoft.DotNet.Cli.Utils/FileNameSuffixes.cs
index 231162a31..86d1d6407 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileNameSuffixes.cs
+++ b/src/Microsoft.DotNet.Cli.Utils/FileNameSuffixes.cs
@@ -1,7 +1,7 @@
using System;
using Microsoft.DotNet.PlatformAbstractions;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Cli.Utils
{
public static class FileNameSuffixes
{
@@ -70,4 +70,4 @@ namespace Microsoft.DotNet.ProjectModel
public string StaticLib { get; internal set; }
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Microsoft.DotNet.Cli.Utils/FrameworkDependencyFile.cs b/src/Microsoft.DotNet.Cli.Utils/FrameworkDependencyFile.cs
index f783e9c15..5393df880 100644
--- a/src/Microsoft.DotNet.Cli.Utils/FrameworkDependencyFile.cs
+++ b/src/Microsoft.DotNet.Cli.Utils/FrameworkDependencyFile.cs
@@ -4,6 +4,7 @@
using System.IO;
using System.Linq;
using Microsoft.DotNet.PlatformAbstractions;
+
using Microsoft.Extensions.DependencyModel;
namespace Microsoft.DotNet.Cli.Utils
diff --git a/src/Microsoft.DotNet.Cli.Utils/RuntimeConfig.cs b/src/Microsoft.DotNet.Cli.Utils/RuntimeConfig.cs
new file mode 100644
index 000000000..5b0c8fcc5
--- /dev/null
+++ b/src/Microsoft.DotNet.Cli.Utils/RuntimeConfig.cs
@@ -0,0 +1,56 @@
+// Copyright (c) .NET Foundation and contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using Newtonsoft.Json.Linq;
+using System.IO;
+
+namespace Microsoft.DotNet.Cli.Utils
+{
+ public class RuntimeConfig
+ {
+ public bool IsPortable { get; }
+ public RuntimeConfigFramework Framework { get; }
+
+ public RuntimeConfig(string runtimeConfigPath)
+ {
+ var runtimeConfigJson = OpenRuntimeConfig(runtimeConfigPath);
+
+ Framework = ParseFramework(runtimeConfigJson);
+
+ IsPortable = Framework != null;
+ }
+
+ public static bool IsApplicationPortable(string entryAssemblyPath)
+ {
+ var runtimeConfigFile = Path.ChangeExtension(entryAssemblyPath, FileNameSuffixes.RuntimeConfigJson);
+ if (File.Exists(runtimeConfigFile))
+ {
+ var runtimeConfig = new RuntimeConfig(runtimeConfigFile);
+ return runtimeConfig.IsPortable;
+ }
+ return false;
+ }
+
+ private JObject OpenRuntimeConfig(string runtimeConfigPath)
+ {
+ return JObject.Parse(File.ReadAllText(runtimeConfigPath));
+ }
+
+ private RuntimeConfigFramework ParseFramework(JObject runtimeConfigRoot)
+ {
+ var runtimeOptionsRoot = runtimeConfigRoot["runtimeOptions"];
+ if (runtimeOptionsRoot == null)
+ {
+ return null;
+ }
+
+ var framework = (JObject) runtimeOptionsRoot["framework"];
+ if (framework == null)
+ {
+ return null;
+ }
+
+ return RuntimeConfigFramework.ParseFromFrameworkRoot(framework);
+ }
+ }
+}
diff --git a/src/Microsoft.DotNet.Cli.Utils/RuntimeConfigFramework.cs b/src/Microsoft.DotNet.Cli.Utils/RuntimeConfigFramework.cs
new file mode 100644
index 000000000..b8f8dcea5
--- /dev/null
+++ b/src/Microsoft.DotNet.Cli.Utils/RuntimeConfigFramework.cs
@@ -0,0 +1,34 @@
+// Copyright (c) .NET Foundation and contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System;
+using System.Linq;
+using Newtonsoft.Json.Linq;
+
+namespace Microsoft.DotNet.Cli.Utils
+{
+ public class RuntimeConfigFramework
+ {
+ public string Name { get; set; }
+ public string Version { get; set; }
+
+ public static RuntimeConfigFramework ParseFromFrameworkRoot(JObject framework)
+ {
+ var properties = framework.Properties();
+
+ var name = properties.FirstOrDefault(p => p.Name.Equals("name", StringComparison.OrdinalIgnoreCase));
+ var version = properties.FirstOrDefault(p => p.Name.Equals("version", StringComparison.OrdinalIgnoreCase));
+
+ if (name == null || version == null)
+ {
+ return null;
+ }
+
+ return new RuntimeConfigFramework
+ {
+ Name = name.Value.ToString(),
+ Version = version.Value.ToString()
+ };
+ }
+ }
+}
diff --git a/src/Microsoft.DotNet.Cli.Utils/RuntimeEnvironmentRidExtensions.cs b/src/Microsoft.DotNet.Cli.Utils/RuntimeEnvironmentRidExtensions.cs
new file mode 100644
index 000000000..073e1407e
--- /dev/null
+++ b/src/Microsoft.DotNet.Cli.Utils/RuntimeEnvironmentRidExtensions.cs
@@ -0,0 +1,84 @@
+
+using System;
+using System.Collections.Generic;
+using Microsoft.DotNet.PlatformAbstractions;
+
+namespace Microsoft.DotNet.Cli.Utils
+{
+ // This is to support some legacy stuff.
+ // dnu restore (and thus dotnet restore) always uses win7-x64 as the Windows restore target,
+ // so, when picking targets out of the lock file, we need to do version fallback since the
+ // active RID might be higher than the RID in the lock file.
+ //
+ // We should clean this up. Filed #619 to track.
+ public static class RuntimeEnvironmentRidExtensions
+ {
+ // Gets the identfier that is used for restore by default (this is different from the actual RID, but only on Windows)
+ public static string GetLegacyRestoreRuntimeIdentifier()
+ {
+ if (RuntimeEnvironment.OperatingSystemPlatform != Platform.Windows)
+ {
+ return RuntimeEnvironment.GetRuntimeIdentifier();
+ }
+ else
+ {
+ var arch = RuntimeEnvironment.RuntimeArchitecture.ToLowerInvariant();
+ return "win7-" + arch;
+ }
+ }
+
+ public static IEnumerable GetAllCandidateRuntimeIdentifiers()
+ {
+ return GetAllCandidateRuntimeIdentifiers(null);
+ }
+
+ public static IEnumerable GetAllCandidateRuntimeIdentifiers(IEnumerable fallbackIdentifiers = null)
+ {
+ List result = new List();
+
+ if (RuntimeEnvironment.OperatingSystemPlatform != Platform.Windows)
+ {
+ result.Add(RuntimeEnvironment.GetRuntimeIdentifier());
+ }
+ else
+ {
+ var arch = RuntimeEnvironment.RuntimeArchitecture.ToLowerInvariant();
+ if (RuntimeEnvironment.OperatingSystemVersion.StartsWith("6.1", StringComparison.Ordinal))
+ {
+ result.Add("win7-" + arch);
+ }
+ else if (RuntimeEnvironment.OperatingSystemVersion.StartsWith("6.2", StringComparison.Ordinal))
+ {
+ result.Add("win8-" + arch);
+ result.Add("win7-" + arch);
+ }
+ else if (RuntimeEnvironment.OperatingSystemVersion.StartsWith("6.3", StringComparison.Ordinal))
+ {
+ result.Add("win81-" + arch);
+ result.Add("win8-" + arch);
+ result.Add("win7-" + arch);
+ }
+ else if (RuntimeEnvironment.OperatingSystemVersion.StartsWith("10.0", StringComparison.Ordinal))
+ {
+ result.Add("win10-" + arch);
+ result.Add("win81-" + arch);
+ result.Add("win8-" + arch);
+ result.Add("win7-" + arch);
+ }
+ }
+
+ if (fallbackIdentifiers != null)
+ {
+ foreach (string fallbackIdentifier in fallbackIdentifiers)
+ {
+ if (!result.Contains(fallbackIdentifier))
+ {
+ result.Add(fallbackIdentifier);
+ }
+ }
+ }
+
+ return result;
+ }
+ }
+}
diff --git a/src/Microsoft.DotNet.Cli.Utils/ScriptExecutor.cs b/src/Microsoft.DotNet.Cli.Utils/ScriptExecutor.cs
deleted file mode 100644
index 31d822134..000000000
--- a/src/Microsoft.DotNet.Cli.Utils/ScriptExecutor.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.DotNet.Cli.Utils.CommandParsing;
-using Microsoft.DotNet.PlatformAbstractions;
-using Microsoft.DotNet.ProjectModel;
-
-namespace Microsoft.DotNet.Cli.Utils
-{
- public static class ScriptExecutor
- {
- public static ICommand CreateCommandForScript(Project project, string scriptCommandLine, IDictionary variables)
- {
- return CreateCommandForScript(project, scriptCommandLine, WrapVariableDictionary(variables));
- }
-
- public static ICommand CreateCommandForScript(Project project, string scriptCommandLine, Func getVariable)
- {
- var scriptArguments = ParseScriptArguments(project, scriptCommandLine, getVariable);
- if (scriptArguments == null)
- {
- throw new Exception($"ScriptExecutor: failed to parse script \"{scriptCommandLine}\"");
- }
-
- var inferredExtensions = DetermineInferredScriptExtensions();
-
- return Command
- .CreateForScript(scriptArguments.First(), scriptArguments.Skip(1), project, inferredExtensions)
- .WorkingDirectory(project.ProjectDirectory);
- }
-
- private static IEnumerable ParseScriptArguments(Project project, string scriptCommandLine, Func getVariable)
- {
- var scriptArguments = CommandGrammar.Process(
- scriptCommandLine,
- GetScriptVariable(project, getVariable),
- preserveSurroundingQuotes: false);
-
- scriptArguments = scriptArguments.Where(argument => !string.IsNullOrEmpty(argument)).ToArray();
- if (scriptArguments.Length == 0)
- {
- return null;
- }
-
- return scriptArguments;
- }
-
- private static string[] DetermineInferredScriptExtensions()
- {
- if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows)
- {
- return new string[] { "", ".cmd" };
- }
- else
- {
- return new string[] { "", ".sh" };
- }
- }
-
- private static Func WrapVariableDictionary(IDictionary contextVariables)
- {
- return key =>
- {
- string value;
- contextVariables.TryGetValue(key, out value);
- return value;
- };
- }
-
- private static Func GetScriptVariable(Project project, Func getVariable)
- {
- var keys = new Dictionary>(StringComparer.OrdinalIgnoreCase)
- {
- { "project:Directory", () => project.ProjectDirectory },
- { "project:Name", () => project.Name },
- { "project:Version", () => project.Version.ToString() },
- };
-
- return key =>
- {
- // try returning key from dictionary
- Func valueFactory;
- if (keys.TryGetValue(key, out valueFactory))
- {
- return valueFactory();
- }
-
- // try returning command-specific key
- var value = getVariable(key);
- if (!string.IsNullOrEmpty(value))
- {
- return value;
- }
-
- // try returning environment variable
- return Environment.GetEnvironmentVariable(key);
- };
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Cli.Utils/ScriptNames.cs b/src/Microsoft.DotNet.Cli.Utils/ScriptNames.cs
deleted file mode 100644
index 18ac76f3e..000000000
--- a/src/Microsoft.DotNet.Cli.Utils/ScriptNames.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace Microsoft.DotNet.Cli.Utils
-{
- public static class ScriptNames
- {
- public const string PreCompile = "precompile";
- public const string PostCompile = "postcompile";
- public const string PrePublish = "prepublish";
- public const string PostPublish = "postpublish";
- }
-}
diff --git a/src/Microsoft.DotNet.Cli.Utils/project.json b/src/Microsoft.DotNet.Cli.Utils/project.json
index 31e76e28c..961dd507a 100644
--- a/src/Microsoft.DotNet.Cli.Utils/project.json
+++ b/src/Microsoft.DotNet.Cli.Utils/project.json
@@ -5,9 +5,7 @@
"warningsAsErrors": true
},
"dependencies": {
- "Microsoft.DotNet.ProjectModel": {
- "target": "project"
- },
+ "Microsoft.Extensions.DependencyModel": "1.0.1-beta-000933",
"Microsoft.DotNet.PlatformAbstractions": "1.0.1-beta-000933",
"NuGet.Versioning": "3.6.0-rc-1984",
diff --git a/src/Microsoft.DotNet.Compiler.Common/AssemblyInfoFileGenerator.cs b/src/Microsoft.DotNet.Compiler.Common/AssemblyInfoFileGenerator.cs
deleted file mode 100644
index acf511e27..000000000
--- a/src/Microsoft.DotNet.Compiler.Common/AssemblyInfoFileGenerator.cs
+++ /dev/null
@@ -1,115 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Resources;
-using Microsoft.CodeAnalysis.CSharp;
-using System.IO;
-using System.Runtime.Versioning;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-using NuGet.Frameworks;
-
-namespace Microsoft.DotNet.Cli.Compiler.Common
-{
- public class AssemblyInfoFileGenerator
- {
- public static string GenerateCSharp(AssemblyInfoOptions metadata, IEnumerable sourceFiles)
- {
- var projectAttributes = GetProjectAttributes(metadata);
-
- var existingAttributes = new List();
- foreach (var sourceFile in sourceFiles)
- {
- var tree = CSharpSyntaxTree.ParseText(File.ReadAllText(sourceFile));
- var root = tree.GetRoot();
-
- // assembly attributes can be only on first level
- foreach (var attributeListSyntax in root.ChildNodes().OfType())
- {
- if (attributeListSyntax.Target.Identifier.Kind() == SyntaxKind.AssemblyKeyword)
- {
- foreach (var attributeSyntax in attributeListSyntax.Attributes)
- {
- var projectAttribute = projectAttributes.FirstOrDefault(attribute => IsSameAttribute(attribute.Key, attributeSyntax));
- if (projectAttribute.Key != null)
- {
- existingAttributes.Add(projectAttribute.Key);
- }
- }
- }
- }
- }
-
- string autoGeneratedHeader = "// This file has been auto generated. \r\n";
- return autoGeneratedHeader + string.Join(Environment.NewLine, projectAttributes
- .Where(projectAttribute => projectAttribute.Value != null && !existingAttributes.Contains(projectAttribute.Key))
- .Select(projectAttribute => $"[assembly:{projectAttribute.Key.FullName}(\"{projectAttribute.Value}\")]"));
- }
-
- public static string GenerateFSharp(AssemblyInfoOptions metadata)
- {
- var projectAttributes = GetProjectAttributes(metadata);
-
- return string.Join(Environment.NewLine,
- new[] { "namespace System", Environment.NewLine, Environment.NewLine }
- .Concat(projectAttributes.Select(projectAttribute => $"[]"))
- .Concat(new[] { "do ()", Environment.NewLine }));
- }
-
- private static Dictionary GetProjectAttributes(AssemblyInfoOptions metadata)
- {
- var attributes = new Dictionary()
- {
- [typeof(AssemblyTitleAttribute)] = EscapeCharacters(metadata.Title),
- [typeof(AssemblyDescriptionAttribute)] = EscapeCharacters(metadata.Description),
- [typeof(AssemblyCopyrightAttribute)] = EscapeCharacters(metadata.Copyright),
- [typeof(AssemblyFileVersionAttribute)] = EscapeCharacters(metadata.AssemblyFileVersion?.ToString()),
- [typeof(AssemblyVersionAttribute)] = EscapeCharacters(metadata.AssemblyVersion?.ToString()),
- [typeof(AssemblyInformationalVersionAttribute)] = EscapeCharacters(metadata.InformationalVersion),
- [typeof(AssemblyCultureAttribute)] = EscapeCharacters(metadata.Culture),
- [typeof(NeutralResourcesLanguageAttribute)] = EscapeCharacters(metadata.NeutralLanguage)
- };
-
- if (SupportsTargetFrameworkAttribute(metadata))
- {
- // TargetFrameworkAttribute only exists since .NET 4.0
- attributes[typeof(TargetFrameworkAttribute)] = EscapeCharacters(metadata.TargetFramework);
- };
-
- return attributes;
- }
-
- private static bool SupportsTargetFrameworkAttribute(AssemblyInfoOptions metadata)
- {
- if (string.IsNullOrEmpty(metadata.TargetFramework))
- {
- // target framework is unknown. to be on the safe side, return false.
- return false;
- }
-
- var targetFramework = NuGetFramework.Parse(metadata.TargetFramework);
- if (!targetFramework.IsDesktop())
- {
- // assuming .NET Core, which should support .NET 4.0 attributes
- return true;
- }
-
- return targetFramework.Version >= new Version(4, 0);
- }
-
- private static bool IsSameAttribute(Type attributeType, AttributeSyntax attributeSyntax)
- {
- var name = attributeSyntax.Name.ToString();
- // This check is quite stupid but we can not do more without semantic model
- return attributeType.FullName.StartsWith(name) || attributeType.Name.StartsWith(name);
- }
-
- private static string EscapeCharacters(string str)
- {
- return str != null ? SymbolDisplay.FormatLiteral(str, quote: false) : null;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Microsoft.DotNet.Compiler.Common/AssemblyInfoOptions.cs b/src/Microsoft.DotNet.Compiler.Common/AssemblyInfoOptions.cs
deleted file mode 100644
index 251d0f48f..000000000
--- a/src/Microsoft.DotNet.Compiler.Common/AssemblyInfoOptions.cs
+++ /dev/null
@@ -1,129 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using Microsoft.DotNet.ProjectModel;
-using System.Collections.Generic;
-using NuGet.Frameworks;
-
-namespace Microsoft.DotNet.Cli.Compiler.Common
-{
- public class AssemblyInfoOptions
- {
- public static readonly string TitleOptionName = "title";
-
- public static readonly string DescriptionOptionName = "description";
-
- public static readonly string CopyrightOptionName = "copyright";
-
- public static readonly string AssemblyFileVersionOptionName = "file-version";
-
- public static readonly string AssemblyVersionOptionName = "version";
-
- public static readonly string InformationalVersionOptionName = "informational-version";
-
- public static readonly string CultureOptionName = "culture";
-
- public static readonly string NeutralCultureOptionName = "neutral-language";
-
- public static readonly string TargetFrameworkOptionName = "target-framework";
-
- public string Title { get; set; }
-
- public string Description { get; set; }
-
- public string Copyright { get; set; }
-
- public string AssemblyFileVersion { get; set; }
-
- public string AssemblyVersion { get; set; }
-
- public string InformationalVersion { get; set; }
-
- public string Culture { get; set; }
-
- public string NeutralLanguage { get; set; }
-
- public string TargetFramework { get; set; }
-
- public static AssemblyInfoOptions CreateForProject(ProjectContext context)
- {
- var project = context.ProjectFile;
- NuGetFramework targetFramework = null;
- // force .NETFramework instead of DNX
- if (context.TargetFramework.IsDesktop())
- {
- targetFramework = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.Net, context.TargetFramework.Version);
- }
- else
- {
- targetFramework = context.TargetFramework;
- }
-
- return new AssemblyInfoOptions()
- {
- AssemblyVersion = project.Version?.Version.ToString(),
- AssemblyFileVersion = project.AssemblyFileVersion.ToString(),
- InformationalVersion = project.Version.ToString(),
- Copyright = project.Copyright,
- Description = project.Description,
- Title = project.Title,
- NeutralLanguage = project.Language,
- TargetFramework = targetFramework.DotNetFrameworkName
- };
- }
-
- public static IEnumerable SerializeToArgs(AssemblyInfoOptions assemblyInfoOptions)
- {
- var options = new List();
-
- if (!string.IsNullOrWhiteSpace(assemblyInfoOptions.Title))
- {
- options.Add(FormatOption(TitleOptionName, assemblyInfoOptions.Title));
- }
- if (!string.IsNullOrWhiteSpace(assemblyInfoOptions.Description))
- {
- options.Add(FormatOption(DescriptionOptionName, assemblyInfoOptions.Description));
- }
- if (!string.IsNullOrWhiteSpace(assemblyInfoOptions.Copyright))
- {
- options.Add(FormatOption(CopyrightOptionName, assemblyInfoOptions.Copyright));
- }
- if (!string.IsNullOrWhiteSpace(assemblyInfoOptions.AssemblyFileVersion))
- {
- options.Add(FormatOption(AssemblyFileVersionOptionName, assemblyInfoOptions.AssemblyFileVersion));
- }
- if (!string.IsNullOrWhiteSpace(assemblyInfoOptions.AssemblyVersion))
- {
- options.Add(FormatOption(AssemblyVersionOptionName, assemblyInfoOptions.AssemblyVersion));
- }
- if (!string.IsNullOrWhiteSpace(assemblyInfoOptions.InformationalVersion))
- {
- options.Add(FormatOption(InformationalVersionOptionName, assemblyInfoOptions.InformationalVersion));
- }
- if (!string.IsNullOrWhiteSpace(assemblyInfoOptions.Culture))
- {
- options.Add(FormatOption(CultureOptionName, assemblyInfoOptions.Culture));
- }
- if (!string.IsNullOrWhiteSpace(assemblyInfoOptions.NeutralLanguage))
- {
- options.Add(FormatOption(NeutralCultureOptionName, assemblyInfoOptions.NeutralLanguage));
- }
- if (!string.IsNullOrWhiteSpace(assemblyInfoOptions.TargetFramework))
- {
- options.Add(FormatOption(TargetFrameworkOptionName, assemblyInfoOptions.TargetFramework));
- }
-
- return options;
- }
-
- private static string FormatOption(string optionName, string value)
- {
- return $"--{optionName}:{EscapeNewlines(value)}";
- }
-
- private static string EscapeNewlines(string text)
- {
- return text.Replace("\r", "\\r").Replace("\n", "\\n");
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Compiler.Common/BindingRedirectGenerator.cs b/src/Microsoft.DotNet.Compiler.Common/BindingRedirectGenerator.cs
deleted file mode 100644
index 1227c9866..000000000
--- a/src/Microsoft.DotNet.Compiler.Common/BindingRedirectGenerator.cs
+++ /dev/null
@@ -1,304 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Reflection.Metadata;
-using System.Reflection.PortableExecutable;
-using System.Security.Cryptography;
-using System.Text;
-using System.Xml.Linq;
-using Microsoft.DotNet.ProjectModel.Compilation;
-
-namespace Microsoft.DotNet.Cli.Compiler.Common
-{
- public static class BindingRedirectGenerator
- {
- private const int TokenLength = 8;
- private const string Namespace = "urn:schemas-microsoft-com:asm.v1";
-
- private static readonly XName ConfigurationElementName = XName.Get("configuration");
- private static readonly XName RuntimeElementName = XName.Get("runtime");
- private static readonly XName AssemblyBindingElementName = XName.Get("assemblyBinding", Namespace);
- private static readonly XName DependentAssemblyElementName = XName.Get("dependentAssembly", Namespace);
- private static readonly XName AssemblyIdentityElementName = XName.Get("assemblyIdentity", Namespace);
- private static readonly XName BindingRedirectElementName = XName.Get("bindingRedirect", Namespace);
-
- private static readonly XName NameAttributeName = XName.Get("name");
- private static readonly XName PublicKeyTokenAttributeName = XName.Get("publicKeyToken");
- private static readonly XName CultureAttributeName = XName.Get("culture");
- private static readonly XName OldVersionAttributeName = XName.Get("oldVersion");
- private static readonly XName NewVersionAttributeName = XName.Get("newVersion");
-
- private static SHA1 Sha1 { get; } = SHA1.Create();
-
- public static void GenerateBindingRedirects(this IEnumerable dependencies, IEnumerable configFiles)
- {
- var redirects = CollectRedirects(dependencies);
-
- if (!redirects.Any())
- {
- // No redirects required
- return;
- }
-
- foreach (var configFile in configFiles)
- {
- GenerateBindingRedirects(configFile, redirects);
- }
- }
-
- internal static void GenerateBindingRedirects(string configFile, AssemblyRedirect[] bindingRedirects)
- {
- XDocument configRoot = File.Exists(configFile) ? XDocument.Load(configFile) : new XDocument();
- var configuration = GetOrAddElement(configRoot, ConfigurationElementName);
- var runtime = GetOrAddElement(configuration, RuntimeElementName);
- var assemblyBindings = GetOrAddElement(runtime, AssemblyBindingElementName);
-
- foreach (var redirect in bindingRedirects)
- {
- AddDependentAssembly(redirect, assemblyBindings);
- }
-
- using (var fileStream = File.Open(configFile, FileMode.OpenOrCreate, FileAccess.ReadWrite))
- {
- configRoot.Save(fileStream);
- }
- }
-
- private static void AddDependentAssembly(AssemblyRedirect redirect, XElement assemblyBindings)
- {
- var dependencyElement = assemblyBindings.Elements(DependentAssemblyElementName)
- .FirstOrDefault(element => IsSameAssembly(redirect, element));
-
- if (dependencyElement == null)
- {
- dependencyElement = new XElement(DependentAssemblyElementName,
- new XElement(AssemblyIdentityElementName,
- new XAttribute(NameAttributeName, redirect.From.Name),
- new XAttribute(PublicKeyTokenAttributeName, redirect.From.PublicKeyToken),
- new XAttribute(CultureAttributeName, redirect.From.Culture)
- )
- );
- assemblyBindings.Add(dependencyElement);
- }
-
- bool redirectExists = dependencyElement.Elements(BindingRedirectElementName).Any(element => IsSameRedirect(redirect, element));
-
- if (!redirectExists)
- {
- dependencyElement.Add(new XElement(BindingRedirectElementName,
- new XAttribute(OldVersionAttributeName, redirect.From.Version),
- new XAttribute(NewVersionAttributeName, redirect.To.Version)
- ));
- }
- }
-
- private static bool IsSameAssembly(AssemblyRedirect redirect, XElement dependentAssemblyElement)
- {
- var identity = dependentAssemblyElement.Element(AssemblyIdentityElementName);
- if (identity == null)
- {
- return false;
- }
- return (string)identity.Attribute(NameAttributeName) == redirect.From.Name &&
- (string)identity.Attribute(PublicKeyTokenAttributeName) == redirect.From.PublicKeyToken &&
- (string)identity.Attribute(CultureAttributeName) == redirect.From.Culture;
- }
-
- private static bool IsSameRedirect(AssemblyRedirect redirect, XElement bindingRedirectElement)
- {
- if (bindingRedirectElement == null)
- {
- return false;
- }
- return (string)bindingRedirectElement.Attribute(OldVersionAttributeName) == redirect.From.Version.ToString() &&
- (string)bindingRedirectElement.Attribute(NewVersionAttributeName) == redirect.To.Version.ToString();
- }
-
- private static XElement GetOrAddElement(XContainer parent, XName elementName)
- {
- XElement element;
- if (parent.Element(elementName) != null)
- {
- element = parent.Element(elementName);
- }
- else
- {
- element = new XElement(elementName);
- parent.Add(element);
- }
- return element;
- }
-
- internal static AssemblyRedirect[] CollectRedirects(IEnumerable dependencies)
- {
- var runtimeAssemblies = dependencies
- .SelectMany(d => d.RuntimeAssemblyGroups.GetDefaultAssets())
- .Select(GetAssemblyInfo);
-
- return CollectRedirects(runtimeAssemblies);
- }
-
- internal static AssemblyRedirect[] CollectRedirects(IEnumerable runtimeAssemblies)
- {
- var assemblyLookup = runtimeAssemblies.ToLookup(r => r.Identity.ToLookupKey());
-
- var redirectAssemblies = new HashSet();
- foreach (var assemblyReferenceInfo in assemblyLookup)
- {
- // Using .First here is not exactly valid, but we don't know which one gets copied to
- // output so we just use first
- var references = assemblyReferenceInfo.First().References;
- foreach (var referenceIdentity in references)
- {
- var targetAssemblies = assemblyLookup[referenceIdentity.ToLookupKey()];
- if (!targetAssemblies.Any())
- {
- continue;
- }
- var targetAssemblyIdentity = targetAssemblies.First();
- if (targetAssemblyIdentity.Identity.Version != referenceIdentity.Version)
- {
- if (targetAssemblyIdentity.Identity.PublicKeyToken != null)
- {
- redirectAssemblies.Add(new AssemblyRedirect()
- {
- From = referenceIdentity,
- To = targetAssemblyIdentity.Identity
- });
- }
- }
- }
- }
-
- return redirectAssemblies.ToArray();
- }
-
- private static AssemblyReferenceInfo GetAssemblyInfo(LibraryAsset arg)
- {
- try
- {
- using (var peReader = new PEReader(File.OpenRead(arg.ResolvedPath)))
- {
- var metadataReader = peReader.GetMetadataReader();
-
- var definition = metadataReader.GetAssemblyDefinition();
-
- var identity = new AssemblyIdentity(
- metadataReader.GetString(definition.Name),
- definition.Version,
- metadataReader.GetString(definition.Culture),
- GetPublicKeyToken(metadataReader.GetBlobBytes(definition.PublicKey))
- );
-
- var references = new List(metadataReader.AssemblyReferences.Count);
-
- foreach (var assemblyReferenceHandle in metadataReader.AssemblyReferences)
- {
- var assemblyReference = metadataReader.GetAssemblyReference(assemblyReferenceHandle);
- references.Add(new AssemblyIdentity(
- metadataReader.GetString(assemblyReference.Name),
- assemblyReference.Version,
- metadataReader.GetString(assemblyReference.Culture),
- GetPublicKeyToken(metadataReader.GetBlobBytes(assemblyReference.PublicKeyOrToken))
- ));
- }
-
- return new AssemblyReferenceInfo(identity, references.ToArray());
- }
- }
- catch (Exception e)
- {
- throw new InvalidDataException($"Could not read assembly info for {arg.ResolvedPath}", e);
- }
- }
-
- private static string GetPublicKeyToken(byte[] bytes)
- {
- if (bytes.Length == 0)
- {
- return null;
- }
-
- byte[] token;
- if (bytes.Length == TokenLength)
- {
- token = bytes;
- }
- else
- {
- token = new byte[TokenLength];
- var sha1 = Sha1.ComputeHash(bytes);
- Array.Copy(sha1, sha1.Length - TokenLength, token, 0, TokenLength);
- Array.Reverse(token);
- }
-
- var hex = new StringBuilder(TokenLength * 2);
- foreach (var b in token)
- {
- hex.AppendFormat("{0:x2}", b);
- }
- return hex.ToString();
- }
-
- internal struct AssemblyRedirect
- {
- public AssemblyRedirect(AssemblyIdentity from, AssemblyIdentity to)
- {
- From = from;
- To = to;
- }
-
- public AssemblyIdentity From { get; set; }
-
- public AssemblyIdentity To { get; set; }
- }
-
- internal struct AssemblyIdentity
- {
- public AssemblyIdentity(string name, Version version, string culture, string publicKeyToken)
- {
- Name = name;
- Version = version;
- Culture = string.IsNullOrEmpty(culture) ? "neutral" : culture;
- PublicKeyToken = publicKeyToken;
- }
-
- public string Name { get; }
-
- public Version Version { get; }
-
- public string Culture { get; }
-
- public string PublicKeyToken { get; }
-
- public Tuple ToLookupKey() => Tuple.Create(Name, Culture, PublicKeyToken);
-
- public override string ToString()
- {
- return $"{Name} {Version} {Culture} {PublicKeyToken}";
- }
- }
-
- internal struct AssemblyReferenceInfo
- {
- public AssemblyReferenceInfo(AssemblyIdentity identity, AssemblyIdentity[] references)
- {
- Identity = identity;
- References = references;
- }
-
- public AssemblyIdentity Identity { get; }
-
- public AssemblyIdentity[] References { get; }
-
- public override string ToString()
- {
- return $"{Identity} Reference count: {References.Length}";
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Microsoft.DotNet.Compiler.Common/CommonCompilerOptionsExtensions.cs b/src/Microsoft.DotNet.Compiler.Common/CommonCompilerOptionsExtensions.cs
deleted file mode 100644
index 0c47686c1..000000000
--- a/src/Microsoft.DotNet.Compiler.Common/CommonCompilerOptionsExtensions.cs
+++ /dev/null
@@ -1,157 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.Collections.Generic;
-using System.Linq;
-
-using Microsoft.DotNet.ProjectModel;
-
-namespace Microsoft.DotNet.Cli.Compiler.Common
-{
- public static class CommonCompilerOptionsExtensions
- {
- public static readonly string DefineOptionName = "define";
- public static readonly string SuppressWarningOptionName = "suppress-warning";
- public static readonly string LanguageVersionOptionName = "language-version";
- public static readonly string PlatformOptionName = "platform";
- public static readonly string AllowUnsafeOptionName = "allow-unsafe";
- public static readonly string WarningsAsErrorsOptionName = "warnings-as-errors";
- public static readonly string OptimizeOptionName = "optimize";
- public static readonly string KeyFileOptionName = "key-file";
- public static readonly string DelaySignOptionName = "delay-sign";
- public static readonly string PublicSignOptionName = "public-sign";
- public static readonly string DebugTypeOptionName = "debug-type";
- public static readonly string EmitEntryPointOptionName = "emit-entry-point";
- public static readonly string GenerateXmlDocumentationOptionName = "generate-xml-documentation";
- public static readonly string AdditionalArgumentsOptionName = "additional-argument";
- public static readonly string OutputNameOptionName = "output-name";
-
- internal static readonly OptionTemplate s_definesTemplate = new OptionTemplate(DefineOptionName);
-
- internal static readonly OptionTemplate s_suppressWarningTemplate = new OptionTemplate(SuppressWarningOptionName);
-
- internal static readonly OptionTemplate s_languageVersionTemplate = new OptionTemplate(LanguageVersionOptionName);
-
- internal static readonly OptionTemplate s_platformTemplate = new OptionTemplate(PlatformOptionName);
-
- internal static readonly OptionTemplate s_allowUnsafeTemplate = new OptionTemplate(AllowUnsafeOptionName);
-
- internal static readonly OptionTemplate s_warningsAsErrorsTemplate = new OptionTemplate(WarningsAsErrorsOptionName);
-
- internal static readonly OptionTemplate s_optimizeTemplate = new OptionTemplate(OptimizeOptionName);
-
- internal static readonly OptionTemplate s_keyFileTemplate = new OptionTemplate(KeyFileOptionName);
-
- internal static readonly OptionTemplate s_delaySignTemplate = new OptionTemplate(DelaySignOptionName);
-
- internal static readonly OptionTemplate s_publicSignTemplate = new OptionTemplate(PublicSignOptionName);
-
- internal static readonly OptionTemplate s_debugTypeTemplate = new OptionTemplate(DebugTypeOptionName);
-
- internal static readonly OptionTemplate s_emitEntryPointTemplate = new OptionTemplate(EmitEntryPointOptionName);
-
- internal static readonly OptionTemplate s_generateXmlDocumentation = new OptionTemplate(GenerateXmlDocumentationOptionName);
-
- internal static readonly OptionTemplate s_additionalArgumentsTemplate = new OptionTemplate(AdditionalArgumentsOptionName);
-
- internal static readonly OptionTemplate s_outputNameTemplate = new OptionTemplate(OutputNameOptionName);
-
- public static IEnumerable SerializeToArgs(this CommonCompilerOptions options)
- {
- var defines = options.Defines;
- var suppressWarnings = options.SuppressWarnings;
- var languageVersion = options.LanguageVersion;
- var debugType = options.DebugType;
- var platform = options.Platform;
- var allowUnsafe = options.AllowUnsafe;
- var warningsAsErrors = options.WarningsAsErrors;
- var optimize = options.Optimize;
- var keyFile = options.KeyFile;
- var delaySign = options.DelaySign;
- var publicSign = options.PublicSign;
- var emitEntryPoint = options.EmitEntryPoint;
- var generateXmlDocumentation = options.GenerateXmlDocumentation;
- var outputName = options.OutputName;
- var additionalArguments = options.AdditionalArguments;
-
- var args = new List();
-
- if (defines != null)
- {
- args.AddRange(defines.Select(def => s_definesTemplate.ToLongArg(def)));
- }
-
- if (suppressWarnings != null)
- {
- args.AddRange(suppressWarnings.Select(def => s_suppressWarningTemplate.ToLongArg(def)));
- }
-
- if (additionalArguments != null)
- {
- args.AddRange(additionalArguments.Select(arg => s_additionalArgumentsTemplate.ToLongArg(arg)));
- }
-
- if (languageVersion != null)
- {
- args.Add(s_languageVersionTemplate.ToLongArg(languageVersion));
- }
-
- if (platform != null)
- {
- args.Add(s_platformTemplate.ToLongArg(platform));
- }
-
- if (allowUnsafe != null)
- {
- args.Add(s_allowUnsafeTemplate.ToLongArg(allowUnsafe));
- }
-
- if (warningsAsErrors != null)
- {
- args.Add(s_warningsAsErrorsTemplate.ToLongArg(warningsAsErrors));
- }
-
- if (optimize != null)
- {
- args.Add(s_optimizeTemplate.ToLongArg(optimize));
- }
-
- if (keyFile != null)
- {
- args.Add(s_keyFileTemplate.ToLongArg(keyFile));
- }
-
- if (delaySign != null)
- {
- args.Add(s_delaySignTemplate.ToLongArg(delaySign));
- }
-
- if (publicSign != null)
- {
- args.Add(s_publicSignTemplate.ToLongArg(publicSign));
- }
-
- if (debugType != null)
- {
- args.Add(s_debugTypeTemplate.ToLongArg(debugType));
- }
-
- if (emitEntryPoint != null)
- {
- args.Add(s_emitEntryPointTemplate.ToLongArg(emitEntryPoint));
- }
-
- if (generateXmlDocumentation != null)
- {
- args.Add(s_generateXmlDocumentation.ToLongArg(generateXmlDocumentation));
- }
-
- if (outputName != null)
- {
- args.Add(s_outputNameTemplate.ToLongArg(outputName));
- }
-
- return args;
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Compiler.Common/DefaultCompilerWarningSuppresses.cs b/src/Microsoft.DotNet.Compiler.Common/DefaultCompilerWarningSuppresses.cs
deleted file mode 100644
index 7c430d88e..000000000
--- a/src/Microsoft.DotNet.Compiler.Common/DefaultCompilerWarningSuppresses.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.Collections.Generic;
-
-namespace Microsoft.DotNet.Cli.Compiler.Common
-{
- public class DefaultCompilerWarningSuppresses
- {
- public static IReadOnlyDictionary> Suppresses { get; } = new Dictionary>
- {
- { "csc", new string[] {"CS1701", "CS1702", "CS1705" } }
- };
- }
-}
diff --git a/src/Microsoft.DotNet.Compiler.Common/DepsFormatter.cs b/src/Microsoft.DotNet.Compiler.Common/DepsFormatter.cs
deleted file mode 100644
index 3406c9e3f..000000000
--- a/src/Microsoft.DotNet.Compiler.Common/DepsFormatter.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-
-namespace Microsoft.DotNet.Cli.Compiler.Common
-{
- internal static class DepsFormatter
- {
- internal static string EscapeRow(IEnumerable values)
- {
- return values
- .Select(EscapeValue)
- .Aggregate((a, v) => a + "," + v);
- }
-
- internal static string EscapeValue(string value)
- {
- return "\"" + value.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\"";
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Compiler.Common/Executable.cs b/src/Microsoft.DotNet.Compiler.Common/Executable.cs
deleted file mode 100644
index 591cbf25e..000000000
--- a/src/Microsoft.DotNet.Compiler.Common/Executable.cs
+++ /dev/null
@@ -1,345 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using Microsoft.DotNet.Cli.Utils;
-using Microsoft.DotNet.Files;
-using Microsoft.DotNet.ProjectModel;
-using Microsoft.DotNet.ProjectModel.Compilation;
-using Microsoft.DotNet.ProjectModel.Files;
-using Microsoft.DotNet.Tools.Common;
-using Microsoft.Extensions.DependencyModel;
-using NuGet.Frameworks;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using NuGet.LibraryModel;
-
-namespace Microsoft.DotNet.Cli.Compiler.Common
-{
- public class Executable
- {
- private readonly ProjectContext _context;
-
- private readonly LibraryExporter _exporter;
-
- private readonly string _configuration;
-
- private readonly OutputPaths _outputPaths;
-
- private readonly string _runtimeOutputPath;
-
- private readonly string _intermediateOutputPath;
-
- private readonly CommonCompilerOptions _compilerOptions;
-
- public Executable(ProjectContext context, OutputPaths outputPaths, LibraryExporter exporter, string configuration)
- : this(context, outputPaths, outputPaths.RuntimeOutputPath, outputPaths.IntermediateOutputDirectoryPath, exporter, configuration) { }
-
- public Executable(ProjectContext context, OutputPaths outputPaths, string runtimeOutputPath, string intermediateOutputDirectoryPath, LibraryExporter exporter, string configuration)
- {
- _context = context;
- _outputPaths = outputPaths;
- _runtimeOutputPath = runtimeOutputPath;
- _intermediateOutputPath = intermediateOutputDirectoryPath;
- _exporter = exporter;
- _configuration = configuration;
- _compilerOptions = _context.ProjectFile.GetCompilerOptions(_context.TargetFramework, configuration);
- }
-
- public void MakeCompilationOutputRunnable()
- {
- CopyContentFiles();
- ExportRuntimeAssets();
- }
-
- private void VerifyCoreClrPresenceInPackageGraph()
- {
- var isCoreClrPresent = _exporter
- .GetAllExports()
- .SelectMany(e => e.NativeLibraryGroups)
- .SelectMany(g => g.Assets)
- .Select(a => a.FileName)
- .Where(f => Constants.LibCoreClrBinaryNames.Contains(f))
- .Any();
-
- // coreclr should be present for standalone apps
- if (!isCoreClrPresent)
- {
- throw new InvalidOperationException("Expected coreclr library not found in package graph. Please try running dotnet restore again.");
- }
- }
-
- private void ExportRuntimeAssets()
- {
- if (_context.TargetFramework.IsDesktop())
- {
- MakeCompilationOutputRunnableForFullFramework();
- }
- else
- {
- MakeCompilationOutputRunnableForCoreCLR();
- }
- }
-
- private void MakeCompilationOutputRunnableForFullFramework()
- {
- var dependencies = _exporter.GetDependencies();
- CopyAssemblies(dependencies);
- CopyAssets(dependencies);
- GenerateBindingRedirects(_exporter);
- }
-
- private void MakeCompilationOutputRunnableForCoreCLR()
- {
- WriteDepsFileAndCopyProjectDependencies(_exporter);
-
- var isRunnable = _compilerOptions.EmitEntryPoint ?? false;
-
- if (isRunnable && !_context.IsPortable)
- {
- // TODO: Pick a host based on the RID
- VerifyCoreClrPresenceInPackageGraph();
- CoreHost.CopyTo(_runtimeOutputPath, _compilerOptions.OutputName + Constants.ExeSuffix);
- }
- }
-
- private void CopyContentFiles()
- {
- var contentFiles = new ContentFiles(_context);
-
- if (_compilerOptions.CopyToOutputInclude != null)
- {
- var includeEntries = IncludeFilesResolver.GetIncludeFiles(
- _compilerOptions.CopyToOutputInclude,
- PathUtility.EnsureTrailingSlash(_runtimeOutputPath),
- diagnostics: null);
-
- contentFiles.StructuredCopyTo(_runtimeOutputPath, includeEntries);
- }
- else
- {
- contentFiles.StructuredCopyTo(_runtimeOutputPath);
- }
- }
-
- private void CopyAssemblies(IEnumerable libraryExports)
- {
- foreach (var libraryExport in libraryExports)
- {
- libraryExport.RuntimeAssemblyGroups.GetDefaultAssets().CopyTo(_runtimeOutputPath);
- libraryExport.NativeLibraryGroups.GetDefaultAssets().CopyTo(_runtimeOutputPath);
-
- foreach (var group in libraryExport.ResourceAssemblies.GroupBy(r => r.Locale))
- {
- var localeSpecificDir = Path.Combine(_runtimeOutputPath, group.Key);
- if (!Directory.Exists(localeSpecificDir))
- {
- Directory.CreateDirectory(localeSpecificDir);
- }
- group.Select(r => r.Asset).CopyTo(localeSpecificDir);
- }
- }
- }
-
- private void CopyAssets(IEnumerable libraryExports)
- {
- foreach (var libraryExport in libraryExports)
- {
- libraryExport.RuntimeAssets.StructuredCopyTo(
- _runtimeOutputPath,
- _intermediateOutputPath);
- }
- }
-
- private void WriteDepsFileAndCopyProjectDependencies(LibraryExporter exporter)
- {
- var exports = exporter.GetAllExports().ToList();
- var exportsLookup = exports.ToDictionary(e => e.Library.Identity.Name, StringComparer.OrdinalIgnoreCase);
- var platformExclusionList = _context.GetPlatformExclusionList(exportsLookup);
- var filteredExports = exports.FilterExports(platformExclusionList);
-
- WriteConfigurationFiles(exports, filteredExports, exports, includeDevConfig: true);
-
- var projectExports = exporter.GetAllProjectTypeDependencies();
- CopyAssemblies(projectExports);
- CopyAssets(projectExports);
-
- var packageExports = exporter.GetDependencies(LibraryType.Package);
- CopyAssets(packageExports);
- }
-
- public void WriteConfigurationFiles(
- IEnumerable allExports,
- IEnumerable depsRuntimeExports,
- IEnumerable depsCompilationExports,
- bool includeDevConfig)
- {
- WriteDeps(depsRuntimeExports, depsCompilationExports);
- if (_context.ProjectFile.HasRuntimeOutput(_configuration))
- {
- WriteRuntimeConfig(allExports);
- if (includeDevConfig)
- {
- WriteDevRuntimeConfig();
- }
- }
- }
-
- private void WriteRuntimeConfig(IEnumerable allExports)
- {
- if (!_context.TargetFramework.IsDesktop())
- {
- // TODO: Suppress this file if there's nothing to write? RuntimeOutputFiles would have to be updated
- // in order to prevent breaking incremental compilation...
-
- var json = new JObject();
- var runtimeOptions = new JObject();
- json.Add("runtimeOptions", runtimeOptions);
-
- WriteFramework(runtimeOptions, allExports);
- WriteRuntimeOptions(runtimeOptions);
-
- var runtimeConfigJsonFile =
- Path.Combine(_runtimeOutputPath, _compilerOptions.OutputName + FileNameSuffixes.RuntimeConfigJson);
-
- using (var writer = new JsonTextWriter(new StreamWriter(File.Create(runtimeConfigJsonFile))))
- {
- writer.Formatting = Formatting.Indented;
- json.WriteTo(writer);
- }
- }
- }
-
- private void WriteFramework(JObject runtimeOptions, IEnumerable allExports)
- {
- var redistPackage = _context.PlatformLibrary;
- if (redistPackage != null)
- {
- var packageName = redistPackage.Identity.Name;
-
- var redistExport = allExports.FirstOrDefault(e => e.Library.Identity.Name.Equals(packageName));
- if (redistExport == null)
- {
- throw new InvalidOperationException($"Platform package '{packageName}' was not present in the graph.");
- }
- else
- {
- var framework = new JObject(
- new JProperty("name", redistExport.Library.Identity.Name),
- new JProperty("version", redistExport.Library.Identity.Version.ToNormalizedString()));
- runtimeOptions.Add("framework", framework);
- }
- }
- }
-
- private void WriteRuntimeOptions(JObject runtimeOptions)
- {
- if (string.IsNullOrEmpty(_context.ProjectFile.RawRuntimeOptions))
- {
- return;
- }
-
- var runtimeOptionsFromProjectJson = JObject.Parse(_context.ProjectFile.RawRuntimeOptions);
- foreach (var runtimeOption in runtimeOptionsFromProjectJson)
- {
- runtimeOptions.Add(runtimeOption.Key, runtimeOption.Value);
- }
- }
-
- private void WriteDevRuntimeConfig()
- {
- if (_context.TargetFramework.IsDesktop())
- {
- return;
- }
-
- var json = new JObject();
- var runtimeOptions = new JObject();
- json.Add("runtimeOptions", runtimeOptions);
-
- AddAdditionalProbingPaths(runtimeOptions);
-
- var runtimeConfigDevJsonFile =
- Path.Combine(_runtimeOutputPath, _compilerOptions.OutputName + FileNameSuffixes.RuntimeConfigDevJson);
-
- using (var writer = new JsonTextWriter(new StreamWriter(File.Create(runtimeConfigDevJsonFile))))
- {
- writer.Formatting = Formatting.Indented;
- json.WriteTo(writer);
- }
- }
-
- private void AddAdditionalProbingPaths(JObject runtimeOptions)
- {
- if (_context.LockFile != null)
- {
- var additionalProbingPaths = new JArray();
- foreach (var packageFolder in _context.LockFile.PackageFolders)
- {
- // DotNetHost doesn't handle additional probing paths with a trailing slash
- additionalProbingPaths.Add(PathUtility.EnsureNoTrailingDirectorySeparator(packageFolder.Path));
- }
-
- runtimeOptions.Add("additionalProbingPaths", additionalProbingPaths);
- }
- }
-
- private void WriteDeps(IEnumerable runtimeExports, IEnumerable compilationExports)
- {
- Directory.CreateDirectory(_runtimeOutputPath);
-
- var includeCompile = _compilerOptions.PreserveCompilationContext == true;
-
- var dependencyContext = new DependencyContextBuilder().Build(
- compilerOptions: includeCompile ? _compilerOptions : null,
- compilationExports: includeCompile ? compilationExports : null,
- runtimeExports: runtimeExports,
- portable: _context.IsPortable,
- target: _context.TargetFramework,
- runtime: _context.RuntimeIdentifier ?? string.Empty);
-
- var writer = new DependencyContextWriter();
- var depsJsonFilePath = Path.Combine(_runtimeOutputPath, _compilerOptions.OutputName + FileNameSuffixes.DepsJson);
- using (var fileStream = File.Create(depsJsonFilePath))
- {
- writer.Write(dependencyContext, fileStream);
- }
- }
-
- private void GenerateBindingRedirects(LibraryExporter exporter)
- {
- var outputName = _outputPaths.RuntimeFiles.Assembly;
- var configFile = outputName + Constants.ConfigSuffix;
-
- var existingConfig = new DirectoryInfo(_context.ProjectDirectory)
- .EnumerateFiles()
- .FirstOrDefault(f => f.Name.Equals("app.config", StringComparison.OrdinalIgnoreCase));
-
- if (existingConfig != null)
- {
- File.Copy(existingConfig.FullName, configFile, true);
- }
-
- List configFiles = new List();
- configFiles.Add(configFile);
-
- foreach (var export in exporter.GetDependencies())
- {
- var dependencyExecutables = export.RuntimeAssemblyGroups.GetDefaultAssets()
- .Where(asset => asset.FileName.ToLower().EndsWith(FileNameSuffixes.DotNet.Exe))
- .Select(asset => Path.Combine(_runtimeOutputPath, asset.FileName));
-
- foreach (var executable in dependencyExecutables)
- {
- configFile = executable + Constants.ConfigSuffix;
- configFiles.Add(configFile);
- }
- }
-
- exporter.GetAllExports().GenerateBindingRedirects(configFiles);
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Compiler.Common/LibraryExporterExtensions.cs b/src/Microsoft.DotNet.Compiler.Common/LibraryExporterExtensions.cs
deleted file mode 100644
index 7ae531785..000000000
--- a/src/Microsoft.DotNet.Compiler.Common/LibraryExporterExtensions.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using Microsoft.DotNet.ProjectModel.Compilation;
-using NuGet.LibraryModel;
-
-namespace Microsoft.DotNet.Cli.Compiler.Common
-{
- public static class LibraryExporterExtensions
- {
- public static IEnumerable GetAllProjectTypeDependencies(this LibraryExporter exporter)
- {
- return
- exporter.GetDependencies(LibraryType.Project);
- }
-
- public static void CopyTo(this IEnumerable assets, string destinationPath)
- {
- if (!Directory.Exists(destinationPath))
- {
- Directory.CreateDirectory(destinationPath);
- }
-
- foreach (var asset in assets)
- {
- var file = Path.Combine(destinationPath, Path.GetFileName(asset.ResolvedPath));
- File.Copy(asset.ResolvedPath, file, overwrite: true);
- RemoveFileAttribute(file, FileAttributes.ReadOnly);
- }
- }
-
- public static void StructuredCopyTo(this IEnumerable assets, string destinationPath, string tempLocation)
- {
- if (!Directory.Exists(destinationPath))
- {
- Directory.CreateDirectory(destinationPath);
- }
-
- foreach (var asset in assets)
- {
- var targetName = ResolveTargetName(destinationPath, asset);
- var transformedFile = asset.GetTransformedFile(tempLocation);
-
- File.Copy(transformedFile, targetName, overwrite: true);
- RemoveFileAttribute(targetName, FileAttributes.ReadOnly);
- }
- }
-
- private static void RemoveFileAttribute(String file, FileAttributes attribute)
- {
- if (File.Exists(file))
- {
- var fileAttributes = File.GetAttributes(file);
- if ((fileAttributes & attribute) == attribute)
- {
- File.SetAttributes(file, fileAttributes & ~attribute);
- }
- }
- }
-
- private static string ResolveTargetName(string destinationPath, LibraryAsset asset)
- {
- string targetName;
- if (!string.IsNullOrEmpty(asset.RelativePath))
- {
- targetName = Path.Combine(destinationPath, asset.RelativePath);
- var destinationAssetPath = Path.GetDirectoryName(targetName);
-
- if (!Directory.Exists(destinationAssetPath))
- {
- Directory.CreateDirectory(destinationAssetPath);
- }
- }
- else
- {
- targetName = Path.Combine(destinationPath, Path.GetFileName(asset.ResolvedPath));
- }
- return targetName;
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Compiler.Common/Microsoft.DotNet.Compiler.Common.xproj b/src/Microsoft.DotNet.Compiler.Common/Microsoft.DotNet.Compiler.Common.xproj
deleted file mode 100644
index e7b0225ee..000000000
--- a/src/Microsoft.DotNet.Compiler.Common/Microsoft.DotNet.Compiler.Common.xproj
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
- 14.0
- $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
-
-
-
-
- a16958e1-24c7-4f1e-b317-204ad91625dd
- Microsoft.Dotnet.Cli.Compiler.Common
- ..\..\artifacts\obj\$(MSBuildProjectName)
- ..\..\artifacts\bin
-
-
-
- 2.0
-
-
-
diff --git a/src/Microsoft.DotNet.Compiler.Common/OptionTemplate.cs b/src/Microsoft.DotNet.Compiler.Common/OptionTemplate.cs
deleted file mode 100644
index 7d31a72e0..000000000
--- a/src/Microsoft.DotNet.Compiler.Common/OptionTemplate.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-
-namespace Microsoft.DotNet.Cli.Compiler.Common
-{
- internal class OptionTemplate
- {
- public string Template { get; }
- public string ShortName { get; }
- public string LongName { get; }
-
- private static char[] s_separator = { '|' };
- public OptionTemplate(string template)
- {
- Template = template;
-
- foreach (var part in Template.Split(s_separator, 2, StringSplitOptions.RemoveEmptyEntries))
- {
- if (part.Length == 1)
- {
- ShortName = part;
- }
- else
- {
- LongName = part;
- }
- }
-
- if (string.IsNullOrEmpty(LongName) && string.IsNullOrEmpty(ShortName))
- {
- throw new ArgumentException($"Invalid template pattern '{template}'", nameof(template));
- }
- }
-
- public string ToLongArg(object value)
- {
- return $"--{LongName}:{value}";
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Compiler.Common/ProjectContextExtensions.cs b/src/Microsoft.DotNet.Compiler.Common/ProjectContextExtensions.cs
deleted file mode 100644
index d51ec02e9..000000000
--- a/src/Microsoft.DotNet.Compiler.Common/ProjectContextExtensions.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using Microsoft.DotNet.ProjectModel;
-using NuGet.Frameworks;
-
-namespace Microsoft.DotNet.Cli.Compiler.Common
-{
- public static class ProjectContextExtensions
- {
- public static string ProjectName(this ProjectContext context) => context.RootProject.Identity.Name;
-
- public static string GetDisplayName(this ProjectContext context) => $"{context.RootProject.Identity.Name} ({context.TargetFramework})";
-
- public static CommonCompilerOptions GetLanguageSpecificCompilerOptions(this ProjectContext context, NuGetFramework framework, string configurationName)
- {
- var baseOption = context.ProjectFile.GetCompilerOptions(framework, configurationName);
-
- IReadOnlyList defaultSuppresses;
- var compilerName = baseOption.CompilerName ?? "csc";
- if (DefaultCompilerWarningSuppresses.Suppresses.TryGetValue(compilerName, out defaultSuppresses))
- {
- baseOption.SuppressWarnings = (baseOption.SuppressWarnings ?? Enumerable.Empty()).Concat(defaultSuppresses).Distinct();
- }
-
- return baseOption;
- }
-
- public static string GetSDKVersionFile(this ProjectContext context, string configuration, string buildBasePath, string outputPath)
- {
- var intermediatePath = context.GetOutputPaths(configuration, buildBasePath, outputPath).IntermediateOutputDirectoryPath;
- return Path.Combine(intermediatePath, ".SDKVersion");
- }
-
- public static string IncrementalCacheFile(this ProjectContext context, string configuration, string buildBasePath, string outputPath)
- {
- var intermediatePath = context.GetOutputPaths(configuration, buildBasePath, outputPath).IntermediateOutputDirectoryPath;
- return Path.Combine(intermediatePath, ".IncrementalCache");
- }
-
- // used in incremental compilation for the key file
- public static CommonCompilerOptions ResolveCompilationOptions(this ProjectContext context, string configuration)
- {
- var compilerOptions = context.GetLanguageSpecificCompilerOptions(context.TargetFramework, configuration);
-
- // Path to strong naming key in environment variable overrides path in project.json
- var environmentKeyFile = Environment.GetEnvironmentVariable(EnvironmentNames.StrongNameKeyFile);
-
- if (!string.IsNullOrWhiteSpace(environmentKeyFile))
- {
- compilerOptions.KeyFile = environmentKeyFile;
- }
- else if (!string.IsNullOrWhiteSpace(compilerOptions.KeyFile))
- {
- // Resolve full path to key file
- compilerOptions.KeyFile =
- Path.GetFullPath(Path.Combine(context.ProjectFile.ProjectDirectory, compilerOptions.KeyFile));
- }
- return compilerOptions;
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Compiler.Common/Properties/Properties.cs b/src/Microsoft.DotNet.Compiler.Common/Properties/Properties.cs
deleted file mode 100644
index 046cd5ad1..000000000
--- a/src/Microsoft.DotNet.Compiler.Common/Properties/Properties.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-[assembly: AssemblyMetadataAttribute("Serviceable", "True")]
-[assembly: InternalsVisibleTo("dotnet-compile.UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
\ No newline at end of file
diff --git a/src/Microsoft.DotNet.Compiler.Common/project.json b/src/Microsoft.DotNet.Compiler.Common/project.json
deleted file mode 100644
index c740966e1..000000000
--- a/src/Microsoft.DotNet.Compiler.Common/project.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "version": "1.0.0-preview3-*",
- "buildOptions": {
- "keyFile": "../../tools/Key.snk"
- },
- "dependencies": {
- "Microsoft.CodeAnalysis.CSharp": "2.0.0-beta6-60922-08",
- "Microsoft.DotNet.ProjectModel": {
- "target": "project"
- },
- "Microsoft.DotNet.Cli.Utils": {
- "target": "project"
- },
- "Microsoft.DotNet.Files": {
- "target": "project"
- },
- "NuGet.ProjectModel": "3.6.0-rc-1984"
- },
- "frameworks": {
- "netstandard1.5": {
- "imports": [
- "portable-net45+wp80+win8+wpa81+dnxcore50"
- ]
- }
- },
- "scripts": {}
-}
diff --git a/src/Microsoft.DotNet.Configurer/NuGetCachePrimer.cs b/src/Microsoft.DotNet.Configurer/NuGetCachePrimer.cs
index df2d85931..fe644332b 100644
--- a/src/Microsoft.DotNet.Configurer/NuGetCachePrimer.cs
+++ b/src/Microsoft.DotNet.Configurer/NuGetCachePrimer.cs
@@ -86,7 +86,7 @@ namespace Microsoft.DotNet.Configurer
private bool RestoreTemporaryProject(string extractedPackagesArchiveDirectory, string workingDirectory)
{
return RunCommand(
- "restore3",
+ "restore",
new[] {"-s", extractedPackagesArchiveDirectory},
workingDirectory);
}
diff --git a/src/Microsoft.DotNet.Configurer/project.json b/src/Microsoft.DotNet.Configurer/project.json
index 2479637f5..7c1046a89 100644
--- a/src/Microsoft.DotNet.Configurer/project.json
+++ b/src/Microsoft.DotNet.Configurer/project.json
@@ -11,9 +11,6 @@
"Microsoft.DotNet.Cli.Utils": {
"target": "project"
},
- "Microsoft.DotNet.ProjectModel": {
- "target": "project"
- },
"Microsoft.DotNet.Archive": {
"target": "project"
}
diff --git a/src/Microsoft.DotNet.Files/ContentFiles.cs b/src/Microsoft.DotNet.Files/ContentFiles.cs
deleted file mode 100644
index b6e5ada0a..000000000
--- a/src/Microsoft.DotNet.Files/ContentFiles.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using Microsoft.DotNet.ProjectModel;
-using Microsoft.DotNet.ProjectModel.Files;
-using Microsoft.DotNet.Tools.Common;
-
-namespace Microsoft.DotNet.Files
-{
- public class ContentFiles
- {
- private readonly ProjectContext _context;
-
- public ContentFiles(ProjectContext context)
- {
- _context = context;
- }
-
- public void StructuredCopyTo(string targetDirectory)
- {
- var sourceFiles = _context
- .ProjectFile
- .Files
- .GetContentFiles();
-
- var sourceDirectory = _context.ProjectDirectory;
-
- if (sourceFiles == null)
- {
- throw new ArgumentNullException(nameof(sourceFiles));
- }
-
- sourceDirectory = EnsureTrailingSlash(sourceDirectory);
- targetDirectory = EnsureTrailingSlash(targetDirectory);
-
- var pathMap = sourceFiles
- .ToDictionary(s => s,
- s => Path.Combine(targetDirectory,
- PathUtility.GetRelativePathIgnoringDirectoryTraversals(sourceDirectory, s)));
-
- foreach (var targetDir in pathMap.Values
- .Select(Path.GetDirectoryName)
- .Distinct()
- .Where(t => !Directory.Exists(t)))
- {
- Directory.CreateDirectory(targetDir);
- }
-
- foreach (var sourceFilePath in pathMap.Keys)
- {
- File.Copy(
- sourceFilePath,
- pathMap[sourceFilePath],
- overwrite: true);
- }
-
- RemoveAttributeFromFiles(pathMap.Values, FileAttributes.ReadOnly);
- }
-
- public void StructuredCopyTo(string targetDirectory, IEnumerable includeEntries)
- {
- if (includeEntries == null)
- {
- return;
- }
-
- foreach (var targetDir in includeEntries
- .Select(f => Path.GetDirectoryName(f.TargetPath))
- .Distinct()
- .Where(t => !Directory.Exists(t)))
- {
- Directory.CreateDirectory(targetDir);
- }
-
- foreach (var file in includeEntries)
- {
- File.Copy(file.SourcePath, file.TargetPath, overwrite: true);
- }
-
- RemoveAttributeFromFiles(includeEntries.Select(f => f.TargetPath), FileAttributes.ReadOnly);
- }
-
- private static void RemoveAttributeFromFiles(IEnumerable files, FileAttributes attribute)
- {
- foreach (var file in files)
- {
- var fileAttributes = File.GetAttributes(file);
- if ((fileAttributes & attribute) == attribute)
- {
- File.SetAttributes(file, fileAttributes & ~attribute);
- }
- }
- }
-
- private static string EnsureTrailingSlash(string path)
- {
- return EnsureTrailingCharacter(path, Path.DirectorySeparatorChar);
- }
-
- private static string EnsureTrailingCharacter(string path, char trailingCharacter)
- {
- if (path == null)
- {
- throw new ArgumentNullException(nameof(path));
- }
-
- // if the path is empty, we want to return the original string instead of a single trailing character.
- if (path.Length == 0 || path[path.Length - 1] == trailingCharacter)
- {
- return path;
- }
-
- return path + trailingCharacter;
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Files/Microsoft.DotNet.Files.xproj b/src/Microsoft.DotNet.Files/Microsoft.DotNet.Files.xproj
deleted file mode 100644
index 0dca981d4..000000000
--- a/src/Microsoft.DotNet.Files/Microsoft.DotNet.Files.xproj
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
- 14.0
- $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
-
-
-
- d521dd9f-0614-4929-93b4-d8fa5682c174
- Microsoft.DotNet.Files
- ..\..\artifacts\obj\$(MSBuildProjectName)
- ..\..\artifacts\bin
-
-
- 2.0
-
-
-
\ No newline at end of file
diff --git a/src/Microsoft.DotNet.Files/Properties/AssemblyInfo.cs b/src/Microsoft.DotNet.Files/Properties/AssemblyInfo.cs
deleted file mode 100644
index bd44bced5..000000000
--- a/src/Microsoft.DotNet.Files/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-using System.Reflection;
-
-[assembly: AssemblyMetadataAttribute("Serviceable", "True")]
diff --git a/src/Microsoft.DotNet.Files/project.json b/src/Microsoft.DotNet.Files/project.json
deleted file mode 100644
index a78ab145f..000000000
--- a/src/Microsoft.DotNet.Files/project.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "version": "1.0.0-preview3-*",
- "buildOptions": {
- "keyFile": "../../tools/Key.snk"
- },
- "description": "Abstraction to interact with the file system and file paths.",
- "dependencies": {
- "Microsoft.DotNet.Cli.Utils": {
- "target": "project"
- },
- "Microsoft.DotNet.ProjectModel": {
- "target": "project"
- },
- "System.Linq.Expressions": "4.1.0"
- },
- "frameworks": {
- "netstandard1.5": {
- "imports": [
- "portable-net45+wp80+win8+wpa81+dnxcore50"
- ]
- }
- },
- "scripts": {}
-}
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/ConstantPackageNames.cs b/src/Microsoft.DotNet.ProjectJsonMigration/ConstantPackageNames.cs
index 1f2e710d2..ada280bbf 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/ConstantPackageNames.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/ConstantPackageNames.cs
@@ -3,7 +3,7 @@
namespace Microsoft.DotNet.ProjectJsonMigration
{
- public class ConstantPackageNames
+ internal class ConstantPackageNames
{
public const string CSdkPackageName = "Microsoft.NET.Sdk";
}
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/DefaultMigrationRuleSet.cs b/src/Microsoft.DotNet.ProjectJsonMigration/DefaultMigrationRuleSet.cs
index 66251c2e5..90adfc19f 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/DefaultMigrationRuleSet.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/DefaultMigrationRuleSet.cs
@@ -5,7 +5,7 @@ using Microsoft.DotNet.ProjectJsonMigration.Rules;
namespace Microsoft.DotNet.ProjectJsonMigration
{
- public class DefaultMigrationRuleSet : IMigrationRule
+ internal class DefaultMigrationRuleSet : IMigrationRule
{
private IMigrationRule[] Rules => new IMigrationRule[]
{
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/MSBuildExtensions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/MSBuildExtensions.cs
index 9d42425ae..2d0d9bbfd 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/MSBuildExtensions.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/MSBuildExtensions.cs
@@ -8,7 +8,7 @@ using System.Linq;
namespace Microsoft.DotNet.ProjectJsonMigration
{
- public static class MSBuildExtensions
+ internal static class MSBuildExtensions
{
public static IEnumerable GetEncompassedIncludes(this ProjectItemElement item,
ProjectItemElement otherItem)
diff --git a/src/Microsoft.DotNet.ProjectModel/AnalyzerOptions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/AnalyzerOptions.cs
similarity index 92%
rename from src/Microsoft.DotNet.ProjectModel/AnalyzerOptions.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/AnalyzerOptions.cs
index d27b3a85c..87cdc0eee 100644
--- a/src/Microsoft.DotNet.ProjectModel/AnalyzerOptions.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/AnalyzerOptions.cs
@@ -3,9 +3,9 @@
using System;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class AnalyzerOptions : IEquatable
+ internal class AnalyzerOptions : IEquatable
{
///
/// The identifier indicating the project language as defined by NuGet.
diff --git a/src/Microsoft.DotNet.ProjectModel/BuildWorkspace.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/BuildWorkspace.cs
similarity index 97%
rename from src/Microsoft.DotNet.ProjectModel/BuildWorkspace.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/BuildWorkspace.cs
index 232abdae7..39af35dc8 100644
--- a/src/Microsoft.DotNet.ProjectModel/BuildWorkspace.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/BuildWorkspace.cs
@@ -5,9 +5,9 @@ using System;
using System.Collections.Generic;
using System.Linq;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class BuildWorkspace : Workspace
+ internal class BuildWorkspace : Workspace
{
public BuildWorkspace(ProjectReaderSettings settings) : base(settings, false) { }
diff --git a/src/Microsoft.DotNet.ProjectModel/CommonCompilerOptions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/CommonCompilerOptions.cs
similarity index 98%
rename from src/Microsoft.DotNet.ProjectModel/CommonCompilerOptions.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/CommonCompilerOptions.cs
index 9411a2757..7bf66c2b2 100644
--- a/src/Microsoft.DotNet.ProjectModel/CommonCompilerOptions.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/CommonCompilerOptions.cs
@@ -3,11 +3,11 @@
using System.Collections.Generic;
using System.Linq;
-using Microsoft.DotNet.ProjectModel.Files;
+using Microsoft.DotNet.Internal.ProjectModel.Files;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class CommonCompilerOptions
+ internal class CommonCompilerOptions
{
public IEnumerable Defines { get; set; }
diff --git a/src/Microsoft.DotNet.ProjectModel/Compilation/AnalyzerAssembly.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/AnalyzerAssembly.cs
similarity index 92%
rename from src/Microsoft.DotNet.ProjectModel/Compilation/AnalyzerAssembly.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/AnalyzerAssembly.cs
index 2e2236ae3..6ec2b0b27 100644
--- a/src/Microsoft.DotNet.ProjectModel/Compilation/AnalyzerAssembly.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/AnalyzerAssembly.cs
@@ -3,9 +3,9 @@
using NuGet.Frameworks;
-namespace Microsoft.DotNet.ProjectModel.Compilation
+namespace Microsoft.DotNet.Internal.ProjectModel.Compilation
{
- public class AnalyzerReference
+ internal class AnalyzerReference
{
///
/// The fully-qualified path to the analyzer assembly.
diff --git a/src/Microsoft.DotNet.ProjectModel/Compilation/LibraryAsset.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryAsset.cs
similarity index 95%
rename from src/Microsoft.DotNet.ProjectModel/Compilation/LibraryAsset.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryAsset.cs
index acd983dbf..93523331b 100644
--- a/src/Microsoft.DotNet.ProjectModel/Compilation/LibraryAsset.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryAsset.cs
@@ -6,9 +6,9 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.DotNet.PlatformAbstractions;
-using Microsoft.DotNet.ProjectModel.Utilities;
+using Microsoft.DotNet.Internal.ProjectModel.Utilities;
-namespace Microsoft.DotNet.ProjectModel.Compilation
+namespace Microsoft.DotNet.Internal.ProjectModel.Compilation
{
public struct LibraryAsset
{
diff --git a/src/Microsoft.DotNet.ProjectModel/Compilation/LibraryAssetExtension.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryAssetExtension.cs
similarity index 94%
rename from src/Microsoft.DotNet.ProjectModel/Compilation/LibraryAssetExtension.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryAssetExtension.cs
index 534a114a2..c9f46e44b 100644
--- a/src/Microsoft.DotNet.ProjectModel/Compilation/LibraryAssetExtension.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryAssetExtension.cs
@@ -5,9 +5,9 @@ using System;
using System.IO;
using System.Reflection;
-namespace Microsoft.DotNet.ProjectModel.Compilation
+namespace Microsoft.DotNet.Internal.ProjectModel.Compilation
{
- public static class LibraryAssetExtensions
+ internal static class LibraryAssetExtensions
{
private const string NativeImageSufix = ".ni";
diff --git a/src/Microsoft.DotNet.ProjectModel/Compilation/LibraryAssetGroup.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryAssetGroup.cs
similarity index 91%
rename from src/Microsoft.DotNet.ProjectModel/Compilation/LibraryAssetGroup.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryAssetGroup.cs
index fd1b9809f..941fc0f48 100644
--- a/src/Microsoft.DotNet.ProjectModel/Compilation/LibraryAssetGroup.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryAssetGroup.cs
@@ -4,9 +4,9 @@
using System.Linq;
using System.Collections.Generic;
-namespace Microsoft.DotNet.ProjectModel.Compilation
+namespace Microsoft.DotNet.Internal.ProjectModel.Compilation
{
- public class LibraryAssetGroup
+ internal class LibraryAssetGroup
{
public LibraryAssetGroup(string runtime, params LibraryAsset[] assets) : this(runtime, (IEnumerable)assets) { }
public LibraryAssetGroup(params LibraryAsset[] assets) : this(string.Empty, (IEnumerable)assets) { }
diff --git a/src/Microsoft.DotNet.ProjectModel/Compilation/LibraryExport.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryExport.cs
similarity index 97%
rename from src/Microsoft.DotNet.ProjectModel/Compilation/LibraryExport.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryExport.cs
index 4e68c549b..13a0a1388 100644
--- a/src/Microsoft.DotNet.ProjectModel/Compilation/LibraryExport.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryExport.cs
@@ -4,10 +4,10 @@
using System.Collections.Generic;
using System.Diagnostics;
-namespace Microsoft.DotNet.ProjectModel.Compilation
+namespace Microsoft.DotNet.Internal.ProjectModel.Compilation
{
[DebuggerDisplay("{DebuggerDisplay,nq}")]
- public class LibraryExport
+ internal class LibraryExport
{
///
/// Gets the library that produced this export
diff --git a/src/Microsoft.DotNet.ProjectModel/Compilation/LibraryExportBuilder.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryExportBuilder.cs
similarity index 98%
rename from src/Microsoft.DotNet.ProjectModel/Compilation/LibraryExportBuilder.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryExportBuilder.cs
index 650f93d6f..54b55d7b1 100644
--- a/src/Microsoft.DotNet.ProjectModel/Compilation/LibraryExportBuilder.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryExportBuilder.cs
@@ -4,9 +4,9 @@
using System;
using System.Collections.Generic;
-namespace Microsoft.DotNet.ProjectModel.Compilation
+namespace Microsoft.DotNet.Internal.ProjectModel.Compilation
{
- public class LibraryExportBuilder
+ internal class LibraryExportBuilder
{
private IList _runtimeAssemblyGroups;
diff --git a/src/Microsoft.DotNet.ProjectModel/Compilation/LibraryExporter.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryExporter.cs
similarity index 98%
rename from src/Microsoft.DotNet.ProjectModel/Compilation/LibraryExporter.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryExporter.cs
index 8c6d00a1a..fa00c6020 100644
--- a/src/Microsoft.DotNet.ProjectModel/Compilation/LibraryExporter.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryExporter.cs
@@ -5,18 +5,18 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using Microsoft.DotNet.ProjectModel.Compilation.Preprocessor;
-using Microsoft.DotNet.ProjectModel.Files;
-using Microsoft.DotNet.ProjectModel.Resolution;
-using Microsoft.DotNet.ProjectModel.Utilities;
+using Microsoft.DotNet.Internal.ProjectModel.Compilation.Preprocessor;
+using Microsoft.DotNet.Internal.ProjectModel.Files;
+using Microsoft.DotNet.Internal.ProjectModel.Resolution;
+using Microsoft.DotNet.Internal.ProjectModel.Utilities;
using Microsoft.DotNet.Tools.Compiler;
using NuGet.Frameworks;
using NuGet.LibraryModel;
using NuGet.ProjectModel;
-namespace Microsoft.DotNet.ProjectModel.Compilation
+namespace Microsoft.DotNet.Internal.ProjectModel.Compilation
{
- public class LibraryExporter
+ internal class LibraryExporter
{
private readonly string _configuration;
private readonly string _runtime;
diff --git a/src/Microsoft.DotNet.ProjectModel/Compilation/LibraryResourceAssembly.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryResourceAssembly.cs
similarity index 80%
rename from src/Microsoft.DotNet.ProjectModel/Compilation/LibraryResourceAssembly.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryResourceAssembly.cs
index 1520352c3..79e93d615 100644
--- a/src/Microsoft.DotNet.ProjectModel/Compilation/LibraryResourceAssembly.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryResourceAssembly.cs
@@ -1,9 +1,9 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-namespace Microsoft.DotNet.ProjectModel.Compilation
+namespace Microsoft.DotNet.Internal.ProjectModel.Compilation
{
- public class LibraryResourceAssembly
+ internal class LibraryResourceAssembly
{
public LibraryResourceAssembly(LibraryAsset asset, string locale)
{
diff --git a/src/Microsoft.DotNet.ProjectModel/Compilation/Preprocessor/PPFileParameters.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/Preprocessor/PPFileParameters.cs
similarity index 83%
rename from src/Microsoft.DotNet.ProjectModel/Compilation/Preprocessor/PPFileParameters.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/Preprocessor/PPFileParameters.cs
index eca04ad66..25f9e2953 100644
--- a/src/Microsoft.DotNet.ProjectModel/Compilation/Preprocessor/PPFileParameters.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/Preprocessor/PPFileParameters.cs
@@ -6,9 +6,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
-namespace Microsoft.DotNet.ProjectModel.Compilation.Preprocessor
+namespace Microsoft.DotNet.Internal.ProjectModel.Compilation.Preprocessor
{
- public class PPFileParameters
+ internal class PPFileParameters
{
public static IDictionary CreateForProject(Project project)
{
diff --git a/src/Microsoft.DotNet.ProjectModel/Compilation/Preprocessor/PPFilePreprocessor.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/Preprocessor/PPFilePreprocessor.cs
similarity index 97%
rename from src/Microsoft.DotNet.ProjectModel/Compilation/Preprocessor/PPFilePreprocessor.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/Preprocessor/PPFilePreprocessor.cs
index c2d597c97..ebbf4d735 100644
--- a/src/Microsoft.DotNet.ProjectModel/Compilation/Preprocessor/PPFilePreprocessor.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/Preprocessor/PPFilePreprocessor.cs
@@ -7,7 +7,7 @@ using System.IO;
namespace Microsoft.DotNet.Tools.Compiler
{
- public class PPFilePreprocessor
+ internal class PPFilePreprocessor
{
public static void Preprocess(Stream input, Stream output, IDictionary parameters)
{
diff --git a/src/Microsoft.DotNet.ProjectModel/Compilation/Preprocessor/PPFileTokenizer.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/Preprocessor/PPFileTokenizer.cs
similarity index 98%
rename from src/Microsoft.DotNet.ProjectModel/Compilation/Preprocessor/PPFileTokenizer.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/Preprocessor/PPFileTokenizer.cs
index 8567aeb48..1bbfbe212 100644
--- a/src/Microsoft.DotNet.ProjectModel/Compilation/Preprocessor/PPFileTokenizer.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/Preprocessor/PPFileTokenizer.cs
@@ -6,7 +6,7 @@ using System.Text;
namespace Microsoft.DotNet.Tools.Compiler
{
- public class PPFileTokenizer
+ internal class PPFileTokenizer
{
private readonly string _text;
private int _index;
@@ -103,7 +103,7 @@ namespace Microsoft.DotNet.Tools.Compiler
return new Token(TokenCategory.Text, sb.ToString());
}
- public class Token
+ internal class Token
{
public string Value { get; private set; }
public TokenCategory Category { get; private set; }
diff --git a/src/Microsoft.DotNet.ProjectModel/CompilationOutputFiles.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/CompilationOutputFiles.cs
similarity index 94%
rename from src/Microsoft.DotNet.ProjectModel/CompilationOutputFiles.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/CompilationOutputFiles.cs
index 463451d4f..588bb3734 100644
--- a/src/Microsoft.DotNet.ProjectModel/CompilationOutputFiles.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/CompilationOutputFiles.cs
@@ -4,13 +4,13 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using Microsoft.DotNet.ProjectModel.Files;
-using Microsoft.DotNet.ProjectModel.Resources;
+using Microsoft.DotNet.Internal.ProjectModel.Files;
+using Microsoft.DotNet.Internal.ProjectModel.Resources;
using NuGet.Frameworks;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class CompilationOutputFiles
+ internal class CompilationOutputFiles
{
protected readonly Project Project;
protected readonly string Configuration;
diff --git a/src/Microsoft.DotNet.ProjectModel/Constants.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Constants.cs
similarity index 91%
rename from src/Microsoft.DotNet.ProjectModel/Constants.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Constants.cs
index 5b0100a00..3175fcbf4 100644
--- a/src/Microsoft.DotNet.ProjectModel/Constants.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Constants.cs
@@ -3,7 +3,7 @@
using System;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
internal static class Constants
{
diff --git a/src/Microsoft.DotNet.ProjectModel/DependencyContextBuilder.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DependencyContextBuilder.cs
similarity index 97%
rename from src/Microsoft.DotNet.ProjectModel/DependencyContextBuilder.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DependencyContextBuilder.cs
index d59047c3b..bf339806a 100644
--- a/src/Microsoft.DotNet.ProjectModel/DependencyContextBuilder.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DependencyContextBuilder.cs
@@ -7,16 +7,16 @@ using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
-using Microsoft.DotNet.ProjectModel;
-using Microsoft.DotNet.ProjectModel.Compilation;
-using Microsoft.DotNet.ProjectModel.Resolution;
-using Microsoft.DotNet.ProjectModel.Utilities;
+using Microsoft.DotNet.Internal.ProjectModel;
+using Microsoft.DotNet.Internal.ProjectModel.Compilation;
+using Microsoft.DotNet.Internal.ProjectModel.Resolution;
+using Microsoft.DotNet.Internal.ProjectModel.Utilities;
using NuGet.Frameworks;
using NuGet.LibraryModel;
namespace Microsoft.Extensions.DependencyModel
{
- public class DependencyContextBuilder
+ internal class DependencyContextBuilder
{
private readonly string _referenceAssembliesPath;
diff --git a/src/Microsoft.DotNet.ProjectModel/DesignTimeWorkspace.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DesignTimeWorkspace.cs
similarity index 98%
rename from src/Microsoft.DotNet.ProjectModel/DesignTimeWorkspace.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DesignTimeWorkspace.cs
index 33982fa2e..9c10b0514 100644
--- a/src/Microsoft.DotNet.ProjectModel/DesignTimeWorkspace.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DesignTimeWorkspace.cs
@@ -7,9 +7,9 @@ using System.IO;
using System.Linq;
using NuGet.LibraryModel;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class DesignTimeWorkspace : Workspace
+ internal class DesignTimeWorkspace : Workspace
{
private readonly HashSet _projects = new HashSet(StringComparer.OrdinalIgnoreCase);
diff --git a/src/Microsoft.DotNet.ProjectModel/DiagnosticMessage.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DiagnosticMessage.cs
similarity index 98%
rename from src/Microsoft.DotNet.ProjectModel/DiagnosticMessage.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DiagnosticMessage.cs
index 1a7104c20..a8c8c07b4 100644
--- a/src/Microsoft.DotNet.ProjectModel/DiagnosticMessage.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DiagnosticMessage.cs
@@ -1,12 +1,12 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
///
/// Represents a single diagnostic message, such as a compilation error or a project.json parsing error.
///
- public class DiagnosticMessage
+ internal class DiagnosticMessage
{
public DiagnosticMessage(string errorCode, string message, string filePath, DiagnosticMessageSeverity severity)
: this(errorCode, message, filePath, severity, startLine: 1, startColumn: 0)
diff --git a/src/Microsoft.DotNet.ProjectModel/DiagnosticMessageSeverity.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DiagnosticMessageSeverity.cs
similarity index 88%
rename from src/Microsoft.DotNet.ProjectModel/DiagnosticMessageSeverity.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DiagnosticMessageSeverity.cs
index 36a0c6fb8..2ead2eed5 100644
--- a/src/Microsoft.DotNet.ProjectModel/DiagnosticMessageSeverity.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DiagnosticMessageSeverity.cs
@@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
///
/// Specifies the severity of a .
diff --git a/src/Microsoft.DotNet.ProjectModel/DirectoryNames.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DirectoryNames.cs
similarity index 52%
rename from src/Microsoft.DotNet.ProjectModel/DirectoryNames.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DirectoryNames.cs
index bafbf8c0e..2b8e8b7ed 100644
--- a/src/Microsoft.DotNet.ProjectModel/DirectoryNames.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DirectoryNames.cs
@@ -1,6 +1,6 @@
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public static class DirectoryNames
+ internal static class DirectoryNames
{
public const string Bin = "bin";
diff --git a/src/Microsoft.DotNet.ProjectModel/EnvironmentNames.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/EnvironmentNames.cs
similarity index 80%
rename from src/Microsoft.DotNet.ProjectModel/EnvironmentNames.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/EnvironmentNames.cs
index 6e0f9f02f..9c528501b 100644
--- a/src/Microsoft.DotNet.ProjectModel/EnvironmentNames.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/EnvironmentNames.cs
@@ -1,9 +1,9 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class EnvironmentNames
+ internal class EnvironmentNames
{
public static readonly string PackagesStore = "NUGET_PACKAGES";
public static readonly string StrongNameKeyFile = "DOTNET_BUILD_STRONG_NAME_KEYFILE";
diff --git a/src/Microsoft.DotNet.ProjectModel/ErrorCodes.DotNet.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ErrorCodes.DotNet.cs
similarity index 91%
rename from src/Microsoft.DotNet.ProjectModel/ErrorCodes.DotNet.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ErrorCodes.DotNet.cs
index e17418174..5179d14d7 100644
--- a/src/Microsoft.DotNet.ProjectModel/ErrorCodes.DotNet.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ErrorCodes.DotNet.cs
@@ -1,9 +1,9 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public static partial class ErrorCodes
+ internal static partial class ErrorCodes
{
// Target framework not installed
public static readonly string DOTNET1011 = nameof(DOTNET1011);
diff --git a/src/Microsoft.DotNet.ProjectModel/ErrorCodes.NuGet.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ErrorCodes.NuGet.cs
similarity index 95%
rename from src/Microsoft.DotNet.ProjectModel/ErrorCodes.NuGet.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ErrorCodes.NuGet.cs
index 0c3b0ca71..da0f05837 100644
--- a/src/Microsoft.DotNet.ProjectModel/ErrorCodes.NuGet.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ErrorCodes.NuGet.cs
@@ -1,9 +1,9 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public static partial class ErrorCodes
+ internal static partial class ErrorCodes
{
// The dependency A could not be resolved.
public static readonly string NU1001 = nameof(NU1001);
diff --git a/src/Microsoft.DotNet.ProjectModel/FileFormatException.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileFormatException.cs
similarity index 98%
rename from src/Microsoft.DotNet.ProjectModel/FileFormatException.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileFormatException.cs
index 006ed1371..7dc7088db 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileFormatException.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileFormatException.cs
@@ -5,7 +5,7 @@ using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
public sealed class FileFormatException : Exception
{
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileNameSuffixes.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileNameSuffixes.cs
new file mode 100644
index 000000000..ba5fbcd7b
--- /dev/null
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileNameSuffixes.cs
@@ -0,0 +1,73 @@
+using System;
+using Microsoft.DotNet.PlatformAbstractions;
+
+namespace Microsoft.DotNet.Internal.ProjectModel
+{
+ internal static class FileNameSuffixes
+ {
+ public const string DepsJson = ".deps.json";
+ public const string RuntimeConfigJson = ".runtimeconfig.json";
+ public const string RuntimeConfigDevJson = ".runtimeconfig.dev.json";
+
+ public static PlatformFileNameSuffixes CurrentPlatform
+ {
+ get
+ {
+ switch (RuntimeEnvironment.OperatingSystemPlatform)
+ {
+ case Platform.Windows:
+ return Windows;
+ case Platform.Darwin:
+ return OSX;
+ case Platform.Linux:
+ return Linux;
+ default:
+ throw new InvalidOperationException("Unknown Platform");
+ }
+ }
+ }
+
+ public static PlatformFileNameSuffixes DotNet { get; } = new PlatformFileNameSuffixes
+ {
+ DynamicLib = ".dll",
+ Exe = ".exe",
+ ProgramDatabase = ".pdb",
+ StaticLib = ".lib"
+ };
+
+ public static PlatformFileNameSuffixes Windows { get; } = new PlatformFileNameSuffixes
+ {
+ DynamicLib = ".dll",
+ Exe = ".exe",
+ ProgramDatabase = ".pdb",
+ StaticLib = ".lib"
+ };
+
+ public static PlatformFileNameSuffixes OSX { get; } = new PlatformFileNameSuffixes
+ {
+ DynamicLib = ".dylib",
+ Exe = "",
+ ProgramDatabase = ".pdb",
+ StaticLib = ".a"
+ };
+
+ public static PlatformFileNameSuffixes Linux { get; } = new PlatformFileNameSuffixes
+ {
+ DynamicLib = ".so",
+ Exe = "",
+ ProgramDatabase = ".pdb",
+ StaticLib = ".a"
+ };
+
+ public struct PlatformFileNameSuffixes
+ {
+ public string DynamicLib { get; internal set; }
+
+ public string Exe { get; internal set; }
+
+ public string ProgramDatabase { get; internal set; }
+
+ public string StaticLib { get; internal set; }
+ }
+ }
+}
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Abstractions/DirectoryInfoBase.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/DirectoryInfoBase.cs
similarity index 74%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Abstractions/DirectoryInfoBase.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/DirectoryInfoBase.cs
index 69d5fe357..37f31803e 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Abstractions/DirectoryInfoBase.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/DirectoryInfoBase.cs
@@ -3,9 +3,9 @@
using System.Collections.Generic;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Abstractions
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions
{
- public abstract class DirectoryInfoBase : FileSystemInfoBase
+ internal abstract class DirectoryInfoBase : FileSystemInfoBase
{
public abstract IEnumerable EnumerateFileSystemInfos();
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Abstractions/DirectoryInfoWrapper.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/DirectoryInfoWrapper.cs
similarity index 95%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Abstractions/DirectoryInfoWrapper.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/DirectoryInfoWrapper.cs
index 3d3ec1236..422a3580b 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Abstractions/DirectoryInfoWrapper.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/DirectoryInfoWrapper.cs
@@ -5,9 +5,9 @@ using System;
using System.Collections.Generic;
using System.IO;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Abstractions
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions
{
- public class DirectoryInfoWrapper : DirectoryInfoBase
+ internal class DirectoryInfoWrapper : DirectoryInfoBase
{
private readonly DirectoryInfo _directoryInfo;
private readonly bool _isParentPath;
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Abstractions/FileInfoBase.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/FileInfoBase.cs
similarity index 57%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Abstractions/FileInfoBase.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/FileInfoBase.cs
index 5eee717b0..2a4dc403f 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Abstractions/FileInfoBase.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/FileInfoBase.cs
@@ -1,9 +1,9 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Abstractions
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions
{
- public abstract class FileInfoBase : FileSystemInfoBase
+ internal abstract class FileInfoBase : FileSystemInfoBase
{
}
}
\ No newline at end of file
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Abstractions/FileInfoWrapper.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/FileInfoWrapper.cs
similarity index 84%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Abstractions/FileInfoWrapper.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/FileInfoWrapper.cs
index addafc60d..2cd2abcab 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Abstractions/FileInfoWrapper.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/FileInfoWrapper.cs
@@ -3,9 +3,9 @@
using System.IO;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Abstractions
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions
{
- public class FileInfoWrapper : FileInfoBase
+ internal class FileInfoWrapper : FileInfoBase
{
private FileInfo _fileInfo;
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Abstractions/FileSystemInfoBase.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/FileSystemInfoBase.cs
similarity index 73%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Abstractions/FileSystemInfoBase.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/FileSystemInfoBase.cs
index e6826cfb2..09a88909a 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Abstractions/FileSystemInfoBase.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/FileSystemInfoBase.cs
@@ -1,9 +1,9 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Abstractions
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions
{
- public abstract class FileSystemInfoBase
+ internal abstract class FileSystemInfoBase
{
public abstract string Name { get; }
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/FilePatternMatch.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/FilePatternMatch.cs
similarity index 94%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/FilePatternMatch.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/FilePatternMatch.cs
index 498f976b0..b3bb6d075 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/FilePatternMatch.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/FilePatternMatch.cs
@@ -4,7 +4,7 @@
using System;
using Microsoft.DotNet.PlatformAbstractions;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing
{
public struct FilePatternMatch : IEquatable
{
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/ILinearPattern.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/ILinearPattern.cs
similarity index 68%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/ILinearPattern.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/ILinearPattern.cs
index a5cd7419b..9fcaa0306 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/ILinearPattern.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/ILinearPattern.cs
@@ -3,9 +3,9 @@
using System.Collections.Generic;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal
{
- public interface ILinearPattern : IPattern
+ internal interface ILinearPattern : IPattern
{
IList Segments { get; }
}
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/IPathSegment.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IPathSegment.cs
similarity index 69%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/IPathSegment.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IPathSegment.cs
index 9d15792cb..64300e4f6 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/IPathSegment.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IPathSegment.cs
@@ -1,9 +1,9 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal
{
- public interface IPathSegment
+ internal interface IPathSegment
{
bool CanProduceStem { get; }
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/IPattern.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IPattern.cs
similarity index 73%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/IPattern.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IPattern.cs
index c67d87abe..d7bc796cd 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/IPattern.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IPattern.cs
@@ -1,9 +1,9 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal
{
- public interface IPattern
+ internal interface IPattern
{
IPatternContext CreatePatternContextForInclude();
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/IPatternContext.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IPatternContext.cs
similarity index 70%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/IPatternContext.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IPatternContext.cs
index ac98cb297..5b86cb6b7 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/IPatternContext.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IPatternContext.cs
@@ -2,11 +2,11 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Abstractions;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal
{
- public interface IPatternContext
+ internal interface IPatternContext
{
void Declare(Action onDeclare);
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/IRaggedPattern.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IRaggedPattern.cs
similarity index 76%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/IRaggedPattern.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IRaggedPattern.cs
index 66915b91c..2bc081089 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/IRaggedPattern.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IRaggedPattern.cs
@@ -3,9 +3,9 @@
using System.Collections.Generic;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal
{
- public interface IRaggedPattern : IPattern
+ internal interface IRaggedPattern : IPattern
{
IList Segments { get; }
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/MatcherContext.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/MatcherContext.cs
similarity index 96%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/MatcherContext.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/MatcherContext.cs
index 22565a06a..cb6298517 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/MatcherContext.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/MatcherContext.cs
@@ -4,13 +4,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Abstractions;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal.PathSegments;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Util;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PathSegments;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Util;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal
{
- public class MatcherContext
+ internal class MatcherContext
{
private readonly DirectoryInfoBase _root;
private readonly IList _includePatternContexts;
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PathSegments/CurrentPathSegment.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/CurrentPathSegment.cs
similarity index 71%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PathSegments/CurrentPathSegment.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/CurrentPathSegment.cs
index 1b50202ca..6569c70ed 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PathSegments/CurrentPathSegment.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/CurrentPathSegment.cs
@@ -3,9 +3,9 @@
using System;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal.PathSegments
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PathSegments
{
- public class CurrentPathSegment : IPathSegment
+ internal class CurrentPathSegment : IPathSegment
{
public bool CanProduceStem { get { return false; } }
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PathSegments/LiteralPathSegment.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/LiteralPathSegment.cs
similarity index 85%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PathSegments/LiteralPathSegment.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/LiteralPathSegment.cs
index 83b4dbe81..e41a1e3a3 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PathSegments/LiteralPathSegment.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/LiteralPathSegment.cs
@@ -2,11 +2,11 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Util;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Util;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal.PathSegments
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PathSegments
{
- public class LiteralPathSegment : IPathSegment
+ internal class LiteralPathSegment : IPathSegment
{
private readonly StringComparison _comparisonType;
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PathSegments/ParentPathSegment.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/ParentPathSegment.cs
similarity index 76%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PathSegments/ParentPathSegment.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/ParentPathSegment.cs
index 02b336990..c83618abc 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PathSegments/ParentPathSegment.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/ParentPathSegment.cs
@@ -3,9 +3,9 @@
using System;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal.PathSegments
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PathSegments
{
- public class ParentPathSegment : IPathSegment
+ internal class ParentPathSegment : IPathSegment
{
private static readonly string LiteralParent = "..";
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PathSegments/RecursiveWildcardSegment.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/RecursiveWildcardSegment.cs
similarity index 70%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PathSegments/RecursiveWildcardSegment.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/RecursiveWildcardSegment.cs
index 1e9c607df..9337247fc 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PathSegments/RecursiveWildcardSegment.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/RecursiveWildcardSegment.cs
@@ -3,9 +3,9 @@
using System;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal.PathSegments
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PathSegments
{
- public class RecursiveWildcardSegment : IPathSegment
+ internal class RecursiveWildcardSegment : IPathSegment
{
public bool CanProduceStem { get { return true; } }
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PathSegments/WildcardPathSegment.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/WildcardPathSegment.cs
similarity index 94%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PathSegments/WildcardPathSegment.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/WildcardPathSegment.cs
index d0eee3b0c..66e944dfb 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PathSegments/WildcardPathSegment.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/WildcardPathSegment.cs
@@ -4,9 +4,9 @@
using System;
using System.Collections.Generic;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal.PathSegments
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PathSegments
{
- public class WildcardPathSegment : IPathSegment
+ internal class WildcardPathSegment : IPathSegment
{
// It doesn't matter which StringComparison type is used in this MatchAll segment because
// all comparing are skipped since there is no content in the segment.
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContext.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContext.cs
similarity index 79%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContext.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContext.cs
index 9cc35670e..6afc07c3d 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContext.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContext.cs
@@ -3,11 +3,11 @@
using System;
using System.Collections.Generic;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Abstractions;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal.PatternContexts
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PatternContexts
{
- public abstract class PatternContext : IPatternContext
+ internal abstract class PatternContext : IPatternContext
{
private Stack _stack = new Stack();
protected TFrame Frame;
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinear.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinear.cs
similarity index 93%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinear.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinear.cs
index c2767590d..7a22bd7c8 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinear.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinear.cs
@@ -3,11 +3,11 @@
using System;
using System.Collections.Generic;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Abstractions;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal.PatternContexts
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PatternContexts
{
- public abstract class PatternContextLinear
+ internal abstract class PatternContextLinear
: PatternContext
{
public PatternContextLinear(ILinearPattern pattern)
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinearExclude.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinearExclude.cs
similarity index 75%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinearExclude.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinearExclude.cs
index 17d0dffdb..f23f608c7 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinearExclude.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinearExclude.cs
@@ -2,11 +2,11 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Abstractions;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal.PatternContexts
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PatternContexts
{
- public class PatternContextLinearExclude : PatternContextLinear
+ internal class PatternContextLinearExclude : PatternContextLinear
{
public PatternContextLinearExclude(ILinearPattern pattern)
: base(pattern)
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinearInclude.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinearInclude.cs
similarity index 84%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinearInclude.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinearInclude.cs
index 5deb186aa..d2852b3e4 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinearInclude.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinearInclude.cs
@@ -2,11 +2,11 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Abstractions;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal.PatternContexts
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PatternContexts
{
- public class PatternContextLinearInclude : PatternContextLinear
+ internal class PatternContextLinearInclude : PatternContextLinear
{
public PatternContextLinearInclude(ILinearPattern pattern)
: base(pattern)
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRagged.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRagged.cs
similarity index 95%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRagged.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRagged.cs
index ea2dab475..7b2da0d8b 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRagged.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRagged.cs
@@ -3,11 +3,11 @@
using System;
using System.Collections.Generic;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Abstractions;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal.PatternContexts
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PatternContexts
{
- public abstract class PatternContextRagged : PatternContext
+ internal abstract class PatternContextRagged : PatternContext
{
public PatternContextRagged(IRaggedPattern pattern)
{
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRaggedExclude.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRaggedExclude.cs
similarity index 82%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRaggedExclude.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRaggedExclude.cs
index fa757828d..76ebc353f 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRaggedExclude.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRaggedExclude.cs
@@ -2,11 +2,11 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Abstractions;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal.PatternContexts
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PatternContexts
{
- public class PatternContextRaggedExclude : PatternContextRagged
+ internal class PatternContextRaggedExclude : PatternContextRagged
{
public PatternContextRaggedExclude(IRaggedPattern pattern)
: base(pattern)
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRaggedInclude.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRaggedInclude.cs
similarity index 82%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRaggedInclude.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRaggedInclude.cs
index 33bef4954..65e8e3051 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRaggedInclude.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRaggedInclude.cs
@@ -2,12 +2,12 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Abstractions;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal.PathSegments;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PathSegments;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal.PatternContexts
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PatternContexts
{
- public class PatternContextRaggedInclude : PatternContextRagged
+ internal class PatternContextRaggedInclude : PatternContextRagged
{
public PatternContextRaggedInclude(IRaggedPattern pattern)
: base(pattern)
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternTestResult.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternTestResult.cs
similarity index 90%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternTestResult.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternTestResult.cs
index 408dd29be..20146a528 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/PatternTestResult.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternTestResult.cs
@@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal
{
public struct PatternTestResult
{
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/Patterns/PatternBuilder.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/Patterns/PatternBuilder.cs
similarity index 97%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/Patterns/PatternBuilder.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/Patterns/PatternBuilder.cs
index c6995bce5..fc275fe06 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Internal/Patterns/PatternBuilder.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/Patterns/PatternBuilder.cs
@@ -3,12 +3,12 @@
using System;
using System.Collections.Generic;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal.PathSegments;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal.PatternContexts;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PathSegments;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PatternContexts;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal.Patterns
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.Patterns
{
- public class PatternBuilder
+ internal class PatternBuilder
{
private static readonly char[] _slashes = new[] { '/', '\\' };
private static readonly char[] _star = new[] { '*' };
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Matcher.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Matcher.cs
similarity index 80%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Matcher.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Matcher.cs
index 64dc98586..1b93f480a 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Matcher.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Matcher.cs
@@ -3,13 +3,13 @@
using System;
using System.Collections.Generic;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Abstractions;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Internal.Patterns;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.Patterns;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing
{
- public class Matcher
+ internal class Matcher
{
private IList _includePatterns = new List();
private IList _excludePatterns = new List();
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/MatcherExtensions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/MatcherExtensions.cs
similarity index 87%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/MatcherExtensions.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/MatcherExtensions.cs
index f44e97ead..be4cfba4c 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/MatcherExtensions.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/MatcherExtensions.cs
@@ -5,11 +5,11 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Abstractions;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing
{
- public static class MatcherExtensions
+ internal static class MatcherExtensions
{
public static void AddExcludePatterns(this Matcher matcher, params IEnumerable[] excludePatternsGroups)
{
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/PatternMatchingResult.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/PatternMatchingResult.cs
similarity index 79%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/PatternMatchingResult.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/PatternMatchingResult.cs
index 0a18b4b65..1cc933c01 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/PatternMatchingResult.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/PatternMatchingResult.cs
@@ -3,9 +3,9 @@
using System.Collections.Generic;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing
{
- public class PatternMatchingResult
+ internal class PatternMatchingResult
{
public PatternMatchingResult(IEnumerable files)
{
diff --git a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Util/StringComparisonHelper.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Util/StringComparisonHelper.cs
similarity index 94%
rename from src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Util/StringComparisonHelper.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Util/StringComparisonHelper.cs
index e7c8bfb7d..a35d6b483 100644
--- a/src/Microsoft.DotNet.ProjectModel/FileSystemGlobbing/Util/StringComparisonHelper.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Util/StringComparisonHelper.cs
@@ -3,7 +3,7 @@
using System;
-namespace Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Util
+namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Util
{
internal static class StringComparisonHelper
{
diff --git a/src/Microsoft.DotNet.ProjectModel/Files/IncludeContext.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/IncludeContext.cs
similarity index 98%
rename from src/Microsoft.DotNet.ProjectModel/Files/IncludeContext.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/IncludeContext.cs
index bef8c47c7..bc90d63b0 100644
--- a/src/Microsoft.DotNet.ProjectModel/Files/IncludeContext.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/IncludeContext.cs
@@ -7,9 +7,9 @@ using System.IO;
using System.Linq;
using Newtonsoft.Json.Linq;
-namespace Microsoft.DotNet.ProjectModel.Files
+namespace Microsoft.DotNet.Internal.ProjectModel.Files
{
- public class IncludeContext
+ internal class IncludeContext
{
private static readonly char[] PatternSeparator = new[] { ';' };
diff --git a/src/Microsoft.DotNet.ProjectModel/Files/IncludeEntry.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/IncludeEntry.cs
similarity index 91%
rename from src/Microsoft.DotNet.ProjectModel/Files/IncludeEntry.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/IncludeEntry.cs
index aeb99cdc5..18786667d 100644
--- a/src/Microsoft.DotNet.ProjectModel/Files/IncludeEntry.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/IncludeEntry.cs
@@ -4,9 +4,9 @@
using System;
using Microsoft.DotNet.PlatformAbstractions;
-namespace Microsoft.DotNet.ProjectModel.Files
+namespace Microsoft.DotNet.Internal.ProjectModel.Files
{
- public class IncludeEntry : IEquatable
+ internal class IncludeEntry : IEquatable
{
public string TargetPath { get; }
diff --git a/src/Microsoft.DotNet.ProjectModel/Files/IncludeFilesResolver.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/IncludeFilesResolver.cs
similarity index 96%
rename from src/Microsoft.DotNet.ProjectModel/Files/IncludeFilesResolver.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/IncludeFilesResolver.cs
index f1baeb70f..537eeb7d9 100644
--- a/src/Microsoft.DotNet.ProjectModel/Files/IncludeFilesResolver.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/IncludeFilesResolver.cs
@@ -5,13 +5,13 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using Microsoft.DotNet.ProjectModel.Utilities;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing.Abstractions;
+using Microsoft.DotNet.Internal.ProjectModel.Utilities;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions;
-namespace Microsoft.DotNet.ProjectModel.Files
+namespace Microsoft.DotNet.Internal.ProjectModel.Files
{
- public class IncludeFilesResolver
+ internal class IncludeFilesResolver
{
public static IEnumerable GetIncludeFiles(IncludeContext context, string targetBasePath, IList diagnostics)
{
diff --git a/src/Microsoft.DotNet.ProjectModel/Files/NamedResourceReader.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/NamedResourceReader.cs
similarity index 98%
rename from src/Microsoft.DotNet.ProjectModel/Files/NamedResourceReader.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/NamedResourceReader.cs
index 6721a9fa6..c81829b0f 100644
--- a/src/Microsoft.DotNet.ProjectModel/Files/NamedResourceReader.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/NamedResourceReader.cs
@@ -5,7 +5,7 @@ using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json.Linq;
-namespace Microsoft.DotNet.ProjectModel.Files
+namespace Microsoft.DotNet.Internal.ProjectModel.Files
{
internal static class NamedResourceReader
{
diff --git a/src/Microsoft.DotNet.ProjectModel/Files/PackIncludeEntry.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/PackIncludeEntry.cs
similarity index 93%
rename from src/Microsoft.DotNet.ProjectModel/Files/PackIncludeEntry.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/PackIncludeEntry.cs
index 615c42099..40bc57f1b 100644
--- a/src/Microsoft.DotNet.ProjectModel/Files/PackIncludeEntry.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/PackIncludeEntry.cs
@@ -5,9 +5,9 @@ using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
-namespace Microsoft.DotNet.ProjectModel.Files
+namespace Microsoft.DotNet.Internal.ProjectModel.Files
{
- public class PackIncludeEntry
+ internal class PackIncludeEntry
{
public string Target { get; }
public string[] SourceGlobs { get; }
diff --git a/src/Microsoft.DotNet.ProjectModel/Files/PatternGroup.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/PatternGroup.cs
similarity index 97%
rename from src/Microsoft.DotNet.ProjectModel/Files/PatternGroup.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/PatternGroup.cs
index 80c8e8157..6bc6e8032 100644
--- a/src/Microsoft.DotNet.ProjectModel/Files/PatternGroup.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/PatternGroup.cs
@@ -5,12 +5,12 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using Microsoft.DotNet.ProjectModel.FileSystemGlobbing;
+using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing;
using Newtonsoft.Json.Linq;
-namespace Microsoft.DotNet.ProjectModel.Files
+namespace Microsoft.DotNet.Internal.ProjectModel.Files
{
- public class PatternGroup
+ internal class PatternGroup
{
private readonly List _excludeGroups = new List();
private readonly Matcher _matcher = new Matcher();
diff --git a/src/Microsoft.DotNet.ProjectModel/Files/PatternsCollectionHelper.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/PatternsCollectionHelper.cs
similarity index 97%
rename from src/Microsoft.DotNet.ProjectModel/Files/PatternsCollectionHelper.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/PatternsCollectionHelper.cs
index e87a316fb..83864bd64 100644
--- a/src/Microsoft.DotNet.ProjectModel/Files/PatternsCollectionHelper.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/PatternsCollectionHelper.cs
@@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json.Linq;
-namespace Microsoft.DotNet.ProjectModel.Files
+namespace Microsoft.DotNet.Internal.ProjectModel.Files
{
internal static class PatternsCollectionHelper
{
diff --git a/src/Microsoft.DotNet.ProjectModel/Files/ProjectFilesCollection.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/ProjectFilesCollection.cs
similarity index 98%
rename from src/Microsoft.DotNet.ProjectModel/Files/ProjectFilesCollection.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/ProjectFilesCollection.cs
index 7cd84d78f..d86083a27 100644
--- a/src/Microsoft.DotNet.ProjectModel/Files/ProjectFilesCollection.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/ProjectFilesCollection.cs
@@ -5,9 +5,9 @@ using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json.Linq;
-namespace Microsoft.DotNet.ProjectModel.Files
+namespace Microsoft.DotNet.Internal.ProjectModel.Files
{
- public class ProjectFilesCollection
+ internal class ProjectFilesCollection
{
public static readonly string[] DefaultCompileBuiltInPatterns = new[] { @"**/*.cs" };
public static readonly string[] DefaultPreprocessPatterns = new[] { @"compiler/preprocess/**/*.cs" };
diff --git a/src/Microsoft.DotNet.ProjectModel/GlobalSettings.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/GlobalSettings.cs
similarity index 97%
rename from src/Microsoft.DotNet.ProjectModel/GlobalSettings.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/GlobalSettings.cs
index 4f144f093..0b8886a21 100644
--- a/src/Microsoft.DotNet.ProjectModel/GlobalSettings.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/GlobalSettings.cs
@@ -8,9 +8,9 @@ using System.IO;
using Newtonsoft.Json;
using System.Linq;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class GlobalSettings
+ internal class GlobalSettings
{
public const string FileName = "global.json";
diff --git a/src/Microsoft.DotNet.ProjectModel/Graph/ExportFile.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/ExportFile.cs
similarity index 87%
rename from src/Microsoft.DotNet.ProjectModel/Graph/ExportFile.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/ExportFile.cs
index 226bd0d5f..92f586592 100644
--- a/src/Microsoft.DotNet.ProjectModel/Graph/ExportFile.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/ExportFile.cs
@@ -2,9 +2,9 @@
using System.Linq;
using NuGet.ProjectModel;
-namespace Microsoft.DotNet.ProjectModel.Graph
+namespace Microsoft.DotNet.Internal.ProjectModel.Graph
{
- public class ExportFile
+ internal class ExportFile
{
public static readonly string ExportFileName = "project.fragment.lock.json";
diff --git a/src/Microsoft.DotNet.ProjectModel/Graph/LockFileExtensions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/LockFileExtensions.cs
similarity index 96%
rename from src/Microsoft.DotNet.ProjectModel/Graph/LockFileExtensions.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/LockFileExtensions.cs
index 175e66679..0a6d879f3 100644
--- a/src/Microsoft.DotNet.ProjectModel/Graph/LockFileExtensions.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/LockFileExtensions.cs
@@ -2,9 +2,9 @@ using System;
using System.Linq;
using NuGet.ProjectModel;
-namespace Microsoft.DotNet.ProjectModel.Graph
+namespace Microsoft.DotNet.Internal.ProjectModel.Graph
{
- public static class LockFileExtensions
+ internal static class LockFileExtensions
{
public static readonly int CurrentVersion = 2;
diff --git a/src/Microsoft.DotNet.ProjectModel/Graph/LockFileLookup.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/LockFileLookup.cs
similarity index 95%
rename from src/Microsoft.DotNet.ProjectModel/Graph/LockFileLookup.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/LockFileLookup.cs
index 4939f2f49..d45350fef 100644
--- a/src/Microsoft.DotNet.ProjectModel/Graph/LockFileLookup.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/LockFileLookup.cs
@@ -7,9 +7,9 @@ using NuGet.LibraryModel;
using NuGet.ProjectModel;
using NuGet.Versioning;
-namespace Microsoft.DotNet.ProjectModel.Graph
+namespace Microsoft.DotNet.Internal.ProjectModel.Graph
{
- public class LockFileLookup
+ internal class LockFileLookup
{
// REVIEW: Case sensitivity?
private readonly Dictionary, LockFileLibrary> _packages;
diff --git a/src/Microsoft.DotNet.ProjectModel/Graph/ProjectLibraryDependency.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/ProjectLibraryDependency.cs
similarity index 76%
rename from src/Microsoft.DotNet.ProjectModel/Graph/ProjectLibraryDependency.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/ProjectLibraryDependency.cs
index d67661aaa..5b2c015d5 100644
--- a/src/Microsoft.DotNet.ProjectModel/Graph/ProjectLibraryDependency.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/ProjectLibraryDependency.cs
@@ -1,8 +1,8 @@
using NuGet.LibraryModel;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class ProjectLibraryDependency : LibraryDependency
+ internal class ProjectLibraryDependency : LibraryDependency
{
public string SourceFilePath { get; set; }
public int SourceLine { get; set; }
diff --git a/src/Microsoft.DotNet.ProjectModel/IProjectReader.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/IProjectReader.cs
similarity index 76%
rename from src/Microsoft.DotNet.ProjectModel/IProjectReader.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/IProjectReader.cs
index 981ecbc36..a9e8c61a2 100644
--- a/src/Microsoft.DotNet.ProjectModel/IProjectReader.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/IProjectReader.cs
@@ -1,9 +1,9 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public interface IProjectReader
+ internal interface IProjectReader
{
Project ReadProject(string projectPath, ProjectReaderSettings settings = null);
}
diff --git a/src/Microsoft.DotNet.ProjectModel/Internal/EmptyArray.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Internal/EmptyArray.cs
similarity index 88%
rename from src/Microsoft.DotNet.ProjectModel/Internal/EmptyArray.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Internal/EmptyArray.cs
index d55b1456b..dad6516bb 100644
--- a/src/Microsoft.DotNet.ProjectModel/Internal/EmptyArray.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Internal/EmptyArray.cs
@@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
internal static class EmptyArray
{
diff --git a/src/Microsoft.DotNet.ProjectModel/LibraryDescription.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/LibraryDescription.cs
similarity index 96%
rename from src/Microsoft.DotNet.ProjectModel/LibraryDescription.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/LibraryDescription.cs
index 10152c2a0..10a34a17d 100644
--- a/src/Microsoft.DotNet.ProjectModel/LibraryDescription.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/LibraryDescription.cs
@@ -8,12 +8,12 @@ using Microsoft.DotNet.PlatformAbstractions;
using NuGet.Frameworks;
using NuGet.LibraryModel;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
///
/// Represents the result of resolving the library
///
- public class LibraryDescription
+ internal class LibraryDescription
{
public LibraryDescription(
LibraryIdentity identity,
diff --git a/src/Microsoft.DotNet.ProjectModel/MSBuildProjectDescription.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/MSBuildProjectDescription.cs
similarity index 93%
rename from src/Microsoft.DotNet.ProjectModel/MSBuildProjectDescription.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/MSBuildProjectDescription.cs
index 42b95ef72..9861892a5 100644
--- a/src/Microsoft.DotNet.ProjectModel/MSBuildProjectDescription.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/MSBuildProjectDescription.cs
@@ -5,7 +5,7 @@ using System.Collections.Generic;
using NuGet.LibraryModel;
using NuGet.ProjectModel;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
///
/// Represents an MSBuild project.
@@ -14,7 +14,7 @@ namespace Microsoft.DotNet.ProjectModel
/// Path points to the project's directory
/// MSBuildPRojectPath points to the csproj file
///
- public class MSBuildProjectDescription : TargetLibraryWithAssets
+ internal class MSBuildProjectDescription : TargetLibraryWithAssets
{
public MSBuildProjectDescription(
string path,
diff --git a/src/Microsoft.DotNet.ProjectModel/Microsoft.DotNet.ProjectModel.xproj b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Microsoft.DotNet.ProjectModel.xproj
similarity index 100%
rename from src/Microsoft.DotNet.ProjectModel/Microsoft.DotNet.ProjectModel.xproj
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Microsoft.DotNet.ProjectModel.xproj
diff --git a/src/Microsoft.DotNet.ProjectModel/OutputPaths.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/OutputPaths.cs
similarity index 95%
rename from src/Microsoft.DotNet.ProjectModel/OutputPaths.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/OutputPaths.cs
index 2628032d3..f2bdfd417 100644
--- a/src/Microsoft.DotNet.ProjectModel/OutputPaths.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/OutputPaths.cs
@@ -3,9 +3,9 @@
using System;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class OutputPaths
+ internal class OutputPaths
{
private readonly string _runtimePath;
private readonly RuntimeOutputFiles _runtimeFiles;
diff --git a/src/Microsoft.DotNet.ProjectModel/OutputPathsCalculator.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/OutputPathsCalculator.cs
similarity index 95%
rename from src/Microsoft.DotNet.ProjectModel/OutputPathsCalculator.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/OutputPathsCalculator.cs
index f2a25bb45..d3269f61e 100644
--- a/src/Microsoft.DotNet.ProjectModel/OutputPathsCalculator.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/OutputPathsCalculator.cs
@@ -2,12 +2,12 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.IO;
-using Microsoft.DotNet.ProjectModel.Utilities;
+using Microsoft.DotNet.Internal.ProjectModel.Utilities;
using NuGet.Frameworks;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class OutputPathsCalculator
+ internal class OutputPathsCalculator
{
private const string ObjDirectoryName = "obj";
private const string BinDirectoryName = "bin";
diff --git a/src/Microsoft.DotNet.ProjectModel/PackOptions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/PackOptions.cs
similarity index 84%
rename from src/Microsoft.DotNet.ProjectModel/PackOptions.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/PackOptions.cs
index ab8ee37ff..cd5677bb9 100644
--- a/src/Microsoft.DotNet.ProjectModel/PackOptions.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/PackOptions.cs
@@ -1,11 +1,11 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-using Microsoft.DotNet.ProjectModel.Files;
+using Microsoft.DotNet.Internal.ProjectModel.Files;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class PackOptions
+ internal class PackOptions
{
public string[] Tags { get; set; }
diff --git a/src/Microsoft.DotNet.ProjectModel/PackageDescription.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/PackageDescription.cs
similarity index 91%
rename from src/Microsoft.DotNet.ProjectModel/PackageDescription.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/PackageDescription.cs
index 62bd5be22..a296f0946 100644
--- a/src/Microsoft.DotNet.ProjectModel/PackageDescription.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/PackageDescription.cs
@@ -3,13 +3,13 @@
using System.Collections.Generic;
using System.Linq;
-using Microsoft.DotNet.ProjectModel.Resolution;
+using Microsoft.DotNet.Internal.ProjectModel.Resolution;
using NuGet.LibraryModel;
using NuGet.ProjectModel;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class PackageDescription : TargetLibraryWithAssets
+ internal class PackageDescription : TargetLibraryWithAssets
{
public PackageDescription(
string path,
diff --git a/src/Microsoft.DotNet.ProjectModel/Project.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Project.cs
similarity index 96%
rename from src/Microsoft.DotNet.ProjectModel/Project.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Project.cs
index 7a42b0748..f2177ad57 100644
--- a/src/Microsoft.DotNet.ProjectModel/Project.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Project.cs
@@ -4,13 +4,13 @@
using System;
using System.Collections.Generic;
using System.IO;
-using Microsoft.DotNet.ProjectModel.Files;
+using Microsoft.DotNet.Internal.ProjectModel.Files;
using NuGet.Frameworks;
using NuGet.Versioning;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class Project
+ internal class Project
{
public static readonly string FileName = "project.json";
@@ -71,8 +71,8 @@ namespace Microsoft.DotNet.ProjectModel
public RuntimeOptions RuntimeOptions { get; set; }
- public IList Runtimes { get; set; }
-
+ public IList Runtimes { get; set; }
+
public IDictionary Commands { get; } = new Dictionary(StringComparer.OrdinalIgnoreCase);
public IDictionary> Scripts { get; } = new Dictionary>(StringComparer.OrdinalIgnoreCase);
diff --git a/src/Microsoft.DotNet.ProjectModel/ProjectContext.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContext.cs
similarity index 97%
rename from src/Microsoft.DotNet.ProjectModel/ProjectContext.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContext.cs
index 897a65b6a..df8b73458 100644
--- a/src/Microsoft.DotNet.ProjectModel/ProjectContext.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContext.cs
@@ -4,14 +4,14 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using Microsoft.DotNet.ProjectModel.Compilation;
-using Microsoft.DotNet.ProjectModel.Resolution;
+using Microsoft.DotNet.Internal.ProjectModel.Compilation;
+using Microsoft.DotNet.Internal.ProjectModel.Resolution;
using NuGet.Frameworks;
using NuGet.ProjectModel;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class ProjectContext
+ internal class ProjectContext
{
private string[] _runtimeFallbacks;
diff --git a/src/Microsoft.DotNet.ProjectModel/ProjectContextBuilder.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContextBuilder.cs
similarity index 99%
rename from src/Microsoft.DotNet.ProjectModel/ProjectContextBuilder.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContextBuilder.cs
index d5e0a7517..de60159f8 100644
--- a/src/Microsoft.DotNet.ProjectModel/ProjectContextBuilder.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContextBuilder.cs
@@ -6,19 +6,19 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
-using Microsoft.DotNet.InternalAbstractions;
+using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.PlatformAbstractions;
-using Microsoft.DotNet.ProjectModel.Graph;
-using Microsoft.DotNet.ProjectModel.Resolution;
+using Microsoft.DotNet.Internal.ProjectModel.Graph;
+using Microsoft.DotNet.Internal.ProjectModel.Resolution;
using NuGet.Common;
using NuGet.Configuration;
using NuGet.Frameworks;
using NuGet.LibraryModel;
using NuGet.ProjectModel;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class ProjectContextBuilder
+ internal class ProjectContextBuilder
{
// Note: When adding a property, make sure to add it to Clone below. You'll also need to update the CloneTest in
// Microsoft.DotNet.ProjectModel.Tests.ProjectContextBuilderTests
diff --git a/src/Microsoft.DotNet.ProjectModel/ProjectContextCollection.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContextCollection.cs
similarity index 96%
rename from src/Microsoft.DotNet.ProjectModel/ProjectContextCollection.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContextCollection.cs
index ab5e78239..5b697382d 100644
--- a/src/Microsoft.DotNet.ProjectModel/ProjectContextCollection.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContextCollection.cs
@@ -7,9 +7,9 @@ using System.IO;
using System.Linq;
using NuGet.Frameworks;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class ProjectContextCollection
+ internal class ProjectContextCollection
{
public Project Project { get; set; }
diff --git a/src/Microsoft.DotNet.ProjectModel/ProjectContextIdentity.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContextIdentity.cs
similarity index 96%
rename from src/Microsoft.DotNet.ProjectModel/ProjectContextIdentity.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContextIdentity.cs
index 7fd1bd33d..4278a9aca 100644
--- a/src/Microsoft.DotNet.ProjectModel/ProjectContextIdentity.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContextIdentity.cs
@@ -4,7 +4,7 @@
using Microsoft.DotNet.PlatformAbstractions;
using NuGet.Frameworks;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
public struct ProjectContextIdentity
{
diff --git a/src/Microsoft.DotNet.ProjectModel/ProjectDescription.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectDescription.cs
similarity index 95%
rename from src/Microsoft.DotNet.ProjectModel/ProjectDescription.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectDescription.cs
index bdd161d50..0b773f0e0 100644
--- a/src/Microsoft.DotNet.ProjectModel/ProjectDescription.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectDescription.cs
@@ -5,9 +5,9 @@ using System.Collections.Generic;
using System.Linq;
using NuGet.LibraryModel;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class ProjectDescription : LibraryDescription
+ internal class ProjectDescription : LibraryDescription
{
// Create an unresolved project description
public ProjectDescription(string name, string path)
diff --git a/src/Microsoft.DotNet.ProjectModel/ProjectExtensions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectExtensions.cs
similarity index 90%
rename from src/Microsoft.DotNet.ProjectModel/ProjectExtensions.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectExtensions.cs
index b981fc9a1..b7300c994 100644
--- a/src/Microsoft.DotNet.ProjectModel/ProjectExtensions.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectExtensions.cs
@@ -6,9 +6,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public static class ProjectExtensions
+ internal static class ProjectExtensions
{
private static readonly KeyValuePair[] _compilerNameToLanguageId =
{
diff --git a/src/Microsoft.DotNet.ProjectModel/ProjectFileDependencyGroup.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectFileDependencyGroup.cs
similarity index 85%
rename from src/Microsoft.DotNet.ProjectModel/ProjectFileDependencyGroup.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectFileDependencyGroup.cs
index 6bf8d5d8a..eea721847 100644
--- a/src/Microsoft.DotNet.ProjectModel/ProjectFileDependencyGroup.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectFileDependencyGroup.cs
@@ -4,9 +4,9 @@
using System.Collections.Generic;
using NuGet.Frameworks;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class ProjectFileDependencyGroup
+ internal class ProjectFileDependencyGroup
{
public ProjectFileDependencyGroup(NuGetFramework frameworkName, IEnumerable dependencies)
{
diff --git a/src/Microsoft.DotNet.ProjectModel/ProjectModelPlatformExtensions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectModelPlatformExtensions.cs
similarity index 94%
rename from src/Microsoft.DotNet.ProjectModel/ProjectModelPlatformExtensions.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectModelPlatformExtensions.cs
index 220d9a84b..b7c826b31 100644
--- a/src/Microsoft.DotNet.ProjectModel/ProjectModelPlatformExtensions.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectModelPlatformExtensions.cs
@@ -1,11 +1,11 @@
using System.Collections.Generic;
using System.Linq;
-using Microsoft.DotNet.ProjectModel.Compilation;
+using Microsoft.DotNet.Internal.ProjectModel.Compilation;
using NuGet.LibraryModel;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public static class ProjectModelPlatformExtensions
+ internal static class ProjectModelPlatformExtensions
{
public static HashSet GetPlatformExclusionList(this ProjectContext context, IDictionary exports)
{
diff --git a/src/Microsoft.DotNet.ProjectModel/ProjectPathHelper.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectPathHelper.cs
similarity index 93%
rename from src/Microsoft.DotNet.ProjectModel/ProjectPathHelper.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectPathHelper.cs
index b80b3f2e2..290952276 100644
--- a/src/Microsoft.DotNet.ProjectModel/ProjectPathHelper.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectPathHelper.cs
@@ -4,9 +4,9 @@
using System;
using System.IO;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public static class ProjectPathHelper
+ internal static class ProjectPathHelper
{
public static string NormalizeProjectDirectoryPath(string path)
{
diff --git a/src/Microsoft.DotNet.ProjectModel/ProjectReader.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectReader.cs
similarity index 98%
rename from src/Microsoft.DotNet.ProjectModel/ProjectReader.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectReader.cs
index 88534e11b..c5b67bf17 100644
--- a/src/Microsoft.DotNet.ProjectModel/ProjectReader.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectReader.cs
@@ -5,17 +5,17 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using Microsoft.DotNet.ProjectModel.Files;
-using Microsoft.DotNet.ProjectModel.Utilities;
+using Microsoft.DotNet.Internal.ProjectModel.Files;
+using Microsoft.DotNet.Internal.ProjectModel.Utilities;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NuGet.Frameworks;
using NuGet.LibraryModel;
using NuGet.Versioning;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class ProjectReader : IProjectReader
+ internal class ProjectReader : IProjectReader
{
public static bool TryGetProject(string path, out Project project, ProjectReaderSettings settings = null)
{
@@ -158,8 +158,10 @@ namespace Microsoft.DotNet.ProjectModel
project.EmbedInteropTypes = rawProject.Value("embedInteropTypes");
project.Dependencies = new List();
+
project.Tools = new List();
- project.Runtimes = new List();
+
+ project.Runtimes = new List();
// Project files
project.Files = new ProjectFilesCollection(rawProject, project.ProjectDirectory, project.ProjectFilePath);
@@ -224,8 +226,9 @@ namespace Microsoft.DotNet.ProjectModel
rawProject,
"tools",
isGacOrFrameworkReference: false);
-
- PopulateRuntimes(project.Runtimes, rawProject);
+
+ PopulateRuntimes(project.Runtimes, rawProject);
+
JToken runtimeOptionsToken;
if (rawProject.TryGetValue("runtimeOptions", out runtimeOptionsToken))
@@ -372,20 +375,20 @@ namespace Microsoft.DotNet.ProjectModel
}
}
}
-
- private static void PopulateRuntimes(IList results, JObject settings)
- {
- var runtimes = settings.Value("runtimes") as JObject;
- if (runtimes != null)
- {
- foreach (var runtime in runtimes)
- {
- if (!string.IsNullOrEmpty(runtime.Key))
- {
- results.Add(runtime.Key);
- }
- }
- }
+
+ private static void PopulateRuntimes(IList results, JObject settings)
+ {
+ var runtimes = settings.Value("runtimes") as JObject;
+ if (runtimes != null)
+ {
+ foreach (var runtime in runtimes)
+ {
+ if (!string.IsNullOrEmpty(runtime.Key))
+ {
+ results.Add(runtime.Key);
+ }
+ }
+ }
}
private void BuildTargetFrameworksAndConfigurations(Project project, JObject projectJsonObject)
diff --git a/src/Microsoft.DotNet.ProjectModel/ProjectReaderSettings.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectReaderSettings.cs
similarity index 85%
rename from src/Microsoft.DotNet.ProjectModel/ProjectReaderSettings.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectReaderSettings.cs
index 22f643f70..101a4b390 100644
--- a/src/Microsoft.DotNet.ProjectModel/ProjectReaderSettings.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectReaderSettings.cs
@@ -1,8 +1,8 @@
using System;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class ProjectReaderSettings
+ internal class ProjectReaderSettings
{
public string VersionSuffix { get; set; }
public string AssemblyFileVersion { get; set; }
diff --git a/src/Microsoft.DotNet.ProjectModel/ProjectRootResolver.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectRootResolver.cs
similarity index 89%
rename from src/Microsoft.DotNet.ProjectModel/ProjectRootResolver.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectRootResolver.cs
index 536a4d01f..cb1796721 100644
--- a/src/Microsoft.DotNet.ProjectModel/ProjectRootResolver.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectRootResolver.cs
@@ -3,9 +3,9 @@
using System.IO;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public static class ProjectRootResolver
+ internal static class ProjectRootResolver
{
public static readonly string GlobalFileName = "global.json";
public static string ResolveRootDirectory(string projectPath)
diff --git a/src/Microsoft.DotNet.ProjectModel/Resolution/FrameworkInformation.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/FrameworkInformation.cs
similarity index 95%
rename from src/Microsoft.DotNet.ProjectModel/Resolution/FrameworkInformation.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/FrameworkInformation.cs
index 3dcd22249..4638b9674 100644
--- a/src/Microsoft.DotNet.ProjectModel/Resolution/FrameworkInformation.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/FrameworkInformation.cs
@@ -5,7 +5,7 @@ using System;
using System.Collections.Generic;
using System.IO;
-namespace Microsoft.DotNet.ProjectModel.Resolution
+namespace Microsoft.DotNet.Internal.ProjectModel.Resolution
{
internal class FrameworkInformation
{
diff --git a/src/Microsoft.DotNet.ProjectModel/Resolution/FrameworkReferenceResolver.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/FrameworkReferenceResolver.cs
similarity index 99%
rename from src/Microsoft.DotNet.ProjectModel/Resolution/FrameworkReferenceResolver.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/FrameworkReferenceResolver.cs
index 679128952..f04b95644 100644
--- a/src/Microsoft.DotNet.ProjectModel/Resolution/FrameworkReferenceResolver.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/FrameworkReferenceResolver.cs
@@ -9,13 +9,13 @@ using System.Linq;
using System.Runtime.Versioning;
using System.Xml.Linq;
using Microsoft.DotNet.PlatformAbstractions;
-using Microsoft.DotNet.ProjectModel.Utilities;
+using Microsoft.DotNet.Internal.ProjectModel.Utilities;
using Microsoft.Extensions.DependencyModel.Resolution;
using NuGet.Frameworks;
-namespace Microsoft.DotNet.ProjectModel.Resolution
+namespace Microsoft.DotNet.Internal.ProjectModel.Resolution
{
- public class FrameworkReferenceResolver
+ internal class FrameworkReferenceResolver
{
// FrameworkConstants doesn't have dnx46 yet
private static readonly NuGetFramework Dnx46 = new NuGetFramework(
diff --git a/src/Microsoft.DotNet.ProjectModel/Resolution/LibraryManager.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/LibraryManager.cs
similarity index 98%
rename from src/Microsoft.DotNet.ProjectModel/Resolution/LibraryManager.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/LibraryManager.cs
index 8044bed54..d2cb50754 100644
--- a/src/Microsoft.DotNet.ProjectModel/Resolution/LibraryManager.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/LibraryManager.cs
@@ -3,12 +3,12 @@
using System.Collections.Generic;
using System.Linq;
-using Microsoft.DotNet.ProjectModel.Utilities;
+using Microsoft.DotNet.Internal.ProjectModel.Utilities;
using NuGet.LibraryModel;
-namespace Microsoft.DotNet.ProjectModel.Resolution
+namespace Microsoft.DotNet.Internal.ProjectModel.Resolution
{
- public class LibraryManager
+ internal class LibraryManager
{
private readonly IList _libraries;
private readonly IList _diagnostics;
diff --git a/src/Microsoft.DotNet.ProjectModel/Resolution/MSBuildDependencyProvider.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/MSBuildDependencyProvider.cs
similarity index 97%
rename from src/Microsoft.DotNet.ProjectModel/Resolution/MSBuildDependencyProvider.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/MSBuildDependencyProvider.cs
index a0a58f290..cc53d5517 100644
--- a/src/Microsoft.DotNet.ProjectModel/Resolution/MSBuildDependencyProvider.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/MSBuildDependencyProvider.cs
@@ -9,9 +9,9 @@ using NuGet.Frameworks;
using NuGet.LibraryModel;
using NuGet.ProjectModel;
-namespace Microsoft.DotNet.ProjectModel.Resolution
+namespace Microsoft.DotNet.Internal.ProjectModel.Resolution
{
- public class MSBuildDependencyProvider
+ internal class MSBuildDependencyProvider
{
private readonly Project _rootProject;
private readonly Func _projectResolver;
diff --git a/src/Microsoft.DotNet.ProjectModel/Resolution/PackageDependencyProvider.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/PackageDependencyProvider.cs
similarity index 98%
rename from src/Microsoft.DotNet.ProjectModel/Resolution/PackageDependencyProvider.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/PackageDependencyProvider.cs
index d823cfedd..c1661fd49 100644
--- a/src/Microsoft.DotNet.ProjectModel/Resolution/PackageDependencyProvider.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/PackageDependencyProvider.cs
@@ -13,9 +13,9 @@ using NuGet.LibraryModel;
using NuGet.Packaging;
using NuGet.ProjectModel;
-namespace Microsoft.DotNet.ProjectModel.Resolution
+namespace Microsoft.DotNet.Internal.ProjectModel.Resolution
{
- public class PackageDependencyProvider
+ internal class PackageDependencyProvider
{
private readonly FallbackPackagePathResolver _packagePathResolver;
private readonly VersionFolderPathResolver _versionFolderPathResolver;
diff --git a/src/Microsoft.DotNet.ProjectModel/Resolution/ProjectDependencyProvider.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/ProjectDependencyProvider.cs
similarity index 97%
rename from src/Microsoft.DotNet.ProjectModel/Resolution/ProjectDependencyProvider.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/ProjectDependencyProvider.cs
index 192b03c33..eb32868d1 100644
--- a/src/Microsoft.DotNet.ProjectModel/Resolution/ProjectDependencyProvider.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/ProjectDependencyProvider.cs
@@ -9,9 +9,9 @@ using NuGet.Frameworks;
using NuGet.LibraryModel;
using NuGet.ProjectModel;
-namespace Microsoft.DotNet.ProjectModel.Resolution
+namespace Microsoft.DotNet.Internal.ProjectModel.Resolution
{
- public class ProjectDependencyProvider
+ internal class ProjectDependencyProvider
{
private Func _resolveProject;
diff --git a/src/Microsoft.DotNet.ProjectModel/Resolution/ReferenceAssemblyDependencyResolver.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/ReferenceAssemblyDependencyResolver.cs
similarity index 93%
rename from src/Microsoft.DotNet.ProjectModel/Resolution/ReferenceAssemblyDependencyResolver.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/ReferenceAssemblyDependencyResolver.cs
index 795059831..4ebb51dad 100644
--- a/src/Microsoft.DotNet.ProjectModel/Resolution/ReferenceAssemblyDependencyResolver.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/ReferenceAssemblyDependencyResolver.cs
@@ -7,9 +7,9 @@ using NuGet.Frameworks;
using NuGet.LibraryModel;
using NuGet.Versioning;
-namespace Microsoft.DotNet.ProjectModel.Resolution
+namespace Microsoft.DotNet.Internal.ProjectModel.Resolution
{
- public class ReferenceAssemblyDependencyResolver
+ internal class ReferenceAssemblyDependencyResolver
{
public ReferenceAssemblyDependencyResolver(FrameworkReferenceResolver frameworkReferenceResolver)
{
diff --git a/src/Microsoft.DotNet.ProjectModel/Resolution/UnresolvedDependencyProvider.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/UnresolvedDependencyProvider.cs
similarity index 94%
rename from src/Microsoft.DotNet.ProjectModel/Resolution/UnresolvedDependencyProvider.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/UnresolvedDependencyProvider.cs
index 599d96cd9..812c658b4 100644
--- a/src/Microsoft.DotNet.ProjectModel/Resolution/UnresolvedDependencyProvider.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/UnresolvedDependencyProvider.cs
@@ -5,9 +5,9 @@ using System.Linq;
using NuGet.Frameworks;
using NuGet.LibraryModel;
-namespace Microsoft.DotNet.ProjectModel.Resolution
+namespace Microsoft.DotNet.Internal.ProjectModel.Resolution
{
- public static class UnresolvedDependencyProvider
+ internal static class UnresolvedDependencyProvider
{
public static LibraryDescription GetDescription(ProjectLibraryDependency libraryDependency, NuGetFramework targetFramework)
{
diff --git a/src/Microsoft.DotNet.ProjectModel/ResourceFile.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ResourceFile.cs
similarity index 79%
rename from src/Microsoft.DotNet.ProjectModel/ResourceFile.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ResourceFile.cs
index 73518481b..679595df3 100644
--- a/src/Microsoft.DotNet.ProjectModel/ResourceFile.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ResourceFile.cs
@@ -3,9 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class ResourceFile
+ internal class ResourceFile
{
public string Path { get; }
public string Locale { get; }
diff --git a/src/Microsoft.DotNet.ProjectModel/Resources/CultureInfoCache.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resources/CultureInfoCache.cs
similarity index 99%
rename from src/Microsoft.DotNet.ProjectModel/Resources/CultureInfoCache.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resources/CultureInfoCache.cs
index 21882654a..b414e9028 100644
--- a/src/Microsoft.DotNet.ProjectModel/Resources/CultureInfoCache.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resources/CultureInfoCache.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
-namespace Microsoft.DotNet.ProjectModel.Resources
+namespace Microsoft.DotNet.Internal.ProjectModel.Resources
{
///
/// Contains a list of known culture names that can be used to create a .
diff --git a/src/Microsoft.DotNet.ProjectModel/Resources/ResourceUtility.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resources/ResourceUtility.cs
similarity index 94%
rename from src/Microsoft.DotNet.ProjectModel/Resources/ResourceUtility.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resources/ResourceUtility.cs
index 29a69ab5b..436007fba 100644
--- a/src/Microsoft.DotNet.ProjectModel/Resources/ResourceUtility.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resources/ResourceUtility.cs
@@ -5,11 +5,11 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using Microsoft.DotNet.ProjectModel.Utilities;
+using Microsoft.DotNet.Internal.ProjectModel.Utilities;
-namespace Microsoft.DotNet.ProjectModel.Resources
+namespace Microsoft.DotNet.Internal.ProjectModel.Resources
{
- public static class ResourceUtility
+ internal static class ResourceUtility
{
public static string GetResourceName(string projectFolder, string resourcePath)
{
diff --git a/src/Microsoft.DotNet.ProjectModel/RuntimeConfig/RuntimeConfig.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeConfig/RuntimeConfig.cs
similarity index 95%
rename from src/Microsoft.DotNet.ProjectModel/RuntimeConfig/RuntimeConfig.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeConfig/RuntimeConfig.cs
index 5a8bf2136..7c7e20102 100644
--- a/src/Microsoft.DotNet.ProjectModel/RuntimeConfig/RuntimeConfig.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeConfig/RuntimeConfig.cs
@@ -8,9 +8,9 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.IO;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class RuntimeConfig
+ internal class RuntimeConfig
{
public bool IsPortable { get; }
public RuntimeConfigFramework Framework { get; }
diff --git a/src/Microsoft.DotNet.ProjectModel/RuntimeConfig/RuntimeConfigFramework.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeConfig/RuntimeConfigFramework.cs
similarity index 92%
rename from src/Microsoft.DotNet.ProjectModel/RuntimeConfig/RuntimeConfigFramework.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeConfig/RuntimeConfigFramework.cs
index d6a0c6f63..ca1d4a396 100644
--- a/src/Microsoft.DotNet.ProjectModel/RuntimeConfig/RuntimeConfigFramework.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeConfig/RuntimeConfigFramework.cs
@@ -7,9 +7,9 @@ using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class RuntimeConfigFramework
+ internal class RuntimeConfigFramework
{
public string Name { get; set; }
public string Version { get; set; }
diff --git a/src/Microsoft.DotNet.ProjectModel/RuntimeGraphCollector.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeGraphCollector.cs
similarity index 96%
rename from src/Microsoft.DotNet.ProjectModel/RuntimeGraphCollector.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeGraphCollector.cs
index a85b3a1a7..f1b5c7dbd 100644
--- a/src/Microsoft.DotNet.ProjectModel/RuntimeGraphCollector.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeGraphCollector.cs
@@ -7,7 +7,7 @@ using System.Linq;
using NuGet.LibraryModel;
using NuGet.RuntimeModel;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
class RuntimeGraphCollector
{
diff --git a/src/Microsoft.DotNet.ProjectModel/RuntimeOptions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeOptions.cs
similarity index 77%
rename from src/Microsoft.DotNet.ProjectModel/RuntimeOptions.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeOptions.cs
index b11f6c37d..2c9fac1dd 100644
--- a/src/Microsoft.DotNet.ProjectModel/RuntimeOptions.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeOptions.cs
@@ -1,9 +1,9 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class RuntimeOptions
+ internal class RuntimeOptions
{
public bool GcServer { get; set; }
diff --git a/src/Microsoft.DotNet.ProjectModel/RuntimeOutputFiles.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeOutputFiles.cs
similarity index 96%
rename from src/Microsoft.DotNet.ProjectModel/RuntimeOutputFiles.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeOutputFiles.cs
index ea420762f..cee19bd7a 100644
--- a/src/Microsoft.DotNet.ProjectModel/RuntimeOutputFiles.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeOutputFiles.cs
@@ -5,9 +5,9 @@ using System.Collections.Generic;
using System.IO;
using NuGet.Frameworks;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class RuntimeOutputFiles : CompilationOutputFiles
+ internal class RuntimeOutputFiles : CompilationOutputFiles
{
private readonly string _runtimeIdentifier;
diff --git a/src/Microsoft.DotNet.ProjectModel/TargetFrameworkInformation.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/TargetFrameworkInformation.cs
similarity index 88%
rename from src/Microsoft.DotNet.ProjectModel/TargetFrameworkInformation.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/TargetFrameworkInformation.cs
index 5dd9d9b31..8d36ed788 100644
--- a/src/Microsoft.DotNet.ProjectModel/TargetFrameworkInformation.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/TargetFrameworkInformation.cs
@@ -4,9 +4,9 @@
using System.Collections.Generic;
using NuGet.Frameworks;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public class TargetFrameworkInformation
+ internal class TargetFrameworkInformation
{
public NuGetFramework FrameworkName { get; set; }
diff --git a/src/Microsoft.DotNet.ProjectModel/TargetLibraryWithAssets.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/TargetLibraryWithAssets.cs
similarity index 93%
rename from src/Microsoft.DotNet.ProjectModel/TargetLibraryWithAssets.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/TargetLibraryWithAssets.cs
index 97fa24e3b..50b7049f8 100644
--- a/src/Microsoft.DotNet.ProjectModel/TargetLibraryWithAssets.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/TargetLibraryWithAssets.cs
@@ -6,9 +6,9 @@ using NuGet.Frameworks;
using NuGet.LibraryModel;
using NuGet.ProjectModel;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
- public abstract class TargetLibraryWithAssets : LibraryDescription
+ internal abstract class TargetLibraryWithAssets : LibraryDescription
{
public TargetLibraryWithAssets(
LibraryIdentity libraryIdentity,
diff --git a/src/Microsoft.DotNet.ProjectModel/Utilities/CollectionExtensions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/CollectionExtensions.cs
similarity index 93%
rename from src/Microsoft.DotNet.ProjectModel/Utilities/CollectionExtensions.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/CollectionExtensions.cs
index 6bb65ef5f..1344ab101 100644
--- a/src/Microsoft.DotNet.ProjectModel/Utilities/CollectionExtensions.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/CollectionExtensions.cs
@@ -1,9 +1,9 @@
-using Microsoft.DotNet.ProjectModel.Compilation;
+using Microsoft.DotNet.Internal.ProjectModel.Compilation;
using System.Linq;
namespace System.Collections.Generic
{
- public static class CollectionExtensions
+ internal static class CollectionExtensions
{
public static LibraryAssetGroup GetDefaultGroup(this IEnumerable self) => GetGroup(self, string.Empty);
public static LibraryAssetGroup GetRuntimeGroup(this IEnumerable self, string runtime)
diff --git a/src/Microsoft.DotNet.ProjectModel/Utilities/DictionaryExtensions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/DictionaryExtensions.cs
similarity index 90%
rename from src/Microsoft.DotNet.ProjectModel/Utilities/DictionaryExtensions.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/DictionaryExtensions.cs
index 65cd560e6..5c08da37b 100644
--- a/src/Microsoft.DotNet.ProjectModel/Utilities/DictionaryExtensions.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/DictionaryExtensions.cs
@@ -5,9 +5,9 @@ using System;
using System.Collections.Generic;
using System.Linq;
-namespace Microsoft.DotNet.ProjectModel.Utilities
+namespace Microsoft.DotNet.Internal.ProjectModel.Utilities
{
- public static class DictionaryExtensions
+ internal static class DictionaryExtensions
{
public static IEnumerable GetOrEmpty(this IDictionary> self, K key)
{
diff --git a/src/Microsoft.DotNet.ProjectModel/Utilities/FrameworksExtensions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/FrameworksExtensions.cs
similarity index 97%
rename from src/Microsoft.DotNet.ProjectModel/Utilities/FrameworksExtensions.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/FrameworksExtensions.cs
index 93b2cf921..903d9697f 100644
--- a/src/Microsoft.DotNet.ProjectModel/Utilities/FrameworksExtensions.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/FrameworksExtensions.cs
@@ -6,7 +6,7 @@ using System.Runtime.Versioning;
namespace NuGet.Frameworks
{
- public static class FrameworksExtensions
+ internal static class FrameworksExtensions
{
// HACK(anurse): NuGet.Frameworks turns "dnxcore50" into "dnxcore5" :(
public static string GetTwoDigitShortFolderName(this NuGetFramework self)
diff --git a/src/Microsoft.DotNet.ProjectModel/Utilities/PathUtility.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/PathUtility.cs
similarity index 99%
rename from src/Microsoft.DotNet.ProjectModel/Utilities/PathUtility.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/PathUtility.cs
index 0f0bfc653..453b00847 100644
--- a/src/Microsoft.DotNet.ProjectModel/Utilities/PathUtility.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/PathUtility.cs
@@ -5,7 +5,7 @@ using System;
using System.IO;
using Microsoft.DotNet.PlatformAbstractions;
-namespace Microsoft.DotNet.ProjectModel.Utilities
+namespace Microsoft.DotNet.Internal.ProjectModel.Utilities
{
internal static class PathUtility
{
diff --git a/src/Microsoft.DotNet.ProjectModel/Utilities/ResilientFileStreamOpener.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/ResilientFileStreamOpener.cs
similarity index 91%
rename from src/Microsoft.DotNet.ProjectModel/Utilities/ResilientFileStreamOpener.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/ResilientFileStreamOpener.cs
index dc824c1b2..e2f4e29d0 100644
--- a/src/Microsoft.DotNet.ProjectModel/Utilities/ResilientFileStreamOpener.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/ResilientFileStreamOpener.cs
@@ -5,9 +5,9 @@ using System;
using System.IO;
using System.Threading;
-namespace Microsoft.DotNet.ProjectModel.Utilities
+namespace Microsoft.DotNet.Internal.ProjectModel.Utilities
{
- public class ResilientFileStreamOpener
+ internal class ResilientFileStreamOpener
{
public static FileStream OpenFile(string filepath)
{
diff --git a/src/Microsoft.DotNet.ProjectModel/Utilities/VersionUtility.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/VersionUtility.cs
similarity index 97%
rename from src/Microsoft.DotNet.ProjectModel/Utilities/VersionUtility.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/VersionUtility.cs
index 69072d3b3..90a721e38 100644
--- a/src/Microsoft.DotNet.ProjectModel/Utilities/VersionUtility.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/VersionUtility.cs
@@ -11,9 +11,9 @@ using System.Reflection;
using System.Text;
using NuGet.Versioning;
-namespace Microsoft.DotNet.ProjectModel.Utilities
+namespace Microsoft.DotNet.Internal.ProjectModel.Utilities
{
- public static class VersionUtility
+ internal static class VersionUtility
{
public static readonly string DnxCoreFrameworkIdentifier = "DNXCore";
public static readonly string DnxFrameworkIdentifier = "DNX";
diff --git a/src/Microsoft.DotNet.ProjectModel/Workspace.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Workspace.cs
similarity index 98%
rename from src/Microsoft.DotNet.ProjectModel/Workspace.cs
rename to src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Workspace.cs
index 8ec8880aa..0a865a049 100644
--- a/src/Microsoft.DotNet.ProjectModel/Workspace.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Workspace.cs
@@ -6,16 +6,16 @@ using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using Microsoft.DotNet.ProjectModel.Utilities;
+using Microsoft.DotNet.Internal.ProjectModel.Utilities;
using NuGet.Frameworks;
using NuGet.ProjectModel;
-namespace Microsoft.DotNet.ProjectModel
+namespace Microsoft.DotNet.Internal.ProjectModel
{
///
/// Represents a cache of Projects, LockFiles, and ProjectContexts
///
- public abstract class Workspace
+ internal abstract class Workspace
{
// key: project directory
private readonly ConcurrentDictionary> _projectsCache
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationError.cs b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationError.cs
index c7d819415..868292fc7 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationError.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationError.cs
@@ -3,7 +3,7 @@
namespace Microsoft.DotNet.ProjectJsonMigration
{
- public class MigrationError
+ internal class MigrationError
{
public string ErrorCode { get; }
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationErrorCodes.cs b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationErrorCodes.cs
index 23b6483d0..336bd42c0 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationErrorCodes.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationErrorCodes.cs
@@ -5,7 +5,7 @@ using System;
namespace Microsoft.DotNet.ProjectJsonMigration
{
- public static partial class MigrationErrorCodes
+ internal static partial class MigrationErrorCodes
{
public static Func MIGRATE1011
=> (message) => new MigrationError(nameof(MIGRATE1011), "Deprecated Project", message);
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationException.cs b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationException.cs
index ecef3c3ac..08047e66e 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationException.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationException.cs
@@ -5,7 +5,7 @@ using System;
namespace Microsoft.DotNet.ProjectJsonMigration
{
- public class MigrationException : Exception
+ internal class MigrationException : Exception
{
public MigrationError Error { get; }
public MigrationException(MigrationError error, string message) : base(message)
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationNuGetFrameworkExtensions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationNuGetFrameworkExtensions.cs
index 76d063f38..1bdf4364d 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationNuGetFrameworkExtensions.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationNuGetFrameworkExtensions.cs
@@ -5,7 +5,7 @@ using NuGet.Frameworks;
namespace Microsoft.DotNet.ProjectJsonMigration
{
- public static class MigrationNuGetFrameworkExtensions
+ internal static class MigrationNuGetFrameworkExtensions
{
public static string GetMSBuildCondition(this NuGetFramework framework)
{
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationRuleInputs.cs b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationRuleInputs.cs
index a0a1deebc..f08c06c88 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationRuleInputs.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationRuleInputs.cs
@@ -3,12 +3,12 @@
using System.Collections.Generic;
using Microsoft.Build.Construction;
-using Microsoft.DotNet.ProjectModel;
+using Microsoft.DotNet.Internal.ProjectModel;
using System.Linq;
namespace Microsoft.DotNet.ProjectJsonMigration
{
- public class MigrationRuleInputs
+ internal class MigrationRuleInputs
{
public ProjectRootElement ProjectXproj { get; }
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationSettings.cs b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationSettings.cs
index 594fa53c4..ec18c4709 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationSettings.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationSettings.cs
@@ -5,7 +5,7 @@ using Microsoft.Build.Construction;
namespace Microsoft.DotNet.ProjectJsonMigration
{
- public class MigrationSettings
+ internal class MigrationSettings
{
public string ProjectXProjFilePath { get; }
public string ProjectDirectory { get; }
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationTrace.cs b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationTrace.cs
index 298f05b60..60d31e4d8 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationTrace.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationTrace.cs
@@ -5,7 +5,7 @@ using System;
namespace Microsoft.DotNet.ProjectJsonMigration
{
- public class MigrationTrace
+ internal class MigrationTrace
{
public static MigrationTrace Instance { get; set; }
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Models/DefaultProjectItemInfo.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Models/DefaultProjectItemInfo.cs
index 5f1f31977..5cbd37153 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Models/DefaultProjectItemInfo.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Models/DefaultProjectItemInfo.cs
@@ -5,7 +5,7 @@ using System.Collections.Generic;
namespace Microsoft.DotNet.ProjectJsonMigration.Models
{
- public class DefaultProjectItemInfo
+ internal class DefaultProjectItemInfo
{
public string ItemType {get; set;}
public string Include {get; set;}
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Models/DefaultProjectPropertyInfo.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Models/DefaultProjectPropertyInfo.cs
index d228e0179..cb4097e79 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Models/DefaultProjectPropertyInfo.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Models/DefaultProjectPropertyInfo.cs
@@ -5,7 +5,7 @@ using System.Collections.Generic;
namespace Microsoft.DotNet.ProjectJsonMigration.Models
{
- public class DefaultProjectPropertyInfo
+ internal class DefaultProjectPropertyInfo
{
public string Name {get; set;}
public string Value {get; set;}
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Models/ItemMetadataValue.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Models/ItemMetadataValue.cs
index 7b67db2c8..1fd6f77bb 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Models/ItemMetadataValue.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Models/ItemMetadataValue.cs
@@ -5,7 +5,7 @@ using System;
namespace Microsoft.DotNet.ProjectJsonMigration.Models
{
- public class ItemMetadataValue
+ internal class ItemMetadataValue
{
public string MetadataName { get; }
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Models/SerializableMigrationDefaultsInfo.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Models/SerializableMigrationDefaultsInfo.cs
index 34a500864..25dc7b08d 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Models/SerializableMigrationDefaultsInfo.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Models/SerializableMigrationDefaultsInfo.cs
@@ -5,7 +5,7 @@ using System.Collections.Generic;
namespace Microsoft.DotNet.ProjectJsonMigration.Models
{
- public class SerializableMigrationDefaultsInfo
+ internal class SerializableMigrationDefaultsInfo
{
public IEnumerable Items { get; set; }
public IEnumerable Properties { get; set; }
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectContextExtensions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/ProjectContextExtensions.cs
index aa7d345ae..c0bb37bd5 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectContextExtensions.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/ProjectContextExtensions.cs
@@ -5,12 +5,12 @@ using System;
using System.Collections.Generic;
using Microsoft.Build.Construction;
using System.Linq;
-using Microsoft.DotNet.ProjectModel;
+using Microsoft.DotNet.Internal.ProjectModel;
using System.IO;
namespace Microsoft.DotNet.ProjectJsonMigration
{
- public static class ProjectContextExtensions
+ internal static class ProjectContextExtensions
{
public static string GetProjectName(this ProjectContext projectContext)
{
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependency.cs b/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependency.cs
index 03c780d43..2315deabb 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependency.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependency.cs
@@ -3,7 +3,7 @@
namespace Microsoft.DotNet.ProjectJsonMigration
{
- public class ProjectDependency
+ internal class ProjectDependency
{
public string Name { get; }
public string ProjectFilePath { get; }
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependencyComparer.cs b/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependencyComparer.cs
index afb2a8578..dcf3d8f7b 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependencyComparer.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependencyComparer.cs
@@ -6,7 +6,7 @@ using System.Collections.Generic;
namespace Microsoft.DotNet.ProjectJsonMigration
{
- public class ProjectDependencyComparer : IEqualityComparer
+ internal class ProjectDependencyComparer : IEqualityComparer
{
public bool Equals(ProjectDependency one, ProjectDependency two)
{
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependencyFinder.cs b/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependencyFinder.cs
index c92bec3a7..904a7993b 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependencyFinder.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependencyFinder.cs
@@ -4,8 +4,8 @@
using System;
using System.Collections.Generic;
using Microsoft.Build.Construction;
-using Microsoft.DotNet.ProjectModel;
-using Microsoft.DotNet.ProjectModel.Graph;
+using Microsoft.DotNet.Internal.ProjectModel;
+using Microsoft.DotNet.Internal.ProjectModel.Graph;
using System.Linq;
using System.IO;
using Newtonsoft.Json.Linq;
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectMigrator.cs b/src/Microsoft.DotNet.ProjectJsonMigration/ProjectMigrator.cs
index 9de79845e..031aa7651 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectMigrator.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/ProjectMigrator.cs
@@ -4,8 +4,8 @@
using System;
using System.Collections.Generic;
using Microsoft.Build.Construction;
-using Microsoft.DotNet.ProjectModel;
-using Microsoft.DotNet.ProjectModel.Graph;
+using Microsoft.DotNet.Internal.ProjectModel;
+using Microsoft.DotNet.Internal.ProjectModel.Graph;
using Microsoft.DotNet.Cli;
using System.Linq;
using System.IO;
@@ -14,7 +14,7 @@ using Microsoft.DotNet.Tools.Common;
namespace Microsoft.DotNet.ProjectJsonMigration
{
- public class ProjectMigrator
+ internal class ProjectMigrator
{
private readonly IMigrationRule _ruleSet;
private readonly ProjectDependencyFinder _projectDependencyFinder = new ProjectDependencyFinder();
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Report/MigrationReport.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Report/MigrationReport.cs
index d54d0faf7..bfde5391b 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Report/MigrationReport.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Report/MigrationReport.cs
@@ -9,7 +9,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration
{
/// Any changes to this need to be reflected in roslyn-project-system
/// TODO add link
- public class MigrationReport
+ internal class MigrationReport
{
public List ProjectMigrationReports { get; }
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Report/ProjectMigrationReport.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Report/ProjectMigrationReport.cs
index b719b6ce7..2e71cd095 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Report/ProjectMigrationReport.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Report/ProjectMigrationReport.cs
@@ -5,7 +5,7 @@ using System.Collections.Generic;
using System.Linq;
namespace Microsoft.DotNet.ProjectJsonMigration
{
- public class ProjectMigrationReport
+ internal class ProjectMigrationReport
{
public string ProjectDirectory { get; }
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/AddDefaultsToProjectRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/AddDefaultsToProjectRule.cs
index bbc214d14..d4f529b7b 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/AddDefaultsToProjectRule.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/AddDefaultsToProjectRule.cs
@@ -13,7 +13,7 @@ using Newtonsoft.Json;
namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
- public class AddDefaultsToProjectRule : IMigrationRule
+ internal class AddDefaultsToProjectRule : IMigrationRule
{
internal const string c_DefaultsProjectElementContainerLabel = "MigrationDefaultsTempContainer";
internal const string c_SdkDefaultsJsonFileName = "sdkdefaults.json";
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/CleanOutputProjectRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/CleanOutputProjectRule.cs
index 3d58a006c..dfdb2420d 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/CleanOutputProjectRule.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/CleanOutputProjectRule.cs
@@ -13,7 +13,7 @@ using Newtonsoft.Json;
namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
- public class CleanOutputProjectRule : IMigrationRule
+ internal class CleanOutputProjectRule : IMigrationRule
{
public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs)
{
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/IMigrationRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/IMigrationRule.cs
index 36cc3715c..92635883b 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/IMigrationRule.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/IMigrationRule.cs
@@ -3,7 +3,7 @@
namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
- public interface IMigrationRule
+ internal interface IMigrationRule
{
void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs);
}
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateAssemblyInfoRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateAssemblyInfoRule.cs
index 22edd478d..4f3e719c2 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateAssemblyInfoRule.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateAssemblyInfoRule.cs
@@ -10,14 +10,14 @@ using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.DotNet.ProjectJsonMigration;
using Microsoft.DotNet.ProjectJsonMigration.Transforms;
-using Microsoft.DotNet.ProjectModel;
-using Microsoft.DotNet.ProjectModel.Files;
+using Microsoft.DotNet.Internal.ProjectModel;
+using Microsoft.DotNet.Internal.ProjectModel.Files;
using Microsoft.DotNet.Tools.Common;
using NuGet.Frameworks;
namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
- public class MigrateAssemblyInfoRule : IMigrationRule
+ internal class MigrateAssemblyInfoRule : IMigrationRule
{
private static IReadOnlyDictionary> Suppresses { get; } = new Dictionary>
{
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateBuildOptionsRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateBuildOptionsRule.cs
index 00f561a87..78b28c2d1 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateBuildOptionsRule.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateBuildOptionsRule.cs
@@ -6,13 +6,13 @@ using System.Collections.Generic;
using System.Linq;
using Microsoft.Build.Construction;
using Microsoft.DotNet.ProjectJsonMigration.Transforms;
-using Microsoft.DotNet.ProjectModel;
-using Microsoft.DotNet.ProjectModel.Files;
+using Microsoft.DotNet.Internal.ProjectModel;
+using Microsoft.DotNet.Internal.ProjectModel.Files;
using Newtonsoft.Json.Linq;
namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
- public class MigrateBuildOptionsRule : IMigrationRule
+ internal class MigrateBuildOptionsRule : IMigrationRule
{
private AddPropertyTransform[] EmitEntryPointTransforms
=> new []
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateConfigurationsRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateConfigurationsRule.cs
index 164d91243..4d9b55e43 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateConfigurationsRule.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateConfigurationsRule.cs
@@ -5,11 +5,11 @@ using System.Collections.Generic;
using System.Linq;
using Microsoft.Build.Construction;
using NuGet.Frameworks;
-using Microsoft.DotNet.ProjectModel;
+using Microsoft.DotNet.Internal.ProjectModel;
namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
- public class MigrateConfigurationsRule : IMigrationRule
+ internal class MigrateConfigurationsRule : IMigrationRule
{
public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs)
{
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateJsonPropertiesRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateJsonPropertiesRule.cs
index 11b85ba99..5751d5b4f 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateJsonPropertiesRule.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateJsonPropertiesRule.cs
@@ -10,7 +10,7 @@ using Newtonsoft.Json.Linq;
namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
- public class MigrateJsonPropertiesRule : IMigrationRule
+ internal class MigrateJsonPropertiesRule : IMigrationRule
{
private Dictionary> _propertyMappings
= new Dictionary>
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigratePackOptionsRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigratePackOptionsRule.cs
index b521fe1bd..570e8e648 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigratePackOptionsRule.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigratePackOptionsRule.cs
@@ -8,13 +8,13 @@ using System.Linq;
using Microsoft.Build.Construction;
using Microsoft.DotNet.ProjectJsonMigration;
using Microsoft.DotNet.ProjectJsonMigration.Transforms;
-using Microsoft.DotNet.ProjectModel;
-using Microsoft.DotNet.ProjectModel.Files;
+using Microsoft.DotNet.Internal.ProjectModel;
+using Microsoft.DotNet.Internal.ProjectModel.Files;
using Microsoft.DotNet.Tools.Common;
namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
- public class MigratePackOptionsRule : IMigrationRule
+ internal class MigratePackOptionsRule : IMigrationRule
{
private AddPropertyTransform TagsTransform => new AddPropertyTransform(
"PackageTags",
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigratePackageDependenciesAndToolsRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigratePackageDependenciesAndToolsRule.cs
index 236e3ae10..6ca97b185 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigratePackageDependenciesAndToolsRule.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigratePackageDependenciesAndToolsRule.cs
@@ -8,14 +8,14 @@ using System.Linq;
using Microsoft.Build.Construction;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.ProjectJsonMigration.Transforms;
-using Microsoft.DotNet.ProjectModel;
+using Microsoft.DotNet.Internal.ProjectModel;
using Microsoft.DotNet.Tools.Common;
using NuGet.Frameworks;
using NuGet.LibraryModel;
namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
- public class MigratePackageDependenciesAndToolsRule : IMigrationRule
+ internal class MigratePackageDependenciesAndToolsRule : IMigrationRule
{
private readonly ITransformApplicator _transformApplicator;
private readonly ProjectDependencyFinder _projectDependencyFinder;
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateProjectDependenciesRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateProjectDependenciesRule.cs
index bda537b2c..9fcd1b4da 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateProjectDependenciesRule.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateProjectDependenciesRule.cs
@@ -7,13 +7,13 @@ using System.IO;
using System.Linq;
using Microsoft.Build.Construction;
using Microsoft.DotNet.ProjectJsonMigration.Transforms;
-using Microsoft.DotNet.ProjectModel;
+using Microsoft.DotNet.Internal.ProjectModel;
using Microsoft.DotNet.Tools.Common;
using NuGet.Frameworks;
namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
- public class MigrateProjectDependenciesRule : IMigrationRule
+ internal class MigrateProjectDependenciesRule : IMigrationRule
{
private readonly ITransformApplicator _transformApplicator;
private readonly ProjectDependencyFinder _projectDependencyFinder;
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigratePublishOptionsRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigratePublishOptionsRule.cs
index 53c6b30d0..edb9582b6 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigratePublishOptionsRule.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigratePublishOptionsRule.cs
@@ -6,7 +6,7 @@ using Microsoft.DotNet.ProjectJsonMigration.Transforms;
namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
- public class MigratePublishOptionsRule : IMigrationRule
+ internal class MigratePublishOptionsRule : IMigrationRule
{
private readonly ITransformApplicator _transformApplicator;
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateRootOptionsRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateRootOptionsRule.cs
index 54f76b05f..73760a3a0 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateRootOptionsRule.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateRootOptionsRule.cs
@@ -3,11 +3,11 @@
using System.Linq;
using Microsoft.DotNet.ProjectJsonMigration.Transforms;
-using Project = Microsoft.DotNet.ProjectModel.Project;
+using Project = Microsoft.DotNet.Internal.ProjectModel.Project;
namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
- public class MigrateRootOptionsRule : IMigrationRule
+ internal class MigrateRootOptionsRule : IMigrationRule
{
private readonly ITransformApplicator _transformApplicator;
private readonly AddPropertyTransform[] _transforms;
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateRuntimeOptionsRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateRuntimeOptionsRule.cs
index e865fe39a..0ad4aace3 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateRuntimeOptionsRule.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateRuntimeOptionsRule.cs
@@ -5,7 +5,7 @@ using System.IO;
namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
- public class MigrateRuntimeOptionsRule : IMigrationRule
+ internal class MigrateRuntimeOptionsRule : IMigrationRule
{
private static readonly string s_runtimeOptionsFileName = "runtimeconfig.template.json";
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateRuntimesRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateRuntimesRule.cs
index c0ddb8c46..c30ac843f 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateRuntimesRule.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateRuntimesRule.cs
@@ -7,7 +7,7 @@ using Microsoft.DotNet.ProjectJsonMigration.Transforms;
namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
- public class MigrateRuntimesRule : IMigrationRule
+ internal class MigrateRuntimesRule : IMigrationRule
{
AddPropertyTransform> RuntimeIdentifiersTransform =>
new AddPropertyTransform>(
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateScriptsRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateScriptsRule.cs
index 5901b6256..1312c5d89 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateScriptsRule.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateScriptsRule.cs
@@ -7,11 +7,11 @@ using System.Linq;
using Microsoft.Build.Construction;
using Microsoft.DotNet.Cli.Utils.CommandParsing;
using Microsoft.DotNet.ProjectJsonMigration.Transforms;
-using Microsoft.DotNet.ProjectModel;
+using Microsoft.DotNet.Internal.ProjectModel;
namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
- public class MigrateScriptsRule : IMigrationRule
+ internal class MigrateScriptsRule : IMigrationRule
{
private readonly ITransformApplicator _transformApplicator;
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateTFMRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateTFMRule.cs
index ac75851ee..c173d90f9 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateTFMRule.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateTFMRule.cs
@@ -13,7 +13,7 @@ using System.Collections.Generic;
namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
// TODO: Support Multi-TFM
- public class MigrateTFMRule : IMigrationRule
+ internal class MigrateTFMRule : IMigrationRule
{
private readonly ITransformApplicator _transformApplicator;
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/RemoveDefaultsFromProjectRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/RemoveDefaultsFromProjectRule.cs
index 5a18b23ff..0802be4aa 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/RemoveDefaultsFromProjectRule.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/RemoveDefaultsFromProjectRule.cs
@@ -13,7 +13,7 @@ using Newtonsoft.Json;
namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
- public class RemoveDefaultsFromProjectRule : IMigrationRule
+ internal class RemoveDefaultsFromProjectRule : IMigrationRule
{
public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs)
{
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/SaveOutputProjectRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/SaveOutputProjectRule.cs
index dd4a88ee7..ed35d9907 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/SaveOutputProjectRule.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/SaveOutputProjectRule.cs
@@ -6,7 +6,7 @@ using Microsoft.Build.Construction;
namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
- public class SaveOutputProjectRule : IMigrationRule
+ internal class SaveOutputProjectRule : IMigrationRule
{
public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs)
{
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/ItemTransformApplicator.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/ItemTransformApplicator.cs
index 9fabbc316..8aa455422 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/ItemTransformApplicator.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/ItemTransformApplicator.cs
@@ -8,7 +8,7 @@ using System.Linq;
namespace Microsoft.DotNet.ProjectJsonMigration.Transforms
{
- public class ItemTransformApplicator : ITransformApplicator
+ internal class ItemTransformApplicator : ITransformApplicator
{
private readonly ProjectRootElement _projectElementGenerator = ProjectRootElement.Create();
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/PropertyTransformApplicator.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/PropertyTransformApplicator.cs
index 91f21641b..fa85e942b 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/PropertyTransformApplicator.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/PropertyTransformApplicator.cs
@@ -9,7 +9,7 @@ using System.Text.RegularExpressions;
namespace Microsoft.DotNet.ProjectJsonMigration.Transforms
{
- public class PropertyTransformApplicator : ITransformApplicator
+ internal class PropertyTransformApplicator : ITransformApplicator
{
private readonly ProjectRootElement _projectElementGenerator = ProjectRootElement.Create();
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/project.json b/src/Microsoft.DotNet.ProjectJsonMigration/project.json
index d2bb6c028..c04560752 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/project.json
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/project.json
@@ -8,15 +8,9 @@
}
},
"dependencies": {
- "Microsoft.DotNet.Compiler.Common": {
- "target": "project"
- },
"Microsoft.DotNet.Cli.Utils": {
"target": "project"
},
- "Microsoft.DotNet.ProjectModel": {
- "target": "project"
- },
"Microsoft.Build": "15.1.319-preview5",
"Microsoft.CodeAnalysis.CSharp": "2.0.0-beta6-60922-08"
},
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/transforms/AddItemTransform.cs b/src/Microsoft.DotNet.ProjectJsonMigration/transforms/AddItemTransform.cs
index 55bb687b1..59505d3c0 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/transforms/AddItemTransform.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/transforms/AddItemTransform.cs
@@ -8,7 +8,7 @@ using Microsoft.DotNet.ProjectJsonMigration.Models;
namespace Microsoft.DotNet.ProjectJsonMigration.Transforms
{
- public class AddItemTransform : ConditionalTransform
+ internal class AddItemTransform : ConditionalTransform
{
private readonly ProjectRootElement _itemObjectGenerator = ProjectRootElement.Create();
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/transforms/AddPropertyTransform.cs b/src/Microsoft.DotNet.ProjectJsonMigration/transforms/AddPropertyTransform.cs
index b3dbe40f5..6b25fc290 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/transforms/AddPropertyTransform.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/transforms/AddPropertyTransform.cs
@@ -6,7 +6,7 @@ using Microsoft.Build.Construction;
namespace Microsoft.DotNet.ProjectJsonMigration.Transforms
{
- public class AddPropertyTransform : ConditionalTransform
+ internal class AddPropertyTransform : ConditionalTransform
{
public string PropertyName { get; }
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/transforms/ConditionalTransform.cs b/src/Microsoft.DotNet.ProjectJsonMigration/transforms/ConditionalTransform.cs
index 4fc455e7f..099f553c2 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/transforms/ConditionalTransform.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/transforms/ConditionalTransform.cs
@@ -5,7 +5,7 @@ using System;
namespace Microsoft.DotNet.ProjectJsonMigration.Transforms
{
- public abstract class ConditionalTransform : ITransform
+ internal abstract class ConditionalTransform : ITransform
{
private Func _condition;
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/transforms/ITransform.cs b/src/Microsoft.DotNet.ProjectJsonMigration/transforms/ITransform.cs
index 7cd8f68f0..23e82b8f7 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/transforms/ITransform.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/transforms/ITransform.cs
@@ -3,7 +3,7 @@
namespace Microsoft.DotNet.ProjectJsonMigration.Transforms
{
- public interface ITransform
+ internal interface ITransform
{
U Transform(T source);
}
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/transforms/ITransformApplicator.cs b/src/Microsoft.DotNet.ProjectJsonMigration/transforms/ITransformApplicator.cs
index 4efd2f16f..6b1bb5f52 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/transforms/ITransformApplicator.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/transforms/ITransformApplicator.cs
@@ -6,7 +6,7 @@ using Microsoft.Build.Construction;
namespace Microsoft.DotNet.ProjectJsonMigration.Transforms
{
- public interface ITransformApplicator
+ internal interface ITransformApplicator
{
void Execute(
T element,
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/transforms/IncludeContextTransform.cs b/src/Microsoft.DotNet.ProjectJsonMigration/transforms/IncludeContextTransform.cs
index b2ff28ac2..3a6183d03 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/transforms/IncludeContextTransform.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/transforms/IncludeContextTransform.cs
@@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-using Microsoft.DotNet.ProjectModel.Files;
+using Microsoft.DotNet.Internal.ProjectModel.Files;
using System;
using System.IO;
using System.Collections.Generic;
@@ -13,7 +13,7 @@ using Microsoft.DotNet.Tools.Common;
namespace Microsoft.DotNet.ProjectJsonMigration.Transforms
{
- public class IncludeContextTransform : ConditionalTransform>
+ internal class IncludeContextTransform : ConditionalTransform>
{
private Func> IncludeFilesExcludeFilesTransformGetter =>
(itemName) =>
diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/transforms/TransformApplicator.cs b/src/Microsoft.DotNet.ProjectJsonMigration/transforms/TransformApplicator.cs
index 47815949e..85759d662 100644
--- a/src/Microsoft.DotNet.ProjectJsonMigration/transforms/TransformApplicator.cs
+++ b/src/Microsoft.DotNet.ProjectJsonMigration/transforms/TransformApplicator.cs
@@ -8,7 +8,7 @@ using System.Linq;
namespace Microsoft.DotNet.ProjectJsonMigration.Transforms
{
- public class TransformApplicator : ITransformApplicator
+ internal class TransformApplicator : ITransformApplicator
{
private readonly ITransformApplicator _propertyTransformApplicator;
diff --git a/src/Microsoft.DotNet.ProjectModel.Loader/LoaderProjectContextExtensions.cs b/src/Microsoft.DotNet.ProjectModel.Loader/LoaderProjectContextExtensions.cs
deleted file mode 100644
index 5dec13272..000000000
--- a/src/Microsoft.DotNet.ProjectModel.Loader/LoaderProjectContextExtensions.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Runtime.Loader;
-using Microsoft.DotNet.ProjectModel.Compilation;
-using Microsoft.Extensions.DependencyModel;
-
-namespace Microsoft.DotNet.ProjectModel.Loader
-{
- public static class LoaderProjectContextExtensions
- {
- public static AssemblyLoadContext CreateLoadContext(
- this ProjectContext context,
- string configuration) => CreateLoadContext(context, context.RuntimeIdentifier, configuration);
-
- public static AssemblyLoadContext CreateLoadContext(
- this ProjectContext context,
- string runtimeIdentifier,
- string configuration) => CreateLoadContext(context, runtimeIdentifier, configuration, outputPath: null);
-
- public static AssemblyLoadContext CreateLoadContext(
- this ProjectContext context,
- string runtimeIdentifier,
- string configuration,
- string outputPath)
- {
- var exporter = context.CreateExporter(configuration);
- var assemblies = new Dictionary(AssemblyNameComparer.OrdinalIgnoreCase);
- var nativeLibs = new Dictionary();
- var rids = DependencyContext.Default?.RuntimeGraph ?? Enumerable.Empty();
- var fallbacks = rids.FirstOrDefault(r => r.Runtime.Equals(runtimeIdentifier));
-
- foreach (var export in exporter.GetAllExports())
- {
- // Process managed assets
- var group = string.IsNullOrEmpty(runtimeIdentifier) ?
- export.RuntimeAssemblyGroups.GetDefaultGroup() :
- GetGroup(export.RuntimeAssemblyGroups, runtimeIdentifier, fallbacks);
- if(group != null)
- {
- foreach(var asset in group.Assets)
- {
- assemblies[asset.GetAssemblyName()] = asset.ResolvedPath;
- }
- }
-
- // Process native assets
- group = string.IsNullOrEmpty(runtimeIdentifier) ?
- export.NativeLibraryGroups.GetDefaultGroup() :
- GetGroup(export.NativeLibraryGroups, runtimeIdentifier, fallbacks);
- if(group != null)
- {
- foreach(var asset in group.Assets)
- {
- nativeLibs[asset.Name] = asset.ResolvedPath;
- }
- }
-
- // Process resource assets
- foreach(var asset in export.ResourceAssemblies)
- {
- var name = asset.Asset.GetAssemblyName();
- name.CultureName = asset.Locale;
- assemblies[name] = asset.Asset.ResolvedPath;
- }
- }
-
- return new ProjectLoadContext(
- assemblies,
- nativeLibs,
-
- // Add the project's output directory path to ensure project-to-project references get located
- new[] { context.GetOutputPaths(configuration, outputPath: outputPath).CompilationOutputPath });
- }
-
- private static LibraryAssetGroup GetGroup(IEnumerable groups, string runtimeIdentifier, RuntimeFallbacks fallbacks)
- {
- IEnumerable rids = new[] { runtimeIdentifier };
- if(fallbacks != null)
- {
- rids = Enumerable.Concat(rids, fallbacks.Fallbacks);
- }
-
- foreach(var rid in rids)
- {
- var group = groups.GetRuntimeGroup(rid);
- if(group != null)
- {
- return group;
- }
- }
- return null;
- }
-
- private class AssemblyNameComparer : IEqualityComparer
- {
- public static readonly IEqualityComparer OrdinalIgnoreCase = new AssemblyNameComparer();
-
- private AssemblyNameComparer()
- {
- }
-
- public bool Equals(AssemblyName x, AssemblyName y)
- {
- // Ignore case because that's what Assembly.Load does.
- return string.Equals(x.Name, y.Name, StringComparison.OrdinalIgnoreCase) &&
- string.Equals(x.CultureName ?? string.Empty, y.CultureName ?? string.Empty, StringComparison.Ordinal);
- }
-
- public int GetHashCode(AssemblyName obj)
- {
- var hashCode = 0;
- if (obj.Name != null)
- {
- hashCode ^= obj.Name.GetHashCode();
- }
-
- hashCode ^= (obj.CultureName ?? string.Empty).GetHashCode();
- return hashCode;
- }
- }
- }
-}
diff --git a/src/Microsoft.DotNet.ProjectModel.Loader/Microsoft.DotNet.ProjectModel.Loader.xproj b/src/Microsoft.DotNet.ProjectModel.Loader/Microsoft.DotNet.ProjectModel.Loader.xproj
deleted file mode 100644
index bb7e99e2f..000000000
--- a/src/Microsoft.DotNet.ProjectModel.Loader/Microsoft.DotNet.ProjectModel.Loader.xproj
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
- 14.0.24720
- $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
-
-
-
- 651DDD55-4819-4F20-B619-4F8A5BC2DF6D
- Microsoft.DotNet.ProjectModel.Loader
- ..\..\artifacts\obj\$(MSBuildProjectName)
- ..\..\artifacts\bin
-
-
- 2.0
-
-
-
\ No newline at end of file
diff --git a/src/Microsoft.DotNet.ProjectModel.Loader/ProjectLoadContext.cs b/src/Microsoft.DotNet.ProjectModel.Loader/ProjectLoadContext.cs
deleted file mode 100644
index fa92273b6..000000000
--- a/src/Microsoft.DotNet.ProjectModel.Loader/ProjectLoadContext.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Reflection;
-using System.Runtime.InteropServices;
-using System.Runtime.Loader;
-
-namespace Microsoft.DotNet.ProjectModel.Loader
-{
- ///
- /// An designed to allow loading from a Project.
- ///
- public class ProjectLoadContext : AssemblyLoadContext
- {
- private readonly IDictionary _assemblyPaths;
- private readonly IDictionary _nativeLibraries;
- private readonly IEnumerable _searchPaths;
-
- private static readonly string[] NativeLibraryExtensions;
- private static readonly string[] ManagedAssemblyExtensions = new[]
- {
- ".dll",
- ".ni.dll",
- ".exe",
- ".ni.exe"
- };
-
-
- static ProjectLoadContext()
- {
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- {
- NativeLibraryExtensions = new[] { ".dll" };
- }
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
- {
- NativeLibraryExtensions = new[] { ".dylib" };
- }
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
- {
- NativeLibraryExtensions = new[] { ".so" };
- }
- else
- {
- NativeLibraryExtensions = new string[0];
- }
- }
-
- public ProjectLoadContext(IDictionary assemblyPaths,
- IDictionary nativeLibraries,
- IEnumerable searchPaths)
- {
- _assemblyPaths = assemblyPaths;
- _nativeLibraries = nativeLibraries;
- _searchPaths = searchPaths;
- }
-
- protected override Assembly Load(AssemblyName assemblyName)
- {
- string path;
- if (_assemblyPaths.TryGetValue(assemblyName, out path) || SearchForLibrary(ManagedAssemblyExtensions, assemblyName.Name, out path))
- {
- return LoadFromAssemblyPath(path);
- }
-
- return null;
- }
-
- protected override IntPtr LoadUnmanagedDll(string unmanagedDllName)
- {
- string path;
- if (_nativeLibraries.TryGetValue(unmanagedDllName, out path) || SearchForLibrary(NativeLibraryExtensions, unmanagedDllName, out path))
- {
- return LoadUnmanagedDllFromPath(path);
- }
-
- return base.LoadUnmanagedDll(unmanagedDllName);
- }
-
- private bool SearchForLibrary(string[] extensions, string name, out string path)
- {
- foreach (var searchPath in _searchPaths)
- {
- foreach (var extension in extensions)
- {
- var candidate = Path.Combine(searchPath, name + extension);
- if (File.Exists(candidate))
- {
- path = candidate;
- return true;
- }
- }
- }
- path = null;
- return false;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Microsoft.DotNet.ProjectModel.Loader/Properties/AssemblyInfo.cs b/src/Microsoft.DotNet.ProjectModel.Loader/Properties/AssemblyInfo.cs
deleted file mode 100644
index bd44bced5..000000000
--- a/src/Microsoft.DotNet.ProjectModel.Loader/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-using System.Reflection;
-
-[assembly: AssemblyMetadataAttribute("Serviceable", "True")]
diff --git a/src/Microsoft.DotNet.ProjectModel.Loader/project.json b/src/Microsoft.DotNet.ProjectModel.Loader/project.json
deleted file mode 100644
index 3d0d43789..000000000
--- a/src/Microsoft.DotNet.ProjectModel.Loader/project.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "version": "1.0.0-preview3-*",
- "buildOptions": {
- "keyFile": "../../tools/Key.snk"
- },
- "dependencies": {
- "Microsoft.DotNet.ProjectModel": {
- "target": "project"
- },
- "System.Runtime.Loader": "4.0.0"
- },
- "frameworks": {
- "netstandard1.6": {
- "imports": "portable-net45+wp80+win8+wpa81+dnxcore50"
- }
- }
-}
diff --git a/src/Microsoft.DotNet.ProjectModel.Workspaces/Microsoft.DotNet.ProjectModel.Workspaces.xproj b/src/Microsoft.DotNet.ProjectModel.Workspaces/Microsoft.DotNet.ProjectModel.Workspaces.xproj
deleted file mode 100644
index 3227dea0a..000000000
--- a/src/Microsoft.DotNet.ProjectModel.Workspaces/Microsoft.DotNet.ProjectModel.Workspaces.xproj
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
- 14.0.23107
- $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
-
-
-
- bd7833f8-3209-4682-bf75-b4bca883e279
- Microsoft.DotNet.ProjectModel.Workspaces
- ..\..\artifacts\obj\$(MSBuildProjectName)
- ..\..\artifacts\bin
-
-
-
- 2.0
-
-
-
\ No newline at end of file
diff --git a/src/Microsoft.DotNet.ProjectModel.Workspaces/ProjectJsonWorkspace.cs b/src/Microsoft.DotNet.ProjectModel.Workspaces/ProjectJsonWorkspace.cs
deleted file mode 100644
index 43b50b3fd..000000000
--- a/src/Microsoft.DotNet.ProjectModel.Workspaces/ProjectJsonWorkspace.cs
+++ /dev/null
@@ -1,251 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Reflection.PortableExecutable;
-using System.Text;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.Host.Mef;
-using Microsoft.CodeAnalysis.Text;
-using Microsoft.DotNet.Cli.Compiler.Common;
-using Microsoft.DotNet.PlatformAbstractions;
-using Microsoft.DotNet.ProjectModel.Compilation;
-using Microsoft.DotNet.ProjectModel.Files;
-using NuGet.Frameworks;
-
-using RoslynWorkspace = Microsoft.CodeAnalysis.Workspace;
-
-namespace Microsoft.DotNet.ProjectModel.Workspaces
-{
- public class ProjectJsonWorkspace : RoslynWorkspace
- {
- private Dictionary _cache = new Dictionary();
-
- public ProjectJsonWorkspace(ProjectContext context) : base(MefHostServices.DefaultHost, "Custom")
- {
- AddProject(context);
- }
-
- public ProjectJsonWorkspace(string projectPath) : this(new[] { projectPath })
- {
- }
-
- public ProjectJsonWorkspace(IEnumerable projectPaths) : base(MefHostServices.DefaultHost, "Custom")
- {
- Initialize(projectPaths);
- }
-
- private void Initialize(IEnumerable projectPaths)
- {
- foreach (var projectPath in projectPaths)
- {
- AddProject(projectPath);
- }
- }
-
- private void AddProject(string projectPath)
- {
- // Get all of the specific projects (there is a project per framework)
- foreach (var p in ProjectContext.CreateContextForEachFramework(projectPath))
- {
- AddProject(p);
- }
- }
-
- private ProjectId AddProject(ProjectContext project)
- {
- // Create the framework specific project and add it to the workspace
- var projectInfo = ProjectInfo.Create(
- ProjectId.CreateNewId(),
- VersionStamp.Create(),
- project.ProjectFile.Name + "+" + project.TargetFramework,
- project.ProjectFile.Name,
- LanguageNames.CSharp,
- project.ProjectFile.ProjectFilePath);
-
- OnProjectAdded(projectInfo);
-
- // TODO: ctor argument?
- var configuration = "Debug";
-
- var compilerOptions = project.GetLanguageSpecificCompilerOptions(project.TargetFramework, configuration);
-
- var compilationSettings = ToCompilationSettings(compilerOptions, project.TargetFramework, project.ProjectFile.ProjectDirectory);
-
- OnParseOptionsChanged(projectInfo.Id, new CSharpParseOptions(compilationSettings.LanguageVersion, preprocessorSymbols: compilationSettings.Defines));
-
- OnCompilationOptionsChanged(projectInfo.Id, compilationSettings.CompilationOptions);
-
- IEnumerable sourceFiles = null;
- if (compilerOptions.CompileInclude == null)
- {
- sourceFiles = project.ProjectFile.Files.SourceFiles;
- }
- else
- {
- var includeFiles = IncludeFilesResolver.GetIncludeFiles(compilerOptions.CompileInclude, "/", diagnostics: null);
- sourceFiles = includeFiles.Select(f => f.SourcePath);
- }
-
- foreach (var file in sourceFiles)
- {
- using (var stream = File.OpenRead(file))
- {
- AddSourceFile(projectInfo, file, stream);
- }
- }
-
- var exporter = project.CreateExporter(configuration);
-
- foreach (var dependency in exporter.GetDependencies())
- {
- var projectDependency = dependency.Library as ProjectDescription;
- if (projectDependency != null)
- {
- var projectDependencyContext = ProjectContext.Create(projectDependency.Project.ProjectFilePath, projectDependency.Framework);
-
- var id = AddProject(projectDependencyContext);
-
- OnProjectReferenceAdded(projectInfo.Id, new ProjectReference(id));
- }
- else
- {
- foreach (var asset in dependency.CompilationAssemblies)
- {
- OnMetadataReferenceAdded(projectInfo.Id, GetMetadataReference(asset.ResolvedPath));
- }
- }
-
- foreach (var file in dependency.SourceReferences)
- {
- using (var stream = file.GetTransformedStream())
- {
- AddSourceFile(projectInfo, file.ResolvedPath, stream);
- }
- }
- }
-
- return projectInfo.Id;
- }
-
- private void AddSourceFile(ProjectInfo projectInfo, string file, Stream stream)
- {
- var sourceText = SourceText.From(stream, encoding: Encoding.UTF8);
- var id = DocumentId.CreateNewId(projectInfo.Id);
- var version = VersionStamp.Create();
-
- var loader = TextLoader.From(TextAndVersion.Create(sourceText, version));
- OnDocumentAdded(DocumentInfo.Create(id, file, filePath: file, loader: loader));
- }
-
- private MetadataReference GetMetadataReference(string path)
- {
- AssemblyMetadata assemblyMetadata;
- if (!_cache.TryGetValue(path, out assemblyMetadata))
- {
- using (var stream = File.OpenRead(path))
- {
- var moduleMetadata = ModuleMetadata.CreateFromStream(stream, PEStreamOptions.PrefetchMetadata);
- assemblyMetadata = AssemblyMetadata.Create(moduleMetadata);
- _cache[path] = assemblyMetadata;
- }
- }
-
- return assemblyMetadata.GetReference();
- }
-
- private static CompilationSettings ToCompilationSettings(CommonCompilerOptions compilerOptions,
- NuGetFramework targetFramework,
- string projectDirectory)
- {
- var options = GetCompilationOptions(compilerOptions, projectDirectory);
-
- options = options.WithSpecificDiagnosticOptions(compilerOptions.SuppressWarnings.ToDictionary(
- suppress => suppress, _ => ReportDiagnostic.Suppress));
-
- AssemblyIdentityComparer assemblyIdentityComparer =
- targetFramework.IsDesktop() ?
- DesktopAssemblyIdentityComparer.Default :
- null;
-
- options = options.WithAssemblyIdentityComparer(assemblyIdentityComparer);
-
- LanguageVersion languageVersion;
- if (!Enum.TryParse(value: compilerOptions.LanguageVersion,
- ignoreCase: true,
- result: out languageVersion))
- {
- languageVersion = LanguageVersion.CSharp6;
- }
-
- var settings = new CompilationSettings
- {
- LanguageVersion = languageVersion,
- Defines = compilerOptions.Defines ?? Enumerable.Empty(),
- CompilationOptions = options
- };
-
- return settings;
- }
-
- private static CSharpCompilationOptions GetCompilationOptions(CommonCompilerOptions compilerOptions, string projectDirectory)
- {
- var outputKind = compilerOptions.EmitEntryPoint.GetValueOrDefault() ?
- OutputKind.ConsoleApplication : OutputKind.DynamicallyLinkedLibrary;
- var options = new CSharpCompilationOptions(outputKind);
-
- string platformValue = compilerOptions.Platform;
- bool allowUnsafe = compilerOptions.AllowUnsafe ?? false;
- bool optimize = compilerOptions.Optimize ?? false;
- bool warningsAsErrors = compilerOptions.WarningsAsErrors ?? false;
-
- Microsoft.CodeAnalysis.Platform platform;
- if (!Enum.TryParse(value: platformValue, ignoreCase: true, result: out platform))
- {
- platform = Microsoft.CodeAnalysis.Platform.AnyCpu;
- }
-
- options = options
- .WithAllowUnsafe(allowUnsafe)
- .WithPlatform(platform)
- .WithGeneralDiagnosticOption(warningsAsErrors ? ReportDiagnostic.Error : ReportDiagnostic.Default)
- .WithOptimizationLevel(optimize ? OptimizationLevel.Release : OptimizationLevel.Debug);
-
- return AddSigningOptions(options, compilerOptions, projectDirectory);
- }
-
- private static CSharpCompilationOptions AddSigningOptions(CSharpCompilationOptions options, CommonCompilerOptions compilerOptions, string projectDirectory)
- {
- var useOssSigning = compilerOptions.PublicSign == true;
- var keyFile = compilerOptions.KeyFile;
-
- if (!string.IsNullOrEmpty(keyFile))
- {
- keyFile = Path.GetFullPath(Path.Combine(projectDirectory, compilerOptions.KeyFile));
-
- if (RuntimeEnvironment.OperatingSystemPlatform != PlatformAbstractions.Platform.Windows || useOssSigning)
- {
- return options.WithCryptoPublicKey(
- SnkUtils.ExtractPublicKey(File.ReadAllBytes(keyFile)));
- }
-
- options = options.WithCryptoKeyFile(keyFile);
-
- return options.WithDelaySign(compilerOptions.DelaySign);
- }
-
- return options;
- }
-
- private class CompilationSettings
- {
- public LanguageVersion LanguageVersion { get; set; }
- public IEnumerable Defines { get; set; }
- public CSharpCompilationOptions CompilationOptions { get; set; }
- }
- }
-}
diff --git a/src/Microsoft.DotNet.ProjectModel.Workspaces/Properties/AssemblyInfo.cs b/src/Microsoft.DotNet.ProjectModel.Workspaces/Properties/AssemblyInfo.cs
deleted file mode 100644
index bd44bced5..000000000
--- a/src/Microsoft.DotNet.ProjectModel.Workspaces/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-using System.Reflection;
-
-[assembly: AssemblyMetadataAttribute("Serviceable", "True")]
diff --git a/src/Microsoft.DotNet.ProjectModel.Workspaces/SnkUtils.cs b/src/Microsoft.DotNet.ProjectModel.Workspaces/SnkUtils.cs
deleted file mode 100644
index 608d4e023..000000000
--- a/src/Microsoft.DotNet.ProjectModel.Workspaces/SnkUtils.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections.Immutable;
-using System.IO;
-
-namespace Microsoft.DotNet.ProjectModel.Workspaces
-{
- internal static class SnkUtils
- {
- const byte PUBLICKEYBLOB = 0x06;
- const byte PRIVATEKEYBLOB = 0x07;
-
- private const uint CALG_RSA_SIGN = 0x00002400;
- private const uint CALG_SHA = 0x00008004;
-
- private const uint RSA1 = 0x31415352; //"RSA1" publickeyblob
- private const uint RSA2 = 0x32415352; //"RSA2" privatekeyblob
-
- private const int VersionOffset = 1;
- private const int ModulusLengthOffset = 12;
- private const int ExponentOffset = 16;
- private const int MagicPrivateKeyOffset = 8;
- private const int MagicPublicKeyOffset = 20;
-
- public static ImmutableArray ExtractPublicKey(byte[] snk)
- {
- ValidateBlob(snk);
-
- if (snk[0] != PRIVATEKEYBLOB)
- {
- return ImmutableArray.Create(snk);
- }
-
- var version = snk[VersionOffset];
- int modulusBitLength = ReadInt32(snk, ModulusLengthOffset);
- uint exponent = (uint)ReadInt32(snk, ExponentOffset);
- var modulus = new byte[modulusBitLength >> 3];
-
- Array.Copy(snk, 20, modulus, 0, modulus.Length);
-
- return CreatePublicKey(version, exponent, modulus);
- }
-
- private static void ValidateBlob(byte[] snk)
- {
- // 160 - the size of public key
- if (snk.Length >= 160)
- {
- if (snk[0] == PRIVATEKEYBLOB && ReadInt32(snk, MagicPrivateKeyOffset) == RSA2 || // valid private key
- snk[12] == PUBLICKEYBLOB && ReadInt32(snk, MagicPublicKeyOffset) == RSA1) // valid public key
- {
- return;
- }
- }
-
- throw new InvalidOperationException("Invalid key file.");
- }
-
- private static int ReadInt32(byte[] array, int index)
- {
- return array[index] | array[index + 1] << 8 | array[index + 2] << 16 | array[index + 3] << 24;
- }
-
- private static ImmutableArray CreatePublicKey(byte version, uint exponent, byte[] modulus)
- {
- using (var ms = new MemoryStream(160))
- using (var binaryWriter = new BinaryWriter(ms))
- {
- binaryWriter.Write(CALG_RSA_SIGN);
- binaryWriter.Write(CALG_SHA);
- // total size of the rest of the blob (20 - size of RSAPUBKEY)
- binaryWriter.Write(modulus.Length + 20);
- binaryWriter.Write(PUBLICKEYBLOB);
- binaryWriter.Write(version);
- binaryWriter.Write((ushort)0x00000000); // reserved
- binaryWriter.Write(CALG_RSA_SIGN);
- binaryWriter.Write(RSA1);
- binaryWriter.Write(modulus.Length << 3);
- binaryWriter.Write(exponent);
- binaryWriter.Write(modulus);
- return ImmutableArray.Create(ms.ToArray());
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Microsoft.DotNet.ProjectModel.Workspaces/WorkspaceProjectContextExtensions.cs b/src/Microsoft.DotNet.ProjectModel.Workspaces/WorkspaceProjectContextExtensions.cs
deleted file mode 100644
index fd54b39c0..000000000
--- a/src/Microsoft.DotNet.ProjectModel.Workspaces/WorkspaceProjectContextExtensions.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using RoslynWorkspace = Microsoft.CodeAnalysis.Workspace;
-
-namespace Microsoft.DotNet.ProjectModel.Workspaces
-{
- public static class WorkspaceProjectContextExtensions
- {
- public static RoslynWorkspace CreateRoslynWorkspace(this ProjectContext context) => new ProjectJsonWorkspace(context);
- }
-}
\ No newline at end of file
diff --git a/src/Microsoft.DotNet.ProjectModel.Workspaces/project.json b/src/Microsoft.DotNet.ProjectModel.Workspaces/project.json
deleted file mode 100644
index ef434e125..000000000
--- a/src/Microsoft.DotNet.ProjectModel.Workspaces/project.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "version": "1.0.0-preview3-*",
- "buildOptions": {
- "keyFile": "../../tools/Key.snk"
- },
- "dependencies": {
- "Microsoft.DotNet.ProjectModel": {
- "target": "project"
- },
- "Microsoft.DotNet.Compiler.Common": {
- "target": "project"
- },
- "Microsoft.CodeAnalysis.CSharp.Workspaces": "2.0.0-beta6-60922-08",
- "Microsoft.DotNet.PlatformAbstractions": "1.0.1-beta-000933"
- },
- "frameworks": {
- "netstandard1.5": {
- "imports": [
- "portable-net45+wp80+win8+wpa81+dnxcore50",
- "portable-net45+win8"
- ]
- }
- }
-}
diff --git a/src/Microsoft.DotNet.ProjectModel/Properties/AssemblyInfo.cs b/src/Microsoft.DotNet.ProjectModel/Properties/AssemblyInfo.cs
deleted file mode 100644
index f0ea358d0..000000000
--- a/src/Microsoft.DotNet.ProjectModel/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Microsoft.DotNet.ProjectModel")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Microsoft.DotNet.ProjectModel")]
-[assembly: AssemblyCopyright("Copyright © 2015")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("303677d5-7312-4c3f-baee-beb1a9bd9fe6")]
-
-[assembly: AssemblyMetadataAttribute("Serviceable", "True")]
-[assembly: InternalsVisibleTo("Microsoft.DotNet.ProjectJsonMigration, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
-[assembly: InternalsVisibleTo("Microsoft.DotNet.ProjectModel.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100039ac461fa5c82c7dd2557400c4fd4e9dcdf7ac47e3d572548c04cd4673e004916610f4ea5cbf86f2b1ca1cb824f2a7b3976afecfcf4eb72d9a899aa6786effa10c30399e6580ed848231fec48374e41b3acf8811931343fc2f73acf72dae745adbcb7063cc4b50550618383202875223fc75401351cd89c44bf9b50e7fa3796")]
-[assembly:
- InternalsVisibleTo(
- "dotnet-test.UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100039ac461fa5c82c7dd2557400c4fd4e9dcdf7ac47e3d572548c04cd4673e004916610f4ea5cbf86f2b1ca1cb824f2a7b3976afecfcf4eb72d9a899aa6786effa10c30399e6580ed848231fec48374e41b3acf8811931343fc2f73acf72dae745adbcb7063cc4b50550618383202875223fc75401351cd89c44bf9b50e7fa3796"
- )]
\ No newline at end of file
diff --git a/src/Microsoft.DotNet.ProjectModel/RuntimeEnvironmentRidExtensions.cs b/src/Microsoft.DotNet.ProjectModel/RuntimeEnvironmentRidExtensions.cs
deleted file mode 100644
index 3ff7ed5dd..000000000
--- a/src/Microsoft.DotNet.ProjectModel/RuntimeEnvironmentRidExtensions.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-
-using System;
-using System.Collections.Generic;
-using Microsoft.DotNet.PlatformAbstractions;
-
-namespace Microsoft.DotNet.InternalAbstractions
-{
- // This is to support some legacy stuff.
- // dnu restore (and thus dotnet restore) always uses win7-x64 as the Windows restore target,
- // so, when picking targets out of the lock file, we need to do version fallback since the
- // active RID might be higher than the RID in the lock file.
- //
- // We should clean this up. Filed #619 to track.
- public static class RuntimeEnvironmentRidExtensions
- {
- // Gets the identfier that is used for restore by default (this is different from the actual RID, but only on Windows)
- public static string GetLegacyRestoreRuntimeIdentifier()
- {
- if (RuntimeEnvironment.OperatingSystemPlatform != Platform.Windows)
- {
- return RuntimeEnvironment.GetRuntimeIdentifier();
- }
- else
- {
- var arch = RuntimeEnvironment.RuntimeArchitecture.ToLowerInvariant();
- return "win7-" + arch;
- }
- }
-
- public static IEnumerable GetAllCandidateRuntimeIdentifiers()
- {
- return GetAllCandidateRuntimeIdentifiers(null);
- }
-
- public static IEnumerable GetAllCandidateRuntimeIdentifiers(IEnumerable fallbackIdentifiers = null)
- {
- List result = new List();
-
- if (RuntimeEnvironment.OperatingSystemPlatform != Platform.Windows)
- {
- result.Add(RuntimeEnvironment.GetRuntimeIdentifier());
- }
- else
- {
- var arch = RuntimeEnvironment.RuntimeArchitecture.ToLowerInvariant();
- if (RuntimeEnvironment.OperatingSystemVersion.StartsWith("6.1", StringComparison.Ordinal))
- {
- result.Add("win7-" + arch);
- }
- else if (RuntimeEnvironment.OperatingSystemVersion.StartsWith("6.2", StringComparison.Ordinal))
- {
- result.Add("win8-" + arch);
- result.Add("win7-" + arch);
- }
- else if (RuntimeEnvironment.OperatingSystemVersion.StartsWith("6.3", StringComparison.Ordinal))
- {
- result.Add("win81-" + arch);
- result.Add("win8-" + arch);
- result.Add("win7-" + arch);
- }
- else if (RuntimeEnvironment.OperatingSystemVersion.StartsWith("10.0", StringComparison.Ordinal))
- {
- result.Add("win10-" + arch);
- result.Add("win81-" + arch);
- result.Add("win8-" + arch);
- result.Add("win7-" + arch);
- }
- }
-
- if (fallbackIdentifiers != null)
- {
- foreach (string fallbackIdentifier in fallbackIdentifiers)
- {
- if (!result.Contains(fallbackIdentifier))
- {
- result.Add(fallbackIdentifier);
- }
- }
- }
-
- return result;
- }
- }
-}
diff --git a/src/Microsoft.DotNet.ProjectModel/project.json b/src/Microsoft.DotNet.ProjectModel/project.json
deleted file mode 100644
index 292acc616..000000000
--- a/src/Microsoft.DotNet.ProjectModel/project.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "version": "1.0.0-rc4-*",
- "buildOptions": {
- "keyFile": "../../tools/Key.snk"
- },
- "description": "Types to model a .NET Project",
- "dependencies": {
- "Microsoft.Extensions.DependencyModel": "1.0.1-beta-000933",
- "Microsoft.DotNet.PlatformAbstractions": "1.0.1-beta-000933",
- "Newtonsoft.Json": "9.0.1",
- "NuGet.Configuration": "3.6.0-rc-1984",
- "NuGet.Packaging": "3.6.0-rc-1984",
- "NuGet.RuntimeModel": "3.6.0-rc-1984",
- "NuGet.ProjectModel": "3.6.0-rc-1984",
- "System.Reflection.Metadata": "1.4.1-beta-24410-02"
- },
- "frameworks": {
- "netstandard1.3": {
- "imports": [
- "portable-net45+wp80+win8+wpa81+dnxcore50",
- "dotnet5.4"
- ],
- "dependencies": {
- "Microsoft.CSharp": "4.0.1",
- "System.Dynamic.Runtime": "4.0.11",
- "System.Runtime.Serialization.Primitives": "4.1.1",
- "System.Security.Cryptography.Algorithms": "4.2.0",
- "System.Threading.Thread": "4.0.0",
- "System.Xml.XDocument": "4.0.11"
- }
- }
- }
-}
diff --git a/src/Microsoft.DotNet.TestFramework/Extensions/DirectoryInfoExtensions.cs b/src/Microsoft.DotNet.TestFramework/Extensions/DirectoryInfoExtensions.cs
new file mode 100644
index 000000000..981fc8eee
--- /dev/null
+++ b/src/Microsoft.DotNet.TestFramework/Extensions/DirectoryInfoExtensions.cs
@@ -0,0 +1,25 @@
+// Copyright (c) .NET Foundation and contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System.IO;
+
+namespace Microsoft.DotNet.TestFramework
+{
+ internal static class DirectoryInfoExtensions
+ {
+ public static bool Contains(this DirectoryInfo subject, FileSystemInfo target)
+ {
+ return target.FullName.StartsWith(subject.FullName);
+ }
+
+ public static DirectoryInfo GetDirectory(this DirectoryInfo subject, params string [] directoryNames)
+ {
+ return new DirectoryInfo(Path.Combine(subject.FullName, Path.Combine(directoryNames)));
+ }
+
+ public static FileInfo GetFile(this DirectoryInfo subject, string fileName)
+ {
+ return new FileInfo(Path.Combine(subject.FullName, fileName));
+ }
+ }
+}
diff --git a/src/Microsoft.DotNet.TestFramework/TestAssetInfo.cs b/src/Microsoft.DotNet.TestFramework/TestAssetInfo.cs
new file mode 100644
index 000000000..2b5772d47
--- /dev/null
+++ b/src/Microsoft.DotNet.TestFramework/TestAssetInfo.cs
@@ -0,0 +1,229 @@
+// Copyright (c) .NET Foundation and contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Threading.Tasks;
+using Microsoft.DotNet.Cli.Utils;
+using Microsoft.DotNet.PlatformAbstractions;
+
+namespace Microsoft.DotNet.TestFramework
+{
+ public class TestAssetInfo
+ {
+ private const string DataDirectoryName = ".tam";
+
+ private readonly string [] FilesToExclude = { ".DS_Store", ".noautobuild" };
+
+ private readonly DirectoryInfo [] _directoriesToExclude;
+
+ private readonly string _assetName;
+
+ private readonly DirectoryInfo _dataDirectory;
+
+ private readonly DirectoryInfo _root;
+
+ private readonly TestAssetInventoryFiles _inventoryFiles;
+
+ internal DirectoryInfo Root
+ {
+ get
+ {
+ return _root;
+ }
+ }
+
+ internal TestAssetInfo(DirectoryInfo root, string assetName)
+ {
+ if (!root.Exists)
+ {
+ throw new DirectoryNotFoundException($"Directory not found at '{root}'");
+ }
+
+ _assetName = assetName;
+
+ _root = root;
+
+ _dataDirectory = new DirectoryInfo(Path.Combine(_root.FullName, DataDirectoryName));
+
+ _inventoryFiles = new TestAssetInventoryFiles(_dataDirectory);
+
+ _directoriesToExclude = new []
+ {
+ _dataDirectory
+ };
+
+ if (!_dataDirectory.Exists)
+ {
+ _dataDirectory.Create();
+ }
+ }
+
+ public TestAssetInstance CreateInstance([CallerMemberName] string callingMethod = "", string identifier = "")
+ {
+ var instancePath = GetTestDestinationDirectoryPath(callingMethod, identifier);
+
+ var testInstance = new TestAssetInstance(this, new DirectoryInfo(instancePath));
+
+ return testInstance;
+ }
+
+ private string GetTestDestinationDirectoryPath(string callingMethod, string identifier)
+ {
+#if NET451
+ string baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
+#else
+ string baseDirectory = AppContext.BaseDirectory;
+#endif
+ return Path.Combine(baseDirectory, callingMethod + identifier, _assetName);
+ }
+
+ private List LoadInventory(FileInfo file)
+ {
+ if (!file.Exists)
+ {
+ return null;
+ }
+
+ var inventory = new List();
+
+ var lines = file.OpenText();
+
+ while (lines.Peek() > 0)
+ {
+ inventory.Add(new FileInfo(lines.ReadLine()));
+ }
+
+ return inventory;
+ }
+
+ private void SaveInventory(FileInfo file, IEnumerable inventory)
+ {
+ StreamWriter writer;
+
+ if (file.Exists)
+ {
+ writer = file.AppendText();
+ }
+ else
+ {
+ writer = file.CreateText();
+ }
+
+ using(writer)
+ {
+ foreach (var path in inventory.Select(i => i.FullName))
+ {
+ writer.WriteLine(path);
+ }
+ }
+ }
+
+ private IEnumerable GetFileList()
+ {
+ return _root.GetFiles("*.*", SearchOption.AllDirectories)
+ .Where(f => !_directoriesToExclude.Any(d => d.Contains(f)))
+ .Where(f => !FilesToExclude.Contains(f.Name));
+ }
+
+ internal IEnumerable GetSourceFiles()
+ {
+ return GetInventory(_inventoryFiles.Source, null, () => {});
+ }
+
+ internal IEnumerable GetRestoreFiles()
+ {
+ return GetInventory(_inventoryFiles.Restore, GetSourceFiles, DoRestore);
+ }
+
+ internal IEnumerable GetBuildFiles()
+ {
+ return GetInventory(_inventoryFiles.Build, GetRestoreFiles, DoBuild);
+ }
+
+ private IEnumerable GetInventory(FileInfo file, Func> beforeAction, Action action)
+ {
+ if (file.Exists)
+ {
+ return LoadInventory(file);
+ }
+
+ IEnumerable preInventory;
+
+ if (beforeAction == null)
+ {
+ preInventory = new List();
+ }
+ else
+ {
+ beforeAction();
+
+ preInventory = GetFileList();
+ }
+
+ action();
+
+ var inventory = GetFileList().Where(i => !preInventory.Select(p => p.FullName).Contains(i.FullName));
+
+ SaveInventory(file, inventory);
+
+ return inventory;
+ }
+
+ private void DoRestore()
+ {
+ Console.WriteLine($"TestAsset Restore '{_assetName}'");
+
+ var projFiles = _root.GetFiles("*.csproj", SearchOption.AllDirectories);
+
+ foreach (var projFile in projFiles)
+ {
+ var restoreArgs = new string[] { "restore", projFile.FullName, "/p:SkipInvalidConfigurations=true" };
+
+ var commandResult = Command.Create(new PathCommandResolverPolicy(), "dotnet", restoreArgs)
+ .CaptureStdOut()
+ .CaptureStdErr()
+ .Execute();
+
+ int exitCode = commandResult.ExitCode;
+
+ if (exitCode != 0)
+ {
+ Console.WriteLine(commandResult.StdOut);
+
+ Console.WriteLine(commandResult.StdErr);
+
+ string message = string.Format($"TestAsset Restore '{_assetName}'@'{projFile.FullName}' Failed with {exitCode}");
+
+ throw new Exception(message);
+ }
+ }
+ }
+
+ private void DoBuild()
+ {
+ string[] args = new string[] { "build" };
+
+ Console.WriteLine($"TestAsset Build '{_assetName}'");
+
+ var commandResult = Command.Create(new PathCommandResolverPolicy(), "dotnet", args)
+ .WorkingDirectory(_root.FullName)
+ .CaptureStdOut()
+ .CaptureStdErr()
+ .Execute();
+
+ int exitCode = commandResult.ExitCode;
+
+ if (exitCode != 0)
+ {
+ Console.WriteLine(commandResult.StdOut);
+ Console.WriteLine(commandResult.StdErr);
+ string message = string.Format($"TestAsset Build '{_assetName}' Failed with {exitCode}");
+ throw new Exception(message);
+ }
+ }
+ }
+}
diff --git a/src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs b/src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs
new file mode 100644
index 000000000..12c6c27d2
--- /dev/null
+++ b/src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs
@@ -0,0 +1,87 @@
+// Copyright (c) .NET Foundation and contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Threading.Tasks;
+using Microsoft.DotNet.Cli.Utils;
+using Microsoft.DotNet.Tools.Common;
+
+namespace Microsoft.DotNet.TestFramework
+{
+ public class TestAssetInstance
+ {
+ private TestAssetInfo _testAssetInfo;
+
+ private DirectoryInfo _root;
+
+ public DirectoryInfo Root
+ {
+ get
+ {
+ return _root;
+ }
+ }
+
+ public TestAssetInstance(TestAssetInfo testAssetInfo, DirectoryInfo root)
+ {
+ _testAssetInfo = testAssetInfo;
+
+ _root = root;
+
+ if (root.Exists)
+ {
+ root.Delete(recursive: true);
+ }
+
+ root.Create();
+ }
+
+ public TestAssetInstance WithSourceFiles()
+ {
+ var filesToCopy = _testAssetInfo.GetSourceFiles();
+
+ CopyFiles(filesToCopy);
+
+ return this;
+ }
+
+ public TestAssetInstance WithRestoreFiles()
+ {
+ var filesToCopy = _testAssetInfo.GetRestoreFiles();
+
+ CopyFiles(filesToCopy);
+
+ return this;
+ }
+
+ public TestAssetInstance WithBuildFiles()
+ {
+ var filesToCopy = _testAssetInfo.GetBuildFiles();
+
+ CopyFiles(filesToCopy);
+
+ return this;
+ }
+
+ private void CopyFiles(IEnumerable filesToCopy)
+ {
+ foreach (var file in filesToCopy)
+ {
+ var relativePath = file.FullName.Substring(_testAssetInfo.Root.FullName.Length + 1);
+
+ var newPath = Path.Combine(Root.FullName, relativePath);
+
+ var newFile = new FileInfo(newPath);
+
+ PathUtility.EnsureDirectory(newFile.Directory.FullName);
+
+ file.CopyTo(newPath);
+ }
+
+ }
+ }
+}
diff --git a/src/Microsoft.DotNet.TestFramework/TestAssetInventoryFiles.cs b/src/Microsoft.DotNet.TestFramework/TestAssetInventoryFiles.cs
new file mode 100644
index 000000000..563ba8fd1
--- /dev/null
+++ b/src/Microsoft.DotNet.TestFramework/TestAssetInventoryFiles.cs
@@ -0,0 +1,76 @@
+// Copyright (c) .NET Foundation and contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Threading.Tasks;
+using Microsoft.DotNet.Cli.Utils;
+
+namespace Microsoft.DotNet.TestFramework
+{
+ public class TestAssetInventoryFiles
+ {
+ private FileInfo _source;
+
+ private FileInfo _restore;
+
+ private FileInfo _build;
+
+ public FileInfo Source
+ {
+ get
+ {
+ _source.Refresh();
+
+ return _source;
+ }
+
+ private set
+ {
+ _source = value;
+ }
+ }
+
+ public FileInfo Restore
+ {
+ get
+ {
+ _restore.Refresh();
+
+ return _restore;
+ }
+
+ private set
+ {
+ _restore = value;
+ }
+ }
+
+ public FileInfo Build
+ {
+ get
+ {
+ _build.Refresh();
+
+ return _build;
+ }
+
+ private set
+ {
+ _build = value;
+ }
+ }
+
+ public TestAssetInventoryFiles(DirectoryInfo inventoryFileDirectory)
+ {
+ Source = new FileInfo(Path.Combine(inventoryFileDirectory.FullName, "source.txt"));
+
+ Restore = new FileInfo(Path.Combine(inventoryFileDirectory.FullName, "restore.txt"));
+
+ Build = new FileInfo(Path.Combine(inventoryFileDirectory.FullName, "build.txt"));
+ }
+ }
+}
diff --git a/src/Microsoft.DotNet.TestFramework/TestAssetKinds.cs b/src/Microsoft.DotNet.TestFramework/TestAssetKinds.cs
new file mode 100644
index 000000000..6d95b0128
--- /dev/null
+++ b/src/Microsoft.DotNet.TestFramework/TestAssetKinds.cs
@@ -0,0 +1,20 @@
+// Copyright (c) .NET Foundation and contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Threading.Tasks;
+using Microsoft.DotNet.Cli.Utils;
+
+namespace Microsoft.DotNet.TestFramework
+{
+ public class TestAssetKinds
+ {
+ public static string DesktopTestProjects = "DesktopTestProjects";
+
+ public static string TestProjects = "TestProjects";
+ }
+}
diff --git a/src/Microsoft.DotNet.TestFramework/TestAssets.cs b/src/Microsoft.DotNet.TestFramework/TestAssets.cs
new file mode 100644
index 000000000..a08b225bf
--- /dev/null
+++ b/src/Microsoft.DotNet.TestFramework/TestAssets.cs
@@ -0,0 +1,40 @@
+// Copyright (c) .NET Foundation and contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Threading.Tasks;
+using Microsoft.DotNet.Cli.Utils;
+
+namespace Microsoft.DotNet.TestFramework
+{
+ public class TestAssets
+ {
+ private DirectoryInfo _root;
+
+ public TestAssets(DirectoryInfo assetsRoot)
+ {
+ if (!assetsRoot.Exists)
+ {
+ throw new DirectoryNotFoundException($"Directory not found at '{assetsRoot}'");
+ }
+
+ _root = assetsRoot;
+ }
+
+ public TestAssetInfo Get(string name)
+ {
+ return Get(TestAssetKinds.TestProjects, name);
+ }
+
+ public TestAssetInfo Get(string kind, string name)
+ {
+ var assetDirectory = new DirectoryInfo(Path.Combine(_root.FullName, kind, name));
+
+ return new TestAssetInfo(assetDirectory, name);
+ }
+ }
+}
diff --git a/src/Microsoft.DotNet.TestFramework/TestInstance.cs b/src/Microsoft.DotNet.TestFramework/TestInstance.cs
index 8e5f8229c..b39adf509 100644
--- a/src/Microsoft.DotNet.TestFramework/TestInstance.cs
+++ b/src/Microsoft.DotNet.TestFramework/TestInstance.cs
@@ -49,7 +49,7 @@ namespace Microsoft.DotNet.TestFramework
.Where(file =>
{
file = file.ToLower();
- return !file.EndsWith("project.lock.json")
+ return !file.EndsWith("project.assets.json")
&& !file.Contains($"{System.IO.Path.DirectorySeparatorChar}bin{System.IO.Path.DirectorySeparatorChar}")
&& !file.Contains($"{System.IO.Path.DirectorySeparatorChar}obj{System.IO.Path.DirectorySeparatorChar}");
});
@@ -61,9 +61,22 @@ namespace Microsoft.DotNet.TestFramework
}
}
+ public TestInstance WithNuGetMSBuildFiles()
+ {
+ foreach (string file in Directory.GetFiles(_testAssetRoot, "*.nuget.g.*", SearchOption.AllDirectories))
+ {
+ string destinationLockFile = file.Replace(_testAssetRoot, Path);
+ Directory.CreateDirectory(System.IO.Path.GetDirectoryName(destinationLockFile));
+
+ File.Copy(file, destinationLockFile, true);
+ }
+
+ return this;
+ }
+
public TestInstance WithLockFiles()
{
- foreach (string lockFile in Directory.GetFiles(_testAssetRoot, "project.lock.json", SearchOption.AllDirectories))
+ foreach (string lockFile in Directory.GetFiles(_testAssetRoot, "project.assets.json", SearchOption.AllDirectories))
{
string destinationLockFile = lockFile.Replace(_testAssetRoot, Path);
Directory.CreateDirectory(System.IO.Path.GetDirectoryName(destinationLockFile));
diff --git a/src/Microsoft.DotNet.Tools.Test/AssemblyTestRunnerDecorator.cs b/src/Microsoft.DotNet.Tools.Test/AssemblyTestRunnerDecorator.cs
deleted file mode 100644
index c6d9836b7..000000000
--- a/src/Microsoft.DotNet.Tools.Test/AssemblyTestRunnerDecorator.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.IO;
-using Microsoft.DotNet.Cli.Utils;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class AssemblyTestRunnerDecorator : IDotnetTestRunner
- {
- private readonly Func _nextRunner;
-
- public AssemblyTestRunnerDecorator(Func nextRunner)
- {
- _nextRunner = nextRunner;
- }
-
- public int RunTests(DotnetTestParams dotnetTestParams)
- {
- var assembly = new FileInfo(dotnetTestParams.ProjectOrAssemblyPath);
- var publishDirectory = assembly.Directory.FullName;
- var applicationName = Path.GetFileNameWithoutExtension(dotnetTestParams.ProjectOrAssemblyPath);
-
- var commandFactory = new PublishedPathCommandFactory(publishDirectory, applicationName);
-
- var assemblyUnderTest = dotnetTestParams.ProjectOrAssemblyPath;
-
- return _nextRunner(commandFactory, assemblyUnderTest).RunTests(dotnetTestParams);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Microsoft.DotNet.Tools.Test/AssemblyUnderTest.cs b/src/Microsoft.DotNet.Tools.Test/AssemblyUnderTest.cs
deleted file mode 100644
index 39820969f..000000000
--- a/src/Microsoft.DotNet.Tools.Test/AssemblyUnderTest.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.IO;
-using Microsoft.DotNet.ProjectModel;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class AssemblyUnderTest
- {
- private readonly ProjectContext _projectContext;
- private readonly DotnetTestParams _dotentTestParams;
-
- public AssemblyUnderTest(ProjectContext projectContext, DotnetTestParams dotentTestParams)
- {
- _projectContext = projectContext;
- _dotentTestParams = dotentTestParams;
- }
-
- public string Path
- {
- get
- {
- var outputPaths = _projectContext.GetOutputPaths(
- _dotentTestParams.Config,
- _dotentTestParams.BuildBasePath,
- _dotentTestParams.Output);
-
- return outputPaths.RuntimeFiles.Assembly;
- }
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/CommandTestRunnerExtensions.cs b/src/Microsoft.DotNet.Tools.Test/CommandTestRunnerExtensions.cs
deleted file mode 100644
index d90df7e6a..000000000
--- a/src/Microsoft.DotNet.Tools.Test/CommandTestRunnerExtensions.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using Microsoft.DotNet.Cli.Utils;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public static class CommandTestRunnerExtensions
- {
- public static TestStartInfo ToTestStartInfo(this ICommand command)
- {
- return new TestStartInfo
- {
- FileName = command.CommandName,
- Arguments = command.CommandArgs
- };
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/ConsoleTestRunner.cs b/src/Microsoft.DotNet.Tools.Test/ConsoleTestRunner.cs
deleted file mode 100644
index fa8a6b00e..000000000
--- a/src/Microsoft.DotNet.Tools.Test/ConsoleTestRunner.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.Collections.Generic;
-using Microsoft.DotNet.Cli.Utils;
-using NuGet.Frameworks;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class ConsoleTestRunner : IDotnetTestRunner
- {
- private readonly ITestRunnerNameResolver _testRunnerNameResolver;
-
- private readonly ICommandFactory _commandFactory;
-
- private readonly string _assemblyUnderTest;
-
- private readonly NuGetFramework _framework;
-
- public ConsoleTestRunner(
- ITestRunnerNameResolver testRunnerNameResolver,
- ICommandFactory commandFactory,
- string assemblyUnderTest,
- NuGetFramework framework = null)
- {
- _testRunnerNameResolver = testRunnerNameResolver;
- _commandFactory = commandFactory;
- _assemblyUnderTest = assemblyUnderTest;
- _framework = framework;
- }
-
- public int RunTests(DotnetTestParams dotnetTestParams)
- {
- return _commandFactory.Create(
- _testRunnerNameResolver.ResolveTestRunner(),
- GetCommandArgs(dotnetTestParams),
- _framework,
- dotnetTestParams.Config)
- .Execute()
- .ExitCode;
- }
-
- private IEnumerable GetCommandArgs(DotnetTestParams dotnetTestParams)
- {
- var commandArgs = new List
- {
- _assemblyUnderTest
- };
-
- commandArgs.AddRange(dotnetTestParams.RemainingArguments);
-
- return commandArgs;
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/DesignTimeRunner.cs b/src/Microsoft.DotNet.Tools.Test/DesignTimeRunner.cs
deleted file mode 100644
index 8d3d37ded..000000000
--- a/src/Microsoft.DotNet.Tools.Test/DesignTimeRunner.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using Microsoft.DotNet.Cli.Utils;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class DesignTimeRunner : IDotnetTestRunner
- {
- private readonly ITestRunnerNameResolver _testRunnerNameResolver;
-
- private readonly ICommandFactory _commandFactory;
-
- private readonly string _assemblyUnderTest;
-
- public DesignTimeRunner(
- ITestRunnerNameResolver testRunnerNameResolver,
- ICommandFactory commandFactory,
- string assemblyUnderTest)
- {
- _testRunnerNameResolver = testRunnerNameResolver;
- _commandFactory = commandFactory;
- _assemblyUnderTest = assemblyUnderTest;
- }
-
- public int RunTests(DotnetTestParams dotnetTestParams)
- {
- Console.WriteLine("Listening on port {0}", dotnetTestParams.Port.Value);
-
- HandleDesignTimeMessages(dotnetTestParams);
-
- return 0;
- }
-
- private void HandleDesignTimeMessages(DotnetTestParams dotnetTestParams)
- {
- var reportingChannelFactory = new ReportingChannelFactory();
- var adapterChannel = reportingChannelFactory.CreateAdapterChannel(dotnetTestParams.Port.Value);
-
- try
- {
- var pathToAssemblyUnderTest = _assemblyUnderTest;
- var messages = new TestMessagesCollection();
- using (var dotnetTest = new DotnetTest(messages, pathToAssemblyUnderTest))
- {
- var testRunnerFactory =
- new TestRunnerFactory(_testRunnerNameResolver.ResolveTestRunner(), _commandFactory);
-
- dotnetTest
- .AddNonSpecificMessageHandlers(messages, adapterChannel)
- .AddTestDiscoveryMessageHandlers(adapterChannel, reportingChannelFactory, testRunnerFactory)
- .AddTestRunMessageHandlers(adapterChannel, reportingChannelFactory, testRunnerFactory)
- .AddTestRunnnersMessageHandlers(adapterChannel, reportingChannelFactory);
-
- dotnetTest.StartListeningTo(adapterChannel);
-
- adapterChannel.Connect();
-
- dotnetTest.StartHandlingMessages();
- }
- }
- catch (Exception ex)
- {
- adapterChannel.SendError(ex);
- }
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/DotnetTest.cs b/src/Microsoft.DotNet.Tools.Test/DotnetTest.cs
deleted file mode 100644
index b684fce1b..000000000
--- a/src/Microsoft.DotNet.Tools.Test/DotnetTest.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections.Generic;
-using Microsoft.Extensions.Testing.Abstractions;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class DotnetTest : IDotnetTest
- {
- private readonly IList _channels;
- private readonly IList _messageHandlers;
- private readonly ITestMessagesCollection _messages;
-
- public IDotnetTestMessageHandler TestSessionTerminateMessageHandler { private get; set; }
- public IDotnetTestMessageHandler UnknownMessageHandler { private get; set; }
-
- public DotnetTestState State { get; private set; }
-
- public string PathToAssemblyUnderTest { get; }
-
- public IEnumerable TestsToRun { get; set; }
-
- public DotnetTest(ITestMessagesCollection messages, string pathToAssemblyUnderTest)
- {
- PathToAssemblyUnderTest = pathToAssemblyUnderTest;
- State = DotnetTestState.InitialState;
- _channels = new List();
- _messageHandlers = new List();
- _messages = messages;
- }
-
- public DotnetTest AddMessageHandler(IDotnetTestMessageHandler messageHandler)
- {
- _messageHandlers.Add(messageHandler);
-
- return this;
- }
-
- public void StartHandlingMessages()
- {
- Message message;
- while (_messages.TryTake(out message))
- {
- HandleMessage(message);
- }
- }
-
- public void StartListeningTo(IReportingChannel reportingChannel)
- {
- ValidateSpecialMessageHandlersArePresent();
-
- _channels.Add(reportingChannel);
- reportingChannel.MessageReceived += OnMessageReceived;
- }
-
- public void Dispose()
- {
- foreach (var reportingChannel in _channels)
- {
- reportingChannel.Dispose();
- }
- }
-
- private void ValidateSpecialMessageHandlersArePresent()
- {
- if (TestSessionTerminateMessageHandler == null)
- {
- throw new InvalidOperationException("The TestSession.Terminate message handler needs to be set.");
- }
-
- if (UnknownMessageHandler == null)
- {
- throw new InvalidOperationException("The unknown message handler needs to be set.");
- }
- }
-
- private void HandleMessage(Message message)
- {
- foreach (var messageHandler in _messageHandlers)
- {
- var nextState = messageHandler.HandleMessage(this, message);
-
- if (nextState != DotnetTestState.NoOp)
- {
- State = nextState;
- return;
- }
- }
-
- UnknownMessageHandler.HandleMessage(this, message);
- }
-
- private void OnMessageReceived(object sender, Message message)
- {
- if (!TerminateTestSession(message))
- {
- _messages.Add(message);
- }
- }
-
- private bool TerminateTestSession(Message message)
- {
- return TestSessionTerminateMessageHandler.HandleMessage(this, message) == DotnetTestState.Terminated;
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/DotnetTestExtensions.cs b/src/Microsoft.DotNet.Tools.Test/DotnetTestExtensions.cs
deleted file mode 100644
index 0e4c17b74..000000000
--- a/src/Microsoft.DotNet.Tools.Test/DotnetTestExtensions.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using Microsoft.DotNet.Cli.Tools.Test;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public static class DotnetTestExtensions
- {
- public static IDotnetTest AddNonSpecificMessageHandlers(
- this IDotnetTest dotnetTest,
- ITestMessagesCollection messages,
- IReportingChannel adapterChannel)
- {
- dotnetTest.TestSessionTerminateMessageHandler = new TestSessionTerminateMessageHandler(messages);
- dotnetTest.UnknownMessageHandler = new UnknownMessageHandler(adapterChannel);
-
- dotnetTest.AddMessageHandler(new VersionCheckMessageHandler(adapterChannel));
-
- return dotnetTest;
- }
-
- public static IDotnetTest AddTestDiscoveryMessageHandlers(
- this IDotnetTest dotnetTest,
- IReportingChannel adapterChannel,
- IReportingChannelFactory reportingChannelFactory,
- ITestRunnerFactory testRunnerFactory)
- {
- dotnetTest.AddMessageHandler(
- new TestDiscoveryStartMessageHandler(testRunnerFactory, adapterChannel, reportingChannelFactory));
-
- return dotnetTest;
- }
-
- public static IDotnetTest AddTestRunMessageHandlers(
- this IDotnetTest dotnetTest,
- IReportingChannel adapterChannel,
- IReportingChannelFactory reportingChannelFactory,
- ITestRunnerFactory testRunnerFactory)
- {
- dotnetTest.AddMessageHandler(new GetTestRunnerProcessStartInfoMessageHandler(
- testRunnerFactory,
- adapterChannel,
- reportingChannelFactory));
-
- return dotnetTest;
- }
-
- public static IDotnetTest AddTestRunnnersMessageHandlers(
- this IDotnetTest dotnetTest,
- IReportingChannel adapterChannel,
- IReportingChannelFactory reportingChannelFactory)
- {
- dotnetTest.AddMessageHandler(new TestRunnerTestStartedMessageHandler(adapterChannel));
- dotnetTest.AddMessageHandler(new TestRunnerTestResultMessageHandler(adapterChannel));
- dotnetTest.AddMessageHandler(new TestRunnerTestFoundMessageHandler(adapterChannel));
- dotnetTest.AddMessageHandler(new TestRunnerTestCompletedMessageHandler(adapterChannel));
- dotnetTest.AddMessageHandler(new TestRunnerWaitingCommandMessageHandler(reportingChannelFactory));
-
- return dotnetTest;
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/DotnetTestParams.cs b/src/Microsoft.DotNet.Tools.Test/DotnetTestParams.cs
deleted file mode 100644
index 9bfdadff1..000000000
--- a/src/Microsoft.DotNet.Tools.Test/DotnetTestParams.cs
+++ /dev/null
@@ -1,189 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using Microsoft.DotNet.Cli.CommandLine;
-using Microsoft.DotNet.Cli.Utils;
-using Microsoft.DotNet.ProjectModel;
-using Microsoft.DotNet.Tools.Common;
-using NuGet.Frameworks;
-using static System.Int32;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class DotnetTestParams
- {
- private readonly CommandLineApplication _app;
-
- private CommandOption _outputOption;
- private CommandOption _buildBasePath;
- private CommandOption _frameworkOption;
- private CommandOption _runtimeOption;
- private CommandOption _configurationOption;
- private CommandOption _portOption;
- private CommandOption _parentProcessIdOption;
- private CommandArgument _projectOrAssemblyPath;
- private CommandOption _noBuildOption;
- private CommandOption _testRunner;
-
- public int? Port { get; set; }
-
- public int? ParentProcessId { get; set; }
-
- public string Runtime { get; set; }
-
- public string Config { get; set; }
-
- public string BuildBasePath { get; set; }
-
- public string Output { get; set; }
-
- public string ProjectOrAssemblyPath { get; set; }
-
- public NuGetFramework Framework { get; set; }
-
- public string UnparsedFramework { get; set; }
-
- public List RemainingArguments { get; set; }
-
- public bool NoBuild { get; set; }
-
- public bool Help { get; set; }
-
- public string TestRunner { get; set; }
-
- public bool HasTestRunner => !string.IsNullOrWhiteSpace(TestRunner);
-
- public bool IsTestingAssembly => ProjectOrAssemblyPath.EndsWith(".dll");
-
- public DotnetTestParams()
- {
- _app = new CommandLineApplication(false)
- {
- Name = "dotnet test",
- FullName = ".NET Test Driver",
- Description = "Test Driver for the .NET Platform"
- };
-
- AddDotnetTestParameters();
-
- Help = true;
- }
-
- public void Parse(string[] args)
- {
- _app.OnExecute(() =>
- {
- // Locate the project and get the name and full path
- ProjectOrAssemblyPath = _projectOrAssemblyPath.Value;
- if (string.IsNullOrEmpty(ProjectOrAssemblyPath))
- {
- ProjectOrAssemblyPath = Directory.GetCurrentDirectory();
- }
-
- if (_parentProcessIdOption.HasValue())
- {
- int processId;
-
- if (!TryParse(_parentProcessIdOption.Value(), out processId))
- {
- throw new InvalidOperationException(
- $"Invalid process id '{_parentProcessIdOption.Value()}'. Process id must be an integer.");
- }
-
- ParentProcessId = processId;
- }
-
- if (_portOption.HasValue())
- {
- int port;
-
- if (!TryParse(_portOption.Value(), out port))
- {
- throw new InvalidOperationException($"{_portOption.Value()} is not a valid port number.");
- }
-
- Port = port;
- }
-
- if (_testRunner.HasValue())
- {
- if (!IsTestingAssembly)
- {
- throw new InvalidOperationException("You can only specify a test runner with a dll.");
- }
-
- TestRunner = _testRunner.Value();
- }
-
- UnparsedFramework = _frameworkOption.Value();
- if (_frameworkOption.HasValue())
- {
- Framework = NuGetFramework.Parse(_frameworkOption.Value());
- }
-
- Output = _outputOption.Value();
- BuildBasePath = PathUtility.GetFullPath(_buildBasePath.Value());
- Config = _configurationOption.Value() ?? Constants.DefaultConfiguration;
- Runtime = _runtimeOption.Value();
- NoBuild = _noBuildOption.HasValue();
-
- RemainingArguments = _app.RemainingArguments;
-
- Help = false;
-
- return 0;
- });
-
- _app.Execute(args);
- }
-
- private void AddDotnetTestParameters()
- {
- _app.HelpOption("-?|-h|--help");
-
- _parentProcessIdOption = _app.Option(
- "--parentProcessId",
- "Used by IDEs to specify their process ID. Test will exit if the parent process does.",
- CommandOptionType.SingleValue);
- _portOption = _app.Option(
- "--port",
- "Used by IDEs to specify a port number to listen for a connection.",
- CommandOptionType.SingleValue);
- _configurationOption = _app.Option(
- "-c|--configuration ",
- "Configuration under which to build",
- CommandOptionType.SingleValue);
- _outputOption = _app.Option(
- "-o|--output ",
- "Directory in which to find the binaries to be run",
- CommandOptionType.SingleValue);
- _buildBasePath = _app.Option(
- "-b|--build-base-path ",
- "Directory in which to find temporary outputs",
- CommandOptionType.SingleValue);
- _frameworkOption = _app.Option(
- "-f|--framework ",
- "Looks for test binaries for a specific framework",
- CommandOptionType.SingleValue);
- _runtimeOption = _app.Option(
- "-r|--runtime ",
- "Look for test binaries for a for the specified runtime",
- CommandOptionType.SingleValue);
- _noBuildOption =
- _app.Option("--no-build", "Do not build project before testing", CommandOptionType.NoValue);
- _testRunner =
- _app.Option(
- "-t|--test-runner ",
- "Test runner to be used to run the test when an assembly to test is specified. If this option " +
- "is not provided, we will try to find a suitable runner collocated with the assembly",
- CommandOptionType.SingleValue);
- _projectOrAssemblyPath = _app.Argument(
- "",
- "The project or assembly to test, defaults to the current directory. Can be a path to a " +
- "project.json, to a dll or a project directory.");
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/DotnetTestRunnerFactory.cs b/src/Microsoft.DotNet.Tools.Test/DotnetTestRunnerFactory.cs
deleted file mode 100644
index bcef09d91..000000000
--- a/src/Microsoft.DotNet.Tools.Test/DotnetTestRunnerFactory.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using Microsoft.DotNet.Cli.Utils;
-using NuGet.Frameworks;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class DotnetTestRunnerFactory : IDotnetTestRunnerFactory
- {
- private readonly DotnetTestRunnerResolverFactory _dotnetTestRunnerResolverFactory;
-
- public DotnetTestRunnerFactory(DotnetTestRunnerResolverFactory dotnetTestRunnerResolverFactory)
- {
- _dotnetTestRunnerResolverFactory = dotnetTestRunnerResolverFactory;
- }
-
- public IDotnetTestRunner Create(DotnetTestParams dotnetTestParams)
- {
- Func nextTestRunner =
- (commandFactory, assemblyUnderTest, framework) =>
- {
- var dotnetTestRunnerResolver = _dotnetTestRunnerResolverFactory.Create(dotnetTestParams);
-
- IDotnetTestRunner testRunner =
- new ConsoleTestRunner(dotnetTestRunnerResolver, commandFactory, assemblyUnderTest, framework);
- if (dotnetTestParams.Port.HasValue)
- {
- testRunner = new DesignTimeRunner(dotnetTestRunnerResolver, commandFactory, assemblyUnderTest);
- }
-
- return testRunner;
- };
-
- return dotnetTestParams.IsTestingAssembly
- ? CreateTestRunnerForAssembly(nextTestRunner)
- : CreateTestRunnerForProjectJson(nextTestRunner);
- }
-
- private static IDotnetTestRunner CreateTestRunnerForAssembly(
- Func nextTestRunner)
- {
- Func nextAssemblyTestRunner =
- (commandFactory, assemblyUnderTest) => nextTestRunner(commandFactory, assemblyUnderTest, null);
-
- return new AssemblyTestRunnerDecorator(nextAssemblyTestRunner);
- }
-
- private static IDotnetTestRunner CreateTestRunnerForProjectJson(
- Func nextTestRunner)
- {
- return new ProjectJsonTestRunnerDecorator(nextTestRunner);
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/DotnetTestState.cs b/src/Microsoft.DotNet.Tools.Test/DotnetTestState.cs
deleted file mode 100644
index 7520f5c75..000000000
--- a/src/Microsoft.DotNet.Tools.Test/DotnetTestState.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public enum DotnetTestState
- {
- NoOp,
- InitialState,
- VersionCheckCompleted,
- TestDiscoveryStarted,
- TestDiscoveryCompleted,
- TestExecutionSentTestRunnerProcessStartInfo,
- TestExecutionStarted,
- TestExecutionCompleted,
- Terminated
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/IDotnetTest.cs b/src/Microsoft.DotNet.Tools.Test/IDotnetTest.cs
deleted file mode 100644
index 1cf7350f4..000000000
--- a/src/Microsoft.DotNet.Tools.Test/IDotnetTest.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections.Generic;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public interface IDotnetTest : IDisposable
- {
- string PathToAssemblyUnderTest { get; }
-
- DotnetTestState State { get; }
-
- DotnetTest AddMessageHandler(IDotnetTestMessageHandler messageHandler);
-
- IDotnetTestMessageHandler TestSessionTerminateMessageHandler { set; }
-
- IDotnetTestMessageHandler UnknownMessageHandler { set; }
-
- IEnumerable TestsToRun { get; set; }
-
- void StartHandlingMessages();
-
- void StartListeningTo(IReportingChannel reportingChannel);
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/IDotnetTestRunner.cs b/src/Microsoft.DotNet.Tools.Test/IDotnetTestRunner.cs
deleted file mode 100644
index 2e40e335c..000000000
--- a/src/Microsoft.DotNet.Tools.Test/IDotnetTestRunner.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public interface IDotnetTestRunner
- {
- int RunTests(DotnetTestParams dotnetTestParams);
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/IDotnetTestRunnerFactory.cs b/src/Microsoft.DotNet.Tools.Test/IDotnetTestRunnerFactory.cs
deleted file mode 100644
index ccb0dc47b..000000000
--- a/src/Microsoft.DotNet.Tools.Test/IDotnetTestRunnerFactory.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public interface IDotnetTestRunnerFactory
- {
- IDotnetTestRunner Create(DotnetTestParams dotnetTestParams);
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/ITestMessagesCollection.cs b/src/Microsoft.DotNet.Tools.Test/ITestMessagesCollection.cs
deleted file mode 100644
index ff462fb6a..000000000
--- a/src/Microsoft.DotNet.Tools.Test/ITestMessagesCollection.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using Microsoft.Extensions.Testing.Abstractions;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public interface ITestMessagesCollection : IDisposable
- {
- void Drain();
-
- void Add(Message message);
-
- bool TryTake(out Message message);
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/GetTestRunnerProcessStartInfoMessageHandler.cs b/src/Microsoft.DotNet.Tools.Test/MessageHandlers/GetTestRunnerProcessStartInfoMessageHandler.cs
deleted file mode 100644
index 95931d9cd..000000000
--- a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/GetTestRunnerProcessStartInfoMessageHandler.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using Microsoft.Extensions.Testing.Abstractions;
-using Newtonsoft.Json.Linq;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class GetTestRunnerProcessStartInfoMessageHandler : IDotnetTestMessageHandler
- {
- private readonly ITestRunnerFactory _testRunnerFactory;
- private readonly IReportingChannel _adapterChannel;
- private readonly IReportingChannelFactory _reportingChannelFactory;
-
- public GetTestRunnerProcessStartInfoMessageHandler(
- ITestRunnerFactory testRunnerFactory,
- IReportingChannel adapterChannel,
- IReportingChannelFactory reportingChannelFactory)
- {
- _testRunnerFactory = testRunnerFactory;
- _adapterChannel = adapterChannel;
- _reportingChannelFactory = reportingChannelFactory;
- }
-
- public DotnetTestState HandleMessage(IDotnetTest dotnetTest, Message message)
- {
- var nextState = DotnetTestState.NoOp;
-
- if (CanHandleMessage(dotnetTest, message))
- {
- DoHandleMessage(dotnetTest, message);
- nextState = DotnetTestState.TestExecutionSentTestRunnerProcessStartInfo;
- }
-
- return nextState;
- }
-
- private void DoHandleMessage(IDotnetTest dotnetTest, Message message)
- {
- var testRunnerChannel = _reportingChannelFactory.CreateTestRunnerChannel();
-
- dotnetTest.StartListeningTo(testRunnerChannel);
-
- testRunnerChannel.Connect();
-
- var testRunner = _testRunnerFactory.CreateTestRunner(
- new RunTestsArgumentsBuilder(dotnetTest.PathToAssemblyUnderTest, testRunnerChannel.Port, message));
-
- dotnetTest.TestsToRun = message.Payload?.ToObject().Tests;
-
- var processStartInfo = testRunner.GetProcessStartInfo();
-
- _adapterChannel.Send(new Message
- {
- MessageType = TestMessageTypes.TestExecutionTestRunnerProcessStartInfo,
- Payload = JToken.FromObject(processStartInfo)
- });
- }
-
- private static bool CanHandleMessage(IDotnetTest dotnetTest, Message message)
- {
- return IsAtAnAcceptableState(dotnetTest) &&
- message.MessageType == TestMessageTypes.TestExecutionGetTestRunnerProcessStartInfo;
- }
-
- private static bool IsAtAnAcceptableState(IDotnetTest dotnetTest)
- {
- return dotnetTest.State == DotnetTestState.VersionCheckCompleted ||
- dotnetTest.State == DotnetTestState.InitialState;
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/IDotnetTestMessageHandler.cs b/src/Microsoft.DotNet.Tools.Test/MessageHandlers/IDotnetTestMessageHandler.cs
deleted file mode 100644
index b2c44c614..000000000
--- a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/IDotnetTestMessageHandler.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using Microsoft.Extensions.Testing.Abstractions;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public interface IDotnetTestMessageHandler
- {
- DotnetTestState HandleMessage(IDotnetTest dotnetTest, Message message);
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestDiscoveryStartMessageHandler.cs b/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestDiscoveryStartMessageHandler.cs
deleted file mode 100644
index d33109e95..000000000
--- a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestDiscoveryStartMessageHandler.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.DotNet.Tools.Test;
-using Microsoft.Extensions.Testing.Abstractions;
-
-namespace Microsoft.DotNet.Cli.Tools.Test
-{
- public class TestDiscoveryStartMessageHandler : IDotnetTestMessageHandler
- {
- private readonly ITestRunnerFactory _testRunnerFactory;
- private readonly IReportingChannel _adapterChannel;
- private readonly IReportingChannelFactory _reportingChannelFactory;
-
- public TestDiscoveryStartMessageHandler(
- ITestRunnerFactory testRunnerFactory,
- IReportingChannel adapterChannel,
- IReportingChannelFactory reportingChannelFactory)
- {
- _testRunnerFactory = testRunnerFactory;
- _adapterChannel = adapterChannel;
- _reportingChannelFactory = reportingChannelFactory;
- }
-
- public DotnetTestState HandleMessage(IDotnetTest dotnetTest, Message message)
- {
- var nextState = DotnetTestState.NoOp;
- if (CanHandleMessage(dotnetTest, message))
- {
- HandleMessage(dotnetTest);
- nextState = DotnetTestState.TestDiscoveryStarted;
- }
-
- return nextState;
- }
-
- private void HandleMessage(IDotnetTest dotnetTest)
- {
- TestHostTracing.Source.TraceInformation("Starting Discovery");
-
- DiscoverTests(dotnetTest);
- }
-
- private void DiscoverTests(IDotnetTest dotnetTest)
- {
- var testRunnerResults = Enumerable.Empty();
-
- try
- {
- var testRunnerChannel = _reportingChannelFactory.CreateTestRunnerChannel();
-
- dotnetTest.StartListeningTo(testRunnerChannel);
-
- testRunnerChannel.Connect();
-
- var testRunner = _testRunnerFactory.CreateTestRunner(
- new DiscoverTestsArgumentsBuilder(dotnetTest.PathToAssemblyUnderTest, testRunnerChannel.Port));
-
- testRunner.RunTestCommand();
- }
- catch (TestRunnerOperationFailedException e)
- {
- _adapterChannel.SendError(e.Message);
- }
- }
-
- private static bool CanHandleMessage(IDotnetTest dotnetTest, Message message)
- {
- return IsAtAnAcceptableState(dotnetTest) && message.MessageType == TestMessageTypes.TestDiscoveryStart;
- }
-
- private static bool IsAtAnAcceptableState(IDotnetTest dotnetTest)
- {
- return (dotnetTest.State == DotnetTestState.VersionCheckCompleted ||
- dotnetTest.State == DotnetTestState.InitialState);
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestMessageTypes.cs b/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestMessageTypes.cs
deleted file mode 100644
index ce76ccef4..000000000
--- a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestMessageTypes.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public static class TestMessageTypes
- {
- public const string TestRunnerExecute = "TestRunner.Execute";
- public const string TestRunnerWaitingCommand = "TestRunner.WaitingCommand";
- public const string TestRunnerTestResult = "TestExecution.TestResult";
- public const string TestRunnerTestStarted = "TestExecution.TestStarted";
- public const string TestRunnerTestCompleted = "TestRunner.TestCompleted";
- public const string TestRunnerTestFound = "TestDiscovery.TestFound";
- public const string TestSessionConnected = "TestSession.Connected";
- public const string TestSessionTerminate = "TestSession.Terminate";
- public const string VersionCheck = "ProtocolVersion";
- public const string TestDiscoveryStart = "TestDiscovery.Start";
- public const string TestDiscoveryCompleted = "TestDiscovery.Completed";
- public const string TestDiscoveryTestFound = "TestDiscovery.TestFound";
- public const string TestExecutionGetTestRunnerProcessStartInfo = "TestExecution.GetTestRunnerProcessStartInfo";
- public const string TestExecutionTestRunnerProcessStartInfo = "TestExecution.TestRunnerProcessStartInfo";
- public const string TestExecutionStarted = "TestExecution.TestStarted";
- public const string TestExecutionTestResult = "TestExecution.TestResult";
- public const string TestExecutionCompleted = "TestExecution.Completed";
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestRunnerResultMessageHandler.cs b/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestRunnerResultMessageHandler.cs
deleted file mode 100644
index e33a4bbfb..000000000
--- a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestRunnerResultMessageHandler.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using Microsoft.Extensions.Testing.Abstractions;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public abstract class TestRunnerResultMessageHandler : IDotnetTestMessageHandler
- {
- private readonly IReportingChannel _adapterChannel;
- private readonly DotnetTestState _nextStateIfHandled;
- private readonly string _messageIfHandled;
-
- protected TestRunnerResultMessageHandler(
- IReportingChannel adapterChannel,
- DotnetTestState nextStateIfHandled,
- string messageIfHandled)
- {
- _adapterChannel = adapterChannel;
- _nextStateIfHandled = nextStateIfHandled;
- _messageIfHandled = messageIfHandled;
- }
-
- public DotnetTestState HandleMessage(IDotnetTest dotnetTest, Message message)
- {
- var nextState = DotnetTestState.NoOp;
- if (CanHandleMessage(dotnetTest, message))
- {
- HandleMessage(message);
- nextState = _nextStateIfHandled;
- }
-
- return nextState;
- }
-
- private void HandleMessage(Message message)
- {
- _adapterChannel.Send(new Message
- {
- MessageType = _messageIfHandled,
- Payload = message.Payload
- });
- }
-
- protected abstract bool CanHandleMessage(IDotnetTest dotnetTest, Message message);
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestRunnerTestCompletedMessageHandler.cs b/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestRunnerTestCompletedMessageHandler.cs
deleted file mode 100644
index 8e60b2838..000000000
--- a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestRunnerTestCompletedMessageHandler.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using Microsoft.Extensions.Testing.Abstractions;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class TestRunnerTestCompletedMessageHandler : IDotnetTestMessageHandler
- {
- private readonly IReportingChannel _adapterChannel;
-
- public TestRunnerTestCompletedMessageHandler(IReportingChannel adapterChannel)
- {
- _adapterChannel = adapterChannel;
- }
-
- public DotnetTestState HandleMessage(IDotnetTest dotnetTest, Message message)
- {
- var nextState = DotnetTestState.NoOp;
- if (CanHandleMessage(dotnetTest, message))
- {
- DoHandleMessage(dotnetTest, message);
- nextState = NextState(dotnetTest);
- }
-
- return nextState;
- }
-
- private void DoHandleMessage(IDotnetTest dotnetTest, Message message)
- {
- _adapterChannel.Send(new Message
- {
- MessageType = MessageType(dotnetTest)
- });
- }
-
- private string MessageType(IDotnetTest dotnetTest)
- {
- return dotnetTest.State == DotnetTestState.TestDiscoveryStarted
- ? TestMessageTypes.TestDiscoveryCompleted
- : TestMessageTypes.TestExecutionCompleted;
- }
-
- private DotnetTestState NextState(IDotnetTest dotnetTest)
- {
- return dotnetTest.State == DotnetTestState.TestDiscoveryStarted
- ? DotnetTestState.TestDiscoveryCompleted
- : DotnetTestState.TestExecutionCompleted;
- }
-
- private bool CanHandleMessage(IDotnetTest dotnetTest, Message message)
- {
- return IsAtAnAcceptableState(dotnetTest) && CanAcceptMessage(message);
- }
-
- private static bool CanAcceptMessage(Message message)
- {
- return message.MessageType == TestMessageTypes.TestRunnerTestCompleted;
- }
-
- private static bool IsAtAnAcceptableState(IDotnetTest dotnetTest)
- {
- return (dotnetTest.State == DotnetTestState.TestDiscoveryStarted ||
- dotnetTest.State == DotnetTestState.TestExecutionStarted);
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestRunnerTestFoundMessageHandler.cs b/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestRunnerTestFoundMessageHandler.cs
deleted file mode 100644
index 78bbbba6a..000000000
--- a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestRunnerTestFoundMessageHandler.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using Microsoft.Extensions.Testing.Abstractions;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class TestRunnerTestFoundMessageHandler : TestRunnerResultMessageHandler
- {
- public TestRunnerTestFoundMessageHandler(IReportingChannel adapterChannel)
- : base(adapterChannel, DotnetTestState.TestDiscoveryStarted, TestMessageTypes.TestDiscoveryTestFound)
- {
- }
-
- protected override bool CanHandleMessage(IDotnetTest dotnetTest, Message message)
- {
- return dotnetTest.State == DotnetTestState.TestDiscoveryStarted &&
- message.MessageType == TestMessageTypes.TestRunnerTestFound;
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestRunnerTestResultMessageHandler.cs b/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestRunnerTestResultMessageHandler.cs
deleted file mode 100644
index 78bcb4a32..000000000
--- a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestRunnerTestResultMessageHandler.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using Microsoft.Extensions.Testing.Abstractions;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class TestRunnerTestResultMessageHandler : TestRunnerResultMessageHandler
- {
- public TestRunnerTestResultMessageHandler(IReportingChannel adapterChannel)
- : base(adapterChannel, DotnetTestState.TestExecutionStarted, TestMessageTypes.TestExecutionTestResult)
- {
- }
-
- protected override bool CanHandleMessage(IDotnetTest dotnetTest, Message message)
- {
- return dotnetTest.State == DotnetTestState.TestExecutionStarted &&
- message.MessageType == TestMessageTypes.TestRunnerTestResult;
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestRunnerTestStartedMessageHandler.cs b/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestRunnerTestStartedMessageHandler.cs
deleted file mode 100644
index ac08ebc6c..000000000
--- a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestRunnerTestStartedMessageHandler.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using Microsoft.Extensions.Testing.Abstractions;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class TestRunnerTestStartedMessageHandler : TestRunnerResultMessageHandler
- {
- public TestRunnerTestStartedMessageHandler(IReportingChannel adapterChannel)
- : base(adapterChannel, DotnetTestState.TestExecutionStarted, TestMessageTypes.TestExecutionStarted)
- {
- }
-
- protected override bool CanHandleMessage(IDotnetTest dotnetTest, Message message)
- {
- return IsAtAnAcceptableState(dotnetTest) &&
- message.MessageType == TestMessageTypes.TestRunnerTestStarted;
- }
-
- private static bool IsAtAnAcceptableState(IDotnetTest dotnetTest)
- {
- return dotnetTest.State == DotnetTestState.TestExecutionSentTestRunnerProcessStartInfo ||
- dotnetTest.State == DotnetTestState.TestExecutionStarted;
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestRunnerWaitingCommandMessageHandler.cs b/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestRunnerWaitingCommandMessageHandler.cs
deleted file mode 100644
index 8f05566be..000000000
--- a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestRunnerWaitingCommandMessageHandler.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Collections.Generic;
-using Microsoft.Extensions.Testing.Abstractions;
-using Newtonsoft.Json.Linq;
-using Microsoft.DotNet.Cli.Utils;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class TestRunnerWaitingCommandMessageHandler : IDotnetTestMessageHandler
- {
- private readonly IReportingChannelFactory _reportingChannelFactory;
- private IReportingChannel _testRunnerChannel;
-
- public TestRunnerWaitingCommandMessageHandler(IReportingChannelFactory reportingChannelFactory)
- {
- _reportingChannelFactory = reportingChannelFactory;
-
- _reportingChannelFactory.TestRunnerChannelCreated += OnTestRunnerChannelCreated;
- }
-
- public DotnetTestState HandleMessage(IDotnetTest dotnetTest, Message message)
- {
- var nextState = DotnetTestState.NoOp;
-
- if (CanHandleMessage(dotnetTest, message))
- {
- HandleMessage(dotnetTest);
- nextState = DotnetTestState.TestExecutionSentTestRunnerProcessStartInfo;
- }
-
- return nextState;
- }
-
- private void HandleMessage(IDotnetTest dotnetTest)
- {
- if (_testRunnerChannel == null)
- {
- const string errorMessage =
- "A test runner channel hasn't been created for TestRunnerWaitingCommandMessageHandler";
- throw new InvalidOperationException(errorMessage);
- }
-
- _testRunnerChannel.Send(new Message
- {
- MessageType = TestMessageTypes.TestRunnerExecute,
- Payload = JToken.FromObject(new RunTestsMessage
- {
- Tests = new List(dotnetTest.TestsToRun.OrEmptyIfNull())
- })
- });
- }
-
- private void OnTestRunnerChannelCreated(object sender, IReportingChannel testRunnerChannel)
- {
- if (_testRunnerChannel != null)
- {
- const string errorMessage = "TestRunnerWaitingCommandMessageHandler already has a test runner channel";
- throw new InvalidOperationException(errorMessage);
- }
-
- _testRunnerChannel = testRunnerChannel;
- }
-
- private static bool CanHandleMessage(IDotnetTest dotnetTest, Message message)
- {
- return dotnetTest.State == DotnetTestState.TestExecutionSentTestRunnerProcessStartInfo &&
- message.MessageType == TestMessageTypes.TestRunnerWaitingCommand;
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestSessionTerminateMessageHandler.cs b/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestSessionTerminateMessageHandler.cs
deleted file mode 100644
index 39d1dd381..000000000
--- a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/TestSessionTerminateMessageHandler.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using Microsoft.Extensions.Testing.Abstractions;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class TestSessionTerminateMessageHandler : IDotnetTestMessageHandler
- {
- private readonly ITestMessagesCollection _messages;
-
- public TestSessionTerminateMessageHandler(ITestMessagesCollection messages)
- {
- _messages = messages;
- }
-
- public DotnetTestState HandleMessage(IDotnetTest dotnetTest, Message message)
- {
- var nextState = DotnetTestState.NoOp;
-
- if (TestMessageTypes.TestSessionTerminate.Equals(message.MessageType))
- {
- nextState = DotnetTestState.Terminated;
- _messages.Drain();
- }
-
- return nextState;
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/UnknownMessageHandler.cs b/src/Microsoft.DotNet.Tools.Test/MessageHandlers/UnknownMessageHandler.cs
deleted file mode 100644
index d0ce66db1..000000000
--- a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/UnknownMessageHandler.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Diagnostics;
-using Microsoft.Extensions.Testing.Abstractions;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class UnknownMessageHandler : IDotnetTestMessageHandler
- {
- private readonly IReportingChannel _adapterChannel;
-
- public UnknownMessageHandler(IReportingChannel adapterChannel)
- {
- _adapterChannel = adapterChannel;
- }
-
- public DotnetTestState HandleMessage(IDotnetTest dotnetTest, Message message)
- {
- var error = $"No handler for message '{message.MessageType}' when at state '{dotnetTest.State}'";
-
- TestHostTracing.Source.TraceEvent(TraceEventType.Error, 0, error);
-
- _adapterChannel.SendError(error);
-
- throw new InvalidOperationException(error);
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/VersionCheckMessageHandler.cs b/src/Microsoft.DotNet.Tools.Test/MessageHandlers/VersionCheckMessageHandler.cs
deleted file mode 100644
index e6d458337..000000000
--- a/src/Microsoft.DotNet.Tools.Test/MessageHandlers/VersionCheckMessageHandler.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using Microsoft.Extensions.Testing.Abstractions;
-using Newtonsoft.Json.Linq;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class VersionCheckMessageHandler : IDotnetTestMessageHandler
- {
- private const int SupportedVersion = 1;
-
- private readonly IReportingChannel _adapterChannel;
-
- public VersionCheckMessageHandler(IReportingChannel adapterChannel)
- {
- _adapterChannel = adapterChannel;
- }
-
- public DotnetTestState HandleMessage(IDotnetTest dotnetTest, Message message)
- {
- var nextState = DotnetTestState.NoOp;
- if (CanHandleMessage(dotnetTest, message))
- {
- HandleMessage(message);
- nextState = DotnetTestState.VersionCheckCompleted;
- }
-
- return nextState;
- }
-
- private void HandleMessage(Message message)
- {
- var version = message.Payload?.ToObject().Version;
- TestHostTracing.Source.TraceInformation(
- "[ReportingChannel]: Requested Version: {0} - Using Version: {1}",
- version,
- SupportedVersion);
-
- _adapterChannel.Send(new Message
- {
- MessageType = TestMessageTypes.VersionCheck,
- Payload = JToken.FromObject(new ProtocolVersionMessage
- {
- Version = SupportedVersion,
- }),
- });
- }
-
- private static bool CanHandleMessage(IDotnetTest dotnetTest, Message message)
- {
- return dotnetTest.State == DotnetTestState.InitialState &&
- TestMessageTypes.VersionCheck.Equals(message.MessageType);
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/Microsoft.DotNet.Tools.Test.xproj b/src/Microsoft.DotNet.Tools.Test/Microsoft.DotNet.Tools.Test.xproj
deleted file mode 100644
index f429f9bf5..000000000
--- a/src/Microsoft.DotNet.Tools.Test/Microsoft.DotNet.Tools.Test.xproj
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
- 14.0
- $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
-
-
-
-
- 6D028154-5518-4A56-BAD6-938A90E5BCF6
- dotnet_test_console
- ..\..\artifacts\obj\$(MSBuildProjectName)
- ..\..\artifacts\bin
-
-
-
- 2.0
-
-
-
diff --git a/src/Microsoft.DotNet.Tools.Test/ProjectJsonTestRunnerDecorator.cs b/src/Microsoft.DotNet.Tools.Test/ProjectJsonTestRunnerDecorator.cs
deleted file mode 100644
index c103741a8..000000000
--- a/src/Microsoft.DotNet.Tools.Test/ProjectJsonTestRunnerDecorator.cs
+++ /dev/null
@@ -1,148 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.IO;
-using System.Linq;
-using Microsoft.DotNet.Cli;
-using Microsoft.DotNet.Cli.Utils;
-using Microsoft.DotNet.ProjectModel;
-using NuGet.Frameworks;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class ProjectJsonTestRunnerDecorator : IDotnetTestRunner
- {
- private readonly Func _nextRunner;
- private readonly TestProjectBuilder _testProjectBuilder;
-
- public ProjectJsonTestRunnerDecorator(
- Func nextRunner)
- {
- _nextRunner = nextRunner;
- _testProjectBuilder = new TestProjectBuilder();
- }
-
- public int RunTests(DotnetTestParams dotnetTestParams)
- {
- var projectPath = GetProjectPath(dotnetTestParams.ProjectOrAssemblyPath);
- var runtimeIdentifiers = !string.IsNullOrEmpty(dotnetTestParams.Runtime)
- ? new[] {dotnetTestParams.Runtime}
- : DotnetRuntimeIdentifiers.InferCurrentRuntimeIdentifiers(DotnetFiles.VersionFileObject);
- var exitCode = 0;
-
- // Create a workspace
- var workspace = new BuildWorkspace(ProjectReaderSettings.ReadFromEnvironment());
-
- if (dotnetTestParams.Framework != null)
- {
- var projectContext = workspace.GetProjectContext(projectPath, dotnetTestParams.Framework);
- if (projectContext == null)
- {
- Reporter.Error.WriteLine(
- $"Project '{projectPath}' does not support framework: {dotnetTestParams.UnparsedFramework}");
- return 1;
- }
- projectContext = workspace.GetRuntimeContext(projectContext, runtimeIdentifiers);
-
- exitCode = RunTests(projectContext, dotnetTestParams);
- }
- else
- {
- var summary = new Summary();
- var projectContexts = workspace.GetProjectContextCollection(projectPath)
- .EnsureValid(projectPath)
- .FrameworkOnlyContexts
- .Select(c => workspace.GetRuntimeContext(c, runtimeIdentifiers))
- .ToList();
-
- // Execute for all TFMs the project targets.
- foreach (var projectContext in projectContexts)
- {
- var result = RunTests(projectContext, dotnetTestParams);
- if (result == 0)
- {
- summary.Passed++;
- }
- else
- {
- summary.Failed++;
- if (exitCode == 0)
- {
- // If tests fail in more than one TFM, we'll have it use the result of the first one
- // as the exit code.
- exitCode = result;
- }
- }
- }
-
- summary.Print();
- }
-
- return exitCode;
- }
-
- private int RunTests(ProjectContext projectContext, DotnetTestParams dotnetTestParams)
- {
- var result = _testProjectBuilder.BuildTestProject(projectContext, dotnetTestParams);
-
- if (result == 0)
- {
- var commandFactory =
- new ProjectDependenciesCommandFactory(
- projectContext.TargetFramework,
- dotnetTestParams.Config,
- dotnetTestParams.Output,
- dotnetTestParams.BuildBasePath,
- projectContext.ProjectDirectory);
-
- var assemblyUnderTest = new AssemblyUnderTest(projectContext, dotnetTestParams);
-
- var framework = projectContext.TargetFramework;
-
- result = _nextRunner(commandFactory, assemblyUnderTest.Path, framework).RunTests(dotnetTestParams);
- }
-
- return result;
- }
-
- private static string GetProjectPath(string projectPath)
- {
- projectPath = projectPath ?? Directory.GetCurrentDirectory();
-
- if (!projectPath.EndsWith(Project.FileName))
- {
- projectPath = Path.Combine(projectPath, Project.FileName);
- }
-
- if (!File.Exists(projectPath))
- {
- throw new InvalidOperationException($"{projectPath} does not exist.");
- }
-
- return projectPath;
- }
-
- private class Summary
- {
- public int Passed { get; set; }
-
- public int Failed { get; set; }
-
- private int Total => Passed + Failed;
-
- public void Print()
- {
- var summaryMessage = $"SUMMARY: Total: {Total} targets, Passed: {Passed}, Failed: {Failed}.";
- if (Failed > 0)
- {
- Reporter.Error.WriteLine(summaryMessage.Red());
- }
- else
- {
- Reporter.Output.WriteLine(summaryMessage);
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Microsoft.DotNet.Tools.Test/Properties/AssemblyInfo.cs b/src/Microsoft.DotNet.Tools.Test/Properties/AssemblyInfo.cs
deleted file mode 100644
index f0993d023..000000000
--- a/src/Microsoft.DotNet.Tools.Test/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-[assembly: InternalsVisibleTo("dotnet-test.UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100039ac461fa5c82c7dd2557400c4fd4e9dcdf7ac47e3d572548c04cd4673e004916610f4ea5cbf86f2b1ca1cb824f2a7b3976afecfcf4eb72d9a899aa6786effa10c30399e6580ed848231fec48374e41b3acf8811931343fc2f73acf72dae745adbcb7063cc4b50550618383202875223fc75401351cd89c44bf9b50e7fa3796")]
diff --git a/src/Microsoft.DotNet.Tools.Test/README.md b/src/Microsoft.DotNet.Tools.Test/README.md
deleted file mode 100644
index a3b9dc64b..000000000
--- a/src/Microsoft.DotNet.Tools.Test/README.md
+++ /dev/null
@@ -1,104 +0,0 @@
-% DOTNET-TEST(1)
-% Microsoft Corporation dotnetclifeedback@microsoft.com
-% April 2016
-
-## NAME
-
-`dotnet-test` - Runs unit tests using the configured test runner
-
-## SYNOPSIS
-
-`dotnet test [--configuration]
- [--output] [--build-base-path] [--framework] [--runtime]
- [--no-build]
- [--parentProcessId] [--port]
- []`
-
-## DESCRIPTION
-
-The `dotnet test` command is used to execute unit tests in a given project. Unit tests are class library
-projects that have dependencies on the unit test framework (for example, NUnit or xUnit) and the
-dotnet test runner for that unit testing framework.
-These are packaged as NuGet packages and are restored as ordinary dependencies for the project.
-
-Test projects also need to specify a test runner property in project.json using the "testRunner" node.
-This value should contain the name of the unit test framework.
-
-The following sample project.json shows the properties needed:
-
-```json
-{
- "version": "1.0.0-*",
-
- "dependencies": {
- "Microsoft.NETCore.App": {
- "version": "1.0.0-rc2-3002702",
- "type": "platform"
- },
- "xunit": "2.1.0",
- "dotnet-test-xunit": "1.0.0-rc2-build10015"
- },
- "testRunner": "xunit",
-
- "frameworks": {
- "netcoreapp1.0": {
- "imports": [
- "dnxcore50",
- "portable-net45+win8"
- ]
- }
- }
-}
-```
-`dotnet test` supports two running modes:
-
-1. Console: In console mode, `dotnet test` simply executes fully any command gets passed to it and outputs the results. Anytime you invoke `dotnet test` without passing --port, it runs in console mode, which in turn will cause the runner to run in console mode.
-2. Design time: used in the context of other tools, such as editors or Integrated Development Environments (IDEs). You can find out more about this mode in the [dotnet-test protocol](../../../../Documentation/dotnet-test-protocol.md) document.
-
-## OPTIONS
-
-`[project]`
-
-Specifies a path to the test project. If omitted, it defaults to current directory.
-
-`-c`, `--configuration` [Debug|Release]
-
-Configuration under which to build. The default value is Release.
-
-`-o`, `--output` [DIR]
-
-Directory in which to find binaries to run.
-
-`-b`, `--build-base-path` [DIR]
-
-Directory in which to place temporary outputs.
-
-`-f`, `--framework` [FRAMEWORK]
-
-Looks for test binaries for a specific framework.
-
-`-r`, `--runtime` [RUNTIME_IDENTIFIER]
-
-Look for test binaries for a for the specified runtime.
-
-`--no-build`
-
-Does not build the test project prior to running it.
-
---parentProcessId
-
-Used by IDEs to specify their process ID. Test will exit if the parent process does.
-
-`--port`
-
-Used by IDEs to specify a port number to listen for a connection.
-
-## EXAMPLES
-
-`dotnet test`
-
-Runs the tests in the project in the current directory.
-
-`dotnet test /projects/test1/project.json`
-
-Runs the tests in the test1 project.
diff --git a/src/Microsoft.DotNet.Tools.Test/ReportingChannels/AdapterReportingChannel.cs b/src/Microsoft.DotNet.Tools.Test/ReportingChannels/AdapterReportingChannel.cs
deleted file mode 100644
index 1bf9ffb21..000000000
--- a/src/Microsoft.DotNet.Tools.Test/ReportingChannels/AdapterReportingChannel.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using Microsoft.Extensions.Testing.Abstractions;
-using System.Net;
-using System.Net.Sockets;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class AdapterReportingChannel : ReportingChannel
- {
- private readonly IPEndPoint _ipEndPoint;
-
- public static AdapterReportingChannel ConnectTo(int port)
- {
- var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-
- var ipEndPoint = new IPEndPoint(IPAddress.Loopback, port);
-
- return new AdapterReportingChannel(socket, ipEndPoint);
- }
-
- private AdapterReportingChannel(Socket connectSocket, IPEndPoint ipEndPoint)
- : base(connectSocket, ipEndPoint.Port)
- {
- _ipEndPoint = ipEndPoint;
- }
-
- public override void Connect()
- {
- Socket = ConnectSocket;
-
- Socket.Connect(_ipEndPoint);
-
- StartReadingMessages();
-
- Send(new Message
- {
- MessageType = TestMessageTypes.TestSessionConnected
- });
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/ReportingChannels/IReportingChannel.cs b/src/Microsoft.DotNet.Tools.Test/ReportingChannels/IReportingChannel.cs
deleted file mode 100644
index 0729b4032..000000000
--- a/src/Microsoft.DotNet.Tools.Test/ReportingChannels/IReportingChannel.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Threading.Tasks;
-using Microsoft.Extensions.Testing.Abstractions;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public interface IReportingChannel : IDisposable
- {
- event EventHandler MessageReceived;
-
- int Port { get; }
-
- void Connect();
-
- void Send(Message message);
-
- void SendError(string error);
-
- void SendError(Exception ex);
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/ReportingChannels/IReportingChannelFactory.cs b/src/Microsoft.DotNet.Tools.Test/ReportingChannels/IReportingChannelFactory.cs
deleted file mode 100644
index 2f35fffd2..000000000
--- a/src/Microsoft.DotNet.Tools.Test/ReportingChannels/IReportingChannelFactory.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public interface IReportingChannelFactory
- {
- event EventHandler TestRunnerChannelCreated;
-
- IReportingChannel CreateTestRunnerChannel();
-
- IReportingChannel CreateAdapterChannel(int port);
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/ReportingChannels/ReportingChannel.cs b/src/Microsoft.DotNet.Tools.Test/ReportingChannels/ReportingChannel.cs
deleted file mode 100644
index 624e75c32..000000000
--- a/src/Microsoft.DotNet.Tools.Test/ReportingChannels/ReportingChannel.cs
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Diagnostics;
-using System.IO;
-using System.Net;
-using System.Net.Sockets;
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.Extensions.Testing.Abstractions;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public abstract class ReportingChannel : IReportingChannel
- {
- private BinaryWriter _writer;
- private BinaryReader _reader;
-
- protected ReportingChannel(Socket connectSocket, int port)
- {
- ConnectSocket = connectSocket;
- Port = port;
- }
-
- protected Socket Socket { get; set; }
-
- public event EventHandler MessageReceived;
-
- public Socket ConnectSocket { get; }
-
- public int Port { get; }
-
- public abstract void Connect();
-
- public void Send(Message message)
- {
- lock (_writer)
- {
- try
- {
- TestHostTracing.Source.TraceEvent(
- TraceEventType.Verbose,
- 0,
- "[ReportingChannel]: Send({0})",
- message);
-
- _writer.Write(JsonConvert.SerializeObject(message));
- }
- catch (Exception ex)
- {
- TestHostTracing.Source.TraceEvent(
- TraceEventType.Error,
- 0,
- "[ReportingChannel]: Error sending {0}",
- ex);
- throw;
- }
- }
- }
-
- public void SendError(string error)
- {
- Send(new Message()
- {
- MessageType = "Error",
- Payload = JToken.FromObject(new ErrorMessage()
- {
- Message = error,
- }),
- });
- }
-
- public void SendError(Exception ex)
- {
- SendError(ex.ToString());
- }
-
- protected void StartReadingMessages()
- {
- var stream = new NetworkStream(Socket);
- _writer = new BinaryWriter(stream);
- _reader = new BinaryReader(stream);
-
- // Read incoming messages on the background thread
- new Thread(ReadMessages) { IsBackground = true }.Start();
- }
-
- private void ReadMessages()
- {
- while (true)
- {
- try
- {
- var rawMessage = _reader.ReadString();
- var message = JsonConvert.DeserializeObject(rawMessage);
-
- MessageReceived?.Invoke(this, message);
-
- if (ShouldStopListening(message))
- {
- break;
- }
- }
- catch (Exception ex)
- {
- TestHostTracing.Source.TraceEvent(
- TraceEventType.Error,
- 0,
- "[ReportingChannel]: Waiting for message failed {0}",
- ex);
- throw;
- }
- }
- }
-
- private static bool ShouldStopListening(Message message)
- {
- return message.MessageType == TestMessageTypes.TestRunnerTestCompleted ||
- message.MessageType == TestMessageTypes.TestSessionTerminate;
- }
-
- public void Dispose()
- {
- Socket?.Dispose();
- }
- }
-}
\ No newline at end of file
diff --git a/src/Microsoft.DotNet.Tools.Test/ReportingChannels/ReportingChannelFactory.cs b/src/Microsoft.DotNet.Tools.Test/ReportingChannels/ReportingChannelFactory.cs
deleted file mode 100644
index 0ecec58c6..000000000
--- a/src/Microsoft.DotNet.Tools.Test/ReportingChannels/ReportingChannelFactory.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class ReportingChannelFactory : IReportingChannelFactory
- {
- public event EventHandler TestRunnerChannelCreated;
-
- public IReportingChannel CreateTestRunnerChannel()
- {
- var testRunnerChannel = TestRunnerReportingChannel.ListenOn(0);
-
- TestRunnerChannelCreated?.Invoke(this, testRunnerChannel);
-
- return testRunnerChannel;
- }
-
- public IReportingChannel CreateAdapterChannel(int port)
- {
- return AdapterReportingChannel.ConnectTo(port);
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/ReportingChannels/TestRunnerReportingChannel.cs b/src/Microsoft.DotNet.Tools.Test/ReportingChannels/TestRunnerReportingChannel.cs
deleted file mode 100644
index 204988441..000000000
--- a/src/Microsoft.DotNet.Tools.Test/ReportingChannels/TestRunnerReportingChannel.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.Net;
-using System.Net.Sockets;
-using System.Threading;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class TestRunnerReportingChannel : ReportingChannel
- {
- public static ReportingChannel ListenOn(int port)
- {
- // This fixes the mono incompatibility but ties it to ipv4 connections
- var listenSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-
- listenSocket.Bind(new IPEndPoint(IPAddress.Loopback, port));
- listenSocket.Listen(10);
-
- return new TestRunnerReportingChannel(listenSocket, ((IPEndPoint)listenSocket.LocalEndPoint));
- }
-
- private TestRunnerReportingChannel(Socket connectSocket, IPEndPoint ipEndPoint)
- : base(connectSocket, ipEndPoint.Port)
- {
- }
-
- public override void Connect()
- {
- new Thread(() =>
- {
- using (ConnectSocket)
- {
- Socket = ConnectSocket.Accept();
-
- StartReadingMessages();
- }
- })
- { IsBackground = true }.Start();
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/TestCommand.cs b/src/Microsoft.DotNet.Tools.Test/TestCommand.cs
deleted file mode 100644
index 8d40829a0..000000000
--- a/src/Microsoft.DotNet.Tools.Test/TestCommand.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using Microsoft.DotNet.Cli.Utils;
-using Microsoft.DotNet.InternalAbstractions;
-using Microsoft.DotNet.ProjectModel;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class TestCommand
- {
- private readonly IDotnetTestRunnerFactory _dotnetTestRunnerFactory;
-
- public static int Run(string[] args)
- {
- var dotnetTestRunnerResolverFactory = new DotnetTestRunnerResolverFactory(new ProjectReader());
- var testCommand = new TestCommand(new DotnetTestRunnerFactory(dotnetTestRunnerResolverFactory));
-
- return testCommand.DoRun(args);
- }
-
- public TestCommand(IDotnetTestRunnerFactory testRunnerFactory)
- {
- _dotnetTestRunnerFactory = testRunnerFactory;
- }
-
- public int DoRun(string[] args)
- {
- DebugHelper.HandleDebugSwitch(ref args);
-
- var dotnetTestParams = new DotnetTestParams();
-
- try
- {
- dotnetTestParams.Parse(args);
-
- if (dotnetTestParams.Help)
- {
- return 0;
- }
-
- // Register for parent process's exit event
- if (dotnetTestParams.ParentProcessId.HasValue)
- {
- RegisterForParentProcessExit(dotnetTestParams.ParentProcessId.Value);
- }
-
- return RunTest(dotnetTestParams);
- }
- catch (InvalidOperationException ex)
- {
- TestHostTracing.Source.TraceEvent(TraceEventType.Error, 0, ex.ToString());
- return -1;
- }
- catch (Exception ex) when (!(ex is GracefulException))
- {
- Console.WriteLine(ex.ToString());
- TestHostTracing.Source.TraceEvent(TraceEventType.Error, 0, ex.ToString());
- return -2;
- }
- }
-
- private static void RegisterForParentProcessExit(int id)
- {
- var parentProcess = Process.GetProcesses().FirstOrDefault(p => p.Id == id);
-
- if (parentProcess != null)
- {
- parentProcess.EnableRaisingEvents = true;
- parentProcess.Exited += (sender, eventArgs) =>
- {
- TestHostTracing.Source.TraceEvent(
- TraceEventType.Information,
- 0,
- "Killing the current process as parent process has exited.");
-
- Process.GetCurrentProcess().Kill();
- };
- }
- else
- {
- TestHostTracing.Source.TraceEvent(
- TraceEventType.Information,
- 0,
- "Failed to register for parent process's exit event. " +
- $"Parent process with id '{id}' was not found.");
- }
- }
-
- private int RunTest(DotnetTestParams dotnetTestParams)
- {
- var dotnetTestRunner = _dotnetTestRunnerFactory.Create(dotnetTestParams);
- return dotnetTestRunner.RunTests(dotnetTestParams);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Microsoft.DotNet.Tools.Test/TestHostTracing.cs b/src/Microsoft.DotNet.Tools.Test/TestHostTracing.cs
deleted file mode 100644
index 44299586b..000000000
--- a/src/Microsoft.DotNet.Tools.Test/TestHostTracing.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System;
-using System.Diagnostics;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public static class TestHostTracing
- {
- public static readonly string TracingEnvironmentVariable = "DOTNET_TEST_TRACE";
-
- public static readonly TraceSource Source;
-
- static TestHostTracing()
- {
- Source = Environment.GetEnvironmentVariable(TracingEnvironmentVariable) == "1"
- ? new TraceSource("dotnet-test", SourceLevels.Verbose)
- : new TraceSource("dotnet-test", SourceLevels.Warning);
-
- Source.Listeners.Add(new TextWriterTraceListener(Console.Error));
- }
-
- public static void ClearListeners()
- {
- Source.Listeners.Clear();
- }
- }
-}
diff --git a/src/Microsoft.DotNet.Tools.Test/TestMessagesCollection.cs b/src/Microsoft.DotNet.Tools.Test/TestMessagesCollection.cs
deleted file mode 100644
index d803f4a81..000000000
--- a/src/Microsoft.DotNet.Tools.Test/TestMessagesCollection.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright (c) .NET Foundation and contributors. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-using System.Collections.Concurrent;
-using System.Diagnostics;
-using System.Threading;
-using Microsoft.Extensions.Testing.Abstractions;
-using System;
-
-namespace Microsoft.DotNet.Tools.Test
-{
- public class TestMessagesCollection : ITestMessagesCollection
- {
- private readonly ManualResetEventSlim _terminateWaitHandle;
- private readonly BlockingCollection