diff --git a/.cliversion b/.cliversion deleted file mode 100644 index 36471cf6b..000000000 --- a/.cliversion +++ /dev/null @@ -1 +0,0 @@ -1.0.0-preview2-1-003177 diff --git a/.toolversions b/.toolversions deleted file mode 100644 index d7f7f5ac7..000000000 --- a/.toolversions +++ /dev/null @@ -1,2 +0,0 @@ -microsoft.dotnet.buildtools=1.0.27-prerelease-01316-08 -microsoft.dotnet.buildtools.run=1.0.0-prerelease-00807-04 \ No newline at end of file diff --git a/Documentation/general/tab-completion.md b/Documentation/general/tab-completion.md new file mode 100644 index 000000000..bf6fefaa3 --- /dev/null +++ b/Documentation/general/tab-completion.md @@ -0,0 +1,71 @@ +# .NET CLI Tab Completion + +In version 2.0 of the .NET Core CLI, we have added support for providing suggestions when you press `tab`. While it's not yet enabled by default, you can try it out today by installing a [preview build](https://github.com/dotnet/cli#installers-and-binaries) from the master branch or by building from source. + +Here are some examples of what it provides: + +Input | becomes | because +:------------------------------------|:----------------------------------------------------------------------------|:-------------------------------- +`dotnet a⇥` | `dotnet add` | `add` is the first subcommand, alphabetically. +`dotnet add p⇥` | `dotnet add --help` | it matches substrings and `--help` comes first alphabetically. +`dotnet add p⇥⇥` | `dotnet add package` | pressing tab a second time brings up the next suggestion. +`dotnet add package Microsoft⇥` | `dotnet add package Microsoft.ApplicationInsights.Web` | results are returned alphabetically. +`dotnet remove reference ⇥` | `dotnet remove reference ..\..\src\OmniSharp.DotNet\OmniSharp.DotNet.csproj` | it is project file aware. + +## How to enable it + +Tab completion is currently supported in three shells: PowerShell, bash, and zsh. These scripts assume that `dotnet` v2.0 is on your path. You can verify that you have the correct version of `dotnet` on your path by trying out the new `complete` command directly: + +``` +[04/26/2017 11:38:20] C:\ +> dotnet complete "dotnet add p" +``` + +If you just installed `dotnet` you may see the first-run output: + +``` +Welcome to .NET Core! +--------------------- +Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. + +Telemetry +-------------- +The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. +You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. +You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry. + +Configuring... +------------------- +A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once. +Decompressing 100% 4936 ms +Expanding 100% 17195 ms +``` + +You should see the following ouput (perhaps coming at the end of the first-run output). This indicates that `dotnet` is resolving to a v2.0 installation that supports completion. + +``` +--help +package +``` + +### PowerShell + +To enable tab completion in PowerShell, edit your PowerShell profile: + +``` +notepad $PROFILE +``` + +Add the contents of [register-completions.ps1](https://github.com/dotnet/cli/blob/master/scripts/register-completions.ps1) to this file and save. + +### bash + +To enable tab completion in bash, edit your `.bashrc` file to add the contents of [register-completions.bash](https://github.com/dotnet/cli/blob/master/scripts/register-completions.bash). + +### zsh + +To enable tab completion in zsh, edit your `.zshrc` file to add the contents of [register-completions.zsh](https://github.com/dotnet/cli/blob/master/scripts/register-completions.zsh). + +## How it works + +Each of these scripts provides a hook for completions for its respective shell. The logic that determines which suggestions to provide is in the CLI itself, configured using [our new parser](https://github.com/dotnet/CliCommandLineParser). You can see a code example [here](https://github.com/dotnet/cli/blob/master/src/dotnet/commands/dotnet-add/dotnet-add-package/AddPackageParser.cs#L23). diff --git a/Documentation/project-docs/developer-guide.md b/Documentation/project-docs/developer-guide.md index 5a03554d7..0391adefa 100644 --- a/Documentation/project-docs/developer-guide.md +++ b/Documentation/project-docs/developer-guide.md @@ -35,8 +35,8 @@ Using the `dotnet` built in the previous step: 1. `cd {new directory}` 2. `dotnet new` -3. `dotnet restore3` -4. `dotnet run3` +3. `dotnet restore` +4. `dotnet run` ## Running tests diff --git a/Documentation/specs/cli-installation-scenarios.md b/Documentation/specs/cli-installation-scenarios.md index d9e1a8187..b547116cd 100644 --- a/Documentation/specs/cli-installation-scenarios.md +++ b/Documentation/specs/cli-installation-scenarios.md @@ -80,21 +80,21 @@ This, however, does have one specific constraint: **newer versions must be insta ## Layout on disk ``` / (%PATH%) - dotnet ("muxer", has platform dependant file extension) + dotnet ("muxer", has platform dependant file extension) hostfxr (implementation detail for "muxer", platform dependant file extension) - sdk/ + sdk/ / (i.e. "1.0.0-rc2-002543") ... (binaries like: dotnet.dll, csc.dll) / ... (binaries) ... - shared/ ("redist" or "shared framework") + shared/ ("redist" or "shared framework") / (currently only "Microsoft.NETCore.App") - / (i.e. "1.0.0-rc2-3002543") + / (i.e. "1.0.0-rc2-3002543") ... (binaries like: coreclr.dll, mscorlib.ni.dll, System.*.dll, dotnet-hostimpl.dll, dotnet, netcoreapp.deps.json) - / - ... (binaries) -``` + / + ... (binaries) +``` ## Native dependencies .NET Core CLI is built on top of CoreFX and CoreCLR and as such its' dependencies set is defined by the platform that those two combine. Whether or not those dependencies will be installed depends on the installer being used. The table below lists out the installers and whether or not they bring in dependencies. diff --git a/Microsoft.DotNet.Cli.sln b/Microsoft.DotNet.Cli.sln index 08da39cfa..f1fed5401 100644 --- a/Microsoft.DotNet.Cli.sln +++ b/Microsoft.DotNet.Cli.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26228.9 +VisualStudioVersion = 15.0.26419.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{ED2FE3E2-F7E7-4389-8231-B65123F2076F}" EndProject @@ -52,7 +52,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4 build\Package.targets = build\Package.targets build\Prepare.targets = build\Prepare.targets build\Publish.targets = build\Publish.targets - build\Run.targets = build\Run.targets build\sdks\sdks.csproj = build\sdks\sdks.csproj build\Signing.proj = build\Signing.proj build\Stage0.props = build\Stage0.props @@ -140,8 +139,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Configurer EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.InternalAbstractions", "src\Microsoft.DotNet.InternalAbstractions\Microsoft.DotNet.InternalAbstractions.csproj", "{570950AD-A080-4F32-980C-F50E312910DF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.ProjectJsonMigration", "src\Microsoft.DotNet.ProjectJsonMigration\Microsoft.DotNet.ProjectJsonMigration.csproj", "{A8E6EFEB-027A-4C4B-A73C-C193A0F00569}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.TestFramework", "src\Microsoft.DotNet.TestFramework\Microsoft.DotNet.TestFramework.csproj", "{6592A22C-2386-4E83-A4D3-FC08075C723A}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "redist", "src\redist\redist.csproj", "{098D9321-1201-4974-A75E-F58EBCD98ACF}" @@ -166,7 +163,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet.Tests", "test\dotnet EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-build.Tests", "test\dotnet-build.Tests\dotnet-build.Tests.csproj", "{BBB5A4C8-CD2D-4A6A-9159-0FEAF84B745E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dotnet-help.Tests", "test\dotnet-help.Tests\dotnet-help.Tests.csproj", "{8AA88E83-6A98-4AD6-86EB-2ED4F6EDA17F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-help.Tests", "test\dotnet-help.Tests\dotnet-help.Tests.csproj", "{8AA88E83-6A98-4AD6-86EB-2ED4F6EDA17F}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-migrate.Tests", "test\dotnet-migrate.Tests\dotnet-migrate.Tests.csproj", "{726D2CB9-80E5-4496-9C86-910AC452C45E}" EndProject @@ -194,8 +191,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Cli.Utils. EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Configurer.UnitTests", "test\Microsoft.DotNet.Configurer.UnitTests\Microsoft.DotNet.Configurer.UnitTests.csproj", "{F228580D-9373-4A60-AB88-76DF58D11580}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.ProjectJsonMigration.Tests", "test\Microsoft.DotNet.ProjectJsonMigration.Tests\Microsoft.DotNet.ProjectJsonMigration.Tests.csproj", "{53F4CC00-72B3-4049-8888-FC05F622A9AC}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Tools.Tests.Utilities", "test\Microsoft.DotNet.Tools.Tests.Utilities\Microsoft.DotNet.Tools.Tests.Utilities.csproj", "{48E260F4-6F3F-4387-B61F-D15BABD06D9A}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "msbuild.IntegrationTests", "test\msbuild.IntegrationTests\msbuild.IntegrationTests.csproj", "{23EE9BBB-3B33-4CF2-8D1A-29A8DB12E878}" @@ -228,6 +223,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-back-compat.Tests", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-outputsframeworkversion-netcoreapp1.0", "TestAssets\TestPackages\dotnet-outputsframeworkversion\dotnet-outputsframeworkversion-netcoreapp1.0\dotnet-outputsframeworkversion-netcoreapp1.0.csproj", "{3F7D56A3-A280-467E-8916-C18659C243BA}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-remove-package.Tests", "test\dotnet-remove-package.Tests\dotnet-remove-package.Tests.csproj", "{B1AEC227-5115-44BC-92D2-B1B3545E1DDE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-add-package.Tests", "test\dotnet-add-package.Tests\dotnet-add-package.Tests.csproj", "{08A40B6A-F695-4EA9-AC8D-CF88FADEA796}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -652,30 +651,6 @@ Global {570950AD-A080-4F32-980C-F50E312910DF}.RelWithDebInfo|x64.Build.0 = Release|Any CPU {570950AD-A080-4F32-980C-F50E312910DF}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU {570950AD-A080-4F32-980C-F50E312910DF}.RelWithDebInfo|x86.Build.0 = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.Debug|x64.ActiveCfg = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.Debug|x64.Build.0 = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.Debug|x86.ActiveCfg = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.Debug|x86.Build.0 = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.MinSizeRel|Any CPU.ActiveCfg = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.MinSizeRel|Any CPU.Build.0 = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.MinSizeRel|x64.ActiveCfg = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.MinSizeRel|x64.Build.0 = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.MinSizeRel|x86.ActiveCfg = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.MinSizeRel|x86.Build.0 = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.Release|Any CPU.Build.0 = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.Release|x64.ActiveCfg = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.Release|x64.Build.0 = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.Release|x86.ActiveCfg = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.Release|x86.Build.0 = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.RelWithDebInfo|x64.Build.0 = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569}.RelWithDebInfo|x86.Build.0 = Release|Any CPU {6592A22C-2386-4E83-A4D3-FC08075C723A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6592A22C-2386-4E83-A4D3-FC08075C723A}.Debug|Any CPU.Build.0 = Debug|Any CPU {6592A22C-2386-4E83-A4D3-FC08075C723A}.Debug|x64.ActiveCfg = Release|Any CPU @@ -1300,30 +1275,6 @@ Global {F228580D-9373-4A60-AB88-76DF58D11580}.RelWithDebInfo|x64.Build.0 = Release|Any CPU {F228580D-9373-4A60-AB88-76DF58D11580}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU {F228580D-9373-4A60-AB88-76DF58D11580}.RelWithDebInfo|x86.Build.0 = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.Debug|x64.ActiveCfg = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.Debug|x64.Build.0 = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.Debug|x86.ActiveCfg = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.Debug|x86.Build.0 = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.MinSizeRel|Any CPU.ActiveCfg = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.MinSizeRel|Any CPU.Build.0 = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.MinSizeRel|x64.ActiveCfg = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.MinSizeRel|x64.Build.0 = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.MinSizeRel|x86.ActiveCfg = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.MinSizeRel|x86.Build.0 = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.Release|Any CPU.Build.0 = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.Release|x64.ActiveCfg = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.Release|x64.Build.0 = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.Release|x86.ActiveCfg = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.Release|x86.Build.0 = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.RelWithDebInfo|x64.Build.0 = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU - {53F4CC00-72B3-4049-8888-FC05F622A9AC}.RelWithDebInfo|x86.Build.0 = Release|Any CPU {48E260F4-6F3F-4387-B61F-D15BABD06D9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {48E260F4-6F3F-4387-B61F-D15BABD06D9A}.Debug|Any CPU.Build.0 = Debug|Any CPU {48E260F4-6F3F-4387-B61F-D15BABD06D9A}.Debug|x64.ActiveCfg = Release|Any CPU @@ -1588,6 +1539,54 @@ Global {3F7D56A3-A280-467E-8916-C18659C243BA}.RelWithDebInfo|x64.Build.0 = Release|Any CPU {3F7D56A3-A280-467E-8916-C18659C243BA}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU {3F7D56A3-A280-467E-8916-C18659C243BA}.RelWithDebInfo|x86.Build.0 = Release|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.Debug|x64.ActiveCfg = Debug|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.Debug|x64.Build.0 = Debug|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.Debug|x86.ActiveCfg = Debug|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.Debug|x86.Build.0 = Debug|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.MinSizeRel|x86.ActiveCfg = Debug|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.MinSizeRel|x86.Build.0 = Debug|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.Release|Any CPU.Build.0 = Release|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.Release|x64.ActiveCfg = Release|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.Release|x64.Build.0 = Release|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.Release|x86.ActiveCfg = Release|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.Release|x86.Build.0 = Release|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.RelWithDebInfo|x64.Build.0 = Release|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE}.RelWithDebInfo|x86.Build.0 = Release|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.Debug|Any CPU.Build.0 = Debug|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.Debug|x64.ActiveCfg = Debug|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.Debug|x64.Build.0 = Debug|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.Debug|x86.ActiveCfg = Debug|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.Debug|x86.Build.0 = Debug|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.MinSizeRel|x86.ActiveCfg = Debug|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.MinSizeRel|x86.Build.0 = Debug|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.Release|Any CPU.ActiveCfg = Release|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.Release|Any CPU.Build.0 = Release|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.Release|x64.ActiveCfg = Release|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.Release|x64.Build.0 = Release|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.Release|x86.ActiveCfg = Release|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.Release|x86.Build.0 = Release|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.RelWithDebInfo|x64.Build.0 = Release|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796}.RelWithDebInfo|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1618,7 +1617,6 @@ Global {73ACEB34-D22C-43EA-87BE-EFC0E83D0126} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {ABB81DAE-0D26-483C-BE3B-0F9ACD812A62} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {570950AD-A080-4F32-980C-F50E312910DF} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} - {A8E6EFEB-027A-4C4B-A73C-C193A0F00569} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {6592A22C-2386-4E83-A4D3-FC08075C723A} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {098D9321-1201-4974-A75E-F58EBCD98ACF} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} @@ -1644,7 +1642,6 @@ Global {7F115EF9-1827-4175-B50E-F214A490093E} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} {FC9A1FF2-86AC-4DBE-B045-1A8EE6E9B3F3} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} {F228580D-9373-4A60-AB88-76DF58D11580} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} - {53F4CC00-72B3-4049-8888-FC05F622A9AC} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} {48E260F4-6F3F-4387-B61F-D15BABD06D9A} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} {23EE9BBB-3B33-4CF2-8D1A-29A8DB12E878} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} {F5E27BA5-063B-4770-A6E8-87252E9AB22C} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} @@ -1658,5 +1655,7 @@ Global {DE4D1AEB-871B-4E7C-945A-453F9A490C06} = {89905EC4-BC0F-443B-8ADF-691321F10108} {A4C198B4-D46E-4CA8-87DF-B2B206DCCAE6} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} {3F7D56A3-A280-467E-8916-C18659C243BA} = {1AB5B24B-B317-4142-A5D1-A6E84F15BA34} + {B1AEC227-5115-44BC-92D2-B1B3545E1DDE} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} + {08A40B6A-F695-4EA9-AC8D-CF88FADEA796} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} EndGlobalSection EndGlobal diff --git a/NuGet.Config b/NuGet.Config index 120a5daf6..fc37b121d 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -6,12 +6,14 @@ - + + + diff --git a/README.md b/README.md index 185f4c5c7..8b62f921f 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,12 @@ Looking for V1 of the .NET Core tooling? If you are looking for the v1.0.1 release of the .NET Core tools (CLI, MSBuild and the new csproj), head over to https://dot.net/core and download! -> **Note:** the release/2.0.0 branch of the CLI repo is based on the upcoming v2 of .NET Core and is considered pre-release. For production-level usage, please use the +> **Note:** the master branch of the CLI repo is based on the upcoming v2 of .NET Core and is considered pre-release. For production-level usage, please use the > v1 of the tools. Found an issue? --------------- -You can consult the [known issues page](https://github.com/dotnet/core/blob/release/2.0.0/cli/known-issues.md) to find out the current issues and to see the workarounds. +You can consult the [known issues page](https://github.com/dotnet/core/blob/master/cli/known-issues.md) to find out the current issues and to see the workarounds. If you don't find your issue, please file one! However, given that this is a very high-frequency repo, we've setup some [basic guidelines](Documentation/project-docs/issue-filing-guide.md) to help you. Please consult those first. @@ -23,9 +23,9 @@ This project has adopted the code of conduct defined by the [Contributor Covenan Build Status ------------ -|Ubuntu 14.04 / Linux Mint 17 |Ubuntu 16.04 |Debian 8.2 |Windows x64 |Windows x86 |macOS |CentOS 7.1 / Oracle Linux 7.1 |RHEL 7.2 | Linux x64 | +|Ubuntu 14.04 / Linux Mint 17 |Ubuntu 16.04 |Debian 8 |Windows x64 |Windows x86 |macOS |CentOS 7.1 / Oracle Linux 7.1 |RHEL 7.2 | Linux x64 | |:------:|:------:|:------:|:------:|:------:|:------:|:------:|:------:|:------:| -|[![][ubuntu-14.04-build-badge]][ubuntu-14.04-build]|[![][ubuntu-16.04-build-badge]][ubuntu-16.04-build]|[![][debian-8.2-build-badge]][debian-8.2-build]|[![][win-x64-build-badge]][win-x64-build]|[![][win-x86-build-badge]][win-x86-build]|[![][osx-build-badge]][osx-build]|[![][centos-build-badge]][centos-build]|[![][rhel-build-badge]][rhel-build]|[![][linux-build-badge]][linux-build]| +|[![][ubuntu-14.04-build-badge]][ubuntu-14.04-build]|[![][ubuntu-16.04-build-badge]][ubuntu-16.04-build]|[![][debian-8-build-badge]][debian-8-build]|[![][win-x64-build-badge]][win-x64-build]|[![][win-x86-build-badge]][win-x86-build]|[![][osx-build-badge]][osx-build]|[![][centos-build-badge]][centos-build]|[![][rhel-build-badge]][rhel-build]|[![][linux-build-badge]][linux-build]| [win-x64-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/5449/badge [win-x64-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=5449 @@ -39,8 +39,8 @@ Build Status [ubuntu-16.04-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/5448/badge [ubuntu-16.04-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=5448 -[debian-8.2-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/5442/badge -[debian-8.2-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=5442 +[debian-8-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/5442/badge +[debian-8-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=5442 [osx-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/5445/badge [osx-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=5445 @@ -64,13 +64,13 @@ In order to download just the .NET Core runtime without the SDK, please visit ht > **Note:** please be aware that below installers are the **latest bits**. If you > want to install the latest released versions, please check out the [section above](#looking-for-v1-of-the-net-core-tooling). -| Platform | release/2.0.0
[![][version-badge]][version] | +| Platform | master
[![][version-badge]][version] | | -------- | :-------------------------------------: | | **Windows x64** | [Installer][win-x64-installer] - [Checksum][win-x64-installer-checksum]
[zip][win-x64-zip] - [Checksum][win-x64-zip-checksum] | | **Windows x86** | [Installer][win-x86-installer] - [Checksum][win-x86-installer-checksum]
[zip][win-x86-zip] - [Checksum][win-x86-zip-checksum] | | **Ubuntu 14.04 / Linux Mint 17** | [Installer][ubuntu-14.04-installer] - [Checksum][ubuntu-14.04-installer-checksum]
*See Installer Note Below
[tar.gz][ubuntu-14.04-targz] - [Checksum][ubuntu-14.04-targz-checksum] | | **Ubuntu 16.04** | [tar.gz][ubuntu-16.04-targz] - [Checksum][ubuntu-16.04-targz-checksum] | -| **Debian 8.2** | [tar.gz][debian-8.2-targz] - [Checksum][debian-8.2-targz-checksum] | +| **Debian 8** | [tar.gz][debian-8-targz] - [Checksum][debian-8-targz-checksum] | | **macOS** | [Installer][osx-installer] - [Checksum][osx-installer-checksum]
[tar.gz][osx-targz] - [Checksum][osx-targz-checksum] | | **CentOS 7.1 / Oracle Linux 7** | [tar.gz][centos-targz] - [Checksum][centos-targz-checksum] | | **RHEL 7.2** | [tar.gz][rhel-targz] - [Checksum][rhel-targz-checksum] | @@ -78,44 +78,44 @@ In order to download just the .NET Core runtime without the SDK, please visit ht *Note: Our Debian packages are put together slightly differently than the other OS specific installers. Instead of combining everything, we have separate component packages that depend on each other. If you're installing these directly from the .deb files (via dpkg or similar), then you'll need to install the [corresponding Host, Host FX Resolver, and Shared Framework packages](https://github.com/dotnet/core-setup#daily-builds) before installing the Sdk package.* -[version]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/2.0.0/latest.version +[version]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/latest.version [comment]: # (The latest versions are always the same across all platforms. Just need one to show, so picking win-x64's svg.) -[version-badge]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/2.0.0/win_x64_Release_version_badge.svg +[version-badge]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/win_x64_Release_version_badge.svg -[win-x64-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-win-x64.latest.exe -[win-x64-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-win-x64.latest.exe.sha -[win-x64-zip]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-win-x64.latest.zip -[win-x64-zip-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-win-x64.latest.zip.sha +[win-x64-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-win-x64.latest.exe +[win-x64-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-win-x64.latest.exe.sha +[win-x64-zip]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-win-x64.latest.zip +[win-x64-zip-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-win-x64.latest.zip.sha -[win-x86-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-win-x86.latest.exe -[win-x86-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-win-x86.latest.exe.sha -[win-x86-zip]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-win-x86.latest.zip -[win-x86-zip-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-win-x86.latest.zip.sha +[win-x86-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-win-x86.latest.exe +[win-x86-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-win-x86.latest.exe.sha +[win-x86-zip]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-win-x86.latest.zip +[win-x86-zip-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-win-x86.latest.zip.sha -[ubuntu-14.04-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-sdk-ubuntu-x64.latest.deb -[ubuntu-14.04-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-sdk-ubuntu-x64.latest.deb.sha -[ubuntu-14.04-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-ubuntu-x64.latest.tar.gz -[ubuntu-14.04-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-ubuntu-x64.latest.tar.gz.sha +[ubuntu-14.04-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-ubuntu-x64.latest.deb +[ubuntu-14.04-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-ubuntu-x64.latest.deb.sha +[ubuntu-14.04-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-ubuntu-x64.latest.tar.gz +[ubuntu-14.04-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-ubuntu-x64.latest.tar.gz.sha -[ubuntu-16.04-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-ubuntu.16.04-x64.latest.tar.gz -[ubuntu-16.04-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-ubuntu.16.04-x64.latest.tar.gz.sha +[ubuntu-16.04-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-ubuntu.16.04-x64.latest.tar.gz +[ubuntu-16.04-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-ubuntu.16.04-x64.latest.tar.gz.sha -[debian-8.2-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-debian-x64.latest.tar.gz -[debian-8.2-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-debian-x64.latest.tar.gz.sha +[debian-8-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-debian-x64.latest.tar.gz +[debian-8-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-debian-x64.latest.tar.gz.sha -[osx-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-osx-x64.latest.pkg -[osx-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-osx-x64.latest.pkg.sha -[osx-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-osx-x64.latest.tar.gz -[osx-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-osx-x64.latest.tar.gz.sha +[osx-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-osx-x64.latest.pkg +[osx-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-osx-x64.latest.pkg.sha +[osx-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-osx-x64.latest.tar.gz +[osx-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-osx-x64.latest.tar.gz.sha -[centos-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-centos-x64.latest.tar.gz -[centos-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-centos-x64.latest.tar.gz.sha +[centos-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-centos-x64.latest.tar.gz +[centos-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-centos-x64.latest.tar.gz.sha -[rhel-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-rhel-x64.latest.tar.gz -[rhel-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-rhel-x64.latest.tar.gz.sha +[rhel-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-rhel-x64.latest.tar.gz +[rhel-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-rhel-x64.latest.tar.gz.sha -[linux-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-linux-x64.latest.tar.gz -[linux-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/2.0.0/dotnet-dev-linux-x64.latest.tar.gz.sha +[linux-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-linux-x64.latest.tar.gz +[linux-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-linux-x64.latest.tar.gz.sha # Debian daily feed diff --git a/TestAssets/DesktopTestProjects/AutoAddDesktopReferencesDuringMigrate/.noautobuild b/TestAssets/DesktopTestProjects/AutoAddDesktopReferencesDuringMigrate/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/DesktopTestProjects/AutoAddDesktopReferencesDuringMigrate/Program.cs b/TestAssets/DesktopTestProjects/AutoAddDesktopReferencesDuringMigrate/Program.cs deleted file mode 100644 index 1bf340523..000000000 --- a/TestAssets/DesktopTestProjects/AutoAddDesktopReferencesDuringMigrate/Program.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.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using Microsoft.CSharp.RuntimeBinder; - -namespace AutoAddDesktopReferencesDuringMigrate -{ - class Program - { - static void Main(string[] args) - { - var mscorlibRef = new List(new int[] { 4, 5, 6 }); - var systemCoreRef = mscorlibRef.ToArray().Average(); - Debug.Assert(systemCoreRef == 5, "Test System assembly reference"); - if (systemCoreRef != 5) - { - throw new RuntimeBinderException("Test Microsoft.CSharp assembly reference"); - } - } - } -} diff --git a/TestAssets/DesktopTestProjects/AutoAddDesktopReferencesDuringMigrate/project.json b/TestAssets/DesktopTestProjects/AutoAddDesktopReferencesDuringMigrate/project.json deleted file mode 100644 index 57931c899..000000000 --- a/TestAssets/DesktopTestProjects/AutoAddDesktopReferencesDuringMigrate/project.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true - }, - "dependencies": { - "Newtonsoft.Json": "9.0.1" - }, - "frameworks": { - "net451": {} - }, - "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/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestApp/Program.cs b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestApp/Program.cs deleted file mode 100644 index 7937a9ba0..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestApp/Program.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 TestApp -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine(TestLibrary.Helper.GetMessage()); - return 0; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestApp/TestApp.sln b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestApp/TestApp.sln deleted file mode 100644 index 0935de81a..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestApp/TestApp.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestApp", "TestApp.xproj", "{0138CB8F-4AA9-4029-A21E-C07C30F425BA}" -EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestLibrary", "..\TestLibrary\TestLibrary.csproj", "{DC0B35D0-8A36-4B52-8A11-B86739F055D2}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.Build.0 = Release|Any CPU - {DC0B35D0-8A36-4B52-8A11-B86739F055D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DC0B35D0-8A36-4B52-8A11-B86739F055D2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DC0B35D0-8A36-4B52-8A11-B86739F055D2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DC0B35D0-8A36-4B52-8A11-B86739F055D2}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection -EndGlobal diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestApp/TestApp.xproj b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestApp/TestApp.xproj deleted file mode 100644 index d18702195..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestApp/TestApp.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0.23107 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 0138cb8f-4aa9-4029-a21e-c07c30f425ba - TestAppWithContents - ..\..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\..\artifacts\ - - - 2.0 - - - diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestApp/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestApp/project.json deleted file mode 100644 index 060460e39..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestApp/project.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "dependencies": { - "TestLibrary": { - "target": "project", - "version": "1.0.0-*" - }, - "Microsoft.NETCore.App": "1.1.1" - }, - "frameworks": { - "netcoreapp1.1": {} - }, - "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/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestLibrary/Helper.cs b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestLibrary/Helper.cs deleted file mode 100644 index 6c3bc0e53..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestLibrary/Helper.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; - -namespace TestLibrary -{ - public static class Helper - { - public static string GetMessage() - { - return "This string came from the test library!"; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestLibrary/TestLibrary.csproj b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestLibrary/TestLibrary.csproj deleted file mode 100644 index 2debc348d..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestLibrary/TestLibrary.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - netstandard1.5 - TestLibrary - TestLibrary - - - - - - - diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestLibrary/TestLibrary.xproj b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestLibrary/TestLibrary.xproj deleted file mode 100644 index dc8eb7060..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestLibrary/TestLibrary.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0.23107 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - dc0b35d0-8a36-4b52-8a11-b86739f055d2 - TestAppWithContents - ..\..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\..\artifacts\ - - - 2.0 - - - diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestLibrary/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestLibrary/project.json deleted file mode 100644 index 032754312..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndOneAlreadyMigratedCsproj/TestLibrary/project.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": "1.0.0-*", - "dependencies": { - "NETStandard.Library": "1.6.0" - }, - "frameworks": { - "netstandard1.5": {} - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/NoSolutionItemsAfterMigration.sln b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/NoSolutionItemsAfterMigration.sln deleted file mode 100644 index da0ae5935..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/NoSolutionItemsAfterMigration.sln +++ /dev/null @@ -1,39 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "TestApp\TestApp.xproj", "{D65E5A1F-719F-4F95-8835-88BDD67AD457}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FAACC4BE-31AE-4EB7-A4C8-5BB4617EB4AF}" - ProjectSection(SolutionItems) = preProject - global.json = global.json - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|x64.ActiveCfg = Debug|x64 - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|x64.Build.0 = Debug|x64 - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|x86.ActiveCfg = Debug|x86 - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|x86.Build.0 = Debug|x86 - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|Any CPU.Build.0 = Release|Any CPU - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|x64.ActiveCfg = Release|x64 - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|x64.Build.0 = Release|x64 - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|x86.ActiveCfg = Release|x86 - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/ReadmeSolutionItemAfterMigration.sln b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/ReadmeSolutionItemAfterMigration.sln deleted file mode 100644 index 05aecb75d..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/ReadmeSolutionItemAfterMigration.sln +++ /dev/null @@ -1,40 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "TestApp\TestApp.xproj", "{D65E5A1F-719F-4F95-8835-88BDD67AD457}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FAACC4BE-31AE-4EB7-A4C8-5BB4617EB4AF}" - ProjectSection(SolutionItems) = preProject - global.json = global.json - readme.txt = readme.txt - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|x64.ActiveCfg = Debug|x64 - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|x64.Build.0 = Debug|x64 - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|x86.ActiveCfg = Debug|x86 - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Debug|x86.Build.0 = Debug|x86 - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|Any CPU.Build.0 = Release|Any CPU - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|x64.ActiveCfg = Release|x64 - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|x64.Build.0 = Release|x64 - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|x86.ActiveCfg = Release|x86 - {D65E5A1F-719F-4F95-8835-88BDD67AD457}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/TestApp/Program.cs b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/TestApp/Program.cs deleted file mode 100644 index 2289ac741..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/TestApp/Program.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; -namespace TestApp -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine("Hello World!"); - return 0; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/TestApp/TestApp.xproj b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/TestApp/TestApp.xproj deleted file mode 100644 index d18702195..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/TestApp/TestApp.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0.23107 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 0138cb8f-4aa9-4029-a21e-c07c30f425ba - TestAppWithContents - ..\..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\..\artifacts\ - - - 2.0 - - - diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/TestApp/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/TestApp/project.json deleted file mode 100644 index a42ae0bb0..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/TestApp/project.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "dependencies": { - "Microsoft.NETCore.App": "1.1.1" - }, - "frameworks": { - "netcoreapp1.1": {} - }, - "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/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/global.json b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/global.json deleted file mode 100644 index 22936715c..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/global.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "projects": [ "." ] -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/readme.txt b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/readme.txt deleted file mode 100644 index 6e3eb33f4..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndSolutionItemsToMoveToBackup/readme.txt +++ /dev/null @@ -1 +0,0 @@ -This is just for our test to verify that we do not remove the readme.txt link from the solution. diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/Existing.csproj b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/Existing.csproj deleted file mode 100644 index 2f78a7e02..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/Existing.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard1.4 - - - - - - - diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/Program.cs b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/Program.cs deleted file mode 100644 index fa982665c..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/Program.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. - -using System; -using System.Diagnostics; - -namespace TestApp -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine(TestLibrary.Helper.GetMessage()); - Console.WriteLine(subdir.Helper.GetMessage()); - return 100; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/TestApp.sln b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/TestApp.sln deleted file mode 100644 index 3dc27a305..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/TestApp.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestApp", "TestApp.xproj", "{0138CB8F-4AA9-4029-A21E-C07C30F425BA}" -EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestLibrary", "..\TestLibrary\TestLibrary.xproj", "{DC0B35D0-8A36-4B52-8A11-B86739F055D2}" -EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "subdir", "src\subdir\subdir.xproj", "{F8F96F4A-F10C-4C54-867C-A9EFF55494C8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.Build.0 = Release|Any CPU - {DC0B35D0-8A36-4B52-8A11-B86739F055D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DC0B35D0-8A36-4B52-8A11-B86739F055D2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DC0B35D0-8A36-4B52-8A11-B86739F055D2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DC0B35D0-8A36-4B52-8A11-B86739F055D2}.Release|Any CPU.Build.0 = Release|Any CPU - {F8F96F4A-F10C-4C54-867C-A9EFF55494C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F8F96F4A-F10C-4C54-867C-A9EFF55494C8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F8F96F4A-F10C-4C54-867C-A9EFF55494C8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F8F96F4A-F10C-4C54-867C-A9EFF55494C8}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/TestApp.xproj b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/TestApp.xproj deleted file mode 100644 index d18702195..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/TestApp.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0.23107 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 0138cb8f-4aa9-4029-a21e-c07c30f425ba - TestAppWithContents - ..\..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\..\artifacts\ - - - 2.0 - - - diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/project.json deleted file mode 100644 index 788896dab..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/project.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "dependencies": { - "TestLibrary": { - "target": "project", - "version": "1.0.0-*" - }, - "subdir": { - "target": "project", - "version": "1.0.0-*" - }, - "Microsoft.NETCore.App": "1.1.1" - }, - "frameworks": { - "netcoreapp1.1": {} - }, - "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/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/src/subdir/Helper.cs b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/src/subdir/Helper.cs deleted file mode 100644 index 2d937c387..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/src/subdir/Helper.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; - -namespace subdir -{ - public static class Helper - { - public static string GetMessage() - { - return "This string came from the subdir test library!"; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/src/subdir/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/src/subdir/project.json deleted file mode 100644 index bdf53dd6e..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/src/subdir/project.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "nowarn": [ - "CS1591" - ], - "additionalArguments": [ - "-highentropyva+" - ] - },"dependencies": { - "NETStandard.Library": "1.6.0" - }, - "frameworks": { - "netstandard1.5": {} - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/src/subdir/subdir.xproj b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/src/subdir/subdir.xproj deleted file mode 100644 index 8f183ae93..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestApp/src/subdir/subdir.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0.23107 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - F8F96F4A-F10C-4C54-867C-A9EFF55494C8 - TestAppWithContents - ..\..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\..\artifacts\ - - - 2.0 - - - diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestLibrary/Helper.cs b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestLibrary/Helper.cs deleted file mode 100644 index 6c3bc0e53..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestLibrary/Helper.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; - -namespace TestLibrary -{ - public static class Helper - { - public static string GetMessage() - { - return "This string came from the test library!"; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestLibrary/TestLibrary.xproj b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestLibrary/TestLibrary.xproj deleted file mode 100644 index dc8eb7060..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestLibrary/TestLibrary.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0.23107 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - dc0b35d0-8a36-4b52-8a11-b86739f055d2 - TestAppWithContents - ..\..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\..\artifacts\ - - - 2.0 - - - diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestLibrary/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestLibrary/project.json deleted file mode 100644 index 032754312..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefsAndUnrelatedCsproj/TestLibrary/project.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": "1.0.0-*", - "dependencies": { - "NETStandard.Library": "1.6.0" - }, - "frameworks": { - "netstandard1.5": {} - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestApp/Program.cs b/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestApp/Program.cs deleted file mode 100644 index 3263737e1..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestApp/Program.cs +++ /dev/null @@ -1,20 +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.Threading.Tasks; - -namespace TestApp -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello from main"); - Console.WriteLine(TestLibrary.Lib.GetMessage()); - Console.WriteLine(subdir.Helper.GetMessage()); - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestApp/TestApp.sln b/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestApp/TestApp.sln deleted file mode 100644 index 8f43e30de..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestApp/TestApp.sln +++ /dev/null @@ -1,28 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestApp", "TestApp.xproj", "{411BC0C0-497A-45C2-B6F7-0B428A6A9AEF}" -EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestLibrary", "..\TestLibrary\TestLibrary.xproj", "{B2E306B6-B490-46AC-A421-AA3B7D38EDF0}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {411BC0C0-497A-45C2-B6F7-0B428A6A9AEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {411BC0C0-497A-45C2-B6F7-0B428A6A9AEF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {411BC0C0-497A-45C2-B6F7-0B428A6A9AEF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {411BC0C0-497A-45C2-B6F7-0B428A6A9AEF}.Release|Any CPU.Build.0 = Release|Any CPU - {B2E306B6-B490-46AC-A421-AA3B7D38EDF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B2E306B6-B490-46AC-A421-AA3B7D38EDF0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B2E306B6-B490-46AC-A421-AA3B7D38EDF0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B2E306B6-B490-46AC-A421-AA3B7D38EDF0}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestApp/TestApp.xproj b/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestApp/TestApp.xproj deleted file mode 100644 index 4f40e62b2..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestApp/TestApp.xproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - 0138cb8f-4aa9-4029-a21e-c07c30f425ba - TestApp - .\obj - .\bin\ - v4.5.2 - - - - - - - - 2.0 - - - diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestApp/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestApp/project.json deleted file mode 100644 index ade45a814..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestApp/project.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true - }, - - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.1" - }, - "TestLibrary": { - "target": "project", - "version": "1.0.0-*" - }, - "subdir": { - "target": "project", - "version": "1.0.0-*" - } - }, - - "frameworks": { - "netcoreapp1.1": { - "imports": "dnxcore50" - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestApp/src/subdir/Helper.cs b/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestApp/src/subdir/Helper.cs deleted file mode 100644 index 2d937c387..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestApp/src/subdir/Helper.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; - -namespace subdir -{ - public static class Helper - { - public static string GetMessage() - { - return "This string came from the subdir test library!"; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestApp/src/subdir/subdir.csproj b/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestApp/src/subdir/subdir.csproj deleted file mode 100644 index fd3e68501..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestApp/src/subdir/subdir.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - netstandard1.5 - $(NoWarn);CS1591 - subdir - subdir - F8F96F4A-F10C-4C54-867C-A9EFF55494C8 - - - - - - - - diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestLibrary/Helper.cs b/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestLibrary/Helper.cs deleted file mode 100644 index 46ad7bb9d..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestLibrary/Helper.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. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace TestLibrary -{ - public static class Lib - { - public static string GetMessage() - { - return "Hello from TestLibrary.Lib"; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestLibrary/TestLibrary.xproj b/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestLibrary/TestLibrary.xproj deleted file mode 100644 index b5cb449ca..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestLibrary/TestLibrary.xproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - dc0b35d0-8a36-4b52-8a11-b86739f055d2 - TestLibrary - .\obj - .\bin\ - v4.5.2 - - - - 2.0 - - - diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestLibrary/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestLibrary/project.json deleted file mode 100644 index 864b9a5f3..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnThatDoesNotRefCsproj/TestLibrary/project.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": "1.0.0-*", - - "dependencies": { - "NETStandard.Library": "1.6.0" - }, - - "frameworks": { - "netstandard1.6": { - "imports": "dnxcore50" - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion14/Program.cs b/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion14/Program.cs deleted file mode 100644 index e901ebc5c..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion14/Program.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 TestApp -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine("Hello world"); - return 0; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion14/TestApp.sln b/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion14/TestApp.sln deleted file mode 100644 index 3adf30d78..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion14/TestApp.sln +++ /dev/null @@ -1,23 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestApp", "TestApp.xproj", "{0138CB8F-4AA9-4029-A21E-C07C30F425BA}" -EndProject -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion14/TestApp.xproj b/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion14/TestApp.xproj deleted file mode 100644 index d18702195..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion14/TestApp.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0.23107 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 0138cb8f-4aa9-4029-a21e-c07c30f425ba - TestAppWithContents - ..\..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\..\artifacts\ - - - 2.0 - - - diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion14/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion14/project.json deleted file mode 100644 index a42ae0bb0..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion14/project.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "dependencies": { - "Microsoft.NETCore.App": "1.1.1" - }, - "frameworks": { - "netcoreapp1.1": {} - }, - "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/NonRestoredTestProjects/PJAppWithSlnVersion15/Program.cs b/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion15/Program.cs deleted file mode 100644 index e901ebc5c..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion15/Program.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 TestApp -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine("Hello world"); - return 0; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion15/TestApp.sln b/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion15/TestApp.sln deleted file mode 100644 index 88284045d..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion15/TestApp.sln +++ /dev/null @@ -1,23 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 Custom -VisualStudioVersion = 15.9.12345.4 -MinimumVisualStudioVersion = 10.9.1234.5 -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestApp", "TestApp.xproj", "{0138CB8F-4AA9-4029-A21E-C07C30F425BA}" -EndProject -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion15/TestApp.xproj b/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion15/TestApp.xproj deleted file mode 100644 index d18702195..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion15/TestApp.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0.23107 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 0138cb8f-4aa9-4029-a21e-c07c30f425ba - TestAppWithContents - ..\..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\..\artifacts\ - - - 2.0 - - - diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion15/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion15/project.json deleted file mode 100644 index a42ae0bb0..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersion15/project.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "dependencies": { - "Microsoft.NETCore.App": "1.1.1" - }, - "frameworks": { - "netcoreapp1.1": {} - }, - "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/NonRestoredTestProjects/PJAppWithSlnVersionUnknown/Program.cs b/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersionUnknown/Program.cs deleted file mode 100644 index e901ebc5c..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersionUnknown/Program.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 TestApp -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine("Hello world"); - return 0; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersionUnknown/TestApp.sln b/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersionUnknown/TestApp.sln deleted file mode 100644 index 60722b8f3..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersionUnknown/TestApp.sln +++ /dev/null @@ -1,23 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 16 -VisualStudioVersion = 14.0.unknown.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestApp", "TestApp.xproj", "{0138CB8F-4AA9-4029-A21E-C07C30F425BA}" -EndProject -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersionUnknown/TestApp.xproj b/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersionUnknown/TestApp.xproj deleted file mode 100644 index d18702195..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersionUnknown/TestApp.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0.23107 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 0138cb8f-4aa9-4029-a21e-c07c30f425ba - TestAppWithContents - ..\..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\..\artifacts\ - - - 2.0 - - - diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersionUnknown/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersionUnknown/project.json deleted file mode 100644 index a42ae0bb0..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnVersionUnknown/project.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "dependencies": { - "Microsoft.NETCore.App": "1.1.1" - }, - "frameworks": { - "netcoreapp1.1": {} - }, - "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/NonRestoredTestProjects/PJAppWithXprojNameDifferentThanDirName/FolderHasDifferentName.sln b/TestAssets/NonRestoredTestProjects/PJAppWithXprojNameDifferentThanDirName/FolderHasDifferentName.sln deleted file mode 100644 index 5fe171b9d..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithXprojNameDifferentThanDirName/FolderHasDifferentName.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "FolderHasDifferentName", "FolderHasDifferentName.xproj", "{0138CB8F-4AA9-4029-A21E-C07C30F425BA}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithXprojNameDifferentThanDirName/FolderHasDifferentName.xproj b/TestAssets/NonRestoredTestProjects/PJAppWithXprojNameDifferentThanDirName/FolderHasDifferentName.xproj deleted file mode 100644 index d18702195..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithXprojNameDifferentThanDirName/FolderHasDifferentName.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0.23107 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 0138cb8f-4aa9-4029-a21e-c07c30f425ba - TestAppWithContents - ..\..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\..\artifacts\ - - - 2.0 - - - diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithXprojNameDifferentThanDirName/Program.cs b/TestAssets/NonRestoredTestProjects/PJAppWithXprojNameDifferentThanDirName/Program.cs deleted file mode 100644 index f6b060a91..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithXprojNameDifferentThanDirName/Program.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 TestApp -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine("Hello World"); - return 0; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithXprojNameDifferentThanDirName/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithXprojNameDifferentThanDirName/project.json deleted file mode 100644 index 166d41c2b..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithXprojNameDifferentThanDirName/project.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "dependencies": { - "Microsoft.NETCore.App": "1.0.1" - }, - "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/NonRestoredTestProjects/PJDeprecatedCompilation/Program.cs b/TestAssets/NonRestoredTestProjects/PJDeprecatedCompilation/Program.cs deleted file mode 100644 index 2130cd0a7..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompilation/Program.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; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompilation/project.json b/TestAssets/NonRestoredTestProjects/PJDeprecatedCompilation/project.json deleted file mode 100644 index 48cc4461c..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompilation/project.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": "1.0.0-*", - "compilerName": "csc", - "compilationOptions": { - "debugType": "portable", - "emitEntryPoint": true - }, - "dependencies": {}, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.1" - } - }, - "imports": "dnxcore50" - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompile/Helper1.cs b/TestAssets/NonRestoredTestProjects/PJDeprecatedCompile/Helper1.cs deleted file mode 100644 index cead047c5..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompile/Helper1.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; - -namespace ConsoleApplication -{ - public class Helper1 - { - public static string GetMessage() - { - return "Hello from Helper1 class!"; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompile/Helper2.cs b/TestAssets/NonRestoredTestProjects/PJDeprecatedCompile/Helper2.cs deleted file mode 100644 index 15f4cd39a..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompile/Helper2.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; - -namespace ConsoleApplication -{ - public class Helper2 - { - public static string GetMessage() - { - return "Hello from Helper2 class!"; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompile/project/IncludeThis.cs b/TestAssets/NonRestoredTestProjects/PJDeprecatedCompile/project/IncludeThis.cs deleted file mode 100644 index 74b1d71d1..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompile/project/IncludeThis.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; - -namespace ConsoleApplication -{ - public class IncludeThis - { - public static string GetMessage() - { - return "Hello from IncludeThis class!"; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompile/project/Program.cs b/TestAssets/NonRestoredTestProjects/PJDeprecatedCompile/project/Program.cs deleted file mode 100644 index e3e9eebc3..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompile/project/Program.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; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine(IncludeThis.GetMessage()); - Console.WriteLine(Helper1.GetMessage()); - Console.WriteLine(Helper2.GetMessage()); - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompile/project/project.json b/TestAssets/NonRestoredTestProjects/PJDeprecatedCompile/project/project.json deleted file mode 100644 index abe2d6127..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompile/project/project.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": "1.0.0-*", - "compile": "../Helper1.cs", - "compileFiles": "../Helper2.cs", - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true - }, - "dependencies": {}, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.1" - } - }, - "imports": "dnxcore50" - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileBuiltIn/HelperBuiltIn1.cs b/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileBuiltIn/HelperBuiltIn1.cs deleted file mode 100644 index 99421a7a7..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileBuiltIn/HelperBuiltIn1.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; - -namespace ConsoleApplication -{ - public class HelperBuiltIn1 - { - public static string GetMessage() - { - return "Hello from HelperBuiltIn1 class!"; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileBuiltIn/HelperBuiltIn2.cs b/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileBuiltIn/HelperBuiltIn2.cs deleted file mode 100644 index d80d2f47d..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileBuiltIn/HelperBuiltIn2.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; - -namespace ConsoleApplication -{ - public class HelperBuiltIn2 - { - public static string GetMessage() - { - return "Hello from HelperBuiltIn2 class!"; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileBuiltIn/project/IncludeThis.cs b/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileBuiltIn/project/IncludeThis.cs deleted file mode 100644 index 74b1d71d1..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileBuiltIn/project/IncludeThis.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; - -namespace ConsoleApplication -{ - public class IncludeThis - { - public static string GetMessage() - { - return "Hello from IncludeThis class!"; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileBuiltIn/project/Program.cs b/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileBuiltIn/project/Program.cs deleted file mode 100644 index ab14e18ba..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileBuiltIn/project/Program.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; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine(IncludeThis.GetMessage()); - Console.WriteLine(HelperBuiltIn1.GetMessage()); - Console.WriteLine(HelperBuiltIn2.GetMessage()); - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileBuiltIn/project/project.json b/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileBuiltIn/project/project.json deleted file mode 100644 index ce76b170c..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileBuiltIn/project/project.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": "1.0.0-*", - "compileBuiltIn": [ "Program.cs", "IncludeThis.cs", "../HelperBuiltIn1.cs", "../HelperBuiltIn2.cs" ], - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true - }, - "dependencies": {}, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.1" - } - }, - "imports": "dnxcore50" - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileExclude/ExcludeThis1.cs b/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileExclude/ExcludeThis1.cs deleted file mode 100644 index b4c0e60fb..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileExclude/ExcludeThis1.cs +++ /dev/null @@ -1,4 +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. - -This does not compile but is used to test compile exclusion. diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileExclude/ExcludeThis2.cs b/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileExclude/ExcludeThis2.cs deleted file mode 100644 index b4c0e60fb..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileExclude/ExcludeThis2.cs +++ /dev/null @@ -1,4 +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. - -This does not compile but is used to test compile exclusion. diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileExclude/Program.cs b/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileExclude/Program.cs deleted file mode 100644 index 2130cd0a7..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileExclude/Program.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; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileExclude/project.json b/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileExclude/project.json deleted file mode 100644 index caa91e887..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedCompileExclude/project.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": "1.0.0-*", - "compileExclude": "ExcludeThis1.cs", - "exclude": [ "ExcludeThis2.cs" ], - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true - }, - "dependencies": {}, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.1" - } - }, - "imports": "dnxcore50" - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/ContentFile1.txt1 b/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/ContentFile1.txt1 deleted file mode 100644 index 49852374c..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/ContentFile1.txt1 +++ /dev/null @@ -1 +0,0 @@ -Test content file that should be included. diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/ContentFile2.txt1 b/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/ContentFile2.txt1 deleted file mode 100644 index 49852374c..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/ContentFile2.txt1 +++ /dev/null @@ -1 +0,0 @@ -Test content file that should be included. diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/ContentFileBuiltIn1.txt1 b/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/ContentFileBuiltIn1.txt1 deleted file mode 100644 index 49852374c..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/ContentFileBuiltIn1.txt1 +++ /dev/null @@ -1 +0,0 @@ -Test content file that should be included. diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/ContentFileBuiltIn2.txt1 b/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/ContentFileBuiltIn2.txt1 deleted file mode 100644 index 49852374c..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/ContentFileBuiltIn2.txt1 +++ /dev/null @@ -1 +0,0 @@ -Test content file that should be included. diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/ExcludeThis1.txt b/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/ExcludeThis1.txt deleted file mode 100644 index 949ca7b7c..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/ExcludeThis1.txt +++ /dev/null @@ -1 +0,0 @@ -Test content file that should be excluded. diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/ExcludeThis2.txt b/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/ExcludeThis2.txt deleted file mode 100644 index 949ca7b7c..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/ExcludeThis2.txt +++ /dev/null @@ -1 +0,0 @@ -Test content file that should be excluded. diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/IncludeThis.txt b/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/IncludeThis.txt deleted file mode 100644 index 49852374c..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/IncludeThis.txt +++ /dev/null @@ -1 +0,0 @@ -Test content file that should be included. diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/Program.cs b/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/Program.cs deleted file mode 100644 index 2130cd0a7..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/Program.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; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/project.json b/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/project.json deleted file mode 100644 index 721775e7f..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedContent/project/project.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "version": "1.0.0-*", - "content": "*.txt", - "contentExclude": "ExcludeThis1.txt", - "contentFiles": [ "ContentFile1.txt1", "ContentFile2.txt1" ], - "contentBuiltIn": [ "ContentFileBuiltIn1.txt1", "ContentFileBuiltIn2.txt1" ], - "publishExclude": "ExcludeThis2.txt", - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true - }, - "dependencies": {}, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.1" - } - }, - "imports": "dnxcore50" - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedPack/Content1.txt b/TestAssets/NonRestoredTestProjects/PJDeprecatedPack/Content1.txt deleted file mode 100644 index a36501f3f..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedPack/Content1.txt +++ /dev/null @@ -1 +0,0 @@ -Test pack content file. diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedPack/Content2.txt b/TestAssets/NonRestoredTestProjects/PJDeprecatedPack/Content2.txt deleted file mode 100644 index a36501f3f..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedPack/Content2.txt +++ /dev/null @@ -1 +0,0 @@ -Test pack content file. diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedPack/Program.cs b/TestAssets/NonRestoredTestProjects/PJDeprecatedPack/Program.cs deleted file mode 100644 index 2130cd0a7..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedPack/Program.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; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedPack/project.json b/TestAssets/NonRestoredTestProjects/PJDeprecatedPack/project.json deleted file mode 100644 index 9590efb93..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedPack/project.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "version": "1.0.0-*", - "projectUrl": "http://projecturl/", - "licenseUrl": "http://licenseurl/", - "iconUrl": "http://iconurl/", - "owners": [ "owner1", "owner2" ], - "tags": [ "tag1", "tag2" ], - "releaseNotes": "releaseNotes", - "requireLicenseAcceptance": true, - "summary": "summary", - "repository": { - "type": "git", - "url": "http://url/" - }, - "packInclude": [ "Content1.txt", "Content2.txt" ], - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true - }, - "dependencies": {}, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.1" - } - }, - "imports": "dnxcore50" - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedResource/Strings1.resx b/TestAssets/NonRestoredTestProjects/PJDeprecatedResource/Strings1.resx deleted file mode 100644 index 1f24a372f..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedResource/Strings1.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Hello World! - - \ No newline at end of file diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedResource/Strings2.resx b/TestAssets/NonRestoredTestProjects/PJDeprecatedResource/Strings2.resx deleted file mode 100644 index 1f24a372f..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedResource/Strings2.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Hello World! - - \ No newline at end of file diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedResource/project/Program.cs b/TestAssets/NonRestoredTestProjects/PJDeprecatedResource/project/Program.cs deleted file mode 100644 index b0df821a7..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedResource/project/Program.cs +++ /dev/null @@ -1,22 +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.Linq; -using System.Reflection; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - var thisAssembly = typeof(Program).GetTypeInfo().Assembly; - var resources = from resourceName in thisAssembly.GetManifestResourceNames() - select resourceName; - - var resourceNames = string.Join(",", resources); - Console.WriteLine($"{resources.Count()} Resources Found: {resourceNames}"); - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedResource/project/Resources/Strings.resx b/TestAssets/NonRestoredTestProjects/PJDeprecatedResource/project/Resources/Strings.resx deleted file mode 100644 index 1f24a372f..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedResource/project/Resources/Strings.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Hello World! - - \ No newline at end of file diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedResource/project/project.json b/TestAssets/NonRestoredTestProjects/PJDeprecatedResource/project/project.json deleted file mode 100644 index 4851a858d..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedResource/project/project.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": "1.0.0-*", - "resource": "../Strings1.resx", - "resourceFiles": [ "../Strings2.resx" ], - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true - }, - "dependencies": {}, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.0" - } - }, - "imports": "dnxcore50" - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceBuiltIn/Strings1.resx b/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceBuiltIn/Strings1.resx deleted file mode 100644 index 1f24a372f..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceBuiltIn/Strings1.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Hello World! - - \ No newline at end of file diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceBuiltIn/Strings2.resx b/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceBuiltIn/Strings2.resx deleted file mode 100644 index 1f24a372f..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceBuiltIn/Strings2.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Hello World! - - \ No newline at end of file diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceBuiltIn/project/Program.cs b/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceBuiltIn/project/Program.cs deleted file mode 100644 index b0df821a7..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceBuiltIn/project/Program.cs +++ /dev/null @@ -1,22 +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.Linq; -using System.Reflection; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - var thisAssembly = typeof(Program).GetTypeInfo().Assembly; - var resources = from resourceName in thisAssembly.GetManifestResourceNames() - select resourceName; - - var resourceNames = string.Join(",", resources); - Console.WriteLine($"{resources.Count()} Resources Found: {resourceNames}"); - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceBuiltIn/project/Resources/Strings.resx b/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceBuiltIn/project/Resources/Strings.resx deleted file mode 100644 index 1f24a372f..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceBuiltIn/project/Resources/Strings.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Hello World! - - \ No newline at end of file diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceBuiltIn/project/project.json b/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceBuiltIn/project/project.json deleted file mode 100644 index 5bf7fe5f7..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceBuiltIn/project/project.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": "1.0.0-*", - "resourceBuiltIn": [ "../Strings1.resx", "../Strings2.resx" ], - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true - }, - "dependencies": {}, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.0" - } - }, - "imports": "dnxcore50" - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceExclude/Exclude1.resx b/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceExclude/Exclude1.resx deleted file mode 100644 index a82c91ddd..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceExclude/Exclude1.resx +++ /dev/null @@ -1 +0,0 @@ -This is not a resource file but is used to test resource exclusion. diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceExclude/Exclude2.resx b/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceExclude/Exclude2.resx deleted file mode 100644 index a82c91ddd..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceExclude/Exclude2.resx +++ /dev/null @@ -1 +0,0 @@ -This is not a resource file but is used to test resource exclusion. diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceExclude/Program.cs b/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceExclude/Program.cs deleted file mode 100644 index b0df821a7..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceExclude/Program.cs +++ /dev/null @@ -1,22 +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.Linq; -using System.Reflection; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - var thisAssembly = typeof(Program).GetTypeInfo().Assembly; - var resources = from resourceName in thisAssembly.GetManifestResourceNames() - select resourceName; - - var resourceNames = string.Join(",", resources); - Console.WriteLine($"{resources.Count()} Resources Found: {resourceNames}"); - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceExclude/project.json b/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceExclude/project.json deleted file mode 100644 index 87e1d0675..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedResourceExclude/project.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": "1.0.0-*", - "exclude": "Exclude1.resx", - "resourceExclude": [ "Exclude2.resx" ], - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true - }, - "dependencies": {}, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.0" - } - }, - "imports": "dnxcore50" - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/TestAppWithLibraryAndMissingP2P/TestApp/.noautobuild b/TestAssets/NonRestoredTestProjects/TestAppWithLibraryAndMissingP2P/TestApp/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/NonRestoredTestProjects/TestAppWithLibraryAndMissingP2P/TestApp/Program.cs b/TestAssets/NonRestoredTestProjects/TestAppWithLibraryAndMissingP2P/TestApp/Program.cs deleted file mode 100644 index ac3163a58..000000000 --- a/TestAssets/NonRestoredTestProjects/TestAppWithLibraryAndMissingP2P/TestApp/Program.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 System.Diagnostics; - -namespace TestApp -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine(TestLibrary.Helper.GetMessage()); - return 100; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/TestAppWithLibraryAndMissingP2P/TestApp/project.json b/TestAssets/NonRestoredTestProjects/TestAppWithLibraryAndMissingP2P/TestApp/project.json deleted file mode 100644 index 8edb9fd32..000000000 --- a/TestAssets/NonRestoredTestProjects/TestAppWithLibraryAndMissingP2P/TestApp/project.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "dependencies": { - "TestLibrary": { - "target": "project", - "version": "1.0.0-*" - }, - "Microsoft.NETCore.App": "1.1.0" - }, - "frameworks": { - "netcoreapp1.1": {} - }, - "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/NonRestoredTestProjects/TestAppWithLibraryAndMissingP2P/TestLibrary/.noautobuild b/TestAssets/NonRestoredTestProjects/TestAppWithLibraryAndMissingP2P/TestLibrary/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/NonRestoredTestProjects/TestAppWithLibraryAndMissingP2P/TestLibrary/Helper.cs b/TestAssets/NonRestoredTestProjects/TestAppWithLibraryAndMissingP2P/TestLibrary/Helper.cs deleted file mode 100644 index 8c643796b..000000000 --- a/TestAssets/NonRestoredTestProjects/TestAppWithLibraryAndMissingP2P/TestLibrary/Helper.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; - -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/NonRestoredTestProjects/TestAppWithLibraryAndMissingP2P/TestLibrary/project.json b/TestAssets/NonRestoredTestProjects/TestAppWithLibraryAndMissingP2P/TestLibrary/project.json deleted file mode 100644 index 2470e823b..000000000 --- a/TestAssets/NonRestoredTestProjects/TestAppWithLibraryAndMissingP2P/TestLibrary/project.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "nowarn": [ - "CS1591" - ], - "xmlDoc": true, - "additionalArguments": [ - "-highentropyva+" - ] - }, - "dependencies": { - "MissingP2PDependency": { - "target": "project", - "version": "1.0.0-*" - }, - "NETStandard.Library": "1.6.0" - }, - "frameworks": { - "netstandard1.5": {} - } -} diff --git a/TestAssets/NonRestoredTestProjects/TestAppWithLibraryAndMissingP2P/global.json b/TestAssets/NonRestoredTestProjects/TestAppWithLibraryAndMissingP2P/global.json deleted file mode 100644 index 3a4684c26..000000000 --- a/TestAssets/NonRestoredTestProjects/TestAppWithLibraryAndMissingP2P/global.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "projects": [ "."] -} \ No newline at end of file diff --git a/TestAssets/TestPackages/PackageWithFakeNativeDep/PackageWithFakeNativeDep.csproj b/TestAssets/TestPackages/PackageWithFakeNativeDep/PackageWithFakeNativeDep.csproj index 9929c7099..de9c330de 100644 --- a/TestAssets/TestPackages/PackageWithFakeNativeDep/PackageWithFakeNativeDep.csproj +++ b/TestAssets/TestPackages/PackageWithFakeNativeDep/PackageWithFakeNativeDep.csproj @@ -2,7 +2,6 @@ net45 PackageWithFakeNativeDep - win7-x64;win7-x86;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;osx.10.10-x64;rhel.7-x64 diff --git a/TestAssets/TestPackages/dotnet-dependency-tool-invoker/AppliedOptionsExtensions.cs b/TestAssets/TestPackages/dotnet-dependency-tool-invoker/AppliedOptionsExtensions.cs new file mode 100644 index 000000000..a5e32d1ad --- /dev/null +++ b/TestAssets/TestPackages/dotnet-dependency-tool-invoker/AppliedOptionsExtensions.cs @@ -0,0 +1,30 @@ +// 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 Microsoft.DotNet.Cli.CommandLine; + +namespace Microsoft.DotNet.Tools.DependencyInvoker +{ + public static class AppliedOptionExtensions + { + public static T ValueOrDefault(this AppliedOption parseResult, string alias) + { + return parseResult + .AppliedOptions + .Where(o => o.HasAlias(alias)) + .Select(o => o.Value()) + .SingleOrDefault(); + } + + public static string SingleArgumentOrDefault(this AppliedOption parseResult, string alias) + { + return parseResult + .AppliedOptions + .Where(o => o.HasAlias(alias)) + .Select(o => o.Arguments.Single()) + .SingleOrDefault(); + } + } +} diff --git a/TestAssets/TestPackages/dotnet-dependency-tool-invoker/DotnetBaseParams.cs b/TestAssets/TestPackages/dotnet-dependency-tool-invoker/DotnetBaseParams.cs deleted file mode 100644 index 0d9e07748..000000000 --- a/TestAssets/TestPackages/dotnet-dependency-tool-invoker/DotnetBaseParams.cs +++ /dev/null @@ -1,113 +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.IO; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Tools.DependencyInvoker -{ - public class DotnetBaseParams - { - private readonly CommandLineApplication _app; - - private CommandOption _outputOption; - private CommandOption _buildBasePath; - private CommandOption _frameworkOption; - private CommandOption _runtimeOption; - private CommandOption _configurationOption; - private CommandOption _projectPath; - private CommandArgument _command; - - public string Runtime { get; set; } - - public string Config { get; set; } - - public string BuildBasePath { get; set; } - - public string Output { get; set; } - - public string ProjectPath { get; set; } - - public NuGetFramework Framework { get; set; } - - public string Command {get; set; } - - public List RemainingArguments { get; set; } - - public DotnetBaseParams(string name, string fullName, string description) - { - _app = new CommandLineApplication(false) - { - Name = name, - FullName = fullName, - Description = description - }; - - AddDotnetBaseParameters(); - } - - public void Parse(string[] args) - { - _app.OnExecute(() => - { - // Locate the project and get the name and full path - ProjectPath = _projectPath.Value(); - Output = _outputOption.Value(); - BuildBasePath = _buildBasePath.Value(); - Config = _configurationOption.Value() ?? Constants.DefaultConfiguration; - Runtime = _runtimeOption.Value(); - if (_frameworkOption.HasValue()) - { - Framework = NuGetFramework.Parse(_frameworkOption.Value()); - } - Command = _command.Value; - RemainingArguments = _app.RemainingArguments; - - if (string.IsNullOrEmpty(ProjectPath)) - { - ProjectPath = Directory.GetCurrentDirectory(); - } - - return 0; - }); - - _app.Execute(args); - } - - private void AddDotnetBaseParameters() - { - _app.HelpOption("-?|-h|--help"); - - _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); - _projectPath = _app.Option( - "-p|--project-path ", - "Path to Project.json that contains the tool dependency", - CommandOptionType.SingleValue); - _command = _app.Argument( - "", - "The command to execute."); - } - } -} diff --git a/TestAssets/TestPackages/dotnet-dependency-tool-invoker/DotnetDependencyToolInvokerParser.cs b/TestAssets/TestPackages/dotnet-dependency-tool-invoker/DotnetDependencyToolInvokerParser.cs new file mode 100644 index 000000000..31f29c70f --- /dev/null +++ b/TestAssets/TestPackages/dotnet-dependency-tool-invoker/DotnetDependencyToolInvokerParser.cs @@ -0,0 +1,58 @@ +// 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 System.Linq; +using Microsoft.DotNet.Cli.CommandLine; +using Microsoft.DotNet.Tools.Common; +using Microsoft.DotNet.Cli.Utils; +using NuGet.Frameworks; + +namespace Microsoft.DotNet.Tools.DependencyInvoker +{ + internal static class DotnetDependencyToolInvokerParser + { + public static Microsoft.DotNet.Cli.CommandLine.Command DotnetDependencyToolInvoker() => + Create.Command( + "dotnet-dependency-tool-invoker", + "DotNet Dependency Tool Invoker", + Accept.ExactlyOneArgument() + .With(name: "COMMAND", + description: "The command to execute."), + false, + Create.Option( + "-h|--help", + "Show help information", + Accept.NoArguments(), + materialize: o => o.Option.Command().HelpView()), + Create.Option( + "-p|--project-path", + "Path to Project.json that contains the tool dependency", + Accept.ExactlyOneArgument() + .With(name: "PROJECT_JSON_PATH", + defaultValue: () => + PathUtility.EnsureTrailingSlash(Directory.GetCurrentDirectory()))), + Create.Option( + "-c|--configuration", + "Configuration under which to build", + Accept.ExactlyOneArgument() + .With(name: "CONFIGURATION", + defaultValue: () => Constants.DefaultConfiguration)), + Create.Option( + "-o|--output", + "Directory in which to find the binaries to be run", + Accept.ExactlyOneArgument() + .With(name: "OUTPUT_DIR")), + Create.Option( + "-f|--framework", + "Looks for test binaries for a specific framework", + Accept.ExactlyOneArgument() + .With(name: "FRAMEWORK") + .MaterializeAs(p => NuGetFramework.Parse(p.Arguments.Single()))), + Create.Option( + "-r|--runtime", + "Look for test binaries for a for the specified runtime", + Accept.ExactlyOneArgument() + .With(name: "RUNTIME_IDENTIFIER"))); + } +} diff --git a/TestAssets/TestPackages/dotnet-dependency-tool-invoker/Program.cs b/TestAssets/TestPackages/dotnet-dependency-tool-invoker/Program.cs index 9c481c55d..ff312149e 100644 --- a/TestAssets/TestPackages/dotnet-dependency-tool-invoker/Program.cs +++ b/TestAssets/TestPackages/dotnet-dependency-tool-invoker/Program.cs @@ -5,8 +5,10 @@ using System; using System.IO; using System.Collections.Generic; using System.Linq; +using Microsoft.DotNet.Cli.CommandLine; using Microsoft.DotNet.Cli.Utils; using NuGet.Frameworks; +using Microsoft.DotNet.Tools.Common; namespace Microsoft.DotNet.Tools.DependencyInvoker { @@ -16,51 +18,79 @@ namespace Microsoft.DotNet.Tools.DependencyInvoker { DebugHelper.HandleDebugSwitch(ref args); - var dotnetParams = new DotnetBaseParams("dotnet-dependency-tool-invoker", "DotNet Dependency Tool Invoker", "Invokes tools declared as NuGet dependencies of a project"); + args = new [] { "dotnet-dependency-tool-invoker" }.Concat(args).ToArray(); - dotnetParams.Parse(args); + var parser = new Parser( + options: DotnetDependencyToolInvokerParser.DotnetDependencyToolInvoker()); - if (string.IsNullOrEmpty(dotnetParams.Command)) + var parseResult = parser.Parse(args); + var appliedOptions = parseResult["dotnet-dependency-tool-invoker"]; + + Console.WriteLine(parseResult.Diagram()); + + if (appliedOptions.HasOption("help")) { - Console.WriteLine("A command name must be provided"); - - return 1; + Console.WriteLine(parseResult.Command().HelpView()); + return 0; } + var command = appliedOptions.Arguments.First(); + var framework = appliedOptions.ValueOrDefault("framework"); + var configuration = appliedOptions.ValueOrDefault("configuration"); + if (string.IsNullOrEmpty(configuration)) + { + configuration = Constants.DefaultConfiguration; + } + + var output = appliedOptions.SingleArgumentOrDefault("output"); + var projectPath = appliedOptions.ValueOrDefault("project-path"); + if (string.IsNullOrEmpty(projectPath)) + { + projectPath = PathUtility.EnsureTrailingSlash(Directory.GetCurrentDirectory()); + } + + var appArguments = parseResult.UnmatchedTokens; + var commandFactory = new ProjectDependenciesCommandFactory( - dotnetParams.Framework, - dotnetParams.Config, - dotnetParams.Output, - dotnetParams.BuildBasePath, - dotnetParams.ProjectPath); + framework, + configuration, + output, + string.Empty, + projectPath); - var result = InvokeDependencyToolForMSBuild(commandFactory, dotnetParams); + var result = + InvokeDependencyToolForMSBuild(commandFactory, command, framework, configuration, appArguments); return result; } private static int InvokeDependencyToolForMSBuild( ProjectDependenciesCommandFactory commandFactory, - DotnetBaseParams dotnetParams) + string command, + NuGetFramework framework, + string configuration, + IEnumerable appArguments) { - Console.WriteLine($"Invoking '{dotnetParams.Command}' for '{dotnetParams.Framework.GetShortFolderName()}'."); + Console.WriteLine($"Invoking '{command}' for '{framework.GetShortFolderName()}'."); - return InvokeDependencyTool(commandFactory, dotnetParams, dotnetParams.Framework); + return InvokeDependencyTool(commandFactory, command, framework, configuration, appArguments); } private static int InvokeDependencyTool( ProjectDependenciesCommandFactory commandFactory, - DotnetBaseParams dotnetParams, - NuGetFramework framework) + string command, + NuGetFramework framework, + string configuration, + IEnumerable appArguments) { try { var exitCode = commandFactory.Create( - $"dotnet-{dotnetParams.Command}", - dotnetParams.RemainingArguments, + $"dotnet-{command}", + appArguments, framework, - dotnetParams.Config) + configuration) .ForwardStdErr() .ForwardStdOut() .Execute() diff --git a/TestAssets/TestPackages/dotnet-dependency-tool-invoker/dotnet-dependency-tool-invoker.csproj b/TestAssets/TestPackages/dotnet-dependency-tool-invoker/dotnet-dependency-tool-invoker.csproj index 47539b5f0..a6c5b91c1 100644 --- a/TestAssets/TestPackages/dotnet-dependency-tool-invoker/dotnet-dependency-tool-invoker.csproj +++ b/TestAssets/TestPackages/dotnet-dependency-tool-invoker/dotnet-dependency-tool-invoker.csproj @@ -16,13 +16,10 @@ $(CliVersionPrefix)-* - - - - + diff --git a/TestAssets/TestProjects/AppWith2Tfm0Rid/.noautobuild b/TestAssets/TestProjects/AppWith2Tfm0Rid/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/AppWith2Tfm0Rid/Program.cs b/TestAssets/TestProjects/AppWith2Tfm0Rid/Program.cs deleted file mode 100644 index 1b3eb2ea9..000000000 --- a/TestAssets/TestProjects/AppWith2Tfm0Rid/Program.cs +++ /dev/null @@ -1,20 +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.Xml; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main() - { - Console.WriteLine("Hello World!"); -#if NET20 || NET35 || NET45 || NET461 - // Force XmlDocument to be used - var doc = new XmlDocument(); -#endif - } - } -} diff --git a/TestAssets/TestProjects/AppWith2Tfm0Rid/project.json b/TestAssets/TestProjects/AppWith2Tfm0Rid/project.json deleted file mode 100644 index 068194430..000000000 --- a/TestAssets/TestProjects/AppWith2Tfm0Rid/project.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true - }, - "dependencies": {}, - "frameworks": { - "net461": { - "frameworkAssemblies": { - "System.Xml": {} - } - }, - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NetCore.App": { - "version": "1.1.0", - "type": "platform" - } - } - } - } -} diff --git a/TestAssets/TestProjects/AppWith4netTfm0Rid/.noautobuild b/TestAssets/TestProjects/AppWith4netTfm0Rid/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/AppWith4netTfm0Rid/Program.cs b/TestAssets/TestProjects/AppWith4netTfm0Rid/Program.cs deleted file mode 100644 index 1b3eb2ea9..000000000 --- a/TestAssets/TestProjects/AppWith4netTfm0Rid/Program.cs +++ /dev/null @@ -1,20 +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.Xml; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main() - { - Console.WriteLine("Hello World!"); -#if NET20 || NET35 || NET45 || NET461 - // Force XmlDocument to be used - var doc = new XmlDocument(); -#endif - } - } -} diff --git a/TestAssets/TestProjects/AppWith4netTfm0Rid/project.json b/TestAssets/TestProjects/AppWith4netTfm0Rid/project.json deleted file mode 100644 index 6324ec95a..000000000 --- a/TestAssets/TestProjects/AppWith4netTfm0Rid/project.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true - }, - "dependencies": {}, - "frameworks": { - "net20": { - "frameworkAssemblies": { - "System.Xml": {} - } - }, - "net35": { - "frameworkAssemblies": { - "System.Xml": {} - } - }, - "net40": { - "frameworkAssemblies": { - "System.Xml": {} - } - }, - "net461": { - "frameworkAssemblies": { - "System.Xml": {} - } - } - } -} diff --git a/TestAssets/TestProjects/AppWithAssemblyInfo/Program.cs b/TestAssets/TestProjects/AppWithAssemblyInfo/Program.cs deleted file mode 100644 index 003e251ce..000000000 --- a/TestAssets/TestProjects/AppWithAssemblyInfo/Program.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 System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace ConsoleApp1 -{ - public class Program - { - public static void Main(string[] args) - { - } - } -} diff --git a/TestAssets/TestProjects/AppWithAssemblyInfo/Properties/AssemblyInfo.cs b/TestAssets/TestProjects/AppWithAssemblyInfo/Properties/AssemblyInfo.cs deleted file mode 100644 index 5f2a0822d..000000000 --- a/TestAssets/TestProjects/AppWithAssemblyInfo/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,28 +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: AssemblyConfiguration("")] -[assembly: AssemblyCompanyAttribute("")] -[assembly: System.Reflection.AssemblyProduct("ConsoleApp1")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyFileVersion("")] -[assembly: AssemblyInformationalVersion("")] -[assembly: System.Reflection.AssemblyTitleAttribute("")] -[assembly: AssemblyVersion("1.0.0"), System.Resources.NeutralResourcesLanguageAttribute("")] - -// 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("ab699746-eb43-467d-ab46-6095b4de9722")] diff --git a/TestAssets/TestProjects/AppWithAssemblyInfo/project.json b/TestAssets/TestProjects/AppWithAssemblyInfo/project.json deleted file mode 100644 index dff934e8b..000000000 --- a/TestAssets/TestProjects/AppWithAssemblyInfo/project.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true - }, - - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.0" - } - }, - - "frameworks": { - "netcoreapp1.1": { - "imports": "dnxcore50" - } - } -} diff --git a/TestAssets/TestProjects/AppWithOutputAssemblyName/Program.cs b/TestAssets/TestProjects/AppWithOutputAssemblyName/Program.cs deleted file mode 100644 index b56f8e0b0..000000000 --- a/TestAssets/TestProjects/AppWithOutputAssemblyName/Program.cs +++ /dev/null @@ -1,13 +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 AppWithOutputAssemblyName -{ - public class MyApp - { - public static void Main() - { - System.Console.WriteLine("Hello, World!"); - } - } -} diff --git a/TestAssets/TestProjects/AppWithOutputAssemblyName/project.json b/TestAssets/TestProjects/AppWithOutputAssemblyName/project.json deleted file mode 100644 index 33eacba13..000000000 --- a/TestAssets/TestProjects/AppWithOutputAssemblyName/project.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "buildOptions": { - "outputName": "MyApp", - "emitEntryPoint": true - }, - "dependencies": { - "Microsoft.NETCore.App": "1.1.0" - }, - "frameworks": { - "netcoreapp1.1": {} - }, - "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/AppWithPackageNamedAfterFolder/TestAssets/TestAsset/.noautobuild b/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/TestAssets/TestAsset/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/TestAssets/TestAsset/Program.cs b/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/TestAssets/TestAsset/Program.cs deleted file mode 100644 index 21cf5b1d3..000000000 --- a/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/TestAssets/TestAsset/Program.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; - -namespace App.Tests -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World from Test asset!"); - } - } -} diff --git a/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/TestAssets/TestAsset/project.json b/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/TestAssets/TestAsset/project.json deleted file mode 100644 index be38f2878..000000000 --- a/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/TestAssets/TestAsset/project.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "frameworks": { - "netcoreapp1.1": { - "imports": [ - "portable-net451+win8" - ], - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.1.0", - "type": "platform" - } - } - } - } -} \ No newline at end of file diff --git a/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/global.json b/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/global.json deleted file mode 100644 index 3427cd57d..000000000 --- a/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/global.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "projects": [ - "src", - "test" - ] -} diff --git a/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/src/App/.noautobuild b/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/src/App/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/src/App/project.json b/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/src/App/project.json deleted file mode 100644 index b51c38f5f..000000000 --- a/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/src/App/project.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "frameworks": { - "net40": { - "frameworkAssemblies": { - "System.Configuration": "4.0.0.0", - "System.Data": "4.0.0.0", - "System.Data.Linq": "4.0.0.0", - "System.Xml": "4.0.0.0" - }, - "dependencies": { - "EntityFramework": "6.1.3", - "Microsoft.SqlServer.Types": "11.0.2" - } - }, - "net45": { - "buildOptions": { - "define": [ "ASYNC" ] - }, - "frameworkAssemblies": { - "System.Configuration": "4.0.0.0", - "System.Data": "4.0.0.0", - "System.Data.Linq": "4.0.0.0", - "System.Xml": "4.0.0.0" - }, - "dependencies": { - "EntityFramework": "6.1.3", - "Microsoft.SqlServer.Types": "11.0.2" - } - } - } -} \ No newline at end of file diff --git a/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/test/App.Tests/.noautobuild b/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/test/App.Tests/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/test/App.Tests/EntityFramework/Program.cs b/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/test/App.Tests/EntityFramework/Program.cs deleted file mode 100644 index c436bf19d..000000000 --- a/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/test/App.Tests/EntityFramework/Program.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; - -namespace App.Tests -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/test/App.Tests/project.json b/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/test/App.Tests/project.json deleted file mode 100644 index 510857461..000000000 --- a/TestAssets/TestProjects/AppWithPackageNamedAfterFolder/test/App.Tests/project.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "frameworks": { - "netcoreapp1.1": { - "imports": [ - "portable-net451+win8", - "dnxcore50" - ], - "buildOptions": { - "define": [ "ASYNC", "COREFX", "XUNIT2", "SQLITE" ] - }, - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.1.0", - "type": "platform" - } - } - } - } -} \ No newline at end of file diff --git a/TestAssets/TestProjects/FSharpTestProjects/TestApp/.noautobuild b/TestAssets/TestProjects/FSharpTestProjects/TestApp/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/FSharpTestProjects/TestApp/FSharpTestApp.xproj b/TestAssets/TestProjects/FSharpTestProjects/TestApp/FSharpTestApp.xproj deleted file mode 100644 index 4b792e869..000000000 --- a/TestAssets/TestProjects/FSharpTestProjects/TestApp/FSharpTestApp.xproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - a666217d-2aca-4866-b109-ea476e51c7aa - FSharpTestApp - ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\$(MSBuildProjectName)\ - - - - 2.0 - - - diff --git a/TestAssets/TestProjects/FSharpTestProjects/TestApp/Program.fs b/TestAssets/TestProjects/FSharpTestProjects/TestApp/Program.fs deleted file mode 100644 index 7375d5c55..000000000 --- a/TestAssets/TestProjects/FSharpTestProjects/TestApp/Program.fs +++ /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. - -namespace TestApp - -open System -open System.Diagnostics - -module Program = - - open TestLibrary - - [] - let Main (args: string array) = - printfn "%s" (TestLibrary.Helper.GetMessage()) - 0 diff --git a/TestAssets/TestProjects/FSharpTestProjects/TestApp/project.json b/TestAssets/TestProjects/FSharpTestProjects/TestApp/project.json deleted file mode 100644 index 46c065472..000000000 --- a/TestAssets/TestProjects/FSharpTestProjects/TestApp/project.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "compilerName": "fsc", - "compile": { - "includeFiles": [ - "Program.fs" - ] - } - }, - "dependencies": { - "TestLibrary": { - "version": "1.0.0-*", - "target": "project" - }, - "Microsoft.NETCore.App": "1.1.0", - "Microsoft.FSharp.Core.netcore": "1.0.0-alpha-160509" - }, - "tools": { - "dotnet-compile-fsc": { - "version": "1.0.0-preview2-*", - "imports": [ - "dnxcore50", - "portable-net45+win81", - "netstandard1.3" - ] - } - }, - "frameworks": { - "netcoreapp1.1": { - "imports": "dnxcore50" - } - }, - "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/FSharpTestProjects/TestLibrary/.noautobuild b/TestAssets/TestProjects/FSharpTestProjects/TestLibrary/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/FSharpTestProjects/TestLibrary/FSharpTestLibrary.xproj b/TestAssets/TestProjects/FSharpTestProjects/TestLibrary/FSharpTestLibrary.xproj deleted file mode 100644 index ae10bbff6..000000000 --- a/TestAssets/TestProjects/FSharpTestProjects/TestLibrary/FSharpTestLibrary.xproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - ec801982-096b-4af3-a42b-7881b1a7380e - FSharpTestLibrary - ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\$(MSBuildProjectName)\ - - - - 2.0 - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/FSharpTestProjects/TestLibrary/Helper.fs b/TestAssets/TestProjects/FSharpTestProjects/TestLibrary/Helper.fs deleted file mode 100644 index a29f6ac9a..000000000 --- a/TestAssets/TestProjects/FSharpTestProjects/TestLibrary/Helper.fs +++ /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. - -namespace TestLibrary - -open Lib - -type Helper() = - - static member GetMessage () = Lib.message () - - static member SayHi () = Lib.sayHi () diff --git a/TestAssets/TestProjects/FSharpTestProjects/TestLibrary/Helper2.fs b/TestAssets/TestProjects/FSharpTestProjects/TestLibrary/Helper2.fs deleted file mode 100644 index 6d374f769..000000000 --- a/TestAssets/TestProjects/FSharpTestProjects/TestLibrary/Helper2.fs +++ /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. - -module Lib - -open System - -let message () = - "This string came from the test library!" - -let sayHi () = - Console.WriteLine("Hello there!") diff --git a/TestAssets/TestProjects/FSharpTestProjects/TestLibrary/project.json b/TestAssets/TestProjects/FSharpTestProjects/TestLibrary/project.json deleted file mode 100644 index fff7c8bfb..000000000 --- a/TestAssets/TestProjects/FSharpTestProjects/TestLibrary/project.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "version": "1.0.0-*", - "dependencies": { - "Microsoft.FSharp.Core.netcore": "1.0.0-alpha-160509", - "NETStandard.Library": "1.6.0" - }, - "tools": { - "dotnet-compile-fsc": { - "version": "1.0.0-preview2-*", - "imports": [ - "dnxcore50", - "portable-net45+win81", - "netstandard1.3" - ] - } - }, - "frameworks": { - "netcoreapp1.0": { - "imports": "dnxcore50" - } - }, - "buildOptions": { - "compilerName": "fsc", - "compile": { - "includeFiles": [ - "Helper2.fs", - "Helper.fs" - ] - } - } -} diff --git a/TestAssets/TestProjects/LibraryWithNetStandardLibRef/.noautobuild b/TestAssets/TestProjects/LibraryWithNetStandardLibRef/.noautobuild deleted file mode 100644 index 8f7edc4ac..000000000 --- a/TestAssets/TestProjects/LibraryWithNetStandardLibRef/.noautobuild +++ /dev/null @@ -1 +0,0 @@ -noautobuild \ No newline at end of file diff --git a/TestAssets/TestProjects/LibraryWithNetStandardLibRef/Program.cs b/TestAssets/TestProjects/LibraryWithNetStandardLibRef/Program.cs deleted file mode 100644 index 334a639db..000000000 --- a/TestAssets/TestProjects/LibraryWithNetStandardLibRef/Program.cs +++ /dev/null @@ -1,8 +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; - -class Program -{ -} diff --git a/TestAssets/TestProjects/LibraryWithNetStandardLibRef/project.json b/TestAssets/TestProjects/LibraryWithNetStandardLibRef/project.json deleted file mode 100644 index 519b9beee..000000000 --- a/TestAssets/TestProjects/LibraryWithNetStandardLibRef/project.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "frameworks": { - "netstandard1.3": { - "dependencies": { - "System.AppContext": "4.1.0", - "NETStandard.Library": "1.5.0" - } - } - } -} diff --git a/TestAssets/TestProjects/LibraryWithoutNetStandardLibRef/.noautobuild b/TestAssets/TestProjects/LibraryWithoutNetStandardLibRef/.noautobuild deleted file mode 100644 index 8f7edc4ac..000000000 --- a/TestAssets/TestProjects/LibraryWithoutNetStandardLibRef/.noautobuild +++ /dev/null @@ -1 +0,0 @@ -noautobuild \ No newline at end of file diff --git a/TestAssets/TestProjects/LibraryWithoutNetStandardLibRef/Program.cs b/TestAssets/TestProjects/LibraryWithoutNetStandardLibRef/Program.cs deleted file mode 100644 index 334a639db..000000000 --- a/TestAssets/TestProjects/LibraryWithoutNetStandardLibRef/Program.cs +++ /dev/null @@ -1,8 +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; - -class Program -{ -} diff --git a/TestAssets/TestProjects/LibraryWithoutNetStandardLibRef/project.json b/TestAssets/TestProjects/LibraryWithoutNetStandardLibRef/project.json deleted file mode 100644 index 2ef2a4a2c..000000000 --- a/TestAssets/TestProjects/LibraryWithoutNetStandardLibRef/project.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "frameworks": { - "netstandard1.3": { - "dependencies": { - "System.AppContext": "4.1.0" - } - } - } -} diff --git a/TestAssets/TestProjects/PJLibWithMultipleFrameworks/.noautobuild b/TestAssets/TestProjects/PJLibWithMultipleFrameworks/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/PJLibWithMultipleFrameworks/Program.cs b/TestAssets/TestProjects/PJLibWithMultipleFrameworks/Program.cs deleted file mode 100644 index 235f81584..000000000 --- a/TestAssets/TestProjects/PJLibWithMultipleFrameworks/Program.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; - -namespace Library -{ - public class TestLib - { - public static void Test() - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/TestProjects/PJLibWithMultipleFrameworks/project.json b/TestAssets/TestProjects/PJLibWithMultipleFrameworks/project.json deleted file mode 100644 index 99c97f5a8..000000000 --- a/TestAssets/TestProjects/PJLibWithMultipleFrameworks/project.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "version": "1.0.0-*", - "frameworks": { - "netstandard1.6": { - "dependencies": { - "NETStandard.Library": "1.6" - } - }, - "netstandard1.3": { - "dependencies": { - "NETStandard.Library": "1.3" - } - }, - "net451": {} - } -} diff --git a/TestAssets/TestProjects/PJTestAppSimple/PJTestAppSimple.xproj b/TestAssets/TestProjects/PJTestAppSimple/PJTestAppSimple.xproj deleted file mode 100644 index 53f0c8b7a..000000000 --- a/TestAssets/TestProjects/PJTestAppSimple/PJTestAppSimple.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0.23107 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 0138cb8f-4aa9-4029-a21e-c07c30f425ba - TestAppWithContents - ..\..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\..\artifacts\ - - - 2.0 - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/PJTestAppSimple/PJTestAppSimple.xproj.user b/TestAssets/TestProjects/PJTestAppSimple/PJTestAppSimple.xproj.user deleted file mode 100644 index efbe88aa6..000000000 --- a/TestAssets/TestProjects/PJTestAppSimple/PJTestAppSimple.xproj.user +++ /dev/null @@ -1 +0,0 @@ -Ok, it's true. Didn't have an xproj user file handy and needed the file to exist so a test can show it gets moved to backup. \ No newline at end of file diff --git a/TestAssets/TestProjects/PJTestAppSimple/Program.cs b/TestAssets/TestProjects/PJTestAppSimple/Program.cs deleted file mode 100644 index 2130cd0a7..000000000 --- a/TestAssets/TestProjects/PJTestAppSimple/Program.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; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/TestProjects/PJTestAppSimple/project.json b/TestAssets/TestProjects/PJTestAppSimple/project.json deleted file mode 100755 index 1797b91c4..000000000 --- a/TestAssets/TestProjects/PJTestAppSimple/project.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true - }, - "dependencies": { - "Microsoft.NETCore.App": "1.1.0" - }, - "frameworks": { - "netcoreapp1.1": {} - }, - "runtimes": { - "win7-x64": {}, - "win7-x86": {}, - "osx.10.10-x64": {}, - "osx.10.11-x64": {}, - "osx.10.12-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/PJTestLibraryWithConfiguration/.noautobuild b/TestAssets/TestProjects/PJTestLibraryWithConfiguration/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/PJTestLibraryWithConfiguration/Helper.cs b/TestAssets/TestProjects/PJTestLibraryWithConfiguration/Helper.cs deleted file mode 100644 index 8c643796b..000000000 --- a/TestAssets/TestProjects/PJTestLibraryWithConfiguration/Helper.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; - -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/PJTestLibraryWithConfiguration/contentitem.txt b/TestAssets/TestProjects/PJTestLibraryWithConfiguration/contentitem.txt deleted file mode 100644 index 37ba8a3c3..000000000 --- a/TestAssets/TestProjects/PJTestLibraryWithConfiguration/contentitem.txt +++ /dev/null @@ -1 +0,0 @@ -Random content. \ No newline at end of file diff --git a/TestAssets/TestProjects/PJTestLibraryWithConfiguration/project.json b/TestAssets/TestProjects/PJTestLibraryWithConfiguration/project.json deleted file mode 100755 index e558ee487..000000000 --- a/TestAssets/TestProjects/PJTestLibraryWithConfiguration/project.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "nowarn": [ - "CS1591" - ], - "xmlDoc": true, - "additionalArguments": [ - "-highentropyva+" - ] - }, - "dependencies": { - "NETStandard.Library": "1.6.0" - }, - "configurations": { - "Test": {} - }, - "frameworks": { - "netstandard1.5": {} - }, - "packOptions": { - "files": { - "include": ["contentitem.txt"], - "mappings": { - "dir/contentitem.txt": "contentitem.txt" - } - } - } -} \ No newline at end of file diff --git a/TestAssets/TestProjects/ProjectJsonConsoleTemplate/Program.cs b/TestAssets/TestProjects/ProjectJsonConsoleTemplate/Program.cs deleted file mode 100644 index 7e52efa0e..000000000 --- a/TestAssets/TestProjects/ProjectJsonConsoleTemplate/Program.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 System; - -class Program -{ - static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } -} diff --git a/TestAssets/TestProjects/ProjectJsonConsoleTemplate/project.json b/TestAssets/TestProjects/ProjectJsonConsoleTemplate/project.json deleted file mode 100644 index 71dcdd6ed..000000000 --- a/TestAssets/TestProjects/ProjectJsonConsoleTemplate/project.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true - }, - "dependencies": {}, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.0" - } - }, - "imports": "dnxcore50" - } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/.bowerrc b/TestAssets/TestProjects/ProjectJsonWebTemplate/.bowerrc deleted file mode 100644 index 6406626ab..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "wwwroot/lib" -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/.gitignore b/TestAssets/TestProjects/ProjectJsonWebTemplate/.gitignore deleted file mode 100644 index 0ca27f04e..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/.gitignore +++ /dev/null @@ -1,234 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -build/ -bld/ -[Bb]in/ -[Oo]bj/ - -# Visual Studio 2015 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# DNX -project.lock.json -artifacts/ - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Microsoft Azure ApplicationInsights config file -ApplicationInsights.config - -# Windows Store app package directory -AppPackages/ -BundleArtifacts/ - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings -node_modules/ -orleans.codegen.cs - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe - -# FAKE - F# Make -.fake/ diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Controllers/AccountController.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Controllers/AccountController.cs deleted file mode 100644 index a6b81482d..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Controllers/AccountController.cs +++ /dev/null @@ -1,471 +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.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Rendering; -using Microsoft.Extensions.Logging; -using WebApplication.Models; -using WebApplication.Models.AccountViewModels; -using WebApplication.Services; - -namespace WebApplication.Controllers -{ - [Authorize] - public class AccountController : Controller - { - private readonly UserManager _userManager; - private readonly SignInManager _signInManager; - private readonly IEmailSender _emailSender; - private readonly ISmsSender _smsSender; - private readonly ILogger _logger; - - public AccountController( - UserManager userManager, - SignInManager signInManager, - IEmailSender emailSender, - ISmsSender smsSender, - ILoggerFactory loggerFactory) - { - _userManager = userManager; - _signInManager = signInManager; - _emailSender = emailSender; - _smsSender = smsSender; - _logger = loggerFactory.CreateLogger(); - } - - // - // GET: /Account/Login - [HttpGet] - [AllowAnonymous] - public IActionResult Login(string returnUrl = null) - { - ViewData["ReturnUrl"] = returnUrl; - return View(); - } - - // - // POST: /Account/Login - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task Login(LoginViewModel model, string returnUrl = null) - { - ViewData["ReturnUrl"] = returnUrl; - if (ModelState.IsValid) - { - // This doesn't count login failures towards account lockout - // To enable password failures to trigger account lockout, set lockoutOnFailure: true - var result = await _signInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, lockoutOnFailure: false); - if (result.Succeeded) - { - _logger.LogInformation(1, "User logged in."); - return RedirectToLocal(returnUrl); - } - if (result.RequiresTwoFactor) - { - return RedirectToAction(nameof(SendCode), new { ReturnUrl = returnUrl, RememberMe = model.RememberMe }); - } - if (result.IsLockedOut) - { - _logger.LogWarning(2, "User account locked out."); - return View("Lockout"); - } - else - { - ModelState.AddModelError(string.Empty, "Invalid login attempt."); - return View(model); - } - } - - // If we got this far, something failed, redisplay form - return View(model); - } - - // - // GET: /Account/Register - [HttpGet] - [AllowAnonymous] - public IActionResult Register(string returnUrl = null) - { - ViewData["ReturnUrl"] = returnUrl; - return View(); - } - - // - // POST: /Account/Register - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task Register(RegisterViewModel model, string returnUrl = null) - { - ViewData["ReturnUrl"] = returnUrl; - if (ModelState.IsValid) - { - var user = new ApplicationUser { UserName = model.Email, Email = model.Email }; - var result = await _userManager.CreateAsync(user, model.Password); - if (result.Succeeded) - { - // For more information on how to enable account confirmation and password reset please visit https://go.microsoft.com/fwlink/?LinkID=532713 - // Send an email with this link - //var code = await _userManager.GenerateEmailConfirmationTokenAsync(user); - //var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme); - //await _emailSender.SendEmailAsync(model.Email, "Confirm your account", - // $"Please confirm your account by clicking this link: link"); - await _signInManager.SignInAsync(user, isPersistent: false); - _logger.LogInformation(3, "User created a new account with password."); - return RedirectToLocal(returnUrl); - } - AddErrors(result); - } - - // If we got this far, something failed, redisplay form - return View(model); - } - - // - // POST: /Account/LogOff - [HttpPost] - [ValidateAntiForgeryToken] - public async Task LogOff() - { - await _signInManager.SignOutAsync(); - _logger.LogInformation(4, "User logged out."); - return RedirectToAction(nameof(HomeController.Index), "Home"); - } - - // - // POST: /Account/ExternalLogin - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public IActionResult ExternalLogin(string provider, string returnUrl = null) - { - // Request a redirect to the external login provider. - var redirectUrl = Url.Action("ExternalLoginCallback", "Account", new { ReturnUrl = returnUrl }); - var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl); - return Challenge(properties, provider); - } - - // - // GET: /Account/ExternalLoginCallback - [HttpGet] - [AllowAnonymous] - public async Task ExternalLoginCallback(string returnUrl = null, string remoteError = null) - { - if (remoteError != null) - { - ModelState.AddModelError(string.Empty, $"Error from external provider: {remoteError}"); - return View(nameof(Login)); - } - var info = await _signInManager.GetExternalLoginInfoAsync(); - if (info == null) - { - return RedirectToAction(nameof(Login)); - } - - // Sign in the user with this external login provider if the user already has a login. - var result = await _signInManager.ExternalLoginSignInAsync(info.LoginProvider, info.ProviderKey, isPersistent: false); - if (result.Succeeded) - { - _logger.LogInformation(5, "User logged in with {Name} provider.", info.LoginProvider); - return RedirectToLocal(returnUrl); - } - if (result.RequiresTwoFactor) - { - return RedirectToAction(nameof(SendCode), new { ReturnUrl = returnUrl }); - } - if (result.IsLockedOut) - { - return View("Lockout"); - } - else - { - // If the user does not have an account, then ask the user to create an account. - ViewData["ReturnUrl"] = returnUrl; - ViewData["LoginProvider"] = info.LoginProvider; - var email = info.Principal.FindFirstValue(ClaimTypes.Email); - return View("ExternalLoginConfirmation", new ExternalLoginConfirmationViewModel { Email = email }); - } - } - - // - // POST: /Account/ExternalLoginConfirmation - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task ExternalLoginConfirmation(ExternalLoginConfirmationViewModel model, string returnUrl = null) - { - if (ModelState.IsValid) - { - // Get the information about the user from the external login provider - var info = await _signInManager.GetExternalLoginInfoAsync(); - if (info == null) - { - return View("ExternalLoginFailure"); - } - var user = new ApplicationUser { UserName = model.Email, Email = model.Email }; - var result = await _userManager.CreateAsync(user); - if (result.Succeeded) - { - result = await _userManager.AddLoginAsync(user, info); - if (result.Succeeded) - { - await _signInManager.SignInAsync(user, isPersistent: false); - _logger.LogInformation(6, "User created an account using {Name} provider.", info.LoginProvider); - return RedirectToLocal(returnUrl); - } - } - AddErrors(result); - } - - ViewData["ReturnUrl"] = returnUrl; - return View(model); - } - - // GET: /Account/ConfirmEmail - [HttpGet] - [AllowAnonymous] - public async Task ConfirmEmail(string userId, string code) - { - if (userId == null || code == null) - { - return View("Error"); - } - var user = await _userManager.FindByIdAsync(userId); - if (user == null) - { - return View("Error"); - } - var result = await _userManager.ConfirmEmailAsync(user, code); - return View(result.Succeeded ? "ConfirmEmail" : "Error"); - } - - // - // GET: /Account/ForgotPassword - [HttpGet] - [AllowAnonymous] - public IActionResult ForgotPassword() - { - return View(); - } - - // - // POST: /Account/ForgotPassword - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task ForgotPassword(ForgotPasswordViewModel model) - { - if (ModelState.IsValid) - { - var user = await _userManager.FindByNameAsync(model.Email); - if (user == null || !(await _userManager.IsEmailConfirmedAsync(user))) - { - // Don't reveal that the user does not exist or is not confirmed - return View("ForgotPasswordConfirmation"); - } - - // For more information on how to enable account confirmation and password reset please visit https://go.microsoft.com/fwlink/?LinkID=532713 - // Send an email with this link - //var code = await _userManager.GeneratePasswordResetTokenAsync(user); - //var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme); - //await _emailSender.SendEmailAsync(model.Email, "Reset Password", - // $"Please reset your password by clicking here: link"); - //return View("ForgotPasswordConfirmation"); - } - - // If we got this far, something failed, redisplay form - return View(model); - } - - // - // GET: /Account/ForgotPasswordConfirmation - [HttpGet] - [AllowAnonymous] - public IActionResult ForgotPasswordConfirmation() - { - return View(); - } - - // - // GET: /Account/ResetPassword - [HttpGet] - [AllowAnonymous] - public IActionResult ResetPassword(string code = null) - { - return code == null ? View("Error") : View(); - } - - // - // POST: /Account/ResetPassword - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task ResetPassword(ResetPasswordViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - var user = await _userManager.FindByNameAsync(model.Email); - if (user == null) - { - // Don't reveal that the user does not exist - return RedirectToAction(nameof(AccountController.ResetPasswordConfirmation), "Account"); - } - var result = await _userManager.ResetPasswordAsync(user, model.Code, model.Password); - if (result.Succeeded) - { - return RedirectToAction(nameof(AccountController.ResetPasswordConfirmation), "Account"); - } - AddErrors(result); - return View(); - } - - // - // GET: /Account/ResetPasswordConfirmation - [HttpGet] - [AllowAnonymous] - public IActionResult ResetPasswordConfirmation() - { - return View(); - } - - // - // GET: /Account/SendCode - [HttpGet] - [AllowAnonymous] - public async Task SendCode(string returnUrl = null, bool rememberMe = false) - { - var user = await _signInManager.GetTwoFactorAuthenticationUserAsync(); - if (user == null) - { - return View("Error"); - } - var userFactors = await _userManager.GetValidTwoFactorProvidersAsync(user); - var factorOptions = userFactors.Select(purpose => new SelectListItem { Text = purpose, Value = purpose }).ToList(); - return View(new SendCodeViewModel { Providers = factorOptions, ReturnUrl = returnUrl, RememberMe = rememberMe }); - } - - // - // POST: /Account/SendCode - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task SendCode(SendCodeViewModel model) - { - if (!ModelState.IsValid) - { - return View(); - } - - var user = await _signInManager.GetTwoFactorAuthenticationUserAsync(); - if (user == null) - { - return View("Error"); - } - - // Generate the token and send it - var code = await _userManager.GenerateTwoFactorTokenAsync(user, model.SelectedProvider); - if (string.IsNullOrWhiteSpace(code)) - { - return View("Error"); - } - - var message = "Your security code is: " + code; - if (model.SelectedProvider == "Email") - { - await _emailSender.SendEmailAsync(await _userManager.GetEmailAsync(user), "Security Code", message); - } - else if (model.SelectedProvider == "Phone") - { - await _smsSender.SendSmsAsync(await _userManager.GetPhoneNumberAsync(user), message); - } - - return RedirectToAction(nameof(VerifyCode), new { Provider = model.SelectedProvider, ReturnUrl = model.ReturnUrl, RememberMe = model.RememberMe }); - } - - // - // GET: /Account/VerifyCode - [HttpGet] - [AllowAnonymous] - public async Task VerifyCode(string provider, bool rememberMe, string returnUrl = null) - { - // Require that the user has already logged in via username/password or external login - var user = await _signInManager.GetTwoFactorAuthenticationUserAsync(); - if (user == null) - { - return View("Error"); - } - return View(new VerifyCodeViewModel { Provider = provider, ReturnUrl = returnUrl, RememberMe = rememberMe }); - } - - // - // POST: /Account/VerifyCode - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task VerifyCode(VerifyCodeViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - - // The following code protects for brute force attacks against the two factor codes. - // If a user enters incorrect codes for a specified amount of time then the user account - // will be locked out for a specified amount of time. - var result = await _signInManager.TwoFactorSignInAsync(model.Provider, model.Code, model.RememberMe, model.RememberBrowser); - if (result.Succeeded) - { - return RedirectToLocal(model.ReturnUrl); - } - if (result.IsLockedOut) - { - _logger.LogWarning(7, "User account locked out."); - return View("Lockout"); - } - else - { - ModelState.AddModelError(string.Empty, "Invalid code."); - return View(model); - } - } - - #region Helpers - - private void AddErrors(IdentityResult result) - { - foreach (var error in result.Errors) - { - ModelState.AddModelError(string.Empty, error.Description); - } - } - - private Task GetCurrentUserAsync() - { - return _userManager.GetUserAsync(HttpContext.User); - } - - private IActionResult RedirectToLocal(string returnUrl) - { - if (Url.IsLocalUrl(returnUrl)) - { - return Redirect(returnUrl); - } - else - { - return RedirectToAction(nameof(HomeController.Index), "Home"); - } - } - - #endregion - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Controllers/HomeController.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Controllers/HomeController.cs deleted file mode 100644 index 67d139496..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Controllers/HomeController.cs +++ /dev/null @@ -1,38 +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.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace WebApplication.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() - { - return View(); - } - - public IActionResult About() - { - ViewData["Message"] = "Your application description page."; - - return View(); - } - - public IActionResult Contact() - { - ViewData["Message"] = "Your contact page."; - - return View(); - } - - public IActionResult Error() - { - return View(); - } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Controllers/ManageController.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Controllers/ManageController.cs deleted file mode 100644 index f7ff98504..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Controllers/ManageController.cs +++ /dev/null @@ -1,350 +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.Threading.Tasks; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using WebApplication.Models; -using WebApplication.Models.ManageViewModels; -using WebApplication.Services; - -namespace WebApplication.Controllers -{ - [Authorize] - public class ManageController : Controller - { - private readonly UserManager _userManager; - private readonly SignInManager _signInManager; - private readonly IEmailSender _emailSender; - private readonly ISmsSender _smsSender; - private readonly ILogger _logger; - - public ManageController( - UserManager userManager, - SignInManager signInManager, - IEmailSender emailSender, - ISmsSender smsSender, - ILoggerFactory loggerFactory) - { - _userManager = userManager; - _signInManager = signInManager; - _emailSender = emailSender; - _smsSender = smsSender; - _logger = loggerFactory.CreateLogger(); - } - - // - // GET: /Manage/Index - [HttpGet] - public async Task Index(ManageMessageId? message = null) - { - ViewData["StatusMessage"] = - message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed." - : message == ManageMessageId.SetPasswordSuccess ? "Your password has been set." - : message == ManageMessageId.SetTwoFactorSuccess ? "Your two-factor authentication provider has been set." - : message == ManageMessageId.Error ? "An error has occurred." - : message == ManageMessageId.AddPhoneSuccess ? "Your phone number was added." - : message == ManageMessageId.RemovePhoneSuccess ? "Your phone number was removed." - : ""; - - var user = await GetCurrentUserAsync(); - var model = new IndexViewModel - { - HasPassword = await _userManager.HasPasswordAsync(user), - PhoneNumber = await _userManager.GetPhoneNumberAsync(user), - TwoFactor = await _userManager.GetTwoFactorEnabledAsync(user), - Logins = await _userManager.GetLoginsAsync(user), - BrowserRemembered = await _signInManager.IsTwoFactorClientRememberedAsync(user) - }; - return View(model); - } - - // - // POST: /Manage/RemoveLogin - [HttpPost] - [ValidateAntiForgeryToken] - public async Task RemoveLogin(RemoveLoginViewModel account) - { - ManageMessageId? message = ManageMessageId.Error; - var user = await GetCurrentUserAsync(); - if (user != null) - { - var result = await _userManager.RemoveLoginAsync(user, account.LoginProvider, account.ProviderKey); - if (result.Succeeded) - { - await _signInManager.SignInAsync(user, isPersistent: false); - message = ManageMessageId.RemoveLoginSuccess; - } - } - return RedirectToAction(nameof(ManageLogins), new { Message = message }); - } - - // - // GET: /Manage/AddPhoneNumber - public IActionResult AddPhoneNumber() - { - return View(); - } - - // - // POST: /Manage/AddPhoneNumber - [HttpPost] - [ValidateAntiForgeryToken] - public async Task AddPhoneNumber(AddPhoneNumberViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - // Generate the token and send it - var user = await GetCurrentUserAsync(); - var code = await _userManager.GenerateChangePhoneNumberTokenAsync(user, model.PhoneNumber); - await _smsSender.SendSmsAsync(model.PhoneNumber, "Your security code is: " + code); - return RedirectToAction(nameof(VerifyPhoneNumber), new { PhoneNumber = model.PhoneNumber }); - } - - // - // POST: /Manage/EnableTwoFactorAuthentication - [HttpPost] - [ValidateAntiForgeryToken] - public async Task EnableTwoFactorAuthentication() - { - var user = await GetCurrentUserAsync(); - if (user != null) - { - await _userManager.SetTwoFactorEnabledAsync(user, true); - await _signInManager.SignInAsync(user, isPersistent: false); - _logger.LogInformation(1, "User enabled two-factor authentication."); - } - return RedirectToAction(nameof(Index), "Manage"); - } - - // - // POST: /Manage/DisableTwoFactorAuthentication - [HttpPost] - [ValidateAntiForgeryToken] - public async Task DisableTwoFactorAuthentication() - { - var user = await GetCurrentUserAsync(); - if (user != null) - { - await _userManager.SetTwoFactorEnabledAsync(user, false); - await _signInManager.SignInAsync(user, isPersistent: false); - _logger.LogInformation(2, "User disabled two-factor authentication."); - } - return RedirectToAction(nameof(Index), "Manage"); - } - - // - // GET: /Manage/VerifyPhoneNumber - [HttpGet] - public async Task VerifyPhoneNumber(string phoneNumber) - { - var code = await _userManager.GenerateChangePhoneNumberTokenAsync(await GetCurrentUserAsync(), phoneNumber); - // Send an SMS to verify the phone number - return phoneNumber == null ? View("Error") : View(new VerifyPhoneNumberViewModel { PhoneNumber = phoneNumber }); - } - - // - // POST: /Manage/VerifyPhoneNumber - [HttpPost] - [ValidateAntiForgeryToken] - public async Task VerifyPhoneNumber(VerifyPhoneNumberViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - var user = await GetCurrentUserAsync(); - if (user != null) - { - var result = await _userManager.ChangePhoneNumberAsync(user, model.PhoneNumber, model.Code); - if (result.Succeeded) - { - await _signInManager.SignInAsync(user, isPersistent: false); - return RedirectToAction(nameof(Index), new { Message = ManageMessageId.AddPhoneSuccess }); - } - } - // If we got this far, something failed, redisplay the form - ModelState.AddModelError(string.Empty, "Failed to verify phone number"); - return View(model); - } - - // - // POST: /Manage/RemovePhoneNumber - [HttpPost] - [ValidateAntiForgeryToken] - public async Task RemovePhoneNumber() - { - var user = await GetCurrentUserAsync(); - if (user != null) - { - var result = await _userManager.SetPhoneNumberAsync(user, null); - if (result.Succeeded) - { - await _signInManager.SignInAsync(user, isPersistent: false); - return RedirectToAction(nameof(Index), new { Message = ManageMessageId.RemovePhoneSuccess }); - } - } - return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error }); - } - - // - // GET: /Manage/ChangePassword - [HttpGet] - public IActionResult ChangePassword() - { - return View(); - } - - // - // POST: /Manage/ChangePassword - [HttpPost] - [ValidateAntiForgeryToken] - public async Task ChangePassword(ChangePasswordViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - var user = await GetCurrentUserAsync(); - if (user != null) - { - var result = await _userManager.ChangePasswordAsync(user, model.OldPassword, model.NewPassword); - if (result.Succeeded) - { - await _signInManager.SignInAsync(user, isPersistent: false); - _logger.LogInformation(3, "User changed their password successfully."); - return RedirectToAction(nameof(Index), new { Message = ManageMessageId.ChangePasswordSuccess }); - } - AddErrors(result); - return View(model); - } - return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error }); - } - - // - // GET: /Manage/SetPassword - [HttpGet] - public IActionResult SetPassword() - { - return View(); - } - - // - // POST: /Manage/SetPassword - [HttpPost] - [ValidateAntiForgeryToken] - public async Task SetPassword(SetPasswordViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - - var user = await GetCurrentUserAsync(); - if (user != null) - { - var result = await _userManager.AddPasswordAsync(user, model.NewPassword); - if (result.Succeeded) - { - await _signInManager.SignInAsync(user, isPersistent: false); - return RedirectToAction(nameof(Index), new { Message = ManageMessageId.SetPasswordSuccess }); - } - AddErrors(result); - return View(model); - } - return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error }); - } - - //GET: /Manage/ManageLogins - [HttpGet] - public async Task ManageLogins(ManageMessageId? message = null) - { - ViewData["StatusMessage"] = - message == ManageMessageId.RemoveLoginSuccess ? "The external login was removed." - : message == ManageMessageId.AddLoginSuccess ? "The external login was added." - : message == ManageMessageId.Error ? "An error has occurred." - : ""; - var user = await GetCurrentUserAsync(); - if (user == null) - { - return View("Error"); - } - var userLogins = await _userManager.GetLoginsAsync(user); - var otherLogins = _signInManager.GetExternalAuthenticationSchemes().Where(auth => userLogins.All(ul => auth.AuthenticationScheme != ul.LoginProvider)).ToList(); - ViewData["ShowRemoveButton"] = user.PasswordHash != null || userLogins.Count > 1; - return View(new ManageLoginsViewModel - { - CurrentLogins = userLogins, - OtherLogins = otherLogins - }); - } - - // - // POST: /Manage/LinkLogin - [HttpPost] - [ValidateAntiForgeryToken] - public IActionResult LinkLogin(string provider) - { - // Request a redirect to the external login provider to link a login for the current user - var redirectUrl = Url.Action("LinkLoginCallback", "Manage"); - var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl, _userManager.GetUserId(User)); - return Challenge(properties, provider); - } - - // - // GET: /Manage/LinkLoginCallback - [HttpGet] - public async Task LinkLoginCallback() - { - var user = await GetCurrentUserAsync(); - if (user == null) - { - return View("Error"); - } - var info = await _signInManager.GetExternalLoginInfoAsync(await _userManager.GetUserIdAsync(user)); - if (info == null) - { - return RedirectToAction(nameof(ManageLogins), new { Message = ManageMessageId.Error }); - } - var result = await _userManager.AddLoginAsync(user, info); - var message = result.Succeeded ? ManageMessageId.AddLoginSuccess : ManageMessageId.Error; - return RedirectToAction(nameof(ManageLogins), new { Message = message }); - } - - #region Helpers - - private void AddErrors(IdentityResult result) - { - foreach (var error in result.Errors) - { - ModelState.AddModelError(string.Empty, error.Description); - } - } - - public enum ManageMessageId - { - AddPhoneSuccess, - AddLoginSuccess, - ChangePasswordSuccess, - SetTwoFactorSuccess, - SetPasswordSuccess, - RemoveLoginSuccess, - RemovePhoneSuccess, - Error - } - - private Task GetCurrentUserAsync() - { - return _userManager.GetUserAsync(HttpContext.User); - } - - #endregion - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Data/ApplicationDbContext.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Data/ApplicationDbContext.cs deleted file mode 100644 index 329199667..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Data/ApplicationDbContext.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.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using WebApplication.Models; - -namespace WebApplication.Data -{ - public class ApplicationDbContext : IdentityDbContext - { - public ApplicationDbContext(DbContextOptions options) - : base(options) - { - } - - protected override void OnModelCreating(ModelBuilder builder) - { - base.OnModelCreating(builder); - // Customize the ASP.NET Identity model and override the defaults if needed. - // For example, you can rename the ASP.NET Identity table names and more. - // Add your customizations after calling base.OnModelCreating(builder); - } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs deleted file mode 100644 index 5262b9296..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs +++ /dev/null @@ -1,215 +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.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using WebApplication.Data; - -namespace WebApplication.Data.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("00000000000000_CreateIdentitySchema")] - partial class CreateIdentitySchema - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { - modelBuilder - .HasAnnotation("ProductVersion", "1.0.0-rc2-20901"); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b => - { - b.Property("Id"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasAnnotation("MaxLength", 256); - - b.Property("NormalizedName") - .HasAnnotation("MaxLength", 256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("WebApplication.Models.ApplicationUser", b => - { - b.Property("Id"); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasAnnotation("MaxLength", 256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasAnnotation("MaxLength", 256); - - b.Property("NormalizedUserName") - .HasAnnotation("MaxLength", 256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasAnnotation("MaxLength", 256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => - { - b.HasOne("WebApplication.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => - { - b.HasOne("WebApplication.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("WebApplication.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Data/Migrations/00000000000000_CreateIdentitySchema.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Data/Migrations/00000000000000_CreateIdentitySchema.cs deleted file mode 100644 index 751316b28..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Data/Migrations/00000000000000_CreateIdentitySchema.cs +++ /dev/null @@ -1,218 +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.EntityFrameworkCore.Migrations; - -namespace WebApplication.Data.Migrations -{ - public partial class CreateIdentitySchema : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "AspNetRoles", - columns: table => new - { - Id = table.Column(nullable: false), - ConcurrencyStamp = table.Column(nullable: true), - Name = table.Column(nullable: true), - NormalizedName = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetRoles", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserTokens", - columns: table => new - { - UserId = table.Column(nullable: false), - LoginProvider = table.Column(nullable: false), - Name = table.Column(nullable: false), - Value = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); - }); - - migrationBuilder.CreateTable( - name: "AspNetUsers", - columns: table => new - { - Id = table.Column(nullable: false), - AccessFailedCount = table.Column(nullable: false), - ConcurrencyStamp = table.Column(nullable: true), - Email = table.Column(nullable: true), - EmailConfirmed = table.Column(nullable: false), - LockoutEnabled = table.Column(nullable: false), - LockoutEnd = table.Column(nullable: true), - NormalizedEmail = table.Column(nullable: true), - NormalizedUserName = table.Column(nullable: true), - PasswordHash = table.Column(nullable: true), - PhoneNumber = table.Column(nullable: true), - PhoneNumberConfirmed = table.Column(nullable: false), - SecurityStamp = table.Column(nullable: true), - TwoFactorEnabled = table.Column(nullable: false), - UserName = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUsers", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AspNetRoleClaims", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Autoincrement", true), - ClaimType = table.Column(nullable: true), - ClaimValue = table.Column(nullable: true), - RoleId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id); - table.ForeignKey( - name: "FK_AspNetRoleClaims_AspNetRoles_RoleId", - column: x => x.RoleId, - principalTable: "AspNetRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserClaims", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Autoincrement", true), - ClaimType = table.Column(nullable: true), - ClaimValue = table.Column(nullable: true), - UserId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); - table.ForeignKey( - name: "FK_AspNetUserClaims_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserLogins", - columns: table => new - { - LoginProvider = table.Column(nullable: false), - ProviderKey = table.Column(nullable: false), - ProviderDisplayName = table.Column(nullable: true), - UserId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey }); - table.ForeignKey( - name: "FK_AspNetUserLogins_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserRoles", - columns: table => new - { - UserId = table.Column(nullable: false), - RoleId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId }); - table.ForeignKey( - name: "FK_AspNetUserRoles_AspNetRoles_RoleId", - column: x => x.RoleId, - principalTable: "AspNetRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AspNetUserRoles_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "RoleNameIndex", - table: "AspNetRoles", - column: "NormalizedName"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetRoleClaims_RoleId", - table: "AspNetRoleClaims", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserClaims_UserId", - table: "AspNetUserClaims", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserLogins_UserId", - table: "AspNetUserLogins", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserRoles_RoleId", - table: "AspNetUserRoles", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserRoles_UserId", - table: "AspNetUserRoles", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "EmailIndex", - table: "AspNetUsers", - column: "NormalizedEmail"); - - migrationBuilder.CreateIndex( - name: "UserNameIndex", - table: "AspNetUsers", - column: "NormalizedUserName"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AspNetRoleClaims"); - - migrationBuilder.DropTable( - name: "AspNetUserClaims"); - - migrationBuilder.DropTable( - name: "AspNetUserLogins"); - - migrationBuilder.DropTable( - name: "AspNetUserRoles"); - - migrationBuilder.DropTable( - name: "AspNetUserTokens"); - - migrationBuilder.DropTable( - name: "AspNetRoles"); - - migrationBuilder.DropTable( - name: "AspNetUsers"); - } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Data/Migrations/ApplicationDbContextModelSnapshot.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Data/Migrations/ApplicationDbContextModelSnapshot.cs deleted file mode 100644 index 54608c041..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Data/Migrations/ApplicationDbContextModelSnapshot.cs +++ /dev/null @@ -1,214 +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.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using WebApplication.Data; - -namespace WebApplication.Data.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - partial class ApplicationDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { - modelBuilder - .HasAnnotation("ProductVersion", "1.0.0-rc2-20901"); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b => - { - b.Property("Id"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasAnnotation("MaxLength", 256); - - b.Property("NormalizedName") - .HasAnnotation("MaxLength", 256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("WebApplication.Models.ApplicationUser", b => - { - b.Property("Id"); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasAnnotation("MaxLength", 256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasAnnotation("MaxLength", 256); - - b.Property("NormalizedUserName") - .HasAnnotation("MaxLength", 256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasAnnotation("MaxLength", 256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => - { - b.HasOne("WebApplication.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => - { - b.HasOne("WebApplication.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("WebApplication.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs deleted file mode 100644 index 033c4b789..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/AccountViewModels/ExternalLoginConfirmationViewModel.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. - -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.AccountViewModels -{ - public class ExternalLoginConfirmationViewModel - { - [Required] - [EmailAddress] - public string Email { get; set; } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/AccountViewModels/ForgotPasswordViewModel.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/AccountViewModels/ForgotPasswordViewModel.cs deleted file mode 100644 index 5b026a9f3..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/AccountViewModels/ForgotPasswordViewModel.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. - -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.AccountViewModels -{ - public class ForgotPasswordViewModel - { - [Required] - [EmailAddress] - public string Email { get; set; } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/AccountViewModels/LoginViewModel.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/AccountViewModels/LoginViewModel.cs deleted file mode 100644 index ae17051ab..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/AccountViewModels/LoginViewModel.cs +++ /dev/null @@ -1,25 +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.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.AccountViewModels -{ - public class LoginViewModel - { - [Required] - [EmailAddress] - public string Email { get; set; } - - [Required] - [DataType(DataType.Password)] - public string Password { get; set; } - - [Display(Name = "Remember me?")] - public bool RememberMe { get; set; } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/AccountViewModels/RegisterViewModel.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/AccountViewModels/RegisterViewModel.cs deleted file mode 100644 index a6d5f1a96..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/AccountViewModels/RegisterViewModel.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.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.AccountViewModels -{ - public class RegisterViewModel - { - [Required] - [EmailAddress] - [Display(Name = "Email")] - public string Email { get; set; } - - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "Password")] - public string Password { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm password")] - [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/AccountViewModels/ResetPasswordViewModel.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/AccountViewModels/ResetPasswordViewModel.cs deleted file mode 100644 index 15c2967f1..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/AccountViewModels/ResetPasswordViewModel.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.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.AccountViewModels -{ - public class ResetPasswordViewModel - { - [Required] - [EmailAddress] - public string Email { get; set; } - - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - public string Password { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm password")] - [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - - public string Code { get; set; } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/AccountViewModels/SendCodeViewModel.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/AccountViewModels/SendCodeViewModel.cs deleted file mode 100644 index 2f44b9951..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/AccountViewModels/SendCodeViewModel.cs +++ /dev/null @@ -1,22 +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.Threading.Tasks; -using Microsoft.AspNetCore.Mvc.Rendering; - -namespace WebApplication.Models.AccountViewModels -{ - public class SendCodeViewModel - { - public string SelectedProvider { get; set; } - - public ICollection Providers { get; set; } - - public string ReturnUrl { get; set; } - - public bool RememberMe { get; set; } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/AccountViewModels/VerifyCodeViewModel.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/AccountViewModels/VerifyCodeViewModel.cs deleted file mode 100644 index c1016c143..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/AccountViewModels/VerifyCodeViewModel.cs +++ /dev/null @@ -1,28 +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.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.AccountViewModels -{ - public class VerifyCodeViewModel - { - [Required] - public string Provider { get; set; } - - [Required] - public string Code { get; set; } - - public string ReturnUrl { get; set; } - - [Display(Name = "Remember this browser?")] - public bool RememberBrowser { get; set; } - - [Display(Name = "Remember me?")] - public bool RememberMe { get; set; } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ApplicationUser.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ApplicationUser.cs deleted file mode 100644 index 047cfadd5..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ApplicationUser.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; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; - -namespace WebApplication.Models -{ - // Add profile data for application users by adding properties to the ApplicationUser class - public class ApplicationUser : IdentityUser - { - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/AddPhoneNumberViewModel.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/AddPhoneNumberViewModel.cs deleted file mode 100644 index 0648e6f44..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/AddPhoneNumberViewModel.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 System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.ManageViewModels -{ - public class AddPhoneNumberViewModel - { - [Required] - [Phone] - [Display(Name = "Phone number")] - public string PhoneNumber { get; set; } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/ChangePasswordViewModel.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/ChangePasswordViewModel.cs deleted file mode 100644 index 51093e9b1..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/ChangePasswordViewModel.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.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.ManageViewModels -{ - public class ChangePasswordViewModel - { - [Required] - [DataType(DataType.Password)] - [Display(Name = "Current password")] - public string OldPassword { get; set; } - - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "New password")] - public string NewPassword { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm new password")] - [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs deleted file mode 100644 index e56af0ec0..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/ConfigureTwoFactorViewModel.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. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc.Rendering; - -namespace WebApplication.Models.ManageViewModels -{ - public class ConfigureTwoFactorViewModel - { - public string SelectedProvider { get; set; } - - public ICollection Providers { get; set; } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/FactorViewModel.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/FactorViewModel.cs deleted file mode 100644 index 1b74bc14b..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/FactorViewModel.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; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.ManageViewModels -{ - public class FactorViewModel - { - public string Purpose { get; set; } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/IndexViewModel.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/IndexViewModel.cs deleted file mode 100644 index f97ce4cf4..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/IndexViewModel.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.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Identity; - -namespace WebApplication.Models.ManageViewModels -{ - public class IndexViewModel - { - public bool HasPassword { get; set; } - - public IList Logins { get; set; } - - public string PhoneNumber { get; set; } - - public bool TwoFactor { get; set; } - - public bool BrowserRemembered { get; set; } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/ManageLoginsViewModel.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/ManageLoginsViewModel.cs deleted file mode 100644 index e2474b126..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/ManageLoginsViewModel.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 System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Http.Authentication; -using Microsoft.AspNetCore.Identity; - -namespace WebApplication.Models.ManageViewModels -{ - public class ManageLoginsViewModel - { - public IList CurrentLogins { get; set; } - - public IList OtherLogins { get; set; } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/RemoveLoginViewModel.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/RemoveLoginViewModel.cs deleted file mode 100644 index 031d5421b..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/RemoveLoginViewModel.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 System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.ManageViewModels -{ - public class RemoveLoginViewModel - { - public string LoginProvider { get; set; } - public string ProviderKey { get; set; } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/SetPasswordViewModel.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/SetPasswordViewModel.cs deleted file mode 100644 index 861834531..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/SetPasswordViewModel.cs +++ /dev/null @@ -1,25 +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.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.ManageViewModels -{ - public class SetPasswordViewModel - { - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "New password")] - public string NewPassword { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm new password")] - [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs deleted file mode 100644 index 13ee9834e..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs +++ /dev/null @@ -1,22 +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.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.ManageViewModels -{ - public class VerifyPhoneNumberViewModel - { - [Required] - public string Code { get; set; } - - [Required] - [Phone] - [Display(Name = "Phone number")] - public string PhoneNumber { get; set; } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Program.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Program.cs deleted file mode 100644 index de237aae7..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Program.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; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Hosting; - -namespace WebApplication -{ - public class Program - { - public static void Main(string[] args) - { - var host = new WebHostBuilder() - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseIISIntegration() - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/README.md b/TestAssets/TestProjects/ProjectJsonWebTemplate/README.md deleted file mode 100644 index d8ba0b382..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# Welcome to ASP.NET Core - -We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. - -You've created a new ASP.NET Core project. [Learn what's new](https://go.microsoft.com/fwlink/?LinkId=518016) - -## This application consists of: - -* Sample pages using ASP.NET Core MVC -* [Gulp](https://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](https://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side libraries -* Theming using [Bootstrap](https://go.microsoft.com/fwlink/?LinkID=398939) - -## How to - -* [Add a Controller and View](https://go.microsoft.com/fwlink/?LinkID=398600) -* [Add an appsetting in config and access it in app.](https://go.microsoft.com/fwlink/?LinkID=699562) -* [Manage User Secrets using Secret Manager.](https://go.microsoft.com/fwlink/?LinkId=699315) -* [Use logging to log a message.](https://go.microsoft.com/fwlink/?LinkId=699316) -* [Add packages using NuGet.](https://go.microsoft.com/fwlink/?LinkId=699317) -* [Add client packages using Bower.](https://go.microsoft.com/fwlink/?LinkId=699318) -* [Target development, staging or production environment.](https://go.microsoft.com/fwlink/?LinkId=699319) - -## Overview - -* [Conceptual overview of what is ASP.NET Core](https://go.microsoft.com/fwlink/?LinkId=518008) -* [Fundamentals of ASP.NET Core such as Startup and middleware.](https://go.microsoft.com/fwlink/?LinkId=699320) -* [Working with Data](https://go.microsoft.com/fwlink/?LinkId=398602) -* [Security](https://go.microsoft.com/fwlink/?LinkId=398603) -* [Client side development](https://go.microsoft.com/fwlink/?LinkID=699321) -* [Develop on different platforms](https://go.microsoft.com/fwlink/?LinkID=699322) -* [Read more on the documentation site](https://go.microsoft.com/fwlink/?LinkID=699323) - -## Run & Deploy - -* [Run your app](https://go.microsoft.com/fwlink/?LinkID=517851) -* [Run tools such as EF migrations and more](https://go.microsoft.com/fwlink/?LinkID=517853) -* [Publish to Microsoft Azure Web Apps](https://go.microsoft.com/fwlink/?LinkID=398609) - -We would love to hear your [feedback](https://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Services/IEmailSender.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Services/IEmailSender.cs deleted file mode 100644 index 8010a870c..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Services/IEmailSender.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; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Services -{ - public interface IEmailSender - { - Task SendEmailAsync(string email, string subject, string message); - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Services/ISmsSender.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Services/ISmsSender.cs deleted file mode 100644 index b887b6113..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Services/ISmsSender.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; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Services -{ - public interface ISmsSender - { - Task SendSmsAsync(string number, string message); - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Services/MessageServices.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Services/MessageServices.cs deleted file mode 100644 index c3ee43128..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Services/MessageServices.cs +++ /dev/null @@ -1,28 +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.Threading.Tasks; - -namespace WebApplication.Services -{ - // This class is used by the application to send Email and SMS - // when you turn on two-factor authentication in ASP.NET Identity. - // For more details see this link https://go.microsoft.com/fwlink/?LinkID=532713 - public class AuthMessageSender : IEmailSender, ISmsSender - { - public Task SendEmailAsync(string email, string subject, string message) - { - // Plug in your email service here to send an email. - return Task.FromResult(0); - } - - public Task SendSmsAsync(string number, string message) - { - // Plug in your SMS service here to send a text message. - return Task.FromResult(0); - } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Startup.cs b/TestAssets/TestProjects/ProjectJsonWebTemplate/Startup.cs deleted file mode 100644 index 9280e73f0..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Startup.cs +++ /dev/null @@ -1,91 +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.Threading.Tasks; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using WebApplication.Data; -using WebApplication.Models; -using WebApplication.Services; - -namespace WebApplication -{ - public class Startup - { - public Startup(IHostingEnvironment env) - { - var builder = new ConfigurationBuilder() - .SetBasePath(env.ContentRootPath) - .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) - .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true); - - if (env.IsDevelopment()) - { - // For more details on using the user secret store see https://go.microsoft.com/fwlink/?LinkID=532709 - builder.AddUserSecrets(); - } - - builder.AddEnvironmentVariables(); - Configuration = builder.Build(); - } - - public IConfigurationRoot Configuration { get; } - - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - // Add framework services. - services.AddDbContext(options => - options.UseSqlite(Configuration.GetConnectionString("DefaultConnection"))); - - services.AddIdentity() - .AddEntityFrameworkStores() - .AddDefaultTokenProviders(); - - services.AddMvc(); - - // Add application services. - services.AddTransient(); - services.AddTransient(); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) - { - loggerFactory.AddConsole(Configuration.GetSection("Logging")); - loggerFactory.AddDebug(); - - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - app.UseDatabaseErrorPage(); - app.UseBrowserLink(); - } - else - { - app.UseExceptionHandler("/Home/Error"); - } - - app.UseStaticFiles(); - - app.UseIdentity(); - - // Add external authentication middleware below. To configure them please see https://go.microsoft.com/fwlink/?LinkID=532715 - - app.UseMvc(routes => - { - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - }); - } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/ConfirmEmail.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/ConfirmEmail.cshtml deleted file mode 100644 index 8e8088d44..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/ConfirmEmail.cshtml +++ /dev/null @@ -1,10 +0,0 @@ -@{ - ViewData["Title"] = "Confirm Email"; -} - -

@ViewData["Title"].

-
-

- Thank you for confirming your email. Please Click here to Log in. -

-
diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/ExternalLoginConfirmation.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/ExternalLoginConfirmation.cshtml deleted file mode 100644 index eb3612b55..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/ExternalLoginConfirmation.cshtml +++ /dev/null @@ -1,35 +0,0 @@ -@model ExternalLoginConfirmationViewModel -@{ - ViewData["Title"] = "Register"; -} - -

@ViewData["Title"].

-

Associate your @ViewData["LoginProvider"] account.

- -
-

Association Form

-
-
- -

- You've successfully authenticated with @ViewData["LoginProvider"]. - Please enter an email address for this site below and click the Register button to finish - logging in. -

-
- -
- - -
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/ExternalLoginFailure.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/ExternalLoginFailure.cshtml deleted file mode 100644 index 2509746be..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/ExternalLoginFailure.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@{ - ViewData["Title"] = "Login Failure"; -} - -
-

@ViewData["Title"].

-

Unsuccessful login with service.

-
diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/ForgotPassword.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/ForgotPassword.cshtml deleted file mode 100644 index 9d748023f..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/ForgotPassword.cshtml +++ /dev/null @@ -1,31 +0,0 @@ -@model ForgotPasswordViewModel -@{ - ViewData["Title"] = "Forgot your password?"; -} - -

@ViewData["Title"]

-

- For more information on how to enable reset password please see this article. -

- -@*
-

Enter your email.

-
-
-
- -
- - -
-
-
-
- -
-
-
*@ - -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/ForgotPasswordConfirmation.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/ForgotPasswordConfirmation.cshtml deleted file mode 100644 index 4877fc83a..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/ForgotPasswordConfirmation.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@{ - ViewData["Title"] = "Forgot Password Confirmation"; -} - -

@ViewData["Title"].

-

- Please check your email to reset your password. -

diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/Lockout.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/Lockout.cshtml deleted file mode 100644 index 34ac56ff3..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/Lockout.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@{ - ViewData["Title"] = "Locked out"; -} - -
-

Locked out.

-

This account has been locked out, please try again later.

-
diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/Login.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/Login.cshtml deleted file mode 100644 index 95430a12e..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/Login.cshtml +++ /dev/null @@ -1,92 +0,0 @@ -@using System.Collections.Generic -@using Microsoft.AspNetCore.Http -@using Microsoft.AspNetCore.Http.Authentication -@model LoginViewModel -@inject SignInManager SignInManager - -@{ - ViewData["Title"] = "Log in"; -} - -

@ViewData["Title"].

-
-
-
-
-

Use a local account to log in.

-
-
-
- -
- - -
-
-
- -
- - -
-
-
-
-
- -
-
-
-
-
- -
-
-

- Register as a new user? -

-

- Forgot your password? -

-
-
-
-
-
-

Use another service to log in.

-
- @{ - var loginProviders = SignInManager.GetExternalAuthenticationSchemes().ToList(); - if (loginProviders.Count == 0) - { -
-

- There are no external authentication services configured. See this article - for details on setting up this ASP.NET application to support logging in via external services. -

-
- } - else - { -
-
-

- @foreach (var provider in loginProviders) - { - - } -

-
-
- } - } -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/Register.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/Register.cshtml deleted file mode 100644 index 2090f900e..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/Register.cshtml +++ /dev/null @@ -1,42 +0,0 @@ -@model RegisterViewModel -@{ - ViewData["Title"] = "Register"; -} - -

@ViewData["Title"].

- -
-

Create a new account.

-
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/ResetPassword.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/ResetPassword.cshtml deleted file mode 100644 index dd716d735..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/ResetPassword.cshtml +++ /dev/null @@ -1,43 +0,0 @@ -@model ResetPasswordViewModel -@{ - ViewData["Title"] = "Reset password"; -} - -

@ViewData["Title"].

- -
-

Reset your password.

-
-
- -
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/ResetPasswordConfirmation.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/ResetPasswordConfirmation.cshtml deleted file mode 100644 index 6321d858e..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/ResetPasswordConfirmation.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@{ - ViewData["Title"] = "Reset password confirmation"; -} - -

@ViewData["Title"].

-

- Your password has been reset. Please Click here to log in. -

diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/SendCode.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/SendCode.cshtml deleted file mode 100644 index e85ca3c2b..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/SendCode.cshtml +++ /dev/null @@ -1,21 +0,0 @@ -@model SendCodeViewModel -@{ - ViewData["Title"] = "Send Verification Code"; -} - -

@ViewData["Title"].

- -
- -
-
- Select Two-Factor Authentication Provider: - - -
-
-
- -@section Scripts { - @{await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/VerifyCode.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/VerifyCode.cshtml deleted file mode 100644 index 60afb361d..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Account/VerifyCode.cshtml +++ /dev/null @@ -1,38 +0,0 @@ -@model VerifyCodeViewModel -@{ - ViewData["Title"] = "Verify"; -} - -

@ViewData["Title"].

- -
-
- - -

@ViewData["Status"]

-
-
- -
- - -
-
-
-
-
- - -
-
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Home/About.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Home/About.cshtml deleted file mode 100644 index b653a26f1..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Home/About.cshtml +++ /dev/null @@ -1,7 +0,0 @@ -@{ - ViewData["Title"] = "About"; -} -

@ViewData["Title"].

-

@ViewData["Message"]

- -

Use this area to provide additional information.

diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Home/Contact.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Home/Contact.cshtml deleted file mode 100644 index f953aa63d..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Home/Contact.cshtml +++ /dev/null @@ -1,17 +0,0 @@ -@{ - ViewData["Title"] = "Contact"; -} -

@ViewData["Title"].

-

@ViewData["Message"]

- -
- One Microsoft Way
- Redmond, WA 98052-6399
- P: - 425.555.0100 -
- -
- Support: Support@example.com
- Marketing: Marketing@example.com -
diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Home/Index.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Home/Index.cshtml deleted file mode 100644 index 957b8c1da..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Home/Index.cshtml +++ /dev/null @@ -1,109 +0,0 @@ -@{ - ViewData["Title"] = "Home Page"; -} - - - - diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Manage/AddPhoneNumber.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Manage/AddPhoneNumber.cshtml deleted file mode 100644 index 2feb93b22..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Manage/AddPhoneNumber.cshtml +++ /dev/null @@ -1,27 +0,0 @@ -@model AddPhoneNumberViewModel -@{ - ViewData["Title"] = "Add Phone Number"; -} - -

@ViewData["Title"].

-
-

Add a phone number.

-
-
-
- -
- - -
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Manage/ChangePassword.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Manage/ChangePassword.cshtml deleted file mode 100644 index 41c7960c8..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Manage/ChangePassword.cshtml +++ /dev/null @@ -1,42 +0,0 @@ -@model ChangePasswordViewModel -@{ - ViewData["Title"] = "Change Password"; -} - -

@ViewData["Title"].

- -
-

Change Password Form

-
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Manage/Index.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Manage/Index.cshtml deleted file mode 100644 index 8419b2429..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Manage/Index.cshtml +++ /dev/null @@ -1,71 +0,0 @@ -@model IndexViewModel -@{ - ViewData["Title"] = "Manage your account"; -} - -

@ViewData["Title"].

-

@ViewData["StatusMessage"]

- -
-

Change your account settings

-
-
-
Password:
-
- @if (Model.HasPassword) - { - Change - } - else - { - Create - } -
-
External Logins:
-
- - @Model.Logins.Count Manage -
-
Phone Number:
-
-

- Phone Numbers can used as a second factor of verification in two-factor authentication. - See this article - for details on setting up this ASP.NET application to support two-factor authentication using SMS. -

- @*@(Model.PhoneNumber ?? "None") - @if (Model.PhoneNumber != null) - { -
- Change -
- [] -
- } - else - { - Add - }*@ -
- -
Two-Factor Authentication:
-
-

- There are no two-factor authentication providers configured. See this article - for setting up this application to support two-factor authentication. -

- @*@if (Model.TwoFactor) - { -
- Enabled -
- } - else - { -
- Disabled -
- }*@ -
-
-
diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Manage/ManageLogins.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Manage/ManageLogins.cshtml deleted file mode 100644 index 35e12da68..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Manage/ManageLogins.cshtml +++ /dev/null @@ -1,54 +0,0 @@ -@model ManageLoginsViewModel -@using Microsoft.AspNetCore.Http.Authentication -@{ - ViewData["Title"] = "Manage your external logins"; -} - -

@ViewData["Title"].

- -

@ViewData["StatusMessage"]

-@if (Model.CurrentLogins.Count > 0) -{ -

Registered Logins

- - - @for (var index = 0; index < Model.CurrentLogins.Count; index++) - { - - - - - } - -
@Model.CurrentLogins[index].LoginProvider - @if ((bool)ViewData["ShowRemoveButton"]) - { -
-
- - - -
-
- } - else - { - @:   - } -
-} -@if (Model.OtherLogins.Count > 0) -{ -

Add another service to log in.

-
-
-
-

- @foreach (var provider in Model.OtherLogins) - { - - } -

-
-
-} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Manage/SetPassword.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Manage/SetPassword.cshtml deleted file mode 100644 index cfa779160..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Manage/SetPassword.cshtml +++ /dev/null @@ -1,38 +0,0 @@ -@model SetPasswordViewModel -@{ - ViewData["Title"] = "Set Password"; -} - -

- You do not have a local username/password for this site. Add a local - account so you can log in without an external login. -

- -
-

Set your password

-
-
-
- -
- - -
-
-
- -
- - -
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Manage/VerifyPhoneNumber.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Manage/VerifyPhoneNumber.cshtml deleted file mode 100644 index af7cd0b1f..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Manage/VerifyPhoneNumber.cshtml +++ /dev/null @@ -1,30 +0,0 @@ -@model VerifyPhoneNumberViewModel -@{ - ViewData["Title"] = "Verify Phone Number"; -} - -

@ViewData["Title"].

- -
- -

Add a phone number.

-
@ViewData["Status"]
-
-
-
- -
- - -
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Shared/Error.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Shared/Error.cshtml deleted file mode 100644 index 229c2dead..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Shared/Error.cshtml +++ /dev/null @@ -1,14 +0,0 @@ -@{ - ViewData["Title"] = "Error"; -} - -

Error.

-

An error occurred while processing your request.

- -

Development Mode

-

- Swapping to Development environment will display more detailed information about the error that occurred. -

-

- Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. -

diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Shared/_Layout.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Shared/_Layout.cshtml deleted file mode 100644 index 56827ca52..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Shared/_Layout.cshtml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - @ViewData["Title"] - WebApplication - - - - - - - - - - - - -
- @RenderBody() -
-
-

© 2016 - WebApplication

-
-
- - - - - - - - - - - - - @RenderSection("scripts", required: false) - - diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Shared/_LoginPartial.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Shared/_LoginPartial.cshtml deleted file mode 100644 index f50d5e89e..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Shared/_LoginPartial.cshtml +++ /dev/null @@ -1,26 +0,0 @@ -@using Microsoft.AspNetCore.Identity -@using WebApplication.Models - -@inject SignInManager SignInManager -@inject UserManager UserManager - -@if (SignInManager.IsSignedIn(User)) -{ - -} -else -{ - -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Shared/_ValidationScriptsPartial.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Shared/_ValidationScriptsPartial.cshtml deleted file mode 100644 index 289b22064..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/Shared/_ValidationScriptsPartial.cshtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/_ViewImports.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/_ViewImports.cshtml deleted file mode 100644 index dcca16cb0..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/_ViewImports.cshtml +++ /dev/null @@ -1,6 +0,0 @@ -@using WebApplication -@using WebApplication.Models -@using WebApplication.Models.AccountViewModels -@using WebApplication.Models.ManageViewModels -@using Microsoft.AspNetCore.Identity -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/_ViewStart.cshtml b/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/_ViewStart.cshtml deleted file mode 100644 index 820a2f6e0..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/Views/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "_Layout"; -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/appsettings.json b/TestAssets/TestProjects/ProjectJsonWebTemplate/appsettings.json deleted file mode 100644 index 53b17ae04..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/appsettings.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "ConnectionStrings": { - "DefaultConnection": "Data Source=WebApplication.db" - }, - "Logging": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Debug", - "System": "Information", - "Microsoft": "Information" - } - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/bower.json b/TestAssets/TestProjects/ProjectJsonWebTemplate/bower.json deleted file mode 100644 index 3891fce13..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/bower.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "webapplication", - "private": true, - "dependencies": { - "bootstrap": "3.3.6", - "jquery": "2.2.3", - "jquery-validation": "1.15.0", - "jquery-validation-unobtrusive": "3.2.6" - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/gulpfile.js b/TestAssets/TestProjects/ProjectJsonWebTemplate/gulpfile.js deleted file mode 100644 index faf295540..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/gulpfile.js +++ /dev/null @@ -1,45 +0,0 @@ -/// -"use strict"; - -var gulp = require("gulp"), - rimraf = require("rimraf"), - concat = require("gulp-concat"), - cssmin = require("gulp-cssmin"), - uglify = require("gulp-uglify"); - -var webroot = "./wwwroot/"; - -var paths = { - js: webroot + "js/**/*.js", - minJs: webroot + "js/**/*.min.js", - css: webroot + "css/**/*.css", - minCss: webroot + "css/**/*.min.css", - concatJsDest: webroot + "js/site.min.js", - concatCssDest: webroot + "css/site.min.css" -}; - -gulp.task("clean:js", function (cb) { - rimraf(paths.concatJsDest, cb); -}); - -gulp.task("clean:css", function (cb) { - rimraf(paths.concatCssDest, cb); -}); - -gulp.task("clean", ["clean:js", "clean:css"]); - -gulp.task("min:js", function () { - return gulp.src([paths.js, "!" + paths.minJs], { base: "." }) - .pipe(concat(paths.concatJsDest)) - .pipe(uglify()) - .pipe(gulp.dest(".")); -}); - -gulp.task("min:css", function () { - return gulp.src([paths.css, "!" + paths.minCss]) - .pipe(concat(paths.concatCssDest)) - .pipe(cssmin()) - .pipe(gulp.dest(".")); -}); - -gulp.task("min", ["min:js", "min:css"]); diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/package.json b/TestAssets/TestProjects/ProjectJsonWebTemplate/package.json deleted file mode 100644 index 4bb6c884c..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "webapplication", - "version": "0.0.0", - "private": true, - "devDependencies": { - "gulp": "3.9.1", - "gulp-concat": "2.6.0", - "gulp-cssmin": "0.1.7", - "gulp-uglify": "1.5.3", - "rimraf": "2.5.2" - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/project.json b/TestAssets/TestProjects/ProjectJsonWebTemplate/project.json deleted file mode 100644 index e82212642..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/project.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "userSecretsId": "aspnet-WebApplication-0799fe3e-6eaf-4c5f-b40e-7c6bfd5dfa9a", - - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.1.0", - "type": "platform" - }, - "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0", - "Microsoft.AspNetCore.Diagnostics": "1.0.0", - "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0", - "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0", - "Microsoft.AspNetCore.Mvc": "1.0.1", - "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview2-final", - "type": "build" - }, - "Microsoft.AspNetCore.Routing": "1.0.1", - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.1", - "Microsoft.AspNetCore.StaticFiles": "1.0.0", - "Microsoft.EntityFrameworkCore.Sqlite": "1.0.1", - "Microsoft.EntityFrameworkCore.Tools": { - "version": "1.0.0-preview2-final", - "type": "build" - }, - "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", - "Microsoft.Extensions.Configuration.Json": "1.0.0", - "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0", - "Microsoft.Extensions.Logging": "1.0.0", - "Microsoft.Extensions.Logging.Console": "1.0.0", - "Microsoft.Extensions.Logging.Debug": "1.0.0", - "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0", - "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { - "version": "1.0.0-preview2-update1", - "type": "build" - }, - "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": { - "version": "1.0.0-preview2-update1", - "type": "build" - } - }, - - "tools": { - "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview2-final", - "imports": "portable-net45+win8+dnxcore50" - }, - "Microsoft.AspNetCore.Server.IISIntegration.Tools": { - "version": "1.0.0-preview2-final", - "imports": "portable-net45+win8+dnxcore50" - }, - "Microsoft.EntityFrameworkCore.Tools": { - "version": "1.0.0-preview2-final", - "imports": [ - "portable-net45+win8+dnxcore50", - "portable-net45+win8" - ] - }, - "Microsoft.Extensions.SecretManager.Tools": { - "version": "1.0.0-preview2-final", - "imports": "portable-net45+win8+dnxcore50" - }, - "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { - "version": "1.0.0-preview2-final", - "imports": [ - "portable-net45+win8+dnxcore50", - "portable-net45+win8" - ] - } - }, - - "frameworks": { - "netcoreapp1.1": { - "imports": [ - "dotnet5.6", - "dnxcore50", - "portable-net45+win8" - ] - } - }, - - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - - "runtimeOptions": { - "configProperties": { - "System.GC.Server": true - } - }, - - "publishOptions": { - "include": [ - "wwwroot", - "**/*.cshtml", - "appsettings.json", - "web.config", - "README.md" - ] - }, - - "scripts": { - "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ], - "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] - }, - - "tooling": { - "defaultNamespace": "WebApplication" - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/web.config b/TestAssets/TestProjects/ProjectJsonWebTemplate/web.config deleted file mode 100644 index a8d667275..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/web.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/css/site.css b/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/css/site.css deleted file mode 100644 index 6baa84da1..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/css/site.css +++ /dev/null @@ -1,44 +0,0 @@ -body { - padding-top: 50px; - padding-bottom: 20px; -} - -/* Wrapping element */ -/* Set some basic padding to keep content from hitting the edges */ -.body-content { - padding-left: 15px; - padding-right: 15px; -} - -/* Set widths on the form inputs since otherwise they're 100% wide */ -input, -select, -textarea { - max-width: 280px; -} - -/* Carousel */ -.carousel-caption p { - font-size: 20px; - line-height: 1.4; -} - -/* buttons and links extension to use brackets: [ click me ] */ -.btn-bracketed::before { - display:inline-block; - content: "["; - padding-right: 0.5em; -} -.btn-bracketed::after { - display:inline-block; - content: "]"; - padding-left: 0.5em; -} - -/* Hide/rearrange for smaller screens */ -@media screen and (max-width: 767px) { - /* Hide captions */ - .carousel-caption { - display: none - } -} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/css/site.min.css b/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/css/site.min.css deleted file mode 100644 index c8f600ac5..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/css/site.min.css +++ /dev/null @@ -1 +0,0 @@ -body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}input,select,textarea{max-width:280px}.carousel-caption p{font-size:20px;line-height:1.4}.btn-bracketed::before{display:inline-block;content:"[";padding-right:.5em}.btn-bracketed::after{display:inline-block;content:"]";padding-left:.5em}@media screen and (max-width:767px){.carousel-caption{display:none}} diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/favicon.ico b/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/favicon.ico deleted file mode 100644 index a3a799985..000000000 Binary files a/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/favicon.ico and /dev/null differ diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/images/banner1.svg b/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/images/banner1.svg deleted file mode 100644 index 1ab32b60b..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/images/banner1.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/images/banner2.svg b/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/images/banner2.svg deleted file mode 100644 index 9679c604d..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/images/banner2.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/images/banner3.svg b/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/images/banner3.svg deleted file mode 100644 index 9be2c2503..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/images/banner3.svg +++ /dev/null @@ -1 +0,0 @@ -banner3b \ No newline at end of file diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/images/banner4.svg b/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/images/banner4.svg deleted file mode 100644 index 38b3d7cd1..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/images/banner4.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/js/site.js b/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/js/site.js deleted file mode 100644 index e069226a1..000000000 --- a/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/js/site.js +++ /dev/null @@ -1 +0,0 @@ -// Write your Javascript code. diff --git a/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/js/site.min.js b/TestAssets/TestProjects/ProjectJsonWebTemplate/wwwroot/js/site.min.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/ProjectsWithGlobalJson/global.json b/TestAssets/TestProjects/ProjectsWithGlobalJson/global.json deleted file mode 100644 index 2b2293b26..000000000 --- a/TestAssets/TestProjects/ProjectsWithGlobalJson/global.json +++ /dev/null @@ -1,4 +0,0 @@ - -{ - "projects": [ "src", "src with spaces", "src without projects" ] -} \ No newline at end of file diff --git a/TestAssets/TestProjects/ProjectsWithGlobalJson/src with spaces/ProjectJ/.noautobuild b/TestAssets/TestProjects/ProjectsWithGlobalJson/src with spaces/ProjectJ/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/ProjectsWithGlobalJson/src with spaces/ProjectJ/Program.cs b/TestAssets/TestProjects/ProjectsWithGlobalJson/src with spaces/ProjectJ/Program.cs deleted file mode 100644 index db2c801fd..000000000 --- a/TestAssets/TestProjects/ProjectsWithGlobalJson/src with spaces/ProjectJ/Program.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 System; -using System.Diagnostics; - -namespace TestApp -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine("This string came from ProjectJ"); - string helperStr = TestLibrary.ProjectI.GetMessage(); - Console.WriteLine(helperStr); - return 0; - } - } -} diff --git a/TestAssets/TestProjects/ProjectsWithGlobalJson/src with spaces/ProjectJ/project.json b/TestAssets/TestProjects/ProjectsWithGlobalJson/src with spaces/ProjectJ/project.json deleted file mode 100644 index 89299337a..000000000 --- a/TestAssets/TestProjects/ProjectsWithGlobalJson/src with spaces/ProjectJ/project.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "dependencies": { - "ProjectI": { - "target": "project", - "version": "1.0.0-*" - }, - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.1" - } - }, - "frameworks": { - "netcoreapp1.1": {} - } -} diff --git a/TestAssets/TestProjects/ProjectsWithGlobalJson/src/ProjectH/.noautobuild b/TestAssets/TestProjects/ProjectsWithGlobalJson/src/ProjectH/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/ProjectsWithGlobalJson/src/ProjectH/Program.cs b/TestAssets/TestProjects/ProjectsWithGlobalJson/src/ProjectH/Program.cs deleted file mode 100644 index 27e455e98..000000000 --- a/TestAssets/TestProjects/ProjectsWithGlobalJson/src/ProjectH/Program.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 System; -using System.Diagnostics; - -namespace TestApp -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine("This string came from ProjectH"); - string helperStr = TestLibrary.ProjectI.GetMessage(); - Console.WriteLine(helperStr); - return 0; - } - } -} diff --git a/TestAssets/TestProjects/ProjectsWithGlobalJson/src/ProjectH/project.json b/TestAssets/TestProjects/ProjectsWithGlobalJson/src/ProjectH/project.json deleted file mode 100644 index 003e499f1..000000000 --- a/TestAssets/TestProjects/ProjectsWithGlobalJson/src/ProjectH/project.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "dependencies": { - "ProjectI": { - "target": "project", - "version": "1.0.0-*" - }, - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.0" - } - }, - "frameworks": { - "netcoreapp1.1": {} - } -} diff --git a/TestAssets/TestProjects/ProjectsWithGlobalJson/src/ProjectI/.noautobuild b/TestAssets/TestProjects/ProjectsWithGlobalJson/src/ProjectI/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/ProjectsWithGlobalJson/src/ProjectI/Helper.cs b/TestAssets/TestProjects/ProjectsWithGlobalJson/src/ProjectI/Helper.cs deleted file mode 100644 index d92100c45..000000000 --- a/TestAssets/TestProjects/ProjectsWithGlobalJson/src/ProjectI/Helper.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; - -namespace TestLibrary -{ - public static class ProjectI - { - public static string GetMessage() - { - return "This string came from ProjectI"; - } - } -} diff --git a/TestAssets/TestProjects/ProjectsWithGlobalJson/src/ProjectI/project.json b/TestAssets/TestProjects/ProjectsWithGlobalJson/src/ProjectI/project.json deleted file mode 100644 index 48bc772d8..000000000 --- a/TestAssets/TestProjects/ProjectsWithGlobalJson/src/ProjectI/project.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "nowarn": [ - "CS1591" - ], - "xmlDoc": true, - "additionalArguments": [ - "-highentropyva+" - ] - }, - "dependencies": { - "NETStandard.Library": "1.6.0" - }, - "frameworks": { - "netstandard1.5": {} - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary1/.noautobuild b/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary1/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary1/CsprojLibrary1.csproj b/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary1/CsprojLibrary1.csproj deleted file mode 100644 index cb6b4e876..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary1/CsprojLibrary1.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Library - netstandard1.5 - - - - - - - - - - diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary1/Helper.cs b/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary1/Helper.cs deleted file mode 100644 index a9734c078..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary1/Helper.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; - -namespace TestLibrary -{ - public static class ProjectC - { - public static string GetMessage() - { - return "This string came from CsprojLibrary1"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary1/project.json b/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary1/project.json deleted file mode 100644 index bc57c51ff..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary1/project.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "dependencies": {}, - "frameworks": { - "netstandard1.5": { - "dependencies": { - "Microsoft.NET.Sdk": "1.0.0-alpha-20161104-2", - "NETStandard.Library": "1.6.0" - } - } - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary2/.noautobuild b/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary2/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary2/CsprojLibrary2.csproj b/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary2/CsprojLibrary2.csproj deleted file mode 100644 index cb6b4e876..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary2/CsprojLibrary2.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Library - netstandard1.5 - - - - - - - - - - diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary2/Helper.cs b/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary2/Helper.cs deleted file mode 100644 index d32ed6e6b..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary2/Helper.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; - -namespace TestLibrary -{ - public static class ProjectC - { - public static string GetMessage() - { - return "This string came from CsprojLibrary2"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary2/project.json b/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary2/project.json deleted file mode 100644 index bc57c51ff..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary2/project.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "dependencies": {}, - "frameworks": { - "netstandard1.5": { - "dependencies": { - "Microsoft.NET.Sdk": "1.0.0-alpha-20161104-2", - "NETStandard.Library": "1.6.0" - } - } - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary3/.noautobuild b/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary3/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary3/CsprojLibrary3.csproj b/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary3/CsprojLibrary3.csproj deleted file mode 100644 index cb6b4e876..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary3/CsprojLibrary3.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Library - netstandard1.5 - - - - - - - - - - diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary3/Helper.cs b/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary3/Helper.cs deleted file mode 100644 index d7784a65d..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary3/Helper.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; - -namespace TestLibrary -{ - public static class ProjectC - { - public static string GetMessage() - { - return "This string came from CsprojLibrary3"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary3/project.json b/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary3/project.json deleted file mode 100644 index bc57c51ff..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/CsprojLibrary3/project.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "dependencies": {}, - "frameworks": { - "netstandard1.5": { - "dependencies": { - "Microsoft.NET.Sdk": "1.0.0-alpha-20161104-2", - "NETStandard.Library": "1.6.0" - } - } - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectA/.noautobuild b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectA/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectA/Program.cs b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectA/Program.cs deleted file mode 100644 index 1d1f78b84..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectA/Program.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 System; -using System.Diagnostics; -using TestLibrary; - -namespace TestApp -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine("This string came from ProjectA"); - Console.WriteLine($"{ProjectD.GetMessage()}"); - return 0; - } - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectA/project.json b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectA/project.json deleted file mode 100644 index ab0e331eb..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectA/project.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "dependencies": { - "ProjectB": { - "target": "project", - "version": "1.0.0-*" - }, - "ProjectC": { - "target": "project", - "version": "1.0.0-*" - }, - "Microsoft.NETCore.App": "1.1.0" - }, - "frameworks": { - "netcoreapp1.1": {} - }, - "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/TestAppDependencyGraph/ProjectB/.noautobuild b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectB/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectB/Helper.cs b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectB/Helper.cs deleted file mode 100644 index 5a986d891..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectB/Helper.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; - -namespace TestLibrary -{ - public static class ProjectB - { - public static string GetMessage() - { - return "This string came from ProjectB"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectB/project.json b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectB/project.json deleted file mode 100644 index 1eb055cca..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectB/project.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "nowarn": [ - "CS1591" - ], - "xmlDoc": true, - "additionalArguments": [ - "-highentropyva+" - ] - }, - "dependencies": { - "ProjectC": { - "target": "project", - "version": "1.0.0-*" - }, - "ProjectD": { - "target": "project", - "version": "1.0.0-*" - }, - "NETStandard.Library": "1.6.0" - }, - "frameworks": { - "netstandard1.5": {} - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectC/.noautobuild b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectC/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectC/Helper.cs b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectC/Helper.cs deleted file mode 100644 index 317f57fc2..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectC/Helper.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; - -namespace TestLibrary -{ - public static class ProjectC - { - public static string GetMessage() - { - return "This string came from ProjectC"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectC/ProjectC.xproj b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectC/ProjectC.xproj deleted file mode 100644 index 47fef9e1d..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectC/ProjectC.xproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 084222f1-7909-48f4-81e8-a97398b26b1c - ProjectC - obj - bin - v4.6 - - - 2.0 - - - - - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectC/project.json b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectC/project.json deleted file mode 100644 index 3dab0b9a6..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectC/project.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "nowarn": [ - "CS1591" - ], - "xmlDoc": true, - "additionalArguments": [ - "-highentropyva+" - ] - }, - "dependencies": { - "ProjectD": { - "target": "project", - "version": "1.0.0-*" - }, - "ProjectE": { - "target": "project", - "version": "1.0.0-*" - }, - "CsprojLibrary1": { - "target": "project" - }, - "CsprojLibrary2": { - "target": "project" - }, - "NETStandard.Library": "1.6.0" - }, - "frameworks": { - "netstandard1.5": {} - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectD/.noautobuild b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectD/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectD/Helper.cs b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectD/Helper.cs deleted file mode 100644 index 0c0422913..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectD/Helper.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; - -namespace TestLibrary -{ - public static class ProjectD - { - public static string GetMessage() - { - return "This string came from ProjectD"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectD/project.json b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectD/project.json deleted file mode 100644 index 48bc772d8..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectD/project.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "nowarn": [ - "CS1591" - ], - "xmlDoc": true, - "additionalArguments": [ - "-highentropyva+" - ] - }, - "dependencies": { - "NETStandard.Library": "1.6.0" - }, - "frameworks": { - "netstandard1.5": {} - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectE/.noautobuild b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectE/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectE/Helper.cs b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectE/Helper.cs deleted file mode 100644 index b91a23164..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectE/Helper.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; - -namespace TestLibrary -{ - public static class ProjectE - { - public static string GetMessage() - { - return "This string came from ProjectE"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectE/ProjectE.xproj b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectE/ProjectE.xproj deleted file mode 100644 index 3cd98ff52..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectE/ProjectE.xproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 7fb8f138-ffb0-4eec-af9e-2e6ff9979593 - ProjectE - obj - bin - v4.6 - - - 2.0 - - - - - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectE/project.json b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectE/project.json deleted file mode 100644 index f21f103f3..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectE/project.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "nowarn": [ - "CS1591" - ], - "xmlDoc": true, - "additionalArguments": [ - "-highentropyva+" - ] - }, - "dependencies": { - "CsprojLibrary2": { - "target": "project" - }, - "CsprojLibrary3": { - "target": "project" - }, - "NETStandard.Library": "1.6.0" - }, - "frameworks": { - "netstandard1.5": {} - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectF/.noautobuild b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectF/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectF/Program.cs b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectF/Program.cs deleted file mode 100644 index 5f68b57d5..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectF/Program.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 System; -using System.Diagnostics; - -namespace TestApp -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine("This string came from ProjectF"); - string helperStr = TestLibrary.ProjectG.GetMessage(); - Console.WriteLine(helperStr); - return 0; - } - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectF/project.json b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectF/project.json deleted file mode 100644 index 585da58f6..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectF/project.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "dependencies": { - "ProjectG": { - "target": "project", - "version": "1.0.0-*" - }, - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.0" - } - }, - "frameworks": { - "netcoreapp1.1": {} - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectG/.noautobuild b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectG/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectG/Helper.cs b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectG/Helper.cs deleted file mode 100644 index 055698989..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectG/Helper.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; - -namespace TestLibrary -{ - public static class ProjectG - { - public static string GetMessage() - { - return "This string came from ProjectG"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectG/project.json b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectG/project.json deleted file mode 100644 index 48bc772d8..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectG/project.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "nowarn": [ - "CS1591" - ], - "xmlDoc": true, - "additionalArguments": [ - "-highentropyva+" - ] - }, - "dependencies": { - "NETStandard.Library": "1.6.0" - }, - "frameworks": { - "netstandard1.5": {} - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/global.json b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/global.json deleted file mode 100644 index 2b2293b26..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/global.json +++ /dev/null @@ -1,4 +0,0 @@ - -{ - "projects": [ "src", "src with spaces", "src without projects" ] -} \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src with spaces/ProjectJ/.noautobuild b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src with spaces/ProjectJ/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src with spaces/ProjectJ/Program.cs b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src with spaces/ProjectJ/Program.cs deleted file mode 100644 index db2c801fd..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src with spaces/ProjectJ/Program.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 System; -using System.Diagnostics; - -namespace TestApp -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine("This string came from ProjectJ"); - string helperStr = TestLibrary.ProjectI.GetMessage(); - Console.WriteLine(helperStr); - return 0; - } - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src with spaces/ProjectJ/project.json b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src with spaces/ProjectJ/project.json deleted file mode 100644 index 003e499f1..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src with spaces/ProjectJ/project.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "dependencies": { - "ProjectI": { - "target": "project", - "version": "1.0.0-*" - }, - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.0" - } - }, - "frameworks": { - "netcoreapp1.1": {} - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src/ProjectH/.noautobuild b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src/ProjectH/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src/ProjectH/Program.cs b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src/ProjectH/Program.cs deleted file mode 100644 index 27e455e98..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src/ProjectH/Program.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 System; -using System.Diagnostics; - -namespace TestApp -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine("This string came from ProjectH"); - string helperStr = TestLibrary.ProjectI.GetMessage(); - Console.WriteLine(helperStr); - return 0; - } - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src/ProjectH/project.json b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src/ProjectH/project.json deleted file mode 100644 index 003e499f1..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src/ProjectH/project.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "dependencies": { - "ProjectI": { - "target": "project", - "version": "1.0.0-*" - }, - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.0" - } - }, - "frameworks": { - "netcoreapp1.1": {} - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src/ProjectI/.noautobuild b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src/ProjectI/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src/ProjectI/Helper.cs b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src/ProjectI/Helper.cs deleted file mode 100644 index d92100c45..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src/ProjectI/Helper.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; - -namespace TestLibrary -{ - public static class ProjectI - { - public static string GetMessage() - { - return "This string came from ProjectI"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src/ProjectI/project.json b/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src/ProjectI/project.json deleted file mode 100644 index 48bc772d8..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/ProjectsWithGlobalJson/src/ProjectI/project.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "nowarn": [ - "CS1591" - ], - "xmlDoc": true, - "additionalArguments": [ - "-highentropyva+" - ] - }, - "dependencies": { - "NETStandard.Library": "1.6.0" - }, - "frameworks": { - "netstandard1.5": {} - } -} diff --git a/TestAssets/TestProjects/TestAppDependencyGraph/global.json b/TestAssets/TestProjects/TestAppDependencyGraph/global.json deleted file mode 100644 index 9e26dfeeb..000000000 --- a/TestAssets/TestProjects/TestAppDependencyGraph/global.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppWithContents/Program.cs b/TestAssets/TestProjects/TestAppWithContents/Program.cs deleted file mode 100644 index dc54ad2be..000000000 --- a/TestAssets/TestProjects/TestAppWithContents/Program.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 ConsoleApplication -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine("Hello World!"); - return 0; - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithContents/TestAppWithContents.xproj b/TestAssets/TestProjects/TestAppWithContents/TestAppWithContents.xproj deleted file mode 100644 index fa06ff0b3..000000000 --- a/TestAssets/TestProjects/TestAppWithContents/TestAppWithContents.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0.23107 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 0138cb8f-4aa9-4029-a21e-c07c30f425ba - TestAppWithContents - ..\..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\..\artifacts\ - - - 2.0 - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppWithContents/project.json b/TestAssets/TestProjects/TestAppWithContents/project.json deleted file mode 100644 index b23cbdc8b..000000000 --- a/TestAssets/TestProjects/TestAppWithContents/project.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "copyToOutput": { - "include": "testcontentfile.txt", - "mappings": { - "dir/mappingfile.txt":{ - "include": "testcontentfile2.txt" - }, - "out/": { - "include": ["Program.cs"], - "exclude": ["Program.cs"], - "includeFiles": ["Program.cs"], - "excludeFiles": ["Program.cs"] - } - } - } - }, - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.1.0", - "type": "platform" - } - }, - "frameworks": { - "netcoreapp1.1": {} - }, - "publishOptions": { - "include": "testcontentfile.txt" - } -} diff --git a/TestAssets/TestProjects/TestAppWithContents/testcontentfile.txt b/TestAssets/TestProjects/TestAppWithContents/testcontentfile.txt deleted file mode 100644 index 9a1cc0232..000000000 --- a/TestAssets/TestProjects/TestAppWithContents/testcontentfile.txt +++ /dev/null @@ -1 +0,0 @@ -This is to test if contents are copied correctly by the dotnet tools \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppWithContents/testcontentfile2.txt b/TestAssets/TestProjects/TestAppWithContents/testcontentfile2.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestAppWithEmbeddedResources/Program.cs b/TestAssets/TestProjects/TestAppWithEmbeddedResources/Program.cs deleted file mode 100755 index 9d31ed2c9..000000000 --- a/TestAssets/TestProjects/TestAppWithEmbeddedResources/Program.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.Linq; -using System.Reflection; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - var thisAssembly = typeof(Program).GetTypeInfo().Assembly; - var resources = from resourceName in thisAssembly.GetManifestResourceNames() - select resourceName; - - if (resources.Count() > 1) - { - throw new Exception($"{resources.Count()} found in the assembly. Was expecting only 1."); - } - - var resourceNames = string.Join(",", resources); - Console.WriteLine($"{resources.Count()} Resources Found: {resourceNames}"); - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithEmbeddedResources/Resources/Strings.resx b/TestAssets/TestProjects/TestAppWithEmbeddedResources/Resources/Strings.resx deleted file mode 100644 index 1f24a372f..000000000 --- a/TestAssets/TestProjects/TestAppWithEmbeddedResources/Resources/Strings.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Hello World! - - \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppWithEmbeddedResources/project.json b/TestAssets/TestProjects/TestAppWithEmbeddedResources/project.json deleted file mode 100755 index 4f97537d9..000000000 --- a/TestAssets/TestProjects/TestAppWithEmbeddedResources/project.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true, - "embed": [ "Resources/*.resx" ] - }, - "dependencies": {}, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.0" - } - }, - "imports": "dnxcore50" - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithExplicitInclude/Program.cs b/TestAssets/TestProjects/TestAppWithExplicitInclude/Program.cs deleted file mode 100644 index 7e52efa0e..000000000 --- a/TestAssets/TestProjects/TestAppWithExplicitInclude/Program.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 System; - -class Program -{ - static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } -} diff --git a/TestAssets/TestProjects/TestAppWithExplicitInclude/project.json b/TestAssets/TestProjects/TestAppWithExplicitInclude/project.json deleted file mode 100644 index bd75d882b..000000000 --- a/TestAssets/TestProjects/TestAppWithExplicitInclude/project.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true, - "compile": { - "include": [ - "Program.cs" - ] - } - }, - "dependencies": {}, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.0" - } - }, - "imports": "dnxcore50" - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithExplicitIncludeGlob/Program.cs b/TestAssets/TestProjects/TestAppWithExplicitIncludeGlob/Program.cs deleted file mode 100644 index 7e52efa0e..000000000 --- a/TestAssets/TestProjects/TestAppWithExplicitIncludeGlob/Program.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 System; - -class Program -{ - static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } -} diff --git a/TestAssets/TestProjects/TestAppWithExplicitIncludeGlob/project.json b/TestAssets/TestProjects/TestAppWithExplicitIncludeGlob/project.json deleted file mode 100644 index 56f3433fc..000000000 --- a/TestAssets/TestProjects/TestAppWithExplicitIncludeGlob/project.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true, - "compile": { - "include": [ - "**/*.cs" - ] - } - }, - "dependencies": {}, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.0" - } - }, - "imports": "dnxcore50" - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithLibrary/TestApp/Program.cs b/TestAssets/TestProjects/TestAppWithLibrary/TestApp/Program.cs deleted file mode 100644 index ac3163a58..000000000 --- a/TestAssets/TestProjects/TestAppWithLibrary/TestApp/Program.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 System.Diagnostics; - -namespace TestApp -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine(TestLibrary.Helper.GetMessage()); - return 100; - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithLibrary/TestApp/TestApp.xproj b/TestAssets/TestProjects/TestAppWithLibrary/TestApp/TestApp.xproj deleted file mode 100644 index 53f0c8b7a..000000000 --- a/TestAssets/TestProjects/TestAppWithLibrary/TestApp/TestApp.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0.23107 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 0138cb8f-4aa9-4029-a21e-c07c30f425ba - TestAppWithContents - ..\..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\..\artifacts\ - - - 2.0 - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppWithLibrary/TestApp/TestApp.xproj.user b/TestAssets/TestProjects/TestAppWithLibrary/TestApp/TestApp.xproj.user deleted file mode 100644 index efbe88aa6..000000000 --- a/TestAssets/TestProjects/TestAppWithLibrary/TestApp/TestApp.xproj.user +++ /dev/null @@ -1 +0,0 @@ -Ok, it's true. Didn't have an xproj user file handy and needed the file to exist so a test can show it gets moved to backup. \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppWithLibrary/TestApp/project.json b/TestAssets/TestProjects/TestAppWithLibrary/TestApp/project.json deleted file mode 100644 index 8edb9fd32..000000000 --- a/TestAssets/TestProjects/TestAppWithLibrary/TestApp/project.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "dependencies": { - "TestLibrary": { - "target": "project", - "version": "1.0.0-*" - }, - "Microsoft.NETCore.App": "1.1.0" - }, - "frameworks": { - "netcoreapp1.1": {} - }, - "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/TestAppWithLibrary/TestLibrary/.noautobuild b/TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/Helper.cs b/TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/Helper.cs deleted file mode 100644 index 8c643796b..000000000 --- a/TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/Helper.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; - -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/TestAppWithLibrary/TestLibrary/TestLibrary.xproj b/TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/TestLibrary.xproj deleted file mode 100644 index 53f0c8b7a..000000000 --- a/TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/TestLibrary.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0.23107 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 0138cb8f-4aa9-4029-a21e-c07c30f425ba - TestAppWithContents - ..\..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\..\artifacts\ - - - 2.0 - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/TestLibrary.xproj.user b/TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/TestLibrary.xproj.user deleted file mode 100644 index efbe88aa6..000000000 --- a/TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/TestLibrary.xproj.user +++ /dev/null @@ -1 +0,0 @@ -Ok, it's true. Didn't have an xproj user file handy and needed the file to exist so a test can show it gets moved to backup. \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/project.json b/TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/project.json deleted file mode 100644 index 48bc772d8..000000000 --- a/TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/project.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "nowarn": [ - "CS1591" - ], - "xmlDoc": true, - "additionalArguments": [ - "-highentropyva+" - ] - }, - "dependencies": { - "NETStandard.Library": "1.6.0" - }, - "frameworks": { - "netstandard1.5": {} - } -} diff --git a/TestAssets/TestProjects/TestAppWithLibrary/global.json b/TestAssets/TestProjects/TestAppWithLibrary/global.json deleted file mode 100644 index 3a4684c26..000000000 --- a/TestAssets/TestProjects/TestAppWithLibrary/global.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "projects": [ "."] -} \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppWithRuntimeOptions/Program.cs b/TestAssets/TestProjects/TestAppWithRuntimeOptions/Program.cs deleted file mode 100644 index 2130cd0a7..000000000 --- a/TestAssets/TestProjects/TestAppWithRuntimeOptions/Program.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; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithRuntimeOptions/project.json b/TestAssets/TestProjects/TestAppWithRuntimeOptions/project.json deleted file mode 100644 index 3727b2ece..000000000 --- a/TestAssets/TestProjects/TestAppWithRuntimeOptions/project.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true - }, - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.1.0", - "type": "platform" - } - }, - "frameworks": { - "netcoreapp1.1": {} - }, - "runtimeOptions": { - "somethingString": "anything", - "somethingBoolean": true, - "someArray": [ - "one", - "two" - ], - "someObject": { - "someProperty": "someValue" - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithSigning/Program.cs b/TestAssets/TestProjects/TestAppWithSigning/Program.cs deleted file mode 100644 index 2130cd0a7..000000000 --- a/TestAssets/TestProjects/TestAppWithSigning/Program.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; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithSigning/key.snk b/TestAssets/TestProjects/TestAppWithSigning/key.snk deleted file mode 100644 index fe413a523..000000000 Binary files a/TestAssets/TestProjects/TestAppWithSigning/key.snk and /dev/null differ diff --git a/TestAssets/TestProjects/TestAppWithSigning/project.json b/TestAssets/TestProjects/TestAppWithSigning/project.json deleted file mode 100644 index fa84e6e50..000000000 --- a/TestAssets/TestProjects/TestAppWithSigning/project.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "keyFile": "./key.snk" - }, - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.1.0", - "type": "platform" - }, - }, - "frameworks": { - "netcoreapp1.1": {} - } -} diff --git a/TestAssets/TestProjects/TestLibraryWithAnalyzer/.noautobuild b/TestAssets/TestProjects/TestLibraryWithAnalyzer/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestLibraryWithAnalyzer/Program.cs b/TestAssets/TestProjects/TestLibraryWithAnalyzer/Program.cs deleted file mode 100644 index 0eeb0eb96..000000000 --- a/TestAssets/TestProjects/TestLibraryWithAnalyzer/Program.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. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } - - public class TT : Attribute - {} -} diff --git a/TestAssets/TestProjects/TestLibraryWithAnalyzer/project.json b/TestAssets/TestProjects/TestLibraryWithAnalyzer/project.json deleted file mode 100644 index 73a907775..000000000 --- a/TestAssets/TestProjects/TestLibraryWithAnalyzer/project.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": "1.0.0-*", - "dependencies": { - "NETStandard.Library": "1.6.0", - "System.Runtime.Analyzers": { - "version": "1.1.0", - "type": "build" - } - }, - "frameworks": { - "netstandard1.5": {} - } -} diff --git a/TestAssets/TestProjects/TestLibraryWithTwoFrameworks/.noautobuild b/TestAssets/TestProjects/TestLibraryWithTwoFrameworks/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestLibraryWithTwoFrameworks/Program.cs b/TestAssets/TestProjects/TestLibraryWithTwoFrameworks/Program.cs deleted file mode 100644 index 4582f6761..000000000 --- a/TestAssets/TestProjects/TestLibraryWithTwoFrameworks/Program.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; -using System.Xml; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main() - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/TestProjects/TestLibraryWithTwoFrameworks/project.json b/TestAssets/TestProjects/TestLibraryWithTwoFrameworks/project.json deleted file mode 100644 index 33104dede..000000000 --- a/TestAssets/TestProjects/TestLibraryWithTwoFrameworks/project.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": false - }, - "dependencies": {}, - "frameworks": { - "netcoreapp1.0": { - "imports": "dnxcore50", - "dependencies": { - "NETStandard.Library": "1.6.0" - } - }, - "netstandard1.5": { - "imports": "dnxcore50", - "dependencies": { - "NETStandard.Library": "1.6.0" - } - } - } -} diff --git a/TestAssets/TestProjects/VBTestApp/Program.vb b/TestAssets/TestProjects/VBTestApp/Program.vb new file mode 100644 index 000000000..46283ca23 --- /dev/null +++ b/TestAssets/TestProjects/VBTestApp/Program.vb @@ -0,0 +1,7 @@ +Imports System + +Module Program + Sub Main(args As String()) + Console.WriteLine("Hello World!") + End Sub +End Module diff --git a/TestAssets/TestProjects/VBTestApp/VBTestApp.vbproj b/TestAssets/TestProjects/VBTestApp/VBTestApp.vbproj new file mode 100644 index 000000000..ce1697ae8 --- /dev/null +++ b/TestAssets/TestProjects/VBTestApp/VBTestApp.vbproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp2.0 + + + diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/.bowerrc b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/.bowerrc deleted file mode 100755 index 6406626ab..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "wwwroot/lib" -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/.gitignore b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/.gitignore deleted file mode 100755 index 0ca27f04e..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/.gitignore +++ /dev/null @@ -1,234 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -build/ -bld/ -[Bb]in/ -[Oo]bj/ - -# Visual Studio 2015 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# DNX -project.lock.json -artifacts/ - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Microsoft Azure ApplicationInsights config file -ApplicationInsights.config - -# Windows Store app package directory -AppPackages/ -BundleArtifacts/ - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings -node_modules/ -orleans.codegen.cs - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe - -# FAKE - F# Make -.fake/ diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Controllers/AccountController.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Controllers/AccountController.cs deleted file mode 100755 index a6b81482d..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Controllers/AccountController.cs +++ /dev/null @@ -1,471 +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.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Rendering; -using Microsoft.Extensions.Logging; -using WebApplication.Models; -using WebApplication.Models.AccountViewModels; -using WebApplication.Services; - -namespace WebApplication.Controllers -{ - [Authorize] - public class AccountController : Controller - { - private readonly UserManager _userManager; - private readonly SignInManager _signInManager; - private readonly IEmailSender _emailSender; - private readonly ISmsSender _smsSender; - private readonly ILogger _logger; - - public AccountController( - UserManager userManager, - SignInManager signInManager, - IEmailSender emailSender, - ISmsSender smsSender, - ILoggerFactory loggerFactory) - { - _userManager = userManager; - _signInManager = signInManager; - _emailSender = emailSender; - _smsSender = smsSender; - _logger = loggerFactory.CreateLogger(); - } - - // - // GET: /Account/Login - [HttpGet] - [AllowAnonymous] - public IActionResult Login(string returnUrl = null) - { - ViewData["ReturnUrl"] = returnUrl; - return View(); - } - - // - // POST: /Account/Login - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task Login(LoginViewModel model, string returnUrl = null) - { - ViewData["ReturnUrl"] = returnUrl; - if (ModelState.IsValid) - { - // This doesn't count login failures towards account lockout - // To enable password failures to trigger account lockout, set lockoutOnFailure: true - var result = await _signInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, lockoutOnFailure: false); - if (result.Succeeded) - { - _logger.LogInformation(1, "User logged in."); - return RedirectToLocal(returnUrl); - } - if (result.RequiresTwoFactor) - { - return RedirectToAction(nameof(SendCode), new { ReturnUrl = returnUrl, RememberMe = model.RememberMe }); - } - if (result.IsLockedOut) - { - _logger.LogWarning(2, "User account locked out."); - return View("Lockout"); - } - else - { - ModelState.AddModelError(string.Empty, "Invalid login attempt."); - return View(model); - } - } - - // If we got this far, something failed, redisplay form - return View(model); - } - - // - // GET: /Account/Register - [HttpGet] - [AllowAnonymous] - public IActionResult Register(string returnUrl = null) - { - ViewData["ReturnUrl"] = returnUrl; - return View(); - } - - // - // POST: /Account/Register - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task Register(RegisterViewModel model, string returnUrl = null) - { - ViewData["ReturnUrl"] = returnUrl; - if (ModelState.IsValid) - { - var user = new ApplicationUser { UserName = model.Email, Email = model.Email }; - var result = await _userManager.CreateAsync(user, model.Password); - if (result.Succeeded) - { - // For more information on how to enable account confirmation and password reset please visit https://go.microsoft.com/fwlink/?LinkID=532713 - // Send an email with this link - //var code = await _userManager.GenerateEmailConfirmationTokenAsync(user); - //var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme); - //await _emailSender.SendEmailAsync(model.Email, "Confirm your account", - // $"Please confirm your account by clicking this link: link"); - await _signInManager.SignInAsync(user, isPersistent: false); - _logger.LogInformation(3, "User created a new account with password."); - return RedirectToLocal(returnUrl); - } - AddErrors(result); - } - - // If we got this far, something failed, redisplay form - return View(model); - } - - // - // POST: /Account/LogOff - [HttpPost] - [ValidateAntiForgeryToken] - public async Task LogOff() - { - await _signInManager.SignOutAsync(); - _logger.LogInformation(4, "User logged out."); - return RedirectToAction(nameof(HomeController.Index), "Home"); - } - - // - // POST: /Account/ExternalLogin - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public IActionResult ExternalLogin(string provider, string returnUrl = null) - { - // Request a redirect to the external login provider. - var redirectUrl = Url.Action("ExternalLoginCallback", "Account", new { ReturnUrl = returnUrl }); - var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl); - return Challenge(properties, provider); - } - - // - // GET: /Account/ExternalLoginCallback - [HttpGet] - [AllowAnonymous] - public async Task ExternalLoginCallback(string returnUrl = null, string remoteError = null) - { - if (remoteError != null) - { - ModelState.AddModelError(string.Empty, $"Error from external provider: {remoteError}"); - return View(nameof(Login)); - } - var info = await _signInManager.GetExternalLoginInfoAsync(); - if (info == null) - { - return RedirectToAction(nameof(Login)); - } - - // Sign in the user with this external login provider if the user already has a login. - var result = await _signInManager.ExternalLoginSignInAsync(info.LoginProvider, info.ProviderKey, isPersistent: false); - if (result.Succeeded) - { - _logger.LogInformation(5, "User logged in with {Name} provider.", info.LoginProvider); - return RedirectToLocal(returnUrl); - } - if (result.RequiresTwoFactor) - { - return RedirectToAction(nameof(SendCode), new { ReturnUrl = returnUrl }); - } - if (result.IsLockedOut) - { - return View("Lockout"); - } - else - { - // If the user does not have an account, then ask the user to create an account. - ViewData["ReturnUrl"] = returnUrl; - ViewData["LoginProvider"] = info.LoginProvider; - var email = info.Principal.FindFirstValue(ClaimTypes.Email); - return View("ExternalLoginConfirmation", new ExternalLoginConfirmationViewModel { Email = email }); - } - } - - // - // POST: /Account/ExternalLoginConfirmation - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task ExternalLoginConfirmation(ExternalLoginConfirmationViewModel model, string returnUrl = null) - { - if (ModelState.IsValid) - { - // Get the information about the user from the external login provider - var info = await _signInManager.GetExternalLoginInfoAsync(); - if (info == null) - { - return View("ExternalLoginFailure"); - } - var user = new ApplicationUser { UserName = model.Email, Email = model.Email }; - var result = await _userManager.CreateAsync(user); - if (result.Succeeded) - { - result = await _userManager.AddLoginAsync(user, info); - if (result.Succeeded) - { - await _signInManager.SignInAsync(user, isPersistent: false); - _logger.LogInformation(6, "User created an account using {Name} provider.", info.LoginProvider); - return RedirectToLocal(returnUrl); - } - } - AddErrors(result); - } - - ViewData["ReturnUrl"] = returnUrl; - return View(model); - } - - // GET: /Account/ConfirmEmail - [HttpGet] - [AllowAnonymous] - public async Task ConfirmEmail(string userId, string code) - { - if (userId == null || code == null) - { - return View("Error"); - } - var user = await _userManager.FindByIdAsync(userId); - if (user == null) - { - return View("Error"); - } - var result = await _userManager.ConfirmEmailAsync(user, code); - return View(result.Succeeded ? "ConfirmEmail" : "Error"); - } - - // - // GET: /Account/ForgotPassword - [HttpGet] - [AllowAnonymous] - public IActionResult ForgotPassword() - { - return View(); - } - - // - // POST: /Account/ForgotPassword - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task ForgotPassword(ForgotPasswordViewModel model) - { - if (ModelState.IsValid) - { - var user = await _userManager.FindByNameAsync(model.Email); - if (user == null || !(await _userManager.IsEmailConfirmedAsync(user))) - { - // Don't reveal that the user does not exist or is not confirmed - return View("ForgotPasswordConfirmation"); - } - - // For more information on how to enable account confirmation and password reset please visit https://go.microsoft.com/fwlink/?LinkID=532713 - // Send an email with this link - //var code = await _userManager.GeneratePasswordResetTokenAsync(user); - //var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme); - //await _emailSender.SendEmailAsync(model.Email, "Reset Password", - // $"Please reset your password by clicking here: link"); - //return View("ForgotPasswordConfirmation"); - } - - // If we got this far, something failed, redisplay form - return View(model); - } - - // - // GET: /Account/ForgotPasswordConfirmation - [HttpGet] - [AllowAnonymous] - public IActionResult ForgotPasswordConfirmation() - { - return View(); - } - - // - // GET: /Account/ResetPassword - [HttpGet] - [AllowAnonymous] - public IActionResult ResetPassword(string code = null) - { - return code == null ? View("Error") : View(); - } - - // - // POST: /Account/ResetPassword - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task ResetPassword(ResetPasswordViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - var user = await _userManager.FindByNameAsync(model.Email); - if (user == null) - { - // Don't reveal that the user does not exist - return RedirectToAction(nameof(AccountController.ResetPasswordConfirmation), "Account"); - } - var result = await _userManager.ResetPasswordAsync(user, model.Code, model.Password); - if (result.Succeeded) - { - return RedirectToAction(nameof(AccountController.ResetPasswordConfirmation), "Account"); - } - AddErrors(result); - return View(); - } - - // - // GET: /Account/ResetPasswordConfirmation - [HttpGet] - [AllowAnonymous] - public IActionResult ResetPasswordConfirmation() - { - return View(); - } - - // - // GET: /Account/SendCode - [HttpGet] - [AllowAnonymous] - public async Task SendCode(string returnUrl = null, bool rememberMe = false) - { - var user = await _signInManager.GetTwoFactorAuthenticationUserAsync(); - if (user == null) - { - return View("Error"); - } - var userFactors = await _userManager.GetValidTwoFactorProvidersAsync(user); - var factorOptions = userFactors.Select(purpose => new SelectListItem { Text = purpose, Value = purpose }).ToList(); - return View(new SendCodeViewModel { Providers = factorOptions, ReturnUrl = returnUrl, RememberMe = rememberMe }); - } - - // - // POST: /Account/SendCode - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task SendCode(SendCodeViewModel model) - { - if (!ModelState.IsValid) - { - return View(); - } - - var user = await _signInManager.GetTwoFactorAuthenticationUserAsync(); - if (user == null) - { - return View("Error"); - } - - // Generate the token and send it - var code = await _userManager.GenerateTwoFactorTokenAsync(user, model.SelectedProvider); - if (string.IsNullOrWhiteSpace(code)) - { - return View("Error"); - } - - var message = "Your security code is: " + code; - if (model.SelectedProvider == "Email") - { - await _emailSender.SendEmailAsync(await _userManager.GetEmailAsync(user), "Security Code", message); - } - else if (model.SelectedProvider == "Phone") - { - await _smsSender.SendSmsAsync(await _userManager.GetPhoneNumberAsync(user), message); - } - - return RedirectToAction(nameof(VerifyCode), new { Provider = model.SelectedProvider, ReturnUrl = model.ReturnUrl, RememberMe = model.RememberMe }); - } - - // - // GET: /Account/VerifyCode - [HttpGet] - [AllowAnonymous] - public async Task VerifyCode(string provider, bool rememberMe, string returnUrl = null) - { - // Require that the user has already logged in via username/password or external login - var user = await _signInManager.GetTwoFactorAuthenticationUserAsync(); - if (user == null) - { - return View("Error"); - } - return View(new VerifyCodeViewModel { Provider = provider, ReturnUrl = returnUrl, RememberMe = rememberMe }); - } - - // - // POST: /Account/VerifyCode - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task VerifyCode(VerifyCodeViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - - // The following code protects for brute force attacks against the two factor codes. - // If a user enters incorrect codes for a specified amount of time then the user account - // will be locked out for a specified amount of time. - var result = await _signInManager.TwoFactorSignInAsync(model.Provider, model.Code, model.RememberMe, model.RememberBrowser); - if (result.Succeeded) - { - return RedirectToLocal(model.ReturnUrl); - } - if (result.IsLockedOut) - { - _logger.LogWarning(7, "User account locked out."); - return View("Lockout"); - } - else - { - ModelState.AddModelError(string.Empty, "Invalid code."); - return View(model); - } - } - - #region Helpers - - private void AddErrors(IdentityResult result) - { - foreach (var error in result.Errors) - { - ModelState.AddModelError(string.Empty, error.Description); - } - } - - private Task GetCurrentUserAsync() - { - return _userManager.GetUserAsync(HttpContext.User); - } - - private IActionResult RedirectToLocal(string returnUrl) - { - if (Url.IsLocalUrl(returnUrl)) - { - return Redirect(returnUrl); - } - else - { - return RedirectToAction(nameof(HomeController.Index), "Home"); - } - } - - #endregion - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Controllers/HomeController.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Controllers/HomeController.cs deleted file mode 100755 index 67d139496..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Controllers/HomeController.cs +++ /dev/null @@ -1,38 +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.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace WebApplication.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() - { - return View(); - } - - public IActionResult About() - { - ViewData["Message"] = "Your application description page."; - - return View(); - } - - public IActionResult Contact() - { - ViewData["Message"] = "Your contact page."; - - return View(); - } - - public IActionResult Error() - { - return View(); - } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Controllers/ManageController.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Controllers/ManageController.cs deleted file mode 100755 index f7ff98504..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Controllers/ManageController.cs +++ /dev/null @@ -1,350 +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.Threading.Tasks; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using WebApplication.Models; -using WebApplication.Models.ManageViewModels; -using WebApplication.Services; - -namespace WebApplication.Controllers -{ - [Authorize] - public class ManageController : Controller - { - private readonly UserManager _userManager; - private readonly SignInManager _signInManager; - private readonly IEmailSender _emailSender; - private readonly ISmsSender _smsSender; - private readonly ILogger _logger; - - public ManageController( - UserManager userManager, - SignInManager signInManager, - IEmailSender emailSender, - ISmsSender smsSender, - ILoggerFactory loggerFactory) - { - _userManager = userManager; - _signInManager = signInManager; - _emailSender = emailSender; - _smsSender = smsSender; - _logger = loggerFactory.CreateLogger(); - } - - // - // GET: /Manage/Index - [HttpGet] - public async Task Index(ManageMessageId? message = null) - { - ViewData["StatusMessage"] = - message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed." - : message == ManageMessageId.SetPasswordSuccess ? "Your password has been set." - : message == ManageMessageId.SetTwoFactorSuccess ? "Your two-factor authentication provider has been set." - : message == ManageMessageId.Error ? "An error has occurred." - : message == ManageMessageId.AddPhoneSuccess ? "Your phone number was added." - : message == ManageMessageId.RemovePhoneSuccess ? "Your phone number was removed." - : ""; - - var user = await GetCurrentUserAsync(); - var model = new IndexViewModel - { - HasPassword = await _userManager.HasPasswordAsync(user), - PhoneNumber = await _userManager.GetPhoneNumberAsync(user), - TwoFactor = await _userManager.GetTwoFactorEnabledAsync(user), - Logins = await _userManager.GetLoginsAsync(user), - BrowserRemembered = await _signInManager.IsTwoFactorClientRememberedAsync(user) - }; - return View(model); - } - - // - // POST: /Manage/RemoveLogin - [HttpPost] - [ValidateAntiForgeryToken] - public async Task RemoveLogin(RemoveLoginViewModel account) - { - ManageMessageId? message = ManageMessageId.Error; - var user = await GetCurrentUserAsync(); - if (user != null) - { - var result = await _userManager.RemoveLoginAsync(user, account.LoginProvider, account.ProviderKey); - if (result.Succeeded) - { - await _signInManager.SignInAsync(user, isPersistent: false); - message = ManageMessageId.RemoveLoginSuccess; - } - } - return RedirectToAction(nameof(ManageLogins), new { Message = message }); - } - - // - // GET: /Manage/AddPhoneNumber - public IActionResult AddPhoneNumber() - { - return View(); - } - - // - // POST: /Manage/AddPhoneNumber - [HttpPost] - [ValidateAntiForgeryToken] - public async Task AddPhoneNumber(AddPhoneNumberViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - // Generate the token and send it - var user = await GetCurrentUserAsync(); - var code = await _userManager.GenerateChangePhoneNumberTokenAsync(user, model.PhoneNumber); - await _smsSender.SendSmsAsync(model.PhoneNumber, "Your security code is: " + code); - return RedirectToAction(nameof(VerifyPhoneNumber), new { PhoneNumber = model.PhoneNumber }); - } - - // - // POST: /Manage/EnableTwoFactorAuthentication - [HttpPost] - [ValidateAntiForgeryToken] - public async Task EnableTwoFactorAuthentication() - { - var user = await GetCurrentUserAsync(); - if (user != null) - { - await _userManager.SetTwoFactorEnabledAsync(user, true); - await _signInManager.SignInAsync(user, isPersistent: false); - _logger.LogInformation(1, "User enabled two-factor authentication."); - } - return RedirectToAction(nameof(Index), "Manage"); - } - - // - // POST: /Manage/DisableTwoFactorAuthentication - [HttpPost] - [ValidateAntiForgeryToken] - public async Task DisableTwoFactorAuthentication() - { - var user = await GetCurrentUserAsync(); - if (user != null) - { - await _userManager.SetTwoFactorEnabledAsync(user, false); - await _signInManager.SignInAsync(user, isPersistent: false); - _logger.LogInformation(2, "User disabled two-factor authentication."); - } - return RedirectToAction(nameof(Index), "Manage"); - } - - // - // GET: /Manage/VerifyPhoneNumber - [HttpGet] - public async Task VerifyPhoneNumber(string phoneNumber) - { - var code = await _userManager.GenerateChangePhoneNumberTokenAsync(await GetCurrentUserAsync(), phoneNumber); - // Send an SMS to verify the phone number - return phoneNumber == null ? View("Error") : View(new VerifyPhoneNumberViewModel { PhoneNumber = phoneNumber }); - } - - // - // POST: /Manage/VerifyPhoneNumber - [HttpPost] - [ValidateAntiForgeryToken] - public async Task VerifyPhoneNumber(VerifyPhoneNumberViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - var user = await GetCurrentUserAsync(); - if (user != null) - { - var result = await _userManager.ChangePhoneNumberAsync(user, model.PhoneNumber, model.Code); - if (result.Succeeded) - { - await _signInManager.SignInAsync(user, isPersistent: false); - return RedirectToAction(nameof(Index), new { Message = ManageMessageId.AddPhoneSuccess }); - } - } - // If we got this far, something failed, redisplay the form - ModelState.AddModelError(string.Empty, "Failed to verify phone number"); - return View(model); - } - - // - // POST: /Manage/RemovePhoneNumber - [HttpPost] - [ValidateAntiForgeryToken] - public async Task RemovePhoneNumber() - { - var user = await GetCurrentUserAsync(); - if (user != null) - { - var result = await _userManager.SetPhoneNumberAsync(user, null); - if (result.Succeeded) - { - await _signInManager.SignInAsync(user, isPersistent: false); - return RedirectToAction(nameof(Index), new { Message = ManageMessageId.RemovePhoneSuccess }); - } - } - return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error }); - } - - // - // GET: /Manage/ChangePassword - [HttpGet] - public IActionResult ChangePassword() - { - return View(); - } - - // - // POST: /Manage/ChangePassword - [HttpPost] - [ValidateAntiForgeryToken] - public async Task ChangePassword(ChangePasswordViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - var user = await GetCurrentUserAsync(); - if (user != null) - { - var result = await _userManager.ChangePasswordAsync(user, model.OldPassword, model.NewPassword); - if (result.Succeeded) - { - await _signInManager.SignInAsync(user, isPersistent: false); - _logger.LogInformation(3, "User changed their password successfully."); - return RedirectToAction(nameof(Index), new { Message = ManageMessageId.ChangePasswordSuccess }); - } - AddErrors(result); - return View(model); - } - return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error }); - } - - // - // GET: /Manage/SetPassword - [HttpGet] - public IActionResult SetPassword() - { - return View(); - } - - // - // POST: /Manage/SetPassword - [HttpPost] - [ValidateAntiForgeryToken] - public async Task SetPassword(SetPasswordViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - - var user = await GetCurrentUserAsync(); - if (user != null) - { - var result = await _userManager.AddPasswordAsync(user, model.NewPassword); - if (result.Succeeded) - { - await _signInManager.SignInAsync(user, isPersistent: false); - return RedirectToAction(nameof(Index), new { Message = ManageMessageId.SetPasswordSuccess }); - } - AddErrors(result); - return View(model); - } - return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error }); - } - - //GET: /Manage/ManageLogins - [HttpGet] - public async Task ManageLogins(ManageMessageId? message = null) - { - ViewData["StatusMessage"] = - message == ManageMessageId.RemoveLoginSuccess ? "The external login was removed." - : message == ManageMessageId.AddLoginSuccess ? "The external login was added." - : message == ManageMessageId.Error ? "An error has occurred." - : ""; - var user = await GetCurrentUserAsync(); - if (user == null) - { - return View("Error"); - } - var userLogins = await _userManager.GetLoginsAsync(user); - var otherLogins = _signInManager.GetExternalAuthenticationSchemes().Where(auth => userLogins.All(ul => auth.AuthenticationScheme != ul.LoginProvider)).ToList(); - ViewData["ShowRemoveButton"] = user.PasswordHash != null || userLogins.Count > 1; - return View(new ManageLoginsViewModel - { - CurrentLogins = userLogins, - OtherLogins = otherLogins - }); - } - - // - // POST: /Manage/LinkLogin - [HttpPost] - [ValidateAntiForgeryToken] - public IActionResult LinkLogin(string provider) - { - // Request a redirect to the external login provider to link a login for the current user - var redirectUrl = Url.Action("LinkLoginCallback", "Manage"); - var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl, _userManager.GetUserId(User)); - return Challenge(properties, provider); - } - - // - // GET: /Manage/LinkLoginCallback - [HttpGet] - public async Task LinkLoginCallback() - { - var user = await GetCurrentUserAsync(); - if (user == null) - { - return View("Error"); - } - var info = await _signInManager.GetExternalLoginInfoAsync(await _userManager.GetUserIdAsync(user)); - if (info == null) - { - return RedirectToAction(nameof(ManageLogins), new { Message = ManageMessageId.Error }); - } - var result = await _userManager.AddLoginAsync(user, info); - var message = result.Succeeded ? ManageMessageId.AddLoginSuccess : ManageMessageId.Error; - return RedirectToAction(nameof(ManageLogins), new { Message = message }); - } - - #region Helpers - - private void AddErrors(IdentityResult result) - { - foreach (var error in result.Errors) - { - ModelState.AddModelError(string.Empty, error.Description); - } - } - - public enum ManageMessageId - { - AddPhoneSuccess, - AddLoginSuccess, - ChangePasswordSuccess, - SetTwoFactorSuccess, - SetPasswordSuccess, - RemoveLoginSuccess, - RemovePhoneSuccess, - Error - } - - private Task GetCurrentUserAsync() - { - return _userManager.GetUserAsync(HttpContext.User); - } - - #endregion - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Data/ApplicationDbContext.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Data/ApplicationDbContext.cs deleted file mode 100755 index 329199667..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Data/ApplicationDbContext.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.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using WebApplication.Models; - -namespace WebApplication.Data -{ - public class ApplicationDbContext : IdentityDbContext - { - public ApplicationDbContext(DbContextOptions options) - : base(options) - { - } - - protected override void OnModelCreating(ModelBuilder builder) - { - base.OnModelCreating(builder); - // Customize the ASP.NET Identity model and override the defaults if needed. - // For example, you can rename the ASP.NET Identity table names and more. - // Add your customizations after calling base.OnModelCreating(builder); - } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs deleted file mode 100755 index 5262b9296..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs +++ /dev/null @@ -1,215 +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.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using WebApplication.Data; - -namespace WebApplication.Data.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("00000000000000_CreateIdentitySchema")] - partial class CreateIdentitySchema - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { - modelBuilder - .HasAnnotation("ProductVersion", "1.0.0-rc2-20901"); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b => - { - b.Property("Id"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasAnnotation("MaxLength", 256); - - b.Property("NormalizedName") - .HasAnnotation("MaxLength", 256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("WebApplication.Models.ApplicationUser", b => - { - b.Property("Id"); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasAnnotation("MaxLength", 256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasAnnotation("MaxLength", 256); - - b.Property("NormalizedUserName") - .HasAnnotation("MaxLength", 256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasAnnotation("MaxLength", 256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => - { - b.HasOne("WebApplication.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => - { - b.HasOne("WebApplication.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("WebApplication.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Data/Migrations/00000000000000_CreateIdentitySchema.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Data/Migrations/00000000000000_CreateIdentitySchema.cs deleted file mode 100755 index 751316b28..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Data/Migrations/00000000000000_CreateIdentitySchema.cs +++ /dev/null @@ -1,218 +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.EntityFrameworkCore.Migrations; - -namespace WebApplication.Data.Migrations -{ - public partial class CreateIdentitySchema : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "AspNetRoles", - columns: table => new - { - Id = table.Column(nullable: false), - ConcurrencyStamp = table.Column(nullable: true), - Name = table.Column(nullable: true), - NormalizedName = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetRoles", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserTokens", - columns: table => new - { - UserId = table.Column(nullable: false), - LoginProvider = table.Column(nullable: false), - Name = table.Column(nullable: false), - Value = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); - }); - - migrationBuilder.CreateTable( - name: "AspNetUsers", - columns: table => new - { - Id = table.Column(nullable: false), - AccessFailedCount = table.Column(nullable: false), - ConcurrencyStamp = table.Column(nullable: true), - Email = table.Column(nullable: true), - EmailConfirmed = table.Column(nullable: false), - LockoutEnabled = table.Column(nullable: false), - LockoutEnd = table.Column(nullable: true), - NormalizedEmail = table.Column(nullable: true), - NormalizedUserName = table.Column(nullable: true), - PasswordHash = table.Column(nullable: true), - PhoneNumber = table.Column(nullable: true), - PhoneNumberConfirmed = table.Column(nullable: false), - SecurityStamp = table.Column(nullable: true), - TwoFactorEnabled = table.Column(nullable: false), - UserName = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUsers", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AspNetRoleClaims", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Autoincrement", true), - ClaimType = table.Column(nullable: true), - ClaimValue = table.Column(nullable: true), - RoleId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id); - table.ForeignKey( - name: "FK_AspNetRoleClaims_AspNetRoles_RoleId", - column: x => x.RoleId, - principalTable: "AspNetRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserClaims", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Autoincrement", true), - ClaimType = table.Column(nullable: true), - ClaimValue = table.Column(nullable: true), - UserId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); - table.ForeignKey( - name: "FK_AspNetUserClaims_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserLogins", - columns: table => new - { - LoginProvider = table.Column(nullable: false), - ProviderKey = table.Column(nullable: false), - ProviderDisplayName = table.Column(nullable: true), - UserId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey }); - table.ForeignKey( - name: "FK_AspNetUserLogins_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AspNetUserRoles", - columns: table => new - { - UserId = table.Column(nullable: false), - RoleId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId }); - table.ForeignKey( - name: "FK_AspNetUserRoles_AspNetRoles_RoleId", - column: x => x.RoleId, - principalTable: "AspNetRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AspNetUserRoles_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "RoleNameIndex", - table: "AspNetRoles", - column: "NormalizedName"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetRoleClaims_RoleId", - table: "AspNetRoleClaims", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserClaims_UserId", - table: "AspNetUserClaims", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserLogins_UserId", - table: "AspNetUserLogins", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserRoles_RoleId", - table: "AspNetUserRoles", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserRoles_UserId", - table: "AspNetUserRoles", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "EmailIndex", - table: "AspNetUsers", - column: "NormalizedEmail"); - - migrationBuilder.CreateIndex( - name: "UserNameIndex", - table: "AspNetUsers", - column: "NormalizedUserName"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AspNetRoleClaims"); - - migrationBuilder.DropTable( - name: "AspNetUserClaims"); - - migrationBuilder.DropTable( - name: "AspNetUserLogins"); - - migrationBuilder.DropTable( - name: "AspNetUserRoles"); - - migrationBuilder.DropTable( - name: "AspNetUserTokens"); - - migrationBuilder.DropTable( - name: "AspNetRoles"); - - migrationBuilder.DropTable( - name: "AspNetUsers"); - } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Data/Migrations/ApplicationDbContextModelSnapshot.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Data/Migrations/ApplicationDbContextModelSnapshot.cs deleted file mode 100755 index 54608c041..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Data/Migrations/ApplicationDbContextModelSnapshot.cs +++ /dev/null @@ -1,214 +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.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using WebApplication.Data; - -namespace WebApplication.Data.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - partial class ApplicationDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { - modelBuilder - .HasAnnotation("ProductVersion", "1.0.0-rc2-20901"); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b => - { - b.Property("Id"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasAnnotation("MaxLength", 256); - - b.Property("NormalizedName") - .HasAnnotation("MaxLength", 256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("WebApplication.Models.ApplicationUser", b => - { - b.Property("Id"); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasAnnotation("MaxLength", 256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasAnnotation("MaxLength", 256); - - b.Property("NormalizedUserName") - .HasAnnotation("MaxLength", 256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasAnnotation("MaxLength", 256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim", b => - { - b.HasOne("WebApplication.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin", b => - { - b.HasOne("WebApplication.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("WebApplication.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs deleted file mode 100755 index 033c4b789..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/AccountViewModels/ExternalLoginConfirmationViewModel.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. - -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.AccountViewModels -{ - public class ExternalLoginConfirmationViewModel - { - [Required] - [EmailAddress] - public string Email { get; set; } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/AccountViewModels/ForgotPasswordViewModel.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/AccountViewModels/ForgotPasswordViewModel.cs deleted file mode 100755 index 5b026a9f3..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/AccountViewModels/ForgotPasswordViewModel.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. - -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.AccountViewModels -{ - public class ForgotPasswordViewModel - { - [Required] - [EmailAddress] - public string Email { get; set; } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/AccountViewModels/LoginViewModel.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/AccountViewModels/LoginViewModel.cs deleted file mode 100755 index ae17051ab..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/AccountViewModels/LoginViewModel.cs +++ /dev/null @@ -1,25 +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.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.AccountViewModels -{ - public class LoginViewModel - { - [Required] - [EmailAddress] - public string Email { get; set; } - - [Required] - [DataType(DataType.Password)] - public string Password { get; set; } - - [Display(Name = "Remember me?")] - public bool RememberMe { get; set; } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/AccountViewModels/RegisterViewModel.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/AccountViewModels/RegisterViewModel.cs deleted file mode 100755 index a6d5f1a96..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/AccountViewModels/RegisterViewModel.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.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.AccountViewModels -{ - public class RegisterViewModel - { - [Required] - [EmailAddress] - [Display(Name = "Email")] - public string Email { get; set; } - - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "Password")] - public string Password { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm password")] - [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/AccountViewModels/ResetPasswordViewModel.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/AccountViewModels/ResetPasswordViewModel.cs deleted file mode 100755 index 15c2967f1..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/AccountViewModels/ResetPasswordViewModel.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.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.AccountViewModels -{ - public class ResetPasswordViewModel - { - [Required] - [EmailAddress] - public string Email { get; set; } - - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - public string Password { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm password")] - [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - - public string Code { get; set; } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/AccountViewModels/SendCodeViewModel.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/AccountViewModels/SendCodeViewModel.cs deleted file mode 100755 index 2f44b9951..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/AccountViewModels/SendCodeViewModel.cs +++ /dev/null @@ -1,22 +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.Threading.Tasks; -using Microsoft.AspNetCore.Mvc.Rendering; - -namespace WebApplication.Models.AccountViewModels -{ - public class SendCodeViewModel - { - public string SelectedProvider { get; set; } - - public ICollection Providers { get; set; } - - public string ReturnUrl { get; set; } - - public bool RememberMe { get; set; } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/AccountViewModels/VerifyCodeViewModel.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/AccountViewModels/VerifyCodeViewModel.cs deleted file mode 100755 index c1016c143..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/AccountViewModels/VerifyCodeViewModel.cs +++ /dev/null @@ -1,28 +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.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.AccountViewModels -{ - public class VerifyCodeViewModel - { - [Required] - public string Provider { get; set; } - - [Required] - public string Code { get; set; } - - public string ReturnUrl { get; set; } - - [Display(Name = "Remember this browser?")] - public bool RememberBrowser { get; set; } - - [Display(Name = "Remember me?")] - public bool RememberMe { get; set; } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ApplicationUser.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ApplicationUser.cs deleted file mode 100755 index 047cfadd5..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ApplicationUser.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; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; - -namespace WebApplication.Models -{ - // Add profile data for application users by adding properties to the ApplicationUser class - public class ApplicationUser : IdentityUser - { - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/AddPhoneNumberViewModel.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/AddPhoneNumberViewModel.cs deleted file mode 100755 index 0648e6f44..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/AddPhoneNumberViewModel.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 System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.ManageViewModels -{ - public class AddPhoneNumberViewModel - { - [Required] - [Phone] - [Display(Name = "Phone number")] - public string PhoneNumber { get; set; } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/ChangePasswordViewModel.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/ChangePasswordViewModel.cs deleted file mode 100755 index 51093e9b1..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/ChangePasswordViewModel.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.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.ManageViewModels -{ - public class ChangePasswordViewModel - { - [Required] - [DataType(DataType.Password)] - [Display(Name = "Current password")] - public string OldPassword { get; set; } - - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "New password")] - public string NewPassword { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm new password")] - [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs deleted file mode 100755 index e56af0ec0..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/ConfigureTwoFactorViewModel.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. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc.Rendering; - -namespace WebApplication.Models.ManageViewModels -{ - public class ConfigureTwoFactorViewModel - { - public string SelectedProvider { get; set; } - - public ICollection Providers { get; set; } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/FactorViewModel.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/FactorViewModel.cs deleted file mode 100755 index 1b74bc14b..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/FactorViewModel.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; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.ManageViewModels -{ - public class FactorViewModel - { - public string Purpose { get; set; } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/IndexViewModel.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/IndexViewModel.cs deleted file mode 100755 index f97ce4cf4..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/IndexViewModel.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.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Identity; - -namespace WebApplication.Models.ManageViewModels -{ - public class IndexViewModel - { - public bool HasPassword { get; set; } - - public IList Logins { get; set; } - - public string PhoneNumber { get; set; } - - public bool TwoFactor { get; set; } - - public bool BrowserRemembered { get; set; } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/ManageLoginsViewModel.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/ManageLoginsViewModel.cs deleted file mode 100755 index e2474b126..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/ManageLoginsViewModel.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 System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Http.Authentication; -using Microsoft.AspNetCore.Identity; - -namespace WebApplication.Models.ManageViewModels -{ - public class ManageLoginsViewModel - { - public IList CurrentLogins { get; set; } - - public IList OtherLogins { get; set; } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/RemoveLoginViewModel.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/RemoveLoginViewModel.cs deleted file mode 100755 index 031d5421b..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/RemoveLoginViewModel.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 System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.ManageViewModels -{ - public class RemoveLoginViewModel - { - public string LoginProvider { get; set; } - public string ProviderKey { get; set; } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/SetPasswordViewModel.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/SetPasswordViewModel.cs deleted file mode 100755 index 861834531..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/SetPasswordViewModel.cs +++ /dev/null @@ -1,25 +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.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.ManageViewModels -{ - public class SetPasswordViewModel - { - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "New password")] - public string NewPassword { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm new password")] - [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs deleted file mode 100755 index 13ee9834e..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs +++ /dev/null @@ -1,22 +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.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Models.ManageViewModels -{ - public class VerifyPhoneNumberViewModel - { - [Required] - public string Code { get; set; } - - [Required] - [Phone] - [Display(Name = "Phone number")] - public string PhoneNumber { get; set; } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Program.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Program.cs deleted file mode 100755 index de237aae7..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Program.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; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Hosting; - -namespace WebApplication -{ - public class Program - { - public static void Main(string[] args) - { - var host = new WebHostBuilder() - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseIISIntegration() - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/README.md b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/README.md deleted file mode 100755 index d8ba0b382..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# Welcome to ASP.NET Core - -We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. - -You've created a new ASP.NET Core project. [Learn what's new](https://go.microsoft.com/fwlink/?LinkId=518016) - -## This application consists of: - -* Sample pages using ASP.NET Core MVC -* [Gulp](https://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](https://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side libraries -* Theming using [Bootstrap](https://go.microsoft.com/fwlink/?LinkID=398939) - -## How to - -* [Add a Controller and View](https://go.microsoft.com/fwlink/?LinkID=398600) -* [Add an appsetting in config and access it in app.](https://go.microsoft.com/fwlink/?LinkID=699562) -* [Manage User Secrets using Secret Manager.](https://go.microsoft.com/fwlink/?LinkId=699315) -* [Use logging to log a message.](https://go.microsoft.com/fwlink/?LinkId=699316) -* [Add packages using NuGet.](https://go.microsoft.com/fwlink/?LinkId=699317) -* [Add client packages using Bower.](https://go.microsoft.com/fwlink/?LinkId=699318) -* [Target development, staging or production environment.](https://go.microsoft.com/fwlink/?LinkId=699319) - -## Overview - -* [Conceptual overview of what is ASP.NET Core](https://go.microsoft.com/fwlink/?LinkId=518008) -* [Fundamentals of ASP.NET Core such as Startup and middleware.](https://go.microsoft.com/fwlink/?LinkId=699320) -* [Working with Data](https://go.microsoft.com/fwlink/?LinkId=398602) -* [Security](https://go.microsoft.com/fwlink/?LinkId=398603) -* [Client side development](https://go.microsoft.com/fwlink/?LinkID=699321) -* [Develop on different platforms](https://go.microsoft.com/fwlink/?LinkID=699322) -* [Read more on the documentation site](https://go.microsoft.com/fwlink/?LinkID=699323) - -## Run & Deploy - -* [Run your app](https://go.microsoft.com/fwlink/?LinkID=517851) -* [Run tools such as EF migrations and more](https://go.microsoft.com/fwlink/?LinkID=517853) -* [Publish to Microsoft Azure Web Apps](https://go.microsoft.com/fwlink/?LinkID=398609) - -We would love to hear your [feedback](https://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Services/IEmailSender.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Services/IEmailSender.cs deleted file mode 100755 index 8010a870c..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Services/IEmailSender.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; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Services -{ - public interface IEmailSender - { - Task SendEmailAsync(string email, string subject, string message); - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Services/ISmsSender.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Services/ISmsSender.cs deleted file mode 100755 index b887b6113..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Services/ISmsSender.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; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace WebApplication.Services -{ - public interface ISmsSender - { - Task SendSmsAsync(string number, string message); - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Services/MessageServices.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Services/MessageServices.cs deleted file mode 100755 index c3ee43128..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Services/MessageServices.cs +++ /dev/null @@ -1,28 +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.Threading.Tasks; - -namespace WebApplication.Services -{ - // This class is used by the application to send Email and SMS - // when you turn on two-factor authentication in ASP.NET Identity. - // For more details see this link https://go.microsoft.com/fwlink/?LinkID=532713 - public class AuthMessageSender : IEmailSender, ISmsSender - { - public Task SendEmailAsync(string email, string subject, string message) - { - // Plug in your email service here to send an email. - return Task.FromResult(0); - } - - public Task SendSmsAsync(string number, string message) - { - // Plug in your SMS service here to send a text message. - return Task.FromResult(0); - } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Startup.cs b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Startup.cs deleted file mode 100755 index 9280e73f0..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Startup.cs +++ /dev/null @@ -1,91 +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.Threading.Tasks; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using WebApplication.Data; -using WebApplication.Models; -using WebApplication.Services; - -namespace WebApplication -{ - public class Startup - { - public Startup(IHostingEnvironment env) - { - var builder = new ConfigurationBuilder() - .SetBasePath(env.ContentRootPath) - .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) - .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true); - - if (env.IsDevelopment()) - { - // For more details on using the user secret store see https://go.microsoft.com/fwlink/?LinkID=532709 - builder.AddUserSecrets(); - } - - builder.AddEnvironmentVariables(); - Configuration = builder.Build(); - } - - public IConfigurationRoot Configuration { get; } - - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - // Add framework services. - services.AddDbContext(options => - options.UseSqlite(Configuration.GetConnectionString("DefaultConnection"))); - - services.AddIdentity() - .AddEntityFrameworkStores() - .AddDefaultTokenProviders(); - - services.AddMvc(); - - // Add application services. - services.AddTransient(); - services.AddTransient(); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) - { - loggerFactory.AddConsole(Configuration.GetSection("Logging")); - loggerFactory.AddDebug(); - - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - app.UseDatabaseErrorPage(); - app.UseBrowserLink(); - } - else - { - app.UseExceptionHandler("/Home/Error"); - } - - app.UseStaticFiles(); - - app.UseIdentity(); - - // Add external authentication middleware below. To configure them please see https://go.microsoft.com/fwlink/?LinkID=532715 - - app.UseMvc(routes => - { - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - }); - } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/ConfirmEmail.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/ConfirmEmail.cshtml deleted file mode 100755 index 8e8088d44..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/ConfirmEmail.cshtml +++ /dev/null @@ -1,10 +0,0 @@ -@{ - ViewData["Title"] = "Confirm Email"; -} - -

@ViewData["Title"].

-
-

- Thank you for confirming your email. Please Click here to Log in. -

-
diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/ExternalLoginConfirmation.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/ExternalLoginConfirmation.cshtml deleted file mode 100755 index eb3612b55..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/ExternalLoginConfirmation.cshtml +++ /dev/null @@ -1,35 +0,0 @@ -@model ExternalLoginConfirmationViewModel -@{ - ViewData["Title"] = "Register"; -} - -

@ViewData["Title"].

-

Associate your @ViewData["LoginProvider"] account.

- -
-

Association Form

-
-
- -

- You've successfully authenticated with @ViewData["LoginProvider"]. - Please enter an email address for this site below and click the Register button to finish - logging in. -

-
- -
- - -
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/ExternalLoginFailure.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/ExternalLoginFailure.cshtml deleted file mode 100755 index 2509746be..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/ExternalLoginFailure.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@{ - ViewData["Title"] = "Login Failure"; -} - -
-

@ViewData["Title"].

-

Unsuccessful login with service.

-
diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/ForgotPassword.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/ForgotPassword.cshtml deleted file mode 100755 index 9d748023f..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/ForgotPassword.cshtml +++ /dev/null @@ -1,31 +0,0 @@ -@model ForgotPasswordViewModel -@{ - ViewData["Title"] = "Forgot your password?"; -} - -

@ViewData["Title"]

-

- For more information on how to enable reset password please see this article. -

- -@*
-

Enter your email.

-
-
-
- -
- - -
-
-
-
- -
-
-
*@ - -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/ForgotPasswordConfirmation.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/ForgotPasswordConfirmation.cshtml deleted file mode 100755 index 4877fc83a..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/ForgotPasswordConfirmation.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@{ - ViewData["Title"] = "Forgot Password Confirmation"; -} - -

@ViewData["Title"].

-

- Please check your email to reset your password. -

diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/Lockout.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/Lockout.cshtml deleted file mode 100755 index 34ac56ff3..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/Lockout.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@{ - ViewData["Title"] = "Locked out"; -} - -
-

Locked out.

-

This account has been locked out, please try again later.

-
diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/Login.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/Login.cshtml deleted file mode 100755 index 95430a12e..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/Login.cshtml +++ /dev/null @@ -1,92 +0,0 @@ -@using System.Collections.Generic -@using Microsoft.AspNetCore.Http -@using Microsoft.AspNetCore.Http.Authentication -@model LoginViewModel -@inject SignInManager SignInManager - -@{ - ViewData["Title"] = "Log in"; -} - -

@ViewData["Title"].

-
-
-
-
-

Use a local account to log in.

-
-
-
- -
- - -
-
-
- -
- - -
-
-
-
-
- -
-
-
-
-
- -
-
-

- Register as a new user? -

-

- Forgot your password? -

-
-
-
-
-
-

Use another service to log in.

-
- @{ - var loginProviders = SignInManager.GetExternalAuthenticationSchemes().ToList(); - if (loginProviders.Count == 0) - { -
-

- There are no external authentication services configured. See this article - for details on setting up this ASP.NET application to support logging in via external services. -

-
- } - else - { -
-
-

- @foreach (var provider in loginProviders) - { - - } -

-
-
- } - } -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/Register.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/Register.cshtml deleted file mode 100755 index 2090f900e..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/Register.cshtml +++ /dev/null @@ -1,42 +0,0 @@ -@model RegisterViewModel -@{ - ViewData["Title"] = "Register"; -} - -

@ViewData["Title"].

- -
-

Create a new account.

-
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/ResetPassword.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/ResetPassword.cshtml deleted file mode 100755 index dd716d735..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/ResetPassword.cshtml +++ /dev/null @@ -1,43 +0,0 @@ -@model ResetPasswordViewModel -@{ - ViewData["Title"] = "Reset password"; -} - -

@ViewData["Title"].

- -
-

Reset your password.

-
-
- -
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/ResetPasswordConfirmation.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/ResetPasswordConfirmation.cshtml deleted file mode 100755 index 6321d858e..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/ResetPasswordConfirmation.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@{ - ViewData["Title"] = "Reset password confirmation"; -} - -

@ViewData["Title"].

-

- Your password has been reset. Please Click here to log in. -

diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/SendCode.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/SendCode.cshtml deleted file mode 100755 index e85ca3c2b..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/SendCode.cshtml +++ /dev/null @@ -1,21 +0,0 @@ -@model SendCodeViewModel -@{ - ViewData["Title"] = "Send Verification Code"; -} - -

@ViewData["Title"].

- -
- -
-
- Select Two-Factor Authentication Provider: - - -
-
-
- -@section Scripts { - @{await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/VerifyCode.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/VerifyCode.cshtml deleted file mode 100755 index 60afb361d..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Account/VerifyCode.cshtml +++ /dev/null @@ -1,38 +0,0 @@ -@model VerifyCodeViewModel -@{ - ViewData["Title"] = "Verify"; -} - -

@ViewData["Title"].

- -
-
- - -

@ViewData["Status"]

-
-
- -
- - -
-
-
-
-
- - -
-
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Home/About.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Home/About.cshtml deleted file mode 100755 index b653a26f1..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Home/About.cshtml +++ /dev/null @@ -1,7 +0,0 @@ -@{ - ViewData["Title"] = "About"; -} -

@ViewData["Title"].

-

@ViewData["Message"]

- -

Use this area to provide additional information.

diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Home/Contact.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Home/Contact.cshtml deleted file mode 100755 index f953aa63d..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Home/Contact.cshtml +++ /dev/null @@ -1,17 +0,0 @@ -@{ - ViewData["Title"] = "Contact"; -} -

@ViewData["Title"].

-

@ViewData["Message"]

- -
- One Microsoft Way
- Redmond, WA 98052-6399
- P: - 425.555.0100 -
- -
- Support: Support@example.com
- Marketing: Marketing@example.com -
diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Home/Index.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Home/Index.cshtml deleted file mode 100755 index 957b8c1da..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Home/Index.cshtml +++ /dev/null @@ -1,109 +0,0 @@ -@{ - ViewData["Title"] = "Home Page"; -} - - - - diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Manage/AddPhoneNumber.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Manage/AddPhoneNumber.cshtml deleted file mode 100755 index 2feb93b22..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Manage/AddPhoneNumber.cshtml +++ /dev/null @@ -1,27 +0,0 @@ -@model AddPhoneNumberViewModel -@{ - ViewData["Title"] = "Add Phone Number"; -} - -

@ViewData["Title"].

-
-

Add a phone number.

-
-
-
- -
- - -
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Manage/ChangePassword.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Manage/ChangePassword.cshtml deleted file mode 100755 index 41c7960c8..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Manage/ChangePassword.cshtml +++ /dev/null @@ -1,42 +0,0 @@ -@model ChangePasswordViewModel -@{ - ViewData["Title"] = "Change Password"; -} - -

@ViewData["Title"].

- -
-

Change Password Form

-
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Manage/Index.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Manage/Index.cshtml deleted file mode 100755 index 8419b2429..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Manage/Index.cshtml +++ /dev/null @@ -1,71 +0,0 @@ -@model IndexViewModel -@{ - ViewData["Title"] = "Manage your account"; -} - -

@ViewData["Title"].

-

@ViewData["StatusMessage"]

- -
-

Change your account settings

-
-
-
Password:
-
- @if (Model.HasPassword) - { - Change - } - else - { - Create - } -
-
External Logins:
-
- - @Model.Logins.Count Manage -
-
Phone Number:
-
-

- Phone Numbers can used as a second factor of verification in two-factor authentication. - See this article - for details on setting up this ASP.NET application to support two-factor authentication using SMS. -

- @*@(Model.PhoneNumber ?? "None") - @if (Model.PhoneNumber != null) - { -
- Change -
- [] -
- } - else - { - Add - }*@ -
- -
Two-Factor Authentication:
-
-

- There are no two-factor authentication providers configured. See this article - for setting up this application to support two-factor authentication. -

- @*@if (Model.TwoFactor) - { -
- Enabled -
- } - else - { -
- Disabled -
- }*@ -
-
-
diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Manage/ManageLogins.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Manage/ManageLogins.cshtml deleted file mode 100755 index 35e12da68..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Manage/ManageLogins.cshtml +++ /dev/null @@ -1,54 +0,0 @@ -@model ManageLoginsViewModel -@using Microsoft.AspNetCore.Http.Authentication -@{ - ViewData["Title"] = "Manage your external logins"; -} - -

@ViewData["Title"].

- -

@ViewData["StatusMessage"]

-@if (Model.CurrentLogins.Count > 0) -{ -

Registered Logins

- - - @for (var index = 0; index < Model.CurrentLogins.Count; index++) - { - - - - - } - -
@Model.CurrentLogins[index].LoginProvider - @if ((bool)ViewData["ShowRemoveButton"]) - { -
-
- - - -
-
- } - else - { - @:   - } -
-} -@if (Model.OtherLogins.Count > 0) -{ -

Add another service to log in.

-
-
-
-

- @foreach (var provider in Model.OtherLogins) - { - - } -

-
-
-} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Manage/SetPassword.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Manage/SetPassword.cshtml deleted file mode 100755 index cfa779160..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Manage/SetPassword.cshtml +++ /dev/null @@ -1,38 +0,0 @@ -@model SetPasswordViewModel -@{ - ViewData["Title"] = "Set Password"; -} - -

- You do not have a local username/password for this site. Add a local - account so you can log in without an external login. -

- -
-

Set your password

-
-
-
- -
- - -
-
-
- -
- - -
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Manage/VerifyPhoneNumber.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Manage/VerifyPhoneNumber.cshtml deleted file mode 100755 index af7cd0b1f..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Manage/VerifyPhoneNumber.cshtml +++ /dev/null @@ -1,30 +0,0 @@ -@model VerifyPhoneNumberViewModel -@{ - ViewData["Title"] = "Verify Phone Number"; -} - -

@ViewData["Title"].

- -
- -

Add a phone number.

-
@ViewData["Status"]
-
-
-
- -
- - -
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Shared/Error.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Shared/Error.cshtml deleted file mode 100755 index 229c2dead..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Shared/Error.cshtml +++ /dev/null @@ -1,14 +0,0 @@ -@{ - ViewData["Title"] = "Error"; -} - -

Error.

-

An error occurred while processing your request.

- -

Development Mode

-

- Swapping to Development environment will display more detailed information about the error that occurred. -

-

- Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. -

diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Shared/_Layout.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Shared/_Layout.cshtml deleted file mode 100755 index 56827ca52..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Shared/_Layout.cshtml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - @ViewData["Title"] - WebApplication - - - - - - - - - - - - -
- @RenderBody() -
-
-

© 2016 - WebApplication

-
-
- - - - - - - - - - - - - @RenderSection("scripts", required: false) - - diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Shared/_LoginPartial.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Shared/_LoginPartial.cshtml deleted file mode 100755 index f50d5e89e..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Shared/_LoginPartial.cshtml +++ /dev/null @@ -1,26 +0,0 @@ -@using Microsoft.AspNetCore.Identity -@using WebApplication.Models - -@inject SignInManager SignInManager -@inject UserManager UserManager - -@if (SignInManager.IsSignedIn(User)) -{ - -} -else -{ - -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Shared/_ValidationScriptsPartial.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Shared/_ValidationScriptsPartial.cshtml deleted file mode 100755 index 289b22064..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/Shared/_ValidationScriptsPartial.cshtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/_ViewImports.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/_ViewImports.cshtml deleted file mode 100755 index dcca16cb0..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/_ViewImports.cshtml +++ /dev/null @@ -1,6 +0,0 @@ -@using WebApplication -@using WebApplication.Models -@using WebApplication.Models.AccountViewModels -@using WebApplication.Models.ManageViewModels -@using Microsoft.AspNetCore.Identity -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/_ViewStart.cshtml b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/_ViewStart.cshtml deleted file mode 100755 index 820a2f6e0..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/Views/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "_Layout"; -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/appsettings.json b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/appsettings.json deleted file mode 100755 index 53b17ae04..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/appsettings.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "ConnectionStrings": { - "DefaultConnection": "Data Source=WebApplication.db" - }, - "Logging": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Debug", - "System": "Information", - "Microsoft": "Information" - } - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/bower.json b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/bower.json deleted file mode 100755 index 3891fce13..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/bower.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "webapplication", - "private": true, - "dependencies": { - "bootstrap": "3.3.6", - "jquery": "2.2.3", - "jquery-validation": "1.15.0", - "jquery-validation-unobtrusive": "3.2.6" - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/gulpfile.js b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/gulpfile.js deleted file mode 100755 index faf295540..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/gulpfile.js +++ /dev/null @@ -1,45 +0,0 @@ -/// -"use strict"; - -var gulp = require("gulp"), - rimraf = require("rimraf"), - concat = require("gulp-concat"), - cssmin = require("gulp-cssmin"), - uglify = require("gulp-uglify"); - -var webroot = "./wwwroot/"; - -var paths = { - js: webroot + "js/**/*.js", - minJs: webroot + "js/**/*.min.js", - css: webroot + "css/**/*.css", - minCss: webroot + "css/**/*.min.css", - concatJsDest: webroot + "js/site.min.js", - concatCssDest: webroot + "css/site.min.css" -}; - -gulp.task("clean:js", function (cb) { - rimraf(paths.concatJsDest, cb); -}); - -gulp.task("clean:css", function (cb) { - rimraf(paths.concatCssDest, cb); -}); - -gulp.task("clean", ["clean:js", "clean:css"]); - -gulp.task("min:js", function () { - return gulp.src([paths.js, "!" + paths.minJs], { base: "." }) - .pipe(concat(paths.concatJsDest)) - .pipe(uglify()) - .pipe(gulp.dest(".")); -}); - -gulp.task("min:css", function () { - return gulp.src([paths.css, "!" + paths.minCss]) - .pipe(concat(paths.concatCssDest)) - .pipe(cssmin()) - .pipe(gulp.dest(".")); -}); - -gulp.task("min", ["min:js", "min:css"]); diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/package.json b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/package.json deleted file mode 100755 index 4bb6c884c..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "webapplication", - "version": "0.0.0", - "private": true, - "devDependencies": { - "gulp": "3.9.1", - "gulp-concat": "2.6.0", - "gulp-cssmin": "0.1.7", - "gulp-uglify": "1.5.3", - "rimraf": "2.5.2" - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/project.json b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/project.json deleted file mode 100755 index f8e6d7db9..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/project.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "userSecretsId": "aspnet-WebApplication-0799fe3e-6eaf-4c5f-b40e-7c6bfd5dfa9a", - - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.1.0", - "type": "platform" - }, - "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0", - "Microsoft.AspNetCore.Diagnostics": "1.0.0", - "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0", - "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0", - "Microsoft.AspNetCore.Mvc": "1.0.0", - "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview2-final", - "type": "build" - }, - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", - "Microsoft.AspNetCore.StaticFiles": "1.0.0", - "Microsoft.EntityFrameworkCore.Sqlite": "1.0.0", - "Microsoft.EntityFrameworkCore.Tools": { - "version": "1.0.0-preview2-final", - "type": "build" - }, - "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", - "Microsoft.Extensions.Configuration.Json": "1.0.0", - "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0", - "Microsoft.Extensions.Logging": "1.0.0", - "Microsoft.Extensions.Logging.Console": "1.0.0", - "Microsoft.Extensions.Logging.Debug": "1.0.0", - "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0", - "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { - "version": "1.0.0-preview2-final", - "type": "build" - }, - "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": { - "version": "1.0.0-preview2-final", - "type": "build" - } - }, - - "tools": { - "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview2-final", - "imports": "portable-net45+win8+dnxcore50" - }, - "Microsoft.AspNetCore.Server.IISIntegration.Tools": { - "version": "1.0.0-preview2-final", - "imports": "portable-net45+win8+dnxcore50" - }, - "Microsoft.EntityFrameworkCore.Tools": { - "version": "1.0.0-preview2-final", - "imports": [ - "portable-net45+win8+dnxcore50", - "portable-net45+win8" - ] - }, - "Microsoft.Extensions.SecretManager.Tools": { - "version": "1.0.0-preview2-final", - "imports": "portable-net45+win8+dnxcore50" - }, - "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { - "version": "1.0.0-preview2-final", - "imports": [ - "portable-net45+win8+dnxcore50", - "portable-net45+win8" - ] - } - }, - - "frameworks": { - "netcoreapp1.1": { - "imports": [ - "dotnet5.6", - "dnxcore50", - "portable-net45+win8" - ] - } - }, - - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - - "runtimeOptions": { - "configProperties": { - "System.GC.Server": true - } - }, - - "publishOptions": { - "include": [ - "wwwroot", - "Views", - "appsettings.json", - "web.config", - "nonExistingFile.config" - ] - }, - - "tooling": { - "defaultNamespace": "WebApplication" - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/web.config b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/web.config deleted file mode 100755 index a8d667275..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/web.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/css/site.css b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/css/site.css deleted file mode 100755 index 6baa84da1..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/css/site.css +++ /dev/null @@ -1,44 +0,0 @@ -body { - padding-top: 50px; - padding-bottom: 20px; -} - -/* Wrapping element */ -/* Set some basic padding to keep content from hitting the edges */ -.body-content { - padding-left: 15px; - padding-right: 15px; -} - -/* Set widths on the form inputs since otherwise they're 100% wide */ -input, -select, -textarea { - max-width: 280px; -} - -/* Carousel */ -.carousel-caption p { - font-size: 20px; - line-height: 1.4; -} - -/* buttons and links extension to use brackets: [ click me ] */ -.btn-bracketed::before { - display:inline-block; - content: "["; - padding-right: 0.5em; -} -.btn-bracketed::after { - display:inline-block; - content: "]"; - padding-left: 0.5em; -} - -/* Hide/rearrange for smaller screens */ -@media screen and (max-width: 767px) { - /* Hide captions */ - .carousel-caption { - display: none - } -} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/css/site.min.css b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/css/site.min.css deleted file mode 100755 index c8f600ac5..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/css/site.min.css +++ /dev/null @@ -1 +0,0 @@ -body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}input,select,textarea{max-width:280px}.carousel-caption p{font-size:20px;line-height:1.4}.btn-bracketed::before{display:inline-block;content:"[";padding-right:.5em}.btn-bracketed::after{display:inline-block;content:"]";padding-left:.5em}@media screen and (max-width:767px){.carousel-caption{display:none}} diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/favicon.ico b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/favicon.ico deleted file mode 100755 index a3a799985..000000000 Binary files a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/favicon.ico and /dev/null differ diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/images/banner1.svg b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/images/banner1.svg deleted file mode 100755 index 1ab32b60b..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/images/banner1.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/images/banner2.svg b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/images/banner2.svg deleted file mode 100755 index 9679c604d..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/images/banner2.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/images/banner3.svg b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/images/banner3.svg deleted file mode 100755 index 9be2c2503..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/images/banner3.svg +++ /dev/null @@ -1 +0,0 @@ -banner3b \ No newline at end of file diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/images/banner4.svg b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/images/banner4.svg deleted file mode 100755 index 38b3d7cd1..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/images/banner4.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/js/site.js b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/js/site.js deleted file mode 100755 index e069226a1..000000000 --- a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/js/site.js +++ /dev/null @@ -1 +0,0 @@ -// Write your Javascript code. diff --git a/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/js/site.min.js b/TestAssets/TestProjects/WebAppWithMissingFileInPublishOptions/wwwroot/js/site.min.js deleted file mode 100755 index e69de29bb..000000000 diff --git a/build.proj b/build.proj index 066001333..ac36138fb 100644 --- a/build.proj +++ b/build.proj @@ -53,7 +53,6 @@ - diff --git a/build/BranchInfo.props b/build/BranchInfo.props index 0d146ab2a..5510dc8b9 100644 --- a/build/BranchInfo.props +++ b/build/BranchInfo.props @@ -1,6 +1,6 @@ - release/2.0.0 - release/2.0.0 + master + master diff --git a/build/Branding.props b/build/Branding.props index a49ecbeef..25fc7c433 100644 --- a/build/Branding.props +++ b/build/Branding.props @@ -1,6 +1,6 @@ - Microsoft .NET Core 2.0.0 - SDK Preview 1 + Microsoft .NET Core 2.0.0 - Preview 2 SDK Microsoft .NET Core 2.0.0 - Runtime Microsoft .NET Core 2.0.0 - Host Microsoft .NET Core 2.0.0 - Host FX Resolver diff --git a/build/BuildDefaults.props b/build/BuildDefaults.props index 32ae1dfac..64eddcfd4 100644 --- a/build/BuildDefaults.props +++ b/build/BuildDefaults.props @@ -4,8 +4,7 @@ Debug true false - true - true + true true true diff --git a/build/BuildInfo.targets b/build/BuildInfo.targets index 6972a864e..751f10737 100644 --- a/build/BuildInfo.targets +++ b/build/BuildInfo.targets @@ -15,7 +15,7 @@ $(HostOSPlatform) -<Project ToolsVersion="15.0"> +<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Rid>$(Rid)</Rid> <Architecture>$(Architecture)</Architecture> diff --git a/build/BundledRuntimes.props b/build/BundledRuntimes.props index f9d2a589a..252b275f8 100644 --- a/build/BundledRuntimes.props +++ b/build/BundledRuntimes.props @@ -1,31 +1,28 @@ - -portable - -portable + $(Rid) + $(ProductMonikerRid) - dotnet-host-$(ProductMonikerRid).$(SharedHostVersion)$(InstallerPortableSuffix)$(InstallerExtension) + dotnet-host-$(CoreSetupRid).$(SharedHostVersion)$(InstallerExtension) $(PackagesDirectory)/$(DownloadedSharedHostInstallerFileName) - dotnet-hostfxr-$(ProductMonikerRid).$(HostFxrVersion)$(InstallerPortableSuffix)$(InstallerExtension) + dotnet-hostfxr-$(CoreSetupRid).$(HostFxrVersion)$(InstallerExtension) $(PackagesDirectory)/$(DownloadedHostFxrInstallerFileName) - dotnet-sharedframework-$(ProductMonikerRid).$(SharedFrameworkVersion)$(InstallerPortableSuffix)$(InstallerExtension) + dotnet-sharedframework-$(CoreSetupRid).$(SharedFrameworkVersion)$(InstallerExtension) $(PackagesDirectory)/$(DownloadedSharedFrameworkInstallerFileName) - $(ProductMonikerRid) + $(CoreSetupRid) linux-x64 - dotnet-$(SharedFrameworkRid).$(SharedFrameworkVersion)$(ArchivePortableSuffix)$(ArchiveExtension) + dotnet-$(SharedFrameworkRid).$(SharedFrameworkVersion)$(ArchiveExtension) - release/2.0.0 https://dotnetcli.azureedge.net/dotnet/ - $(CoreSetupBlobRootUrl)$(CoreSetupChannel) - $(CoreSetupBlobRootUrlWithChannel)/Binaries/$(SharedFrameworkVersion) - $(CoreSetupBlobRootUrlWithChannel)/Installers + $(CoreSetupBlobRootUrl)Runtime/ $(IntermediateDirectory)/coreSetupDownload/$(SharedFrameworkVersion) $(CoreSetupDownloadDirectory)/combinedSharedHostAndFrameworkArchive$(ArchiveExtension) @@ -49,28 +46,28 @@ <_DownloadAndExtractItem Include="CombinedSharedHostAndFrameworkArchive" Condition="!Exists('$(CombinedSharedHostAndFrameworkArchive)')"> - $(SharedFrameworkArchiveBlobRootUrl)/$(CombinedFrameworkHostCompressedFileName) + $(CoreSetupRootUrl)$(SharedFrameworkVersion)/$(CombinedFrameworkHostCompressedFileName) $(CombinedSharedHostAndFrameworkArchive) $(SharedFrameworkPublishDirectory) <_DownloadAndExtractItem Include="DownloadedSharedFrameworkInstallerFile" Condition="'$(SkipBuildingInstallers)' != 'true' And !Exists('$(DownloadedSharedFrameworkInstallerFile)') And '$(InstallerExtension)' != ''"> - $(CoreSetupInstallerBlobRootUrl)/$(SharedFrameworkVersion)/$(DownloadedSharedFrameworkInstallerFileName) + $(CoreSetupRootUrl)$(SharedFrameworkVersion)/$(DownloadedSharedFrameworkInstallerFileName) $(DownloadedSharedFrameworkInstallerFile) <_DownloadAndExtractItem Include="DownloadedSharedHostInstallerFile" Condition="'$(SkipBuildingInstallers)' != 'true' And !Exists('$(DownloadedSharedHostInstallerFile)') And '$(InstallerExtension)' != ''"> - $(CoreSetupInstallerBlobRootUrl)/$(SharedHostVersion)/$(DownloadedSharedHostInstallerFileName) + $(CoreSetupRootUrl)$(SharedHostVersion)/$(DownloadedSharedHostInstallerFileName) $(DownloadedSharedHostInstallerFile) <_DownloadAndExtractItem Include="DownloadedHostFxrInstallerFile" Condition="'$(SkipBuildingInstallers)' != 'true' And !Exists('$(DownloadedHostFxrInstallerFile)') And '$(InstallerExtension)' != ''"> - $(CoreSetupInstallerBlobRootUrl)/$(HostFxrVersion)/$(DownloadedHostFxrInstallerFileName) + $(CoreSetupRootUrl)$(HostFxrVersion)/$(DownloadedHostFxrInstallerFileName) $(DownloadedHostFxrInstallerFile) diff --git a/build/CrossGen.props b/build/CrossGen.props index b4557d666..8d5dd78ec 100644 --- a/build/CrossGen.props +++ b/build/CrossGen.props @@ -1,8 +1,8 @@ - runtime.$(CoreCLRRid).microsoft.netcore.app + runtime.$(SharedFrameworkRid).microsoft.netcore.app $(NuGetPackagesDir)/$(RuntimeNETCoreAppPackageName)/$(CLI_SharedFrameworkVersion)/tools/crossgen$(ExeExtension) - $(NuGetPackagesDir)/$(RuntimeNETCoreAppPackageName)/$(CLI_SharedFrameworkVersion)/runtimes/$(CoreCLRRid)/native/$(DynamicLibPrefix)clrjit$(DynamicLibExtension) + $(NuGetPackagesDir)/$(RuntimeNETCoreAppPackageName)/$(CLI_SharedFrameworkVersion)/runtimes/$(SharedFrameworkRid)/native/$(DynamicLibPrefix)clrjit$(DynamicLibExtension) $(OutputDirectory)/shared/$(SharedFrameworkName)/$(SharedFrameworkVersion) diff --git a/build/DependencyVersions.props b/build/DependencyVersions.props index 10ce3f677..84196e098 100644 --- a/build/DependencyVersions.props +++ b/build/DependencyVersions.props @@ -1,33 +1,37 @@ - 2.0.0-preview1-002111-00 - 15.3.0-preview-000117-01 - 2.0.0-rc4-61325-08 - 2.0.0-alpha-20170509-2 - 4.3.0-beta1-2418 + 2.0.0-preview2-25319-02 + 15.3.0-preview-000246-05 + 2.3.0-beta2-61716-09 + 1.6.0-beta2-25304 + 1.0.0-rc-170511-0 + 2.0.0-preview2-20170506-1 + 4.3.0-preview1-2500 2.0.0-rel-20170518-512 - 15.3.0-preview-20170517-02 + 15.3.0-preview-20170502-03 $(CLI_SharedFrameworkVersion) $(CLI_SharedFrameworkVersion) $(CLI_SharedFrameworkVersion) - 1.0.0-beta2-20170518-237 - 1.0.0-beta2-20170505-222 - 1.0.0-beta2-20170505-222 - 2.0.0-preview1-002111 - 2.0.0-preview1-002111 + 1.0.0-beta2-20170523-241 + 1.0.0-beta2-20170523-241 + 1.0.0-beta2-20170523-241 + 2.0.0-preview2-25319-02 + 2.0.0-preview2-25319-02 0.1.0-alpha-142 + 1.2.1-alpha-002130 + 0.2.0 - notimestamp - 2.0.0-preview1-92 - preview2-25098 + timestamped + dev-125 + preview2-25159 - 1.0.27-prerelease-01402-01 + 1.0.27-prerelease-01611-04 2.0.0-preview1-001877 diff --git a/build/FileExtensions.props b/build/FileExtensions.props index 210287ae0..cc9f7e79c 100644 --- a/build/FileExtensions.props +++ b/build/FileExtensions.props @@ -6,11 +6,11 @@ .msi .pkg - .deb + .deb .exe $(InstallerExtension) - $(InstallerExtension) + $(InstallerExtension) lib diff --git a/build/InitRepo.props b/build/InitRepo.props index 39a2b5b99..3a17534a9 100644 --- a/build/InitRepo.props +++ b/build/InitRepo.props @@ -1,4 +1,4 @@ - + $(RepoRoot)/artifacts/obj $(GeneratedPropsDir)/GitCommitInfo.props diff --git a/build/InstallerInfo.props b/build/InstallerInfo.props index 8ae54f708..6cc81f094 100644 --- a/build/InstallerInfo.props +++ b/build/InstallerInfo.props @@ -5,8 +5,8 @@ $(InstallerOutputDirectory)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(BundleExtension) $(IntermediateDirectory)/debian/sdk - $(SdkDebianIntermediateDirectory)/debianLayoutDirectory - $(IntermediateDirectory)/layouts + $(SdkDebianIntermediateDirectory)/debianLayoutDirectory + $(IntermediateDirectory)/layouts $(LayoutDirectory)/$(ArtifactNameSdk) diff --git a/build/MicroBuild.props b/build/MicroBuild.props new file mode 100644 index 000000000..1cf77f45b --- /dev/null +++ b/build/MicroBuild.props @@ -0,0 +1,11 @@ + + + + + $(MSBuildThisFileDirectory)/.. + $(NUGET_PACKAGES) + $(RepoRoot)/.nuget/packages + + $(NuGetPackagesDir)/microbuild.core/$(MicroBuildVersion)/build/ + + diff --git a/build/OutputDirectories.props b/build/OutputDirectories.props index f780e3656..ac291e14b 100644 --- a/build/OutputDirectories.props +++ b/build/OutputDirectories.props @@ -6,6 +6,7 @@ $(OutputDirectory)/sdk/$(SdkVersion) $(BaseOutputDirectory)/stage2symbols $(SdkOutputDirectory)/Roslyn + $(SdkOutputDirectory)/FSharp $(BaseOutputDirectory)/stage2compilation $(BaseOutputDirectory)/intermediate $(BaseOutputDirectory)/packages diff --git a/build/Prepare.targets b/build/Prepare.targets index 074f4b758..214b1f78d 100644 --- a/build/Prepare.targets +++ b/build/Prepare.targets @@ -80,7 +80,8 @@ + ProjectPath=""%(RestoreToolsPackagesInput.FullPath)"" + AdditionalParameters="/p:UsePortableLinuxSharedFramework=$(UsePortableLinuxSharedFramework)" /> diff --git a/build/Run.targets b/build/Run.targets deleted file mode 100644 index d0f48571a..000000000 --- a/build/Run.targets +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/build/Signing.proj b/build/Signing.proj index 3fa6d63b4..b896366db 100644 --- a/build/Signing.proj +++ b/build/Signing.proj @@ -1,10 +1,9 @@ - - $(MSBuildThisFileDirectory)/.. - - - + + + + @@ -127,5 +126,5 @@ - + diff --git a/build/Stage0.props b/build/Stage0.props index b337b34b3..e5a6a0b50 100644 --- a/build/Stage0.props +++ b/build/Stage0.props @@ -5,8 +5,5 @@ $(Stage0Directory)/dotnet$(ExeExtension) False True - win-$(Architecture) - osx-x64 - linux-x64 diff --git a/build/Version.props b/build/Version.props index a121c2f6d..b9f79eb58 100644 --- a/build/Version.props +++ b/build/Version.props @@ -3,7 +3,7 @@ 2 0 0 - preview1 + preview2 $(VersionMajor).$(VersionMinor).$(VersionPatch)-$(ReleaseSuffix) $(VersionMajor).$(VersionMinor).$(VersionPatch).$(CommitCount) diff --git a/build/package/Installer.DEB.proj b/build/package/Installer.DEB.proj index 80aefcc73..9310623cc 100644 --- a/build/package/Installer.DEB.proj +++ b/build/package/Installer.DEB.proj @@ -10,11 +10,11 @@ TestDebuild; BuildSdkDeb; TestSdkDeb;" - Condition=" '$(OSName)' == 'ubuntu' " + Condition=" '$(OSName)' == 'ubuntu' OR '$(OSName)' == 'debian' " Outputs="@(GeneratedInstallers)"/> + VersionPatch="$(VersionPatch)"> diff --git a/build/publish/PublishDebian.targets b/build/publish/PublishDebian.targets index f7d731218..c920baf81 100644 --- a/build/publish/PublishDebian.targets +++ b/build/publish/PublishDebian.targets @@ -1,11 +1,11 @@ - - - + + dotnet-dev-$(SdkVersion) + - $(DotnetBlobRootUrl)/$(Product)/$(FullNugetVersion)/%(SdkInstallerFileItemGroup.Filename)%(SdkInstallerFileItemGroup.Extension) + $(DotnetBlobRootUrl)/$(Product)/$(FullNugetVersion)/$(ArtifactNameWithVersionSdk)$(InstallerExtension) $(SdkDebianIntermediateDirectory)/package_upload.json 1 @@ -19,7 +19,7 @@ - + diff --git a/build/test/TestPackageProjects.targets b/build/test/TestPackageProjects.targets index 610d03937..fea46690c 100644 --- a/build/test/TestPackageProjects.targets +++ b/build/test/TestPackageProjects.targets @@ -59,7 +59,6 @@ 1.0.0 True - /p:RuntimeIdentifier=$(CoreCLRRid) dotnet-dependency-context-test diff --git a/build_projects/Microsoft.DotNet.Cli.Build.Framework/CurrentArchitecture.cs b/build_projects/Microsoft.DotNet.Cli.Build.Framework/CurrentArchitecture.cs deleted file mode 100644 index a6b90cc63..000000000 --- a/build_projects/Microsoft.DotNet.Cli.Build.Framework/CurrentArchitecture.cs +++ /dev/null @@ -1,53 +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.PlatformAbstractions; - -namespace Microsoft.DotNet.Cli.Build.Framework -{ - public static class CurrentArchitecture - { - public static BuildArchitecture Current - { - get - { - return DetermineCurrentArchitecture(); - } - } - - public static bool Isx86 - { - get - { - var archName = RuntimeEnvironment.RuntimeArchitecture; - return string.Equals(archName, "x86", StringComparison.OrdinalIgnoreCase); - } - } - - public static bool Isx64 - { - get - { - var archName = RuntimeEnvironment.RuntimeArchitecture; - return string.Equals(archName, "x64", StringComparison.OrdinalIgnoreCase); - } - } - - private static BuildArchitecture DetermineCurrentArchitecture() - { - if (Isx86) - { - return BuildArchitecture.x86; - } - else if (Isx64) - { - return BuildArchitecture.x64; - } - else - { - return default(BuildArchitecture); - } - } - } -} diff --git a/build_projects/Microsoft.DotNet.Cli.Build.Framework/Enumerations/BuildArchitecture.cs b/build_projects/Microsoft.DotNet.Cli.Build.Framework/Enumerations/BuildArchitecture.cs deleted file mode 100644 index d5d50ee6f..000000000 --- a/build_projects/Microsoft.DotNet.Cli.Build.Framework/Enumerations/BuildArchitecture.cs +++ /dev/null @@ -1,11 +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.Cli.Build.Framework -{ - public enum BuildArchitecture - { - x86 = 1, - x64 = 2 - } -} diff --git a/build_projects/dotnet-cli-build/EnvironmentVariableFilter.cs b/build_projects/dotnet-cli-build/EnvironmentVariableFilter.cs index d5a7a5acf..5d5cdf9e3 100644 --- a/build_projects/dotnet-cli-build/EnvironmentVariableFilter.cs +++ b/build_projects/dotnet-cli-build/EnvironmentVariableFilter.cs @@ -22,7 +22,7 @@ namespace Microsoft.DotNet.Cli.Build private IEnumerable _environmentVariablesToRemove = new string [] { - "CscToolExe" + "CscToolExe", "VbcToolExe" }; private IEnumerable _environmentVariablesToKeep = new string [] diff --git a/build_projects/dotnet-cli-build/GenerateMsiVersion.cs b/build_projects/dotnet-cli-build/GenerateMsiVersion.cs index 8a4043628..3c03a0a00 100644 --- a/build_projects/dotnet-cli-build/GenerateMsiVersion.cs +++ b/build_projects/dotnet-cli-build/GenerateMsiVersion.cs @@ -3,7 +3,6 @@ using Microsoft.Build.Framework; using Microsoft.Build.Utilities; -using System.Runtime.InteropServices; namespace Microsoft.DotNet.Cli.Build { @@ -21,20 +20,16 @@ namespace Microsoft.DotNet.Cli.Build [Required] public int VersionPatch { get; set; } - [Required] - public string ReleaseSuffix { get; set; } - [Output] public string MsiVersion { get; set; } public override bool Execute() { - var buildVersion = new BuildVersion() + var buildVersion = new Version() { Major = VersionMajor, Minor = VersionMinor, Patch = VersionPatch, - ReleaseSuffix = ReleaseSuffix, CommitCount = CommitCount }; diff --git a/build_projects/shared-build-targets-utils/Utils/BuildVersion.cs b/build_projects/shared-build-targets-utils/Utils/BuildVersion.cs deleted file mode 100644 index ba43dddcc..000000000 --- a/build_projects/shared-build-targets-utils/Utils/BuildVersion.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 System.Collections.Generic; - -namespace Microsoft.DotNet.Cli.Build -{ - public class BuildVersion : Version - { - public string VersionSuffix => $"{ReleaseSuffix}-{CommitCountString}"; - } -} diff --git a/build_projects/shared-build-targets-utils/Utils/Version.cs b/build_projects/shared-build-targets-utils/Utils/Version.cs index cc2ec209b..b7d4e7536 100644 --- a/build_projects/shared-build-targets-utils/Utils/Version.cs +++ b/build_projects/shared-build-targets-utils/Utils/Version.cs @@ -9,8 +9,6 @@ namespace Microsoft.DotNet.Cli.Build public virtual int Minor { get; set; } public virtual int Patch { get; set; } public virtual int CommitCount { get; set; } - public virtual string CommitCountString => CommitCount.ToString("000000"); - public virtual string ReleaseSuffix { get; set; } public string GenerateMsiVersion() { diff --git a/build_projects/update-dependencies/Program.cs b/build_projects/update-dependencies/Program.cs index 296ad2d0a..e256564d6 100644 --- a/build_projects/update-dependencies/Program.cs +++ b/build_projects/update-dependencies/Program.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. -using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.VersionTools; using Microsoft.DotNet.VersionTools.Automation; using Microsoft.DotNet.VersionTools.Dependencies; using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; using System.Text.RegularExpressions; @@ -19,7 +19,7 @@ namespace Microsoft.DotNet.Scripts public static void Main(string[] args) { - DebugHelper.HandleDebugSwitch(ref args); + HandleDebugSwitch(ref args); bool onlyUpdate = args.Length > 0 && string.Equals("--Update", args[0], StringComparison.OrdinalIgnoreCase); @@ -96,5 +96,21 @@ namespace Microsoft.DotNet.Scripts VersionGroupName = "version" }; } + + private static void HandleDebugSwitch(ref string[] args) + { + if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase)) + { + args = args.Skip(1).ToArray(); + WaitForDebugger(); + } + } + + private static void WaitForDebugger() + { + Console.WriteLine("Waiting for debugger to attach. Press ENTER to continue"); + Console.WriteLine($"Process ID: {Process.GetCurrentProcess().Id}"); + Console.ReadLine(); + } } } diff --git a/build_projects/update-dependencies/update-dependencies.csproj b/build_projects/update-dependencies/update-dependencies.csproj index 3fa31e791..2f82553fe 100644 --- a/build_projects/update-dependencies/update-dependencies.csproj +++ b/build_projects/update-dependencies/update-dependencies.csproj @@ -1,17 +1,12 @@  - + Updates the repos dependencies Exe - $(CliTargetFramework) - false + netcoreapp2.0 - - - - diff --git a/build_projects/update-dependencies/update-dependencies.ps1 b/build_projects/update-dependencies/update-dependencies.ps1 index 5a9760ecb..8eafc53c1 100644 --- a/build_projects/update-dependencies/update-dependencies.ps1 +++ b/build_projects/update-dependencies/update-dependencies.ps1 @@ -42,11 +42,6 @@ if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" } # Put the stage0 on the path $env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH" -# Generate some props files that are imported by update-dependencies -Write-Host "Generating property files..." -dotnet msbuild $RepoRoot\build.proj /p:Architecture=$Architecture /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles -if($LASTEXITCODE -ne 0) { throw "Failed to generate intermidates" } - # Restore the app Write-Host "Restoring $ProjectPath..." dotnet restore "$ProjectPath" diff --git a/build_projects/update-dependencies/update-dependencies.sh b/build_projects/update-dependencies/update-dependencies.sh index ccfb06831..4781c8453 100755 --- a/build_projects/update-dependencies/update-dependencies.sh +++ b/build_projects/update-dependencies/update-dependencies.sh @@ -42,11 +42,7 @@ fi # Put the stage 0 on the path export PATH=$DOTNET_INSTALL_DIR:$PATH -# Generate some props files that are imported by update-dependencies -echo "Generating property files..." -dotnet msbuild "$REPO_ROOT/build.proj" /p:Architecture=x64 /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles - -echo "Resotring $PROJECT_PATH..." +echo "Restoring $PROJECT_PATH..." dotnet restore "$PROJECT_PATH" if [ $? -ne 0 ]; then diff --git a/config.json b/config.json deleted file mode 100644 index c98d5789f..000000000 --- a/config.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "settings": { - "Project": { - "description": "Project where the commands are going to be applied.", - "valueType": "passThrough", - "values": [], - "defaultValue": "" - }, - "CleanArtifacts": { - "description": "MsBuild target that deletes the artifacts output directory.", - "valueType": "target", - "values": [], - "defaultValue": "" - }, - "CleanPackages": { - "description": "MsBuild target that deletes the repo-local nuget package directory.", - "valueType": "target", - "values": [], - "defaultValue": "" - }, - "CleanPackagesCache": { - "description": "MsBuild target that deletes the user-local nuget package cache.", - "valueType": "target", - "values": [], - "defaultValue": "" - }, - "CleanRepo": { - "description": "Cleans the entire repo of all non-git-added artifacts", - "valueType": "target", - "values": [], - "defaultValue": "" - }, - }, - "commands": { - "clean":{ - "alias":{ - "o":{ - "description": "Deletes the artifacts directory.", - "settings":{ - "CleanArtifacts": "default" - } - }, - "p":{ - "description": "Deletes the repo-local nuget package directory.", - "settings":{ - "CleanPackages": "default" - } - }, - "u": { - "description": "Deletes the user-local nuget package directory", - "settings": { - "CleanPackagesCache": "default" - } - }, - "a": { - "description": "Deletes all repo content that is not git-added", - "settings": { - "CleanRepo" : "default" - } - } - }, - "defaultValues":{ - "toolName": "msbuild", - "settings": { - "Project": "build.proj" - } - } - } - }, - "tools": { - "msbuild": { - "run": { - "windows": "build_tools\\msbuild.cmd", - "unix": "build_tools/msbuild.sh" - }, - "valueTypes": { - "property": "/p:{name}={value}", - "target": "/t:{name}", - "internal": "/{name}" - } - } - } -} diff --git a/dir.props b/dir.props index 2bf0fe048..a7e587dfb 100644 --- a/dir.props +++ b/dir.props @@ -34,9 +34,9 @@ - + diff --git a/netci.groovy b/netci.groovy index 9ab606c7f..f41a78758 100644 --- a/netci.groovy +++ b/netci.groovy @@ -68,3 +68,5 @@ platformList.each { platform -> Utilities.createHelperJob(this, project, branch, "Welcome to the ${project} Repository", // This is prepended to the help message "Have a nice day!") // This is appended to the help message. You might put known issues here. + +Utilities.addCROSSCheck(this, project, branch) diff --git a/packaging/windows/clisdk/bundle.wxl b/packaging/windows/clisdk/bundle.wxl index e7ad81713..e61e26427 100644 --- a/packaging/windows/clisdk/bundle.wxl +++ b/packaging/windows/clisdk/bundle.wxl @@ -1,6 +1,6 @@ - [WixBundleName] Setup + [WixBundleName] Installer [BUNDLEMONIKER] You just need a shell, a text editor and 10 minutes of your time. diff --git a/run-build.ps1 b/run-build.ps1 index 4781c68fa..61796b456 100644 --- a/run-build.ps1 +++ b/run-build.ps1 @@ -42,7 +42,19 @@ else $env:DOTNET_BUILD_SKIP_PACKAGING=0 } -# Use a repo-local install directory (but not the artifacts directory because that gets cleaned a lot +# Use a repo-local install directory for stage0 (but not the artifacts directory because that gets cleaned a lot +if (!$env:DOTNET_INSTALL_DIR) +{ + $env:DOTNET_INSTALL_DIR="$RepoRoot\.dotnet_stage0\$Architecture" +} + +if (!(Test-Path $env:DOTNET_INSTALL_DIR)) +{ + mkdir $env:DOTNET_INSTALL_DIR | Out-Null +} + +# We also need to pull down a project.json based CLI that is used by some tests +# so create another directory for that. if (!$env:DOTNET_INSTALL_DIR_PJ) { $env:DOTNET_INSTALL_DIR_PJ="$RepoRoot\.dotnet_stage0PJ\$Architecture" @@ -53,16 +65,7 @@ if (!(Test-Path $env:DOTNET_INSTALL_DIR_PJ)) mkdir $env:DOTNET_INSTALL_DIR_PJ | Out-Null } -# Also create an install directory for a post-PJnistic CLI -if (!$env:DOTNET_INSTALL_DIR) -{ - $env:DOTNET_INSTALL_DIR="$RepoRoot\.dotnet_stage0\$Architecture" -} -if (!(Test-Path $env:DOTNET_INSTALL_DIR)) -{ - mkdir $env:DOTNET_INSTALL_DIR | Out-Null -} # Disable first run since we want to control all package sources $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 @@ -74,38 +77,11 @@ $env:DOTNET_MULTILEVEL_LOOKUP=0 $env:VSTEST_BUILD_TRACE=1 $env:VSTEST_TRACE_BUILD=1 -# set the base tools directory -$toolsLocalPath = Join-Path $PSScriptRoot "build_tools" -if($env:BOOTSTRAP_INSTALL_DIR) -{ - $toolsLocalPath = $env:BOOTSTRAP_INSTALL_DIR -} -$bootStrapperPath = Join-Path $toolsLocalPath "bootstrap.ps1" -# if the boot-strapper script doesn't exist then download it -if ((Test-Path $bootStrapperPath) -eq 0) -{ - if ((Test-Path $toolsLocalPath) -eq 0) - { - mkdir $toolsLocalPath | Out-Null - } +# install a stage0 +$dotnetInstallPath = Join-Path $RepoRoot "scripts\obtain\dotnet-install.ps1" - # download boot-strapper script - Invoke-WebRequest "https://raw.githubusercontent.com/dotnet/buildtools/master/bootstrap/bootstrap.ps1" -OutFile $bootStrapperPath -} - -# now execute it -& $bootStrapperPath -DotNetInstallBranch release/2.0.0 -RepositoryRoot (Get-Location) -ToolsLocalPath $toolsLocalPath -CliLocalPath $env:DOTNET_INSTALL_DIR_PJ -Architecture $Architecture | Out-File (Join-Path (Get-Location) "bootstrap.log") -if ($LastExitCode -ne 0) -{ - Write-Output "Boot-strapping failed with exit code $LastExitCode, see bootstrap.log for more information." - exit $LastExitCode -} - -# install the post-PJnistic stage0 -$dotnetInstallPath = Join-Path $toolsLocalPath "dotnet-install.ps1" - -Write-Host "$dotnetInstallPath -Channel ""release/2.0.0"" -Version ""2.0.0-preview1-005867"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" -Invoke-Expression "$dotnetInstallPath -Channel ""release/2.0.0"" -Version ""2.0.0-preview1-005867"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" +Write-Host "$dotnetInstallPath -Channel ""master"" -Version ""2.0.0-preview1-005867"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" +Invoke-Expression "$dotnetInstallPath -Channel ""master"" ""2.0.0-preview1-005867"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" if ($LastExitCode -ne 0) { Write-Output "The .NET CLI installation failed with exit code $LastExitCode" @@ -113,6 +89,14 @@ if ($LastExitCode -ne 0) } +Write-Host "$dotnetInstallPath -Channel ""master"" -InstallDir $env:DOTNET_INSTALL_DIR_PJ -Architecture ""$Architecture"" -Version 1.0.0-preview2-1-003177" +Invoke-Expression "$dotnetInstallPath -Channel ""master"" -InstallDir $env:DOTNET_INSTALL_DIR_PJ -Architecture ""$Architecture"" -Version 1.0.0-preview2-1-003177" +if ($LastExitCode -ne 0) +{ + Write-Output "The .NET CLI installation failed with exit code $LastExitCode" + exit $LastExitCode +} + # Put the stage0 on the path $env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH" diff --git a/run-build.sh b/run-build.sh index aa9c877da..726e6d3bd 100755 --- a/run-build.sh +++ b/run-build.sh @@ -130,58 +130,43 @@ done # $args array may have empty elements in it. # The easiest way to remove them is to cast to string and back to array. -# This will actually break quoted arguments, arguments like +# This will actually break quoted arguments, arguments like # -test "hello world" will be broken into three arguments instead of two, as it should. temp="${args[@]}" args=($temp) -# Use a repo-local install directory (but not the artifacts directory because that gets cleaned a lot -[ -z "$DOTNET_INSTALL_DIR_PJ" ] && export DOTNET_INSTALL_DIR_PJ=$REPOROOT/.dotnet_stage0PJ/$ARCHITECTURE -[ -d "$DOTNET_INSTALL_DIR_PJ" ] || mkdir -p $DOTNET_INSTALL_DIR_PJ - -# Also create an install directory for a post-PJnistic CLI +# Create an install directory for the stage 0 CLI [ -z "$DOTNET_INSTALL_DIR" ] && export DOTNET_INSTALL_DIR=$REPOROOT/.dotnet_stage0/$ARCHITECTURE [ -d "$DOTNET_INSTALL_DIR" ] || mkdir -p $DOTNET_INSTALL_DIR -# During xplat bootstrapping, disable HTTP parallelism to avoid fatal restore timeouts. -export __INIT_TOOLS_RESTORE_ARGS="$__INIT_TOOLS_RESTORE_ARGS --disable-parallel" +# We also need to pull down a project.json based CLI that is used by some tests +# so create another directory for that. +[ -z "$DOTNET_INSTALL_DIR_PJ" ] && export DOTNET_INSTALL_DIR_PJ=$REPOROOT/.dotnet_stage0PJ/$ARCHITECTURE +[ -d "$DOTNET_INSTALL_DIR_PJ" ] || mkdir -p $DOTNET_INSTALL_DIR_PJ + +export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 # Enable verbose VS Test Console logging export VSTEST_BUILD_TRACE=1 export VSTEST_TRACE_BUILD=1 -DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 # Don't resolve shared frameworks from user or global locations DOTNET_MULTILEVEL_LOOKUP=0 -toolsLocalPath="$REPOROOT/build_tools" -if [ ! -z $BOOTSTRAP_INSTALL_DIR]; then - toolsLocalPath = $BOOTSTRAP_INSTALL_DIR -fi -bootStrapperPath="$toolsLocalPath/bootstrap.sh" -dotnetInstallPath="$toolsLocalPath/dotnet-install.sh" -if [ ! -f $bootStrapperPath ]; then - if [ ! -d $toolsLocalPath ]; then - mkdir $toolsLocalPath - fi - download "https://raw.githubusercontent.com/dotnet/buildtools/master/bootstrap/bootstrap.sh" "$bootStrapperPath" - chmod u+x $bootStrapperPath -fi - -$bootStrapperPath --dotNetInstallBranch release/2.0.0 --repositoryRoot "$REPOROOT" --toolsLocalPath "$toolsLocalPath" --cliInstallPath $DOTNET_INSTALL_DIR_PJ --architecture $ARCHITECTURE > bootstrap.log +# Install a stage 0 +(set -x ; "$REPOROOT/scripts/obtain/dotnet-install.sh" --channel "master" --version "2.0.0-preview1-005867" --install-dir "$DOTNET_INSTALL_DIR" --architecture "$ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS) EXIT_CODE=$? if [ $EXIT_CODE != 0 ]; then - echo "run-build: Error: Boot-strapping failed with exit code $EXIT_CODE, see bootstrap.log for more information." >&2 + echo "run-build: Error: installing stage0 with exit code $EXIT_CODE." >&2 exit $EXIT_CODE fi -# now execute the script -echo "installing CLI: $dotnetInstallPath --channel \"release/2.0.0\" --version \"2.0.0-preview1-005867\" --install-dir $DOTNET_INSTALL_DIR --architecture \"$ARCHITECTURE\" $LINUX_PORTABLE_INSTALL_ARGS" -$dotnetInstallPath --channel "release/2.0.0" --version "2.0.0-preview1-005867" --install-dir $DOTNET_INSTALL_DIR --architecture "$ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS +# Install a project.json based CLI for use by tests +(set -x ; "$REPOROOT/scripts/obtain/dotnet-install.sh" --channel "master" --install-dir "$DOTNET_INSTALL_DIR_PJ" --architecture "$ARCHITECTURE" --version "1.0.0-preview2-1-003177") EXIT_CODE=$? if [ $EXIT_CODE != 0 ]; then - echo "run-build: Error: Boot-strapping post-PJ stage0 with exit code $EXIT_CODE." >&2 + echo "run-build: Error: installing project-json based cli failed with exit code $EXIT_CODE." >&2 exit $EXIT_CODE fi diff --git a/run.cmd b/run.cmd deleted file mode 100644 index 5c0284a7d..000000000 --- a/run.cmd +++ /dev/null @@ -1,25 +0,0 @@ -@if "%_echo%" neq "on" echo off -setlocal - -if not defined VisualStudioVersion ( - if defined VS140COMNTOOLS ( - call "%VS140COMNTOOLS%\VsDevCmd.bat" - goto :Run - ) - echo Error: Visual Studio 2015 required. - echo Please see https://github.com/dotnet/cli/blob/rel/1.0.0/Documentation/developer-guide.md for build instructions. - exit /b 1 -) - -:Run -powershell -NoProfile -NoLogo -Command "%~dp0build.cmd -NoBuild; exit $LastExitCode;" -set _toolRuntime=%~dp0build_tools -set _dotnet=%_toolRuntime%\dotnetcli\dotnet.exe - -echo Running: %_dotnet% %_toolRuntime%\run.exe %* -call %_dotnet% %_toolRuntime%\run.exe %~dp0config.json %* -if NOT [%ERRORLEVEL%]==[0] ( - exit /b 1 -) - -exit /b 0 \ No newline at end of file diff --git a/scripts/obtain/dotnet-install.ps1 b/scripts/obtain/dotnet-install.ps1 index c2f5e6d15..e72c5ad55 100644 --- a/scripts/obtain/dotnet-install.ps1 +++ b/scripts/obtain/dotnet-install.ps1 @@ -10,18 +10,14 @@ Installs dotnet cli. If dotnet installation already exists in the given directory it will update it only if the requested version differs from the one already installed. .PARAMETER Channel - Default: preview - Channel is the way of reasoning about stability and quality of dotnet. This parameter takes one of the values: - - future - Possibly unstable, frequently changing, may contain new finished and unfinished features - - preview - Pre-release stable with known issues and feature gaps - - production - Most stable releases + Default: release/1.0.0 + Download from the Channel specified .PARAMETER Version Default: latest Represents a build version on specific channel. Possible values: - - 4-part version in a format A.B.C.D - represents specific version of build - latest - most latest build on specific channel - - lkg - last known good version on specific channel - Note: LKG work is in progress. Once the work is finished, this will become new default + - 3-part version in a format A.B.C - represents specific version of build + examples: 2.0.0-preview2-006120; 1.1.0 .PARAMETER InstallDir Default: %LocalAppData%\Microsoft\dotnet Path to where to install dotnet. Note that binaries will be placed directly in a given directory. @@ -46,7 +42,11 @@ Displays diagnostics information. .PARAMETER AzureFeed Default: https://dotnetcli.azureedge.net/dotnet - This parameter should not be usually changed by user. It allows to change URL for the Azure feed used by this installer. + This parameter typically is not changed by the user. + It allows to change URL for the Azure feed used by this installer. +.PARAMETER UncachedFeed + This parameter typically is not changed by the user. + It allows to change URL for the Uncached feed used by this installer. .PARAMETER ProxyAddress If set, the installer will use the proxy when making web requests .PARAMETER ProxyUseDefaultCredentials @@ -55,7 +55,7 @@ #> [cmdletbinding()] param( - [string]$Channel="rel-1.0.0", + [string]$Channel="release/1.0.0", [string]$Version="Latest", [string]$InstallDir="", [string]$Architecture="", @@ -140,6 +140,17 @@ function GetHTTPResponse([Uri] $Uri) try { # HttpClient is used vs Invoke-WebRequest in order to support Nano Server which doesn't support the Invoke-WebRequest cmdlet. Load-Assembly -Assembly System.Net.Http + + if(-not $ProxyAddress) + { + # Despite no proxy being explicitly specified, we may still be behind a default proxy + $DefaultProxy = [System.Net.WebRequest]::DefaultWebProxy; + if($DefaultProxy -and (-not $DefaultProxy.IsBypassed($Uri))){ + $ProxyAddress = $DefaultProxy.GetProxy($Uri).OriginalString + $ProxyUseDefaultCredentials = $true + } + } + if($ProxyAddress){ $HttpClientHandler = New-Object System.Net.Http.HttpClientHandler $HttpClientHandler.Proxy = New-Object System.Net.WebProxy -Property @{Address=$ProxyAddress;UseDefaultCredentials=$ProxyUseDefaultCredentials} @@ -149,8 +160,8 @@ function GetHTTPResponse([Uri] $Uri) $HttpClient = New-Object System.Net.Http.HttpClient } # Default timeout for HttpClient is 100s. For a 50 MB download this assumes 500 KB/s average, any less will time out - # 5 minutes allows it to work over much slower connections. - $HttpClient.Timeout = New-TimeSpan -Minutes 5 + # 10 minutes allows it to work over much slower connections. + $HttpClient.Timeout = New-TimeSpan -Minutes 10 $Response = $HttpClient.GetAsync($Uri).Result if (($Response -eq $null) -or (-not ($Response.IsSuccessStatusCode))) { @@ -173,15 +184,15 @@ function GetHTTPResponse([Uri] $Uri) } -function Get-Latest-Version-Info([string]$AzureFeed, [string]$AzureChannel, [string]$CLIArchitecture) { +function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel) { Say-Invocation $MyInvocation $VersionFileUrl = $null if ($SharedRuntime) { - $VersionFileUrl = "$UncachedFeed/$AzureChannel/dnvm/latest.sharedfx.win.$CLIArchitecture.version" + $VersionFileUrl = "$UncachedFeed/Runtime/$Channel/latest.version" } else { - $VersionFileUrl = "$UncachedFeed/Sdk/$AzureChannel/latest.version" + $VersionFileUrl = "$UncachedFeed/Sdk/$Channel/latest.version" } $Response = GetHTTPResponse -Uri $VersionFileUrl @@ -190,6 +201,7 @@ function Get-Latest-Version-Info([string]$AzureFeed, [string]$AzureChannel, [str switch ($Response.Content.Headers.ContentType) { { ($_ -eq "application/octet-stream") } { $VersionText = [Text.Encoding]::UTF8.GetString($StringContent) } { ($_ -eq "text/plain") } { $VersionText = $StringContent } + { ($_ -eq "text/plain; charset=UTF-8") } { $VersionText = $StringContent } default { throw "``$Response.Content.Headers.ContentType`` is an unknown .version file content type." } } @@ -198,38 +210,26 @@ function Get-Latest-Version-Info([string]$AzureFeed, [string]$AzureChannel, [str return $VersionInfo } -# TODO: AzureChannel and Channel should be unified -function Get-Azure-Channel-From-Channel([string]$Channel) { - Say-Invocation $MyInvocation - # For compatibility with build scripts accept also directly Azure channels names - switch ($Channel.ToLower()) { - { ($_ -eq "future") -or ($_ -eq "dev") } { return "dev" } - { $_ -eq "production" } { throw "Production channel does not exist yet" } - default { return $_ } - } -} - -function Get-Specific-Version-From-Version([string]$AzureFeed, [string]$AzureChannel, [string]$CLIArchitecture, [string]$Version) { +function Get-Specific-Version-From-Version([string]$AzureFeed, [string]$Channel, [string]$Version) { Say-Invocation $MyInvocation switch ($Version.ToLower()) { { $_ -eq "latest" } { - $LatestVersionInfo = Get-Latest-Version-Info -AzureFeed $AzureFeed -AzureChannel $AzureChannel -CLIArchitecture $CLIArchitecture + $LatestVersionInfo = Get-Latest-Version-Info -AzureFeed $AzureFeed -Channel $Channel return $LatestVersionInfo.Version } - { $_ -eq "lkg" } { throw "``-Version LKG`` not supported yet." } default { return $Version } } } -function Get-Download-Links([string]$AzureFeed, [string]$AzureChannel, [string]$SpecificVersion, [string]$CLIArchitecture) { +function Get-Download-Links([string]$AzureFeed, [string]$Channel, [string]$SpecificVersion, [string]$CLIArchitecture) { Say-Invocation $MyInvocation $ret = @() if ($SharedRuntime) { - $PayloadURL = "$AzureFeed/$AzureChannel/Binaries/$SpecificVersion/dotnet-win-$CLIArchitecture.$SpecificVersion.zip" + $PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/dotnet-win-$CLIArchitecture.$SpecificVersion.zip" } else { $PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-dev-win-$CLIArchitecture.$SpecificVersion.zip" @@ -394,10 +394,9 @@ function Prepend-Sdk-InstallRoot-To-Path([string]$InstallRoot, [string]$BinFolde } } -$AzureChannel = Get-Azure-Channel-From-Channel -Channel $Channel $CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture -$SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -AzureChannel $AzureChannel -CLIArchitecture $CLIArchitecture -Version $Version -$DownloadLinks = Get-Download-Links -AzureFeed $AzureFeed -AzureChannel $AzureChannel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture +$SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -Channel $Channel -Version $Version +$DownloadLinks = Get-Download-Links -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture if ($DryRun) { Say "Payload URLs:" diff --git a/scripts/obtain/dotnet-install.sh b/scripts/obtain/dotnet-install.sh index ecb28613b..65f70e39f 100755 --- a/scripts/obtain/dotnet-install.sh +++ b/scripts/obtain/dotnet-install.sh @@ -111,6 +111,24 @@ get_os_download_name_from_platform() { get_current_os_name() { eval $invocation + local uname=$(uname) + if [ "$uname" = "Darwin" ]; then + echo "osx" + return 0 + else + if [ "$uname" = "Linux" ]; then + echo "linux" + return 0 + fi + fi + + say_err "OS name could not be detected: $ID.$VERSION_ID" + return 1 +} + +get_distro_specific_os_name() { + eval $invocation + local uname=$(uname) if [ "$uname" = "Darwin" ]; then echo "osx" @@ -140,12 +158,19 @@ machine_has() { return $? } + check_min_reqs() { - if ! machine_has "curl"; then - say_err "curl is required to download dotnet. Install curl to proceed." + local hasMinimum=false + if machine_has "curl"; then + hasMinimum=true + elif machine_has "wget"; then + hasMinimum=true + fi + + if [ "$hasMinimum" = "false" ]; then + say_err "curl (recommended) or wget are required to download dotnet. Install missing prerequisite to proceed." return 1 fi - return 0 } @@ -168,7 +193,6 @@ check_pre_reqs() { [ -z "$($LDCONFIG_COMMAND -p | grep libunwind)" ] && say_err "Unable to locate libunwind. Install libunwind to continue" && failing=true [ -z "$($LDCONFIG_COMMAND -p | grep libssl)" ] && say_err "Unable to locate libssl. Install libssl to continue" && failing=true - [ -z "$($LDCONFIG_COMMAND -p | grep libcurl)" ] && say_err "Unable to locate libcurl. Install libcurl to continue" && failing=true [ -z "$($LDCONFIG_COMMAND -p | grep libicu)" ] && say_err "Unable to locate libicu. Install libicu to continue" && failing=true fi @@ -252,12 +276,12 @@ get_normalized_architecture_from_architecture() { return 0 ;; x86) - say_err "Architecture ``x86`` currently not supported" + say_err "Architecture \`x86\` currently not supported" return 1 ;; esac - say_err "Architecture ``$architecture`` not supported. If you think this is a bug, please report it at https://github.com/dotnet/cli/issues" + say_err "Architecture \`$architecture\` not supported. If you think this is a bug, please report it at https://github.com/dotnet/cli/issues" return 1 } @@ -307,23 +331,20 @@ is_dotnet_package_installed() { # args: # azure_feed - $1 -# azure_channel - $2 +# channel - $2 # normalized_architecture - $3 get_latest_version_info() { eval $invocation local azure_feed=$1 - local azure_channel=$2 + local channel=$2 local normalized_architecture=$3 - - local osname - osname=$(get_current_os_name) || return 1 local version_file_url=null if [ "$shared_runtime" = true ]; then - version_file_url="$uncached_feed/$azure_channel/dnvm/latest.sharedfx.$osname.$normalized_architecture.version" + version_file_url="$uncached_feed/Runtime/$channel/latest.version" else - version_file_url="$uncached_feed/Sdk/$azure_channel/latest.version" + version_file_url="$uncached_feed/Sdk/$channel/latest.version" fi say_verbose "get_latest_version_info: latest url: $version_file_url" @@ -331,51 +352,27 @@ get_latest_version_info() { return $? } -# args: -# channel - $1 -get_azure_channel_from_channel() { - eval $invocation - - local channel=$(to_lowercase $1) - case $channel in - future|dev) - echo "dev" - return 0 - ;; - production) - say_err "Production channel does not exist yet" - return 1 - esac - - echo $channel - return 0 -} - # args: # azure_feed - $1 -# azure_channel - $2 +# channel - $2 # normalized_architecture - $3 # version - $4 get_specific_version_from_version() { eval $invocation local azure_feed=$1 - local azure_channel=$2 + local channel=$2 local normalized_architecture=$3 local version=$(to_lowercase $4) case $version in latest) local version_info - version_info="$(get_latest_version_info $azure_feed $azure_channel $normalized_architecture)" || return 1 + version_info="$(get_latest_version_info $azure_feed $channel $normalized_architecture)" || return 1 say_verbose "get_specific_version_from_version: version_info=$version_info" echo "$version_info" | get_version_from_version_info return 0 ;; - lkg) - say_err "``--version LKG`` not supported yet." - return 1 - ;; *) echo $version return 0 @@ -385,23 +382,23 @@ get_specific_version_from_version() { # args: # azure_feed - $1 -# azure_channel - $2 +# channel - $2 # normalized_architecture - $3 # specific_version - $4 construct_download_link() { eval $invocation local azure_feed=$1 - local azure_channel=$2 + local channel=$2 local normalized_architecture=$3 local specific_version=${4//[$'\t\r\n']} local osname osname=$(get_current_os_name) || return 1 - + local download_link=null if [ "$shared_runtime" = true ]; then - download_link="$azure_feed/$azure_channel/Binaries/$specific_version/dotnet-$osname-$normalized_architecture.$specific_version.tar.gz" + download_link="$azure_feed/Runtime/$specific_version/dotnet-$osname-$normalized_architecture.$specific_version.tar.gz" else download_link="$azure_feed/Sdk/$specific_version/dotnet-dev-$osname-$normalized_architecture.$specific_version.tar.gz" fi @@ -410,6 +407,33 @@ construct_download_link() { return 0 } +# args: +# azure_feed - $1 +# channel - $2 +# normalized_architecture - $3 +# specific_version - $4 +construct_alt_download_link() { + eval $invocation + + local azure_feed=$1 + local channel=$2 + local normalized_architecture=$3 + local specific_version=${4//[$'\t\r\n']} + + local distro_specific_osname + distro_specific_osname=$(get_distro_specific_os_name) || return 1 + + local alt_download_link=null + if [ "$shared_runtime" = true ]; then + alt_download_link="$azure_feed/Runtime/$specific_version/dotnet-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz" + else + alt_download_link="$azure_feed/Sdk/$specific_version/dotnet-dev-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz" + fi + + echo "$alt_download_link" + return 0 +} + get_user_install_path() { eval $invocation @@ -520,49 +544,90 @@ extract_dotnet_package() { # [out_path] - $2 - stdout if not provided download() { eval $invocation - + + local remote_path=$1 + local out_path=${2:-} + + local failed=false + if machine_has "curl"; then + downloadcurl $remote_path $out_path || failed=true + elif machine_has "wget"; then + downloadwget $remote_path $out_path || failed=true + else + failed=true + fi + if [ "$failed" = true ]; then + say_verbose "Download failed: $remote_path" + return 1 + fi + return 0 +} + +downloadcurl() { + eval $invocation local remote_path=$1 local out_path=${2:-} local failed=false if [ -z "$out_path" ]; then - curl --fail -s $remote_path || failed=true + curl --retry 10 -sSL -f --create-dirs $remote_path || failed=true else - curl --fail -s -o $out_path $remote_path || failed=true + curl --retry 10 -sSL -f --create-dirs -o $out_path $remote_path || failed=true fi - if [ "$failed" = true ]; then - say_err "Download failed" + say_verbose "Curl download failed" return 1 fi + return 0 +} + +downloadwget() { + eval $invocation + local remote_path=$1 + local out_path=${2:-} + + local failed=false + if [ -z "$out_path" ]; then + wget -q --tries 10 $remote_path || failed=true + else + wget -v --tries 10 -O $out_path $remote_path || failed=true + fi + if [ "$failed" = true ]; then + say_verbose "Wget download failed" + return 1 + fi + return 0 } calculate_vars() { eval $invocation - azure_channel=$(get_azure_channel_from_channel "$channel") - say_verbose "azure_channel=$azure_channel" - normalized_architecture=$(get_normalized_architecture_from_architecture "$architecture") say_verbose "normalized_architecture=$normalized_architecture" - specific_version=$(get_specific_version_from_version $azure_feed $azure_channel $normalized_architecture $version) + specific_version=$(get_specific_version_from_version $azure_feed $channel $normalized_architecture $version) say_verbose "specific_version=$specific_version" if [ -z "$specific_version" ]; then say_err "Could not get version information." return 1 fi - download_link=$(construct_download_link $azure_feed $azure_channel $normalized_architecture $specific_version) + download_link=$(construct_download_link $azure_feed $channel $normalized_architecture $specific_version) say_verbose "download_link=$download_link" - + + if [ "$(uname)" = "Linux" ]; then + alt_download_link=$(construct_alt_download_link $azure_feed $channel $normalized_architecture $specific_version) + say_verbose "alt_download_link=$alt_download_link" + fi + install_root=$(resolve_installation_path $install_dir) say_verbose "install_root=$install_root" } install_dotnet() { eval $invocation - + local download_failed=false + if is_dotnet_package_installed $install_root "sdk" $specific_version; then say ".NET SDK version $specific_version is already installed." return 0 @@ -571,10 +636,18 @@ install_dotnet() { mkdir -p $install_root zip_path=$(mktemp $temporary_file_template) say_verbose "Zip path: $zip_path" - - say "Downloading $download_link" - download "$download_link" $zip_path - say_verbose "Downloaded file exists and readable? $(if [ -r $zip_path ]; then echo "yes"; else echo "no"; fi)" + + say "Downloading link: $download_link" + download "$download_link" $zip_path || download_failed=true + + # if the download fails, download the alt_download_link [Linux only] + if [ "$(uname)" = "Linux" ] && [ "$download_failed" = true ]; then + say "Cannot download: $download_link" + zip_path=$(mktemp $temporary_file_template) + say_verbose "Alternate zip path: $zip_path" + say "Downloading alternate link: $alt_download_link" + download "$alt_download_link" $zip_path + fi say "Extracting zip" extract_dotnet_package $zip_path $install_root @@ -586,7 +659,7 @@ local_version_file_relative_path="/.version" bin_folder_relative_path="" temporary_file_template="${TMPDIR:-/tmp}/dotnet.XXXXXXXXX" -channel="rel-1.0.0" +channel="release/1.0.0" version="Latest" install_dir="" architecture="" @@ -638,6 +711,10 @@ do shift azure_feed="$1" ;; + --uncached-feed|-[Uu]ncached[Ff]eed) + shift + uncached_feed="$1" + ;; --runtime-id|-[Rr]untime[Ii]d) shift runtime_id="$1" @@ -653,7 +730,7 @@ do echo "Options:" echo " -c,--channel Download from the CHANNEL specified (default: $channel)." echo " -Channel" - echo " -v,--version Use specific version, ``latest`` or ``lkg``. Defaults to ``latest``." + echo " -v,--version Use specific version, or \`latest\`. Defaults to \`latest\`." echo " -Version" echo " -i,--install-dir Install under specified location (see Install Location below)" echo " -InstallDir" @@ -665,7 +742,8 @@ do echo " --dry-run,-DryRun Do not perform installation. Display download link." echo " --no-path, -NoPath Do not set PATH for the current process." echo " --verbose,-Verbose Display diagnostics information." - echo " --azure-feed,-AzureFeed Azure feed location. Defaults to $azure_feed" + echo " --azure-feed,-AzureFeed Azure feed location. Defaults to $azure_feed, This parameter typically is not changed by the user." + echo " --uncached-feed,-UncachedFeed Uncached feed location. This parameter typically is not changed by the user." echo " --runtime-id Installs the .NET Tools for the given platform (use linux-x64 for portable linux)." echo " -RuntimeId" echo " -?,--?,-h,--help,-Help Shows this help message" @@ -690,6 +768,9 @@ check_min_reqs calculate_vars if [ "$dry_run" = true ]; then say "Payload URL: $download_link" + if [ "$(uname)" = "Linux" ]; then + say "Alternate payload URL: $alt_download_link" + fi say "Repeatable invocation: ./$(basename $0) --version $specific_version --channel $channel --install-dir $install_dir" exit 0 fi @@ -699,7 +780,7 @@ install_dotnet bin_path=$(get_absolute_path $(combine_paths $install_root $bin_folder_relative_path)) if [ "$no_path" = false ]; then - say "Adding to current process PATH: ``$bin_path``. Note: This change will be visible only when sourcing script." + say "Adding to current process PATH: \`$bin_path\`. Note: This change will be visible only when sourcing script." export PATH=$bin_path:$PATH else say "Binaries of dotnet can be found in $bin_path" diff --git a/scripts/register-completions.ps1 b/scripts/register-completions.ps1 index dfc701504..88c416cd8 100644 --- a/scripts/register-completions.ps1 +++ b/scripts/register-completions.ps1 @@ -1,7 +1,7 @@ # PowerShell parameter completion shim for the dotnet CLI Register-ArgumentCompleter -Native -CommandName dotnet -ScriptBlock { param($commandName, $wordToComplete, $cursorPosition) - C:\dev\github\cli\artifacts\win10-x64\stage2\dotnet.exe complete --position $cursorPosition "$wordToComplete" | ForEach-Object { + dotnet complete --position $cursorPosition "$wordToComplete" | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) } } \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/LocalizableStrings.cs b/src/Microsoft.DotNet.Cli.Sln.Internal/LocalizableStrings.cs index f340f9373..013260ed8 100644 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/LocalizableStrings.cs +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/LocalizableStrings.cs @@ -17,7 +17,9 @@ namespace Microsoft.DotNet.Cli.Sln.Internal public const string GlobalSectionNotClosedError = "Global section not closed"; - public const string FileHeaderMissingError = "File header is missing"; + public const string FileHeaderMissingVersionError = "File header is missing version"; + + public const string FileHeaderMissingError = "Expected file header not found"; public const string ProjectSectionNotClosedError = "Project section not closed"; diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/SlnFile.cs b/src/Microsoft.DotNet.Cli.Sln.Internal/SlnFile.cs index 93df94b85..87fad297e 100644 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/SlnFile.cs +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/SlnFile.cs @@ -120,7 +120,7 @@ namespace Microsoft.DotNet.Cli.Sln.Internal private void Read(TextReader reader) { - const string HeaderPrefix = "Microsoft Visual Studio Solution File, Format Version "; + const string HeaderPrefix = "Microsoft Visual Studio Solution File, Format Version"; string line; int curLineNum = 0; @@ -137,10 +137,10 @@ namespace Microsoft.DotNet.Cli.Sln.Internal { throw new InvalidSolutionFormatException( curLineNum, - LocalizableStrings.FileHeaderMissingError); + LocalizableStrings.FileHeaderMissingVersionError); } - FormatVersion = line.Substring(HeaderPrefix.Length); + FormatVersion = line.Substring(HeaderPrefix.Length).Trim(); _prefixBlankLines = curLineNum - 1; } if (line.StartsWith("# ", StringComparison.Ordinal)) @@ -199,9 +199,7 @@ namespace Microsoft.DotNet.Cli.Sln.Internal } if (FormatVersion == null) { - throw new InvalidSolutionFormatException( - curLineNum, - LocalizableStrings.FileHeaderMissingError); + throw new InvalidSolutionFormatException(LocalizableStrings.FileHeaderMissingError); } } @@ -1167,6 +1165,11 @@ namespace Microsoft.DotNet.Cli.Sln.Internal public class InvalidSolutionFormatException : Exception { + public InvalidSolutionFormatException(string details) + : base(details) + { + } + public InvalidSolutionFormatException(int line, string details) : base(string.Format(LocalizableStrings.ErrorMessageFormatString, line, details)) { diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.cs.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.cs.xlf index 4b50c92ec..c8b89d596 100644 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.cs.xlf +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.cs.xlf @@ -14,9 +14,9 @@ - File header is missing - Chybí hlavička souboru - + Expected file header not found + Chybí hlavička souboru + Project section not closed @@ -53,6 +53,11 @@ V sadě vlastností chybí {0}. + + File header is missing version + File header is missing version + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.de.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.de.xlf index 90466bde1..9d0cbae6e 100644 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.de.xlf +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.de.xlf @@ -14,9 +14,9 @@ - File header is missing - Dateiheader fehlt - + Expected file header not found + Dateiheader fehlt + Project section not closed @@ -53,6 +53,11 @@ Im Eigenschaftensatz fehlt "{0}" + + File header is missing version + File header is missing version + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.es.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.es.xlf index 973580474..11b99fe4a 100644 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.es.xlf +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.es.xlf @@ -14,9 +14,9 @@ - File header is missing - Encabezado de archivo omitido - + Expected file header not found + Encabezado de archivo omitido + Project section not closed @@ -53,6 +53,11 @@ A la propiedad establecida le falta "{0}" + + File header is missing version + File header is missing version + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.fr.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.fr.xlf index 963c9eab7..d9422d96e 100644 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.fr.xlf +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.fr.xlf @@ -14,9 +14,9 @@ - File header is missing - En-tête de fichier manquant - + Expected file header not found + En-tête de fichier manquant + Project section not closed @@ -53,6 +53,11 @@ '{0}' est manquant dans le jeu de propriétés + + File header is missing version + File header is missing version + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.it.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.it.xlf index d34f69d9f..5805939a2 100644 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.it.xlf +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.it.xlf @@ -14,9 +14,9 @@ - File header is missing - Manca l'intestazione del file - + Expected file header not found + Manca l'intestazione del file + Project section not closed @@ -53,6 +53,11 @@ Nel set di proprietà manca '{0}' + + File header is missing version + File header is missing version + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.ja.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.ja.xlf index 62f3a3c8c..a17eefc52 100644 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.ja.xlf +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.ja.xlf @@ -14,9 +14,9 @@ - File header is missing - ファイル ヘッダーがありません - + Expected file header not found + ファイル ヘッダーがありません + Project section not closed @@ -53,6 +53,11 @@ プロパティ セットが見つかりません '{0}' + + File header is missing version + File header is missing version + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.ko.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.ko.xlf index ac18c0983..ef4c9c6a8 100644 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.ko.xlf +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.ko.xlf @@ -14,9 +14,9 @@ - File header is missing - 파일 헤더가 누락됨 - + Expected file header not found + 파일 헤더가 누락됨 + Project section not closed @@ -53,6 +53,11 @@ 속성 설정에 '{0}'이(가) 없습니다. + + File header is missing version + File header is missing version + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.pl.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.pl.xlf index 5c4473d38..89fe0ef42 100644 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.pl.xlf +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.pl.xlf @@ -14,9 +14,9 @@ - File header is missing - Brak nagłówka pliku - + Expected file header not found + Brak nagłówka pliku + Project section not closed @@ -53,6 +53,11 @@ W zestawie właściwości brakuje elementu „{0}” + + File header is missing version + File header is missing version + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.pt-BR.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.pt-BR.xlf index 14a0f832b..f7fc6023c 100644 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.pt-BR.xlf @@ -14,9 +14,9 @@ - File header is missing - Cabeçalho de arquivo ausente - + Expected file header not found + Cabeçalho de arquivo ausente + Project section not closed @@ -53,6 +53,11 @@ O conjunto de propriedade está sem '{0}' + + File header is missing version + File header is missing version + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.ru.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.ru.xlf index 1fa146067..58a3e674d 100644 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.ru.xlf +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.ru.xlf @@ -14,9 +14,9 @@ - File header is missing - Отсутствует заголовок файла. - + Expected file header not found + Отсутствует заголовок файла. + Project section not closed @@ -53,6 +53,11 @@ В наборе свойств отсутствует "{0}" + + File header is missing version + File header is missing version + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.tr.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.tr.xlf index c5658d2c0..acfd746d0 100644 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.tr.xlf +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.tr.xlf @@ -14,9 +14,9 @@ - File header is missing - Dosya üst bilgisi eksik - + Expected file header not found + Dosya üst bilgisi eksik + Project section not closed @@ -53,6 +53,11 @@ Özellik kümesinde '{0}' eksik + + File header is missing version + File header is missing version + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.xlf index a4a292d41..743ec3778 100644 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.xlf +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.xlf @@ -12,8 +12,8 @@ - File header is missing - + Expected file header not found + Project section not closed @@ -33,14 +33,18 @@ Invalid format in line {0}: {1} - + Project section is missing '{0}' when parsing the line starting at position {1} - + Property set is missing '{0}' + + + + File header is missing version diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.zh-Hans.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.zh-Hans.xlf index 51a9531a9..5a81c555e 100644 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.zh-Hans.xlf @@ -14,9 +14,9 @@ - File header is missing - 缺少文件标头 - + Expected file header not found + 缺少文件标头 + Project section not closed @@ -53,6 +53,11 @@ 属性集缺少“{0}” + + File header is missing version + File header is missing version + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.zh-Hant.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.zh-Hant.xlf index c3d66cf7f..a33947173 100644 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.zh-Hant.xlf @@ -14,9 +14,9 @@ - File header is missing - 遺漏檔案標頭 - + Expected file header not found + 遺漏檔案標頭 + Project section not closed @@ -53,6 +53,11 @@ 屬性集缺少 '{0}' + + File header is missing version + File header is missing version + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectFactory.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectFactory.cs index 73e1971a3..31dd409ac 100644 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectFactory.cs +++ b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectFactory.cs @@ -80,7 +80,7 @@ namespace Microsoft.DotNet.Cli.Utils } else if (projectFiles.Count() > 1) { - throw new InvalidOperationException(string.Format( + throw new GracefulException(string.Format( LocalizableStrings.MultipleProjectFilesFound, projectDirectory)); } diff --git a/src/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs b/src/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs index 351ce43af..500ab7b30 100644 --- a/src/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs +++ b/src/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs @@ -24,6 +24,7 @@ namespace Microsoft.DotNet.Cli.Utils { { "MSBuildExtensionsPath", AppContext.BaseDirectory }, { "CscToolExe", GetRunCscPath() }, + { "VbcToolExe", GetRunVbcPath() }, { "MSBuildSDKsPath", GetMSBuildSDKsPath() } }; @@ -77,10 +78,20 @@ namespace Microsoft.DotNet.Cli.Utils SdksDirectoryName); } + private static string GetRunVbcPath() + { + return GetRunToolPath("Vbc"); + } + private static string GetRunCscPath() + { + return GetRunToolPath("Csc"); + } + + private static string GetRunToolPath(string compilerName) { var scriptExtension = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".cmd" : ".sh"; - return Path.Combine(AppContext.BaseDirectory, "Roslyn", $"RunCsc{scriptExtension}"); + return Path.Combine(AppContext.BaseDirectory, "Roslyn", $"Run{compilerName}{scriptExtension}"); } } } diff --git a/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj b/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj index bc95703fb..7d230f361 100644 --- a/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj +++ b/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj @@ -3,7 +3,7 @@ $(SdkVersion) - netstandard1.5;net46 + netstandard1.5;net46 netstandard1.5 true ../../tools/Key.snk diff --git a/src/Microsoft.DotNet.Cli.Utils/RuntimeConfig.cs b/src/Microsoft.DotNet.Cli.Utils/RuntimeConfig.cs index 5b0c8fcc5..61691e4a8 100644 --- a/src/Microsoft.DotNet.Cli.Utils/RuntimeConfig.cs +++ b/src/Microsoft.DotNet.Cli.Utils/RuntimeConfig.cs @@ -1,8 +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. - + +using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using System.IO; +using System.IO; namespace Microsoft.DotNet.Cli.Utils { @@ -12,12 +13,16 @@ namespace Microsoft.DotNet.Cli.Utils public RuntimeConfigFramework Framework { get; } public RuntimeConfig(string runtimeConfigPath) - { - var runtimeConfigJson = OpenRuntimeConfig(runtimeConfigPath); - - Framework = ParseFramework(runtimeConfigJson); - - IsPortable = Framework != null; + { + JObject runtimeConfigJson; + using (var streamReader = new StreamReader(new FileStream(runtimeConfigPath, FileMode.Open))) + { + runtimeConfigJson = OpenRuntimeConfig(streamReader); + } + + Framework = ParseFramework(runtimeConfigJson); + + IsPortable = Framework != null; } public static bool IsApplicationPortable(string entryAssemblyPath) @@ -31,9 +36,11 @@ namespace Microsoft.DotNet.Cli.Utils return false; } - private JObject OpenRuntimeConfig(string runtimeConfigPath) - { - return JObject.Parse(File.ReadAllText(runtimeConfigPath)); + private JObject OpenRuntimeConfig(StreamReader streamReader) + { + var reader = new JsonTextReader(streamReader); + + return JObject.Load(reader); } private RuntimeConfigFramework ParseFramework(JObject runtimeConfigRoot) diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.cs.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.cs.xlf index ca8e034db..1ce8f19d6 100644 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.cs.xlf +++ b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.cs.xlf @@ -215,6 +215,26 @@ Po spuštění příkazu se nepodařilo volat {0}. + + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + + + + {0}: Could not find runtimeconfig.json file for tool {1} + {0}: Could not find runtimeconfig.json file for tool {1} + + + + Unable to find deps.json generator project. + Unable to find deps.json generator project. + + + + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.de.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.de.xlf index 423626138..24b21b8a3 100644 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.de.xlf +++ b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.de.xlf @@ -215,6 +215,26 @@ {0} kann nach Ausführung des Befehls nicht aufgerufen werden. + + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + + + + {0}: Could not find runtimeconfig.json file for tool {1} + {0}: Could not find runtimeconfig.json file for tool {1} + + + + Unable to find deps.json generator project. + Unable to find deps.json generator project. + + + + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.es.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.es.xlf index 5ecf0ceb1..6ed18b0b5 100644 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.es.xlf +++ b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.es.xlf @@ -215,6 +215,26 @@ No se puede invocar {0} después de la ejecución del comando + + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + + + + {0}: Could not find runtimeconfig.json file for tool {1} + {0}: Could not find runtimeconfig.json file for tool {1} + + + + Unable to find deps.json generator project. + Unable to find deps.json generator project. + + + + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.fr.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.fr.xlf index 907ecf035..498f5afd1 100644 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.fr.xlf +++ b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.fr.xlf @@ -215,6 +215,26 @@ Impossible d'appeler {0} après l'exécution de la commande + + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + + + + {0}: Could not find runtimeconfig.json file for tool {1} + {0}: Could not find runtimeconfig.json file for tool {1} + + + + Unable to find deps.json generator project. + Unable to find deps.json generator project. + + + + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.it.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.it.xlf index 2fb130b58..1673d687a 100644 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.it.xlf +++ b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.it.xlf @@ -215,6 +215,26 @@ Non è possibile richiamare {0} dopo l'esecuzione del comando + + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + + + + {0}: Could not find runtimeconfig.json file for tool {1} + {0}: Could not find runtimeconfig.json file for tool {1} + + + + Unable to find deps.json generator project. + Unable to find deps.json generator project. + + + + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.ja.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.ja.xlf index 0384678d9..b362d7f2e 100644 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.ja.xlf +++ b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.ja.xlf @@ -215,6 +215,26 @@ コマンドの実行後、{0} を呼び出せません + + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + + + + {0}: Could not find runtimeconfig.json file for tool {1} + {0}: Could not find runtimeconfig.json file for tool {1} + + + + Unable to find deps.json generator project. + Unable to find deps.json generator project. + + + + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.ko.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.ko.xlf index a7fd4999a..1bc65e7de 100644 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.ko.xlf +++ b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.ko.xlf @@ -215,6 +215,26 @@ 명령이 실행된 후 {0}을(를) 호출할 수 없음 + + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + + + + {0}: Could not find runtimeconfig.json file for tool {1} + {0}: Could not find runtimeconfig.json file for tool {1} + + + + Unable to find deps.json generator project. + Unable to find deps.json generator project. + + + + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.pl.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.pl.xlf index d3c4e1b48..37daf3edb 100644 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.pl.xlf +++ b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.pl.xlf @@ -215,6 +215,26 @@ Nie można wywołać elementu {0} po uruchomieniu polecenia + + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + + + + {0}: Could not find runtimeconfig.json file for tool {1} + {0}: Could not find runtimeconfig.json file for tool {1} + + + + Unable to find deps.json generator project. + Unable to find deps.json generator project. + + + + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.pt-BR.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.pt-BR.xlf index 33ab86868..f0d700dbb 100644 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.pt-BR.xlf @@ -215,6 +215,26 @@ Não é possível invocar {0} após a execução do comando + + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + + + + {0}: Could not find runtimeconfig.json file for tool {1} + {0}: Could not find runtimeconfig.json file for tool {1} + + + + Unable to find deps.json generator project. + Unable to find deps.json generator project. + + + + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.ru.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.ru.xlf index 5cd32a327..dd9f2b023 100644 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.ru.xlf +++ b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.ru.xlf @@ -215,6 +215,26 @@ Не удается вызвать {0} после запуска команды. + + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + + + + {0}: Could not find runtimeconfig.json file for tool {1} + {0}: Could not find runtimeconfig.json file for tool {1} + + + + Unable to find deps.json generator project. + Unable to find deps.json generator project. + + + + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.tr.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.tr.xlf index 9bded53e4..e4c4c0dce 100644 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.tr.xlf +++ b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.tr.xlf @@ -215,6 +215,26 @@ Komut çalıştırıldıktan sonra {0} çağrılamıyor + + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + + + + {0}: Could not find runtimeconfig.json file for tool {1} + {0}: Could not find runtimeconfig.json file for tool {1} + + + + Unable to find deps.json generator project. + Unable to find deps.json generator project. + + + + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.xlf index be3a475e5..edd61956b 100644 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.xlf +++ b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.xlf @@ -172,6 +172,22 @@ Unable to invoke {0} after the command has been run + + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + + + + {0}: Could not find runtimeconfig.json file for tool {1} + + + + Unable to find deps.json generator project. + + + + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.zh-Hans.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.zh-Hans.xlf index 587dcc32c..7b1b39762 100644 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.zh-Hans.xlf @@ -215,6 +215,26 @@ 运行命令后无法调用 {0} + + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + + + + {0}: Could not find runtimeconfig.json file for tool {1} + {0}: Could not find runtimeconfig.json file for tool {1} + + + + Unable to find deps.json generator project. + Unable to find deps.json generator project. + + + + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.zh-Hant.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.zh-Hant.xlf index 49c345db9..c7cf3d794 100644 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.zh-Hant.xlf @@ -215,6 +215,26 @@ 執行命令後無法叫用 {0} + + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) + + + + {0}: Could not find runtimeconfig.json file for tool {1} + {0}: Could not find runtimeconfig.json file for tool {1} + + + + Unable to find deps.json generator project. + Unable to find deps.json generator project. + + + + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.cs.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.cs.xlf index c722cb035..c964f8c5c 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.cs.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.cs.xlf @@ -33,9 +33,9 @@ Běží příkaz pro počáteční naplnění vaší místní mezipaměti balí - Failed to create prime the NuGet cache. {0} failed with: {1} - Nepodařilo se vytvořit primární mezipaměť balíčku NuGet. {0} selhalo s: {1} - + Failed to prime the NuGet cache. {0} failed with: {1} + Nepodařilo se vytvořit primární mezipaměť balíčku NuGet. {0} selhalo s: {1} + diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.de.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.de.xlf index 2f757dc0a..640f73857 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.de.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.de.xlf @@ -33,9 +33,9 @@ Ein Befehl wird ausgeführt, um Ihren lokalen Paketcache erstmals aufzufüllen, - Failed to create prime the NuGet cache. {0} failed with: {1} - Fehler beim Vorbereiten des NuGet-Cache. Fehler von {0} mit: {1} - + Failed to prime the NuGet cache. {0} failed with: {1} + Fehler beim Vorbereiten des NuGet-Cache. Fehler von {0} mit: {1} + diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.es.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.es.xlf index 5a5aa4b18..c8c5fa41c 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.es.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.es.xlf @@ -33,9 +33,9 @@ Se está ejecutando un comando para rellenar inicialmente la memoria caché de p - Failed to create prime the NuGet cache. {0} failed with: {1} - No se pudo crear la caché de NuGet. Error de {0} con: {1} - + Failed to prime the NuGet cache. {0} failed with: {1} + No se pudo crear la caché de NuGet. Error de {0} con: {1} + diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.fr.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.fr.xlf index 6318c757a..ff33dae33 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.fr.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.fr.xlf @@ -33,9 +33,9 @@ La commande qui est exécutée remplit initialement votre cache de package local - Failed to create prime the NuGet cache. {0} failed with: {1} - Échec de la création du cache NuGet. Échec de {0} : {1} - + Failed to prime the NuGet cache. {0} failed with: {1} + Échec de la création du cache NuGet. Échec de {0} : {1} + diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.it.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.it.xlf index 5434c2ac2..432cd66b5 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.it.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.it.xlf @@ -33,9 +33,9 @@ Configurazione... - Failed to create prime the NuGet cache. {0} failed with: {1} - Non è possibile creare per la prima volta la cache NuGet. {0} non riuscito. Errore: {1} - + Failed to prime the NuGet cache. {0} failed with: {1} + Non è possibile creare per la prima volta la cache NuGet. {0} non riuscito. Errore: {1} + diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ja.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ja.xlf index f72526146..f8184dc83 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ja.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ja.xlf @@ -33,9 +33,9 @@ A command is running to initially populate your local package cache, to improve - Failed to create prime the NuGet cache. {0} failed with: {1} - プライム NuGet キャッシュを作成できませんでした。{0} は {1} で失敗しました - + Failed to prime the NuGet cache. {0} failed with: {1} + プライム NuGet キャッシュを作成できませんでした。{0} は {1} で失敗しました + diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ko.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ko.xlf index a64611340..f2aa73287 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ko.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ko.xlf @@ -17,7 +17,7 @@ You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-te Configuring... ------------------- A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once. - NET Core를 시작합니다! + .NET Core를 시작합니다! --------------------- .NET Core에 대한 자세한 내용은 https://aka.ms/dotnet-docs를 참조하세요. 사용 가능한 명령을 보려면 dotnet --help를 사용하거나 https://aka.ms/dotnet-cli-docs를 방문하세요. @@ -33,10 +33,10 @@ A command is running to initially populate your local package cache, to improve - Failed to create prime the NuGet cache. {0} failed with: {1} - 프라임 NuGet 캐시를 만들지 못했습니다. {0} 실패: {1} - + Failed to prime the NuGet cache. {0} failed with: {1} + 프라임 NuGet 캐시를 만들지 못했습니다. {0} 실패: {1} + - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pl.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pl.xlf index e862e5163..7dd51018c 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pl.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pl.xlf @@ -33,9 +33,9 @@ Wykonywane jest polecenie w celu wstępnego wypełnienia lokalnej pamięci podr - Failed to create prime the NuGet cache. {0} failed with: {1} - Nie udało się utworzyć głównej pamięci podręcznej NuGet. Operacja {0} zakończyła się niepowodzeniem: {1} - + Failed to prime the NuGet cache. {0} failed with: {1} + Nie udało się utworzyć głównej pamięci podręcznej NuGet. Operacja {0} zakończyła się niepowodzeniem: {1} + diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pt-BR.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pt-BR.xlf index 5dd44b02c..b4d2a0ed4 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pt-BR.xlf @@ -33,9 +33,9 @@ Um comando está sendo executado para preencher inicialmente seu cache de pacote - Failed to create prime the NuGet cache. {0} failed with: {1} - Falha ao criar principal do cache do NuGet. {0} falhou com: {1} - + Failed to prime the NuGet cache. {0} failed with: {1} + Falha ao criar principal do cache do NuGet. {0} falhou com: {1} + diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ru.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ru.xlf index 618c4dc13..3f24f76d7 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ru.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ru.xlf @@ -33,9 +33,9 @@ A command is running to initially populate your local package cache, to improve - Failed to create prime the NuGet cache. {0} failed with: {1} - Не удалось изначально создать кэш NuGet. {0} завершился с ошибкой: {1} - + Failed to prime the NuGet cache. {0} failed with: {1} + Не удалось изначально создать кэш NuGet. {0} завершился с ошибкой: {1} + diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.tr.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.tr.xlf index 6bf8d2a96..7e4f71713 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.tr.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.tr.xlf @@ -33,9 +33,9 @@ Geri yükleme hızını artırmak ve çevrimdışı erişimi etkinleştirmek iç - Failed to create prime the NuGet cache. {0} failed with: {1} - Birincil NuGet önbelleği oluşturulamadı. {0} şu hata ile başarısız oldu: {1} - + Failed to prime the NuGet cache. {0} failed with: {1} + Birincil NuGet önbelleği oluşturulamadı. {0} şu hata ile başarısız oldu: {1} + diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.xlf index d80f08c8d..45687abde 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.xlf @@ -20,8 +20,8 @@ A command is running to initially populate your local package cache, to improve - Failed to create prime the NuGet cache. {0} failed with: {1} - + Failed to prime the NuGet cache. {0} failed with: {1} + diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hans.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hans.xlf index eeefbb856..ddd08f8bd 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hans.xlf @@ -33,9 +33,9 @@ A command is running to initially populate your local package cache, to improve - Failed to create prime the NuGet cache. {0} failed with: {1} - 未能创建主要 NuGet 缓存。{0} 失败,错误为: {1} - + Failed to prime the NuGet cache. {0} failed with: {1} + 未能创建主要 NuGet 缓存。{0} 失败,错误为: {1} + diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hant.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hant.xlf index deeab71c0..2dfebee03 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hant.xlf @@ -33,9 +33,9 @@ A command is running to initially populate your local package cache, to improve - Failed to create prime the NuGet cache. {0} failed with: {1} - 無法建立主要 NuGet 快取。{0} 失敗,發生: {1} - + Failed to prime the NuGet cache. {0} failed with: {1} + 無法建立主要 NuGet 快取。{0} 失敗,發生: {1} + diff --git a/src/Microsoft.DotNet.MSBuildSdkResolver/EnvironmentProvider.cs b/src/Microsoft.DotNet.MSBuildSdkResolver/EnvironmentProvider.cs new file mode 100644 index 000000000..c45ad256c --- /dev/null +++ b/src/Microsoft.DotNet.MSBuildSdkResolver/EnvironmentProvider.cs @@ -0,0 +1,61 @@ +// 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.InteropServices; + +namespace Microsoft.DotNet.MSBuildSdkResolver +{ + internal class EnvironmentProvider + { + private IEnumerable _searchPaths; + + private readonly Func _getEnvironmentVariable; + + public EnvironmentProvider(Func getEnvironmentVariable) + { + _getEnvironmentVariable = getEnvironmentVariable; + } + + public string ExecutableExtension + { + get + { + return Interop.RunningOnWindows ? ".exe" : string.Empty; + } + } + + private IEnumerable SearchPaths + { + get + { + if (_searchPaths == null) + { + var searchPaths = new List(); + + searchPaths.AddRange( + _getEnvironmentVariable("PATH") + .Split(Path.PathSeparator) + .Select(p => p.Trim('"'))); + + _searchPaths = searchPaths; + } + + return _searchPaths; + } + } + + public string GetCommandPath(string commandName) + { + var commandNameWithExtension = commandName + ExecutableExtension; + var commandPath = SearchPaths + .Select(p => Path.Combine(p, commandNameWithExtension)) + .FirstOrDefault(File.Exists); + + return commandPath; + } + } +} diff --git a/src/Microsoft.DotNet.MSBuildSdkResolver/FXVersion.cs b/src/Microsoft.DotNet.MSBuildSdkResolver/FXVersion.cs new file mode 100644 index 000000000..076f2f237 --- /dev/null +++ b/src/Microsoft.DotNet.MSBuildSdkResolver/FXVersion.cs @@ -0,0 +1,129 @@ +// 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.MSBuildSdkResolver +{ + // Note: This is not SemVer (esp., in comparing pre-release part, fx_ver_t does not + // compare multiple dot separated identifiers individually.) ex: 1.0.0-beta.2 vs. 1.0.0-beta.11 + // See the original version of this code here: https://github.com/dotnet/core-setup/blob/master/src/corehost/cli/fxr/fx_ver.cpp + internal sealed class FXVersion + { + public int Major { get; } + public int Minor { get; } + public int Patch { get; } + public string Pre { get; } + public string Build { get; } + + public FXVersion(int major, int minor, int patch, string pre = "", string build = "") + { + Major = major; + Minor = minor; + Patch = patch; + Pre = pre; + Build = build; + } + + public static int Compare(FXVersion s1, FXVersion s2) + { + if (s1.Major != s2.Major) + { + return s1.Major > s2.Major ? 1 : -1; + } + + if (s1.Minor != s2.Minor) + { + return s1.Minor > s2.Minor ? 1 : -1; + } + + if (s1.Patch != s2.Patch) + { + return s1.Patch > s2.Patch ? 1 : -1; + } + + if (string.IsNullOrEmpty(s1.Pre) != string.IsNullOrEmpty(s2.Pre)) + { + return string.IsNullOrEmpty(s1.Pre) ? 1 : -1; + } + + int preCompare = string.CompareOrdinal(s1.Pre, s2.Pre); + if (preCompare != 0) + { + return preCompare; + } + + return string.CompareOrdinal(s1.Build, s2.Build); + } + + public static bool TryParse(string fxVersionString, out FXVersion FXVersion) + { + FXVersion = null; + if (string.IsNullOrEmpty(fxVersionString)) + { + return false; + } + + int majorSeparator = fxVersionString.IndexOf("."); + if (majorSeparator == -1) + { + return false; + } + + int major = 0; + if (!int.TryParse(fxVersionString.Substring(0, majorSeparator), out major)) + { + return false; + } + + int minorStart = majorSeparator + 1; + int minorSeparator = fxVersionString.IndexOf(".", minorStart); + if (minorSeparator == -1) + { + return false; + } + + int minor = 0; + if (!int.TryParse(fxVersionString.Substring(minorStart, minorSeparator - minorStart), out minor)) + { + return false; + } + + int patch = 0; + int patchStart = minorSeparator + 1; + int patchSeparator = fxVersionString.FindFirstNotOf("0123456789", patchStart); + if (patchSeparator == -1) + { + if (!int.TryParse(fxVersionString.Substring(patchStart), out patch)) + { + return false; + } + + FXVersion = new FXVersion(major, minor, patch); + return true; + } + + if (!int.TryParse(fxVersionString.Substring(patchStart, patchSeparator - patchStart), out patch)) + { + return false; + } + + int preStart = patchSeparator; + int preSeparator = fxVersionString.IndexOf("+", preStart); + if (preSeparator == -1) + { + FXVersion = new FXVersion(major, minor, patch, fxVersionString.Substring(preStart)); + } + else + { + int buildStart = preSeparator + 1; + FXVersion = new FXVersion( + major, + minor, + patch, + fxVersionString.Substring(preStart, preSeparator - preStart), + fxVersionString.Substring(buildStart)); + } + + return true; + } + } +} \ No newline at end of file diff --git a/src/Microsoft.DotNet.MSBuildSdkResolver/InternalsVisibleToTests.cs b/src/Microsoft.DotNet.MSBuildSdkResolver/InternalsVisibleToTests.cs new file mode 100644 index 000000000..f767ffc2b --- /dev/null +++ b/src/Microsoft.DotNet.MSBuildSdkResolver/InternalsVisibleToTests.cs @@ -0,0 +1,6 @@ +// 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.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Microsoft.DotNet.MSBuildSdkResolver.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/Microsoft.DotNet.MSBuildSdkResolver/Interop.NETFramework.cs b/src/Microsoft.DotNet.MSBuildSdkResolver/Interop.NETFramework.cs index d1d567e8b..2101637f3 100644 --- a/src/Microsoft.DotNet.MSBuildSdkResolver/Interop.NETFramework.cs +++ b/src/Microsoft.DotNet.MSBuildSdkResolver/Interop.NETFramework.cs @@ -12,6 +12,8 @@ namespace Microsoft.DotNet.MSBuildSdkResolver { internal static partial class Interop { + internal static readonly bool RunningOnWindows = true; + static Interop() { PreloadLibrary("hostfxr.dll"); diff --git a/src/Microsoft.DotNet.MSBuildSdkResolver/Interop.NETStandard.cs b/src/Microsoft.DotNet.MSBuildSdkResolver/Interop.NETStandard.cs index bff6fd84b..afb2fd32a 100644 --- a/src/Microsoft.DotNet.MSBuildSdkResolver/Interop.NETStandard.cs +++ b/src/Microsoft.DotNet.MSBuildSdkResolver/Interop.NETStandard.cs @@ -14,13 +14,13 @@ namespace Microsoft.DotNet.MSBuildSdkResolver { internal static partial class Interop { - internal static readonly bool s_runningOnWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); + internal static readonly bool RunningOnWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); private static int hostfxr_resolve_sdk(string exe_dir, string working_dir, [Out] StringBuilder buffer, int buffer_size) { // hostfxr string encoding is platform -specific so dispatch to the // appropriately annotated P/Invoke for the current platform. - return s_runningOnWindows + return RunningOnWindows ? windows_hostfxr_resolve_sdk(exe_dir, working_dir, buffer, buffer_size) : unix_hostfxr_resolve_sdk(exe_dir, working_dir, buffer, buffer_size); } diff --git a/src/Microsoft.DotNet.MSBuildSdkResolver/MSBuildSdkResolver.cs b/src/Microsoft.DotNet.MSBuildSdkResolver/MSBuildSdkResolver.cs index 6048d3d59..4edf02190 100644 --- a/src/Microsoft.DotNet.MSBuildSdkResolver/MSBuildSdkResolver.cs +++ b/src/Microsoft.DotNet.MSBuildSdkResolver/MSBuildSdkResolver.cs @@ -15,13 +15,26 @@ namespace Microsoft.DotNet.MSBuildSdkResolver // Default resolver has priority 10000 and we want to go before it and leave room on either side of us. public override int Priority => 5000; + private readonly Func _getEnvironmentVariable; + + public DotNetMSBuildSdkResolver() + : this(Environment.GetEnvironmentVariable) + { + } + + // Test hook to provide environment variables without polluting the test process. + internal DotNetMSBuildSdkResolver(Func getEnvironmentVariable) + { + _getEnvironmentVariable = getEnvironmentVariable; + } + public override SdkResult Resolve(SdkReference sdkReference, SdkResolverContext context, SdkResultFactory factory) { // These are overrides that are used to force the resolved SDK tasks and targets to come from a given // base directory and report a given version to msbuild (which may be null if unknown. One key use case // for this is to test SDK tasks and targets without deploying them inside the .NET Core SDK. - string msbuildSdksDir = Environment.GetEnvironmentVariable("DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR"); - string netcoreSdkVersion = Environment.GetEnvironmentVariable("DOTNET_MSBUILD_SDK_RESOLVER_SDKS_VER"); + string msbuildSdksDir = _getEnvironmentVariable("DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR"); + string netcoreSdkVersion = _getEnvironmentVariable("DOTNET_MSBUILD_SDK_RESOLVER_SDKS_VER"); if (msbuildSdksDir == null) { @@ -40,6 +53,19 @@ namespace Microsoft.DotNet.MSBuildSdkResolver netcoreSdkVersion = new DirectoryInfo(netcoreSdkDir).Name;; } + if (!IsNetCoreSDKOveridden(netcoreSdkVersion) && + IsNetCoreSDKSmallerThanTheMinimumVersion(netcoreSdkVersion, sdkReference.MinimumVersion)) + { + return factory.IndicateFailure( + new[] + { + $"Version {netcoreSdkVersion} of the SDK is smaller than the minimum version" + + $" {sdkReference.MinimumVersion} requested. Check that a recent enough .NET Core SDK is" + + " installed, increase the minimum version specified in the project, or increase" + + " the version specified in global.json." + }); + } + string msbuildSdkDir = Path.Combine(msbuildSdksDir, sdkReference.Name, "Sdk"); if (!Directory.Exists(msbuildSdkDir)) { @@ -47,80 +73,57 @@ namespace Microsoft.DotNet.MSBuildSdkResolver new[] { $"{msbuildSdkDir} not found. Check that a recent enough .NET Core SDK is installed" - + " and/or increase the version specified in global.json. " + + " and/or increase the version specified in global.json." }); } return factory.IndicateSuccess(msbuildSdkDir, netcoreSdkVersion); } - private string ResolveNetcoreSdkDirectory(SdkResolverContext context) + private bool IsNetCoreSDKOveridden(string netcoreSdkVersion) { - foreach (string exeDir in GetDotnetExeDirectoryCandidates()) - { - string workingDir = context.SolutionFilePath ?? context.ProjectFilePath; - string netcoreSdkDir = Interop.hostfxr_resolve_sdk(exeDir, workingDir); - - if (netcoreSdkDir != null) - { - return netcoreSdkDir; - } - } - - return null; + return netcoreSdkVersion == null; } - // Search for [ProgramFiles]\dotnet in this order. - private static readonly string[] s_programFiles = new[] + private bool IsNetCoreSDKSmallerThanTheMinimumVersion(string netcoreSdkVersion, string minimumVersion) { - // "c:\Program Files" on x64 machine regardless process architecture. - // Undefined on x86 machines. - "ProgramW6432", + FXVersion netCoreSdkFXVersion; + FXVersion minimumFXVersion; - // "c:\Program Files (x86)" on x64 machine regardless of process architecture - // Undefined on x86 machines. - "ProgramFiles(x86)", + if (string.IsNullOrEmpty(minimumVersion)) + { + return false; + } - // "c:\Program Files" or "C:\Program Files (x86)" on x64 machine depending on process architecture. - // "c:\Program Files" on x86 machines (therefore not redundant with the two locations above in that case). - // - // NOTE: hostfxr will search this on its own if multilevel lookup is not disable, but we do it explicitly - // to prevent an environment with disabled multilevel lookup from crippling desktop msbuild and VS. - "ProgramFiles", - }; + if (!FXVersion.TryParse(netcoreSdkVersion, out netCoreSdkFXVersion) || + !FXVersion.TryParse(minimumVersion, out minimumFXVersion)) + { + return true; + } - private List GetDotnetExeDirectoryCandidates() + return FXVersion.Compare(netCoreSdkFXVersion, minimumFXVersion) == -1; + } + + private string ResolveNetcoreSdkDirectory(SdkResolverContext context) { - string environmentOverride = Environment.GetEnvironmentVariable("DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR"); + string exeDir = GetDotnetExeDirectory(); + string workingDir = context.SolutionFilePath ?? context.ProjectFilePath; + string netcoreSdkDir = Interop.hostfxr_resolve_sdk(exeDir, workingDir); + + return netcoreSdkDir; + } + + private string GetDotnetExeDirectory() + { + string environmentOverride = _getEnvironmentVariable("DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR"); if (environmentOverride != null) { - return new List(capacity: 1) { environmentOverride }; + return environmentOverride; } - // Initial capacity is 2 because while there are 3 candidates, we expect at most 2 unique ones (x64 + x86) - // Also, N=3 here means that we needn't be concerned with the O(N^2) complexity of the foreach + contains. - var candidates = new List(capacity: 2); - foreach (string variable in s_programFiles) - { - string directory = Environment.GetEnvironmentVariable(variable); - if (directory == null) - { - continue; - } + var environmentProvider = new EnvironmentProvider(_getEnvironmentVariable); - directory = Path.Combine(directory, "dotnet"); - if (!candidates.Contains(directory)) - { - candidates.Add(directory); - } - } - - if (candidates.Count == 0) - { - candidates.Add(null); - } - - return candidates; + return Path.GetDirectoryName(environmentProvider.GetCommandPath("dotnet")); } } } diff --git a/src/Microsoft.DotNet.MSBuildSdkResolver/Microsoft.DotNet.MSBuildSdkResolver.sln b/src/Microsoft.DotNet.MSBuildSdkResolver/Microsoft.DotNet.MSBuildSdkResolver.sln index 4d5062122..08c449079 100644 --- a/src/Microsoft.DotNet.MSBuildSdkResolver/Microsoft.DotNet.MSBuildSdkResolver.sln +++ b/src/Microsoft.DotNet.MSBuildSdkResolver/Microsoft.DotNet.MSBuildSdkResolver.sln @@ -7,6 +7,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.MSBuildSdk EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.MSBuildSdkResolver.Tests", "..\..\test\Microsoft.DotNet.MSBuildSdkResolver.Tests\Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj", "{CC488F39-E106-4BF4-9599-19A265AFD9AC}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Tools.Tests.Utilities", "..\..\test\Microsoft.DotNet.Tools.Tests.Utilities\Microsoft.DotNet.Tools.Tests.Utilities.csproj", "{E548D3D0-50E3-4485-B531-95585A5D0B85}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.TestFramework", "..\Microsoft.DotNet.TestFramework\Microsoft.DotNet.TestFramework.csproj", "{182FFFA6-AE8F-431C-9B17-2F30B2A8FE42}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestDependencies", "TestDependencies", "{0F45009E-9053-401D-91CA-8046D9EB310B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.Cli.Utils", "..\Microsoft.DotNet.Cli.Utils\Microsoft.DotNet.Cli.Utils.csproj", "{7F68DEFE-F2D3-453C-B155-51B674604D29}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.InternalAbstractions", "..\Microsoft.DotNet.InternalAbstractions\Microsoft.DotNet.InternalAbstractions.csproj", "{A54567A1-E8DE-4B8C-9156-D895B9D016DB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,8 +31,30 @@ Global {CC488F39-E106-4BF4-9599-19A265AFD9AC}.Debug|Any CPU.Build.0 = Debug|Any CPU {CC488F39-E106-4BF4-9599-19A265AFD9AC}.Release|Any CPU.ActiveCfg = Release|Any CPU {CC488F39-E106-4BF4-9599-19A265AFD9AC}.Release|Any CPU.Build.0 = Release|Any CPU + {E548D3D0-50E3-4485-B531-95585A5D0B85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E548D3D0-50E3-4485-B531-95585A5D0B85}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E548D3D0-50E3-4485-B531-95585A5D0B85}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E548D3D0-50E3-4485-B531-95585A5D0B85}.Release|Any CPU.Build.0 = Release|Any CPU + {182FFFA6-AE8F-431C-9B17-2F30B2A8FE42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {182FFFA6-AE8F-431C-9B17-2F30B2A8FE42}.Debug|Any CPU.Build.0 = Debug|Any CPU + {182FFFA6-AE8F-431C-9B17-2F30B2A8FE42}.Release|Any CPU.ActiveCfg = Release|Any CPU + {182FFFA6-AE8F-431C-9B17-2F30B2A8FE42}.Release|Any CPU.Build.0 = Release|Any CPU + {7F68DEFE-F2D3-453C-B155-51B674604D29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7F68DEFE-F2D3-453C-B155-51B674604D29}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7F68DEFE-F2D3-453C-B155-51B674604D29}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7F68DEFE-F2D3-453C-B155-51B674604D29}.Release|Any CPU.Build.0 = Release|Any CPU + {A54567A1-E8DE-4B8C-9156-D895B9D016DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A54567A1-E8DE-4B8C-9156-D895B9D016DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A54567A1-E8DE-4B8C-9156-D895B9D016DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A54567A1-E8DE-4B8C-9156-D895B9D016DB}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {E548D3D0-50E3-4485-B531-95585A5D0B85} = {0F45009E-9053-401D-91CA-8046D9EB310B} + {182FFFA6-AE8F-431C-9B17-2F30B2A8FE42} = {0F45009E-9053-401D-91CA-8046D9EB310B} + {7F68DEFE-F2D3-453C-B155-51B674604D29} = {0F45009E-9053-401D-91CA-8046D9EB310B} + {A54567A1-E8DE-4B8C-9156-D895B9D016DB} = {0F45009E-9053-401D-91CA-8046D9EB310B} + EndGlobalSection EndGlobal diff --git a/src/Microsoft.DotNet.MSBuildSdkResolver/StringExtensions.cs b/src/Microsoft.DotNet.MSBuildSdkResolver/StringExtensions.cs new file mode 100644 index 000000000..8382008c9 --- /dev/null +++ b/src/Microsoft.DotNet.MSBuildSdkResolver/StringExtensions.cs @@ -0,0 +1,15 @@ +namespace Microsoft.DotNet.MSBuildSdkResolver +{ + internal static class StringExtensions + { + public static int FindFirstNotOf(this string s, string chars, int startIndex) + { + for (int i = startIndex; i < s.Length; i++) + { + if (chars.IndexOf(s[i]) == -1) return i; + } + + return -1; + } + } +} \ No newline at end of file diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/ConstantPackageVersions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/ConstantPackageVersions.cs deleted file mode 100644 index 2b768bea1..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/ConstantPackageVersions.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. - -namespace Microsoft.DotNet.ProjectJsonMigration -{ - internal class ConstantPackageVersions - { - public const string AspNetToolsVersion = "1.0.0"; - public const string AspNet110ToolsVersion = "1.1.0"; - public const string AspNetLTSPackagesVersion = "1.0.3"; - public const string EntityFrameworkLTSPackagesVersion = "1.0.3"; - public const string TestSdkPackageVersion = "15.0.0-preview-20170106-08"; - public const string XUnitPackageVersion = "2.2.0-beta5-build3474"; - public const string XUnitRunnerPackageVersion = "2.2.0-beta5-build1225"; - public const string MstestTestAdapterVersion = "1.1.8-rc"; - public const string MstestTestFrameworkVersion = "1.0.8-rc"; - public const string BundleMinifierToolVersion = "2.2.301"; - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/DefaultMigrationRuleSet.cs b/src/Microsoft.DotNet.ProjectJsonMigration/DefaultMigrationRuleSet.cs deleted file mode 100644 index 3e554366a..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/DefaultMigrationRuleSet.cs +++ /dev/null @@ -1,41 +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.ProjectJsonMigration.Rules; - -namespace Microsoft.DotNet.ProjectJsonMigration -{ - internal class DefaultMigrationRuleSet : IMigrationRule - { - private IMigrationRule[] Rules => new IMigrationRule[] - { - new AddDefaultsToProjectRule(), - new MigrateRootOptionsRule(), - new MigrateTFMRule(), - new MigrateBuildOptionsRule(), - new MigrateJsonPropertiesRule(), - new MigratePackOptionsRule(), - new MigrateRuntimeOptionsRule(), - new MigrateRuntimesRule(), - new MigratePublishOptionsRule(), - new MigrateProjectDependenciesRule(), - new MigratePackageDependenciesAndToolsRule(), - new MigrateConfigurationsRule(), - new MigrateScriptsRule(), - new MigrateAssemblyInfoRule(), - new RemoveDefaultsFromProjectRule(), - new CleanOutputProjectRule(), - new SaveOutputProjectRule(), - new MigrateWebSdkRule() - }; - - public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs) - { - foreach (var rule in Rules) - { - MigrationTrace.Instance.WriteLine(string.Format(LocalizableStrings.ExecutingMigrationRule, nameof(DefaultMigrationRuleSet), rule.GetType().Name)); - rule.Apply(migrationSettings, migrationRuleInputs); - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/DotnetSupportedPackageVersionsCsvProvider.cs b/src/Microsoft.DotNet.ProjectJsonMigration/DotnetSupportedPackageVersionsCsvProvider.cs deleted file mode 100644 index deed5808a..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/DotnetSupportedPackageVersionsCsvProvider.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 System; -using System.Collections.Generic; -using System.IO; - -namespace Microsoft.DotNet.ProjectJsonMigration -{ - internal class DotnetSupportedPackageVersionsCsvProvider : IDotnetSupportedPackageVersionsProvider - { - public void AddDotnetSupportedPackageVersions( - IDictionary projectDependenciesPackages) - { - var dotnetSupportedPackageVersionsPath = - Path.Combine(AppContext.BaseDirectory, "dotnet-supported-package-versions.csv"); - using (var reader = new StreamReader(File.OpenRead(dotnetSupportedPackageVersionsPath))) - { - SkipHeader(reader); - while (!reader.EndOfStream) - { - var line = reader.ReadLine(); - var values = line.Split(','); - var packageName = values[0]; - var ltsVersion = values[1]; - var ftsVersion = values[2]; - - if (HasVersion(ltsVersion)) - { - projectDependenciesPackages.Add( - new PackageDependencyInfo - { - Name = packageName, - Version = $"[,{ltsVersion})" - }, - new PackageDependencyInfo - { - Name = packageName, - Version = ltsVersion - }); - } - - if(HasVersion(ftsVersion)) - { - var version = HasVersion(ltsVersion) ? $"({ltsVersion},{ftsVersion})" : $"[,{ftsVersion})"; - projectDependenciesPackages.Add( - new PackageDependencyInfo - { - Name = packageName, - Version = version - }, - new PackageDependencyInfo - { - Name = packageName, - Version = ftsVersion - }); - } - } - } - } - - private void SkipHeader(StreamReader reader) - { - reader.ReadLine(); - } - - private bool HasVersion(string version) - { - return !string.IsNullOrEmpty(version); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/IDotnetSupportedPackageVersionsProvider.cs b/src/Microsoft.DotNet.ProjectJsonMigration/IDotnetSupportedPackageVersionsProvider.cs deleted file mode 100644 index 27d05f907..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/IDotnetSupportedPackageVersionsProvider.cs +++ /dev/null @@ -1,13 +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.ProjectJsonMigration -{ - internal interface IDotnetSupportedPackageVersionsProvider - { - void AddDotnetSupportedPackageVersions( - IDictionary projectDependenciesPackages); - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/LocalizableStrings.cs b/src/Microsoft.DotNet.ProjectJsonMigration/LocalizableStrings.cs deleted file mode 100644 index 383b009ac..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/LocalizableStrings.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. - -namespace Microsoft.DotNet.ProjectJsonMigration -{ - internal class LocalizableStrings - { - public const string DoubleMigrationError = "Detected double project migration: {0}"; - - public const string CannotMergeMetadataError = "Cannot merge metadata with the same name and different values"; - - public const string NoXprojFileGivenError = "{0}: No xproj file given."; - - public const string MultipleXprojFilesError = "Multiple xproj files found in {0}, please specify which to use"; - - public const string NullMSBuildProjectTemplateError = "Expected non-null MSBuildProjectTemplate in MigrationSettings"; - - public const string CannotMigrateProjectWithCompilerError = "Cannot migrate project {0} using compiler {1}"; - - public const string ExpectedElementToBeOfTypeNotTypeError = "Expected element to be of type {0}, but got {1}"; - - public const string ProjAlreadyExistsError = "{0} already exists. Has migration already been run?"; - - public const string NullDestinationElementError = "expected destinationElement to not be null"; - - public const string DiagnosticMessageTemplate = "{0} (line: {1}, file: {2})"; - - public const string CannotMergeItemsOfDifferentTypesError = "Cannot merge items of different types."; - - public const string CannotMergeItemsWithoutCommonIncludeError = "Cannot merge items without a common include."; - - public const string PropertyTransformApplicatorWrongElementTypeError = "Expected element to be of type {0}, but got {1}"; - - public const string UnexpectedTypeError = "Unexpected type {0}"; - - public const string MIGRATE1011 = "Deprecated Project"; - - public const string MIGRATE1012 = "Project not Restored"; - - public const string MIGRATE1013 = "No Project"; - - public const string MIGRATE1013Arg = "The project.json specifies no target frameworks in {0}"; - - public const string MIGRATE1014 = "Unresolved Dependency"; - - public const string MIGRATE1014Arg = "Unresolved project dependency ({0})"; - - public const string MIGRATE1015 = "File Overwrite"; - - public const string MIGRATE1016 = "Unsupported Script Variable"; - - public const string MIGRATE1016Arg = "{0} is currently an unsupported script variable for project migration"; - - public const string MIGRATE1017 = "Multiple Xproj Files"; - - public const string MIGRATE1018 = "Dependency Project not found"; - - public const string MIGRATE1018Arg = "Dependency project not found ({0})" ; - - public const string MIGRATE1019 = "Unsupported Script Event Hook"; - - public const string MIGRATE1019Arg = "{0} is an unsupported script event hook for project migration"; - - public const string MIGRATE20011 = "Multi-TFM"; - - public const string MIGRATE20012 = "Configuration Exclude"; - - public const string MIGRATE20013 = "Non-Csharp App"; - - public const string MIGRATE20018 = "Files specified under PackOptions"; - - public const string IncludesNotEquivalent = "{0}.{1} includes not equivalent."; - - public const string UpdatesNotEquivalent = "{0}.{1} updates not equivalent."; - - public const string ExcludesNotEquivalent = "{0}.{1} excludes not equivalent."; - - public const string RemovesNotEquivalent = "{0}.{1} removes not equivalent."; - - public const string MetadataDoesntExist = "{0}.{1} metadata doesn't exist {{ {2} {3} }}"; - - public const string MetadataHasAnotherValue = "{0}.{1} metadata has another value {{ {2} {3} {4} }}"; - - public const string AddingMetadataToItem = "{0}: Adding metadata to {1} item: {{ {2}, {3}, {4} }}"; - - public const string SkipMigrationAlreadyMigrated = "{0}: Skip migrating {1}, it is already migrated."; - - public const string ExecutingRule = "Executing rule: {0}"; - - public const string NoConfigurationOrFrameworkFoundInProject = "{0}: No configuration or framework build options found in project"; - - public const string MigratingCountTargetFrameworks = "Migrating {0} target frameworks"; - - public const string MigratingFramework = "Migrating framework {0}"; - - public const string ImportsTransformNullFor = "{0}: imports transform null for {1}"; - - public const string MigratingCountXprojToCsprojReferences = "{0}: Migrating {1} xproj to csproj references"; - - public const string ExecutingMigrationRule = "{0}: Executing migration rule {1}"; - - public const string ItemTransformApplicatorHeader = "{0}: Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }}"; - - public const string ItemTransformApplicatorItemGroup = "{0}: ItemGroup {{ Condition: {1} }}"; - - public const string ItemTransformAppliatorItemCompletelyMerged = "{0}: Item completely merged"; - - public const string ItemTransformApplicatorAddItemHeader = "{0}: AddItemToItemGroup {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }}"; - - public const string ItemTransformApplicatorMergingItemWithExistingItems = "{0}: Merging Item with {1} existing items with a different condition chain."; - - public const string ItemTransformApplicatorEncompassedIncludes = "{0}: encompassed includes {1}"; - - public const string ItemTransformApplicatorEncompassedUpdates = "{0}: encompassed updates {1}"; - - public const string ItemTransformApplicatorRemovingItem = "{0}: Removing Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }}"; - - public const string ItemTransformApplicatorIgnoringItem = "{0}: Ignoring Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }}"; - - public const string ItemTransformApplicatorMergingItemWithExistingItemsSameChain = "{0}: Merging Item with {1} existing items with the same condition chain."; - - public const string ItemTransformApplicatorAddingMergedItem = "{0}: Adding Merged Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }}"; - - public const string MergingProperty = "Merging property, output merged property"; - - public const string IgnoringMergedProperty = "Ignoring fully merged property"; - - public const string PropertyInfo = "{0}: {1}, {{ Name={2}, Value={3} }}"; - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/MSBuildExtensions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/MSBuildExtensions.cs deleted file mode 100644 index adf5cc643..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/MSBuildExtensions.cs +++ /dev/null @@ -1,259 +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.Build.Construction; - -namespace Microsoft.DotNet.ProjectJsonMigration -{ - public static class MSBuildExtensions - { - public static IEnumerable GetEncompassedIncludes(this ProjectItemElement item, - ProjectItemElement otherItem, TextWriter trace = null) - { - if (otherItem.IsEquivalentToExceptIncludeUpdateAndExclude(item, trace) && - new HashSet(otherItem.Excludes()).IsSubsetOf(new HashSet(item.Excludes()))) - { - return otherItem.IntersectIncludes(item); - } - - return Enumerable.Empty(); - } - - public static IEnumerable GetEncompassedUpdates(this ProjectItemElement item, - ProjectItemElement otherItem, TextWriter trace = null) - { - if (otherItem.IsEquivalentToExceptIncludeUpdateAndExclude(item, trace) && - new HashSet(otherItem.Excludes()).IsSubsetOf(new HashSet(item.Excludes()))) - { - return otherItem.IntersectUpdates(item); - } - - return Enumerable.Empty(); - } - - public static bool IsEquivalentTo(this ProjectItemElement item, ProjectItemElement otherItem, TextWriter trace = null) - { - // Different includes - if (item.IntersectIncludes(otherItem).Count() != item.Includes().Count()) - { - trace?.WriteLine(String.Format(LocalizableStrings.IncludesNotEquivalent, nameof(MSBuildExtensions), nameof(IsEquivalentTo))); - return false; - } - - if (item.IntersectUpdates(otherItem).Count() != item.Updates().Count()) - { - trace?.WriteLine(String.Format(LocalizableStrings.UpdatesNotEquivalent, nameof(MSBuildExtensions), nameof(IsEquivalentTo))); - return false; - } - - // Different Excludes - if (item.IntersectExcludes(otherItem).Count() != item.Excludes().Count()) - { - trace?.WriteLine(String.Format(LocalizableStrings.ExcludesNotEquivalent, nameof(MSBuildExtensions), nameof(IsEquivalentTo))); - return false; - } - - return item.IsEquivalentToExceptIncludeUpdateAndExclude(otherItem, trace); - } - - public static bool IsEquivalentToExceptIncludeUpdateAndExclude(this ProjectItemElement item, ProjectItemElement otherItem, TextWriter trace = null) - { - // Different remove - if (item.Remove != otherItem.Remove) - { - trace?.WriteLine(String.Format(LocalizableStrings.RemovesNotEquivalent, nameof(MSBuildExtensions), nameof(IsEquivalentTo))); - return false; - } - - // Different Metadata - var metadataTuples = otherItem.Metadata.Select(m => Tuple.Create(m, item)).Concat( - item.Metadata.Select(m => Tuple.Create(m, otherItem))); - foreach (var metadataTuple in metadataTuples) - { - var metadata = metadataTuple.Item1; - var itemToCompare = metadataTuple.Item2; - - var otherMetadata = itemToCompare.GetMetadataWithName(metadata.Name); - if (otherMetadata == null) - { - trace?.WriteLine(String.Format(LocalizableStrings.MetadataDoesntExist, nameof(MSBuildExtensions), nameof(IsEquivalentTo), metadata.Name, metadata.Value)); - return false; - } - - if (!metadata.ValueEquals(otherMetadata)) - { - trace?.WriteLine(String.Format(LocalizableStrings.MetadataHasAnotherValue, nameof(MSBuildExtensions), nameof(IsEquivalentTo), metadata.Name, metadata.Value, otherMetadata.Value)); - return false; - } - } - - return true; - } - - public static ISet ConditionChain(this ProjectElement projectElement) - { - var conditionChainSet = new HashSet(); - - if (!string.IsNullOrEmpty(projectElement.Condition)) - { - conditionChainSet.Add(projectElement.Condition); - } - - foreach (var parent in projectElement.AllParents) - { - if (!string.IsNullOrEmpty(parent.Condition)) - { - conditionChainSet.Add(parent.Condition); - } - } - - return conditionChainSet; - } - - public static bool ConditionChainsAreEquivalent(this ProjectElement projectElement, ProjectElement otherProjectElement) - { - return projectElement.ConditionChain().SetEquals(otherProjectElement.ConditionChain()); - } - - public static IEnumerable PropertiesWithoutConditions( - this ProjectRootElement projectRoot) - { - return ElementsWithoutConditions(projectRoot.Properties); - } - - public static IEnumerable ItemsWithoutConditions( - this ProjectRootElement projectRoot) - { - return ElementsWithoutConditions(projectRoot.Items); - } - - public static IEnumerable Includes( - this ProjectItemElement item) - { - return SplitSemicolonDelimitedValues(item.Include); - } - - public static IEnumerable Updates( - this ProjectItemElement item) - { - return SplitSemicolonDelimitedValues(item.Update); - } - - public static IEnumerable Excludes( - this ProjectItemElement item) - { - return SplitSemicolonDelimitedValues(item.Exclude); - } - - public static IEnumerable Removes( - this ProjectItemElement item) - { - return SplitSemicolonDelimitedValues(item.Remove); - } - - public static IEnumerable AllConditions(this ProjectElement projectElement) - { - return new string[] { projectElement.Condition }.Concat(projectElement.AllParents.Select(p=> p.Condition)); - } - - public static IEnumerable IntersectIncludes(this ProjectItemElement item, ProjectItemElement otherItem) - { - return item.Includes().Intersect(otherItem.Includes()); - } - - public static IEnumerable IntersectUpdates(this ProjectItemElement item, ProjectItemElement otherItem) - { - return item.Updates().Intersect(otherItem.Updates()); - } - - public static IEnumerable IntersectExcludes(this ProjectItemElement item, ProjectItemElement otherItem) - { - return item.Excludes().Intersect(otherItem.Excludes()); - } - - public static void RemoveIncludes(this ProjectItemElement item, IEnumerable includesToRemove) - { - item.Include = string.Join(";", item.Includes().Except(includesToRemove)); - } - - public static void RemoveUpdates(this ProjectItemElement item, IEnumerable updatesToRemove) - { - item.Update = string.Join(";", item.Updates().Except(updatesToRemove)); - } - - public static void UnionIncludes(this ProjectItemElement item, IEnumerable includesToAdd) - { - item.Include = string.Join(";", item.Includes().Union(includesToAdd)); - } - - public static void UnionExcludes(this ProjectItemElement item, IEnumerable excludesToAdd) - { - item.Exclude = string.Join(";", item.Excludes().Union(excludesToAdd)); - } - - public static bool ValueEquals(this ProjectMetadataElement metadata, ProjectMetadataElement otherMetadata) - { - return metadata.Value.Equals(otherMetadata.Value, StringComparison.Ordinal); - } - - public static void AddMetadata(this ProjectItemElement item, ICollection metadataElements, TextWriter trace = null) - { - foreach (var metadata in metadataElements) - { - item.AddMetadata(metadata, trace); - } - } - - public static void RemoveIfEmpty(this ProjectElementContainer container) - { - if (!container.Children.Any()) - { - container.Parent.RemoveChild(container); - } - } - - public static ProjectMetadataElement GetMetadataWithName(this ProjectItemElement item, string name) - { - return item.Metadata.FirstOrDefault(m => m.Name.Equals(name, StringComparison.OrdinalIgnoreCase)); - } - - public static void AddMetadata(this ProjectItemElement item, ProjectMetadataElement metadata, TextWriter trace = null) - { - var existingMetadata = item.GetMetadataWithName(metadata.Name); - - if (existingMetadata != default(ProjectMetadataElement) && !existingMetadata.ValueEquals(metadata)) - { - throw new Exception(LocalizableStrings.CannotMergeMetadataError); - } - - if (existingMetadata == default(ProjectMetadataElement)) - { - trace?.WriteLine(String.Format(LocalizableStrings.AddingMetadataToItem, nameof(AddMetadata), item.ItemType, metadata.Name, metadata.Value, metadata.Condition)); - var metametadata = item.AddMetadata(metadata.Name, metadata.Value); - metametadata.Condition = metadata.Condition; - metametadata.ExpressedAsAttribute = metadata.ExpressedAsAttribute; - } - } - - public static void SetExcludeOnlyIfIncludeIsSet(this ProjectItemElement item, string exclude) - { - item.Exclude = string.IsNullOrEmpty(item.Include) ? string.Empty : exclude; - } - - private static IEnumerable SplitSemicolonDelimitedValues(string combinedValue) - { - return string.IsNullOrEmpty(combinedValue) ? Enumerable.Empty() : combinedValue.Split(';'); - } - - private static IEnumerable ElementsWithoutConditions(IEnumerable elements) where T : ProjectElement - { - return elements - .Where(e => string.IsNullOrEmpty(e.Condition) - && e.AllParents.All(parent => string.IsNullOrEmpty(parent.Condition))); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/AnalyzerOptions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/AnalyzerOptions.cs deleted file mode 100644 index ac60f0957..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/AnalyzerOptions.cs +++ /dev/null @@ -1,57 +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.Internal.ProjectModel -{ - internal class AnalyzerOptions : IEquatable - { - /// - /// The identifier indicating the project language as defined by NuGet. - /// - /// - /// See https://docs.nuget.org/create/analyzers-conventions for valid values - /// - public string LanguageId { get; } - - public AnalyzerOptions(string languageId = null) - { - LanguageId = languageId; - } - - public bool Equals(AnalyzerOptions other) - { - return !ReferenceEquals(other, null) && other.LanguageId == LanguageId; - } - - public override bool Equals(object obj) - { - return Equals(obj as AnalyzerOptions); - } - - public override int GetHashCode() - { - return LanguageId?.GetHashCode() ?? 0; - } - - public static bool operator ==(AnalyzerOptions left, AnalyzerOptions right) - { - if (ReferenceEquals(left, right)) - { - return true; - } - if (ReferenceEquals(left, null)) - { - return false; - } - - return left.Equals(right); - } - - public static bool operator !=(AnalyzerOptions left, AnalyzerOptions right) - { - return !(left == right); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/BuildWorkspace.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/BuildWorkspace.cs deleted file mode 100644 index 39af35dc8..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/BuildWorkspace.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; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal class BuildWorkspace : Workspace - { - public BuildWorkspace(ProjectReaderSettings settings) : base(settings, false) { } - - /// - /// Create an empty using the default - /// - /// - public static BuildWorkspace Create() => Create(versionSuffix: string.Empty); - - /// - /// Create an empty using the default , with the specified Version Suffix - /// - /// The suffix to use to replace any '-*' snapshot tokens in Project versions. - /// - public static BuildWorkspace Create(string versionSuffix) - { - var settings = ProjectReaderSettings.ReadFromEnvironment(); - if (!string.IsNullOrEmpty(versionSuffix)) - { - settings.VersionSuffix = versionSuffix; - } - return new BuildWorkspace(settings); - } - - public ProjectContext GetRuntimeContext(ProjectContext context, IEnumerable runtimeIdentifiers) - { - if (!runtimeIdentifiers.Any()) - { - return context; - } - - var contexts = GetProjectContextCollection(context.ProjectDirectory); - if (contexts == null) - { - return null; - } - - var runtimeContext = runtimeIdentifiers - .Select(r => contexts.GetTarget(context.TargetFramework, r)) - .FirstOrDefault(c => c != null); - - if (runtimeContext == null) - { - if (context.IsPortable) - { - // We're specializing a portable target, so synthesize a runtime target manually - // We don't cache this project context, but we'll still use the cached Project and LockFile - return CreateBaseProjectBuilder(context.ProjectFile) - .WithTargetFramework(context.TargetFramework) - .WithRuntimeIdentifiers(runtimeIdentifiers) - .Build(); - } - - // We are standalone, but don't support this runtime - var rids = string.Join(", ", runtimeIdentifiers); - throw new InvalidOperationException($"Can not find runtime target for framework '{context.TargetFramework}' compatible with one of the target runtimes: '{rids}'. " + - "Possible causes:" + Environment.NewLine + - "1. The project has not been restored or restore failed - run `dotnet restore`" + Environment.NewLine + - $"2. The project does not list one of '{rids}' in the 'runtimes' section." + Environment.NewLine + - "3. You may be trying to publish a library, which is not supported. Use `dotnet pack` to distribute libraries."); - } - - return runtimeContext; - } - - protected override IEnumerable BuildProjectContexts(Project project) - { - return CreateBaseProjectBuilder(project).BuildAllTargets(); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/CommonCompilerOptions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/CommonCompilerOptions.cs deleted file mode 100644 index 7bf66c2b2..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/CommonCompilerOptions.cs +++ /dev/null @@ -1,212 +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.Internal.ProjectModel.Files; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal class CommonCompilerOptions - { - public IEnumerable Defines { get; set; } - - public string LanguageVersion { get; set; } - - public string Platform { get; set; } - - public bool? AllowUnsafe { get; set; } - - public bool? WarningsAsErrors { get; set; } - - public bool? Optimize { get; set; } - - public string KeyFile { get; set; } - - public bool? DelaySign { get; set; } - - public bool? PublicSign { get; set; } - - public string DebugType { get; set; } - - public bool? EmitEntryPoint { get; set; } - - public bool? PreserveCompilationContext { get; set; } - - public bool? GenerateXmlDocumentation { get; set; } - - public IEnumerable SuppressWarnings { get; set; } - - public IEnumerable AdditionalArguments { get; set; } - - public string OutputName { get; set; } - - public string CompilerName { get; set; } - - public IncludeContext CompileInclude { get; set; } - - public IncludeContext EmbedInclude { get; set; } - - public IncludeContext CopyToOutputInclude { get; set; } - - public override bool Equals(object obj) - { - var other = obj as CommonCompilerOptions; - return other != null && - LanguageVersion == other.LanguageVersion && - Platform == other.Platform && - AllowUnsafe == other.AllowUnsafe && - WarningsAsErrors == other.WarningsAsErrors && - Optimize == other.Optimize && - KeyFile == other.KeyFile && - DelaySign == other.DelaySign && - PublicSign == other.PublicSign && - DebugType == other.DebugType && - EmitEntryPoint == other.EmitEntryPoint && - GenerateXmlDocumentation == other.GenerateXmlDocumentation && - PreserveCompilationContext == other.PreserveCompilationContext && - EnumerableEquals(Defines, other.Defines) && - EnumerableEquals(SuppressWarnings, other.SuppressWarnings) && - EnumerableEquals(AdditionalArguments, other.AdditionalArguments) && - OutputName == other.OutputName && - CompilerName == other.CompilerName && - IsEqual(CompileInclude, other.CompileInclude) && - IsEqual(EmbedInclude, other.EmbedInclude) && - IsEqual(CopyToOutputInclude, other.CopyToOutputInclude); - } - - private static bool IsEqual(IncludeContext first, IncludeContext second) - { - if (first == null || second == null) - { - return first == second; - } - - return first.Equals(second); - } - - private static bool EnumerableEquals(IEnumerable left, IEnumerable right) - => Enumerable.SequenceEqual(left ?? EmptyArray.Value, right ?? EmptyArray.Value); - - public override int GetHashCode() - { - return base.GetHashCode(); - } - - private static IEnumerable Combine(IEnumerable @new, IEnumerable old) - { - if (@new != null) - { - old = old ?? EmptyArray.Value; - return old.Concat(@new).Distinct().ToArray(); - } - return old; - } - - public static CommonCompilerOptions Combine(params CommonCompilerOptions[] options) - { - var result = new CommonCompilerOptions(); - foreach (var option in options) - { - // Skip null options - if (option == null) - { - continue; - } - - // Defines, suppressions, and additional arguments are always combined - result.Defines = Combine(option.Defines, result.Defines); - result.SuppressWarnings = Combine(option.SuppressWarnings, result.SuppressWarnings); - result.AdditionalArguments = Combine(option.AdditionalArguments, result.AdditionalArguments); - - if (option.LanguageVersion != null) - { - result.LanguageVersion = option.LanguageVersion; - } - - if (option.Platform != null) - { - result.Platform = option.Platform; - } - - if (option.AllowUnsafe != null) - { - result.AllowUnsafe = option.AllowUnsafe; - } - - if (option.WarningsAsErrors != null) - { - result.WarningsAsErrors = option.WarningsAsErrors; - } - - if (option.Optimize != null) - { - result.Optimize = option.Optimize; - } - - if (option.KeyFile != null) - { - result.KeyFile = option.KeyFile; - } - - if (option.DelaySign != null) - { - result.DelaySign = option.DelaySign; - } - - if (option.PublicSign != null) - { - result.PublicSign = option.PublicSign; - } - - if (option.DebugType != null) - { - result.DebugType = option.DebugType; - } - - if (option.EmitEntryPoint != null) - { - result.EmitEntryPoint = option.EmitEntryPoint; - } - - if (option.PreserveCompilationContext != null) - { - result.PreserveCompilationContext = option.PreserveCompilationContext; - } - - if (option.GenerateXmlDocumentation != null) - { - result.GenerateXmlDocumentation = option.GenerateXmlDocumentation; - } - - if (option.OutputName != null) - { - result.OutputName = option.OutputName; - } - - if (option.CompileInclude != null) - { - result.CompileInclude = option.CompileInclude; - } - - if (option.EmbedInclude != null) - { - result.EmbedInclude = option.EmbedInclude; - } - - if (option.CopyToOutputInclude != null) - { - result.CopyToOutputInclude = option.CopyToOutputInclude; - } - - // compilerName set in the root cannot be overriden. - if (result.CompilerName == null) - { - result.CompilerName = option.CompilerName; - } - } - - return result; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/AnalyzerAssembly.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/AnalyzerAssembly.cs deleted file mode 100644 index 75456f630..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/AnalyzerAssembly.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 NuGet.Frameworks; - -namespace Microsoft.DotNet.Internal.ProjectModel.Compilation -{ - internal class AnalyzerReference - { - /// - /// The fully-qualified path to the analyzer assembly. - /// - public string AssemblyPath { get; } - - /// - /// The supported language of the analyzer assembly. - /// - public string AnalyzerLanguage { get; } - - /// - /// The required framework for hosting the analyzer assembly. - /// - public NuGetFramework RequiredFramework { get; } - - /// - /// The required runtime for hosting the analyzer assembly. - /// - public string RuntimeIdentifier { get; } - - public AnalyzerReference( - string assembly, - NuGetFramework framework, - string language, - string runtimeIdentifier) - { - AnalyzerLanguage = language; - AssemblyPath = assembly; - RequiredFramework = framework; - RuntimeIdentifier = runtimeIdentifier; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryAsset.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryAsset.cs deleted file mode 100644 index 93523331b..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryAsset.cs +++ /dev/null @@ -1,71 +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.PlatformAbstractions; -using Microsoft.DotNet.Internal.ProjectModel.Utilities; - -namespace Microsoft.DotNet.Internal.ProjectModel.Compilation -{ - public struct LibraryAsset - { - public string Name { get; } - public string RelativePath { get; } - public string ResolvedPath { get; } - public string FileName => Path.GetFileName(RelativePath); - public Action Transform { get; set; } - - public LibraryAsset(string name, string relativePath, string resolvedPath, Action transform = null) - { - Name = name; - RelativePath = relativePath; - ResolvedPath = resolvedPath; - Transform = transform; - } - - public bool Equals(LibraryAsset other) - { - return string.Equals(Name, other.Name) - && string.Equals(RelativePath, other.RelativePath) - && string.Equals(ResolvedPath, other.ResolvedPath); - } - - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) return false; - return obj is LibraryAsset && Equals((LibraryAsset) obj); - } - - public override int GetHashCode() - { - var combiner = HashCodeCombiner.Start(); - combiner.Add(Name); - combiner.Add(RelativePath); - combiner.Add(ResolvedPath); - return combiner.CombinedHash; - } - - public static LibraryAsset CreateFromRelativePath(string basePath, string relativePath, Action transform = null) - { - return new LibraryAsset( - Path.GetFileNameWithoutExtension(relativePath), - relativePath, - Path.Combine(basePath, relativePath), - transform); - } - - public static LibraryAsset CreateFromAbsolutePath(string basePath, string absolutePath, Action transform = null) - { - var relativePath = absolutePath.Replace(PathUtility.EnsureTrailingSlash(basePath), string.Empty); - - return new LibraryAsset( - Path.GetFileNameWithoutExtension(relativePath), - relativePath, - absolutePath, - transform); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryAssetExtension.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryAssetExtension.cs deleted file mode 100644 index c9f46e44b..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryAssetExtension.cs +++ /dev/null @@ -1,59 +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.Reflection; - -namespace Microsoft.DotNet.Internal.ProjectModel.Compilation -{ - internal static class LibraryAssetExtensions - { - private const string NativeImageSufix = ".ni"; - - public static AssemblyName GetAssemblyName(this LibraryAsset asset) - { - var name = asset.Name; - if (asset.Name.EndsWith(NativeImageSufix)) - { - name = name.Substring(0, name.Length - NativeImageSufix.Length); - } - - return new AssemblyName(name); - } - - public static string GetTransformedFile(this LibraryAsset asset, string tempLocation, string tempName = null) - { - if (asset.Transform == null) - { - return asset.ResolvedPath; - } - - tempName = tempName ?? Path.GetFileName(asset.RelativePath); - using (var input = File.OpenRead(asset.ResolvedPath)) - { - var transformedName = Path.Combine(tempLocation, tempName); - using (var output = File.OpenWrite(transformedName)) - { - asset.Transform(input, output); - } - return transformedName; - } - } - - public static Stream GetTransformedStream(this LibraryAsset asset) - { - if (asset.Transform == null) - { - return File.OpenRead(asset.ResolvedPath); - } - - using (var input = File.OpenRead(asset.ResolvedPath)) - { - var output = new MemoryStream(); - asset.Transform(input, output); - return output; - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryAssetGroup.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryAssetGroup.cs deleted file mode 100644 index ecbd44ffd..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryAssetGroup.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.Linq; -using System.Collections.Generic; - -namespace Microsoft.DotNet.Internal.ProjectModel.Compilation -{ - internal class LibraryAssetGroup - { - public LibraryAssetGroup(string runtime, params LibraryAsset[] assets) : this(runtime, (IEnumerable)assets) { } - public LibraryAssetGroup(params LibraryAsset[] assets) : this(string.Empty, (IEnumerable)assets) { } - public LibraryAssetGroup(IEnumerable assets) : this(string.Empty, assets) { } - - public LibraryAssetGroup(string runtime, - IEnumerable assets) - { - Runtime = runtime; - Assets = assets.ToArray(); - } - - public string Runtime { get; } - - /// - /// Gets a list of assets provided in this runtime group - /// - public IReadOnlyList Assets { get; } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryExport.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryExport.cs deleted file mode 100644 index 13a0a1388..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryExport.cs +++ /dev/null @@ -1,80 +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.Diagnostics; - -namespace Microsoft.DotNet.Internal.ProjectModel.Compilation -{ - [DebuggerDisplay("{DebuggerDisplay,nq}")] - internal class LibraryExport - { - /// - /// Gets the library that produced this export - /// - public LibraryDescription Library { get; } - - /// - /// Gets a list of MSIL binaries required to run - /// - public IEnumerable RuntimeAssemblyGroups { get; } - - /// - /// Non assembly runtime assets. - /// - public IEnumerable RuntimeAssets { get; } - - /// - /// Gets a list of native binaries required to run - /// - public IEnumerable NativeLibraryGroups { get; } - - /// - /// Gets a list of fully-qualified paths to MSIL metadata references - /// - public IEnumerable CompilationAssemblies { get; } - - /// - /// Get a list of embedded resource files provided by this export. - /// - public IEnumerable EmbeddedResources { get; } - - /// - /// Gets a list of fully-qualified paths to source code file references - /// - public IEnumerable SourceReferences { get; } - - /// - /// Get a list of analyzers provided by this export. - /// - public IEnumerable AnalyzerReferences { get; } - - /// - /// Get a list of resource assemblies provided by this export. - /// - public IEnumerable ResourceAssemblies { get; } - - public LibraryExport(LibraryDescription library, - IEnumerable compileAssemblies, - IEnumerable sourceReferences, - IEnumerable runtimeAssemblyGroups, - IEnumerable runtimeAssets, - IEnumerable nativeLibraryGroups, - IEnumerable embeddedResources, - IEnumerable analyzers, - IEnumerable resourceAssemblies) - { - Library = library; - CompilationAssemblies = compileAssemblies; - SourceReferences = sourceReferences; - RuntimeAssemblyGroups = runtimeAssemblyGroups; - RuntimeAssets = runtimeAssets; - NativeLibraryGroups = nativeLibraryGroups; - EmbeddedResources = embeddedResources; - AnalyzerReferences = analyzers; - ResourceAssemblies = resourceAssemblies; - } - - private string DebuggerDisplay => Library.Identity.ToString(); - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryExportBuilder.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryExportBuilder.cs deleted file mode 100644 index b58782d4f..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryExportBuilder.cs +++ /dev/null @@ -1,191 +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.Internal.ProjectModel.Compilation -{ - internal class LibraryExportBuilder - { - private IList _runtimeAssemblyGroups; - - private IList _runtimeAssets; - - private IList _compilationAssemblies; - - private IList _sourceReferences; - - private IList _nativeLibraryGroups; - - private IList _embeddedResources; - - private IList _analyzerReferences; - - private IList _resourceAssemblies; - - public LibraryDescription Library { get; set; } - - public IEnumerable RuntimeAssemblyGroups => _runtimeAssemblyGroups; - - public IEnumerable RuntimeAssets => _runtimeAssets; - - public IEnumerable CompilationAssemblies => _compilationAssemblies; - - public IEnumerable SourceReferences => _sourceReferences; - - public IEnumerable NativeLibraryGroups => _nativeLibraryGroups; - - public IEnumerable EmbeddedResources => _embeddedResources; - - public IEnumerable AnalyzerReferences => _analyzerReferences; - - public IEnumerable ResourceAssemblies => _resourceAssemblies; - - public static LibraryExportBuilder Create(LibraryDescription library = null) - { - return new LibraryExportBuilder().WithLibrary(library); - } - - public LibraryExport Build() - { - if (Library == null) - { - throw new InvalidOperationException("Cannot build LibraryExport withoud Library set"); - } - return new LibraryExport( - Library, - CompilationAssemblies ?? EmptyArray.Value, - SourceReferences ?? EmptyArray.Value, - RuntimeAssemblyGroups ?? EmptyArray.Value, - RuntimeAssets ?? EmptyArray.Value, - NativeLibraryGroups ?? EmptyArray.Value, - EmbeddedResources ?? EmptyArray.Value, - AnalyzerReferences ?? EmptyArray.Value, - ResourceAssemblies ?? EmptyArray.Value); - } - - public LibraryExportBuilder WithLibrary(LibraryDescription libraryDescription) - { - Library = libraryDescription; - return this; - } - - public LibraryExportBuilder WithRuntimeAssemblyGroups(IEnumerable assets) - { - Replace(ref _runtimeAssemblyGroups, assets); - return this; - } - - public LibraryExportBuilder WithRuntimeAssets(IEnumerable assets) - { - Replace(ref _runtimeAssets, assets); - return this; - } - - public LibraryExportBuilder WithCompilationAssemblies(IEnumerable assets) - { - Replace(ref _compilationAssemblies, assets); - return this; - } - - public LibraryExportBuilder WithSourceReferences(IEnumerable assets) - { - Replace(ref _sourceReferences, assets); - return this; - } - - public LibraryExportBuilder WithNativeLibraryGroups(IEnumerable assets) - { - Replace(ref _nativeLibraryGroups, assets); - return this; - } - - public LibraryExportBuilder WithEmbedddedResources(IEnumerable assets) - { - Replace(ref _embeddedResources, assets); - return this; - } - - public LibraryExportBuilder WithAnalyzerReference(IEnumerable assets) - { - Replace(ref _analyzerReferences, assets); - return this; - } - - public LibraryExportBuilder WithResourceAssemblies(IEnumerable assemblies) - { - Replace(ref _resourceAssemblies, assemblies); - return this; - } - - public LibraryExportBuilder AddRuntimeAssemblyGroup(LibraryAssetGroup asset) - { - Add(ref _runtimeAssemblyGroups, asset); - return this; - } - - public LibraryExportBuilder AddRuntimeAsset(LibraryAsset asset) - { - Add(ref _runtimeAssets, asset); - return this; - } - - public LibraryExportBuilder AddCompilationAssembly(LibraryAsset asset) - { - Add(ref _compilationAssemblies, asset); - return this; - } - - public LibraryExportBuilder AddSourceReference(LibraryAsset asset) - { - Add(ref _sourceReferences, asset); - return this; - } - - public LibraryExportBuilder AddNativeLibraryGroup(LibraryAssetGroup asset) - { - Add(ref _nativeLibraryGroups, asset); - return this; - } - - public LibraryExportBuilder AddEmbedddedResource(LibraryAsset asset) - { - Add(ref _embeddedResources, asset); - return this; - } - - public LibraryExportBuilder AddAnalyzerReference(AnalyzerReference asset) - { - Add(ref _analyzerReferences, asset); - return this; - } - - public LibraryExportBuilder AddResourceAssembly(LibraryResourceAssembly assembly) - { - Add(ref _resourceAssemblies, assembly); - return this; - } - - private void Replace(ref IList list, IEnumerable enumerable) - { - if (enumerable == null) - { - list = null; - } - else - { - list = new List(enumerable); - } - } - - private void Add(ref IList list, T item) - { - if (list == null) - { - list = new List(); - } - list.Add(item); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryExporter.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryExporter.cs deleted file mode 100644 index fa00c6020..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryExporter.cs +++ /dev/null @@ -1,514 +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.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.Internal.ProjectModel.Compilation -{ - internal class LibraryExporter - { - private readonly string _configuration; - private readonly string _runtime; - private readonly string[] _runtimeFallbacks; - private readonly ProjectDescription _rootProject; - private readonly string _buildBasePath; - private readonly string _solutionRootPath; - - public LibraryExporter(ProjectDescription rootProject, - LibraryManager manager, - string configuration, - string runtime, - string[] runtimeFallbacks, - string buildBasePath, - string solutionRootPath) - { - if (string.IsNullOrEmpty(configuration)) - { - throw new ArgumentNullException(nameof(configuration)); - } - - LibraryManager = manager; - _configuration = configuration; - _runtime = runtime; - _runtimeFallbacks = runtimeFallbacks; - _buildBasePath = buildBasePath; - _solutionRootPath = solutionRootPath; - _rootProject = rootProject; - } - - public LibraryManager LibraryManager { get; } - - /// - /// Gets all the exports specified by this project, including the root project itself - /// - public IEnumerable GetAllExports() - { - return ExportLibraries(_ => true); - } - - /// - /// Gets all exports required by the project, NOT including the project itself - /// - /// - public IEnumerable GetDependencies() - { - return GetDependencies(null); - } - - /// - /// Gets all exports required by the project, of the specified , NOT including the project itself - /// - /// - public IEnumerable GetDependencies(LibraryType? type) - { - // Export all but the main project - return ExportLibraries(library => - library != _rootProject && - LibraryIsOfType(type, library)); - } - - /// - /// Retrieves a list of objects representing the assets - /// required from other libraries to compile this project. - /// - private IEnumerable ExportLibraries(Func condition) - { - var seenMetadataReferences = new HashSet(); - - // Iterate over libraries in the library manager - foreach (var library in LibraryManager.GetLibraries()) - { - if (!condition(library)) - { - continue; - } - - var compilationAssemblies = new List(); - var sourceReferences = new List(); - var analyzerReferences = new List(); - var libraryExport = GetExport(library); - - // We need to filter out source references from non-root libraries, - // so we rebuild the library export - foreach (var reference in libraryExport.CompilationAssemblies) - { - if (seenMetadataReferences.Add(reference.Name)) - { - compilationAssemblies.Add(reference); - } - } - - // Source and analyzer references are not transitive - if (library.Parents.Contains(_rootProject)) - { - sourceReferences.AddRange(libraryExport.SourceReferences); - analyzerReferences.AddRange(libraryExport.AnalyzerReferences); - } - - var builder = LibraryExportBuilder.Create(library); - if (_runtime != null && _runtimeFallbacks != null) - { - // For portable apps that are built with runtime trimming we replace RuntimeAssemblyGroups and NativeLibraryGroups - // with single default group that contains asset specific to runtime we are trimming for - // based on runtime fallback list - builder.WithRuntimeAssemblyGroups(TrimAssetGroups(libraryExport.RuntimeAssemblyGroups, _runtimeFallbacks)); - builder.WithNativeLibraryGroups(TrimAssetGroups(libraryExport.NativeLibraryGroups, _runtimeFallbacks)); - } - else - { - builder.WithRuntimeAssemblyGroups(libraryExport.RuntimeAssemblyGroups); - builder.WithNativeLibraryGroups(libraryExport.NativeLibraryGroups); - } - - yield return builder - .WithCompilationAssemblies(compilationAssemblies) - .WithSourceReferences(sourceReferences) - .WithRuntimeAssets(libraryExport.RuntimeAssets) - .WithEmbedddedResources(libraryExport.EmbeddedResources) - .WithAnalyzerReference(analyzerReferences) - .WithResourceAssemblies(libraryExport.ResourceAssemblies) - .Build(); - } - } - - private IEnumerable TrimAssetGroups(IEnumerable runtimeAssemblyGroups, - string[] runtimeFallbacks) - { - LibraryAssetGroup runtimeAssets; - foreach (var rid in runtimeFallbacks) - { - runtimeAssets = runtimeAssemblyGroups.GetRuntimeGroup(rid); - if (runtimeAssets != null) - { - yield return new LibraryAssetGroup(runtimeAssets.Assets); - yield break; - } - } - - runtimeAssets = runtimeAssemblyGroups.GetDefaultGroup(); - if (runtimeAssets != null) - { - yield return runtimeAssets; - } - } - - /// - /// Create a LibraryExport from LibraryDescription. - /// - /// When the library is not resolved the LibraryExport is created nevertheless. - /// - private LibraryExport GetExport(LibraryDescription library) - { - if (!library.Resolved) - { - // For a unresolved project reference returns a export with empty asset. - return LibraryExportBuilder.Create(library).Build(); - } - - var libraryType = library.Identity.Type; - if (library is TargetLibraryWithAssets) - { - return ExportPackage((TargetLibraryWithAssets)library); - } - else if (Equals(LibraryType.Project, libraryType)) - { - return ExportProject((ProjectDescription)library); - } - else - { - return ExportFrameworkLibrary(library); - } - } - - private LibraryExport ExportPackage(TargetLibraryWithAssets library) - { - var builder = LibraryExportBuilder.Create(library); - builder.AddNativeLibraryGroup(new LibraryAssetGroup(PopulateAssets(library, library.NativeLibraries))); - builder.AddRuntimeAssemblyGroup(new LibraryAssetGroup(PopulateAssets(library, library.RuntimeAssemblies))); - builder.WithResourceAssemblies(PopulateResources(library, library.ResourceAssemblies)); - builder.WithCompilationAssemblies(PopulateAssets(library, library.CompileTimeAssemblies)); - - if (library.Identity.Type.Equals(LibraryType.Package)) - { - builder.WithSourceReferences(GetSharedSources((PackageDescription) library)); - builder.WithAnalyzerReference(GetAnalyzerReferences((PackageDescription) library)); - } - - if (library.ContentFiles.Any()) - { - var parameters = PPFileParameters.CreateForProject(_rootProject.Project); - Action transform = (input, output) => PPFilePreprocessor.Preprocess(input, output, parameters); - - var sourceCodeLanguage = _rootProject.Project.GetSourceCodeLanguage(); - var languageGroups = library.ContentFiles.GroupBy(file => file.CodeLanguage); - - var selectedGroup = languageGroups.FirstOrDefault(g => g.Key == sourceCodeLanguage) ?? - languageGroups.FirstOrDefault(g => g.Key == "any") ?? - languageGroups.FirstOrDefault(g => g.Key == null); - if (selectedGroup != null) - { - foreach (var contentFile in selectedGroup) - { - if (contentFile.CodeLanguage != null && - contentFile.CodeLanguage != "any" && - string.Compare(contentFile.CodeLanguage, sourceCodeLanguage, StringComparison.OrdinalIgnoreCase) != 0) - { - continue; - } - - var fileTransform = contentFile.PPOutputPath != null ? transform : null; - - var fullPath = Path.Combine(library.Path, contentFile.Path); - if (contentFile.BuildAction == BuildAction.Compile) - { - builder.AddSourceReference(LibraryAsset.CreateFromRelativePath(library.Path, contentFile.Path, fileTransform)); - } - else if (contentFile.BuildAction == BuildAction.EmbeddedResource) - { - builder.AddEmbedddedResource(LibraryAsset.CreateFromRelativePath(library.Path, contentFile.Path, fileTransform)); - } - if (contentFile.CopyToOutput) - { - builder.AddRuntimeAsset(new LibraryAsset(contentFile.Path, contentFile.OutputPath, fullPath, fileTransform)); - } - } - } - } - if (library.RuntimeTargets.Any()) - { - foreach (var targetGroup in library.RuntimeTargets.GroupBy(t => t.Runtime)) - { - var runtime = new List(); - var native = new List(); - - foreach (var lockFileRuntimeTarget in targetGroup) - { - if (string.Equals(lockFileRuntimeTarget.AssetType, "native", StringComparison.OrdinalIgnoreCase)) - { - native.Add(LibraryAsset.CreateFromRelativePath(library.Path, lockFileRuntimeTarget.Path)); - } - else if (string.Equals(lockFileRuntimeTarget.AssetType, "runtime", StringComparison.OrdinalIgnoreCase)) - { - runtime.Add(LibraryAsset.CreateFromRelativePath(library.Path, lockFileRuntimeTarget.Path)); - } - } - - if (runtime.Any()) - { - builder.AddRuntimeAssemblyGroup(new LibraryAssetGroup(targetGroup.Key, runtime.Where(a => !PackageDependencyProvider.IsPlaceholderFile(a.RelativePath)))); - } - - if (native.Any()) - { - builder.AddNativeLibraryGroup(new LibraryAssetGroup(targetGroup.Key, native.Where(a => !PackageDependencyProvider.IsPlaceholderFile(a.RelativePath)))); - } - } - } - - return builder.Build(); - } - - private LibraryExport ExportProject(ProjectDescription project) - { - var builder = LibraryExportBuilder.Create(project); - var compilerOptions = project.Project.GetCompilerOptions(project.TargetFrameworkInfo.FrameworkName, _configuration); - - if (!string.IsNullOrEmpty(project.TargetFrameworkInfo?.AssemblyPath)) - { - // Project specifies a pre-compiled binary. We're done! - var assemblyPath = ResolvePath(project.Project, _configuration, project.TargetFrameworkInfo.AssemblyPath); - var pdbPath = Path.ChangeExtension(assemblyPath, "pdb"); - - var compileAsset = new LibraryAsset( - project.Project.Name, - Path.GetFileName(assemblyPath), - assemblyPath); - - builder.AddCompilationAssembly(compileAsset); - builder.AddRuntimeAssemblyGroup(new LibraryAssetGroup(new[] { compileAsset })); - if (File.Exists(pdbPath)) - { - builder.AddRuntimeAsset(new LibraryAsset(Path.GetFileName(pdbPath), Path.GetFileName(pdbPath), pdbPath)); - } - } - else if (HasSourceFiles(project, compilerOptions)) - { - var outputPaths = project.GetOutputPaths(_buildBasePath, _solutionRootPath, _configuration, _runtime); - - var compilationAssembly = outputPaths.CompilationFiles.Assembly; - var compilationAssemblyAsset = LibraryAsset.CreateFromAbsolutePath( - outputPaths.CompilationFiles.BasePath, - compilationAssembly); - - builder.AddCompilationAssembly(compilationAssemblyAsset); - - if (ExportsRuntime(project)) - { - var runtimeAssemblyAsset = LibraryAsset.CreateFromAbsolutePath( - outputPaths.RuntimeFiles.BasePath, - outputPaths.RuntimeFiles.Assembly); - - builder.AddRuntimeAssemblyGroup(new LibraryAssetGroup(new[] { runtimeAssemblyAsset })); - builder.WithRuntimeAssets(CollectAssets(outputPaths.RuntimeFiles)); - } - else - { - builder.AddRuntimeAssemblyGroup(new LibraryAssetGroup(new[] { compilationAssemblyAsset })); - builder.WithRuntimeAssets(CollectAssets(outputPaths.CompilationFiles)); - } - - builder.WithResourceAssemblies(outputPaths.CompilationFiles.Resources().Select(r => new LibraryResourceAssembly( - LibraryAsset.CreateFromAbsolutePath(outputPaths.CompilationFiles.BasePath, r.Path), - r.Locale))); - } - - builder.WithSourceReferences(project.Project.Files.SharedFiles.Select(f => - LibraryAsset.CreateFromAbsolutePath(project.Path, f) - )); - - return builder.Build(); - } - - private bool HasSourceFiles(ProjectDescription project, CommonCompilerOptions compilerOptions) - { - if (compilerOptions.CompileInclude == null) - { - return project.Project.Files.SourceFiles.Any(); - } - - var includeFiles = IncludeFilesResolver.GetIncludeFiles(compilerOptions.CompileInclude, "/", diagnostics: null); - - return includeFiles.Any(); - } - - private IEnumerable CollectAssets(CompilationOutputFiles files) - { - var assemblyPath = files.Assembly; - foreach (var path in files.All().Except(files.Resources().Select(r => r.Path))) - { - if (string.Equals(assemblyPath, path)) - { - continue; - } - yield return LibraryAsset.CreateFromAbsolutePath(files.BasePath, path); - } - } - - private bool ExportsRuntime(ProjectDescription project) - { - return project == _rootProject && - !string.IsNullOrWhiteSpace(_runtime) && - project.Project.HasRuntimeOutput(_configuration); - } - - private static string ResolvePath(Project project, string configuration, string path) - { - if (string.IsNullOrEmpty(path)) - { - return null; - } - - path = PathUtility.GetPathWithDirectorySeparator(path); - - path = path.Replace("{configuration}", configuration); - - return Path.Combine(project.ProjectDirectory, path); - } - - private LibraryExport ExportFrameworkLibrary(LibraryDescription library) - { - // We assume the path is to an assembly. Framework libraries only export compile-time stuff - // since they assume the runtime library is present already - var builder = LibraryExportBuilder.Create(library); - if (!string.IsNullOrEmpty(library.Path)) - { - builder.WithCompilationAssemblies(new[] - { - new LibraryAsset(library.Identity.Name, null, library.Path) - }); - } - return builder.Build(); - } - - private IEnumerable GetSharedSources(PackageDescription package) - { - return package - .PackageLibrary - .Files - .Select(f => PathUtility.GetPathWithDirectorySeparator(f)) - .Where(path => path.StartsWith("shared" + Path.DirectorySeparatorChar)) - .Select(path => LibraryAsset.CreateFromRelativePath(package.Path, path)); - } - - private IEnumerable GetAnalyzerReferences(PackageDescription package) - { - var analyzers = package - .PackageLibrary - .Files - .Select(f => PathUtility.GetPathWithDirectorySeparator(f)) - .Where(path => path.StartsWith("analyzers" + Path.DirectorySeparatorChar) && - path.EndsWith(".dll")); - - - var analyzerRefs = new List(); - - // See https://docs.nuget.org/create/analyzers-conventions for the analyzer - // NuGet specification - foreach (var analyzer in analyzers) - { - var specifiers = analyzer.Split(Path.DirectorySeparatorChar); - - var assemblyPath = Path.Combine(package.Path, analyzer); - - // $/analyzers/{Framework Name}{Version}/{Supported Architecture}/{Supported Programming Language}/{Analyzer}.dll - switch (specifiers.Length) - { - // $/analyzers/{analyzer}.dll - case 2: - analyzerRefs.Add(new AnalyzerReference( - assembly: assemblyPath, - framework: null, - language: null, - runtimeIdentifier: null - )); - break; - - // $/analyzers/{framework}/{analyzer}.dll - case 3: - analyzerRefs.Add(new AnalyzerReference( - assembly: assemblyPath, - framework: NuGetFramework.Parse(specifiers[1]), - language: null, - runtimeIdentifier: null - )); - break; - - // $/analyzers/{framework}/{language}/{analyzer}.dll - case 4: - analyzerRefs.Add(new AnalyzerReference( - assembly: assemblyPath, - framework: NuGetFramework.Parse(specifiers[1]), - language: specifiers[2], - runtimeIdentifier: null - )); - break; - - // $/analyzers/{framework}/{runtime}/{language}/{analyzer}.dll - case 5: - analyzerRefs.Add(new AnalyzerReference( - assembly: assemblyPath, - framework: NuGetFramework.Parse(specifiers[1]), - language: specifiers[3], - runtimeIdentifier: specifiers[2] - )); - break; - - // Anything less than 2 specifiers or more than 4 is - // illegal according to the specification and will be - // ignored - } - } - return analyzerRefs; - } - - private IEnumerable PopulateResources(TargetLibraryWithAssets library, IEnumerable section) - { - foreach (var assemblyPath in section.Where(a => !PackageDependencyProvider.IsPlaceholderFile(a.Path))) - { - string locale; - if(!assemblyPath.Properties.TryGetValue(Constants.LocaleLockFilePropertyName, out locale)) - { - locale = null; - } - yield return new LibraryResourceAssembly( - LibraryAsset.CreateFromRelativePath(library.Path, assemblyPath.Path), - locale); - } - } - - private IEnumerable PopulateAssets(TargetLibraryWithAssets library, IEnumerable section) - { - foreach (var assemblyPath in section.Where(a => !PackageDependencyProvider.IsPlaceholderFile(a.Path))) - { - yield return LibraryAsset.CreateFromRelativePath(library.Path, assemblyPath.Path); - } - } - - private static bool LibraryIsOfType(LibraryType? type, LibraryDescription library) - { - return type == null || // No type filter was requested - library.Identity.Type.Equals(type); // OR, library type matches requested type - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryResourceAssembly.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryResourceAssembly.cs deleted file mode 100644 index 23815fd93..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/LibraryResourceAssembly.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.Internal.ProjectModel.Compilation -{ - internal class LibraryResourceAssembly - { - public LibraryResourceAssembly(LibraryAsset asset, string locale) - { - Asset = asset; - Locale = locale; - } - - public LibraryAsset Asset { get; } - - public string Locale { get; } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/Preprocessor/PPFileParameters.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/Preprocessor/PPFileParameters.cs deleted file mode 100644 index 25f9e2953..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/Preprocessor/PPFileParameters.cs +++ /dev/null @@ -1,22 +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.Threading.Tasks; - -namespace Microsoft.DotNet.Internal.ProjectModel.Compilation.Preprocessor -{ - internal class PPFileParameters - { - public static IDictionary CreateForProject(Project project) - { - return new Dictionary() - { - {"rootnamespace", project.Name }, - {"assemblyname", project.Name } - }; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/Preprocessor/PPFilePreprocessor.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/Preprocessor/PPFilePreprocessor.cs deleted file mode 100644 index ebbf4d735..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/Preprocessor/PPFilePreprocessor.cs +++ /dev/null @@ -1,53 +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; - -namespace Microsoft.DotNet.Tools.Compiler -{ - internal class PPFilePreprocessor - { - public static void Preprocess(Stream input, Stream output, IDictionary parameters) - { - string text; - using (var streamReader = new StreamReader(input)) - { - text = streamReader.ReadToEnd(); - } - var tokenizer = new PPFileTokenizer(text); - using (var streamWriter = new StreamWriter(output)) - { - while (true) - { - var token = tokenizer.Read(); - if (token == null) - { - break; - } - - if (token.Category == PPFileTokenizer.TokenCategory.Variable) - { - var replaced = ReplaceToken(token.Value, parameters); - streamWriter.Write(replaced); - } - else - { - streamWriter.Write(token.Value); - } - } - } - } - - private static string ReplaceToken(string name, IDictionary parameters) - { - string value; - if (!parameters.TryGetValue(name, out value)) - { - throw new InvalidOperationException($"The replacement token '{name}' has no value."); - } - return value; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/Preprocessor/PPFileTokenizer.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/Preprocessor/PPFileTokenizer.cs deleted file mode 100644 index 1bbfbe212..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Compilation/Preprocessor/PPFileTokenizer.cs +++ /dev/null @@ -1,124 +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.Globalization; -using System.Text; - -namespace Microsoft.DotNet.Tools.Compiler -{ - internal class PPFileTokenizer - { - private readonly string _text; - private int _index; - - public PPFileTokenizer(string text) - { - _text = text; - _index = 0; - } - - /// - /// Gets the next token. - /// - /// The parsed token. Or null if no more tokens are available. - public Token Read() - { - if (_index >= _text.Length) - { - return null; - } - - if (_text[_index] == '$') - { - _index++; - return ParseTokenAfterDollarSign(); - } - return ParseText(); - } - - private static bool IsWordChar(char ch) - { - // See http://msdn.microsoft.com/en-us/library/20bw873z.aspx#WordCharacter - var c = CharUnicodeInfo.GetUnicodeCategory(ch); - return c == UnicodeCategory.LowercaseLetter || - c == UnicodeCategory.UppercaseLetter || - c == UnicodeCategory.TitlecaseLetter || - c == UnicodeCategory.OtherLetter || - c == UnicodeCategory.ModifierLetter || - c == UnicodeCategory.DecimalDigitNumber || - c == UnicodeCategory.ConnectorPunctuation; - } - - // Parses and returns the next token after a $ is just read. - // _index is one char after the $. - private Token ParseTokenAfterDollarSign() - { - var sb = new StringBuilder(); - while (_index < _text.Length) - { - var ch = _text[_index]; - if (ch == '$') - { - ++_index; - if (sb.Length == 0) - { - // escape sequence "$$" is encountered - return new Token(TokenCategory.Text, "$"); - } - // matching $ is read. So the token is a variable. - return new Token(TokenCategory.Variable, sb.ToString()); - } - if (IsWordChar(ch)) - { - sb.Append(ch); - ++_index; - } - else - { - // non word char encountered. So the current token - // is not a variable after all. - sb.Insert(0, '$'); - sb.Append(ch); - ++_index; - return new Token(TokenCategory.Text, sb.ToString()); - } - } - - // no matching $ is found and the end of text is reached. - // So the current token is a text. - sb.Insert(0, '$'); - return new Token(TokenCategory.Text, sb.ToString()); - } - - private Token ParseText() - { - var sb = new StringBuilder(); - while (_index < _text.Length - && _text[_index] != '$') - { - sb.Append(_text[_index]); - _index++; - } - - return new Token(TokenCategory.Text, sb.ToString()); - } - - internal class Token - { - public string Value { get; private set; } - public TokenCategory Category { get; private set; } - - public Token(TokenCategory category, string value) - { - Category = category; - Value = value; - } - } - - public enum TokenCategory - { - Text, - Variable - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/CompilationOutputFiles.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/CompilationOutputFiles.cs deleted file mode 100644 index 0610ae1d3..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/CompilationOutputFiles.cs +++ /dev/null @@ -1,104 +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.IO; -using System.Linq; -using Microsoft.DotNet.Internal.ProjectModel.Files; -using Microsoft.DotNet.Internal.ProjectModel.Resources; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal class CompilationOutputFiles - { - protected readonly Project Project; - protected readonly string Configuration; - protected readonly NuGetFramework Framework; - - public CompilationOutputFiles( - string basePath, - Project project, - string configuration, - NuGetFramework framework) - { - BasePath = basePath; - Project = project; - Configuration = configuration; - Framework = framework; - OutputExtension = FileNameSuffixes.DotNet.DynamicLib; - - var compilerOptions = Project.GetCompilerOptions(framework, configuration); - if (framework.IsDesktop() && compilerOptions.EmitEntryPoint.GetValueOrDefault()) - { - OutputExtension = FileNameSuffixes.DotNet.Exe; - } - } - - public string BasePath { get; } - - public string Assembly - { - get - { - var compilerOptions = Project.GetCompilerOptions(Framework, Configuration); - - return Path.Combine(BasePath, compilerOptions.OutputName + OutputExtension); - } - } - - public string PdbPath - { - get - { - return Path.ChangeExtension(Assembly, FileNameSuffixes.CurrentPlatform.ProgramDatabase); - } - } - - public string OutputExtension { get; } - - public virtual IEnumerable Resources() - { - var resourceCultureNames = GetResourceFiles() - .Select(f => ResourceUtility.GetResourceCultureName(f)) - .Where(f => !string.IsNullOrEmpty(f)) - .Distinct(); - - foreach (var resourceCultureName in resourceCultureNames) - { - yield return new ResourceFile( - Path.Combine( - BasePath, resourceCultureName, Project.Name + ".resources" + FileNameSuffixes.DotNet.DynamicLib), - resourceCultureName); - } - } - - public virtual IEnumerable All() - { - yield return Assembly; - yield return PdbPath; - var compilerOptions = Project.GetCompilerOptions(Framework, Configuration); - if (compilerOptions.GenerateXmlDocumentation == true) - { - yield return Path.ChangeExtension(Assembly, "xml"); - } - foreach (var resource in Resources()) - { - yield return resource.Path; - } - } - - private IEnumerable GetResourceFiles() - { - var compilerOptions = Project.GetCompilerOptions(Framework, Configuration); - if (compilerOptions.EmbedInclude == null) - { - return Project.Files.ResourceFiles.Keys; - } - - var includeFiles = IncludeFilesResolver.GetIncludeFiles(compilerOptions.EmbedInclude, "/", diagnostics: null); - - return includeFiles.Select(f => f.SourcePath); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Constants.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Constants.cs deleted file mode 100644 index 3175fcbf4..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Constants.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; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal static class Constants - { - public static readonly string DefaultOutputDirectory = "bin"; - public static readonly string DefaultConfiguration = "Debug"; - - public static readonly string LocaleLockFilePropertyName = "locale"; - - public static readonly Version Version50 = new Version(5, 0); - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DependencyContextBuilder.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DependencyContextBuilder.cs deleted file mode 100644 index bf339806a..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DependencyContextBuilder.cs +++ /dev/null @@ -1,240 +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.Security.Cryptography; -using System.Text; -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 -{ - internal class DependencyContextBuilder - { - private readonly string _referenceAssembliesPath; - - public DependencyContextBuilder() : this(FrameworkReferenceResolver.Default.ReferenceAssembliesPath) - { - } - - public DependencyContextBuilder(string referenceAssembliesPath) - { - _referenceAssembliesPath = referenceAssembliesPath; - } - - public DependencyContext Build(CommonCompilerOptions compilerOptions, - IEnumerable compilationExports, - IEnumerable runtimeExports, - bool portable, - NuGetFramework target, - string runtime) - { - if (compilationExports == null) - { - compilationExports = Enumerable.Empty(); - } - - var dependencyLookup = compilationExports - .Concat(runtimeExports) - .Select(export => export.Library.Identity) - .Distinct() - .Select(identity => new Dependency(identity.Name, identity.Version.ToString())) - .ToDictionary(dependency => dependency.Name, StringComparer.OrdinalIgnoreCase); - - var compilationOptions = compilerOptions != null - ? GetCompilationOptions(compilerOptions) - : CompilationOptions.Default; - - var runtimeSignature = GenerateRuntimeSignature(runtimeExports); - - return new DependencyContext( - new TargetInfo(target.DotNetFrameworkName, runtime, runtimeSignature, portable), - compilationOptions, - GetLibraries(compilationExports, dependencyLookup, runtime: false).Cast(), - GetLibraries(runtimeExports, dependencyLookup, runtime: true).Cast(), - new RuntimeFallbacks[] {}); - } - - private static string GenerateRuntimeSignature(IEnumerable runtimeExports) - { - var sha1 = SHA1.Create(); - var builder = new StringBuilder(); - var packages = runtimeExports - .Where(libraryExport => libraryExport.Library.Identity.Type == LibraryType.Package); - var seperator = "|"; - foreach (var libraryExport in packages) - { - builder.Append(libraryExport.Library.Identity.Name); - builder.Append(seperator); - builder.Append(libraryExport.Library.Identity.Version.ToString()); - builder.Append(seperator); - } - var hash = sha1.ComputeHash(Encoding.UTF8.GetBytes(builder.ToString())); - - builder.Clear(); - foreach (var b in hash) - { - builder.AppendFormat("{0:x2}", b); - } - return builder.ToString(); - } - - private static CompilationOptions GetCompilationOptions(CommonCompilerOptions compilerOptions) - { - return new CompilationOptions(compilerOptions.Defines, - compilerOptions.LanguageVersion, - compilerOptions.Platform, - compilerOptions.AllowUnsafe, - compilerOptions.WarningsAsErrors, - compilerOptions.Optimize, - compilerOptions.KeyFile, - compilerOptions.DelaySign, - compilerOptions.PublicSign, - compilerOptions.DebugType, - compilerOptions.EmitEntryPoint, - compilerOptions.GenerateXmlDocumentation); - } - - private IEnumerable GetLibraries(IEnumerable exports, - IDictionary dependencyLookup, - bool runtime) - { - return exports.Select(export => GetLibrary(export, runtime, dependencyLookup)); - } - - private Library GetLibrary(LibraryExport export, - bool runtime, - IDictionary dependencyLookup) - { - var type = export.Library.Identity.Type; - - // TEMPORARY: All packages are serviceable in RC2 - // See https://github.com/dotnet/cli/issues/2569 - var serviceable = (export.Library as PackageDescription) != null; - var libraryDependencies = new HashSet(); - - foreach (var libraryDependency in export.Library.Dependencies) - { - // skip build time dependencies - if (libraryDependency.Type.Equals(LibraryDependencyType.Build)) - { - continue; - } - - Dependency dependency; - if (dependencyLookup.TryGetValue(libraryDependency.Name, out dependency)) - { - libraryDependencies.Add(dependency); - } - } - - if (runtime) - { - return new RuntimeLibrary( - type.ToString().ToLowerInvariant(), - export.Library.Identity.Name, - export.Library.Identity.Version.ToString(), - export.Library.Hash, - export.RuntimeAssemblyGroups.Select(CreateRuntimeAssetGroup).ToArray(), - export.NativeLibraryGroups.Select(CreateRuntimeAssetGroup).ToArray(), - export.ResourceAssemblies.Select(CreateResourceAssembly), - libraryDependencies, - serviceable, - GetLibraryPath(export.Library), - GetLibraryHashPath(export.Library)); - } - else - { - IEnumerable assemblies; - if (type == LibraryType.Reference) - { - assemblies = ResolveReferenceAssembliesPath(export.CompilationAssemblies); - } - else - { - assemblies = export.CompilationAssemblies.Select(libraryAsset => libraryAsset.RelativePath); - } - - return new CompilationLibrary( - type.ToString().ToLowerInvariant(), - export.Library.Identity.Name, - export.Library.Identity.Version.ToString(), - export.Library.Hash, - assemblies, - libraryDependencies, - serviceable, - GetLibraryPath(export.Library), - GetLibraryHashPath(export.Library)); - } - } - - private string GetLibraryPath(LibraryDescription description) - { - var packageDescription = description as PackageDescription; - - if (packageDescription != null) - { - // This is the relative path appended to a NuGet packages directory to find the directory containing - // the package assets. This string should only be mastered by NuGet. - return packageDescription.PackageLibrary?.Path; - } - - return null; - } - - private string GetLibraryHashPath(LibraryDescription description) - { - var packageDescription = description as PackageDescription; - - if (packageDescription != null) - { - // This hash path appended to the package path (much like package assets). This string should only be - // mastered by NuGet. - return packageDescription.HashPath; - } - - return null; - } - - private RuntimeAssetGroup CreateRuntimeAssetGroup(LibraryAssetGroup libraryAssetGroup) - { - return new RuntimeAssetGroup( - libraryAssetGroup.Runtime, - libraryAssetGroup.Assets.Select(a => a.RelativePath)); - } - - private ResourceAssembly CreateResourceAssembly(LibraryResourceAssembly resourceAssembly) - { - return new ResourceAssembly( - path: resourceAssembly.Asset.RelativePath, - locale: resourceAssembly.Locale - ); - } - - private IEnumerable ResolveReferenceAssembliesPath(IEnumerable libraryAssets) - { - var referenceAssembliesPath = - PathUtility.EnsureTrailingSlash(_referenceAssembliesPath); - foreach (var libraryAsset in libraryAssets) - { - // If resolved path is under ReferenceAssembliesPath store it as a relative to it - // if not, save only assembly name and try to find it somehow later - if (libraryAsset.ResolvedPath.StartsWith(referenceAssembliesPath)) - { - yield return libraryAsset.ResolvedPath.Substring(referenceAssembliesPath.Length); - } - else - { - yield return Path.GetFileName(libraryAsset.ResolvedPath); - } - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DesignTimeWorkspace.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DesignTimeWorkspace.cs deleted file mode 100644 index 9c10b0514..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DesignTimeWorkspace.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.Collections.Generic; -using System.IO; -using System.Linq; -using NuGet.LibraryModel; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal class DesignTimeWorkspace : Workspace - { - private readonly HashSet _projects = new HashSet(StringComparer.OrdinalIgnoreCase); - - private bool _needRefresh; - - public DesignTimeWorkspace(ProjectReaderSettings settings) : base(settings, true) { } - - public void AddProject(string path) - { - var projectPath = ProjectPathHelper.NormalizeProjectDirectoryPath(path); - - if (projectPath != null) - { - _needRefresh = _projects.Add(path); - } - } - - public void RemoveProject(string path) - { - _needRefresh = _projects.Remove(path); - } - - /// - /// Refresh all cached projects in the Workspace - /// - public void Refresh() - { - if (!_needRefresh) - { - return; - } - - var basePaths = new List(_projects); - _projects.Clear(); - - foreach (var projectDirectory in basePaths) - { - var project = GetProject(projectDirectory); - if (project == null) - { - continue; - } - - _projects.Add(project.ProjectDirectory); - - foreach (var projectContext in GetProjectContextCollection(project.ProjectDirectory).ProjectContexts) - { - foreach (var reference in GetProjectReferences(projectContext)) - { - var referencedProject = GetProject(reference.Path); - if (referencedProject != null) - { - _projects.Add(referencedProject.ProjectDirectory); - } - } - } - } - - _needRefresh = false; - } - - protected override IEnumerable BuildProjectContexts(Project project) - { - foreach (var framework in project.GetTargetFrameworks()) - { - yield return CreateBaseProjectBuilder(project) - .AsDesignTime() - .WithTargetFramework(framework.FrameworkName) - .Build(); - } - } - - private static List ResolveProjectPath(string projectPath) - { - if (File.Exists(projectPath)) - { - var filename = Path.GetFileName(projectPath); - if (!Project.FileName.Equals(filename, StringComparison.OrdinalIgnoreCase) && - !GlobalSettings.FileName.Equals(filename, StringComparison.OrdinalIgnoreCase)) - { - return null; - } - - projectPath = Path.GetDirectoryName(projectPath); - } - - if (File.Exists(Path.Combine(projectPath, Project.FileName))) - { - return new List { projectPath }; - } - - if (File.Exists(Path.Combine(projectPath, GlobalSettings.FileName))) - { - var root = ProjectRootResolver.ResolveRootDirectory(projectPath); - GlobalSettings globalSettings; - if (GlobalSettings.TryGetGlobalSettings(projectPath, out globalSettings)) - { - return globalSettings.ProjectSearchPaths - .Select(searchPath => Path.Combine(globalSettings.DirectoryPath, searchPath)) - .Where(actualPath => Directory.Exists(actualPath)) - .SelectMany(actualPath => Directory.GetDirectories(actualPath)) - .Where(actualPath => File.Exists(Path.Combine(actualPath, Project.FileName))) - .Select(path => Path.GetFullPath(path)) - .Distinct(StringComparer.OrdinalIgnoreCase) - .ToList(); - } - } - - return null; - } - - private static IEnumerable GetProjectReferences(ProjectContext context) - { - var projectDescriptions = context.LibraryManager - .GetLibraries() - .Where(lib => lib.Identity.Type == LibraryType.Project) - .OfType(); - - foreach (var description in projectDescriptions) - { - if (description.Identity.Name == context.ProjectFile.Name) - { - continue; - } - - // if this is an assembly reference then don't threat it as project reference - if (!string.IsNullOrEmpty(description.TargetFrameworkInfo?.AssemblyPath)) - { - continue; - } - - yield return description; - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DiagnosticMessage.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DiagnosticMessage.cs deleted file mode 100644 index c533a3e27..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DiagnosticMessage.cs +++ /dev/null @@ -1,132 +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.Internal.ProjectModel -{ - /// - /// Represents a single diagnostic message, such as a compilation error or a project.json parsing error. - /// - internal class DiagnosticMessage - { - public DiagnosticMessage(string errorCode, string message, string filePath, DiagnosticMessageSeverity severity) - : this(errorCode, message, filePath, severity, startLine: 1, startColumn: 0) - { } - - public DiagnosticMessage(string errorCode, string message, string filePath, DiagnosticMessageSeverity severity, int startLine, int startColumn) - : this( - errorCode, - message, - $"{filePath}({startLine},{startColumn}): {severity.ToString().ToLowerInvariant()} {errorCode}: {message}", - filePath, - severity, - startLine, - startColumn, - endLine: startLine, - endColumn: startColumn, - source: null) - { } - - public DiagnosticMessage(string errorCode, string message, string filePath, DiagnosticMessageSeverity severity, int startLine, int startColumn, LibraryDescription source) - : this( - errorCode, - message, - $"{filePath}({startLine},{startColumn}): {severity.ToString().ToLowerInvariant()} {errorCode}: {message}", - filePath, - severity, - startLine, - startColumn, - endLine: startLine, - endColumn: startColumn, - source: source) - { } - - public DiagnosticMessage(string errorCode, string message, string formattedMessage, string filePath, - DiagnosticMessageSeverity severity, int startLine, int startColumn, int endLine, int endColumn) - : this(errorCode, - message, - formattedMessage, - filePath, - severity, - startLine, - startColumn, - endLine, - endColumn, - source: null) - { - } - - public DiagnosticMessage( - string errorCode, - string message, - string formattedMessage, - string filePath, - DiagnosticMessageSeverity severity, - int startLine, - int startColumn, - int endLine, - int endColumn, - LibraryDescription source) - { - ErrorCode = errorCode; - Message = message; - SourceFilePath = filePath; - Severity = severity; - StartLine = startLine; - EndLine = endLine; - StartColumn = startColumn; - EndColumn = endColumn; - FormattedMessage = formattedMessage; - Source = source; - } - - /// - /// The moniker associated with the error message - /// - public string ErrorCode { get; } - - /// - /// Path of the file that produced the message. - /// - public string SourceFilePath { get; } - - /// - /// Gets the error message. - /// - public string Message { get; } - - /// - /// Gets the . - /// - public DiagnosticMessageSeverity Severity { get; } - - /// - /// Gets the one-based line index for the start of the compilation error. - /// - public int StartLine { get; } - - /// - /// Gets the zero-based column index for the start of the compilation error. - /// - public int StartColumn { get; } - - /// - /// Gets the one-based line index for the end of the compilation error. - /// - public int EndLine { get; } - - /// - /// Gets the zero-based column index for the end of the compilation error. - /// - public int EndColumn { get; } - - /// - /// Gets the formatted error message. - /// - public string FormattedMessage { get; } - - /// - /// Gets the source of this message - /// - public LibraryDescription Source { get; } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DiagnosticMessageSeverity.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DiagnosticMessageSeverity.cs deleted file mode 100644 index 8a823300e..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DiagnosticMessageSeverity.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. - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - /// - /// Specifies the severity of a . - /// - public enum DiagnosticMessageSeverity - { - Info, - Warning, - Error, - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DirectoryNames.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DirectoryNames.cs deleted file mode 100644 index d1f12812f..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/DirectoryNames.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. - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal static class DirectoryNames - { - public const string Bin = "bin"; - - public const string Obj = "obj"; - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/EnvironmentNames.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/EnvironmentNames.cs deleted file mode 100644 index 9c528501b..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/EnvironmentNames.cs +++ /dev/null @@ -1,11 +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.Internal.ProjectModel -{ - 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.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ErrorCodes.DotNet.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ErrorCodes.DotNet.cs deleted file mode 100644 index 5179d14d7..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ErrorCodes.DotNet.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. - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal static partial class ErrorCodes - { - // Target framework not installed - public static readonly string DOTNET1011 = nameof(DOTNET1011); - - // Reference assemblies location not specified - public static readonly string DOTNET1012 = nameof(DOTNET1012); - - // Multiple libraries marked as "platform" - public static readonly string DOTNET1013 = nameof(DOTNET1013); - - // Failed to read lock file - public static readonly string DOTNET1014 = nameof(DOTNET1014); - - // The '{0}' option is deprecated. Use '{1}' instead. - public static readonly string DOTNET1015 = nameof(DOTNET1015); - - // The '{0}' option in the root is deprecated. Use it in '{1}' instead. - public static readonly string DOTNET1016 = nameof(DOTNET1016); - - // Project file does not exist '{0}'. - public static readonly string DOTNET1017 = nameof(DOTNET1017); - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ErrorCodes.NuGet.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ErrorCodes.NuGet.cs deleted file mode 100644 index da0f05837..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ErrorCodes.NuGet.cs +++ /dev/null @@ -1,44 +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.Internal.ProjectModel -{ - internal static partial class ErrorCodes - { - // The dependency A could not be resolved. - public static readonly string NU1001 = nameof(NU1001); - - // The dependency A in project B does not support framework C." - public static readonly string NU1002 = nameof(NU1002); - - // Invalid A section. The target B is invalid, targets must either be a file name or a directory suffixed with '/'. The root directory of the package can be specified by using a single '/' character. - public static readonly string NU1003 = nameof(NU1003); - - // Invalid A section. The target B contains path-traversal characters ('.' or '..'). These characters are not permitted in target paths. - public static readonly string NU1004 = nameof(NU1004); - - // Invalid A section. The target B refers to a single file, but the pattern C produces multiple files. To mark the target as a directory, suffix it with '/'. - public static readonly string NU1005 = nameof(NU1005); - - // A. Please run \"dotnet restore\" to generate a new lock file. - public static readonly string NU1006 = nameof(NU1006); - - // Dependency specified was A but ended up with B. - public static readonly string NU1007 = nameof(NU1007); - - // A is an unsupported framework. - public static readonly string NU1008 = nameof(NU1008); - - // The expected lock file doesn't exist. Please run \"dotnet restore\" to generate a new lock file. - public static readonly string NU1009 = nameof(NU1009); - - // The dependency type was changed - public static readonly string NU1010 = nameof(NU1010); - - // The dependency target '{0}' is unsupported. - public static readonly string NU1011 = nameof(NU1011); - - // Dependency conflict. - public static readonly string NU1012 = nameof(NU1012); - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileFormatException.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileFormatException.cs deleted file mode 100644 index 7dc7088db..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileFormatException.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 Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - public sealed class FileFormatException : Exception - { - private FileFormatException(string message) : - base(message) - { - } - - private FileFormatException(string message, Exception innerException) : - base(message, innerException) - { - } - - public string Path { get; private set; } - public int Line { get; private set; } - public int Column { get; private set; } - - public override string ToString() - { - return $"{Path}({Line},{Column}): Error: {base.ToString()}"; - } - - internal static FileFormatException Create(Exception exception, string filePath) - { - return new FileFormatException(exception.Message, exception) - .WithFilePath(filePath) - .WithLineInfo(exception); - } - - internal static FileFormatException Create(Exception exception, JToken jsonValue, string filePath) - { - var result = Create(exception, jsonValue) - .WithFilePath(filePath); - - return result; - } - - internal static FileFormatException Create(Exception exception, JToken jsonValue) - { - var result = new FileFormatException(exception.Message, exception) - .WithLineInfo(jsonValue); - - return result; - } - - internal static FileFormatException Create(string message, JToken jsonValue, string filePath) - { - var result = Create(message, jsonValue) - .WithFilePath(filePath); - - return result; - } - - internal static FileFormatException Create(string message, string filePath) - { - var result = new FileFormatException(message) - .WithFilePath(filePath); - - return result; - } - - internal static FileFormatException Create(string message, JToken jsonValue) - { - var result = new FileFormatException(message) - .WithLineInfo(jsonValue); - - return result; - } - - internal FileFormatException WithFilePath(string path) - { - if (path == null) - { - throw new ArgumentNullException(nameof(path)); - } - - Path = path; - - return this; - } - - private FileFormatException WithLineInfo(Exception exception) - { - if (exception is JsonReaderException) - { - WithLineInfo((JsonReaderException) exception); - } - - return this; - } - - private FileFormatException WithLineInfo(JsonReaderException exception) - { - if (exception == null) - { - throw new ArgumentNullException(nameof(exception)); - } - - Line = exception.LineNumber; - Column = exception.LinePosition; - - return this; - } - - private FileFormatException WithLineInfo(JToken value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - var lineInfo = (IJsonLineInfo)value; - Line = lineInfo.LineNumber; - Column = lineInfo.LinePosition; - - return this; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileNameSuffixes.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileNameSuffixes.cs deleted file mode 100644 index 8f880eaf5..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileNameSuffixes.cs +++ /dev/null @@ -1,76 +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.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.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/DirectoryInfoBase.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/DirectoryInfoBase.cs deleted file mode 100644 index 5829d6499..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/DirectoryInfoBase.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.Collections.Generic; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions -{ - internal abstract class DirectoryInfoBase : FileSystemInfoBase - { - public abstract IEnumerable EnumerateFileSystemInfos(); - - public abstract DirectoryInfoBase GetDirectory(string path); - - public abstract FileInfoBase GetFile(string path); - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/DirectoryInfoWrapper.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/DirectoryInfoWrapper.cs deleted file mode 100644 index 422a3580b..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/DirectoryInfoWrapper.cs +++ /dev/null @@ -1,89 +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; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions -{ - internal class DirectoryInfoWrapper : DirectoryInfoBase - { - private readonly DirectoryInfo _directoryInfo; - private readonly bool _isParentPath; - - public DirectoryInfoWrapper(DirectoryInfo directoryInfo, bool isParentPath = false) - { - _directoryInfo = directoryInfo; - _isParentPath = isParentPath; - } - - public override IEnumerable EnumerateFileSystemInfos() - { - if (_directoryInfo.Exists) - { - foreach (var fileSystemInfo in _directoryInfo.EnumerateFileSystemInfos("*", SearchOption.TopDirectoryOnly)) - { - var directoryInfo = fileSystemInfo as DirectoryInfo; - if (directoryInfo != null) - { - yield return new DirectoryInfoWrapper(directoryInfo); - } - else - { - yield return new FileInfoWrapper((FileInfo)fileSystemInfo); - } - } - } - } - - public override DirectoryInfoBase GetDirectory(string name) - { - var isParentPath = string.Equals(name, "..", StringComparison.Ordinal); - - if (isParentPath) - { - return new DirectoryInfoWrapper(new DirectoryInfo(Path.Combine(_directoryInfo.FullName, name)), isParentPath); - } - else - { - var dirs = _directoryInfo.GetDirectories(name); - - if (dirs.Length == 1) - { - return new DirectoryInfoWrapper(dirs[0], isParentPath); - } - else if (dirs.Length == 0) - { - return null; - } - else - { - // This shouldn't happen. The parameter name isn't supposed to contain wild card. - throw new InvalidOperationException( - string.Format("More than one sub directories are found under {0} with name {1}.", _directoryInfo.FullName, name)); - } - } - } - - public override FileInfoBase GetFile(string name) - { - return new FileInfoWrapper(new FileInfo(Path.Combine(_directoryInfo.FullName, name))); - } - - public override string Name - { - get { return _isParentPath ? ".." : _directoryInfo.Name; } - } - - public override string FullName - { - get { return _directoryInfo.FullName; } - } - - public override DirectoryInfoBase ParentDirectory - { - get { return new DirectoryInfoWrapper(_directoryInfo.Parent); } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/FileInfoBase.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/FileInfoBase.cs deleted file mode 100644 index 633c8e524..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/FileInfoBase.cs +++ /dev/null @@ -1,9 +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.Internal.ProjectModel.FileSystemGlobbing.Abstractions -{ - internal abstract class FileInfoBase : FileSystemInfoBase - { - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/FileInfoWrapper.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/FileInfoWrapper.cs deleted file mode 100644 index c28dcfdc3..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/FileInfoWrapper.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.IO; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions -{ - internal class FileInfoWrapper : FileInfoBase - { - private FileInfo _fileInfo; - - public FileInfoWrapper(FileInfo fileInfo) - { - _fileInfo = fileInfo; - } - - public override string Name - { - get { return _fileInfo.Name; } - } - - public override string FullName - { - get { return _fileInfo.FullName; } - } - - public override DirectoryInfoBase ParentDirectory - { - get { return new DirectoryInfoWrapper(_fileInfo.Directory); } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/FileSystemInfoBase.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/FileSystemInfoBase.cs deleted file mode 100644 index 3d50eb272..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Abstractions/FileSystemInfoBase.cs +++ /dev/null @@ -1,14 +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.Internal.ProjectModel.FileSystemGlobbing.Abstractions -{ - internal abstract class FileSystemInfoBase - { - public abstract string Name { get; } - - public abstract string FullName { get; } - - public abstract DirectoryInfoBase ParentDirectory { get; } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/FilePatternMatch.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/FilePatternMatch.cs deleted file mode 100644 index 23506bdb4..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/FilePatternMatch.cs +++ /dev/null @@ -1,40 +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.PlatformAbstractions; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing -{ - public struct FilePatternMatch : IEquatable - { - public string Path { get; } - public string Stem { get; } - - public FilePatternMatch(string path, string stem) - { - Path = path; - Stem = stem; - } - - public bool Equals(FilePatternMatch other) - { - return string.Equals(other.Path, Path, StringComparison.OrdinalIgnoreCase) && - string.Equals(other.Stem, Stem, StringComparison.OrdinalIgnoreCase); - } - - public override bool Equals(object obj) - { - return Equals((FilePatternMatch)obj); - } - - public override int GetHashCode() - { - var hashCodeCombiner = HashCodeCombiner.Start(); - hashCodeCombiner.Add(Path, StringComparer.OrdinalIgnoreCase); - hashCodeCombiner.Add(Stem, StringComparer.OrdinalIgnoreCase); - - return hashCodeCombiner.CombinedHash; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/ILinearPattern.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/ILinearPattern.cs deleted file mode 100644 index 13c399597..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/ILinearPattern.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 System.Collections.Generic; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal -{ - internal interface ILinearPattern : IPattern - { - IList Segments { get; } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IPathSegment.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IPathSegment.cs deleted file mode 100644 index fe571da2e..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IPathSegment.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. - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal -{ - internal interface IPathSegment - { - bool CanProduceStem { get; } - - bool Match(string value); - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IPattern.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IPattern.cs deleted file mode 100644 index c4ea64c28..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IPattern.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. - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal -{ - internal interface IPattern - { - IPatternContext CreatePatternContextForInclude(); - - IPatternContext CreatePatternContextForExclude(); - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IPatternContext.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IPatternContext.cs deleted file mode 100644 index 5b86cb6b7..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IPatternContext.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 System; -using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal -{ - internal interface IPatternContext - { - void Declare(Action onDeclare); - - bool Test(DirectoryInfoBase directory); - - PatternTestResult Test(FileInfoBase file); - - void PushDirectory(DirectoryInfoBase directory); - - void PopDirectory(); - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IRaggedPattern.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IRaggedPattern.cs deleted file mode 100644 index 931f14fb3..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/IRaggedPattern.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. - -using System.Collections.Generic; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal -{ - internal interface IRaggedPattern : IPattern - { - IList Segments { get; } - - IList StartsWith { get; } - - IList> Contains { get; } - - IList EndsWith { get; } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/MatcherContext.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/MatcherContext.cs deleted file mode 100644 index cb6298517..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/MatcherContext.cs +++ /dev/null @@ -1,250 +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.Internal.ProjectModel.FileSystemGlobbing.Abstractions; -using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PathSegments; -using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Util; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal -{ - internal class MatcherContext - { - private readonly DirectoryInfoBase _root; - private readonly IList _includePatternContexts; - private readonly IList _excludePatternContexts; - private readonly IList _files; - - private readonly HashSet _declaredLiteralFolderSegmentInString; - private readonly HashSet _declaredLiteralFolderSegments = new HashSet(); - private readonly HashSet _declaredLiteralFileSegments = new HashSet(); - - private bool _declaredParentPathSegment; - private bool _declaredWildcardPathSegment; - - private readonly StringComparison _comparisonType; - - public MatcherContext(IEnumerable includePatterns, - IEnumerable excludePatterns, - DirectoryInfoBase directoryInfo, - StringComparison comparison) - { - _root = directoryInfo; - _files = new List(); - _comparisonType = comparison; - - _includePatternContexts = includePatterns.Select(pattern => pattern.CreatePatternContextForInclude()).ToList(); - _excludePatternContexts = excludePatterns.Select(pattern => pattern.CreatePatternContextForExclude()).ToList(); - - _declaredLiteralFolderSegmentInString = new HashSet(StringComparisonHelper.GetStringComparer(comparison)); - } - - public PatternMatchingResult Execute() - { - _files.Clear(); - - Match(_root, parentRelativePath: null); - - return new PatternMatchingResult(_files); - } - - private void Match(DirectoryInfoBase directory, string parentRelativePath) - { - // Request all the including and excluding patterns to push current directory onto their status stack. - PushDirectory(directory); - Declare(); - - var entities = new List(); - if (_declaredWildcardPathSegment || _declaredLiteralFileSegments.Any()) - { - entities.AddRange(directory.EnumerateFileSystemInfos()); - } - else - { - var candidates = directory.EnumerateFileSystemInfos().OfType(); - foreach (var candidate in candidates) - { - if (_declaredLiteralFolderSegmentInString.Contains(candidate.Name)) - { - entities.Add(candidate); - } - } - } - - if (_declaredParentPathSegment) - { - entities.Add(directory.GetDirectory("..")); - } - - // collect files and sub directories - var subDirectories = new List(); - foreach (var entity in entities) - { - var fileInfo = entity as FileInfoBase; - if (fileInfo != null) - { - var result = MatchPatternContexts(fileInfo, (pattern, file) => pattern.Test(file)); - if (result.IsSuccessful) - { - _files.Add(new FilePatternMatch( - path: CombinePath(parentRelativePath, fileInfo.Name), - stem: result.Stem)); - } - - continue; - } - - var directoryInfo = entity as DirectoryInfoBase; - if (directoryInfo != null) - { - if (MatchPatternContexts(directoryInfo, (pattern, dir) => pattern.Test(dir))) - { - subDirectories.Add(directoryInfo); - } - - continue; - } - } - - // Matches the sub directories recursively - foreach (var subDir in subDirectories) - { - var relativePath = CombinePath(parentRelativePath, subDir.Name); - - Match(subDir, relativePath); - } - - // Request all the including and excluding patterns to pop their status stack. - PopDirectory(); - } - - private void Declare() - { - _declaredLiteralFileSegments.Clear(); - _declaredLiteralFolderSegments.Clear(); - _declaredParentPathSegment = false; - _declaredWildcardPathSegment = false; - - foreach (var include in _includePatternContexts) - { - include.Declare(DeclareInclude); - } - } - - private void DeclareInclude(IPathSegment patternSegment, bool isLastSegment) - { - var literalSegment = patternSegment as LiteralPathSegment; - if (literalSegment != null) - { - if (isLastSegment) - { - _declaredLiteralFileSegments.Add(literalSegment); - } - else - { - _declaredLiteralFolderSegments.Add(literalSegment); - _declaredLiteralFolderSegmentInString.Add(literalSegment.Value); - } - } - else if (patternSegment is ParentPathSegment) - { - _declaredParentPathSegment = true; - } - else if (patternSegment is WildcardPathSegment) - { - _declaredWildcardPathSegment = true; - } - } - - internal static string CombinePath(string left, string right) - { - if (string.IsNullOrEmpty(left)) - { - return right; - } - else - { - return string.Format("{0}/{1}", left, right); - } - } - - // Used to adapt Test(DirectoryInfoBase) for the below overload - private bool MatchPatternContexts(TFileInfoBase fileinfo, Func test) - { - return MatchPatternContexts( - fileinfo, - (ctx, file) => - { - if (test(ctx, file)) - { - return PatternTestResult.Success(stem: string.Empty); - } - else - { - return PatternTestResult.Failed; - } - }).IsSuccessful; - } - - private PatternTestResult MatchPatternContexts(TFileInfoBase fileinfo, Func test) - { - var result = PatternTestResult.Failed; - - // If the given file/directory matches any including pattern, continues to next step. - foreach (var context in _includePatternContexts) - { - var localResult = test(context, fileinfo); - if (localResult.IsSuccessful) - { - result = localResult; - break; - } - } - - // If the given file/directory doesn't match any of the including pattern, returns false. - if (!result.IsSuccessful) - { - return PatternTestResult.Failed; - } - - // If the given file/directory matches any excluding pattern, returns false. - foreach (var context in _excludePatternContexts) - { - if (test(context, fileinfo).IsSuccessful) - { - return PatternTestResult.Failed; - } - } - - return result; - } - - private void PopDirectory() - { - foreach (var context in _excludePatternContexts) - { - context.PopDirectory(); - } - - foreach (var context in _includePatternContexts) - { - context.PopDirectory(); - } - } - - private void PushDirectory(DirectoryInfoBase directory) - { - foreach (var context in _includePatternContexts) - { - context.PushDirectory(directory); - } - - foreach (var context in _excludePatternContexts) - { - context.PushDirectory(directory); - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/CurrentPathSegment.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/CurrentPathSegment.cs deleted file mode 100644 index 441537144..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/CurrentPathSegment.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; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PathSegments -{ - internal class CurrentPathSegment : IPathSegment - { - public bool CanProduceStem { get { return false; } } - - public bool Match(string value) - { - return false; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/LiteralPathSegment.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/LiteralPathSegment.cs deleted file mode 100644 index ad914c0f7..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/LiteralPathSegment.cs +++ /dev/null @@ -1,48 +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.Internal.ProjectModel.FileSystemGlobbing.Util; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PathSegments -{ - internal class LiteralPathSegment : IPathSegment - { - private readonly StringComparison _comparisonType; - - public bool CanProduceStem { get { return false; } } - - public LiteralPathSegment(string value, StringComparison comparisonType) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - Value = value; - - _comparisonType = comparisonType; - } - - public string Value { get; } - - public bool Match(string value) - { - return string.Equals(Value, value, _comparisonType); - } - - public override bool Equals(object obj) - { - var other = obj as LiteralPathSegment; - - return other != null && - _comparisonType == other._comparisonType && - string.Equals(other.Value, Value, _comparisonType); - } - - public override int GetHashCode() - { - return StringComparisonHelper.GetStringComparer(_comparisonType).GetHashCode(Value); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/ParentPathSegment.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/ParentPathSegment.cs deleted file mode 100644 index ffcd6a97e..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/ParentPathSegment.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 System; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PathSegments -{ - internal class ParentPathSegment : IPathSegment - { - private static readonly string LiteralParent = ".."; - - public bool CanProduceStem { get { return false; } } - - public bool Match(string value) - { - return string.Equals(LiteralParent, value, StringComparison.Ordinal); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/RecursiveWildcardSegment.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/RecursiveWildcardSegment.cs deleted file mode 100644 index e6a4d44b9..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/RecursiveWildcardSegment.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; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PathSegments -{ - internal class RecursiveWildcardSegment : IPathSegment - { - public bool CanProduceStem { get { return true; } } - - public bool Match(string value) - { - return false; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/WildcardPathSegment.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/WildcardPathSegment.cs deleted file mode 100644 index 8022aa8c3..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PathSegments/WildcardPathSegment.cs +++ /dev/null @@ -1,74 +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.Internal.ProjectModel.FileSystemGlobbing.Internal.PathSegments -{ - 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. - public static readonly WildcardPathSegment MatchAll = new WildcardPathSegment( - string.Empty, new List(), string.Empty, StringComparison.OrdinalIgnoreCase); - - private readonly StringComparison _comparisonType; - - public WildcardPathSegment(string beginsWith, List contains, string endsWith, StringComparison comparisonType) - { - BeginsWith = beginsWith; - Contains = contains; - EndsWith = endsWith; - _comparisonType = comparisonType; - } - - public bool CanProduceStem { get { return true; } } - - public string BeginsWith { get; } - - public List Contains { get; } - - public string EndsWith { get; } - - public bool Match(string value) - { - var wildcard = this; - - if (value.Length < wildcard.BeginsWith.Length + wildcard.EndsWith.Length) - { - return false; - } - - if (!value.StartsWith(wildcard.BeginsWith, _comparisonType)) - { - return false; - } - - if (!value.EndsWith(wildcard.EndsWith, _comparisonType)) - { - return false; - } - - var beginRemaining = wildcard.BeginsWith.Length; - var endRemaining = value.Length - wildcard.EndsWith.Length; - for (var containsIndex = 0; containsIndex != wildcard.Contains.Count; ++containsIndex) - { - var containsValue = wildcard.Contains[containsIndex]; - var indexOf = value.IndexOf( - value: containsValue, - startIndex: beginRemaining, - count: endRemaining - beginRemaining, - comparisonType: _comparisonType); - if (indexOf == -1) - { - return false; - } - - beginRemaining = indexOf + containsValue.Length; - } - - return true; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContext.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContext.cs deleted file mode 100644 index d846541dc..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContext.cs +++ /dev/null @@ -1,39 +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.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PatternContexts -{ - internal abstract class PatternContext : IPatternContext - { - private Stack _stack = new Stack(); - protected TFrame Frame; - - public virtual void Declare(Action declare) { } - - public abstract PatternTestResult Test(FileInfoBase file); - - public abstract bool Test(DirectoryInfoBase directory); - - public abstract void PushDirectory(DirectoryInfoBase directory); - - public virtual void PopDirectory() - { - Frame = _stack.Pop(); - } - - protected void PushDataFrame(TFrame frame) - { - _stack.Push(Frame); - Frame = frame; - } - - protected bool IsStackEmpty() - { - return _stack.Count == 0; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinear.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinear.cs deleted file mode 100644 index 7a22bd7c8..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinear.cs +++ /dev/null @@ -1,105 +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.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PatternContexts -{ - internal abstract class PatternContextLinear - : PatternContext - { - public PatternContextLinear(ILinearPattern pattern) - { - Pattern = pattern; - } - - public override PatternTestResult Test(FileInfoBase file) - { - if (IsStackEmpty()) - { - throw new InvalidOperationException("Can't test file before entering a directory."); - } - - if(!Frame.IsNotApplicable && IsLastSegment() && TestMatchingSegment(file.Name)) - { - return PatternTestResult.Success(CalculateStem(file)); - } - - return PatternTestResult.Failed; - } - - public override void PushDirectory(DirectoryInfoBase directory) - { - // copy the current frame - var frame = Frame; - - if (IsStackEmpty() || Frame.IsNotApplicable) - { - // when the stack is being initialized - // or no change is required. - } - else if (!TestMatchingSegment(directory.Name)) - { - // nothing down this path is affected by this pattern - frame.IsNotApplicable = true; - } - else - { - // Determine this frame's contribution to the stem (if any) - var segment = Pattern.Segments[Frame.SegmentIndex]; - if (frame.InStem || segment.CanProduceStem) - { - frame.InStem = true; - frame.StemItems.Add(directory.Name); - } - - // directory matches segment, advance position in pattern - frame.SegmentIndex = frame.SegmentIndex + 1; - } - - PushDataFrame(frame); - } - - public struct FrameData - { - public bool IsNotApplicable; - public int SegmentIndex; - public bool InStem; - private IList _stemItems; - - public IList StemItems - { - get { return _stemItems ?? (_stemItems = new List()); } - } - - public string Stem - { - get { return _stemItems == null ? null : string.Join("/", _stemItems); } - } - } - - protected ILinearPattern Pattern { get; } - - protected bool IsLastSegment() - { - return Frame.SegmentIndex == Pattern.Segments.Count - 1; - } - - protected bool TestMatchingSegment(string value) - { - if (Frame.SegmentIndex >= Pattern.Segments.Count) - { - return false; - } - - return Pattern.Segments[Frame.SegmentIndex].Match(value); - } - - protected string CalculateStem(FileInfoBase matchedFile) - { - return MatcherContext.CombinePath(Frame.Stem, matchedFile.Name); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinearExclude.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinearExclude.cs deleted file mode 100644 index f23f608c7..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinearExclude.cs +++ /dev/null @@ -1,31 +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.Internal.ProjectModel.FileSystemGlobbing.Abstractions; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PatternContexts -{ - internal class PatternContextLinearExclude : PatternContextLinear - { - public PatternContextLinearExclude(ILinearPattern pattern) - : base(pattern) - { - } - - public override bool Test(DirectoryInfoBase directory) - { - if (IsStackEmpty()) - { - throw new InvalidOperationException("Can't test directory before entering a directory."); - } - - if (Frame.IsNotApplicable) - { - return false; - } - - return IsLastSegment() && TestMatchingSegment(directory.Name); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinearInclude.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinearInclude.cs deleted file mode 100644 index d2852b3e4..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextLinearInclude.cs +++ /dev/null @@ -1,49 +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.Internal.ProjectModel.FileSystemGlobbing.Abstractions; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PatternContexts -{ - internal class PatternContextLinearInclude : PatternContextLinear - { - public PatternContextLinearInclude(ILinearPattern pattern) - : base(pattern) - { - } - - public override void Declare(Action onDeclare) - { - if (IsStackEmpty()) - { - throw new InvalidOperationException("Can't declare path segment before entering a directory."); - } - - if (Frame.IsNotApplicable) - { - return; - } - - if (Frame.SegmentIndex < Pattern.Segments.Count) - { - onDeclare(Pattern.Segments[Frame.SegmentIndex], IsLastSegment()); - } - } - - public override bool Test(DirectoryInfoBase directory) - { - if (IsStackEmpty()) - { - throw new InvalidOperationException("Can't test directory before entering a directory."); - } - - if (Frame.IsNotApplicable) - { - return false; - } - - return !IsLastSegment() && TestMatchingSegment(directory.Name); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRagged.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRagged.cs deleted file mode 100644 index 7b2da0d8b..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRagged.cs +++ /dev/null @@ -1,186 +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.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PatternContexts -{ - internal abstract class PatternContextRagged : PatternContext - { - public PatternContextRagged(IRaggedPattern pattern) - { - Pattern = pattern; - } - - public override PatternTestResult Test(FileInfoBase file) - { - if (IsStackEmpty()) - { - throw new InvalidOperationException("Can't test file before entering a directory."); - } - - if(!Frame.IsNotApplicable && IsEndingGroup() && TestMatchingGroup(file)) - { - return PatternTestResult.Success(CalculateStem(file)); - } - return PatternTestResult.Failed; - } - - public sealed override void PushDirectory(DirectoryInfoBase directory) - { - // copy the current frame - var frame = Frame; - - if (IsStackEmpty()) - { - // initializing - frame.SegmentGroupIndex = -1; - frame.SegmentGroup = Pattern.StartsWith; - } - else if (Frame.IsNotApplicable) - { - // no change - } - else if (IsStartingGroup()) - { - if (!TestMatchingSegment(directory.Name)) - { - // nothing down this path is affected by this pattern - frame.IsNotApplicable = true; - } - else - { - // starting path incrementally satisfied - frame.SegmentIndex += 1; - } - } - else if (!IsStartingGroup() && directory.Name == "..") - { - // any parent path segment is not applicable in ** - frame.IsNotApplicable = true; - } - else if (!IsStartingGroup() && !IsEndingGroup() && TestMatchingGroup(directory)) - { - frame.SegmentIndex = Frame.SegmentGroup.Count; - frame.BacktrackAvailable = 0; - } - else - { - // increase directory backtrack length - frame.BacktrackAvailable += 1; - } - - if (frame.InStem) - { - frame.StemItems.Add(directory.Name); - } - - while ( - frame.SegmentIndex == frame.SegmentGroup.Count && - frame.SegmentGroupIndex != Pattern.Contains.Count) - { - frame.SegmentGroupIndex += 1; - frame.SegmentIndex = 0; - if (frame.SegmentGroupIndex < Pattern.Contains.Count) - { - frame.SegmentGroup = Pattern.Contains[frame.SegmentGroupIndex]; - } - else - { - frame.SegmentGroup = Pattern.EndsWith; - } - - // We now care about the stem - frame.InStem = true; - } - - PushDataFrame(frame); - } - - public override void PopDirectory() - { - base.PopDirectory(); - if (Frame.StemItems.Count > 0) - { - Frame.StemItems.RemoveAt(Frame.StemItems.Count - 1); - } - } - - public struct FrameData - { - public bool IsNotApplicable; - - public int SegmentGroupIndex; - - public IList SegmentGroup; - - public int BacktrackAvailable; - - public int SegmentIndex; - - public bool InStem; - - private IList _stemItems; - - public IList StemItems - { - get { return _stemItems ?? (_stemItems = new List()); } - } - - public string Stem - { - get { return _stemItems == null ? null : string.Join("/", _stemItems); } - } - } - - protected IRaggedPattern Pattern { get; } - - protected bool IsStartingGroup() - { - return Frame.SegmentGroupIndex == -1; - } - - protected bool IsEndingGroup() - { - return Frame.SegmentGroupIndex == Pattern.Contains.Count; - } - - protected bool TestMatchingSegment(string value) - { - if (Frame.SegmentIndex >= Frame.SegmentGroup.Count) - { - return false; - } - return Frame.SegmentGroup[Frame.SegmentIndex].Match(value); - } - - protected bool TestMatchingGroup(FileSystemInfoBase value) - { - var groupLength = Frame.SegmentGroup.Count; - var backtrackLength = Frame.BacktrackAvailable + 1; - if (backtrackLength < groupLength) - { - return false; - } - - var scan = value; - for (int index = 0; index != groupLength; ++index) - { - var segment = Frame.SegmentGroup[groupLength - index - 1]; - if (!segment.Match(scan.Name)) - { - return false; - } - scan = scan.ParentDirectory; - } - return true; - } - - protected string CalculateStem(FileInfoBase matchedFile) - { - return MatcherContext.CombinePath(Frame.Stem, matchedFile.Name); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRaggedExclude.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRaggedExclude.cs deleted file mode 100644 index 76ebc353f..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRaggedExclude.cs +++ /dev/null @@ -1,45 +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.Internal.ProjectModel.FileSystemGlobbing.Abstractions; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PatternContexts -{ - internal class PatternContextRaggedExclude : PatternContextRagged - { - public PatternContextRaggedExclude(IRaggedPattern pattern) - : base(pattern) - { - } - - public override bool Test(DirectoryInfoBase directory) - { - if (IsStackEmpty()) - { - throw new InvalidOperationException("Can't test directory before entering a directory."); - } - - if (Frame.IsNotApplicable) - { - return false; - } - - if (IsEndingGroup() && TestMatchingGroup(directory)) - { - // directory excluded with file-like pattern - return true; - } - - if (Pattern.EndsWith.Count == 0 && - Frame.SegmentGroupIndex == Pattern.Contains.Count - 1 && - TestMatchingGroup(directory)) - { - // directory excluded by matching up to final '/**' - return true; - } - - return false; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRaggedInclude.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRaggedInclude.cs deleted file mode 100644 index 65e8e3051..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternContexts/PatternContextRaggedInclude.cs +++ /dev/null @@ -1,60 +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.Internal.ProjectModel.FileSystemGlobbing.Abstractions; -using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PathSegments; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PatternContexts -{ - internal class PatternContextRaggedInclude : PatternContextRagged - { - public PatternContextRaggedInclude(IRaggedPattern pattern) - : base(pattern) - { - } - - public override void Declare(Action onDeclare) - { - if (IsStackEmpty()) - { - throw new InvalidOperationException("Can't declare path segment before entering a directory."); - } - - if (Frame.IsNotApplicable) - { - return; - } - - if (IsStartingGroup() && Frame.SegmentIndex < Frame.SegmentGroup.Count) - { - onDeclare(Frame.SegmentGroup[Frame.SegmentIndex], false); - } - else - { - onDeclare(WildcardPathSegment.MatchAll, false); - } - } - - public override bool Test(DirectoryInfoBase directory) - { - if (IsStackEmpty()) - { - throw new InvalidOperationException("Can't test directory before entering a directory."); - } - - if (Frame.IsNotApplicable) - { - return false; - } - - if (IsStartingGroup() && !TestMatchingSegment(directory.Name)) - { - // deterministic not-included - return false; - } - - return true; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternTestResult.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternTestResult.cs deleted file mode 100644 index 58d6dabd9..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/PatternTestResult.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. - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal -{ - public struct PatternTestResult - { - public static readonly PatternTestResult Failed = new PatternTestResult(isSuccessful: false, stem: null); - - public bool IsSuccessful { get; } - public string Stem { get; } - - private PatternTestResult(bool isSuccessful, string stem) - { - IsSuccessful = isSuccessful; - Stem = stem; - } - - public static PatternTestResult Success(string stem) - { - return new PatternTestResult(isSuccessful: true, stem: stem); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/Patterns/PatternBuilder.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/Patterns/PatternBuilder.cs deleted file mode 100644 index 7684ee502..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Internal/Patterns/PatternBuilder.cs +++ /dev/null @@ -1,272 +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.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PathSegments; -using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.PatternContexts; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.Patterns -{ - internal class PatternBuilder - { - private static readonly char[] _slashes = new[] { '/', '\\' }; - private static readonly char[] _star = new[] { '*' }; - - public PatternBuilder() - { - ComparisonType = StringComparison.OrdinalIgnoreCase; - } - - public PatternBuilder(StringComparison comparisonType) - { - ComparisonType = comparisonType; - } - - public StringComparison ComparisonType { get; } - - public IPattern Build(string pattern) - { - if (pattern == null) - { - throw new ArgumentNullException("pattern"); - } - - pattern = pattern.TrimStart(_slashes); - - if (pattern.TrimEnd(_slashes).Length < pattern.Length) - { - // If the pattern end with a slash, it is considered as - // a directory. - pattern = pattern.TrimEnd(_slashes) + "/**"; - } - - var allSegments = new List(); - var isParentSegmentLegal = true; - - IList segmentsPatternStartsWith = null; - IList> segmentsPatternContains = null; - IList segmentsPatternEndsWith = null; - - var endPattern = pattern.Length; - for (int scanPattern = 0; scanPattern < endPattern;) - { - var beginSegment = scanPattern; - var endSegment = NextIndex(pattern, _slashes, scanPattern, endPattern); - - IPathSegment segment = null; - - if (segment == null && endSegment - beginSegment == 3) - { - if (pattern[beginSegment] == '*' && - pattern[beginSegment + 1] == '.' && - pattern[beginSegment + 2] == '*') - { - // turn *.* into * - beginSegment += 2; - } - } - - if (segment == null && endSegment - beginSegment == 2) - { - if (pattern[beginSegment] == '*' && - pattern[beginSegment + 1] == '*') - { - // recognized ** - segment = new RecursiveWildcardSegment(); - } - else if (pattern[beginSegment] == '.' && - pattern[beginSegment + 1] == '.') - { - // recognized .. - - if (!isParentSegmentLegal) - { - throw new ArgumentException("\"..\" can be only added at the beginning of the pattern."); - } - segment = new ParentPathSegment(); - } - } - - if (segment == null && endSegment - beginSegment == 1) - { - if (pattern[beginSegment] == '.') - { - // recognized . - segment = new CurrentPathSegment(); - } - } - - if (segment == null && endSegment - beginSegment > 2) - { - if (pattern[beginSegment] == '*' && - pattern[beginSegment + 1] == '*' && - pattern[beginSegment + 2] == '.') - { - // recognize **. - // swallow the first *, add the recursive path segment and - // the remaining part will be treat as wild card in next loop. - segment = new RecursiveWildcardSegment(); - endSegment = beginSegment; - } - } - - if (segment == null) - { - var beginsWith = string.Empty; - var contains = new List(); - var endsWith = string.Empty; - - for (int scanSegment = beginSegment; scanSegment < endSegment;) - { - var beginLiteral = scanSegment; - var endLiteral = NextIndex(pattern, _star, scanSegment, endSegment); - - if (beginLiteral == beginSegment) - { - if (endLiteral == endSegment) - { - // and the only bit - segment = new LiteralPathSegment(Portion(pattern, beginLiteral, endLiteral), ComparisonType); - } - else - { - // this is the first bit - beginsWith = Portion(pattern, beginLiteral, endLiteral); - } - } - else if (endLiteral == endSegment) - { - // this is the last bit - endsWith = Portion(pattern, beginLiteral, endLiteral); - } - else - { - if (beginLiteral != endLiteral) - { - // this is a middle bit - contains.Add(Portion(pattern, beginLiteral, endLiteral)); - } - else - { - // note: NOOP here, adjacent *'s are collapsed when they - // are mixed with literal text in a path segment - } - } - - scanSegment = endLiteral + 1; - } - - if (segment == null) - { - segment = new WildcardPathSegment(beginsWith, contains, endsWith, ComparisonType); - } - } - - if (!(segment is ParentPathSegment)) - { - isParentSegmentLegal = false; - } - - if (segment is CurrentPathSegment) - { - // ignore ".\" - } - else - { - if (segment is RecursiveWildcardSegment) - { - if (segmentsPatternStartsWith == null) - { - segmentsPatternStartsWith = new List(allSegments); - segmentsPatternEndsWith = new List(); - segmentsPatternContains = new List>(); - } - else if (segmentsPatternEndsWith.Count != 0) - { - segmentsPatternContains.Add(segmentsPatternEndsWith); - segmentsPatternEndsWith = new List(); - } - } - else if (segmentsPatternEndsWith != null) - { - segmentsPatternEndsWith.Add(segment); - } - - allSegments.Add(segment); - } - - scanPattern = endSegment + 1; - } - - if (segmentsPatternStartsWith == null) - { - return new LinearPattern(allSegments); - } - else - { - return new RaggedPattern(allSegments, segmentsPatternStartsWith, segmentsPatternEndsWith, segmentsPatternContains); - } - } - - private static int NextIndex(string pattern, char[] anyOf, int beginIndex, int endIndex) - { - var index = pattern.IndexOfAny(anyOf, beginIndex, endIndex - beginIndex); - return index == -1 ? endIndex : index; - } - - private static string Portion(string pattern, int beginIndex, int endIndex) - { - return pattern.Substring(beginIndex, endIndex - beginIndex); - } - - private class LinearPattern : ILinearPattern - { - public LinearPattern(List allSegments) - { - Segments = allSegments; - } - - public IList Segments { get; } - - public IPatternContext CreatePatternContextForInclude() - { - return new PatternContextLinearInclude(this); - } - - public IPatternContext CreatePatternContextForExclude() - { - return new PatternContextLinearExclude(this); - } - } - - private class RaggedPattern : IRaggedPattern - { - public RaggedPattern(List allSegments, IList segmentsPatternStartsWith, IList segmentsPatternEndsWith, IList> segmentsPatternContains) - { - Segments = allSegments; - StartsWith = segmentsPatternStartsWith; - Contains = segmentsPatternContains; - EndsWith = segmentsPatternEndsWith; - } - - public IList> Contains { get; } - - public IList EndsWith { get; } - - public IList Segments { get; } - - public IList StartsWith { get; } - - public IPatternContext CreatePatternContextForInclude() - { - return new PatternContextRaggedInclude(this); - } - - public IPatternContext CreatePatternContextForExclude() - { - return new PatternContextRaggedExclude(this); - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Matcher.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Matcher.cs deleted file mode 100644 index b08855011..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Matcher.cs +++ /dev/null @@ -1,48 +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.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions; -using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal; -using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Internal.Patterns; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing -{ - internal class Matcher - { - private IList _includePatterns = new List(); - private IList _excludePatterns = new List(); - private readonly PatternBuilder _builder; - private readonly StringComparison _comparison; - - public Matcher() - : this(StringComparison.OrdinalIgnoreCase) - { - } - - public Matcher(StringComparison comparisonType) - { - _comparison = comparisonType; - _builder = new PatternBuilder(comparisonType); - } - - public virtual Matcher AddInclude(string pattern) - { - _includePatterns.Add(_builder.Build(pattern)); - return this; - } - - public virtual Matcher AddExclude(string pattern) - { - _excludePatterns.Add(_builder.Build(pattern)); - return this; - } - - public virtual PatternMatchingResult Execute(DirectoryInfoBase directoryInfo) - { - var context = new MatcherContext(_includePatterns, _excludePatterns, directoryInfo, _comparison); - return context.Execute(); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/MatcherExtensions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/MatcherExtensions.cs deleted file mode 100644 index e2aa7fb68..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/MatcherExtensions.cs +++ /dev/null @@ -1,44 +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.Internal.ProjectModel.FileSystemGlobbing.Abstractions; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing -{ - internal static class MatcherExtensions - { - public static void AddExcludePatterns(this Matcher matcher, params IEnumerable[] excludePatternsGroups) - { - foreach (var group in excludePatternsGroups) - { - foreach (var pattern in group) - { - matcher.AddExclude(pattern); - } - } - } - - public static void AddIncludePatterns(this Matcher matcher, params IEnumerable[] includePatternsGroups) - { - foreach (var group in includePatternsGroups) - { - foreach (var pattern in group) - { - matcher.AddInclude(pattern); - } - } - } - - public static IEnumerable GetResultsInFullPath(this Matcher matcher, string directoryPath) - { - var matches = matcher.Execute(new DirectoryInfoWrapper(new DirectoryInfo(directoryPath))).Files; - var result = matches.Select(match => Path.GetFullPath(Path.Combine(directoryPath, match.Path))).ToArray(); - - return result; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/PatternMatchingResult.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/PatternMatchingResult.cs deleted file mode 100644 index 3e2a10fa4..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/PatternMatchingResult.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.Collections.Generic; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing -{ - internal class PatternMatchingResult - { - public PatternMatchingResult(IEnumerable files) - { - Files = files; - } - - public IEnumerable Files { get; set; } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Util/StringComparisonHelper.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Util/StringComparisonHelper.cs deleted file mode 100644 index a35d6b483..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/FileSystemGlobbing/Util/StringComparisonHelper.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; - -namespace Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Util -{ - internal static class StringComparisonHelper - { - public static StringComparer GetStringComparer(StringComparison comparisonType) - { - switch (comparisonType) - { - case StringComparison.CurrentCulture: - return StringComparer.CurrentCulture; - case StringComparison.CurrentCultureIgnoreCase: - return StringComparer.CurrentCultureIgnoreCase; - case StringComparison.Ordinal: - return StringComparer.Ordinal; - case StringComparison.OrdinalIgnoreCase: - return StringComparer.OrdinalIgnoreCase; -#if NET451 - case StringComparison.InvariantCulture: - return StringComparer.InvariantCulture; - case StringComparison.InvariantCultureIgnoreCase: - return StringComparer.InvariantCultureIgnoreCase; -#endif - default: - throw new InvalidOperationException($"Unexpected StringComparison type: {comparisonType}"); - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/ExcludeContext.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/ExcludeContext.cs deleted file mode 100644 index 4c6e0281c..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/ExcludeContext.cs +++ /dev/null @@ -1,54 +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 Newtonsoft.Json.Linq; - -namespace Microsoft.DotNet.Internal.ProjectModel.Files -{ - // Similar to IncludeContext, except that it replaces the include information with the exclude information and clears - // out the exclude information. This is to be used by migration to do CopyToOutput with Never set as its metadata. - internal class ExcludeContext : IncludeContext - { - public ExcludeContext( - string sourceBasePath, - string option, - JObject rawObject, - string[] defaultBuiltInInclude, - string[] defaultBuiltInExclude) : base( - sourceBasePath, - option, - rawObject, - defaultBuiltInInclude, - defaultBuiltInExclude) - { - IncludePatterns = ExcludePatterns; - ExcludePatterns = new List(); - - IncludeFiles = ExcludeFiles; - ExcludeFiles = new List(); - - BuiltInsInclude = BuiltInsExclude; - BuiltInsExclude = new List(); - - if (Mappings != null) - { - var newMappings = new Dictionary(); - foreach (var mapping in Mappings) - { - newMappings.Add(mapping.Key, new ExcludeContext( - mapping.Value.SourceBasePath, - mapping.Value.Option, - mapping.Value.RawObject, - mapping.Value.BuiltInsInclude?.ToArray(), - mapping.Value.BuiltInsExclude?.ToArray())); - } - - Mappings = newMappings; - } - } - } -} \ No newline at end of file diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/IncludeContext.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/IncludeContext.cs deleted file mode 100644 index cad094fe1..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/IncludeContext.cs +++ /dev/null @@ -1,236 +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 Newtonsoft.Json.Linq; - -namespace Microsoft.DotNet.Internal.ProjectModel.Files -{ - internal class IncludeContext - { - private static readonly char[] PatternSeparator = new[] { ';' }; - - public IncludeContext( - string sourceBasePath, - string option, - JObject rawObject, - string[] defaultBuiltInInclude, - string[] defaultBuiltInExclude) - { - if (sourceBasePath == null) - { - throw new ArgumentNullException(nameof(sourceBasePath)); - } - - if (option == null) - { - throw new ArgumentNullException(nameof(option)); - } - - if (rawObject == null) - { - throw new ArgumentNullException(nameof(rawObject)); - } - - CustomIncludePatterns = new List(); - CustomRemovePatterns = new List(); - SourceBasePath = sourceBasePath; - Option = option; - RawObject = rawObject; - var token = rawObject.Value(option); - - if (token == null) - { - IncludePatterns = new List(); - ExcludePatterns = new List(); - IncludeFiles = new List(); - ExcludeFiles = new List(); - } - else if (token.Type != JTokenType.Object) - { - IncludePatterns = CreateCollection( - sourceBasePath, option, ExtractValues(token), literalPath: false); - } - else - { - IncludePatterns = CreateCollection( - sourceBasePath, "include", ExtractValues(token.Value("include")), literalPath: false); - - ExcludePatterns = CreateCollection( - sourceBasePath, "exclude", ExtractValues(token.Value("exclude")), literalPath: false); - - IncludeFiles = CreateCollection( - sourceBasePath, "includeFiles", ExtractValues(token.Value("includeFiles")), literalPath: true); - - ExcludeFiles = CreateCollection( - sourceBasePath, "excludeFiles", ExtractValues(token.Value("excludeFiles")), literalPath: true); - - var builtIns = token.Value("builtIns") as JObject; - if (builtIns != null) - { - BuiltInsInclude = CreateCollection( - sourceBasePath, "include", ExtractValues(builtIns.Value("include")), literalPath: false); - - BuiltInsExclude = CreateCollection( - sourceBasePath, "exclude", ExtractValues(builtIns.Value("exclude")), literalPath: false); - } - - var mappings = token.Value("mappings") as JObject; - if (mappings != null) - { - Mappings = new Dictionary(); - - foreach (var map in mappings) - { - Mappings.Add( - map.Key, - new IncludeContext( - sourceBasePath, - map.Key, - mappings, - defaultBuiltInInclude: null, - defaultBuiltInExclude: null)); - } - } - } - - if (defaultBuiltInInclude != null && - (BuiltInsInclude == null || !BuiltInsInclude.Any())) - { - BuiltInsInclude = defaultBuiltInInclude.ToList(); - } - - if (defaultBuiltInExclude != null && - (BuiltInsExclude == null || !BuiltInsExclude.Any())) - { - BuiltInsExclude = defaultBuiltInExclude.ToList(); - } - } - - public string SourceBasePath { get; } - - public string Option { get; } - - public List CustomIncludePatterns { get; } - - public List CustomRemovePatterns { get; } - - public List IncludePatterns { get; protected set; } - - public List ExcludePatterns { get; protected set; } - - public List IncludeFiles { get; protected set; } - - public List ExcludeFiles { get; protected set; } - - public List BuiltInsInclude { get; protected set; } - - public List BuiltInsExclude { get; protected set; } - - public IDictionary Mappings { get; protected set; } - - public JObject RawObject { get; } - - public override bool Equals(object obj) - { - var other = obj as IncludeContext; - return other != null && - SourceBasePath == other.SourceBasePath && - Option == other.Option && - EnumerableEquals(CustomIncludePatterns, other.CustomIncludePatterns) && - EnumerableEquals(IncludePatterns, other.IncludePatterns) && - EnumerableEquals(ExcludePatterns, other.ExcludePatterns) && - EnumerableEquals(IncludeFiles, other.IncludeFiles) && - EnumerableEquals(ExcludeFiles, other.ExcludeFiles) && - EnumerableEquals(BuiltInsInclude, other.BuiltInsInclude) && - EnumerableEquals(BuiltInsExclude, other.BuiltInsExclude) && - EnumerableEquals(Mappings, other.Mappings); - } - - public override int GetHashCode() - { - return base.GetHashCode(); - } - - private static bool EnumerableEquals(IEnumerable left, IEnumerable right) - => Enumerable.SequenceEqual(left ?? EmptyArray.Value, right ?? EmptyArray.Value); - - private static string[] ExtractValues(JToken token) - { - if (token != null) - { - if (token.Type == JTokenType.String) - { - return new string[] { token.Value() }; - } - else if (token.Type == JTokenType.Array) - { - return token.Values().ToArray(); - } - } - - return new string[0]; - } - - internal static List CreateCollection( - string projectDirectory, - string propertyName, - IEnumerable patternsStrings, - bool literalPath) - { - var patterns = patternsStrings - .SelectMany(patternsString => GetSourcesSplit(patternsString)) - .Select(patternString => - patternString.Replace('/', Path.DirectorySeparatorChar).Replace('\\', Path.DirectorySeparatorChar)); - - foreach (var pattern in patterns) - { - if (Path.IsPathRooted(pattern)) - { - throw new InvalidOperationException($"The '{propertyName}' property cannot be a rooted path."); - } - - if (literalPath && pattern.Contains('*')) - { - throw new InvalidOperationException($"The '{propertyName}' property cannot contain wildcard characters."); - } - } - - return new List(patterns.Select(pattern => FolderToPattern(pattern, projectDirectory))); - } - - private static IEnumerable GetSourcesSplit(string sourceDescription) - { - if (string.IsNullOrEmpty(sourceDescription)) - { - return Enumerable.Empty(); - } - - return sourceDescription.Split(PatternSeparator, StringSplitOptions.RemoveEmptyEntries); - } - - private static string FolderToPattern(string candidate, string projectDir) - { - // If it's already a pattern, no change is needed - if (candidate.Contains('*')) - { - return candidate; - } - - // If the given string ends with a path separator, or it is an existing directory - // we convert this folder name to a pattern matching all files in the folder - if (candidate.EndsWith(@"\") || - candidate.EndsWith("/") || - Directory.Exists(Path.Combine(projectDir, candidate))) - { - return Path.Combine(candidate, "**", "*"); - } - - // Otherwise, it represents a single file - return candidate; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/IncludeEntry.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/IncludeEntry.cs deleted file mode 100644 index 18786667d..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/IncludeEntry.cs +++ /dev/null @@ -1,45 +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.PlatformAbstractions; - -namespace Microsoft.DotNet.Internal.ProjectModel.Files -{ - internal class IncludeEntry : IEquatable - { - public string TargetPath { get; } - - public string SourcePath { get; } - - public bool IsCustomTarget { get; set; } - - public IncludeEntry(string target, string source) - { - TargetPath = target; - SourcePath = source; - } - - public override bool Equals(object obj) - { - return Equals((IncludeEntry)obj); - } - - public override int GetHashCode() - { - var combiner = HashCodeCombiner.Start(); - combiner.Add(TargetPath); - combiner.Add(SourcePath); - - return combiner.CombinedHash; - } - - public bool Equals(IncludeEntry other) - { - return other != null && - string.Equals(TargetPath, other.TargetPath, StringComparison.Ordinal) && - string.Equals(SourcePath, other.SourcePath, StringComparison.Ordinal) && - IsCustomTarget == other.IsCustomTarget; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/IncludeFilesResolver.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/IncludeFilesResolver.cs deleted file mode 100644 index 537eeb7d9..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/IncludeFilesResolver.cs +++ /dev/null @@ -1,212 +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.Internal.ProjectModel.Utilities; -using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing; -using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions; - -namespace Microsoft.DotNet.Internal.ProjectModel.Files -{ - internal class IncludeFilesResolver - { - public static IEnumerable GetIncludeFiles(IncludeContext context, string targetBasePath, IList diagnostics) - { - return GetIncludeFiles(context, targetBasePath, diagnostics, flatten: false); - } - - public static IEnumerable GetIncludeFiles( - IncludeContext context, - string targetBasePath, - IList diagnostics, - bool flatten) - { - var sourceBasePath = PathUtility.EnsureTrailingSlash(context.SourceBasePath); - targetBasePath = PathUtility.GetPathWithDirectorySeparator(targetBasePath); - - var includeEntries = new HashSet(); - - // Check for illegal characters in target path - if (string.IsNullOrEmpty(targetBasePath)) - { - diagnostics?.Add(new DiagnosticMessage( - ErrorCodes.NU1003, - $"Invalid '{context.Option}' section. The target '{targetBasePath}' is invalid, " + - "targets must either be a file name or a directory suffixed with '/'. " + - "The root directory of the package can be specified by using a single '/' character.", - sourceBasePath, - DiagnosticMessageSeverity.Error)); - } - else if (targetBasePath.Split(Path.DirectorySeparatorChar).Any(s => s.Equals(".") || s.Equals(".."))) - { - diagnostics?.Add(new DiagnosticMessage( - ErrorCodes.NU1004, - $"Invalid '{context.Option}' section. " + - $"The target '{targetBasePath}' contains path-traversal characters ('.' or '..'). " + - "These characters are not permitted in target paths.", - sourceBasePath, - DiagnosticMessageSeverity.Error)); - } - else - { - var files = GetIncludeFilesCore( - sourceBasePath, - context.IncludePatterns, - context.ExcludePatterns, - context.IncludeFiles, - context.BuiltInsInclude, - context.BuiltInsExclude).ToList(); - - var isFile = targetBasePath[targetBasePath.Length - 1] != Path.DirectorySeparatorChar; - if (isFile && files.Count > 1) - { - // It's a file. But the glob matched multiple things - diagnostics?.Add(new DiagnosticMessage( - ErrorCodes.NU1005, - $"Invalid '{ProjectFilesCollection.PackIncludePropertyName}' section. " + - $"The target '{targetBasePath}' refers to a single file, but the corresponding pattern " + - "produces multiple files. To mark the target as a directory, suffix it with '/'.", - sourceBasePath, - DiagnosticMessageSeverity.Error)); - } - else if (isFile && files.Count > 0) - { - var filePath = Path.GetFullPath( - Path.Combine(sourceBasePath, PathUtility.GetPathWithDirectorySeparator(files[0].Path))); - - includeEntries.Add(new IncludeEntry(targetBasePath, filePath)); - } - else if (!isFile) - { - targetBasePath = targetBasePath.Substring(0, targetBasePath.Length - 1); - - foreach (var file in files) - { - var fullPath = Path.GetFullPath( - Path.Combine(sourceBasePath, PathUtility.GetPathWithDirectorySeparator(file.Path))); - string targetPath; - - if (flatten) - { - targetPath = Path.Combine(targetBasePath, PathUtility.GetPathWithDirectorySeparator(file.Stem)); - } - else - { - targetPath = Path.Combine( - targetBasePath, - PathUtility.GetRelativePathIgnoringDirectoryTraversals(sourceBasePath, fullPath)); - } - - includeEntries.Add(new IncludeEntry(targetPath, fullPath)); - } - } - - if (context.IncludeFiles != null) - { - foreach (var literalRelativePath in context.IncludeFiles) - { - var fullPath = Path.GetFullPath(Path.Combine(sourceBasePath, literalRelativePath)); - string targetPath; - - if (isFile) - { - targetPath = targetBasePath; - } - else if (flatten) - { - targetPath = Path.Combine(targetBasePath, Path.GetFileName(fullPath)); - } - else - { - targetPath = Path.Combine(targetBasePath, PathUtility.GetRelativePath(sourceBasePath, fullPath)); - } - - includeEntries.Add(new IncludeEntry(targetPath, fullPath)); - } - } - - if (context.ExcludeFiles != null) - { - var literalExcludedFiles = new HashSet( - context.ExcludeFiles.Select(file => Path.GetFullPath(Path.Combine(sourceBasePath, file))), - StringComparer.Ordinal); - - includeEntries.RemoveWhere(entry => literalExcludedFiles.Contains(entry.SourcePath)); - } - } - - if (context.Mappings != null) - { - // Finally add all the mappings - foreach (var map in context.Mappings) - { - var targetPath = Path.Combine(targetBasePath, PathUtility.GetPathWithDirectorySeparator(map.Key)); - - foreach (var file in GetIncludeFiles(map.Value, targetPath, diagnostics, flatten: true)) - { - file.IsCustomTarget = true; - - // Prefer named targets over default ones - includeEntries.RemoveWhere(f => string.Equals(f.SourcePath, file.SourcePath) && !f.IsCustomTarget); - includeEntries.Add(file); - } - } - } - - return includeEntries; - } - - private static IEnumerable GetIncludeFilesCore( - string sourceBasePath, - List includePatterns, - List excludePatterns, - List includeFiles, - List builtInsInclude, - List builtInsExclude) - { - var literalIncludedFiles = new List(); - - if (includeFiles != null) - { - // literal included files are added at the last, but the search happens early - // so as to make the process fail early in case there is missing file. fail early - // helps to avoid unnecessary globing for performance optimization - foreach (var literalRelativePath in includeFiles) - { - var fullPath = Path.GetFullPath(Path.Combine(sourceBasePath, literalRelativePath)); - - if (!File.Exists(fullPath)) - { - throw new InvalidOperationException(string.Format("Can't find file {0}", literalRelativePath)); - } - - literalIncludedFiles.Add(fullPath); - } - } - - // Globbing - var matcher = new Matcher(); - if (builtInsInclude != null) - { - matcher.AddIncludePatterns(builtInsInclude); - } - if (includePatterns != null) - { - matcher.AddIncludePatterns(includePatterns); - } - if (builtInsExclude != null) - { - matcher.AddExcludePatterns(builtInsExclude); - } - if (excludePatterns != null) - { - matcher.AddExcludePatterns(excludePatterns); - } - - return matcher.Execute(new DirectoryInfoWrapper(new DirectoryInfo(sourceBasePath))).Files; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/NamedResourceReader.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/NamedResourceReader.cs deleted file mode 100644 index c81829b0f..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/NamedResourceReader.cs +++ /dev/null @@ -1,75 +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.IO; -using Newtonsoft.Json.Linq; - -namespace Microsoft.DotNet.Internal.ProjectModel.Files -{ - internal static class NamedResourceReader - { - public static IDictionary ReadNamedResources(JObject rawProject, string projectFilePath) - { - JToken namedResourceToken; - if (!rawProject.TryGetValue("namedResource", out namedResourceToken)) - { - return new Dictionary(); - } - - if (namedResourceToken.Type != JTokenType.Object) - { - throw FileFormatException.Create( - "Value must be object.", - rawProject.Value("namedResource"), projectFilePath); - } - - var namedResources = new Dictionary(); - foreach (var namedResource in (JObject)namedResourceToken) - { - if (namedResource.Value.Type != JTokenType.String) - { - throw FileFormatException.Create("Value must be string.", namedResource.Key, projectFilePath); - } - - var resourcePath = namedResource.Value.ToString(); - if (resourcePath.Contains("*")) - { - throw FileFormatException.Create("Value cannot contain wildcards.", resourcePath, projectFilePath); - } - - var resourceFileFullPath = - Path.GetFullPath(Path.Combine(Path.GetDirectoryName(projectFilePath), resourcePath)); - - if (namedResources.ContainsKey(namedResource.Key)) - { - throw FileFormatException.Create( - string.Format("The named resource {0} already exists.", namedResource.Key), - resourcePath, - projectFilePath); - } - - namedResources.Add(namedResource.Key, resourceFileFullPath); - } - - return namedResources; - } - - public static void ApplyNamedResources(IDictionary namedResources, IDictionary resources) - { - foreach (var namedResource in namedResources) - { - // The named resources dictionary is like the project file - // key = name, value = path to resource - if (resources.ContainsKey(namedResource.Value)) - { - resources[namedResource.Value] = namedResource.Key; - } - else - { - resources.Add(namedResource.Value, namedResource.Key); - } - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/PackIncludeEntry.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/PackIncludeEntry.cs deleted file mode 100644 index 260891bcf..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/PackIncludeEntry.cs +++ /dev/null @@ -1,49 +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.Linq; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -namespace Microsoft.DotNet.Internal.ProjectModel.Files -{ - internal class PackIncludeEntry - { - public string Target { get; } - public string[] SourceGlobs { get; } - public int Line { get; } - public int Column { get; } - - internal PackIncludeEntry(string target, JToken json) - { - Target = target; - SourceGlobs = ExtractValues(json); - - var lineInfo = (IJsonLineInfo)json; - Line = lineInfo.LineNumber; - Column = lineInfo.LinePosition; - } - - public PackIncludeEntry(string target, string[] sourceGlobs, int line, int column) - { - Target = target; - SourceGlobs = sourceGlobs; - Line = line; - Column = column; - } - - private static string[] ExtractValues(JToken json) - { - if (json.Type == JTokenType.String) - { - return new string[] { json.Value() }; - } - - if (json.Type == JTokenType.Array) - { - return json.Select(v => v.ToString()).ToArray(); - } - return new string[0]; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/PatternGroup.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/PatternGroup.cs deleted file mode 100644 index 6bc6e8032..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/PatternGroup.cs +++ /dev/null @@ -1,123 +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.Internal.ProjectModel.FileSystemGlobbing; -using Newtonsoft.Json.Linq; - -namespace Microsoft.DotNet.Internal.ProjectModel.Files -{ - internal class PatternGroup - { - private readonly List _excludeGroups = new List(); - private readonly Matcher _matcher = new Matcher(); - - internal PatternGroup(IEnumerable includePatterns) - { - IncludeLiterals = Enumerable.Empty(); - IncludePatterns = includePatterns; - ExcludePatterns = Enumerable.Empty(); - _matcher.AddIncludePatterns(IncludePatterns); - } - - internal PatternGroup(IEnumerable includePatterns, IEnumerable excludePatterns, IEnumerable includeLiterals) - { - IncludeLiterals = includeLiterals; - IncludePatterns = includePatterns; - ExcludePatterns = excludePatterns; - - _matcher.AddIncludePatterns(IncludePatterns); - _matcher.AddExcludePatterns(ExcludePatterns); - } - - internal static PatternGroup Build(JObject rawProject, - string projectDirectory, - string projectFilePath, - string name, - IEnumerable fallbackIncluding = null, - IEnumerable additionalIncluding = null, - IEnumerable additionalExcluding = null, - bool includePatternsOnly = false, - ICollection warnings = null) - { - string includePropertyName = name; - additionalIncluding = additionalIncluding ?? Enumerable.Empty(); - var includePatterns = PatternsCollectionHelper.GetPatternsCollection(rawProject, projectDirectory, projectFilePath, includePropertyName, defaultPatterns: fallbackIncluding) - .Concat(additionalIncluding) - .Distinct(); - - if (includePatternsOnly) - { - return new PatternGroup(includePatterns); - } - - additionalExcluding = additionalExcluding ?? Enumerable.Empty(); - var excludePatterns = PatternsCollectionHelper.GetPatternsCollection(rawProject, projectDirectory, projectFilePath, propertyName: name + "Exclude") - .Concat(additionalExcluding) - .Distinct(); - - var includeLiterals = PatternsCollectionHelper.GetPatternsCollection(rawProject, projectDirectory, projectFilePath, propertyName: name + "Files", literalPath: true) - .Distinct(); - - return new PatternGroup(includePatterns, excludePatterns, includeLiterals); - } - - public IEnumerable IncludeLiterals { get; } - - public IEnumerable IncludePatterns { get; } - - public IEnumerable ExcludePatterns { get; } - - public IEnumerable ExcludePatternsGroup { get { return _excludeGroups; } } - - public PatternGroup ExcludeGroup(PatternGroup group) - { - _excludeGroups.Add(group); - - return this; - } - - public IEnumerable SearchFiles(string rootPath) - { - // literal included files are added at the last, but the search happens early - // so as to make the process fail early in case there is missing file. fail early - // helps to avoid unnecessary globing for performance optimization - var literalIncludedFiles = new List(); - foreach (var literalRelativePath in IncludeLiterals) - { - var fullPath = Path.GetFullPath(Path.Combine(rootPath, literalRelativePath)); - - if (!File.Exists(fullPath)) - { - throw new InvalidOperationException(string.Format("Can't find file {0}", literalRelativePath)); - } - - // TODO: extract utility like NuGet.PathUtility.GetPathWithForwardSlashes() - literalIncludedFiles.Add(fullPath.Replace('\\', '/')); - } - - // globing files - var globbingResults = _matcher.GetResultsInFullPath(rootPath); - - // if there is no results generated in globing, skip excluding other groups - // for performance optimization. - if (globbingResults.Any()) - { - foreach (var group in _excludeGroups) - { - globbingResults = globbingResults.Except(group.SearchFiles(rootPath)); - } - } - - return globbingResults.Concat(literalIncludedFiles).Distinct(); - } - - public override string ToString() - { - return string.Format("Pattern group: Literals [{0}] Includes [{1}] Excludes [{2}]", string.Join(", ", IncludeLiterals), string.Join(", ", IncludePatterns), string.Join(", ", ExcludePatterns)); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/PatternsCollectionHelper.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/PatternsCollectionHelper.cs deleted file mode 100644 index 83864bd64..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/PatternsCollectionHelper.cs +++ /dev/null @@ -1,54 +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 Newtonsoft.Json.Linq; - -namespace Microsoft.DotNet.Internal.ProjectModel.Files -{ - internal static class PatternsCollectionHelper - { - private static readonly char[] PatternSeparator = new[] { ';' }; - - public static IEnumerable GetPatternsCollection(JObject rawProject, - string projectDirectory, - string projectFilePath, - string propertyName, - IEnumerable defaultPatterns = null, - bool literalPath = false) - { - defaultPatterns = defaultPatterns ?? Enumerable.Empty(); - - try - { - JToken propertyNameToken; - if (!rawProject.TryGetValue(propertyName, out propertyNameToken)) - { - return IncludeContext.CreateCollection( - projectDirectory, propertyName, defaultPatterns, literalPath); - } - - if (propertyNameToken.Type == JTokenType.String) - { - return IncludeContext.CreateCollection( - projectDirectory, propertyName, new string[] { propertyNameToken.Value() }, literalPath); - } - - if (propertyNameToken.Type == JTokenType.Array) - { - var valuesInArray = propertyNameToken.Values(); - return IncludeContext.CreateCollection( - projectDirectory, propertyName, valuesInArray.Select(s => s.ToString()), literalPath); - } - } - catch (Exception ex) - { - throw FileFormatException.Create(ex, rawProject.Value(propertyName), projectFilePath); - } - - throw FileFormatException.Create("Value must be either string or array.", rawProject.Value(propertyName), projectFilePath); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/ProjectFilesCollection.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/ProjectFilesCollection.cs deleted file mode 100644 index ae5216faf..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Files/ProjectFilesCollection.cs +++ /dev/null @@ -1,193 +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 Newtonsoft.Json.Linq; - -namespace Microsoft.DotNet.Internal.ProjectModel.Files -{ - internal class ProjectFilesCollection - { - public static readonly string[] SdkInjectedDefaultCompileBuiltInPatterns = new[] { @"**/*.cs" }; - public static readonly string[] DefaultPreprocessPatterns = new[] { @"compiler/preprocess/**/*.cs" }; - public static readonly string[] DefaultSharedPatterns = new[] { @"compiler/shared/**/*.cs" }; - public static readonly string[] DefaultBuiltInExcludePatterns = new[] { "bin/**", "obj/**", "**/*.xproj", "packages/**" }; - - public static readonly string PackIncludePropertyName = "packInclude"; - - private PatternGroup _sharedPatternsGroup; - private PatternGroup _resourcePatternsGroup; - private PatternGroup _preprocessPatternsGroup; - private PatternGroup _compilePatternsGroup; - private PatternGroup _contentPatternsGroup; - private IDictionary _namedResources; - private IEnumerable _publishExcludePatterns; - private IEnumerable _packInclude; - - private readonly string _projectDirectory; - private readonly string _projectFilePath; - - private JObject _rawProject; - private bool _initialized; - - internal ProjectFilesCollection(JObject rawProject, string projectDirectory, string projectFilePath) - { - _projectDirectory = projectDirectory; - _projectFilePath = projectFilePath; - _rawProject = rawProject; - } - - internal void EnsureInitialized() - { - if (_initialized) - { - return; - } - - var excludeBuiltIns = PatternsCollectionHelper.GetPatternsCollection(_rawProject, _projectDirectory, _projectFilePath, "excludeBuiltIn", DefaultBuiltInExcludePatterns); - var excludePatterns = PatternsCollectionHelper.GetPatternsCollection(_rawProject, _projectDirectory, _projectFilePath, "exclude") - .Concat(excludeBuiltIns); - var contentBuiltIns = PatternsCollectionHelper.GetPatternsCollection(_rawProject, _projectDirectory, _projectFilePath, "contentBuiltIn"); - var compileBuiltIns = PatternsCollectionHelper.GetPatternsCollection(_rawProject, _projectDirectory, _projectFilePath, "compileBuiltIn", SdkInjectedDefaultCompileBuiltInPatterns); - var resourceBuiltIns = PatternsCollectionHelper.GetPatternsCollection(_rawProject, _projectDirectory, _projectFilePath, "resourceBuiltIn"); - - _publishExcludePatterns = PatternsCollectionHelper.GetPatternsCollection(_rawProject, _projectDirectory, _projectFilePath, "publishExclude"); - - _sharedPatternsGroup = PatternGroup.Build(_rawProject, _projectDirectory, _projectFilePath, "shared", fallbackIncluding: DefaultSharedPatterns, additionalExcluding: excludePatterns); - - _resourcePatternsGroup = PatternGroup.Build(_rawProject, _projectDirectory, _projectFilePath, "resource", additionalIncluding: resourceBuiltIns, additionalExcluding: excludePatterns); - - _preprocessPatternsGroup = PatternGroup.Build(_rawProject, _projectDirectory, _projectFilePath, "preprocess", fallbackIncluding: DefaultPreprocessPatterns, additionalExcluding: excludePatterns) - .ExcludeGroup(_sharedPatternsGroup) - .ExcludeGroup(_resourcePatternsGroup); - - _compilePatternsGroup = PatternGroup.Build(_rawProject, _projectDirectory, _projectFilePath, "compile", additionalIncluding: compileBuiltIns, additionalExcluding: excludePatterns) - .ExcludeGroup(_sharedPatternsGroup) - .ExcludeGroup(_preprocessPatternsGroup) - .ExcludeGroup(_resourcePatternsGroup); - - _contentPatternsGroup = PatternGroup.Build(_rawProject, _projectDirectory, _projectFilePath, "content", additionalIncluding: contentBuiltIns, additionalExcluding: _publishExcludePatterns); - - _namedResources = NamedResourceReader.ReadNamedResources(_rawProject, _projectFilePath); - - // Files to be packed along with the project - var packIncludeJson = _rawProject.Value(PackIncludePropertyName) as JObject; - if (packIncludeJson != null) - { - var packIncludeEntries = new List(); - foreach (var token in packIncludeJson) - { - packIncludeEntries.Add(new PackIncludeEntry(token.Key, token.Value)); - } - - _packInclude = packIncludeEntries; - } - else - { - _packInclude = new List(); - } - - _initialized = true; - _rawProject = null; - } - - public IEnumerable PackInclude - { - get - { - EnsureInitialized(); - return _packInclude; - } - } - - public IEnumerable SourceFiles - { - get { return CompilePatternsGroup.SearchFiles(_projectDirectory).Distinct(); } - } - - public IEnumerable PreprocessSourceFiles - { - get { return PreprocessPatternsGroup.SearchFiles(_projectDirectory).Distinct(); } - } - - public IDictionary ResourceFiles - { - get - { - var resources = ResourcePatternsGroup - .SearchFiles(_projectDirectory) - .Distinct() - .ToDictionary(res => res, res => (string)null); - - NamedResourceReader.ApplyNamedResources(_namedResources, resources); - - return resources; - } - } - - public IEnumerable SharedFiles - { - get { return SharedPatternsGroup.SearchFiles(_projectDirectory).Distinct(); } - } - - public IEnumerable GetContentFiles(IEnumerable additionalExcludePatterns = null) - { - var patternGroup = new PatternGroup(ContentPatternsGroup.IncludePatterns, - ContentPatternsGroup.ExcludePatterns.Concat(additionalExcludePatterns ?? new List()), - ContentPatternsGroup.IncludeLiterals); - - foreach (var excludedGroup in ContentPatternsGroup.ExcludePatternsGroup) - { - patternGroup.ExcludeGroup(excludedGroup); - } - - return patternGroup.SearchFiles(_projectDirectory); - } - - internal PatternGroup CompilePatternsGroup - { - get - { - EnsureInitialized(); - return _compilePatternsGroup; - } - } - - internal PatternGroup SharedPatternsGroup - { - get - { - EnsureInitialized(); - return _sharedPatternsGroup; - } - } - - internal PatternGroup ResourcePatternsGroup - { - get - { - EnsureInitialized(); - return _resourcePatternsGroup; - } - } - - internal PatternGroup PreprocessPatternsGroup - { - get - { - EnsureInitialized(); - return _preprocessPatternsGroup; - } - } - - internal PatternGroup ContentPatternsGroup - { - get - { - EnsureInitialized(); - return _contentPatternsGroup; - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/GlobalSettings.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/GlobalSettings.cs deleted file mode 100644 index 0b8886a21..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/GlobalSettings.cs +++ /dev/null @@ -1,105 +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 Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.IO; -using Newtonsoft.Json; -using System.Linq; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal class GlobalSettings - { - public const string FileName = "global.json"; - - public IList ProjectSearchPaths { get; private set; } - public string PackagesPath { get; private set; } - public string FilePath { get; private set; } - public string DirectoryPath - { - get - { - return Path.GetFullPath(Path.GetDirectoryName(FilePath)); - } - } - - public static bool TryGetGlobalSettings(string path, out GlobalSettings globalSettings) - { - globalSettings = null; - string globalJsonPath = null; - - if (Path.GetFileName(path) == FileName) - { - globalJsonPath = path; - path = Path.GetDirectoryName(path); - } - else if (!HasGlobalFile(path)) - { - return false; - } - else - { - globalJsonPath = Path.Combine(path, FileName); - } - - try - { - using (var fs = File.OpenRead(globalJsonPath)) - { - globalSettings = GetGlobalSettings(fs, globalJsonPath); - } - } - catch (Exception ex) - { - throw FileFormatException.Create(ex, globalJsonPath); - } - - return true; - } - - public static GlobalSettings GetGlobalSettings(Stream fs, string globalJsonPath) - { - var globalSettings = new GlobalSettings(); - - var reader = new StreamReader(fs); - JObject jobject; - try - { - jobject = JObject.Parse(reader.ReadToEnd()); - } - catch (JsonReaderException) - { - throw new InvalidOperationException("The JSON file can't be deserialized to a JSON object."); - } - - IEnumerable projectSearchPaths = Enumerable.Empty(); - JToken projectSearchPathsToken; - if (jobject.TryGetValue("projects", out projectSearchPathsToken) && - projectSearchPathsToken.Type == JTokenType.Array) - { - projectSearchPaths = projectSearchPathsToken.Values(); - } - else if (jobject.TryGetValue("sources", out projectSearchPathsToken) && - projectSearchPathsToken.Type == JTokenType.Array) - { - projectSearchPaths = projectSearchPathsToken.Values(); - } - - globalSettings.ProjectSearchPaths = new List(projectSearchPaths); - globalSettings.PackagesPath = jobject.Value("packages"); - globalSettings.FilePath = globalJsonPath; - - return globalSettings; - } - - public static bool HasGlobalFile(string path) - { - string projectPath = Path.Combine(path, FileName); - - return File.Exists(projectPath); - } - - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/ExportFile.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/ExportFile.cs deleted file mode 100644 index eae343aa8..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/ExportFile.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.Collections.Generic; -using System.Linq; -using NuGet.ProjectModel; - -namespace Microsoft.DotNet.Internal.ProjectModel.Graph -{ - internal class ExportFile - { - public static readonly string ExportFileName = "project.fragment.lock.json"; - - public int Version { get; } - public string ExportFilePath { get; } - - public IList Exports { get; } - - public ExportFile(string exportFilePath, int version, IList exports) - { - ExportFilePath = exportFilePath; - Version = version; - Exports = exports.Any() ? exports : new List(0); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/LockFileExtensions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/LockFileExtensions.cs deleted file mode 100644 index f45ff7e94..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/LockFileExtensions.cs +++ /dev/null @@ -1,76 +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.Linq; -using NuGet.ProjectModel; - -namespace Microsoft.DotNet.Internal.ProjectModel.Graph -{ - internal static class LockFileExtensions - { - public static readonly int CurrentVersion = 2; - - public static bool IsValidForProject(this LockFile lockFile, Project project) - { - string message; - return lockFile.IsValidForProject(project, out message); - } - - public static bool IsValidForProject(this LockFile lockFile, Project project, out string message) - { - if (lockFile.Version != CurrentVersion) - { - message = $"The expected lock file version does not match the actual version"; - return false; - } - - message = $"Dependencies in {Project.FileName} were modified"; - - var actualTargetFrameworks = project.GetTargetFrameworks(); - - // The lock file should contain dependencies for each framework plus dependencies shared by all frameworks - if (lockFile.ProjectFileDependencyGroups.Count != actualTargetFrameworks.Count() + 1) - { - Console.WriteLine($"Different count; {lockFile.ProjectFileDependencyGroups.Count} != {actualTargetFrameworks.Count() + 1}"); - return false; - } - - foreach (var group in lockFile.ProjectFileDependencyGroups) - { - IOrderedEnumerable actualDependencies; - var expectedDependencies = group.Dependencies.OrderBy(x => x); - - // If the framework name is empty, the associated dependencies are shared by all frameworks - if (string.IsNullOrEmpty(group.FrameworkName)) - { - actualDependencies = project.Dependencies - .Select(d => d.LibraryRange.ToLockFileDependencyGroupString()) - .OrderBy(x => x, StringComparer.OrdinalIgnoreCase); - } - else - { - var framework = actualTargetFrameworks - .FirstOrDefault(f => Equals(f.FrameworkName.DotNetFrameworkName, group.FrameworkName)); - if (framework == null) - { - return false; - } - - actualDependencies = framework.Dependencies - .Select(d => d.LibraryRange.ToLockFileDependencyGroupString()) - .OrderBy(x => x, StringComparer.OrdinalIgnoreCase); - } - - if (!actualDependencies.SequenceEqual(expectedDependencies)) - { - Console.WriteLine($"ActualDependencies don't match"); - return false; - } - } - - message = null; - return true; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/LockFileLookup.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/LockFileLookup.cs deleted file mode 100644 index d45350fef..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/LockFileLookup.cs +++ /dev/null @@ -1,66 +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 NuGet.LibraryModel; -using NuGet.ProjectModel; -using NuGet.Versioning; - -namespace Microsoft.DotNet.Internal.ProjectModel.Graph -{ - internal class LockFileLookup - { - // REVIEW: Case sensitivity? - private readonly Dictionary, LockFileLibrary> _packages; - private readonly Dictionary _projects; - - public LockFileLookup(LockFile lockFile) - { - _packages = new Dictionary, LockFileLibrary>(); - _projects = new Dictionary(); - - foreach (var library in lockFile.Libraries) - { - var libraryType = LibraryType.Parse(library.Type); - - if (libraryType == LibraryType.Package) - { - _packages[Tuple.Create(library.Name, library.Version)] = library; - } - if (libraryType == LibraryType.Project) - { - _projects[library.Name] = library; - } - } - } - - public LockFileLibrary GetProject(string name) - { - LockFileLibrary project; - if (_projects.TryGetValue(name, out project)) - { - return project; - } - - return null; - } - - public LockFileLibrary GetPackage(string id, NuGetVersion version) - { - LockFileLibrary package; - if (_packages.TryGetValue(Tuple.Create(id, version), out package)) - { - return package; - } - - return null; - } - - public void Clear() - { - _packages.Clear(); - _projects.Clear(); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/ProjectLibraryDependency.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/ProjectLibraryDependency.cs deleted file mode 100644 index cc9fb10fc..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Graph/ProjectLibraryDependency.cs +++ /dev/null @@ -1,23 +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 NuGet.LibraryModel; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal class ProjectLibraryDependency : LibraryDependency - { - public string SourceFilePath { get; set; } - public int SourceLine { get; set; } - public int SourceColumn { get; set; } - - public ProjectLibraryDependency() - { - } - - public ProjectLibraryDependency(LibraryRange libraryRange) - { - LibraryRange = libraryRange; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/IProjectReader.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/IProjectReader.cs deleted file mode 100644 index b46bf0ce8..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/IProjectReader.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.Internal.ProjectModel -{ - internal interface IProjectReader - { - Project ReadProject(string projectPath, ProjectReaderSettings settings = null); - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Internal/EmptyArray.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Internal/EmptyArray.cs deleted file mode 100644 index dad6516bb..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Internal/EmptyArray.cs +++ /dev/null @@ -1,14 +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.Internal.ProjectModel -{ - internal static class EmptyArray - { -#if NET451 - public static readonly T[] Value = new T[0]; -#else - public static readonly T[] Value = System.Array.Empty(); -#endif - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/LibraryDescription.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/LibraryDescription.cs deleted file mode 100644 index 10a34a17d..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/LibraryDescription.cs +++ /dev/null @@ -1,77 +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.PlatformAbstractions; -using NuGet.Frameworks; -using NuGet.LibraryModel; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - /// - /// Represents the result of resolving the library - /// - internal class LibraryDescription - { - public LibraryDescription( - LibraryIdentity identity, - string hash, - string path, - IEnumerable dependencies, - NuGetFramework framework, - bool resolved, - bool compatible) - { - Path = path; - Identity = identity; - Hash = hash; - Dependencies = dependencies ?? Enumerable.Empty(); - Framework = framework; - Resolved = resolved; - Compatible = compatible; - } - - public LibraryIdentity Identity { get; } - public string Hash { get; } - public HashSet RequestedRanges { get; } = - new HashSet(new LibraryRangeEqualityComparer()); - public List Parents { get; } = new List(); - public string Path { get; } - public IEnumerable Dependencies { get; } - public bool Compatible { get; } - - public NuGetFramework Framework { get; set; } - public bool Resolved { get; set; } - - public override string ToString() - { - return $"{Identity} ({Identity.Type}) = {Path}"; - } - - // For diagnostics, we don't want to duplicate requested dependencies so we - // dedupe dependencies defined in project.json - private class LibraryRangeEqualityComparer : IEqualityComparer - { - public bool Equals(ProjectLibraryDependency x, ProjectLibraryDependency y) - { - return x.Equals(y) && - x.SourceColumn == y.SourceColumn && - x.SourceLine == y.SourceLine && - string.Equals(x.SourceFilePath, y.SourceFilePath, StringComparison.Ordinal); - } - - public int GetHashCode(ProjectLibraryDependency obj) - { - var combiner = HashCodeCombiner.Start(); - combiner.Add(obj); - combiner.Add(obj.SourceFilePath); - combiner.Add(obj.SourceLine); - combiner.Add(obj.SourceColumn); - - return combiner.CombinedHash; - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/MSBuildProjectDescription.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/MSBuildProjectDescription.cs deleted file mode 100644 index 9861892a5..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/MSBuildProjectDescription.cs +++ /dev/null @@ -1,49 +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 NuGet.LibraryModel; -using NuGet.ProjectModel; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - /// - /// Represents an MSBuild project. - /// It has been invisibly built by MSBuild, so it behaves like a package: can provide all assets up front - /// - /// Path points to the project's directory - /// MSBuildPRojectPath points to the csproj file - /// - internal class MSBuildProjectDescription : TargetLibraryWithAssets - { - public MSBuildProjectDescription( - string path, - string msbuildProjectPath, - LockFileLibrary projectLibrary, - LockFileTargetLibrary lockFileLibrary, - Project projectFile, - IEnumerable dependencies, - bool compatible, - bool resolved) - : base( - new LibraryIdentity(projectLibrary.Name, projectLibrary.Version, LibraryType.Project), - string.Empty, //msbuild projects don't have hashes - path, - lockFileLibrary, - dependencies, - resolved: resolved, - compatible: compatible, - framework: null) - { - MSBuildProjectPath = msbuildProjectPath; - ProjectFile = projectFile; - ProjectLibrary = projectLibrary; - } - - public LockFileLibrary ProjectLibrary { get; } - - public string MSBuildProjectPath { get; set; } - - public Project ProjectFile { get; } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/OutputPaths.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/OutputPaths.cs deleted file mode 100644 index f2bdfd417..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/OutputPaths.cs +++ /dev/null @@ -1,58 +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.Internal.ProjectModel -{ - internal class OutputPaths - { - private readonly string _runtimePath; - private readonly RuntimeOutputFiles _runtimeFiles; - - public OutputPaths(string intermediateOutputDirectoryPath, - string compilationOutputPath, - string runtimePath, - CompilationOutputFiles compilationFiles, - RuntimeOutputFiles runtimeFiles) - { - _runtimePath = runtimePath; - _runtimeFiles = runtimeFiles; - CompilationOutputPath = compilationOutputPath; - IntermediateOutputDirectoryPath = intermediateOutputDirectoryPath; - CompilationFiles = compilationFiles; - } - - public string CompilationOutputPath { get; } - - public string IntermediateOutputDirectoryPath { get; } - - public string RuntimeOutputPath - { - get - { - if (_runtimePath == null) - { - throw new InvalidOperationException( - $"Cannot get runtime output path for {nameof(OutputPaths)} with no runtime set"); - } - return _runtimePath; - } - } - - public CompilationOutputFiles CompilationFiles { get; } - - public RuntimeOutputFiles RuntimeFiles - { - get - { - if (_runtimeFiles == null) - { - throw new InvalidOperationException( - $"Cannot get runtime output files for {nameof(OutputPaths)} with no runtime set"); - } - return _runtimeFiles; - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/OutputPathsCalculator.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/OutputPathsCalculator.cs deleted file mode 100644 index dac398927..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/OutputPathsCalculator.cs +++ /dev/null @@ -1,77 +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.Internal.ProjectModel.Utilities; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal class OutputPathsCalculator - { - private const string ObjDirectoryName = "obj"; - private const string BinDirectoryName = "bin"; - - public static OutputPaths GetOutputPaths( - Project project, - NuGetFramework framework, - string runtimeIdentifier, - string configuration, - string solutionRootPath, - string buildBasePath, - string outputPath) - { - string resolvedBuildBasePath; - if (string.IsNullOrEmpty(buildBasePath)) - { - resolvedBuildBasePath = project.ProjectDirectory; - } - else - { - if (string.IsNullOrEmpty(solutionRootPath)) - { - resolvedBuildBasePath = Path.Combine(buildBasePath, project.Name); - } - else - { - resolvedBuildBasePath = project.ProjectDirectory.Replace(solutionRootPath, buildBasePath); - } - } - - var compilationOutputPath = PathUtility.EnsureTrailingSlash(Path.Combine(resolvedBuildBasePath, - BinDirectoryName, - configuration, - framework.GetShortFolderName())); - - string runtimeOutputPath = null; - if (string.IsNullOrEmpty(outputPath)) - { - if (!string.IsNullOrEmpty(runtimeIdentifier)) - { - runtimeOutputPath = PathUtility.EnsureTrailingSlash(Path.Combine(compilationOutputPath, runtimeIdentifier)); - } - else - { - // "Runtime" assets (i.e. the deps file) will be dropped to the compilation output path, because - // we are building a RID-less target. - runtimeOutputPath = compilationOutputPath; - } - } - else - { - runtimeOutputPath = PathUtility.EnsureTrailingSlash(Path.GetFullPath(outputPath)); - } - - var intermediateOutputPath = PathUtility.EnsureTrailingSlash(Path.Combine( - resolvedBuildBasePath, - ObjDirectoryName, - configuration, - framework.GetTwoDigitShortFolderName())); - - var compilationFiles = new CompilationOutputFiles(compilationOutputPath, project, configuration, framework); - - RuntimeOutputFiles runtimeFiles = new RuntimeOutputFiles(runtimeOutputPath, project, configuration, framework, runtimeIdentifier); - return new OutputPaths(intermediateOutputPath, compilationOutputPath, runtimeOutputPath, compilationFiles, runtimeFiles); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/PackOptions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/PackOptions.cs deleted file mode 100644 index 0172c5fd0..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/PackOptions.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 Microsoft.DotNet.Internal.ProjectModel.Files; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal class PackOptions - { - public string[] Tags { get; set; } - - public string[] Owners { get; set; } - - public string ReleaseNotes { get; set; } - - public string IconUrl { get; set; } - - public string ProjectUrl { get; set; } - - public string LicenseUrl { get; set; } - - public bool RequireLicenseAcceptance { get; set; } - - public string RepositoryType { get; set; } - - public string RepositoryUrl { get; set; } - - public string Summary { get; set; } - - public IncludeContext PackInclude { get; set; } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/PackageDescription.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/PackageDescription.cs deleted file mode 100644 index a296f0946..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/PackageDescription.cs +++ /dev/null @@ -1,53 +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.Internal.ProjectModel.Resolution; -using NuGet.LibraryModel; -using NuGet.ProjectModel; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal class PackageDescription : TargetLibraryWithAssets - { - public PackageDescription( - string path, - string hashPath, - LockFileLibrary package, - LockFileTargetLibrary lockFileLibrary, - IEnumerable dependencies, - bool compatible, - bool resolved) - : base( - new LibraryIdentity(package.Name, package.Version, LibraryType.Package), - "sha512-" + package.Sha512, - path, - lockFileLibrary, - dependencies, - resolved: resolved, - compatible: compatible, - framework: null) - { - HashPath = hashPath; - PackageLibrary = package; - } - - public string HashPath { get; } - - public LockFileLibrary PackageLibrary { get; } - - public override IEnumerable RuntimeAssemblies => FilterPlaceholders(base.RuntimeAssemblies); - - public override IEnumerable CompileTimeAssemblies => FilterPlaceholders(base.CompileTimeAssemblies); - - public bool HasCompileTimePlaceholder => - base.CompileTimeAssemblies.Any() && - base.CompileTimeAssemblies.All(a => PackageDependencyProvider.IsPlaceholderFile(a.Path)); - - private static IEnumerable FilterPlaceholders(IEnumerable items) - { - return items.Where(a => !PackageDependencyProvider.IsPlaceholderFile(a.Path)); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Project.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Project.cs deleted file mode 100644 index f2177ad57..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Project.cs +++ /dev/null @@ -1,156 +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.Internal.ProjectModel.Files; -using NuGet.Frameworks; -using NuGet.Versioning; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal class Project - { - public static readonly string FileName = "project.json"; - - // REVIEW: It's kinda hacky making these internal but the reader needs to set them - internal Dictionary _targetFrameworks = new Dictionary(); - internal Dictionary _compilerOptionsByConfiguration = new Dictionary(StringComparer.OrdinalIgnoreCase); - - internal CommonCompilerOptions _defaultCompilerOptions; - internal TargetFrameworkInformation _defaultTargetFrameworkConfiguration; - - public Project() - { - } - - public string ProjectFilePath { get; set; } - - public string ProjectDirectory - { - get - { - return Path.GetDirectoryName(ProjectFilePath); - } - } - - public AnalyzerOptions AnalyzerOptions { get; set; } - - public string Name { get; set; } - - public string Title { get; set; } - - public string Description { get; set; } - - public string Copyright { get; set; } - - public string Language { get; set; } - - public string[] Authors { get; set; } - - public bool EmbedInteropTypes { get; set; } - - public NuGetVersion Version { get; set; } - - public Version AssemblyFileVersion { get; set; } - - public IList Dependencies { get; set; } - - public List Tools { get; set; } - - public string EntryPoint { get; set; } - - public string TestRunner { get; set; } - - public ProjectFilesCollection Files { get; set; } - - public PackOptions PackOptions { get; set; } - - public bool Serviceable { get; set; } - - public RuntimeOptions RuntimeOptions { get; set; } - - public IList Runtimes { get; set; } - - public IDictionary Commands { get; } = new Dictionary(StringComparer.OrdinalIgnoreCase); - - public IDictionary> Scripts { get; } = new Dictionary>(StringComparer.OrdinalIgnoreCase); - - public string RawRuntimeOptions { get; set; } - - public IncludeContext PublishOptions { get; set; } - - public List Diagnostics { get; } = new List(); - - public bool IsTestProject => !string.IsNullOrEmpty(TestRunner); - - public IEnumerable GetTargetFrameworks() - { - return _targetFrameworks.Values; - } - - public IEnumerable GetConfigurations() - { - return _compilerOptionsByConfiguration.Keys; - } - - public CommonCompilerOptions GetCompilerOptions(NuGetFramework targetFramework, string configurationName) - { - // Get all project options and combine them - var rootOptions = GetCompilerOptions(); - var configurationOptions = configurationName != null ? GetRawCompilerOptions(configurationName) : null; - var targetFrameworkOptions = targetFramework != null ? GetRawCompilerOptions(targetFramework) : null; - - // Combine all of the options - var compilerOptions = CommonCompilerOptions.Combine(rootOptions, configurationOptions, targetFrameworkOptions); - - if (compilerOptions.OutputName == null) - { - compilerOptions.OutputName = Name; - } - - return compilerOptions; - } - - public TargetFrameworkInformation GetTargetFramework(NuGetFramework targetFramework) - { - TargetFrameworkInformation targetFrameworkInfo = null; - if (targetFramework != null && _targetFrameworks.TryGetValue(targetFramework, out targetFrameworkInfo)) - { - return targetFrameworkInfo; - } - - return targetFrameworkInfo ?? _defaultTargetFrameworkConfiguration; - } - - public bool HasRuntimeOutput(string configuration) - { - var compilerOptions = GetCompilerOptions(targetFramework: null, configurationName: configuration); - - // TODO: Make this opt in via another mechanism - return compilerOptions.EmitEntryPoint.GetValueOrDefault() || IsTestProject; - } - - private CommonCompilerOptions GetCompilerOptions() - { - return _defaultCompilerOptions; - } - - internal CommonCompilerOptions GetRawCompilerOptions(string configurationName) - { - CommonCompilerOptions options; - if (_compilerOptionsByConfiguration.TryGetValue(configurationName, out options)) - { - return options; - } - - return null; - } - - internal CommonCompilerOptions GetRawCompilerOptions(NuGetFramework frameworkName) - { - return GetTargetFramework(frameworkName)?.CompilerOptions; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContext.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContext.cs deleted file mode 100644 index df8b73458..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContext.cs +++ /dev/null @@ -1,171 +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.IO; -using System.Linq; -using Microsoft.DotNet.Internal.ProjectModel.Compilation; -using Microsoft.DotNet.Internal.ProjectModel.Resolution; -using NuGet.Frameworks; -using NuGet.ProjectModel; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal class ProjectContext - { - private string[] _runtimeFallbacks; - - public ProjectContextIdentity Identity { get; } - - public GlobalSettings GlobalSettings { get; } - - public ProjectDescription RootProject { get; } - - public NuGetFramework TargetFramework { get; } - - public LibraryDescription PlatformLibrary { get; } - - public bool IsPortable { get; } - - public string RuntimeIdentifier { get; } - - public Project ProjectFile => RootProject?.Project; - - public LockFile LockFile { get; } - - public string RootDirectory => GlobalSettings?.DirectoryPath; - - public string ProjectDirectory => ProjectFile?.ProjectDirectory; - - public string PackagesDirectory { get; } - - public LibraryManager LibraryManager { get; } - - public List Diagnostics { get; } - - internal ProjectContext( - GlobalSettings globalSettings, - ProjectDescription rootProject, - LibraryDescription platformLibrary, - NuGetFramework targetFramework, - bool isPortable, - string runtimeIdentifier, - string packagesDirectory, - LibraryManager libraryManager, - LockFile lockfile, - List diagnostics) - { - Identity = new ProjectContextIdentity(rootProject?.Path, targetFramework); - GlobalSettings = globalSettings; - RootProject = rootProject; - PlatformLibrary = platformLibrary; - TargetFramework = targetFramework; - RuntimeIdentifier = runtimeIdentifier; - PackagesDirectory = packagesDirectory; - LibraryManager = libraryManager; - LockFile = lockfile; - IsPortable = isPortable; - Diagnostics = diagnostics; - } - - public LibraryExporter CreateExporter(string configuration, string buildBasePath = null) - { - if (IsPortable && RuntimeIdentifier != null && _runtimeFallbacks == null) - { - var graph = RuntimeGraphCollector.Collect(LibraryManager.GetLibraries()); - _runtimeFallbacks = graph.ExpandRuntime(RuntimeIdentifier).ToArray(); - } - return new LibraryExporter(RootProject, - LibraryManager, - configuration, - RuntimeIdentifier, - _runtimeFallbacks, - buildBasePath, - RootDirectory); - } - - /// - /// Creates a project context for the project located at , - /// specifically in the context of the framework specified in - /// - public static ProjectContext Create(string projectPath, NuGetFramework framework) - { - return Create(projectPath, framework, Enumerable.Empty()); - } - - /// - /// Creates a project context for the project located at , - /// specifically in the context of the framework specified in - /// and the candidate runtime identifiers specified in - /// - public static ProjectContext Create(string projectPath, NuGetFramework framework, IEnumerable runtimeIdentifiers) - { - if (projectPath.EndsWith(Project.FileName)) - { - projectPath = Path.GetDirectoryName(projectPath); - } - return new ProjectContextBuilder() - .WithProjectDirectory(projectPath) - .WithTargetFramework(framework) - .WithRuntimeIdentifiers(runtimeIdentifiers) - .Build(); - } - - public static ProjectContextBuilder CreateBuilder(string projectPath, NuGetFramework framework) - { - if (projectPath.EndsWith(Project.FileName)) - { - projectPath = Path.GetDirectoryName(projectPath); - } - return new ProjectContextBuilder() - .WithProjectDirectory(projectPath) - .WithTargetFramework(framework); - } - - /// - /// Creates a project context for each framework located in the project at - /// - public static IEnumerable CreateContextForEachFramework(string projectPath, ProjectReaderSettings settings = null, IEnumerable runtimeIdentifiers = null) - { - if (!projectPath.EndsWith(Project.FileName)) - { - projectPath = Path.Combine(projectPath, Project.FileName); - } - var project = ProjectReader.GetProject(projectPath, settings); - - foreach (var framework in project.GetTargetFrameworks()) - { - yield return new ProjectContextBuilder() - .WithProject(project) - .WithTargetFramework(framework.FrameworkName) - .WithProjectReaderSettings(settings) - .WithRuntimeIdentifiers(runtimeIdentifiers ?? Enumerable.Empty()) - .Build(); - } - } - - /// - /// Creates a project context for each target located in the project at - /// - public static IEnumerable CreateContextForEachTarget(string projectPath, ProjectReaderSettings settings = null) - { - var project = ProjectReader.GetProject(projectPath); - - return new ProjectContextBuilder() - .WithProjectReaderSettings(settings) - .WithProject(project) - .BuildAllTargets(); - } - - public OutputPaths GetOutputPaths(string configuration, string buidBasePath = null, string outputPath = null) - { - return OutputPathsCalculator.GetOutputPaths(ProjectFile, - TargetFramework, - RuntimeIdentifier, - configuration, - RootDirectory, - buidBasePath, - outputPath); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContextBuilder.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContextBuilder.cs deleted file mode 100644 index de60159f8..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContextBuilder.cs +++ /dev/null @@ -1,708 +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.Text; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.PlatformAbstractions; -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.Internal.ProjectModel -{ - 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 - - private Project Project { get; set; } - - private LockFile LockFile { get; set; } - - private NuGetFramework TargetFramework { get; set; } - - private IEnumerable RuntimeIdentifiers { get; set; } = Enumerable.Empty(); - - private string RootDirectory { get; set; } - - private string ProjectDirectory { get; set; } - - private string PackagesDirectory { get; set; } - - private string ReferenceAssembliesPath { get; set; } - - private bool IsDesignTime { get; set; } - - private Func ProjectResolver { get; set; } - - private Func LockFileResolver { get; set; } - - private ProjectReaderSettings ProjectReaderSettings { get; set; } = ProjectReaderSettings.ReadFromEnvironment(); - - public ProjectContextBuilder() - { - ProjectResolver = ResolveProject; - LockFileResolver = ResolveLockFile; - } - - public ProjectContextBuilder Clone() - { - var builder = new ProjectContextBuilder() - .WithLockFile(LockFile) - .WithProject(Project) - .WithProjectDirectory(ProjectDirectory) - .WithTargetFramework(TargetFramework) - .WithRuntimeIdentifiers(RuntimeIdentifiers) - .WithReferenceAssembliesPath(ReferenceAssembliesPath) - .WithPackagesDirectory(PackagesDirectory) - .WithRootDirectory(RootDirectory) - .WithProjectResolver(ProjectResolver) - .WithLockFileResolver(LockFileResolver) - .WithProjectReaderSettings(ProjectReaderSettings); - if (IsDesignTime) - { - builder.AsDesignTime(); - } - - return builder; - } - - public ProjectContextBuilder WithLockFile(LockFile lockFile) - { - LockFile = lockFile; - return this; - } - - public ProjectContextBuilder WithProject(Project project) - { - Project = project; - return this; - } - - public ProjectContextBuilder WithProjectDirectory(string projectDirectory) - { - ProjectDirectory = projectDirectory; - return this; - } - - public ProjectContextBuilder WithTargetFramework(NuGetFramework targetFramework) - { - TargetFramework = targetFramework; - return this; - } - - public ProjectContextBuilder WithTargetFramework(string targetFramework) - { - TargetFramework = NuGetFramework.Parse(targetFramework); - return this; - } - - public ProjectContextBuilder WithRuntimeIdentifiers(IEnumerable runtimeIdentifiers) - { - RuntimeIdentifiers = runtimeIdentifiers; - return this; - } - - public ProjectContextBuilder WithReferenceAssembliesPath(string referenceAssembliesPath) - { - ReferenceAssembliesPath = referenceAssembliesPath; - return this; - } - - public ProjectContextBuilder WithPackagesDirectory(string packagesDirectory) - { - PackagesDirectory = packagesDirectory; - return this; - } - - public ProjectContextBuilder WithRootDirectory(string rootDirectory) - { - RootDirectory = rootDirectory; - return this; - } - - public ProjectContextBuilder WithProjectResolver(Func projectResolver) - { - ProjectResolver = projectResolver; - return this; - } - - public ProjectContextBuilder WithLockFileResolver(Func lockFileResolver) - { - LockFileResolver = lockFileResolver; - return this; - } - - public ProjectContextBuilder WithProjectReaderSettings(ProjectReaderSettings projectReaderSettings) - { - ProjectReaderSettings = projectReaderSettings; - return this; - } - - public ProjectContextBuilder AsDesignTime() - { - IsDesignTime = true; - return this; - } - - /// - /// Produce all targets found in the lock file associated with this builder. - /// Returns an empty enumerable if there is no lock file - /// (making this unsuitable for scenarios where the lock file may not be present, - /// such as at design-time) - /// - /// - public IEnumerable BuildAllTargets() - { - ProjectDirectory = Project?.ProjectDirectory ?? ProjectDirectory; - EnsureProjectLoaded(); - LockFile = LockFile ?? LockFileResolver(ProjectDirectory); - - if (LockFile != null) - { - var deduper = new HashSet(); - foreach (var target in LockFile.Targets) - { - var context = Clone() - .WithTargetFramework(target.TargetFramework) - .WithRuntimeIdentifiers(new[] { target.RuntimeIdentifier }).Build(); - - var id = $"{context.TargetFramework}/{context.RuntimeIdentifier}"; - if (deduper.Add(id)) - { - yield return context; - } - } - } - else - { - // Build a context for each framework. It won't be fully valid, since it won't have resolved data or runtime data, but the diagnostics will show that. - foreach (var framework in Project.GetTargetFrameworks()) - { - var builder = new ProjectContextBuilder() - .WithProject(Project) - .WithTargetFramework(framework.FrameworkName); - if (IsDesignTime) - { - builder.AsDesignTime(); - } - yield return builder.Build(); - } - } - } - - public ProjectContext Build() - { - var diagnostics = new List(); - - ProjectDirectory = Project?.ProjectDirectory ?? ProjectDirectory; - - GlobalSettings globalSettings = null; - if (ProjectDirectory != null) - { - RootDirectory = ProjectRootResolver.ResolveRootDirectory(ProjectDirectory); - GlobalSettings.TryGetGlobalSettings(RootDirectory, out globalSettings); - } - - RootDirectory = globalSettings?.DirectoryPath ?? RootDirectory; - - FrameworkReferenceResolver frameworkReferenceResolver; - if (string.IsNullOrEmpty(ReferenceAssembliesPath)) - { - // Use the default static resolver - frameworkReferenceResolver = FrameworkReferenceResolver.Default; - } - else - { - frameworkReferenceResolver = new FrameworkReferenceResolver(ReferenceAssembliesPath); - } - - LockFileLookup lockFileLookup = null; - EnsureProjectLoaded(); - - ReadLockFile(diagnostics); - - // some callers only give ProjectContextBuilder a LockFile - ProjectDirectory = ProjectDirectory ?? TryGetProjectDirectoryFromLockFile(); - - INuGetPathContext nugetPathContext = null; - if (ProjectDirectory != null) - { - nugetPathContext = NuGetPathContext.Create(ProjectDirectory); - } - - PackagesDirectory = PackagesDirectory ?? nugetPathContext?.UserPackageFolder; - - var validLockFile = true; - string lockFileValidationMessage = null; - - if (LockFile != null) - { - if (Project != null) - { - validLockFile = LockFile.IsValidForProject(Project, out lockFileValidationMessage); - } - - lockFileLookup = new LockFileLookup(LockFile); - } - - var libraries = new Dictionary(); - var projectResolver = new ProjectDependencyProvider(ProjectResolver); - - ProjectDescription mainProject = null; - if (Project != null) - { - mainProject = projectResolver.GetDescription(TargetFramework, Project, targetLibrary: null); - - // Add the main project - libraries.Add(new LibraryKey(mainProject.Identity.Name), mainProject); - } - - ProjectLibraryDependency platformDependency = null; - if (mainProject != null) - { - platformDependency = mainProject.Dependencies - .Where(d => d.Type.Equals(LibraryDependencyType.Platform)) - .Cast() - .FirstOrDefault(); - } - bool isPortable = platformDependency != null; - - LockFileTarget target = null; - LibraryDescription platformLibrary = null; - - if (lockFileLookup != null) - { - target = SelectTarget(LockFile, isPortable); - if (target != null) - { - var nugetPackageResolver = new PackageDependencyProvider(nugetPathContext, frameworkReferenceResolver); - var msbuildProjectResolver = new MSBuildDependencyProvider(Project, ProjectResolver); - ScanLibraries(target, lockFileLookup, libraries, msbuildProjectResolver, nugetPackageResolver, projectResolver); - - if (platformDependency != null) - { - libraries.TryGetValue(new LibraryKey(platformDependency.Name), out platformLibrary); - } - } - } - - string runtime = target?.RuntimeIdentifier; - if (string.IsNullOrEmpty(runtime) && TargetFramework.IsDesktop()) - { - // we got a ridless target for desktop so turning portable mode on - isPortable = true; - var legacyRuntime = RuntimeEnvironmentRidExtensions.GetLegacyRestoreRuntimeIdentifier(); - if (RuntimeIdentifiers.Contains(legacyRuntime)) - { - runtime = legacyRuntime; - } - else - { - runtime = RuntimeIdentifiers.FirstOrDefault(); - } - } - - var referenceAssemblyDependencyResolver = new ReferenceAssemblyDependencyResolver(frameworkReferenceResolver); - bool requiresFrameworkAssemblies; - - // Resolve the dependencies - ResolveDependencies(libraries, referenceAssemblyDependencyResolver, out requiresFrameworkAssemblies); - - // REVIEW: Should this be in NuGet (possibly stored in the lock file?) - if (LockFile == null) - { - diagnostics.Add(new DiagnosticMessage( - ErrorCodes.NU1009, - $"The expected lock file doesn't exist. Please run \"dotnet restore\" to generate a new lock file.", - Path.Combine(Project.ProjectDirectory, LockFileFormat.LockFileName), - DiagnosticMessageSeverity.Error)); - } - - if (!validLockFile) - { - diagnostics.Add(new DiagnosticMessage( - ErrorCodes.NU1006, - $"{lockFileValidationMessage}. Please run \"dotnet restore\" to generate a new lock file.", - Path.Combine(Project.ProjectDirectory, LockFileFormat.LockFileName), - DiagnosticMessageSeverity.Warning)); - } - - if (requiresFrameworkAssemblies) - { - var frameworkInfo = Project.GetTargetFramework(TargetFramework); - - if (frameworkReferenceResolver == null || string.IsNullOrEmpty(frameworkReferenceResolver.ReferenceAssembliesPath)) - { - // If there was an attempt to use reference assemblies but they were not installed - // report an error - diagnostics.Add(new DiagnosticMessage( - ErrorCodes.DOTNET1012, - $"The reference assemblies directory was not specified. You can set the location using the DOTNET_REFERENCE_ASSEMBLIES_PATH environment variable.", - filePath: Project.ProjectFilePath, - severity: DiagnosticMessageSeverity.Error, - startLine: frameworkInfo.Line, - startColumn: frameworkInfo.Column - )); - } - else if (!frameworkReferenceResolver.IsInstalled(TargetFramework)) - { - // If there was an attempt to use reference assemblies but they were not installed - // report an error - diagnostics.Add(new DiagnosticMessage( - ErrorCodes.DOTNET1011, - $"Framework not installed: {TargetFramework.DotNetFrameworkName} in {ReferenceAssembliesPath}", - filePath: Project.ProjectFilePath, - severity: DiagnosticMessageSeverity.Error, - startLine: frameworkInfo.Line, - startColumn: frameworkInfo.Column - )); - } - } - - List allDiagnostics = new List(diagnostics); - if (Project != null) - { - allDiagnostics.AddRange(Project.Diagnostics); - } - - // Create a library manager - var libraryManager = new LibraryManager(libraries.Values.ToList(), allDiagnostics, Project?.ProjectFilePath); - - return new ProjectContext( - globalSettings, - mainProject, - platformLibrary, - TargetFramework, - isPortable, - runtime, - PackagesDirectory, - libraryManager, - LockFile, - diagnostics); - } - - private string TryGetProjectDirectoryFromLockFile() - { - string result = null; - - if (LockFile != null && !string.IsNullOrEmpty(LockFile.Path)) - { - result = Path.GetDirectoryName(LockFile.Path); - } - - return result; - } - - private void ReadLockFile(ICollection diagnostics) - { - try - { - LockFile = LockFile ?? LockFileResolver(ProjectDirectory); - } - catch (FileFormatException e) - { - var lockFilePath = ""; - if (LockFile != null) - { - lockFilePath = LockFile.Path; - } - else if (Project != null) - { - lockFilePath = Path.Combine(Project.ProjectDirectory, LockFileFormat.LockFileName); - } - - diagnostics.Add(new DiagnosticMessage( - ErrorCodes.DOTNET1014, - ComposeMessageFromInnerExceptions(e), - lockFilePath, - DiagnosticMessageSeverity.Error)); - } - } - - private static string ComposeMessageFromInnerExceptions(Exception exception) - { - var sb = new StringBuilder(); - var messages = new HashSet(); - - while (exception != null) - { - messages.Add(exception.Message); - exception = exception.InnerException; - } - - foreach (var message in messages) - { - sb.AppendLine(message); - } - - return sb.ToString(); - } - - private void ResolveDependencies(Dictionary libraries, - ReferenceAssemblyDependencyResolver referenceAssemblyDependencyResolver, - out bool requiresFrameworkAssemblies) - { - // Remark: the LibraryType in the key of the given dictionary are all "Unspecified" at the beginning. - requiresFrameworkAssemblies = false; - - foreach (var pair in libraries.ToList()) - { - var library = pair.Value; - - // The System.* packages provide placeholders on any non netstandard platform - // To make them work seamlessly on those platforms, we fill the gap with a reference - // assembly (if available) - var package = library as PackageDescription; - if (package != null && - package.Resolved && - package.HasCompileTimePlaceholder && - !TargetFramework.IsPackageBased) - { - // requiresFrameworkAssemblies is true whenever we find a CompileTimePlaceholder in a non-package based framework, even if - // the reference is unresolved. This ensures the best error experience when someone is building on a machine without - // the target framework installed. - requiresFrameworkAssemblies = true; - - var newKey = new LibraryKey(library.Identity.Name, LibraryType.Reference); - var dependency = new ProjectLibraryDependency - { - LibraryRange = new LibraryRange(library.Identity.Name, LibraryDependencyTarget.Reference) - }; - - var replacement = referenceAssemblyDependencyResolver.GetDescription(dependency, TargetFramework); - - // If the reference is unresolved, just skip it. Don't replace the package dependency - if (replacement == null) - { - continue; - } - - // Remove the original package reference - libraries.Remove(pair.Key); - - // Insert a reference assembly key if there isn't one - if (!libraries.ContainsKey(newKey)) - { - libraries[newKey] = replacement; - } - } - } - - foreach (var pair in libraries.ToList()) - { - var library = pair.Value; - library.Framework = library.Framework ?? TargetFramework; - foreach (var dependency in library.Dependencies) - { - var keyType = dependency.LibraryRange.TypeConstraint == LibraryDependencyTarget.Reference ? - LibraryType.Reference : - (LibraryType?) null; - - var key = new LibraryKey(dependency.Name, keyType); - - LibraryDescription dependencyDescription; - if (!libraries.TryGetValue(key, out dependencyDescription)) - { - if (keyType == LibraryType.Reference) - { - // a dependency is specified to be reference assembly but fail to match - // then add a unresolved dependency - dependencyDescription = referenceAssemblyDependencyResolver.GetDescription(dependency, TargetFramework) ?? - UnresolvedDependencyProvider.GetDescription(dependency, TargetFramework); - libraries[key] = dependencyDescription; - } - else if (!libraries.TryGetValue(new LibraryKey(dependency.Name, LibraryType.Reference), out dependencyDescription)) - { - // a dependency which type is unspecified fails to match, then try to find a - // reference assembly type dependency - dependencyDescription = UnresolvedDependencyProvider.GetDescription(dependency, TargetFramework); - libraries[key] = dependencyDescription; - } - } - - dependencyDescription.RequestedRanges.Add(dependency); - dependencyDescription.Parents.Add(library); - } - } - - // Deduplicate libraries with the same name - // Priority list is backwards so not found -1 would be last when sorting by descending - var priorities = new[] { LibraryType.Package, LibraryType.Project, LibraryType.Reference }; - var nameGroups = libraries.Keys.ToLookup(libraryKey => libraryKey.Name); - foreach (var nameGroup in nameGroups) - { - var librariesToRemove = nameGroup - .OrderByDescending(libraryKey => Array.IndexOf(priorities, libraryKey.LibraryType)) - .Skip(1); - - foreach (var library in librariesToRemove) - { - libraries.Remove(library); - } - } - } - - private void ScanLibraries(LockFileTarget target, - LockFileLookup lockFileLookup, - Dictionary libraries, - MSBuildDependencyProvider msbuildResolver, - PackageDependencyProvider packageResolver, - ProjectDependencyProvider projectResolver) - { - foreach (var library in target.Libraries) - { - LibraryDescription description = null; - LibraryDependencyTarget type = LibraryDependencyTarget.All; - - if (string.Equals(library.Type, "project")) - { - var projectLibrary = lockFileLookup.GetProject(library.Name); - - if (projectLibrary != null) - { - if (MSBuildDependencyProvider.IsMSBuildProjectLibrary(projectLibrary)) - { - description = msbuildResolver.GetDescription(TargetFramework, projectLibrary, library, IsDesignTime); - type = LibraryDependencyTarget.Project; - } - else - { - var path = Path.GetFullPath(Path.Combine(ProjectDirectory, projectLibrary.Path)); - description = projectResolver.GetDescription(library.Name, path, library, ProjectResolver); - type = LibraryDependencyTarget.Project; - } - } - } - else - { - var packageEntry = lockFileLookup.GetPackage(library.Name, library.Version); - - if (packageEntry != null) - { - description = packageResolver.GetDescription(TargetFramework, packageEntry, library); - } - - type = LibraryDependencyTarget.Package; - } - - description = description ?? - UnresolvedDependencyProvider.GetDescription( - new ProjectLibraryDependency - { - LibraryRange = new LibraryRange(library.Name, type) - }, - target.TargetFramework); - - libraries.Add(new LibraryKey(library.Name), description); - } - } - - private void EnsureProjectLoaded() - { - if (Project == null && ProjectDirectory != null) - { - Project = ProjectResolver(ProjectDirectory); - if (Project == null) - { - throw new InvalidOperationException($"Could not resolve project at: {ProjectDirectory}. " + - $"This could happen when project.lock.json was moved after restore."); - } - } - } - - private LockFileTarget SelectTarget(LockFile lockFile, bool isPortable) - { - if (!isPortable) - { - foreach (var runtimeIdentifier in RuntimeIdentifiers) - { - foreach (var scanTarget in lockFile.Targets) - { - if (Equals(scanTarget.TargetFramework, TargetFramework) && string.Equals(scanTarget.RuntimeIdentifier, runtimeIdentifier, StringComparison.Ordinal)) - { - return scanTarget; - } - } - } - } - - foreach (var scanTarget in lockFile.Targets) - { - if (Equals(scanTarget.TargetFramework, TargetFramework) && string.IsNullOrEmpty(scanTarget.RuntimeIdentifier)) - { - return scanTarget; - } - } - - return null; - } - - private Project ResolveProject(string projectDirectory) - { - Project project; - if (ProjectReader.TryGetProject(projectDirectory, out project, settings: ProjectReaderSettings)) - { - return project; - } - else - { - return null; - } - } - - private static LockFile ResolveLockFile(string projectDir) - { - var projectLockJsonPath = Path.Combine(projectDir, LockFileFormat.LockFileName); - return File.Exists(projectLockJsonPath) ? - new LockFileFormat().Read(Path.Combine(projectDir, LockFileFormat.LockFileName)) : - null; - } - - private struct LibraryKey - { - public LibraryKey(string name) : this(name, null) - { - } - - public LibraryKey(string name, LibraryType? libraryType) - { - Name = name; - LibraryType = libraryType; - } - - public string Name { get; } - public LibraryType? LibraryType { get; } - - public override bool Equals(object obj) - { - var otherKey = (LibraryKey)obj; - - return string.Equals(otherKey.Name, Name, StringComparison.OrdinalIgnoreCase) && - otherKey.LibraryType.Equals(LibraryType); - } - - public override int GetHashCode() - { - var combiner = new HashCodeCombiner(); - combiner.Add(Name.ToLowerInvariant()); - combiner.Add(LibraryType); - - return combiner.CombinedHash; - } - - public override string ToString() - { - return Name + " " + LibraryType; - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContextCollection.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContextCollection.cs deleted file mode 100644 index 5b697382d..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContextCollection.cs +++ /dev/null @@ -1,85 +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 NuGet.Frameworks; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal class ProjectContextCollection - { - public Project Project { get; set; } - - /// - /// Gets all the ProjectContexts in this collection - /// - public List ProjectContexts { get; } = new List(); - - /// - /// Gets the ProjectContexts in this collection which are not runtime-specific (i.e. the ones used for compilation) - /// - public IEnumerable FrameworkOnlyContexts => ProjectContexts.Where(c => string.IsNullOrEmpty(c.RuntimeIdentifier)); - - public List ProjectDiagnostics { get; } = new List(); - - public string LockFilePath { get; set; } - - public string ProjectFilePath { get; set; } - - public DateTime LastProjectFileWriteTimeUtc { get; set; } - - public DateTime LastLockFileWriteTimeUtc { get; set; } - - public bool HasChanged - { - get - { - if (ProjectFilePath == null || !File.Exists(ProjectFilePath)) - { - return true; - } - - if (LastProjectFileWriteTimeUtc < File.GetLastWriteTimeUtc(ProjectFilePath)) - { - return true; - } - - if (LockFilePath == null || !File.Exists(LockFilePath)) - { - return true; - } - - if (LastLockFileWriteTimeUtc < File.GetLastWriteTimeUtc(LockFilePath)) - { - return true; - } - - return false; - } - } - - public ProjectContext GetTarget(NuGetFramework targetFramework) => GetTarget(targetFramework, string.Empty); - - public ProjectContext GetTarget(NuGetFramework targetFramework, string runtimeIdentifier) - { - return ProjectContexts - .FirstOrDefault(c => - Equals(c.TargetFramework, targetFramework) && - string.Equals(c.RuntimeIdentifier ?? string.Empty, runtimeIdentifier ?? string.Empty)); - } - - public void Reset() - { - Project = null; - ProjectContexts.Clear(); - ProjectFilePath = null; - LockFilePath = null; - LastLockFileWriteTimeUtc = DateTime.MinValue; - LastProjectFileWriteTimeUtc = DateTime.MinValue; - ProjectDiagnostics.Clear(); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContextIdentity.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContextIdentity.cs deleted file mode 100644 index fbd95238f..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectContextIdentity.cs +++ /dev/null @@ -1,39 +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.PlatformAbstractions; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - public struct ProjectContextIdentity - { - public ProjectContextIdentity(string path, NuGetFramework targetFramework) - { - Path = path; - TargetFramework = targetFramework; - } - - public string Path { get; } - public NuGetFramework TargetFramework { get; } - - public bool Equals(ProjectContextIdentity other) - { - return string.Equals(Path, other.Path) && Equals(TargetFramework, other.TargetFramework); - } - - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) return false; - return obj is ProjectContextIdentity && Equals((ProjectContextIdentity) obj); - } - - public override int GetHashCode() - { - var combiner = HashCodeCombiner.Start(); - combiner.Add(Path); - combiner.Add(TargetFramework); - return combiner.CombinedHash; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectDescription.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectDescription.cs deleted file mode 100644 index 0b773f0e0..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectDescription.cs +++ /dev/null @@ -1,59 +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 NuGet.LibraryModel; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal class ProjectDescription : LibraryDescription - { - // Create an unresolved project description - public ProjectDescription(string name, string path) - : base( - new LibraryIdentity(name, null, LibraryType.Project), - string.Empty, // Projects don't have hashes - path, - Enumerable.Empty(), - framework: null, - resolved: false, - compatible: false) - { - } - - public ProjectDescription( - LibraryRange libraryRange, - Project project, - IEnumerable dependencies, - TargetFrameworkInformation targetFrameworkInfo, - bool resolved) : - base( - new LibraryIdentity(project.Name, project.Version, LibraryType.Project), - string.Empty, // Projects don't have hashes - project.ProjectFilePath, - dependencies, - targetFrameworkInfo.FrameworkName, - resolved, - compatible: true) - { - Project = project; - TargetFrameworkInfo = targetFrameworkInfo; - } - - public Project Project { get; } - - public TargetFrameworkInformation TargetFrameworkInfo { get; } - - public OutputPaths GetOutputPaths(string buildBasePath, string solutionRootPath, string configuration, string runtime) - { - return OutputPathsCalculator.GetOutputPaths(Project, - Framework, - runtimeIdentifier: runtime, - configuration: configuration, - solutionRootPath: solutionRootPath, - buildBasePath: buildBasePath, - outputPath: null); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectExtensions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectExtensions.cs deleted file mode 100644 index b7300c994..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectExtensions.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.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal static class ProjectExtensions - { - private static readonly KeyValuePair[] _compilerNameToLanguageId = - { - new KeyValuePair("csc", "cs"), - new KeyValuePair("vbc", "vb"), - new KeyValuePair("fsc", "fs") - }; - - public static string GetSourceCodeLanguage(this Project project) - { - foreach (var kvp in _compilerNameToLanguageId) - { - if (kvp.Key == (project._defaultCompilerOptions.CompilerName)) - { - return kvp.Value; - } - } - return null; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectFileDependencyGroup.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectFileDependencyGroup.cs deleted file mode 100644 index a82db9434..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectFileDependencyGroup.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 System.Collections.Generic; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal class ProjectFileDependencyGroup - { - public ProjectFileDependencyGroup(NuGetFramework frameworkName, IEnumerable dependencies) - { - FrameworkName = frameworkName; - Dependencies = dependencies; - } - - public NuGetFramework FrameworkName { get; } - - public IEnumerable Dependencies { get; } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectModelPlatformExtensions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectModelPlatformExtensions.cs deleted file mode 100644 index d1aa74050..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectModelPlatformExtensions.cs +++ /dev/null @@ -1,82 +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.Internal.ProjectModel.Compilation; -using NuGet.LibraryModel; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal static class ProjectModelPlatformExtensions - { - public static HashSet GetPlatformExclusionList(this ProjectContext context, IDictionary exports) - { - var exclusionList = new HashSet(); - var redistPackage = context.PlatformLibrary; - if (redistPackage == null) - { - return exclusionList; - } - - var redistExport = exports[redistPackage.Identity.Name]; - - exclusionList.Add(redistExport.Library.Identity.Name); - CollectDependencies(exports, redistExport.Library.Dependencies, exclusionList); - return exclusionList; - } - - private static void CollectDependencies( - IDictionary exports, - IEnumerable dependencies, - HashSet exclusionList) - { - foreach (var dependency in dependencies) - { - var export = exports[dependency.Name]; - if (export.Library.Identity.Version.Equals(dependency.LibraryRange.VersionRange.MinVersion)) - { - exclusionList.Add(export.Library.Identity.Name); - CollectDependencies(exports, export.Library.Dependencies, exclusionList); - } - } - } - - public static HashSet GetTypeBuildExclusionList(this ProjectContext context, IDictionary exports) - { - var acceptedExports = new HashSet(); - - // Accept the root project, obviously :) - acceptedExports.Add(context.RootProject.Identity.Name); - - // Walk all dependencies, tagging exports. But don't walk through Build dependencies. - CollectNonBuildDependencies(exports, context.RootProject.Dependencies, acceptedExports); - - // Whatever is left in exports was brought in ONLY by a build dependency - var exclusionList = new HashSet(exports.Keys); - exclusionList.ExceptWith(acceptedExports); - return exclusionList; - } - - private static void CollectNonBuildDependencies( - IDictionary exports, - IEnumerable dependencies, - HashSet acceptedExports) - { - foreach (var dependency in dependencies) - { - var export = exports[dependency.Name]; - if (!dependency.Type.Equals(LibraryDependencyType.Build)) - { - acceptedExports.Add(export.Library.Identity.Name); - CollectNonBuildDependencies(exports, export.Library.Dependencies, acceptedExports); - } - } - } - - public static IEnumerable FilterExports(this IEnumerable exports, HashSet exclusionList) - { - return exports.Where(e => !exclusionList.Contains(e.Library.Identity.Name)); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectPathHelper.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectPathHelper.cs deleted file mode 100644 index 290952276..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectPathHelper.cs +++ /dev/null @@ -1,48 +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; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal static class ProjectPathHelper - { - public static string NormalizeProjectDirectoryPath(string path) - { - string fullPath = Path.GetFullPath(path); - - if (IsProjectFilePath(fullPath)) - { - return Path.GetDirectoryName(fullPath); - } - else if (IsDirectoryContainingProjectFile(fullPath)) - { - return fullPath; - } - - return null; - } - - public static string NormalizeProjectFilePath(string path) - { - if (!path.EndsWith(Project.FileName)) - { - path = Path.Combine(path, Project.FileName); - } - - return Path.GetFullPath(path); - } - - private static bool IsProjectFilePath(string path) - { - return File.Exists(path) && - string.Equals(Path.GetFileName(path), Project.FileName, StringComparison.OrdinalIgnoreCase); - } - - private static bool IsDirectoryContainingProjectFile(string path) - { - return Directory.Exists(path) && File.Exists(Path.Combine(path, Project.FileName)); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectReader.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectReader.cs deleted file mode 100644 index 298766d64..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectReader.cs +++ /dev/null @@ -1,1020 +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.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.Internal.ProjectModel -{ - internal class ProjectReader : IProjectReader - { - public static bool TryGetProject(string path, out Project project, ProjectReaderSettings settings = null) - { - project = null; - - string projectPath = null; - - if (string.Equals(Path.GetFileName(path), Project.FileName, StringComparison.OrdinalIgnoreCase)) - { - projectPath = path; - path = Path.GetDirectoryName(path); - } - else if (!HasProjectFile(path)) - { - return false; - } - else - { - projectPath = Path.Combine(path, Project.FileName); - } - - // Assume the directory name is the project name if none was specified - var projectName = PathUtility.GetDirectoryName(Path.GetFullPath(path)); - projectPath = Path.GetFullPath(projectPath); - - if (!File.Exists(projectPath)) - { - return false; - } - - try - { - using (var stream = File.OpenRead(projectPath)) - { - var reader = new ProjectReader(); - project = reader.ReadProject(stream, projectName, projectPath, settings); - } - } - catch (Exception ex) - { - throw FileFormatException.Create(ex, projectPath); - } - - return true; - } - - public static Project GetProject(string projectPath, ProjectReaderSettings settings = null) - { - return new ProjectReader().ReadProject(projectPath, settings); - } - - public Project ReadProject(string projectPath, ProjectReaderSettings settings) - { - projectPath = ProjectPathHelper.NormalizeProjectFilePath(projectPath); - - var name = Path.GetFileName(Path.GetDirectoryName(projectPath)); - - using (var stream = new FileStream(projectPath, FileMode.Open, FileAccess.Read, FileShare.Read)) - { - return ReadProject(stream, name, projectPath, settings); - } - } - - public Project ReadProject(Stream stream, string projectName, string projectPath, ProjectReaderSettings settings = null) - { - settings = settings ?? new ProjectReaderSettings(); - var project = new Project(); - - var reader = new StreamReader(stream); - JObject rawProject; - using (var jsonReader = new JsonTextReader(reader)) - { - rawProject = JObject.Load(jsonReader); - - // Try to read another token to ensure we're at the end of the document. - // This will no-op if we are, and throw a JsonReaderException if there is additional content (which is what we want) - jsonReader.Read(); - } - - if (rawProject == null) - { - throw FileFormatException.Create( - "The JSON file can't be deserialized to a JSON object.", - projectPath); - } - - // Meta-data properties - project.Name = rawProject.Value("name") ?? projectName; - project.ProjectFilePath = Path.GetFullPath(projectPath); - - var version = rawProject.Value("version"); - if (version == null) - { - project.Version = new NuGetVersion("1.0.0"); - } - else - { - try - { - var buildVersion = settings.VersionSuffix; - project.Version = SpecifySnapshot(version, buildVersion); - } - catch (Exception ex) - { - throw FileFormatException.Create(ex, version, project.ProjectFilePath); - } - } - - var fileVersion = settings.AssemblyFileVersion; - if (string.IsNullOrWhiteSpace(fileVersion)) - { - project.AssemblyFileVersion = project.Version.Version; - } - else - { - try - { - var simpleVersion = project.Version.Version; - project.AssemblyFileVersion = new Version(simpleVersion.Major, - simpleVersion.Minor, - simpleVersion.Build, - int.Parse(fileVersion)); - } - catch (FormatException ex) - { - throw new FormatException("The assembly file version is invalid: " + fileVersion, ex); - } - } - - project.Description = rawProject.Value("description"); - project.Copyright = rawProject.Value("copyright"); - project.Title = rawProject.Value("title"); - project.EntryPoint = rawProject.Value("entryPoint"); - project.TestRunner = rawProject.Value("testRunner"); - project.Authors = - rawProject.Value("authors")?.Values().ToArray() ?? EmptyArray.Value; - project.Language = rawProject.Value("language"); - - // REVIEW: Move this to the dependencies node? - project.EmbedInteropTypes = rawProject.Value("embedInteropTypes"); - - project.Dependencies = new List(); - - project.Tools = new List(); - - project.Runtimes = new List(); - - // Project files - project.Files = new ProjectFilesCollection(rawProject, project.ProjectDirectory, project.ProjectFilePath); - AddProjectFilesDeprecationDiagnostics(rawProject, project); - ConvertDeprecatedToSupportedFormat(rawProject); - - var commands = rawProject.Value("commands") as JObject; - if (commands != null) - { - foreach (var command in commands) - { - var commandValue = command.Value.Type == JTokenType.String ? command.Value.Value() : null; - if (commandValue != null) - { - project.Commands[command.Key] = commandValue; - } - } - } - - var scripts = rawProject.Value("scripts") as JObject; - if (scripts != null) - { - foreach (var script in scripts) - { - var stringValue = script.Value.Type == JTokenType.String ? script.Value.Value() : null; - if (stringValue != null) - { - project.Scripts[script.Key] = new string[] { stringValue }; - continue; - } - - var arrayValue = - script.Value.Type == JTokenType.Array ? script.Value.Values().ToArray() : null; - if (arrayValue != null) - { - project.Scripts[script.Key] = arrayValue; - continue; - } - - throw FileFormatException.Create( - string.Format("The value of a script in {0} can only be a string or an array of strings", Project.FileName), - script.Value, - project.ProjectFilePath); - } - } - - project.PackOptions = GetPackOptions(rawProject, project) ?? new PackOptions(); - project.RuntimeOptions = GetRuntimeOptions(rawProject) ?? new RuntimeOptions(); - project.PublishOptions = GetPublishInclude(rawProject, project); - - BuildTargetFrameworksAndConfigurations(project, rawProject); - - PopulateDependencies( - project.ProjectFilePath, - project.Dependencies, - rawProject, - "dependencies", - isGacOrFrameworkReference: false); - - PopulateDependencies( - project.ProjectFilePath, - project.Tools, - rawProject, - "tools", - isGacOrFrameworkReference: false); - - PopulateRuntimes(project.Runtimes, rawProject); - - - JToken runtimeOptionsToken; - if (rawProject.TryGetValue("runtimeOptions", out runtimeOptionsToken)) - { - var runtimeOptions = runtimeOptionsToken as JObject; - if (runtimeOptions == null) - { - throw FileFormatException.Create("The runtimeOptions must be an object", runtimeOptionsToken); - } - - project.RawRuntimeOptions = runtimeOptions.ToString(); - } - - return project; - } - - private static NuGetVersion SpecifySnapshot(string version, string snapshotValue) - { - if (version.EndsWith("-*")) - { - if (string.IsNullOrEmpty(snapshotValue)) - { - version = version.Substring(0, version.Length - 2); - } - else - { - version = version.Substring(0, version.Length - 1) + snapshotValue; - } - } - - return new NuGetVersion(version); - } - - private static void PopulateDependencies( - string projectPath, - IList results, - JObject settings, - string propertyName, - bool isGacOrFrameworkReference) - { - var dependencies = settings.Value(propertyName) as JObject; - if (dependencies != null) - { - foreach (var dependency in dependencies) - { - if (string.IsNullOrEmpty(dependency.Key)) - { - throw FileFormatException.Create( - "Unable to resolve dependency ''.", - dependency.Key, - projectPath); - } - - var dependencyValue = dependency.Value; - var dependencyTypeValue = LibraryDependencyType.Default; - - var dependencyIncludeFlagsValue = LibraryIncludeFlags.All; - var dependencyExcludeFlagsValue = LibraryIncludeFlags.None; - var suppressParentFlagsValue = LibraryIncludeFlagUtils.DefaultSuppressParent; - - var target = isGacOrFrameworkReference ? LibraryDependencyTarget.Reference : LibraryDependencyTarget.All; - string dependencyVersionAsString = null; - - if (dependencyValue.Type == JTokenType.Object) - { - // "dependencies" : { "Name" : { "version": "1.0", "type": "build", "target": "project" } } - dependencyVersionAsString = dependencyValue.Value("version"); - - var type = dependencyValue.Value("type"); - if (type != null) - { - dependencyTypeValue = LibraryDependencyType.Parse(new [] { type }); - } - - // Read the target if specified - if (!isGacOrFrameworkReference) - { - var targetStr = dependencyValue.Value("target"); - target = LibraryDependencyTargetUtils.Parse(targetStr); - } - - IEnumerable strings; - if (TryGetStringEnumerable(dependencyValue["include"], out strings)) - { - dependencyIncludeFlagsValue = LibraryIncludeFlagUtils.GetFlags(strings); - } - - if (TryGetStringEnumerable(dependencyValue["exclude"], out strings)) - { - dependencyExcludeFlagsValue = LibraryIncludeFlagUtils.GetFlags(strings); - } - - if (TryGetStringEnumerable(dependencyValue["suppressParent"], out strings)) - { - // This overrides any settings that came from the type property. - suppressParentFlagsValue = LibraryIncludeFlagUtils.GetFlags(strings); - } - } - else if (dependencyValue.Type == JTokenType.String) - { - // "dependencies" : { "Name" : "1.0" } - dependencyVersionAsString = dependencyValue.Value(); - } - else - { - throw FileFormatException.Create( - string.Format( - "Invalid dependency version: {0}. The format is not recognizable.", - dependency.Key), - dependencyValue, - projectPath); - } - - VersionRange dependencyVersionRange = null; - if (!string.IsNullOrEmpty(dependencyVersionAsString)) - { - try - { - dependencyVersionRange = VersionRange.Parse(dependencyVersionAsString); - } - catch (Exception ex) - { - throw FileFormatException.Create(ex, dependencyValue, projectPath); - } - } - - // the dependency flags are: Include flags - Exclude flags - var includeFlags = dependencyIncludeFlagsValue & ~dependencyExcludeFlagsValue; - - var lineInfo = (IJsonLineInfo)dependencyValue; - results.Add(new ProjectLibraryDependency - { - LibraryRange = new LibraryRange( - dependency.Key, - dependencyVersionRange, - target), - Type = dependencyTypeValue, - IncludeType = includeFlags, - SuppressParent = suppressParentFlagsValue, - SourceFilePath = projectPath, - SourceLine = lineInfo.LineNumber, - SourceColumn = lineInfo.LinePosition - }); - } - } - } - - 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) - { - // Get the shared compilationOptions - project._defaultCompilerOptions = - GetCompilationOptions(projectJsonObject, project) ?? new CommonCompilerOptions { CompilerName = "csc" }; - - project._defaultTargetFrameworkConfiguration = new TargetFrameworkInformation - { - Dependencies = new List() - }; - - // Add default configurations - project._compilerOptionsByConfiguration["Debug"] = new CommonCompilerOptions - { - Defines = new[] { "DEBUG", "TRACE" }, - Optimize = false - }; - - project._compilerOptionsByConfiguration["Release"] = new CommonCompilerOptions - { - Defines = new[] { "RELEASE", "TRACE" }, - Optimize = true - }; - - // The configuration node has things like debug/release compiler settings - /* - { - "configurations": { - "Debug": { - }, - "Release": { - } - } - } - */ - - var configurationsSection = projectJsonObject.Value("configurations") as JObject; - if (configurationsSection != null) - { - foreach (var configKey in configurationsSection) - { - var compilerOptions = GetCompilationOptions(configKey.Value as JObject, project); - - // Only use this as a configuration if it's not a target framework - project._compilerOptionsByConfiguration[configKey.Key] = compilerOptions; - } - } - - // The frameworks node is where target frameworks go - /* - { - "frameworks": { - "net45": { - }, - "dnxcore50": { - } - } - } - */ - - var frameworks = projectJsonObject.Value("frameworks") as JObject; - if (frameworks != null) - { - foreach (var framework in frameworks) - { - try - { - var frameworkToken = framework.Value as JObject; - var success = BuildTargetFrameworkNode(project, framework.Key, frameworkToken); - if (!success) - { - var lineInfo = (IJsonLineInfo)framework.Value; - project.Diagnostics.Add( - new DiagnosticMessage( - ErrorCodes.NU1008, - $"\"{framework.Key}\" is an unsupported framework.", - project.ProjectFilePath, - DiagnosticMessageSeverity.Error, - lineInfo.LineNumber, - lineInfo.LinePosition)); - } - } - catch (Exception ex) - { - throw FileFormatException.Create(ex, framework.Value, project.ProjectFilePath); - } - } - } - } - - /// - /// Parse a Json object which represents project configuration for a specified framework - /// - /// The name of the framework - /// The Json object represent the settings - /// Returns true if it successes. - private bool BuildTargetFrameworkNode(Project project, string frameworkKey, JObject frameworkValue) - { - // If no compilation options are provided then figure them out from the node - var compilerOptions = GetCompilationOptions(frameworkValue, project) ?? - new CommonCompilerOptions(); - - var frameworkName = NuGetFramework.Parse(frameworkKey); - - // If it's not unsupported then keep it - if (frameworkName.IsUnsupported) - { - // REVIEW: Should we skip unsupported target frameworks - return false; - } - - // Add the target framework specific define - var defines = new HashSet(compilerOptions.Defines ?? Enumerable.Empty()); - - compilerOptions.Defines = defines; - - var lineInfo = (IJsonLineInfo)frameworkValue; - var targetFrameworkInformation = new TargetFrameworkInformation - { - FrameworkName = frameworkName, - Dependencies = new List(), - CompilerOptions = compilerOptions, - Line = lineInfo.LineNumber, - Column = lineInfo.LinePosition, - Imports = GetImports(frameworkValue) - }; - - var frameworkDependencies = new List(); - - PopulateDependencies( - project.ProjectFilePath, - frameworkDependencies, - frameworkValue, - "dependencies", - isGacOrFrameworkReference: false); - - var frameworkAssemblies = new List(); - PopulateDependencies( - project.ProjectFilePath, - frameworkAssemblies, - frameworkValue, - "frameworkAssemblies", - isGacOrFrameworkReference: true); - - frameworkDependencies.AddRange(frameworkAssemblies); - targetFrameworkInformation.Dependencies = frameworkDependencies; - - targetFrameworkInformation.WrappedProject = frameworkValue.Value("wrappedProject"); - - var binNode = frameworkValue.Value("bin") as JObject; - if (binNode != null) - { - targetFrameworkInformation.AssemblyPath = binNode.Value("assembly"); - } - - project._targetFrameworks[frameworkName] = targetFrameworkInformation; - - return true; - } - - private IEnumerable GetImports(JObject frameworkValue) - { - var prop = frameworkValue.Property("imports"); - if (prop == null) - { - return Enumerable.Empty(); - } - - if (prop.Value.Type == JTokenType.Array) - { - return (prop.Value as JArray).Select(i => i.Value()); - } - else if (prop.Value.Type == JTokenType.String) - { - return new [] { prop.Value.ToString() }; - } - - return null; - } - - private static CommonCompilerOptions GetCompilationOptions(JObject rawObject, Project project) - { - var compilerName = rawObject.Value("compilerName"); - if (compilerName != null) - { - var lineInfo = rawObject.Value("compilerName"); - project.Diagnostics.Add( - new DiagnosticMessage( - ErrorCodes.DOTNET1016, - $"The 'compilerName' option in the root is deprecated. Use it in 'buildOptions' instead.", - project.ProjectFilePath, - DiagnosticMessageSeverity.Warning, - lineInfo.LineNumber, - lineInfo.LinePosition)); - } - - var rawOptions = rawObject.Value("buildOptions") as JObject; - if (rawOptions == null) - { - return new CommonCompilerOptions - { - CompilerName = compilerName ?? "csc" - }; - } - - var analyzerOptionsJson = rawOptions.Value("analyzerOptions") as JObject; - if (analyzerOptionsJson != null) - { - var analyzerOptions = new AnalyzerOptions(); - - foreach (var analyzerOption in analyzerOptionsJson) - { - switch (analyzerOption.Key) - { - case "languageId": - if (analyzerOption.Value.Type != JTokenType.String) - { - throw FileFormatException.Create( - "The analyzer languageId must be a string", - analyzerOption.Value.ToString(), - project.ProjectFilePath); - } - analyzerOptions = new AnalyzerOptions(analyzerOption.Value.ToString()); - break; - - default: - throw FileFormatException.Create( - $"Unrecognized analyzerOption key: {analyzerOption.Key}", - project.ProjectFilePath); - } - } - - project.AnalyzerOptions = analyzerOptions; - } - - return new CommonCompilerOptions - { - Defines = rawOptions.Value("define")?.Values().ToArray(), - SuppressWarnings = rawOptions.Value("nowarn")?.Values().ToArray(), - AdditionalArguments = rawOptions.Value("additionalArguments")?.Values().ToArray(), - LanguageVersion = rawOptions.Value("languageVersion"), - AllowUnsafe = rawOptions.Value("allowUnsafe"), - Platform = rawOptions.Value("platform"), - WarningsAsErrors = rawOptions.Value("warningsAsErrors"), - Optimize = rawOptions.Value("optimize"), - KeyFile = rawOptions.Value("keyFile"), - DelaySign = rawOptions.Value("delaySign"), - PublicSign = rawOptions.Value("publicSign"), - DebugType = rawOptions.Value("debugType"), - EmitEntryPoint = rawOptions.Value("emitEntryPoint"), - GenerateXmlDocumentation = rawOptions.Value("xmlDoc"), - PreserveCompilationContext = rawOptions.Value("preserveCompilationContext"), - OutputName = rawOptions.Value("outputName"), - CompilerName = rawOptions.Value("compilerName") ?? compilerName ?? "csc", - CompileInclude = GetIncludeContext( - project, - rawOptions, - "compile", - defaultBuiltInInclude: ProjectFilesCollection.SdkInjectedDefaultCompileBuiltInPatterns, - defaultBuiltInExclude: ProjectFilesCollection.DefaultBuiltInExcludePatterns), - EmbedInclude = GetIncludeContext( - project, - rawOptions, - "embed", - defaultBuiltInInclude: null, - defaultBuiltInExclude: ProjectFilesCollection.DefaultBuiltInExcludePatterns), - CopyToOutputInclude = GetIncludeContext( - project, - rawOptions, - "copyToOutput", - defaultBuiltInInclude: null, - defaultBuiltInExclude: null) - }; - } - - private static IncludeContext GetIncludeContext( - Project project, - JObject rawOptions, - string option, - string[] defaultBuiltInInclude, - string[] defaultBuiltInExclude) - { - var contextOption = rawOptions.Value(option); - if (contextOption != null) - { - return new IncludeContext( - project.ProjectDirectory, - option, - rawOptions, - defaultBuiltInInclude, - defaultBuiltInExclude); - } - - return null; - } - - private static PackOptions GetPackOptions(JObject rawProject, Project project) - { - var rawPackOptions = rawProject.Value("packOptions") as JObject; - - // Files to be packed along with the project - IncludeContext packInclude = null; - if (rawPackOptions != null && rawPackOptions.Value("files") != null) - { - packInclude = new IncludeContext( - project.ProjectDirectory, - "files", - rawPackOptions, - defaultBuiltInInclude: null, - defaultBuiltInExclude: ProjectFilesCollection.DefaultBuiltInExcludePatterns); - } - - var repository = GetPackOptionsValue("repository", rawProject, rawPackOptions, project) as JObject; - - return new PackOptions - { - ProjectUrl = GetPackOptionsValue("projectUrl", rawProject, rawPackOptions, project), - LicenseUrl = GetPackOptionsValue("licenseUrl", rawProject, rawPackOptions, project), - IconUrl = GetPackOptionsValue("iconUrl", rawProject, rawPackOptions, project), - Owners = GetPackOptionsValue("owners", rawProject, rawPackOptions, project)?.Values().ToArray() ?? EmptyArray.Value, - Tags = GetPackOptionsValue("tags", rawProject, rawPackOptions, project)?.Values().ToArray() ?? EmptyArray.Value, - ReleaseNotes = GetPackOptionsValue("releaseNotes", rawProject, rawPackOptions, project), - RequireLicenseAcceptance = GetPackOptionsValue("requireLicenseAcceptance", rawProject, rawPackOptions, project), - Summary = GetPackOptionsValue("summary", rawProject, rawPackOptions, project), - RepositoryType = repository?.Value("type"), - RepositoryUrl = repository?.Value("url"), - PackInclude = packInclude - }; - } - - private static T GetPackOptionsValue( - string option, - JObject rawProject, - JObject rawPackOptions, - Project project) - { - var rootValue = rawProject.Value(option); - if (rawProject.GetValue(option) != null) - { - var lineInfo = rawProject.Value(option); - project.Diagnostics.Add( - new DiagnosticMessage( - ErrorCodes.DOTNET1016, - $"The '{option}' option in the root is deprecated. Use it in 'packOptions' instead.", - project.ProjectFilePath, - DiagnosticMessageSeverity.Warning, - lineInfo.LineNumber, - lineInfo.LinePosition)); - } - - if (rawPackOptions != null) - { - var hasOption = rawPackOptions.Value(option) != null; - if (hasOption) - { - var packOptionValue = rawPackOptions.Value(option); - if (packOptionValue != null) - { - return packOptionValue; - } - } - } - - return rootValue; - } - - private static RuntimeOptions GetRuntimeOptions(JObject rawProject) - { - var rawRuntimeOptions = rawProject.Value("runtimeOptions") as JObject; - if (rawRuntimeOptions == null) - { - return null; - } - - return new RuntimeOptions - { - // Value(null) will return default(T) which is false in this case. - GcServer = rawRuntimeOptions.Value("gcServer"), - GcConcurrent = rawRuntimeOptions.Value("gcConcurrent") - }; - } - - private static IncludeContext GetPublishInclude(JObject rawProject, Project project) - { - var rawPublishOptions = rawProject.Value("publishOptions"); - if (rawPublishOptions != null) - { - return new IncludeContext( - project.ProjectDirectory, - "publishOptions", - rawProject, - defaultBuiltInInclude: null, - defaultBuiltInExclude: null); - } - - return null; - } - - private static bool HasProjectFile(string path) - { - string projectPath = Path.Combine(path, Project.FileName); - - return File.Exists(projectPath); - } - - private static void AddProjectFilesDeprecationDiagnostics(JObject rawProject, Project project) - { - var compilationOptionsWarning = "'buildOptions'"; - AddDeprecatedDiagnosticMessage(rawProject, project, "compilationOptions", compilationOptionsWarning); - - var compileWarning = "'compile' in 'buildOptions'"; - AddDeprecatedDiagnosticMessage(rawProject, project, "compile", compileWarning); - AddDeprecatedDiagnosticMessage(rawProject, project, "compileExclude", compileWarning); - AddDeprecatedDiagnosticMessage(rawProject, project, "compileFiles", compileWarning); - AddDeprecatedDiagnosticMessage(rawProject, project, "compileBuiltIn", compileWarning); - - var resourceWarning = "'embed' in 'buildOptions'"; - AddDeprecatedDiagnosticMessage(rawProject, project, "resource", resourceWarning); - AddDeprecatedDiagnosticMessage(rawProject, project, "resourceExclude", resourceWarning); - AddDeprecatedDiagnosticMessage(rawProject, project, "resourceFiles", resourceWarning); - AddDeprecatedDiagnosticMessage(rawProject, project, "resourceBuiltIn", resourceWarning); - // Issue: https://github.com/dotnet/cli/issues/5471 - // This is why we mark it as an error which will fail migration. - AddDeprecatedDiagnosticMessage( - rawProject, - project, - "namedResource", - resourceWarning, - DiagnosticMessageSeverity.Error); - - var contentWarning = "'publishOptions' to publish or 'copyToOutput' in 'buildOptions' to copy to build output"; - AddDeprecatedDiagnosticMessage(rawProject, project, "content", contentWarning); - AddDeprecatedDiagnosticMessage(rawProject, project, "contentExclude", contentWarning); - AddDeprecatedDiagnosticMessage(rawProject, project, "contentFiles", contentWarning); - AddDeprecatedDiagnosticMessage(rawProject, project, "contentBuiltIn", contentWarning); - - AddDeprecatedDiagnosticMessage(rawProject, project, "packInclude", "'files' in 'packOptions'"); - AddDeprecatedDiagnosticMessage(rawProject, project, "publishExclude", "'publishOptions'"); - AddDeprecatedDiagnosticMessage(rawProject, project, "exclude", "'exclude' within 'compile' or 'embed'"); - } - - private static void AddDeprecatedDiagnosticMessage( - JObject rawProject, - Project project, - string option, - string message, - DiagnosticMessageSeverity severity = DiagnosticMessageSeverity.Warning) - { - var lineInfo = rawProject.Value(option); - if (lineInfo == null) - { - return; - } - - project.Diagnostics.Add( - new DiagnosticMessage( - ErrorCodes.DOTNET1015, - $"The '{option}' option is deprecated. Use {message} instead.", - project.ProjectFilePath, - severity, - lineInfo.LineNumber, - lineInfo.LinePosition)); - } - - private static void ConvertDeprecatedToSupportedFormat(JObject rawProject) - { - ConvertToBuildOptions(rawProject); - ConvertToBuildOptionsCompile(rawProject); - ConvertToBuildOptionsEmbed(rawProject); - ConvertToBuildOptionsCopyToOutput(rawProject); - ConvertToPackOptions(rawProject); - ConvertToPublishOptions(rawProject); - } - - private static void ConvertToBuildOptions(JObject rawProject) - { - var jpath = "buildOptions"; - if (AreDeprecatedOptionsIgnored(rawProject, jpath)) - { - return; - } - - var deprecatedValue = rawProject.Value("compilationOptions"); - if (deprecatedValue != null) - { - rawProject["buildOptions"] = deprecatedValue.DeepClone(); - } - } - - private static void ConvertToBuildOptionsCompile(JObject rawProject) - { - var jpath = "buildOptions.compile"; - if (AreDeprecatedOptionsIgnored(rawProject, jpath)) - { - return; - } - - ConvertFromDeprecatedFormat(rawProject, jpath, "compile", "include"); - ConvertFromDeprecatedFormat(rawProject, jpath, "exclude", "exclude"); - ConvertFromDeprecatedFormat(rawProject, jpath, "compileExclude", "excludeFiles"); - ConvertFromDeprecatedFormat(rawProject, jpath, "compileFiles", "includeFiles"); - ConvertFromDeprecatedFormat(rawProject, $"{jpath}.builtIns", "compileBuiltIn", "include"); - } - - private static void ConvertToBuildOptionsEmbed(JObject rawProject) - { - var jpath = "buildOptions.embed"; - if (AreDeprecatedOptionsIgnored(rawProject, jpath)) - { - return; - } - - ConvertFromDeprecatedFormat(rawProject, jpath, "resource", "include"); - ConvertFromDeprecatedFormat(rawProject, jpath, "exclude", "exclude"); - ConvertFromDeprecatedFormat(rawProject, jpath, "resourceExclude", "excludeFiles"); - ConvertFromDeprecatedFormat(rawProject, jpath, "resourceFiles", "includeFiles"); - ConvertFromDeprecatedFormat(rawProject, $"{jpath}.builtIns", "resourceBuiltIn", "include"); - } - - private static void ConvertToBuildOptionsCopyToOutput(JObject rawProject) - { - var jpath = "buildOptions.copyToOutput"; - if (AreDeprecatedOptionsIgnored(rawProject, jpath)) - { - return; - } - - ConvertFromDeprecatedFormat(rawProject, jpath, "content", "include"); - ConvertFromDeprecatedFormat(rawProject, jpath, "contentExclude", "excludeFiles"); - ConvertFromDeprecatedFormat(rawProject, jpath, "contentFiles", "includeFiles"); - ConvertFromDeprecatedFormat(rawProject, $"{jpath}.builtIns", "contentBuiltIn", "include"); - } - - private static void ConvertToPackOptions(JObject rawProject) - { - var jpath = "packOptions"; - if (AreDeprecatedOptionsIgnored(rawProject, jpath)) - { - return; - } - - ConvertFromDeprecatedFormat(rawProject, $"{jpath}.files", "packInclude", "include"); - } - - private static void ConvertToPublishOptions(JObject rawProject) - { - var jpath = "publishOptions"; - if (AreDeprecatedOptionsIgnored(rawProject, jpath)) - { - return; - } - - ConvertFromDeprecatedFormat(rawProject, jpath, "content", "include"); - ConvertFromDeprecatedFormat(rawProject, jpath, "publishExclude", "exclude"); - ConvertFromDeprecatedFormat(rawProject, jpath, "contentExclude", "excludeFiles"); - ConvertFromDeprecatedFormat(rawProject, jpath, "contentFiles", "includeFiles"); - ConvertFromDeprecatedFormat(rawProject, $"{jpath}.builtIns", "contentBuiltIn", "include"); - } - - private static bool AreDeprecatedOptionsIgnored(JObject rawProject, string jpathToNewFormatObject) - { - // If the node already exists this means that the project.json file contained both the old and - // new format. In these cases the project.json build ignores the deprecated format and just uses - // the new format. - return (rawProject.SelectToken(jpathToNewFormatObject) != null); - } - - private static void ConvertFromDeprecatedFormat( - JObject rawProject, - string jpathToObject, - string deprecatedKey, - string newKey - ) - { - var deprecatedValue = rawProject.Value(deprecatedKey); - if (deprecatedValue != null) - { - var objectNode = GetOrCreateObjectHierarchy(rawProject, jpathToObject); - objectNode[newKey] = deprecatedValue.DeepClone(); - } - } - - private static JObject GetOrCreateObjectHierarchy(JObject rawProject, string jpath) - { - var currentObject = rawProject as JObject; - - var objectHierarchy = jpath.Split('.'); - foreach (var name in objectHierarchy) - { - var childObject = currentObject.Value(name); - if (childObject == null) - { - childObject = new JObject(); - currentObject[name] = childObject; - } - currentObject = childObject; - } - - return currentObject; - } - - private static bool TryGetStringEnumerable(JToken token, out IEnumerable result) - { - IEnumerable values; - if (token == null) - { - result = null; - return false; - } - else if (token.Type == JTokenType.String) - { - values = new[] - { - token.Value() - }; - } - else - { - values = token.Values(); - } - result = values - .SelectMany(value => value.Split(new[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries)); - return true; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectReaderSettings.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectReaderSettings.cs deleted file mode 100644 index ae2016674..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectReaderSettings.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; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal class ProjectReaderSettings - { - public string VersionSuffix { get; set; } - public string AssemblyFileVersion { get; set; } - - public static ProjectReaderSettings ReadFromEnvironment() - { - var settings = new ProjectReaderSettings - { - VersionSuffix = Environment.GetEnvironmentVariable("DOTNET_BUILD_VERSION"), - AssemblyFileVersion = Environment.GetEnvironmentVariable("DOTNET_ASSEMBLY_FILE_VERSION") - }; - - return settings; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectRootResolver.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectRootResolver.cs deleted file mode 100644 index cb1796721..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ProjectRootResolver.cs +++ /dev/null @@ -1,31 +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; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal static class ProjectRootResolver - { - public static readonly string GlobalFileName = "global.json"; - public static string ResolveRootDirectory(string projectPath) - { - var di = new DirectoryInfo(projectPath); - - while (di.Parent != null) - { - var globalJsonPath = Path.Combine(di.FullName, GlobalFileName); - - if (File.Exists(globalJsonPath)) - { - return di.FullName; - } - - di = di.Parent; - } - - // If we don't find any files then make the project folder the root - return projectPath; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/FrameworkInformation.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/FrameworkInformation.cs deleted file mode 100644 index 3e44a3430..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/FrameworkInformation.cs +++ /dev/null @@ -1,52 +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; - -namespace Microsoft.DotNet.Internal.ProjectModel.Resolution -{ - internal class FrameworkInformation - { - private bool? _exists; - - public FrameworkInformation() - { - Assemblies = new Dictionary(); - } - - public bool Exists - { - get - { - if (_exists == null) - { - _exists = Directory.Exists(Path); - } - - return _exists.Value; - } - set - { - _exists = true; - } - } - - public string Path { get; set; } - - public IEnumerable SearchPaths { get; set; } - - public string RedistListPath { get; set; } - - public IDictionary Assemblies { get; private set; } - - public string Name { get; set; } - } - - internal class AssemblyEntry - { - public string Path { get; set; } - public Version Version { get; set; } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/FrameworkReferenceResolver.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/FrameworkReferenceResolver.cs deleted file mode 100644 index f04b95644..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/FrameworkReferenceResolver.cs +++ /dev/null @@ -1,487 +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.Concurrent; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.Versioning; -using System.Xml.Linq; -using Microsoft.DotNet.PlatformAbstractions; -using Microsoft.DotNet.Internal.ProjectModel.Utilities; -using Microsoft.Extensions.DependencyModel.Resolution; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Internal.ProjectModel.Resolution -{ - internal class FrameworkReferenceResolver - { - // FrameworkConstants doesn't have dnx46 yet - private static readonly NuGetFramework Dnx46 = new NuGetFramework( - FrameworkConstants.FrameworkIdentifiers.Dnx, - new Version(4, 6)); - - private static FrameworkReferenceResolver _default; - - private readonly ConcurrentDictionary _cache = new ConcurrentDictionary(); - - private static readonly IDictionary _aliases = new Dictionary - { - { FrameworkConstants.CommonFrameworks.Dnx451, new [] { FrameworkConstants.CommonFrameworks.Net451 } }, - { Dnx46, new [] { FrameworkConstants.CommonFrameworks.Net46 } } - }; - - public FrameworkReferenceResolver(string referenceAssembliesPath) - { - ReferenceAssembliesPath = referenceAssembliesPath; - } - - public string ReferenceAssembliesPath { get; } - - public static FrameworkReferenceResolver Default - { - get - { - if (_default == null) - { - _default = new FrameworkReferenceResolver(GetDefaultReferenceAssembliesPath()); - } - - return _default; - } - } - - public static string GetDefaultReferenceAssembliesPath() - { - // Allow setting the reference assemblies path via an environment variable - var referenceAssembliesPath = DotNetReferenceAssembliesPathResolver.Resolve(); - - if (!string.IsNullOrEmpty(referenceAssembliesPath)) - { - return referenceAssembliesPath; - } - - if (RuntimeEnvironment.OperatingSystemPlatform != Platform.Windows) - { - // There is no reference assemblies path outside of windows - // The environment variable can be used to specify one - return null; - } - - // References assemblies are in %ProgramFiles(x86)% on - // 64 bit machines - var programFiles = Environment.GetEnvironmentVariable("ProgramFiles(x86)"); - - if (string.IsNullOrEmpty(programFiles)) - { - // On 32 bit machines they are in %ProgramFiles% - programFiles = Environment.GetEnvironmentVariable("ProgramFiles"); - } - - if (string.IsNullOrEmpty(programFiles)) - { - // Reference assemblies aren't installed - return null; - } - - return Path.Combine( - programFiles, - "Reference Assemblies", "Microsoft", "Framework"); - } - - public bool TryGetAssembly(string name, NuGetFramework targetFramework, out string path, out Version version) - { - path = null; - version = null; - - var information = _cache.GetOrAdd(targetFramework, GetFrameworkInformation); - - if (information == null || !information.Exists) - { - return false; - } - - lock (information.Assemblies) - { - AssemblyEntry entry; - if (information.Assemblies.TryGetValue(name, out entry)) - { - if (string.IsNullOrEmpty(entry.Path)) - { - entry.Path = GetAssemblyPath(information.SearchPaths, name); - } - - if (!string.IsNullOrEmpty(entry.Path) && entry.Version == null) - { - // This code path should only run on mono - entry.Version = VersionUtility.GetAssemblyVersion(entry.Path).Version; - } - - path = entry.Path; - version = entry.Version; - } - } - - return !string.IsNullOrEmpty(path); - } - - public bool IsInstalled(NuGetFramework targetFramework) - { - var information = _cache.GetOrAdd(targetFramework, GetFrameworkInformation); - - return information?.Exists == true; - } - - public string GetFrameworkRedistListPath(NuGetFramework targetFramework) - { - var information = _cache.GetOrAdd(targetFramework, GetFrameworkInformation); - - if (information == null || !information.Exists) - { - return null; - } - - return information.RedistListPath; - } - - public string GetFriendlyFrameworkName(NuGetFramework targetFramework) - { - var frameworkName = new FrameworkName(targetFramework.DotNetFrameworkName); - - // We don't have a friendly name for this anywhere on the machine so hard code it - if (string.Equals(frameworkName.Identifier, VersionUtility.DnxCoreFrameworkIdentifier, StringComparison.OrdinalIgnoreCase)) - { - return "DNX Core 5.0"; - } - else if (string.Equals(frameworkName.Identifier, VersionUtility.DnxFrameworkIdentifier, StringComparison.OrdinalIgnoreCase)) - { - return "DNX " + targetFramework.Version.ToString(); - } - else if (string.Equals(frameworkName.Identifier, VersionUtility.NetPlatformFrameworkIdentifier, StringComparison.OrdinalIgnoreCase)) - { - var version = targetFramework.Version > Constants.Version50 ? - (" " + targetFramework.Version.ToString()) : - string.Empty; - return ".NET Platform" + version; - } - - var information = _cache.GetOrAdd(targetFramework, GetFrameworkInformation); - - if (information == null) - { - return SynthesizeFrameworkFriendlyName(targetFramework); - } - - return information.Name; - } - - private FrameworkInformation GetFrameworkInformation(NuGetFramework targetFramework) - { - string referenceAssembliesPath = ReferenceAssembliesPath; - - if (string.IsNullOrEmpty(referenceAssembliesPath)) - { - return null; - } - - NuGetFramework[] candidates; - if (_aliases.TryGetValue(targetFramework, out candidates)) - { - foreach (var framework in candidates) - { - var information = GetFrameworkInformation(framework); - - if (information != null) - { - return information; - } - } - - return null; - } - else - { - return GetFrameworkInformation(targetFramework, referenceAssembliesPath); - } - } - - private static FrameworkInformation GetFrameworkInformation(NuGetFramework targetFramework, string referenceAssembliesPath) - { - // Check for legacy frameworks - if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows && - targetFramework.IsDesktop() && - targetFramework.Version <= new Version(3, 5, 0, 0)) - { - return GetLegacyFrameworkInformation(targetFramework, referenceAssembliesPath); - } - - var basePath = Path.Combine(referenceAssembliesPath, - targetFramework.Framework, - "v" + GetDisplayVersion(targetFramework)); - - if (!string.IsNullOrEmpty(targetFramework.Profile)) - { - basePath = Path.Combine(basePath, "Profile", targetFramework.Profile); - } - - var version = new DirectoryInfo(basePath); - if (!version.Exists) - { - return null; - } - - return GetFrameworkInformation(version, targetFramework, referenceAssembliesPath); - } - - private static FrameworkInformation GetLegacyFrameworkInformation(NuGetFramework targetFramework, string referenceAssembliesPath) - { - var frameworkInfo = new FrameworkInformation(); - - // Always grab .NET 2.0 data - var searchPaths = new List(); - var net20Dir = Path.Combine(Environment.GetEnvironmentVariable("WINDIR"), "Microsoft.NET", "Framework", "v2.0.50727"); - - if (!Directory.Exists(net20Dir)) - { - return null; - } - - // Grab reference assemblies first, if present for this framework - if (targetFramework.Version.Major == 3) - { - // Most specific first (i.e. 3.5) - if (targetFramework.Version.Minor == 5) - { - var refAsms35Dir = Path.Combine(referenceAssembliesPath, "v3.5"); - if (!string.IsNullOrEmpty(targetFramework.Profile)) - { - // The 3.5 Client Profile assemblies ARE in .NETFramework... it's weird. - refAsms35Dir = Path.Combine(referenceAssembliesPath, ".NETFramework", "v3.5", "Profile", targetFramework.Profile); - } - if (Directory.Exists(refAsms35Dir)) - { - searchPaths.Add(refAsms35Dir); - } - } - - // Always search the 3.0 reference assemblies - if (string.IsNullOrEmpty(targetFramework.Profile)) - { - // a) 3.0 didn't have profiles - // b) When using a profile, we don't want to fall back to 3.0 or 2.0 - var refAsms30Dir = Path.Combine(referenceAssembliesPath, "v3.0"); - if (Directory.Exists(refAsms30Dir)) - { - searchPaths.Add(refAsms30Dir); - } - } - } - - // .NET 2.0 reference assemblies go last (but only if there's no profile in the TFM) - if (string.IsNullOrEmpty(targetFramework.Profile)) - { - searchPaths.Add(net20Dir); - } - - frameworkInfo.Exists = true; - frameworkInfo.Path = searchPaths.First(); - frameworkInfo.SearchPaths = searchPaths; - - // Load the redist list in reverse order (most general -> most specific) - for (int i = searchPaths.Count - 1; i >= 0; i--) - { - var dir = new DirectoryInfo(searchPaths[i]); - if (dir.Exists) - { - PopulateFromRedistList(dir, targetFramework, referenceAssembliesPath, frameworkInfo); - } - } - - if (string.IsNullOrEmpty(frameworkInfo.Name)) - { - frameworkInfo.Name = SynthesizeFrameworkFriendlyName(targetFramework); - } - return frameworkInfo; - } - - private static string SynthesizeFrameworkFriendlyName(NuGetFramework targetFramework) - { - // Names are not present in the RedistList.xml file for older frameworks or on Mono - // We do some custom version string rendering to match how net40 is rendered (.NET Framework 4) - if (targetFramework.Framework.Equals(FrameworkConstants.FrameworkIdentifiers.Net)) - { - string versionString = targetFramework.Version.Minor == 0 ? - targetFramework.Version.Major.ToString() : - GetDisplayVersion(targetFramework).ToString(); - - string profileString = string.IsNullOrEmpty(targetFramework.Profile) ? - string.Empty : - $" {targetFramework.Profile} Profile"; - return ".NET Framework " + versionString + profileString; - } - return targetFramework.ToString(); - } - - private static FrameworkInformation GetFrameworkInformation(DirectoryInfo directory, NuGetFramework targetFramework, string referenceAssembliesPath) - { - var frameworkInfo = new FrameworkInformation(); - frameworkInfo.Exists = true; - frameworkInfo.Path = directory.FullName; - frameworkInfo.SearchPaths = new[] { - frameworkInfo.Path, - Path.Combine(frameworkInfo.Path, "Facades") - }; - - PopulateFromRedistList(directory, targetFramework, referenceAssembliesPath, frameworkInfo); - if (string.IsNullOrEmpty(frameworkInfo.Name)) - { - frameworkInfo.Name = SynthesizeFrameworkFriendlyName(targetFramework); - } - return frameworkInfo; - } - - private static void PopulateFromRedistList(DirectoryInfo directory, NuGetFramework targetFramework, string referenceAssembliesPath, FrameworkInformation frameworkInfo) - { - // The redist list contains the list of assemblies for this target framework - string redistList = Path.Combine(directory.FullName, "RedistList", "FrameworkList.xml"); - - if (File.Exists(redistList)) - { - frameworkInfo.RedistListPath = redistList; - - using (var stream = File.OpenRead(redistList)) - { - var frameworkList = XDocument.Load(stream); - - // Remember the original search paths, because we might need them later - var originalSearchPaths = frameworkInfo.SearchPaths; - - // There are some frameworks, that "inherit" from a base framework, like - // e.g. .NET 4.0.3, and MonoAndroid. - var includeFrameworkVersion = frameworkList.Root.Attribute("IncludeFramework")?.Value; - if (includeFrameworkVersion != null) - { - // Get the NuGetFramework identifier for the framework to include - var includeFramework = NuGetFramework.Parse($"{targetFramework.Framework}, Version={includeFrameworkVersion}"); - - // Recursively call the code to get the framework information - var includeFrameworkInfo = GetFrameworkInformation(includeFramework, referenceAssembliesPath); - - // Append the search paths of the included framework - frameworkInfo.SearchPaths = frameworkInfo.SearchPaths.Concat(includeFrameworkInfo.SearchPaths).ToArray(); - - // Add the assemblies of the included framework - foreach (var assemblyEntry in includeFrameworkInfo.Assemblies) - { - frameworkInfo.Assemblies[assemblyEntry.Key] = assemblyEntry.Value; - } - } - - // On mono, the RedistList.xml has an entry pointing to the TargetFrameworkDirectory - // It basically uses the GAC as the reference assemblies for all .NET framework - // profiles - var targetFrameworkDirectory = frameworkList.Root.Attribute("TargetFrameworkDirectory")?.Value; - - IEnumerable populateFromPaths; - if (!string.IsNullOrEmpty(targetFrameworkDirectory)) - { - // For some odd reason, the paths are actually listed as \ so normalize them here - targetFrameworkDirectory = targetFrameworkDirectory.Replace('\\', Path.DirectorySeparatorChar); - - // The specified path is the relative path from the RedistList.xml itself - var resovledPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(redistList), targetFrameworkDirectory)); - - // Update the path to the framework - frameworkInfo.Path = resovledPath; - - populateFromPaths = new List - { - resovledPath, - Path.Combine(resovledPath, "Facades") - }; - } - else - { - var emptyFileElements = true; - foreach (var e in frameworkList.Root.Elements()) - { - // Remember that we had at least one framework assembly - emptyFileElements = false; - - var assemblyName = e.Attribute("AssemblyName").Value; - var version = e.Attribute("Version")?.Value; - - var entry = new AssemblyEntry(); - entry.Version = version != null ? Version.Parse(version) : null; - frameworkInfo.Assemblies[assemblyName] = entry; - } - - if (emptyFileElements) - { - // When we haven't found any file elements, we probably processed a - // Mono/Xamarin FrameworkList.xml. That means, that we have to - // populate the assembly list from the files. - populateFromPaths = originalSearchPaths; - } - else - { - populateFromPaths = null; - } - } - - // Do we need to populate from search paths? - if (populateFromPaths != null) - { - foreach (var populateFromPath in populateFromPaths) - { - PopulateAssemblies(frameworkInfo.Assemblies, populateFromPath); - } - } - - var nameAttribute = frameworkList.Root.Attribute("Name"); - - frameworkInfo.Name = nameAttribute == null ? null : nameAttribute.Value; - } - } - } - - private static void PopulateAssemblies(IDictionary assemblies, string path) - { - if (!Directory.Exists(path)) - { - return; - } - - foreach (var assemblyPath in Directory.GetFiles(path, "*.dll")) - { - var name = Path.GetFileNameWithoutExtension(assemblyPath); - var entry = new AssemblyEntry(); - entry.Path = assemblyPath; - assemblies[name] = entry; - } - } - - private static string GetAssemblyPath(IEnumerable basePaths, string assemblyName) - { - foreach (var basePath in basePaths) - { - var assemblyPath = Path.Combine(basePath, assemblyName + ".dll"); - - if (File.Exists(assemblyPath)) - { - return assemblyPath; - } - } - - return null; - } - - private static Version GetDisplayVersion(NuGetFramework framework) - { - // Fix the target framework version due to https://github.com/NuGet/Home/issues/1600, this is relevant - // when looking up in the reference assembly folder - return new FrameworkName(framework.DotNetFrameworkName).Version; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/LibraryManager.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/LibraryManager.cs deleted file mode 100644 index d2cb50754..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/LibraryManager.cs +++ /dev/null @@ -1,269 +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.Internal.ProjectModel.Utilities; -using NuGet.LibraryModel; - -namespace Microsoft.DotNet.Internal.ProjectModel.Resolution -{ - internal class LibraryManager - { - private readonly IList _libraries; - private readonly IList _diagnostics; - private readonly string _projectPath; - - public LibraryManager(IList libraries, - IList diagnostics, - string projectPath) - { - _libraries = libraries; - _diagnostics = diagnostics; - _projectPath = projectPath; - } - - public IList GetLibraries() - { - return _libraries; - } - - public IList GetAllDiagnostics() - { - var messages = new List(); - - if (_diagnostics != null) - { - messages.AddRange(_diagnostics); - } - - var dependencies = new Dictionary>(); - var topLevel = new List(); - - var platformLibraries = new List(); - foreach (var library in GetLibraries()) - { - if (!library.Resolved) - { - string message; - string errorCode; - if (library.Compatible) - { - foreach (var range in library.RequestedRanges) - { - errorCode = ErrorCodes.NU1001; - message = $"The dependency {FormatLibraryRange(range)} could not be resolved."; - - AddDiagnostics(messages, library, message, DiagnosticMessageSeverity.Error, errorCode); - } - } - else - { - errorCode = ErrorCodes.NU1002; - message = $"The dependency {library.Identity} does not support framework {library.Framework}."; - - AddDiagnostics(messages, library, message, DiagnosticMessageSeverity.Error, errorCode); - } - } - else - { - var isPlatform = library.RequestedRanges.Any(r => r.Type.Equals(LibraryDependencyType.Platform)); - if (isPlatform) - { - platformLibraries.Add(library); - } - // Store dependency -> library for later - // J.N -> [(R1, P1), (R2, P2)] - foreach (var dependency in library.Dependencies) - { - List items; - if (!dependencies.TryGetValue(dependency.Name, out items)) - { - items = new List(); - dependencies[dependency.Name] = items; - } - items.Add(new DependencyItem(dependency, library)); - } - - foreach (var range in library.RequestedRanges) - { - // Skip libraries that aren't specified in a project.json - // Only report problems for this project - if (string.IsNullOrEmpty(range.SourceFilePath)) - { - continue; - } - - // We only care about things requested in this project - if (!string.Equals(_projectPath, range.SourceFilePath)) - { - continue; - } - - if (range.LibraryRange.VersionRange == null) - { - // TODO: Show errors/warnings for things without versions - continue; - } - - topLevel.Add(new LibraryItem(range, library)); - - // If we ended up with a declared version that isn't what was asked for directly - // then report a warning - // Case 1: Non floating version and the minimum doesn't match what was specified - // Case 2: Floating version that fell outside of the range - if ((!range.LibraryRange.VersionRange.IsFloating && - range.LibraryRange.VersionRange.MinVersion != library.Identity.Version) || - (range.LibraryRange.VersionRange.IsFloating && - !range.LibraryRange.VersionRange.Float.Satisfies(library.Identity.Version))) - { - var message = $"Dependency specified was {FormatLibraryRange(range)} but ended up with {library.Identity}."; - - messages.Add( - new DiagnosticMessage( - ErrorCodes.NU1007, - message, - range.SourceFilePath, - DiagnosticMessageSeverity.Warning, - range.SourceLine, - range.SourceColumn, - library)); - } - } - } - } - - if (platformLibraries.Count > 1) - { - foreach (var platformLibrary in platformLibraries) - { - AddDiagnostics( - messages, - platformLibrary, - "The following dependencies are marked with type 'platform', however only one dependency can have this type: " + - string.Join(", ", platformLibraries.Select(l => l.Identity.Name).ToArray()), - DiagnosticMessageSeverity.Error, - ErrorCodes.DOTNET1013); - } - } - - // Version conflicts - foreach (var libraryItem in topLevel) - { - var library = libraryItem.Library; - - if (library.Identity.Type != LibraryType.Package) - { - continue; - } - - List items; - if (dependencies.TryGetValue(library.Identity.Name, out items)) - { - foreach (var item in items) - { - var versionRange = item.Dependency.LibraryRange.VersionRange; - - if (versionRange == null) - { - continue; - } - - if (item.Library != library && !versionRange.Satisfies(library.Identity.Version)) - { - var message = $"Dependency conflict. {item.Library.Identity} expected {FormatLibraryRange(item.Dependency)} but received {library.Identity.Version}"; - - messages.Add( - new DiagnosticMessage( - ErrorCodes.NU1012, - message, - libraryItem.RequestedRange.SourceFilePath, - DiagnosticMessageSeverity.Warning, - libraryItem.RequestedRange.SourceLine, - libraryItem.RequestedRange.SourceColumn, - library)); - } - } - } - } - - return messages; - } - - private static string FormatLibraryRange(ProjectLibraryDependency range) - { - return range.LibraryRange.ToLockFileDependencyGroupString(); - } - - private void AddDiagnostics(List messages, - LibraryDescription library, - string message, - DiagnosticMessageSeverity severity, - string errorCode) - { - // A (in project.json) -> B (unresolved) (not in project.json) - foreach (var source in GetRangesWithSourceLocations(library).Distinct()) - { - // We only care about things requested in this project - if (!string.Equals(_projectPath, source.SourceFilePath)) - { - continue; - } - - messages.Add( - new DiagnosticMessage( - errorCode, - message, - source.SourceFilePath, - severity, - source.SourceLine, - source.SourceColumn, - library)); - - } - } - - private IEnumerable GetRangesWithSourceLocations(LibraryDescription library) - { - foreach (var range in library.RequestedRanges) - { - if (!string.IsNullOrEmpty(range.SourceFilePath)) - { - yield return range; - } - } - - foreach (var parent in library.Parents) - { - foreach (var relevantPath in GetRangesWithSourceLocations(parent)) - { - yield return relevantPath; - } - } - } - - private struct DependencyItem - { - public ProjectLibraryDependency Dependency { get; private set; } - public LibraryDescription Library { get; private set; } - - public DependencyItem(ProjectLibraryDependency dependency, LibraryDescription library) - { - Dependency = dependency; - Library = library; - } - } - - private struct LibraryItem - { - public ProjectLibraryDependency RequestedRange { get; private set; } - public LibraryDescription Library { get; private set; } - - public LibraryItem(ProjectLibraryDependency requestedRange, LibraryDescription library) - { - RequestedRange = requestedRange; - Library = library; - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/MSBuildDependencyProvider.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/MSBuildDependencyProvider.cs deleted file mode 100644 index cc53d5517..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/MSBuildDependencyProvider.cs +++ /dev/null @@ -1,113 +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 NuGet.Frameworks; -using NuGet.LibraryModel; -using NuGet.ProjectModel; - -namespace Microsoft.DotNet.Internal.ProjectModel.Resolution -{ - internal class MSBuildDependencyProvider - { - private readonly Project _rootProject; - private readonly Func _projectResolver; - - public MSBuildDependencyProvider(Project rootProject, Func projectResolver) - { - _rootProject = rootProject; - _projectResolver = projectResolver; - } - - public MSBuildProjectDescription GetDescription(NuGetFramework targetFramework, - LockFileLibrary projectLibrary, - LockFileTargetLibrary targetLibrary, - bool isDesignTime) - { - // During design time fragment file could be missing. When fragment file is missing none of the - // assets can be found but it is acceptable during design time. - var compatible = targetLibrary.FrameworkAssemblies.Any() || - targetLibrary.CompileTimeAssemblies.Any() || - targetLibrary.RuntimeAssemblies.Any() || - isDesignTime; - - var dependencies = new List( - targetLibrary.Dependencies.Count + targetLibrary.FrameworkAssemblies.Count); - PopulateDependencies(dependencies, targetLibrary, targetFramework); - - var msbuildProjectFilePath = GetMSBuildProjectFilePath(projectLibrary); - var msbuildProjectDirectoryPath = Path.GetDirectoryName(msbuildProjectFilePath); - - var exists = Directory.Exists(msbuildProjectDirectoryPath); - - var projectFile = projectLibrary.Path == null ? null : _projectResolver(projectLibrary.Path); - - var msbuildPackageDescription = new MSBuildProjectDescription( - msbuildProjectDirectoryPath, - msbuildProjectFilePath, - projectLibrary, - targetLibrary, - projectFile, - dependencies, - compatible, - resolved: compatible && exists); - - return msbuildPackageDescription; - } - - private string GetMSBuildProjectFilePath(LockFileLibrary projectLibrary) - { - if (_rootProject == null) - { - throw new InvalidOperationException("Root xproj project does not exist. Cannot compute the path of its referenced csproj projects."); - } - - var rootProjectPath = Path.GetDirectoryName(_rootProject.ProjectFilePath); - var msbuildProjectFilePath = Path.Combine(rootProjectPath, projectLibrary.MSBuildProject); - - return Path.GetFullPath(msbuildProjectFilePath); - } - - private void PopulateDependencies( - List dependencies, - LockFileTargetLibrary targetLibrary, - NuGetFramework targetFramework) - { - foreach (var dependency in targetLibrary.Dependencies) - { - dependencies.Add(new ProjectLibraryDependency - { - LibraryRange = new LibraryRange(dependency.Id, dependency.VersionRange, LibraryDependencyTarget.All) - }); - } - - if (!targetFramework.IsPackageBased) - { - // Only add framework assemblies for non-package based frameworks. - foreach (var frameworkAssembly in targetLibrary.FrameworkAssemblies) - { - dependencies.Add(new ProjectLibraryDependency - { - LibraryRange = new LibraryRange(frameworkAssembly, LibraryDependencyTarget.Reference) - }); - } - } - } - - public static bool IsMSBuildProjectLibrary(LockFileLibrary projectLibrary) - { - var msbuildProjectPath = projectLibrary.MSBuildProject; - if (msbuildProjectPath == null) - { - return false; - } - - var extension = Path.GetExtension(msbuildProjectPath); - - return !string.Equals(extension, ".xproj", StringComparison.OrdinalIgnoreCase); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/PackageDependencyProvider.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/PackageDependencyProvider.cs deleted file mode 100644 index b554fb29f..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/PackageDependencyProvider.cs +++ /dev/null @@ -1,184 +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 NuGet.Common; -using NuGet.Frameworks; -using NuGet.LibraryModel; -using NuGet.Packaging; -using NuGet.ProjectModel; - -namespace Microsoft.DotNet.Internal.ProjectModel.Resolution -{ - internal class PackageDependencyProvider - { - private readonly FallbackPackagePathResolver _packagePathResolver; - private readonly VersionFolderPathResolver _versionFolderPathResolver; - private readonly FrameworkReferenceResolver _frameworkReferenceResolver; - - public PackageDependencyProvider(INuGetPathContext nugetPathContext, FrameworkReferenceResolver frameworkReferenceResolver) - { - if (nugetPathContext != null) - { - _packagePathResolver = new FallbackPackagePathResolver(nugetPathContext); - - // This resolver is only used for building file names, so that base path is not required. - _versionFolderPathResolver = new VersionFolderPathResolver(rootPath: null); - } - - _frameworkReferenceResolver = frameworkReferenceResolver; - } - - public PackageDescription GetDescription( - NuGetFramework targetFramework, - LockFileLibrary package, - LockFileTargetLibrary targetLibrary) - { - // If a NuGet dependency is supposed to provide assemblies but there is no assembly compatible with - // current target framework, we should mark this dependency as unresolved - var containsAssembly = package.Files - .Select(f => f.Replace('/', Path.DirectorySeparatorChar)) - .Any(x => x.StartsWith($"ref{Path.DirectorySeparatorChar}") || - x.StartsWith($"lib{Path.DirectorySeparatorChar}")); - - var compatible = targetLibrary.FrameworkAssemblies.Any() || - targetLibrary.CompileTimeAssemblies.Any() || - targetLibrary.RuntimeAssemblies.Any() || - !containsAssembly; - - var dependencies = - new List(targetLibrary.Dependencies.Count + targetLibrary.FrameworkAssemblies.Count); - PopulateDependencies(dependencies, targetLibrary, targetFramework); - - var path = _packagePathResolver?.GetPackageDirectory(package.Name, package.Version); - bool exists = path != null; - - string hashPath = null; - if (_versionFolderPathResolver != null) - { - hashPath = _versionFolderPathResolver.GetHashFileName(package.Name, package.Version); - } - - if (exists) - { - // If the package's compile time assemblies is for a portable profile then, read the assembly metadata - // and turn System.* references into reference assembly dependencies - PopulateLegacyPortableDependencies(targetFramework, dependencies, path, targetLibrary); - } - - var packageDescription = new PackageDescription( - path, - hashPath, - package, - targetLibrary, - dependencies, - compatible, - resolved: compatible && exists); - - return packageDescription; - } - - private void PopulateLegacyPortableDependencies( - NuGetFramework targetFramework, - List dependencies, - string packagePath, - LockFileTargetLibrary targetLibrary) - { - var seen = new HashSet(); - - foreach (var assembly in targetLibrary.CompileTimeAssemblies) - { - if (IsPlaceholderFile(assembly.Path)) - { - continue; - } - - // (ref/lib)/{tfm}/{assembly} - var pathParts = assembly.Path.Split(Path.DirectorySeparatorChar); - - if (pathParts.Length != 3) - { - continue; - } - - var assemblyTargetFramework = NuGetFramework.Parse(pathParts[1]); - - if (!assemblyTargetFramework.IsPCL) - { - continue; - } - - var assemblyPath = Path.Combine(packagePath, assembly.Path); - - foreach (var dependency in GetDependencies(assemblyPath)) - { - if (seen.Add(dependency)) - { - string path; - Version version; - - // If there exists a reference assembly on the requested framework with the same name then turn this into a - // framework assembly dependency - if (_frameworkReferenceResolver.TryGetAssembly(dependency, targetFramework, out path, out version)) - { - dependencies.Add(new ProjectLibraryDependency - { - LibraryRange = new LibraryRange(dependency, LibraryDependencyTarget.Reference) - }); - } - } - } - } - } - - private static IEnumerable GetDependencies(string path) - { - using (var peReader = new PEReader(File.OpenRead(path))) - { - var metadataReader = peReader.GetMetadataReader(); - - foreach (var assemblyReferenceHandle in metadataReader.AssemblyReferences) - { - var assemblyReference = metadataReader.GetAssemblyReference(assemblyReferenceHandle); - - yield return metadataReader.GetString(assemblyReference.Name); - } - } - } - - private void PopulateDependencies( - List dependencies, - LockFileTargetLibrary targetLibrary, - NuGetFramework targetFramework) - { - foreach (var dependency in targetLibrary.Dependencies) - { - dependencies.Add(new ProjectLibraryDependency{ - LibraryRange = new LibraryRange(dependency.Id, dependency.VersionRange, LibraryDependencyTarget.All) - }); - } - - if (!targetFramework.IsPackageBased) - { - // Only add framework assemblies for non-package based frameworks. - foreach (var frameworkAssembly in targetLibrary.FrameworkAssemblies) - { - dependencies.Add(new ProjectLibraryDependency - { - LibraryRange = new LibraryRange(frameworkAssembly, LibraryDependencyTarget.Reference) - }); - } - } - } - - public static bool IsPlaceholderFile(string path) - { - return string.Equals(Path.GetFileName(path), "_._", StringComparison.Ordinal); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/ProjectDependencyProvider.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/ProjectDependencyProvider.cs deleted file mode 100644 index eb32868d1..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/ProjectDependencyProvider.cs +++ /dev/null @@ -1,103 +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 NuGet.Frameworks; -using NuGet.LibraryModel; -using NuGet.ProjectModel; - -namespace Microsoft.DotNet.Internal.ProjectModel.Resolution -{ - internal class ProjectDependencyProvider - { - private Func _resolveProject; - - public ProjectDependencyProvider(Func projectCacheResolver) - { - _resolveProject = projectCacheResolver; - } - - public ProjectDescription GetDescription(string name, - string path, - LockFileTargetLibrary targetLibrary, - Func projectCacheResolver) - { - var project = _resolveProject(Path.GetDirectoryName(path)); - if (project != null) - { - return GetDescription(NuGetFramework.Parse(targetLibrary.Framework), project, targetLibrary); - } - else - { - return new ProjectDescription(name, path); - } - } - - public ProjectDescription GetDescription(string name, string path, LockFileTargetLibrary targetLibrary) - { - return GetDescription(name, path, targetLibrary, projectCacheResolver: null); - } - - public ProjectDescription GetDescription(NuGetFramework targetFramework, Project project, LockFileTargetLibrary targetLibrary) - { - // This never returns null - var targetFrameworkInfo = project.GetTargetFramework(targetFramework); - var dependencies = new List(targetFrameworkInfo.Dependencies); - - // Add all of the project's dependencies - dependencies.AddRange(project.Dependencies); - - if (targetFramework != null && targetFramework.IsDesktop()) - { - AddIfMissing(dependencies, "mscorlib"); - AddIfMissing(dependencies, "System"); - - if (targetFramework.Version >= new Version(3, 5)) - { - AddIfMissing(dependencies, "System.Core"); - if (targetFramework.Version >= new Version(4, 0)) - { - AddIfMissing(dependencies, "Microsoft.CSharp"); - } - } - } - - if (targetLibrary != null) - { - // The lock file entry might have a filtered set of dependencies - var lockFileDependencies = targetLibrary.Dependencies.ToDictionary( - d => d.Id, - StringComparer.OrdinalIgnoreCase); - - // Remove all non-framework dependencies that don't appear in the lock file entry - dependencies.RemoveAll(m => - !lockFileDependencies.ContainsKey(m.Name) && - m.LibraryRange.TypeConstraint != LibraryDependencyTarget.Reference); - } - - // Mark the library as unresolved if there were specified frameworks - // and none of them resolved - bool unresolved = targetFrameworkInfo.FrameworkName == null; - - return new ProjectDescription( - new LibraryRange(project.Name, LibraryDependencyTarget.All), - project, - dependencies, - targetFrameworkInfo, - !unresolved); - } - - private static void AddIfMissing(List dependencies, string dependencyName) - { - if (!dependencies.Any(dep => string.Equals(dep.Name, dependencyName, StringComparison.OrdinalIgnoreCase))) - { - dependencies.Add(new ProjectLibraryDependency { - LibraryRange = new LibraryRange(dependencyName, LibraryDependencyTarget.Reference) - }); - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/ReferenceAssemblyDependencyResolver.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/ReferenceAssemblyDependencyResolver.cs deleted file mode 100644 index 4ebb51dad..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/ReferenceAssemblyDependencyResolver.cs +++ /dev/null @@ -1,49 +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.Linq; -using NuGet.Frameworks; -using NuGet.LibraryModel; -using NuGet.Versioning; - -namespace Microsoft.DotNet.Internal.ProjectModel.Resolution -{ - internal class ReferenceAssemblyDependencyResolver - { - public ReferenceAssemblyDependencyResolver(FrameworkReferenceResolver frameworkReferenceResolver) - { - FrameworkResolver = frameworkReferenceResolver; - } - - private FrameworkReferenceResolver FrameworkResolver { get; set; } - - public LibraryDescription GetDescription(ProjectLibraryDependency libraryDependency, NuGetFramework targetFramework) - { - if (!libraryDependency.LibraryRange.TypeConstraintAllows(LibraryDependencyTarget.Reference)) - { - return null; - } - - var name = libraryDependency.Name; - var version = libraryDependency.LibraryRange.VersionRange?.MinVersion; - - string path; - Version assemblyVersion; - - if (!FrameworkResolver.TryGetAssembly(name, targetFramework, out path, out assemblyVersion)) - { - return null; - } - - return new LibraryDescription( - new LibraryIdentity(libraryDependency.Name, new NuGetVersion(assemblyVersion), LibraryType.Reference), - string.Empty, // Framework assemblies don't have hashes - path, - Enumerable.Empty(), - targetFramework, - resolved: true, - compatible: true); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/UnresolvedDependencyProvider.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/UnresolvedDependencyProvider.cs deleted file mode 100644 index 812c658b4..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resolution/UnresolvedDependencyProvider.cs +++ /dev/null @@ -1,48 +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.Linq; -using NuGet.Frameworks; -using NuGet.LibraryModel; - -namespace Microsoft.DotNet.Internal.ProjectModel.Resolution -{ - internal static class UnresolvedDependencyProvider - { - public static LibraryDescription GetDescription(ProjectLibraryDependency libraryDependency, NuGetFramework targetFramework) - { - return new LibraryDescription( - new LibraryIdentity( - libraryDependency.Name, - libraryDependency.LibraryRange.VersionRange?.MinVersion, - GetLibraryTypeFromLibraryDependencyTarget(libraryDependency.LibraryRange.TypeConstraint)), - hash: null, - path: null, - dependencies: Enumerable.Empty(), - framework: targetFramework, - resolved: false, - compatible: true); - } - - private static LibraryType GetLibraryTypeFromLibraryDependencyTarget(LibraryDependencyTarget target) - { - switch(target) - { - case LibraryDependencyTarget.Package: - return LibraryType.Package; - case LibraryDependencyTarget.Project: - return LibraryType.Project; - case LibraryDependencyTarget.Reference: - return LibraryType.Reference; - case LibraryDependencyTarget.Assembly: - return LibraryType.Assembly; - case LibraryDependencyTarget.ExternalProject: - return LibraryType.ExternalProject; - case LibraryDependencyTarget.WinMD: - return LibraryType.WinMD; - default: - return LibraryType.Unresolved; - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ResourceFile.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ResourceFile.cs deleted file mode 100644 index 1605cde4f..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/ResourceFile.cs +++ /dev/null @@ -1,22 +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.Threading.Tasks; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal class ResourceFile - { - public string Path { get; } - public string Locale { get; } - - public ResourceFile(string path, string locale) - { - Path = path; - Locale = locale; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resources/CultureInfoCache.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resources/CultureInfoCache.cs deleted file mode 100644 index 7cc2db9e1..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resources/CultureInfoCache.cs +++ /dev/null @@ -1,442 +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.Internal.ProjectModel.Resources -{ - /// - /// Contains a list of known culture names that can be used to create a . - /// - internal static class CultureInfoCache - { - /// - /// This list of known cultures was generated by CultureInfoGenerator using .NET Framework 4.6 RC or later on - /// Microsoft Windows NT 6.2.9200.0. - /// As new versions of .NET Framework and Windows are released, this list should be regenerated to ensure it - /// contains the latest culture names. - /// - public static readonly HashSet KnownCultureNames = new HashSet(StringComparer.OrdinalIgnoreCase) - { - "", - "af", - "af-ZA", - "am", - "am-ET", - "ar", - "ar-AE", - "ar-BH", - "ar-DZ", - "ar-EG", - "ar-IQ", - "ar-JO", - "ar-KW", - "ar-LB", - "ar-LY", - "ar-MA", - "ar-OM", - "ar-QA", - "ar-SA", - "ar-SY", - "ar-TN", - "ar-YE", - "arn", - "arn-CL", - "as", - "as-IN", - "az", - "az-Cyrl", - "az-Cyrl-AZ", - "az-Latn", - "az-Latn-AZ", - "ba", - "ba-RU", - "be", - "be-BY", - "bg", - "bg-BG", - "bn", - "bn-BD", - "bn-IN", - "bo", - "bo-CN", - "br", - "br-FR", - "bs", - "bs-Cyrl", - "bs-Cyrl-BA", - "bs-Latn", - "bs-Latn-BA", - "ca", - "ca-ES", - "ca-ES-valencia", - "chr", - "chr-Cher", - "chr-Cher-US", - "co", - "co-FR", - "cs", - "cs-CZ", - "cy", - "cy-GB", - "da", - "da-DK", - "de", - "de-AT", - "de-CH", - "de-DE", - "de-LI", - "de-LU", - "dsb", - "dsb-DE", - "dv", - "dv-MV", - "el", - "el-GR", - "en", - "en-029", - "en-AU", - "en-BZ", - "en-CA", - "en-GB", - "en-HK", - "en-IE", - "en-IN", - "en-JM", - "en-MY", - "en-NZ", - "en-PH", - "en-SG", - "en-TT", - "en-US", - "en-ZA", - "en-ZW", - "es", - "es-419", - "es-AR", - "es-BO", - "es-CL", - "es-CO", - "es-CR", - "es-DO", - "es-EC", - "es-ES", - "es-GT", - "es-HN", - "es-MX", - "es-NI", - "es-PA", - "es-PE", - "es-PR", - "es-PY", - "es-SV", - "es-US", - "es-UY", - "es-VE", - "et", - "et-EE", - "eu", - "eu-ES", - "fa", - "fa-IR", - "ff", - "ff-Latn", - "ff-Latn-SN", - "fi", - "fi-FI", - "fil", - "fil-PH", - "fo", - "fo-FO", - "fr", - "fr-BE", - "fr-CA", - "fr-CD", - "fr-CH", - "fr-CI", - "fr-CM", - "fr-FR", - "fr-HT", - "fr-LU", - "fr-MA", - "fr-MC", - "fr-ML", - "fr-RE", - "fr-SN", - "fy", - "fy-NL", - "ga", - "ga-IE", - "gd", - "gd-GB", - "gl", - "gl-ES", - "gn", - "gn-PY", - "gsw", - "gsw-FR", - "gu", - "gu-IN", - "ha", - "ha-Latn", - "ha-Latn-NG", - "haw", - "haw-US", - "he", - "he-IL", - "hi", - "hi-IN", - "hr", - "hr-BA", - "hr-HR", - "hsb", - "hsb-DE", - "hu", - "hu-HU", - "hy", - "hy-AM", - "id", - "id-ID", - "ig", - "ig-NG", - "ii", - "ii-CN", - "is", - "is-IS", - "it", - "it-CH", - "it-IT", - "iu", - "iu-Cans", - "iu-Cans-CA", - "iu-Latn", - "iu-Latn-CA", - "ja", - "ja-JP", - "jv", - "jv-Latn", - "jv-Latn-ID", - "ka", - "ka-GE", - "kk", - "kk-KZ", - "kl", - "kl-GL", - "km", - "km-KH", - "kn", - "kn-IN", - "ko", - "ko-KR", - "kok", - "kok-IN", - "ku", - "ku-Arab", - "ku-Arab-IQ", - "ky", - "ky-KG", - "lb", - "lb-LU", - "lo", - "lo-LA", - "lt", - "lt-LT", - "lv", - "lv-LV", - "mg", - "mg-MG", - "mi", - "mi-NZ", - "mk", - "mk-MK", - "ml", - "ml-IN", - "mn", - "mn-Cyrl", - "mn-MN", - "mn-Mong", - "mn-Mong-CN", - "mn-Mong-MN", - "moh", - "moh-CA", - "mr", - "mr-IN", - "ms", - "ms-BN", - "ms-MY", - "mt", - "mt-MT", - "my", - "my-MM", - "nb", - "nb-NO", - "ne", - "ne-IN", - "ne-NP", - "nl", - "nl-BE", - "nl-NL", - "nn", - "nn-NO", - "no", - "nqo", - "nqo-GN", - "nso", - "nso-ZA", - "oc", - "oc-FR", - "om", - "om-ET", - "or", - "or-IN", - "pa", - "pa-Arab", - "pa-Arab-PK", - "pa-IN", - "pl", - "pl-PL", - "prs", - "prs-AF", - "ps", - "ps-AF", - "pt", - "pt-AO", - "pt-BR", - "pt-PT", - "qut", - "qut-GT", - "quz", - "quz-BO", - "quz-EC", - "quz-PE", - "rm", - "rm-CH", - "ro", - "ro-MD", - "ro-RO", - "ru", - "ru-RU", - "rw", - "rw-RW", - "sa", - "sa-IN", - "sah", - "sah-RU", - "sd", - "sd-Arab", - "sd-Arab-PK", - "se", - "se-FI", - "se-NO", - "se-SE", - "si", - "si-LK", - "sk", - "sk-SK", - "sl", - "sl-SI", - "sma", - "sma-NO", - "sma-SE", - "smj", - "smj-NO", - "smj-SE", - "smn", - "smn-FI", - "sms", - "sms-FI", - "sn", - "sn-Latn", - "sn-Latn-ZW", - "so", - "so-SO", - "sq", - "sq-AL", - "sr", - "sr-Cyrl", - "sr-Cyrl-BA", - "sr-Cyrl-CS", - "sr-Cyrl-ME", - "sr-Cyrl-RS", - "sr-Latn", - "sr-Latn-BA", - "sr-Latn-CS", - "sr-Latn-ME", - "sr-Latn-RS", - "st", - "st-ZA", - "sv", - "sv-FI", - "sv-SE", - "sw", - "sw-KE", - "syr", - "syr-SY", - "ta", - "ta-IN", - "ta-LK", - "te", - "te-IN", - "tg", - "tg-Cyrl", - "tg-Cyrl-TJ", - "th", - "th-TH", - "ti", - "ti-ER", - "ti-ET", - "tk", - "tk-TM", - "tn", - "tn-BW", - "tn-ZA", - "tr", - "tr-TR", - "ts", - "ts-ZA", - "tt", - "tt-RU", - "tzm", - "tzm-Latn", - "tzm-Latn-DZ", - "tzm-Tfng", - "tzm-Tfng-MA", - "ug", - "ug-CN", - "uk", - "uk-UA", - "ur", - "ur-IN", - "ur-PK", - "uz", - "uz-Cyrl", - "uz-Cyrl-UZ", - "uz-Latn", - "uz-Latn-UZ", - "vi", - "vi-VN", - "wo", - "wo-SN", - "xh", - "xh-ZA", - "yo", - "yo-NG", - "zgh", - "zgh-Tfng", - "zgh-Tfng-MA", - "zh", - "zh-CN", - "zh-Hans", - "zh-Hant", - "zh-HK", - "zh-MO", - "zh-SG", - "zh-TW", - "zu", - "zu-ZA", - "zh-CHS", - "zh-CHT" - }; - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resources/ResourceUtility.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resources/ResourceUtility.cs deleted file mode 100644 index b3f7eb16c..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Resources/ResourceUtility.cs +++ /dev/null @@ -1,79 +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.Internal.ProjectModel.Utilities; - -namespace Microsoft.DotNet.Internal.ProjectModel.Resources -{ - internal static class ResourceUtility - { - public static string GetResourceName(string projectFolder, string resourcePath) - { - // If the file is outside of the project folder, we are assuming it is directly in the root - // otherwise, keep the folders that are inside the project - return PathUtility.IsChildOfDirectory(projectFolder, resourcePath) ? - PathUtility.GetRelativePath(projectFolder, resourcePath) : - Path.GetFileName(resourcePath); - } - - public static bool IsResourceFile(string fileName) - { - var ext = Path.GetExtension(fileName); - - return - IsResxFile(fileName) || - string.Equals(ext, ".restext", StringComparison.OrdinalIgnoreCase) || - string.Equals(ext, ".resources", StringComparison.OrdinalIgnoreCase); - } - - public static bool IsResxFile(string fileName) - { - var ext = Path.GetExtension(fileName); - - return string.Equals(ext, ".resx", StringComparison.OrdinalIgnoreCase); - } - - public static IEnumerable GetResourcesForCulture(string cultureName, IList resources) - { - var resourcesByCultureName = resources - .GroupBy(GetResourceCultureName, StringComparer.OrdinalIgnoreCase); - - if (string.Equals(cultureName, "neutral", StringComparison.OrdinalIgnoreCase)) - { - cultureName = string.Empty; - } - - return resourcesByCultureName - .SingleOrDefault(grouping => string.Equals(grouping.Key, cultureName, StringComparison.OrdinalIgnoreCase)); - } - - public static string GetResourceCultureName(string res) - { - var ext = Path.GetExtension(res); - - if (IsResourceFile(res)) - { - var resourceBaseName = Path.GetFileNameWithoutExtension(Path.GetFileName(res)); - var cultureName = Path.GetExtension(resourceBaseName); - if (string.IsNullOrEmpty(cultureName) || cultureName.Length < 3) - { - return string.Empty; - } - - // Path.Extension adds a . to the file extension name; example - ".resources". Removing the "." with Substring - cultureName = cultureName.Substring(1); - - if (CultureInfoCache.KnownCultureNames.Contains(cultureName)) - { - return cultureName; - } - } - - return string.Empty; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeConfig/RuntimeConfig.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeConfig/RuntimeConfig.cs deleted file mode 100644 index 0fa019796..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeConfig/RuntimeConfig.cs +++ /dev/null @@ -1,60 +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 Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System.IO; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal 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.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeConfig/RuntimeConfigFramework.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeConfig/RuntimeConfigFramework.cs deleted file mode 100644 index 2c94490b0..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeConfig/RuntimeConfigFramework.cs +++ /dev/null @@ -1,36 +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 Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal 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.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeGraphCollector.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeGraphCollector.cs deleted file mode 100644 index 4e92196c5..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeGraphCollector.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.Collections.Generic; -using System.IO; -using System.Linq; -using NuGet.LibraryModel; -using NuGet.RuntimeModel; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - class RuntimeGraphCollector - { - private const string RuntimeJsonFileName = "runtime.json"; - - public static RuntimeGraph Collect(IEnumerable libraries) - { - var graph = RuntimeGraph.Empty; - foreach (var library in libraries) - { - if (library.Identity.Type == LibraryType.Package) - { - var runtimeJson = ((PackageDescription)library).PackageLibrary.Files.FirstOrDefault(f => f == RuntimeJsonFileName); - if (runtimeJson != null) - { - var runtimeJsonFullName = Path.Combine(library.Path, runtimeJson); - graph = RuntimeGraph.Merge(graph, JsonRuntimeFormat.ReadRuntimeGraph(runtimeJsonFullName)); - } - } - } - return graph; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeOptions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeOptions.cs deleted file mode 100644 index a03d22ca8..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeOptions.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. - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal class RuntimeOptions - { - public bool GcServer { get; set; } - - public bool GcConcurrent { get; set; } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeOutputFiles.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeOutputFiles.cs deleted file mode 100644 index cee19bd7a..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/RuntimeOutputFiles.cs +++ /dev/null @@ -1,98 +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.IO; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal class RuntimeOutputFiles : CompilationOutputFiles - { - private readonly string _runtimeIdentifier; - - public RuntimeOutputFiles(string basePath, - Project project, - string configuration, - NuGetFramework framework, - string runtimeIdentifier) : base(basePath, project, configuration, framework) - { - _runtimeIdentifier = runtimeIdentifier; - } - - public string Executable - { - get - { - var extension = FileNameSuffixes.CurrentPlatform.Exe; - - if (Framework.IsDesktop()) - { - // This is the check for mono, if we're not on windows and producing outputs for - // the desktop framework then it's an exe - extension = FileNameSuffixes.DotNet.Exe; - } - else if (string.IsNullOrEmpty(_runtimeIdentifier)) - { - // The executable is a DLL in this case - extension = FileNameSuffixes.DotNet.DynamicLib; - } - - var compilerOptions = Project.GetCompilerOptions(Framework, Configuration); - - return Path.Combine(BasePath, compilerOptions.OutputName + extension); - } - } - - public string DepsJson - { - get - { - return Path.ChangeExtension(Assembly, FileNameSuffixes.DepsJson); - } - } - - public string RuntimeConfigJson - { - get - { - return Path.ChangeExtension(Assembly, FileNameSuffixes.RuntimeConfigJson); - } - } - - public string Config - { - get { return Assembly + ".config"; } - } - - public override IEnumerable All() - { - foreach (var file in base.All()) - { - yield return file; - } - - if (Project.HasRuntimeOutput(Config)) - { - if (!Framework.IsDesktop()) - { - yield return DepsJson; - yield return RuntimeConfigJson; - } - - // If the project actually has an entry point - var hasEntryPoint = Project.GetCompilerOptions(targetFramework: null, configurationName: Configuration).EmitEntryPoint ?? false; - if (hasEntryPoint) - { - // Yield the executable - yield return Executable; - } - } - - if (File.Exists(Config)) - { - yield return Config; - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/TargetFrameworkInformation.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/TargetFrameworkInformation.cs deleted file mode 100644 index 8d36ed788..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/TargetFrameworkInformation.cs +++ /dev/null @@ -1,28 +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 NuGet.Frameworks; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal class TargetFrameworkInformation - { - public NuGetFramework FrameworkName { get; set; } - - public IReadOnlyList Dependencies { get; set; } - - public CommonCompilerOptions CompilerOptions { get; set; } - - public int Line { get; set; } - - public int Column { get; set; } - - // REVIEW: Wrapping, we might do this differntly - public string WrappedProject { get; set; } - - public string AssemblyPath { get; set; } - - public IEnumerable Imports { get; set; } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/TargetLibraryWithAssets.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/TargetLibraryWithAssets.cs deleted file mode 100644 index 50b7049f8..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/TargetLibraryWithAssets.cs +++ /dev/null @@ -1,48 +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 NuGet.Frameworks; -using NuGet.LibraryModel; -using NuGet.ProjectModel; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - internal abstract class TargetLibraryWithAssets : LibraryDescription - { - public TargetLibraryWithAssets( - LibraryIdentity libraryIdentity, - string sha512, - string path, - LockFileTargetLibrary lockFileLibrary, - IEnumerable dependencies, - bool compatible, - bool resolved, - NuGetFramework framework = null) - : base( - libraryIdentity, - sha512, - path, - dependencies: dependencies, - framework: null, - resolved: resolved, - compatible: compatible) - { - TargetLibrary = lockFileLibrary; - } - - private LockFileTargetLibrary TargetLibrary { get; } - - public virtual IEnumerable RuntimeAssemblies => TargetLibrary.RuntimeAssemblies; - - public virtual IEnumerable CompileTimeAssemblies => TargetLibrary.CompileTimeAssemblies; - - public virtual IEnumerable ResourceAssemblies => TargetLibrary.ResourceAssemblies; - - public virtual IEnumerable NativeLibraries => TargetLibrary.NativeLibraries; - - public virtual IEnumerable ContentFiles => TargetLibrary.ContentFiles; - - public virtual IEnumerable RuntimeTargets => TargetLibrary.RuntimeTargets; - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/CollectionExtensions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/CollectionExtensions.cs deleted file mode 100644 index b9d37016a..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/CollectionExtensions.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.DotNet.Internal.ProjectModel.Compilation; -using System.Linq; - -namespace System.Collections.Generic -{ - internal static class CollectionExtensions - { - public static LibraryAssetGroup GetDefaultGroup(this IEnumerable self) => GetGroup(self, string.Empty); - public static LibraryAssetGroup GetRuntimeGroup(this IEnumerable self, string runtime) - { - if(string.IsNullOrEmpty(runtime)) - { - throw new ArgumentNullException(nameof(runtime)); - } - return GetGroup(self, runtime); - } - - private static LibraryAssetGroup GetGroup(IEnumerable groups, string runtime) - { - return groups.FirstOrDefault(g => g.Runtime == runtime); - } - - public static IEnumerable GetDefaultAssets(this IEnumerable self) => GetAssets(self, string.Empty); - public static IEnumerable GetRuntimeAssets(this IEnumerable self, string runtime) - { - if(string.IsNullOrEmpty(runtime)) - { - throw new ArgumentNullException(nameof(runtime)); - } - return GetAssets(self, runtime); - } - - private static IEnumerable GetAssets(IEnumerable self, string runtime) - { - return self - .Where(a => string.Equals(a.Runtime, runtime, StringComparison.Ordinal)) - .SelectMany(a => a.Assets); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/DictionaryExtensions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/DictionaryExtensions.cs deleted file mode 100644 index 5c08da37b..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/DictionaryExtensions.cs +++ /dev/null @@ -1,35 +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; - -namespace Microsoft.DotNet.Internal.ProjectModel.Utilities -{ - internal static class DictionaryExtensions - { - public static IEnumerable GetOrEmpty(this IDictionary> self, K key) - { - IEnumerable val; - return !self.TryGetValue(key, out val) - ? Enumerable.Empty() - : val; - } - - public static TValue GetOrAdd(this IDictionary dictionary, TKey key, Func factory) - { - lock (dictionary) - { - TValue value; - if (!dictionary.TryGetValue(key, out value)) - { - value = factory(key); - dictionary[key] = value; - } - - return value; - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/FrameworksExtensions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/FrameworksExtensions.cs deleted file mode 100644 index 903d9697f..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/FrameworksExtensions.cs +++ /dev/null @@ -1,60 +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.Runtime.Versioning; - -namespace NuGet.Frameworks -{ - internal static class FrameworksExtensions - { - // HACK(anurse): NuGet.Frameworks turns "dnxcore50" into "dnxcore5" :( - public static string GetTwoDigitShortFolderName(this NuGetFramework self) - { - var original = self.GetShortFolderName(); - var index = 0; - for (; index < original.Length; index++) - { - if (char.IsDigit(original[index])) - { - break; - } - } - - var versionPart = original.Substring(index); - if (versionPart.Length >= 2) - { - return original; - } - - // Assume if the version part was preserved then leave it alone - if (versionPart.IndexOf('.') != -1) - { - return original; - } - - var name = original.Substring(0, index); - var version = self.Version.ToString(2); - - if (self.Framework.Equals(FrameworkConstants.FrameworkIdentifiers.NetPlatform)) - { - return name + version; - } - - return name + version.Replace(".", string.Empty); - } - - // NuGet.Frameworks doesn't have the equivalent of the old VersionUtility.GetFrameworkString - // which is relevant for building packages - public static string GetFrameworkString(this NuGetFramework self) - { - var frameworkName = new FrameworkName(self.DotNetFrameworkName); - string name = frameworkName.Identifier + frameworkName.Version; - if (string.IsNullOrEmpty(frameworkName.Profile)) - { - return name; - } - return name + "-" + frameworkName.Profile; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/PathUtility.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/PathUtility.cs deleted file mode 100644 index 73257f35c..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/PathUtility.cs +++ /dev/null @@ -1,216 +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.PlatformAbstractions; - -namespace Microsoft.DotNet.Internal.ProjectModel.Utilities -{ - internal static class PathUtility - { - public static bool IsChildOfDirectory(string dir, string candidate) - { - if (dir == null) - { - throw new ArgumentNullException(nameof(dir)); - } - if (candidate == null) - { - throw new ArgumentNullException(nameof(candidate)); - } - dir = Path.GetFullPath(dir); - dir = EnsureTrailingSlash(dir); - candidate = Path.GetFullPath(candidate); - return candidate.StartsWith(dir, StringComparison.OrdinalIgnoreCase); - } - - public static string EnsureTrailingSlash(this string path) - { - return EnsureTrailingCharacter(path, Path.DirectorySeparatorChar); - } - - public static string EnsureTrailingForwardSlash(string path) - { - return EnsureTrailingCharacter(path, '/'); - } - - 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; - } - - public static void EnsureParentDirectoryExists(string filePath) - { - string directory = Path.GetDirectoryName(filePath); - - EnsureDirectoryExists(directory); - } - - public static void EnsureDirectoryExists(string directoryPath) - { - if (!Directory.Exists(directoryPath)) - { - Directory.CreateDirectory(directoryPath); - } - } - - /// - /// Returns relative to , with Path.DirectorySeparatorChar as separator - /// - public static string GetRelativePath(string path1, string path2) - { - return GetRelativePath(path1, path2, Path.DirectorySeparatorChar, includeDirectoryTraversals: true); - } - - /// - /// Returns relative to , with Path.DirectorySeparatorChar - /// as separator but ignoring directory traversals. - /// - public static string GetRelativePathIgnoringDirectoryTraversals(string path1, string path2) - { - return GetRelativePath(path1, path2, Path.DirectorySeparatorChar, false); - } - - /// - /// Returns relative to , with given path separator - /// - public static string GetRelativePath(string path1, string path2, char separator, bool includeDirectoryTraversals) - { - if (string.IsNullOrEmpty(path1)) - { - throw new ArgumentException("Path must have a value", nameof(path1)); - } - - if (string.IsNullOrEmpty(path2)) - { - throw new ArgumentException("Path must have a value", nameof(path2)); - } - - StringComparison compare; - if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows) - { - compare = StringComparison.OrdinalIgnoreCase; - // check if paths are on the same volume - if (!string.Equals(Path.GetPathRoot(path1), Path.GetPathRoot(path2))) - { - // on different volumes, "relative" path is just path2 - return path2; - } - } - else - { - compare = StringComparison.Ordinal; - } - - var index = 0; - var path1Segments = path1.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); - var path2Segments = path2.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); - // if path1 does not end with / it is assumed the end is not a directory - // we will assume that is isn't a directory by ignoring the last split - var len1 = path1Segments.Length - 1; - var len2 = path2Segments.Length; - - // find largest common absolute path between both paths - var min = Math.Min(len1, len2); - while (min > index) - { - if (!string.Equals(path1Segments[index], path2Segments[index], compare)) - { - break; - } - // Handle scenarios where folder and file have same name (only if os supports same name for file and directory) - // e.g. /file/name /file/name/app - else if ((len1 == index && len2 > index + 1) || (len1 > index && len2 == index + 1)) - { - break; - } - ++index; - } - - var path = ""; - - // check if path2 ends with a non-directory separator and if path1 has the same non-directory at the end - if (len1 + 1 == len2 && !string.IsNullOrEmpty(path1Segments[index]) && - string.Equals(path1Segments[index], path2Segments[index], compare)) - { - return path; - } - - if (includeDirectoryTraversals) - { - for (var i = index; len1 > i; ++i) - { - path += ".." + separator; - } - } - - for (var i = index; len2 - 1 > i; ++i) - { - path += path2Segments[i] + separator; - } - // if path2 doesn't end with an empty string it means it ended with a non-directory name, so we add it back - if (!string.IsNullOrEmpty(path2Segments[len2 - 1])) - { - path += path2Segments[len2 - 1]; - } - - return path; - } - - public static string GetAbsolutePath(string basePath, string relativePath) - { - if (basePath == null) - { - throw new ArgumentNullException(nameof(basePath)); - } - - if (relativePath == null) - { - throw new ArgumentNullException(nameof(relativePath)); - } - - Uri resultUri = new Uri(new Uri(basePath), new Uri(relativePath, UriKind.Relative)); - return resultUri.LocalPath; - } - - public static string GetDirectoryName(string path) - { - path = path.TrimEnd(Path.DirectorySeparatorChar); - return path.Substring(Path.GetDirectoryName(path).Length).Trim(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); - } - - public static string GetPathWithForwardSlashes(string path) - { - return path.Replace('\\', '/'); - } - - public static string GetPathWithBackSlashes(string path) - { - return path.Replace('/', '\\'); - } - - public static string GetPathWithDirectorySeparator(string path) - { - if (Path.DirectorySeparatorChar == '/') - { - return GetPathWithForwardSlashes(path); - } - else - { - return GetPathWithBackSlashes(path); - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/ResilientFileStreamOpener.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/ResilientFileStreamOpener.cs deleted file mode 100644 index ab31cbaa5..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/ResilientFileStreamOpener.cs +++ /dev/null @@ -1,45 +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.Threading; - -namespace Microsoft.DotNet.Internal.ProjectModel.Utilities -{ - internal class ResilientFileStreamOpener - { - public static FileStream OpenFile(string filepath) - { - return OpenFile(filepath, 0); - } - - public static FileStream OpenFile(string filepath, int retry) - { - if (retry < 0) - { - throw new ArgumentException("Retry can't be fewer than 0", nameof(retry)); - } - - var count = 0; - while (true) - { - try - { - return new FileStream(filepath, FileMode.Open, FileAccess.Read, FileShare.Read); - } - catch - { - if (++count > retry) - { - throw; - } - else - { - Thread.Sleep(500); - } - } - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/VersionUtility.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/VersionUtility.cs deleted file mode 100644 index cfc75f6a6..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Utilities/VersionUtility.cs +++ /dev/null @@ -1,123 +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. - -#if !NET451 -using System; -using System.IO; -using System.Reflection.Metadata; -using System.Reflection.PortableExecutable; -#endif -using System.Reflection; -using System.Text; -using NuGet.Versioning; - -namespace Microsoft.DotNet.Internal.ProjectModel.Utilities -{ - internal static class VersionUtility - { - public static readonly string DnxCoreFrameworkIdentifier = "DNXCore"; - public static readonly string DnxFrameworkIdentifier = "DNX"; - public static readonly string NetPlatformFrameworkIdentifier = ".NETPlatform"; - public static readonly string NetFrameworkIdentifier = ".NETFramework"; - - internal static NuGetVersion GetAssemblyVersion(string path) - { -#if NET451 - return new NuGetVersion(AssemblyName.GetAssemblyName(path).Version); -#else - return new NuGetVersion(GetAssemblyVersionPrivate(path)); -#endif - } - -#if !NET451 - private static Version GetAssemblyVersionPrivate(string assemblyPath) - { - using (var fileStream = new FileStream(assemblyPath, FileMode.Open, FileAccess.Read, FileShare.Delete | FileShare.Read)) - { - return GetAssemblyVersionPrivate(fileStream); - } - } - - private static Version GetAssemblyVersionPrivate(Stream assemblyStream) - { - Version result = null; - try - { - using (PEReader peReader = new PEReader(assemblyStream, PEStreamOptions.LeaveOpen)) - { - if (peReader.HasMetadata) - { - MetadataReader reader = peReader.GetMetadataReader(); - result = reader.GetAssemblyDefinition().Version; - } - } - } - catch (BadImageFormatException) - { - // not a PE - } - - return result; - } -#endif - - public static string RenderVersion(VersionRange range) - { - if (range == null) - { - return null; - } - - if (range.MinVersion == range.MaxVersion && - (range.Float == null || range.Float.FloatBehavior == NuGetVersionFloatBehavior.None)) - { - return range.MinVersion.ToNormalizedString(); - } - var sb = new StringBuilder(); - sb.Append(">= "); - switch (range?.Float?.FloatBehavior) - { - case null: - case NuGetVersionFloatBehavior.None: - sb.Append(range.MinVersion.ToNormalizedString()); - break; - case NuGetVersionFloatBehavior.Prerelease: - // Work around nuget bug: https://github.com/NuGet/Home/issues/1598 - // sb.AppendFormat("{0}-*", range.MinVersion); - sb.Append($"{range.MinVersion.Version.Major}.{range.MinVersion.Version.Minor}.{range.MinVersion.Version.Build}"); - if (string.IsNullOrEmpty(range.MinVersion.Release) || - string.Equals("-", range.MinVersion.Release)) - { - sb.Append($"-*"); - } - else - { - sb.Append($"-{range.MinVersion.Release}*"); - } - break; - case NuGetVersionFloatBehavior.Revision: - sb.Append($"{range.MinVersion.Version.Major}.{range.MinVersion.Version.Minor}.{range.MinVersion.Version.Build}.*"); - break; - case NuGetVersionFloatBehavior.Patch: - sb.Append($"{range.MinVersion.Version.Major}.{range.MinVersion.Version.Minor}.*"); - break; - case NuGetVersionFloatBehavior.Minor: - sb.AppendFormat($"{range.MinVersion.Version.Major}.*"); - break; - case NuGetVersionFloatBehavior.Major: - sb.AppendFormat("*"); - break; - default: - break; - } - - if (range.MaxVersion != null) - { - sb.Append(range.IsMaxInclusive ? " <= " : " < "); - sb.Append(range.MaxVersion); - } - - return sb.ToString(); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Workspace.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Workspace.cs deleted file mode 100644 index 0a865a049..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.Internal.ProjectModel/Workspace.cs +++ /dev/null @@ -1,299 +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.Concurrent; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Microsoft.DotNet.Internal.ProjectModel.Utilities; -using NuGet.Frameworks; -using NuGet.ProjectModel; - -namespace Microsoft.DotNet.Internal.ProjectModel -{ - /// - /// Represents a cache of Projects, LockFiles, and ProjectContexts - /// - internal abstract class Workspace - { - // key: project directory - private readonly ConcurrentDictionary> _projectsCache - = new ConcurrentDictionary>(); - - // key: project directory - private readonly ConcurrentDictionary> _lockFileCache - = new ConcurrentDictionary>(); - - // key: project directory, target framework - private readonly ConcurrentDictionary _projectContextsCache - = new ConcurrentDictionary(); - - private readonly ProjectReaderSettings _settings; - private readonly LockFileFormat _lockFileReader; - private readonly bool _designTime; - - protected Workspace(ProjectReaderSettings settings, bool designTime) - { - _settings = settings; - _lockFileReader = new LockFileFormat(); - _designTime = designTime; - } - - public ProjectContext GetProjectContext(string projectPath, NuGetFramework framework) - { - var contexts = GetProjectContextCollection(projectPath); - if (contexts == null) - { - return null; - } - - return contexts - .ProjectContexts - .FirstOrDefault(c => Equals(c.TargetFramework, framework) && string.IsNullOrEmpty(c.RuntimeIdentifier)); - } - - public ProjectContextCollection GetProjectContextCollection(string projectPath, bool clearCache) - { - var normalizedPath = ProjectPathHelper.NormalizeProjectDirectoryPath(projectPath); - if (normalizedPath == null) - { - return null; - } - - if (clearCache) - { - _projectContextsCache.Clear(); - _projectsCache.Clear(); - _lockFileCache.Clear(); - } - - return _projectContextsCache.AddOrUpdate( - normalizedPath, - key => AddProjectContextEntry(key, null), - (key, oldEntry) => AddProjectContextEntry(key, oldEntry)); - } - - public ProjectContextCollection GetProjectContextCollection(string projectPath) - { - return GetProjectContextCollection(projectPath, clearCache: false); - } - - public Project GetProject(string projectDirectory) => GetProjectCore(projectDirectory)?.Model; - - private LockFile GetLockFile(string projectDirectory) - { - var normalizedPath = ProjectPathHelper.NormalizeProjectDirectoryPath(projectDirectory); - if (normalizedPath == null) - { - return null; - } - - return _lockFileCache.AddOrUpdate( - normalizedPath, - key => AddLockFileEntry(key, null), - (key, oldEntry) => AddLockFileEntry(key, oldEntry)).Model; - } - - - private FileModelEntry GetProjectCore(string projectDirectory) - { - var normalizedPath = ProjectPathHelper.NormalizeProjectDirectoryPath(projectDirectory); - if (normalizedPath == null) - { - return null; - } - - return _projectsCache.AddOrUpdate( - normalizedPath, - key => AddProjectEntry(key, null), - (key, oldEntry) => AddProjectEntry(key, oldEntry)); - } - - private FileModelEntry AddProjectEntry(string projectDirectory, FileModelEntry currentEntry) - { - if (currentEntry == null) - { - currentEntry = new FileModelEntry(); - } - else if (!File.Exists(Path.Combine(projectDirectory, Project.FileName))) - { - // project was deleted - currentEntry.Reset(); - return currentEntry; - } - - if (currentEntry.IsInvalid) - { - Project project; - if (!ProjectReader.TryGetProject(projectDirectory, out project, _settings)) - { - currentEntry.Reset(); - } - else - { - currentEntry.Diagnostics.AddRange(project.Diagnostics); - currentEntry.Model = project; - currentEntry.FilePath = project.ProjectFilePath; - currentEntry.UpdateLastWriteTimeUtc(); - } - } - - return currentEntry; - } - - private FileModelEntry AddLockFileEntry(string projectDirectory, FileModelEntry currentEntry) - { - if (currentEntry == null) - { - currentEntry = new FileModelEntry(); - } - - if (currentEntry.IsInvalid) - { - currentEntry.Reset(); - - if (!File.Exists(Path.Combine(projectDirectory, LockFileFormat.LockFileName))) - { - return currentEntry; - } - else - { - currentEntry.FilePath = Path.Combine(projectDirectory, LockFileFormat.LockFileName); - - using (var fs = ResilientFileStreamOpener.OpenFile(currentEntry.FilePath, retry: 2)) - { - try - { - currentEntry.Model = _lockFileReader.Read(fs, currentEntry.FilePath); - currentEntry.UpdateLastWriteTimeUtc(); - } - catch (FileFormatException ex) - { - throw ex.WithFilePath(currentEntry.FilePath); - } - catch (Exception ex) - { - throw FileFormatException.Create(ex, currentEntry.FilePath); - } - } - } - } - - return currentEntry; - } - - private ProjectContextCollection AddProjectContextEntry(string projectDirectory, - ProjectContextCollection currentEntry) - { - if (currentEntry == null) - { - // new entry required - currentEntry = new ProjectContextCollection(); - } - - var projectEntry = GetProjectCore(projectDirectory); - - if (projectEntry?.Model == null) - { - // project doesn't exist anymore - currentEntry.Reset(); - return currentEntry; - } - - var project = projectEntry.Model; - if (currentEntry.HasChanged) - { - currentEntry.Reset(); - - var contexts = BuildProjectContexts(project); - - currentEntry.ProjectContexts.AddRange(contexts); - - currentEntry.Project = project; - currentEntry.ProjectFilePath = project.ProjectFilePath; - currentEntry.LastProjectFileWriteTimeUtc = File.GetLastWriteTimeUtc(currentEntry.ProjectFilePath); - - var lockFilePath = Path.Combine(project.ProjectDirectory, LockFileFormat.LockFileName); - if (File.Exists(lockFilePath)) - { - currentEntry.LockFilePath = lockFilePath; - currentEntry.LastLockFileWriteTimeUtc = File.GetLastWriteTimeUtc(lockFilePath); - } - - currentEntry.ProjectDiagnostics.AddRange(projectEntry.Diagnostics); - currentEntry.ProjectDiagnostics.AddRange( - currentEntry.ProjectContexts.SelectMany(c => c.Diagnostics)); - } - - return currentEntry; - } - - protected abstract IEnumerable BuildProjectContexts(Project project); - - /// - /// Creates a ProjectContextBuilder configured to use the Workspace caches. - /// - /// - protected ProjectContextBuilder CreateBaseProjectBuilder() - { - return new ProjectContextBuilder() - .WithProjectReaderSettings(_settings) - .WithProjectResolver(path => GetProjectCore(path)?.Model) - .WithLockFileResolver(path => GetLockFile(path)); - } - - /// - /// Creates a ProjectContextBuilder configured to use the Workspace caches, and the specified root project. - /// - /// The root project - /// - protected ProjectContextBuilder CreateBaseProjectBuilder(Project root) - { - return CreateBaseProjectBuilder().WithProject(root); - } - - protected class FileModelEntry where TModel : class - { - private DateTime _lastWriteTimeUtc; - - public TModel Model { get; set; } - - public string FilePath { get; set; } - - public List Diagnostics { get; } = new List(); - - public void UpdateLastWriteTimeUtc() - { - _lastWriteTimeUtc = File.GetLastWriteTimeUtc(FilePath); - } - - public bool IsInvalid - { - get - { - if (Model == null) - { - return true; - } - - if (!File.Exists(FilePath)) - { - return true; - } - - return _lastWriteTimeUtc < File.GetLastWriteTimeUtc(FilePath); - } - } - - public void Reset() - { - Model = null; - FilePath = null; - Diagnostics.Clear(); - _lastWriteTimeUtc = DateTime.MinValue; - } - } - - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.ProjectJsonMigration.csproj b/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.ProjectJsonMigration.csproj deleted file mode 100644 index 91aad23fc..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Microsoft.DotNet.ProjectJsonMigration.csproj +++ /dev/null @@ -1,29 +0,0 @@ - - - - - $(CliVersionPrefix) - netcoreapp2.0 - true - ../../tools/Key.snk - true - true - - - - - - PreserveNewest - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationBackupPlan.cs b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationBackupPlan.cs deleted file mode 100644 index 9224dfaa2..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationBackupPlan.cs +++ /dev/null @@ -1,221 +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.Text; -using Microsoft.DotNet.Internal.ProjectModel.Utilities; - -namespace Microsoft.DotNet.ProjectJsonMigration -{ - internal class MigrationBackupPlan - { - private const string TempCsprojExtention = ".migration_in_place_backup"; - - private readonly FileInfo globalJson; - private readonly Dictionary> mapOfProjectBackupDirectoryToFilesToMove; - - public DirectoryInfo RootBackupDirectory { get; } - public DirectoryInfo[] ProjectBackupDirectories { get; } - - public IEnumerable FilesToMove(DirectoryInfo projectBackupDirectory) - => mapOfProjectBackupDirectoryToFilesToMove[projectBackupDirectory]; - - public MigrationBackupPlan( - IEnumerable projectDirectories, - DirectoryInfo workspaceDirectory, - Func> getFiles = null) - { - if (projectDirectories == null) - { - throw new ArgumentNullException(nameof(projectDirectories)); - } - - if (!projectDirectories.Any()) - { - throw new ArgumentException("No project directories provided.", nameof(projectDirectories)); - } - - if (workspaceDirectory == null) - { - throw new ArgumentNullException(nameof(workspaceDirectory)); - } - - MigrationTrace.Instance.WriteLine("Computing migration backup plan..."); - - projectDirectories = projectDirectories.Select(pd => new DirectoryInfo(pd.FullName.EnsureTrailingSlash())); - workspaceDirectory = new DirectoryInfo(workspaceDirectory.FullName.EnsureTrailingSlash()); - - MigrationTrace.Instance.WriteLine($" Workspace: {workspaceDirectory.FullName}"); - foreach (var projectDirectory in projectDirectories) - { - MigrationTrace.Instance.WriteLine($" Project: {projectDirectory.FullName}"); - } - - var rootDirectory = FindCommonRootPath(projectDirectories.ToArray()) ?? workspaceDirectory; - rootDirectory = new DirectoryInfo(rootDirectory.FullName.EnsureTrailingSlash()); - - MigrationTrace.Instance.WriteLine($" Root: {rootDirectory.FullName}"); - - globalJson = new FileInfo( - Path.Combine( - workspaceDirectory.FullName, - "global.json")); - - RootBackupDirectory = new DirectoryInfo( - GetUniqueDirectoryPath( - Path.Combine( - rootDirectory.FullName, - "backup")) - .EnsureTrailingSlash()); - - MigrationTrace.Instance.WriteLine($" Root Backup: {RootBackupDirectory.FullName}"); - - var projectBackupDirectories = new List(); - mapOfProjectBackupDirectoryToFilesToMove = new Dictionary>(); - getFiles = getFiles ?? (dir => dir.EnumerateFiles()); - - foreach (var projectDirectory in projectDirectories) - { - var projectBackupDirectory = ComputeProjectBackupDirectoryPath(rootDirectory, projectDirectory, RootBackupDirectory); - var filesToMove = getFiles(projectDirectory).Where(NeedsBackup); - - projectBackupDirectories.Add(projectBackupDirectory); - mapOfProjectBackupDirectoryToFilesToMove.Add(projectBackupDirectory, filesToMove); - } - - ProjectBackupDirectories = projectBackupDirectories.ToArray(); - } - - public void PerformBackup() - { - if (globalJson.Exists) - { - PathUtility.EnsureDirectoryExists(RootBackupDirectory.FullName); - - globalJson.MoveTo( - Path.Combine( - RootBackupDirectory.FullName, - globalJson.Name)); - } - - foreach (var kvp in mapOfProjectBackupDirectoryToFilesToMove) - { - var projectBackupDirectory = kvp.Key; - var filesToMove = kvp.Value; - - PathUtility.EnsureDirectoryExists(projectBackupDirectory.FullName); - - foreach (var file in filesToMove) - { - var fileName = file.Name.EndsWith(TempCsprojExtention) - ? Path.GetFileNameWithoutExtension(file.Name) - : file.Name; - - file.MoveTo( - Path.Combine( - projectBackupDirectory.FullName, - fileName)); - } - } - } - - private static DirectoryInfo ComputeProjectBackupDirectoryPath( - DirectoryInfo rootDirectory, DirectoryInfo projectDirectory, DirectoryInfo rootBackupDirectory) - { - if (PathUtility.IsChildOfDirectory(rootDirectory.FullName, projectDirectory.FullName)) - { - var relativePath = PathUtility.GetRelativePath( - rootDirectory.FullName, - projectDirectory.FullName); - - return new DirectoryInfo( - Path.Combine( - rootBackupDirectory.FullName, - relativePath) - .EnsureTrailingSlash()); - } - - // Ensure that we use a unique name to avoid collisions as a fallback. - return new DirectoryInfo( - GetUniqueDirectoryPath( - Path.Combine( - rootBackupDirectory.FullName, - projectDirectory.Name) - .EnsureTrailingSlash())); - } - - private static bool NeedsBackup(FileInfo file) - => file.Name == "project.json" - || file.Extension == ".xproj" - || file.FullName.EndsWith(".xproj.user") - || file.FullName.EndsWith(".lock.json") - || file.FullName.EndsWith(TempCsprojExtention); - - private static string GetUniqueDirectoryPath(string directoryPath) - { - var candidatePath = directoryPath; - - var suffix = 1; - while (Directory.Exists(candidatePath)) - { - candidatePath = $"{directoryPath}_{suffix++}"; - } - - return candidatePath; - } - - private static DirectoryInfo FindCommonRootPath(DirectoryInfo[] paths) - { - var pathSplits = new string[paths.Length][]; - var shortestLength = int.MaxValue; - for (int i = 0; i < paths.Length; i++) - { - pathSplits[i] = paths[i].FullName.Split(new[] { Path.DirectorySeparatorChar }); - shortestLength = Math.Min(shortestLength, pathSplits[i].Length); - } - - var builder = new StringBuilder(); - var splitIndex = 0; - while (splitIndex < shortestLength) - { - var split = pathSplits[0][splitIndex]; - - var done = false; - for (int i = 1; i < pathSplits.Length; i++) - { - if (pathSplits[i][splitIndex] != split) - { - done = true; - break; - } - } - - if (done) - { - break; - } - - builder.Append(split); - builder.Append(Path.DirectorySeparatorChar); - splitIndex++; - } - - return new DirectoryInfo(builder.ToString().EnsureTrailingSlash()); - } - - public static void RenameCsprojFromMigrationOutputNameToTempName(string outputProject) - { - var backupFileName = $"{outputProject}{TempCsprojExtention}"; - - if (File.Exists(backupFileName)) - { - File.Delete(backupFileName); - } - - File.Move(outputProject, backupFileName); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationError.cs b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationError.cs deleted file mode 100644 index b79bcea32..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationError.cs +++ /dev/null @@ -1,31 +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.ProjectJsonMigration -{ - internal class MigrationError - { - public string ErrorCode { get; } - - public string GeneralErrorReason { get; } - - public string Message { get; } - - public MigrationError(string errorCode, string generalErrorReason, string message) - { - ErrorCode = errorCode; - GeneralErrorReason = generalErrorReason; - Message = message; - } - - public void Throw() - { - throw new MigrationException(this, GetFormattedErrorMessage()); - } - - public string GetFormattedErrorMessage() - { - return $"{ErrorCode}::{GeneralErrorReason}: {Message}"; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationErrorCodes.cs b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationErrorCodes.cs deleted file mode 100644 index 9fd5a3f51..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationErrorCodes.cs +++ /dev/null @@ -1,50 +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.ProjectJsonMigration -{ - internal static partial class MigrationErrorCodes - { - public static Func MIGRATE1011 - => (message) => new MigrationError(nameof(MIGRATE1011), LocalizableStrings.MIGRATE1011, message); - - public static Func MIGRATE1012 - => (message) => new MigrationError(nameof(MIGRATE1012), LocalizableStrings.MIGRATE1012, message); - - public static Func MIGRATE1013 - => (message) => new MigrationError(nameof(MIGRATE1013), LocalizableStrings.MIGRATE1013, message); - - public static Func MIGRATE1014 - => (message) => new MigrationError(nameof(MIGRATE1014), LocalizableStrings.MIGRATE1014, message); - - public static Func MIGRATE1015 - => (message) => new MigrationError(nameof(MIGRATE1015), LocalizableStrings.MIGRATE1015, message); - - public static Func MIGRATE1016 - => (message) => new MigrationError(nameof(MIGRATE1016), LocalizableStrings.MIGRATE1016, message); - - public static Func MIGRATE1017 - => (message) => new MigrationError(nameof(MIGRATE1017), LocalizableStrings.MIGRATE1017, message); - - public static Func MIGRATE1018 - => (message) => new MigrationError(nameof(MIGRATE1018), LocalizableStrings.MIGRATE1018, message); - - public static Func MIGRATE1019 - => (message) => new MigrationError(nameof(MIGRATE1019), LocalizableStrings.MIGRATE1019, message); - - // Potentially Temporary (Point in Time) Errors - public static Func MIGRATE20011 - => (message) => new MigrationError(nameof(MIGRATE20011), LocalizableStrings.MIGRATE20011, message); - - public static Func MIGRATE20012 - => (message) => new MigrationError(nameof(MIGRATE20012), LocalizableStrings.MIGRATE20012, message); - - public static Func MIGRATE20013 - => (message) => new MigrationError(nameof(MIGRATE20013), LocalizableStrings.MIGRATE20013, message); - - public static Func MIGRATE20018 - => (message) => new MigrationError(nameof(MIGRATE20018), LocalizableStrings.MIGRATE20018, message); - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationException.cs b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationException.cs deleted file mode 100644 index 31652bc43..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationException.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.ProjectJsonMigration -{ - internal class MigrationException : Exception - { - public MigrationError Error { get; } - public MigrationException(MigrationError error, string message) : base(message) - { - Error = error; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationNuGetFrameworkExtensions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationNuGetFrameworkExtensions.cs deleted file mode 100644 index 1bdf4364d..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationNuGetFrameworkExtensions.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 NuGet.Frameworks; - -namespace Microsoft.DotNet.ProjectJsonMigration -{ - internal static class MigrationNuGetFrameworkExtensions - { - public static string GetMSBuildCondition(this NuGetFramework framework) - { - return $" '$(TargetFramework)' == '{framework.GetTwoDigitShortFolderName()}' "; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationRuleInputs.cs b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationRuleInputs.cs deleted file mode 100644 index 2041cf758..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationRuleInputs.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 System.Collections.Generic; -using Microsoft.Build.Construction; -using Microsoft.DotNet.Internal.ProjectModel; -using System.Linq; - -namespace Microsoft.DotNet.ProjectJsonMigration -{ - internal class MigrationRuleInputs - { - public ProjectRootElement ProjectXproj { get; } - - public ProjectRootElement OutputMSBuildProject { get; } - - public ProjectItemGroupElement CommonItemGroup { get; } - - public ProjectPropertyGroupElement CommonPropertyGroup { get; } - - public List ProjectContexts { get; } - - public ProjectContext DefaultProjectContext - { - get - { - return ProjectContexts.FirstOrDefault(); - } - } - - public bool IsMultiTFM => ProjectContexts.Count() > 1; - - public MigrationRuleInputs( - IEnumerable projectContexts, - ProjectRootElement outputMSBuildProject, - ProjectItemGroupElement commonItemGroup, - ProjectPropertyGroupElement commonPropertyGroup, - ProjectRootElement projectXproj=null) - { - ProjectXproj = projectXproj; - ProjectContexts = projectContexts.ToList(); - OutputMSBuildProject = outputMSBuildProject; - CommonItemGroup = commonItemGroup; - CommonPropertyGroup = commonPropertyGroup; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationSettings.cs b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationSettings.cs deleted file mode 100644 index ec993cd87..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationSettings.cs +++ /dev/null @@ -1,79 +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.Build.Construction; -using Microsoft.Build.Evaluation; -using Microsoft.DotNet.Cli.Sln.Internal; - -namespace Microsoft.DotNet.ProjectJsonMigration -{ - internal class MigrationSettings - { - public string ProjectXProjFilePath { get; } - public string ProjectDirectory { get; } - public string OutputDirectory { get; } - public ProjectRootElement MSBuildProjectTemplate { get; } - public string MSBuildProjectTemplatePath { get; } - public string SdkDefaultsFilePath { get; } - public SlnFile SolutionFile { get; } - - public MigrationSettings( - string projectDirectory, - string outputDirectory, - string msBuildProjectTemplatePath, - string projectXprojFilePath=null, - string sdkDefaultsFilePath=null, - SlnFile solutionFile=null) : this( - projectDirectory, outputDirectory, projectXprojFilePath, sdkDefaultsFilePath, solutionFile) - { - MSBuildProjectTemplatePath = msBuildProjectTemplatePath; - MSBuildProjectTemplate = ProjectRootElement.Open( - MSBuildProjectTemplatePath, - new ProjectCollection(), - preserveFormatting: true); - } - - private MigrationSettings( - string projectDirectory, - string outputDirectory, - ProjectRootElement msBuildProjectTemplate, - string projectXprojFilePath = null, - string sdkDefaultsFilePath = null) : this( - projectDirectory, outputDirectory, projectXprojFilePath, sdkDefaultsFilePath, null) - { - MSBuildProjectTemplate = msBuildProjectTemplate != null ? msBuildProjectTemplate.DeepClone() : null; - } - - private MigrationSettings( - string projectDirectory, - string outputDirectory, - string projectXprojFilePath, - string sdkDefaultsFilePath, - SlnFile solutionFile) - { - ProjectDirectory = projectDirectory; - OutputDirectory = outputDirectory; - ProjectXProjFilePath = projectXprojFilePath; - SdkDefaultsFilePath = sdkDefaultsFilePath; - SolutionFile = solutionFile; - } - - public static MigrationSettings CreateMigrationSettingsTestHook( - string projectDirectory, - string outputDirectory, - ProjectRootElement msBuildProjectTemplate, - string projectXprojFilePath = null, - string sdkDefaultsFilePath = null) - { - // Product code should not call this private constructor because we don't want to call DeepClone. - // Doing so means we lose formatting. - return new MigrationSettings( - projectDirectory, - outputDirectory, - msBuildProjectTemplate, - projectXprojFilePath, - sdkDefaultsFilePath); - } - - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationTrace.cs b/src/Microsoft.DotNet.ProjectJsonMigration/MigrationTrace.cs deleted file mode 100644 index 46eff9e46..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/MigrationTrace.cs +++ /dev/null @@ -1,49 +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.Text; - -namespace Microsoft.DotNet.ProjectJsonMigration -{ - internal class MigrationTrace : TextWriter - { - public static MigrationTrace Instance { get; set; } - - public string EnableEnvironmentVariable => "DOTNET_MIGRATION_TRACE"; - public bool IsEnabled { get; private set; } - - private TextWriter _underlyingWriter; - - static MigrationTrace () - { - Instance = new MigrationTrace(); - } - - public MigrationTrace() - { - _underlyingWriter = Console.Out; - IsEnabled = IsEnabledValue(); - } - - private bool IsEnabledValue() - { -#if DEBUG - return true; -#else - return Environment.GetEnvironmentVariable(EnableEnvironmentVariable) != null; -#endif - } - - public override Encoding Encoding => _underlyingWriter.Encoding; - - public override void Write(char value) - { - if (IsEnabled) - { - _underlyingWriter.Write(value); - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Models/DefaultProjectItemInfo.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Models/DefaultProjectItemInfo.cs deleted file mode 100644 index 657edd357..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Models/DefaultProjectItemInfo.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.Collections.Generic; - -namespace Microsoft.DotNet.ProjectJsonMigration.Models -{ - internal class DefaultProjectItemInfo - { - public string ItemType {get; set;} - public string Include {get; set;} - public string Exclude {get; set;} - public string Remove {get; set;} - public string Condition {get; set;} - public string ParentCondition {get; set;} - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Models/DefaultProjectPropertyInfo.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Models/DefaultProjectPropertyInfo.cs deleted file mode 100644 index e93482913..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Models/DefaultProjectPropertyInfo.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.Collections.Generic; - -namespace Microsoft.DotNet.ProjectJsonMigration.Models -{ - internal class DefaultProjectPropertyInfo - { - public string Name {get; set;} - public string Value {get; set;} - public string Condition {get; set;} - public string ParentCondition {get; set;} - } -} - - diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Models/ItemMetadataValue.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Models/ItemMetadataValue.cs deleted file mode 100644 index a2aa81a9e..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Models/ItemMetadataValue.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 System; - -namespace Microsoft.DotNet.ProjectJsonMigration.Models -{ - internal class ItemMetadataValue - { - public string MetadataName { get; } - public string Condition { get; } - public bool ExpressedAsAttribute { get; } - - private readonly Func _metadataValueFunc; - private readonly Func _writeMetadataConditionFunc; - - public ItemMetadataValue( - string metadataName, - string metadataValue, - string condition = null, - bool expressedAsAttribute = false) : - this(metadataName, - _ => metadataValue, - condition: condition, - expressedAsAttribute: expressedAsAttribute) - { - } - - public ItemMetadataValue( - string metadataName, - Func metadataValueFunc, - Func writeMetadataConditionFunc = null, - string condition = null, - bool expressedAsAttribute = false) - { - if (metadataName == null) - { - throw new ArgumentNullException(nameof(metadataName)); - } - - if (metadataValueFunc == null) - { - throw new ArgumentNullException(nameof(metadataValueFunc)); - } - - MetadataName = metadataName; - _metadataValueFunc = metadataValueFunc; - _writeMetadataConditionFunc = writeMetadataConditionFunc; - Condition = condition; - ExpressedAsAttribute = expressedAsAttribute; - } - - public bool ShouldWriteMetadata(T source) - { - return _writeMetadataConditionFunc == null || _writeMetadataConditionFunc(source); - } - - public string GetMetadataValue(T source) - { - return _metadataValueFunc(source); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Models/SerializableMigrationDefaultsInfo.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Models/SerializableMigrationDefaultsInfo.cs deleted file mode 100644 index 2b0770d25..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Models/SerializableMigrationDefaultsInfo.cs +++ /dev/null @@ -1,13 +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.ProjectJsonMigration.Models -{ - 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 deleted file mode 100644 index 10c2630e0..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectContextExtensions.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 System.Collections.Generic; -using Microsoft.Build.Construction; -using System.Linq; -using Microsoft.DotNet.Internal.ProjectModel; -using System.IO; - -namespace Microsoft.DotNet.ProjectJsonMigration -{ - internal static class ProjectContextExtensions - { - public static string GetProjectName(this ProjectContext projectContext) - { - var projectDirectory = projectContext.ProjectDirectory; - - return Path.GetFileName(projectDirectory); - } - - public static bool HasRuntimes(this IEnumerable projectContexts) - { - return projectContexts.Any(p => p.ProjectFile.Runtimes.Any()); - } - - public static bool HasBothCoreAndFullFrameworkTFMs(this IEnumerable projectContexts) - { - return projectContexts.HasCoreTFM() && projectContexts.HasFullFrameworkTFM(); - } - - public static bool HasCoreTFM(this IEnumerable projectContexts) - { - return projectContexts.Any(p => !p.IsFullFramework()); - } - - public static bool HasFullFrameworkTFM(this IEnumerable projectContexts) - { - return projectContexts.Any(p => p.IsFullFramework()); - } - - public static bool HasExeOutput(this IEnumerable projectContexts) - { - return projectContexts.Any(p => p.IsExe()); - } - - public static bool HasLibraryOutput(this IEnumerable projectContexts) - { - return projectContexts.Any(p => p.IsLibrary()); - } - - public static bool IsFullFramework(this ProjectContext projectContext) - { - return !projectContext.TargetFramework.IsPackageBased; - } - - public static bool IsExe(this ProjectContext projectContext) - { - var compilerOptions = projectContext.ProjectFile.GetCompilerOptions(null, null); - return (compilerOptions.EmitEntryPoint != null && compilerOptions.EmitEntryPoint.Value); - } - - public static bool IsLibrary(this ProjectContext projectContext) - { - var compilerOptions = projectContext.ProjectFile.GetCompilerOptions(null, null); - return (compilerOptions.EmitEntryPoint == null || !compilerOptions.EmitEntryPoint.Value); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependency.cs b/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependency.cs deleted file mode 100644 index d830182b8..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependency.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. - -namespace Microsoft.DotNet.ProjectJsonMigration -{ - internal class ProjectDependency - { - public string Name { get; } - public string ProjectFilePath { get; } - - public ProjectDependency(string name, string projectFilePath) - { - Name = name; - ProjectFilePath = System.IO.Path.GetFullPath(projectFilePath); - } - - public override bool Equals(object obj) - { - var other = obj as ProjectDependency; - - return other != null && other.ProjectFilePath == ProjectFilePath; - } - - public override int GetHashCode() - { - return ProjectFilePath.GetHashCode(); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependencyComparer.cs b/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependencyComparer.cs deleted file mode 100644 index dcf3d8f7b..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependencyComparer.cs +++ /dev/null @@ -1,23 +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.ProjectJsonMigration -{ - internal class ProjectDependencyComparer : IEqualityComparer - { - public bool Equals(ProjectDependency one, ProjectDependency two) - { - return StringComparer.OrdinalIgnoreCase - .Equals(one.ProjectFilePath, two.ProjectFilePath); - } - - public int GetHashCode(ProjectDependency item) - { - return StringComparer.OrdinalIgnoreCase - .GetHashCode(item.ProjectFilePath); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependencyFinder.cs b/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependencyFinder.cs deleted file mode 100644 index 976cc8502..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectDependencyFinder.cs +++ /dev/null @@ -1,455 +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.Build.Construction; -using Microsoft.DotNet.Internal.ProjectModel; -using Microsoft.DotNet.Internal.ProjectModel.Graph; -using System.Linq; -using System.IO; -using Newtonsoft.Json.Linq; -using Microsoft.DotNet.Cli.Sln.Internal; -using Microsoft.DotNet.Tools.Common; -using NuGet.Frameworks; -using NuGet.LibraryModel; - -namespace Microsoft.DotNet.ProjectJsonMigration -{ - internal class ProjectDependencyFinder - { - public IEnumerable ResolveProjectDependencies( - IEnumerable projectContexts, - IEnumerable preResolvedProjects = null, - SlnFile solutionFile=null) - { - foreach (var projectContext in projectContexts) - { - foreach (var projectDependency in - ResolveProjectDependencies(projectContext, preResolvedProjects, solutionFile)) - { - yield return projectDependency; - } - } - } - - public IEnumerable ResolveProjectDependencies(string projectDir, - string xprojFile = null, SlnFile solutionFile = null) - { - var projectContexts = ProjectContext.CreateContextForEachFramework(projectDir); - xprojFile = xprojFile ?? FindXprojFile(projectDir); - - ProjectRootElement xproj = null; - if (xprojFile != null) - { - xproj = ProjectRootElement.Open(xprojFile); - } - - return ResolveProjectDependencies( - projectContexts, - ResolveXProjProjectDependencyNames(xproj), - solutionFile); - } - - public IEnumerable ResolveAllProjectDependenciesForFramework( - ProjectDependency projectToResolve, - NuGetFramework framework, - IEnumerable preResolvedProjects=null, - SlnFile solutionFile=null) - { - var projects = new List { projectToResolve }; - var allDependencies = new HashSet(); - while (projects.Count > 0) - { - var project = projects.First(); - projects.Remove(project); - if (!File.Exists(project.ProjectFilePath)) - { - MigrationErrorCodes - .MIGRATE1018(String.Format(LocalizableStrings.MIGRATE1018Arg, project.ProjectFilePath)).Throw(); - } - - var projectContext = - ProjectContext.CreateContextForEachFramework(project.ProjectFilePath).FirstOrDefault(); - if(projectContext == null) - { - continue; - } - - var dependencies = ResolveDirectProjectDependenciesForFramework( - projectContext.ProjectFile, - framework, - preResolvedProjects, - solutionFile - ); - allDependencies.UnionWith(dependencies); - } - - return allDependencies; - } - - public IEnumerable ResolveDirectProjectDependenciesForFramework( - Project project, - NuGetFramework framework, - IEnumerable preResolvedProjects=null, - SlnFile solutionFile = null) - { - preResolvedProjects = preResolvedProjects ?? new HashSet(); - - var possibleProjectDependencies = FindPossibleProjectDependencies(solutionFile, project.ProjectFilePath); - - var projectDependencies = new List(); - - IEnumerable projectFileDependenciesForFramework; - if (framework == null) - { - projectFileDependenciesForFramework = project.Dependencies; - } - else - { - projectFileDependenciesForFramework = project.GetTargetFramework(framework).Dependencies; - } - - foreach (var projectFileDependency in - projectFileDependenciesForFramework.Where(p => - p.LibraryRange.TypeConstraint == LibraryDependencyTarget.Project || - p.LibraryRange.TypeConstraint == LibraryDependencyTarget.All)) - { - var dependencyName = projectFileDependency.Name; - - ProjectDependency projectDependency; - - if (preResolvedProjects.Contains(dependencyName)) - { - continue; - } - - if (!possibleProjectDependencies.TryGetValue(dependencyName, out projectDependency)) - { - if (projectFileDependency.LibraryRange.TypeConstraint == LibraryDependencyTarget.Project) - { - MigrationErrorCodes - .MIGRATE1014(String.Format(LocalizableStrings.MIGRATE1014Arg, dependencyName)).Throw(); - } - else - { - continue; - } - } - - projectDependencies.Add(projectDependency); - } - - return projectDependencies; - } - - internal IEnumerable ResolveXProjProjectDependencies(ProjectRootElement xproj) - { - if (xproj == null) - { - MigrationTrace.Instance.WriteLine(String.Format(LocalizableStrings.NoXprojFileGivenError, nameof(ProjectDependencyFinder))); - return Enumerable.Empty(); - } - - return xproj.Items - .Where(i => i.ItemType == "ProjectReference") - .Where(p => p.Includes().Any( - include => string.Equals(Path.GetExtension(include), ".csproj", StringComparison.OrdinalIgnoreCase))); - } - - internal string FindXprojFile(string projectDirectory) - { - var allXprojFiles = Directory.EnumerateFiles(projectDirectory, "*.xproj", SearchOption.TopDirectoryOnly); - - if (allXprojFiles.Count() > 1) - { - MigrationErrorCodes - .MIGRATE1017(String.Format(LocalizableStrings.MultipleXprojFilesError, projectDirectory)) - .Throw(); - } - - return allXprojFiles.FirstOrDefault(); - } - - private IEnumerable ResolveProjectDependencies( - ProjectContext projectContext, - IEnumerable preResolvedProjects=null, - SlnFile slnFile=null) - { - preResolvedProjects = preResolvedProjects ?? new HashSet(); - - var projectExports = projectContext.CreateExporter("_").GetDependencies(); - var possibleProjectDependencies = - FindPossibleProjectDependencies(slnFile, projectContext.ProjectFile.ProjectFilePath); - - var projectDependencies = new List(); - foreach (var projectExport in - projectExports.Where(p => p.Library.Identity.Type == LibraryType.Project)) - { - var projectExportName = projectExport.Library.Identity.Name; - ProjectDependency projectDependency; - - if (preResolvedProjects.Contains(projectExportName)) - { - continue; - } - - if (!possibleProjectDependencies.TryGetValue(projectExportName, out projectDependency)) - { - if (projectExport.Library.Identity.Type.Equals(LibraryType.Project)) - { - MigrationErrorCodes - .MIGRATE1014(String.Format(LocalizableStrings.MIGRATE1014Arg, projectExportName)).Throw(); - } - else - { - continue; - } - } - - projectDependencies.Add(projectDependency); - } - - return projectDependencies; - } - - private IEnumerable ResolveXProjProjectDependencyNames(ProjectRootElement xproj) - { - var xprojDependencies = ResolveXProjProjectDependencies(xproj).SelectMany(r => r.Includes()); - return new HashSet(xprojDependencies.Select(p => Path.GetFileNameWithoutExtension( - PathUtility.GetPathWithDirectorySeparator(p)))); - } - - private Dictionary FindPossibleProjectDependencies( - SlnFile slnFile, - string projectJsonFilePath) - { - var projectRootDirectory = GetRootFromProjectJson(projectJsonFilePath); - - var projectSearchPaths = new List(); - projectSearchPaths.Add(projectRootDirectory); - - var globalPaths = GetGlobalPaths(projectRootDirectory); - projectSearchPaths = globalPaths.Union(projectSearchPaths).ToList(); - - var solutionPaths = GetSolutionPaths(slnFile); - projectSearchPaths = solutionPaths.Union(projectSearchPaths).ToList(); - - var projects = new Dictionary(StringComparer.Ordinal); - - foreach (var project in GetPotentialProjects(projectSearchPaths)) - { - if (projects.ContainsKey(project.Name)) - { - // Remove the existing project if it doesn't have project.json - // project.json isn't checked until the project is resolved, but here - // we need to check it up front. - var otherProject = projects[project.Name]; - - if (project.ProjectFilePath != otherProject.ProjectFilePath) - { - var projectExists = File.Exists(project.ProjectFilePath); - var otherExists = File.Exists(otherProject.ProjectFilePath); - - if (projectExists != otherExists - && projectExists - && !otherExists) - { - // the project currently in the cache does not exist, but this one does - // remove the old project and add the current one - projects[project.Name] = project; - } - } - } - else - { - projects.Add(project.Name, project); - } - } - - return projects; - } - - /// - /// Finds the parent directory of the project.json. - /// - /// Full path to project.json. - private static string GetRootFromProjectJson(string projectJsonPath) - { - if (!string.IsNullOrEmpty(projectJsonPath)) - { - var file = new FileInfo(projectJsonPath); - - // If for some reason we are at the root of the drive this will be null - // Use the file directory instead. - if (file.Directory.Parent == null) - { - return file.Directory.FullName; - } - else - { - return file.Directory.Parent.FullName; - } - } - - return projectJsonPath; - } - - /// - /// Create the list of potential projects from the search paths. - /// - private static List GetPotentialProjects( - IEnumerable searchPaths) - { - var projects = new List(); - - // Resolve all of the potential projects - foreach (var searchPath in searchPaths) - { - var directory = new DirectoryInfo(searchPath); - - if (!directory.Exists) - { - continue; - } - - foreach (var projectDirectory in - Enumerable.Repeat(directory, 1).Union(directory.GetDirectories("*", SearchOption.AllDirectories))) - { - AddIfProjectExists(projects, projectDirectory); - } - } - - return projects; - } - - private static void AddIfProjectExists(List projects, DirectoryInfo projectDirectory) - { - var projectJSONFilePath = Path.Combine(projectDirectory.FullName, "project.json"); - var csProjFilePath = Path.Combine(projectDirectory.FullName, $"{projectDirectory.Name}.csproj"); - - if (File.Exists(projectJSONFilePath)) - { - var project = new ProjectDependency(projectDirectory.Name, projectJSONFilePath); - projects.Add(project); - } - else if (File.Exists(csProjFilePath)) - { - var project = new ProjectDependency(projectDirectory.Name, csProjFilePath); - projects.Add(project); - } - } - - internal static List GetGlobalPaths(string rootPath) - { - var paths = new List(); - - var globalJsonRoot = ResolveRootDirectory(rootPath); - - GlobalSettings globalSettings; - if (GlobalSettings.TryGetGlobalSettings(globalJsonRoot, out globalSettings)) - { - foreach (var sourcePath in globalSettings.ProjectPaths) - { - var path = Path.GetFullPath(Path.Combine(globalJsonRoot, sourcePath)); - - paths.Add(path); - } - } - - return paths; - } - - internal static List GetSolutionPaths(SlnFile solutionFile) - { - return (solutionFile == null) - ? new List() - : new List(solutionFile.Projects.Select(p => - Path.Combine(solutionFile.BaseDirectory, Path.GetDirectoryName(p.FilePath)))); - } - - private static string ResolveRootDirectory(string projectPath) - { - var di = new DirectoryInfo(projectPath); - - while (di.Parent != null) - { - var globalJsonPath = Path.Combine(di.FullName, GlobalSettings.GlobalFileName); - - if (File.Exists(globalJsonPath)) - { - return di.FullName; - } - - di = di.Parent; - } - - // If we don't find any files then make the project folder the root - return projectPath; - } - - private class GlobalSettings - { - public const string GlobalFileName = "global.json"; - public IList ProjectPaths { get; private set; } - public string PackagesPath { get; private set; } - public string FilePath { get; private set; } - - public string RootPath - { - get { return Path.GetDirectoryName(FilePath); } - } - - public static bool TryGetGlobalSettings(string path, out GlobalSettings globalSettings) - { - globalSettings = null; - - string globalJsonPath = null; - - if (Path.GetFileName(path) == GlobalFileName) - { - globalJsonPath = path; - path = Path.GetDirectoryName(path); - } - else if (!HasGlobalFile(path)) - { - return false; - } - else - { - globalJsonPath = Path.Combine(path, GlobalFileName); - } - - globalSettings = new GlobalSettings(); - - try - { - var json = File.ReadAllText(globalJsonPath); - - JObject settings = JObject.Parse(json); - - var projects = settings["projects"]; - var dependencies = settings["dependencies"] as JObject; - - globalSettings.ProjectPaths = projects == null ? new string[] { } : - projects.Select(a => a.Value()).ToArray(); - globalSettings.PackagesPath = settings.Value("packages"); - globalSettings.FilePath = globalJsonPath; - } - catch (Exception ex) - { - throw FileFormatException.Create(ex, globalJsonPath); - } - - return true; - } - - public static bool HasGlobalFile(string path) - { - var projectPath = Path.Combine(path, GlobalFileName); - - return File.Exists(projectPath); - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectExtensions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/ProjectExtensions.cs deleted file mode 100644 index f7db81b49..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectExtensions.cs +++ /dev/null @@ -1,71 +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 info - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using Microsoft.DotNet.Internal.ProjectModel; - -namespace Microsoft.DotNet.ProjectJsonMigration -{ - internal static class ProjectExtensions - { - public static ProjectType GetProjectType(this Project project) - { - ProjectType projectType = ProjectType.Library; - if (project.IsTestProject) - { - projectType = ProjectType.Test; - } - else if (project.HasEntryPoint()) - { - if (project.HasDependency(ContainingName(".AspNetCore."))) - { - projectType = ProjectType.Web; - } - else - { - projectType = ProjectType.Console; - } - } - - return projectType; - } - - private static bool HasEntryPoint(this Project project) - { - return project.GetCompilerOptions(null, "Debug").EmitEntryPoint.GetValueOrDefault(); - } - - private static Func ContainingName(string nameSegment) - { - return x => x.Name.IndexOf(nameSegment, StringComparison.OrdinalIgnoreCase) > -1; - } - - public static bool HasDependency(this Project project, Func pred) - { - if (HasAnyDependency(project.Dependencies, pred)) - { - return true; - } - - foreach (var tf in project.GetTargetFrameworks()) - { - if(HasAnyDependency(tf.Dependencies, pred)) - { - return true; - } - } - - return false; - } - - private static bool HasAnyDependency( - IEnumerable dependencies, - Func pred) - { - return dependencies.Any(pred); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectMigrator.cs b/src/Microsoft.DotNet.ProjectJsonMigration/ProjectMigrator.cs deleted file mode 100644 index 9aa45ea11..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectMigrator.cs +++ /dev/null @@ -1,337 +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.Build.Construction; -using Microsoft.DotNet.Internal.ProjectModel; -using Microsoft.DotNet.Internal.ProjectModel.Graph; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Cli.Sln.Internal; -using Microsoft.DotNet.ProjectJsonMigration.Rules; -using Microsoft.DotNet.Tools.Common; - -namespace Microsoft.DotNet.ProjectJsonMigration -{ - internal class ProjectMigrator - { - private readonly IMigrationRule _ruleSet; - private readonly ProjectDependencyFinder _projectDependencyFinder = new ProjectDependencyFinder(); - private HashSet _migratedProjects = new HashSet(); - - public ProjectMigrator() : this(new DefaultMigrationRuleSet()) { } - - public ProjectMigrator(IMigrationRule ruleSet) - { - _ruleSet = ruleSet; - } - - public MigrationReport Migrate(MigrationSettings rootSettings, bool skipProjectReferences = false) - { - if (rootSettings == null) - { - throw new ArgumentNullException(); - } - - // Try to read the project dependencies, ignore an unresolved exception for now - MigrationRuleInputs rootInputs = ComputeMigrationRuleInputs(rootSettings); - IEnumerable projectDependencies = null; - var projectMigrationReports = new List(); - - List warnings = null; - try - { - // Verify up front so we can prefer these errors over an unresolved project dependency - VerifyInputs(rootInputs, rootSettings, out warnings); - - projectMigrationReports.Add(MigrateProject(rootSettings)); - - if (skipProjectReferences) - { - return new MigrationReport(projectMigrationReports); - } - - projectDependencies = ResolveTransitiveClosureProjectDependencies( - rootSettings.ProjectDirectory, - rootSettings.ProjectXProjFilePath, - rootSettings.SolutionFile); - } - catch (MigrationException e) - { - return new MigrationReport( - new List - { - new ProjectMigrationReport( - rootSettings.ProjectDirectory, - rootInputs?.DefaultProjectContext?.GetProjectName(), - new List {e.Error}, - warnings) - }); - } - - foreach(var project in projectDependencies) - { - var projectDir = Path.GetDirectoryName(project.ProjectFilePath); - var settings = new MigrationSettings(projectDir, - projectDir, - rootSettings.MSBuildProjectTemplatePath); - projectMigrationReports.Add(MigrateProject(settings)); - } - - return new MigrationReport(projectMigrationReports); - } - - private void DeleteProjectJsons(MigrationSettings rootsettings, IEnumerable projectDependencies) - { - try - { - File.Delete(Path.Combine(rootsettings.ProjectDirectory, "project.json")); - } - catch (Exception e) - { - e.ReportAsWarning(); - } - - foreach (var projectDependency in projectDependencies) - { - try - { - File.Delete(projectDependency.ProjectFilePath); - } - catch (Exception e) - { - e.ReportAsWarning(); - } - } - } - - private IEnumerable ResolveTransitiveClosureProjectDependencies( - string rootProject, string xprojFile, SlnFile solutionFile) - { - HashSet projectsMap = new HashSet(new ProjectDependencyComparer()); - var projectDependencies = _projectDependencyFinder.ResolveProjectDependencies(rootProject, xprojFile, solutionFile); - Queue projectsQueue = new Queue(projectDependencies); - - while (projectsQueue.Count() != 0) - { - var projectDependency = projectsQueue.Dequeue(); - - if (projectsMap.Contains(projectDependency)) - { - continue; - } - - projectsMap.Add(projectDependency); - - var projectDir = Path.GetDirectoryName(projectDependency.ProjectFilePath); - projectDependencies = _projectDependencyFinder.ResolveProjectDependencies(projectDir); - - foreach (var project in projectDependencies) - { - projectsQueue.Enqueue(project); - } - } - - return projectsMap; - } - - private ProjectMigrationReport MigrateProject(MigrationSettings migrationSettings) - { - var migrationRuleInputs = ComputeMigrationRuleInputs(migrationSettings); - var projectName = migrationRuleInputs.DefaultProjectContext.GetProjectName(); - var outputProject = Path.Combine(migrationSettings.OutputDirectory, projectName + ".csproj"); - - List warnings = null; - try - { - if (File.Exists(outputProject)) - { - if (_migratedProjects.Contains(outputProject)) - { - MigrationTrace.Instance.WriteLine(String.Format( - LocalizableStrings.SkipMigrationAlreadyMigrated, - nameof(ProjectMigrator), - migrationSettings.ProjectDirectory)); - - return new ProjectMigrationReport( - migrationSettings.ProjectDirectory, - projectName, - skipped: true); - } - else - { - MigrationBackupPlan.RenameCsprojFromMigrationOutputNameToTempName(outputProject); - } - } - - VerifyInputs(migrationRuleInputs, migrationSettings, out warnings); - - SetupOutputDirectory(migrationSettings.ProjectDirectory, migrationSettings.OutputDirectory); - - _ruleSet.Apply(migrationSettings, migrationRuleInputs); - } - catch (MigrationException exc) - { - var error = new List - { - exc.Error - }; - - return new ProjectMigrationReport(migrationSettings.ProjectDirectory, projectName, error, warnings); - } - - List csprojDependencies = null; - if (migrationRuleInputs.ProjectXproj != null) - { - var projectDependencyFinder = new ProjectDependencyFinder(); - var dependencies = projectDependencyFinder.ResolveXProjProjectDependencies( - migrationRuleInputs.ProjectXproj); - - if (dependencies.Any()) - { - csprojDependencies = dependencies - .SelectMany(r => r.Includes().Select(p => PathUtility.GetPathWithDirectorySeparator(p))) - .ToList(); - } - else - { - csprojDependencies = new List(); - } - } - - _migratedProjects.Add(outputProject); - - return new ProjectMigrationReport( - migrationSettings.ProjectDirectory, - projectName, - outputProject, - null, - warnings, - csprojDependencies); - } - - private MigrationRuleInputs ComputeMigrationRuleInputs(MigrationSettings migrationSettings) - { - var projectContexts = ProjectContext.CreateContextForEachFramework(migrationSettings.ProjectDirectory); - var xprojFile = migrationSettings.ProjectXProjFilePath ?? _projectDependencyFinder.FindXprojFile(migrationSettings.ProjectDirectory); - - ProjectRootElement xproj = null; - if (xprojFile != null) - { - xproj = ProjectRootElement.Open(xprojFile); - } - - var templateMSBuildProject = migrationSettings.MSBuildProjectTemplate; - if (templateMSBuildProject == null) - { - throw new Exception(LocalizableStrings.NullMSBuildProjectTemplateError); - } - - var propertyGroup = templateMSBuildProject.AddPropertyGroup(); - var itemGroup = templateMSBuildProject.AddItemGroup(); - - return new MigrationRuleInputs(projectContexts, templateMSBuildProject, itemGroup, propertyGroup, xproj); - } - - private void VerifyInputs( - MigrationRuleInputs migrationRuleInputs, - MigrationSettings migrationSettings, - out List warningMessages - ) - { - VerifyProject(migrationRuleInputs.ProjectContexts, migrationSettings.ProjectDirectory, out warningMessages); - } - - private void VerifyProject( - IEnumerable projectContexts, - string projectDirectory, - out List warningMessages) - { - warningMessages = null; - - if (!projectContexts.Any()) - { - MigrationErrorCodes.MIGRATE1013(String.Format(LocalizableStrings.MIGRATE1013Arg, projectDirectory)).Throw(); - } - - var defaultProjectContext = projectContexts.First(); - - var diagnostics = defaultProjectContext.ProjectFile.Diagnostics; - if (diagnostics.Any()) - { - var warnings = diagnostics.Where(d => d.Severity == DiagnosticMessageSeverity.Warning); - if (warnings.Any()) - { - var migrationError = MigrationErrorCodes.MIGRATE1011(String.Format( - "{0}{1}{2}", - projectDirectory, - Environment.NewLine, - string.Join(Environment.NewLine, diagnostics.Select(d => FormatDiagnosticMessage(d))))); - - warningMessages = new List(); - warningMessages.Add(migrationError.GetFormattedErrorMessage()); - } - - var errors = diagnostics.Where(d => d.Severity == DiagnosticMessageSeverity.Error); - if (errors.Any()) - { - MigrationErrorCodes.MIGRATE1011(String.Format( - "{0}{1}{2}", - projectDirectory, - Environment.NewLine, - string.Join(Environment.NewLine, diagnostics.Select(d => FormatDiagnosticMessage(d))))) - .Throw(); - } - } - - var compilerName = - defaultProjectContext.ProjectFile.GetCompilerOptions(defaultProjectContext.TargetFramework, "_") - .CompilerName; - if (!compilerName.Equals("csc", StringComparison.OrdinalIgnoreCase)) - { - MigrationErrorCodes.MIGRATE20013( - String.Format(LocalizableStrings.CannotMigrateProjectWithCompilerError, defaultProjectContext.ProjectFile.ProjectFilePath, compilerName)).Throw(); - } - } - - private string FormatDiagnosticMessage(DiagnosticMessage d) - { - return String.Format(LocalizableStrings.DiagnosticMessageTemplate, d.Message, d.StartLine, d.SourceFilePath); - } - - private void SetupOutputDirectory(string projectDirectory, string outputDirectory) - { - if (!Directory.Exists(outputDirectory)) - { - Directory.CreateDirectory(outputDirectory); - } - - if (projectDirectory != outputDirectory) - { - CopyProjectToOutputDirectory(projectDirectory, outputDirectory); - } - } - - private void CopyProjectToOutputDirectory(string projectDirectory, string outputDirectory) - { - var sourceFilePaths = Directory.EnumerateFiles(projectDirectory, "*", SearchOption.AllDirectories); - - foreach (var sourceFilePath in sourceFilePaths) - { - var relativeFilePath = PathUtility.GetRelativePath(projectDirectory, sourceFilePath); - var destinationFilePath = Path.Combine(outputDirectory, relativeFilePath); - var destinationDirectory = Path.GetDirectoryName(destinationFilePath); - - if (!Directory.Exists(destinationDirectory)) - { - Directory.CreateDirectory(destinationDirectory); - } - - File.Copy(sourceFilePath, destinationFilePath); - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectType.cs b/src/Microsoft.DotNet.ProjectJsonMigration/ProjectType.cs deleted file mode 100644 index e42cee05b..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/ProjectType.cs +++ /dev/null @@ -1,13 +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.ProjectJsonMigration -{ - internal enum ProjectType - { - Console, - Library, - Test, - Web - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Properties/AssemblyInfo.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Properties/AssemblyInfo.cs deleted file mode 100644 index af0d3c6ef..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,7 +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.Runtime.CompilerServices; - -[assembly:InternalsVisibleTo("Microsoft.DotNet.ProjectJsonMigration.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100039ac461fa5c82c7dd2557400c4fd4e9dcdf7ac47e3d572548c04cd4673e004916610f4ea5cbf86f2b1ca1cb824f2a7b3976afecfcf4eb72d9a899aa6786effa10c30399e6580ed848231fec48374e41b3acf8811931343fc2f73acf72dae745adbcb7063cc4b50550618383202875223fc75401351cd89c44bf9b50e7fa3796")] -[assembly: InternalsVisibleTo("dotnet, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Report/MigrationReport.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Report/MigrationReport.cs deleted file mode 100644 index 8da54829e..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Report/MigrationReport.cs +++ /dev/null @@ -1,65 +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; - -namespace Microsoft.DotNet.ProjectJsonMigration -{ - /// Any changes to this need to be reflected in roslyn-project-system - /// TODO add link - internal class MigrationReport - { - public List ProjectMigrationReports { get; } - - public int MigratedProjectsCount => ProjectMigrationReports.Count; - - public int SucceededProjectsCount => ProjectMigrationReports.Count(p => p.Succeeded); - - public int FailedProjectsCount => ProjectMigrationReports.Count(p => p.Failed); - - public bool AllSucceeded => ! ProjectMigrationReports.Any(p => p.Failed); - - public MigrationReport Merge(MigrationReport otherReport) - { - var allReports = ProjectMigrationReports.Concat(otherReport.ProjectMigrationReports).ToList(); - var dedupedReports = DedupeSkippedReports(allReports); - - return new MigrationReport(dedupedReports); - } - - private List DedupeSkippedReports(List allReports) - { - var reportDict = new Dictionary(); - - foreach (var report in allReports) - { - ProjectMigrationReport existingReport; - - if (reportDict.TryGetValue(report.ProjectDirectory, out existingReport)) - { - if (existingReport.Skipped) - { - reportDict[report.ProjectDirectory] = report; - } - else if (!report.Skipped) - { - MigrationTrace.Instance.WriteLine(String.Format(LocalizableStrings.DoubleMigrationError, report.ProjectDirectory)); - } - } - else - { - reportDict[report.ProjectDirectory] = report; - } - } - - return reportDict.Values.ToList(); - } - - public MigrationReport(List projectMigrationReports) - { - ProjectMigrationReports = projectMigrationReports; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Report/ProjectMigrationReport.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Report/ProjectMigrationReport.cs deleted file mode 100644 index 17f81e06a..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Report/ProjectMigrationReport.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 System.Collections.Generic; -using System.Linq; -namespace Microsoft.DotNet.ProjectJsonMigration -{ - internal class ProjectMigrationReport - { - public string ProjectDirectory { get; } - - public string ProjectName { get; } - - public string OutputMSBuildProject { get; } - - public List Errors { get; } - - public List Warnings { get; } - - public List PreExistingCsprojDependencies { get; } - - public bool Skipped { get; } - - public bool Failed => Errors.Any(); - - public bool Succeeded => !Errors.Any(); - - public ProjectMigrationReport(string projectDirectory, string projectName, bool skipped) - : this(projectDirectory, projectName, null, null, null, null, skipped: skipped) { } - - public ProjectMigrationReport( - string projectDirectory, - string projectName, - List errors, - List warnings) - : this(projectDirectory, projectName, null, errors, warnings, null) { } - - public ProjectMigrationReport( - string projectDirectory, - string projectName, - string outputMSBuildProject, - List warnings) - : this(projectDirectory, projectName, outputMSBuildProject, null, warnings, null) { } - - public ProjectMigrationReport( - string projectDirectory, - string projectName, - string outputMSBuildProject, - List errors, - List warnings, - List preExistingCsprojDependencies, - bool skipped = false) - { - ProjectDirectory = projectDirectory; - ProjectName = projectName; - OutputMSBuildProject = outputMSBuildProject; - Errors = errors ?? new List(); - Warnings = warnings ?? new List(); - PreExistingCsprojDependencies = preExistingCsprojDependencies ?? new List(); - Skipped =skipped; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/AddDefaultsToProjectRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/AddDefaultsToProjectRule.cs deleted file mode 100644 index d4f529b7b..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/AddDefaultsToProjectRule.cs +++ /dev/null @@ -1,128 +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.Linq; -using Microsoft.DotNet.ProjectJsonMigration.Transforms; -using Microsoft.Build.Construction; -using System.Collections.Generic; -using Microsoft.DotNet.ProjectJsonMigration.Models; -using System; -using System.IO; -using System.Reflection; -using Newtonsoft.Json; - -namespace Microsoft.DotNet.ProjectJsonMigration.Rules -{ - internal class AddDefaultsToProjectRule : IMigrationRule - { - internal const string c_DefaultsProjectElementContainerLabel = "MigrationDefaultsTempContainer"; - internal const string c_SdkDefaultsJsonFileName = "sdkdefaults.json"; - - private readonly ITransformApplicator _transformApplicator; - - public AddDefaultsToProjectRule(ITransformApplicator transformApplicator = null) - { - _transformApplicator = transformApplicator ?? new TransformApplicator(); - } - - public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs) - { - SerializableMigrationDefaultsInfo defaults = ResolveDefaults(migrationSettings); - - var project = migrationRuleInputs.OutputMSBuildProject; - var defaultsPropertyGroups = new Dictionary(); - var defaultsItemGroups = new Dictionary(); - - AddDefaultPropertiesToProject(defaults, project, defaultsPropertyGroups); - AddDefaultItemsToProject(defaults, project, defaultsItemGroups); - } - - private void AddDefaultItemsToProject( - SerializableMigrationDefaultsInfo defaults, - ProjectRootElement project, - Dictionary defaultsItemGroups) - { - foreach (var itemInfo in defaults.Items) - { - ProjectItemGroupElement itemGroup; - var parentCondition = itemInfo.ParentCondition ?? string.Empty; - - if (!defaultsItemGroups.TryGetValue(parentCondition, out itemGroup)) - { - itemGroup = project.AddItemGroup(); - itemGroup.Label = c_DefaultsProjectElementContainerLabel; - itemGroup.Condition = parentCondition; - - defaultsItemGroups[parentCondition] = itemGroup; - } - - var item = itemGroup.AddItem(itemInfo.ItemType, itemInfo.Include); - item.Exclude = itemInfo.Exclude; - item.Remove = itemInfo.Remove; - item.Condition = itemInfo.Condition; - } - } - - private static void AddDefaultPropertiesToProject( - SerializableMigrationDefaultsInfo defaults, - ProjectRootElement project, - Dictionary defaultsPropertyGroups) - { - foreach (var propertyInfo in defaults.Properties) - { - ProjectPropertyGroupElement propertyGroup; - var parentCondition = propertyInfo.ParentCondition ?? string.Empty; - - if (!defaultsPropertyGroups.TryGetValue(parentCondition, out propertyGroup)) - { - propertyGroup = project.AddPropertyGroup(); - propertyGroup.Label = c_DefaultsProjectElementContainerLabel; - propertyGroup.Condition = parentCondition; - - defaultsPropertyGroups[parentCondition] = propertyGroup; - } - - var property = propertyGroup.AddProperty(propertyInfo.Name, propertyInfo.Value); - property.Condition = propertyInfo.Condition; - } - } - - private SerializableMigrationDefaultsInfo ResolveDefaults(MigrationSettings migrationSettings) - { - var sdkDefaultFile = TryResolveSdkDefaultsFileFromSettings(migrationSettings); - if (sdkDefaultFile != null) - { - return DeserializeDefaults(File.ReadAllText(sdkDefaultFile)); - } - - var thisAssembly = typeof(AddDefaultsToProjectRule).GetTypeInfo().Assembly; - using (var resource = thisAssembly.GetManifestResourceStream("Microsoft.DotNet.ProjectJsonMigration." + c_SdkDefaultsJsonFileName)) - { - using (StreamReader reader = new StreamReader(resource)) - { - return DeserializeDefaults(reader.ReadToEnd()); - } - } - } - - private string TryResolveSdkDefaultsFileFromSettings(MigrationSettings migrationSettings) - { - var candidate = migrationSettings.SdkDefaultsFilePath; - if (candidate == null) - { - return null; - } - - if (File.Exists(candidate)) - { - return candidate; - } - return null; - } - - private SerializableMigrationDefaultsInfo DeserializeDefaults(string sdkDefaultJson) - { - return JsonConvert.DeserializeObject(sdkDefaultJson); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/CleanOutputProjectRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/CleanOutputProjectRule.cs deleted file mode 100644 index e419c615b..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/CleanOutputProjectRule.cs +++ /dev/null @@ -1,82 +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.Linq; -using Microsoft.DotNet.ProjectJsonMigration.Transforms; -using Microsoft.Build.Construction; -using System.Collections.Generic; -using Microsoft.DotNet.ProjectJsonMigration.Models; -using System; -using System.IO; -using System.Reflection; -using Newtonsoft.Json; - -namespace Microsoft.DotNet.ProjectJsonMigration.Rules -{ - internal class CleanOutputProjectRule : IMigrationRule - { - public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs) - { - var outputProject = migrationRuleInputs.OutputMSBuildProject; - - CleanEmptyPropertiesAndItems(outputProject); - CleanPropertiesThatDontChangeValue(outputProject); - CleanEmptyPropertyAndItemGroups(outputProject); - CleanEmptyTargets(outputProject); - } - - private void CleanEmptyPropertyAndItemGroups(ProjectRootElement msbuildProject) - { - CleanEmptyProjectElementContainers(msbuildProject.PropertyGroups); - CleanEmptyProjectElementContainers(msbuildProject.ItemGroups); - } - - private void CleanEmptyPropertiesAndItems(ProjectRootElement msbuildProject) - { - foreach (var property in msbuildProject.Properties) - { - if (string.IsNullOrEmpty(property.Value)) - { - property.Parent.RemoveChild(property); - } - } - - foreach (var item in msbuildProject.Items) - { - if (string.IsNullOrEmpty(item.Include) && - string.IsNullOrEmpty(item.Remove) && - string.IsNullOrEmpty(item.Update)) - { - item.Parent.RemoveChild(item); - } - } - } - - private void CleanPropertiesThatDontChangeValue(ProjectRootElement msbuildProject) - { - foreach (var property in msbuildProject.Properties) - { - var value = property.Value.Trim(); - var variableExpectedValue = "$(" + property.Name + ")"; - - if (value == variableExpectedValue) - { - property.Parent.RemoveChild(property); - } - } - } - - private void CleanEmptyTargets(ProjectRootElement msbuildProject) - { - CleanEmptyProjectElementContainers(msbuildProject.Targets); - } - - private void CleanEmptyProjectElementContainers(IEnumerable containers) - { - foreach (var container in containers) - { - container.RemoveIfEmpty(); - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/IMigrationRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/IMigrationRule.cs deleted file mode 100644 index 92635883b..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/IMigrationRule.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.ProjectJsonMigration.Rules -{ - internal interface IMigrationRule - { - void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs); - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/ItemsIncludedInTheWebSDK.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/ItemsIncludedInTheWebSDK.cs deleted file mode 100644 index f0cf1f25c..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/ItemsIncludedInTheWebSDK.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. - -namespace Microsoft.DotNet.ProjectJsonMigration.Rules -{ - internal class ItemsIncludedInTheWebSDK - { - public static bool HasContent(string content) - { - return content.Equals("wwwroot") || - content.Contains("web.config") || - content.Equals("**/*.cshtml") || - content.Equals(@"**\*.cshtml") || - content.Contains(".json"); - } - } -} \ No newline at end of file diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateAssemblyInfoRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateAssemblyInfoRule.cs deleted file mode 100644 index 46f51cb5e..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateAssemblyInfoRule.cs +++ /dev/null @@ -1,170 +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.Build.Construction; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using Microsoft.DotNet.ProjectJsonMigration; -using Microsoft.DotNet.ProjectJsonMigration.Transforms; -using Microsoft.DotNet.Internal.ProjectModel; -using Microsoft.DotNet.Internal.ProjectModel.Files; -using Microsoft.DotNet.Tools.Common; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.ProjectJsonMigration.Rules -{ - internal class MigrateAssemblyInfoRule : IMigrationRule - { - private const string SystemReflectionNamespace = "System.Reflection"; - private const string SystemResourcesNamespace = "System.Resources"; - - private static IReadOnlyDictionary> Suppresses { get; } = new Dictionary> - { - { "csc", new string[] {"CS1701", "CS1702", "CS1705" } } - }; - - private static IReadOnlyList GenerateAssemblyInfoWhitelist = new List() - { - new KnownAssemblyAttribute(SystemReflectionNamespace, "AssemblyCompany"), - new KnownAssemblyAttribute(SystemReflectionNamespace, "AssemblyConfiguration"), - new KnownAssemblyAttribute(SystemReflectionNamespace, "AssemblyCopyright"), - new KnownAssemblyAttribute(SystemReflectionNamespace, "AssemblyDescription"), - new KnownAssemblyAttribute(SystemReflectionNamespace, "AssemblyFileVersion"), - new KnownAssemblyAttribute(SystemReflectionNamespace, "AssemblyInformationalVersion"), - new KnownAssemblyAttribute(SystemReflectionNamespace, "AssemblyProduct"), - new KnownAssemblyAttribute(SystemReflectionNamespace, "AssemblyTitle"), - new KnownAssemblyAttribute(SystemReflectionNamespace, "AssemblyVersion"), - new KnownAssemblyAttribute(SystemResourcesNamespace, "NeutralResourcesLanguage") - }; - - private readonly ITransformApplicator _transformApplicator; - - public MigrateAssemblyInfoRule(ITransformApplicator transformApplicator = null) - { - _transformApplicator = transformApplicator ?? new TransformApplicator(); - } - - public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs) - { - var projectContext = migrationRuleInputs.DefaultProjectContext; - var compilationOptions = ResolveCompilationOptions(projectContext, "Debug"); - var sources = GetCompilationSources(projectContext, compilationOptions); - var assemblyAttributeList = GetWhitelistedKnownAssemblyAttributes(sources); - - foreach(var assemblyAttribute in assemblyAttributeList) - { - var propertyTransform = new AddPropertyTransform( - assemblyAttribute.GenerateAssemblyAttributePropertyName, - a => "false", - a => true); - - _transformApplicator.Execute( - propertyTransform.Transform(assemblyAttribute.AttributeName), - migrationRuleInputs.CommonPropertyGroup, - true); - } - } - - private IEnumerable GetCompilationSources(ProjectContext project, CommonCompilerOptions compilerOptions) - { - if (compilerOptions.CompileInclude == null) - { - return project.ProjectFile.Files.SourceFiles; - } - - var includeFiles = IncludeFilesResolver.GetIncludeFiles(compilerOptions.CompileInclude, "/", diagnostics: null); - - return includeFiles.Select(f => f.SourcePath); - } - - private List GetWhitelistedKnownAssemblyAttributes(IEnumerable sourceFiles) - { - var assemblyInfoList = 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 - var attributeListSyntaxNodes = root.ChildNodes().OfType(); - - assemblyInfoList.AddRange( - attributeListSyntaxNodes - .Where(node => node.Target.Identifier.Kind() == SyntaxKind.AssemblyKeyword) - .SelectMany(node => node.Attributes) - .Select(attribute => attribute.Name.ToString()) - .Select(name => - GenerateAssemblyInfoWhitelist - .FirstOrDefault(b => b.MatchNames.Contains(name)) - ) - .Where(knownAttribute => knownAttribute != null) - ); - } - - return assemblyInfoList; - } - - // used in incremental compilation for the key file - private CommonCompilerOptions ResolveCompilationOptions(ProjectContext context, string configuration) - { - var compilerOptions = GetLanguageSpecificCompilerOptions(context, 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; - } - - private CommonCompilerOptions GetLanguageSpecificCompilerOptions( - ProjectContext context, - NuGetFramework framework, - string configurationName) - { - var baseOption = context.ProjectFile.GetCompilerOptions(framework, configurationName); - - IReadOnlyList defaultSuppresses; - var compilerName = baseOption.CompilerName ?? "csc"; - if (Suppresses.TryGetValue(compilerName, out defaultSuppresses)) - { - baseOption.SuppressWarnings = (baseOption.SuppressWarnings ?? Enumerable.Empty()).Concat(defaultSuppresses).Distinct(); - } - - return baseOption; - } - - private class KnownAssemblyAttribute - { - public string Namespace { get; } - public string AttributeName { get; } - public IList MatchNames { get; } - public string GenerateAssemblyAttributePropertyName { get; } - - public KnownAssemblyAttribute(string namespaceName, string attributeName) - { - Namespace = namespaceName; - AttributeName = attributeName; - GenerateAssemblyAttributePropertyName = $"Generate{attributeName}Attribute"; - MatchNames = new [] { - attributeName, - $"{attributeName}Attribute", - $"{namespaceName}.{attributeName}", - $"{namespaceName}.{attributeName}Attribute" - }; - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateBuildOptionsRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateBuildOptionsRule.cs deleted file mode 100644 index 5139082e6..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateBuildOptionsRule.cs +++ /dev/null @@ -1,577 +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.Build.Construction; -using Microsoft.DotNet.ProjectJsonMigration.Transforms; -using Microsoft.DotNet.Internal.ProjectModel; -using Microsoft.DotNet.Internal.ProjectModel.Files; -using Newtonsoft.Json.Linq; - -namespace Microsoft.DotNet.ProjectJsonMigration.Rules -{ - internal class MigrateBuildOptionsRule : IMigrationRule - { - private const string BuiltInCompilerResourcesPattern = "compiler/resources/*"; - - private AddPropertyTransform[] EmitEntryPointTransforms - => new [] - { - new AddPropertyTransform("OutputType", "Exe", - compilerOptions => compilerOptions.EmitEntryPoint != null && compilerOptions.EmitEntryPoint.Value), - new AddPropertyTransform("OutputType", "Library", - compilerOptions => compilerOptions.EmitEntryPoint != null && !compilerOptions.EmitEntryPoint.Value) - }; - - private AddPropertyTransform[] KeyFileTransforms - => new [] - { - new AddPropertyTransform("AssemblyOriginatorKeyFile", - compilerOptions => compilerOptions.KeyFile, - compilerOptions => !string.IsNullOrEmpty(compilerOptions.KeyFile)), - new AddPropertyTransform("SignAssembly", - "true", - compilerOptions => !string.IsNullOrEmpty(compilerOptions.KeyFile)), - new AddPropertyTransform("PublicSign", - "true", - compilerOptions => !string.IsNullOrEmpty(compilerOptions.KeyFile) && (compilerOptions.PublicSign == null)) - .WithMSBuildCondition(" '$(OS)' != 'Windows_NT' ") - }; - - private AddPropertyTransform DefineTransform => new AddPropertyTransform( - "DefineConstants", - compilerOptions => "$(DefineConstants);" + string.Join(";", compilerOptions.Defines), - compilerOptions => compilerOptions.Defines != null && compilerOptions.Defines.Any()); - - private AddPropertyTransform NoWarnTransform => new AddPropertyTransform( - "NoWarn", - compilerOptions => "$(NoWarn);" + string.Join(";", compilerOptions.SuppressWarnings), - compilerOptions => compilerOptions.SuppressWarnings != null && compilerOptions.SuppressWarnings.Any()); - - private AddPropertyTransform PreserveCompilationContextTransform => - new AddPropertyTransform("PreserveCompilationContext", - compilerOptions => compilerOptions.PreserveCompilationContext.ToString().ToLower(), - compilerOptions => compilerOptions.PreserveCompilationContext != null && compilerOptions.PreserveCompilationContext.Value); - - private AddPropertyTransform WarningsAsErrorsTransform => - new AddPropertyTransform("TreatWarningsAsErrors", - compilerOptions => compilerOptions.WarningsAsErrors.ToString().ToLower(), - compilerOptions => compilerOptions.WarningsAsErrors != null && compilerOptions.WarningsAsErrors.Value); - - private AddPropertyTransform AllowUnsafeTransform => - new AddPropertyTransform("AllowUnsafeBlocks", - compilerOptions => compilerOptions.AllowUnsafe.ToString().ToLower(), - compilerOptions => compilerOptions.AllowUnsafe != null && compilerOptions.AllowUnsafe.Value); - - private AddPropertyTransform OptimizeTransform => - new AddPropertyTransform("Optimize", - compilerOptions => compilerOptions.Optimize.ToString().ToLower(), - compilerOptions => compilerOptions.Optimize != null && compilerOptions.Optimize.Value); - - private AddPropertyTransform PlatformTransform => - new AddPropertyTransform("PlatformTarget", - compilerOptions => compilerOptions.Platform, - compilerOptions => !string.IsNullOrEmpty(compilerOptions.Platform)); - - private AddPropertyTransform LanguageVersionTransform => - new AddPropertyTransform("LangVersion", - compilerOptions => FormatLanguageVersion(compilerOptions.LanguageVersion), - compilerOptions => !string.IsNullOrEmpty(compilerOptions.LanguageVersion)); - - private AddPropertyTransform DelaySignTransform => - new AddPropertyTransform("DelaySign", - compilerOptions => compilerOptions.DelaySign.ToString().ToLower(), - compilerOptions => compilerOptions.DelaySign != null && compilerOptions.DelaySign.Value); - - private AddPropertyTransform PublicSignTransform => - new AddPropertyTransform("PublicSign", - compilerOptions => compilerOptions.PublicSign.ToString().ToLower(), - compilerOptions => compilerOptions.PublicSign != null && compilerOptions.PublicSign.Value); - - private AddPropertyTransform DebugTypeTransform => - new AddPropertyTransform("DebugType", - compilerOptions => compilerOptions.DebugType, - compilerOptions => !string.IsNullOrEmpty(compilerOptions.DebugType)); - - private AddPropertyTransform XmlDocTransform => - new AddPropertyTransform("GenerateDocumentationFile", - compilerOptions => compilerOptions.GenerateXmlDocumentation.ToString().ToLower(), - compilerOptions => compilerOptions.GenerateXmlDocumentation != null && compilerOptions.GenerateXmlDocumentation.Value); - - private AddPropertyTransform AssemblyNameTransform => - new AddPropertyTransform("AssemblyName", - compilerOptions => compilerOptions.OutputName, - compilerOptions => compilerOptions.OutputName != null); - - private Func> PackageIdTransformExecute => - (projectFolderName) => - new AddPropertyTransform("PackageId", - compilerOptions => projectFolderName, - compilerOptions => compilerOptions.OutputName != null); - - private string[] _compilePatternsToExclude = new string[] { - "**/*.cs" - }; - - private static bool IsPlainFileName(string fileName) - { - return !fileName.Contains('/') && !fileName.Contains('\\'); - } - - private bool CompileFilesExcludeRule(string pattern) - { - return _compilePatternsToExclude.Contains(pattern.Replace('\\', '/')) - || IsPlainFileName(pattern); - } - - private IncludeContextTransform CompileFilesTransform => - new IncludeContextTransform( - "Compile", - transformMappings: false, - excludePatternsRule: CompileFilesExcludeRule, - condition: ic => ic != null, - emitBuiltInIncludes: false); - - private RemoveContextTransform RemoveCompileFilesTransform => - new RemoveContextTransform( - "Compile", - condition: ic => ic != null); - - private IncludeContextTransform EmbedFilesTransform => - new IncludeContextTransform("EmbeddedResource", transformMappings: false, condition: ic => ic != null); - - private RemoveContextTransform RemoveEmbedFilesTransform => - new RemoveContextTransform("EmbeddedResource", condition: ic => ic != null); - - private IncludeContextTransform CopyToOutputFilesTransform => - new UpdateContextTransform("None", transformMappings: true) - .WithMetadata("CopyToOutputDirectory", "PreserveNewest"); - - private IncludeContextTransform DoNotCopyToOutputFilesTransform => - new UpdateContextTransform("None", transformMappings: true) - .WithMetadata("CopyToOutputDirectory", "Never"); - - private IncludeContextTransform CopyToOutputFilesTransformForWeb => - new UpdateContextTransform( - "None", - transformMappings: true, - excludePatternsRule: pattern => ItemsIncludedInTheWebSDK.HasContent(pattern)) - .WithMetadata("CopyToOutputDirectory", "PreserveNewest"); - - private AddPropertyTransform GenerateRuntimeConfigurationFilesTransform => - new AddPropertyTransform( - "GenerateRuntimeConfigurationFiles", - project => "true", - project => project.GetProjectType() == ProjectType.Test); - - private AddItemTransform AppConfigTransform => - new AddItemTransform( - "None", - projectContext => "App.config", - projectContext => string.Empty, - projectContext => File.Exists(Path.Combine(projectContext.ProjectDirectory, "App.config"))); - - private Func> CompileFilesTransformExecute => - (compilerOptions, projectDirectory, projectType) => - CompileFilesTransform.Transform(compilerOptions.CompileInclude); - - private Func> RemoveCompileFilesTransformExecute => - (compilerOptions, projectDirectory, projectType) => - RemoveCompileFilesTransform.Transform(GetCompileRemoveContext(compilerOptions, projectDirectory)); - - private Func> EmbedFilesTransformExecute => - (compilerOptions, projectDirectory, projectType) => - EmbedFilesTransform.Transform(GetEmbedIncludeContext(compilerOptions, projectDirectory)); - - private Func> RemoveEmbedFilesTransformExecute => - (compilerOptions, projectDirectory, projectType) => - RemoveEmbedFilesTransform.Transform(GetEmbedRemoveContext(compilerOptions)); - - private Func> CopyToOutputFilesTransformExecute => - (compilerOptions, projectDirectory, projectType) => - { - var copyToOutputFilesTransform = - projectType == ProjectType.Web ? - CopyToOutputFilesTransformForWeb : - CopyToOutputFilesTransform; - - return copyToOutputFilesTransform.Transform(GetCopyToOutputIncludeContext(compilerOptions, projectDirectory)); - }; - - private Func> DoNotCopyToOutputFilesTransformExecute => - (compilerOptions, projectDirectory, projectType) => - { - return DoNotCopyToOutputFilesTransform.Transform(GetDoNotCopyToOutputIncludeContext(compilerOptions, projectDirectory)); - }; - - private readonly string[] DefaultEmptyExcludeOption = new string[0]; - - private readonly ProjectPropertyGroupElement _configurationPropertyGroup; - private readonly ProjectItemGroupElement _configurationItemGroup; - private readonly CommonCompilerOptions _configurationBuildOptions; - - private List> _propertyTransforms; - private List>> _removeContextTransformExecutes; - private List>> _includeContextTransformExecutes; - - private readonly ITransformApplicator _transformApplicator; - - public MigrateBuildOptionsRule(ITransformApplicator transformApplicator = null) - { - _transformApplicator = transformApplicator ?? new TransformApplicator(); - ConstructTransformLists(); - } - - public MigrateBuildOptionsRule( - CommonCompilerOptions configurationBuildOptions, - ProjectPropertyGroupElement configurationPropertyGroup, - ProjectItemGroupElement configurationItemGroup, - ITransformApplicator transformApplicator = null) - { - _configurationBuildOptions = configurationBuildOptions; - _configurationPropertyGroup = configurationPropertyGroup; - _configurationItemGroup = configurationItemGroup; - _transformApplicator = transformApplicator ?? new TransformApplicator(); - - ConstructTransformLists(); - } - - private bool ContainsCompilerResources(string projectDirectory) - { - return Directory.Exists(Path.Combine(projectDirectory, "compiler", "resources")); - } - - private void ConstructTransformLists() - { - _propertyTransforms = new List>() - { - DefineTransform, - NoWarnTransform, - WarningsAsErrorsTransform, - AllowUnsafeTransform, - OptimizeTransform, - PlatformTransform, - LanguageVersionTransform, - DelaySignTransform, - PublicSignTransform, - DebugTypeTransform, - XmlDocTransform, - PreserveCompilationContextTransform, - AssemblyNameTransform - }; - - _propertyTransforms.AddRange(EmitEntryPointTransforms); - _propertyTransforms.AddRange(KeyFileTransforms); - - _removeContextTransformExecutes = - new List>>() - { - RemoveCompileFilesTransformExecute, - RemoveEmbedFilesTransformExecute - }; - - _includeContextTransformExecutes = - new List>>() - { - CompileFilesTransformExecute, - EmbedFilesTransformExecute, - CopyToOutputFilesTransformExecute, - DoNotCopyToOutputFilesTransformExecute - }; - } - - public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs) - { - var csproj = migrationRuleInputs.OutputMSBuildProject; - var projectContext = migrationRuleInputs.DefaultProjectContext; - - var propertyGroup = _configurationPropertyGroup ?? migrationRuleInputs.CommonPropertyGroup; - var itemGroup = _configurationItemGroup ?? migrationRuleInputs.CommonItemGroup; - - var compilerOptions = projectContext.ProjectFile.GetCompilerOptions(null, null); - - var projectDirectoryName = new DirectoryInfo(migrationSettings.ProjectDirectory).Name; - _propertyTransforms.Add(PackageIdTransformExecute(projectDirectoryName)); - - var project = migrationRuleInputs.DefaultProjectContext.ProjectFile; - var projectType = project.GetProjectType(); - - // If we're in a configuration, we need to be careful not to overwrite values from BuildOptions - // without a configuration - if (_configurationBuildOptions == null) - { - CleanExistingProperties(csproj); - - PerformPropertyAndItemMappings( - compilerOptions, - propertyGroup, - itemGroup, - _transformApplicator, - migrationSettings.ProjectDirectory, - projectType, - csproj); - } - else - { - PerformConfigurationPropertyAndItemMappings( - compilerOptions, - _configurationBuildOptions, - propertyGroup, - itemGroup, - _transformApplicator, - migrationSettings.ProjectDirectory, - projectType, - csproj); - } - - var transformOutput = GenerateRuntimeConfigurationFilesTransform.Transform( - migrationRuleInputs.DefaultProjectContext.ProjectFile); - _transformApplicator.Execute(transformOutput, propertyGroup, mergeExisting: true); - - var appConfigTransformOutput = AppConfigTransform.Transform(migrationRuleInputs.DefaultProjectContext); - _transformApplicator.Execute(appConfigTransformOutput, itemGroup, mergeExisting: true); - } - - private void PerformConfigurationPropertyAndItemMappings( - CommonCompilerOptions compilerOptions, - CommonCompilerOptions configurationCompilerOptions, - ProjectPropertyGroupElement propertyGroup, - ProjectItemGroupElement itemGroup, - ITransformApplicator transformApplicator, - string projectDirectory, - ProjectType projectType, - ProjectRootElement csproj) - { - foreach (var transform in _propertyTransforms) - { - var nonConfigurationOutput = transform.Transform(compilerOptions); - var configurationOutput = transform.Transform(configurationCompilerOptions); - - if (!PropertiesAreEqual(nonConfigurationOutput, configurationOutput)) - { - transformApplicator.Execute(configurationOutput, propertyGroup, mergeExisting: true); - } - } - - foreach (var removeContextTransformExecutes in _removeContextTransformExecutes) - { - var nonConfigurationOutput = - removeContextTransformExecutes(compilerOptions, projectDirectory, projectType); - var configurationOutput = - removeContextTransformExecutes(configurationCompilerOptions, projectDirectory, projectType); - - if (configurationOutput != null && - !ItemRemovesAreEqual(nonConfigurationOutput, configurationOutput)) - { - transformApplicator.Execute(configurationOutput, itemGroup, mergeExisting: true); - } - } - - foreach (var includeContextTransformExecute in _includeContextTransformExecutes) - { - var nonConfigurationOutput = - includeContextTransformExecute(compilerOptions, projectDirectory, projectType); - var configurationOutput = - includeContextTransformExecute(configurationCompilerOptions, projectDirectory, projectType); - - if (configurationOutput != null) - { - transformApplicator.Execute(configurationOutput, itemGroup, mergeExisting: true); - } - } - } - - private bool PropertiesAreEqual(ProjectPropertyElement nonConfigurationOutput, ProjectPropertyElement configurationOutput) - { - if (configurationOutput != null && nonConfigurationOutput != null) - { - return string.Equals(nonConfigurationOutput.Value, configurationOutput.Value, StringComparison.Ordinal); - } - - return configurationOutput == nonConfigurationOutput; - } - - private bool ItemRemovesAreEqual( - IEnumerable nonConfigurationOutput, - IEnumerable configurationOutput) - { - return Enumerable.SequenceEqual( - nonConfigurationOutput ?? EmptyArray.Value, - configurationOutput ?? EmptyArray.Value, - new ItemRemoveAttributeComparer()); - } - - private class ItemRemoveAttributeComparer : EqualityComparer - { - public override bool Equals(ProjectItemElement item1, ProjectItemElement item2) - { - if (item1 == null && item2 == null) - { - return true; - } - else if (item1 == null || item2 == null) - { - return false; - } - - return string.Equals(item1.Remove, item2.Remove, StringComparison.Ordinal); - } - - public override int GetHashCode(ProjectItemElement item) - { - return item.GetHashCode(); - } - } - - private void PerformPropertyAndItemMappings( - CommonCompilerOptions compilerOptions, - ProjectPropertyGroupElement propertyGroup, - ProjectItemGroupElement itemGroup, - ITransformApplicator transformApplicator, - string projectDirectory, - ProjectType projectType, - ProjectRootElement csproj) - { - foreach (var transform in _propertyTransforms) - { - transformApplicator.Execute(transform.Transform(compilerOptions), propertyGroup, mergeExisting: true); - } - - foreach (var removeContextTransformExecutes in _removeContextTransformExecutes) - { - var transform = removeContextTransformExecutes(compilerOptions, projectDirectory, projectType); - - if (transform != null) - { - transformApplicator.Execute( - transform, - itemGroup, - mergeExisting: true); - } - } - - foreach (var includeContextTransformExecute in _includeContextTransformExecutes) - { - var transform = includeContextTransformExecute(compilerOptions, projectDirectory, projectType); - - if (transform != null) - { - transformApplicator.Execute( - transform, - itemGroup, - mergeExisting: true); - } - } - } - - private void CleanExistingProperties(ProjectRootElement csproj) - { - var existingPropertiesToRemove = new [] {"OutputType", "TargetExt"}; - - foreach (var propertyName in existingPropertiesToRemove) - { - var properties = csproj.Properties.Where(p => p.Name == propertyName); - - foreach (var property in properties) - { - property.Parent.RemoveChild(property); - } - } - } - - private IncludeContext GetCompileRemoveContext( - CommonCompilerOptions compilerOptions, - string projectDirectory) - { - var includeContext = compilerOptions.CompileInclude; - if (includeContext == null && ContainsCompilerResources(projectDirectory)) - { - includeContext = new IncludeContext( - projectDirectory, - "compile", - new JObject(), - null, - null); - includeContext.CustomRemovePatterns.Add(BuiltInCompilerResourcesPattern); - } - return includeContext; - } - - private IncludeContext GetEmbedIncludeContext( - CommonCompilerOptions compilerOptions, - string projectDirectory) - { - var embedIncludeContext = compilerOptions.EmbedInclude; - embedIncludeContext?.BuiltInsExclude.Add("@(EmbeddedResource)"); - - if (embedIncludeContext == null && ContainsCompilerResources(projectDirectory)) - { - embedIncludeContext = new IncludeContext( - projectDirectory, - "embed", - new JObject(), - null, - null); - embedIncludeContext.CustomIncludePatterns.Add(BuiltInCompilerResourcesPattern); - } - - return embedIncludeContext; - } - - private IncludeContext GetEmbedRemoveContext(CommonCompilerOptions compilerOptions) - { - var embedIncludeContext = compilerOptions.EmbedInclude; - - embedIncludeContext?.BuiltInsExclude.Add("@(EmbeddedResource)"); - - return embedIncludeContext; - } - - private IncludeContext GetCopyToOutputIncludeContext(CommonCompilerOptions compilerOptions, string projectDirectory) - { - // Defaults from src/Microsoft.DotNet.ProjectModel/ProjectReader.cs #608 - return compilerOptions.CopyToOutputInclude ?? - new IncludeContext( - projectDirectory, - "copyToOutput", - new JObject(), - null, - null); - } - - private IncludeContext GetDoNotCopyToOutputIncludeContext(CommonCompilerOptions compilerOptions, string projectDirectory) - { - // Defaults from src/Microsoft.DotNet.ProjectModel/ProjectReader.cs #608 - var copyToOutputIncludeContext = compilerOptions.CopyToOutputInclude ?? - new IncludeContext( - projectDirectory, - "copyToOutput", - new JObject(), - null, - null); - - var doNotCopyToOutputIncludeContext = - new ExcludeContext( - copyToOutputIncludeContext.SourceBasePath, - copyToOutputIncludeContext.Option, - copyToOutputIncludeContext.RawObject, - copyToOutputIncludeContext.BuiltInsInclude?.ToArray(), - copyToOutputIncludeContext.BuiltInsExclude?.ToArray()); - - return doNotCopyToOutputIncludeContext; - } - - private string FormatLanguageVersion(string langVersion) - { - if (langVersion.StartsWith("csharp", StringComparison.OrdinalIgnoreCase)) - { - return langVersion.Substring("csharp".Length); - } - - return langVersion; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateConfigurationsRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateConfigurationsRule.cs deleted file mode 100644 index a4eff8551..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateConfigurationsRule.cs +++ /dev/null @@ -1,102 +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.Build.Construction; -using NuGet.Frameworks; -using Microsoft.DotNet.Internal.ProjectModel; - -namespace Microsoft.DotNet.ProjectJsonMigration.Rules -{ - internal class MigrateConfigurationsRule : IMigrationRule - { - public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs) - { - MigrationTrace.Instance.WriteLine(String.Format(LocalizableStrings.ExecutingRule, nameof(MigrateConfigurationsRule))); - var projectContext = migrationRuleInputs.DefaultProjectContext; - var configurations = projectContext.ProjectFile.GetConfigurations().ToList(); - - var frameworks = new List(); - frameworks.AddRange(projectContext.ProjectFile.GetTargetFrameworks().Select(t => t.FrameworkName)); - - if (!configurations.Any() && !frameworks.Any()) - { - MigrationTrace.Instance.WriteLine(String.Format(LocalizableStrings.NoConfigurationOrFrameworkFoundInProject, nameof(MigrateConfigurationsRule))); - - return; - } - - foreach (var framework in frameworks) - { - MigrateConfiguration(projectContext.ProjectFile, framework, migrationSettings, migrationRuleInputs); - } - - foreach (var configuration in configurations) - { - MigrateConfiguration(projectContext.ProjectFile, configuration, migrationSettings, migrationRuleInputs); - } - } - - private void MigrateConfiguration( - Project project, - string configuration, - MigrationSettings migrationSettings, - MigrationRuleInputs migrationRuleInputs) - { - var buildOptions = project.GetRawCompilerOptions(configuration); - var configurationCondition = $" '$(Configuration)' == '{configuration}' "; - - MigrateConfiguration(buildOptions, configurationCondition, migrationSettings, migrationRuleInputs); - } - - private void MigrateConfiguration( - Project project, - NuGetFramework framework, - MigrationSettings migrationSettings, - MigrationRuleInputs migrationRuleInputs) - { - var buildOptions = project.GetRawCompilerOptions(framework); - var configurationCondition = framework.GetMSBuildCondition(); - - MigrateConfiguration(buildOptions, configurationCondition, migrationSettings, migrationRuleInputs); - } - - private void MigrateConfiguration( - CommonCompilerOptions buildOptions, - string configurationCondition, - MigrationSettings migrationSettings, - MigrationRuleInputs migrationRuleInputs) - { - var csproj = migrationRuleInputs.OutputMSBuildProject; - - var propertyGroup = CreatePropertyGroupAtEndOfProject(csproj); - var itemGroup = CreateItemGroupAtEndOfProject(csproj); - - propertyGroup.Condition = configurationCondition; - itemGroup.Condition = configurationCondition; - - new MigrateBuildOptionsRule(buildOptions, propertyGroup, itemGroup) - .Apply(migrationSettings, migrationRuleInputs); - - propertyGroup.RemoveIfEmpty(); - itemGroup.RemoveIfEmpty(); - } - - - private ProjectPropertyGroupElement CreatePropertyGroupAtEndOfProject(ProjectRootElement csproj) - { - var propertyGroup = csproj.CreatePropertyGroupElement(); - csproj.InsertBeforeChild(propertyGroup, csproj.LastChild); - return propertyGroup; - } - - private ProjectItemGroupElement CreateItemGroupAtEndOfProject(ProjectRootElement csproj) - { - var itemGroup = csproj.CreateItemGroupElement(); - csproj.InsertBeforeChild(itemGroup, csproj.LastChild); - return itemGroup; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateJsonPropertiesRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateJsonPropertiesRule.cs deleted file mode 100644 index 5751d5b4f..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateJsonPropertiesRule.cs +++ /dev/null @@ -1,52 +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.IO; -using Microsoft.DotNet.ProjectJsonMigration.Transforms; -using Microsoft.Build.Construction; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -namespace Microsoft.DotNet.ProjectJsonMigration.Rules -{ - internal class MigrateJsonPropertiesRule : IMigrationRule - { - private Dictionary> _propertyMappings - = new Dictionary> - { - ["userSecretsId"] = new AddPropertyTransform("UserSecretsId", - j => j.Value(), - j => !string.IsNullOrEmpty(j.Value())) - }; - - private readonly ITransformApplicator _transformApplicator; - - public MigrateJsonPropertiesRule(ITransformApplicator transformApplicator = null) - { - _transformApplicator = transformApplicator ?? new TransformApplicator(); - } - - public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs) - { - var propertyGroup = migrationRuleInputs.CommonPropertyGroup; - - var projectFile = migrationRuleInputs.DefaultProjectContext.ProjectFile.ProjectFilePath; - - using (var stream = new FileStream(projectFile, FileMode.Open)) - using (var streamReader = new StreamReader(stream)) - using (var jsonReader = new JsonTextReader(streamReader)) - { - var rawProject = JObject.Load(jsonReader); - foreach (var prop in _propertyMappings) - { - var token = rawProject.GetValue(prop.Key); - if (token != null) - { - _transformApplicator.Execute(prop.Value.Transform(token), propertyGroup, mergeExisting: true); - } - } - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigratePackOptionsRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigratePackOptionsRule.cs deleted file mode 100644 index 0e224d386..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigratePackOptionsRule.cs +++ /dev/null @@ -1,176 +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.Build.Construction; -using Microsoft.DotNet.ProjectJsonMigration; -using Microsoft.DotNet.ProjectJsonMigration.Transforms; -using Microsoft.DotNet.Internal.ProjectModel; -using Microsoft.DotNet.Internal.ProjectModel.Files; -using Microsoft.DotNet.Tools.Common; - -namespace Microsoft.DotNet.ProjectJsonMigration.Rules -{ - internal class MigratePackOptionsRule : IMigrationRule - { - private AddPropertyTransform TagsTransform => new AddPropertyTransform( - "PackageTags", - packOptions => string.Join(";", packOptions.Tags), - packOptions => packOptions.Tags != null && packOptions.Tags.Any()); - - private AddPropertyTransform ReleaseNotesTransform => new AddPropertyTransform( - "PackageReleaseNotes", - packOptions => packOptions.ReleaseNotes, - packOptions => !string.IsNullOrEmpty(packOptions.ReleaseNotes)); - - private AddPropertyTransform IconUrlTransform => new AddPropertyTransform( - "PackageIconUrl", - packOptions => packOptions.IconUrl, - packOptions => !string.IsNullOrEmpty(packOptions.IconUrl)); - - private AddPropertyTransform ProjectUrlTransform => new AddPropertyTransform( - "PackageProjectUrl", - packOptions => packOptions.ProjectUrl, - packOptions => !string.IsNullOrEmpty(packOptions.ProjectUrl)); - - private AddPropertyTransform LicenseUrlTransform => new AddPropertyTransform( - "PackageLicenseUrl", - packOptions => packOptions.LicenseUrl, - packOptions => !string.IsNullOrEmpty(packOptions.LicenseUrl)); - - private AddPropertyTransform RequireLicenseAcceptanceTransform => new AddPropertyTransform( - "PackageRequireLicenseAcceptance", - packOptions => packOptions.RequireLicenseAcceptance.ToString().ToLower(), - packOptions => true); - - private AddPropertyTransform RepositoryTypeTransform => new AddPropertyTransform( - "RepositoryType", - packOptions => packOptions.RepositoryType, - packOptions => !string.IsNullOrEmpty(packOptions.RepositoryType)); - - private AddPropertyTransform RepositoryUrlTransform => new AddPropertyTransform( - "RepositoryUrl", - packOptions => packOptions.RepositoryUrl, - packOptions => !string.IsNullOrEmpty(packOptions.RepositoryUrl)); - - private IncludeContextTransform PackFilesTransform => - new UpdateContextTransform("None", transformMappings: true) - .WithMetadata("Pack", "true") - .WithMappingsToTransform(_mappingsToTransfrom); - - private IncludeContextTransform DoNotPackFilesTransform => - new UpdateContextTransform( - "None", - transformMappings: true, - excludePatternsRule: pattern => ProjectFilesCollection.DefaultBuiltInExcludePatterns.Contains(pattern)) - .WithMetadata("Pack", "false"); - - private Func, string, AddItemTransform> _mappingsToTransfrom => - (addItemTransform, targetPath) => - { - var msbuildLinkMetadataValue = ConvertTargetPathToMsbuildMetadata(targetPath); - - return addItemTransform.WithMetadata("PackagePath", msbuildLinkMetadataValue); - }; - - private readonly ITransformApplicator _transformApplicator; - - private List> _propertyTransforms; - - public MigratePackOptionsRule(ITransformApplicator transformApplicator = null) - { - _transformApplicator = transformApplicator ?? new TransformApplicator(); - - ConstructTransformLists(); - } - - private void ConstructTransformLists() - { - _propertyTransforms = new List>() - { - TagsTransform, - ReleaseNotesTransform, - IconUrlTransform, - ProjectUrlTransform, - LicenseUrlTransform, - RequireLicenseAcceptanceTransform, - RepositoryTypeTransform, - RepositoryUrlTransform - }; - } - - public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs) - { - var projectContext = migrationRuleInputs.DefaultProjectContext; - var packOptions = projectContext.ProjectFile.PackOptions; - - TransformProperties(packOptions, migrationRuleInputs.CommonPropertyGroup); - - TransformPackFiles(packOptions, migrationRuleInputs.CommonItemGroup); - } - - private void TransformProperties(PackOptions packOptions, ProjectPropertyGroupElement propertyGroup) - { - foreach (var propertyTransfrom in _propertyTransforms) - { - _transformApplicator.Execute(propertyTransfrom.Transform(packOptions), propertyGroup, true); - } - } - - private void TransformPackFiles(PackOptions packOptions, ProjectItemGroupElement itemGroup) - { - ExecuteTransformation(PackFilesTransform, packOptions.PackInclude, itemGroup); - - if (packOptions.PackInclude != null) - { - ExecuteTransformation( - DoNotPackFilesTransform, - new ExcludeContext( - packOptions.PackInclude.SourceBasePath, - packOptions.PackInclude.Option, - packOptions.PackInclude.RawObject, - packOptions.PackInclude.BuiltInsInclude?.ToArray(), - packOptions.PackInclude.BuiltInsExclude?.ToArray()), - itemGroup); - } - } - - private void ExecuteTransformation( - IncludeContextTransform transform, - IncludeContext includeContext, - ProjectItemGroupElement itemGroup) - { - var transformResult = transform.Transform(includeContext); - - if (transformResult != null && transformResult.Any()) - { - _transformApplicator.Execute( - transformResult, - itemGroup, - mergeExisting: true); - } - } - - private string ConvertTargetPathToMsbuildMetadata(string targetPath) - { - var targetIsDirectory = PathIsDirectory(targetPath); - - if (targetIsDirectory) - { - return targetPath; - } - - return Path.GetDirectoryName(targetPath); - } - - private bool PathIsDirectory(string targetPath) - { - var normalizedTargetPath = PathUtility.GetPathWithDirectorySeparator(targetPath); - - return normalizedTargetPath[normalizedTargetPath.Length - 1] == Path.DirectorySeparatorChar; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigratePackageDependenciesAndToolsRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigratePackageDependenciesAndToolsRule.cs deleted file mode 100644 index f95260149..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigratePackageDependenciesAndToolsRule.cs +++ /dev/null @@ -1,458 +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.Build.Construction; -using Microsoft.DotNet.Cli.Sln.Internal; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.ProjectJsonMigration.Transforms; -using Microsoft.DotNet.Internal.ProjectModel; -using Microsoft.DotNet.Tools.Common; -using NuGet.Frameworks; -using NuGet.LibraryModel; -using NuGet.Versioning; - -namespace Microsoft.DotNet.ProjectJsonMigration.Rules -{ - internal class MigratePackageDependenciesAndToolsRule : IMigrationRule - { - private readonly ITransformApplicator _transformApplicator; - private readonly ProjectDependencyFinder _projectDependencyFinder; - private string _projectDirectory; - - private SupportedPackageVersions _supportedPackageVersions; - - public MigratePackageDependenciesAndToolsRule(ITransformApplicator transformApplicator = null) - { - _transformApplicator = transformApplicator ?? new TransformApplicator(); - _projectDependencyFinder = new ProjectDependencyFinder(); - - _supportedPackageVersions = new SupportedPackageVersions(); - } - - public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs) - { - CleanExistingPackageReferences(migrationRuleInputs.OutputMSBuildProject); - - _projectDirectory = migrationSettings.ProjectDirectory; - var project = migrationRuleInputs.DefaultProjectContext.ProjectFile; - - var tfmDependencyMap = new Dictionary>(); - var targetFrameworks = project.GetTargetFrameworks(); - - var noFrameworkPackageReferenceItemGroup = migrationRuleInputs.OutputMSBuildProject.AddItemGroup(); - - AddProjectTypeSpecificDependencies( - migrationRuleInputs, - migrationSettings, - noFrameworkPackageReferenceItemGroup); - - // Migrate Direct Deps first - MigrateDependencies( - project, - migrationRuleInputs, - null, - project.Dependencies, - migrationSettings.SolutionFile, - itemGroup: noFrameworkPackageReferenceItemGroup); - - MigrationTrace.Instance.WriteLine(String.Format(LocalizableStrings.MigratingCountTargetFrameworks, targetFrameworks.Count())); - foreach (var targetFramework in targetFrameworks) - { - MigrationTrace.Instance.WriteLine(String.Format(LocalizableStrings.MigratingFramework, targetFramework.FrameworkName.GetShortFolderName())); - - MigrateImports( - migrationRuleInputs.CommonPropertyGroup, - targetFramework, - migrationRuleInputs.IsMultiTFM); - - MigrateDependencies( - project, - migrationRuleInputs, - targetFramework.FrameworkName, - targetFramework.Dependencies, - migrationSettings.SolutionFile); - } - - MigrateTools(project, migrationRuleInputs.OutputMSBuildProject); - } - - private void AddProjectTypeSpecificDependencies( - MigrationRuleInputs migrationRuleInputs, - MigrationSettings migrationSettings, - ProjectItemGroupElement noFrameworkPackageReferenceItemGroup) - { - var project = migrationRuleInputs.DefaultProjectContext.ProjectFile; - var type = project.GetProjectType(); - switch (type) - { - case ProjectType.Test: - _transformApplicator.Execute( - PackageDependencyInfoTransform().Transform( - new PackageDependencyInfo - { - Name = SupportedPackageVersions.TestSdkPackageName, - Version = ConstantPackageVersions.TestSdkPackageVersion - }), - noFrameworkPackageReferenceItemGroup, - mergeExisting: false); - - if (project.TestRunner.Equals("xunit", StringComparison.OrdinalIgnoreCase)) - { - _transformApplicator.Execute( - PackageDependencyInfoTransform().Transform( - new PackageDependencyInfo - { - Name = SupportedPackageVersions.XUnitPackageName, - Version = ConstantPackageVersions.XUnitPackageVersion - }), - noFrameworkPackageReferenceItemGroup, - mergeExisting: false); - - _transformApplicator.Execute( - PackageDependencyInfoTransform().Transform( - new PackageDependencyInfo - { - Name = SupportedPackageVersions.XUnitRunnerPackageName, - Version = ConstantPackageVersions.XUnitRunnerPackageVersion - }), - noFrameworkPackageReferenceItemGroup, - mergeExisting: false); - } - else if (project.TestRunner.Equals("mstest", StringComparison.OrdinalIgnoreCase)) - { - _transformApplicator.Execute( - PackageDependencyInfoTransform().Transform( - new PackageDependencyInfo - { - Name = SupportedPackageVersions.MstestTestAdapterName, - Version = ConstantPackageVersions.MstestTestAdapterVersion - }), - noFrameworkPackageReferenceItemGroup, - mergeExisting: false); - - _transformApplicator.Execute( - PackageDependencyInfoTransform().Transform( - new PackageDependencyInfo - { - Name = SupportedPackageVersions.MstestTestFrameworkName, - Version = ConstantPackageVersions.MstestTestFrameworkVersion - }), - noFrameworkPackageReferenceItemGroup, - mergeExisting: false); - } - break; - default: - break; - } - } - - private void MigrateImports( - ProjectPropertyGroupElement commonPropertyGroup, - TargetFrameworkInformation targetFramework, - bool isMultiTFM) - { - var transform = ImportsTransformation.Transform(targetFramework); - - if (transform != null) - { - transform.Condition = isMultiTFM ? targetFramework.FrameworkName.GetMSBuildCondition() : null; - _transformApplicator.Execute(transform, commonPropertyGroup, mergeExisting: true); - } - else - { - MigrationTrace.Instance.WriteLine(String.Format(LocalizableStrings.ImportsTransformNullFor, nameof(MigratePackageDependenciesAndToolsRule), targetFramework.FrameworkName.GetShortFolderName())); - } - } - - private void CleanExistingPackageReferences(ProjectRootElement outputMSBuildProject) - { - var packageRefs = outputMSBuildProject.Items.Where(i => i.ItemType == "PackageReference").ToList(); - - foreach (var packageRef in packageRefs) - { - var parent = packageRef.Parent; - packageRef.Parent.RemoveChild(packageRef); - parent.RemoveIfEmpty(); - } - } - - private void MigrateTools( - Project project, - ProjectRootElement output) - { - if (project.Tools == null || !project.Tools.Any()) - { - return; - } - - var itemGroup = output.AddItemGroup(); - - foreach (var tool in project.Tools) - { - _transformApplicator.Execute( - ToolTransform().Transform(ToPackageDependencyInfo( - tool, - SupportedPackageVersions.ProjectToolPackages)), - itemGroup, - mergeExisting: true); - } - } - - private void MigrateDependencies( - Project project, - MigrationRuleInputs migrationRuleInputs, - NuGetFramework framework, - IEnumerable dependencies, - SlnFile solutionFile, - ProjectItemGroupElement itemGroup=null) - { - var projectDependencies = new HashSet(GetAllProjectReferenceNames( - project, - framework, - migrationRuleInputs.ProjectXproj, - solutionFile)); - var packageDependencies = dependencies.Where(d => !projectDependencies.Contains(d.Name)).ToList(); - - string condition = framework?.GetMSBuildCondition() ?? ""; - itemGroup = itemGroup - ?? migrationRuleInputs.OutputMSBuildProject.ItemGroups.FirstOrDefault(i => i.Condition == condition) - ?? migrationRuleInputs.OutputMSBuildProject.AddItemGroup(); - itemGroup.Condition = condition; - - AutoInjectImplicitProjectJsonAssemblyReferences(framework, packageDependencies); - - foreach (var packageDependency in packageDependencies) - { - MigrationTrace.Instance.WriteLine(packageDependency.Name); - AddItemTransform transform; - - if (packageDependency.LibraryRange.TypeConstraint == LibraryDependencyTarget.Reference) - { - transform = FrameworkDependencyTransform; - } - else - { - transform = PackageDependencyInfoTransform(); - if (packageDependency.Type.Equals(LibraryDependencyType.Build)) - { - transform = transform.WithMetadata("PrivateAssets", "All"); - } - else if (packageDependency.SuppressParent != LibraryIncludeFlagUtils.DefaultSuppressParent) - { - var metadataValue = ReadLibraryIncludeFlags(packageDependency.SuppressParent); - transform = transform.WithMetadata("PrivateAssets", metadataValue); - } - - if (packageDependency.IncludeType != LibraryIncludeFlags.All) - { - var metadataValue = ReadLibraryIncludeFlags(packageDependency.IncludeType); - transform = transform.WithMetadata("IncludeAssets", metadataValue); - } - } - - var packageDependencyInfo = ToPackageDependencyInfo( - packageDependency, - _supportedPackageVersions.ProjectDependencyPackages); - - if (packageDependencyInfo != null && packageDependencyInfo.IsMetaPackage) - { - var metaPackageTransform = RuntimeFrameworkVersionTransformation.Transform(packageDependencyInfo); - if(metaPackageTransform == null) - { - metaPackageTransform = - NetStandardImplicitPackageVersionTransformation.Transform(packageDependencyInfo); - } - - if (migrationRuleInputs.IsMultiTFM) - { - metaPackageTransform.Condition = condition; - } - - _transformApplicator.Execute( - metaPackageTransform, - migrationRuleInputs.CommonPropertyGroup, - mergeExisting: true); - } - else - { - _transformApplicator.Execute( - transform.Transform(packageDependencyInfo), - itemGroup, - mergeExisting: true); - } - } - } - - private PackageDependencyInfo ToPackageDependencyInfo( - ProjectLibraryDependency dependency, - IDictionary dependencyToVersionMap) - { - var name = dependency.Name; - var version = dependency.LibraryRange?.VersionRange?.OriginalString; - var minRange = dependency.LibraryRange?.VersionRange?.ToNonSnapshotRange().MinVersion; - - var possibleMappings = - dependencyToVersionMap.Where(c => c.Key.Name.Equals(name, StringComparison.OrdinalIgnoreCase)); - if (possibleMappings.Any() && !string.IsNullOrEmpty(version)) - { - var possibleVersions = possibleMappings.Select(p => VersionRange.Parse(p.Key.Version)); - var matchVersion = possibleVersions.FirstOrDefault(p => p.Satisfies(minRange)); - if (matchVersion != null) - { - var dependencyInfo = possibleMappings.First(c => - c.Key.Version.Equals(matchVersion.OriginalString, StringComparison.OrdinalIgnoreCase)).Value; - - if (dependencyInfo == null) - { - return null; - } - - name = dependencyInfo.Name; - version = dependencyInfo.Version; - } - } - - return new PackageDependencyInfo - { - Name = name, - Version = version - }; - } - - private void AutoInjectImplicitProjectJsonAssemblyReferences(NuGetFramework framework, - IList packageDependencies) - { - if (framework?.IsDesktop() ?? false) - { - InjectAssemblyReferenceIfNotPresent("System", packageDependencies); - if (framework.Version >= new Version(4, 0)) - { - InjectAssemblyReferenceIfNotPresent("Microsoft.CSharp", packageDependencies); - } - } - } - - private void InjectAssemblyReferenceIfNotPresent(string dependencyName, - IList packageDependencies) - { - if (!packageDependencies.Any(dep => - string.Equals(dep.Name, dependencyName, StringComparison.OrdinalIgnoreCase))) - { - packageDependencies.Add(new ProjectLibraryDependency - { - LibraryRange = new LibraryRange(dependencyName, LibraryDependencyTarget.Reference) - }); - } - } - - private string ReadLibraryIncludeFlags(LibraryIncludeFlags includeFlags) - { - if ((includeFlags ^ LibraryIncludeFlags.All) == 0) - { - return "All"; - } - - if ((includeFlags ^ LibraryIncludeFlags.None) == 0) - { - return "None"; - } - - var flagString = ""; - var allFlagsAndNames = new List> - { - Tuple.Create("Analyzers", LibraryIncludeFlags.Analyzers), - Tuple.Create("Build", LibraryIncludeFlags.Build), - Tuple.Create("Compile", LibraryIncludeFlags.Compile), - Tuple.Create("ContentFiles", LibraryIncludeFlags.ContentFiles), - Tuple.Create("Native", LibraryIncludeFlags.Native), - Tuple.Create("Runtime", LibraryIncludeFlags.Runtime) - }; - - foreach (var flagAndName in allFlagsAndNames) - { - var name = flagAndName.Item1; - var flag = flagAndName.Item2; - - if ((includeFlags & flag) == flag) - { - if (!string.IsNullOrEmpty(flagString)) - { - flagString += ";"; - } - flagString += name; - } - } - - return flagString; - } - - private IEnumerable GetAllProjectReferenceNames( - Project project, - NuGetFramework framework, - ProjectRootElement xproj, - SlnFile solutionFile) - { - var csprojReferenceItems = _projectDependencyFinder.ResolveXProjProjectDependencies(xproj); - var migratedXProjDependencyPaths = csprojReferenceItems.SelectMany(p => p.Includes()); - var migratedXProjDependencyNames = - new HashSet(migratedXProjDependencyPaths.Select(p => - Path.GetFileNameWithoutExtension(PathUtility.GetPathWithDirectorySeparator(p)))); - var projectDependencies = _projectDependencyFinder.ResolveDirectProjectDependenciesForFramework( - project, - framework, - preResolvedProjects: migratedXProjDependencyNames, - solutionFile: solutionFile); - - return projectDependencies.Select(p => p.Name).Concat(migratedXProjDependencyNames); - } - - private AddItemTransform FrameworkDependencyTransform => - new AddItemTransform( - "Reference", - dep => dep.Name, - dep => "", - dep => true); - - private Func> PackageDependencyInfoTransform => - () => new AddItemTransform( - "PackageReference", - dep => dep.Name, - dep => "", - dep => dep != null) - .WithMetadata("Version", r => r.Version, expressedAsAttribute: true); - - private AddItemTransform SdkPackageDependencyTransform => - PackageDependencyInfoTransform() - .WithMetadata("PrivateAssets", r => r.PrivateAssets, r => !string.IsNullOrEmpty(r.PrivateAssets)); - - private Func> ToolTransform => - () => new AddItemTransform( - "DotNetCliToolReference", - dep => dep.Name, - dep => "", - dep => dep != null) - .WithMetadata("Version", r => r.Version, expressedAsAttribute: true); - - private AddPropertyTransform ImportsTransformation => - new AddPropertyTransform( - "PackageTargetFallback", - t => $"$(PackageTargetFallback);{string.Join(";", t.Imports)}", - t => t.Imports.OrEmptyIfNull().Any()); - - private AddPropertyTransform RuntimeFrameworkVersionTransformation => - new AddPropertyTransform( - "RuntimeFrameworkVersion", - p => p.Version, - p => p.Name.Equals("Microsoft.NETCore.App", StringComparison.OrdinalIgnoreCase)); - - private AddPropertyTransform NetStandardImplicitPackageVersionTransformation => - new AddPropertyTransform( - "NetStandardImplicitPackageVersion", - p => p.Version, - p => p.Name.Equals("NETStandard.Library", StringComparison.OrdinalIgnoreCase)); - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateProjectDependenciesRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateProjectDependenciesRule.cs deleted file mode 100644 index f697a6f46..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateProjectDependenciesRule.cs +++ /dev/null @@ -1,172 +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.Build.Construction; -using Microsoft.DotNet.Cli.Sln.Internal; -using Microsoft.DotNet.ProjectJsonMigration.Transforms; -using Microsoft.DotNet.Internal.ProjectModel; -using Microsoft.DotNet.Tools.Common; -using NuGet.Frameworks; -using NuGet.LibraryModel; - -namespace Microsoft.DotNet.ProjectJsonMigration.Rules -{ - internal class MigrateProjectDependenciesRule : IMigrationRule - { - private readonly ITransformApplicator _transformApplicator; - private readonly ProjectDependencyFinder _projectDependencyFinder; - private string _projectDirectory; - - public MigrateProjectDependenciesRule(ITransformApplicator transformApplicator = null) - { - _transformApplicator = transformApplicator ?? new TransformApplicator(); - _projectDependencyFinder = new ProjectDependencyFinder(); - } - - public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs) - { - _projectDirectory = migrationSettings.ProjectDirectory; - - var migratedXProjDependencyPaths = MigrateXProjProjectDependencies(migrationRuleInputs); - var migratedXProjDependencyNames = new HashSet( - migratedXProjDependencyPaths.Select(p => - Path.GetFileNameWithoutExtension(PathUtility.GetPathWithDirectorySeparator(p)))); - MigrateProjectJsonProjectDependencies( - migrationRuleInputs.ProjectContexts, - migratedXProjDependencyNames, - migrationSettings.SolutionFile, - migrationRuleInputs.OutputMSBuildProject); - } - - private IEnumerable MigrateXProjProjectDependencies(MigrationRuleInputs migrationRuleInputs) - { - var csprojReferenceItems = _projectDependencyFinder.ResolveXProjProjectDependencies(migrationRuleInputs.ProjectXproj); - - if (!csprojReferenceItems.Any()) - { - return Enumerable.Empty(); - } - - var csprojTransformedReferences = new List(); - - foreach (var csprojReferenceItem in csprojReferenceItems) - { - var conditionChain = csprojReferenceItem.ConditionChain(); - var condition = string.Join(" and ", conditionChain); - - var referenceInclude = string.Join(";", csprojReferenceItem.Includes() - .Where(include => - string.Equals(Path.GetExtension(include), ".csproj", StringComparison.OrdinalIgnoreCase))); - - var transformItem = ProjectDependencyStringTransform.Transform(referenceInclude); - transformItem.Condition = condition; - - csprojTransformedReferences.Add(transformItem); - } - - MigrationTrace.Instance.WriteLine(String.Format(LocalizableStrings.MigratingCountXprojToCsprojReferences, nameof(MigrateProjectDependenciesRule), csprojTransformedReferences.Count())); - - foreach (var csprojTransformedReference in csprojTransformedReferences) - { - _transformApplicator.Execute(csprojTransformedReference, migrationRuleInputs.CommonItemGroup, true); - } - - return csprojTransformedReferences.SelectMany(r => r.Includes()); - } - - public void MigrateProjectJsonProjectDependencies( - IEnumerable projectContexts, - HashSet migratedXProjDependencyNames, - SlnFile solutionFile, - ProjectRootElement outputMSBuildProject) - { - if(projectContexts.Any()) - { - MigrateProjectJsonProjectDependency( - projectContexts.First().ProjectFile, - null, - migratedXProjDependencyNames, - solutionFile, - outputMSBuildProject); - } - - foreach (var projectContext in projectContexts) - { - MigrateProjectJsonProjectDependency( - projectContext.ProjectFile, - projectContext.TargetFramework, - migratedXProjDependencyNames, - solutionFile, - outputMSBuildProject); - } - } - - private void MigrateProjectJsonProjectDependency( - Project project, - NuGetFramework framework, - HashSet migratedXProjDependencyNames, - SlnFile solutionFile, - ProjectRootElement outputMSBuildProject) - { - var projectDependencies = _projectDependencyFinder.ResolveAllProjectDependenciesForFramework( - new ProjectDependency(project.Name, project.ProjectFilePath), - framework, - migratedXProjDependencyNames, - solutionFile); - - var projectDependencyTransformResults = - projectDependencies.Select(p => ProjectDependencyTransform.Transform(p)); - - if (projectDependencyTransformResults.Any()) - { - AddProjectDependenciesToNewItemGroup( - outputMSBuildProject.AddItemGroup(), - projectDependencyTransformResults, - framework); - } - } - - private void AddProjectDependenciesToNewItemGroup( - ProjectItemGroupElement itemGroup, - IEnumerable projectDependencyTransformResults, - NuGetFramework targetFramework) - { - if (targetFramework != null) - { - itemGroup.Condition = targetFramework.GetMSBuildCondition(); - } - - foreach (var projectDependencyTransformResult in projectDependencyTransformResults) - { - _transformApplicator.Execute(projectDependencyTransformResult, itemGroup, true); - } - } - - private AddItemTransform ProjectDependencyTransform => - GetProjectDependencyTransfrom(); - - private Func> GetProjectDependencyTransfrom => - () => new AddItemTransform( - "ProjectReference", - dep => - { - var projectDir = Path.GetDirectoryName(dep.ProjectFilePath); - var migratedProjectFileName = Path.GetFileName(projectDir) + ".csproj"; - var relativeProjectDir = PathUtility.GetRelativePath(_projectDirectory + "/", projectDir); - - return Path.Combine(relativeProjectDir, migratedProjectFileName); - }, - dep => "", - dep => true); - - private AddItemTransform ProjectDependencyStringTransform => new AddItemTransform( - "ProjectReference", - path => path, - path => "", - path => true); - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigratePublishOptionsRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigratePublishOptionsRule.cs deleted file mode 100644 index fe35c1397..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigratePublishOptionsRule.cs +++ /dev/null @@ -1,85 +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.Build.Construction; -using Microsoft.DotNet.Internal.ProjectModel.Files; -using Microsoft.DotNet.ProjectJsonMigration.Transforms; - -namespace Microsoft.DotNet.ProjectJsonMigration.Rules -{ - internal class MigratePublishOptionsRule : IMigrationRule - { - private readonly ITransformApplicator _transformApplicator; - - public MigratePublishOptionsRule(ITransformApplicator transformApplicator = null) - { - _transformApplicator = transformApplicator ?? new TransformApplicator(); - } - - public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs) - { - var csproj = migrationRuleInputs.OutputMSBuildProject; - var projectContext = migrationRuleInputs.DefaultProjectContext; - - var project = migrationRuleInputs.DefaultProjectContext.ProjectFile; - var projectType = project.GetProjectType(); - - var copyToPublishDirectoryTransform = - projectType == ProjectType.Web ? - CopyToPublishDirectoryTransformForWeb : - CopyToPublishDirectoryTransform; - - ExecuteTransformation( - copyToPublishDirectoryTransform, - projectContext.ProjectFile.PublishOptions, - migrationRuleInputs); - - if (projectContext.ProjectFile.PublishOptions != null) - { - ExecuteTransformation( - DoNotCopyToPublishDirectoryTransform, - new ExcludeContext( - projectContext.ProjectFile.PublishOptions.SourceBasePath, - projectContext.ProjectFile.PublishOptions.Option, - projectContext.ProjectFile.PublishOptions.RawObject, - projectContext.ProjectFile.PublishOptions.BuiltInsInclude?.ToArray(), - projectContext.ProjectFile.PublishOptions.BuiltInsExclude?.ToArray()), - migrationRuleInputs); - } - } - - private void ExecuteTransformation( - IncludeContextTransform transform, - IncludeContext includeContext, - MigrationRuleInputs migrationRuleInputs) - { - var transformResult = transform.Transform(includeContext); - - if (transformResult != null && transformResult.Any()) - { - var itemGroup = migrationRuleInputs.CommonItemGroup; - _transformApplicator.Execute( - transformResult, - itemGroup, - mergeExisting: true); - } - } - - private IncludeContextTransform CopyToPublishDirectoryTransform => - new UpdateContextTransform("None", transformMappings: true) - .WithMetadata("CopyToPublishDirectory", "PreserveNewest"); - - private IncludeContextTransform DoNotCopyToPublishDirectoryTransform => - new UpdateContextTransform("None", transformMappings: true) - .WithMetadata("CopyToPublishDirectory", "Never"); - - private IncludeContextTransform CopyToPublishDirectoryTransformForWeb => - new UpdateContextTransform( - "None", - transformMappings: true, - excludePatternsRule: pattern => ItemsIncludedInTheWebSDK.HasContent(pattern)) - .WithMetadata("CopyToPublishDirectory", "PreserveNewest"); - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateRootOptionsRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateRootOptionsRule.cs deleted file mode 100644 index f8ee1d9c9..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateRootOptionsRule.cs +++ /dev/null @@ -1,78 +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.Cli.Utils; -using Microsoft.DotNet.ProjectJsonMigration.Transforms; -using Project = Microsoft.DotNet.Internal.ProjectModel.Project; - -namespace Microsoft.DotNet.ProjectJsonMigration.Rules -{ - internal class MigrateRootOptionsRule : IMigrationRule - { - private readonly ITransformApplicator _transformApplicator; - private readonly AddPropertyTransform[] _transforms; - - public MigrateRootOptionsRule(ITransformApplicator transformApplicator = null) - { - _transformApplicator = transformApplicator ?? new TransformApplicator(); - - _transforms = new[] - { - DescriptionTransform, - CopyrightTransform, - TitleTransform, - LanguageTransform, - VersionTransform, - AuthorsTransform - }; - } - - public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs) - { - var projectContext = migrationRuleInputs.DefaultProjectContext; - - var transformResults = _transforms.Select(t => t.Transform(projectContext.ProjectFile)).ToArray(); - if (transformResults.Any()) - { - var propertyGroup = migrationRuleInputs.CommonPropertyGroup; - - foreach (var transformResult in transformResults) - { - _transformApplicator.Execute(transformResult, propertyGroup, true); - } - } - } - - private AddPropertyTransform DescriptionTransform => new AddPropertyTransform( - "Description", - project => project.Description, - project => !string.IsNullOrEmpty(project.Description)); - - private AddPropertyTransform CopyrightTransform => new AddPropertyTransform( - "Copyright", - project => project.Copyright, - project => !string.IsNullOrEmpty(project.Copyright)); - - private AddPropertyTransform TitleTransform => new AddPropertyTransform( - "AssemblyTitle", - project => project.Title, - project => !string.IsNullOrEmpty(project.Title)); - - private AddPropertyTransform LanguageTransform => new AddPropertyTransform( - "NeutralLanguage", - project => project.Language, - project => !string.IsNullOrEmpty(project.Language)); - - private AddPropertyTransform VersionTransform => new AddPropertyTransform( - "VersionPrefix", - project => project.Version.ToString(), - p => true); - - private AddPropertyTransform AuthorsTransform => new AddPropertyTransform( - "Authors", - project => string.Join(";", project.Authors), - project => project.Authors.OrEmptyIfNull().Any()); - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateRuntimeOptionsRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateRuntimeOptionsRule.cs deleted file mode 100644 index 5f7d63e3b..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateRuntimeOptionsRule.cs +++ /dev/null @@ -1,102 +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.ProjectJsonMigration.Transforms; -using Newtonsoft.Json.Linq; -using System; -using System.IO; - -namespace Microsoft.DotNet.ProjectJsonMigration.Rules -{ - internal class MigrateRuntimeOptionsRule : IMigrationRule - { - private const string ConfigPropertiesTokenName = "configProperties"; - private const string SystemGCServerTokenName = "System.GC.Server"; - private readonly ITransformApplicator _transformApplicator; - private static readonly string s_runtimeOptionsFileName = "runtimeconfig.template.json"; - - public MigrateRuntimeOptionsRule(ITransformApplicator transformApplicator = null) - { - _transformApplicator = transformApplicator ?? new TransformApplicator(); - } - - public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs) - { - var projectContext = migrationRuleInputs.DefaultProjectContext; - var raw = projectContext.ProjectFile.RawRuntimeOptions; - var outputRuntimeOptionsFile = Path.Combine(migrationSettings.OutputDirectory, s_runtimeOptionsFileName); - - if (!string.IsNullOrEmpty(raw)) - { - if (File.Exists(outputRuntimeOptionsFile)) - { - MigrationErrorCodes.MIGRATE1015( - String.Format(LocalizableStrings.ProjAlreadyExistsError, outputRuntimeOptionsFile)).Throw(); - } - - var runtimeOptions = JObject.Parse(raw); - if (HasServerGCProperty(runtimeOptions)) - { - bool serverGCValue = GetServerGCValue(runtimeOptions); - - if (!IsServerGCValueInjectedBySdk(serverGCValue, projectContext.ProjectFile.GetProjectType())) - { - var propertyTransform = new AddPropertyTransform( - "ServerGarbageCollection", - gcValue => gcValue.ToString().ToLower(), - gcValue => true); - - _transformApplicator.Execute( - propertyTransform.Transform(serverGCValue), - migrationRuleInputs.CommonPropertyGroup, - true); - } - - RemoveServerGCProperty(runtimeOptions); - } - - if (runtimeOptions.HasValues) - { - File.WriteAllText(outputRuntimeOptionsFile, runtimeOptions.ToString()); - } - } - } - - private bool IsServerGCValueInjectedBySdk(bool serverGCValue, ProjectType projectType) - { - return (projectType == ProjectType.Web && serverGCValue); - } - - private bool HasServerGCProperty(JObject runtimeOptions) - { - bool hasServerGCProperty = false; - - var configProperties = runtimeOptions.Value(ConfigPropertiesTokenName); - if (configProperties != null) - { - hasServerGCProperty = configProperties[SystemGCServerTokenName] != null; - } - - return hasServerGCProperty; - } - - private bool GetServerGCValue(JObject runtimeOptions) - { - var configProperties = runtimeOptions[ConfigPropertiesTokenName]; - return configProperties.Value(SystemGCServerTokenName); - } - - private void RemoveServerGCProperty(JObject runtimeOptions) - { - var configProperties = runtimeOptions.Value(ConfigPropertiesTokenName); - if (configProperties != null) - { - configProperties.Remove(SystemGCServerTokenName); - if (!configProperties.HasValues) - { - runtimeOptions.Remove(ConfigPropertiesTokenName); - } - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateRuntimesRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateRuntimesRule.cs deleted file mode 100644 index c30ac843f..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateRuntimesRule.cs +++ /dev/null @@ -1,35 +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.DotNet.ProjectJsonMigration.Transforms; - -namespace Microsoft.DotNet.ProjectJsonMigration.Rules -{ - internal class MigrateRuntimesRule : IMigrationRule - { - AddPropertyTransform> RuntimeIdentifiersTransform => - new AddPropertyTransform>( - "RuntimeIdentifiers", - l => String.Join(";", l), - l => l.Count > 0); - - private readonly ITransformApplicator _transformApplicator; - - public MigrateRuntimesRule(ITransformApplicator transformApplicator = null) - { - _transformApplicator = transformApplicator ?? new TransformApplicator(); - } - - public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs) - { - var propertyGroup = migrationRuleInputs.CommonPropertyGroup; - - _transformApplicator.Execute( - RuntimeIdentifiersTransform.Transform(migrationRuleInputs.DefaultProjectContext.ProjectFile.Runtimes), - propertyGroup, - mergeExisting: true); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateScriptsRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateScriptsRule.cs deleted file mode 100644 index 152e66a7e..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateScriptsRule.cs +++ /dev/null @@ -1,209 +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.Build.Construction; -using Microsoft.DotNet.Cli.Utils.CommandParsing; -using Microsoft.DotNet.ProjectJsonMigration.Transforms; -using Microsoft.DotNet.Internal.ProjectModel; - -namespace Microsoft.DotNet.ProjectJsonMigration.Rules -{ - internal class MigrateScriptsRule : IMigrationRule - { - private readonly ITransformApplicator _transformApplicator; - - public MigrateScriptsRule(ITransformApplicator transformApplicator = null) - { - _transformApplicator = transformApplicator ?? new TransformApplicator(); - } - - public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs) - { - var csproj = migrationRuleInputs.OutputMSBuildProject; - var commonPropertyGroup = migrationRuleInputs.CommonPropertyGroup; - var projectContext = migrationRuleInputs.DefaultProjectContext; - var scripts = projectContext.ProjectFile.Scripts; - - foreach (var scriptSet in scripts) - { - MigrateScriptSet( - csproj, - commonPropertyGroup, - scriptSet.Value, - scriptSet.Key, - migrationRuleInputs.IsMultiTFM); - } - } - - public ProjectTargetElement MigrateScriptSet( - ProjectRootElement csproj, - ProjectPropertyGroupElement commonPropertyGroup, - IEnumerable scriptCommands, - string scriptSetName, - bool isMultiTFM) - { - var target = CreateTarget(csproj, scriptSetName, isMultiTFM); - foreach (var scriptCommand in scriptCommands) - { - if (CommandIsNotNeededInMSBuild(scriptCommand)) - { - continue; - } - else if (IsRazorPrecompilationCommand(scriptCommand)) - { - EnableRazorCompilationOnPublish(commonPropertyGroup); - continue; - } - - AddExec(target, FormatScriptCommand(scriptCommand)); - } - - return target; - } - - internal string FormatScriptCommand(string scriptCommandline) - { - return ReplaceScriptVariables(scriptCommandline); - } - - internal string ReplaceScriptVariables(string scriptCommandline) - { - Func scriptVariableReplacementDelegate = key => - { - if (ScriptVariableToMSBuildMap.ContainsKey(key)) - { - if (ScriptVariableToMSBuildMap[key] == null) - { - MigrationErrorCodes.MIGRATE1016( - String.Format(LocalizableStrings.MIGRATE1016Arg, key)) - .Throw(); - } - - return ScriptVariableToMSBuildMap[key]; - } - return $"$({key})"; - }; - - var scriptArguments = CommandGrammar.Process( - scriptCommandline, - scriptVariableReplacementDelegate, - preserveSurroundingQuotes: true); - - scriptArguments = scriptArguments.Where(argument => !string.IsNullOrEmpty(argument)).ToArray(); - - return string.Join(" ", scriptArguments); - } - - private bool CommandIsNotNeededInMSBuild(string command) - { - return command.Contains("dotnet publish-iis"); - } - - private static bool IsRazorPrecompilationCommand(string command) - { - return command.Contains("dotnet razor-precompile"); - } - - private static void EnableRazorCompilationOnPublish(ProjectPropertyGroupElement commonPropertyGroup) - { - commonPropertyGroup.AddProperty("MvcRazorCompileOnPublish", "true"); - } - - private bool IsPathRootedForAnyOS(string path) - { - return path.StartsWith("/") || path.Substring(1).StartsWith(":\\"); - } - - private ProjectTargetElement CreateTarget(ProjectRootElement csproj, string scriptSetName, bool isMultiTFM) - { - var targetName = $"{scriptSetName[0].ToString().ToUpper()}{string.Concat(scriptSetName.Skip(1))}Script"; - - TargetHookInfo targetHookInfo; - if(!ScriptSetToMSBuildHookTargetMap.TryGetValue(scriptSetName, out targetHookInfo)) - { - MigrationErrorCodes.MIGRATE1019( - String.Format(LocalizableStrings.MIGRATE1019Arg, scriptSetName)) - .Throw(); - } - - var target = csproj.CreateTargetElement(targetName); - csproj.InsertBeforeChild(target, csproj.LastChild); - if (targetHookInfo.IsRunBefore) - { - target.BeforeTargets = targetHookInfo.TargetName; - } - else - { - target.AfterTargets = targetHookInfo.TargetName; - } - - if (isMultiTFM) - { - ConditionTargetToRunScriptsAfterEachInnerBuild(target); - } - - return target; - } - - private void ConditionTargetToRunScriptsAfterEachInnerBuild(ProjectTargetElement target) - { - target.Condition = " '$(IsCrossTargetingBuild)' != 'true' "; - } - - private void AddExec(ProjectTargetElement target, string command) - { - var task = target.AddTask("Exec"); - task.SetParameter("Command", command); - } - - // ProjectJson Script Set Name to - private static Dictionary ScriptSetToMSBuildHookTargetMap => new Dictionary() - { - { "precompile", new TargetHookInfo(true, "BeforeBuild") }, - { "postcompile", new TargetHookInfo(false, "Build") }, - { "prepublish", new TargetHookInfo(true, "PrepareForPublish") }, - { "postpublish", new TargetHookInfo(false, "Publish") } - }; - - private static Dictionary ScriptVariableToMSBuildMap => new Dictionary - { - { "compile:ResponseFile", null }, // Not migrated - { "compile:CompilerExitCode", null }, // Not migrated - { "compile:RuntimeOutputDir", null }, // Not migrated - { "compile:RuntimeIdentifier", null },// Not Migrated - - { "compile:TargetFramework", "$(TargetFramework)" }, - { "publish:TargetFramework", "$(TargetFramework)" }, - { "publish:Runtime", "$(RuntimeIdentifier)" }, - - { "compile:FullTargetFramework", "$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion)" }, - { "compile:Configuration", "$(Configuration)" }, - { "compile:OutputFile", "$(TargetPath)" }, - { "compile:OutputDir", "$(TargetDir)" }, - - { "publish:ProjectPath", "$(MSBuildThisFileDirectory)" }, - { "publish:Configuration", "$(Configuration)" }, - { "publish:OutputPath", "$(TargetDir)" }, - { "publish:FullTargetFramework", "$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion)" }, - - { "project:Directory", "$(MSBuildProjectDirectory)" }, - { "project:Name", "$(AssemblyName)" }, - { "project:Version", "$(Version)" } - }; - - private class TargetHookInfo - { - public bool IsRunBefore { get; } - public string TargetName { get; } - - public TargetHookInfo(bool isRunBefore, string targetName) - { - IsRunBefore = isRunBefore; - TargetName = targetName; - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateTFMRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateTFMRule.cs deleted file mode 100644 index 6152b479a..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateTFMRule.cs +++ /dev/null @@ -1,122 +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.Globalization; -using System.Linq; -using System.Text; -using Microsoft.Build.Construction; -using Microsoft.DotNet.Internal.ProjectModel; -using Microsoft.DotNet.ProjectJsonMigration.Transforms; -using NuGet.Frameworks; -using System.Collections.Generic; - -namespace Microsoft.DotNet.ProjectJsonMigration.Rules -{ - // TODO: Support Multi-TFM - internal class MigrateTFMRule : IMigrationRule - { - private const string RuntimeIdentifiers = - "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"; - - private readonly ITransformApplicator _transformApplicator; - - public MigrateTFMRule(ITransformApplicator transformApplicator = null) - { - _transformApplicator = transformApplicator ?? new TransformApplicator(); - } - - public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs) - { - var csproj = migrationRuleInputs.OutputMSBuildProject; - var propertyGroup = migrationRuleInputs.CommonPropertyGroup; - - CleanExistingProperties(csproj); - CleanExistingPackageReferences(csproj); - - if(migrationRuleInputs.IsMultiTFM) - { - _transformApplicator.Execute( - FrameworksTransform.Transform( - migrationRuleInputs.ProjectContexts.Select(p => p.TargetFramework)), - propertyGroup, - mergeExisting: true); - } - else - { - _transformApplicator.Execute( - FrameworkTransform.Transform( - migrationRuleInputs.ProjectContexts.Single().TargetFramework), - propertyGroup, - mergeExisting: true); - } - } - - private void CleanExistingProperties(ProjectRootElement csproj) - { - var existingPropertiesToRemove = new string[] - { - "TargetFrameworkIdentifier", - "TargetFrameworkVersion", - "TargetFrameworks", - "TargetFramework" - }; - - var properties = csproj.Properties.Where(p => existingPropertiesToRemove.Contains(p.Name)); - - foreach (var property in properties) - { - property.Parent.RemoveChild(property); - } - } - - //TODO: this is a hack right now to clean packagerefs. This is not the final resting place for this piece of code - // @brthor will move it to its final location as part of this PackageRef PR: https://github.com/dotnet/cli/pull/4261 - private void CleanExistingPackageReferences(ProjectRootElement outputMSBuildProject) - { - var packageRefs = outputMSBuildProject - .Items - .Where(i => i.ItemType == "PackageReference" && i.Include != SupportedPackageVersions.SdkPackageName) - .ToList(); - - foreach (var packageRef in packageRefs) - { - var parent = packageRef.Parent; - packageRef.Parent.RemoveChild(packageRef); - parent.RemoveIfEmpty(); - } - } - - // Taken from private NuGet.Frameworks method - // https://github.com/NuGet/NuGet.Client/blob/33b8f85a94b01f805f1e955f9b68992b297fad6e/src/NuGet.Core/NuGet.Frameworks/NuGetFramework.cs#L234 - private static string GetDisplayVersion(Version version) - { - var sb = new StringBuilder(String.Format(CultureInfo.InvariantCulture, "{0}.{1}", version.Major, version.Minor)); - - if (version.Build > 0 - || version.Revision > 0) - { - sb.AppendFormat(CultureInfo.InvariantCulture, ".{0}", version.Build); - - if (version.Revision > 0) - { - sb.AppendFormat(CultureInfo.InvariantCulture, ".{0}", version.Revision); - } - } - - return sb.ToString(); - } - - private AddPropertyTransform> FrameworksTransform => - new AddPropertyTransform>( - "TargetFrameworks", - frameworks => string.Join(";", frameworks.Select(f => f.GetShortFolderName())), - frameworks => true); - - private AddPropertyTransform FrameworkTransform => - new AddPropertyTransform( - "TargetFramework", - framework => framework.GetShortFolderName(), - framework => true); - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateWebSdkRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateWebSdkRule.cs deleted file mode 100644 index 3a3fd5889..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/MigrateWebSdkRule.cs +++ /dev/null @@ -1,40 +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.Build.Construction; - -namespace Microsoft.DotNet.ProjectJsonMigration.Rules -{ - //HACK to workaround https://github.com/Microsoft/msbuild/issues/1429 - internal class MigrateWebSdkRule : IMigrationRule - { - private static string GetContainingFolderName(string projectDirectory) - { - projectDirectory = projectDirectory.TrimEnd(new char[] { '/', '\\' }); - return Path.GetFileName(projectDirectory); - } - - public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs) - { - var project = migrationRuleInputs.DefaultProjectContext.ProjectFile; - var type = project.GetProjectType(); - - if(type == ProjectType.Web) - { - ReplaceSdkWithWebSdk(migrationSettings); - } - } - - private void ReplaceSdkWithWebSdk(MigrationSettings migrationSettings) - { - string csprojName = $"{GetContainingFolderName(migrationSettings.ProjectDirectory)}.csproj"; - var outputProject = Path.Combine(migrationSettings.OutputDirectory, csprojName); - - var csprojContent = File.ReadAllText(outputProject); - csprojContent = csprojContent.Replace("Sdk=\"Microsoft.NET.Sdk\"", "Sdk=\"Microsoft.NET.Sdk.Web\""); - - File.WriteAllText(outputProject, csprojContent); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/RemoveDefaultsFromProjectRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/RemoveDefaultsFromProjectRule.cs deleted file mode 100644 index 0802be4aa..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/RemoveDefaultsFromProjectRule.cs +++ /dev/null @@ -1,28 +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.Linq; -using Microsoft.DotNet.ProjectJsonMigration.Transforms; -using Microsoft.Build.Construction; -using System.Collections.Generic; -using Microsoft.DotNet.ProjectJsonMigration.Models; -using System; -using System.IO; -using System.Reflection; -using Newtonsoft.Json; - -namespace Microsoft.DotNet.ProjectJsonMigration.Rules -{ - internal class RemoveDefaultsFromProjectRule : IMigrationRule - { - public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs) - { - foreach (var element in - migrationRuleInputs.OutputMSBuildProject.Children - .Where(c => c.Label == AddDefaultsToProjectRule.c_DefaultsProjectElementContainerLabel)) - { - element.Parent.RemoveChild(element); - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/SaveOutputProjectRule.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Rules/SaveOutputProjectRule.cs deleted file mode 100644 index 955295dc5..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Rules/SaveOutputProjectRule.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.IO; -using Microsoft.Build.Construction; - -namespace Microsoft.DotNet.ProjectJsonMigration.Rules -{ - internal class SaveOutputProjectRule : IMigrationRule - { - private static string GetContainingFolderName(string projectDirectory) - { - projectDirectory = projectDirectory.TrimEnd(new char[] { '/', '\\' }); - return Path.GetFileName(projectDirectory); - } - - public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs) - { - var outputName = migrationRuleInputs.DefaultProjectContext.GetProjectName(); - - string csprojName = $"{GetContainingFolderName(migrationSettings.ProjectDirectory)}.csproj"; - var outputProject = Path.Combine(migrationSettings.OutputDirectory, csprojName); - - migrationRuleInputs.OutputMSBuildProject.Save(outputProject); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/SupportedPackageVersions.cs b/src/Microsoft.DotNet.ProjectJsonMigration/SupportedPackageVersions.cs deleted file mode 100644 index ac7e05721..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/SupportedPackageVersions.cs +++ /dev/null @@ -1,314 +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; - -namespace Microsoft.DotNet.ProjectJsonMigration -{ - internal class PackageDependencyInfo - { - public string Name { get; set; } - public string Version { get; set; } - public string PrivateAssets { get; set; } - - public bool IsMetaPackage - { - get - { - return !string.IsNullOrEmpty(Name) && - (Name.Equals("Microsoft.NETCore.App", StringComparison.OrdinalIgnoreCase) || - Name.Equals("NETStandard.Library", StringComparison.OrdinalIgnoreCase)); - } - } - } - - internal class SupportedPackageVersions - { - public const string SdkPackageName = "Microsoft.NET.Sdk"; - public const string WebSdkPackageName = "Microsoft.NET.Sdk.Web"; - public const string TestSdkPackageName = "Microsoft.NET.Test.Sdk"; - public const string XUnitPackageName = "xunit"; - public const string XUnitRunnerPackageName = "xunit.runner.visualstudio"; - public const string MstestTestAdapterName = "MSTest.TestAdapter"; - public const string MstestTestFrameworkName = "MSTest.TestFramework"; - public const string NetStandardPackageName = "NETStandard.Library"; - public const string NetStandardPackageVersion = "1.6.0"; - public const string DotnetTestXunit = "dotnet-test-xunit"; - public const string DotnetTestMSTest = "dotnet-test-mstest"; - - public readonly IDictionary ProjectDependencyPackages; - - public static readonly IDictionary ProjectToolPackages = - new Dictionary { - { - new PackageDependencyInfo - { - Name = "Microsoft.EntityFrameworkCore.Tools", - Version = "[1.0.0-*,)" - }, - new PackageDependencyInfo { - Name = "Microsoft.EntityFrameworkCore.Tools.DotNet", - Version = ConstantPackageVersions.AspNetToolsVersion - } - }, - { - new PackageDependencyInfo - { - Name = "Microsoft.EntityFrameworkCore.Tools.DotNet", - Version = "[1.0.0-*,)" - }, - new PackageDependencyInfo { - Name = "Microsoft.EntityFrameworkCore.Tools.DotNet", - Version = ConstantPackageVersions.AspNetToolsVersion - } - }, - { - new PackageDependencyInfo - { - Name = "Microsoft.AspNetCore.Razor.Tools", - Version = "[1.0.0-*,)" - }, - null - }, - { - new PackageDependencyInfo - { - Name = "Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools", - Version = "[1.0.0-*,)" - }, - null - }, - { - new PackageDependencyInfo - { - Name = "Microsoft.VisualStudio.Web.CodeGeneration.Tools", - Version = "[1.0.0-*,)" - }, - new PackageDependencyInfo { - Name = "Microsoft.VisualStudio.Web.CodeGeneration.Tools", - Version = ConstantPackageVersions.AspNetToolsVersion - } - }, - { - new PackageDependencyInfo - { - Name = "Microsoft.DotNet.Watcher.Tools", - Version = "[1.0.0-*,)" - }, - new PackageDependencyInfo { - Name = "Microsoft.DotNet.Watcher.Tools", - Version = ConstantPackageVersions.AspNetToolsVersion - } - }, - { - new PackageDependencyInfo - { - Name = "Microsoft.Extensions.SecretManager.Tools", - Version = "[1.0.0-*,)" - }, - new PackageDependencyInfo { - Name = "Microsoft.Extensions.SecretManager.Tools", - Version = ConstantPackageVersions.AspNetToolsVersion - } - }, - { - new PackageDependencyInfo - { - Name = "Microsoft.AspNetCore.Server.IISIntegration.Tools", - Version = "[1.0.0-*,)" - }, - null - }, - { - new PackageDependencyInfo{ - Name = "BundlerMinifier.Core", - Version = "[1.0.0-*,)" - }, - new PackageDependencyInfo { - Name = "BundlerMinifier.Core", - Version = ConstantPackageVersions.BundleMinifierToolVersion - } - } - }; - - public SupportedPackageVersions() - { - ProjectDependencyPackages = - new Dictionary { - { - new PackageDependencyInfo { - Name = "Microsoft.EntityFrameworkCore.Tools", - Version = "[1.0.0-*,)" - }, - new PackageDependencyInfo { - Name = "Microsoft.EntityFrameworkCore.Tools", - Version = ConstantPackageVersions.AspNetToolsVersion } - }, - { - new PackageDependencyInfo - { - Name = "Microsoft.AspNetCore.Razor.Tools", - Version = "[1.0.0-*,)" - }, - null - }, - { - new PackageDependencyInfo - { - Name = "Microsoft.AspNetCore.Razor.Design", - Version = "[1.0.0-*,)" - }, - null - }, - // I hate to do this, but ordering here matters. The higher version needs to come first, otherwise - // the lower version mapping will match to it. - { - new PackageDependencyInfo - { - Name = "Microsoft.VisualStudio.Web.CodeGenerators.Mvc", - Version = "[1.1.0-*,)" - }, - new PackageDependencyInfo - { - Name = "Microsoft.VisualStudio.Web.CodeGeneration.Design", - Version = ConstantPackageVersions.AspNet110ToolsVersion - } - }, - { - new PackageDependencyInfo - { - Name = "Microsoft.VisualStudio.Web.CodeGenerators.Mvc", - Version = "[1.0.0-*,1.1.0)" - }, - new PackageDependencyInfo - { - Name = "Microsoft.VisualStudio.Web.CodeGeneration.Design", - Version = ConstantPackageVersions.AspNetToolsVersion - } - }, - { - new PackageDependencyInfo - { - Name = "Microsoft.VisualStudio.Web.BrowserLink.Loader", - Version = "[14.1.0-*,)" - }, - new PackageDependencyInfo - { - Name = "Microsoft.VisualStudio.Web.BrowserLink", - Version = "1.1.0" - } - }, - { - new PackageDependencyInfo - { - Name = "Microsoft.VisualStudio.Web.BrowserLink.Loader", - Version = "[14.0.0-*,14.1.0)" - }, - new PackageDependencyInfo - { - Name = "Microsoft.VisualStudio.Web.BrowserLink", - Version = "1.0.1" - } - }, - { - new PackageDependencyInfo - { - Name = "Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design", - Version = "[1.0.0-*,)" - }, - new PackageDependencyInfo { - Name = "Microsoft.AspNetCore.Mvc.Razor.ViewCompilation", - Version = ConstantPackageVersions.AspNet110ToolsVersion - } - }, - { - new PackageDependencyInfo - { - Name = "Microsoft.VisualStudio.Web.CodeGeneration.Tools", - Version = "[1.0.0-*,)" - }, - null - }, - { - new PackageDependencyInfo - { - Name = TestSdkPackageName, - Version = "[1.0.0-*,)" - }, - new PackageDependencyInfo - { - Name = TestSdkPackageName, - Version = ConstantPackageVersions.TestSdkPackageVersion - } - }, - { - new PackageDependencyInfo - { - Name = XUnitPackageName, - Version = "[1.0.0-*,)" - }, - new PackageDependencyInfo - { - Name = XUnitPackageName, - Version = ConstantPackageVersions.XUnitPackageVersion - } - }, - { - new PackageDependencyInfo - { - Name = XUnitRunnerPackageName, - Version = "[1.0.0-*,)" - }, - new PackageDependencyInfo { - Name = XUnitRunnerPackageName, - Version = ConstantPackageVersions.XUnitRunnerPackageVersion - } - }, - { - new PackageDependencyInfo - { - Name = MstestTestAdapterName, - Version = "[1.0.0-*,)" - }, - new PackageDependencyInfo - { - Name = MstestTestAdapterName, - Version = ConstantPackageVersions.MstestTestAdapterVersion - } - }, - { - new PackageDependencyInfo - { - Name = MstestTestFrameworkName, - Version = "[1.0.0-*,)" - }, - new PackageDependencyInfo { - Name = MstestTestFrameworkName, - Version = ConstantPackageVersions.MstestTestFrameworkVersion - } - }, - { - new PackageDependencyInfo - { - Name = DotnetTestXunit, - Version = "[1.0.0-*,)" - }, - null - }, - { - new PackageDependencyInfo - { - Name = DotnetTestMSTest, - Version = "[1.0.0-*,)" - }, - null - } - }; - - new DotnetSupportedPackageVersionsCsvProvider() - .AddDotnetSupportedPackageVersions(ProjectDependencyPackages); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/AddItemTransform.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/AddItemTransform.cs deleted file mode 100644 index a00c0e4ce..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/AddItemTransform.cs +++ /dev/null @@ -1,154 +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.Build.Construction; -using Microsoft.DotNet.ProjectJsonMigration.Models; - -namespace Microsoft.DotNet.ProjectJsonMigration.Transforms -{ - internal class AddItemTransform : ConditionalTransform - { - private readonly ProjectRootElement _itemObjectGenerator = ProjectRootElement.Create(); - - private readonly string _itemName; - private readonly string _includeValue; - private readonly string _excludeValue; - - private readonly Func _includeValueFunc; - private readonly Func _excludeValueFunc; - private readonly Func _updateValueFunc; - - private readonly List> _metadata = new List>(); - - public AddItemTransform( - string itemName, - IEnumerable includeValues, - IEnumerable excludeValues, - Func condition) - : this( - itemName, - string.Join(";", includeValues), - string.Join(";", excludeValues), - condition) { } - - public AddItemTransform( - string itemName, - Func includeValueFunc, - Func excludeValueFunc, - Func updateValueFunc, - Func condition) - : base(condition) - { - _itemName = itemName; - _includeValueFunc = includeValueFunc; - _excludeValueFunc = excludeValueFunc; - _updateValueFunc = updateValueFunc; - } - - public AddItemTransform( - string itemName, - Func includeValueFunc, - Func excludeValueFunc, - Func condition) - : base(condition) - { - _itemName = itemName; - _includeValueFunc = includeValueFunc; - _excludeValueFunc = excludeValueFunc; - } - - public AddItemTransform( - string itemName, - string includeValue, - Func excludeValueFunc, - Func condition) - : base(condition) - { - _itemName = itemName; - _includeValue = includeValue; - _excludeValueFunc = excludeValueFunc; - } - - public AddItemTransform( - string itemName, - Func includeValueFunc, - string excludeValue, - Func condition) - : base(condition) - { - _itemName = itemName; - _includeValueFunc = includeValueFunc; - _excludeValue = excludeValue; - } - - public AddItemTransform( - string itemName, - string includeValue, - string excludeValue, - Func condition) - : base(condition) - { - _itemName = itemName; - _includeValue = includeValue; - _excludeValue = excludeValue; - } - - public AddItemTransform WithMetadata( - string metadataName, - string metadataValue, - bool expressedAsAttribute = false) - { - _metadata.Add(new ItemMetadataValue( - metadataName, - metadataValue, - expressedAsAttribute: expressedAsAttribute)); - return this; - } - - public AddItemTransform WithMetadata( - string metadataName, - Func metadataValueFunc, - Func writeMetadataConditionFunc = null, - bool expressedAsAttribute = false) - { - _metadata.Add(new ItemMetadataValue( - metadataName, - metadataValueFunc, - writeMetadataConditionFunc, - expressedAsAttribute: expressedAsAttribute)); - return this; - } - - public AddItemTransform WithMetadata(ItemMetadataValue metadata) - { - _metadata.Add(metadata); - return this; - } - - public override ProjectItemElement ConditionallyTransform(T source) - { - string includeValue = _includeValue ?? _includeValueFunc(source); - string excludeValue = _excludeValue ?? _excludeValueFunc(source); - string updateValue = _updateValueFunc != null ? _updateValueFunc(source) : null; - - var item = _itemObjectGenerator.AddItem(_itemName, "placeholder"); - item.Include = includeValue; - item.SetExcludeOnlyIfIncludeIsSet(excludeValue); - item.Update = updateValue; - - foreach (var metadata in _metadata) - { - if (metadata.ShouldWriteMetadata(source)) - { - var metametadata = item.AddMetadata(metadata.MetadataName, metadata.GetMetadataValue(source)); - metametadata.Condition = metadata.Condition; - metametadata.ExpressedAsAttribute = metadata.ExpressedAsAttribute; - } - } - - return item; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/AddPropertyTransform.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/AddPropertyTransform.cs deleted file mode 100644 index ebeee7691..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/AddPropertyTransform.cs +++ /dev/null @@ -1,65 +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.Build.Construction; - -namespace Microsoft.DotNet.ProjectJsonMigration.Transforms -{ - internal class AddPropertyTransform : ConditionalTransform - { - public string PropertyName { get; } - - private readonly ProjectRootElement _propertyObjectGenerator = ProjectRootElement.Create(); - private readonly string _propertyValue; - private readonly Func _propertyValueFunc; - - private Func _msbuildConditionFunc = null; - - public AddPropertyTransform(string propertyName, string propertyValue, Func condition) - : base(condition) - { - PropertyName = propertyName; - _propertyValue = propertyValue; - } - - public AddPropertyTransform(string propertyName, Func propertyValueFunc, Func condition) - : base(condition) - { - PropertyName = propertyName; - _propertyValueFunc = propertyValueFunc; - } - - public AddPropertyTransform WithMSBuildCondition(string condition) - { - _msbuildConditionFunc = source => condition; - return this; - } - - public AddPropertyTransform WithMSBuildCondition(Func conditionFunc) - { - _msbuildConditionFunc = conditionFunc; - return this; - } - - public override ProjectPropertyElement ConditionallyTransform(T source) - { - string propertyValue = GetPropertyValue(source); - - var property = _propertyObjectGenerator.CreatePropertyElement(PropertyName); - property.Value = propertyValue; - - if (_msbuildConditionFunc != null) - { - property.Condition = _msbuildConditionFunc(source); - } - - return property; - } - - public string GetPropertyValue(T source) - { - return _propertyValue ?? _propertyValueFunc(source); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/ConditionalTransform.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/ConditionalTransform.cs deleted file mode 100644 index 7f5d1a984..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/ConditionalTransform.cs +++ /dev/null @@ -1,102 +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.Tools.Common; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace Microsoft.DotNet.ProjectJsonMigration.Transforms -{ - internal abstract class ConditionalTransform : ITransform - { - private Func _condition; - - public ConditionalTransform(Func condition) - { - _condition = condition; - } - - public U Transform(T source) - { - if (_condition == null || _condition(source)) - { - return ConditionallyTransform(source); - } - - return default(U); - } - - public abstract U ConditionallyTransform(T source); - - protected string FormatGlobPatternsForMsbuild(IEnumerable patterns, string projectDirectory) - { - if (patterns == null) - { - return string.Empty; - } - - List mutatedPatterns = new List(patterns.Count()); - - foreach (var pattern in patterns) - { - // Do not use forward slashes - // https://github.com/Microsoft/msbuild/issues/724 - var mutatedPattern = pattern.Replace('/', '\\'); - - // MSBuild cannot copy directories - mutatedPattern = ReplaceDirectoriesWithGlobs(mutatedPattern, projectDirectory); - - mutatedPatterns.Add(mutatedPattern); - } - - return string.Join(";", mutatedPatterns); - } - - private string ReplaceDirectoriesWithGlobs(string pattern, string projectDirectory) - { - if (PatternIsDirectory(pattern, projectDirectory)) - { - return $"{pattern.TrimEnd(new char[] { '\\' })}\\**\\*"; - } - else - { - return pattern; - } - } - - private bool PatternIsDirectory(string pattern, string projectDirectory) - { - // TODO: what about /some/path/**/somedir? - // Should this even be migrated? - var path = pattern; - - if (!Path.IsPathRooted(path)) - { - path = Path.Combine(projectDirectory, path); - } - - return Directory.Exists(path); - } - - protected string ConvertTargetPathToMsbuildMetadata(string targetPath) - { - var targetIsFile = MappingsTargetPathIsFile(targetPath); - - if (targetIsFile) - { - return targetPath; - } - - return $"{targetPath}%(FileName)%(Extension)"; - } - - private bool MappingsTargetPathIsFile(string targetPath) - { - var normalizedTargetPath = PathUtility.GetPathWithDirectorySeparator(targetPath); - - return normalizedTargetPath[normalizedTargetPath.Length - 1] != Path.DirectorySeparatorChar; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/ITransform.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/ITransform.cs deleted file mode 100644 index df8eaf24b..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/ITransform.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.ProjectJsonMigration.Transforms -{ - 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 deleted file mode 100644 index f1af39fad..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/ITransformApplicator.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 System.Collections.Generic; -using Microsoft.Build.Construction; - -namespace Microsoft.DotNet.ProjectJsonMigration.Transforms -{ - internal interface ITransformApplicator - { - void Execute( - T element, - U destinationElement, - bool mergeExisting) where T : ProjectElement where U : ProjectElementContainer; - - void Execute( - IEnumerable elements, - U destinationElement, - bool mergeExisting) where T : ProjectElement where U : ProjectElementContainer; - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/IncludeContextTransform.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/IncludeContextTransform.cs deleted file mode 100644 index ac91119c9..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/IncludeContextTransform.cs +++ /dev/null @@ -1,185 +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.Internal.ProjectModel.Files; -using System; -using System.IO; -using System.Collections.Generic; -using System.Linq; -using Microsoft.Build.Construction; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.ProjectJsonMigration.Models; -using Microsoft.DotNet.Tools.Common; - -namespace Microsoft.DotNet.ProjectJsonMigration.Transforms -{ - internal class IncludeContextTransform : ConditionalTransform> - { - protected virtual Func> IncludeFilesExcludeFilesTransformGetter => - (itemName) => - new AddItemTransform( - itemName, - includeContext => FormatGlobPatternsForMsbuild(includeContext.IncludeFiles.OrEmptyIfNull() - .Where((pattern) => !ExcludePatternRule(pattern)), - includeContext.SourceBasePath), - includeContext => FormatGlobPatternsForMsbuild(includeContext.ExcludeFiles, includeContext.SourceBasePath), - includeContext => includeContext != null - && includeContext.IncludeFiles != null - && includeContext.IncludeFiles.Where((pattern) => !ExcludePatternRule(pattern)).Count() > 0); - - protected virtual Func> IncludeExcludeTransformGetter => - (itemName) => new AddItemTransform( - itemName, - includeContext => - { - var fullIncludeSet = includeContext.IncludePatterns.OrEmptyIfNull() - .Union(includeContext.CustomIncludePatterns.OrEmptyIfNull()); - if (_emitBuiltInIncludes) - { - fullIncludeSet = fullIncludeSet.Union(includeContext.BuiltInsInclude.OrEmptyIfNull()); - } - - fullIncludeSet = fullIncludeSet.Where((pattern) => !ExcludePatternRule(pattern)); - - return FormatGlobPatternsForMsbuild(fullIncludeSet, includeContext.SourceBasePath); - }, - includeContext => - { - var fullExcludeSet = includeContext.ExcludePatterns.OrEmptyIfNull() - .Union(includeContext.BuiltInsExclude.OrEmptyIfNull()) - .Union(includeContext.ExcludeFiles.OrEmptyIfNull()); - - return FormatGlobPatternsForMsbuild(fullExcludeSet, includeContext.SourceBasePath); - }, - includeContext => - { - return includeContext != null && - ( - (includeContext.IncludePatterns != null && includeContext.IncludePatterns.Where((pattern) => !ExcludePatternRule(pattern)).Count() > 0) - || - (includeContext.CustomIncludePatterns != null && includeContext.CustomIncludePatterns.Where((pattern) => !ExcludePatternRule(pattern)).Count() > 0) - || - (_emitBuiltInIncludes && - includeContext.BuiltInsInclude != null && - includeContext.BuiltInsInclude.Count > 0) - ); - }); - - private Func> MappingsIncludeFilesExcludeFilesTransformGetter => - (itemName, targetPath) => AddMappingToTransform(IncludeFilesExcludeFilesTransformGetter(itemName), targetPath); - - private Func> MappingsIncludeExcludeTransformGetter => - (itemName, targetPath) => AddMappingToTransform(IncludeExcludeTransformGetter(itemName), targetPath); - - private Func, string, AddItemTransform> _mappingsToTransfrom; - - private readonly string _itemName; - private bool _transformMappings; - protected Func ExcludePatternRule { get; } - private bool _emitBuiltInIncludes; - private readonly List> _metadata = new List>(); - - public IncludeContextTransform( - string itemName, - bool transformMappings = true, - Func condition = null, - bool emitBuiltInIncludes = true, - Func excludePatternsRule = null) : base(condition) - { - _itemName = itemName; - _transformMappings = transformMappings; - _emitBuiltInIncludes = emitBuiltInIncludes; - ExcludePatternRule = excludePatternsRule ?? ((pattern) => false); - - _mappingsToTransfrom = (addItemTransform, targetPath) => - { - var msbuildLinkMetadataValue = ConvertTargetPathToMsbuildMetadata(targetPath); - - return addItemTransform.WithMetadata("Link", msbuildLinkMetadataValue); - }; - } - - public IncludeContextTransform WithMetadata( - string metadataName, - string metadataValue, - string condition = null) - { - _metadata.Add(new ItemMetadataValue(metadataName, metadataValue, condition)); - return this; - } - - public IncludeContextTransform WithMetadata( - string metadataName, - Func metadataValueFunc, - string condition = null) - { - _metadata.Add(new ItemMetadataValue( - metadataName, - metadataValueFunc, - condition: condition)); - return this; - } - - public IncludeContextTransform WithMappingsToTransform( - Func, string, AddItemTransform> mappingsToTransfrom) - { - _mappingsToTransfrom = mappingsToTransfrom; - return this; - } - - private IEnumerable, IncludeContext>> CreateTransformSet(IncludeContext source) - { - var transformSet = new List, IncludeContext>> - { - Tuple.Create(IncludeFilesExcludeFilesTransformGetter(_itemName), source), - Tuple.Create(IncludeExcludeTransformGetter(_itemName), source) - }; - - if (source == null) - { - return transformSet; - } - - // Mappings must be executed before the transform set to prevent a the - // non-mapped items that will merge with mapped items from being encompassed - foreach (var mappingEntry in source.Mappings.OrEmptyIfNull()) - { - var targetPath = mappingEntry.Key; - var includeContext = mappingEntry.Value; - - transformSet.Insert(0, - Tuple.Create( - MappingsIncludeExcludeTransformGetter(_itemName, targetPath), - includeContext)); - - transformSet.Insert(0, - Tuple.Create( - MappingsIncludeFilesExcludeFilesTransformGetter(_itemName, targetPath), - includeContext)); - } - - foreach (var metadataElement in _metadata) - { - foreach (var transform in transformSet) - { - transform.Item1.WithMetadata(metadataElement); - } - } - - return transformSet; - } - - public override IEnumerable ConditionallyTransform(IncludeContext source) - { - var transformSet = CreateTransformSet(source); - return transformSet.Select(t => t.Item1.Transform(t.Item2)); - } - - private AddItemTransform AddMappingToTransform( - AddItemTransform addItemTransform, - string targetPath) - { - return _mappingsToTransfrom(addItemTransform, targetPath); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/ItemTransformApplicator.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/ItemTransformApplicator.cs deleted file mode 100644 index 828e6ab94..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/ItemTransformApplicator.cs +++ /dev/null @@ -1,610 +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.Build.Construction; -using System.Linq; - -namespace Microsoft.DotNet.ProjectJsonMigration.Transforms -{ - internal class ItemTransformApplicator : ITransformApplicator - { - private readonly ProjectRootElement _projectElementGenerator = ProjectRootElement.Create(); - - public void Execute( - T element, - U destinationElement, - bool mergeExisting) where T : ProjectElement where U : ProjectElementContainer - { - if (typeof(T) != typeof(ProjectItemElement)) - { - throw new ArgumentException(String.Format( - LocalizableStrings.ExpectedElementToBeOfTypeNotTypeError, - nameof(ProjectItemElement), - typeof(T))); - } - - if (typeof(U) != typeof(ProjectItemGroupElement)) - { - throw new ArgumentException(String.Format( - LocalizableStrings.ExpectedElementToBeOfTypeNotTypeError, - nameof(ProjectItemGroupElement), - typeof(U))); - } - - if (element == null) - { - return; - } - - if (destinationElement == null) - { - throw new ArgumentException(LocalizableStrings.NullDestinationElementError); - } - - var item = element as ProjectItemElement; - var destinationItemGroup = destinationElement as ProjectItemGroupElement; - - MigrationTrace.Instance.WriteLine(String.Format( - LocalizableStrings.ItemTransformApplicatorHeader, - nameof(ItemTransformApplicator), - item.ItemType, - item.Condition, - item.Include, - item.Exclude, - item.Update)); - MigrationTrace.Instance.WriteLine(String.Format( - LocalizableStrings.ItemTransformApplicatorItemGroup, - nameof(ItemTransformApplicator), - destinationItemGroup.Condition)); - - if (mergeExisting) - { - // Don't duplicate items or includes - item = MergeWithExistingItemsWithSameCondition(item, destinationItemGroup); - if (item == null) - { - MigrationTrace.Instance.WriteLine(String.Format( - LocalizableStrings.ItemTransformAppliatorItemCompletelyMerged, - nameof(ItemTransformApplicator))); - return; - } - - // Handle duplicate includes between different conditioned items - item = MergeWithExistingItemsWithNoCondition(item, destinationItemGroup); - if (item == null) - { - MigrationTrace.Instance.WriteLine(String.Format( - LocalizableStrings.ItemTransformAppliatorItemCompletelyMerged, - nameof(ItemTransformApplicator))); - return; - } - - item = MergeWithExistingItemsWithACondition(item, destinationItemGroup); - if (item == null) - { - MigrationTrace.Instance.WriteLine(String.Format( - LocalizableStrings.ItemTransformAppliatorItemCompletelyMerged, - nameof(ItemTransformApplicator))); - return; - } - } - - AddItemToItemGroup(item, destinationItemGroup); - } - - public void Execute( - IEnumerable elements, - U destinationElement, - bool mergeExisting) where T : ProjectElement where U : ProjectElementContainer - { - foreach (var element in elements) - { - Execute(element, destinationElement, mergeExisting); - } - } - - private void AddItemToItemGroup(ProjectItemElement item, ProjectItemGroupElement itemGroup) - { - var outputItem = itemGroup.ContainingProject.CreateItemElement("___TEMP___"); - outputItem.CopyFrom(item); - - MigrationTrace.Instance.WriteLine(String.Format( - LocalizableStrings.ItemTransformApplicatorAddItemHeader, - nameof(ItemTransformApplicator), - outputItem.ItemType, - outputItem.Condition, - outputItem.Include, - outputItem.Exclude, - outputItem.Update)); - - itemGroup.AppendChild(outputItem); - outputItem.AddMetadata(item.Metadata, MigrationTrace.Instance); - } - - private ProjectItemElement MergeWithExistingItemsWithACondition( - ProjectItemElement item, - ProjectItemGroupElement destinationItemGroup) - { - // This logic only applies to conditionless items - if (item.ConditionChain().Any() || destinationItemGroup.ConditionChain().Any()) - { - return item; - } - - var existingItemsWithACondition = - FindExistingItemsWithACondition(item, destinationItemGroup.ContainingProject, destinationItemGroup); - - MigrationTrace.Instance.WriteLine(String.Format( - LocalizableStrings.ItemTransformApplicatorMergingItemWithExistingItems, - nameof(ItemTransformApplicator), - existingItemsWithACondition.Count())); - - foreach (var existingItem in existingItemsWithACondition) - { - if (!string.IsNullOrEmpty(item.Include)) - { - MergeOnIncludesWithExistingItemsWithACondition(item, existingItem, destinationItemGroup); - } - - if (!string.IsNullOrEmpty(item.Update)) - { - MergeOnUpdatesWithExistingItemsWithACondition(item, existingItem, destinationItemGroup); - } - } - - return item; - } - - private void MergeOnIncludesWithExistingItemsWithACondition( - ProjectItemElement item, - ProjectItemElement existingItem, - ProjectItemGroupElement destinationItemGroup) - { - // If this item is encompassing items in a condition, remove the encompassed includes from the existing item - var encompassedIncludes = item.GetEncompassedIncludes(existingItem, MigrationTrace.Instance); - if (encompassedIncludes.Any()) - { - MigrationTrace.Instance.WriteLine(String.Format( - LocalizableStrings.ItemTransformApplicatorEncompassedIncludes, - nameof(ItemTransformApplicator), - string.Join(", ", encompassedIncludes))); - existingItem.RemoveIncludes(encompassedIncludes); - } - - // continue if the existing item is now empty - if (!existingItem.Includes().Any()) - { - MigrationTrace.Instance.WriteLine(String.Format( - LocalizableStrings.ItemTransformApplicatorRemovingItem, - nameof(ItemTransformApplicator), - existingItem.ItemType, - existingItem.Condition, - existingItem.Include, - existingItem.Exclude)); - existingItem.Parent.RemoveChild(existingItem); - return; - } - - // If we haven't continued, the existing item may have includes - // that need to be removed before being redefined, to avoid duplicate includes - // Create or merge with existing remove - var remainingIntersectedIncludes = existingItem.IntersectIncludes(item); - - if (remainingIntersectedIncludes.Any()) - { - var existingRemoveItem = destinationItemGroup.Items - .Where(i => - string.IsNullOrEmpty(i.Include) - && string.IsNullOrEmpty(i.Exclude) - && !string.IsNullOrEmpty(i.Remove)) - .FirstOrDefault(); - - if (existingRemoveItem != null) - { - var removes = new HashSet(existingRemoveItem.Remove.Split(';')); - foreach (var include in remainingIntersectedIncludes) - { - removes.Add(include); - } - existingRemoveItem.Remove = string.Join(";", removes); - } - else - { - var clearPreviousItem = _projectElementGenerator.CreateItemElement(item.ItemType); - clearPreviousItem.Remove = string.Join(";", remainingIntersectedIncludes); - - AddItemToItemGroup(clearPreviousItem, existingItem.Parent as ProjectItemGroupElement); - } - } - } - - private void MergeOnUpdatesWithExistingItemsWithACondition( - ProjectItemElement item, - ProjectItemElement existingItem, - ProjectItemGroupElement destinationItemGroup) - { - // If this item is encompassing items in a condition, remove the encompassed updates from the existing item - var encompassedUpdates = item.GetEncompassedUpdates(existingItem, MigrationTrace.Instance); - if (encompassedUpdates.Any()) - { - MigrationTrace.Instance.WriteLine(String.Format( - LocalizableStrings.ItemTransformApplicatorEncompassedUpdates, - nameof(ItemTransformApplicator), - string.Join(", ", encompassedUpdates))); - existingItem.RemoveUpdates(encompassedUpdates); - } - - // continue if the existing item is now empty - if (!existingItem.Updates().Any()) - { - MigrationTrace.Instance.WriteLine(String.Format( - LocalizableStrings.ItemTransformApplicatorRemovingItem, - nameof(ItemTransformApplicator), - existingItem.ItemType, - existingItem.Condition, - existingItem.Update, - existingItem.Exclude)); - existingItem.Parent.RemoveChild(existingItem); - return; - } - - // If we haven't continued, the existing item may have updates - // that need to be removed before being redefined, to avoid duplicate updates - // Create or merge with existing remove - var remainingIntersectedUpdates = existingItem.IntersectUpdates(item); - - if (remainingIntersectedUpdates.Any()) - { - var existingRemoveItem = destinationItemGroup.Items - .Where(i => - string.IsNullOrEmpty(i.Update) - && string.IsNullOrEmpty(i.Exclude) - && !string.IsNullOrEmpty(i.Remove)) - .FirstOrDefault(); - - if (existingRemoveItem != null) - { - var removes = new HashSet(existingRemoveItem.Remove.Split(';')); - foreach (var update in remainingIntersectedUpdates) - { - removes.Add(update); - } - existingRemoveItem.Remove = string.Join(";", removes); - } - else - { - var clearPreviousItem = _projectElementGenerator.CreateItemElement(item.ItemType); - clearPreviousItem.Remove = string.Join(";", remainingIntersectedUpdates); - - AddItemToItemGroup(clearPreviousItem, existingItem.Parent as ProjectItemGroupElement); - } - } - } - - private ProjectItemElement MergeWithExistingItemsWithNoCondition( - ProjectItemElement item, - ProjectItemGroupElement destinationItemGroup) - { - // This logic only applies to items being placed into a condition - if (!item.ConditionChain().Any() && !destinationItemGroup.ConditionChain().Any()) - { - return item; - } - - var existingItemsWithNoCondition = - FindExistingItemsWithNoCondition(item, destinationItemGroup.ContainingProject, destinationItemGroup); - - MigrationTrace.Instance.WriteLine(String.Format( - LocalizableStrings.ItemTransformApplicatorMergingItemWithExistingItems, - nameof(ItemTransformApplicator), - existingItemsWithNoCondition.Count())); - - if (!string.IsNullOrEmpty(item.Include)) - { - // Handle the item being placed inside of a condition, when it is overlapping with a conditionless item - // If it is not definining new metadata or excludes, the conditioned item can be merged with the - // conditionless item - foreach (var existingItem in existingItemsWithNoCondition) - { - var encompassedIncludes = existingItem.GetEncompassedIncludes(item, MigrationTrace.Instance); - if (encompassedIncludes.Any()) - { - MigrationTrace.Instance.WriteLine(String.Format( - LocalizableStrings.ItemTransformApplicatorEncompassedIncludes, - nameof(ItemTransformApplicator), - string.Join(", ", encompassedIncludes))); - item.RemoveIncludes(encompassedIncludes); - if (!item.Includes().Any()) - { - MigrationTrace.Instance.WriteLine(String.Format( - LocalizableStrings.ItemTransformApplicatorIgnoringItem, - nameof(ItemTransformApplicator), - existingItem.ItemType, - existingItem.Condition, - existingItem.Include, - existingItem.Exclude)); - return null; - } - } - } - } - - if (!string.IsNullOrEmpty(item.Update)) - { - // Handle the item being placed inside of a condition, when it is overlapping with a conditionless item - // If it is not definining new metadata or excludes, the conditioned item can be merged with the - // conditionless item - foreach (var existingItem in existingItemsWithNoCondition) - { - var encompassedUpdates = existingItem.GetEncompassedUpdates(item, MigrationTrace.Instance); - if (encompassedUpdates.Any()) - { - MigrationTrace.Instance.WriteLine(String.Format( - LocalizableStrings.ItemTransformApplicatorEncompassedUpdates, - nameof(ItemTransformApplicator), - string.Join(", ", encompassedUpdates))); - item.RemoveUpdates(encompassedUpdates); - if (!item.Updates().Any()) - { - MigrationTrace.Instance.WriteLine(String.Format( - LocalizableStrings.ItemTransformApplicatorIgnoringItem, - nameof(ItemTransformApplicator), - existingItem.ItemType, - existingItem.Condition, - existingItem.Update, - existingItem.Exclude)); - return null; - } - } - } - } - - // If we haven't returned, and there are existing items with a separate condition, we need to - // overwrite with those items inside the destinationItemGroup by using a Remove - if (existingItemsWithNoCondition.Any()) - { - // Merge with the first remove if possible - var existingRemoveItem = destinationItemGroup.Items - .Where(i => - string.IsNullOrEmpty(i.Include) - && string.IsNullOrEmpty(i.Update) - && string.IsNullOrEmpty(i.Exclude) - && !string.IsNullOrEmpty(i.Remove)) - .FirstOrDefault(); - - var itemsToRemove = string.IsNullOrEmpty(item.Include) ? item.Update : item.Include; - if (existingRemoveItem != null) - { - existingRemoveItem.Remove += ";" + itemsToRemove; - } - else - { - var clearPreviousItem = _projectElementGenerator.CreateItemElement(item.ItemType); - clearPreviousItem.Remove = itemsToRemove; - - AddItemToItemGroup(clearPreviousItem, destinationItemGroup); - } - } - - return item; - } - - private ProjectItemElement MergeWithExistingItemsWithSameCondition( - ProjectItemElement item, - ProjectItemGroupElement destinationItemGroup) - { - var existingItemsWithSameCondition = FindExistingItemsWithSameCondition( - item, - destinationItemGroup.ContainingProject, - destinationItemGroup); - - MigrationTrace.Instance.WriteLine(String.Format( - LocalizableStrings.ItemTransformApplicatorMergingItemWithExistingItemsSameChain, - nameof(TransformApplicator), - existingItemsWithSameCondition.Count())); - - foreach (var existingItem in existingItemsWithSameCondition) - { - var mergeResult = MergeItems(item, existingItem); - item = mergeResult.InputItem; - - // Existing Item is null when it's entire set of includes has been merged with the MergeItem - if (mergeResult.ExistingItem == null) - { - existingItem.Parent.RemoveChild(existingItem); - } - - MigrationTrace.Instance.WriteLine(String.Format( - LocalizableStrings.ItemTransformApplicatorAddingMergedItem, - nameof(TransformApplicator), - mergeResult.MergedItem.ItemType, - mergeResult.MergedItem.Condition, - mergeResult.MergedItem.Include, - mergeResult.MergedItem.Exclude)); - AddItemToItemGroup(mergeResult.MergedItem, destinationItemGroup); - } - - return item; - } - - private MergeResult MergeItems(ProjectItemElement item, ProjectItemElement existingItem) - { - if (!string.IsNullOrEmpty(item.Include)) - { - return MergeItemsOnIncludes(item, existingItem); - } - - if (!string.IsNullOrEmpty(item.Update)) - { - return MergeItemsOnUpdates(item, existingItem); - } - - throw new InvalidOperationException(LocalizableStrings.CannotMergeItemsWithoutCommonIncludeError); - } - - /// - /// Merges two items on their common sets of includes. - /// The output is 3 items, the 2 input items and the merged items. If the common - /// set of includes spans the entirety of the includes of either of the 2 input - /// items, that item will be returned as null. - /// - /// The 3rd output item, the merged item, will have the Union of the excludes and - /// metadata from the 2 input items. If any metadata between the 2 input items is different, - /// this will throw. - /// - /// This function will mutate the Include property of the 2 input items, removing the common subset. - /// - private MergeResult MergeItemsOnIncludes(ProjectItemElement item, ProjectItemElement existingItem) - { - if (!string.Equals(item.ItemType, existingItem.ItemType, StringComparison.Ordinal)) - { - throw new InvalidOperationException(LocalizableStrings.CannotMergeItemsOfDifferentTypesError); - } - - var commonIncludes = item.IntersectIncludes(existingItem).ToList(); - var mergedItem = _projectElementGenerator.AddItem(item.ItemType, string.Join(";", commonIncludes)); - - mergedItem.UnionExcludes(existingItem.Excludes()); - mergedItem.UnionExcludes(item.Excludes()); - - mergedItem.AddMetadata(MergeMetadata(existingItem.Metadata, item.Metadata), MigrationTrace.Instance); - - item.RemoveIncludes(commonIncludes); - existingItem.RemoveIncludes(commonIncludes); - - var mergeResult = new MergeResult - { - InputItem = string.IsNullOrEmpty(item.Include) ? null : item, - ExistingItem = string.IsNullOrEmpty(existingItem.Include) ? null : existingItem, - MergedItem = mergedItem - }; - - return mergeResult; - } - - private MergeResult MergeItemsOnUpdates(ProjectItemElement item, ProjectItemElement existingItem) - { - if (!string.Equals(item.ItemType, existingItem.ItemType, StringComparison.Ordinal)) - { - throw new InvalidOperationException(LocalizableStrings.CannotMergeItemsOfDifferentTypesError); - } - - var commonUpdates = item.IntersectUpdates(existingItem).ToList(); - var mergedItem = _projectElementGenerator.AddItem(item.ItemType, "placeholder"); - mergedItem.Include = string.Empty; - mergedItem.Update = string.Join(";", commonUpdates); - - mergedItem.UnionExcludes(existingItem.Excludes()); - mergedItem.UnionExcludes(item.Excludes()); - - mergedItem.AddMetadata(MergeMetadata(existingItem.Metadata, item.Metadata), MigrationTrace.Instance); - - item.RemoveUpdates(commonUpdates); - existingItem.RemoveUpdates(commonUpdates); - - var mergeResult = new MergeResult - { - InputItem = string.IsNullOrEmpty(item.Update) ? null : item, - ExistingItem = string.IsNullOrEmpty(existingItem.Update) ? null : existingItem, - MergedItem = mergedItem - }; - - return mergeResult; - } - - private ICollection MergeMetadata( - ICollection existingMetadataElements, - ICollection newMetadataElements) - { - var mergedMetadata = new List(existingMetadataElements.Select(m => (ProjectMetadataElement) m.Clone())); - - foreach (var newMetadata in newMetadataElements) - { - var existingMetadata = mergedMetadata.FirstOrDefault(m => - m.Name.Equals(newMetadata.Name, StringComparison.OrdinalIgnoreCase)); - if (existingMetadata == null) - { - mergedMetadata.Add((ProjectMetadataElement) newMetadata.Clone()); - } - else - { - MergeMetadata(existingMetadata, (ProjectMetadataElement) newMetadata.Clone()); - } - } - - return mergedMetadata; - } - - public void MergeMetadata(ProjectMetadataElement existingMetadata, ProjectMetadataElement newMetadata) - { - if (existingMetadata.Value != newMetadata.Value) - { - if (existingMetadata.Name == "CopyToOutputDirectory" || - existingMetadata.Name == "CopyToPublishDirectory") - { - existingMetadata.Value = - existingMetadata.Value == "Never" || newMetadata.Value == "Never" ? - "Never" : - "PreserveNewest"; - } - else if (existingMetadata.Name == "Pack") - { - existingMetadata.Value = - existingMetadata.Value == "false" || newMetadata.Value == "false" ? - "false" : - "true"; - } - else - { - existingMetadata.Value = string.Join(";", new [] { existingMetadata.Value, newMetadata.Value }); - } - } - } - - private IEnumerable FindExistingItemsWithSameCondition( - ProjectItemElement item, - ProjectRootElement project, - ProjectElementContainer destinationContainer) - { - return project.Items - .Where(i => i.Condition == item.Condition) - .Where(i => i.Parent.ConditionChainsAreEquivalent(destinationContainer)) - .Where(i => i.ItemType == item.ItemType) - .Where(i => i.IntersectIncludes(item).Any() || - i.IntersectUpdates(item).Any()); - } - - private IEnumerable FindExistingItemsWithNoCondition( - ProjectItemElement item, - ProjectRootElement project, - ProjectElementContainer destinationContainer) - { - return project.Items - .Where(i => !i.ConditionChain().Any()) - .Where(i => i.ItemType == item.ItemType) - .Where(i => i.IntersectIncludes(item).Any() || - i.IntersectUpdates(item).Any()); - } - - private IEnumerable FindExistingItemsWithACondition( - ProjectItemElement item, - ProjectRootElement project, - ProjectElementContainer destinationContainer) - { - return project.Items - .Where(i => i.ConditionChain().Any()) - .Where(i => i.ItemType == item.ItemType) - .Where(i => i.IntersectIncludes(item).Any() || - i.IntersectUpdates(item).Any()); - } - - private class MergeResult - { - public ProjectItemElement InputItem { get; set; } - public ProjectItemElement ExistingItem { get; set; } - public ProjectItemElement MergedItem { get; set; } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/PropertyTransformApplicator.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/PropertyTransformApplicator.cs deleted file mode 100644 index 307d7cf8f..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/PropertyTransformApplicator.cs +++ /dev/null @@ -1,136 +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.Build.Construction; -using System.Linq; -using System.Text.RegularExpressions; - -namespace Microsoft.DotNet.ProjectJsonMigration.Transforms -{ - internal class PropertyTransformApplicator : ITransformApplicator - { - private readonly ProjectRootElement _projectElementGenerator = ProjectRootElement.Create(); - - public void Execute( - T element, - U destinationElement, - bool mergeExisting) where T : ProjectElement where U : ProjectElementContainer - { - if (typeof(T) != typeof(ProjectPropertyElement)) - { - throw new ArgumentException(String.Format(LocalizableStrings.PropertyTransformApplicatorWrongElementTypeError, nameof(ProjectPropertyElement), nameof(T))); - } - - if (typeof(U) != typeof(ProjectPropertyGroupElement)) - { - throw new ArgumentException(String.Format(LocalizableStrings.PropertyTransformApplicatorWrongElementTypeError, nameof(ProjectPropertyGroupElement), nameof(U))); - } - - if (element == null) - { - return; - } - - var property = element as ProjectPropertyElement; - var destinationPropertyGroup = destinationElement as ProjectPropertyGroupElement; - - if (mergeExisting) - { - var mergedProperty = MergePropertyWithProject(property, destinationPropertyGroup); - if (mergedProperty != null && !string.IsNullOrEmpty(mergedProperty.Value)) - { - TracePropertyInfo(LocalizableStrings.MergingProperty, mergedProperty); - AddPropertyToPropertyGroup(mergedProperty, destinationPropertyGroup); - } - else - { - TracePropertyInfo(LocalizableStrings.IgnoringMergedProperty, property); - } - } - else - { - AddPropertyToPropertyGroup(property, destinationPropertyGroup); - } - } - - private ProjectPropertyElement MergePropertyWithProject( - ProjectPropertyElement property, - ProjectPropertyGroupElement destinationPropertyGroup) - { - var propertiesToMergeWith = FindPropertiesWithSameNameAndSameOrNoCondition( - property, - destinationPropertyGroup.ContainingProject); - - foreach (var propertyToMergeWith in propertiesToMergeWith) - { - property = MergeProperties(propertyToMergeWith, property); - } - - return property; - } - - private IEnumerable FindPropertiesWithSameNameAndSameOrNoCondition( - ProjectPropertyElement property, - ProjectRootElement project) - { - return project.Properties - .Where(otherProperty => - property.Name == otherProperty.Name - && (property.Condition == otherProperty.Condition - || (property.Condition == otherProperty.Parent.Condition && string.IsNullOrEmpty(otherProperty.Condition)) - || !otherProperty.ConditionChain().Any())); - } - - private ProjectPropertyElement MergeProperties(ProjectPropertyElement baseProperty, ProjectPropertyElement addedProperty) - { - var mergedProperty = _projectElementGenerator.AddProperty("___TEMP___", "___TEMP___"); - mergedProperty.CopyFrom(addedProperty); - - var basePropertyValues = baseProperty.Value.Split(';'); - var addedPropertyValues = addedProperty.Value.Split(';'); - - var intersectedValues = basePropertyValues.Intersect(addedPropertyValues, StringComparer.Ordinal); - intersectedValues = RemoveValuesWithVariable(intersectedValues); - - mergedProperty.Value = string.Join(";", addedPropertyValues.Except(intersectedValues)); - - return mergedProperty; - } - - private IEnumerable RemoveValuesWithVariable(IEnumerable intersectedValues) - { - return intersectedValues.Where(v => ! Regex.IsMatch(v, @"\$\(.*?\)")); - } - - private void AddPropertyToPropertyGroup(ProjectPropertyElement property, ProjectPropertyGroupElement destinationPropertyGroup) - { - var outputProperty = destinationPropertyGroup.ContainingProject.CreatePropertyElement("___TEMP___"); - outputProperty.CopyFrom(property); - - destinationPropertyGroup.AppendChild(outputProperty); - } - - public void Execute( - IEnumerable elements, - U destinationElement, - bool mergeExisting) where T : ProjectElement where U : ProjectElementContainer - { - foreach (var element in elements) - { - Execute(element, destinationElement, mergeExisting); - } - } - - private void TracePropertyInfo(string message, ProjectPropertyElement mergedProperty) - { - MigrationTrace.Instance.WriteLine(String.Format( - LocalizableStrings.PropertyInfo, - nameof(PropertyTransformApplicator), - message, - mergedProperty.Name, - mergedProperty.Value)); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/RemoveContextTransform.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/RemoveContextTransform.cs deleted file mode 100644 index 6da010c8e..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/RemoveContextTransform.cs +++ /dev/null @@ -1,113 +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.Internal.ProjectModel.Files; -using System; -using System.IO; -using System.Collections.Generic; -using System.Linq; -using Microsoft.Build.Construction; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.ProjectJsonMigration.Models; -using Microsoft.DotNet.Tools.Common; - -namespace Microsoft.DotNet.ProjectJsonMigration.Transforms -{ - internal class RemoveContextTransform : ConditionalTransform> - { - protected virtual Func> RemoveTransformGetter => - (itemName) => new RemoveItemTransform( - itemName, - includeContext => - { - var fullRemoveSet = includeContext.ExcludePatterns.OrEmptyIfNull() - .Union(includeContext.ExcludeFiles.OrEmptyIfNull()) - .Union(includeContext.CustomRemovePatterns.OrEmptyIfNull()); - - return FormatGlobPatternsForMsbuild(fullRemoveSet, includeContext.SourceBasePath); - }, - includeContext => - { - return includeContext != null && - ( - (includeContext.ExcludePatterns != null && includeContext.ExcludePatterns.Count > 0) - || - (includeContext.ExcludeFiles != null && includeContext.ExcludeFiles.Count > 0) - || - (includeContext.CustomRemovePatterns != null && includeContext.CustomRemovePatterns.Count > 0) - ); - }); - - private Func> MappingsRemoveTransformGetter => - (itemName, targetPath) => AddMappingToTransform(RemoveTransformGetter(itemName), targetPath); - - private Func, string, RemoveItemTransform> _mappingsToTransfrom; - - private readonly string _itemName; - private readonly List> _metadata = new List>(); - - public RemoveContextTransform( - string itemName, - Func condition = null - ) : base(condition) - { - _itemName = itemName; - - _mappingsToTransfrom = (removeItemTransform, targetPath) => - { - var msbuildLinkMetadataValue = ConvertTargetPathToMsbuildMetadata(targetPath); - - return removeItemTransform.WithMetadata("Link", msbuildLinkMetadataValue); - }; - } - - public override IEnumerable ConditionallyTransform(IncludeContext source) - { - var transformSet = CreateTransformSet(source); - return transformSet.Select(t => t.Item1.Transform(t.Item2)); - } - - private IEnumerable, IncludeContext>> CreateTransformSet(IncludeContext source) - { - var transformSet = new List, IncludeContext>> - { - Tuple.Create(RemoveTransformGetter(_itemName), source) - }; - - if (source == null) - { - return transformSet; - } - - // Mappings must be executed before the transform set to prevent a the - // non-mapped items that will merge with mapped items from being encompassed - foreach (var mappingEntry in source.Mappings.OrEmptyIfNull()) - { - var targetPath = mappingEntry.Key; - var includeContext = mappingEntry.Value; - - transformSet.Insert(0, - Tuple.Create( - MappingsRemoveTransformGetter(_itemName, targetPath), - includeContext)); - } - - foreach (var metadataElement in _metadata) - { - foreach (var transform in transformSet) - { - transform.Item1.WithMetadata(metadataElement); - } - } - - return transformSet; - } - - private RemoveItemTransform AddMappingToTransform( - RemoveItemTransform removeItemTransform, - string targetPath) - { - return _mappingsToTransfrom(removeItemTransform, targetPath); - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/RemoveItemTransform.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/RemoveItemTransform.cs deleted file mode 100644 index 7833e4b8b..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/RemoveItemTransform.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 System.Collections.Generic; -using Microsoft.Build.Construction; -using Microsoft.DotNet.ProjectJsonMigration.Models; - -namespace Microsoft.DotNet.ProjectJsonMigration.Transforms -{ - internal class RemoveItemTransform : ConditionalTransform - { - private readonly ProjectRootElement _itemObjectGenerator = ProjectRootElement.Create(); - - private readonly string _itemName; - private readonly Func _removeValueFunc; - - private readonly List> _metadata = new List>(); - - public RemoveItemTransform( - string itemName, - Func removeValueFunc, - Func condition) - : base(condition) - { - _itemName = itemName; - _removeValueFunc = removeValueFunc; - } - - public RemoveItemTransform WithMetadata(ItemMetadataValue metadata) - { - _metadata.Add(metadata); - return this; - } - - public RemoveItemTransform WithMetadata( - string metadataName, - string metadataValue, - bool expressedAsAttribute = false) - { - _metadata.Add(new ItemMetadataValue( - metadataName, - metadataValue, - expressedAsAttribute: expressedAsAttribute)); - return this; - } - - public override ProjectItemElement ConditionallyTransform(T source) - { - string removeValue = _removeValueFunc(source); - - var item = _itemObjectGenerator.AddItem(_itemName, "PlaceHolderSinceNullOrEmptyCannotBePassedToConstructor"); - item.Include = null; - item.Remove = removeValue; - - foreach (var metadata in _metadata) - { - if (metadata.ShouldWriteMetadata(source)) - { - var metametadata = item.AddMetadata(metadata.MetadataName, metadata.GetMetadataValue(source)); - metametadata.Condition = metadata.Condition; - metametadata.ExpressedAsAttribute = metadata.ExpressedAsAttribute; - } - } - - return item; - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/TransformApplicator.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/TransformApplicator.cs deleted file mode 100644 index 0b8cb1be9..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/TransformApplicator.cs +++ /dev/null @@ -1,53 +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.Build.Construction; -using System.Linq; - -namespace Microsoft.DotNet.ProjectJsonMigration.Transforms -{ - internal class TransformApplicator : ITransformApplicator - { - private readonly ITransformApplicator _propertyTransformApplicator; - - private readonly ITransformApplicator _itemTransformApplicator; - - public TransformApplicator(ITransformApplicator propertyTransformApplicator=null, ITransformApplicator itemTransformApplicator=null) - { - _propertyTransformApplicator = propertyTransformApplicator ?? new PropertyTransformApplicator(); - _itemTransformApplicator = propertyTransformApplicator ?? new ItemTransformApplicator(); - } - - public void Execute( - T element, - U destinationElement, - bool mergeExisting) where T : ProjectElement where U : ProjectElementContainer - { - if (typeof(T) == typeof(ProjectItemElement)) - { - _itemTransformApplicator.Execute(element, destinationElement, mergeExisting); - } - else if (typeof(T) == typeof(ProjectPropertyElement)) - { - _propertyTransformApplicator.Execute(element, destinationElement, mergeExisting); - } - else - { - throw new ArgumentException(String.Format(LocalizableStrings.UnexpectedTypeError, nameof(T))); - } - } - - public void Execute( - IEnumerable elements, - U destinationElement, - bool mergeExisting) where T : ProjectElement where U : ProjectElementContainer - { - foreach (var element in elements) - { - Execute(element, destinationElement, mergeExisting); - } - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/UpdateContextTransform.cs b/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/UpdateContextTransform.cs deleted file mode 100644 index e31d5c8df..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/Transforms/UpdateContextTransform.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 Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Internal.ProjectModel.Files; -using System; -using System.Linq; - -namespace Microsoft.DotNet.ProjectJsonMigration.Transforms -{ - internal class UpdateContextTransform : IncludeContextTransform - { - protected override Func> IncludeFilesExcludeFilesTransformGetter => - (itemName) => - new AddItemTransform( - itemName, - includeContext => string.Empty, - includeContext => FormatGlobPatternsForMsbuild(includeContext.ExcludeFiles, includeContext.SourceBasePath), - includeContext => FormatGlobPatternsForMsbuild( - includeContext.IncludeFiles.OrEmptyIfNull().Where( - pattern => !ExcludePatternRule(pattern)), includeContext.SourceBasePath), - includeContext => includeContext != null - && includeContext.IncludeFiles != null - && includeContext.IncludeFiles.Where( - pattern => !ExcludePatternRule(pattern)).Count() > 0); - - protected override Func> IncludeExcludeTransformGetter => - (itemName) => new AddItemTransform( - itemName, - includeContext => string.Empty, - includeContext => - { - var fullExcludeSet = includeContext.ExcludePatterns.OrEmptyIfNull() - .Union(includeContext.BuiltInsExclude.OrEmptyIfNull()) - .Union(includeContext.ExcludeFiles.OrEmptyIfNull()); - - return FormatGlobPatternsForMsbuild(fullExcludeSet, includeContext.SourceBasePath); - }, - includeContext => - { - var fullIncludeSet = includeContext.IncludePatterns.OrEmptyIfNull() - .Union(includeContext.BuiltInsInclude.OrEmptyIfNull()) - .Union(includeContext.CustomIncludePatterns.OrEmptyIfNull()); - - return FormatGlobPatternsForMsbuild( - fullIncludeSet.Where(pattern => !ExcludePatternRule(pattern)), - includeContext.SourceBasePath); - }, - includeContext => - { - return includeContext != null &&includeContext.IncludePatterns.OrEmptyIfNull() - .Union(includeContext.BuiltInsInclude.OrEmptyIfNull()) - .Union(includeContext.CustomIncludePatterns.OrEmptyIfNull()) - .Where(pattern => !ExcludePatternRule(pattern)).Count() > 0; - }); - - public UpdateContextTransform( - string itemName, - bool transformMappings = true, - Func condition = null, - Func excludePatternsRule = null) : base( - itemName, - transformMappings, - condition, - excludePatternsRule: excludePatternsRule) - { - } - } -} diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/dotnet-supported-package-versions.csv b/src/Microsoft.DotNet.ProjectJsonMigration/dotnet-supported-package-versions.csv deleted file mode 100644 index c3abe102d..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/dotnet-supported-package-versions.csv +++ /dev/null @@ -1,320 +0,0 @@ -Id,LtsVersion,CurrentVersion -Microsoft.NETCore.App,1.0.4,1.1.1 -Microsoft.AspNetCore,1.0.4,1.1.1 -Microsoft.AspNetCore.Authentication,1.0.2,1.1.1 -Microsoft.AspNetCore.Authentication.Cookies,1.0.2,1.1.1 -Microsoft.AspNetCore.Authentication.Facebook,1.0.2,1.1.1 -Microsoft.AspNetCore.Authentication.Google,1.0.2,1.1.1 -Microsoft.AspNetCore.Authentication.JwtBearer,1.0.2,1.1.1 -Microsoft.AspNetCore.Authentication.MicrosoftAccount,1.0.2,1.1.1 -Microsoft.AspNetCore.Authentication.OAuth,1.0.2,1.1.1 -Microsoft.AspNetCore.Authentication.OpenIdConnect,1.0.2,1.1.1 -Microsoft.AspNetCore.Authentication.Twitter,1.0.2,1.1.1 -Microsoft.AspNetCore.Buffering,0.1.2,0.2.1 -Microsoft.AspNetCore.CookiePolicy,1.0.2,1.1.1 -Microsoft.AspNetCore.Cors,1.0.2,1.1.1 -Microsoft.AspNetCore.DataProtection,1.0.2,1.1.1 -Microsoft.AspNetCore.DataProtection.Extensions,1.0.2,1.1.1 -Microsoft.AspNetCore.DataProtection.Redis,,0.1.1 -Microsoft.AspNetCore.DataProtection.SystemWeb,1.0.2,1.1.1 -Microsoft.AspNetCore.DataProtection.Sources,1.0.2,1.1.1 -Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore,1.0.2,1.1.1 -Microsoft.AspNetCore.Diagnostics.Elm,0.1.2,0.2.1 -Microsoft.AspNetCore.Hosting.WindowsServices,1.0.2,1.1.1 -Microsoft.AspNetCore.Html.Abstractions,1.0.2,1.1.1 -Microsoft.AspNetCore.Identity.EntityFrameworkCore,1.0.2,1.1.1 -Microsoft.AspNetCore.MiddlewareAnalysis,1.0.2,1.1.1 -Microsoft.AspNetCore.Mvc,1.0.3,1.1.2 -Microsoft.AspNetCore.Mvc.Abstractions,1.0.3,1.1.2 -Microsoft.AspNetCore.Mvc.ApiExplorer,1.0.3,1.1.2 -Microsoft.AspNetCore.Mvc.Formatters.Xml,1.0.3,1.1.2 -Microsoft.AspNetCore.Mvc.WebApiCompatShim,1.0.3,1.1.2 -Microsoft.AspNetCore.Owin,1.0.2,1.1.1 -Microsoft.AspNetCore.Routing,1.0.3,1.1.1 -Microsoft.AspNetCore.Routing.Abstractions,1.0.3,1.1.1 -Microsoft.AspNetCore.Routing.DecisionTree.Sources,1.0.3,1.1.1 -Microsoft.AspNetCore.Server.Kestrel.Https,1.0.3,1.1.1 -Microsoft.AspNetCore.Server.WebListener,1.0.2,1.1.1 -Microsoft.AspNetCore.Session,1.0.2,1.1.1 -Microsoft.AspNetCore.StaticFiles,1.0.2,1.1.1 -Microsoft.AspNetCore.TestHost,1.0.2,1.1.1 -Microsoft.AspNetCore.Testing,1.0.1,1.1.0-rtm-22752 -Microsoft.AspNetCore.DiagnosticsViewPage.Sources,1.0.2,1.1.1 -Microsoft.Data.Sqlite,1.0.1,1.1.0 -Microsoft.EntityFrameworkCore,1.0.3,1.1.1 -Microsoft.EntityFrameworkCore.Design,1.0.3,1.1.1 -Microsoft.EntityFrameworkCore.InMemory,1.0.3,1.1.1 -Microsoft.EntityFrameworkCore.Relational,1.0.3,1.1.1 -Microsoft.EntityFrameworkCore.Relational.Design,1.0.3,1.1.1 -Microsoft.EntityFrameworkCore.Sqlite,1.0.3,1.1.1 -Microsoft.EntityFrameworkCore.Sqlite.Design,1.0.3,1.1.1 -Microsoft.EntityFrameworkCore.SqlServer,1.0.3,1.1.1 -Microsoft.EntityFrameworkCore.SqlServer.Design,1.0.3,1.1.1 -Microsoft.Extensions.Caching.Memory,1.0.2,1.1.1 -Microsoft.Extensions.Caching.Redis,1.0.2,1.1.1 -Microsoft.Extensions.Caching.SqlServer,1.0.2,1.1.1 -Microsoft.Extensions.CommandLineUtils,1.0.1,1.1.0 -Microsoft.Extensions.Configuration,1.0.2,1.1.1 -Microsoft.Extensions.Configuration.Binder,1.0.2,1.1.1 -Microsoft.Extensions.Configuration.CommandLine,1.0.2,1.1.1 -Microsoft.Extensions.Configuration.EnvironmentVariables,1.0.2,1.1.1 -Microsoft.Extensions.Configuration.FileExtensions,1.0.2,1.1.1 -Microsoft.Extensions.Configuration.Ini,1.0.2,1.1.1 -Microsoft.Extensions.Configuration.Json,1.0.2,1.1.1 -Microsoft.Extensions.Configuration.UserSecrets,1.0.2,1.1.1 -Microsoft.Extensions.Configuration.Xml,1.0.2,1.1.1 -Microsoft.Extensions.DependencyInjection,1.0.2,1.1.0 -Microsoft.Extensions.DiagnosticAdapter,1.0.2,1.1.0 -Microsoft.Extensions.FileProviders.Composite,1.0.1,1.1.0 -Microsoft.Extensions.FileProviders.Embedded,1.0.1,1.1.0 -Microsoft.Extensions.FileProviders.Physical,1.0.1,1.1.0 -Microsoft.Extensions.FileSystemGlobbing,1.0.1,1.1.0 -Microsoft.Extensions.Globalization.CultureInfoCache,1.0.2,1.1.1 -Microsoft.Extensions.Localization,1.0.2,1.1.1 -Microsoft.Extensions.Logging,1.0.2,1.1.1 -Microsoft.Extensions.Logging.Console,1.0.2,1.1.1 -Microsoft.Extensions.Logging.Debug,1.0.2,1.1.1 -Microsoft.Extensions.Logging.Filter,1.0.2,1.1.1 -Microsoft.Extensions.Logging.TraceSource,1.0.2,1.1.1 -Microsoft.Extensions.Logging.EventLog,1.0.2,1.1.1 -Microsoft.VisualStudio.Web.BrowserLink,1.0.1,1.1.0 -Microsoft.AspNetCore.AzureAppServicesIntegration,,1.0.1 -Microsoft.AspNetCore.DataProtection.AzureStorage,,1.0.1 -Microsoft.AspNetCore.Localization.Routing,,1.1.1 -Microsoft.AspNetCore.Rewrite,,1.0.1 -Microsoft.AspNetCore.ResponseCaching,1.0.1,1.1.1 -Microsoft.AspNetCore.ResponseCompression,,1.0.1 -Microsoft.AspNetCore.WebSockets,,1.0.1 -Microsoft.Extensions.Logging.AzureAppServices,,1.0.1 -Microsoft.Extensions.Configuration.AzureKeyVault,,1.0.1 -Microsoft.Extensions.Logging.EventSource,,1.1.1 -System.ServiceModel.Duplex,4.0.1,4.3.0 -System.ServiceModel.Http,4.1.0,4.3.0 -System.ServiceModel.NetTcp,4.1.0,4.3.0 -System.ServiceModel.Security,4.0.1,4.3.0 -Libuv,1.9.1,1.9.1 -Microsoft.AspNet.WebApi.Client,5.2.2,5.2.2 -Microsoft.AspNetCore.Antiforgery,1.0.3,1.1.1 -Microsoft.AspNetCore.Authorization,1.0.2,1.1.1 -Microsoft.AspNetCore.Cryptography.Internal,1.0.2,1.1.1 -Microsoft.AspNetCore.Cryptography.KeyDerivation,1.0.2,1.1.1 -Microsoft.AspNetCore.DataProtection.Abstractions,1.0.2,1.1.1 -Microsoft.AspNetCore.Diagnostics,1.0.2,1.1.1 -Microsoft.AspNetCore.Diagnostics.Abstractions,1.0.2,1.1.1 -Microsoft.AspNetCore.Hosting,1.0.2,1.1.1 -Microsoft.AspNetCore.Hosting.Abstractions,1.0.2,1.1.1 -Microsoft.AspNetCore.Hosting.Server.Abstractions,1.0.2,1.1.1 -Microsoft.AspNetCore.Http,1.0.2,1.1.1 -Microsoft.AspNetCore.Http.Abstractions,1.0.2,1.1.1 -Microsoft.AspNetCore.Http.Extensions,1.0.2,1.1.1 -Microsoft.AspNetCore.Http.Features,1.0.2,1.1.1 -Microsoft.AspNetCore.HttpOverrides,1.0.2,1.1.1 -Microsoft.AspNetCore.Identity,1.0.2,1.1.1 -Microsoft.AspNetCore.JsonPatch,1.0.0,1.1.1 -Microsoft.AspNetCore.Localization,1.0.2,1.1.1 -Microsoft.AspNetCore.Mvc.Core,1.0.3,1.1.2 -Microsoft.AspNetCore.Mvc.Cors,1.0.3,1.1.2 -Microsoft.AspNetCore.Mvc.DataAnnotations,1.0.3,1.1.2 -Microsoft.AspNetCore.Mvc.Formatters.Json,1.0.3,1.1.2 -Microsoft.AspNetCore.Mvc.Localization,1.0.3,1.1.2 -Microsoft.AspNetCore.Mvc.Razor,1.0.3,1.1.2 -Microsoft.AspNetCore.Mvc.Razor.Host,1.0.3,1.1.2 -Microsoft.AspNetCore.Mvc.TagHelpers,1.0.3,1.1.2 -Microsoft.AspNetCore.Mvc.ViewFeatures,1.0.3,1.1.2 -Microsoft.AspNetCore.Razor,1.0.2,1.1.1 -Microsoft.AspNetCore.Razor.Runtime,1.0.2,1.1.1 -Microsoft.AspNetCore.Server.IISIntegration,1.0.2,1.1.1 -Microsoft.AspNetCore.Server.Kestrel,1.0.3,1.1.1 -Microsoft.AspNetCore.WebUtilities,1.0.2,1.1.1 -Microsoft.Bcl,1.1.9,1.1.9 -Microsoft.Bcl.Build,1.0.14,1.0.14 -Microsoft.CodeAnalysis.Analyzers,1.1.0,1.1.0 -Microsoft.CodeAnalysis.Common,1.3.0,1.3.0 -Microsoft.CodeAnalysis.CSharp,1.3.0,1.3.0 -Microsoft.CodeAnalysis.VisualBasic,1.3.0,1.3.0 -Microsoft.CSharp,4.0.1,4.3.0 -Microsoft.DotNet.InternalAbstractions,1.0.0, -Microsoft.Extensions.Caching.Abstractions,1.0.2,1.1.1 -Microsoft.Extensions.Configuration.Abstractions,1.0.2,1.1.1 -Microsoft.Extensions.DependencyInjection.Abstractions,1.0.2,1.1.0 -Microsoft.Extensions.DependencyModel,1.0.0,1.1.0 -Microsoft.Extensions.FileProviders.Abstractions,1.0.1,1.1.0 -Microsoft.Extensions.Localization.Abstractions,1.0.2,1.1.1 -Microsoft.Extensions.Logging.Abstractions,1.0.2,1.1.1 -Microsoft.Extensions.ObjectPool,1.0.1,1.1.0 -Microsoft.Extensions.Options,1.0.2,1.1.1 -Microsoft.Extensions.Options.ConfigurationExtensions,1.0.2,1.1.1 -Microsoft.Extensions.PlatformAbstractions,1.0.0,1.1.0 -Microsoft.Extensions.Primitives,1.0.1,1.1.0 -Microsoft.Extensions.WebEncoders,1.0.2,1.1.1 -Microsoft.IdentityModel.Logging,1.0.0,1.1.0 -Microsoft.IdentityModel.Protocols,2.0.0,2.1.0 -Microsoft.IdentityModel.Protocols.OpenIdConnect,2.0.0,2.1.0 -Microsoft.IdentityModel.Tokens,5.0.0,5.1.0 -Microsoft.Net.Http,2.2.22,2.2.22 -Microsoft.Net.Http.Headers,1.0.2,1.1.1 -Microsoft.Net.Http.Server,1.0.2,1.1.1 -Microsoft.NETCore.DotNetHost,1.0.1,1.1.0 -Microsoft.NETCore.DotNetHostPolicy,1.0.3,1.1.0 -Microsoft.NETCore.DotNetHostResolver,1.0.1,1.1.0 -Microsoft.NETCore.Jit,1.0.5,1.1.0 -Microsoft.NETCore.Platforms,1.0.2,1.1.0 -Microsoft.NETCore.Runtime.CoreCLR,1.0.5,1.1.0 -Microsoft.NETCore.Targets,1.0.1,1.1.0 -Microsoft.NETCore.Windows.ApiSets,1.0.1,1.0.1 -Microsoft.VisualBasic,10.0.1,10.1.0 -Microsoft.Win32.Primitives,4.0.1,4.3.0 -Microsoft.Win32.Registry,4.0.0,4.3.0 -NETStandard.Library,1.6.0,1.6.1 -Newtonsoft.Json,9.0.1,9.0.1 -Remotion.Linq,2.1.1,2.1.1 -runtime.native.System,4.0.0,4.3.0 -runtime.native.System.Data.SqlClient.sni,4.0.0,4.3.0 -runtime.native.System.IO.Compression,4.1.0,4.3.0 -runtime.native.System.Net.Http,4.0.1,4.3.0 -runtime.native.System.Net.Security,4.0.1,4.3.0 -runtime.native.System.Security.Cryptography,4.0.0, -runtime.win7-x64.runtime.native.System.Data.SqlClient.sni,4.0.1,4.3.0 -runtime.win7-x86.runtime.native.System.Data.SqlClient.sni,4.0.1,4.3.0 -SQLite,3.13.0,3.13.0 -System.AppContext,4.1.0,4.3.0 -System.Buffers,4.0.0,4.3.0 -System.Collections,4.0.11,4.3.0 -System.Collections.Concurrent,4.0.12,4.3.0 -System.Collections.Immutable,1.2.0,1.3.0 -System.Collections.NonGeneric,4.0.1,4.3.0 -System.Collections.Specialized,4.0.1,4.3.0 -System.ComponentModel,4.0.1,4.3.0 -System.ComponentModel.Annotations,4.1.0,4.3.0 -System.ComponentModel.EventBasedAsync,4.0.11,4.3.0 -System.ComponentModel.Primitives,4.1.0,4.3.0 -System.ComponentModel.TypeConverter,4.1.0,4.3.0 -System.Console,4.0.0,4.3.0 -System.Data.Common,4.1.0,4.3.0 -System.Data.SqlClient,4.1.0,4.3.0 -System.Diagnostics.Contracts,4.0.1,4.3.0 -System.Diagnostics.Debug,4.0.11,4.3.0 -System.Diagnostics.DiagnosticSource,4.0.0,4.3.0 -System.Diagnostics.FileVersionInfo,4.0.0,4.0.0 -System.Diagnostics.Process,4.1.0,4.3.0 -System.Diagnostics.StackTrace,4.0.1,4.3.0 -System.Diagnostics.Tools,4.0.1,4.3.0 -System.Diagnostics.TraceSource,4.0.0,4.3.0 -System.Diagnostics.Tracing,4.1.0,4.3.0 -System.Dynamic.Runtime,4.0.11,4.3.0 -System.Globalization,4.0.11,4.3.0 -System.Globalization.Calendars,4.0.1,4.3.0 -System.Globalization.Extensions,4.0.1,4.3.0 -System.IdentityModel.Tokens.Jwt,5.0.0,5.1.0 -System.Interactive.Async,3.0.0,3.0.0 -System.IO,4.1.0,4.3.0 -System.IO.Compression,4.1.0,4.3.0 -System.IO.Compression.ZipFile,4.0.1,4.3.0 -System.IO.FileSystem,4.0.1,4.3.0 -System.IO.FileSystem.Primitives,4.0.1,4.3.0 -System.IO.FileSystem.Watcher,4.0.0,4.3.0 -System.IO.MemoryMappedFiles,4.0.0,4.3.0 -System.IO.Pipes,4.0.0,4.3.0 -System.IO.UnmanagedMemoryStream,4.0.1,4.3.0 -System.Linq,4.1.0,4.3.0 -System.Linq.Expressions,4.1.0,4.3.0 -System.Linq.Parallel,4.0.1,4.3.0 -System.Linq.Queryable,4.0.1,4.3.0 -System.Net.Http,4.1.1,4.3.0 -System.Net.NameResolution,4.0.0,4.3.0 -System.Net.Primitives,4.0.11,4.3.0 -System.Net.Requests,4.0.11,4.3.0 -System.Net.Security,4.0.0,4.3.0 -System.Net.Sockets,4.1.0,4.3.0 -System.Net.WebHeaderCollection,4.0.1,4.3.0 -System.Net.WebSockets,4.0.0,4.3.0 -System.Net.WebSockets.Client,4.0.0,4.3.0 -System.Numerics.Vectors,4.1.1,4.3.0 -System.ObjectModel,4.0.12,4.3.0 -System.Private.DataContractSerialization,4.1.1,4.3.0 -System.Private.ServiceModel,4.1.0,4.3.0 -System.Reflection,4.1.0,4.3.0 -System.Reflection.DispatchProxy,4.0.1,4.3.0 -System.Reflection.Emit,4.0.1,4.3.0 -System.Reflection.Emit.ILGeneration,4.0.1,4.3.0 -System.Reflection.Emit.Lightweight,4.0.1,4.3.0 -System.Reflection.Extensions,4.0.1,4.3.0 -System.Reflection.Metadata,1.3.0,1.4.1 -System.Reflection.Primitives,4.0.1,4.3.0 -System.Reflection.TypeExtensions,4.1.0,4.3.0 -System.Resources.Reader,4.0.0,4.3.0 -System.Resources.ResourceManager,4.0.1,4.3.0 -System.Runtime,4.1.0,4.3.0 -System.Runtime.Extensions,4.1.0,4.3.0 -System.Runtime.Handles,4.0.1,4.3.0 -System.Runtime.InteropServices,4.1.0,4.3.0 -System.Runtime.InteropServices.RuntimeInformation,4.0.0,4.3.0 -System.Runtime.Loader,4.0.0,4.3.0 -System.Runtime.Numerics,4.0.1,4.3.0 -System.Runtime.Serialization.Primitives,4.1.1,4.3.0 -System.Runtime.Serialization.Xml,4.1.1,4.3.0 -System.Security.Claims,4.0.1,4.3.0 -System.Security.Cryptography.Algorithms,4.2.0,4.3.0 -System.Security.Cryptography.Cng,4.2.0,4.3.0 -System.Security.Cryptography.Csp,4.0.0,4.3.0 -System.Security.Cryptography.Encoding,4.0.0,4.3.0 -System.Security.Cryptography.OpenSsl,4.0.0,4.3.0 -System.Security.Cryptography.Primitives,4.0.0,4.3.0 -System.Security.Cryptography.X509Certificates,4.1.0,4.3.0 -System.Security.Principal,4.0.1,4.3.0 -System.Security.Principal.Windows,4.0.0,4.3.0 -System.ServiceModel.Primitives,4.1.0,4.3.0 -System.Text.Encoding,4.0.11,4.3.0 -System.Text.Encoding.CodePages,4.0.1,4.3.0 -System.Text.Encoding.Extensions,4.0.11,4.3.0 -System.Text.Encodings.Web,4.0.0,4.3.0 -System.Text.RegularExpressions,4.1.0,4.3.0 -System.Threading,4.0.11,4.3.0 -System.Threading.Overlapped,4.0.1,4.3.0 -System.Threading.Tasks,4.0.11,4.3.0 -System.Threading.Tasks.Dataflow,4.6.0,4.7.0 -System.Threading.Tasks.Extensions,4.0.0,4.3.0 -System.Threading.Tasks.Parallel,4.0.1,4.3.0 -System.Threading.Thread,4.0.0,4.3.0 -System.Threading.ThreadPool,4.0.10,4.3.0 -System.Threading.Timer,4.0.1,4.3.0 -System.Xml.ReaderWriter,4.0.11,4.3.0 -System.Xml.XDocument,4.0.11,4.3.0 -System.Xml.XmlDocument,4.0.1,4.3.0 -System.Xml.XmlSerializer,4.0.11,4.3.0 -System.Xml.XPath,4.0.1,4.0.1 -System.Xml.XPath.XDocument,4.0.1,4.0.1 -Microsoft.AspNetCore.ResponseCaching.Abstractions,1.0.1,1.1.1 -Microsoft.Azure.KeyVault,,2.0.2-preview -Microsoft.Azure.KeyVault.WebKey,,2.0.0-preview -Microsoft.Data.Edm,,5.6.4 -Microsoft.Data.OData,,5.6.4 -Microsoft.Data.Services.Client,,5.6.4 -Microsoft.DiaSymReader.Native,,1.4.0 -Microsoft.DotNet.PlatformAbstractions,,1.1.0 -Microsoft.IdentityModel.Clients.ActiveDirectory,,3.13.5 -Microsoft.Rest.ClientRuntime,,2.3.2 -Microsoft.Rest.ClientRuntime.Azure,,3.3.1 -runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl,,4.3.0 -runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl,,4.3.0 -runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl,,4.3.0 -runtime.native.System.Security.Cryptography.Apple,,4.3.0 -runtime.native.System.Security.Cryptography.OpenSsl,,4.3.0 -runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl,,4.3.0 -runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl,,4.3.0 -runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple,,4.3.0 -runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl,,4.3.0 -runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl,,4.3.0 -runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl,,4.3.0 -runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl,,4.3.0 -runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl,,4.3.0 -Serilog,,2.3.0 -Serilog.Extensions.Logging,,1.0.0 -Serilog.Sinks.File,,3.1.0 -Serilog.Sinks.PeriodicBatching,,2.0.0 -Serilog.Sinks.RollingFile,,3.1.0 -StackExchange.Redis.StrongName,,1.1.605 -System.Runtime.CompilerServices.Unsafe,,4.3.0 -System.Runtime.Serialization.Json,,4.0.2 -System.Spatial,,5.6.4 -WindowsAzure.Storage,,7.2.1 \ No newline at end of file diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/sdkdefaults.json b/src/Microsoft.DotNet.ProjectJsonMigration/sdkdefaults.json deleted file mode 100755 index 1cf03a483..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/sdkdefaults.json +++ /dev/null @@ -1,178 +0,0 @@ -{ - "Items": [ - { - "ItemType": "Compile", - "Include": "**\\*.cs", - "Exclude": "bin\\**;obj\\**", - "Remove": null, - "Condition": null, - "ParentCondition": null - }, - { - "ItemType": "EmbeddedResource", - "Include": "**\\*.resx", - "Exclude": "bin\\**;obj\\**", - "Remove": null, - "Condition": null, - "ParentCondition": null - } - ], - "Properties": [ - { - "Name": "OutputType", - "Value": "Library", - "Condition": "", - "ParentCondition": "" - }, - { - "Name": "Configuration", - "Value": "Debug", - "Condition": null, - "ParentCondition": null - }, - { - "Name": "Platform", - "Value": "AnyCPU", - "Condition": "", - "ParentCondition": "" - }, - { - "Name": "FileAlignment", - "Value": "512", - "Condition": "", - "ParentCondition": "" - }, - { - "Name": "PlatformTarget", - "Value": "AnyCPU", - "Condition": "", - "ParentCondition": "" - }, - { - "Name": "ErrorReport", - "Value": "prompt", - "Condition": "", - "ParentCondition": "" - }, - { - "Name": "AssemblyName", - "Value": "$(MSBuildProjectName)", - "Condition": "", - "ParentCondition": "" - }, - { - "Name": "RootNamespace", - "Value": "$(MSBuildProjectName)", - "Condition": "", - "ParentCondition": "" - }, - { - "Name": "Deterministic", - "Value": "true", - "Condition": "", - "ParentCondition": "" - }, - { - "Name": "WarningLevel", - "Value": "4", - "Condition": "", - "ParentCondition": "" - }, - { - "Name": "NoWarn", - "Value": "1701;1702;1705", - "Condition": "", - "ParentCondition": "" - }, - { - "Name": "PackageRequireLicenseAcceptance", - "Value": "false", - "Condition": "", - "ParentCondition": "" - }, - { - "Name": "DebugSymbols", - "Value": "true", - "Condition": "", - "ParentCondition": " '$(Configuration)' == 'Debug' " - }, - { - "Name": "Optimize", - "Value": "false", - "Condition": "", - "ParentCondition": " '$(Configuration)' == 'Debug' " - }, - { - "Name": "OutputPath", - "Value": "bin\\Debug\\", - "Condition": "", - "ParentCondition": " '$(Configuration)' == 'Debug' " - }, - { - "Name": "Optimize", - "Value": "true", - "Condition": "", - "ParentCondition": " '$(Configuration)' == 'Release' " - }, - { - "Name": "OutputPath", - "Value": "bin\\Release\\", - "Condition": "", - "ParentCondition": " '$(Configuration)' == 'Release' " - }, - { - "Name": "DefineConstants", - "Value": "DEBUG;TRACE", - "Condition": "", - "ParentCondition": " '$(Configuration)' == 'Debug' " - }, - { - "Name": "DefineConstants", - "Value": "RELEASE;TRACE", - "Condition": "", - "ParentCondition": " '$(Configuration)' == 'Release' " - }, - { - "Name": "VersionPrefix", - "Value": "1.0.0", - "Condition": null, - "ParentCondition": null - }, - { - "Name": "AssemblyTitle", - "Value": "$(AssemblyName)", - "Condition": null, - "ParentCondition": null - }, - { - "Name": "Product", - "Value": "$(AssemblyName)", - "Condition": null, - "ParentCondition": null - }, - { - "Name": "NeutralLanguage", - "Value": "en", - "Condition": null, - "ParentCondition": null - }, - { - "Name": "AutoUnifyAssemblyReferences", - "Value": "true", - "Condition": null, - "ParentCondition": null - }, - { - "Name": "DesignTimeAutoUnify", - "Value": "true", - "Condition": null, - "ParentCondition": null - }, - { - "Name": "TargetExt", - "Value": ".dll", - "Condition": null, - "ParentCondition": null - } - ] -} \ No newline at end of file diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.cs.xlf b/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index d9308d51d..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - - Detected double project migration: {0} - Byla zjištěna dvojí migrace projektu: {0} - - - - Cannot merge metadata with the same name and different values - Metadata se stejným názvem, ale různými hodnotami nejdou sloučit. - - - - {0}: No xproj file given. - {0}: Soubor xproj není zadaný. - - - - Multiple xproj files found in {0}, please specify which to use - V {0} bylo zjištěno několik souborů xproj. Prosím zadejte, jaký se má použít. - - - - Expected non-null MSBuildProjectTemplate in MigrationSettings - V nastavení MigrationSettings se v šabloně MSBuildProjectTemplate očekává jiná hodnota než null. - - - - Cannot migrate project {0} using compiler {1} - K migraci projektu {0} se nedá použít kompilátor {1}. - - - - Expected element to be of type {0}, but got {1} - Očekávaný prvek by měl mít typ {0}, ale má {1}. - - - - {0} already exists. Has migration already been run? - {0} už existuje. Spustili jste už migraci? - - - - expected destinationElement to not be null - Očekávaný prvek destinationElement nesmí být null. - - - - {0} (line: {1}, file: {2}) - {0} (řádek: {1}, soubor: {2}) - - - - Cannot merge items of different types. - Položky různého typu se nedají sloučit. - - - - Cannot merge items without a common include. - Bez společného zahrnutí se položky nedají sloučit. - - - - Expected element to be of type {0}, but got {1} - Očekávaný prvek by měl mít typ {0}, ale má {1}. - - - - Unexpected type {0} - Nečekaný typ {0} - - - - Deprecated Project - Zastaralý projekt - - - - Project not Restored - Projekt není obnovený - - - - No Project - Žádný projekt - - - - The project.json specifies no target frameworks in {0} - Soubor project.json nemá v {0} specifikované cílové platformy. - - - - Unresolved Dependency - Nevyřešená závislost - - - - Unresolved project dependency ({0}) - Nevyřešená závislost projektu ({0}) - - - - File Overwrite - Přepsání souboru - - - - Unsupported Script Variable - Nepodporovaná proměnná skriptu - - - - {0} is currently an unsupported script variable for project migration - {0} je v současnosti nepodporovaná proměnná skriptu pro migraci projektu - - - - Multiple Xproj Files - Více souborů Xproj - - - - Dependency Project not found - Nenalezen závislý projekt. - - - - Dependency project not found ({0}) - Nenalezen závislý projekt ({0}). - - - - Unsupported Script Event Hook - Nepodporovaný hook události skriptu - - - - {0} is an unsupported script event hook for project migration - {0} je nepodporovaný hook události skriptu pro migraci projektu. - - - - Multi-TFM - Více TFM - - - - Configuration Exclude - Vyloučit konfiguraci - - - - Non-Csharp App - Aplikace není v C# - - - - Files specified under PackOptions - Soubory zadané v části PackOptions - - - - {0}.{1} includes not equivalent. - {0}.{1} zahrne nevyhovující. - - - - {0}.{1} excludes not equivalent. - {0}.{1} vyloučí nevyhovující. - - - - {0}.{1} removes not equivalent. - {0}.{1} odebere nevyhovující. - - - - {0}.{1} metadata doesn't exist {{ {2} {3} }} - {0}.{1} metadata neexistují {{ {2} {3} }} - - - - {0}.{1} metadata has another value {{ {2} {3} {4} }} - {0}.{1} metadata mají jinou hodnotu {{ {2} {3} {4} }} - - - - {0}: Adding metadata to {1} item: {{ {2}, {3}, {4} }} - {0}: Přidání metadat do položky {1}: {{ {2}, {3}, {4} }} - - - - {0}: Skip migrating {1}, it is already migrated. - {0}: Přeskočit migraci {1}, protože už migrace proběhla. - - - - Executing rule: {0} - Provádění pravidla: {0} - - - - {0}: No configuration or framework build options found in project - {0}: V projektu se nenašly možnosti konfigurace nebo sestavení platformy. - - - - Migrating {0} target frameworks - Migrace cílových platforem {0} - - - - Migrating framework {0} - Migrace platformy {0} - - - - {0}: imports transform null for {1} - {0}: importy transformují hodnotu null pro {1} - - - - {0}: Migrating {1} xproj to csproj references - {0}: Migrace {1} odkazů xproj na csproj - - - - {0}: Executing migration rule {1} - {0}: Spuštění pravidla migrace {1} - - - - {0}: Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}: Položka {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - - - - {0}: ItemGroup {{ Condition: {1} }} - {0}: ItemGroup {{ Condition: {1} }} - - - - {0}: Item completely merged - {0}: Plně sloučená položka - - - - {0}: AddItemToItemGroup {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}: AddItemToItemGroup {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - - - - {0}: Merging Item with {1} existing items with a different condition chain. - {0}: Sloučení položky se {1} stávajícími položkami s jiným řetězcem podmínky. - - - - {0}: encompassed includes {1} - {0}: zahrnutých obsahuje {1} - - - - {0}: Removing Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: Odebrání položky {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - - - - {0}: Ignoring Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: Ignorování položky {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - - - - {0}: Merging Item with {1} existing items with the same condition chain. - {0}: Sloučení položky s {1} stávajícími položkami se stejným řetězcem podmínky. - - - - {0}: Adding Merged Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: Přidání sloučené položky {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - - - - Merging property, output merged property - Vlastnost sloučení, vlastnost sloučeného výstupu - - - - Ignoring fully merged property - Úplně se ignoruje sloučená vlastnost - - - - {0}: {1}, {{ Name={2}, Value={3} }} - {0}: {1}, {{ Name={2}, Value={3} }} - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.de.xlf b/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index 3753619b0..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - - Detected double project migration: {0} - Doppelte Projektmigration erkannt: {0} - - - - Cannot merge metadata with the same name and different values - Zusammenführen der Metadaten mit dem gleichen Namen und anderen Werten nicht möglich. - - - - {0}: No xproj file given. - {0}: Keine xproj-Datei angegeben. - - - - Multiple xproj files found in {0}, please specify which to use - Mehrere xproj-Dateien in {0} gefunden; bitte geben Sie an, welche verwendet werden soll. - - - - Expected non-null MSBuildProjectTemplate in MigrationSettings - MSBuildProjectTemplate ungleich NULL in MigrationSettings erwartet. - - - - Cannot migrate project {0} using compiler {1} - Migration von Projekt {0} mit Compiler {1} nicht möglich. - - - - Expected element to be of type {0}, but got {1} - Element des Typs {0} wurde erwartet, aber {1} wurde empfangen. - - - - {0} already exists. Has migration already been run? - "{0}" ist bereits vorhanden. Wurde die Migration bereits ausgeführt? - - - - expected destinationElement to not be null - destinationElement ungleich NULL erwartet. - - - - {0} (line: {1}, file: {2}) - {0} (Zeile: {1}, Datei: {2}) - - - - Cannot merge items of different types. - Zusammenführen von Elementen verschiedenen Typs nicht möglich. - - - - Cannot merge items without a common include. - Zusammenführen von Elementen ohne gemeinsames "Include" nicht möglich. - - - - Expected element to be of type {0}, but got {1} - Element des Typs {0} wurde erwartet, aber {1} wurde empfangen. - - - - Unexpected type {0} - Unerwarteter Typ: {0} - - - - Deprecated Project - Veraltetes Projekt - - - - Project not Restored - Projekt nicht wiederhergestellt - - - - No Project - Kein Projekt - - - - The project.json specifies no target frameworks in {0} - Die "project.json" gibt keine Zielframeworks in {0} an. - - - - Unresolved Dependency - Nicht aufgelöste Abhängigkeit - - - - Unresolved project dependency ({0}) - Nicht aufgelöste Projektabhängigkeit: ({0}) - - - - File Overwrite - Dateiüberschreibung - - - - Unsupported Script Variable - Nicht unterstützte Skriptvariable - - - - {0} is currently an unsupported script variable for project migration - {0} ist eine derzeit nicht unterstützte Skriptvariable für die Projektmigration. - - - - Multiple Xproj Files - Mehrere Xproj-Dateien - - - - Dependency Project not found - Abhängigkeitsprojekt nicht gefunden - - - - Dependency project not found ({0}) - Abhängigkeitsprojekt nicht gefunden ({0}) - - - - Unsupported Script Event Hook - Nicht unterstützter Skriptereignis-Hook - - - - {0} is an unsupported script event hook for project migration - {0} ist ein nicht unterstützter Skriptereignis-Hook für die Projektmigration. - - - - Multi-TFM - Multi-TFM - - - - Configuration Exclude - Konfiguration: Ausschließen - - - - Non-Csharp App - Nicht-CSharp-App - - - - Files specified under PackOptions - Unter PackOptions angegebene Dateien - - - - {0}.{1} includes not equivalent. - {0}.{1} schließt nicht äquivalente Elemente ein. - - - - {0}.{1} excludes not equivalent. - {0}.{1} schließt nicht äquivalente Elemente aus. - - - - {0}.{1} removes not equivalent. - {0}.{1} entfernt nicht äquivalente Elemente. - - - - {0}.{1} metadata doesn't exist {{ {2} {3} }} - {0}.{1}-Metadaten sind nicht vorhanden. {{ {2} {3} }} - - - - {0}.{1} metadata has another value {{ {2} {3} {4} }} - {0}.{1}-Metadaten haben einen anderen Wert. {{ {2} {3} {4} }} - - - - {0}: Adding metadata to {1} item: {{ {2}, {3}, {4} }} - {0}: Metadaten werden {1}-Element hinzugefügt: {{ {2}, {3}, {4} }} - - - - {0}: Skip migrating {1}, it is already migrated. - {0}: Migration von {1} überspringen, da bereits migriert. - - - - Executing rule: {0} - Regel wird ausgeführt: {0} - - - - {0}: No configuration or framework build options found in project - {0}: Keine Konfigurations- oder Frameworkerstellungsoptionen im Projekt gefunden. - - - - Migrating {0} target frameworks - {0} Zielframeworks werden migriert. - - - - Migrating framework {0} - Framework {0} wird migriert. - - - - {0}: imports transform null for {1} - {0}: Importiert "Transform NULL" für {1}. - - - - {0}: Migrating {1} xproj to csproj references - {0}: {1}-xproj-zu-csproj-Verweise werden migriert. - - - - {0}: Executing migration rule {1} - {0}: Migrationsregel {1} wird ausgeführt. - - - - {0}: Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}: Element {{ ItemType: {1}, Bedingung: {2}, Einschließen: {3}, Ausschließen: {4}, Aktualisieren: {5} }} - - - - {0}: ItemGroup {{ Condition: {1} }} - {0}: ItemGroup {{ Bedingung: {1} }} - - - - {0}: Item completely merged - {0}: Element vollständig zusammengeführt - - - - {0}: AddItemToItemGroup {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}: AddItemToItemGroup {{ ItemType: {1}, Bedingung: {2}, Einschließen: {3}, Ausschließen: {4}, Aktualisieren: {5} }} - - - - {0}: Merging Item with {1} existing items with a different condition chain. - {0}: Element wird mit {1} vorhandenen Elementen mit einer anderen Bedingungskette zusammengeführt. - - - - {0}: encompassed includes {1} - {0}: {1} ist im Umfang enthalten. - - - - {0}: Removing Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: Element wird entfernt {{ ItemType: {1}, Bedingung: {2}, Einschließen: {3}, Ausschließen: {4} }} - - - - {0}: Ignoring Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: Element wird ignoriert {{ ItemType: {1}, Bedingung: {2}, Einschließen: {3}, Ausschließen: {4} }} - - - - {0}: Merging Item with {1} existing items with the same condition chain. - {0}: Element wird mit {1} vorhandenen Elementen mit der gleichen Bedingungskette zusammengeführt. - - - - {0}: Adding Merged Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: Zusammengeführtes Element wird hinzugefügt {{ ItemType: {1}, Bedingung: {2}, Einschließen: {3}, Ausschließen: {4} }} - - - - Merging property, output merged property - Eigenschaft wird zusammengeführt; zusammengeführte Eigenschaft wird ausgegeben. - - - - Ignoring fully merged property - Vollständig zusammengeführte Eigenschaft wird ignoriert. - - - - {0}: {1}, {{ Name={2}, Value={3} }} - {0}: {1}, {{ Name={2}, Wert={3} }} - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.es.xlf b/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index 7c1fd5e3c..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - - Detected double project migration: {0} - Se detectó una migración de proyecto doble: {0} - - - - Cannot merge metadata with the same name and different values - No se pueden combinar metadatos con el mismo nombre y valores distintos - - - - {0}: No xproj file given. - {0}: No se proporcionó archivo xproj. - - - - Multiple xproj files found in {0}, please specify which to use - Se encontraron varios archivos xproj en {0}; especifique cuáles se usarán - - - - Expected non-null MSBuildProjectTemplate in MigrationSettings - Se esperaba un valor MSBuildProjectTemplate no nulo en MigrationSettings - - - - Cannot migrate project {0} using compiler {1} - No se puede migrar el proyecto {0} con el compilador {1} - - - - Expected element to be of type {0}, but got {1} - Se esperaba un elemento de tipo {0}, pero se recibió {1} - - - - {0} already exists. Has migration already been run? - '{0}' ya existe. ¿Ya se ejecutó la migración? - - - - expected destinationElement to not be null - Se esperaba que el valor destinationElement no fuese nulo - - - - {0} (line: {1}, file: {2}) - {0} (línea: {1}, archivo: {2}) - - - - Cannot merge items of different types. - No se pueden combinar elementos de tipos distintos. - - - - Cannot merge items without a common include. - No se pueden combinar elementos sin una inclusión común. - - - - Expected element to be of type {0}, but got {1} - Se esperaba un elemento de tipo {0}, pero se recibió {1} - - - - Unexpected type {0} - Tipo {0} inesperado - - - - Deprecated Project - Proyecto en desuso - - - - Project not Restored - Proyecto no restaurado - - - - No Project - No hay proyecto - - - - The project.json specifies no target frameworks in {0} - El archivo project.json no especifica plataformas de destino en {0} - - - - Unresolved Dependency - Dependencia no resuelta - - - - Unresolved project dependency ({0}) - Dependencia de proyecto no resuelta ({0}) - - - - File Overwrite - Sobrescritura de archivo - - - - Unsupported Script Variable - Variable de script no compatible - - - - {0} is currently an unsupported script variable for project migration - {0} actualmente es una variable de script no compatible con la migración de proyecto - - - - Multiple Xproj Files - Varios archivos Xproj - - - - Dependency Project not found - No se encontró proyecto de dependencia - - - - Dependency project not found ({0}) - No se encontró proyecto de dependencia ({0}) - - - - Unsupported Script Event Hook - Enlace de evento de script no compatible - - - - {0} is an unsupported script event hook for project migration - {0} es un enlace de evento de script no compatible con la migración de proyecto - - - - Multi-TFM - Varios TFM - - - - Configuration Exclude - Exclusión de configuración - - - - Non-Csharp App - Aplicación no de Csharp - - - - Files specified under PackOptions - Archivos especificados en PackOptions - - - - {0}.{1} includes not equivalent. - {0}.{1} incluye valores no equivalentes. - - - - {0}.{1} excludes not equivalent. - {0}.{1} excluye valores no equivalentes. - - - - {0}.{1} removes not equivalent. - {0}.{1} quita valores no equivalentes. - - - - {0}.{1} metadata doesn't exist {{ {2} {3} }} - {0}.\Los metadatos {1\} no existen {{ {2} {3} }} - - - - {0}.{1} metadata has another value {{ {2} {3} {4} }} - {0}.\Los metadatos {1\} tienen otro valor {{ {2} {3} {4} }} - - - - {0}: Adding metadata to {1} item: {{ {2}, {3}, {4} }} - {0}: Agregando metadatos al elemento {1}: {{ {2}, {3}, {4} }} - - - - {0}: Skip migrating {1}, it is already migrated. - {0}: Omitir la migración de {1}; ya se migró. - - - - Executing rule: {0} - Ejecutando regla: {0} - - - - {0}: No configuration or framework build options found in project - {0}: No se encontraron opciones de compilación de plataforma ni configuración en el proyecto - - - - Migrating {0} target frameworks - Migrando {0} plataformas de destino - - - - Migrating framework {0} - Migrando plataforma {0} - - - - {0}: imports transform null for {1} - {0}: importa el valor nulo de transformación para {1} - - - - {0}: Migrating {1} xproj to csproj references - {0}: Migrando {1} referencias de xproj a csproj - - - - {0}: Executing migration rule {1} - {0}: Ejecutando regla de migración {1} - - - - {0}: Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}: Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - - - - {0}: ItemGroup {{ Condition: {1} }} - {0}: ItemGroup {{ Condition: {1} }} - - - - {0}: Item completely merged - {0}: El elemento se combinó completamente - - - - {0}: AddItemToItemGroup {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}: AddItemToItemGroup {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - - - - {0}: Merging Item with {1} existing items with a different condition chain. - {0}: Combinando elemento con {1} elementos existentes con una cadena de condiciones distinta. - - - - {0}: encompassed includes {1} - {0}: inclusiones incluidas {1} - - - - {0}: Removing Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: Quitando elemento {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - - - - {0}: Ignoring Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: Omitiendo elemento {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - - - - {0}: Merging Item with {1} existing items with the same condition chain. - {0}: Combinando elemento con {1} elementos existentes con la misma cadena de condiciones. - - - - {0}: Adding Merged Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: Agregando elemento combinado {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - - - - Merging property, output merged property - Propiedad de combinación, propiedad combinada de salida - - - - Ignoring fully merged property - Omitiendo propiedad completamente combinada - - - - {0}: {1}, {{ Name={2}, Value={3} }} - {0}: {1}, {{ Name={2}, Value={3} }} - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.fr.xlf b/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index c780adf0a..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - - Detected double project migration: {0} - Détection d'une migration de projet en double : {0} - - - - Cannot merge metadata with the same name and different values - Impossible de fusionner des métadonnées avec un nom identique et des valeurs distinctes - - - - {0}: No xproj file given. - {0} : Aucun fichier xproj fourni. - - - - Multiple xproj files found in {0}, please specify which to use - Plusieurs fichiers xproj trouvés dans {0}. Spécifiez celui qui doit être utilisé - - - - Expected non-null MSBuildProjectTemplate in MigrationSettings - MSBuildProjectTemplate non null attendu dans MigrationSettings - - - - Cannot migrate project {0} using compiler {1} - Impossible d'effectuer la migration du projet {0} à l'aide du compilateur {1} - - - - Expected element to be of type {0}, but got {1} - L'élément est censé être de type {0}, au lieu de {1} - - - - {0} already exists. Has migration already been run? - {0} existe déjà. La migration a-t-elle déjà été effectuée ? - - - - expected destinationElement to not be null - destinationElement est censé être non null - - - - {0} (line: {1}, file: {2}) - {0} (ligne : {1}, fichier : {2}) - - - - Cannot merge items of different types. - Impossible de fusionner des éléments dont les types sont différents. - - - - Cannot merge items without a common include. - Impossible de fusionner des éléments sans fichier Include commun. - - - - Expected element to be of type {0}, but got {1} - L'élément est censé être de type {0}, au lieu de {1} - - - - Unexpected type {0} - Type inattendu {0} - - - - Deprecated Project - Projet déconseillé - - - - Project not Restored - Projet non restauré - - - - No Project - Aucun projet - - - - The project.json specifies no target frameworks in {0} - Le fichier project.json ne spécifie aucun framework cible dans {0} - - - - Unresolved Dependency - Dépendance non résolue - - - - Unresolved project dependency ({0}) - Dépendance de projet non résolue ({0}) - - - - File Overwrite - Remplacement de fichier - - - - Unsupported Script Variable - Variable de script non prise en charge - - - - {0} is currently an unsupported script variable for project migration - {0} est une variable de script non prise en charge pour la migration de projet - - - - Multiple Xproj Files - Plusieurs fichiers Xproj - - - - Dependency Project not found - Projet de dépendance introuvable - - - - Dependency project not found ({0}) - Projet de dépendance introuvable ({0}) - - - - Unsupported Script Event Hook - Crochet d'événement de script non pris en charge - - - - {0} is an unsupported script event hook for project migration - {0} est un crochet d'événement de script non pris en charge pour la migration de projet - - - - Multi-TFM - TFM multiple - - - - Configuration Exclude - Exclusion de configuration - - - - Non-Csharp App - Application non Csharp - - - - Files specified under PackOptions - Fichiers spécifiés sous PackOptions - - - - {0}.{1} includes not equivalent. - {0}.{1} : inclusions non équivalentes. - - - - {0}.{1} excludes not equivalent. - {0}.{1} : exclusions non équivalentes. - - - - {0}.{1} removes not equivalent. - {0}.{1} : suppressions non équivalentes. - - - - {0}.{1} metadata doesn't exist {{ {2} {3} }} - {0}.{1} : métadonnées inexistantes {{ {2} {3} }} - - - - {0}.{1} metadata has another value {{ {2} {3} {4} }} - {0}.{1} : métadonnées avec une autre valeur {{ {2} {3} {4} }} - - - - {0}: Adding metadata to {1} item: {{ {2}, {3}, {4} }} - {0} : ajout de métadonnées à l'élément {1} : {{ {2}, {3}, {4} }} - - - - {0}: Skip migrating {1}, it is already migrated. - {0} : migration de {1} ignorée, car elle a déjà été effectuée. - - - - Executing rule: {0} - Règle d'exécution : {0} - - - - {0}: No configuration or framework build options found in project - {0} : options de build de configuration ou de framework introuvables dans le projet - - - - Migrating {0} target frameworks - Migration de {0} frameworks cibles - - - - Migrating framework {0} - Migration du framework {0} - - - - {0}: imports transform null for {1} - {0} : importe une valeur null de transformation pour {1} - - - - {0}: Migrating {1} xproj to csproj references - {0} : migration de {1} dépendances xproj vers csproj - - - - {0}: Executing migration rule {1} - {0} : exécution de la règle de migration {1} - - - - {0}: Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0} : élément {{ ItemType : {1}, condition : {2}, inclusion : {3}, exclusion : {4}, mise à jour : {5} }} - - - - {0}: ItemGroup {{ Condition: {1} }} - {0} : ItemGroup {{ condition : {1} }} - - - - {0}: Item completely merged - {0} : élément entièrement fusionné - - - - {0}: AddItemToItemGroup {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0} : AddItemToItemGroup {{ ItemType : {1}, condition : {2}, inclusion : {3}, exclusion : {4}, mise à jour : {5} }} - - - - {0}: Merging Item with {1} existing items with a different condition chain. - {0} : fusion de l'élément avec {1} éléments existants, avec une chaîne de condition différente. - - - - {0}: encompassed includes {1} - {0} : inclusions englobées {1} - - - - {0}: Removing Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0} : suppression de l'élément {{ ItemType : {1}, condition : {2}, inclusion : {3}, exclusion : {4} }} - - - - {0}: Ignoring Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0} : élément ignoré {{ ItemType : {1}, condition : {2}, inclusion : {3}, exclusion : {4} }} - - - - {0}: Merging Item with {1} existing items with the same condition chain. - {0} : fusion de l'élément avec {1} éléments existants, avec la même chaîne de condition. - - - - {0}: Adding Merged Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0} : ajout de l'élément fusionné {{ ItemType : {1}, condition : {2}, inclusion : {3}, exclusion : {4} }} - - - - Merging property, output merged property - Propriété de fusion, propriété fusionnée de sortie - - - - Ignoring fully merged property - Propriété entièrement fusionnée ignorée - - - - {0}: {1}, {{ Name={2}, Value={3} }} - {0} : {1}, {{ Nom={2}, valeur={3} }} - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.it.xlf b/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index 9a87a4f91..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - - Detected double project migration: {0} - È stata rilevata una doppia migrazione del progetto: {0} - - - - Cannot merge metadata with the same name and different values - Non è possibile unire i metadati con lo stesso nome e valori diversi - - - - {0}: No xproj file given. - {0}: il file xproj non è stato specificato. - - - - Multiple xproj files found in {0}, please specify which to use - In {0} sono stati trovati più file xproj. Specificare quello da usare - - - - Expected non-null MSBuildProjectTemplate in MigrationSettings - In MigrationSettings è previsto un elemento MSBuildProjectTemplate non Null - - - - Cannot migrate project {0} using compiler {1} - Non è possibile eseguire la migrazione del progetto {0} con il compilatore {1} - - - - Expected element to be of type {0}, but got {1} - L'elemento doveva essere di tipo {0}, ma è stato ottenuto {1} - - - - {0} already exists. Has migration already been run? - {0} esiste già. La migrazione è già stata eseguita? - - - - expected destinationElement to not be null - l'elemento destinationElement non deve essere Null - - - - {0} (line: {1}, file: {2}) - {0} (riga: {1}, file: {2}) - - - - Cannot merge items of different types. - Non è possibile unire elementi di tipi diversi. - - - - Cannot merge items without a common include. - Non è possibile unire elementi senza un elemento include comune. - - - - Expected element to be of type {0}, but got {1} - L'elemento doveva essere di tipo {0}, ma è stato ottenuto {1} - - - - Unexpected type {0} - Tipo imprevisto: {0} - - - - Deprecated Project - Progetto deprecato - - - - Project not Restored - Progetto non ripristinato - - - - No Project - Nessun progetto - - - - The project.json specifies no target frameworks in {0} - Il file project.json non specifica alcun framework di destinazione in {0} - - - - Unresolved Dependency - Dipendenza non risolta - - - - Unresolved project dependency ({0}) - Dipendenza del progetto non risolta ({0}) - - - - File Overwrite - Sovrascrittura file - - - - Unsupported Script Variable - Variabile script non supportata - - - - {0} is currently an unsupported script variable for project migration - {0} è attualmente una variabile script non supportata per la migrazione del progetto - - - - Multiple Xproj Files - Più file xproj - - - - Dependency Project not found - Progetto della dipendenza non trovato - - - - Dependency project not found ({0}) - Progetto della dipendenza non trovato ({0}) - - - - Unsupported Script Event Hook - Hook di evento script non supportato - - - - {0} is an unsupported script event hook for project migration - {0} è un hook di evento script non supportato per la migrazione del progetto - - - - Multi-TFM - TFM multiplo - - - - Configuration Exclude - Esclusione configurazione - - - - Non-Csharp App - App non Csharp - - - - Files specified under PackOptions - File specificati in PackOptions - - - - {0}.{1} includes not equivalent. - {0}.{1} include elementi non equivalenti. - - - - {0}.{1} excludes not equivalent. - {0}.{1} esclude elementi non equivalenti. - - - - {0}.{1} removes not equivalent. - {0}.{1} rimuove elementi non equivalenti. - - - - {0}.{1} metadata doesn't exist {{ {2} {3} }} - I metadati di {0}.{1} non esistono {{ {2} {3} }} - - - - {0}.{1} metadata has another value {{ {2} {3} {4} }} - Il valore dei metadati di {0}.{1} è diverso {{ {2} {3} {4} }} - - - - {0}: Adding metadata to {1} item: {{ {2}, {3}, {4} }} - {0}: aggiunta di metadati all'elemento {1}: {{ {2}, {3}, {4} }} - - - - {0}: Skip migrating {1}, it is already migrated. - {0}: la migrazione di {1} verrà ignorata perché è già stata eseguita. - - - - Executing rule: {0} - Esecuzione della regola: {0} - - - - {0}: No configuration or framework build options found in project - {0}: nel progetto non sono state trovate opzioni di configurazione o creazione del framework - - - - Migrating {0} target frameworks - Migrazione di {0} framework di destinazione - - - - Migrating framework {0} - Migrazione del framework {0} - - - - {0}: imports transform null for {1} - {0}: importa il valore Null della trasformazione per {1} - - - - {0}: Migrating {1} xproj to csproj references - {0}: migrazione di {1} riferimenti da xproj a csproj - - - - {0}: Executing migration rule {1} - {0}: esecuzione della regola di migrazione {1} - - - - {0}: Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}: elemento {{ Tipo di elemento: {1}. Condizione: {2}. Includi: {3}. Escludi: {4}. Aggiorna: {5} }} - - - - {0}: ItemGroup {{ Condition: {1} }} - {0}: ItemGroup {{ Condizione: {1} }} - - - - {0}: Item completely merged - {0}: elemento completamente unito - - - - {0}: AddItemToItemGroup {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}: AddItemToItemGroup {{ Tipo di elemento: {1}. Condizione: {2}. Includi: {3}. Escludi: {4}. Aggiorna: {5} }} - - - - {0}: Merging Item with {1} existing items with a different condition chain. - {0}: unione dell'elemento con {1} elementi esistenti e una catena di condizioni diversa. - - - - {0}: encompassed includes {1} - {0}: incluso include {1} - - - - {0}: Removing Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: rimozione dell'elemento {{ Tipo di elemento: {1}. Condizione: {2}. Includi: {3}. Escludi: {4} }} - - - - {0}: Ignoring Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: elemento ignorato {{ Tipo di elemento: {1}. Condizione: {2}. Includi: {3}. Escludi: {4} }} - - - - {0}: Merging Item with {1} existing items with the same condition chain. - {0}: unione dell'elemento con {1} elementi esistenti e la stessa catena di condizioni. - - - - {0}: Adding Merged Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: aggiunta dell'elemento unito {{ Tipo di elemento: {1}. Condizione: {2}. Includi: {3}. Escludi: {4} }} - - - - Merging property, output merged property - Unione della proprietà. Proprietà unita di output - - - - Ignoring fully merged property - La proprietà completamente unita verrà ignorata - - - - {0}: {1}, {{ Name={2}, Value={3} }} - {0}: {1}, {{ Nome={2}. Valore={3} }} - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.ja.xlf b/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index a7073fe9a..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - - Detected double project migration: {0} - ダブル プロジェクト移行が検出されました: {0} - - - - Cannot merge metadata with the same name and different values - 名前が同じで値が異なるメタデータをマージすることはできません - - - - {0}: No xproj file given. - {0}:xproj ファイルが指定されていません。 - - - - Multiple xproj files found in {0}, please specify which to use - 複数の xproj ファイルが {0} に見つかりました。使用するファイルを指定してください - - - - Expected non-null MSBuildProjectTemplate in MigrationSettings - MigrationSettings に null 以外の MSBuildProjectTemplate が必要です - - - - Cannot migrate project {0} using compiler {1} - コンパイラ {1} を使用してプロジェクト {0} を移行できません - - - - Expected element to be of type {0}, but got {1} - 型 {0} の要素が必要でしたが、{1} を取得しました - - - - {0} already exists. Has migration already been run? - '{0}' は既に存在します。既に移行を実行しましたか? - - - - expected destinationElement to not be null - destinationElement は null でないことが必要です - - - - {0} (line: {1}, file: {2}) - {0} (行: {1}、ファイル: {2}) - - - - Cannot merge items of different types. - 異なる種類のアイテムをマージすることはできません。 - - - - Cannot merge items without a common include. - 共通インクルードなしでアイテムをマージすることはできません。 - - - - Expected element to be of type {0}, but got {1} - 型 {0} の要素が必要でしたが、{1} を取得しました - - - - Unexpected type {0} - 予期しない型 {0} - - - - Deprecated Project - 使用されていないプロジェクト - - - - Project not Restored - 復元されなかったプロジェクト - - - - No Project - プロジェクトなし - - - - The project.json specifies no target frameworks in {0} - project.json が、{0} でターゲット フレームワークを指定していません - - - - Unresolved Dependency - 未解決の依存関係 - - - - Unresolved project dependency ({0}) - 未解決のプロジェクト依存関係 ({0}) - - - - File Overwrite - ファイルの上書き - - - - Unsupported Script Variable - サポートされていないスクリプト変数 - - - - {0} is currently an unsupported script variable for project migration - {0} は現在、プロジェクト移行ではサポートされていないスクリプト変数です - - - - Multiple Xproj Files - 複数の Xproj ファイル - - - - Dependency Project not found - 依存関係プロジェクトが見つかりません - - - - Dependency project not found ({0}) - 依存関係プロジェクトが見つかりません ({0}) - - - - Unsupported Script Event Hook - サポートされていないスクリプト イベント フック - - - - {0} is an unsupported script event hook for project migration - {0} は、プロジェクト移行ではサポートされていないスクリプト イベント フックです - - - - Multi-TFM - マルチ TFM - - - - Configuration Exclude - 構成の除外 - - - - Non-Csharp App - Csharp 以外のアプリ - - - - Files specified under PackOptions - PackOptions で指定されたファイル - - - - {0}.{1} includes not equivalent. - {0}.{1} は、等しくない値を含みます。 - - - - {0}.{1} excludes not equivalent. - {0}.{1} は、等しくない値を除外します。 - - - - {0}.{1} removes not equivalent. - {0}.{1} は、等しくない値を削除します。 - - - - {0}.{1} metadata doesn't exist {{ {2} {3} }} - {0}.{1} メタデータは存在しません: {{ {2} {3} }} - - - - {0}.{1} metadata has another value {{ {2} {3} {4} }} - {0}.{1} メタデータに別の値が含まれています: {{ {2} {3} {4} }} - - - - {0}: Adding metadata to {1} item: {{ {2}, {3}, {4} }} - {0}:メタデータを {1} アイテムに追加しています: {{ {2}, {3}, {4} }} - - - - {0}: Skip migrating {1}, it is already migrated. - {0}:{1} の移行をスキップします。既に移行されています。 - - - - Executing rule: {0} - ルールを実行しています: {0} - - - - {0}: No configuration or framework build options found in project - {0}:プロジェクトに構成またはフレームワーク ビルド オプションが見つかりません - - - - Migrating {0} target frameworks - {0} ターゲット フレームワークを移行しています - - - - Migrating framework {0} - フレームワーク {0} を移行しています - - - - {0}: imports transform null for {1} - {0}: {1} の null 変換をインポートします - - - - {0}: Migrating {1} xproj to csproj references - {0}:{1} xproj を csproj 参照に移行しています - - - - {0}: Executing migration rule {1} - {0}:移行ルール {1} を実行しています - - - - {0}: Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}:アイテム {{アイテムの種類: {1}、条件: {2}、含有: {3}、除外: {4}、更新: {5} }} - - - - {0}: ItemGroup {{ Condition: {1} }} - {0}:ItemGroup {{ 条件: {1} }} - - - - {0}: Item completely merged - {0}:アイテムが完全にマージされました - - - - {0}: AddItemToItemGroup {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}:AddItemToItemGroup {{アイテムの種類: {1}、条件: {2}、含有: {3}、除外: {4}、更新: {5} }} - - - - {0}: Merging Item with {1} existing items with a different condition chain. - {0}:別の条件チェーンで、アイテムを \ {1 \} 個の既存のアイテムとマージしています。 - - - - {0}: encompassed includes {1} - {0}: 包含には {1} が含まれます - - - - {0}: Removing Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}:アイテムを削除しています {{アイテムの種類: {1}、条件: {2}、含有: {3}、除外: {4} }} - - - - {0}: Ignoring Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}:アイテムを無視しています {{アイテムの種類: {1}、条件: {2}、含有: {3}、除外: {4} }} - - - - {0}: Merging Item with {1} existing items with the same condition chain. - {0}:同じ条件チェーンで、アイテムを \ {1 \} 個の既存のアイテムとマージしています。 - - - - {0}: Adding Merged Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}:マージしたアイテムを追加しています {{アイテムの種類: {1}、条件: {2}、含有: {3}、除外: {4} }} - - - - Merging property, output merged property - プロパティ、出力マージ プロパティをマージしています - - - - Ignoring fully merged property - 完全にマージしたプロパティを無視しています - - - - {0}: {1}, {{ Name={2}, Value={3} }} - {0}: {1}、{{ Name={2}, Value={3} }} - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.ko.xlf b/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index 8b724fdda..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - - Detected double project migration: {0} - 이중 프로젝트 마이그레이션이 검색됨: {0} - - - - Cannot merge metadata with the same name and different values - 동일한 이름의 값이 서로 다른 메타데이터를 병합할 수 없습니다. - - - - {0}: No xproj file given. - {0}: 지정된 xproj 파일이 없습니다. - - - - Multiple xproj files found in {0}, please specify which to use - {0}에 여러 xproj 파일이 있습니다. 사용할 파일을 지정하세요. - - - - Expected non-null MSBuildProjectTemplate in MigrationSettings - MigrationSettings에 Null이 아닌 MSBuildProjectTemplate 필요 - - - - Cannot migrate project {0} using compiler {1} - {1} 컴파일러를 사용하여 {0} 프로젝트를 마이그레이션할 수 없습니다. - - - - Expected element to be of type {0}, but got {1} - {0} 형식의 요소가 필요하지만 {1}을(를) 받았습니다. - - - - {0} already exists. Has migration already been run? - {0}은(는) 이미 있습니다. 마이그레이션이 이미 실행되었나요? - - - - expected destinationElement to not be null - destinationElement는 null이 아니어야 함 - - - - {0} (line: {1}, file: {2}) - {0}(줄: {1}, 파일: {2}) - - - - Cannot merge items of different types. - 서로 다른 유형의 항목을 병합할 수 없습니다. - - - - Cannot merge items without a common include. - 공통된 포함 요소가 없는 항목을 병합할 수 없습니다. - - - - Expected element to be of type {0}, but got {1} - {0} 형식의 요소가 필요하지만 {1}을(를) 받았습니다. - - - - Unexpected type {0} - 예기치 않은 유형 {0} - - - - Deprecated Project - 사용되지 않는 프로젝트 - - - - Project not Restored - 프로젝트가 복원되지 않음 - - - - No Project - 프로젝트 없음 - - - - The project.json specifies no target frameworks in {0} - project.json이 {0}에서 대상 프레임워크를 지정하지 않습니다. - - - - Unresolved Dependency - 확인되지 않은 종속성 - - - - Unresolved project dependency ({0}) - 확인되지 않은 프로젝트 종속성({0}) - - - - File Overwrite - 파일 덮어쓰기 - - - - Unsupported Script Variable - 지원되지 않는 스크립트 변수 - - - - {0} is currently an unsupported script variable for project migration - {0}은(는) 현재 프로젝트 마이그레이션에서 지원되지 않는 스크립트 변수입니다. - - - - Multiple Xproj Files - 여러 Xproj 파일 - - - - Dependency Project not found - 종속성 프로젝트를 찾을 수 없음 - - - - Dependency project not found ({0}) - 종속성 프로젝트를 찾을 수 없음({0}) - - - - Unsupported Script Event Hook - 지원되지 않는 스크립트 이벤트 후크 - - - - {0} is an unsupported script event hook for project migration - {0}은(는) 현재 프로젝트 마이그레이션에서 지원되지 않는 스크립트 이벤트 후크입니다. - - - - Multi-TFM - 다중 TFM - - - - Configuration Exclude - 구성 제외 - - - - Non-Csharp App - 비 Csharp 앱 - - - - Files specified under PackOptions - PackOptions에서 지정된 파일 - - - - {0}.{1} includes not equivalent. - {0}.{1}은(는) 비동일 항목을 포함합니다. - - - - {0}.{1} excludes not equivalent. - {0}.{1}은(는) 비동일 항목을 제외합니다. - - - - {0}.{1} removes not equivalent. - {0}.{1}은(는) 같지 않은 항목을 제거합니다. - - - - {0}.{1} metadata doesn't exist {{ {2} {3} }} - {0}.{1} 메타데이터가 없습니다. {{ {2} {3} }} - - - - {0}.{1} metadata has another value {{ {2} {3} {4} }} - {0}.{1} 메타데이터가 또 다른 값을 가지고 있습니다. {{ {2} {3} {4} }} - - - - {0}: Adding metadata to {1} item: {{ {2}, {3}, {4} }} - {0}: 메타데이터를 {1} 항목에 추가: {{ {2}, {3}, {4} }} - - - - {0}: Skip migrating {1}, it is already migrated. - {0}: {1}의 마이그레이션을 건너뜁니다. 이미 마이그레이션되었습니다. - - - - Executing rule: {0} - 규칙 실행 중: {0} - - - - {0}: No configuration or framework build options found in project - {0}: 프로젝트에 구성 또는 프레임워크 빌드 옵션이 없음 - - - - Migrating {0} target frameworks - {0} 대상 프레임워크 마이그레이션 중 - - - - Migrating framework {0} - {0} 프레임워크 마이그레이션 중 - - - - {0}: imports transform null for {1} - {0}: {1}용 변환 null 가져오기 - - - - {0}: Migrating {1} xproj to csproj references - {0}: {1} xproj를 csproj 참조로 마이그레이션 중 - - - - {0}: Executing migration rule {1} - {0}: {1} 마이그레이션 규칙 실행 중 - - - - {0}: Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}: 항목 {{ 항목 형식: {1}, 조건: {2}, 포함: {3}, 제외: {4}, 업데이트: {5} }} - - - - {0}: ItemGroup {{ Condition: {1} }} - {0}: ItemGroup {{ 조건: {1} }} - - - - {0}: Item completely merged - {0}: 항목이 완전히 병합됨 - - - - {0}: AddItemToItemGroup {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}: AddItemToItemGroup {{ 항목 형식: {1}, 조건: {2}, 포함: {3}, 제외: {4}, 업데이트: {5} }} - - - - {0}: Merging Item with {1} existing items with a different condition chain. - {0}: 항목을 조건 체인이 다른 {1}개의 기존 항목과 병합합니다. - - - - {0}: encompassed includes {1} - {0}: 포함된 항목에 {1} 포함 - - - - {0}: Removing Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: 항목 제거 {{ 항목 형식: {1}, 조건: {2}, 포함: {3}, 제외: {4} }} - - - - {0}: Ignoring Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: 항목 무시 {{ 항목 형식: {1}, 조건: {2}, 포함: {3}, 제외: {4} }} - - - - {0}: Merging Item with {1} existing items with the same condition chain. - {0}: {1}개 기존 항목이 있는 항목을 동일한 조건 체인과 병합합니다. - - - - {0}: Adding Merged Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: 병합된 항목 추가 {{ 항목 형식: {1}, 조건: {2}, 포함: {3}, 제외: {4} }} - - - - Merging property, output merged property - 속성 병합 중, 병합된 속성 출력 - - - - Ignoring fully merged property - 완전히 병합된 속성 무시 - - - - {0}: {1}, {{ Name={2}, Value={3} }} - {0}: {1}, {{ 이름={2}, 값={3} }} - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.pl.xlf b/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index f637bb20f..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - - Detected double project migration: {0} - Wykryto podwójną migrację projektu: {0} - - - - Cannot merge metadata with the same name and different values - Nie można scalić metadanych o tej samej nazwie i różnych wartościach - - - - {0}: No xproj file given. - {0}: Nie podano pliku xproj. - - - - Multiple xproj files found in {0}, please specify which to use - Znaleziono wiele plików xproj w lokalizacji {0} — określ, który ma zostać użyty - - - - Expected non-null MSBuildProjectTemplate in MigrationSettings - W ustawieniach MigrationSettings oczekiwano szablonu MSBuildProjectTemplate o wartości innej niż null - - - - Cannot migrate project {0} using compiler {1} - Nie można zmigrować projektu {0} przy użyciu kompilatora {1} - - - - Expected element to be of type {0}, but got {1} - Oczekiwano elementu typu {0}, ale otrzymano typ {1} - - - - {0} already exists. Has migration already been run? - Element {0} już istnieje. Czy migracja została już uruchomiona? - - - - expected destinationElement to not be null - oczekiwano elementu destinationElement niemającego wartości null - - - - {0} (line: {1}, file: {2}) - Element {0} (wiersz: {1}, plik: {2}) - - - - Cannot merge items of different types. - Nie można scalić elementów różnych typów. - - - - Cannot merge items without a common include. - Nie można scalić elementów niemających wspólnej wartości elementu Include. - - - - Expected element to be of type {0}, but got {1} - Oczekiwano elementu typu {0}, ale otrzymano typ {1} - - - - Unexpected type {0} - Nieoczekiwany typ {0} - - - - Deprecated Project - Przestarzały projekt - - - - Project not Restored - Projekt nie został przywrócony - - - - No Project - Brak projektu - - - - The project.json specifies no target frameworks in {0} - W pliku project.json nie określono żadnych platform docelowych w lokalizacji {0} - - - - Unresolved Dependency - Nierozpoznana zależność - - - - Unresolved project dependency ({0}) - Nierozpoznana zależność projektu ({0}) - - - - File Overwrite - Zastąpienie pliku - - - - Unsupported Script Variable - Nieobsługiwana zmienna skryptu - - - - {0} is currently an unsupported script variable for project migration - {0} to zmienna skryptu, która nie jest obecnie obsługiwana na potrzeby migracji projektu - - - - Multiple Xproj Files - Wiele plików xproj - - - - Dependency Project not found - Nie odnaleziono projektu zależności - - - - Dependency project not found ({0}) - Nie odnaleziono projektu zależności ({0}) - - - - Unsupported Script Event Hook - Nieobsługiwany punkt zaczepienia zdarzenia skryptu - - - - {0} is an unsupported script event hook for project migration - {0} to punkt zaczepienia zdarzenia skryptu, który nie jest obsługiwany na potrzeby migracji projektu - - - - Multi-TFM - Wiele krótkich nazw platformy docelowej - - - - Configuration Exclude - Konfiguracja — wykluczanie - - - - Non-Csharp App - Aplikacja w języku innym niż C# - - - - Files specified under PackOptions - Pliki określone w opcjach PackOptions - - - - {0}.{1} includes not equivalent. - Element {0}.{1} dołącza elementy nierównoważne. - - - - {0}.{1} excludes not equivalent. - Element {0}.{1} wyklucza elementy nierównoważne. - - - - {0}.{1} removes not equivalent. - Element {0}.{1} usuwa elementy nierównoważne. - - - - {0}.{1} metadata doesn't exist {{ {2} {3} }} - Metadane {0}.{1} nie istnieją {{ {2} {3} }} - - - - {0}.{1} metadata has another value {{ {2} {3} {4} }} - Metadane {0}.{1} mają inną wartość {{ {2} {3} {4} }} - - - - {0}: Adding metadata to {1} item: {{ {2}, {3}, {4} }} - {0}: Dodawanie metadanych do elementu {1}: {{ {2}, {3}, {4} }} - - - - {0}: Skip migrating {1}, it is already migrated. - {0}: Pomiń migrowanie elementu {1} — jest już zmigrowany. - - - - Executing rule: {0} - Wykonywanie reguły: {0} - - - - {0}: No configuration or framework build options found in project - {0}: Nie znaleziono konfiguracji lub opcji kompilacji platformy w projekcie - - - - Migrating {0} target frameworks - Migrowanie {0} platform docelowych - - - - Migrating framework {0} - Migrowanie platformy {0} - - - - {0}: imports transform null for {1} - {0}: Importy przekształcają wartość null na {1} - - - - {0}: Migrating {1} xproj to csproj references - {0}: Migrowanie pliku xproj {1} do odwołań projektu csproj - - - - {0}: Executing migration rule {1} - {0}: Wykonywanie reguły migracji {1} - - - - {0}: Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}: Element {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - - - - {0}: ItemGroup {{ Condition: {1} }} - {0}: Element ItemGroup {{ Condition: {1} }} - - - - {0}: Item completely merged - {0}: Element został w pełni scalony - - - - {0}: AddItemToItemGroup {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}: Element AddItemToItemGroup {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - - - - {0}: Merging Item with {1} existing items with a different condition chain. - {0}: Scalanie elementu z {1} istniejącymi elementami z zastosowaniem innego łańcucha warunków. - - - - {0}: encompassed includes {1} - {0}: Ujęty element zawiera element {1} - - - - {0}: Removing Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: Usuwanie elementu {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - - - - {0}: Ignoring Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: Ignorowanie elementu {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - - - - {0}: Merging Item with {1} existing items with the same condition chain. - {0}: Scalanie elementu z {1} istniejącymi elementami z zastosowaniem tego samego łańcucha warunków. - - - - {0}: Adding Merged Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: Dodawanie scalonego elementu {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - - - - Merging property, output merged property - Scalanie właściwości, wyprowadź scaloną właściwość - - - - Ignoring fully merged property - Ignorowanie w pełni scalonej właściwości - - - - {0}: {1}, {{ Name={2}, Value={3} }} - {0}: Element {1}, {{ Name={2}, Value={3} }} - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.pt-BR.xlf b/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index 1edfba4aa..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - - Detected double project migration: {0} - Detecção de migração dupla de projeto: {0} - - - - Cannot merge metadata with the same name and different values - Não é possível mesclar metadados com o mesmo nome e valores diferentes - - - - {0}: No xproj file given. - {0}: Nenhum arquivo xproj fornecido. - - - - Multiple xproj files found in {0}, please specify which to use - Vários arquivos xproj encontrados em {0}. Especifique qual deles deve ser usado - - - - Expected non-null MSBuildProjectTemplate in MigrationSettings - MSBuildProjectTemplate não nulo esperado em MigrationSettings - - - - Cannot migrate project {0} using compiler {1} - Não é possível migrar o projeto {0} usando o compilador {1} - - - - Expected element to be of type {0}, but got {1} - Esperado elemento do tipo {0}, mas {1} foi obtido - - - - {0} already exists. Has migration already been run? - O {0} já existe. A migração já foi executada? - - - - expected destinationElement to not be null - esperado destinationElement não nulo - - - - {0} (line: {1}, file: {2}) - {0} (linha: {1}, arquivo: {2}) - - - - Cannot merge items of different types. - Não é possível mesclar itens de tipos diferentes. - - - - Cannot merge items without a common include. - Não é possível mesclar itens sem uma inclusão comum. - - - - Expected element to be of type {0}, but got {1} - Esperado elemento do tipo {0}, mas {1} foi obtido - - - - Unexpected type {0} - Tipo inesperado {0} - - - - Deprecated Project - Projeto Preterido - - - - Project not Restored - Projeto não Restaurado - - - - No Project - Nenhum projeto - - - - The project.json specifies no target frameworks in {0} - O project.json não especifica nenhuma estrutura de destino em {0} - - - - Unresolved Dependency - Dependência Não Resolvida - - - - Unresolved project dependency ({0}) - Dependência de projeto não resolvida ({0}) - - - - File Overwrite - Substituição de Arquivo - - - - Unsupported Script Variable - Variável de Script Sem Suporte - - - - {0} is currently an unsupported script variable for project migration - Atualmente, {0} é uma variável de script sem suporte para migração de projeto - - - - Multiple Xproj Files - Vários Arquivos Xproj - - - - Dependency Project not found - Projeto de Dependência não encontrado - - - - Dependency project not found ({0}) - Projeto de dependência não encontrado ({0}) - - - - Unsupported Script Event Hook - Gancho de Evento de Script Sem Suporte - - - - {0} is an unsupported script event hook for project migration - {0} é um gancho de evento de script sem suporte para a migração de um projeto - - - - Multi-TFM - Múltiplo TFM - - - - Configuration Exclude - Exclusão de Configuração - - - - Non-Csharp App - Aplicativo não Csharp - - - - Files specified under PackOptions - Arquivos especificados em PackOptions - - - - {0}.{1} includes not equivalent. - {0}.{1} inclui não equivalente. - - - - {0}.{1} excludes not equivalent. - {0}.{1} exclui não equivalente. - - - - {0}.{1} removes not equivalent. - {0}.{1} remove não equivalente. - - - - {0}.{1} metadata doesn't exist {{ {2} {3} }} - {0}.{1} os metadados não existem {{ {2} {3} }} - - - - {0}.{1} metadata has another value {{ {2} {3} {4} }} - {0}.{1} os metadados têm outro valor {{ {2} {3} {4} }} - - - - {0}: Adding metadata to {1} item: {{ {2}, {3}, {4} }} - {0}: Adicionando os metadados ao item {1}: {{ {2}, {3}, {4} }} - - - - {0}: Skip migrating {1}, it is already migrated. - {0}: Ignorar a migração de {1}; ele já foi migrado. - - - - Executing rule: {0} - Executando regra: {0} - - - - {0}: No configuration or framework build options found in project - {0}: Nenhuma opção de build de estrutura ou configuração encontrada no projeto - - - - Migrating {0} target frameworks - Migrando estruturas de destino {0} - - - - Migrating framework {0} - Migrando estrutura {0} - - - - {0}: imports transform null for {1} - {0}: transformação de importação nula para {1} - - - - {0}: Migrating {1} xproj to csproj references - {0}: Migrando {1} xproj para referências de csproj - - - - {0}: Executing migration rule {1} - {0}: Executando regra de migração {1} - - - - {0}: Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}: Item {{ ItemType: {1}, Condição: {2}, Incluir: {3}, Excluir: {4}, Atualizar: {5} }} - - - - {0}: ItemGroup {{ Condition: {1} }} - {0}: ItemGroup {{ Condição: {1} }} - - - - {0}: Item completely merged - {0}: Item totalmente mesclado - - - - {0}: AddItemToItemGroup {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}: AddItemToItemGroup {{ ItemType: {1}, Condição: {2}, Incluir: {3}, Excluir: {4}, Atualizar: {5} }} - - - - {0}: Merging Item with {1} existing items with a different condition chain. - {0}: Mesclando item com os itens existentes {1} e com uma cadeia de condição diferente. - - - - {0}: encompassed includes {1} - {0}: abrangido inclui {1} - - - - {0}: Removing Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: Removendo Item {{ ItemType: {1}, Condição {2\}, Incluir: {3}, Excluir: {4} }} - - - - {0}: Ignoring Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: Ignorando Item {{ ItemType: {1}, Condição {2\}, Incluir: {3}, Excluir: {4} }} - - - - {0}: Merging Item with {1} existing items with the same condition chain. - {0}: Mesclando item com os itens existentes {1} e com a mesma cadeia de condição. - - - - {0}: Adding Merged Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: Adicionando Item Mesclado {{ ItemType: {1}, Condição {2\}, Incluir: {3}, Excluir: {4} }} - - - - Merging property, output merged property - Mesclando propriedade, propriedade mesclada de saída - - - - Ignoring fully merged property - Ignorando propriedade totalmente mesclada - - - - {0}: {1}, {{ Name={2}, Value={3} }} - {0}: {1}, {{ Name={2}, Value={3} }} - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.ru.xlf b/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index 5837613e1..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - - Detected double project migration: {0} - Обнаружен двойной перенос проекта: {0}. - - - - Cannot merge metadata with the same name and different values - Не удается объединить метаданные с одинаковым именем и разными значениями. - - - - {0}: No xproj file given. - {0}: {0}: не указан XPROJ-файл. - - - - Multiple xproj files found in {0}, please specify which to use - В {0} найдено несколько XPROJ-файлов, выберите один из них. - - - - Expected non-null MSBuildProjectTemplate in MigrationSettings - Ожидается отличное от NULL значение MSBuildProjectTemplate в MigrationSettings. - - - - Cannot migrate project {0} using compiler {1} - Не удается перенести проект {0} с помощью компилятора {1}. - - - - Expected element to be of type {0}, but got {1} - Ожидался элемент типа {0}, но получен {1}. - - - - {0} already exists. Has migration already been run? - {0} уже существует. Миграция уже выполнялась? - - - - expected destinationElement to not be null - Ожидается отличное от NULL значение destinationElement - - - - {0} (line: {1}, file: {2}) - {0} (строка: {1}, файл: {2}) - - - - Cannot merge items of different types. - Не удается объединить элементы с разными типами. - - - - Cannot merge items without a common include. - Не удается объединить элементы без общего включения. - - - - Expected element to be of type {0}, but got {1} - Ожидался элемент типа {0}, но получен {1}. - - - - Unexpected type {0} - Неожиданный тип {0} - - - - Deprecated Project - Нерекомендуемый проект - - - - Project not Restored - Проект не восстановлен. - - - - No Project - Нет проекта. - - - - The project.json specifies no target frameworks in {0} - Файл project.json не указывает целевые платформы в {0}. - - - - Unresolved Dependency - Неразрешенная зависимость - - - - Unresolved project dependency ({0}) - Неразрешенная зависимость проекта ({0}) - - - - File Overwrite - Перезапись файла - - - - Unsupported Script Variable - Неподдерживаемая переменная скрипта - - - - {0} is currently an unsupported script variable for project migration - {0} сейчас является неподдерживаемой переменной скрипта для переноса проекта. - - - - Multiple Xproj Files - Несколько файлов XPROJ - - - - Dependency Project not found - Проект зависимости не найден. - - - - Dependency project not found ({0}) - Проект зависимости не найден ({0}). - - - - Unsupported Script Event Hook - Неподдерживаемый перехватчик события скрипта - - - - {0} is an unsupported script event hook for project migration - {0} является неподдерживаемым перехватчиком события скрипта для переноса проекта. - - - - Multi-TFM - Multi-TFM - - - - Configuration Exclude - Исключение конфигурации - - - - Non-Csharp App - Приложение, отличное от Csharp - - - - Files specified under PackOptions - Файлы, указанные в PackOptions - - - - {0}.{1} includes not equivalent. - {0}.{1} включает "не эквивалентно". - - - - {0}.{1} excludes not equivalent. - {0}.{1} исключает "не эквивалентно". - - - - {0}.{1} removes not equivalent. - {0}.{1} удаляет "не эквивалентно". - - - - {0}.{1} metadata doesn't exist {{ {2} {3} }} - Метаданные {0}.{1} не существуют {{ {2} {3} }} - - - - {0}.{1} metadata has another value {{ {2} {3} {4} }} - Метаданные {0}.{1} имеют другое значение {{ {2} {3} {4} }} - - - - {0}: Adding metadata to {1} item: {{ {2}, {3}, {4} }} - {0}: добавление метаданных в элемент {1}: {{ {2}, {3}, {4} }} - - - - {0}: Skip migrating {1}, it is already migrated. - {0}: пропуск миграции {1}, этот объект уже перенесен. - - - - Executing rule: {0} - Выполнение правила: {0} - - - - {0}: No configuration or framework build options found in project - {0}: в проекте не найдены параметры сборки для платформы или конфигурации. - - - - Migrating {0} target frameworks - Перенос целевых платформ: {0} - - - - Migrating framework {0} - Перенос платформы: {0} - - - - {0}: imports transform null for {1} - {0}: импорты преобразуют значение NULL для {1} - - - - {0}: Migrating {1} xproj to csproj references - {0}: перенос XPROJ {1} в ссылки CSPROJ - - - - {0}: Executing migration rule {1} - {0}: выполнение правила переноса {1} - - - - {0}: Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}: элемент {{ ItemType: {1}, условие: {2}, включение: {3}, исключение: {4}, обновление: {5} }} - - - - {0}: ItemGroup {{ Condition: {1} }} - {0}: ItemGroup {{ условие: {1} }} - - - - {0}: Item completely merged - {0}: элемент полностью объединен - - - - {0}: AddItemToItemGroup {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}: AddItemToItemGroup {{ ItemType: {1}, условие: {2}, включение: {3}, исключение: {4}, обновление: {5} }} - - - - {0}: Merging Item with {1} existing items with a different condition chain. - {0}: объединение элемента с существующими элементами {1} с другой цепочкой условий. - - - - {0}: encompassed includes {1} - {0}: охват включает {1} - - - - {0}: Removing Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: удаление элемента {{ ItemType: {1}, условие: {2}, включение: {3}, исключение: {4} }} - - - - {0}: Ignoring Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: пропуск элемента {{ ItemType: {1}, условие: {2}, включение: {3}, исключение: {4} }} - - - - {0}: Merging Item with {1} existing items with the same condition chain. - {0}: объединение элемента с существующими элементами {1} с такой же цепочкой условий. - - - - {0}: Adding Merged Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: добавление объединенного элемента {{ ItemType: {1}, условие: {2}, включение: {3}, исключение: {4} }} - - - - Merging property, output merged property - Объединение свойства, выходное объединенное свойство - - - - Ignoring fully merged property - Пропуск полностью объединенного свойства - - - - {0}: {1}, {{ Name={2}, Value={3} }} - {0}: {1}, {{ имя={2}, значение={3} }} - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.tr.xlf b/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index 0ae77a8d3..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - - Detected double project migration: {0} - İkili proje geçişi algılandı: {0} - - - - Cannot merge metadata with the same name and different values - Aynı ada ve farklı değerlere sahip meta veriler birleştirilemez - - - - {0}: No xproj file given. - {0}: Xproj dosyası belirtilmedi. - - - - Multiple xproj files found in {0}, please specify which to use - {0} içinde birden çok xproj dosyası bulundu, lütfen kullanılacak dosyayı belirtin - - - - Expected non-null MSBuildProjectTemplate in MigrationSettings - MigrationSettings içinde null olmayan MSBuildProjectTemplate bekleniyordu - - - - Cannot migrate project {0} using compiler {1} - {0} projesi, {1} derleyicisi kullanılarak geçirilemiyor - - - - Expected element to be of type {0}, but got {1} - Öğenin {0} türünde olması bekleniyordu ancak {1} alındı - - - - {0} already exists. Has migration already been run? - {0} zaten var. Geçiş zaten çalıştırıldı mı? - - - - expected destinationElement to not be null - destinationElement öğesinin null olmaması bekleniyordu - - - - {0} (line: {1}, file: {2}) - {0} (satır: {1}, dosya: {2}) - - - - Cannot merge items of different types. - Farklı türlerdeki öğeler birleştirilemez. - - - - Cannot merge items without a common include. - Ortak bir include olmadan öğeler birleştirilemez. - - - - Expected element to be of type {0}, but got {1} - Öğenin {0} türünde olması bekleniyordu ancak {1} alındı - - - - Unexpected type {0} - Beklenmeyen tür {0} - - - - Deprecated Project - Proje Kullanım Dışı Bırakıldı - - - - Project not Restored - Proje Geri Yüklenmedi - - - - No Project - Proje Yok - - - - The project.json specifies no target frameworks in {0} - Project.json {0} içinde hedef çerçeve belirtmiyor - - - - Unresolved Dependency - Çözümlenmemiş Bağımlılık - - - - Unresolved project dependency ({0}) - Çözümlenmemiş proje bağımlılığı ({0}) - - - - File Overwrite - Dosya Üzerine Yazma - - - - Unsupported Script Variable - Desteklenmeyen Betik Değişkeni - - - - {0} is currently an unsupported script variable for project migration - {0} şu anda proje geçişi için desteklenmeyen bir betik değişkeni - - - - Multiple Xproj Files - Birden Çok Xproj Dosyası - - - - Dependency Project not found - Bağımlılık Projesi bulunamadı - - - - Dependency project not found ({0}) - Bağımlılık projesi bulunamadı ({0}) - - - - Unsupported Script Event Hook - Desteklenmeyen Betik Olayı Kancası - - - - {0} is an unsupported script event hook for project migration - {0}, proje geçişi için desteklenmeyen bir betik olay kancası - - - - Multi-TFM - Çoklu TFM - - - - Configuration Exclude - Yapılandırmadan Dışlama - - - - Non-Csharp App - Csharp Olmayan Uygulama - - - - Files specified under PackOptions - PackOptions altında belirtilen dosyalar - - - - {0}.{1} includes not equivalent. - {0}.{1} eşit olmayanı içerir. - - - - {0}.{1} excludes not equivalent. - {0}.{1} eşit olmayanı dışlar. - - - - {0}.{1} removes not equivalent. - {0}.{1} eşit olmayanı kaldırır. - - - - {0}.{1} metadata doesn't exist {{ {2} {3} }} - {0}.{1} meta verileri yok {{ {2} {3} }} - - - - {0}.{1} metadata has another value {{ {2} {3} {4} }} - {0}.{1} meta verileri başka bir değere sahip {{ {2} {3} {4} }} - - - - {0}: Adding metadata to {1} item: {{ {2}, {3}, {4} }} - {0}: Meta veriler {1} öğesine ekleniyor: {{ {2}, {3}, {4} }} - - - - {0}: Skip migrating {1}, it is already migrated. - {0}: {1} geçişini atlayın; öğe zaten geçirildi. - - - - Executing rule: {0} - Kural çalıştırılıyor: {0} - - - - {0}: No configuration or framework build options found in project - {0}: Projede yapılandırma veya çerçeve derleme seçeneği bulunamadı - - - - Migrating {0} target frameworks - {0} hedef çerçeve geçiriliyor - - - - Migrating framework {0} - {0} çerçevesi geçiriliyor - - - - {0}: imports transform null for {1} - {0}: {1} için null dönüştürmeyi içeri aktarır - - - - {0}: Migrating {1} xproj to csproj references - {0}: {1} xproj - csproj başvurusu geçiriliyor - - - - {0}: Executing migration rule {1} - {0}: Geçiş kuralı {1} yürütülüyor - - - - {0}: Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}: Öğe {{ Öğe Türü: {1}, Koşul: {2}, Dahil Et: {3}, Dışla: {4}, Güncelleştir: {5} }} - - - - {0}: ItemGroup {{ Condition: {1} }} - {0}: Öğe Grubu {{ Koşul: {1} }} - - - - {0}: Item completely merged - {0}: Öğe tamamen birleştirildi - - - - {0}: AddItemToItemGroup {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}: Öğe Grubuna Öğe Ekle {{ Öğe Türü: {1}, Koşul: {2}, Dahil Et: {3}, Dışla: {4}, Güncelleştir: {5} }} - - - - {0}: Merging Item with {1} existing items with a different condition chain. - {0}: Öğe, farklı bir koşul zincirine sahip {1} mevcut öğeyle birleştiriliyor. - - - - {0}: encompassed includes {1} - {0}: kapsanan {1} öğesini içeriyor - - - - {0}: Removing Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: Öğe Kaldırılıyor {{ Öğe Türü: {1}, Koşul: {2}, Dahil Et: {3}, Dışla: {4} }} - - - - {0}: Ignoring Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: Öğe Yoksayılıyor {{ Öğe Türü: {1}, Koşul: {2}, Dahil Et: {3}, Dışla: {4} }} - - - - {0}: Merging Item with {1} existing items with the same condition chain. - {0}: Öğe, aynı koşul zincirine sahip {1} mevcut öğeyle birleştiriliyor. - - - - {0}: Adding Merged Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: Birleştirilmiş Öğe Ekleniyor {{ Öğe Türü: {1}, Koşul: {2}, Dahil Et: {3}, Dışla: {4} }} - - - - Merging property, output merged property - Özellik birleştiriliyor, birleştirilmiş özellik çıkışı - - - - Ignoring fully merged property - Tamamen birleştirilmiş özellik yoksayılıyor - - - - {0}: {1}, {{ Name={2}, Value={3} }} - {0}: {1}, {{ Ad={2}, Değer={3} }} - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.xlf b/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.xlf deleted file mode 100644 index fbd673e51..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - Detected double project migration: {0} - - - - Cannot merge metadata with the same name and different values - - - - {0}: No xproj file given. - - - - Multiple xproj files found in {0}, please specify which to use - - - - Expected non-null MSBuildProjectTemplate in MigrationSettings - - - - Cannot migrate project {0} using compiler {1} - - - - Expected element to be of type {0}, but got {1} - - - - {0} already exists. Has migration already been run? - - - - expected destinationElement to not be null - - - - {0} (line: {1}, file: {2}) - - - - Cannot merge items of different types. - - - - Cannot merge items without a common include. - - - - Expected element to be of type {0}, but got {1} - - - - Unexpected type {0} - - - - Deprecated Project - - - - Project not Restored - - - - No Project - - - - The project.json specifies no target frameworks in {0} - - - - Unresolved Dependency - - - - Unresolved project dependency ({0}) - - - - File Overwrite - - - - Unsupported Script Variable - - - - {0} is currently an unsupported script variable for project migration - - - - Multiple Xproj Files - - - - Dependency Project not found - - - - Dependency project not found ({0}) - - - - Unsupported Script Event Hook - - - - {0} is an unsupported script event hook for project migration - - - - Multi-TFM - - - - Configuration Exclude - - - - Non-Csharp App - - - - Files specified under PackOptions - - - - {0}.{1} includes not equivalent. - - - - {0}.{1} excludes not equivalent. - - - - {0}.{1} removes not equivalent. - - - - {0}.{1} metadata doesn't exist {{ {2} {3} }} - - - - {0}.{1} metadata has another value {{ {2} {3} {4} }} - - - - {0}: Adding metadata to {1} item: {{ {2}, {3}, {4} }} - - - - {0}: Skip migrating {1}, it is already migrated. - - - - Executing rule: {0} - - - - {0}: No configuration or framework build options found in project - - - - Migrating {0} target frameworks - - - - Migrating framework {0} - - - - {0}: imports transform null for {1} - - - - {0}: Migrating {1} xproj to csproj references - - - - {0}: Executing migration rule {1} - - - - {0}: Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - - - - {0}: ItemGroup {{ Condition: {1} }} - - - - {0}: Item completely merged - - - - {0}: AddItemToItemGroup {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - - - - {0}: Merging Item with {1} existing items with a different condition chain. - - - - {0}: encompassed includes {1} - - - - {0}: Removing Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - - - - {0}: Ignoring Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - - - - {0}: Merging Item with {1} existing items with the same condition chain. - - - - {0}: Adding Merged Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - - - - Merging property, output merged property - - - - Ignoring fully merged property - - - - {0}: {1}, {{ Name={2}, Value={3} }} - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.zh-Hans.xlf b/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index 0736bf4dc..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - - Detected double project migration: {0} - 检测到双项目迁移: {0} - - - - Cannot merge metadata with the same name and different values - 无法合并具有相同名称和不同值的元数据 - - - - {0}: No xproj file given. - {0}: 未提供 xproj 文件。 - - - - Multiple xproj files found in {0}, please specify which to use - 在 {0} 中找到多个 xproj 文件。请指定要使用哪一个 - - - - Expected non-null MSBuildProjectTemplate in MigrationSettings - MigrationSettings 中预期使用 non-null MSBuildProjectTemplate - - - - Cannot migrate project {0} using compiler {1} - 无法使用编译器 {1} 迁移项目 {0} - - - - Expected element to be of type {0}, but got {1} - 预期元素为类型 {0},但得到 {1} - - - - {0} already exists. Has migration already been run? - {0} 已存在。是否已运行迁移? - - - - expected destinationElement to not be null - 预期 destinationElement 不为 null - - - - {0} (line: {1}, file: {2}) - {0} (行: {1},文件: {2}) - - - - Cannot merge items of different types. - 无法合并不同类型的项。 - - - - Cannot merge items without a common include. - 无法合并没有公共包含的项目。 - - - - Expected element to be of type {0}, but got {1} - 预期元素为类型 {0},但得到 {1} - - - - Unexpected type {0} - 意外类型 {0} - - - - Deprecated Project - 已弃用的项目 - - - - Project not Restored - 未还原的项目 - - - - No Project - 无项目 - - - - The project.json specifies no target frameworks in {0} - project.json 在 {0} 中未指定任何目标框架 - - - - Unresolved Dependency - 未解析的依赖项 - - - - Unresolved project dependency ({0}) - 未解析的项目依赖项 ({0}) - - - - File Overwrite - 文件覆盖 - - - - Unsupported Script Variable - 不支持的脚本变量 - - - - {0} is currently an unsupported script variable for project migration - 项目迁移目前不支持 {0} 脚本变量 - - - - Multiple Xproj Files - 多个 Xproj 文件 - - - - Dependency Project not found - 未找到依赖项项目 - - - - Dependency project not found ({0}) - 未找到依赖项项目 ({0}) - - - - Unsupported Script Event Hook - 不支持的脚本事件挂钩 - - - - {0} is an unsupported script event hook for project migration - 项目迁移不支持 {0} 脚本事件挂钩 - - - - Multi-TFM - Multi-TFM - - - - Configuration Exclude - 配置排除 - - - - Non-Csharp App - Non-Csharp 应用 - - - - Files specified under PackOptions - PackOptions 下指定的文件 - - - - {0}.{1} includes not equivalent. - {0}.{1} 包括不等同。 - - - - {0}.{1} excludes not equivalent. - {0}.{1} 排除不等同。 - - - - {0}.{1} removes not equivalent. - {0}.{1} 删除不等同。 - - - - {0}.{1} metadata doesn't exist {{ {2} {3} }} - {0}.{1}元数据不存在 {{ {2} {3} }} - - - - {0}.{1} metadata has another value {{ {2} {3} {4} }} - {0}.{1} 元数据具有另一个值 {{ {2} {3} {4} }} - - - - {0}: Adding metadata to {1} item: {{ {2}, {3}, {4} }} - {0}: 将元数据添加到 {1} 项: {{ {2}, {3}, {4} }} - - - - {0}: Skip migrating {1}, it is already migrated. - {0}: 跳过迁移 {1},因为该项已经迁移。 - - - - Executing rule: {0} - 执行规则: {0} - - - - {0}: No configuration or framework build options found in project - {0}: 在项目中未找到任何配置或框架生成选项 - - - - Migrating {0} target frameworks - 正在迁移 {0} 目标框架 - - - - Migrating framework {0} - 正在迁移框架 {0} - - - - {0}: imports transform null for {1} - {0}: 为 {1} 导入 transform null - - - - {0}: Migrating {1} xproj to csproj references - {0}: 正在将 {1} xproj 迁移到 csproj 引用 - - - - {0}: Executing migration rule {1} - {0}: 执行迁移规则 {1} - - - - {0}: Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}: 项 {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - - - - {0}: ItemGroup {{ Condition: {1} }} - {0}: ItemGroup {{ Condition: {1} }} - - - - {0}: Item completely merged - {0}: 已完全合并项 - - - - {0}: AddItemToItemGroup {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}: AddItemToItemGroup {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - - - - {0}: Merging Item with {1} existing items with a different condition chain. - {0}: 使用不同的条件链将项与 {1} 现有项合并。 - - - - {0}: encompassed includes {1} - {0}: 涵盖包括 {1} - - - - {0}: Removing Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: 删除项 {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - - - - {0}: Ignoring Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: 忽略项 {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - - - - {0}: Merging Item with {1} existing items with the same condition chain. - {0}: 使用相同条件链将项与 {1} 现有项合并。 - - - - {0}: Adding Merged Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}: 添加合并的项 {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - - - - Merging property, output merged property - 合并属性,输出合并的属性 - - - - Ignoring fully merged property - 将忽略完全合并的属性 - - - - {0}: {1}, {{ Name={2}, Value={3} }} - {0}: {1}, {{ Name={2}, Value={3} }} - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.zh-Hant.xlf b/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index 3db3940e0..000000000 --- a/src/Microsoft.DotNet.ProjectJsonMigration/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - - Detected double project migration: {0} - 偵測到重複的專案移轉: {0} - - - - Cannot merge metadata with the same name and different values - 無法合併名稱相同但值不同的中繼資料 - - - - {0}: No xproj file given. - {0}:未指定 xproj 檔案。 - - - - Multiple xproj files found in {0}, please specify which to use - 在 {0} 中找到多個 xproj 檔案,請指定要使用的檔案 - - - - Expected non-null MSBuildProjectTemplate in MigrationSettings - MigrationSettings 中需要非 null MSBuildProjectTemplate - - - - Cannot migrate project {0} using compiler {1} - 無法使用編譯器 {1} 移轉專案 {0} - - - - Expected element to be of type {0}, but got {1} - 需要類型 {0} 的元素,但卻是 {1} - - - - {0} already exists. Has migration already been run? - {0} 已經存在。是否已執行移轉? - - - - expected destinationElement to not be null - destinationElement 不得為 null - - - - {0} (line: {1}, file: {2}) - {0} (行: {1},檔案: {2}) - - - - Cannot merge items of different types. - 無法合併不同類型的項目。 - - - - Cannot merge items without a common include. - 無法合併不具通用包含的項目。 - - - - Expected element to be of type {0}, but got {1} - 需要類型 {0} 的元素,但卻是 {1} - - - - Unexpected type {0} - 未預期的類型 {0} - - - - Deprecated Project - 已被取代的專案 - - - - Project not Restored - 專案未還原 - - - - No Project - 沒有專案 - - - - The project.json specifies no target frameworks in {0} - project.json 在 {0} 中未指定目標 Framework - - - - Unresolved Dependency - 未解析的相依性 - - - - Unresolved project dependency ({0}) - 未解析的專案相依性 ({0}) - - - - File Overwrite - 檔案覆寫 - - - - Unsupported Script Variable - 不受支援的指令碼變數 - - - - {0} is currently an unsupported script variable for project migration - {0} 目前對專案移轉而言為不受支援的指令碼變數 - - - - Multiple Xproj Files - 多個 Xproj 檔案 - - - - Dependency Project not found - 找不到相依性專案 - - - - Dependency project not found ({0}) - 找不到相依性專案 ({0}) - - - - Unsupported Script Event Hook - 不受支援的指令碼事件掛勾 - - - - {0} is an unsupported script event hook for project migration - {0} 對專案移轉而言為不受支援的指令碼事件掛勾 - - - - Multi-TFM - Multi-TFM - - - - Configuration Exclude - 組態排除 - - - - Non-Csharp App - 非 Csharp 應用程式 - - - - Files specified under PackOptions - PackOptions 下指定的檔案 - - - - {0}.{1} includes not equivalent. - {0}.{1} 包含不對等。 - - - - {0}.{1} excludes not equivalent. - {0}.{1} 排除不對等。 - - - - {0}.{1} removes not equivalent. - {0}.{1} 移除不對等。 - - - - {0}.{1} metadata doesn't exist {{ {2} {3} }} - {0}.{1} 中繼資料不存在 {{ {2} {3} }} - - - - {0}.{1} metadata has another value {{ {2} {3} {4} }} - {0}.{1} 中繼資料有其他值 {{ {2} {3} {4} }} - - - - {0}: Adding metadata to {1} item: {{ {2}, {3}, {4} }} - {0}:正在將中繼資料新增至 {1} 項目: {{ {2}, {3}, {4} }} - - - - {0}: Skip migrating {1}, it is already migrated. - {0}:跳過移轉 {1},其已移轉過。 - - - - Executing rule: {0} - 正在執行規則: {0} - - - - {0}: No configuration or framework build options found in project - {0}:在專案中找不到組態或架構建置選項 - - - - Migrating {0} target frameworks - 正在移轉 {0} 目標 Framework - - - - Migrating framework {0} - 正在移轉架構 {0} - - - - {0}: imports transform null for {1} - {0}: {1} 的匯入轉換為 null - - - - {0}: Migrating {1} xproj to csproj references - {0}:正在將 {1} xproj 移轉至 csproj 參考 - - - - {0}: Executing migration rule {1} - {0}:正在執行移轉規則 {1} - - - - {0}: Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}:項目 {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - - - - {0}: ItemGroup {{ Condition: {1} }} - {0}:ItemGroup {{ Condition: {1} }} - - - - {0}: Item completely merged - {0}:項目已完整合併 - - - - {0}: AddItemToItemGroup {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - {0}:AddItemToItemGroup {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4}, Update: {5} }} - - - - {0}: Merging Item with {1} existing items with a different condition chain. - {0}:正在合併具 {1} 個現有項目的項目與其他條件鏈結。 - - - - {0}: encompassed includes {1} - {0}: 包含內含 {1} - - - - {0}: Removing Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}:正在移除項目 {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - - - - {0}: Ignoring Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}:正在略過項目 {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - - - - {0}: Merging Item with {1} existing items with the same condition chain. - {0}:正在合併具 {1} 個現有項目的項目與相同條件鏈結。 - - - - {0}: Adding Merged Item {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - {0}:正在新增合併的項目 {{ ItemType: {1}, Condition: {2}, Include: {3}, Exclude: {4} }} - - - - Merging property, output merged property - 正在合併屬性,輸出合併的屬性 - - - - Ignoring fully merged property - 正在略過完整合併的屬性 - - - - {0}: {1}, {{ Name={2}, Value={3} }} - {0}: {1}, {{ Name={2}, Value={3} }} - - - - - \ No newline at end of file diff --git a/src/dotnet/BuiltInCommandsCatalog.cs b/src/dotnet/BuiltInCommandsCatalog.cs index 1d002dee8..68bfdb1ab 100644 --- a/src/dotnet/BuiltInCommandsCatalog.cs +++ b/src/dotnet/BuiltInCommandsCatalog.cs @@ -59,7 +59,7 @@ namespace Microsoft.DotNet.Cli }, ["migrate"] = new BuiltInCommandMetadata { - Command = MigrateCommand.Run, + Command = MigrateCommandCompose.Run, // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-migrate DocLink = "http://aka.ms/dotnet-migrate" diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.cs.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.cs.xlf index e2f313619..9788ce0aa 100644 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/CommandLine/xlf/LocalizableStrings.cs.xlf @@ -43,16 +43,6 @@ Použití: - - {0} - {0} - - - - {0} {1} - {0} {1} - - [arguments] [argumenty] @@ -63,11 +53,6 @@ Argumenty: - - {0}{1} - {0}{1} - - [options] [možnosti] @@ -78,11 +63,6 @@ Možnosti: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - [command] [příkaz] @@ -93,11 +73,6 @@ Příkazy: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - Use "{0} [command] --help" for more information about a command. Další informace o příkazu získáte, když zadáte "{0} [příkaz] --help". @@ -118,21 +93,6 @@ Další argumenty: - - {0} - {0} - - - - {0} - {0} - - - - {0} {1} - {0} {1} - - Invalid template pattern '{0}' Neplatný vzor šablony {0} @@ -143,6 +103,11 @@ Další možnosti, které je možné předat MSBuildu. Dostupné možnosti zobrazíte příkazem dotnet msbuild -h. + + Required value for option '{0}' was not provided. + Required value for option '{0}' was not provided. + + \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.de.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.de.xlf index 7b5f25b1f..0dbc7035b 100644 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/CommandLine/xlf/LocalizableStrings.de.xlf @@ -43,16 +43,6 @@ Nutzung: - - {0} - {0} - - - - {0} {1} - {0} {1} - - [arguments] [Argumente] @@ -63,11 +53,6 @@ Argumente: - - {0}{1} - {0}{1} - - [options] [Optionen] @@ -78,11 +63,6 @@ Optionen: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - [command] [Befehl] @@ -93,11 +73,6 @@ Befehle: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - Use "{0} [command] --help" for more information about a command. Verwenden Sie "{0} [Befehl] --help", um weitere Informationen zu einem Befehl zu erhalten. @@ -118,21 +93,6 @@ Zusätzliche Argumente: - - {0} - {0} - - - - {0} - {0} - - - - {0} {1} - {0} {1} - - Invalid template pattern '{0}' Ungültiges Vorlagenmuster „{0}“ @@ -143,6 +103,11 @@ Alle zusätzlichen Optionen, die MSBuild übergeben werden sollen. Verfügbare Optionen siehe "dotnet msbuild -h". + + Required value for option '{0}' was not provided. + Required value for option '{0}' was not provided. + + \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.es.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.es.xlf index 7f372cd03..a8f8ad3ff 100644 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/CommandLine/xlf/LocalizableStrings.es.xlf @@ -43,16 +43,6 @@ Uso: - - {0} - {0} - - - - {0} {1} - {0} {1} - - [arguments] [argumentos] @@ -63,11 +53,6 @@ Argumentos: - - {0}{1} - {0}{1} - - [options] [opciones] @@ -78,11 +63,6 @@ Opciones: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - [command] [comando] @@ -93,11 +73,6 @@ Comandos: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - Use "{0} [command] --help" for more information about a command. Use "{0} [comando] --help" para más información sobre un comando. @@ -118,21 +93,6 @@ Argumentos adicionales: - - {0} - {0} - - - - {0} - {0} - - - - {0} {1} - {0} {1} - - Invalid template pattern '{0}' Patrón de plantilla no válido "{0}" @@ -143,6 +103,11 @@ Cualquier opción adicional que se deba pasar a MSBuild. Consulte 'dotnet msbuild -h' para conocer las opciones disponibles. + + Required value for option '{0}' was not provided. + Required value for option '{0}' was not provided. + + \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.fr.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.fr.xlf index b3ec93865..d45d85f65 100644 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/CommandLine/xlf/LocalizableStrings.fr.xlf @@ -43,16 +43,6 @@ Utilisation : - - {0} - {0} - - - - {0} {1} - {0} {1} - - [arguments] [arguments] @@ -63,11 +53,6 @@ Arguments : - - {0}{1} - {0}{1} - - [options] [options] @@ -78,11 +63,6 @@ Options : - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - [command] [commande] @@ -93,11 +73,6 @@ Commandes : - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - Use "{0} [command] --help" for more information about a command. Utilisez "{0} [commande] --help" pour plus d'informations sur une commande. @@ -118,21 +93,6 @@ Arguments supplémentaires : - - {0} - {0} - - - - {0} - {0} - - - - {0} {1} - {0} {1} - - Invalid template pattern '{0}' Modèle non valide '{0}' @@ -143,6 +103,11 @@ Options supplémentaires à passer à MSBuild. Consultez 'dotnet msbuild -h' pour connaître les options disponibles. + + Required value for option '{0}' was not provided. + Required value for option '{0}' was not provided. + + \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.it.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.it.xlf index 30aff666c..7922e1bec 100644 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/CommandLine/xlf/LocalizableStrings.it.xlf @@ -43,16 +43,6 @@ Utilizzo: - - {0} - {0} - - - - {0} {1} - {0} {1} - - [arguments] [argomenti] @@ -63,11 +53,6 @@ Argomenti: - - {0}{1} - {0}{1} - - [options] [opzioni] @@ -78,11 +63,6 @@ Opzioni: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - [command] [comando] @@ -93,11 +73,6 @@ Comandi: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - Use "{0} [command] --help" for more information about a command. Per altre informazioni su un comando, usare "{0} [comando] --help". @@ -118,21 +93,6 @@ Argomenti aggiuntivi: - - {0} - {0} - - - - {0} - {0} - - - - {0} {1} - {0} {1} - - Invalid template pattern '{0}' Criterio di modello '{0}' non valido @@ -143,6 +103,11 @@ Eventuali opzioni aggiuntive da passare a MSBuild. Per le opzioni disponibili, vedere 'dotnet msbuild -h'. + + Required value for option '{0}' was not provided. + Required value for option '{0}' was not provided. + + \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.ja.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.ja.xlf index d254eace8..6acfb9738 100644 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/CommandLine/xlf/LocalizableStrings.ja.xlf @@ -43,16 +43,6 @@ 使用法: - - {0} - {0} - - - - {0} {1} - {0} {1} - - [arguments] [arguments] @@ -63,11 +53,6 @@ 引数: - - {0}{1} - {0}{1} - - [options] [options] @@ -78,11 +63,6 @@ オプション: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - [command] [command] @@ -93,11 +73,6 @@ コマンド: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - Use "{0} [command] --help" for more information about a command. コマンドに関する詳細情報については、"{0} [command] --help" を使用します。 @@ -118,21 +93,6 @@ 追加引数: - - {0} - {0} - - - - {0} - {0} - - - - {0} {1} - {0} {1} - - Invalid template pattern '{0}' 無効なテンプレート パターン '{0}' @@ -143,6 +103,11 @@ MSBuild に渡す必要があるすべての追加オプション。利用可能なオプションについては、'dotnet msbuild -h' をご覧ください。 + + Required value for option '{0}' was not provided. + Required value for option '{0}' was not provided. + + \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.ko.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.ko.xlf index b9ff4729d..022349554 100644 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/CommandLine/xlf/LocalizableStrings.ko.xlf @@ -43,16 +43,6 @@ 사용법: - - {0} - {0} - - - - {0} {1} - {0} {1} - - [arguments] [arguments] @@ -63,11 +53,6 @@ 인수: - - {0}{1} - {0}{1} - - [options] [options] @@ -78,11 +63,6 @@ 옵션: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - [command] [command] @@ -93,11 +73,6 @@ 명령: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - Use "{0} [command] --help" for more information about a command. 명령에 대한 자세한 정보를 보려면 "{0} [command] --help"를 사용합니다. @@ -118,21 +93,6 @@ 추가 인수: - - {0} - {0} - - - - {0} - {0} - - - - {0} {1} - {0} {1} - - Invalid template pattern '{0}' 잘못된 템플릿 패턴 '{0}' @@ -143,6 +103,11 @@ MSBuild에 전달해야 할 추가 옵션입니다. 사용 가능한 옵션은 'dotnet msbuild -h'를 참조하세요. + + Required value for option '{0}' was not provided. + Required value for option '{0}' was not provided. + + \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.pl.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.pl.xlf index fb4e03389..2eafde894 100644 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/CommandLine/xlf/LocalizableStrings.pl.xlf @@ -43,16 +43,6 @@ Użycie: - - {0} - {0} - - - - {0} {1} - {0} {1} - - [arguments] [argumenty] @@ -63,11 +53,6 @@ Argumenty: - - {0}{1} - {0}{1} - - [options] [opcje] @@ -78,11 +63,6 @@ Opcje: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - [command] [polecenie] @@ -93,11 +73,6 @@ Polecenia: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - Use "{0} [command] --help" for more information about a command. Użyj polecenia „{0} [polecenie] --help”, aby uzyskać więcej informacji o danym poleceniu. @@ -118,21 +93,6 @@ Dodatkowe argumenty: - - {0} - {0} - - - - {0} - {0} - - - - {0} {1} - {0} {1} - - Invalid template pattern '{0}' Nieprawidłowy wzorzec szablonu „{0}” @@ -143,6 +103,11 @@ Dodatkowe opcje, które mają zostać przekazane programowi MSBuild. Uruchom polecenie „dotnet msbuild -h”, aby zapoznać się z dostępnymi opcjami. + + Required value for option '{0}' was not provided. + Required value for option '{0}' was not provided. + + \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.pt-BR.xlf index a0d50325d..768ea99e6 100644 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/CommandLine/xlf/LocalizableStrings.pt-BR.xlf @@ -43,16 +43,6 @@ Uso: - - {0} - {0} - - - - {0} {1} - {0} {1} - - [arguments] [arguments] @@ -63,11 +53,6 @@ Argumentos: - - {0}{1} - {0}{1} - - [options] [options] @@ -78,11 +63,6 @@ Opções: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - [command] [command] @@ -93,11 +73,6 @@ Comandos: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - Use "{0} [command] --help" for more information about a command. Use "{0} [command] --help" para obter mais informações sobre um comando. @@ -118,21 +93,6 @@ Argumentos adicionais: - - {0} - {0} - - - - {0} - {0} - - - - {0} {1} - {0} {1} - - Invalid template pattern '{0}' Padrão de modelo '{0}' inválido @@ -143,6 +103,11 @@ Quaisquer opções extra que devam ser transmitidas para o MSBuild. Consulte 'dotnet msbuild -h' para obter opções disponíveis. + + Required value for option '{0}' was not provided. + Required value for option '{0}' was not provided. + + \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.ru.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.ru.xlf index 142fb1f57..08773f873 100644 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/CommandLine/xlf/LocalizableStrings.ru.xlf @@ -43,16 +43,6 @@ Использование: - - {0} - {0} - - - - {0} {1} - {0} {1} - - [arguments] [аргументы] @@ -63,11 +53,6 @@ Аргументы: - - {0}{1} - {0}{1} - - [options] [параметры] @@ -78,11 +63,6 @@ Параметры: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - [command] [команда] @@ -93,11 +73,6 @@ Команды: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - Use "{0} [command] --help" for more information about a command. Используйте синтаксис "{0} [команда] --help" для получения дополнительной информации о команде. @@ -118,21 +93,6 @@ Дополнительные аргументы: - - {0} - {0} - - - - {0} - {0} - - - - {0} {1} - {0} {1} - - Invalid template pattern '{0}' Недопустимая схема шаблона "{0}" @@ -143,6 +103,11 @@ Все дополнительные параметры, которые следует передать в MSBuild. Доступные параметры: dotnet msbuild -h + + Required value for option '{0}' was not provided. + Required value for option '{0}' was not provided. + + \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.tr.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.tr.xlf index 988d28c1b..521ad68a2 100644 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/CommandLine/xlf/LocalizableStrings.tr.xlf @@ -43,16 +43,6 @@ Kullanım: - - {0} - {0} - - - - {0} {1} - {0} {1} - - [arguments] [bağımsız değişkenler] @@ -63,11 +53,6 @@ Bağımsız değişkenler: - - {0}{1} - {0}{1} - - [options] [seçenekler] @@ -78,11 +63,6 @@ Seçenekler: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - [command] [komut] @@ -93,11 +73,6 @@ Komutlar: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - Use "{0} [command] --help" for more information about a command. Bir komut hakkında daha fazla bilgi almak için "{0} [komut] --help" kullanın. @@ -118,21 +93,6 @@ Ek Bağımsız Değişkenler: - - {0} - {0} - - - - {0} - {0} - - - - {0} {1} - {0} {1} - - Invalid template pattern '{0}' Geçersiz şablon deseni: '{0}' @@ -143,6 +103,11 @@ MSBuild’e geçirilmesi gereken ek seçenekler. Kullanılabilir seçenekler için 'dotnet msbuild -h' komutunu kullanın. + + Required value for option '{0}' was not provided. + Required value for option '{0}' was not provided. + + \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.xlf index 9cc7bb67f..d03aa645b 100644 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.xlf +++ b/src/dotnet/CommandLine/xlf/LocalizableStrings.xlf @@ -35,14 +35,6 @@ Usage: - - {0} - - - - {0} {1} - - [arguments] @@ -51,10 +43,6 @@ Arguments: - - {0}{1} - - [options] @@ -63,10 +51,6 @@ Options: - - {{0, -{0}}}{{1}} - - [command] @@ -75,10 +59,6 @@ Commands: - - {{0, -{0}}}{{1}} - - Use "{0} [command] --help" for more information about a command. @@ -95,18 +75,6 @@ Additional Arguments: - - {0} - - - - {0} - - - - {0} {1} - - Invalid template pattern '{0}' @@ -115,6 +83,10 @@ Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options. + + Required value for option '{0}' was not provided. + + \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.zh-Hans.xlf index c9010022f..72afa1347 100644 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/CommandLine/xlf/LocalizableStrings.zh-Hans.xlf @@ -43,16 +43,6 @@ 使用情况: - - {0} - {0} - - - - {0} {1} - {0} {1} - - [arguments] [参数] @@ -63,11 +53,6 @@ 参数: - - {0}{1} - {0}{1} - - [options] [选项] @@ -78,11 +63,6 @@ 选项: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - [command] [命令] @@ -93,11 +73,6 @@ 命令: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - Use "{0} [command] --help" for more information about a command. 使用“{0} [命令] -- help”获取有关命令的详细信息。 @@ -118,21 +93,6 @@ 附加参数: - - {0} - {0} - - - - {0} - {0} - - - - {0} {1} - {0} {1} - - Invalid template pattern '{0}' 无效模板模式“{0}” @@ -143,6 +103,11 @@ 任何应该传递给 MSBuild 的额外选项。有关可用的选项,请参阅“dotnet msbuild -h”。 + + Required value for option '{0}' was not provided. + Required value for option '{0}' was not provided. + + \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.zh-Hant.xlf index 2e3093876..58a84c021 100644 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/CommandLine/xlf/LocalizableStrings.zh-Hant.xlf @@ -43,16 +43,6 @@ 使用方式: - - {0} - {0} - - - - {0} {1} - {0} {1} - - [arguments] [引數] @@ -63,11 +53,6 @@ 引數: - - {0}{1} - {0}{1} - - [options] [選項] @@ -78,11 +63,6 @@ 選項: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - [command] [命令] @@ -93,11 +73,6 @@ 命令: - - {{0, -{0}}}{{1}} - {{0, -{0}}}{{1}} - - Use "{0} [command] --help" for more information about a command. 使用 "{0} [命令] --help" 取得命令的詳細資訊。 @@ -118,21 +93,6 @@ 其他引數: - - {0} - {0} - - - - {0} - {0} - - - - {0} {1} - {0} {1} - - Invalid template pattern '{0}' 範本模式 '{0}' 無效 @@ -143,6 +103,11 @@ 任何應傳遞給 MSBuild 的額外選項。查看 'dotnet msbuild -h' 以得知可用的選項。 + + Required value for option '{0}' was not provided. + Required value for option '{0}' was not provided. + + \ No newline at end of file diff --git a/src/dotnet/CommonLocalizableStrings.cs b/src/dotnet/CommonLocalizableStrings.cs index 1c582f46a..666ed56f4 100644 --- a/src/dotnet/CommonLocalizableStrings.cs +++ b/src/dotnet/CommonLocalizableStrings.cs @@ -101,12 +101,13 @@ namespace Microsoft.DotNet.Tools public const string MoreThanOneProjectInDirectory = "Found more than one project in `{0}`. Please specify which one to use."; public const string FoundInvalidProject = "Found a project `{0}` but it is invalid."; public const string InvalidProject = "Invalid project `{0}`."; + public const string InvalidProjectWithExceptionMessage = "Invalid project `{0}`. {1}."; /// Solution public const string CouldNotFindSolutionIn = "Specified solution file {0} does not exist, or there is no solution file in the directory."; public const string CouldNotFindSolutionOrDirectory = "Could not find solution or directory `{0}`."; public const string MoreThanOneSolutionInDirectory = "Found more than one solution file in {0}. Please specify which one to use."; - public const string InvalidSolutionFormatString = "Invalid solution `{0}`. {1}"; // {0} is the solution path, {1} is already localized details on the failure + public const string InvalidSolutionFormatString = "Invalid solution `{0}`. {1}."; // {0} is the solution path, {1} is already localized details on the failure public const string SolutionDoesNotExist = "Specified solution file {0} does not exist, or there is no solution file in the directory."; /// add p2p @@ -184,13 +185,15 @@ namespace Microsoft.DotNet.Tools public const string ProjectNotCompatibleWithFrameworks = "Project `{0}` cannot be added due to incompatible targeted frameworks between the two projects. Please review the project you are trying to add and verify that is compatible with the following targets:"; public const string ProjectDoesNotTargetFramework = "Project `{0}` does not target framework `{1}`."; - public const string ProjectCouldNotBeEvaluated = "Project `{0}` could not be evaluated. Evaluation failed with following error:\n{1}"; + public const string ProjectCouldNotBeEvaluated = "Project `{0}` could not be evaluated. Evaluation failed with following error:\n{1}."; /// common options - public const string VerbosityOptionDescription = "Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]"; + public const string VerbosityOptionDescription = "Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]."; public const string FrameworkOptionDescription = "Target framework to publish for. The target framework has to be specified in the project file."; public const string RuntimeOptionDescription = "Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app."; public const string ConfigurationOptionDescription = "Configuration to use for building the project. Default for most projects is \"Debug\"."; public const string CmdVersionSuffixDescription = "Defines the value for the $(VersionSuffix) property in the project."; + + public const string ShowHelpDescription = "Show help information."; } } diff --git a/src/dotnet/CommonOptions.cs b/src/dotnet/CommonOptions.cs index e2ea884ef..06047fcd3 100644 --- a/src/dotnet/CommonOptions.cs +++ b/src/dotnet/CommonOptions.cs @@ -12,7 +12,7 @@ namespace Microsoft.DotNet.Cli public static Option HelpOption() => Create.Option( "-h|--help", - "Show help information", + CommonLocalizableStrings.ShowHelpDescription, Accept.NoArguments(), materialize: o => o.Option.Command().HelpView()); diff --git a/src/dotnet/DotNetTopLevelCommandBase.cs b/src/dotnet/DotNetTopLevelCommandBase.cs index 650a5fcbb..bc2fba3f3 100644 --- a/src/dotnet/DotNetTopLevelCommandBase.cs +++ b/src/dotnet/DotNetTopLevelCommandBase.cs @@ -42,14 +42,19 @@ namespace Microsoft.DotNet.Cli } catch (KeyNotFoundException) { - throw new GracefulException(CommonLocalizableStrings.RequiredCommandNotPassed); + return ReportError(CommonLocalizableStrings.RequiredCommandNotPassed); } catch (GracefulException e) { - Reporter.Error.WriteLine(e.Message.Red()); - ParseResult.ShowHelp(); - return 1; + return ReportError(e.Message); } } + + private int ReportError(string errorMessage) + { + Reporter.Error.WriteLine(errorMessage.Red()); + ParseResult.ShowHelp(); + return 1; + } } } \ No newline at end of file diff --git a/src/dotnet/ProjectGlobbingResolver.cs b/src/dotnet/ProjectGlobbingResolver.cs deleted file mode 100644 index 28591b9de..000000000 --- a/src/dotnet/ProjectGlobbingResolver.cs +++ /dev/null @@ -1,70 +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.Internal.ProjectModel; -using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing; -using Microsoft.DotNet.Internal.ProjectModel.FileSystemGlobbing.Abstractions; - -namespace Microsoft.DotNet.Tools.Compiler -{ - internal class ProjectGlobbingResolver - { - internal IEnumerable Resolve(IEnumerable values) - { - var currentDirectory = Directory.GetCurrentDirectory(); - if (!values.Any()) - { - var fileName = Path.Combine(currentDirectory, Project.FileName); - if (!File.Exists(fileName)) - { - throw new InvalidOperationException($"Couldn't find '{Project.FileName}' in current directory"); - } - yield return fileName; - yield break; - } - foreach (var value in values) - { - var fileName = Path.Combine(currentDirectory, value); - if (File.Exists(fileName)) - { - yield return value; - continue; - } - - fileName = Path.Combine(currentDirectory, value, Project.FileName); - if (File.Exists(fileName)) - { - yield return fileName; - continue; - } - - var matcher = new Matcher(); - matcher.AddInclude(value); - var result = matcher.Execute(new DirectoryInfoWrapper(new DirectoryInfo(currentDirectory))); - if (result.Files.Any()) - { - foreach (var filePatternMatch in result.Files) - { - yield return filePatternMatch.Path; - } - } - else if (value.Contains("*")) - { - throw new InvalidOperationException($"Globbing pattern '{value}' did not match any files"); - } - else if (value.EndsWith(Project.FileName)) - { - throw new InvalidOperationException($"Could not find project file '{value}'"); - } - else - { - throw new InvalidOperationException($"Couldn't find '{Project.FileName}' in '{value}'"); - } - } - } - } -} diff --git a/src/dotnet/SlnFileExtensions.cs b/src/dotnet/SlnFileExtensions.cs index 39e34a806..24848dffa 100644 --- a/src/dotnet/SlnFileExtensions.cs +++ b/src/dotnet/SlnFileExtensions.cs @@ -3,6 +3,7 @@ using Microsoft.Build.Construction; using Microsoft.Build.Evaluation; +using Microsoft.Build.Exceptions; using Microsoft.Build.Execution; using Microsoft.DotNet.Cli.Sln.Internal; using Microsoft.DotNet.Cli.Utils; @@ -36,7 +37,19 @@ namespace Microsoft.DotNet.Tools.Common } else { - var projectInstance = new ProjectInstance(fullProjectPath); + ProjectInstance projectInstance = null; + try + { + projectInstance = new ProjectInstance(fullProjectPath); + } + catch (InvalidProjectFileException e) + { + Reporter.Error.WriteLine(string.Format( + CommonLocalizableStrings.InvalidProjectWithExceptionMessage, + fullProjectPath, + e.Message)); + return; + } var slnProject = new SlnProject { diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/AddPackageParser.cs b/src/dotnet/commands/dotnet-add/dotnet-add-package/AddPackageParser.cs index 70687e8d2..5ee3fd10c 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/AddPackageParser.cs +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/AddPackageParser.cs @@ -3,10 +3,12 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Net.Http; using System.Threading; using Microsoft.DotNet.Cli.CommandLine; +using Newtonsoft.Json; using Newtonsoft.Json.Linq; using LocalizableStrings = Microsoft.DotNet.Tools.Add.PackageReference.LocalizableStrings; @@ -52,7 +54,7 @@ namespace Microsoft.DotNet.Cli { var httpClient = new HttpClient(); - string result; + Stream result; try { @@ -60,14 +62,18 @@ namespace Microsoft.DotNet.Cli var response = httpClient.GetAsync($"https://api-v2v3search-0.nuget.org/query?q={match}&skip=0&take=100&prerelease=true", cancellation.Token) .Result; - result = response.Content.ReadAsStringAsync().Result; + result = response.Content.ReadAsStreamAsync().Result; } catch (Exception) { yield break; } - var json = JObject.Parse(result); + JObject json; + using (var reader = new JsonTextReader(new StreamReader(result))) + { + json = JObject.Load(reader); + } foreach (var id in json["data"]) { diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/Program.cs b/src/dotnet/commands/dotnet-add/dotnet-add-package/Program.cs index 5aee92844..a72a413a1 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/Program.cs +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/Program.cs @@ -100,6 +100,9 @@ namespace Microsoft.DotNet.Tools.Add.PackageReference // Turn off restore for Dotnet cli tool references so that we do not generate extra dg specs args.Add($"/p:RestoreDotnetCliToolReferences=false"); + // Output should not include MSBuild version header + args.Add("/nologo"); + var result = new MSBuildForwardingApp(args).Execute(); if (result != 0) diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.cs.xlf index 46213a706..d907ef82f 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.cs.xlf @@ -13,35 +13,30 @@ Příkaz pro přidání odkazu na balíček - - Package references to add - Odkazy na balíčky k přidání - - Please specify one package reference to add. Zadejte prosím jeden odkaz na balíček, který chcete přidat. - Add reference only when targetting a specific framework - Přidat odkaz jen při zaměření na určitou platformu - + Adds reference only when targeting a specific framework. + Přidat odkaz jen při zaměření na určitou platformu + - Add reference without performing restore preview and compatibility check. - Přidá odkaz bez provedení náhledu obnovení a kontroly kompatibility. - + Adds reference without performing restore preview and compatibility check. + Přidá odkaz bez provedení náhledu obnovení a kontroly kompatibility. + - Use specific NuGet package sources to use during the restore. - Určete konkrétní zdroje balíčků NuGet, které se mají použít při obnovení. - + Specifies NuGet package sources to use during the restore. + Určete konkrétní zdroje balíčků NuGet, které se mají použít při obnovení. + - Restore the packages to this Directory . - Obnoví balíčky do tohoto adresáře. - + Restores the packages to the specified directory. + Obnoví balíčky do tohoto adresáře. + Version for the package to be added. @@ -49,9 +44,9 @@ - Unable to Create Dependency graph file for project '{0}'. Cannot add package reference. - Není možné vytvořit grafický soubor závislostí pro projekt {0}. Nejde přidat odkaz na balíček. - + Unable to create dependency graph file for project '{0}'. Cannot add package reference. + Není možné vytvořit grafický soubor závislostí pro projekt {0}. Nejde přidat odkaz na balíček. + VERSION @@ -73,6 +68,16 @@ PACKAGE_DIRECTORY + + The package reference to add. + The package reference to add. + + + + PACKAGE_NAME + PACKAGE_NAME + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.de.xlf index 7bc4f9156..e356aec62 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.de.xlf @@ -13,35 +13,30 @@ Befehl zum Hinzufügen eines Paketverweises - - Package references to add - Hinzuzufügende Paketverweise - - Please specify one package reference to add. Geben Sie einen Paketverweis an, der hinzugefügt werden soll. - Add reference only when targetting a specific framework - Verweis nur bei Verwendung eines bestimmten Zielframeworks hinzufügen - + Adds reference only when targeting a specific framework. + Verweis nur bei Verwendung eines bestimmten Zielframeworks hinzufügen + - Add reference without performing restore preview and compatibility check. - Fügt einen Verweis hinzu, ohne dass eine Wiederherstellungsvorschau oder eine Kompatibilitätsprüfung durchgeführt wird. - + Adds reference without performing restore preview and compatibility check. + Fügt einen Verweis hinzu, ohne dass eine Wiederherstellungsvorschau oder eine Kompatibilitätsprüfung durchgeführt wird. + - Use specific NuGet package sources to use during the restore. - Gibt spezifische NuGet-Paketquellen für die Wiederherstellung an. - + Specifies NuGet package sources to use during the restore. + Gibt spezifische NuGet-Paketquellen für die Wiederherstellung an. + - Restore the packages to this Directory . - Stellt die Pakete in diesem Verzeichnis wieder her. - + Restores the packages to the specified directory. + Stellt die Pakete in diesem Verzeichnis wieder her. + Version for the package to be added. @@ -49,9 +44,9 @@ - Unable to Create Dependency graph file for project '{0}'. Cannot add package reference. - Die Abhängigkeitsdiagrammdatei für das Projekt "{0}" konnte nicht wiederhergestellt werden. Der Paketverweis kann nicht hinzugefügt werden. - + Unable to create dependency graph file for project '{0}'. Cannot add package reference. + Die Abhängigkeitsdiagrammdatei für das Projekt "{0}" konnte nicht wiederhergestellt werden. Der Paketverweis kann nicht hinzugefügt werden. + VERSION @@ -73,6 +68,16 @@ PACKAGE_DIRECTORY + + The package reference to add. + The package reference to add. + + + + PACKAGE_NAME + PACKAGE_NAME + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.es.xlf index dfe725df3..592b0c6b4 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.es.xlf @@ -13,35 +13,30 @@ Comando para agregar referencia de paquete - - Package references to add - Referencias de paquete para agregar - - Please specify one package reference to add. Especifique una referencia de paquete para agregar. - Add reference only when targetting a specific framework - Se agrega una referencia solo cuando hay una plataforma de destino específica - + Adds reference only when targeting a specific framework. + Se agrega una referencia solo cuando hay una plataforma de destino específica + - Add reference without performing restore preview and compatibility check. - Agregue una referencia sin realizar la vista previa de restauración y la comprobación de compatibilidad. - + Adds reference without performing restore preview and compatibility check. + Agregue una referencia sin realizar la vista previa de restauración y la comprobación de compatibilidad. + - Use specific NuGet package sources to use during the restore. - Use orígenes de un paquete NuGet para usarlo durante la restauración. - + Specifies NuGet package sources to use during the restore. + Use orígenes de un paquete NuGet para usarlo durante la restauración. + - Restore the packages to this Directory . - Restaurar los paquetes en este directorio. - + Restores the packages to the specified directory. + Restaurar los paquetes en este directorio. + Version for the package to be added. @@ -49,9 +44,9 @@ - Unable to Create Dependency graph file for project '{0}'. Cannot add package reference. - No se puede crear el archivo de gráfico de dependencias para el proyecto '{0}'. No se puede agregar la referencia de paquete. - + Unable to create dependency graph file for project '{0}'. Cannot add package reference. + No se puede crear el archivo de gráfico de dependencias para el proyecto '{0}'. No se puede agregar la referencia de paquete. + VERSION @@ -73,6 +68,16 @@ DIRECTORIO_DE_PAQUETE + + The package reference to add. + The package reference to add. + + + + PACKAGE_NAME + PACKAGE_NAME + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.fr.xlf index 15ca8160d..10fc98ee6 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.fr.xlf @@ -13,35 +13,30 @@ Commande permettant d'ajouter une référence de package - - Package references to add - Références de package à ajouter - - Please specify one package reference to add. Spécifiez au moins une référence de package à ajouter. - Add reference only when targetting a specific framework - Ajouter une référence uniquement en cas de ciblage d'un framework spécifique - + Adds reference only when targeting a specific framework. + Ajouter une référence uniquement en cas de ciblage d'un framework spécifique + - Add reference without performing restore preview and compatibility check. - Ajoutez une référence sans effectuer de prévisualisation de la restauration et de vérification de la compatibilité. - + Adds reference without performing restore preview and compatibility check. + Ajoutez une référence sans effectuer de prévisualisation de la restauration et de vérification de la compatibilité. + - Use specific NuGet package sources to use during the restore. - Utilisez les sources de package NuGet spécifiques pendant la restauration. - + Specifies NuGet package sources to use during the restore. + Utilisez les sources de package NuGet spécifiques pendant la restauration. + - Restore the packages to this Directory . - Restaurez les packages dans ce répertoire. - + Restores the packages to the specified directory. + Restaurez les packages dans ce répertoire. + Version for the package to be added. @@ -49,9 +44,9 @@ - Unable to Create Dependency graph file for project '{0}'. Cannot add package reference. - Impossible de créer le fichier de graphique de dépendance pour le projet '{0}'. Impossible d'ajouter une référence de package. - + Unable to create dependency graph file for project '{0}'. Cannot add package reference. + Impossible de créer le fichier de graphique de dépendance pour le projet '{0}'. Impossible d'ajouter une référence de package. + VERSION @@ -73,6 +68,16 @@ PACKAGE_DIRECTORY + + The package reference to add. + The package reference to add. + + + + PACKAGE_NAME + PACKAGE_NAME + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.it.xlf index 01156d8a5..b62fa8ffd 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.it.xlf @@ -13,35 +13,30 @@ Comando per aggiungere il riferimento al pacchetto - - Package references to add - Riferimenti al pacchetto da aggiungere - - Please specify one package reference to add. Specificare almeno un riferimento al pacchetto da aggiungere. - Add reference only when targetting a specific framework - Aggiunge il riferimento solo se destinato a un framework specifico - + Adds reference only when targeting a specific framework. + Aggiunge il riferimento solo se destinato a un framework specifico + - Add reference without performing restore preview and compatibility check. - Aggiunge il riferimento senza eseguire l'anteprima di restore e la verifica della compatibilità. - + Adds reference without performing restore preview and compatibility check. + Aggiunge il riferimento senza eseguire l'anteprima di restore e la verifica della compatibilità. + - Use specific NuGet package sources to use during the restore. - Consente di specificare le origini pacchetto NuGet da usare durante il ripristino. - + Specifies NuGet package sources to use during the restore. + Consente di specificare le origini pacchetto NuGet da usare durante il ripristino. + - Restore the packages to this Directory . - Consente di ripristinare i pacchetti in questa directory. - + Restores the packages to the specified directory. + Consente di ripristinare i pacchetti in questa directory. + Version for the package to be added. @@ -49,9 +44,9 @@ - Unable to Create Dependency graph file for project '{0}'. Cannot add package reference. - Non è possibile creare il file del grafico dipendenze per il progetto '{0}'. Non è possibile aggiungere il riferimento al pacchetto. - + Unable to create dependency graph file for project '{0}'. Cannot add package reference. + Non è possibile creare il file del grafico dipendenze per il progetto '{0}'. Non è possibile aggiungere il riferimento al pacchetto. + VERSION @@ -73,6 +68,16 @@ DIRECTORY_PACCHETTO + + The package reference to add. + The package reference to add. + + + + PACKAGE_NAME + PACKAGE_NAME + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ja.xlf index d7df49f70..256edeb09 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ja.xlf @@ -13,35 +13,30 @@ パッケージ参照を追加するコマンド - - Package references to add - 追加するパッケージ参照 - - Please specify one package reference to add. 追加するパッケージ参照を 1 つ指定してください。 - Add reference only when targetting a specific framework - 特定のフレームワークを対象とする場合にのみ参照を追加する - + Adds reference only when targeting a specific framework. + 特定のフレームワークを対象とする場合にのみ参照を追加する + - Add reference without performing restore preview and compatibility check. - 復元のプレビューや互換性チェックを行わずに参照を追加します。 - + Adds reference without performing restore preview and compatibility check. + 復元のプレビューや互換性チェックを行わずに参照を追加します。 + - Use specific NuGet package sources to use during the restore. - 復元中には特定の NuGet パッケージ ソースを使用します。 - + Specifies NuGet package sources to use during the restore. + 復元中には特定の NuGet パッケージ ソースを使用します。 + - Restore the packages to this Directory . - パッケージをこのディレクトリに復元します。 - + Restores the packages to the specified directory. + パッケージをこのディレクトリに復元します。 + Version for the package to be added. @@ -49,9 +44,9 @@ - Unable to Create Dependency graph file for project '{0}'. Cannot add package reference. - プロジェクト '{0}' の依存関係グラフ ファイルを作成できません。パッケージ参照を追加できません。 - + Unable to create dependency graph file for project '{0}'. Cannot add package reference. + プロジェクト '{0}' の依存関係グラフ ファイルを作成できません。パッケージ参照を追加できません。 + VERSION @@ -73,6 +68,16 @@ PACKAGE_DIRECTORY + + The package reference to add. + The package reference to add. + + + + PACKAGE_NAME + PACKAGE_NAME + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ko.xlf index 8bdd3fce2..73a21787b 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ko.xlf @@ -13,35 +13,30 @@ 패키지 참조를 추가하는 명령 - - Package references to add - 추가할 패키지 참조 - - Please specify one package reference to add. 추가할 하나의 패키지 참조를 지정하세요. - Add reference only when targetting a specific framework - 특정 프레임워크를 대상으로 지정할 때에만 참조를 추가합니다. - + Adds reference only when targeting a specific framework. + 특정 프레임워크를 대상으로 지정할 때에만 참조를 추가합니다. + - Add reference without performing restore preview and compatibility check. - 미리 보기 복원 및 호환성 검사를 수행하지 않고 참조를 추가합니다. - + Adds reference without performing restore preview and compatibility check. + 미리 보기 복원 및 호환성 검사를 수행하지 않고 참조를 추가합니다. + - Use specific NuGet package sources to use during the restore. - 복원 중 사용할 특정 NuGet 패키지 원본을 사용합니다. - + Specifies NuGet package sources to use during the restore. + 복원 중 사용할 특정 NuGet 패키지 원본을 사용합니다. + - Restore the packages to this Directory . - 패키지를 이 디렉터리에 복원합니다. - + Restores the packages to the specified directory. + 패키지를 이 디렉터리에 복원합니다. + Version for the package to be added. @@ -49,9 +44,9 @@ - Unable to Create Dependency graph file for project '{0}'. Cannot add package reference. - '{0}' 프로젝트에 대한 종속성 그래프 파일을 만들 수 없습니다. 패키지 참조를 추가할 수 없습니다. - + Unable to create dependency graph file for project '{0}'. Cannot add package reference. + '{0}' 프로젝트에 대한 종속성 그래프 파일을 만들 수 없습니다. 패키지 참조를 추가할 수 없습니다. + VERSION @@ -73,6 +68,16 @@ PACKAGE_DIRECTORY + + The package reference to add. + The package reference to add. + + + + PACKAGE_NAME + PACKAGE_NAME + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.pl.xlf index 33e240e00..f8204f210 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.pl.xlf @@ -13,35 +13,30 @@ Polecenie umożliwiające dodanie odwołania do pakietu - - Package references to add - Odwołania do pakietów, które mają zostać dodane - - Please specify one package reference to add. Podaj jedno odwołanie do pakietu, które ma zostać dodane. - Add reference only when targetting a specific framework - Dodaj odwołanie tylko w przypadku określenia konkretnej platformy docelowej - + Adds reference only when targeting a specific framework. + Dodaj odwołanie tylko w przypadku określenia konkretnej platformy docelowej + - Add reference without performing restore preview and compatibility check. - Dodaj odwołanie bez tworzenia podglądu przywracania i sprawdzania zgodności. - + Adds reference without performing restore preview and compatibility check. + Dodaj odwołanie bez tworzenia podglądu przywracania i sprawdzania zgodności. + - Use specific NuGet package sources to use during the restore. - Użyj konkretnych źródeł pakietów NuGet podczas przywracania. - + Specifies NuGet package sources to use during the restore. + Użyj konkretnych źródeł pakietów NuGet podczas przywracania. + - Restore the packages to this Directory . - Przywróć pakiety do tego katalogu. - + Restores the packages to the specified directory. + Przywróć pakiety do tego katalogu. + Version for the package to be added. @@ -49,9 +44,9 @@ - Unable to Create Dependency graph file for project '{0}'. Cannot add package reference. - Nie można utworzyć pliku wykresu tworzenia zależności dla projektu „{0}”. Nie można dodać odwołania do pakietu. - + Unable to create dependency graph file for project '{0}'. Cannot add package reference. + Nie można utworzyć pliku wykresu tworzenia zależności dla projektu „{0}”. Nie można dodać odwołania do pakietu. + VERSION @@ -73,6 +68,16 @@ KATALOG_PAKIETU + + The package reference to add. + The package reference to add. + + + + PACKAGE_NAME + PACKAGE_NAME + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.pt-BR.xlf index cc564117f..13d17f66d 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.pt-BR.xlf @@ -13,35 +13,30 @@ Comando para adicionar a referência do pacote - - Package references to add - Referências do pacote a serem adicionadas - - Please specify one package reference to add. Especifique uma referência do pacote a ser adicionada. - Add reference only when targetting a specific framework - Adicionar referência apenas ao visar uma estrutura específica - + Adds reference only when targeting a specific framework. + Adicionar referência apenas ao visar uma estrutura específica + - Add reference without performing restore preview and compatibility check. - Adicionar referência ser executar a restauração de visualização e verificação de compatibilidade. - + Adds reference without performing restore preview and compatibility check. + Adicionar referência ser executar a restauração de visualização e verificação de compatibilidade. + - Use specific NuGet package sources to use during the restore. - Usa fontes de pacote do NuGet especificadas a serem usadas durante a restauração. - + Specifies NuGet package sources to use during the restore. + Usa fontes de pacote do NuGet especificadas a serem usadas durante a restauração. + - Restore the packages to this Directory . - Restaurar os pacotes para esse Diretório. - + Restores the packages to the specified directory. + Restaurar os pacotes para esse Diretório. + Version for the package to be added. @@ -49,9 +44,9 @@ - Unable to Create Dependency graph file for project '{0}'. Cannot add package reference. - Não é possível criar o arquivo de gráfico Criar Dependência para o projeto '{0}'. Não é possível adicionar a referência do pacote. - + Unable to create dependency graph file for project '{0}'. Cannot add package reference. + Não é possível criar o arquivo de gráfico Criar Dependência para o projeto '{0}'. Não é possível adicionar a referência do pacote. + VERSION @@ -73,6 +68,16 @@ PACKAGE_DIRECTORY + + The package reference to add. + The package reference to add. + + + + PACKAGE_NAME + PACKAGE_NAME + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ru.xlf index 14d5108fc..1d5f9d385 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ru.xlf @@ -13,35 +13,30 @@ Команда добавления ссылки на пакет - - Package references to add - Добавляемые ссылки на пакеты - - Please specify one package reference to add. Укажите одну добавляемую ссылку на пакет. - Add reference only when targetting a specific framework - Добавлять ссылку только при выборе конкретной целевой платформы - + Adds reference only when targeting a specific framework. + Добавлять ссылку только при выборе конкретной целевой платформы + - Add reference without performing restore preview and compatibility check. - Добавление ссылки без предварительной проверки восстановления и совместимости. - + Adds reference without performing restore preview and compatibility check. + Добавление ссылки без предварительной проверки восстановления и совместимости. + - Use specific NuGet package sources to use during the restore. - Указание конкретных источников пакетов NuGet, используемых во время восстановления. - + Specifies NuGet package sources to use during the restore. + Указание конкретных источников пакетов NuGet, используемых во время восстановления. + - Restore the packages to this Directory . - Восстановление пакетов в указанном каталоге. - + Restores the packages to the specified directory. + Восстановление пакетов в указанном каталоге. + Version for the package to be added. @@ -49,9 +44,9 @@ - Unable to Create Dependency graph file for project '{0}'. Cannot add package reference. - Не удалось создать файл графа зависимостей для проекта {0}. Невозможно добавить ссылку на пакет. - + Unable to create dependency graph file for project '{0}'. Cannot add package reference. + Не удалось создать файл графа зависимостей для проекта {0}. Невозможно добавить ссылку на пакет. + VERSION @@ -73,6 +68,16 @@ PACKAGE_DIRECTORY + + The package reference to add. + The package reference to add. + + + + PACKAGE_NAME + PACKAGE_NAME + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.tr.xlf index 9ad58f591..317cab12d 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.tr.xlf @@ -13,35 +13,30 @@ Paket başvurusu ekleme komutu - - Package references to add - Eklenecek paket başvuruları - - Please specify one package reference to add. Lütfen eklenecek paket başvurusunu belirtin. - Add reference only when targetting a specific framework - Yalnızca belirli bir çerçeveyi hedeflerken başvuru ekler - + Adds reference only when targeting a specific framework. + Yalnızca belirli bir çerçeveyi hedeflerken başvuru ekler + - Add reference without performing restore preview and compatibility check. - Geri yükleme önizlemesi ve uyumluluk denetimi gerçekleştirmeden başvuru ekler. - + Adds reference without performing restore preview and compatibility check. + Geri yükleme önizlemesi ve uyumluluk denetimi gerçekleştirmeden başvuru ekler. + - Use specific NuGet package sources to use during the restore. - Geri yükleme sırasında kullanılacak belirli NuGet paket kaynaklarını kullanır. - + Specifies NuGet package sources to use during the restore. + Geri yükleme sırasında kullanılacak belirli NuGet paket kaynaklarını kullanır. + - Restore the packages to this Directory . - Paketleri bu Dizine geri yükler. - + Restores the packages to the specified directory. + Paketleri bu Dizine geri yükler. + Version for the package to be added. @@ -49,9 +44,9 @@ - Unable to Create Dependency graph file for project '{0}'. Cannot add package reference. - '{0}' projesi için Bağımlılık grafiği dosyası oluşturulamadı. Paket başvurusu eklenemiyor. - + Unable to create dependency graph file for project '{0}'. Cannot add package reference. + '{0}' projesi için Bağımlılık grafiği dosyası oluşturulamadı. Paket başvurusu eklenemiyor. + VERSION @@ -73,6 +68,16 @@ PACKAGE_DIRECTORY + + The package reference to add. + The package reference to add. + + + + PACKAGE_NAME + PACKAGE_NAME + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.xlf index 5002b59b5..cb7dc33f1 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.xlf @@ -11,37 +11,33 @@ Command to add package reference - - Package references to add - - Please specify one package reference to add. - Add reference only when targetting a specific framework - + Adds reference only when targeting a specific framework. + - Add reference without performing restore preview and compatibility check. - + Adds reference without performing restore preview and compatibility check. + - Use specific NuGet package sources to use during the restore. - + Specifies NuGet package sources to use during the restore. + - Restore the packages to this Directory . - + Restores the packages to the specified directory. + Version for the package to be added. - Unable to Create Dependency graph file for project '{0}'. Cannot add package reference. - + Unable to create dependency graph file for project '{0}'. Cannot add package reference. + VERSION @@ -59,6 +55,14 @@ PACKAGE_DIRECTORY + + The package reference to add. + + + + PACKAGE_NAME + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hans.xlf index 2b50715d9..5e14ea6f7 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hans.xlf @@ -13,35 +13,30 @@ 添加包引用的命令 - - Package references to add - 要添加的包引用 - - Please specify one package reference to add. 请指定一个要添加的包引用。 - Add reference only when targetting a specific framework - 仅针对特定框架添加引用 - + Adds reference only when targeting a specific framework. + 仅针对特定框架添加引用 + - Add reference without performing restore preview and compatibility check. - 在没有执行还原预览和兼容性检查的情况下添加引用。 - + Adds reference without performing restore preview and compatibility check. + 在没有执行还原预览和兼容性检查的情况下添加引用。 + - Use specific NuGet package sources to use during the restore. - 使用还原期间使用的特定 NuGet 包源。 - + Specifies NuGet package sources to use during the restore. + 使用还原期间使用的特定 NuGet 包源。 + - Restore the packages to this Directory . - 将包还原到此目录。 - + Restores the packages to the specified directory. + 将包还原到此目录。 + Version for the package to be added. @@ -49,9 +44,9 @@ - Unable to Create Dependency graph file for project '{0}'. Cannot add package reference. - 无法为项目“{0}”创建依赖关系图文件。无法添加包引用。 - + Unable to create dependency graph file for project '{0}'. Cannot add package reference. + 无法为项目“{0}”创建依赖关系图文件。无法添加包引用。 + VERSION @@ -73,6 +68,16 @@ PACKAGE_DIRECTORY + + The package reference to add. + The package reference to add. + + + + PACKAGE_NAME + PACKAGE_NAME + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hant.xlf index 52e90f9ab..be0065892 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hant.xlf @@ -13,35 +13,30 @@ 用以新增套件參考的命令 - - Package references to add - 要新增的套件參考 - - Please specify one package reference to add. 請指定一個要新增的套件參考。 - Add reference only when targetting a specific framework - 只有在以特定架構為目標時才新增參考 - + Adds reference only when targeting a specific framework. + 只有在以特定架構為目標時才新增參考 + - Add reference without performing restore preview and compatibility check. - 不須執行還原預覽及相容性檢查即可新增參考。 - + Adds reference without performing restore preview and compatibility check. + 不須執行還原預覽及相容性檢查即可新增參考。 + - Use specific NuGet package sources to use during the restore. - 使用要在還原期間使用的 NuGet 套件來源。 - + Specifies NuGet package sources to use during the restore. + 使用要在還原期間使用的 NuGet 套件來源。 + - Restore the packages to this Directory . - 將套件還原到此目錄。 - + Restores the packages to the specified directory. + 將套件還原到此目錄。 + Version for the package to be added. @@ -49,9 +44,9 @@ - Unable to Create Dependency graph file for project '{0}'. Cannot add package reference. - 無法建立專案 '{0}' 的相依性關係圖檔案。無法新增套件參考。 - + Unable to create dependency graph file for project '{0}'. Cannot add package reference. + 無法建立專案 '{0}' 的相依性關係圖檔案。無法新增套件參考。 + VERSION @@ -73,6 +68,16 @@ PACKAGE_DIRECTORY + + The package reference to add. + The package reference to add. + + + + PACKAGE_NAME + PACKAGE_NAME + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.cs.xlf index e7f2ec5a6..a8200f568 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.cs.xlf @@ -19,9 +19,9 @@ - Add reference only when targetting a specific framework - Přidat odkaz jen při zaměření na určitou platformu - + Add reference only when targeting a specific framework + Přidat odkaz jen při zaměření na určitou platformu + diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.de.xlf index ab216036c..e2c4848ce 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.de.xlf @@ -19,9 +19,9 @@ - Add reference only when targetting a specific framework - Verweis nur bei Verwendung eines bestimmten Zielframeworks hinzufügen - + Add reference only when targeting a specific framework + Verweis nur bei Verwendung eines bestimmten Zielframeworks hinzufügen + diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.es.xlf index 41577c611..93d2436be 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.es.xlf @@ -19,9 +19,9 @@ - Add reference only when targetting a specific framework - Se agrega una referencia solo cuando hay una plataforma de destino específica - + Add reference only when targeting a specific framework + Se agrega una referencia solo cuando hay una plataforma de destino específica + diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.fr.xlf index 70196228a..2f9000fa6 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.fr.xlf @@ -19,9 +19,9 @@ - Add reference only when targetting a specific framework - Ajouter une référence uniquement en cas de ciblage d'un framework spécifique - + Add reference only when targeting a specific framework + Ajouter une référence uniquement en cas de ciblage d'un framework spécifique + diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.it.xlf index ada7aee58..d58cbc1dd 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.it.xlf @@ -19,9 +19,9 @@ - Add reference only when targetting a specific framework - Aggiunge il riferimento solo se destinato a un framework specifico - + Add reference only when targeting a specific framework + Aggiunge il riferimento solo se destinato a un framework specifico + diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.ja.xlf index 53dad6616..e553fddbf 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.ja.xlf @@ -19,9 +19,9 @@ - Add reference only when targetting a specific framework - 特定のフレームワークを対象とする場合にのみ参照を追加する - + Add reference only when targeting a specific framework + 特定のフレームワークを対象とする場合にのみ参照を追加する + diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.ko.xlf index a0d05418b..c7ca892a9 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.ko.xlf @@ -19,9 +19,9 @@ - Add reference only when targetting a specific framework - 특정 프레임워크를 대상으로 지정할 때에만 참조를 추가합니다. - + Add reference only when targeting a specific framework + 특정 프레임워크를 대상으로 지정할 때에만 참조를 추가합니다. + diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.pl.xlf index 3f1ad612c..d2d59248f 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.pl.xlf @@ -19,9 +19,9 @@ - Add reference only when targetting a specific framework - Dodaj odwołanie tylko w przypadku określenia konkretnej platformy docelowej - + Add reference only when targeting a specific framework + Dodaj odwołanie tylko w przypadku określenia konkretnej platformy docelowej + diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.pt-BR.xlf index 2f7bcade7..7accbdc59 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.pt-BR.xlf @@ -19,9 +19,9 @@ - Add reference only when targetting a specific framework - Adicionar referência apenas ao visar uma estrutura específica - + Add reference only when targeting a specific framework + Adicionar referência apenas ao visar uma estrutura específica + diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.ru.xlf index 3198bd913..c346f243e 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.ru.xlf @@ -19,9 +19,9 @@ - Add reference only when targetting a specific framework - Добавлять ссылку только при выборе конкретной целевой платформы - + Add reference only when targeting a specific framework + Добавлять ссылку только при выборе конкретной целевой платформы + diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.tr.xlf index 23de59c66..43b422df8 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.tr.xlf @@ -19,9 +19,9 @@ - Add reference only when targetting a specific framework - Yalnızca belirli bir çerçeveyi hedeflerken başvuru ekler - + Add reference only when targeting a specific framework + Yalnızca belirli bir çerçeveyi hedeflerken başvuru ekler + diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.xlf index 6f8ec752e..d792b5ef3 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.xlf @@ -5,19 +5,19 @@ .NET Add Project to Project reference Command - + Command to add project to project reference - + Project to project references to add - Add reference only when targetting a specific framework - + Add reference only when targeting a specific framework + diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.zh-Hans.xlf index b5497776a..f71d2fb9d 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.zh-Hans.xlf @@ -19,9 +19,9 @@ - Add reference only when targetting a specific framework - 仅针对特定框架添加引用 - + Add reference only when targeting a specific framework + 仅针对特定框架添加引用 + diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.zh-Hant.xlf index 94c9c7298..6e1e60a11 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.zh-Hant.xlf @@ -19,9 +19,9 @@ - Add reference only when targetting a specific framework - 只有在以特定架構為目標時才新增參考 - + Add reference only when targeting a specific framework + 只有在以特定架構為目標時才新增參考 + diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.cs.xlf index 33a9a4980..c0a5e6c84 100644 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.cs.xlf @@ -13,26 +13,6 @@ .NET Builder - - Configuration to use for building the project. Default for most projects is "Debug". - Konfigurace použitá k sestavení projektu. Výchozí možnost u většiny projektů je „Debug“. - - - - CONFIGURATION - CONFIGURATION - - - - Target framework to build for. The target framework has to be specified in the project file. - Cílová platforma, pro kterou sestavujete projekt. Cílová platforma musí být v souboru projektu zadaná. - - - - FRAMEWORK - FRAMEWORK - - Set this flag to ignore project-to-project references and only build the root project Když nastavíte tento příznak, ignorují se odkazy mezi projekty a sestaví se jenom kořenový projekt. @@ -53,36 +33,6 @@ OUTPUT_DIR - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - Soubor projektu MSBuildu určený k sestavení. Pokud není zadaný soubor projektu, nástroj MSBuild vyhledá v aktuálním pracovním adresáři soubor s příponou, která končí na „proj“, a použije ho. - - - - PROJECT - PROJECT - - - - Target runtime to build for. The default is to build a portable application. - Cílový modul runtime pro sestavení. Výchozí možnost je sestavit přenosnou aplikaci. - - - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Defines the value for the $(VersionSuffix) property in the project - Definuje hodnotu vlastnosti $(VersionSuffix) v projektu. - - - - VERSION_SUFFIX - VERSION_SUFFIX - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.de.xlf index c2f97f3fb..4fdd9a648 100644 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.de.xlf @@ -13,26 +13,6 @@ .NET-Generator - - Configuration to use for building the project. Default for most projects is "Debug". - Konfiguration für die Erstellung des Projekts. Standard für die meisten Projekte ist "Debug". - - - - CONFIGURATION - CONFIGURATION - - - - Target framework to build for. The target framework has to be specified in the project file. - Zielframework für die Erstellung. Das Zielframework muss in der Projektdatei angegeben werden. - - - - FRAMEWORK - FRAMEWORK - - Set this flag to ignore project-to-project references and only build the root project Legen Sie dieses Flag fest, um Projekt-zu-Projekt-Verweise zu ignorieren und nur das Stammprojekt zu erstellen. @@ -53,36 +33,6 @@ OUTPUT_DIR - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - Die zu erstellende MSBuild-Projektdatei. Wenn keine Projektdatei angegeben ist, durchsucht MSBuild das aktuelle Arbeitsverzeichnis nach einer Datei mit einer Dateierweiterung, die auf "proj" endet, und verwendet diese Datei. - - - - PROJECT - PROJECT - - - - Target runtime to build for. The default is to build a portable application. - Ziellaufzeit für die Erstellung. Standardmäßig wird eine portable Anwendung erstellt. - - - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Defines the value for the $(VersionSuffix) property in the project - Definiert den Wert für die Eigenschaft "$(VersionSuffix)" im Projekt. - - - - VERSION_SUFFIX - VERSION_SUFFIX - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.es.xlf index 403a21e6b..fc185e4a0 100644 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.es.xlf @@ -13,26 +13,6 @@ Generador para .NET - - Configuration to use for building the project. Default for most projects is "Debug". - Configuración para usar para crear el proyecto. El valor predeterminado para la mayoría de los proyectos es "Depurar". - - - - CONFIGURATION - CONFIGURACIÓN - - - - Target framework to build for. The target framework has to be specified in the project file. - Plataforma de destino para la que se compila. La plataforma de destino se debe especificar en el archivo de proyecto. - - - - FRAMEWORK - PLATAFORMA - - Set this flag to ignore project-to-project references and only build the root project Establezca esta marca para omitir las referencias de proyecto a proyecto y compilar solo el proyecto raíz @@ -53,36 +33,6 @@ DIRECTORIO_DE_SALIDA - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - Archivo del proyecto de MSBuild para compilar. Si no se especifica un archivo del proyecto, MSBuild busca en el directorio de trabajo actual un archivo que tenga una extensión de archivo que acabe en “proj” y utiliza ese archivo. - - - - PROJECT - PROYECTO - - - - Target runtime to build for. The default is to build a portable application. - Entorno de tiempo de ejecución para el que se compila. La opción predeterminada es compilar una aplicación móvil. - - - - RUNTIME_IDENTIFIER - ID_DEL_ENTORNO_DE_TIEMPO_DE_EJECUCIÓN - - - - Defines the value for the $(VersionSuffix) property in the project - Define el valor para la propiedad $(VersionSuffix) del proyecto - - - - VERSION_SUFFIX - SUFIJO_DE_VERSIÓN - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.fr.xlf index 55a1575c0..3121c29fe 100644 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.fr.xlf @@ -13,26 +13,6 @@ Générateur .NET - - Configuration to use for building the project. Default for most projects is "Debug". - Configuration à utiliser pour la génération du projet. La valeur par défaut pour la plupart des projets est "Debug". - - - - CONFIGURATION - CONFIGURATION - - - - Target framework to build for. The target framework has to be specified in the project file. - Framework cible de la build. Le framework cible doit être spécifié dans le fichier projet. - - - - FRAMEWORK - FRAMEWORK - - Set this flag to ignore project-to-project references and only build the root project Définir cet indicateur pour ignorer les références de projet à projet et générer uniquement le projet racine @@ -53,36 +33,6 @@ RÉP_SORTIE - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - Fichier projet MSBuild à générer. Si aucun fichier projet n'est spécifié, MSBuild recherche dans le répertoire de travail actif un fichier dont l'extension se termine par 'proj' et utilise ce dernier. - - - - PROJECT - PROJET - - - - Target runtime to build for. The default is to build a portable application. - Runtime cible de la génération. Par défaut, une application portable est générée. - - - - RUNTIME_IDENTIFIER - IDENTIFICATEUR_RUNTIME - - - - Defines the value for the $(VersionSuffix) property in the project - Définit la valeur de la propriété $(VersionSuffix) dans le projet - - - - VERSION_SUFFIX - SUFFIXE_VERSION - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.it.xlf index f521c6351..8dc7bf25b 100644 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.it.xlf @@ -13,26 +13,6 @@ Generatore .NET - - Configuration to use for building the project. Default for most projects is "Debug". - Configurazione da usare per compilare il progetto. L'impostazione predefinita per la maggior parte dei progetti è "Debug". - - - - CONFIGURATION - CONFIGURAZIONE - - - - Target framework to build for. The target framework has to be specified in the project file. - Framework di destinazione per cui eseguire la compilazione. Il framework di destinazione deve essere specificato nel file di progetto. - - - - FRAMEWORK - FRAMEWORK - - Set this flag to ignore project-to-project references and only build the root project Impostare questo flag per ignorare i riferimenti P2P (da progetto a progetto) e compilare solo il progetto radice @@ -53,36 +33,6 @@ DIR_OUTPUT - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - File di progetto MSBuild da compilare. Se non si specifica un file di progetto, MSBuild cerca nella directory di lavoro corrente un file la cui estensione termina con `proj` e usa tale file. - - - - PROJECT - PROGETTO - - - - Target runtime to build for. The default is to build a portable application. - Runtime di destinazione per cui eseguire la compilazione. Per impostazione predefinita, viene compilata un'applicazione portatile. - - - - RUNTIME_IDENTIFIER - IDENTIFICATORE_RUNTIME - - - - Defines the value for the $(VersionSuffix) property in the project - Consente di definire il valore per la proprietà $(VersionSuffix) nel progetto - - - - VERSION_SUFFIX - SUFFISSO_VERSIONE - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.ja.xlf index 6fe3491c1..e84f911f0 100644 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.ja.xlf @@ -13,26 +13,6 @@ .NET ビルダー - - Configuration to use for building the project. Default for most projects is "Debug". - プロジェクトの構築に使用する構成。ほとんどのプロジェクトで既定は "デバッグ" です。 - - - - CONFIGURATION - CONFIGURATION - - - - Target framework to build for. The target framework has to be specified in the project file. - 構築用のターゲット フレームワーク。ターゲット フレームワークはプロジェクト ファイルで指定する必要があります。 - - - - FRAMEWORK - FRAMEWORK - - Set this flag to ignore project-to-project references and only build the root project プロジェクト間参照を無視して、ルート プロジェクトのみを構築するには、このフラグを設定します @@ -53,36 +33,6 @@ OUTPUT_DIR - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - 構築する MSBuild プロジェクト ファイル。プロジェクト ファイルを指定しなかった場合、MSBuild は現在の作業ディレクトリの中から "proj" で終わるファイル拡張子を検索し、そのファイルを使用します。 - - - - PROJECT - PROJECT - - - - Target runtime to build for. The default is to build a portable application. - 構築用のターゲット ランタイム既定では、ポータブル アプリケーションを構築します。 - - - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Defines the value for the $(VersionSuffix) property in the project - プロジェクトの $(VersionSuffix) プロパティの値を定義します。 - - - - VERSION_SUFFIX - VERSION_SUFFIX - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.ko.xlf index 9500478f2..c14e5b5e0 100644 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.ko.xlf @@ -13,26 +13,6 @@ .NET 작성기 - - Configuration to use for building the project. Default for most projects is "Debug". - 프로젝트 빌드에 사용할 구성입니다. 대부분의 프로젝트에서 기본값은 "Debug"입니다. - - - - CONFIGURATION - CONFIGURATION - - - - Target framework to build for. The target framework has to be specified in the project file. - 빌드할 대상 프레임워크입니다. 대상 프레임워크는 프로젝트 파일에서 지정해야 합니다. - - - - FRAMEWORK - FRAMEWORK - - Set this flag to ignore project-to-project references and only build the root project p2p(프로젝트 간) 참조를 무시하고 루트 프로젝트만 빌드하려면 이 플래그를 설정합니다. @@ -53,36 +33,6 @@ OUTPUT_DIR - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - 빌드할 MSBuild 프로젝트 파일입니다. 프로젝트 파일을 지정하지 않으면 MSBuild는 현재 작업 디렉터리에서 파일 확장명이 ‘proj’로 끝나는 파일을 찾아서 사용합니다. - - - - PROJECT - PROJECT - - - - Target runtime to build for. The default is to build a portable application. - 빌드할 대상 런타임입니다. 기본값은 이식 가능한 응용 프로그램을 빌드하는 것입니다. - - - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Defines the value for the $(VersionSuffix) property in the project - 프로젝트에서 $(VersionSuffix) 속성의 값을 정의합니다. - - - - VERSION_SUFFIX - VERSION_SUFFIX - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.pl.xlf index 51e5ee2a4..108d64fd8 100644 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.pl.xlf @@ -13,26 +13,6 @@ Konstruktor platformy .NET - - Configuration to use for building the project. Default for most projects is "Debug". - Konfiguracja do użycia na potrzeby kompilacji projektu. Opcją domyślną w przypadku większości projektów jest „Debug”. - - - - CONFIGURATION - KONFIGURACJA - - - - Target framework to build for. The target framework has to be specified in the project file. - Docelowa platforma kompilacji. Platforma docelowa musi być określona w pliku projektu. - - - - FRAMEWORK - PLATFORMA - - Set this flag to ignore project-to-project references and only build the root project Ustaw tę flagę, aby ignorować odwołania między projektami i skompilować tylko projekt główny @@ -53,36 +33,6 @@ KATALOG_WYJŚCIOWY - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - Plik projektu programu MSBuild do skompilowania. Jeśli nie określono pliku projektu, program MSBuild wyszukuje w bieżącym katalogu roboczym plik, którego rozszerzenie kończy się na „proj”, i używa tego pliku. - - - - PROJECT - PROJEKT - - - - Target runtime to build for. The default is to build a portable application. - Docelowe środowisko uruchomieniowe kompilacji. Opcją domyślną jest kompilacja aplikacji przenośnej. - - - - RUNTIME_IDENTIFIER - IDENTYFIKATOR_ŚRODOWISKA_URUCHOMIENIOWEGO - - - - Defines the value for the $(VersionSuffix) property in the project - Określa wartość właściwości $(VersionSuffix) w projekcie - - - - VERSION_SUFFIX - SUFIKS_WERSJI - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.pt-BR.xlf index 3273e988f..654e4f9d8 100644 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.pt-BR.xlf @@ -13,26 +13,6 @@ Construtor do .NET - - Configuration to use for building the project. Default for most projects is "Debug". - A configuração a ser usada para criar o projeto. O padrão para a maioria dos projetos é “Depurar”. - - - - CONFIGURATION - CONFIGURAÇÃO - - - - Target framework to build for. The target framework has to be specified in the project file. - A estrutura de destino para a qual compilar. A estrutura de destino deve ser especificada no arquivo de projeto. - - - - FRAMEWORK - ESTRUTURA - - Set this flag to ignore project-to-project references and only build the root project Defina esse sinalizador para ignorar as referências projeto a projeto e compilar apenas o projeto raiz @@ -53,36 +33,6 @@ DIRETÓRIO_DE_SAÍDA - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - O arquivo de projeto do MSBuild para compilar. Se não houver arquivo de projeto especificado, o MSBuild pesquisará no diretório de trabalho atual um arquivo que contenha uma extensão de arquivo que termine em "proj" e usará esse arquivo. - - - - PROJECT - PROJETO - - - - Target runtime to build for. The default is to build a portable application. - Tempo de execução de destino para o qual compilar. O padrão é compilar um aplicativo portátil. - - - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Defines the value for the $(VersionSuffix) property in the project - Define o valor da propriedade $(VersionSuffix) no projeto - - - - VERSION_SUFFIX - SUFIXO_DA_VERSÃO - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.ru.xlf index 263a23cf5..05c64e84d 100644 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.ru.xlf @@ -13,26 +13,6 @@ Построитель .NET - - Configuration to use for building the project. Default for most projects is "Debug". - Конфигурация, используемая для сборки проекта. Значение по умолчанию для большинства проектов — "Debug". - - - - CONFIGURATION - CONFIGURATION - - - - Target framework to build for. The target framework has to be specified in the project file. - Целевая платформа для сборки. Целевая платформа должна быть указана в файле проекта. - - - - FRAMEWORK - FRAMEWORK - - Set this flag to ignore project-to-project references and only build the root project Задайте этот флаг, чтобы пропускать ссылки проектов на проекты и выполнять сборку только корневого проекта. @@ -53,36 +33,6 @@ OUTPUT_DIR - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - Файл проекта MSBuild для сборки. Если файл проекта не указан, MSBuild выполняет в текущем рабочем каталоге поиск файла с расширением, оканчивающимся на PROJ, и использует этот файл. - - - - PROJECT - PROJECT - - - - Target runtime to build for. The default is to build a portable application. - Целевая среда выполнения для сборки. По умолчанию выполняется сборка переносимого приложения. - - - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Defines the value for the $(VersionSuffix) property in the project - Определяет значение для свойства $(VersionSuffix) в проекте - - - - VERSION_SUFFIX - VERSION_SUFFIX - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.tr.xlf index 76f3dc686..3edfa8849 100644 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.tr.xlf @@ -13,26 +13,6 @@ .NET Oluşturucusu - - Configuration to use for building the project. Default for most projects is "Debug". - Projeyi derlemek için kullanılacak yapılandırma. Çoğu proje için varsayılan: "Debug". - - - - CONFIGURATION - YAPILANDIRMA - - - - Target framework to build for. The target framework has to be specified in the project file. - Derlemenin yapılacağı hedef çerçeve. Hedef çerçevenin proje dosyasında belirtilmesi gerekir. - - - - FRAMEWORK - ÇERÇEVE - - Set this flag to ignore project-to-project references and only build the root project Projeden projeye başvuruları yoksaymak ve yalnızca kök projeyi derlemek için bu bayrağı ayarlayın @@ -53,36 +33,6 @@ ÇIKIŞ_DİZİNİ - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - Derlenecek MSBuild proje dosyası. Bir proje dosyası belirtilmezse MSBuild, geçerli çalışma dizininde dosya uzantısının sonu ‘proj’ olan bir dosyası arar ve bu dosyayı kullanır. - - - - PROJECT - PROJE - - - - Target runtime to build for. The default is to build a portable application. - Derlemenin yapılacağı hedef çalışma zamanı. Varsayılan değer, taşınabilir bir uygulama derlenmesidir. - - - - RUNTIME_IDENTIFIER - ÇALIŞMA_ZAMANI_TANIMLAYICISI - - - - Defines the value for the $(VersionSuffix) property in the project - Projedeki $(VersionSuffix) özelliğinin değerini tanımlar - - - - VERSION_SUFFIX - SÜRÜM_SONEKİ - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.xlf index 1b7967b8c..2e1630d6f 100644 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.xlf +++ b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.xlf @@ -11,22 +11,6 @@ .NET Builder - - Configuration to use for building the project. Default for most projects is "Debug". - - - - CONFIGURATION - - - - Target framework to build for. The target framework has to be specified in the project file. - - - - FRAMEWORK - - Set this flag to ignore project-to-project references and only build the root project @@ -43,30 +27,6 @@ OUTPUT_DIR - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - - - - PROJECT - - - - Target runtime to build for. The default is to build a portable application. - - - - RUNTIME_IDENTIFIER - - - - Defines the value for the $(VersionSuffix) property in the project - - - - VERSION_SUFFIX - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.zh-Hans.xlf index 5afa26c3d..6363f5ef8 100644 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.zh-Hans.xlf @@ -13,26 +13,6 @@ .NET 生成器 - - Configuration to use for building the project. Default for most projects is "Debug". - 用于生成项目的配置。对大多数项目的默认值是 "Debug"。 - - - - CONFIGURATION - CONFIGURATION - - - - Target framework to build for. The target framework has to be specified in the project file. - 要生成的目标框架。目标框架必须在项目文件中指定。 - - - - FRAMEWORK - FRAMEWORK - - Set this flag to ignore project-to-project references and only build the root project 设置此标志以忽略项目到项目引用,仅生成根项目 @@ -53,36 +33,6 @@ OUTPUT_DIR - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - 要生成的 MSBuild 项目文件。如果未指定项目文件,MSBuild 将搜索当前工作目录来查找文件扩展名以“proj”结尾的文件并使用该文件。 - - - - PROJECT - PROJECT - - - - Target runtime to build for. The default is to build a portable application. - 要生成的目标运行时。默认生成可移植的应用程序。 - - - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Defines the value for the $(VersionSuffix) property in the project - 定义项目中 $(VersionSuffix)属性的值 - - - - VERSION_SUFFIX - VERSION_SUFFIX - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.zh-Hant.xlf index 2fd8a2ff8..7156375a1 100644 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.zh-Hant.xlf @@ -13,26 +13,6 @@ .NET 產生器 - - Configuration to use for building the project. Default for most projects is "Debug". - 要用於建置專案的組態。多數專案的預設為 "Debug"。 - - - - CONFIGURATION - 組態 - - - - Target framework to build for. The target framework has to be specified in the project file. - 要對其建置的目標 Framework。目標 Framework 必須在專案檔中指定。 - - - - FRAMEWORK - 架構 - - Set this flag to ignore project-to-project references and only build the root project 將此旗標設定為略過專案對專案參考並僅建置根專案 @@ -53,36 +33,6 @@ OUTPUT_DIR - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - 要建置的 MSBuild 專案檔。若未指定專案檔,MSBuild 會在目前的工作目錄搜尋副檔名以 `proj` 結尾的檔案,並使用該檔案。 - - - - PROJECT - 專案 - - - - Target runtime to build for. The default is to build a portable application. - 要為其建置的目標執行階段。預設為建置可攜式應用程式。 - - - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Defines the value for the $(VersionSuffix) property in the project - 定義專案中 $(VersionSuffix) 屬性的值 - - - - VERSION_SUFFIX - VERSION_SUFFIX - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.cs.xlf index 196f72cd4..7aa3a3027 100644 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.cs.xlf @@ -13,16 +13,6 @@ Příkaz slouží k vyčištění vygenerovaných výstupů buildů. - - PROJECT - PROJECT - - - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - Soubor projektu MSBuildu určený k sestavení. Pokud není zadaný soubor projektu, nástroj MSBuild vyhledá v aktuálním pracovním adresáři soubor s příponou, která končí na „proj“, a použije ho. - - OUTPUT_DIR OUTPUT_DIR @@ -33,26 +23,6 @@ Adresář, do kterého byly umístěny výstupy buildu. - - FRAMEWORK - FRAMEWORK - - - - Clean a specific framework. - Umožňuje vyčistit určitou platformu. - - - - CONFIGURATION - CONFIGURATION - - - - Clean a specific configuration. - Umožňuje vyčistit určitou konfiguraci. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.de.xlf index 06eb43ae3..3a3e39b3d 100644 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.de.xlf @@ -13,16 +13,6 @@ Befehl zum Bereinigen zuvor generierter Buildausgaben. - - PROJECT - PROJECT - - - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - Die zu erstellende MSBuild-Projektdatei. Wenn keine Projektdatei angegeben ist, durchsucht MSBuild das aktuelle Arbeitsverzeichnis nach einer Datei mit einer Dateierweiterung, die auf "proj" endet, und verwendet diese Datei. - - OUTPUT_DIR OUTPUT_DIR @@ -33,26 +23,6 @@ Verzeichnis, in dem sich die Buildausgaben befinden. - - FRAMEWORK - FRAMEWORK - - - - Clean a specific framework. - Bestimmtes Framework bereinigen. - - - - CONFIGURATION - CONFIGURATION - - - - Clean a specific configuration. - Bestimmte Konfiguration bereinigen. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.es.xlf index 56836b0c4..d123920dc 100644 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.es.xlf @@ -13,16 +13,6 @@ Comando para limpiar los archivos de salida de compilaciones anteriores. - - PROJECT - PROYECTO - - - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - Archivo del proyecto de MSBuild para compilar. Si no se especifica un archivo del proyecto, MSBuild busca en el directorio de trabajo actual un archivo que tenga una extensión de archivo que acabe en “proj” y utiliza ese archivo. - - OUTPUT_DIR DIRECTORIO_DE_SALIDA @@ -33,26 +23,6 @@ Directorio donde se han puesto los archivos de salida de la compilación - - FRAMEWORK - PLATAFORMA - - - - Clean a specific framework. - Limpia una plataforma específica. - - - - CONFIGURATION - CONFIGURACIÓN - - - - Clean a specific configuration. - Limpia una configuración específica. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.fr.xlf index ff5cfe1fe..f504b30c3 100644 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.fr.xlf @@ -13,16 +13,6 @@ Commande de nettoyage des sorties de build générées précédemment. - - PROJECT - PROJET - - - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - Fichier projet MSBuild à générer. Si aucun fichier projet n'est spécifié, MSBuild recherche dans le répertoire de travail actif un fichier dont l'extension se termine par 'proj' et utilise ce dernier. - - OUTPUT_DIR RÉP_SORTIE @@ -33,26 +23,6 @@ Répertoire dans lequel les sorties de build ont été placées - - FRAMEWORK - FRAMEWORK - - - - Clean a specific framework. - Nettoyez un framework spécifique. - - - - CONFIGURATION - CONFIGURATION - - - - Clean a specific configuration. - Nettoyez une configuration spécifique. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.it.xlf index a3004e9bd..866516826 100644 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.it.xlf @@ -13,16 +13,6 @@ Comando per pulire gli output di compilazione generati in precedenza. - - PROJECT - PROGETTO - - - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - File di progetto MSBuild da compilare. Se non si specifica un file di progetto, MSBuild cerca nella directory di lavoro corrente un file la cui estensione termina con `proj` e usa tale file. - - OUTPUT_DIR DIR_OUTPUT @@ -33,26 +23,6 @@ Directory in cui sono stati inseriti gli output di compilazione. - - FRAMEWORK - FRAMEWORK - - - - Clean a specific framework. - Pulisce un framework specifico. - - - - CONFIGURATION - CONFIGURAZIONE - - - - Clean a specific configuration. - Pulisce una configurazione specifica. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.ja.xlf index 2b2111899..e53835137 100644 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.ja.xlf @@ -13,16 +13,6 @@ 以前に生成されたビルド出力を消去するコマンド。 - - PROJECT - PROJECT - - - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - 構築する MSBuild プロジェクト ファイル。プロジェクト ファイルを指定しなかった場合、MSBuild は現在の作業ディレクトリの中から "proj" で終わるファイル拡張子を検索し、そのファイルを使用します。 - - OUTPUT_DIR OUTPUT_DIR @@ -33,26 +23,6 @@ ビルド出力が配置されているディレクトリ。 - - FRAMEWORK - FRAMEWORK - - - - Clean a specific framework. - 特定のフレームワークを消去します。 - - - - CONFIGURATION - CONFIGURATION - - - - Clean a specific configuration. - 特定の構成を消去します。 - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.ko.xlf index be9870ecc..853a75802 100644 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.ko.xlf @@ -13,16 +13,6 @@ 이전에 생성된 빌드 출력을 정리하는 명령입니다. - - PROJECT - PROJECT - - - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - 빌드할 MSBuild 프로젝트 파일입니다. 프로젝트 파일을 지정하지 않으면 MSBuild는 현재 작업 디렉터리에서 파일 확장명이 ‘proj’로 끝나는 파일을 찾아서 사용합니다. - - OUTPUT_DIR OUTPUT_DIR @@ -33,26 +23,6 @@ 빌드 출력이 배치된 디렉터리입니다. - - FRAMEWORK - FRAMEWORK - - - - Clean a specific framework. - 특정 프레임워크를 정리합니다. - - - - CONFIGURATION - CONFIGURATION - - - - Clean a specific configuration. - 특정 구성을 정리합니다. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.pl.xlf index cc7678775..1b0aafe34 100644 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.pl.xlf @@ -13,16 +13,6 @@ Polecenie służące do czyszczenia wcześniej wygenerowanych danych wyjściowych kompilacji. - - PROJECT - PROJEKT - - - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - Plik projektu programu MSBuild do skompilowania. Jeśli nie określono pliku projektu, program MSBuild wyszukuje w bieżącym katalogu roboczym plik, którego rozszerzenie kończy się na „proj”, i używa tego pliku. - - OUTPUT_DIR KATALOG_WYJŚCIOWY @@ -33,26 +23,6 @@ Katalog, w którym zostały umieszczone dane wyjściowe kompilacji. - - FRAMEWORK - PLATFORMA - - - - Clean a specific framework. - Wyczyść określoną platformę. - - - - CONFIGURATION - KONFIGURACJA - - - - Clean a specific configuration. - Wyczyść określoną konfigurację. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.pt-BR.xlf index a722371f9..1f71644f3 100644 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.pt-BR.xlf @@ -13,16 +13,6 @@ Comando para limpar saídas de build geradas anteriormente. - - PROJECT - PROJETO - - - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - O arquivo de projeto do MSBuild para compilar. Se não houver arquivo de projeto especificado, o MSBuild pesquisará no diretório de trabalho atual um arquivo que contenha uma extensão de arquivo que termine em "proj" e usará esse arquivo. - - OUTPUT_DIR DIRETÓRIO_DE_SAÍDA @@ -33,26 +23,6 @@ O diretório no qual as saídas do build foram colocadas. - - FRAMEWORK - ESTRUTURA - - - - Clean a specific framework. - Limpa uma estrutura específica. - - - - CONFIGURATION - CONFIGURAÇÃO - - - - Clean a specific configuration. - Limpa uma configuração específica. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.ru.xlf index 1841d3572..ceab2d3dd 100644 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.ru.xlf @@ -13,16 +13,6 @@ Команда для очистки ранее созданных выходных данных сборки. - - PROJECT - PROJECT - - - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - Файл проекта MSBuild для сборки. Если файл проекта не указан, MSBuild выполняет в текущем рабочем каталоге поиск файла с расширением, оканчивающимся на PROJ, и использует этот файл. - - OUTPUT_DIR OUTPUT_DIR @@ -33,26 +23,6 @@ Каталог, в котором размещаются выходные данные сборки. - - FRAMEWORK - FRAMEWORK - - - - Clean a specific framework. - Очистка определенной платформы. - - - - CONFIGURATION - CONFIGURATION - - - - Clean a specific configuration. - Очистка определенной конфигурации. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.tr.xlf index ed3fa207d..044201f64 100644 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.tr.xlf @@ -13,16 +13,6 @@ Daha önce oluşturulan derleme çıkışlarını temizleme komutu. - - PROJECT - PROJE - - - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - Derlenecek MSBuild proje dosyası. Bir proje dosyası belirtilmezse MSBuild, geçerli çalışma dizininde dosya uzantısının sonu ‘proj’ olan bir dosyası arar ve bu dosyayı kullanır. - - OUTPUT_DIR ÇIKIŞ_DİZİNİ @@ -33,26 +23,6 @@ Derleme çıkışlarının yerleştirildiği dizin. - - FRAMEWORK - ÇERÇEVE - - - - Clean a specific framework. - Belirli bir çerçeveyi temizler. - - - - CONFIGURATION - YAPILANDIRMA - - - - Clean a specific configuration. - Belirli bir yapılandırmayı temizler. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.xlf index 8263ce26c..fb0b2c850 100644 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.xlf +++ b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.xlf @@ -11,14 +11,6 @@ Command to clean previously generated build outputs. - - PROJECT - - - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - - OUTPUT_DIR @@ -27,22 +19,6 @@ Directory in which the build outputs have been placed. - - FRAMEWORK - - - - Clean a specific framework. - - - - CONFIGURATION - - - - Clean a specific configuration. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.zh-Hans.xlf index 615e6f68b..293d38abf 100644 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.zh-Hans.xlf @@ -13,16 +13,6 @@ 用于清除先前产生的生成输出的命令。 - - PROJECT - PROJECT - - - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - 要生成的 MSBuild 项目文件。如果未指定项目文件,MSBuild 将搜索当前工作目录来查找文件扩展名以“proj”结尾的文件并使用该文件。 - - OUTPUT_DIR OUTPUT_DIR @@ -33,26 +23,6 @@ 放置了生成输出的目录。 - - FRAMEWORK - FRAMEWORK - - - - Clean a specific framework. - 清理特定的框架。 - - - - CONFIGURATION - CONFIGURATION - - - - Clean a specific configuration. - 清理特定的配置。 - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.zh-Hant.xlf index fe23cac63..97e205e67 100644 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.zh-Hant.xlf @@ -13,16 +13,6 @@ 用以清除先前產生之建置輸出的命令。 - - PROJECT - 專案 - - - - The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - 要建置的 MSBuild 專案檔。若未指定專案檔,MSBuild 會在目前的工作目錄搜尋副檔名以 `proj` 結尾的檔案,並使用該檔案。 - - OUTPUT_DIR OUTPUT_DIR @@ -33,26 +23,6 @@ 已放置建置輸出的目錄。 - - FRAMEWORK - 架構 - - - - Clean a specific framework. - 清除特定架構。 - - - - CONFIGURATION - 組態 - - - - Clean a specific configuration. - 清除特定組態。 - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/HelpUsageText.cs b/src/dotnet/commands/dotnet-help/HelpUsageText.cs index 0acc60669..f6ae73667 100644 --- a/src/dotnet/commands/dotnet-help/HelpUsageText.cs +++ b/src/dotnet/commands/dotnet-help/HelpUsageText.cs @@ -3,43 +3,45 @@ internal static class HelpUsageText { public static readonly string UsageText = -$@"{LocalizableStrings.Usage}: dotnet [host-options] [command] [arguments] [common-options] +$@"{LocalizableStrings.Usage}: dotnet [runtime-options] [path-to-application] +{LocalizableStrings.Usage}: dotnet [command] [arguments] [command-options] -{LocalizableStrings.Arguments}: - [command] {LocalizableStrings.CommandDefinition} - [arguments] {LocalizableStrings.ArgumentsDefinition} - [host-options] {LocalizableStrings.HostOptionsDefinition} - [common-options] {LocalizableStrings.OptionsDescription} +path-to-application: + {LocalizableStrings.PathToApplicationDefinition} + +{LocalizableStrings.Commands}: + new {LocalizableStrings.NewDefinition} + restore {LocalizableStrings.RestoreDefinition} + run {LocalizableStrings.RunDefinition} + build {LocalizableStrings.BuildDefinition} + publish {LocalizableStrings.PublishDefinition} + test {LocalizableStrings.TestDefinition} + pack {LocalizableStrings.PackDefinition} + migrate {LocalizableStrings.MigrateDefinition} + clean {LocalizableStrings.CleanDefinition} + sln {LocalizableStrings.SlnDefinition} + add {LocalizableStrings.AddDefinition} + remove {LocalizableStrings.RemoveDefinition} + list {LocalizableStrings.ListDefinition} + nuget {LocalizableStrings.NugetDefinition} + msbuild {LocalizableStrings.MsBuildDefinition} + vstest {LocalizableStrings.VsTestDefinition} + -v|--version {LocalizableStrings.SDKVersionCommandDefinition} + -i|--info {LocalizableStrings.SDKInfoCommandDefinition} + -d|--diagnostics {LocalizableStrings.SDKDiagnosticsCommandDefinition} {LocalizableStrings.CommonOptions}: -v|--verbose {LocalizableStrings.VerboseDefinition} -h|--help {LocalizableStrings.HelpDefinition} -{LocalizableStrings.HostOptions}: - -d|--diagnostics {LocalizableStrings.DiagnosticsDefinition} - --version {LocalizableStrings.VersionDescription} - --info {LocalizableStrings.InfoDescription} +{LocalizableStrings.RunDotnetCommandHelpForMore} -{LocalizableStrings.Commands}: - new {LocalizableStrings.NewDefinition} - restore {LocalizableStrings.RestoreDefinition} - build {LocalizableStrings.BuildDefinition} - publish {LocalizableStrings.PublishDefinition} - run {LocalizableStrings.RunDefinition} - test {LocalizableStrings.TestDefinition} - pack {LocalizableStrings.PackDefinition} - migrate {LocalizableStrings.MigrateDefinition} - clean {LocalizableStrings.CleanDefinition} - sln {LocalizableStrings.SlnDefinition} - -{LocalizableStrings.ProjectModificationCommands}: - add {LocalizableStrings.AddDefinition} - remove {LocalizableStrings.RemoveDefinition} - list {LocalizableStrings.ListDefinition} - -{LocalizableStrings.AdvancedCommands}: - nuget {LocalizableStrings.NugetDefinition} - msbuild {LocalizableStrings.MsBuildDefinition} - vstest {LocalizableStrings.VsTestDefinition}"; +runtime-options: + --additionalprobingpath {LocalizableStrings.AdditionalprobingpathDefinition} + --depsfile {LocalizableStrings.DepsfilDefinition} + --runtimeconfig {LocalizableStrings.RuntimeconfigDefinition} + --fx-version {LocalizableStrings.FxVersionDefinition} + --roll-forward-on-no-candidate-fx {LocalizableStrings.RollForwardOnNoCandidateFxDefinition} + --additional-deps {LocalizableStrings.AdditionalDeps} +"; } - diff --git a/src/dotnet/commands/dotnet-help/LocalizableStrings.cs b/src/dotnet/commands/dotnet-help/LocalizableStrings.cs index fee5ac990..91dbf82dd 100644 --- a/src/dotnet/commands/dotnet-help/LocalizableStrings.cs +++ b/src/dotnet/commands/dotnet-help/LocalizableStrings.cs @@ -31,7 +31,7 @@ namespace Microsoft.DotNet.Tools.Help public const string InfoDescription = "Display .NET CLI Info"; - public const string Commands = "Commands"; + public const string Commands = "SDK commands"; public const string NewDefinition = "Initialize .NET projects."; @@ -51,11 +51,11 @@ namespace Microsoft.DotNet.Tools.Help public const string ProjectModificationCommands = "Project modification commands"; - public const string AddDefinition = "Add items to the project."; + public const string AddDefinition = "Add reference to the project."; - public const string RemoveDefinition = "Remove items from the project."; + public const string RemoveDefinition = "Remove reference from the project."; - public const string ListDefinition = "List items in the project."; + public const string ListDefinition = "List reference in the project."; public const string AdvancedCommands = "Advanced Commands"; @@ -79,7 +79,26 @@ namespace Microsoft.DotNet.Tools.Help public const string CommandArgumentDescription = "CLI command for which to view more detailed help."; + public const string PathToApplicationDefinition = "The path to an application .dll file to execute."; + public const string SDKVersionCommandDefinition = "Display .NET Core SDK version."; + public const string SDKInfoCommandDefinition = "Display .NET Core information."; + + public const string SDKDiagnosticsCommandDefinition = "Enable diagnostic output."; + + public const string RunDotnetCommandHelpForMore = "Run 'dotnet COMMAND --help' for more information on a command."; + + public const string AdditionalprobingpathDefinition = "Path containing probing policy and assemblies to probe for."; + + public const string DepsfilDefinition = "Path to .deps.json file."; + + public const string RuntimeconfigDefinition = "Path to .runtimeconfig.json file."; + + public const string FxVersionDefinition = "Version of the installed Shared Framework to use to run the application."; + + public const string RollForwardOnNoCandidateFxDefinition = "Roll forward on no candidate shared framework is enabled."; + + public const string AdditionalDeps = "Path to additonal deps.json file."; } } diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.cs.xlf index cd00b99a1..83c4e64e2 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.cs.xlf @@ -64,9 +64,9 @@ - Commands - Příkazy - + SDK commands + Příkazy + Initialize .NET projects. @@ -114,14 +114,14 @@ - Add items to the project. - Přidá položky do projektu. - + Add reference to the project. + Přidá položky do projektu. + - Remove items from the project. - Odebere položky z projektu. - + Remove reference from the project. + Odebere položky z projektu. + Advanced Commands @@ -158,6 +158,91 @@ Umožňuje upravovat soubory řešení (SLN). + + List reference in the project. + List reference in the project. + + + + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + + + + .NET CLI help utility + .NET CLI help utility + + + + Utility to get more detailed help about each of the CLI commands. + Utility to get more detailed help about each of the CLI commands. + + + + COMMAND_NAME + COMMAND_NAME + + + + CLI command for which to view more detailed help. + CLI command for which to view more detailed help. + + + + The path to an application .dll file to execute. + The path to an application .dll file to execute. + + + + Display .NET Core SDK version. + Display .NET Core SDK version. + + + + Display .NET Core information. + Display .NET Core information. + + + + Enable diagnostic output. + Enable diagnostic output. + + + + Run 'dotnet COMMAND --help' for more information on a command. + Run 'dotnet COMMAND --help' for more information on a command. + + + + Path containing probing policy and assemblies to probe for. + Path containing probing policy and assemblies to probe for. + + + + Path to <application>.deps.json file. + Path to <application>.deps.json file. + + + + Path to <application>.runtimeconfig.json file. + Path to <application>.runtimeconfig.json file. + + + + Version of the installed Shared Framework to use to run the application. + Version of the installed Shared Framework to use to run the application. + + + + Roll forward on no candidate shared framework is enabled. + Roll forward on no candidate shared framework is enabled. + + + + Path to additonal deps.json file. + Path to additonal deps.json file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.de.xlf index d34acd800..f9964ca35 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.de.xlf @@ -64,9 +64,9 @@ - Commands - Befehle - + SDK commands + Befehle + Initialize .NET projects. @@ -114,14 +114,14 @@ - Add items to the project. - Elemente zum Projekt hinzufügen. - + Add reference to the project. + Elemente zum Projekt hinzufügen. + - Remove items from the project. - Elemente aus dem Projekt entfernen. - + Remove reference from the project. + Elemente aus dem Projekt entfernen. + Advanced Commands @@ -158,6 +158,91 @@ Projektmappendateien (SLN-Dateien) ändern. + + List reference in the project. + List reference in the project. + + + + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + + + + .NET CLI help utility + .NET CLI help utility + + + + Utility to get more detailed help about each of the CLI commands. + Utility to get more detailed help about each of the CLI commands. + + + + COMMAND_NAME + COMMAND_NAME + + + + CLI command for which to view more detailed help. + CLI command for which to view more detailed help. + + + + The path to an application .dll file to execute. + The path to an application .dll file to execute. + + + + Display .NET Core SDK version. + Display .NET Core SDK version. + + + + Display .NET Core information. + Display .NET Core information. + + + + Enable diagnostic output. + Enable diagnostic output. + + + + Run 'dotnet COMMAND --help' for more information on a command. + Run 'dotnet COMMAND --help' for more information on a command. + + + + Path containing probing policy and assemblies to probe for. + Path containing probing policy and assemblies to probe for. + + + + Path to <application>.deps.json file. + Path to <application>.deps.json file. + + + + Path to <application>.runtimeconfig.json file. + Path to <application>.runtimeconfig.json file. + + + + Version of the installed Shared Framework to use to run the application. + Version of the installed Shared Framework to use to run the application. + + + + Roll forward on no candidate shared framework is enabled. + Roll forward on no candidate shared framework is enabled. + + + + Path to additonal deps.json file. + Path to additonal deps.json file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.es.xlf index 494fbf4f5..0ea9eef06 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.es.xlf @@ -64,9 +64,9 @@ - Commands - Comandos - + SDK commands + Comandos + Initialize .NET projects. @@ -114,14 +114,14 @@ - Add items to the project. - Agrega elementos al proyecto. - + Add reference to the project. + Agrega elementos al proyecto. + - Remove items from the project. - Quita elementos del proyecto. - + Remove reference from the project. + Quita elementos del proyecto. + Advanced Commands @@ -158,6 +158,91 @@ Modifique archivos de la solución (SLN). + + List reference in the project. + List reference in the project. + + + + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + + + + .NET CLI help utility + .NET CLI help utility + + + + Utility to get more detailed help about each of the CLI commands. + Utility to get more detailed help about each of the CLI commands. + + + + COMMAND_NAME + COMMAND_NAME + + + + CLI command for which to view more detailed help. + CLI command for which to view more detailed help. + + + + The path to an application .dll file to execute. + The path to an application .dll file to execute. + + + + Display .NET Core SDK version. + Display .NET Core SDK version. + + + + Display .NET Core information. + Display .NET Core information. + + + + Enable diagnostic output. + Enable diagnostic output. + + + + Run 'dotnet COMMAND --help' for more information on a command. + Run 'dotnet COMMAND --help' for more information on a command. + + + + Path containing probing policy and assemblies to probe for. + Path containing probing policy and assemblies to probe for. + + + + Path to <application>.deps.json file. + Path to <application>.deps.json file. + + + + Path to <application>.runtimeconfig.json file. + Path to <application>.runtimeconfig.json file. + + + + Version of the installed Shared Framework to use to run the application. + Version of the installed Shared Framework to use to run the application. + + + + Roll forward on no candidate shared framework is enabled. + Roll forward on no candidate shared framework is enabled. + + + + Path to additonal deps.json file. + Path to additonal deps.json file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.fr.xlf index d458dea79..2b4fa50f0 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.fr.xlf @@ -64,9 +64,9 @@ - Commands - Commandes - + SDK commands + Commandes + Initialize .NET projects. @@ -114,14 +114,14 @@ - Add items to the project. - Ajoutez des éléments au projet. - + Add reference to the project. + Ajoutez des éléments au projet. + - Remove items from the project. - Supprimez des éléments du projet. - + Remove reference from the project. + Supprimez des éléments du projet. + Advanced Commands @@ -158,6 +158,91 @@ Modifiez les fichiers solution (SLN). + + List reference in the project. + List reference in the project. + + + + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + + + + .NET CLI help utility + .NET CLI help utility + + + + Utility to get more detailed help about each of the CLI commands. + Utility to get more detailed help about each of the CLI commands. + + + + COMMAND_NAME + COMMAND_NAME + + + + CLI command for which to view more detailed help. + CLI command for which to view more detailed help. + + + + The path to an application .dll file to execute. + The path to an application .dll file to execute. + + + + Display .NET Core SDK version. + Display .NET Core SDK version. + + + + Display .NET Core information. + Display .NET Core information. + + + + Enable diagnostic output. + Enable diagnostic output. + + + + Run 'dotnet COMMAND --help' for more information on a command. + Run 'dotnet COMMAND --help' for more information on a command. + + + + Path containing probing policy and assemblies to probe for. + Path containing probing policy and assemblies to probe for. + + + + Path to <application>.deps.json file. + Path to <application>.deps.json file. + + + + Path to <application>.runtimeconfig.json file. + Path to <application>.runtimeconfig.json file. + + + + Version of the installed Shared Framework to use to run the application. + Version of the installed Shared Framework to use to run the application. + + + + Roll forward on no candidate shared framework is enabled. + Roll forward on no candidate shared framework is enabled. + + + + Path to additonal deps.json file. + Path to additonal deps.json file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.it.xlf index 19c6d9ca1..482b186e9 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.it.xlf @@ -64,9 +64,9 @@ - Commands - Comandi - + SDK commands + Comandi + Initialize .NET projects. @@ -114,14 +114,14 @@ - Add items to the project. - Consente di aggiungere elementi al progetto. - + Add reference to the project. + Consente di aggiungere elementi al progetto. + - Remove items from the project. - Consente di rimuovere elementi dal progetto. - + Remove reference from the project. + Consente di rimuovere elementi dal progetto. + Advanced Commands @@ -158,6 +158,91 @@ Consente di modificare i file di soluzione (SLN). + + List reference in the project. + List reference in the project. + + + + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + + + + .NET CLI help utility + .NET CLI help utility + + + + Utility to get more detailed help about each of the CLI commands. + Utility to get more detailed help about each of the CLI commands. + + + + COMMAND_NAME + COMMAND_NAME + + + + CLI command for which to view more detailed help. + CLI command for which to view more detailed help. + + + + The path to an application .dll file to execute. + The path to an application .dll file to execute. + + + + Display .NET Core SDK version. + Display .NET Core SDK version. + + + + Display .NET Core information. + Display .NET Core information. + + + + Enable diagnostic output. + Enable diagnostic output. + + + + Run 'dotnet COMMAND --help' for more information on a command. + Run 'dotnet COMMAND --help' for more information on a command. + + + + Path containing probing policy and assemblies to probe for. + Path containing probing policy and assemblies to probe for. + + + + Path to <application>.deps.json file. + Path to <application>.deps.json file. + + + + Path to <application>.runtimeconfig.json file. + Path to <application>.runtimeconfig.json file. + + + + Version of the installed Shared Framework to use to run the application. + Version of the installed Shared Framework to use to run the application. + + + + Roll forward on no candidate shared framework is enabled. + Roll forward on no candidate shared framework is enabled. + + + + Path to additonal deps.json file. + Path to additonal deps.json file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ja.xlf index c7b6ac991..32c8fa8a9 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ja.xlf @@ -64,9 +64,9 @@ - Commands - コマンド - + SDK commands + コマンド + Initialize .NET projects. @@ -114,14 +114,14 @@ - Add items to the project. - 項目をプロジェクトに追加します。 - + Add reference to the project. + 項目をプロジェクトに追加します。 + - Remove items from the project. - 項目をプロジェクトから削除します。 - + Remove reference from the project. + 項目をプロジェクトから削除します。 + Advanced Commands @@ -158,6 +158,91 @@ ソリューション (SLN) ファイルを変更します。 + + List reference in the project. + List reference in the project. + + + + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + + + + .NET CLI help utility + .NET CLI help utility + + + + Utility to get more detailed help about each of the CLI commands. + Utility to get more detailed help about each of the CLI commands. + + + + COMMAND_NAME + COMMAND_NAME + + + + CLI command for which to view more detailed help. + CLI command for which to view more detailed help. + + + + The path to an application .dll file to execute. + The path to an application .dll file to execute. + + + + Display .NET Core SDK version. + Display .NET Core SDK version. + + + + Display .NET Core information. + Display .NET Core information. + + + + Enable diagnostic output. + Enable diagnostic output. + + + + Run 'dotnet COMMAND --help' for more information on a command. + Run 'dotnet COMMAND --help' for more information on a command. + + + + Path containing probing policy and assemblies to probe for. + Path containing probing policy and assemblies to probe for. + + + + Path to <application>.deps.json file. + Path to <application>.deps.json file. + + + + Path to <application>.runtimeconfig.json file. + Path to <application>.runtimeconfig.json file. + + + + Version of the installed Shared Framework to use to run the application. + Version of the installed Shared Framework to use to run the application. + + + + Roll forward on no candidate shared framework is enabled. + Roll forward on no candidate shared framework is enabled. + + + + Path to additonal deps.json file. + Path to additonal deps.json file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ko.xlf index 3b7ca374f..c2ca724a6 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ko.xlf @@ -64,9 +64,9 @@ - Commands - 명령 - + SDK commands + 명령 + Initialize .NET projects. @@ -114,14 +114,14 @@ - Add items to the project. - 프로젝트에 항목을 추가합니다. - + Add reference to the project. + 프로젝트에 항목을 추가합니다. + - Remove items from the project. - 프로젝트에서 항목을 제거합니다. - + Remove reference from the project. + 프로젝트에서 항목을 제거합니다. + Advanced Commands @@ -158,6 +158,91 @@ 솔루션(SLN) 파일을 수정합니다. + + List reference in the project. + List reference in the project. + + + + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + + + + .NET CLI help utility + .NET CLI help utility + + + + Utility to get more detailed help about each of the CLI commands. + Utility to get more detailed help about each of the CLI commands. + + + + COMMAND_NAME + COMMAND_NAME + + + + CLI command for which to view more detailed help. + CLI command for which to view more detailed help. + + + + The path to an application .dll file to execute. + The path to an application .dll file to execute. + + + + Display .NET Core SDK version. + Display .NET Core SDK version. + + + + Display .NET Core information. + Display .NET Core information. + + + + Enable diagnostic output. + Enable diagnostic output. + + + + Run 'dotnet COMMAND --help' for more information on a command. + Run 'dotnet COMMAND --help' for more information on a command. + + + + Path containing probing policy and assemblies to probe for. + Path containing probing policy and assemblies to probe for. + + + + Path to <application>.deps.json file. + Path to <application>.deps.json file. + + + + Path to <application>.runtimeconfig.json file. + Path to <application>.runtimeconfig.json file. + + + + Version of the installed Shared Framework to use to run the application. + Version of the installed Shared Framework to use to run the application. + + + + Roll forward on no candidate shared framework is enabled. + Roll forward on no candidate shared framework is enabled. + + + + Path to additonal deps.json file. + Path to additonal deps.json file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.pl.xlf index ab0af147f..a51025cfe 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.pl.xlf @@ -64,9 +64,9 @@ - Commands - Polecenia - + SDK commands + Polecenia + Initialize .NET projects. @@ -114,14 +114,14 @@ - Add items to the project. - Dodaj elementy do projektu. - + Add reference to the project. + Dodaj elementy do projektu. + - Remove items from the project. - Usuń elementy z projektu. - + Remove reference from the project. + Usuń elementy z projektu. + Advanced Commands @@ -158,6 +158,91 @@ Modyfikuj pliki rozwiązania (SLN). + + List reference in the project. + List reference in the project. + + + + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + + + + .NET CLI help utility + .NET CLI help utility + + + + Utility to get more detailed help about each of the CLI commands. + Utility to get more detailed help about each of the CLI commands. + + + + COMMAND_NAME + COMMAND_NAME + + + + CLI command for which to view more detailed help. + CLI command for which to view more detailed help. + + + + The path to an application .dll file to execute. + The path to an application .dll file to execute. + + + + Display .NET Core SDK version. + Display .NET Core SDK version. + + + + Display .NET Core information. + Display .NET Core information. + + + + Enable diagnostic output. + Enable diagnostic output. + + + + Run 'dotnet COMMAND --help' for more information on a command. + Run 'dotnet COMMAND --help' for more information on a command. + + + + Path containing probing policy and assemblies to probe for. + Path containing probing policy and assemblies to probe for. + + + + Path to <application>.deps.json file. + Path to <application>.deps.json file. + + + + Path to <application>.runtimeconfig.json file. + Path to <application>.runtimeconfig.json file. + + + + Version of the installed Shared Framework to use to run the application. + Version of the installed Shared Framework to use to run the application. + + + + Roll forward on no candidate shared framework is enabled. + Roll forward on no candidate shared framework is enabled. + + + + Path to additonal deps.json file. + Path to additonal deps.json file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.pt-BR.xlf index 1b7a648ef..516306697 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.pt-BR.xlf @@ -64,9 +64,9 @@ - Commands - Comandos - + SDK commands + Comandos + Initialize .NET projects. @@ -114,14 +114,14 @@ - Add items to the project. - Adiciona itens ao projeto. - + Add reference to the project. + Adiciona itens ao projeto. + - Remove items from the project. - Remove itens do projeto. - + Remove reference from the project. + Remove itens do projeto. + Advanced Commands @@ -158,6 +158,91 @@ Modificar arquivos de solução (SLN). + + List reference in the project. + List reference in the project. + + + + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + + + + .NET CLI help utility + .NET CLI help utility + + + + Utility to get more detailed help about each of the CLI commands. + Utility to get more detailed help about each of the CLI commands. + + + + COMMAND_NAME + COMMAND_NAME + + + + CLI command for which to view more detailed help. + CLI command for which to view more detailed help. + + + + The path to an application .dll file to execute. + The path to an application .dll file to execute. + + + + Display .NET Core SDK version. + Display .NET Core SDK version. + + + + Display .NET Core information. + Display .NET Core information. + + + + Enable diagnostic output. + Enable diagnostic output. + + + + Run 'dotnet COMMAND --help' for more information on a command. + Run 'dotnet COMMAND --help' for more information on a command. + + + + Path containing probing policy and assemblies to probe for. + Path containing probing policy and assemblies to probe for. + + + + Path to <application>.deps.json file. + Path to <application>.deps.json file. + + + + Path to <application>.runtimeconfig.json file. + Path to <application>.runtimeconfig.json file. + + + + Version of the installed Shared Framework to use to run the application. + Version of the installed Shared Framework to use to run the application. + + + + Roll forward on no candidate shared framework is enabled. + Roll forward on no candidate shared framework is enabled. + + + + Path to additonal deps.json file. + Path to additonal deps.json file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ru.xlf index 26938555e..2028f0b46 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ru.xlf @@ -64,9 +64,9 @@ - Commands - Команды - + SDK commands + Команды + Initialize .NET projects. @@ -114,14 +114,14 @@ - Add items to the project. - Добавление элементов в проект. - + Add reference to the project. + Добавление элементов в проект. + - Remove items from the project. - Удаление элементов из проекта. - + Remove reference from the project. + Удаление элементов из проекта. + Advanced Commands @@ -158,6 +158,91 @@ Изменение файлов решения (SLN). + + List reference in the project. + List reference in the project. + + + + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + + + + .NET CLI help utility + .NET CLI help utility + + + + Utility to get more detailed help about each of the CLI commands. + Utility to get more detailed help about each of the CLI commands. + + + + COMMAND_NAME + COMMAND_NAME + + + + CLI command for which to view more detailed help. + CLI command for which to view more detailed help. + + + + The path to an application .dll file to execute. + The path to an application .dll file to execute. + + + + Display .NET Core SDK version. + Display .NET Core SDK version. + + + + Display .NET Core information. + Display .NET Core information. + + + + Enable diagnostic output. + Enable diagnostic output. + + + + Run 'dotnet COMMAND --help' for more information on a command. + Run 'dotnet COMMAND --help' for more information on a command. + + + + Path containing probing policy and assemblies to probe for. + Path containing probing policy and assemblies to probe for. + + + + Path to <application>.deps.json file. + Path to <application>.deps.json file. + + + + Path to <application>.runtimeconfig.json file. + Path to <application>.runtimeconfig.json file. + + + + Version of the installed Shared Framework to use to run the application. + Version of the installed Shared Framework to use to run the application. + + + + Roll forward on no candidate shared framework is enabled. + Roll forward on no candidate shared framework is enabled. + + + + Path to additonal deps.json file. + Path to additonal deps.json file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.tr.xlf index f966296e6..b78fa4269 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.tr.xlf @@ -64,9 +64,9 @@ - Commands - Komutlar - + SDK commands + Komutlar + Initialize .NET projects. @@ -114,14 +114,14 @@ - Add items to the project. - Projeye öğe ekler. - + Add reference to the project. + Projeye öğe ekler. + - Remove items from the project. - Projeden öğeleri kaldırır. - + Remove reference from the project. + Projeden öğeleri kaldırır. + Advanced Commands @@ -158,6 +158,91 @@ Çözüm (SLN) dosyalarını değiştirin. + + List reference in the project. + List reference in the project. + + + + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + + + + .NET CLI help utility + .NET CLI help utility + + + + Utility to get more detailed help about each of the CLI commands. + Utility to get more detailed help about each of the CLI commands. + + + + COMMAND_NAME + COMMAND_NAME + + + + CLI command for which to view more detailed help. + CLI command for which to view more detailed help. + + + + The path to an application .dll file to execute. + The path to an application .dll file to execute. + + + + Display .NET Core SDK version. + Display .NET Core SDK version. + + + + Display .NET Core information. + Display .NET Core information. + + + + Enable diagnostic output. + Enable diagnostic output. + + + + Run 'dotnet COMMAND --help' for more information on a command. + Run 'dotnet COMMAND --help' for more information on a command. + + + + Path containing probing policy and assemblies to probe for. + Path containing probing policy and assemblies to probe for. + + + + Path to <application>.deps.json file. + Path to <application>.deps.json file. + + + + Path to <application>.runtimeconfig.json file. + Path to <application>.runtimeconfig.json file. + + + + Version of the installed Shared Framework to use to run the application. + Version of the installed Shared Framework to use to run the application. + + + + Roll forward on no candidate shared framework is enabled. + Roll forward on no candidate shared framework is enabled. + + + + Path to additonal deps.json file. + Path to additonal deps.json file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.xlf index 5f86f65dc..dcb4ed353 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.xlf @@ -52,8 +52,8 @@ - Commands - + SDK commands + Initialize .NET projects. @@ -92,12 +92,12 @@ - Add items to the project. - + Add reference to the project. + - Remove items from the project. - + Remove reference from the project. + Advanced Commands @@ -125,6 +125,74 @@ Modify solution (SLN) files. + + + + List reference in the project. + + + + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + + + + .NET CLI help utility + + + + Utility to get more detailed help about each of the CLI commands. + + + + COMMAND_NAME + + + + CLI command for which to view more detailed help. + + + + The path to an application .dll file to execute. + + + + Display .NET Core SDK version. + + + + Display .NET Core information. + + + + Enable diagnostic output. + + + + Run 'dotnet COMMAND --help' for more information on a command. + + + + Path containing probing policy and assemblies to probe for. + + + + Path to <application>.deps.json file. + + + + Path to <application>.runtimeconfig.json file. + + + + Version of the installed Shared Framework to use to run the application. + + + + Roll forward on no candidate shared framework is enabled. + + + + Path to additonal deps.json file. diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.zh-Hans.xlf index 909ba4756..09399a31d 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.zh-Hans.xlf @@ -64,9 +64,9 @@ - Commands - 命令 - + SDK commands + 命令 + Initialize .NET projects. @@ -114,14 +114,14 @@ - Add items to the project. - 将项添加到项目中。 - + Add reference to the project. + 将项添加到项目中。 + - Remove items from the project. - 从项目中删除项。 - + Remove reference from the project. + 从项目中删除项。 + Advanced Commands @@ -158,6 +158,91 @@ 修改解决方案(SLN)文件。 + + List reference in the project. + List reference in the project. + + + + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + + + + .NET CLI help utility + .NET CLI help utility + + + + Utility to get more detailed help about each of the CLI commands. + Utility to get more detailed help about each of the CLI commands. + + + + COMMAND_NAME + COMMAND_NAME + + + + CLI command for which to view more detailed help. + CLI command for which to view more detailed help. + + + + The path to an application .dll file to execute. + The path to an application .dll file to execute. + + + + Display .NET Core SDK version. + Display .NET Core SDK version. + + + + Display .NET Core information. + Display .NET Core information. + + + + Enable diagnostic output. + Enable diagnostic output. + + + + Run 'dotnet COMMAND --help' for more information on a command. + Run 'dotnet COMMAND --help' for more information on a command. + + + + Path containing probing policy and assemblies to probe for. + Path containing probing policy and assemblies to probe for. + + + + Path to <application>.deps.json file. + Path to <application>.deps.json file. + + + + Path to <application>.runtimeconfig.json file. + Path to <application>.runtimeconfig.json file. + + + + Version of the installed Shared Framework to use to run the application. + Version of the installed Shared Framework to use to run the application. + + + + Roll forward on no candidate shared framework is enabled. + Roll forward on no candidate shared framework is enabled. + + + + Path to additonal deps.json file. + Path to additonal deps.json file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.zh-Hant.xlf index 0869fb862..537e5e383 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.zh-Hant.xlf @@ -64,9 +64,9 @@ - Commands - 命令 - + SDK commands + 命令 + Initialize .NET projects. @@ -114,14 +114,14 @@ - Add items to the project. - 將項目新增至專案。 - + Add reference to the project. + 將項目新增至專案。 + - Remove items from the project. - 從專案中移除項目。 - + Remove reference from the project. + 從專案中移除項目。 + Advanced Commands @@ -158,6 +158,91 @@ 修改方案 (SLN) 檔。 + + List reference in the project. + List reference in the project. + + + + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. + + + + .NET CLI help utility + .NET CLI help utility + + + + Utility to get more detailed help about each of the CLI commands. + Utility to get more detailed help about each of the CLI commands. + + + + COMMAND_NAME + COMMAND_NAME + + + + CLI command for which to view more detailed help. + CLI command for which to view more detailed help. + + + + The path to an application .dll file to execute. + The path to an application .dll file to execute. + + + + Display .NET Core SDK version. + Display .NET Core SDK version. + + + + Display .NET Core information. + Display .NET Core information. + + + + Enable diagnostic output. + Enable diagnostic output. + + + + Run 'dotnet COMMAND --help' for more information on a command. + Run 'dotnet COMMAND --help' for more information on a command. + + + + Path containing probing policy and assemblies to probe for. + Path containing probing policy and assemblies to probe for. + + + + Path to <application>.deps.json file. + Path to <application>.deps.json file. + + + + Path to <application>.runtimeconfig.json file. + Path to <application>.runtimeconfig.json file. + + + + Version of the installed Shared Framework to use to run the application. + Version of the installed Shared Framework to use to run the application. + + + + Roll forward on no candidate shared framework is enabled. + Roll forward on no candidate shared framework is enabled. + + + + Path to additonal deps.json file. + Path to additonal deps.json file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.xlf index ef2115bc4..7c015ba0b 100644 --- a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.xlf +++ b/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.xlf @@ -9,7 +9,7 @@ Command to list project to project references - + There are no {0} references in project {1}. diff --git a/src/dotnet/commands/dotnet-migrate/DotnetNewRedirector.cs b/src/dotnet/commands/dotnet-migrate/DotnetNewRedirector.cs new file mode 100644 index 000000000..bc997da4c --- /dev/null +++ b/src/dotnet/commands/dotnet-migrate/DotnetNewRedirector.cs @@ -0,0 +1,41 @@ +// 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; +using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Tools.MigrateCommand; +using System.Collections.Generic; + +namespace Microsoft.DotNet.Tools.Migrate +{ + public class DotnetNewRedirector : ICanCreateDotnetCoreTemplate + { + public void CreateWithEphemeralHiveAndNoRestore( + string templateName, + string outputDirectory, + string workingDirectory) + { + RunCommand("new", new string[] { "console", "-o", workingDirectory, "--debug:ephemeral-hive", "--no-restore" }, workingDirectory); + } + private void RunCommand(string commandToExecute, IEnumerable args, string workingDirectory) + { + var command = new DotNetCommandFactory() + .Create(commandToExecute, args) + .WorkingDirectory(workingDirectory) + .CaptureStdOut() + .CaptureStdErr(); + + var commandResult = command.Execute(); + + if (commandResult.ExitCode != 0) + { + string argList = string.Join(", ", args); + throw new GracefulException($"Failed to run {commandToExecute} with " + + $"args: {argList} ... " + + $"workingDirectory = {workingDirectory}, " + + $"StdOut = {commandResult.StdOut}, " + + $"StdErr = {commandResult.StdErr}"); + } + } + } +} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/DotnetSlnRedirector.cs b/src/dotnet/commands/dotnet-migrate/DotnetSlnRedirector.cs new file mode 100644 index 000000000..9824741d0 --- /dev/null +++ b/src/dotnet/commands/dotnet-migrate/DotnetSlnRedirector.cs @@ -0,0 +1,41 @@ +// 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; +using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Tools.MigrateCommand; +using Microsoft.DotNet.Tools.Sln; + +namespace Microsoft.DotNet.Tools.Migrate +{ + public class DotnetSlnRedirector : ICanManipulateSolutionFile + { + public void AddProjectToSolution(string solutionFilePath, string projectFilePath) + { + var newCommandArgs = new[] {solutionFilePath, SlnAddParser.SlnAdd().Name, projectFilePath}; + var result = SlnCommand.Run(newCommandArgs); + + if (result != 0) + { + throw new GracefulException( + $"{nameof(SlnCommand)} " + + "failed to execuate given args " + + $"{string.Join(" ", newCommandArgs)}"); + } + } + + public void RemoveProjectFromSolution(string solutionFilePath, string projectFilePath) + { + var newCommandArgs = new[] {solutionFilePath, SlnRemoveParser.SlnRemove().Name, projectFilePath}; + var result = SlnCommand.Run(newCommandArgs); + + if (result != 0) + { + throw new GracefulException( + $"{nameof(SlnCommand)} " + + "failed to execuate given args " + + $"{string.Join(" ", newCommandArgs)}"); + } + } + } +} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/MigrateCommand.cs b/src/dotnet/commands/dotnet-migrate/MigrateCommand.cs deleted file mode 100644 index e49d7932a..000000000 --- a/src/dotnet/commands/dotnet-migrate/MigrateCommand.cs +++ /dev/null @@ -1,532 +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.Text; -using Microsoft.Build.Construction; -using Microsoft.Build.Evaluation; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.Sln.Internal; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.ProjectJsonMigration; -using Microsoft.DotNet.Internal.ProjectModel; -using Project = Microsoft.DotNet.Internal.ProjectModel.Project; -using Microsoft.DotNet.Tools.Common; - -namespace Microsoft.DotNet.Tools.Migrate -{ - public partial class MigrateCommand - { - private const string ProductDescription = "Visual Studio 15"; - private const string VisualStudioVersion = "15.0.26114.2"; - private const string MinimumVisualStudioVersion = "10.0.40219.1"; - - private SlnFile _slnFile; - private readonly DirectoryInfo _workspaceDirectory; - private readonly string _templateFile; - private readonly string _projectArg; - private readonly string _sdkVersion; - private readonly string _xprojFilePath; - private readonly bool _skipProjectReferences; - private readonly string _reportFile; - private readonly bool _reportFormatJson; - private readonly bool _skipBackup; - - public MigrateCommand( - string templateFile, - string projectArg, - string sdkVersion, - string xprojFilePath, - string reportFile, - bool skipProjectReferences, - bool reportFormatJson, - bool skipBackup) - { - _templateFile = templateFile; - _projectArg = projectArg ?? Directory.GetCurrentDirectory(); - _workspaceDirectory = File.Exists(_projectArg) - ? new FileInfo(_projectArg).Directory - : new DirectoryInfo(_projectArg); - _sdkVersion = sdkVersion; - _xprojFilePath = xprojFilePath; - _skipProjectReferences = skipProjectReferences; - _reportFile = reportFile; - _reportFormatJson = reportFormatJson; - _skipBackup = skipBackup; - } - - public int Execute() - { - var temporaryDotnetNewProject = new TemporaryDotnetNewTemplateProject(); - var projectsToMigrate = GetProjectsToMigrate(_projectArg); - - var msBuildTemplatePath = _templateFile ?? temporaryDotnetNewProject.MSBuildProjectPath; - - MigrationReport migrationReport = null; - - foreach (var project in projectsToMigrate) - { - var projectDirectory = Path.GetDirectoryName(project); - var outputDirectory = projectDirectory; - var migrationSettings = new MigrationSettings( - projectDirectory, - outputDirectory, - msBuildTemplatePath, - _xprojFilePath, - null, - _slnFile); - var projectMigrationReport = new ProjectMigrator().Migrate(migrationSettings, _skipProjectReferences); - - if (migrationReport == null) - { - migrationReport = projectMigrationReport; - } - else - { - migrationReport = migrationReport.Merge(projectMigrationReport); - } - } - - WriteReport(migrationReport); - - temporaryDotnetNewProject.Clean(); - - UpdateSolutionFile(migrationReport); - - MoveProjectJsonArtifactsToBackup(migrationReport); - - return migrationReport.FailedProjectsCount; - } - - private void UpdateSolutionFile(MigrationReport migrationReport) - { - if(_slnFile != null) - { - UpdateSolutionFile(migrationReport, _slnFile); - } - else - { - foreach (var slnPath in _workspaceDirectory.EnumerateFiles("*.sln")) - { - var slnFile = SlnFile.Read(slnPath.FullName); - - UpdateSolutionFile(migrationReport, slnFile); - } - } - } - - private void UpdateSolutionFile(MigrationReport migrationReport, SlnFile slnFile) - { - if (slnFile == null) - { - return; - } - - if (migrationReport.FailedProjectsCount > 0) - { - return; - } - - var csprojFilesToAdd = new HashSet(); - var xprojFilesToRemove = new HashSet(); - - var slnPathWithTrailingSlash = PathUtility.EnsureTrailingSlash(slnFile.BaseDirectory); - foreach (var report in migrationReport.ProjectMigrationReports) - { - var reportPathWithTrailingSlash = PathUtility.EnsureTrailingSlash(report.ProjectDirectory); - var relativeReportPath = PathUtility.GetRelativePath( - slnPathWithTrailingSlash, - reportPathWithTrailingSlash); - - var migratedProjectName = report.ProjectName + ".csproj"; - var csprojPath = Path.Combine(relativeReportPath, migratedProjectName); - var solutionContainsCsprojPriorToMigration = slnFile.Projects - .Where(p => p.FilePath == csprojPath) - .Any(); - - if (!solutionContainsCsprojPriorToMigration) - { - csprojFilesToAdd.Add(Path.Combine(report.ProjectDirectory, migratedProjectName)); - } - - foreach (var preExisting in report.PreExistingCsprojDependencies) - { - csprojFilesToAdd.Add(Path.Combine(report.ProjectDirectory, preExisting)); - } - - var projectDirectory = new DirectoryInfo(report.ProjectDirectory); - foreach (var xprojFileName in projectDirectory.EnumerateFiles("*.xproj")) - { - var xprojPath = Path.Combine(relativeReportPath, xprojFileName.Name); - var solutionContainsXprojFileToRemove = slnFile.Projects - .Where(p => p.FilePath == xprojPath) - .Any(); - - if (solutionContainsXprojFileToRemove) - { - xprojFilesToRemove.Add(Path.Combine(report.ProjectDirectory, xprojFileName.Name)); - } - } - } - - Version version; - if (!Version.TryParse(slnFile.VisualStudioVersion, out version) || version.Major < 15) - { - slnFile.ProductDescription = ProductDescription; - slnFile.VisualStudioVersion = VisualStudioVersion; - slnFile.MinimumVisualStudioVersion = MinimumVisualStudioVersion; - } - - RemoveReferencesToMigratedFiles(slnFile); - - slnFile.Write(); - - foreach (var csprojFile in csprojFilesToAdd) - { - RunDotnetSlnCommand(slnFile.FullPath, csprojFile, "add"); - } - - foreach (var xprojFile in xprojFilesToRemove) - { - RunDotnetSlnCommand(slnFile.FullPath, xprojFile, "remove"); - } - } - - private void RemoveReferencesToMigratedFiles(SlnFile slnFile) - { - var solutionFolders = slnFile.Projects.GetProjectsByType(ProjectTypeGuids.SolutionFolderGuid); - - foreach (var solutionFolder in solutionFolders) - { - var solutionItems = solutionFolder.Sections.GetSection("SolutionItems"); - if (solutionItems != null && solutionItems.Properties.ContainsKey("global.json")) - { - solutionItems.Properties.Remove("global.json"); - if (solutionItems.IsEmpty) - { - solutionFolder.Sections.Remove(solutionItems); - } - } - } - - slnFile.RemoveEmptySolutionFolders(); - } - - private void RunDotnetSlnCommand(string slnPath, string projPath, string commandName) - { - var args = new List() - { - "sln", - slnPath, - commandName, - projPath, - }; - - var dotnetPath = Path.Combine(AppContext.BaseDirectory, "dotnet.dll"); - var command = new ForwardingApp(dotnetPath, args); - command.Execute(); - } - - private void MoveProjectJsonArtifactsToBackup(MigrationReport migrationReport) - { - if (_skipBackup) - { - return; - } - - if (migrationReport.FailedProjectsCount > 0) - { - return; - } - - BackupProjects(migrationReport); - } - - private void BackupProjects(MigrationReport migrationReport) - { - var projectDirectories = new List(); - foreach (var report in migrationReport.ProjectMigrationReports) - { - projectDirectories.Add(new DirectoryInfo(report.ProjectDirectory)); - } - - var backupPlan = new MigrationBackupPlan( - projectDirectories, - _workspaceDirectory); - - backupPlan.PerformBackup(); - - Reporter.Output.WriteLine(string.Format( - LocalizableStrings.MigrateFilesBackupLocation, - backupPlan.RootBackupDirectory.FullName)); - } - - private void WriteReport(MigrationReport migrationReport) - { - if (!string.IsNullOrEmpty(_reportFile)) - { - using (var outputTextWriter = GetReportFileOutputTextWriter()) - { - outputTextWriter.Write(GetReportContent(migrationReport)); - } - } - - WriteReportToStdOut(migrationReport); - } - - private void WriteReportToStdOut(MigrationReport migrationReport) - { - StringBuilder sb = new StringBuilder(); - - foreach (var projectMigrationReport in migrationReport.ProjectMigrationReports) - { - var errorContent = GetProjectReportErrorContent(projectMigrationReport, colored: true); - var successContent = GetProjectReportSuccessContent(projectMigrationReport, colored: true); - var warningContent = GetProjectReportWarningContent(projectMigrationReport, colored: true); - Reporter.Output.WriteLine(warningContent); - if (!string.IsNullOrEmpty(errorContent)) - { - Reporter.Error.WriteLine(errorContent); - } - else - { - Reporter.Output.WriteLine(successContent); - } - } - - Reporter.Output.WriteLine(GetReportSummary(migrationReport)); - - Reporter.Output.WriteLine(LocalizableStrings.MigrationAdditionalHelp); - } - - private string GetReportContent(MigrationReport migrationReport, bool colored = false) - { - if (_reportFormatJson) - { - return Newtonsoft.Json.JsonConvert.SerializeObject(migrationReport); - } - - StringBuilder sb = new StringBuilder(); - - foreach (var projectMigrationReport in migrationReport.ProjectMigrationReports) - { - var errorContent = GetProjectReportErrorContent(projectMigrationReport, colored: colored); - var successContent = GetProjectReportSuccessContent(projectMigrationReport, colored: colored); - var warningContent = GetProjectReportWarningContent(projectMigrationReport, colored: colored); - sb.AppendLine(warningContent); - if (!string.IsNullOrEmpty(errorContent)) - { - sb.AppendLine(errorContent); - } - else - { - sb.AppendLine(successContent); - } - } - - sb.AppendLine(GetReportSummary(migrationReport)); - - return sb.ToString(); - } - - private string GetReportSummary(MigrationReport migrationReport) - { - StringBuilder sb = new StringBuilder(); - - sb.AppendLine(LocalizableStrings.MigrationReportSummary); - sb.AppendLine( - string.Format(LocalizableStrings.MigrationReportTotalProjects, migrationReport.MigratedProjectsCount)); - sb.AppendLine(string.Format( - LocalizableStrings.MigrationReportSucceededProjects, - migrationReport.SucceededProjectsCount)); - sb.AppendLine(string.Format( - LocalizableStrings.MigrationReportFailedProjects, - migrationReport.FailedProjectsCount)); - - return sb.ToString(); - } - - private string GetProjectReportSuccessContent(ProjectMigrationReport projectMigrationReport, bool colored) - { - Func GreenIfColored = (str) => colored ? str.Green() : str; - return GreenIfColored(string.Format( - LocalizableStrings.ProjectMigrationSucceeded, - projectMigrationReport.ProjectName, - projectMigrationReport.ProjectDirectory)); - } - - private string GetProjectReportWarningContent(ProjectMigrationReport projectMigrationReport, bool colored) - { - StringBuilder sb = new StringBuilder(); - Func YellowIfColored = (str) => colored ? str.Yellow() : str; - - foreach (var warning in projectMigrationReport.Warnings) - { - sb.AppendLine(YellowIfColored(warning)); - } - - return sb.ToString(); - } - - private string GetProjectReportErrorContent(ProjectMigrationReport projectMigrationReport, bool colored) - { - StringBuilder sb = new StringBuilder(); - Func RedIfColored = (str) => colored ? str.Red() : str; - - if (projectMigrationReport.Errors.Any()) - { - sb.AppendLine(RedIfColored(string.Format( - LocalizableStrings.ProjectMigrationFailed, - projectMigrationReport.ProjectName, - projectMigrationReport.ProjectDirectory))); - - foreach (var error in projectMigrationReport.Errors.Select(e => e.GetFormattedErrorMessage())) - { - sb.AppendLine(RedIfColored(error)); - } - } - - return sb.ToString(); - } - - private TextWriter GetReportFileOutputTextWriter() - { - return File.CreateText(_reportFile); - } - - private IEnumerable GetProjectsToMigrate(string projectArg) - { - IEnumerable projects = null; - - if (projectArg.EndsWith(Project.FileName, StringComparison.OrdinalIgnoreCase)) - { - projects = Enumerable.Repeat(projectArg, 1); - } - else if (projectArg.EndsWith(GlobalSettings.FileName, StringComparison.OrdinalIgnoreCase)) - { - projects = GetProjectsFromGlobalJson(projectArg); - - if (!projects.Any()) - { - throw new GracefulException(LocalizableStrings.MigrationFailedToFindProjectInGlobalJson); - } - } - else if (File.Exists(projectArg) && - string.Equals(Path.GetExtension(projectArg), ".sln", StringComparison.OrdinalIgnoreCase)) - { - projects = GetProjectsFromSolution(projectArg); - - if (!projects.Any()) - { - throw new GracefulException( - string.Format(LocalizableStrings.MigrationUnableToFindProjects, projectArg)); - } - } - else if (Directory.Exists(projectArg)) - { - projects = Directory.EnumerateFiles(projectArg, Project.FileName, SearchOption.AllDirectories); - - if (!projects.Any()) - { - throw new GracefulException( - string.Format(LocalizableStrings.MigrationProjectJsonNotFound, projectArg)); - } - } - else - { - throw new GracefulException( - string.Format(LocalizableStrings.MigrationInvalidProjectArgument, projectArg)); - } - - foreach (var project in projects) - { - yield return GetProjectJsonPath(project); - } - } - - private void EnsureNotNull(string variable, string message) - { - if (variable == null) - { - throw new GracefulException(message); - } - } - - private string GetProjectJsonPath(string projectJson) - { - projectJson = ProjectPathHelper.NormalizeProjectFilePath(projectJson); - - if (File.Exists(projectJson)) - { - return projectJson; - } - - throw new GracefulException(string.Format(LocalizableStrings.MigratonUnableToFindProjectJson, projectJson)); - } - - private IEnumerable GetProjectsFromGlobalJson(string globalJson) - { - var searchPaths = ProjectDependencyFinder.GetGlobalPaths(GetGlobalJsonDirectory(globalJson)); - - foreach (var searchPath in searchPaths) - { - var directory = new DirectoryInfo(searchPath); - - if (!directory.Exists) - { - continue; - } - - foreach (var projectDirectory in directory.EnumerateDirectories()) - { - var projectFilePath = Path.Combine(projectDirectory.FullName, Project.FileName); - - if (File.Exists(projectFilePath)) - { - yield return projectFilePath; - } - } - } - } - - private string GetGlobalJsonDirectory(string globalJson) - { - if (!File.Exists(globalJson)) - { - throw new GracefulException( - string.Format(LocalizableStrings.MigrationUnableToFindGlobalJson, globalJson)); - } - - var globalJsonDirectory = Path.GetDirectoryName(globalJson); - return string.IsNullOrEmpty(globalJsonDirectory) ? "." : globalJsonDirectory; - } - - private IEnumerable GetProjectsFromSolution(string slnPath) - { - if (!File.Exists(slnPath)) - { - throw new GracefulException( - string.Format(LocalizableStrings.MigrationUnableToFindSolutionFile, slnPath)); - } - - _slnFile = SlnFile.Read(slnPath); - - foreach (var project in _slnFile.Projects) - { - var projectFilePath = Path.Combine( - _slnFile.BaseDirectory, - Path.GetDirectoryName(project.FilePath), - Project.FileName); - - if (File.Exists(projectFilePath)) - { - yield return projectFilePath; - } - } - } - - } -} diff --git a/src/dotnet/commands/dotnet-migrate/Program.cs b/src/dotnet/commands/dotnet-migrate/MigrateCommandCompose.cs similarity index 60% rename from src/dotnet/commands/dotnet-migrate/Program.cs rename to src/dotnet/commands/dotnet-migrate/MigrateCommandCompose.cs index 72001edd7..75e8612b1 100644 --- a/src/dotnet/commands/dotnet-migrate/Program.cs +++ b/src/dotnet/commands/dotnet-migrate/MigrateCommandCompose.cs @@ -2,33 +2,40 @@ // 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.Cli; -using Microsoft.DotNet.Cli.CommandLine; using Microsoft.DotNet.Cli.Utils; using Parser = Microsoft.DotNet.Cli.Parser; namespace Microsoft.DotNet.Tools.Migrate { - public partial class MigrateCommand + public class MigrateCommandCompose { - public static MigrateCommand FromArgs(string[] args, string msbuildPath = null) + public static MigrateCommand.MigrateCommand FromArgs(string[] args, string msbuildPath = null) { - var msbuildArgs = new List(); - var parser = Parser.Instance; var result = parser.ParseFrom("dotnet migrate", args); result.ShowHelpOrErrorIfAppropriate(); - return result["dotnet"]["migrate"].Value(); + var parsedMigrateResult = result["dotnet"]["migrate"]; + var migrateCommand = new MigrateCommand.MigrateCommand( + new DotnetSlnRedirector(), + new DotnetNewRedirector(), + parsedMigrateResult.ValueOrDefault("--template-file"), + parsedMigrateResult.Arguments.FirstOrDefault(), + parsedMigrateResult.ValueOrDefault("--sdk-package-version"), + parsedMigrateResult.ValueOrDefault("--xproj-file"), + parsedMigrateResult.ValueOrDefault("--report-file"), + parsedMigrateResult.ValueOrDefault("--skip-project-references"), + parsedMigrateResult.ValueOrDefault("--format-report-file-json"), + parsedMigrateResult.ValueOrDefault("--skip-backup")); + return migrateCommand; } - public static int Run(string[] args) { - // IMPORTANT: // When updating the command line args for dotnet-migrate, we need to update the in-VS caller of dotnet migrate as well. // It is located at dotnet/roslyn-project-system: @@ -36,7 +43,7 @@ namespace Microsoft.DotNet.Tools.Migrate DebugHelper.HandleDebugSwitch(ref args); - MigrateCommand cmd; + MigrateCommand.MigrateCommand cmd; try { cmd = FromArgs(args); diff --git a/src/dotnet/commands/dotnet-migrate/MigrateCommandParser.cs b/src/dotnet/commands/dotnet-migrate/MigrateCommandParser.cs index f878b67f2..77377f0b4 100644 --- a/src/dotnet/commands/dotnet-migrate/MigrateCommandParser.cs +++ b/src/dotnet/commands/dotnet-migrate/MigrateCommandParser.cs @@ -15,16 +15,6 @@ namespace Microsoft.DotNet.Cli "migrate", ".NET Migrate Command", Accept.ZeroOrOneArgument() - .MaterializeAs(o => - new MigrateCommand( - o.ValueOrDefault("--template-file"), - o.Arguments.FirstOrDefault(), - o.ValueOrDefault("--sdk-package-version"), - o.ValueOrDefault("--xproj-file"), - o.ValueOrDefault("--report-file"), - o.ValueOrDefault("--skip-project-references"), - o.ValueOrDefault("--format-report-file-json"), - o.ValueOrDefault("--skip-backup"))) .With(name: LocalizableStrings.CmdProjectArgument, description: LocalizableStrings.CmdProjectArgumentDescription), CommonOptions.HelpOption(), diff --git a/src/dotnet/commands/dotnet-migrate/ProjectRootElementExtensions.cs b/src/dotnet/commands/dotnet-migrate/ProjectRootElementExtensions.cs deleted file mode 100644 index 9c5ccf8f7..000000000 --- a/src/dotnet/commands/dotnet-migrate/ProjectRootElementExtensions.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 System.Linq; -using Microsoft.Build.Construction; -using Microsoft.DotNet.ProjectJsonMigration; - -namespace Microsoft.DotNet.Tools.Migrate -{ - public static class ProjectRootElementExtensions - { - public static string GetSdkVersion(this ProjectRootElement projectRootElement) - { - return projectRootElement - .Items - .Where(i => i.ItemType == "PackageReference") - .First(i => i.Include == SupportedPackageVersions.SdkPackageName) - .GetMetadataWithName("version").Value; - } - } -} diff --git a/src/dotnet/commands/dotnet-migrate/TemporaryDotnetNewTemplateProject.cs b/src/dotnet/commands/dotnet-migrate/TemporaryDotnetNewTemplateProject.cs deleted file mode 100644 index 45750ecc9..000000000 --- a/src/dotnet/commands/dotnet-migrate/TemporaryDotnetNewTemplateProject.cs +++ /dev/null @@ -1,89 +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.Build.Construction; -using Microsoft.DotNet.Cli; -using System; -using System.Collections.Generic; -using System.IO; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.ProjectJsonMigration; -using Microsoft.Build.Evaluation; - -namespace Microsoft.DotNet.Tools.Migrate -{ - internal class TemporaryDotnetNewTemplateProject - { - private const string c_temporaryDotnetNewMSBuildProjectName = "p"; - - private readonly string _projectDirectory; - - public ProjectRootElement MSBuildProject { get; } - - public string MSBuildProjectPath - { - get - { - return Path.Combine(_projectDirectory, c_temporaryDotnetNewMSBuildProjectName + ".csproj"); - } - } - - public TemporaryDotnetNewTemplateProject() - { - _projectDirectory = CreateDotnetNewMSBuild(c_temporaryDotnetNewMSBuildProjectName); - MSBuildProject = GetMSBuildProject(); - } - - public void Clean() - { - Directory.Delete(Path.Combine(_projectDirectory, ".."), true); - } - - private string CreateDotnetNewMSBuild(string projectName) - { - var tempDir = Path.Combine( - Path.GetTempPath(), - this.GetType().Namespace, - Path.GetRandomFileName(), - c_temporaryDotnetNewMSBuildProjectName); - - if (Directory.Exists(tempDir)) - { - Directory.Delete(tempDir, true); - } - Directory.CreateDirectory(tempDir); - - RunCommand("new", new string[] { "console", "-o", tempDir, "--debug:ephemeral-hive", "--no-restore" }, tempDir); - - return tempDir; - } - - private ProjectRootElement GetMSBuildProject() - { - return ProjectRootElement.Open( - MSBuildProjectPath, - ProjectCollection.GlobalProjectCollection, - preserveFormatting: true); - } - - private void RunCommand(string commandToExecute, IEnumerable args, string workingDirectory) - { - var command = new DotNetCommandFactory() - .Create(commandToExecute, args) - .WorkingDirectory(workingDirectory) - .CaptureStdOut() - .CaptureStdErr(); - - var commandResult = command.Execute(); - - if (commandResult.ExitCode != 0) - { - MigrationTrace.Instance.WriteLine(commandResult.StdOut); - MigrationTrace.Instance.WriteLine(commandResult.StdErr); - - string argList = string.Join(", ", args); - throw new GracefulException($"Failed to run {commandToExecute} with args: {argList} ... workingDirectory = {workingDirectory}"); - } - } - } -} diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.cs.xlf index d31200df9..e880cd0bd 100644 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.cs.xlf @@ -39,9 +39,9 @@ Výchozí hodnota je aktuální adresář (pokud není zadaný jiný adresář). - The version of the sdk package that will be referenced in the migrated app. The default is the version of the sdk in dotnet new. - Verze balíčku SDK, na který bude odkazovat migrovaná aplikace. Výchozí hodnotou je verze SDK v příkazu dotnet new. - + The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. + Verze balíčku SDK, na který bude odkazovat migrovaná aplikace. Výchozí hodnotou je verze SDK v příkazu dotnet new. + The path to the xproj file to use. Required when there is more than one xproj in a project directory. @@ -49,9 +49,9 @@ Výchozí hodnota je aktuální adresář (pokud není zadaný jiný adresář). - Skip migrating project references. By default project references are migrated recursively. - Přeskočit migraci odkazů na projekt. Odkazy na projekt se automaticky migrují rekurzivně. - + Skip migrating project references. By default, project references are migrated recursively. + Přeskočit migraci odkazů na projekt. Odkazy na projekt se automaticky migrují rekurzivně. + Output migration report to the given file in addition to the console. @@ -73,6 +73,81 @@ Výchozí hodnota je aktuální adresář (pokud není zadaný jiný adresář). Migrace se nezdařila. + + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + + + + Summary + Summary + + + + Total Projects: {0} + Total Projects: {0} + + + + Succeeded Projects: {0} + Succeeded Projects: {0} + + + + Failed Projects: {0} + Failed Projects: {0} + + + + Project {0} migration succeeded ({1}). + Project {0} migration succeeded ({1}). + + + + Project {0} migration failed ({1}). + Project {0} migration failed ({1}). + + + + Unable to find any projects in global.json. + Unable to find any projects in global.json. + + + + Unable to find any projects in {0}. + Unable to find any projects in {0}. + + + + No project.json file found in '{0}'. + No project.json file found in '{0}'. + + + + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + + + + Unable to find project.json file at {0}. + Unable to find project.json file at {0}. + + + + Unable to find global settings file at {0}. + Unable to find global settings file at {0}. + + + + Unable to find the solution file at {0}. + Unable to find the solution file at {0}. + + + + Files backed up to {0} + Files backed up to {0} + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.de.xlf index 37b94d6b7..a6adb52a7 100644 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.de.xlf @@ -39,9 +39,9 @@ Ohne Angabe wird standardmäßig das aktuelle Verzeichnis verwendet. - The version of the sdk package that will be referenced in the migrated app. The default is the version of the sdk in dotnet new. - Die Version des SDK-Pakets, auf das in der migrierten App verwiesen wird. Standardmäßig wird die Version des SDKs in "dotnet new" verwendet. - + The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. + Die Version des SDK-Pakets, auf das in der migrierten App verwiesen wird. Standardmäßig wird die Version des SDKs in "dotnet new" verwendet. + The path to the xproj file to use. Required when there is more than one xproj in a project directory. @@ -49,9 +49,9 @@ Ohne Angabe wird standardmäßig das aktuelle Verzeichnis verwendet. - Skip migrating project references. By default project references are migrated recursively. - Migration von Projektverweisen überspringen. Projektverweise werden standardmäßig rekursiv migriert. - + Skip migrating project references. By default, project references are migrated recursively. + Migration von Projektverweisen überspringen. Projektverweise werden standardmäßig rekursiv migriert. + Output migration report to the given file in addition to the console. @@ -73,6 +73,81 @@ Ohne Angabe wird standardmäßig das aktuelle Verzeichnis verwendet. Fehler beim Migrieren. + + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + + + + Summary + Summary + + + + Total Projects: {0} + Total Projects: {0} + + + + Succeeded Projects: {0} + Succeeded Projects: {0} + + + + Failed Projects: {0} + Failed Projects: {0} + + + + Project {0} migration succeeded ({1}). + Project {0} migration succeeded ({1}). + + + + Project {0} migration failed ({1}). + Project {0} migration failed ({1}). + + + + Unable to find any projects in global.json. + Unable to find any projects in global.json. + + + + Unable to find any projects in {0}. + Unable to find any projects in {0}. + + + + No project.json file found in '{0}'. + No project.json file found in '{0}'. + + + + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + + + + Unable to find project.json file at {0}. + Unable to find project.json file at {0}. + + + + Unable to find global settings file at {0}. + Unable to find global settings file at {0}. + + + + Unable to find the solution file at {0}. + Unable to find the solution file at {0}. + + + + Files backed up to {0} + Files backed up to {0} + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.es.xlf index 936a60347..33514239f 100644 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.es.xlf @@ -39,9 +39,9 @@ Si no se especifica ninguno, usa el directorio actual de forma predeterminada. - The version of the sdk package that will be referenced in the migrated app. The default is the version of the sdk in dotnet new. - Versión del paquete de SDK al que se hará referencia en la aplicación migrada. El valor predeterminado es la versión del SDK en dotnet new. - + The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. + Versión del paquete de SDK al que se hará referencia en la aplicación migrada. El valor predeterminado es la versión del SDK en dotnet new. + The path to the xproj file to use. Required when there is more than one xproj in a project directory. @@ -49,9 +49,9 @@ Si no se especifica ninguno, usa el directorio actual de forma predeterminada. - Skip migrating project references. By default project references are migrated recursively. - Omite la migración de las referencias del proyecto. De forma predeterminada, las referencias del proyecto se migran recursivamente. - + Skip migrating project references. By default, project references are migrated recursively. + Omite la migración de las referencias del proyecto. De forma predeterminada, las referencias del proyecto se migran recursivamente. + Output migration report to the given file in addition to the console. @@ -73,6 +73,81 @@ Si no se especifica ninguno, usa el directorio actual de forma predeterminada.No se pudo llevar a cabo la migración. + + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + + + + Summary + Summary + + + + Total Projects: {0} + Total Projects: {0} + + + + Succeeded Projects: {0} + Succeeded Projects: {0} + + + + Failed Projects: {0} + Failed Projects: {0} + + + + Project {0} migration succeeded ({1}). + Project {0} migration succeeded ({1}). + + + + Project {0} migration failed ({1}). + Project {0} migration failed ({1}). + + + + Unable to find any projects in global.json. + Unable to find any projects in global.json. + + + + Unable to find any projects in {0}. + Unable to find any projects in {0}. + + + + No project.json file found in '{0}'. + No project.json file found in '{0}'. + + + + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + + + + Unable to find project.json file at {0}. + Unable to find project.json file at {0}. + + + + Unable to find global settings file at {0}. + Unable to find global settings file at {0}. + + + + Unable to find the solution file at {0}. + Unable to find the solution file at {0}. + + + + Files backed up to {0} + Files backed up to {0} + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.fr.xlf index 04122aeb2..ccdd3b5c5 100644 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.fr.xlf @@ -39,9 +39,9 @@ Sélectionne par défaut le répertoire actif si rien n'est spécifié. - The version of the sdk package that will be referenced in the migrated app. The default is the version of the sdk in dotnet new. - Version du package sdk référencée dans l'application migrée. La valeur par défaut est la version du sdk dans dotnet new. - + The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. + Version du package sdk référencée dans l'application migrée. La valeur par défaut est la version du sdk dans dotnet new. + The path to the xproj file to use. Required when there is more than one xproj in a project directory. @@ -49,9 +49,9 @@ Sélectionne par défaut le répertoire actif si rien n'est spécifié. - Skip migrating project references. By default project references are migrated recursively. - Ignorer les références du projet en cours de migration. Par défaut, les références du projet sont migrées de manière récursive. - + Skip migrating project references. By default, project references are migrated recursively. + Ignorer les références du projet en cours de migration. Par défaut, les références du projet sont migrées de manière récursive. + Output migration report to the given file in addition to the console. @@ -73,6 +73,81 @@ Sélectionne par défaut le répertoire actif si rien n'est spécifié. Échec de la migration. + + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + + + + Summary + Summary + + + + Total Projects: {0} + Total Projects: {0} + + + + Succeeded Projects: {0} + Succeeded Projects: {0} + + + + Failed Projects: {0} + Failed Projects: {0} + + + + Project {0} migration succeeded ({1}). + Project {0} migration succeeded ({1}). + + + + Project {0} migration failed ({1}). + Project {0} migration failed ({1}). + + + + Unable to find any projects in global.json. + Unable to find any projects in global.json. + + + + Unable to find any projects in {0}. + Unable to find any projects in {0}. + + + + No project.json file found in '{0}'. + No project.json file found in '{0}'. + + + + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + + + + Unable to find project.json file at {0}. + Unable to find project.json file at {0}. + + + + Unable to find global settings file at {0}. + Unable to find global settings file at {0}. + + + + Unable to find the solution file at {0}. + Unable to find the solution file at {0}. + + + + Files backed up to {0} + Files backed up to {0} + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.it.xlf index 6772f8d8e..b30cb31c0 100644 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.it.xlf @@ -39,9 +39,9 @@ Se non si specifica un valore, per impostazione predefinita, verrà usata la dir - The version of the sdk package that will be referenced in the migrated app. The default is the version of the sdk in dotnet new. - Versione del pacchetto SDK a cui verrà fatto riferimento nell'app di cui è stata eseguita la migrazione. L'impostazione predefinita è la versione dell'SDK in dotnet new. - + The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. + Versione del pacchetto SDK a cui verrà fatto riferimento nell'app di cui è stata eseguita la migrazione. L'impostazione predefinita è la versione dell'SDK in dotnet new. + The path to the xproj file to use. Required when there is more than one xproj in a project directory. @@ -49,9 +49,9 @@ Se non si specifica un valore, per impostazione predefinita, verrà usata la dir - Skip migrating project references. By default project references are migrated recursively. - Ignora la migrazione dei riferimenti al progetto. Per impostazione predefinita, la migrazione dei riferimenti al progetto è ricorsiva. - + Skip migrating project references. By default, project references are migrated recursively. + Ignora la migrazione dei riferimenti al progetto. Per impostazione predefinita, la migrazione dei riferimenti al progetto è ricorsiva. + Output migration report to the given file in addition to the console. @@ -73,6 +73,81 @@ Se non si specifica un valore, per impostazione predefinita, verrà usata la dir La migrazione non è riuscita. + + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + + + + Summary + Summary + + + + Total Projects: {0} + Total Projects: {0} + + + + Succeeded Projects: {0} + Succeeded Projects: {0} + + + + Failed Projects: {0} + Failed Projects: {0} + + + + Project {0} migration succeeded ({1}). + Project {0} migration succeeded ({1}). + + + + Project {0} migration failed ({1}). + Project {0} migration failed ({1}). + + + + Unable to find any projects in global.json. + Unable to find any projects in global.json. + + + + Unable to find any projects in {0}. + Unable to find any projects in {0}. + + + + No project.json file found in '{0}'. + No project.json file found in '{0}'. + + + + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + + + + Unable to find project.json file at {0}. + Unable to find project.json file at {0}. + + + + Unable to find global settings file at {0}. + Unable to find global settings file at {0}. + + + + Unable to find the solution file at {0}. + Unable to find the solution file at {0}. + + + + Files backed up to {0} + Files backed up to {0} + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.ja.xlf index 5d49440a2..ffa1a773d 100644 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.ja.xlf @@ -39,9 +39,9 @@ Defaults to current directory if nothing is specified. - The version of the sdk package that will be referenced in the migrated app. The default is the version of the sdk in dotnet new. - 移行されたアプリで参照される SDK パッケージのバージョン。既定は dotnet new の SDK のバージョンです。 - + The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. + 移行されたアプリで参照される SDK パッケージのバージョン。既定は dotnet new の SDK のバージョンです。 + The path to the xproj file to use. Required when there is more than one xproj in a project directory. @@ -49,9 +49,9 @@ Defaults to current directory if nothing is specified. - Skip migrating project references. By default project references are migrated recursively. - プロジェクト参照の移行をスキップします。既定では、プロジェクト参照は再帰的に移行されます。 - + Skip migrating project references. By default, project references are migrated recursively. + プロジェクト参照の移行をスキップします。既定では、プロジェクト参照は再帰的に移行されます。 + Output migration report to the given file in addition to the console. @@ -73,6 +73,81 @@ Defaults to current directory if nothing is specified. 移行に失敗しました。 + + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + + + + Summary + Summary + + + + Total Projects: {0} + Total Projects: {0} + + + + Succeeded Projects: {0} + Succeeded Projects: {0} + + + + Failed Projects: {0} + Failed Projects: {0} + + + + Project {0} migration succeeded ({1}). + Project {0} migration succeeded ({1}). + + + + Project {0} migration failed ({1}). + Project {0} migration failed ({1}). + + + + Unable to find any projects in global.json. + Unable to find any projects in global.json. + + + + Unable to find any projects in {0}. + Unable to find any projects in {0}. + + + + No project.json file found in '{0}'. + No project.json file found in '{0}'. + + + + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + + + + Unable to find project.json file at {0}. + Unable to find project.json file at {0}. + + + + Unable to find global settings file at {0}. + Unable to find global settings file at {0}. + + + + Unable to find the solution file at {0}. + Unable to find the solution file at {0}. + + + + Files backed up to {0} + Files backed up to {0} + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.ko.xlf index 960840da0..cfeee8929 100644 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.ko.xlf @@ -39,9 +39,9 @@ Defaults to current directory if nothing is specified. - The version of the sdk package that will be referenced in the migrated app. The default is the version of the sdk in dotnet new. - 마이그레이션된 앱에서 참조되는 sdk 패키지의 버전입니다. 기본값은 새 dotnet의 sdk 버전입니다. - + The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. + 마이그레이션된 앱에서 참조되는 sdk 패키지의 버전입니다. 기본값은 새 dotnet의 sdk 버전입니다. + The path to the xproj file to use. Required when there is more than one xproj in a project directory. @@ -49,9 +49,9 @@ Defaults to current directory if nothing is specified. - Skip migrating project references. By default project references are migrated recursively. - 프로젝트 참조 마이그레이션을 건너뜁니다. 기본적으로 프로젝트 참조가 재귀적으로 마이그레이션됩니다. - + Skip migrating project references. By default, project references are migrated recursively. + 프로젝트 참조 마이그레이션을 건너뜁니다. 기본적으로 프로젝트 참조가 재귀적으로 마이그레이션됩니다. + Output migration report to the given file in addition to the console. @@ -73,6 +73,81 @@ Defaults to current directory if nothing is specified. 마이그레이션하지 못했습니다. + + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + + + + Summary + Summary + + + + Total Projects: {0} + Total Projects: {0} + + + + Succeeded Projects: {0} + Succeeded Projects: {0} + + + + Failed Projects: {0} + Failed Projects: {0} + + + + Project {0} migration succeeded ({1}). + Project {0} migration succeeded ({1}). + + + + Project {0} migration failed ({1}). + Project {0} migration failed ({1}). + + + + Unable to find any projects in global.json. + Unable to find any projects in global.json. + + + + Unable to find any projects in {0}. + Unable to find any projects in {0}. + + + + No project.json file found in '{0}'. + No project.json file found in '{0}'. + + + + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + + + + Unable to find project.json file at {0}. + Unable to find project.json file at {0}. + + + + Unable to find global settings file at {0}. + Unable to find global settings file at {0}. + + + + Unable to find the solution file at {0}. + Unable to find the solution file at {0}. + + + + Files backed up to {0} + Files backed up to {0} + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.pl.xlf index 41d8b6fcf..6055db106 100644 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.pl.xlf @@ -39,9 +39,9 @@ W przypadku braku podanej wartości domyślnie jest to bieżący katalog. - The version of the sdk package that will be referenced in the migrated app. The default is the version of the sdk in dotnet new. - Wersja pakietu SDK, do którego odwołanie będzie się znajdować w zmigrowanej aplikacji. Domyślnie jest to wersja pakietu SDK podana w poleceniu dotnet new. - + The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. + Wersja pakietu SDK, do którego odwołanie będzie się znajdować w zmigrowanej aplikacji. Domyślnie jest to wersja pakietu SDK podana w poleceniu dotnet new. + The path to the xproj file to use. Required when there is more than one xproj in a project directory. @@ -49,9 +49,9 @@ W przypadku braku podanej wartości domyślnie jest to bieżący katalog. - Skip migrating project references. By default project references are migrated recursively. - Pomiń migrowanie odwołań do projektów. Domyślnie odwołania do projektów są migrowane rekursywnie. - + Skip migrating project references. By default, project references are migrated recursively. + Pomiń migrowanie odwołań do projektów. Domyślnie odwołania do projektów są migrowane rekursywnie. + Output migration report to the given file in addition to the console. @@ -73,6 +73,81 @@ W przypadku braku podanej wartości domyślnie jest to bieżący katalog.Migracja nie powiodła się. + + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + + + + Summary + Summary + + + + Total Projects: {0} + Total Projects: {0} + + + + Succeeded Projects: {0} + Succeeded Projects: {0} + + + + Failed Projects: {0} + Failed Projects: {0} + + + + Project {0} migration succeeded ({1}). + Project {0} migration succeeded ({1}). + + + + Project {0} migration failed ({1}). + Project {0} migration failed ({1}). + + + + Unable to find any projects in global.json. + Unable to find any projects in global.json. + + + + Unable to find any projects in {0}. + Unable to find any projects in {0}. + + + + No project.json file found in '{0}'. + No project.json file found in '{0}'. + + + + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + + + + Unable to find project.json file at {0}. + Unable to find project.json file at {0}. + + + + Unable to find global settings file at {0}. + Unable to find global settings file at {0}. + + + + Unable to find the solution file at {0}. + Unable to find the solution file at {0}. + + + + Files backed up to {0} + Files backed up to {0} + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.pt-BR.xlf index 5be044342..aec810bdf 100644 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.pt-BR.xlf @@ -39,9 +39,9 @@ Usará como padrão o diretório atual se nada for especificado. - The version of the sdk package that will be referenced in the migrated app. The default is the version of the sdk in dotnet new. - A versão do pacote SDK que será referenciada no aplicativo migrado. O padrão é a versão do SDK em dotnet new. - + The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. + A versão do pacote SDK que será referenciada no aplicativo migrado. O padrão é a versão do SDK em dotnet new. + The path to the xproj file to use. Required when there is more than one xproj in a project directory. @@ -49,9 +49,9 @@ Usará como padrão o diretório atual se nada for especificado. - Skip migrating project references. By default project references are migrated recursively. - Ignorar a migração de referências do projeto. Por padrão, as referências do projeto são migradas recursivamente. - + Skip migrating project references. By default, project references are migrated recursively. + Ignorar a migração de referências do projeto. Por padrão, as referências do projeto são migradas recursivamente. + Output migration report to the given file in addition to the console. @@ -73,6 +73,81 @@ Usará como padrão o diretório atual se nada for especificado. Falha na migração. + + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + + + + Summary + Summary + + + + Total Projects: {0} + Total Projects: {0} + + + + Succeeded Projects: {0} + Succeeded Projects: {0} + + + + Failed Projects: {0} + Failed Projects: {0} + + + + Project {0} migration succeeded ({1}). + Project {0} migration succeeded ({1}). + + + + Project {0} migration failed ({1}). + Project {0} migration failed ({1}). + + + + Unable to find any projects in global.json. + Unable to find any projects in global.json. + + + + Unable to find any projects in {0}. + Unable to find any projects in {0}. + + + + No project.json file found in '{0}'. + No project.json file found in '{0}'. + + + + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + + + + Unable to find project.json file at {0}. + Unable to find project.json file at {0}. + + + + Unable to find global settings file at {0}. + Unable to find global settings file at {0}. + + + + Unable to find the solution file at {0}. + Unable to find the solution file at {0}. + + + + Files backed up to {0} + Files backed up to {0} + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.ru.xlf index b787535a0..21db2ef44 100644 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.ru.xlf @@ -39,9 +39,9 @@ Defaults to current directory if nothing is specified. - The version of the sdk package that will be referenced in the migrated app. The default is the version of the sdk in dotnet new. - Версия пакета SDK, на который будет ссылаться переносимое приложение. По умолчанию применяется версия пакета SDK в команде dotnet new. - + The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. + Версия пакета SDK, на который будет ссылаться переносимое приложение. По умолчанию применяется версия пакета SDK в команде dotnet new. + The path to the xproj file to use. Required when there is more than one xproj in a project directory. @@ -49,9 +49,9 @@ Defaults to current directory if nothing is specified. - Skip migrating project references. By default project references are migrated recursively. - Пропустить миграцию ссылок на проект. По умолчанию ссылки на проект переносятся рекурсивно. - + Skip migrating project references. By default, project references are migrated recursively. + Пропустить миграцию ссылок на проект. По умолчанию ссылки на проект переносятся рекурсивно. + Output migration report to the given file in addition to the console. @@ -73,6 +73,81 @@ Defaults to current directory if nothing is specified. Сбой миграции. + + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + + + + Summary + Summary + + + + Total Projects: {0} + Total Projects: {0} + + + + Succeeded Projects: {0} + Succeeded Projects: {0} + + + + Failed Projects: {0} + Failed Projects: {0} + + + + Project {0} migration succeeded ({1}). + Project {0} migration succeeded ({1}). + + + + Project {0} migration failed ({1}). + Project {0} migration failed ({1}). + + + + Unable to find any projects in global.json. + Unable to find any projects in global.json. + + + + Unable to find any projects in {0}. + Unable to find any projects in {0}. + + + + No project.json file found in '{0}'. + No project.json file found in '{0}'. + + + + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + + + + Unable to find project.json file at {0}. + Unable to find project.json file at {0}. + + + + Unable to find global settings file at {0}. + Unable to find global settings file at {0}. + + + + Unable to find the solution file at {0}. + Unable to find the solution file at {0}. + + + + Files backed up to {0} + Files backed up to {0} + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.tr.xlf index 82070bffc..d7374b6ee 100644 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.tr.xlf @@ -39,9 +39,9 @@ Bir seçenek belirtilmezse, geçerli dizin varsayılan olarak kullanılır. - The version of the sdk package that will be referenced in the migrated app. The default is the version of the sdk in dotnet new. - Geçirilen uygulamada başvurulacak sdk paketinin sürümü. Yeni dotnet’teki sdk sürümü, varsayılan değerdir. - + The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. + Geçirilen uygulamada başvurulacak sdk paketinin sürümü. Yeni dotnet’teki sdk sürümü, varsayılan değerdir. + The path to the xproj file to use. Required when there is more than one xproj in a project directory. @@ -49,9 +49,9 @@ Bir seçenek belirtilmezse, geçerli dizin varsayılan olarak kullanılır. - Skip migrating project references. By default project references are migrated recursively. - Proje başvurularını geçirmeyi atlayın. Varsayılan olarak, proje başvuruları yinelemeli olarak geçirilir. - + Skip migrating project references. By default, project references are migrated recursively. + Proje başvurularını geçirmeyi atlayın. Varsayılan olarak, proje başvuruları yinelemeli olarak geçirilir. + Output migration report to the given file in addition to the console. @@ -73,6 +73,81 @@ Bir seçenek belirtilmezse, geçerli dizin varsayılan olarak kullanılır.Geçiş başarısız oldu. + + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + + + + Summary + Summary + + + + Total Projects: {0} + Total Projects: {0} + + + + Succeeded Projects: {0} + Succeeded Projects: {0} + + + + Failed Projects: {0} + Failed Projects: {0} + + + + Project {0} migration succeeded ({1}). + Project {0} migration succeeded ({1}). + + + + Project {0} migration failed ({1}). + Project {0} migration failed ({1}). + + + + Unable to find any projects in global.json. + Unable to find any projects in global.json. + + + + Unable to find any projects in {0}. + Unable to find any projects in {0}. + + + + No project.json file found in '{0}'. + No project.json file found in '{0}'. + + + + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + + + + Unable to find project.json file at {0}. + Unable to find project.json file at {0}. + + + + Unable to find global settings file at {0}. + Unable to find global settings file at {0}. + + + + Unable to find the solution file at {0}. + Unable to find the solution file at {0}. + + + + Files backed up to {0} + Files backed up to {0} + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.xlf index 9cdf450c0..d7a8520ea 100644 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.xlf +++ b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.xlf @@ -29,16 +29,16 @@ Defaults to current directory if nothing is specified. - The version of the sdk package that will be referenced in the migrated app. The default is the version of the sdk in dotnet new. - + The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. + The path to the xproj file to use. Required when there is more than one xproj in a project directory. - Skip migrating project references. By default project references are migrated recursively. - + Skip migrating project references. By default, project references are migrated recursively. + Output migration report to the given file in addition to the console. @@ -56,6 +56,66 @@ Defaults to current directory if nothing is specified. Migration failed. + + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + + + + Summary + + + + Total Projects: {0} + + + + Succeeded Projects: {0} + + + + Failed Projects: {0} + + + + Project {0} migration succeeded ({1}). + + + + Project {0} migration failed ({1}). + + + + Unable to find any projects in global.json. + + + + Unable to find any projects in {0}. + + + + No project.json file found in '{0}'. + + + + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + + + + Unable to find project.json file at {0}. + + + + Unable to find global settings file at {0}. + + + + Unable to find the solution file at {0}. + + + + Files backed up to {0} + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.zh-Hans.xlf index 60428a99f..5634ab691 100644 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.zh-Hans.xlf @@ -39,9 +39,9 @@ Defaults to current directory if nothing is specified. - The version of the sdk package that will be referenced in the migrated app. The default is the version of the sdk in dotnet new. - 要在迁移的应用中引用的 SDK 包版本。默认值为 dotnet 新建中的 SDK 版本。 - + The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. + 要在迁移的应用中引用的 SDK 包版本。默认值为 dotnet 新建中的 SDK 版本。 + The path to the xproj file to use. Required when there is more than one xproj in a project directory. @@ -49,9 +49,9 @@ Defaults to current directory if nothing is specified. - Skip migrating project references. By default project references are migrated recursively. - 跳过迁移项目引用。默认情况下,项目引用是按递归方式进行迁移的。 - + Skip migrating project references. By default, project references are migrated recursively. + 跳过迁移项目引用。默认情况下,项目引用是按递归方式进行迁移的。 + Output migration report to the given file in addition to the console. @@ -73,6 +73,81 @@ Defaults to current directory if nothing is specified. 迁移失败。 + + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + + + + Summary + Summary + + + + Total Projects: {0} + Total Projects: {0} + + + + Succeeded Projects: {0} + Succeeded Projects: {0} + + + + Failed Projects: {0} + Failed Projects: {0} + + + + Project {0} migration succeeded ({1}). + Project {0} migration succeeded ({1}). + + + + Project {0} migration failed ({1}). + Project {0} migration failed ({1}). + + + + Unable to find any projects in global.json. + Unable to find any projects in global.json. + + + + Unable to find any projects in {0}. + Unable to find any projects in {0}. + + + + No project.json file found in '{0}'. + No project.json file found in '{0}'. + + + + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + + + + Unable to find project.json file at {0}. + Unable to find project.json file at {0}. + + + + Unable to find global settings file at {0}. + Unable to find global settings file at {0}. + + + + Unable to find the solution file at {0}. + Unable to find the solution file at {0}. + + + + Files backed up to {0} + Files backed up to {0} + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.zh-Hant.xlf index e2ca0ed5c..806e403e0 100644 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.zh-Hant.xlf @@ -39,9 +39,9 @@ Defaults to current directory if nothing is specified. - The version of the sdk package that will be referenced in the migrated app. The default is the version of the sdk in dotnet new. - 移轉的應用程式中將要參考的 SDK 套件版本。預設為 dotnet new 中的 SDK 版本。 - + The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. + 移轉的應用程式中將要參考的 SDK 套件版本。預設為 dotnet new 中的 SDK 版本。 + The path to the xproj file to use. Required when there is more than one xproj in a project directory. @@ -49,9 +49,9 @@ Defaults to current directory if nothing is specified. - Skip migrating project references. By default project references are migrated recursively. - 跳過移轉專案參考。預設會遞迴移轉專案參考。 - + Skip migrating project references. By default, project references are migrated recursively. + 跳過移轉專案參考。預設會遞迴移轉專案參考。 + Output migration report to the given file in addition to the console. @@ -73,6 +73,81 @@ Defaults to current directory if nothing is specified. 移轉失敗。 + + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. + + + + Summary + Summary + + + + Total Projects: {0} + Total Projects: {0} + + + + Succeeded Projects: {0} + Succeeded Projects: {0} + + + + Failed Projects: {0} + Failed Projects: {0} + + + + Project {0} migration succeeded ({1}). + Project {0} migration succeeded ({1}). + + + + Project {0} migration failed ({1}). + Project {0} migration failed ({1}). + + + + Unable to find any projects in global.json. + Unable to find any projects in global.json. + + + + Unable to find any projects in {0}. + Unable to find any projects in {0}. + + + + No project.json file found in '{0}'. + No project.json file found in '{0}'. + + + + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. + + + + Unable to find project.json file at {0}. + Unable to find project.json file at {0}. + + + + Unable to find global settings file at {0}. + Unable to find global settings file at {0}. + + + + Unable to find the solution file at {0}. + Unable to find the solution file at {0}. + + + + Files backed up to {0} + Files backed up to {0} + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.cs.xlf index ef71e2afd..2310dab81 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.cs.xlf @@ -38,26 +38,6 @@ Zahrne soubory PDB a zdrojové soubory. Zdrojové soubory ve složce srcve výsledném balíčku NuGet - - CONFIGURATION - CONFIGURATION - - - - Configuration to use for building the project. Default for most projects is "Debug". - Konfigurace použitá k sestavení projektu. Výchozí možnost u většiny projektů je „Debug“. - - - - VERSION_SUFFIX - VERSION_SUFFIX - - - - Defines the value for the $(VersionSuffix) property in the project. - Definuje hodnotu vlastnosti $(VersionSuffix) v projektu. - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. Nastaví v balíčku příznak obsluhovatelnosti. Další informace najdete na adrese https://aka.ms/nupkgservicing. diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.de.xlf index cdc1660bf..1085ec77b 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.de.xlf @@ -38,26 +38,6 @@ PDBs und Quelldateien einschließen. Quelldateien werden im Ordner "src" im resultierenden NuGet-Paket abgelegt. - - CONFIGURATION - CONFIGURATION - - - - Configuration to use for building the project. Default for most projects is "Debug". - Konfiguration für die Erstellung des Projekts. Standard für die meisten Projekte ist "Debug". - - - - VERSION_SUFFIX - VERSION_SUFFIX - - - - Defines the value for the $(VersionSuffix) property in the project. - Definiert den Wert für die Eigenschaft "$(VersionSuffix)" im Projekt. - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. Legt das Verarbeitungsflag im Paket fest. Weitere Informationen finden Sie unter https://aka.ms/nupkgservicing. diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.es.xlf index ed0065af4..e54632921 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.es.xlf @@ -38,26 +38,6 @@ Se incluyen los archivos PDB y de código fuente. Los archivos de código fuente van a la carpeta src del paquete NuGet resultante - - CONFIGURATION - CONFIGURACIÓN - - - - Configuration to use for building the project. Default for most projects is "Debug". - Configuración para usar para crear el proyecto. El valor predeterminado para la mayoría de los proyectos es "Depurar". - - - - VERSION_SUFFIX - SUFIJO_DE_VERSIÓN - - - - Defines the value for the $(VersionSuffix) property in the project. - Define el valor para la propiedad $(VersionSuffix) del proyecto. - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. Establece la marca serviceable en el paquete. Para más información, consulte https://aka.ms/nupkgservicing. diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.fr.xlf index 193d57e54..76b037e2e 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.fr.xlf @@ -38,26 +38,6 @@ Inclure les PDB et les fichiers sources. Les fichiers sources vont dans le dossier src dans le paquet NuGet résultant - - CONFIGURATION - CONFIGURATION - - - - Configuration to use for building the project. Default for most projects is "Debug". - Configuration à utiliser pour la génération du projet. La valeur par défaut pour la plupart des projets est "Debug". - - - - VERSION_SUFFIX - SUFFIXE_VERSION - - - - Defines the value for the $(VersionSuffix) property in the project. - Définit la valeur de la propriété $(VersionSuffix) dans le projet. - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. Définissez l'indicateur de maintenance dans le package. Pour plus d'informations, consultez https://aka.ms/nupkgservicing. diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.it.xlf index 0f7a652d9..547c21511 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.it.xlf @@ -38,26 +38,6 @@ Include i PDB e i file di origine. I file di origine vengono inseriti nella cartella src nel pacchetto NuGet risultante - - CONFIGURATION - CONFIGURAZIONE - - - - Configuration to use for building the project. Default for most projects is "Debug". - Configurazione da usare per compilare il progetto. L'impostazione predefinita per la maggior parte dei progetti è "Debug". - - - - VERSION_SUFFIX - SUFFISSO_VERSIONE - - - - Defines the value for the $(VersionSuffix) property in the project. - Consente di definire il valore per la proprietà $(VersionSuffix) nel progetto. - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. Imposta il flag serviceable nel pacchetto. Per altre informazioni,vedere https://aka.ms/nupkgservicing. diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ja.xlf index f003ccbd0..672b37402 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ja.xlf @@ -38,26 +38,6 @@ PDB とソース ファイルを含めます。ソース ファイルは、結果の nuget パッケージの src フォルダーに移動します - - CONFIGURATION - CONFIGURATION - - - - Configuration to use for building the project. Default for most projects is "Debug". - プロジェクトの構築に使用する構成。ほとんどのプロジェクトで既定は "デバッグ" です。 - - - - VERSION_SUFFIX - VERSION_SUFFIX - - - - Defines the value for the $(VersionSuffix) property in the project. - プロジェクトの $(VersionSuffix) プロパティの値を定義します。 - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. パッケージに処理可能なフラグを設定します。詳しくは、https://aka.ms/nupkgservicing をご覧ください。 diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ko.xlf index 95cb88660..4b21892f8 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ko.xlf @@ -38,26 +38,6 @@ PDB 및 소스 파일을 포함합니다. 소스 파일이 결과 nuget 패키지의 src 폴더로 이동합니다. - - CONFIGURATION - CONFIGURATION - - - - Configuration to use for building the project. Default for most projects is "Debug". - 프로젝트 빌드에 사용할 구성입니다. 대부분의 프로젝트에서 기본값은 "Debug"입니다. - - - - VERSION_SUFFIX - VERSION_SUFFIX - - - - Defines the value for the $(VersionSuffix) property in the project. - 프로젝트에서 $(VersionSuffix) 속성의 값을 정의합니다. - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. 패키지에서 서비스 가능 플래그를 설정합니다. 자세한 내용은 https://aka.ms/nupkgservicing을 참조하세요. diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pl.xlf index 0d18fc138..36ce9b508 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pl.xlf @@ -38,26 +38,6 @@ Dołącz pliki PDB i pliki źródłowe. Pliki źródłowe zostaną umieszczone w folderze src w wynikowym pakiecie NuGet - - CONFIGURATION - KONFIGURACJA - - - - Configuration to use for building the project. Default for most projects is "Debug". - Konfiguracja do użycia na potrzeby kompilacji projektu. Opcją domyślną w przypadku większości projektów jest „Debug”. - - - - VERSION_SUFFIX - SUFIKS_WERSJI - - - - Defines the value for the $(VersionSuffix) property in the project. - Określa wartość właściwości $(VersionSuffix) w projekcie. - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. Ustaw w pakiecie flagę oznaczającą możliwość obsługi. Aby uzyskać więcej informacji, zobacz https://aka.ms/nupkgservicing. diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pt-BR.xlf index d00f555ab..e2555168c 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pt-BR.xlf @@ -38,26 +38,6 @@ Incluir os arquivos de origem e os PDBs. Os arquivos de origem vão para a pasta de origem no pacote nuget resultante - - CONFIGURATION - CONFIGURAÇÃO - - - - Configuration to use for building the project. Default for most projects is "Debug". - A configuração a ser usada para criar o projeto. O padrão para a maioria dos projetos é “Depurar”. - - - - VERSION_SUFFIX - SUFIXO_DA_VERSÃO - - - - Defines the value for the $(VersionSuffix) property in the project. - Define o valor da propriedade $(VersionSuffix) no projeto. - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. Definir o sinalizador operacional no pacote. Para obter mais informações, consulte https://aka.ms/nupkgservicing. diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ru.xlf index 8c3cf145b..b65d1a284 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ru.xlf @@ -38,26 +38,6 @@ Включение PDB-файлов и исходных файлов. Исходные файлы передаются в папку src в получившемся проекте NuGet - - CONFIGURATION - CONFIGURATION - - - - Configuration to use for building the project. Default for most projects is "Debug". - Конфигурация, используемая для сборки проекта. Значение по умолчанию для большинства проектов — "Debug". - - - - VERSION_SUFFIX - VERSION_SUFFIX - - - - Defines the value for the $(VersionSuffix) property in the project. - Определяет значение для свойства $(VersionSuffix) в проекте. - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. Задать флаг "подлежит обслуживанию" в пакете. Дополнительные сведения: https://aka.ms/nupkgservicing. diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.tr.xlf index 4da709be0..6e9615f1a 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.tr.xlf @@ -38,26 +38,6 @@ PDB’leri ve kaynak dosyaları ekleyin. Elde edilen nuget paketinde kaynak dosyaları, src klasöründe yer alır - - CONFIGURATION - YAPILANDIRMA - - - - Configuration to use for building the project. Default for most projects is "Debug". - Projeyi derlemek için kullanılacak yapılandırma. Çoğu proje için varsayılan: "Debug". - - - - VERSION_SUFFIX - SÜRÜM_SONEKİ - - - - Defines the value for the $(VersionSuffix) property in the project. - Projedeki $(VersionSuffix) özelliğinin değerini tanımlar. - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. Paketteki serviceable bayrağını ayarlayın. Daha fazla bilgi için bkz. https://aka.ms/nupkgservicing. diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.xlf index 351965726..922e083e4 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.xlf @@ -31,22 +31,6 @@ Include PDBs and source files. Source files go into the src folder in the resulting nuget package - - CONFIGURATION - - - - Configuration to use for building the project. Default for most projects is "Debug". - - - - VERSION_SUFFIX - - - - Defines the value for the $(VersionSuffix) property in the project. - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hans.xlf index 11d93baf0..ea013c329 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hans.xlf @@ -38,26 +38,6 @@ 包括 PDB 和源文件。源文件放入 nuget 结果包的 src 文件夹中 - - CONFIGURATION - CONFIGURATION - - - - Configuration to use for building the project. Default for most projects is "Debug". - 用于生成项目的配置。对大多数项目的默认值是 "Debug"。 - - - - VERSION_SUFFIX - VERSION_SUFFIX - - - - Defines the value for the $(VersionSuffix) property in the project. - 定义项目中 $(VersionSuffix) 属性的值。 - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. 在包中设置可用标志。有关详细信息,请参阅 https://aka.ms/nupkgservicing。 diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hant.xlf index f2b3b114e..b8a565434 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hant.xlf @@ -38,26 +38,6 @@ 包含 PDB 和來源檔案。來源檔案會傳入產生之 NuGet 套件中的 src 資料夾 - - CONFIGURATION - 組態 - - - - Configuration to use for building the project. Default for most projects is "Debug". - 要用於建置專案的組態。多數專案的預設為 "Debug"。 - - - - VERSION_SUFFIX - VERSION_SUFFIX - - - - Defines the value for the $(VersionSuffix) property in the project. - 定義 $(VersionSuffix) 屬性在專案中的值。 - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. 設定套件中提供服務的旗標。如需詳細資訊,請參閱 https://aka.ms/nupkgservicing。 diff --git a/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs b/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs index aa2b9bc2e..600d4c459 100644 --- a/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs +++ b/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs @@ -15,14 +15,14 @@ namespace Microsoft.DotNet.Cli LocalizableStrings.AppDescription, Accept.ZeroOrMoreArguments(), CommonOptions.HelpOption(), - CommonOptions.FrameworkOption(), - CommonOptions.RuntimeOption(), Create.Option( "-o|--output", LocalizableStrings.OutputOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.OutputOption) .ForwardAsSingle(o => $"/p:PublishDir={o.Arguments.Single()}")), + CommonOptions.FrameworkOption(), + CommonOptions.RuntimeOption(), CommonOptions.ConfigurationOption(), CommonOptions.VersionSuffixOption(), Create.Option( diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.cs.xlf index edb082e5f..4b97a36a5 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.cs.xlf @@ -3,26 +3,11 @@ - - .NET Publisher - .NET Publisher - - Publisher for the .NET Platform Vydavatel pro platformu .NET - - PROJECT - PROJECT - - - - The MSBuild project file to publish. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - Soubor projektu publikovaný nástrojem MSBuild. Pokud není zadaný soubor projektu, nástroj MSBuild vyhledá v aktuálním pracovním adresáři soubor s příponou, která končí na „proj“, a použije ho. - - FRAMEWORK FRAMEWORK @@ -33,16 +18,6 @@ Cílová platforma pro publikování. Cílová platforma musí být v souboru projektu zadaná. - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependented app. - Publikuje projekt pro daný modul runtime. Používá se při vytváření nezávislého nasazení. Výchozí možnost je publikování aplikace závislé na platformě. - - OUTPUT_DIR OUTPUT_DIR @@ -53,34 +28,19 @@ Výstupní adresář do kterého se umisťují publikované artefakty. - - CONFIGURATION - CONFIGURATION - - - - Configuration to use for building the project. Default for most projects is "Debug". - Konfigurace použitá k sestavení projektu. Výchozí možnost u většiny projektů je „Debug“. - - - - VERSION_SUFFIX - VERSION_SUFFIX - - - - Defines the value for the $(VersionSuffix) property in the project. - Definuje hodnotu vlastnosti $(VersionSuffix) v projektu. - - - - profile.xml - profile.proj + + manifest.xml + manifest.xml - - The XML file that contains the list of packages to be excluded from publish step. - The list of packages to be excluded from publish step. + + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + + + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.de.xlf index 496046453..cec2351dd 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.de.xlf @@ -3,26 +3,11 @@ - - .NET Publisher - .NET-Herausgeber - - Publisher for the .NET Platform Herausgeber für die .NET-Plattform - - PROJECT - PROJECT - - - - The MSBuild project file to publish. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - Die zu veröffentlichende MSBuild-Projektdatei. Wenn keine Projektdatei angegeben ist, durchsucht MSBuild das aktuelle Arbeitsverzeichnis nach einer Datei mit einer Dateierweiterung, die auf "proj" endet, und verwendet diese Datei. - - FRAMEWORK FRAMEWORK @@ -33,16 +18,6 @@ Zielframework für die Veröffentlichung. Das Zielframework muss in der Projektdatei angegeben werden. - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependented app. - Veröffentlicht das Projekt für eine angegebene Laufzeit. Wird zum Erstellen einer eigenständigen Bereitstellung verwendet. Standardmäßig wird eine Framework-abhängige App veröffentlicht. - - OUTPUT_DIR OUTPUT_DIR @@ -53,34 +28,19 @@ Ausgabeverzeichnis, in dem veröffentlichte Artefakte abgelegt werden. - - CONFIGURATION - CONFIGURATION - - - - Configuration to use for building the project. Default for most projects is "Debug". - Konfiguration für die Erstellung des Projekts. Standard für die meisten Projekte ist "Debug". - - - - VERSION_SUFFIX - VERSION_SUFFIX - - - - Defines the value for the $(VersionSuffix) property in the project. - Definiert den Wert für die Eigenschaft "$(VersionSuffix)" im Projekt. - - - - profile.xml - profile.proj + + manifest.xml + manifest.xml - - The XML file that contains the list of packages to be excluded from publish step. - The list of packages to be excluded from publish step. + + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + + + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.es.xlf index af51f92f3..e8eca4b07 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.es.xlf @@ -3,26 +3,11 @@ - - .NET Publisher - Publicador de .NET - - Publisher for the .NET Platform Publicador para la plataforma .NET - - PROJECT - PROYECTO - - - - The MSBuild project file to publish. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - Archivo del proyecto de MSBuild que se va a publicar. Si no se especifica un archivo del proyecto, MSBuild busca en el directorio de trabajo actual un archivo que tenga una extensión de archivo que acabe en “proj” y utiliza ese archivo. - - FRAMEWORK PLATAFORMA @@ -33,16 +18,6 @@ Plataforma de destino para la que se publica. La plataforma de destino se debe especificar en el archivo de proyecto. - - RUNTIME_IDENTIFIER - ID_DEL_ENTORNO_DE_TIEMPO_DE_EJECUCIÓN - - - - Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependented app. - Publica el proyecto para un runtime determinado. Se usa cuando se crea la implementación independiente. La opción predeterminada es publicar una aplicación dependiente de la plataforma. - - OUTPUT_DIR DIRECTORIO_DE_SALIDA @@ -53,34 +28,19 @@ Directorio de salida en el que se ubicarán los artefactos publicados. - - CONFIGURATION - CONFIGURACIÓN - - - - Configuration to use for building the project. Default for most projects is "Debug". - Configuración para usar para crear el proyecto. El valor predeterminado para la mayoría de los proyectos es "Depurar". - - - - VERSION_SUFFIX - SUFIJO_DE_VERSIÓN - - - - Defines the value for the $(VersionSuffix) property in the project. - Define el valor para la propiedad $(VersionSuffix) del proyecto. - - - - profile.xml - profile.proj + + manifest.xml + manifest.xml - - The XML file that contains the list of packages to be excluded from publish step. - The list of packages to be excluded from publish step. + + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + + + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.fr.xlf index c9d898451..90fface4b 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.fr.xlf @@ -3,26 +3,11 @@ - - .NET Publisher - Éditeur .NET - - Publisher for the .NET Platform Éditeur pour la plateforme .NET - - PROJECT - PROJET - - - - The MSBuild project file to publish. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - Fichier projet MSBuild à publier. Si aucun fichier projet n'est spécifié, MSBuild recherche dans le répertoire de travail actif un fichier dont l'extension se termine par 'proj' et utilise ce dernier. - - FRAMEWORK FRAMEWORK @@ -33,16 +18,6 @@ Framework cible de la publication. Le framework cible doit être spécifié dans le fichier projet. - - RUNTIME_IDENTIFIER - IDENTIFICATEUR_RUNTIME - - - - Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependented app. - Publie le projet pour un runtime donné. Utilisé lors de la création d'un déploiement autonome. Le comportement par défaut consiste à publier une application dépendante du framework. - - OUTPUT_DIR RÉP_SORTIE @@ -53,34 +28,19 @@ Répertoire de sortie dans lequel placer les artefacts publiés. - - CONFIGURATION - CONFIGURATION - - - - Configuration to use for building the project. Default for most projects is "Debug". - Configuration à utiliser pour la génération du projet. La valeur par défaut pour la plupart des projets est "Debug". - - - - VERSION_SUFFIX - SUFFIXE_VERSION - - - - Defines the value for the $(VersionSuffix) property in the project. - Définit la valeur de la propriété $(VersionSuffix) dans le projet. - - - - profile.xml - profile.proj + + manifest.xml + manifest.xml - - The XML file that contains the list of packages to be excluded from publish step. - The list of packages to be excluded from publish step. + + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + + + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.it.xlf index 7c2236a93..5a4c978aa 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.it.xlf @@ -3,26 +3,11 @@ - - .NET Publisher - Editore .NET - - Publisher for the .NET Platform Editore per la piattaforma .NET - - PROJECT - PROGETTO - - - - The MSBuild project file to publish. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - File di progetto MSBuild da pubblicare. Se non si specifica un file di progetto, MSBuild cerca nella directory di lavoro corrente un file la cui estensione termina con `proj` e usa tale file. - - FRAMEWORK FRAMEWORK @@ -33,16 +18,6 @@ Framework di destinazione per cui eseguire la pubblicazione. Il framework di destinazione deve essere specificato nel file di progetto. - - RUNTIME_IDENTIFIER - IDENTIFICATORE_RUNTIME - - - - Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependented app. - Consente di pubblicare il progetto per un runtime specificato. Viene usata durante la creazione della distribuzione indipendente. Per impostazione predefinita, viene pubblicata un'app dipendente dal framework. - - OUTPUT_DIR DIR_OUTPUT @@ -53,34 +28,19 @@ Directory di output in cui inserire gli artefatti pubblicati. - - CONFIGURATION - CONFIGURAZIONE - - - - Configuration to use for building the project. Default for most projects is "Debug". - Configurazione da usare per compilare il progetto. L'impostazione predefinita per la maggior parte dei progetti è "Debug". - - - - VERSION_SUFFIX - SUFFISSO_VERSIONE - - - - Defines the value for the $(VersionSuffix) property in the project. - Consente di definire il valore per la proprietà $(VersionSuffix) nel progetto. - - - - profile.xml - profile.proj + + manifest.xml + manifest.xml - - The XML file that contains the list of packages to be excluded from publish step. - The list of packages to be excluded from publish step. + + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + + + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ja.xlf index a863c7066..64432090a 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ja.xlf @@ -3,26 +3,11 @@ - - .NET Publisher - .NET Publisher - - Publisher for the .NET Platform .NET Platform 用パブリッシャー - - PROJECT - PROJECT - - - - The MSBuild project file to publish. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - 発行する MSBuild プロジェクト ファイルプロジェクト ファイルを指定しなかった場合、MSBuild は現在の作業ディレクトリの中から "proj" で終わるファイル拡張子を検索し、そのファイルを使用します。 - - FRAMEWORK FRAMEWORK @@ -33,16 +18,6 @@ 発行用のターゲット フレームワーク。ターゲット フレームワークはプロジェクト ファイルで指定する必要があります。 - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependented app. - 指定されたランタイムのプロジェクトを発行します。これは、自己完結型の展開を作成する際に使用します。既定では、フレームワーク依存アプリを発行します。 - - OUTPUT_DIR OUTPUT_DIR @@ -53,34 +28,19 @@ 発行された成果物を配置する出力ディレクトリ。 - - CONFIGURATION - CONFIGURATION - - - - Configuration to use for building the project. Default for most projects is "Debug". - プロジェクトの構築に使用する構成。ほとんどのプロジェクトで既定は "デバッグ" です。 - - - - VERSION_SUFFIX - VERSION_SUFFIX - - - - Defines the value for the $(VersionSuffix) property in the project. - プロジェクトの $(VersionSuffix) プロパティの値を定義します。 - - - - profile.xml - profile.proj + + manifest.xml + manifest.xml - - The XML file that contains the list of packages to be excluded from publish step. - The list of packages to be excluded from publish step. + + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + + + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ko.xlf index a65462ebf..715284fca 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ko.xlf @@ -3,26 +3,11 @@ - - .NET Publisher - .NET 게시자 - - Publisher for the .NET Platform .NET 플랫폼용 게시자입니다. - - PROJECT - PROJECT - - - - The MSBuild project file to publish. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - 게시할 MSBuild 프로젝트 파일입니다. 프로젝트 파일을 지정하지 않으면 MSBuild는 현재 작업 디렉터리에서 파일 확장명이 ‘proj’로 끝나는 파일을 찾아서 사용합니다. - - FRAMEWORK FRAMEWORK @@ -33,16 +18,6 @@ 게시할 대상 프레임워크입니다. 대상 프레임워크는 프로젝트 파일에서 지정해야 합니다. - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependented app. - 지정된 런타임 동안 프로젝트를 게시합니다. 자체 포함 배포를 만들 때 사용됩니다. 기본값은 프레임워크 종속 앱을 게시하는 것입니다. - - OUTPUT_DIR OUTPUT_DIR @@ -53,34 +28,19 @@ 게시할 아티팩트를 배치할 출력 디렉터리입니다. - - CONFIGURATION - CONFIGURATION - - - - Configuration to use for building the project. Default for most projects is "Debug". - 프로젝트 빌드에 사용할 구성입니다. 대부분의 프로젝트에서 기본값은 "Debug"입니다. - - - - VERSION_SUFFIX - VERSION_SUFFIX - - - - Defines the value for the $(VersionSuffix) property in the project. - 프로젝트에서 $(VersionSuffix) 속성의 값을 정의합니다. - - - - profile.xml - profile.proj + + manifest.xml + manifest.xml - - The XML file that contains the list of packages to be excluded from publish step. - The list of packages to be excluded from publish step. + + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + + + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pl.xlf index e828f5e4f..5feecdf91 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pl.xlf @@ -3,26 +3,11 @@ - - .NET Publisher - Wydawca platformy .NET - - Publisher for the .NET Platform Wydawca dla platformy .NET. - - PROJECT - PROJEKT - - - - The MSBuild project file to publish. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - Plik projektu programu MSBuild do publikacji. Jeśli nie określono pliku projektu, program MSBuild wyszukuje w bieżącym katalogu roboczym plik, którego rozszerzenie kończy się na „proj”, i używa tego pliku. - - FRAMEWORK PLATFORMA @@ -33,16 +18,6 @@ Docelowa platforma publikacji. Platforma docelowa musi być określona w pliku projektu. - - RUNTIME_IDENTIFIER - IDENTYFIKATOR_ŚRODOWISKA_URUCHOMIENIOWEGO - - - - Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependented app. - Opublikuj projekt dla danego środowiska uruchomieniowego. Ustawienie stosowane w przypadku tworzenia wdrożenia autonomicznego. Opcją domyślną jest opublikowanie aplikacji zależnej od platformy. - - OUTPUT_DIR KATALOG_WYJŚCIOWY @@ -53,34 +28,19 @@ Katalog wyjściowy, w którym mają zostać umieszczone opublikowane artefakty. - - CONFIGURATION - KONFIGURACJA - - - - Configuration to use for building the project. Default for most projects is "Debug". - Konfiguracja do użycia na potrzeby kompilacji projektu. Opcją domyślną w przypadku większości projektów jest „Debug”. - - - - VERSION_SUFFIX - SUFIKS_WERSJI - - - - Defines the value for the $(VersionSuffix) property in the project. - Określa wartość właściwości $(VersionSuffix) w projekcie. - - - - profile.xml - profile.proj + + manifest.xml + manifest.xml - - The XML file that contains the list of packages to be excluded from publish step. - The list of packages to be excluded from publish step. + + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + + + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pt-BR.xlf index e59daec64..3f816863f 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pt-BR.xlf @@ -3,26 +3,11 @@ - - .NET Publisher - Editor do .NET - - Publisher for the .NET Platform Editor para a Plataforma .NET - - PROJECT - PROJETO - - - - The MSBuild project file to publish. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - O arquivo de projeto do MSBuild para publicar. Se não houver arquivo de projeto especificado, o MSBuild pesquisará no diretório de trabalho atual um arquivo que contenha uma extensão de arquivo que termine em "proj" e usará esse arquivo. - - FRAMEWORK ESTRUTURA @@ -33,16 +18,6 @@ A estrutura de destino para a qual publicar. A estrutura de destino deve ser especificada no arquivo de projeto. - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependented app. - Publique o projeto para um tempo de execução fornecido. Isso é usado ao criar uma implantação autocontida. O padrão é publicar um aplicativo dependente de estrutura. - - OUTPUT_DIR DIRETÓRIO_DE_SAÍDA @@ -53,34 +28,19 @@ Diretório de saída no qual os artefatos publicados serão colocados. - - CONFIGURATION - CONFIGURAÇÃO - - - - Configuration to use for building the project. Default for most projects is "Debug". - A configuração a ser usada para criar o projeto. O padrão para a maioria dos projetos é “Depurar”. - - - - VERSION_SUFFIX - SUFIXO_DA_VERSÃO - - - - Defines the value for the $(VersionSuffix) property in the project. - Define o valor da propriedade $(VersionSuffix) no projeto. - - - - profile.xml - profile.proj + + manifest.xml + manifest.xml - - The XML file that contains the list of packages to be excluded from publish step. - The list of packages to be excluded from publish step. + + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + + + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ru.xlf index 7940d7364..3a59b6e66 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ru.xlf @@ -3,26 +3,11 @@ - - .NET Publisher - Издатель .NET - - Publisher for the .NET Platform Издатель для платформы .NET - - PROJECT - PROJECT - - - - The MSBuild project file to publish. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - Файл проекта MSBuild для публикации. Если файл проекта не указан, MSBuild выполняет в текущем рабочем каталоге поиск файла с расширением, оканчивающимся на PROJ, и использует этот файл. - - FRAMEWORK FRAMEWORK @@ -33,16 +18,6 @@ Целевая платформа публикации. Целевая платформа должна быть указана в файле проекта. - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependented app. - Публикует проект для указанной среды выполнения. Используется при создании автономного развертывания. По умолчанию публикуется зависимое от платформы приложение. - - OUTPUT_DIR OUTPUT_DIR @@ -53,34 +28,19 @@ Выходной каталог для размещения опубликованных артефактов. - - CONFIGURATION - CONFIGURATION - - - - Configuration to use for building the project. Default for most projects is "Debug". - Конфигурация, используемая для сборки проекта. Значение по умолчанию для большинства проектов — "Debug". - - - - VERSION_SUFFIX - VERSION_SUFFIX - - - - Defines the value for the $(VersionSuffix) property in the project. - Определяет значение для свойства $(VersionSuffix) в проекте. - - - - profile.xml - profile.proj + + manifest.xml + manifest.xml - - The XML file that contains the list of packages to be excluded from publish step. - The list of packages to be excluded from publish step. + + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + + + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.tr.xlf index 16a912240..7334d736a 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.tr.xlf @@ -3,26 +3,11 @@ - - .NET Publisher - .NET Yayımcısı - - Publisher for the .NET Platform .NET Platformunun yayımcısı. - - PROJECT - PROJE - - - - The MSBuild project file to publish. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - Yayımlanacak MSBuild proje dosyası. Bir proje dosyası belirtilmezse MSBuild, geçerli çalışma dizininde dosya uzantısının sonu ‘proj’ olan bir dosyası arar ve bu dosyayı kullanır. - - FRAMEWORK ÇERÇEVE @@ -33,16 +18,6 @@ Yayımlamanın yapılacağı hedef çerçeve. Hedef çerçevenin proje dosyasında belirtilmesi gerekir. - - RUNTIME_IDENTIFIER - ÇALIŞMA_ZAMANI_TANIMLAYICISI - - - - Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependented app. - Projeyi belirli bir çalışma zamanı için yayımlar. Bu, kendi içinde dağıtım oluştururken kullanılır. Varsayılan seçenek, çerçeveye bağlı bir uygulama yayımlamaktır. - - OUTPUT_DIR ÇIKIŞ_DİZİNİ @@ -53,34 +28,19 @@ Yayımlanan yapıtların yerleştirileceği çıkış dizini. - - CONFIGURATION - YAPILANDIRMA - - - - Configuration to use for building the project. Default for most projects is "Debug". - Projeyi derlemek için kullanılacak yapılandırma. Çoğu proje için varsayılan: "Debug". - - - - VERSION_SUFFIX - SÜRÜM_SONEKİ - - - - Defines the value for the $(VersionSuffix) property in the project. - Projedeki $(VersionSuffix) özelliğinin değerini tanımlar. - - - - profile.xml - profile.proj + + manifest.xml + manifest.xml - - The XML file that contains the list of packages to be excluded from publish step. - The list of packages to be excluded from publish step. + + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + + + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.xlf index 2576f0f7e..8a33dc288 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.xlf @@ -3,22 +3,10 @@ - - .NET Publisher - - Publisher for the .NET Platform - - PROJECT - - - - The MSBuild project file to publish. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - - FRAMEWORK @@ -27,14 +15,6 @@ Target framework to publish for. The target framework has to be specified in the project file. - - RUNTIME_IDENTIFIER - - - - Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependented app. - - OUTPUT_DIR @@ -43,28 +23,16 @@ Output directory in which to place the published artifacts. - - CONFIGURATION - - - - Configuration to use for building the project. Default for most projects is "Debug". - - - - VERSION_SUFFIX - - - - Defines the value for the $(VersionSuffix) property in the project. - - - - profile.xml + + manifest.xml - - The XML file that contains the list of packages to be excluded from publish step. + + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + + + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hans.xlf index 182693049..2971f5b94 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hans.xlf @@ -3,26 +3,11 @@ - - .NET Publisher - .NET 发布服务器 - - Publisher for the .NET Platform 适用于 .NET 平台的发布服务器 - - PROJECT - PROJECT - - - - The MSBuild project file to publish. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - 要发布的 MSBuild 项目文件。如果未指定项目文件,MSBuild 将搜索当前工作目录来查找文件扩展名以“proj”结尾的文件并使用该文件。 - - FRAMEWORK FRAMEWORK @@ -33,16 +18,6 @@ 要发布的目标框架。目标框架必须在项目文件中指定。 - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependented app. - 针对给定运行时发布项目。创建自包含部署时使用此项。默认操作为发布依赖框架的应用。 - - OUTPUT_DIR OUTPUT_DIR @@ -53,34 +28,19 @@ 用于放置已发布项的输出目录。 - - CONFIGURATION - CONFIGURATION - - - - Configuration to use for building the project. Default for most projects is "Debug". - 用于生成项目的配置。对大多数项目的默认值是 "Debug"。 - - - - VERSION_SUFFIX - VERSION_SUFFIX - - - - Defines the value for the $(VersionSuffix) property in the project. - 定义项目中 $(VersionSuffix) 属性的值。 - - - - profile.xml - profile.proj + + manifest.xml + manifest.xml - - The XML file that contains the list of packages to be excluded from publish step. - The list of packages to be excluded from publish step. + + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + + + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hant.xlf index c6dd013d2..82ba344a6 100644 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hant.xlf @@ -3,26 +3,11 @@ - - .NET Publisher - .NET 發行者 - - Publisher for the .NET Platform .NET 平台的發行者 - - PROJECT - 專案 - - - - The MSBuild project file to publish. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file. - 要發行的 MSBuild 專案檔。若未指定專案檔,MSBuild 會在目前的工作目錄搜尋副檔名以 `proj` 結尾的檔案,並使用該檔案。 - - FRAMEWORK 架構 @@ -33,16 +18,6 @@ 要對其發行的目標 Framework。目標 Framework 必須在專案檔中指定。 - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependented app. - 為指定的執行階段發行專案。這在建立獨立部署時會用到。預設為發行相依於架構的應用程式。 - - OUTPUT_DIR OUTPUT_DIR @@ -53,34 +28,19 @@ 要放置發行之成品的輸出目錄。 - - CONFIGURATION - 組態 - - - - Configuration to use for building the project. Default for most projects is "Debug". - 要用於建置專案的組態。多數專案的預設為 "Debug"。 - - - - VERSION_SUFFIX - VERSION_SUFFIX - - - - Defines the value for the $(VersionSuffix) property in the project. - 在專案中定義 $(VersionSuffix) 屬性的值。 - - - - profile.xml - profile.proj + + manifest.xml + manifest.xml - - The XML file that contains the list of packages to be excluded from publish step. - The list of packages to be excluded from publish step. + + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + The path to a target manifest file that contains the list of packages to be excluded from the publish step. + + + + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. + Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/Program.cs b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/Program.cs index de13b8b97..36d5fce0d 100644 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/Program.cs +++ b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/Program.cs @@ -29,7 +29,7 @@ namespace Microsoft.DotNet.Tools.Remove.PackageReference { throw new ArgumentNullException(nameof(fileOrDirectory)); } - if (_appliedCommand.Arguments.Count != 1) + if (appliedCommand.Arguments.Count != 1) { throw new GracefulException(LocalizableStrings.SpecifyExactlyOnePackageReference); } diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/RemovePackageParser.cs b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/RemovePackageParser.cs index acfe8fa1c..1c7cdc21a 100644 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/RemovePackageParser.cs +++ b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/RemovePackageParser.cs @@ -1,14 +1,19 @@ using Microsoft.DotNet.Cli.CommandLine; -using LocalizableStrings = Microsoft.DotNet.Tools.Remove.ProjectToProjectReference.LocalizableStrings; +using LocalizableStrings = Microsoft.DotNet.Tools.Remove.PackageReference.LocalizableStrings; namespace Microsoft.DotNet.Cli { internal static class RemovePackageParser { - public static Command RemovePackage() => - Create.Command( + public static Command RemovePackage() + { + return Create.Command( "package", LocalizableStrings.AppFullName, + Accept.ExactlyOneArgument() + .With(name: Tools.Add.PackageReference.LocalizableStrings.CmdPackage, + description: LocalizableStrings.AppHelpText), CommonOptions.HelpOption()); + } } -} \ No newline at end of file +} diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.xlf index ea08560e6..db38960c7 100644 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.xlf +++ b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.xlf @@ -5,19 +5,19 @@ .NET Remove Package reference Command. - + Command to remove package reference. - + Package reference to remove. - + Please specify only one package reference to remove. - + diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.cs.xlf index 87b4a917e..ba25511a9 100644 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.cs.xlf @@ -14,9 +14,9 @@ - Remove reference only when targetting a specific framework - Odebrat odkaz jen při zaměření na určitou platformu - + Remove reference only when targeting a specific framework + Odebrat odkaz jen při zaměření na určitou platformu + Project to project references to remove diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.de.xlf index 7ad399a36..a2391199e 100644 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.de.xlf @@ -14,9 +14,9 @@ - Remove reference only when targetting a specific framework - Verweis nur bei Verwendung eines bestimmten Zielframeworks entfernen - + Remove reference only when targeting a specific framework + Verweis nur bei Verwendung eines bestimmten Zielframeworks entfernen + Project to project references to remove diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.es.xlf index c695dd48c..d670213c8 100644 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.es.xlf @@ -14,9 +14,9 @@ - Remove reference only when targetting a specific framework - Se quita la referencia solo cuando hay una plataforma de destino específica - + Remove reference only when targeting a specific framework + Se quita la referencia solo cuando hay una plataforma de destino específica + Project to project references to remove diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.fr.xlf index eebe93da6..1db2fcc5d 100644 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.fr.xlf @@ -14,9 +14,9 @@ - Remove reference only when targetting a specific framework - Supprimer la référence uniquement en cas de ciblage d'un framework spécifique - + Remove reference only when targeting a specific framework + Supprimer la référence uniquement en cas de ciblage d'un framework spécifique + Project to project references to remove diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.it.xlf index 03d53d6a2..fdaccb460 100644 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.it.xlf @@ -14,9 +14,9 @@ - Remove reference only when targetting a specific framework - Rimuove il riferimento solo se destinato a un framework specifico - + Remove reference only when targeting a specific framework + Rimuove il riferimento solo se destinato a un framework specifico + Project to project references to remove diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.ja.xlf index eaa6aadb7..65245f44d 100644 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.ja.xlf @@ -14,9 +14,9 @@ - Remove reference only when targetting a specific framework - 特定のフレームワークを対象とする場合にのみ参照を削除する - + Remove reference only when targeting a specific framework + 特定のフレームワークを対象とする場合にのみ参照を削除する + Project to project references to remove diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.ko.xlf index 23594bc7a..8f88da812 100644 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.ko.xlf @@ -14,9 +14,9 @@ - Remove reference only when targetting a specific framework - 특정 프레임워크를 대상으로 지정할 때에만 참조를 제거합니다. - + Remove reference only when targeting a specific framework + 특정 프레임워크를 대상으로 지정할 때에만 참조를 제거합니다. + Project to project references to remove diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.pl.xlf index a2d5e1617..677c62c3f 100644 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.pl.xlf @@ -14,9 +14,9 @@ - Remove reference only when targetting a specific framework - Usuń odwołanie tylko w przypadku określenia konkretnej platformy docelowej - + Remove reference only when targeting a specific framework + Usuń odwołanie tylko w przypadku określenia konkretnej platformy docelowej + Project to project references to remove diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.pt-BR.xlf index 5bde95fa1..4dd426b0a 100644 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.pt-BR.xlf @@ -14,9 +14,9 @@ - Remove reference only when targetting a specific framework - Remover referência apenas ao visar uma estrutura específica - + Remove reference only when targeting a specific framework + Remover referência apenas ao visar uma estrutura específica + Project to project references to remove diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.ru.xlf index ba1c0e9ea..8281f6532 100644 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.ru.xlf @@ -14,9 +14,9 @@ - Remove reference only when targetting a specific framework - Удалять ссылку только при выборе конкретной целевой платформы - + Remove reference only when targeting a specific framework + Удалять ссылку только при выборе конкретной целевой платформы + Project to project references to remove diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.tr.xlf index 371bb8b30..92eb5c547 100644 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.tr.xlf @@ -14,9 +14,9 @@ - Remove reference only when targetting a specific framework - Yalnızca belirli bir çerçeveyi hedeflerken başvuruyu kaldırır - + Remove reference only when targeting a specific framework + Yalnızca belirli bir çerçeveyi hedeflerken başvuruyu kaldırır + Project to project references to remove diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.xlf index efd5e43f3..dfa4ae1fc 100644 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.xlf +++ b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.xlf @@ -5,15 +5,15 @@ .NET Remove Project to Project reference Command - + Command to remove project to project reference - + - Remove reference only when targetting a specific framework - + Remove reference only when targeting a specific framework + Project to project references to remove diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.zh-Hans.xlf index 155982623..c2f10f739 100644 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.zh-Hans.xlf @@ -14,9 +14,9 @@ - Remove reference only when targetting a specific framework - 仅针对特定框架删除引用 - + Remove reference only when targeting a specific framework + 仅针对特定框架删除引用 + Project to project references to remove diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.zh-Hant.xlf index 028237600..704a5f95b 100644 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.zh-Hant.xlf @@ -14,9 +14,9 @@ - Remove reference only when targetting a specific framework - 只有在以特定架構為目標時才移除參考 - + Remove reference only when targeting a specific framework + 只有在以特定架構為目標時才移除參考 + Project to project references to remove diff --git a/src/dotnet/commands/dotnet-restore/LocalizableStrings.cs b/src/dotnet/commands/dotnet-restore/LocalizableStrings.cs index bf364d895..e502c8fc8 100644 --- a/src/dotnet/commands/dotnet-restore/LocalizableStrings.cs +++ b/src/dotnet/commands/dotnet-restore/LocalizableStrings.cs @@ -35,6 +35,6 @@ namespace Microsoft.DotNet.Tools.Restore public const string CmdIgnoreFailedSourcesOptionDescription = "Treat package source failures as warnings."; - public const string CmdNoDependenciesOptionDescription = "Set this flag to ignore project to project references and only restore the root project"; + public const string CmdNoDependenciesOptionDescription = "Set this flag to ignore project to project references and only restore the root project."; } } diff --git a/src/dotnet/commands/dotnet-restore/Program.cs b/src/dotnet/commands/dotnet-restore/Program.cs index e06ddc42d..65a18e975 100644 --- a/src/dotnet/commands/dotnet-restore/Program.cs +++ b/src/dotnet/commands/dotnet-restore/Program.cs @@ -34,10 +34,14 @@ namespace Microsoft.DotNet.Tools.Restore var msbuildArgs = new List { "/NoLogo", - "/t:Restore", - "/ConsoleLoggerParameters:Verbosity=Minimal" + "/t:Restore" }; + if (!parsedRestore.HasOption("verbosity")) + { + msbuildArgs.Add("/ConsoleLoggerParameters:Verbosity=Minimal"); + } + msbuildArgs.AddRange(parsedRestore.OptionValuesToBeForwarded()); msbuildArgs.AddRange(parsedRestore.Arguments); diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.cs.xlf index e49105ec2..f96b28f94 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.cs.xlf @@ -69,9 +69,9 @@ - Set this flag to ignore project to project references and only restore the root project - Když tento příznak nastavíte, ignorují se odkazy mezi projekty a obnoví se jenom kořenový projekt. - + Set this flag to ignore project to project references and only restore the root project. + Když tento příznak nastavíte, ignorují se odkazy mezi projekty a obnoví se jenom kořenový projekt. + RUNTIME_IDENTIFIER diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.de.xlf index 3fe42cdae..1b66f0e1b 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.de.xlf @@ -69,9 +69,9 @@ - Set this flag to ignore project to project references and only restore the root project - Legen Sie dieses Flag fest, um Projekt-zu-Projekt-Verweise zu ignorieren und nur das Stammprojekt wiederherzustellen. - + Set this flag to ignore project to project references and only restore the root project. + Legen Sie dieses Flag fest, um Projekt-zu-Projekt-Verweise zu ignorieren und nur das Stammprojekt wiederherzustellen. + RUNTIME_IDENTIFIER diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.es.xlf index 4e9eafed7..4d710511b 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.es.xlf @@ -69,9 +69,9 @@ - Set this flag to ignore project to project references and only restore the root project - Establezca esta marca para que se omitan las referencias de proyecto a proyecto y se restaure solo el proyecto raíz - + Set this flag to ignore project to project references and only restore the root project. + Establezca esta marca para que se omitan las referencias de proyecto a proyecto y se restaure solo el proyecto raíz + RUNTIME_IDENTIFIER diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.fr.xlf index e54f65d5e..4bd214e9d 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.fr.xlf @@ -69,9 +69,9 @@ - Set this flag to ignore project to project references and only restore the root project - Définir cet indicateur pour ignorer les références projet à projet et restaurer uniquement le projet racine - + Set this flag to ignore project to project references and only restore the root project. + Définir cet indicateur pour ignorer les références projet à projet et restaurer uniquement le projet racine + RUNTIME_IDENTIFIER diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.it.xlf index a85aa49cc..695a66803 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.it.xlf @@ -69,9 +69,9 @@ - Set this flag to ignore project to project references and only restore the root project - Impostare questo flag per ignorare i riferimenti P2P (da progetto a progetto) e ripristinare solo il progetto radice - + Set this flag to ignore project to project references and only restore the root project. + Impostare questo flag per ignorare i riferimenti P2P (da progetto a progetto) e ripristinare solo il progetto radice + RUNTIME_IDENTIFIER diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ja.xlf index 358a40939..f79606117 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ja.xlf @@ -69,9 +69,9 @@ - Set this flag to ignore project to project references and only restore the root project - プロジェクト間参照を無視して、ルート プロジェクトのみを復元するには、このフラグを設定します - + Set this flag to ignore project to project references and only restore the root project. + プロジェクト間参照を無視して、ルート プロジェクトのみを復元するには、このフラグを設定します + RUNTIME_IDENTIFIER diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ko.xlf index fbe720eb2..ed8c7c45a 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ko.xlf @@ -69,9 +69,9 @@ - Set this flag to ignore project to project references and only restore the root project - 프로젝트 간 참조를 무시하고 루트 프로젝트만 복원하려면 이 플래그를 설정합니다. - + Set this flag to ignore project to project references and only restore the root project. + 프로젝트 간 참조를 무시하고 루트 프로젝트만 복원하려면 이 플래그를 설정합니다. + RUNTIME_IDENTIFIER diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pl.xlf index 4b0c445c1..d79cb3cf6 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pl.xlf @@ -69,9 +69,9 @@ - Set this flag to ignore project to project references and only restore the root project - Ustaw tę flagę, aby ignorować odwołania między projektami i przywrócić tylko projekt główny - + Set this flag to ignore project to project references and only restore the root project. + Ustaw tę flagę, aby ignorować odwołania między projektami i przywrócić tylko projekt główny + RUNTIME_IDENTIFIER diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pt-BR.xlf index ed173b898..4a9b7dd01 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.pt-BR.xlf @@ -69,9 +69,9 @@ - Set this flag to ignore project to project references and only restore the root project - Definir esse sinalizador para ignorar referências de projeto para projeto e restaurar apenas o projeto raiz - + Set this flag to ignore project to project references and only restore the root project. + Definir esse sinalizador para ignorar referências de projeto para projeto e restaurar apenas o projeto raiz + RUNTIME_IDENTIFIER diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ru.xlf index bdb463dc8..1a8cefd41 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.ru.xlf @@ -69,9 +69,9 @@ - Set this flag to ignore project to project references and only restore the root project - Задайте этот флаг, чтобы пропускать ссылки проектов на проекты и выполнять восстановление только корневого проекта. - + Set this flag to ignore project to project references and only restore the root project. + Задайте этот флаг, чтобы пропускать ссылки проектов на проекты и выполнять восстановление только корневого проекта. + RUNTIME_IDENTIFIER diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.tr.xlf index c231858ff..54f4b5514 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.tr.xlf @@ -69,9 +69,9 @@ - Set this flag to ignore project to project references and only restore the root project - Projeden projeye başvuruları yoksaymak ve yalnızca kök projeyi geri yüklemek için bu bayrağı ayarlayın - + Set this flag to ignore project to project references and only restore the root project. + Projeden projeye başvuruları yoksaymak ve yalnızca kök projeyi geri yüklemek için bu bayrağı ayarlayın + RUNTIME_IDENTIFIER diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.xlf index 5e95e7fee..f44a7ab77 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.xlf @@ -56,8 +56,8 @@ - Set this flag to ignore project to project references and only restore the root project - + Set this flag to ignore project to project references and only restore the root project. + RUNTIME_IDENTIFIER diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hans.xlf index b2de0382a..7be9f120e 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hans.xlf @@ -69,9 +69,9 @@ - Set this flag to ignore project to project references and only restore the root project - 设置此标志以忽略项目到项目引用,并仅还原根项目 - + Set this flag to ignore project to project references and only restore the root project. + 设置此标志以忽略项目到项目引用,并仅还原根项目 + RUNTIME_IDENTIFIER diff --git a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hant.xlf index 582757396..585f3f1b3 100644 --- a/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-restore/xlf/LocalizableStrings.zh-Hant.xlf @@ -69,9 +69,9 @@ - Set this flag to ignore project to project references and only restore the root project - 將此旗標設定為略過專案對專案參考並僅還原根專案 - + Set this flag to ignore project to project references and only restore the root project. + 將此旗標設定為略過專案對專案參考並僅還原根專案 + RUNTIME_IDENTIFIER diff --git a/src/dotnet/commands/dotnet-run/LocalizableStrings.cs b/src/dotnet/commands/dotnet-run/LocalizableStrings.cs index b27c6426b..4cdfd5217 100644 --- a/src/dotnet/commands/dotnet-run/LocalizableStrings.cs +++ b/src/dotnet/commands/dotnet-run/LocalizableStrings.cs @@ -21,7 +21,7 @@ namespace Microsoft.DotNet.Tools.Run public const string RunCommandExceptionUnableToRunSpecifyFramework = "Unable to run your project\nYour project targets multiple frameworks. Please specify which framework to run using '{0}'."; - public const string RunCommandExceptionUnableToRun = "Unable to run your project\nPlease ensure you have a runnable project type and ensure '{0}' supports this project.\nThe current {1} is '{2}'"; + public const string RunCommandExceptionUnableToRun = "Unable to run your project.\nPlease ensure you have a runnable project type and ensure '{0}' supports this project.\nA runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'.\nThe current {1} is '{2}'."; public const string RunCommandExceptionNoProjects = "Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}."; diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.cs.xlf index c04e5eb41..7cfe4cf6d 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.cs.xlf @@ -13,16 +13,6 @@ Příkaz používaný ke spuštění aplikací .NET - - Configuration to use for building the project. Default for most projects is "Debug". - Konfigurace použitá k sestavení projektu. Výchozí možnost u většiny projektů je „Debug“. - - - - FRAMEWORK - FRAMEWORK - - Build and run the app using the specified framework. The framework has to be specified in the project file. K sestavení a spuštění aplikace se použije určená platforma. Tato platforma musí být zadaná v souboru projektu. @@ -38,81 +28,49 @@ Sestavení se nezdařilo. Opravte prosím v sestavení chyby a spusťte ho znovu. - - MSBuildExtensionsPath - MSBuildExtensionsPath - - - - Configuration - Konfigurace - - - - TargetFramework - TargetFramework - - - - RunCommand - RunCommand - - - - OutputType - OutputType - - - - Unable to run your project. - Projekt se nepodařilo spustit. - - - - Please ensure you have a runnable project type and ensure 'dotnet run' supports this project. - Ověřte prosím, jestli je typ projektu spustitelný, a zkontrolujte, jestli „dotnet run“ podporuje tento projekt. - - - - The current OutputType is - Aktuální hodnota OutputType je - - - - RunArguments - RunArguments - - - - RunWorkingDirectory - RunWorkingDirectory - - - - Couldn't find a project to run. Ensure a project exists in - Nepodařilo se najít projekt ke spuštění. Zkontrolujte, jestli projekt existuje v - - - - Or pass the path to the project using --project - Nebo zadejte cestu k projektu příkazem --project - - - - Specify which project file to use because this - Zadejte, jaký soubor projektu se použije, protože - - - - contains more than one project file. - obsahuje více souborů projektů. - - Arguments passed to the application that is being run. Argumenty předané spouštěné aplikaci. + + Skip building the project prior to running. By default, the project will be built. + Skip building the project prior to running. By default, the project will be built. + + + + Do not build the project before running. + Do not build the project before running. + + + + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + + + + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + + + + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + + + + Specify which project file to use because {0} contains more than one project file. + Specify which project file to use because {0} contains more than one project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.de.xlf index 595730789..a44863a4e 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.de.xlf @@ -13,16 +13,6 @@ Befehl zum Ausführen von .NET-Apps - - Configuration to use for building the project. Default for most projects is "Debug". - Konfiguration für die Erstellung des Projekts. Standard für die meisten Projekte ist "Debug". - - - - FRAMEWORK - FRAMEWORK - - Build and run the app using the specified framework. The framework has to be specified in the project file. Erstellt die App mit dem angegebenen Framework und führt sie aus. Das Framework muss in der Projektdatei angegeben werden. @@ -38,81 +28,49 @@ Fehler beim Buildvorgang. Beheben Sie die Buildfehler, und wiederholen Sie anschließend den Vorgang. - - MSBuildExtensionsPath - MSBuildExtensionsPath - - - - Configuration - Konfiguration - - - - TargetFramework - TargetFramework - - - - RunCommand - RunCommand - - - - OutputType - OutputType - - - - Unable to run your project. - Das Projekt kann nicht ausgeführt werden. - - - - Please ensure you have a runnable project type and ensure 'dotnet run' supports this project. - Vergewissern Sie sich, dass Sie über einen ausführbaren Projekttyp verfügen und dass das Projekt von "dotnet run" unterstützt wird. - - - - The current OutputType is - Aktueller Ausgabetyp: - - - - RunArguments - RunArguments - - - - RunWorkingDirectory - RunWorkingDirectory - - - - Couldn't find a project to run. Ensure a project exists in - Es wurde kein ausführbares Projekt gefunden. Vergewissern Sie sich, dass an folgendem Ort ein Projekt vorhanden ist: - - - - Or pass the path to the project using --project - Übergeben Sie alternativ den Pfad zum Projekt mithilfe von "--project". - - - - Specify which project file to use because this - Geben Sie die zu verwendende Projektdatei an, da - - - - contains more than one project file. - mehrere Projektdateien vorhanden sind. - - Arguments passed to the application that is being run. Argumente, die der ausgeführten Anwendung übergeben werden. + + Skip building the project prior to running. By default, the project will be built. + Skip building the project prior to running. By default, the project will be built. + + + + Do not build the project before running. + Do not build the project before running. + + + + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + + + + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + + + + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + + + + Specify which project file to use because {0} contains more than one project file. + Specify which project file to use because {0} contains more than one project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.es.xlf index 1fc37e714..7e4c5503a 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.es.xlf @@ -13,16 +13,6 @@ Comando para ejecutar aplicaciones de .NET - - Configuration to use for building the project. Default for most projects is "Debug". - Configuración para usar para crear el proyecto. El valor predeterminado para la mayoría de los proyectos es "Depurar". - - - - FRAMEWORK - PLATAFORMA - - Build and run the app using the specified framework. The framework has to be specified in the project file. Crea y ejecuta la aplicación mediante la plataforma especificada. La plataforma se debe especificar en el archivo de proyecto. @@ -38,81 +28,49 @@ No se pudo llevar a cabo la compilación. Corrija los errores de compilación y vuelva a ejecutar el proyecto. - - MSBuildExtensionsPath - MSBuildExtensionsPath - - - - Configuration - Configuration - - - - TargetFramework - TargetFramework - - - - RunCommand - RunCommand - - - - OutputType - OutputType - - - - Unable to run your project. - No se puede ejecutar el proyecto. - - - - Please ensure you have a runnable project type and ensure 'dotnet run' supports this project. - Asegúrese de que tiene un tipo de proyecto que se puede ejecutar y de que 'dotnet run' lo admite. - - - - The current OutputType is - El tipo de salida actual es - - - - RunArguments - RunArguments - - - - RunWorkingDirectory - RunWorkingDirectory - - - - Couldn't find a project to run. Ensure a project exists in - No se encuentra ningún proyecto para ejecutar. Asegúrese de que el proyecto existe en - - - - Or pass the path to the project using --project - O bien pase la ruta de acceso al proyecto usando --project - - - - Specify which project file to use because this - Especifique el archivo del proyecto que debe usarse, porque - - - - contains more than one project file. - contiene más de un archivo de proyecto. - - Arguments passed to the application that is being run. Argumentos que se pasan a la aplicación en ejecución. + + Skip building the project prior to running. By default, the project will be built. + Skip building the project prior to running. By default, the project will be built. + + + + Do not build the project before running. + Do not build the project before running. + + + + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + + + + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + + + + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + + + + Specify which project file to use because {0} contains more than one project file. + Specify which project file to use because {0} contains more than one project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.fr.xlf index 7976204ff..20aad0b35 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.fr.xlf @@ -13,16 +13,6 @@ Commande utilisée pour exécuter des applications .NET - - Configuration to use for building the project. Default for most projects is "Debug". - Configuration à utiliser pour la génération du projet. La valeur par défaut pour la plupart des projets est "Debug". - - - - FRAMEWORK - FRAMEWORK - - Build and run the app using the specified framework. The framework has to be specified in the project file. Générez et exécutez l'application à l'aide du framework spécifié. Le framework doit être spécifié dans le fichier projet. @@ -38,81 +28,49 @@ Échec de la build. Corrigez les erreurs de la build et réexécutez-la. - - MSBuildExtensionsPath - MSBuildExtensionsPath - - - - Configuration - Configuration - - - - TargetFramework - TargetFramework - - - - RunCommand - RunCommand - - - - OutputType - OutputType - - - - Unable to run your project. - Impossible d'exécuter votre projet. - - - - Please ensure you have a runnable project type and ensure 'dotnet run' supports this project. - Vérifiez que vous disposez d'un type de projet exécutable et que 'dotnet run' prend en charge ce projet. - - - - The current OutputType is - L'OutputType actif est - - - - RunArguments - RunArguments - - - - RunWorkingDirectory - RunWorkingDirectory - - - - Couldn't find a project to run. Ensure a project exists in - Projet à exécuter introuvable. Vérifiez qu'un projet existe dans - - - - Or pass the path to the project using --project - Ou passez le chemin du projet en utilisant --project - - - - Specify which project file to use because this - Spécifiez le fichier projet à utiliser car ce - - - - contains more than one project file. - contient plusieurs fichiers projet. - - Arguments passed to the application that is being run. Arguments passés à l'application exécutée. + + Skip building the project prior to running. By default, the project will be built. + Skip building the project prior to running. By default, the project will be built. + + + + Do not build the project before running. + Do not build the project before running. + + + + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + + + + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + + + + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + + + + Specify which project file to use because {0} contains more than one project file. + Specify which project file to use because {0} contains more than one project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.it.xlf index 17fe45e72..7e9dc1060 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.it.xlf @@ -13,16 +13,6 @@ Comando usato per eseguire app .NET - - Configuration to use for building the project. Default for most projects is "Debug". - Configurazione da usare per compilare il progetto. L'impostazione predefinita per la maggior parte dei progetti è "Debug". - - - - FRAMEWORK - FRAMEWORK - - Build and run the app using the specified framework. The framework has to be specified in the project file. Consente di compilare ed eseguire l'app con il framework specificato. Il framework deve essere specificato nel file di progetto. @@ -38,81 +28,49 @@ La compilazione non è riuscita. Correggere gli errori di compilazione e ripetere l'esecuzione. - - MSBuildExtensionsPath - MSBuildExtensionsPath - - - - Configuration - Configurazione - - - - TargetFramework - TargetFramework - - - - RunCommand - RunCommand - - - - OutputType - OutputType - - - - Unable to run your project. - Non è possibile eseguire il progetto. - - - - Please ensure you have a runnable project type and ensure 'dotnet run' supports this project. - Assicurarsi che sia presente un tipo di progetto eseguibile e che 'dotnet run' supporti tale progetto. - - - - The current OutputType is - L'elemento OutputType corrente è - - - - RunArguments - RunArguments - - - - RunWorkingDirectory - RunWorkingDirectory - - - - Couldn't find a project to run. Ensure a project exists in - Non è stato trovato un progetto da eseguire. Assicurarsi che sia presente un progetto in - - - - Or pass the path to the project using --project - In alternativa, passare il percorso al progetto con --project - - - - Specify which project file to use because this - Specificare il file di progetto da usare perché questo file - - - - contains more than one project file. - contiene più di un file di progetto. - - Arguments passed to the application that is being run. Argomenti passati all'applicazione in esecuzione. + + Skip building the project prior to running. By default, the project will be built. + Skip building the project prior to running. By default, the project will be built. + + + + Do not build the project before running. + Do not build the project before running. + + + + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + + + + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + + + + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + + + + Specify which project file to use because {0} contains more than one project file. + Specify which project file to use because {0} contains more than one project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ja.xlf index 7c0ee010c..9b227986c 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ja.xlf @@ -13,16 +13,6 @@ .NET アプリの実行に使用するコマンド - - Configuration to use for building the project. Default for most projects is "Debug". - プロジェクトの構築に使用する構成。ほとんどのプロジェクトで既定は "デバッグ" です。 - - - - FRAMEWORK - FRAMEWORK - - Build and run the app using the specified framework. The framework has to be specified in the project file. 指定されたフレームワークを使用して、アプリを構築して実行します。フレームワークはプロジェクト ファイルで指定する必要があります。 @@ -38,81 +28,49 @@ ビルドに失敗しました。ビルド エラーを修正して、もう一度実行してください。 - - MSBuildExtensionsPath - MSBuildExtensionsPath - - - - Configuration - 構成 - - - - TargetFramework - TargetFramework - - - - RunCommand - RunCommand - - - - OutputType - OutputType - - - - Unable to run your project. - プロジェクトを実行できません。 - - - - Please ensure you have a runnable project type and ensure 'dotnet run' supports this project. - プロジェクトの種類が実行可能な種類であること、また 'dotnet run' がこのプロジェクトをサポートしていることを確認してください。 - - - - The current OutputType is - 現在の OutputType は - - - - RunArguments - RunArguments - - - - RunWorkingDirectory - RunWorkingDirectory - - - - Couldn't find a project to run. Ensure a project exists in - 実行するプロジェクトが見つかりませんでした。プロジェクトが存在することを確認します - - - - Or pass the path to the project using --project - または、--project を使用してプロジェクトにパスを渡します - - - - Specify which project file to use because this - これには複数のプロジェクト ファイルが含まれているため、使用するプロジェクト ファイルを指定します。 - - - - contains more than one project file. - 複数のプロジェクト ファイルが含まれます。 - - Arguments passed to the application that is being run. 実行中のアプリケーションに渡される引数。 + + Skip building the project prior to running. By default, the project will be built. + Skip building the project prior to running. By default, the project will be built. + + + + Do not build the project before running. + Do not build the project before running. + + + + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + + + + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + + + + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + + + + Specify which project file to use because {0} contains more than one project file. + Specify which project file to use because {0} contains more than one project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ko.xlf index deb86aba9..4e7148d8b 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ko.xlf @@ -13,16 +13,6 @@ .NET 앱을 실행하는 데 사용하는 명령입니다. - - Configuration to use for building the project. Default for most projects is "Debug". - 프로젝트 빌드에 사용할 구성입니다. 대부분의 프로젝트에서 기본값은 "Debug"입니다. - - - - FRAMEWORK - FRAMEWORK - - Build and run the app using the specified framework. The framework has to be specified in the project file. 지정된 프레임워크를 사용하여 앱을 빌드 및 실행합니다. 프로젝트 파일에서 프레임워크를 지정해야 합니다. @@ -38,81 +28,49 @@ 빌드하지 못했습니다. 빌드 오류를 수정하고 다시 실행하세요. - - MSBuildExtensionsPath - MSBuildExtensionsPath - - - - Configuration - 구성 - - - - TargetFramework - TargetFramework - - - - RunCommand - RunCommand - - - - OutputType - OutputType - - - - Unable to run your project. - 프로젝트를 실행할 수 없습니다. - - - - Please ensure you have a runnable project type and ensure 'dotnet run' supports this project. - 실행 가능한 프로젝트 형식이 있고 'dotnet run'에서 이 프로젝트를 지원하는지 확인하세요. - - - - The current OutputType is - 현재 OutputType은 다음과 같습니다. - - - - RunArguments - RunArguments - - - - RunWorkingDirectory - RunWorkingDirectory - - - - Couldn't find a project to run. Ensure a project exists in - 실행할 프로젝트를 찾을 수 없습니다. 프로젝트가 - - - - Or pass the path to the project using --project - 에 있는지 확인하거나 --project를 사용하여 프로젝트의 경로를 전달합니다. - - - - Specify which project file to use because this - - - - - contains more than one project file. - 에는 프로젝트 파일이 두 개 이상 있으므로 사용할 프로젝트 파일을 지정합니다. - - Arguments passed to the application that is being run. 실행 중인 응용 프로그램에 전달되는 인수입니다. + + Skip building the project prior to running. By default, the project will be built. + Skip building the project prior to running. By default, the project will be built. + + + + Do not build the project before running. + Do not build the project before running. + + + + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + + + + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + + + + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + + + + Specify which project file to use because {0} contains more than one project file. + Specify which project file to use because {0} contains more than one project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pl.xlf index dd042760f..9dcf38ac5 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pl.xlf @@ -13,16 +13,6 @@ Polecenie służące do uruchamiania aplikacji .NET - - Configuration to use for building the project. Default for most projects is "Debug". - Konfiguracja do użycia na potrzeby kompilacji projektu. Opcją domyślną w przypadku większości projektów jest „Debug”. - - - - FRAMEWORK - PLATFORMA - - Build and run the app using the specified framework. The framework has to be specified in the project file. Skompiluj i uruchom aplikację przy użyciu określonej platformy. Platforma musi być określona w pliku projektu. @@ -38,81 +28,49 @@ Kompilacja nie powiodła się. Napraw błędy kompilacji i uruchom ją ponownie. - - MSBuildExtensionsPath - ŚcieżkaRozszerzeńMSBuild - - - - Configuration - Konfiguracja - - - - TargetFramework - PlatformaDocelowa - - - - RunCommand - PolecenieRun - - - - OutputType - TypWyjściowy - - - - Unable to run your project. - Nie można uruchomić projektu. - - - - Please ensure you have a runnable project type and ensure 'dotnet run' supports this project. - Upewnij się, że typ projektu jest możliwy do uruchomienia i że polecenie „dotnet run” obsługuje ten projekt. - - - - The current OutputType is - Bieżący typ OutputType to - - - - RunArguments - ArgumentyPoleceniaRun - - - - RunWorkingDirectory - KatalogRoboczyPoleceniaRun - - - - Couldn't find a project to run. Ensure a project exists in - Nie można odnaleźć projektu do uruchomienia. Upewnij się, że projekt istnieje w lokalizacji - - - - Or pass the path to the project using --project - Lub przekaż ścieżkę do projektu przy użyciu opcji --project - - - - Specify which project file to use because this - Określ, który plik ma zostać użyty, ponieważ - - - - contains more than one project file. - podano kilka plików projektu. - - Arguments passed to the application that is being run. Argumenty przekazywane do uruchamianej aplikacji. + + Skip building the project prior to running. By default, the project will be built. + Skip building the project prior to running. By default, the project will be built. + + + + Do not build the project before running. + Do not build the project before running. + + + + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + + + + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + + + + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + + + + Specify which project file to use because {0} contains more than one project file. + Specify which project file to use because {0} contains more than one project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pt-BR.xlf index 4e51c9bca..ecddd4bf5 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pt-BR.xlf @@ -13,16 +13,6 @@ Comando usado para executar aplicativos .NET - - Configuration to use for building the project. Default for most projects is "Debug". - A configuração a ser usada para criar o projeto. O padrão para a maioria dos projetos é “Depurar”. - - - - FRAMEWORK - ESTRUTURA - - Build and run the app using the specified framework. The framework has to be specified in the project file. Compile e execute o aplicativo usando a estrutura especificada. A estrutura deve ser especificada no arquivo de projeto. @@ -38,81 +28,49 @@ Ocorreu uma falha no build. Corrija os erros de build e execute novamente. - - MSBuildExtensionsPath - MSBuildExtensionsPath - - - - Configuration - Configuração - - - - TargetFramework - TargetFramework - - - - RunCommand - RunCommand - - - - OutputType - OutputType - - - - Unable to run your project. - Não foi possível executar seu projeto. - - - - Please ensure you have a runnable project type and ensure 'dotnet run' supports this project. - Certifique-se de que você tenha um tipo de projeto executável e que ‘dotnet run’ dê suporte a esse projeto. - - - - The current OutputType is - O OutputType atual é - - - - RunArguments - RunArguments - - - - RunWorkingDirectory - RunWorkingDirectory - - - - Couldn't find a project to run. Ensure a project exists in - Não foi possível encontrar um projeto para executar. Certifique-se de que existe um projeto em - - - - Or pass the path to the project using --project - Ou passe o caminho para o projeto usando --project - - - - Specify which project file to use because this - Especifique qual arquivo de projeto usar porque este - - - - contains more than one project file. - contém mais de um arquivo de projeto. - - Arguments passed to the application that is being run. Os argumentos passados para o aplicativo em execução. + + Skip building the project prior to running. By default, the project will be built. + Skip building the project prior to running. By default, the project will be built. + + + + Do not build the project before running. + Do not build the project before running. + + + + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + + + + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + + + + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + + + + Specify which project file to use because {0} contains more than one project file. + Specify which project file to use because {0} contains more than one project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ru.xlf index ec36e5bbc..2bd78244b 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ru.xlf @@ -13,16 +13,6 @@ Команда, используемая для запуска приложений .NET - - Configuration to use for building the project. Default for most projects is "Debug". - Конфигурация, используемая для сборки проекта. Значение по умолчанию для большинства проектов — "Debug". - - - - FRAMEWORK - FRAMEWORK - - Build and run the app using the specified framework. The framework has to be specified in the project file. Сборка и запуск приложения на указанной платформе. Платформа должна быть указана в файле проекта. @@ -38,81 +28,49 @@ Ошибка сборки. Устраните ошибки сборки и повторите попытку. - - MSBuildExtensionsPath - MSBuildExtensionsPath - - - - Configuration - Configuration - - - - TargetFramework - TargetFramework - - - - RunCommand - RunCommand - - - - OutputType - OutputType - - - - Unable to run your project. - Не удается выполнить проект. - - - - Please ensure you have a runnable project type and ensure 'dotnet run' supports this project. - Убедитесь, что имеется проект выполнимого типа и команда dotnet run поддерживает этот проект. - - - - The current OutputType is - Текущий тип выходных данных: - - - - RunArguments - RunArguments - - - - RunWorkingDirectory - RunWorkingDirectory - - - - Couldn't find a project to run. Ensure a project exists in - Не удалось найти выполняемый проект. Убедитесь, что проект существует в - - - - Or pass the path to the project using --project - Кроме того, можно передать путь в проект, используя параметр --project - - - - Specify which project file to use because this - Укажите файл проекта для использования, так как - - - - contains more than one project file. - здесь задано несколько файлов проектов. - - Arguments passed to the application that is being run. Аргументы переданы в выполняемое приложение. + + Skip building the project prior to running. By default, the project will be built. + Skip building the project prior to running. By default, the project will be built. + + + + Do not build the project before running. + Do not build the project before running. + + + + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + + + + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + + + + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + + + + Specify which project file to use because {0} contains more than one project file. + Specify which project file to use because {0} contains more than one project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.tr.xlf index 6dfbc4e10..dcea33da3 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.tr.xlf @@ -13,16 +13,6 @@ .NET uygulamalarını çalıştırmak için kullanılan komut - - Configuration to use for building the project. Default for most projects is "Debug". - Projeyi derlemek için kullanılacak yapılandırma. Çoğu proje için varsayılan: "Debug". - - - - FRAMEWORK - ÇERÇEVE - - Build and run the app using the specified framework. The framework has to be specified in the project file. Uygulamayı belirtilen çerçeve için derler ve çalıştırır. Çerçevenin proje dosyasında belirtilmesi gerekir. @@ -38,81 +28,49 @@ Derleme başarısız oldu. Lütfen derleme hatalarını düzeltip yeniden çalıştırın. - - MSBuildExtensionsPath - MSBuildExtensionsPath - - - - Configuration - Configuration - - - - TargetFramework - TargetFramework - - - - RunCommand - RunCommand - - - - OutputType - OutputType - - - - Unable to run your project. - Projeniz çalıştırılamıyor. - - - - Please ensure you have a runnable project type and ensure 'dotnet run' supports this project. - Çalıştırılabilir türde bir projeniz olduğundan ve 'dotnet run' komutunun bu projeyi desteklediğinden emin olun. - - - - The current OutputType is - Geçerli OutputType: - - - - RunArguments - RunArguments - - - - RunWorkingDirectory - RunWorkingDirectory - - - - Couldn't find a project to run. Ensure a project exists in - Çalıştırılacak bir proje bulunamadı. Şurada bir proje bulunduğundan emin olun: - - - - Or pass the path to the project using --project - Veya proje yolunu --project kullanarak geçirin - - - - Specify which project file to use because this - Burada birden fazla proje dosyası bulunduğundan, - - - - contains more than one project file. - hangi proje dosyasının kullanılacağını belirtmeniz gerekiyor. - - Arguments passed to the application that is being run. Çalıştırılan uygulamaya geçirilen bağımsız değişkenler. + + Skip building the project prior to running. By default, the project will be built. + Skip building the project prior to running. By default, the project will be built. + + + + Do not build the project before running. + Do not build the project before running. + + + + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + + + + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + + + + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + + + + Specify which project file to use because {0} contains more than one project file. + Specify which project file to use because {0} contains more than one project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.xlf index fc70017db..18b0f627c 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.xlf @@ -11,14 +11,6 @@ Command used to run .NET apps - - Configuration to use for building the project. Default for most projects is "Debug". - - - - FRAMEWORK - - Build and run the app using the specified framework. The framework has to be specified in the project file. @@ -31,66 +23,38 @@ The build failed. Please fix the build errors and run again. - - MSBuildExtensionsPath - - - - Configuration - - - - TargetFramework - - - - RunCommand - - - - OutputType - - - - Unable to run your project. - - - - Please ensure you have a runnable project type and ensure 'dotnet run' supports this project. - - - - The current OutputType is - - - - RunArguments - - - - RunWorkingDirectory - - - - Couldn't find a project to run. Ensure a project exists in - - - - Or pass the path to the project using --project - - - - Specify which project file to use because this - - - - contains more than one project file. - - Arguments passed to the application that is being run. + + Skip building the project prior to running. By default, the project will be built. + + + + Do not build the project before running. + + + + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + + + + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + + + + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + + + + Specify which project file to use because {0} contains more than one project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hans.xlf index a448561d0..11948a471 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hans.xlf @@ -13,16 +13,6 @@ 用于运行 .NET 应用的命令 - - Configuration to use for building the project. Default for most projects is "Debug". - 用于生成项目的配置。对大多数项目的默认值是 "Debug"。 - - - - FRAMEWORK - FRAMEWORK - - Build and run the app using the specified framework. The framework has to be specified in the project file. 使用指定的框架生成和运行应用。框架必须在项目文件中指定。 @@ -38,81 +28,49 @@ 生成失败。请修复生成错误并重新运行。 - - MSBuildExtensionsPath - MSBuildExtensionsPath - - - - Configuration - 配置 - - - - TargetFramework - TargetFramework - - - - RunCommand - RunCommand - - - - OutputType - OutputType - - - - Unable to run your project. - 无法运行项目。 - - - - Please ensure you have a runnable project type and ensure 'dotnet run' supports this project. - 请确保具有可运行的项目类型且“dotnet run”支持此项目。 - - - - The current OutputType is - 当前的 OutputType 为 - - - - RunArguments - RunArguments - - - - RunWorkingDirectory - RunWorkingDirectory - - - - Couldn't find a project to run. Ensure a project exists in - 找不到要运行的项目。请确保项目位于 - - - - Or pass the path to the project using --project - 或使用 --project 将路径传递给项目 - - - - Specify which project file to use because this - 请指定要使用哪个项目文件,因为此项目 - - - - contains more than one project file. - 包含多个项目文件。 - - Arguments passed to the application that is being run. 传递到运行中应用程序的参数。 + + Skip building the project prior to running. By default, the project will be built. + Skip building the project prior to running. By default, the project will be built. + + + + Do not build the project before running. + Do not build the project before running. + + + + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + + + + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + + + + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + + + + Specify which project file to use because {0} contains more than one project file. + Specify which project file to use because {0} contains more than one project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hant.xlf index 66b72b7c3..fb7d0e86e 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hant.xlf @@ -13,16 +13,6 @@ 用以執行 .NET 應用程式的命令 - - Configuration to use for building the project. Default for most projects is "Debug". - 要用於建置專案的組態。多數專案的預設為 "Debug"。 - - - - FRAMEWORK - 架構 - - Build and run the app using the specified framework. The framework has to be specified in the project file. 使用指定的架構建置及執行應用程式。架構必須在專案檔中指定。 @@ -38,81 +28,49 @@ 建置失敗。請修正建置錯誤後再執行一次。 - - MSBuildExtensionsPath - MSBuildExtensionsPath - - - - Configuration - Configuration - - - - TargetFramework - TargetFramework - - - - RunCommand - RunCommand - - - - OutputType - OutputType - - - - Unable to run your project. - 無法執行您的專案。 - - - - Please ensure you have a runnable project type and ensure 'dotnet run' supports this project. - 請確認您有可執行的專案類型,並確認 'dotnet run' 支援此專案。 - - - - The current OutputType is - 目前的 OutputType 為 - - - - RunArguments - RunArguments - - - - RunWorkingDirectory - RunWorkingDirectory - - - - Couldn't find a project to run. Ensure a project exists in - 找不到要執行的專案。請確認專案存在於 - - - - Or pass the path to the project using --project - 或使用 --project 傳遞專案的路徑 - - - - Specify which project file to use because this - 指定要使用的專案檔,因為這個 - - - - contains more than one project file. - 包含多個專案檔。 - - Arguments passed to the application that is being run. 傳遞至正在執行之應用程式的引數。 + + Skip building the project prior to running. By default, the project will be built. + Skip building the project prior to running. By default, the project will be built. + + + + Do not build the project before running. + Do not build the project before running. + + + + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + Unable to run your project +Your project targets multiple frameworks. Please specify which framework to run using '{0}'. + + + + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + Unable to run your project. +Please ensure you have a runnable project type and ensure '{0}' supports this project. +A runnable project should target a runnable TFM (for instance, netcoreapp2.0) and have OutputType 'Exe'. +The current {1} is '{2}'. + + + + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + Couldn't find a project to run. Ensure a project exists in {0}, or pass the path to the project using {1}. + + + + Specify which project file to use because {0} contains more than one project file. + Specify which project file to use because {0} contains more than one project file. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.cs.xlf index b16fed364..ad1368625 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.cs.xlf @@ -24,9 +24,9 @@ - Add a specified project(s) to the solution. - Přidá určené projekty do řešení. - + Add one or more specified projects to the solution. + Přidá určené projekty do řešení. + .NET Remove project(s) from a solution file Command diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.de.xlf index 34259c792..1c5a95aa0 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.de.xlf @@ -24,9 +24,9 @@ - Add a specified project(s) to the solution. - Fügt der Projektmappe bestimmte Projekte hinzu. - + Add one or more specified projects to the solution. + Fügt der Projektmappe bestimmte Projekte hinzu. + .NET Remove project(s) from a solution file Command diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.es.xlf index 3f471259b..304fbb158 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.es.xlf @@ -24,9 +24,9 @@ - Add a specified project(s) to the solution. - Agregue los proyectos especificado a la solución. - + Add one or more specified projects to the solution. + Agregue los proyectos especificado a la solución. + .NET Remove project(s) from a solution file Command diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.fr.xlf index fb822208c..61952837b 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.fr.xlf @@ -24,9 +24,9 @@ - Add a specified project(s) to the solution. - Ajoutez un ou des projets spécifiés à la solution. - + Add one or more specified projects to the solution. + Ajoutez un ou des projets spécifiés à la solution. + .NET Remove project(s) from a solution file Command diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.it.xlf index cf127f2dd..951c069c7 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.it.xlf @@ -24,9 +24,9 @@ - Add a specified project(s) to the solution. - Consente di aggiungere il progetto o i progetti specificati alla soluzione. - + Add one or more specified projects to the solution. + Consente di aggiungere il progetto o i progetti specificati alla soluzione. + .NET Remove project(s) from a solution file Command diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ja.xlf index f0de96c45..f783720f0 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ja.xlf @@ -24,9 +24,9 @@ - Add a specified project(s) to the solution. - 指定のプロジェクトをソリューションに追加します。 - + Add one or more specified projects to the solution. + 指定のプロジェクトをソリューションに追加します。 + .NET Remove project(s) from a solution file Command diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ko.xlf index 04d187738..79ebb2282 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ko.xlf @@ -24,9 +24,9 @@ - Add a specified project(s) to the solution. - 솔루션에 지정한 프로젝트를 추가합니다. - + Add one or more specified projects to the solution. + 솔루션에 지정한 프로젝트를 추가합니다. + .NET Remove project(s) from a solution file Command diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pl.xlf index d3f2f52b5..44a613355 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pl.xlf @@ -24,9 +24,9 @@ - Add a specified project(s) to the solution. - Dodaj określone projekty do rozwiązania. - + Add one or more specified projects to the solution. + Dodaj określone projekty do rozwiązania. + .NET Remove project(s) from a solution file Command diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pt-BR.xlf index 712fd0ec8..055c8ad65 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.pt-BR.xlf @@ -24,9 +24,9 @@ - Add a specified project(s) to the solution. - Adicionar um projeto especificado à solução. - + Add one or more specified projects to the solution. + Adicionar um projeto especificado à solução. + .NET Remove project(s) from a solution file Command diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ru.xlf index 8cc1f55be..4e6428133 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.ru.xlf @@ -24,9 +24,9 @@ - Add a specified project(s) to the solution. - Добавляет указанные проекты в решение. - + Add one or more specified projects to the solution. + Добавляет указанные проекты в решение. + .NET Remove project(s) from a solution file Command diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.tr.xlf index ac60cdb9f..c7285e3cc 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.tr.xlf @@ -24,9 +24,9 @@ - Add a specified project(s) to the solution. - Belirtilen projeleri çözüme ekleyin. - + Add one or more specified projects to the solution. + Belirtilen projeleri çözüme ekleyin. + .NET Remove project(s) from a solution file Command diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.xlf index f010d7575..c18917879 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.xlf @@ -5,47 +5,47 @@ .NET modify solution file command - + Command to add, remove, and list projects from the solution (SLN) file. - + Projects to add or to remove from the solution. - + .NET Add project(s) to a solution file Command - + - Add a specified project(s) to the solution. + Add one or more specified projects to the solution. .NET Remove project(s) from a solution file Command - + Remove the specified project(s) from the solution. The project is not impacted. - + .NET List project(s) in a solution file Command - + List all projects in the solution. - + .NET Create a solution file Command - + Create a solution file. - + diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hans.xlf index bc56681de..c20a7e514 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hans.xlf @@ -24,9 +24,9 @@ - Add a specified project(s) to the solution. - 将指定项目添加到解决方案。 - + Add one or more specified projects to the solution. + 将指定项目添加到解决方案。 + .NET Remove project(s) from a solution file Command diff --git a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hant.xlf index 7c0060ab4..1052639f6 100644 --- a/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-sln/xlf/LocalizableStrings.zh-Hant.xlf @@ -24,9 +24,9 @@ - Add a specified project(s) to the solution. - 將指定的專案新增到解決方案。 - + Add one or more specified projects to the solution. + 將指定的專案新增到解決方案。 + .NET Remove project(s) from a solution file Command diff --git a/src/dotnet/commands/dotnet-store/LocalizableStrings.cs b/src/dotnet/commands/dotnet-store/LocalizableStrings.cs index a3b50523e..164d42aba 100644 --- a/src/dotnet/commands/dotnet-store/LocalizableStrings.cs +++ b/src/dotnet/commands/dotnet-store/LocalizableStrings.cs @@ -21,12 +21,12 @@ namespace Microsoft.DotNet.Tools.Store public const string SkipOptimizationOptionDescription = "Skips the optimization phase."; + public const string SkipSymbolsOptionDescription = "Skips creating symbol files which can be used for profiling the optimized assemblies."; + public const string IntermediateWorkingDirOption = "IntermediateWorkingDir"; public const string IntermediateWorkingDirOptionDescription = "The directory used by the command to execute."; - public const string PreserveIntermediateWorkingDirOptionDescription = "Preserves the intermediate working directory."; - public const string SpecifyManifests = "Specify at least one manifest with --manifest."; public const string IntermediateDirExists = "Intermediate working directory {0} already exists. Remove {0} or specify another directory with -w."; diff --git a/src/dotnet/commands/dotnet-store/StoreCommandParser.cs b/src/dotnet/commands/dotnet-store/StoreCommandParser.cs index 341156fed..a5b7baafa 100644 --- a/src/dotnet/commands/dotnet-store/StoreCommandParser.cs +++ b/src/dotnet/commands/dotnet-store/StoreCommandParser.cs @@ -49,7 +49,6 @@ namespace Microsoft.DotNet.Cli .With(name: LocalizableStrings.FrameworkVersionOption) .ForwardAsSingle(o => $"/p:RuntimeFrameworkVersion={o.Arguments.Single()}")), CommonOptions.RuntimeOption(), - CommonOptions.ConfigurationOption(), Create.Option( "-o|--output", LocalizableStrings.OutputOptionDescription, @@ -62,16 +61,16 @@ namespace Microsoft.DotNet.Cli Accept.ExactlyOneArgument() .With(name: LocalizableStrings.IntermediateWorkingDirOption) .ForwardAsSingle(o => $"/p:ComposeWorkingDir={o.Arguments.Single()}")), - Create.Option( - "--preserve-working-dir", - LocalizableStrings.PreserveIntermediateWorkingDirOptionDescription, - Accept.NoArguments() - .ForwardAsSingle(o => $"/p:PreserveComposeWorkingDir=true")), Create.Option( "--skip-optimization", LocalizableStrings.SkipOptimizationOptionDescription, Accept.NoArguments() .ForwardAs("/p:SkipOptimization=true")), + Create.Option( + "--skip-symbols", + LocalizableStrings.SkipSymbolsOptionDescription, + Accept.NoArguments() + .ForwardAs("/p:CreateProfilingSymbols=false")), CommonOptions.VerbosityOption()); } } \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.cs.xlf index f45d968a7..f5e95a658 100644 --- a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.cs.xlf @@ -3,53 +3,18 @@ - - .NET Cache - .NET Cache - - - Caches the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. + Stores the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. Cahes Assemblies specified for the .NET Platform - - ProjectEntries - ProjectEntries - - - - The XML file that contains the list of packages to be cached. - The MSBuild project file used to specify the list of packages to be cached. - - - - FRAMEWORK - FRAMEWORK - - - - Target framework for which to cache for. - Target framework for which to cache for - - - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Target runtime to cache for. - Target runtime to cache for. - - OUTPUT_DIR OUTPUT_DIR - Output directory in which to cache the given assemblies. + Output directory in which to store the given assemblies. Path in which to cache the given assemblies @@ -73,16 +38,6 @@ The directory used by the command to do its work - - Preserves the intermediate working directory. - The directory used by the command to do its work will not be removed - - - - Specify at least one entry with --entries. - Please specify atleast one entry with --entries - - Intermediate working directory {0} already exists. Remove {0} or specify another directory with -w. Intermediate working directory {0} exists, remove {0} or specify another directory with -w @@ -93,6 +48,26 @@ Skips the optimization phase. + + PROJECT_MANIFEST + PROJECT_MANIFEST + + + + The XML file that contains the list of packages to be stored. + The XML file that contains the list of packages to be stored. + + + + Skips creating symbol files which can be used for profiling the optimized assemblies. + Skips creating symbol files which can be used for profiling the optimized assemblies. + + + + Specify at least one manifest with --manifest. + Specify at least one manifest with --manifest. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.de.xlf index 16e5443be..260e5f869 100644 --- a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.de.xlf @@ -3,53 +3,18 @@ - - .NET Cache - .NET Cache - - - Caches the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. + Stores the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. Cahes Assemblies specified for the .NET Platform - - ProjectEntries - ProjectEntries - - - - The XML file that contains the list of packages to be cached. - The MSBuild project file used to specify the list of packages to be cached. - - - - FRAMEWORK - FRAMEWORK - - - - Target framework for which to cache for. - Target framework for which to cache for - - - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Target runtime to cache for. - Target runtime to cache for. - - OUTPUT_DIR OUTPUT_DIR - Output directory in which to cache the given assemblies. + Output directory in which to store the given assemblies. Path in which to cache the given assemblies @@ -73,16 +38,6 @@ The directory used by the command to do its work - - Preserves the intermediate working directory. - The directory used by the command to do its work will not be removed - - - - Specify at least one entry with --entries. - Please specify atleast one entry with --entries - - Intermediate working directory {0} already exists. Remove {0} or specify another directory with -w. Intermediate working directory {0} exists, remove {0} or specify another directory with -w @@ -93,6 +48,26 @@ Skips the optimization phase. + + PROJECT_MANIFEST + PROJECT_MANIFEST + + + + The XML file that contains the list of packages to be stored. + The XML file that contains the list of packages to be stored. + + + + Skips creating symbol files which can be used for profiling the optimized assemblies. + Skips creating symbol files which can be used for profiling the optimized assemblies. + + + + Specify at least one manifest with --manifest. + Specify at least one manifest with --manifest. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.es.xlf index c049192f5..6b2d95440 100644 --- a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.es.xlf @@ -3,53 +3,18 @@ - - .NET Cache - .NET Cache - - - Caches the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. + Stores the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. Cahes Assemblies specified for the .NET Platform - - ProjectEntries - ProjectEntries - - - - The XML file that contains the list of packages to be cached. - The MSBuild project file used to specify the list of packages to be cached. - - - - FRAMEWORK - FRAMEWORK - - - - Target framework for which to cache for. - Target framework for which to cache for - - - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Target runtime to cache for. - Target runtime to cache for. - - OUTPUT_DIR OUTPUT_DIR - Output directory in which to cache the given assemblies. + Output directory in which to store the given assemblies. Path in which to cache the given assemblies @@ -73,16 +38,6 @@ The directory used by the command to do its work - - Preserves the intermediate working directory. - The directory used by the command to do its work will not be removed - - - - Specify at least one entry with --entries. - Please specify atleast one entry with --entries - - Intermediate working directory {0} already exists. Remove {0} or specify another directory with -w. Intermediate working directory {0} exists, remove {0} or specify another directory with -w @@ -93,6 +48,26 @@ Skips the optimization phase. + + PROJECT_MANIFEST + PROJECT_MANIFEST + + + + The XML file that contains the list of packages to be stored. + The XML file that contains the list of packages to be stored. + + + + Skips creating symbol files which can be used for profiling the optimized assemblies. + Skips creating symbol files which can be used for profiling the optimized assemblies. + + + + Specify at least one manifest with --manifest. + Specify at least one manifest with --manifest. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.fr.xlf index 3ef25bc4e..d2a9c37ef 100644 --- a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.fr.xlf @@ -3,53 +3,18 @@ - - .NET Cache - .NET Cache - - - Caches the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. + Stores the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. Cahes Assemblies specified for the .NET Platform - - ProjectEntries - ProjectEntries - - - - The XML file that contains the list of packages to be cached. - The MSBuild project file used to specify the list of packages to be cached. - - - - FRAMEWORK - FRAMEWORK - - - - Target framework for which to cache for. - Target framework for which to cache for - - - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Target runtime to cache for. - Target runtime to cache for. - - OUTPUT_DIR OUTPUT_DIR - Output directory in which to cache the given assemblies. + Output directory in which to store the given assemblies. Path in which to cache the given assemblies @@ -73,16 +38,6 @@ The directory used by the command to do its work - - Preserves the intermediate working directory. - The directory used by the command to do its work will not be removed - - - - Specify at least one entry with --entries. - Please specify atleast one entry with --entries - - Intermediate working directory {0} already exists. Remove {0} or specify another directory with -w. Intermediate working directory {0} exists, remove {0} or specify another directory with -w @@ -93,6 +48,26 @@ Skips the optimization phase. + + PROJECT_MANIFEST + PROJECT_MANIFEST + + + + The XML file that contains the list of packages to be stored. + The XML file that contains the list of packages to be stored. + + + + Skips creating symbol files which can be used for profiling the optimized assemblies. + Skips creating symbol files which can be used for profiling the optimized assemblies. + + + + Specify at least one manifest with --manifest. + Specify at least one manifest with --manifest. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.it.xlf index 088a2311c..93a4d7ba4 100644 --- a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.it.xlf @@ -3,53 +3,18 @@ - - .NET Cache - .NET Cache - - - Caches the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. + Stores the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. Cahes Assemblies specified for the .NET Platform - - ProjectEntries - ProjectEntries - - - - The XML file that contains the list of packages to be cached. - The MSBuild project file used to specify the list of packages to be cached. - - - - FRAMEWORK - FRAMEWORK - - - - Target framework for which to cache for. - Target framework for which to cache for - - - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Target runtime to cache for. - Target runtime to cache for. - - OUTPUT_DIR OUTPUT_DIR - Output directory in which to cache the given assemblies. + Output directory in which to store the given assemblies. Path in which to cache the given assemblies @@ -73,16 +38,6 @@ The directory used by the command to do its work - - Preserves the intermediate working directory. - The directory used by the command to do its work will not be removed - - - - Specify at least one entry with --entries. - Please specify atleast one entry with --entries - - Intermediate working directory {0} already exists. Remove {0} or specify another directory with -w. Intermediate working directory {0} exists, remove {0} or specify another directory with -w @@ -93,6 +48,26 @@ Skips the optimization phase. + + PROJECT_MANIFEST + PROJECT_MANIFEST + + + + The XML file that contains the list of packages to be stored. + The XML file that contains the list of packages to be stored. + + + + Skips creating symbol files which can be used for profiling the optimized assemblies. + Skips creating symbol files which can be used for profiling the optimized assemblies. + + + + Specify at least one manifest with --manifest. + Specify at least one manifest with --manifest. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ja.xlf index 0202dcc57..40e790165 100644 --- a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ja.xlf @@ -3,53 +3,18 @@ - - .NET Cache - .NET Cache - - - Caches the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. + Stores the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. Cahes Assemblies specified for the .NET Platform - - ProjectEntries - ProjectEntries - - - - The XML file that contains the list of packages to be cached. - The MSBuild project file used to specify the list of packages to be cached. - - - - FRAMEWORK - FRAMEWORK - - - - Target framework for which to cache for. - Target framework for which to cache for - - - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Target runtime to cache for. - Target runtime to cache for. - - OUTPUT_DIR OUTPUT_DIR - Output directory in which to cache the given assemblies. + Output directory in which to store the given assemblies. Path in which to cache the given assemblies @@ -73,16 +38,6 @@ The directory used by the command to do its work - - Preserves the intermediate working directory. - The directory used by the command to do its work will not be removed - - - - Specify at least one entry with --entries. - Please specify atleast one entry with --entries - - Intermediate working directory {0} already exists. Remove {0} or specify another directory with -w. Intermediate working directory {0} exists, remove {0} or specify another directory with -w @@ -93,6 +48,26 @@ Skips the optimization phase. + + PROJECT_MANIFEST + PROJECT_MANIFEST + + + + The XML file that contains the list of packages to be stored. + The XML file that contains the list of packages to be stored. + + + + Skips creating symbol files which can be used for profiling the optimized assemblies. + Skips creating symbol files which can be used for profiling the optimized assemblies. + + + + Specify at least one manifest with --manifest. + Specify at least one manifest with --manifest. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ko.xlf index 86192e70e..73cf850db 100644 --- a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ko.xlf @@ -3,53 +3,18 @@ - - .NET Cache - .NET Cache - - - Caches the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. + Stores the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. Cahes Assemblies specified for the .NET Platform - - ProjectEntries - ProjectEntries - - - - The XML file that contains the list of packages to be cached. - The MSBuild project file used to specify the list of packages to be cached. - - - - FRAMEWORK - FRAMEWORK - - - - Target framework for which to cache for. - Target framework for which to cache for - - - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Target runtime to cache for. - Target runtime to cache for. - - OUTPUT_DIR OUTPUT_DIR - Output directory in which to cache the given assemblies. + Output directory in which to store the given assemblies. Path in which to cache the given assemblies @@ -73,16 +38,6 @@ The directory used by the command to do its work - - Preserves the intermediate working directory. - The directory used by the command to do its work will not be removed - - - - Specify at least one entry with --entries. - Please specify atleast one entry with --entries - - Intermediate working directory {0} already exists. Remove {0} or specify another directory with -w. Intermediate working directory {0} exists, remove {0} or specify another directory with -w @@ -93,6 +48,26 @@ Skips the optimization phase. + + PROJECT_MANIFEST + PROJECT_MANIFEST + + + + The XML file that contains the list of packages to be stored. + The XML file that contains the list of packages to be stored. + + + + Skips creating symbol files which can be used for profiling the optimized assemblies. + Skips creating symbol files which can be used for profiling the optimized assemblies. + + + + Specify at least one manifest with --manifest. + Specify at least one manifest with --manifest. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pl.xlf index dd9fc1e68..0c88ab7e4 100644 --- a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pl.xlf @@ -3,53 +3,18 @@ - - .NET Cache - .NET Cache - - - Caches the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. + Stores the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. Cahes Assemblies specified for the .NET Platform - - ProjectEntries - ProjectEntries - - - - The XML file that contains the list of packages to be cached. - The MSBuild project file used to specify the list of packages to be cached. - - - - FRAMEWORK - FRAMEWORK - - - - Target framework for which to cache for. - Target framework for which to cache for - - - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Target runtime to cache for. - Target runtime to cache for. - - OUTPUT_DIR OUTPUT_DIR - Output directory in which to cache the given assemblies. + Output directory in which to store the given assemblies. Path in which to cache the given assemblies @@ -73,16 +38,6 @@ The directory used by the command to do its work - - Preserves the intermediate working directory. - The directory used by the command to do its work will not be removed - - - - Specify at least one entry with --entries. - Please specify atleast one entry with --entries - - Intermediate working directory {0} already exists. Remove {0} or specify another directory with -w. Intermediate working directory {0} exists, remove {0} or specify another directory with -w @@ -93,6 +48,26 @@ Skips the optimization phase. + + PROJECT_MANIFEST + PROJECT_MANIFEST + + + + The XML file that contains the list of packages to be stored. + The XML file that contains the list of packages to be stored. + + + + Skips creating symbol files which can be used for profiling the optimized assemblies. + Skips creating symbol files which can be used for profiling the optimized assemblies. + + + + Specify at least one manifest with --manifest. + Specify at least one manifest with --manifest. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pt-BR.xlf index 922f84b4d..d0c6b15c0 100644 --- a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.pt-BR.xlf @@ -3,53 +3,18 @@ - - .NET Cache - .NET Cache - - - Caches the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. + Stores the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. Cahes Assemblies specified for the .NET Platform - - ProjectEntries - ProjectEntries - - - - The XML file that contains the list of packages to be cached. - The MSBuild project file used to specify the list of packages to be cached. - - - - FRAMEWORK - FRAMEWORK - - - - Target framework for which to cache for. - Target framework for which to cache for - - - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Target runtime to cache for. - Target runtime to cache for. - - OUTPUT_DIR OUTPUT_DIR - Output directory in which to cache the given assemblies. + Output directory in which to store the given assemblies. Path in which to cache the given assemblies @@ -73,16 +38,6 @@ The directory used by the command to do its work - - Preserves the intermediate working directory. - The directory used by the command to do its work will not be removed - - - - Specify at least one entry with --entries. - Please specify atleast one entry with --entries - - Intermediate working directory {0} already exists. Remove {0} or specify another directory with -w. Intermediate working directory {0} exists, remove {0} or specify another directory with -w @@ -93,6 +48,26 @@ Skips the optimization phase. + + PROJECT_MANIFEST + PROJECT_MANIFEST + + + + The XML file that contains the list of packages to be stored. + The XML file that contains the list of packages to be stored. + + + + Skips creating symbol files which can be used for profiling the optimized assemblies. + Skips creating symbol files which can be used for profiling the optimized assemblies. + + + + Specify at least one manifest with --manifest. + Specify at least one manifest with --manifest. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ru.xlf index a9bbfdc18..a62618866 100644 --- a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.ru.xlf @@ -3,53 +3,18 @@ - - .NET Cache - .NET Cache - - - Caches the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. + Stores the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. Cahes Assemblies specified for the .NET Platform - - ProjectEntries - ProjectEntries - - - - The XML file that contains the list of packages to be cached. - The MSBuild project file used to specify the list of packages to be cached. - - - - FRAMEWORK - FRAMEWORK - - - - Target framework for which to cache for. - Target framework for which to cache for - - - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Target runtime to cache for. - Target runtime to cache for. - - OUTPUT_DIR OUTPUT_DIR - Output directory in which to cache the given assemblies. + Output directory in which to store the given assemblies. Path in which to cache the given assemblies @@ -73,16 +38,6 @@ The directory used by the command to do its work - - Preserves the intermediate working directory. - The directory used by the command to do its work will not be removed - - - - Specify at least one entry with --entries. - Please specify atleast one entry with --entries - - Intermediate working directory {0} already exists. Remove {0} or specify another directory with -w. Intermediate working directory {0} exists, remove {0} or specify another directory with -w @@ -93,6 +48,26 @@ Skips the optimization phase. + + PROJECT_MANIFEST + PROJECT_MANIFEST + + + + The XML file that contains the list of packages to be stored. + The XML file that contains the list of packages to be stored. + + + + Skips creating symbol files which can be used for profiling the optimized assemblies. + Skips creating symbol files which can be used for profiling the optimized assemblies. + + + + Specify at least one manifest with --manifest. + Specify at least one manifest with --manifest. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.tr.xlf index 409c5dd94..41f19e7d8 100644 --- a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.tr.xlf @@ -3,53 +3,18 @@ - - .NET Cache - .NET Cache - - - Caches the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. + Stores the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. Cahes Assemblies specified for the .NET Platform - - ProjectEntries - ProjectEntries - - - - The XML file that contains the list of packages to be cached. - The MSBuild project file used to specify the list of packages to be cached. - - - - FRAMEWORK - FRAMEWORK - - - - Target framework for which to cache for. - Target framework for which to cache for - - - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Target runtime to cache for. - Target runtime to cache for. - - OUTPUT_DIR OUTPUT_DIR - Output directory in which to cache the given assemblies. + Output directory in which to store the given assemblies. Path in which to cache the given assemblies @@ -73,16 +38,6 @@ The directory used by the command to do its work - - Preserves the intermediate working directory. - The directory used by the command to do its work will not be removed - - - - Specify at least one entry with --entries. - Please specify atleast one entry with --entries - - Intermediate working directory {0} already exists. Remove {0} or specify another directory with -w. Intermediate working directory {0} exists, remove {0} or specify another directory with -w @@ -93,6 +48,26 @@ Skips the optimization phase. + + PROJECT_MANIFEST + PROJECT_MANIFEST + + + + The XML file that contains the list of packages to be stored. + The XML file that contains the list of packages to be stored. + + + + Skips creating symbol files which can be used for profiling the optimized assemblies. + Skips creating symbol files which can be used for profiling the optimized assemblies. + + + + Specify at least one manifest with --manifest. + Specify at least one manifest with --manifest. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.xlf index 2ee6951d4..49ede3f14 100644 --- a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.xlf +++ b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.xlf @@ -3,36 +3,8 @@ - - .NET Cache - - - Caches the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. - - - - ProjectEntries - - - - The XML file that contains the list of packages to be cached. - - - - FRAMEWORK - - - - Target framework for which to cache for. - - - - RUNTIME_IDENTIFIER - - - - Target runtime to cache for. + Stores the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. @@ -40,7 +12,7 @@ - Output directory in which to cache the given assemblies. + Output directory in which to store the given assemblies. @@ -59,14 +31,6 @@ The directory used by the command to execute. - - Preserves the intermediate working directory. - - - - Specify at least one entry with --entries. - - Intermediate working directory {0} already exists. Remove {0} or specify another directory with -w. @@ -75,6 +39,22 @@ Skips the optimization phase. + + PROJECT_MANIFEST + + + + The XML file that contains the list of packages to be stored. + + + + Skips creating symbol files which can be used for profiling the optimized assemblies. + + + + Specify at least one manifest with --manifest. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hans.xlf index 73966975c..3b09a85de 100644 --- a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hans.xlf @@ -3,53 +3,18 @@ - - .NET Cache - .NET Cache - - - Caches the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. + Stores the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. Cahes Assemblies specified for the .NET Platform - - ProjectEntries - ProjectEntries - - - - The XML file that contains the list of packages to be cached. - The MSBuild project file used to specify the list of packages to be cached. - - - - FRAMEWORK - FRAMEWORK - - - - Target framework for which to cache for. - Target framework for which to cache for - - - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Target runtime to cache for. - Target runtime to cache for. - - OUTPUT_DIR OUTPUT_DIR - Output directory in which to cache the given assemblies. + Output directory in which to store the given assemblies. Path in which to cache the given assemblies @@ -73,16 +38,6 @@ The directory used by the command to do its work - - Preserves the intermediate working directory. - The directory used by the command to do its work will not be removed - - - - Specify at least one entry with --entries. - Please specify atleast one entry with --entries - - Intermediate working directory {0} already exists. Remove {0} or specify another directory with -w. Intermediate working directory {0} exists, remove {0} or specify another directory with -w @@ -93,6 +48,26 @@ Skips the optimization phase. + + PROJECT_MANIFEST + PROJECT_MANIFEST + + + + The XML file that contains the list of packages to be stored. + The XML file that contains the list of packages to be stored. + + + + Skips creating symbol files which can be used for profiling the optimized assemblies. + Skips creating symbol files which can be used for profiling the optimized assemblies. + + + + Specify at least one manifest with --manifest. + Specify at least one manifest with --manifest. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hant.xlf index 9e5a5a050..9a303e93e 100644 --- a/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-store/xlf/LocalizableStrings.zh-Hant.xlf @@ -3,53 +3,18 @@ - - .NET Cache - .NET Cache - - - Caches the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. + Stores the specified assemblies for the .NET Platform. By default, these will be optimized for the target runtime and framework. Cahes Assemblies specified for the .NET Platform - - ProjectEntries - ProjectEntries - - - - The XML file that contains the list of packages to be cached. - The MSBuild project file used to specify the list of packages to be cached. - - - - FRAMEWORK - FRAMEWORK - - - - Target framework for which to cache for. - Target framework for which to cache for - - - - RUNTIME_IDENTIFIER - RUNTIME_IDENTIFIER - - - - Target runtime to cache for. - Target runtime to cache for. - - OUTPUT_DIR OUTPUT_DIR - Output directory in which to cache the given assemblies. + Output directory in which to store the given assemblies. Path in which to cache the given assemblies @@ -73,16 +38,6 @@ The directory used by the command to do its work - - Preserves the intermediate working directory. - The directory used by the command to do its work will not be removed - - - - Specify at least one entry with --entries. - Please specify atleast one entry with --entries - - Intermediate working directory {0} already exists. Remove {0} or specify another directory with -w. Intermediate working directory {0} exists, remove {0} or specify another directory with -w @@ -93,6 +48,26 @@ Skips the optimization phase. + + PROJECT_MANIFEST + PROJECT_MANIFEST + + + + The XML file that contains the list of packages to be stored. + The XML file that contains the list of packages to be stored. + + + + Skips creating symbol files which can be used for profiling the optimized assemblies. + Skips creating symbol files which can be used for profiling the optimized assemblies. + + + + Specify at least one manifest with --manifest. + Specify at least one manifest with --manifest. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.cs.xlf index ced762fb1..d60f634dd 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.cs.xlf @@ -19,9 +19,9 @@ - The project to test, defaults to the current directory. - Výchozí hodnotou pro testovaný projekt je aktuální adresář. - + The project to test. Defaults to the current directory. + Výchozí hodnotou pro testovaný projekt je aktuální adresář. + SETTINGS_FILE @@ -72,11 +72,12 @@ - Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" - Zadejte protokolovací nástroj pro výsledky testů. + Specify a logger for test results. + Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + More info on logger arguments support:https://aka.ms/vstest-report + Zadejte protokolovací nástroj pro výsledky testů. Příklad: --logger "trx[;LogFileName=<Standardně se nastaví jedinečný název souboru>]" - + CONFIGURATION @@ -84,9 +85,9 @@ - Configuration to use for building the project. Default for most projects is "Debug". - Konfigurace použitá k sestavení projektu. Výchozí možnost u většiny projektů je „Debug“. - + Configuration to use for building the project. Default for most projects is "Debug". + Konfigurace použitá k sestavení projektu. Výchozí možnost u většiny projektů je „Debug“. + FRAMEWORK @@ -125,12 +126,51 @@ Nesestavujte projekt dříve, než ho otestujete. - - Any extra commandline runsettings arguments that should be passed to vstest. See 'dotnet vstest --help' for available options. - Example: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - Případné další argumenty runsettings příkazového řádku navíc, které by se měly předat do vstestu Dostupné možnosti zobrazíte příkazem dotnet vstest --help. - Příklad: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - + + PATH_TO_ADAPTER + PATH_TO_ADAPTER + + + + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + + + + PATH_TO_RESULTS_DIRECTORY + PATH_TO_RESULTS_DIRECTORY + + + + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + + + DATA_COLLECTOR_FRIENDLY_NAME + DATA_COLLECTOR_FRIENDLY_NAME + + + + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.de.xlf index fbd82d223..28259c2c9 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.de.xlf @@ -19,9 +19,9 @@ - The project to test, defaults to the current directory. - Das zu testende Projekt (standardmäßig das aktuelle Verzeichnis). - + The project to test. Defaults to the current directory. + Das zu testende Projekt (standardmäßig das aktuelle Verzeichnis). + SETTINGS_FILE @@ -72,11 +72,12 @@ - Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" - Geben Sie einen Protokollierer für Testergebnisse an. + Specify a logger for test results. + Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + More info on logger arguments support:https://aka.ms/vstest-report + Geben Sie einen Protokollierer für Testergebnisse an. Beispiel: --logger "trx[;LogFileName=<Defaults to unique file name>]" - + CONFIGURATION @@ -84,9 +85,9 @@ - Configuration to use for building the project. Default for most projects is "Debug". - Konfiguration für die Erstellung des Projekts. Standard für die meisten Projekte ist "Debug". - + Configuration to use for building the project. Default for most projects is "Debug". + Konfiguration für die Erstellung des Projekts. Standard für die meisten Projekte ist "Debug". + FRAMEWORK @@ -125,12 +126,51 @@ Erstellen Sie das Projekt nicht vor dem Testen. - - Any extra commandline runsettings arguments that should be passed to vstest. See 'dotnet vstest --help' for available options. - Example: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - Alle zusätzlichen "runsettings"-Befehlszeilenargumente, die an "vstest" übergeben werden sollen. Verfügbare Optionen siehe "dotnet vstest --help". - Beispiel: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - + + PATH_TO_ADAPTER + PATH_TO_ADAPTER + + + + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + + + + PATH_TO_RESULTS_DIRECTORY + PATH_TO_RESULTS_DIRECTORY + + + + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + + + DATA_COLLECTOR_FRIENDLY_NAME + DATA_COLLECTOR_FRIENDLY_NAME + + + + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.es.xlf index 750eeb35c..4ad92eb15 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.es.xlf @@ -19,9 +19,9 @@ - The project to test, defaults to the current directory. - Proyecto que se prueba. De forma predeterminada, se usa el directorio actual. - + The project to test. Defaults to the current directory. + Proyecto que se prueba. De forma predeterminada, se usa el directorio actual. + SETTINGS_FILE @@ -72,11 +72,12 @@ - Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" - Especifica un registrador para los resultados de pruebas. + Specify a logger for test results. + Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + More info on logger arguments support:https://aka.ms/vstest-report + Especifica un registrador para los resultados de pruebas. Ejemplo: --logger "trx[;LogFileName=<Se establece de manera predeterminada en el nombre de archivo único>]" - + CONFIGURATION @@ -84,9 +85,9 @@ - Configuration to use for building the project. Default for most projects is "Debug". - Configuración para usar para crear el proyecto. El valor predeterminado para la mayoría de los proyectos es "Depurar". - + Configuration to use for building the project. Default for most projects is "Debug". + Configuración para usar para crear el proyecto. El valor predeterminado para la mayoría de los proyectos es "Depurar". + FRAMEWORK @@ -125,12 +126,51 @@ El proyecto no se compila antes de probarlo. - - Any extra commandline runsettings arguments that should be passed to vstest. See 'dotnet vstest --help' for available options. - Example: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - Cualquier argumento runsettings de la línea de comandos adicional que debe pasarse a vstest. Consulte "dotnet vstest --help'" para conocer las opciones disponibles. - Ejemplo: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - + + PATH_TO_ADAPTER + PATH_TO_ADAPTER + + + + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + + + + PATH_TO_RESULTS_DIRECTORY + PATH_TO_RESULTS_DIRECTORY + + + + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + + + DATA_COLLECTOR_FRIENDLY_NAME + DATA_COLLECTOR_FRIENDLY_NAME + + + + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.fr.xlf index ee028003a..4009e01c5 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.fr.xlf @@ -19,9 +19,9 @@ - The project to test, defaults to the current directory. - Projet à tester, par défaut le répertoire actif. - + The project to test. Defaults to the current directory. + Projet à tester, par défaut le répertoire actif. + SETTINGS_FILE @@ -72,11 +72,12 @@ - Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" - Spécifiez un enregistreur pour les résultats des tests. + Specify a logger for test results. + Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + More info on logger arguments support:https://aka.ms/vstest-report + Spécifiez un enregistreur pour les résultats des tests. Exemple : --logger "trx[;LogFileName=<par défaut un nom de fichier unique>]" - + CONFIGURATION @@ -84,9 +85,9 @@ - Configuration to use for building the project. Default for most projects is "Debug". - Configuration à utiliser pour la génération du projet. La valeur par défaut pour la plupart des projets est "Debug". - + Configuration to use for building the project. Default for most projects is "Debug". + Configuration à utiliser pour la génération du projet. La valeur par défaut pour la plupart des projets est "Debug". + FRAMEWORK @@ -125,12 +126,51 @@ Ne générez pas le projet avant les tests. - - Any extra commandline runsettings arguments that should be passed to vstest. See 'dotnet vstest --help' for available options. - Example: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - Tout argument de ligne de commande supplémentaire runsettings qui doit être passé à vstest. Consultez 'dotnet vstest --help' pour connaître les options disponibles. - Exemple : -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - + + PATH_TO_ADAPTER + PATH_TO_ADAPTER + + + + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + + + + PATH_TO_RESULTS_DIRECTORY + PATH_TO_RESULTS_DIRECTORY + + + + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + + + DATA_COLLECTOR_FRIENDLY_NAME + DATA_COLLECTOR_FRIENDLY_NAME + + + + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.it.xlf index be4605641..dbd3e3eac 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.it.xlf @@ -19,9 +19,9 @@ - The project to test, defaults to the current directory. - Progetto da testare. Per impostazione predefinita, verrà usata la directory corrente. - + The project to test. Defaults to the current directory. + Progetto da testare. Per impostazione predefinita, verrà usata la directory corrente. + SETTINGS_FILE @@ -72,11 +72,12 @@ - Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" - Consente di specificare un logger per i risultati dei test. + Specify a logger for test results. + Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + More info on logger arguments support:https://aka.ms/vstest-report + Consente di specificare un logger per i risultati dei test. Esempio: --logger "trx[;LogFileName=<l'impostazione predefinita è un nome file univoco>]" - + CONFIGURATION @@ -84,9 +85,9 @@ - Configuration to use for building the project. Default for most projects is "Debug". - Configurazione da usare per compilare il progetto. L'impostazione predefinita per la maggior parte dei progetti è "Debug". - + Configuration to use for building the project. Default for most projects is "Debug". + Configurazione da usare per compilare il progetto. L'impostazione predefinita per la maggior parte dei progetti è "Debug". + FRAMEWORK @@ -125,12 +126,51 @@ Il progetto non viene compilato prima del test. - - Any extra commandline runsettings arguments that should be passed to vstest. See 'dotnet vstest --help' for available options. - Example: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - Eventuali argomenti aggiuntivi di runsettings della riga di comando che devono essere passati a vstest. Per le opzioni disponibili, vedere 'dotnet vstest --help'. - Esempio: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - + + PATH_TO_ADAPTER + PATH_TO_ADAPTER + + + + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + + + + PATH_TO_RESULTS_DIRECTORY + PATH_TO_RESULTS_DIRECTORY + + + + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + + + DATA_COLLECTOR_FRIENDLY_NAME + DATA_COLLECTOR_FRIENDLY_NAME + + + + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ja.xlf index a59ca7acf..f6a2bfae8 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ja.xlf @@ -19,9 +19,9 @@ - The project to test, defaults to the current directory. - テストするプロジェクト。既定は現在のディレクトリです。 - + The project to test. Defaults to the current directory. + テストするプロジェクト。既定は現在のディレクトリです。 + SETTINGS_FILE @@ -72,11 +72,12 @@ - Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" - テスト結果のロガーを指定します。 + Specify a logger for test results. + Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + More info on logger arguments support:https://aka.ms/vstest-report + テスト結果のロガーを指定します。 例: --logger "trx[;LogFileName=<Defaults to unique file name>]" - + CONFIGURATION @@ -84,9 +85,9 @@ - Configuration to use for building the project. Default for most projects is "Debug". - プロジェクトの構築に使用する構成。ほとんどのプロジェクトで既定は "デバッグ" です。 - + Configuration to use for building the project. Default for most projects is "Debug". + プロジェクトの構築に使用する構成。ほとんどのプロジェクトで既定は "デバッグ" です。 + FRAMEWORK @@ -125,12 +126,51 @@ テストする前にプロジェクトを構築しないでください。 - - Any extra commandline runsettings arguments that should be passed to vstest. See 'dotnet vstest --help' for available options. - Example: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - vstest に渡されるその他の commandline runsettings 引数。利用可能なオプションについては、'dotnet vstest --help' をご覧ください。 - 例: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - + + PATH_TO_ADAPTER + PATH_TO_ADAPTER + + + + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + + + + PATH_TO_RESULTS_DIRECTORY + PATH_TO_RESULTS_DIRECTORY + + + + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + + + DATA_COLLECTOR_FRIENDLY_NAME + DATA_COLLECTOR_FRIENDLY_NAME + + + + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ko.xlf index d350abfea..b51ca2fde 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ko.xlf @@ -19,9 +19,9 @@ - The project to test, defaults to the current directory. - 테스트할 프로젝트입니다. 현재 디렉터리로 기본 설정됩니다. - + The project to test. Defaults to the current directory. + 테스트할 프로젝트입니다. 현재 디렉터리로 기본 설정됩니다. + SETTINGS_FILE @@ -72,11 +72,12 @@ - Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" - 테스트 결과에 대해 로거를 지정합니다. + Specify a logger for test results. + Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + More info on logger arguments support:https://aka.ms/vstest-report + 테스트 결과에 대해 로거를 지정합니다. 예: --logger "trx[;LogFileName=<고유한 파일 이름을 기본값으로 설정>]" - + CONFIGURATION @@ -84,9 +85,9 @@ - Configuration to use for building the project. Default for most projects is "Debug". - 프로젝트 빌드에 사용할 구성입니다. 대부분의 프로젝트에서 기본값은 "Debug"입니다. - + Configuration to use for building the project. Default for most projects is "Debug". + 프로젝트 빌드에 사용할 구성입니다. 대부분의 프로젝트에서 기본값은 "Debug"입니다. + FRAMEWORK @@ -125,12 +126,51 @@ 테스트하기 전에 프로젝트를 빌드하지 않습니다. - - Any extra commandline runsettings arguments that should be passed to vstest. See 'dotnet vstest --help' for available options. - Example: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - vstest에 전달되어야 하는 추가 commandline runsettings 인수입니다. 사용 가능한 옵션은 'dotnet vstest --help'를 참조하세요. - 예: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - + + PATH_TO_ADAPTER + PATH_TO_ADAPTER + + + + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + + + + PATH_TO_RESULTS_DIRECTORY + PATH_TO_RESULTS_DIRECTORY + + + + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + + + DATA_COLLECTOR_FRIENDLY_NAME + DATA_COLLECTOR_FRIENDLY_NAME + + + + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pl.xlf index a9b804681..5bc301f03 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pl.xlf @@ -19,9 +19,9 @@ - The project to test, defaults to the current directory. - Projekt do przetestowania. Domyślną wartością jest bieżący katalog. - + The project to test. Defaults to the current directory. + Projekt do przetestowania. Domyślną wartością jest bieżący katalog. + SETTINGS_FILE @@ -72,11 +72,12 @@ - Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" - Określ rejestratora wyników testów. + Specify a logger for test results. + Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + More info on logger arguments support:https://aka.ms/vstest-report + Określ rejestratora wyników testów. Przykład: --logger "trx[;LogFileName=<domyślnie jest to unikatowa nazwa pliku>]" - + CONFIGURATION @@ -84,9 +85,9 @@ - Configuration to use for building the project. Default for most projects is "Debug". - Konfiguracja do użycia na potrzeby kompilacji projektu. Opcją domyślną w przypadku większości projektów jest „Debug”. - + Configuration to use for building the project. Default for most projects is "Debug". + Konfiguracja do użycia na potrzeby kompilacji projektu. Opcją domyślną w przypadku większości projektów jest „Debug”. + FRAMEWORK @@ -125,12 +126,51 @@ Nie kompiluj projektu przed przeprowadzeniem testów. - - Any extra commandline runsettings arguments that should be passed to vstest. See 'dotnet vstest --help' for available options. - Example: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - Wszelkie dodatkowe argumenty runsettings wiersza polecenia, które mają zostać przekazane do programu vstest. Uruchom polecenie „dotnet vstest --help”, aby zapoznać się z dostępnymi opcjami. - Przykład: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - + + PATH_TO_ADAPTER + PATH_TO_ADAPTER + + + + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + + + + PATH_TO_RESULTS_DIRECTORY + PATH_TO_RESULTS_DIRECTORY + + + + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + + + DATA_COLLECTOR_FRIENDLY_NAME + DATA_COLLECTOR_FRIENDLY_NAME + + + + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pt-BR.xlf index 888a4a19c..09269cf78 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pt-BR.xlf @@ -19,9 +19,9 @@ - The project to test, defaults to the current directory. - O projeto a ser testado, usa como padrão o diretório atual. - + The project to test. Defaults to the current directory. + O projeto a ser testado, usa como padrão o diretório atual. + SETTINGS_FILE @@ -72,11 +72,12 @@ - Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" - Especifique um agente para os resultados de teste. + Specify a logger for test results. + Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + More info on logger arguments support:https://aka.ms/vstest-report + Especifique um agente para os resultados de teste. Exemplo: --logger "trx[;LogFileName=<Defaults to unique file name>]" - + CONFIGURATION @@ -84,9 +85,9 @@ - Configuration to use for building the project. Default for most projects is "Debug". - A configuração a ser usada para criar o projeto. O padrão para a maioria dos projetos é “Depurar”. - + Configuration to use for building the project. Default for most projects is "Debug". + A configuração a ser usada para criar o projeto. O padrão para a maioria dos projetos é “Depurar”. + FRAMEWORK @@ -125,12 +126,51 @@ Não compile o projeto antes de testar. - - Any extra commandline runsettings arguments that should be passed to vstest. See 'dotnet vstest --help' for available options. - Example: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - Qualquer argumento de configuração de execução da linha de comando adicional que deve ser transmitido para vstest. Consulte 'dotnet vstest --help' para obter opções disponíveis. - Exemplo: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - + + PATH_TO_ADAPTER + PATH_TO_ADAPTER + + + + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + + + + PATH_TO_RESULTS_DIRECTORY + PATH_TO_RESULTS_DIRECTORY + + + + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + + + DATA_COLLECTOR_FRIENDLY_NAME + DATA_COLLECTOR_FRIENDLY_NAME + + + + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ru.xlf index fc6590076..4642d9f2e 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ru.xlf @@ -19,9 +19,9 @@ - The project to test, defaults to the current directory. - Тестируемый проект. По умолчанию используется текущий каталог. - + The project to test. Defaults to the current directory. + Тестируемый проект. По умолчанию используется текущий каталог. + SETTINGS_FILE @@ -72,11 +72,12 @@ - Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" - Укажите средство ведения журнала для результатов теста. + Specify a logger for test results. + Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + More info on logger arguments support:https://aka.ms/vstest-report + Укажите средство ведения журнала для результатов теста. Пример: --logger "trx[;LogFileName=<по умолчанию используется уникальное имя файла>]" - + CONFIGURATION @@ -84,9 +85,9 @@ - Configuration to use for building the project. Default for most projects is "Debug". - Конфигурация, используемая для сборки проекта. Значение по умолчанию для большинства проектов — "Debug". - + Configuration to use for building the project. Default for most projects is "Debug". + Конфигурация, используемая для сборки проекта. Значение по умолчанию для большинства проектов — "Debug". + FRAMEWORK @@ -125,12 +126,51 @@ Не выполнять сборку проектов перед тестированием. - - Any extra commandline runsettings arguments that should be passed to vstest. See 'dotnet vstest --help' for available options. - Example: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - Любые дополнительные аргументы runsettings командной строки, которые следует передать vstest. Чтобы узнать, какие параметры доступны, введите "dotnet vstest --help". - Пример: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - + + PATH_TO_ADAPTER + PATH_TO_ADAPTER + + + + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + + + + PATH_TO_RESULTS_DIRECTORY + PATH_TO_RESULTS_DIRECTORY + + + + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + + + DATA_COLLECTOR_FRIENDLY_NAME + DATA_COLLECTOR_FRIENDLY_NAME + + + + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.tr.xlf index 0b49b9ad9..3c4f8eec7 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.tr.xlf @@ -19,9 +19,9 @@ - The project to test, defaults to the current directory. - Test edilecek proje; varsayılan olarak geçerli dizin kullanılır. - + The project to test. Defaults to the current directory. + Test edilecek proje; varsayılan olarak geçerli dizin kullanılır. + SETTINGS_FILE @@ -72,11 +72,12 @@ - Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" - Test sonuçları için bir günlükçü belirtin. + Specify a logger for test results. + Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + More info on logger arguments support:https://aka.ms/vstest-report + Test sonuçları için bir günlükçü belirtin. Örnek: --logger "trx[;LogFileName=<Varsayılan olarak benzersiz dosya adıdır>]" - + CONFIGURATION @@ -84,9 +85,9 @@ - Configuration to use for building the project. Default for most projects is "Debug". - Projeyi derlemek için kullanılacak yapılandırma. Çoğu proje için varsayılan: "Debug". - + Configuration to use for building the project. Default for most projects is "Debug". + Projeyi derlemek için kullanılacak yapılandırma. Çoğu proje için varsayılan: "Debug". + FRAMEWORK @@ -125,12 +126,51 @@ Projeyi derlemeden önce test edin. - - Any extra commandline runsettings arguments that should be passed to vstest. See 'dotnet vstest --help' for available options. - Example: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - Vstest’e aktarılması gereken tüm ilave komut satırı runsettings bağımsız değişkenleri. Kullanılabilir seçenekler için 'dotnet vstest --help' komutuna bakın. - Örnek: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - + + PATH_TO_ADAPTER + PATH_TO_ADAPTER + + + + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + + + + PATH_TO_RESULTS_DIRECTORY + PATH_TO_RESULTS_DIRECTORY + + + + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + + + DATA_COLLECTOR_FRIENDLY_NAME + DATA_COLLECTOR_FRIENDLY_NAME + + + + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.xlf index f2fc04dbc..8179ef995 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.xlf @@ -16,8 +16,8 @@ - The project to test, defaults to the current directory. - + The project to test. Defaults to the current directory. + SETTINGS_FILE @@ -55,8 +55,9 @@ - Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + Specify a logger for test results. + Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + More info on logger arguments support:https://aka.ms/vstest-report @@ -64,8 +65,8 @@ - Configuration to use for building the project. Default for most projects is "Debug". - + Configuration to use for building the project. Default for most projects is "Debug". + FRAMEWORK @@ -96,9 +97,36 @@ Do not build project before testing. - - Any extra commandline runsettings arguments that should be passed to vstest. See 'dotnet vstest --help' for available options. - Example: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false + + PATH_TO_ADAPTER + + + + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + + + + PATH_TO_RESULTS_DIRECTORY + + + + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + + + DATA_COLLECTOR_FRIENDLY_NAME + + + + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.zh-Hans.xlf index ac3cbb981..cd3fcc885 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.zh-Hans.xlf @@ -19,9 +19,9 @@ - The project to test, defaults to the current directory. - 要测试的项目,默认为当前目录。 - + The project to test. Defaults to the current directory. + 要测试的项目,默认为当前目录。 + SETTINGS_FILE @@ -72,11 +72,12 @@ - Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" - 指定测试结果的记录器。 + Specify a logger for test results. + Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + More info on logger arguments support:https://aka.ms/vstest-report + 指定测试结果的记录器。 示例: --logger "trx[;LogFileName=<Defaults to unique file name>]" - + CONFIGURATION @@ -84,9 +85,9 @@ - Configuration to use for building the project. Default for most projects is "Debug". - 用于生成项目的配置。对大多数项目的默认值是 "Debug"。 - + Configuration to use for building the project. Default for most projects is "Debug". + 用于生成项目的配置。对大多数项目的默认值是 "Debug"。 + FRAMEWORK @@ -125,12 +126,51 @@ 测试之前不要生成项目。 - - Any extra commandline runsettings arguments that should be passed to vstest. See 'dotnet vstest --help' for available options. - Example: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - 应传递到 vstest 的任何其他命令行运行设置参数。有关可用选项,请参阅“dotnet vstest --help”。 - 示例: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - + + PATH_TO_ADAPTER + PATH_TO_ADAPTER + + + + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + + + + PATH_TO_RESULTS_DIRECTORY + PATH_TO_RESULTS_DIRECTORY + + + + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + + + DATA_COLLECTOR_FRIENDLY_NAME + DATA_COLLECTOR_FRIENDLY_NAME + + + + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.zh-Hant.xlf index 038341e6f..916d41625 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.zh-Hant.xlf @@ -19,9 +19,9 @@ - The project to test, defaults to the current directory. - 要測試的專案,預設為目前的目錄。 - + The project to test. Defaults to the current directory. + 要測試的專案,預設為目前的目錄。 + SETTINGS_FILE @@ -72,11 +72,12 @@ - Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" - 指定測試結果的記錄器。 + Specify a logger for test results. + Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + More info on logger arguments support:https://aka.ms/vstest-report + 指定測試結果的記錄器。 例如: --logger "trx[;LogFileName=<預設為唯一的檔案名稱>]" - + CONFIGURATION @@ -84,9 +85,9 @@ - Configuration to use for building the project. Default for most projects is "Debug". - 要用於建置專案的組態。多數專案的預設為 "Debug"。 - + Configuration to use for building the project. Default for most projects is "Debug". + 要用於建置專案的組態。多數專案的預設為 "Debug"。 + FRAMEWORK @@ -125,12 +126,51 @@ 請勿在測試前建置專案。 - - Any extra commandline runsettings arguments that should be passed to vstest. See 'dotnet vstest --help' for available options. - Example: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - 任何應傳遞到 vstest 的額外命令列 runsettings 引數。查看 'dotnet vstest --help' 以得知可用的選項。 - 例如: -- RunConfiguration.ResultsDirectory="C:\users\user\desktop\Results Directory" MSTest.DeploymentEnabled=false - + + PATH_TO_ADAPTER + PATH_TO_ADAPTER + + + + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + The directory where the test results are going to be placed. The specified directory will be created if it does not exist. + Example: --results-directory <PATH_TO_RESULTS_DIRECTORY> + + + + PATH_TO_RESULTS_DIRECTORY + PATH_TO_RESULTS_DIRECTORY + + + + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + +RunSettings arguments: + Arguments to pass runsettings configurations through commandline. Arguments may be specified as name-value pair of the form [name]=[value] after "-- ". Note the space after --. + Use a space to separate multiple[name] =[value]. + More info on RunSettings arguments support: https://aka.ms/vstest-runsettings-arguments + Example: dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True + + + + DATA_COLLECTOR_FRIENDLY_NAME + DATA_COLLECTOR_FRIENDLY_NAME + + + + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + Enables data collector for the test run. + More info here : https://aka.ms/vstest-collect + diff --git a/src/dotnet/dotnet.csproj b/src/dotnet/dotnet.csproj index 148d5bbbc..397741eae 100644 --- a/src/dotnet/dotnet.csproj +++ b/src/dotnet/dotnet.csproj @@ -1,6 +1,5 @@  - $(SdkVersion) netcoreapp2.0 @@ -12,22 +11,18 @@ $(PackageTargetFallback);dotnet5.4 Microsoft.DotNet.Cli - - - - @@ -41,13 +36,15 @@ + + - + - + \ No newline at end of file diff --git a/src/dotnet/xlf/CommonLocalizableStrings.cs.xlf b/src/dotnet/xlf/CommonLocalizableStrings.cs.xlf index 44f8e6904..f5cb63c28 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.cs.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.cs.xlf @@ -605,10 +605,10 @@ Project `{0}` could not be evaluated. Evaluation failed with following error: -{1} - Projekt {0} se nepodařilo vyhodnotit. Vyhodnocení vrátilo následující chybu: +{1}. + Projekt {0} se nepodařilo vyhodnotit. Vyhodnocení vrátilo následující chybu: {1} - + Unsupported project type. Please check with your sdk provider. @@ -616,9 +616,9 @@ - Invalid solution `{0}`. {1} - Neplatné řešení {0}. {1} - + Invalid solution `{0}`. {1}. + Neplatné řešení {0}. {1} + The project file to operate on. If a file is not specified, the command will search the current directory for one. @@ -631,14 +631,49 @@ - <SLN_FILE> - <SOUBOR_SLN> - + SLN_FILE + <SOUBOR_SLN> + - <PROJECT> - <PROJEKT> - + PROJECT + <PROJEKT> + + + + Invalid project `{0}`. {1}. + Invalid project `{0}`. {1}. + + + + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + + + + Target framework to publish for. The target framework has to be specified in the project file. + Target framework to publish for. The target framework has to be specified in the project file. + + + + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + + + + Configuration to use for building the project. Default for most projects is "Debug". + Configuration to use for building the project. Default for most projects is "Debug". + + + + Defines the value for the $(VersionSuffix) property in the project. + Defines the value for the $(VersionSuffix) property in the project. + + + + Show help information. + Show help information. + diff --git a/src/dotnet/xlf/CommonLocalizableStrings.de.xlf b/src/dotnet/xlf/CommonLocalizableStrings.de.xlf index 329892e01..3109c5633 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.de.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.de.xlf @@ -605,10 +605,10 @@ Project `{0}` could not be evaluated. Evaluation failed with following error: -{1} - Das Projekt "{0}" konnte nicht ausgewertet werden. Fehler bei der Auswertung: +{1}. + Das Projekt "{0}" konnte nicht ausgewertet werden. Fehler bei der Auswertung: {1} - + Unsupported project type. Please check with your sdk provider. @@ -616,9 +616,9 @@ - Invalid solution `{0}`. {1} - Ungültige Projektmappe "{0}". {1} - + Invalid solution `{0}`. {1}. + Ungültige Projektmappe "{0}". {1} + The project file to operate on. If a file is not specified, the command will search the current directory for one. @@ -631,14 +631,49 @@ - <SLN_FILE> - <SLN_FILE> - + SLN_FILE + <SLN_FILE> + - <PROJECT> - <PROJECT> - + PROJECT + <PROJECT> + + + + Invalid project `{0}`. {1}. + Invalid project `{0}`. {1}. + + + + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + + + + Target framework to publish for. The target framework has to be specified in the project file. + Target framework to publish for. The target framework has to be specified in the project file. + + + + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + + + + Configuration to use for building the project. Default for most projects is "Debug". + Configuration to use for building the project. Default for most projects is "Debug". + + + + Defines the value for the $(VersionSuffix) property in the project. + Defines the value for the $(VersionSuffix) property in the project. + + + + Show help information. + Show help information. + diff --git a/src/dotnet/xlf/CommonLocalizableStrings.es.xlf b/src/dotnet/xlf/CommonLocalizableStrings.es.xlf index cd3d92c7b..37096bc64 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.es.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.es.xlf @@ -605,10 +605,10 @@ Project `{0}` could not be evaluated. Evaluation failed with following error: -{1} - El proyecto "{0}" no se puede evaluar. Se produjo el siguiente error en la evaluación: +{1}. + El proyecto "{0}" no se puede evaluar. Se produjo el siguiente error en la evaluación: {1} - + Unsupported project type. Please check with your sdk provider. @@ -616,9 +616,9 @@ - Invalid solution `{0}`. {1} - La solución "{0}" no es válida. {1} - + Invalid solution `{0}`. {1}. + La solución "{0}" no es válida. {1} + The project file to operate on. If a file is not specified, the command will search the current directory for one. @@ -631,14 +631,49 @@ - <SLN_FILE> - <SLN_FILE> - + SLN_FILE + <SLN_FILE> + - <PROJECT> - <PROJECT> - + PROJECT + <PROJECT> + + + + Invalid project `{0}`. {1}. + Invalid project `{0}`. {1}. + + + + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + + + + Target framework to publish for. The target framework has to be specified in the project file. + Target framework to publish for. The target framework has to be specified in the project file. + + + + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + + + + Configuration to use for building the project. Default for most projects is "Debug". + Configuration to use for building the project. Default for most projects is "Debug". + + + + Defines the value for the $(VersionSuffix) property in the project. + Defines the value for the $(VersionSuffix) property in the project. + + + + Show help information. + Show help information. + diff --git a/src/dotnet/xlf/CommonLocalizableStrings.fr.xlf b/src/dotnet/xlf/CommonLocalizableStrings.fr.xlf index b7e591d0d..0bf58bae7 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.fr.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.fr.xlf @@ -605,10 +605,10 @@ Project `{0}` could not be evaluated. Evaluation failed with following error: -{1} - Impossible d'évaluer le projet '{0}'. L'évaluation a échoué avec l'erreur suivante : +{1}. + Impossible d'évaluer le projet '{0}'. L'évaluation a échoué avec l'erreur suivante : {1} - + Unsupported project type. Please check with your sdk provider. @@ -616,9 +616,9 @@ - Invalid solution `{0}`. {1} - Solution non valide `{0}`. {1} - + Invalid solution `{0}`. {1}. + Solution non valide `{0}`. {1} + The project file to operate on. If a file is not specified, the command will search the current directory for one. @@ -631,14 +631,49 @@ - <SLN_FILE> - <FICHIER_SLN> - + SLN_FILE + <FICHIER_SLN> + - <PROJECT> - <PROJET> - + PROJECT + <PROJET> + + + + Invalid project `{0}`. {1}. + Invalid project `{0}`. {1}. + + + + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + + + + Target framework to publish for. The target framework has to be specified in the project file. + Target framework to publish for. The target framework has to be specified in the project file. + + + + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + + + + Configuration to use for building the project. Default for most projects is "Debug". + Configuration to use for building the project. Default for most projects is "Debug". + + + + Defines the value for the $(VersionSuffix) property in the project. + Defines the value for the $(VersionSuffix) property in the project. + + + + Show help information. + Show help information. + diff --git a/src/dotnet/xlf/CommonLocalizableStrings.it.xlf b/src/dotnet/xlf/CommonLocalizableStrings.it.xlf index 1e08eb74d..acece802f 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.it.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.it.xlf @@ -605,10 +605,10 @@ Project `{0}` could not be evaluated. Evaluation failed with following error: -{1} - Non è stato possibile valutare il progetto `{0}`. La valutazione non è riuscita. Errore: +{1}. + Non è stato possibile valutare il progetto `{0}`. La valutazione non è riuscita. Errore: {1} - + Unsupported project type. Please check with your sdk provider. @@ -616,9 +616,9 @@ - Invalid solution `{0}`. {1} - La soluzione `{0}` non è valida. {1} - + Invalid solution `{0}`. {1}. + La soluzione `{0}` non è valida. {1} + The project file to operate on. If a file is not specified, the command will search the current directory for one. @@ -631,14 +631,49 @@ - <SLN_FILE> - <FILE_SOLUZIONE> - + SLN_FILE + <FILE_SOLUZIONE> + - <PROJECT> - <PROGETTO> - + PROJECT + <PROGETTO> + + + + Invalid project `{0}`. {1}. + Invalid project `{0}`. {1}. + + + + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + + + + Target framework to publish for. The target framework has to be specified in the project file. + Target framework to publish for. The target framework has to be specified in the project file. + + + + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + + + + Configuration to use for building the project. Default for most projects is "Debug". + Configuration to use for building the project. Default for most projects is "Debug". + + + + Defines the value for the $(VersionSuffix) property in the project. + Defines the value for the $(VersionSuffix) property in the project. + + + + Show help information. + Show help information. + diff --git a/src/dotnet/xlf/CommonLocalizableStrings.ja.xlf b/src/dotnet/xlf/CommonLocalizableStrings.ja.xlf index 1ca57d525..2511b4b81 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.ja.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.ja.xlf @@ -605,10 +605,10 @@ Project `{0}` could not be evaluated. Evaluation failed with following error: -{1} - プロジェクト `{0}` を評価できませんでした。評価は次のエラーにより失敗しました: +{1}. + プロジェクト `{0}` を評価できませんでした。評価は次のエラーにより失敗しました: {1} - + Unsupported project type. Please check with your sdk provider. @@ -616,9 +616,9 @@ - Invalid solution `{0}`. {1} - 無効なソリューション `{0}`。{1} - + Invalid solution `{0}`. {1}. + 無効なソリューション `{0}`。{1} + The project file to operate on. If a file is not specified, the command will search the current directory for one. @@ -631,14 +631,49 @@ - <SLN_FILE> - <SLN_FILE> - + SLN_FILE + <SLN_FILE> + - <PROJECT> - <PROJECT> - + PROJECT + <PROJECT> + + + + Invalid project `{0}`. {1}. + Invalid project `{0}`. {1}. + + + + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + + + + Target framework to publish for. The target framework has to be specified in the project file. + Target framework to publish for. The target framework has to be specified in the project file. + + + + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + + + + Configuration to use for building the project. Default for most projects is "Debug". + Configuration to use for building the project. Default for most projects is "Debug". + + + + Defines the value for the $(VersionSuffix) property in the project. + Defines the value for the $(VersionSuffix) property in the project. + + + + Show help information. + Show help information. + diff --git a/src/dotnet/xlf/CommonLocalizableStrings.ko.xlf b/src/dotnet/xlf/CommonLocalizableStrings.ko.xlf index 85a6d0c54..8e7925dd4 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.ko.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.ko.xlf @@ -605,10 +605,10 @@ Project `{0}` could not be evaluated. Evaluation failed with following error: -{1} - ‘{0}’ 프로젝트를 평가할 수 없습니다. 다음 오류와 함께 평가가 실패했습니다. +{1}. + ‘{0}’ 프로젝트를 평가할 수 없습니다. 다음 오류와 함께 평가가 실패했습니다. {1} - + Unsupported project type. Please check with your sdk provider. @@ -616,9 +616,9 @@ - Invalid solution `{0}`. {1} - `{0}` 솔루션이 잘못되었습니다. {1} - + Invalid solution `{0}`. {1}. + `{0}` 솔루션이 잘못되었습니다. {1} + The project file to operate on. If a file is not specified, the command will search the current directory for one. @@ -631,14 +631,49 @@ - <SLN_FILE> - <SLN_FILE> - + SLN_FILE + <SLN_FILE> + - <PROJECT> - <PROJECT> - + PROJECT + <PROJECT> + + + + Invalid project `{0}`. {1}. + Invalid project `{0}`. {1}. + + + + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + + + + Target framework to publish for. The target framework has to be specified in the project file. + Target framework to publish for. The target framework has to be specified in the project file. + + + + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + + + + Configuration to use for building the project. Default for most projects is "Debug". + Configuration to use for building the project. Default for most projects is "Debug". + + + + Defines the value for the $(VersionSuffix) property in the project. + Defines the value for the $(VersionSuffix) property in the project. + + + + Show help information. + Show help information. + diff --git a/src/dotnet/xlf/CommonLocalizableStrings.pl.xlf b/src/dotnet/xlf/CommonLocalizableStrings.pl.xlf index 1a61576de..72cbea8b2 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.pl.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.pl.xlf @@ -605,10 +605,10 @@ Project `{0}` could not be evaluated. Evaluation failed with following error: -{1} - Nie można ocenić projektu „{0}”. Ocena nie powiodła się z powodu następującego błędu: +{1}. + Nie można ocenić projektu „{0}”. Ocena nie powiodła się z powodu następującego błędu: {1} - + Unsupported project type. Please check with your sdk provider. @@ -616,9 +616,9 @@ - Invalid solution `{0}`. {1} - Nieprawidłowe rozwiązanie „{0}”. {1} - + Invalid solution `{0}`. {1}. + Nieprawidłowe rozwiązanie „{0}”. {1} + The project file to operate on. If a file is not specified, the command will search the current directory for one. @@ -631,14 +631,49 @@ - <SLN_FILE> - <PLIK_SLN> - + SLN_FILE + <PLIK_SLN> + - <PROJECT> - <PROJEKT> - + PROJECT + <PROJEKT> + + + + Invalid project `{0}`. {1}. + Invalid project `{0}`. {1}. + + + + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + + + + Target framework to publish for. The target framework has to be specified in the project file. + Target framework to publish for. The target framework has to be specified in the project file. + + + + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + + + + Configuration to use for building the project. Default for most projects is "Debug". + Configuration to use for building the project. Default for most projects is "Debug". + + + + Defines the value for the $(VersionSuffix) property in the project. + Defines the value for the $(VersionSuffix) property in the project. + + + + Show help information. + Show help information. + diff --git a/src/dotnet/xlf/CommonLocalizableStrings.pt-BR.xlf b/src/dotnet/xlf/CommonLocalizableStrings.pt-BR.xlf index cd3a44cf7..8d5ae91a1 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.pt-BR.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.pt-BR.xlf @@ -605,10 +605,10 @@ Project `{0}` could not be evaluated. Evaluation failed with following error: -{1} - Não foi possível avaliar o projeto "{0}". A avaliação falhou com o seguinte erro: +{1}. + Não foi possível avaliar o projeto "{0}". A avaliação falhou com o seguinte erro: {1} - + Unsupported project type. Please check with your sdk provider. @@ -616,9 +616,9 @@ - Invalid solution `{0}`. {1} - Solução inválida `{0}`. {1} - + Invalid solution `{0}`. {1}. + Solução inválida `{0}`. {1} + The project file to operate on. If a file is not specified, the command will search the current directory for one. @@ -631,14 +631,49 @@ - <SLN_FILE> - <SLN_FILE> - + SLN_FILE + <SLN_FILE> + - <PROJECT> - <PROJECT> - + PROJECT + <PROJECT> + + + + Invalid project `{0}`. {1}. + Invalid project `{0}`. {1}. + + + + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + + + + Target framework to publish for. The target framework has to be specified in the project file. + Target framework to publish for. The target framework has to be specified in the project file. + + + + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + + + + Configuration to use for building the project. Default for most projects is "Debug". + Configuration to use for building the project. Default for most projects is "Debug". + + + + Defines the value for the $(VersionSuffix) property in the project. + Defines the value for the $(VersionSuffix) property in the project. + + + + Show help information. + Show help information. + diff --git a/src/dotnet/xlf/CommonLocalizableStrings.ru.xlf b/src/dotnet/xlf/CommonLocalizableStrings.ru.xlf index 0a5131c1b..e62ba75ea 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.ru.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.ru.xlf @@ -605,10 +605,10 @@ Project `{0}` could not be evaluated. Evaluation failed with following error: -{1} - Не удалось вычислить проект {0}. Сбой вычисления со следующей ошибкой: +{1}. + Не удалось вычислить проект {0}. Сбой вычисления со следующей ошибкой: {1} - + Unsupported project type. Please check with your sdk provider. @@ -616,9 +616,9 @@ - Invalid solution `{0}`. {1} - Решение "{0}" недопустимо. {1} - + Invalid solution `{0}`. {1}. + Решение "{0}" недопустимо. {1} + The project file to operate on. If a file is not specified, the command will search the current directory for one. @@ -631,14 +631,49 @@ - <SLN_FILE> - <ФАЙЛ_SLN> - + SLN_FILE + <ФАЙЛ_SLN> + - <PROJECT> - <ПРОЕКТ> - + PROJECT + <ПРОЕКТ> + + + + Invalid project `{0}`. {1}. + Invalid project `{0}`. {1}. + + + + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + + + + Target framework to publish for. The target framework has to be specified in the project file. + Target framework to publish for. The target framework has to be specified in the project file. + + + + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + + + + Configuration to use for building the project. Default for most projects is "Debug". + Configuration to use for building the project. Default for most projects is "Debug". + + + + Defines the value for the $(VersionSuffix) property in the project. + Defines the value for the $(VersionSuffix) property in the project. + + + + Show help information. + Show help information. + diff --git a/src/dotnet/xlf/CommonLocalizableStrings.tr.xlf b/src/dotnet/xlf/CommonLocalizableStrings.tr.xlf index 567b69b82..ec4107373 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.tr.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.tr.xlf @@ -605,10 +605,10 @@ Project `{0}` could not be evaluated. Evaluation failed with following error: -{1} - `{0}` projesi değerlendirilemedi. Değerlendirme, aşağıdaki hatayla başarısız oldu: +{1}. + `{0}` projesi değerlendirilemedi. Değerlendirme, aşağıdaki hatayla başarısız oldu: {1} - + Unsupported project type. Please check with your sdk provider. @@ -616,9 +616,9 @@ - Invalid solution `{0}`. {1} - `{0}` çözümü geçersiz. {1} - + Invalid solution `{0}`. {1}. + `{0}` çözümü geçersiz. {1} + The project file to operate on. If a file is not specified, the command will search the current directory for one. @@ -631,14 +631,49 @@ - <SLN_FILE> - <SLN_FILE> - + SLN_FILE + <SLN_FILE> + - <PROJECT> - <PROJECT> - + PROJECT + <PROJECT> + + + + Invalid project `{0}`. {1}. + Invalid project `{0}`. {1}. + + + + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + + + + Target framework to publish for. The target framework has to be specified in the project file. + Target framework to publish for. The target framework has to be specified in the project file. + + + + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + + + + Configuration to use for building the project. Default for most projects is "Debug". + Configuration to use for building the project. Default for most projects is "Debug". + + + + Defines the value for the $(VersionSuffix) property in the project. + Defines the value for the $(VersionSuffix) property in the project. + + + + Show help information. + Show help information. + diff --git a/src/dotnet/xlf/CommonLocalizableStrings.xlf b/src/dotnet/xlf/CommonLocalizableStrings.xlf index 2bb5faaa0..3102cade8 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.xlf @@ -485,31 +485,59 @@ Project `{0}` could not be evaluated. Evaluation failed with following error: -{1} - +{1}. + Unsupported project type. Please check with your sdk provider. - + - Invalid solution `{0}`. {1} + Invalid solution `{0}`. {1}. The project file to operate on. If a file is not specified, the command will search the current directory for one. - + Solution file to operate on. If not specified, the command will search the current directory for one. - + - <SLN_FILE> + SLN_FILE - <PROJECT> + PROJECT + + + + Invalid project `{0}`. {1}. + + + + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + + + + Target framework to publish for. The target framework has to be specified in the project file. + + + + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + + + + Configuration to use for building the project. Default for most projects is "Debug". + + + + Defines the value for the $(VersionSuffix) property in the project. + + + + Show help information. diff --git a/src/dotnet/xlf/CommonLocalizableStrings.zh-Hans.xlf b/src/dotnet/xlf/CommonLocalizableStrings.zh-Hans.xlf index d8d611a12..559cea774 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.zh-Hans.xlf @@ -605,10 +605,10 @@ Project `{0}` could not be evaluated. Evaluation failed with following error: -{1} - 无法评估项目“{0}”。评估失败,出现以下错误: +{1}. + 无法评估项目“{0}”。评估失败,出现以下错误: {1} - + Unsupported project type. Please check with your sdk provider. @@ -616,9 +616,9 @@ - Invalid solution `{0}`. {1} - 解决方案“{0}”无效。{1} - + Invalid solution `{0}`. {1}. + 解决方案“{0}”无效。{1} + The project file to operate on. If a file is not specified, the command will search the current directory for one. @@ -631,14 +631,49 @@ - <SLN_FILE> - <SLN_FILE> - + SLN_FILE + <SLN_FILE> + - <PROJECT> - <PROJECT> - + PROJECT + <PROJECT> + + + + Invalid project `{0}`. {1}. + Invalid project `{0}`. {1}. + + + + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + + + + Target framework to publish for. The target framework has to be specified in the project file. + Target framework to publish for. The target framework has to be specified in the project file. + + + + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + + + + Configuration to use for building the project. Default for most projects is "Debug". + Configuration to use for building the project. Default for most projects is "Debug". + + + + Defines the value for the $(VersionSuffix) property in the project. + Defines the value for the $(VersionSuffix) property in the project. + + + + Show help information. + Show help information. + diff --git a/src/dotnet/xlf/CommonLocalizableStrings.zh-Hant.xlf b/src/dotnet/xlf/CommonLocalizableStrings.zh-Hant.xlf index 006fb5116..a0cfe709d 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.zh-Hant.xlf @@ -605,10 +605,10 @@ Project `{0}` could not be evaluated. Evaluation failed with following error: -{1} - 無法評估專案 `{0}`。評估失敗,發生下列錯誤: +{1}. + 無法評估專案 `{0}`。評估失敗,發生下列錯誤: {1} - + Unsupported project type. Please check with your sdk provider. @@ -616,9 +616,9 @@ - Invalid solution `{0}`. {1} - 解決方案 `{0}` 無效。{1} - + Invalid solution `{0}`. {1}. + 解決方案 `{0}` 無效。{1} + The project file to operate on. If a file is not specified, the command will search the current directory for one. @@ -631,14 +631,49 @@ - <SLN_FILE> - <SLN_FILE> - + SLN_FILE + <SLN_FILE> + - <PROJECT> - <PROJECT> - + PROJECT + <PROJECT> + + + + Invalid project `{0}`. {1}. + Invalid project `{0}`. {1}. + + + + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. + + + + Target framework to publish for. The target framework has to be specified in the project file. + Target framework to publish for. The target framework has to be specified in the project file. + + + + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. + + + + Configuration to use for building the project. Default for most projects is "Debug". + Configuration to use for building the project. Default for most projects is "Debug". + + + + Defines the value for the $(VersionSuffix) property in the project. + Defines the value for the $(VersionSuffix) property in the project. + + + + Show help information. + Show help information. + diff --git a/src/redist/redist.csproj b/src/redist/redist.csproj index 0bea23856..88aba73b6 100644 --- a/src/redist/redist.csproj +++ b/src/redist/redist.csproj @@ -21,6 +21,12 @@ + + + + @@ -68,6 +74,14 @@ ProjectPath="$(SrcDirectory)/tool_roslyn/tool_roslyn.csproj" /> + + + + + - - - <_VbcPath Include="$(PublishDir)/**/vbc.exe" /> - - - - - + + AfterTargets="CrossgenPublishDir"> <_AllSdkFiles Include="$(PublishDir)/**/*" /> diff --git a/clean.cmd b/src/tool_fsharp/RunFsc.cmd similarity index 60% rename from clean.cmd rename to src/tool_fsharp/RunFsc.cmd index d6c44845f..3be9b946f 100644 --- a/clean.cmd +++ b/src/tool_fsharp/RunFsc.cmd @@ -1,12 +1,6 @@ -@echo off - -REM Copyright (c) .NET Foundation and contributors. All rights reserved. -REM Licensed under the MIT license. See LICENSE file in the project root for full license information. - -if "%~1"=="" ( - @call run.cmd clean -? - @exit /b 1 -) else ( - @call run.cmd clean %* - @exit /b %ERRORLEVEL% -) +@echo off + +REM Copyright (c) .NET Foundation and contributors. All rights reserved. +REM Licensed under the MIT license. See LICENSE file in the project root for full license information. + +"%~dp0..\..\..\dotnet" "%~dp0fsc.exe" %* diff --git a/clean.sh b/src/tool_fsharp/RunFsc.sh old mode 100755 new mode 100644 similarity index 84% rename from clean.sh rename to src/tool_fsharp/RunFsc.sh index 4f56e5597..5ead81286 --- a/clean.sh +++ b/src/tool_fsharp/RunFsc.sh @@ -13,10 +13,5 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -REPOROOT="$DIR" -if [ "$#" -lt 1 ]; then - "$REPOROOT/run.sh" clean -? -else - "$REPOROOT/run.sh" clean "$@" -fi +"$DIR/../../../dotnet" "$DIR/fsc.exe" "$@" diff --git a/src/tool_fsharp/tool_fsc.csproj b/src/tool_fsharp/tool_fsc.csproj new file mode 100644 index 000000000..ba8924741 --- /dev/null +++ b/src/tool_fsharp/tool_fsc.csproj @@ -0,0 +1,67 @@ + + + + + + $(CliVersionPrefix) + netcoreapp2.0 + true + $(FSharpDirectory) + $(CommitCount) + + + + + + + + + + + PreserveNewest + + + + + + + + + + + + + + + + + + + + + diff --git a/src/tool_roslyn/RunVbc.cmd b/src/tool_roslyn/RunVbc.cmd new file mode 100644 index 000000000..e891b1bf5 --- /dev/null +++ b/src/tool_roslyn/RunVbc.cmd @@ -0,0 +1,6 @@ +@echo off + +REM Copyright (c) .NET Foundation and contributors. All rights reserved. +REM Licensed under the MIT license. See LICENSE file in the project root for full license information. + +"%~dp0..\..\..\dotnet" "%~dp0vbc.exe" %* diff --git a/run.sh b/src/tool_roslyn/RunVbc.sh similarity index 73% rename from run.sh rename to src/tool_roslyn/RunVbc.sh index fd709519d..3dda886a0 100755 --- a/run.sh +++ b/src/tool_roslyn/RunVbc.sh @@ -13,12 +13,5 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -REPOROOT="$DIR" -$DIR/build.sh "--nobuild" - -__toolRuntime=$REPOROOT/build_tools -__dotnet=$__toolRuntime/dotnetcli/dotnet - -echo "Running: $__dotnet $__toolRuntime/run.exe $@" -$__dotnet $__toolRuntime/run.exe $DIR/config.json "$@" +"$DIR/../../../dotnet" "$DIR/vbc.exe" "$@" diff --git a/src/tool_roslyn/tool_roslyn.csproj b/src/tool_roslyn/tool_roslyn.csproj index a33ff9b17..89a201128 100644 --- a/src/tool_roslyn/tool_roslyn.csproj +++ b/src/tool_roslyn/tool_roslyn.csproj @@ -16,23 +16,23 @@ - + - + PreserveNewest PreserveNewest - - - @@ -42,12 +42,19 @@ SectionName="%(AssetsToRemoveFromDeps.SectionName)" AssetPath="%(AssetsToRemoveFromDeps.Identity)" /> - + + + { + SlnFile.Read(tmpFile.Path); + }; + + action.ShouldThrow() + .WithMessage($"Invalid format in line {lineNum}: File header is missing version"); + } + [Theory] [InlineData("Invalid Solution")] - [InlineData("Microsoft Visual Studio Solution File, Format Version ")] + [InlineData("Invalid Solution\nSpanning Multiple Lines")] + [InlineData("Microsoft Visual\nStudio Solution File,\nFormat Version ")] public void WhenGivenASolutionWithMissingHeaderItThrows(string fileContents) { var tmpFile = Temp.CreateFile(); @@ -301,7 +321,7 @@ EndGlobal }; action.ShouldThrow() - .WithMessage("Invalid format in line 1: File header is missing"); + .WithMessage("Expected file header not found"); } [Fact] diff --git a/test/Microsoft.DotNet.Cli.Tests.sln b/test/Microsoft.DotNet.Cli.Tests.sln index ffc08cbd5..370d70331 100644 --- a/test/Microsoft.DotNet.Cli.Tests.sln +++ b/test/Microsoft.DotNet.Cli.Tests.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26228.9 +VisualStudioVersion = 15.0.26419.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-add-reference.Tests", "dotnet-add-reference.Tests\dotnet-add-reference.Tests.csproj", "{AB63A3E5-76A3-4EE9-A380-8E0C7B7644DC}" EndProject @@ -48,8 +48,6 @@ Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Microsoft.DotNet.Cli.Utils. EndProject Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Microsoft.DotNet.Configurer.UnitTests", "Microsoft.DotNet.Configurer.UnitTests\Microsoft.DotNet.Configurer.UnitTests.csproj", "{91CBD27F-5069-4FD2-AC61-15A69D65E202}" EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Microsoft.DotNet.ProjectJsonMigration.Tests", "Microsoft.DotNet.ProjectJsonMigration.Tests\Microsoft.DotNet.ProjectJsonMigration.Tests.csproj", "{4CCE366D-7438-40FB-A868-57D6ACD505BF}" -EndProject Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Microsoft.DotNet.Tools.Tests.Utilities", "Microsoft.DotNet.Tools.Tests.Utilities\Microsoft.DotNet.Tools.Tests.Utilities.csproj", "{D399E9DD-3049-47A2-8BFF-CBE26EACED7E}" EndProject Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Msbuild.Tests.Utilities", "Msbuild.Tests.Utilities\Msbuild.Tests.Utilities.csproj", "{F5A9E29F-B47B-47F4-A25B-BC991DE3369C}" @@ -76,6 +74,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-store.Tests", "dotne EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-back-compat.Tests", "dotnet-back-compat.Tests\dotnet-back-compat.Tests.csproj", "{27351B2F-325B-4843-9F4C-BC53FD06A7B5}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dotnet-remove-package.Tests", "dotnet-remove-package.Tests\dotnet-remove-package.Tests.csproj", "{CF517B15-B307-4660-87D5-CC036ADECD4B}" +EndProject +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.MSBuildSdkResolver.Tests", "Microsoft.DotNet.MSBuildSdkResolver.Tests\Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj", "{42A0CAB4-FFAD-47D4-9880-C0F4EDCF93DE}" EndProject Global @@ -364,18 +365,6 @@ Global {91CBD27F-5069-4FD2-AC61-15A69D65E202}.Release|x64.Build.0 = Release|Any CPU {91CBD27F-5069-4FD2-AC61-15A69D65E202}.Release|x86.ActiveCfg = Release|Any CPU {91CBD27F-5069-4FD2-AC61-15A69D65E202}.Release|x86.Build.0 = Release|Any CPU - {4CCE366D-7438-40FB-A868-57D6ACD505BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4CCE366D-7438-40FB-A868-57D6ACD505BF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4CCE366D-7438-40FB-A868-57D6ACD505BF}.Debug|x64.ActiveCfg = Debug|Any CPU - {4CCE366D-7438-40FB-A868-57D6ACD505BF}.Debug|x64.Build.0 = Debug|Any CPU - {4CCE366D-7438-40FB-A868-57D6ACD505BF}.Debug|x86.ActiveCfg = Debug|Any CPU - {4CCE366D-7438-40FB-A868-57D6ACD505BF}.Debug|x86.Build.0 = Debug|Any CPU - {4CCE366D-7438-40FB-A868-57D6ACD505BF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4CCE366D-7438-40FB-A868-57D6ACD505BF}.Release|Any CPU.Build.0 = Release|Any CPU - {4CCE366D-7438-40FB-A868-57D6ACD505BF}.Release|x64.ActiveCfg = Release|Any CPU - {4CCE366D-7438-40FB-A868-57D6ACD505BF}.Release|x64.Build.0 = Release|Any CPU - {4CCE366D-7438-40FB-A868-57D6ACD505BF}.Release|x86.ActiveCfg = Release|Any CPU - {4CCE366D-7438-40FB-A868-57D6ACD505BF}.Release|x86.Build.0 = Release|Any CPU {D399E9DD-3049-47A2-8BFF-CBE26EACED7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D399E9DD-3049-47A2-8BFF-CBE26EACED7E}.Debug|Any CPU.Build.0 = Debug|Any CPU {D399E9DD-3049-47A2-8BFF-CBE26EACED7E}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -484,18 +473,6 @@ Global {04B21F0F-E645-44E3-868B-3C97E435FB74}.Release|x64.Build.0 = Release|Any CPU {04B21F0F-E645-44E3-868B-3C97E435FB74}.Release|x86.ActiveCfg = Release|Any CPU {04B21F0F-E645-44E3-868B-3C97E435FB74}.Release|x86.Build.0 = Release|Any CPU - {7CA9ECD0-9284-496B-890F-94B63ECB37EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7CA9ECD0-9284-496B-890F-94B63ECB37EC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7CA9ECD0-9284-496B-890F-94B63ECB37EC}.Debug|x64.ActiveCfg = Debug|Any CPU - {7CA9ECD0-9284-496B-890F-94B63ECB37EC}.Debug|x64.Build.0 = Debug|Any CPU - {7CA9ECD0-9284-496B-890F-94B63ECB37EC}.Debug|x86.ActiveCfg = Debug|Any CPU - {7CA9ECD0-9284-496B-890F-94B63ECB37EC}.Debug|x86.Build.0 = Debug|Any CPU - {7CA9ECD0-9284-496B-890F-94B63ECB37EC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7CA9ECD0-9284-496B-890F-94B63ECB37EC}.Release|Any CPU.Build.0 = Release|Any CPU - {7CA9ECD0-9284-496B-890F-94B63ECB37EC}.Release|x64.ActiveCfg = Release|Any CPU - {7CA9ECD0-9284-496B-890F-94B63ECB37EC}.Release|x64.Build.0 = Release|Any CPU - {7CA9ECD0-9284-496B-890F-94B63ECB37EC}.Release|x86.ActiveCfg = Release|Any CPU - {7CA9ECD0-9284-496B-890F-94B63ECB37EC}.Release|x86.Build.0 = Release|Any CPU {27351B2F-325B-4843-9F4C-BC53FD06A7B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {27351B2F-325B-4843-9F4C-BC53FD06A7B5}.Debug|Any CPU.Build.0 = Debug|Any CPU {27351B2F-325B-4843-9F4C-BC53FD06A7B5}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -508,6 +485,18 @@ Global {27351B2F-325B-4843-9F4C-BC53FD06A7B5}.Release|x64.Build.0 = Release|Any CPU {27351B2F-325B-4843-9F4C-BC53FD06A7B5}.Release|x86.ActiveCfg = Release|Any CPU {27351B2F-325B-4843-9F4C-BC53FD06A7B5}.Release|x86.Build.0 = Release|Any CPU + {CF517B15-B307-4660-87D5-CC036ADECD4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CF517B15-B307-4660-87D5-CC036ADECD4B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CF517B15-B307-4660-87D5-CC036ADECD4B}.Debug|x64.ActiveCfg = Debug|x64 + {CF517B15-B307-4660-87D5-CC036ADECD4B}.Debug|x64.Build.0 = Debug|x64 + {CF517B15-B307-4660-87D5-CC036ADECD4B}.Debug|x86.ActiveCfg = Debug|x86 + {CF517B15-B307-4660-87D5-CC036ADECD4B}.Debug|x86.Build.0 = Debug|x86 + {CF517B15-B307-4660-87D5-CC036ADECD4B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CF517B15-B307-4660-87D5-CC036ADECD4B}.Release|Any CPU.Build.0 = Release|Any CPU + {CF517B15-B307-4660-87D5-CC036ADECD4B}.Release|x64.ActiveCfg = Release|x64 + {CF517B15-B307-4660-87D5-CC036ADECD4B}.Release|x64.Build.0 = Release|x64 + {CF517B15-B307-4660-87D5-CC036ADECD4B}.Release|x86.ActiveCfg = Release|x86 + {CF517B15-B307-4660-87D5-CC036ADECD4B}.Release|x86.Build.0 = Release|x86 {42A0CAB4-FFAD-47D4-9880-C0F4EDCF93DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {42A0CAB4-FFAD-47D4-9880-C0F4EDCF93DE}.Debug|Any CPU.Build.0 = Debug|Any CPU {42A0CAB4-FFAD-47D4-9880-C0F4EDCF93DE}.Debug|x64.ActiveCfg = Debug|Any CPU diff --git a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenAnMSBuildSdkResolver.cs b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenAnMSBuildSdkResolver.cs index bfbf14e4a..ad98825b5 100644 --- a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenAnMSBuildSdkResolver.cs +++ b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenAnMSBuildSdkResolver.cs @@ -1,17 +1,21 @@ // 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 FluentAssertions; using Microsoft.Build.Framework; +using Microsoft.DotNet.MSBuildSdkResolver; +using Microsoft.DotNet.Tools.Test.Utilities; +using System.Collections.Generic; +using System.IO; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; using Xunit; -using System.Linq; using Xunit.Abstractions; using System; -using Microsoft.DotNet.MSBuildSdkResolver; namespace Microsoft.DotNet.Cli.Utils.Tests { - public class GivenAnMSBuildSdkResolver + public class GivenAnMSBuildSdkResolver : TestBase { private ITestOutputHelper _logger; @@ -30,29 +34,166 @@ namespace Microsoft.DotNet.Cli.Utils.Tests } [Fact] - public void ItCallsNativeCodeWithoutCrashing() // WIP: placeholder to get plumbing through + public void ItFindsTheVersionSpecifiedInGlobalJson() { - var resolver = new DotNetMSBuildSdkResolver(); + var environment = new TestEnvironment(); + environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "99.99.97"); + var expected = environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "99.99.98"); + environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "99.99.99"); + environment.CreateGlobalJson(environment.TestDirectory, "99.99.98"); + environment.CreateMuxerAndAddToPath(ProgramFiles.X64); + + var resolver = environment.CreateResolver(); var result = (MockResult)resolver.Resolve( - new SdkReference("Microsoft.NET.Sdk", null, null), - new MockContext(), + new SdkReference("Some.Test.Sdk", null, null), + new MockContext { ProjectFilePath = environment.TestDirectory.FullName }, new MockFactory()); - _logger.WriteLine($"success: {result.Success}"); - _logger.WriteLine($"errors: {string.Join(Environment.NewLine, result.Errors ?? Array.Empty())}"); - _logger.WriteLine($"warnings: {string.Join(Environment.NewLine, result.Warnings ?? Array.Empty())}"); - _logger.WriteLine($"path: {result.Path}"); - _logger.WriteLine($"version: {result.Version}"); + result.Success.Should().BeTrue(); + result.Path.Should().Be(expected.FullName); + result.Version.Should().Be("99.99.98"); + result.Warnings.Should().BeNullOrEmpty(); + result.Errors.Should().BeNullOrEmpty(); + } + + [Fact] + public void ItReturnsNullIfTheVersionFoundDoesNotSatisfyTheMinVersion() + { + var environment = new TestEnvironment(); + environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "99.99.99"); + environment.CreateMuxerAndAddToPath(ProgramFiles.X64); + + var resolver = environment.CreateResolver(); + var result = (MockResult)resolver.Resolve( + new SdkReference("Some.Test.Sdk", null, "999.99.99"), + new MockContext { ProjectFilePath = environment.TestDirectory.FullName }, + new MockFactory()); + + result.Success.Should().BeFalse(); + result.Path.Should().BeNull(); + result.Version.Should().BeNull(); + result.Warnings.Should().BeNullOrEmpty(); + result.Errors.Should().Contain("Version 99.99.99 of the SDK is smaller than the minimum version 999.99.99" + + " requested. Check that a recent enough .NET Core SDK is installed, increase the minimum version" + + " specified in the project, or increase the version specified in global.json."); + } + + [Fact] + public void ItReturnsTheVersionIfItIsEqualToTheMinVersion() + { + var environment = new TestEnvironment(); + var expected = environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "99.99.99"); + environment.CreateMuxerAndAddToPath(ProgramFiles.X64); + + var resolver = environment.CreateResolver(); + var result = (MockResult)resolver.Resolve( + new SdkReference("Some.Test.Sdk", null, "99.99.99"), + new MockContext { ProjectFilePath = environment.TestDirectory.FullName }, + new MockFactory()); + + result.Success.Should().BeTrue(); + result.Path.Should().Be(expected.FullName); + result.Version.Should().Be("99.99.99"); + result.Warnings.Should().BeNullOrEmpty(); + result.Errors.Should().BeNullOrEmpty(); + } + + [Fact] + public void ItReturnsTheVersionIfItIsHigherThanTheMinVersion() + { + var environment = new TestEnvironment(); + var expected = environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "999.99.99"); + environment.CreateMuxerAndAddToPath(ProgramFiles.X64); + + var resolver = environment.CreateResolver(); + var result = (MockResult)resolver.Resolve( + new SdkReference("Some.Test.Sdk", null, "99.99.99"), + new MockContext { ProjectFilePath = environment.TestDirectory.FullName }, + new MockFactory()); + + result.Success.Should().BeTrue(); + result.Path.Should().Be(expected.FullName); + result.Version.Should().Be("999.99.99"); + result.Warnings.Should().BeNullOrEmpty(); + result.Errors.Should().BeNullOrEmpty(); + } + + private enum ProgramFiles + { + X64, + X86, + Default, + } + + private sealed class TestEnvironment : SdkResolverContext + { + public string Muxer => RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet"; + + public string PathEnvironmentVariable { get; set; } + + public DirectoryInfo TestDirectory { get; } + + public TestEnvironment(string identifier = "", [CallerMemberName] string callingMethod = "") + { + TestDirectory = TestAssets.CreateTestDirectory( + "temp", + identifier: identifier, + callingMethod: callingMethod); + + PathEnvironmentVariable = string.Empty; + } + + public SdkResolver CreateResolver() + => new DotNetMSBuildSdkResolver(GetEnvironmentVariable); + + public DirectoryInfo GetSdkDirectory(ProgramFiles programFiles, string sdkName, string sdkVersion) + => TestDirectory.GetDirectory(GetProgramFilesDirectory(programFiles).FullName, "dotnet", "sdk", sdkVersion, "Sdks", sdkName, "Sdk"); + + public DirectoryInfo GetProgramFilesDirectory(ProgramFiles programFiles) + => TestDirectory.GetDirectory($"ProgramFiles{programFiles}"); + + public DirectoryInfo CreateSdkDirectory(ProgramFiles programFiles, string sdkVersion, string sdkName) + { + var dir = GetSdkDirectory(programFiles, sdkVersion, sdkName); + dir.Create(); + return dir; + } + + public void CreateMuxerAndAddToPath(ProgramFiles programFiles) + { + var muxerDirectory = TestDirectory.GetDirectory(GetProgramFilesDirectory(programFiles).FullName, "dotnet"); + + new FileInfo(Path.Combine(muxerDirectory.FullName, Muxer)).Create(); + + PathEnvironmentVariable = $"{muxerDirectory}{Path.PathSeparator}{PathEnvironmentVariable}"; + } + + public void CreateGlobalJson(DirectoryInfo directory, string version) + => File.WriteAllText(directory.GetFile("global.json").FullName, + $@"{{ ""sdk"": {{ ""version"": ""{version}"" }} }}"); + + public string GetEnvironmentVariable(string variable) + { + switch (variable) + { + case "PATH": + return PathEnvironmentVariable; + default: + return null; + } + } } private sealed class MockContext : SdkResolverContext { + public new string ProjectFilePath { get => base.ProjectFilePath; set => base.ProjectFilePath = value; } + public new string SolutionFilePath { get => base.SolutionFilePath; set => base.SolutionFilePath = value; } } private sealed class MockFactory : SdkResultFactory { public override SdkResult IndicateFailure(IEnumerable errors, IEnumerable warnings = null) - => new MockResult { Success = false, Errors = errors, Warnings = warnings }; + => new MockResult { Success = false, Errors = errors, Warnings = warnings }; public override SdkResult IndicateSuccess(string path, string version, IEnumerable warnings = null) => new MockResult { Success = true, Path = path, Version = version, Warnings = warnings }; diff --git a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenThatIWantToCompareSemanticVersions.cs b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenThatIWantToCompareSemanticVersions.cs new file mode 100644 index 000000000..d7554ef2b --- /dev/null +++ b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenThatIWantToCompareSemanticVersions.cs @@ -0,0 +1,35 @@ +// 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 Xunit; +using Microsoft.DotNet.MSBuildSdkResolver; +using FluentAssertions; + +namespace Microsoft.DotNet.Cli.Utils.Tests +{ + public class GivenThatWeWantToCompareFXVersions + { + [Theory] + [InlineData("2.0.0", "1.0.0", 1)] + [InlineData("1.1.0", "1.0.0", 1)] + [InlineData("1.0.1", "1.0.0", 1)] + [InlineData("1.0.0", "1.0.0-pre", 1)] + [InlineData("1.0.0-pre+2", "1.0.0-pre+1", 1)] + [InlineData("1.0.0", "2.0.0", -1)] + [InlineData("1.0.0", "1.1.0", -1)] + [InlineData("1.0.0", "1.0.1", -1)] + [InlineData("1.0.0-pre", "1.0.0", -1)] + [InlineData("1.0.0-pre+1", "1.0.0-pre+2", -1)] + [InlineData("1.2.3", "1.2.3", 0)] + [InlineData("1.2.3-pre", "1.2.3-pre", 0)] + [InlineData("1.2.3-pre+1", "1.2.3-pre+1", 0)] + public void OneFXVersionIsBiggerThanTheOther(string s1, string s2, int expectedResult) + { + FXVersion fxVersion1; + FXVersion fxVersion2; + FXVersion.TryParse(s1, out fxVersion1); + FXVersion.TryParse(s2, out fxVersion2); + FXVersion.Compare(fxVersion1, fxVersion2).Should().Be(expectedResult); + } + } +} \ No newline at end of file diff --git a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenThatWeWantToParseSemanticVersions.cs b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenThatWeWantToParseSemanticVersions.cs new file mode 100644 index 000000000..1ade1399f --- /dev/null +++ b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenThatWeWantToParseSemanticVersions.cs @@ -0,0 +1,89 @@ +// 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 Xunit; +using Microsoft.DotNet.MSBuildSdkResolver; +using FluentAssertions; + +namespace Microsoft.DotNet.Cli.Utils.Tests +{ + public class GivenThatWeWantToParseFXVersions + { + [Fact] + public void ReturnsNullWhenNoMajorSeparatorIsFound() + { + FXVersion fxVersion; + FXVersion.TryParse("1", out fxVersion).Should().BeFalse(); + } + + [Fact] + public void ReturnsNullWhenMajorPortionIsNotANumber() + { + FXVersion fxVersion; + FXVersion.TryParse("a.0.0", out fxVersion).Should().BeFalse(); + } + + [Fact] + public void ReturnsNullWhenNoMinorSeparatorIsFound() + { + FXVersion fxVersion; + FXVersion.TryParse("1.0", out fxVersion).Should().BeFalse(); + } + + [Fact] + public void ReturnsNullWhenMinorPortionIsNotANumber() + { + FXVersion fxVersion; + FXVersion.TryParse("1.a.0", out fxVersion).Should().BeFalse(); + } + + [Fact] + public void ReturnsNullWhenPatchPortionIsNotANumber() + { + FXVersion fxVersion; + FXVersion.TryParse("1.0.a", out fxVersion).Should().BeFalse(); + } + + [Fact] + public void ReturnsFXVersionWhenOnlyMajorMinorPatchIsFound() + { + FXVersion fxVersion; + + var result = FXVersion.TryParse("1.2.3", out fxVersion); + + result.Should().BeTrue(); + fxVersion.Major.Should().Be(1); + fxVersion.Minor.Should().Be(2); + fxVersion.Patch.Should().Be(3); + } + + [Fact] + public void ReturnsFXVersionWhenOnlyMajorMinorPatchAndPreIsFound() + { + FXVersion fxVersion; + + var result = FXVersion.TryParse("1.2.3-pre", out fxVersion); + + result.Should().BeTrue(); + fxVersion.Major.Should().Be(1); + fxVersion.Minor.Should().Be(2); + fxVersion.Patch.Should().Be(3); + fxVersion.Pre.Should().Be("-pre"); + } + + [Fact] + public void ReturnsFXVersionWhenMajorMinorPatchAndPreAndBuildIsFound() + { + FXVersion fxVersion; + + var result = FXVersion.TryParse("1.2.3-pre+build", out fxVersion); + + result.Should().BeTrue(); + fxVersion.Major.Should().Be(1); + fxVersion.Minor.Should().Be(2); + fxVersion.Patch.Should().Be(3); + fxVersion.Pre.Should().Be("-pre"); + fxVersion.Build.Should().Be("build"); + } + } +} \ No newline at end of file diff --git a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj index bfc8f571a..a21bb4731 100644 --- a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj +++ b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj @@ -2,8 +2,8 @@ - net46;$(CliTargetFramework) - $(CliTargetFramework) + + $(CliTargetFramework) $(CLI_SharedFrameworkVersion) Exe ../../tools/Key.snk @@ -13,6 +13,7 @@ + @@ -27,4 +28,12 @@ + + + + + + + + diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/GivenAProjectMigrator.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/GivenAProjectMigrator.cs deleted file mode 100644 index f61bebe43..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/GivenAProjectMigrator.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; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using FluentAssertions; -using Microsoft.Build.Construction; -using Microsoft.DotNet.ProjectJsonMigration.Rules; -using Microsoft.DotNet.Internal.ProjectModel; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Common; -using Microsoft.DotNet.Tools.Test.Utilities; -using NuGet.Frameworks; -using Xunit; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenAProjectMigrator : TestBase - { - [Fact] - public void ItCopiesProjectDirectoryContentsToOutputDirectoryWhenTheDirectoriesAreDifferent() - { - var testProjectDirectory = TestAssets.Get("PJTestAppSimple") - .CreateInstance(callingMethod: "z") - .WithSourceFiles().Root.FullName; - - var outputDirectory = Temp.CreateDirectory().Path; - - var projectDirectoryRelativeFilePaths = EnumerateFilesWithRelativePath(testProjectDirectory); - - var mockProj = ProjectRootElement.Create(); - var testSettings = MigrationSettings.CreateMigrationSettingsTestHook(testProjectDirectory, outputDirectory, mockProj); - - var projectMigrator = new ProjectMigrator(new FakeEmptyMigrationRule()); - projectMigrator.Migrate(testSettings); - - foreach (var projectDirectoryRelativeFilePath in projectDirectoryRelativeFilePaths) - { - File.Exists(Path.Combine(outputDirectory, projectDirectoryRelativeFilePath)).Should().BeTrue(); - } - } - - [Fact] - public void ItHasWarningWhenMigratingADeprecatedProjectJson() - { - var testProjectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedCompile") - .CreateInstance() - .WithSourceFiles() - .Root - .GetDirectory("project") - .FullName; - - var mockProj = ProjectRootElement.Create(); - var testSettings = MigrationSettings.CreateMigrationSettingsTestHook( - testProjectDirectory, - testProjectDirectory, - mockProj); - - var projectMigrator = new ProjectMigrator(new FakeEmptyMigrationRule()); - var report = projectMigrator.Migrate(testSettings); - - var projectReport = report.ProjectMigrationReports.First(); - var warningMessage = projectReport.Warnings.First(); - warningMessage.Should().Contain("MIGRATE1011::Deprecated Project:"); - warningMessage.Should().Contain("The 'compile' option is deprecated. Use 'compile' in 'buildOptions' instead. (line: 3, file:"); - } - - [Fact] - public void ItHasErrorWhenMigratingADeprecatedNamedResourceOptionProjectJson() - { - var testProjectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedNamedResource") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var mockProj = ProjectRootElement.Create(); - var testSettings = MigrationSettings.CreateMigrationSettingsTestHook( - testProjectDirectory, - testProjectDirectory, - mockProj); - - var projectMigrator = new ProjectMigrator(new FakeEmptyMigrationRule()); - var report = projectMigrator.Migrate(testSettings); - - var projectReport = report.ProjectMigrationReports.First(); - var errorMessage = projectReport.Errors.First().GetFormattedErrorMessage(); - errorMessage.Should().Contain("MIGRATE1011::Deprecated Project:"); - errorMessage.Should().Contain("The 'namedResource' option is deprecated. Use 'embed' in 'buildOptions' instead. (line: 3, file:"); - } - - [Fact] - public void ItHasErrorWhenMigratingANonCsharpApp() - { - var testProjectDirectory = TestAssets.Get("FSharpTestProjects") - .CreateInstance(callingMethod: "z") - .WithSourceFiles() - .Root.GetDirectory("TestApp").FullName; - - var mockProj = ProjectRootElement.Create(); - var testSettings = MigrationSettings.CreateMigrationSettingsTestHook(testProjectDirectory, testProjectDirectory, mockProj); - - var projectMigrator = new ProjectMigrator(new FakeEmptyMigrationRule()); - var report = projectMigrator.Migrate(testSettings); - var projectReport = report.ProjectMigrationReports.First(); - - var errorMessage = projectReport.Errors.First().GetFormattedErrorMessage(); - errorMessage.Should().Contain("MIGRATE20013::Non-Csharp App: Cannot migrate project"); - } - - [Fact] - public void ItHasErrorWhenMigratingAProjectJsonWithoutAFrameworks() - { - var testInstance = TestAssets.Get( - "NonRestoredTestProjects", - "TestLibraryWithProjectFileWithoutFrameworks") - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - var mockProj = ProjectRootElement.Create(); - var testSettings = MigrationSettings.CreateMigrationSettingsTestHook( - testProjectDirectory, - testProjectDirectory, - mockProj); - - var projectMigrator = new ProjectMigrator(new FakeEmptyMigrationRule()); - var report = projectMigrator.Migrate(testSettings); - - var projectReport = report.ProjectMigrationReports.First(); - - projectReport.Errors.First().GetFormattedErrorMessage() - .Should().Contain("MIGRATE1013::No Project:") - .And.Contain($"The project.json specifies no target frameworks in {testProjectDirectory}"); - } - - private IEnumerable EnumerateFilesWithRelativePath(string testProjectDirectory) - { - return - Directory.EnumerateFiles(testProjectDirectory, "*", SearchOption.AllDirectories) - .Select(file => PathUtility.GetRelativePath(testProjectDirectory, file)); - } - - private class FakeEmptyMigrationRule : IMigrationRule - { - public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs) - { - return; - } - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/GivenMSBuildExtensions.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/GivenMSBuildExtensions.cs deleted file mode 100644 index 70ed3f562..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/GivenMSBuildExtensions.cs +++ /dev/null @@ -1,266 +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.Linq; -using FluentAssertions; -using Microsoft.Build.Construction; -using Xunit; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenMSBuildExtensions - { - [Fact] - public void ConditionChain_is_empty_when_element_and_parents_have_no_condition() - { - var project = ProjectRootElement.Create(); - var itemGroup = project.AddItemGroup(); - - var item1 = itemGroup.AddItem("test", "include1"); - - item1.ConditionChain().Should().HaveCount(0); - } - - [Fact] - public void ConditionChain_has_parent_conditions_when_element_is_empty() - { - var project = ProjectRootElement.Create(); - var itemGroup = project.AddItemGroup(); - itemGroup.Condition = "condition"; - - var item1 = itemGroup.AddItem("test", "include1"); - - item1.ConditionChain().Should().HaveCount(1); - item1.ConditionChain().First().Should().Be("condition"); - } - - [Fact] - public void ConditionChain_has_element_and_parent_conditions_when_they_exist() - { - var project = ProjectRootElement.Create(); - var itemGroup = project.AddItemGroup(); - itemGroup.Condition = "itemGroup"; - - var item1 = itemGroup.AddItem("test", "include1"); - item1.Condition = "item"; - - item1.ConditionChain().Should().HaveCount(2); - item1.ConditionChain().Should().BeEquivalentTo("itemGroup", "item"); - } - - [Fact] - public void ConditionChainsAreEquivalent_is_true_when_neither_element_or_parents_have_conditions() - { - var project = ProjectRootElement.Create(); - var itemGroup = project.AddItemGroup(); - - var item1 = itemGroup.AddItem("test", "include1"); - var item2 = itemGroup.AddItem("test", "include2"); - - item1.ConditionChainsAreEquivalent(item2).Should().BeTrue(); - } - - [Fact] - public void ConditionChainsAreEquivalent_is_true_when_elements_have_the_same_condition() - { - var project = ProjectRootElement.Create(); - var itemGroup = project.AddItemGroup(); - - var item1 = itemGroup.AddItem("test", "include1"); - var item2 = itemGroup.AddItem("test", "include2"); - item1.Condition = "item"; - item2.Condition = "item"; - - item1.ConditionChainsAreEquivalent(item2).Should().BeTrue(); - } - - [Fact] - public void ConditionChainsAreEquivalent_is_true_when_element_condition_matches_condition_of_other_element_parent() - { - var project = ProjectRootElement.Create(); - var itemGroup1 = project.AddItemGroup(); - var itemGroup2 = project.AddItemGroup(); - itemGroup1.Condition = "item"; - - var item1 = itemGroup1.AddItem("test", "include1"); - var item2 = itemGroup2.AddItem("test", "include2"); - item2.Condition = "item"; - - item1.ConditionChainsAreEquivalent(item2).Should().BeTrue(); - } - - [Fact] - public void ConditionChainsAreEquivalent_is_false_when_elements_have_different_conditions() - { - var project = ProjectRootElement.Create(); - var itemGroup = project.AddItemGroup(); - - var item1 = itemGroup.AddItem("test", "include1"); - var item2 = itemGroup.AddItem("test", "include2"); - item1.Condition = "item"; - item2.Condition = "item2"; - - item1.ConditionChainsAreEquivalent(item2).Should().BeFalse(); - } - - [Fact] - public void ConditionChainsAreEquivalent_is_false_when_other_element_parent_has_a_condition() - { - var project = ProjectRootElement.Create(); - var itemGroup1 = project.AddItemGroup(); - var itemGroup2 = project.AddItemGroup(); - itemGroup1.Condition = "item"; - - var item1 = itemGroup1.AddItem("test", "include1"); - var item2 = itemGroup2.AddItem("test", "include2"); - - item1.ConditionChainsAreEquivalent(item2).Should().BeFalse(); - } - - [Fact] - public void ConditionChainsAreEquivalent_is_false_when_both_element_parent_conditions_dont_match() - { - var project = ProjectRootElement.Create(); - var itemGroup1 = project.AddItemGroup(); - var itemGroup2 = project.AddItemGroup(); - itemGroup1.Condition = "item"; - itemGroup2.Condition = "item2"; - - var item1 = itemGroup1.AddItem("test", "include1"); - var item2 = itemGroup2.AddItem("test", "include2"); - - item1.ConditionChainsAreEquivalent(item2).Should().BeFalse(); - } - - [Fact] - public void GetMetadataWithName_is_case_insensitive() - { - var project = ProjectRootElement.Create(); - var item1 = project.AddItem("test", "include1"); - item1.AddMetadata("name", "value"); - - item1.GetMetadataWithName("Name").Should().NotBeNull(); - item1.GetMetadataWithName("Name").Value.Should().Be("value"); - } - - [Fact] - public void Includes_returns_include_value_split_by_semicolon() - { - var project = ProjectRootElement.Create(); - var item = project.CreateItemElement("test"); - item.Include = "include1;include2;aaa"; - - var includes = item.Includes().ToArray(); - - includes.Should().HaveCount(3); - includes[0].Should().Be("include1"); - includes[1].Should().Be("include2"); - includes[2].Should().Be("aaa"); - } - - [Fact] - public void Excludes_returns_include_value_split_by_semicolon() - { - var project = ProjectRootElement.Create(); - var item = project.CreateItemElement("test"); - item.Exclude = "include1;include2;aaa"; - - var excludes = item.Excludes().ToArray(); - - excludes.Should().HaveCount(3); - excludes[0].Should().Be("include1"); - excludes[1].Should().Be("include2"); - excludes[2].Should().Be("aaa"); - } - - [Fact] - public void ItemsWithoutConditions_returns_items_without_a_condition() - { - var project = ProjectRootElement.Create(); - var item = project.AddItem("test", "include1"); - - project.ItemsWithoutConditions().Count().Should().Be(1); - project.ItemsWithoutConditions().First().Should().Be(item); - } - - [Fact] - public void ItemsWithoutConditions_doesnt_return_items_with_a_condition() - { - var project = ProjectRootElement.Create(); - var conditionlessItems = project.AddItem("test", "include1"); - var conditionItem = project.AddItem("test2", "include2"); - conditionItem.Condition = "SomeCondition"; - - project.ItemsWithoutConditions().Count().Should().Be(1); - project.ItemsWithoutConditions().First().Should().Be(conditionlessItems); - } - - [Fact] - public void ItemsWithoutConditions_doesnt_return_items_with_a_parent_with_a_condition() - { - var project = ProjectRootElement.Create(); - var conditionlessItems = project.AddItem("test", "include1"); - - var conditionItemGroup = project.AddItemGroup(); - conditionItemGroup.Condition = "SomeCondition"; - conditionItemGroup.AddItem("test2", "include2"); - - project.ItemsWithoutConditions().Count().Should().Be(1); - project.ItemsWithoutConditions().First().Should().Be(conditionlessItems); - } - - [Fact] - public void AddIncludes_merges_include_sets() - { - var project = ProjectRootElement.Create(); - var item1 = project.AddItem("test", "include1;include2"); - item1.UnionIncludes(new string[] {"include2", "include3"}); - - item1.Include.Should().Be("include1;include2;include3"); - } - - [Fact] - public void AddExcludes_merges_include_sets() - { - var project = ProjectRootElement.Create(); - var item1 = project.AddItem("test", "include1"); - item1.Exclude = "exclude1;exclude2"; - item1.UnionExcludes(new string[] {"exclude2", "exclude3"}); - - item1.Exclude.Should().Be("exclude1;exclude2;exclude3"); - } - - [Fact] - public void AddMetadata_adds_metadata_available_via_Metadata_on_an_item() - { - var project = ProjectRootElement.Create(); - var item1 = project.AddItem("test", "include1"); - item1.AddMetadata("name", "value"); - item1.HasMetadata.Should().BeTrue(); - - var item2 = project.AddItem("test1", "include1"); - item2.AddMetadata(item1.Metadata); - - item2.HasMetadata.Should().BeTrue(); - item2.Metadata.First().Name.Should().Be("name"); - item2.Metadata.First().Value.Should().Be("value"); - } - - [Fact] - public void AddMetadata_adds_metadata_from_an_item_generated_from_another_project() - { - var project = ProjectRootElement.Create(); - var item1 = project.AddItem("test", "include1"); - item1.AddMetadata("name", "value"); - item1.HasMetadata.Should().BeTrue(); - - var project2 = ProjectRootElement.Create(); - var item2 = project2.AddItem("test1", "include1"); - item2.AddMetadata(item1.Metadata); - - item2.HasMetadata.Should().BeTrue(); - item2.Metadata.First().Name.Should().Be("name"); - item2.Metadata.First().Value.Should().Be("value"); - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/MSBuild.exe b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/MSBuild.exe deleted file mode 100644 index 2b4d0f999..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/MSBuild.exe +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 \ No newline at end of file diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/MSBuild.exe.config b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/MSBuild.exe.config deleted file mode 100644 index 2b4d0f999..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/MSBuild.exe.config +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 \ No newline at end of file diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/MigrationBackupPlanTests.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/MigrationBackupPlanTests.cs deleted file mode 100644 index 227cef562..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/MigrationBackupPlanTests.cs +++ /dev/null @@ -1,137 +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 FluentAssertions; -using Microsoft.DotNet.Internal.ProjectModel.Utilities; -using Microsoft.DotNet.ProjectJsonMigration; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Xunit; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public partial class MigrationBackupPlanTests - { - [Fact] - public void TheBackupDirectoryIsASubfolderOfTheMigratedProject() - { - var workspaceDirectory = Path.Combine("src", "root"); - var projectDirectory = Path.Combine("src", "project1"); - - WhenMigrating(projectDirectory, workspaceDirectory) - .RootBackupDirectory - .FullName - .Should() - .Be(new DirectoryInfo(Path.Combine("src", "project1", "backup")).FullName.EnsureTrailingSlash()); - } - - [Fact] - public void TheBackupDirectoryIsASubfolderOfTheMigratedProjectWhenInitiatedFromProjectFolder() - { - var workspaceDirectory = Path.Combine("src", "root"); - var projectDirectory = Path.Combine("src", "root"); - - WhenMigrating(projectDirectory, workspaceDirectory) - .ProjectBackupDirectories.Single() - .FullName - .Should() - .Be(new DirectoryInfo(Path.Combine("src", "root", "backup")).FullName.EnsureTrailingSlash()); - } - - [Fact] - public void TheBackupDirectoryIsInTheCommonRootOfTwoProjectFoldersWhenInitiatedFromProjectFolder() - { - var projectDirectories = new [] - { - Path.Combine("root", "project1"), - Path.Combine("root", "project2") - }; - - var workspaceDirectory = Path.Combine("root", "project1"); - - WhenMigrating(projectDirectories, workspaceDirectory) - .RootBackupDirectory - .FullName - .Should() - .Be(new DirectoryInfo(Path.Combine("root", "backup")).FullName.EnsureTrailingSlash()); - } - - [Fact] - public void TheBackupDirectoryIsInTheCommonRootOfTwoProjectFoldersWhenInitiatedFromCommonRoot() - { - var projectDirectories = new [] - { - Path.Combine("root", "project1"), - Path.Combine("root", "project2") - }; - - var workspaceDirectory = Path.Combine("root"); - - WhenMigrating(projectDirectories, workspaceDirectory) - .RootBackupDirectory - .FullName - .Should() - .Be(new DirectoryInfo(Path.Combine("root", "backup")).FullName.EnsureTrailingSlash()); - } - - [Fact] - public void TheBackupDirectoryIsInTheCommonRootOfTwoProjectFoldersAtDifferentLevelsWhenInitiatedFromProjectFolder() - { - var projectDirectories = new [] - { - Path.Combine("root", "tests", "inner", "project1"), - Path.Combine("root", "src", "project2") - }; - - var workspaceDirectory = Path.Combine("root", "tests", "inner"); - - WhenMigrating(projectDirectories, workspaceDirectory) - .RootBackupDirectory - .FullName - .Should() - .Be(new DirectoryInfo(Path.Combine("root", "backup")).FullName.EnsureTrailingSlash()); - } - - [Fact] - public void FilesToBackUpAreIdentifiedInTheRootProjectDirectory() - { - var workspaceDirectory = Path.Combine("src", "root"); - var projectDirectory = Path.Combine("src", "root"); - - var whenMigrating = WhenMigrating(projectDirectory, workspaceDirectory); - - whenMigrating - .FilesToMove(whenMigrating.ProjectBackupDirectories.Single()) - .Should() - .Contain(_ => _.FullName == Path.Combine(new DirectoryInfo(workspaceDirectory).FullName, "project.json")); - } - - [Fact] - public void FilesToBackUpAreIdentifiedInTheDependencyProjectDirectory() - { - var workspaceDirectory = Path.Combine("src", "root"); - var projectDirectory = Path.Combine("src", "root"); - - var whenMigrating = WhenMigrating(projectDirectory, workspaceDirectory); - - whenMigrating - .FilesToMove(whenMigrating.ProjectBackupDirectories.Single()) - .Should() - .Contain(_ => _.FullName == Path.Combine(new DirectoryInfo(projectDirectory).FullName, "project.json")); - } - - private MigrationBackupPlan WhenMigrating(string projectDirectory, string workspaceDirectory) => - new MigrationBackupPlan( - new [] { new DirectoryInfo(projectDirectory) }, - new DirectoryInfo(workspaceDirectory), - dir => new [] { new FileInfo(Path.Combine(dir.FullName, "project.json")) }); - - private MigrationBackupPlan WhenMigrating(string[] projectDirectories, string workspaceDirectory) => - new MigrationBackupPlan( - projectDirectories.Select(p => new DirectoryInfo(p)), - new DirectoryInfo(workspaceDirectory), - dir => new [] { new FileInfo(Path.Combine(dir.FullName, "project.json")) }); - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/ProjectJsonBuilder.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/ProjectJsonBuilder.cs deleted file mode 100644 index ccf82f40a..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/ProjectJsonBuilder.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 Microsoft.DotNet.TestFramework; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - /// - /// Used to build up test scenario project.jsons without needing to add a new test asset. - /// - public class ProjectJsonBuilder - { - private readonly TestAssets _testAssets; - private JObject _projectJson; - - private bool _baseDefined = false; - - public ProjectJsonBuilder(TestAssets testAssets) - { - _testAssets = testAssets; - } - - public string SaveToDisk(string outputDirectory) - { - EnsureBaseIsSet(); - - var projectPath = Path.Combine(outputDirectory, "project.json"); - File.WriteAllText(projectPath, _projectJson.ToString()); - return projectPath; - } - - public JObject Build() - { - EnsureBaseIsSet(); - return _projectJson; - } - - public ProjectJsonBuilder FromTestAssetBase(string testAssetName) - { - var testProjectDirectory = _testAssets.Get(testAssetName) - .CreateInstance() - .WithSourceFiles() - .Root.FullName; - var testProject = Path.Combine(testProjectDirectory, "project.json"); - - SetBase(JObject.Parse(File.ReadAllText(testProject))); - - return this; - } - - public ProjectJsonBuilder FromStringBase(string jsonString) - { - SetBase(JObject.Parse(jsonString)); - return this; - } - - public ProjectJsonBuilder FromEmptyBase() - { - SetBase(new JObject()); - return this; - } - - public ProjectJsonBuilder WithCustomProperty(string propertyName, Dictionary value) - { - EnsureBaseIsSet(); - - _projectJson[propertyName] = JObject.FromObject(value); - - return this; - } - - public ProjectJsonBuilder WithCustomProperty(string propertyName, string value) - { - EnsureBaseIsSet(); - - _projectJson[propertyName] = value; - - return this; - } - - public ProjectJsonBuilder WithCustomProperty(string propertyName, string[] value) - { - EnsureBaseIsSet(); - - _projectJson[propertyName] = JArray.FromObject(value); - - return this; - } - - private void SetBase(JObject project) - { - if (_baseDefined) - { - throw new Exception("Base was already defined."); - } - _baseDefined = true; - - _projectJson = project; - } - - private void EnsureBaseIsSet() - { - if (!_baseDefined) - { - throw new Exception("Cannot build without base set"); - } - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToCleanTheOutputProject.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToCleanTheOutputProject.cs deleted file mode 100644 index 58dcde99c..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToCleanTheOutputProject.cs +++ /dev/null @@ -1,38 +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.Linq; -using FluentAssertions; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; -using Microsoft.DotNet.ProjectJsonMigration; -using System; -using System.IO; -using Microsoft.Build.Construction; -using Microsoft.DotNet.ProjectJsonMigration.Rules; -using Microsoft.DotNet.Internal.ProjectModel; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenThatIWantToCleanTheOutputProject : TestBase - { - [Fact] - public void ItRemovesEmptyTargetsFromTheProject() - { - var mockProj = ProjectRootElement.Create(); - var target = mockProj.CreateTargetElement("Test"); - mockProj.AppendChild(target); - target.AddTask("Exec"); - - var targetToRemove = mockProj.CreateTargetElement("ToRemove"); - mockProj.AppendChild(targetToRemove); - - var migrationRuleInputs = new MigrationRuleInputs(Enumerable.Empty(), mockProj, null, null); - var cleanOutputProjectRule = new CleanOutputProjectRule(); - - cleanOutputProjectRule.Apply(null, migrationRuleInputs); - - mockProj.Targets.Should().HaveCount(c => c == 1); - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateAssemblyInfo.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateAssemblyInfo.cs deleted file mode 100644 index 61ebd00b0..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateAssemblyInfo.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 Microsoft.Build.Construction; -using Microsoft.DotNet.ProjectJsonMigration; -using Microsoft.DotNet.Internal.ProjectModel; -using Microsoft.DotNet.Tools.Test.Utilities; -using NuGet.Frameworks; -using System.Linq; -using Xunit; -using FluentAssertions; -using Microsoft.DotNet.ProjectJsonMigration.Rules; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenThatIWantToMigrateAssemblyInfo : TestBase - { - private ProjectRootElement _mockProject; - - public GivenThatIWantToMigrateAssemblyInfo() - { - var projectDirectory = TestAssets.Get("AppWithAssemblyInfo") - .CreateInstance() - .WithSourceFiles() - .Root.FullName; - var projectContext = - ProjectContext.Create(projectDirectory, FrameworkConstants.CommonFrameworks.NetCoreApp10); - _mockProject = ProjectRootElement.Create(); - var testSettings = MigrationSettings.CreateMigrationSettingsTestHook(projectDirectory, projectDirectory, _mockProject, null); - var testInputs = new MigrationRuleInputs( - new[] {projectContext}, - _mockProject, - _mockProject.AddItemGroup(), - _mockProject.AddPropertyGroup()); - - new MigrateAssemblyInfoRule().Apply(testSettings, testInputs); - } - - [Fact] - public void ItSetsGenerateAssemblyCompanyAttributeToFalseWhenAssemblyCompanyExists() - { - var generateAssemblyAttributes = - _mockProject.Properties.Where(p => p.Name.Equals("GenerateAssemblyCompanyAttribute", StringComparison.Ordinal)); - generateAssemblyAttributes.Count().Should().Be(1); - generateAssemblyAttributes.First().Value.Should().Be("false"); - } - - [Fact] - public void ItSetsGenerateAssemblyConfigurationAttributeToFalseWhenAssemblyConfigurationExists() - { - var generateAssemblyAttributes = - _mockProject.Properties.Where(p => p.Name.Equals("GenerateAssemblyConfigurationAttribute", StringComparison.Ordinal)); - generateAssemblyAttributes.Count().Should().Be(1); - generateAssemblyAttributes.First().Value.Should().Be("false"); - } - - [Fact] - public void ItSetsGenerateAssemblyCopyrightAttributeToFalseWhenAssemblyCopyrightExists() - { - var generateAssemblyAttributes = - _mockProject.Properties.Where(p => p.Name.Equals("GenerateAssemblyCopyrightAttribute", StringComparison.Ordinal)); - generateAssemblyAttributes.Count().Should().Be(1); - generateAssemblyAttributes.First().Value.Should().Be("false"); - } - - [Fact] - public void ItSetsGenerateAssemblyDescriptionAttributeToFalseWhenAssemblyDescriptionExists() - { - var generateAssemblyAttributes = - _mockProject.Properties.Where(p => p.Name.Equals("GenerateAssemblyDescriptionAttribute", StringComparison.Ordinal)); - generateAssemblyAttributes.Count().Should().Be(1); - generateAssemblyAttributes.First().Value.Should().Be("false"); - } - - [Fact] - public void ItSetsGenerateAssemblyFileVersionAttributeToFalseWhenAssemblyFileVersionExists() - { - var generateAssemblyAttributes = - _mockProject.Properties.Where(p => p.Name.Equals("GenerateAssemblyFileVersionAttribute", StringComparison.Ordinal)); - generateAssemblyAttributes.Count().Should().Be(1); - generateAssemblyAttributes.First().Value.Should().Be("false"); - } - - [Fact] - public void ItSetsGenerateAssemblyInformationalVersionAttributeToFalseWhenAssemblyInformationalVersionExists() - { - var generateAssemblyAttributes = - _mockProject.Properties.Where(p => p.Name.Equals("GenerateAssemblyInformationalVersionAttribute", StringComparison.Ordinal)); - generateAssemblyAttributes.Count().Should().Be(1); - generateAssemblyAttributes.First().Value.Should().Be("false"); - } - - [Fact] - public void ItSetsGenerateAssemblyProductAttributeToFalseWhenAssemblyProductExists() - { - var generateAssemblyAttributes = - _mockProject.Properties.Where(p => p.Name.Equals("GenerateAssemblyProductAttribute", StringComparison.Ordinal)); - generateAssemblyAttributes.Count().Should().Be(1); - generateAssemblyAttributes.First().Value.Should().Be("false"); - } - - [Fact] - public void ItSetsGenerateAssemblyTitleAttributeToFalseWhenAssemblyTitleExists() - { - var generateAssemblyAttributes = - _mockProject.Properties.Where(p => p.Name.Equals("GenerateAssemblyTitleAttribute", StringComparison.Ordinal)); - generateAssemblyAttributes.Count().Should().Be(1); - generateAssemblyAttributes.First().Value.Should().Be("false"); - } - - [Fact] - public void ItSetsGenerateAssemblyVersionAttributeToFalseWhenAssemblyVersionExists() - { - var generateAssemblyAttributes = - _mockProject.Properties.Where(p => p.Name.Equals("GenerateAssemblyVersionAttribute", StringComparison.Ordinal)); - generateAssemblyAttributes.Count().Should().Be(1); - generateAssemblyAttributes.First().Value.Should().Be("false"); - } - - [Fact] - public void ItSetsGenerateNeutralResourcesLanguageAttributeToFalseWhenNeutralResourcesLanguageExists() - { - var generateAssemblyAttributes = - _mockProject.Properties.Where(p => p.Name.Equals("GenerateNeutralResourcesLanguageAttribute", StringComparison.Ordinal)); - generateAssemblyAttributes.Count().Should().Be(1); - generateAssemblyAttributes.First().Value.Should().Be("false"); - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateBuildOptions.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateBuildOptions.cs deleted file mode 100644 index 22846342f..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateBuildOptions.cs +++ /dev/null @@ -1,881 +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.Build.Construction; -using Microsoft.DotNet.ProjectJsonMigration; -using Microsoft.DotNet.Internal.ProjectModel; -using Microsoft.DotNet.Tools.Test.Utilities; -using NuGet.Frameworks; -using System; -using System.IO; -using System.Linq; -using Xunit; -using FluentAssertions; -using Microsoft.DotNet.ProjectJsonMigration.Rules; -using Microsoft.DotNet.Internal.ProjectModel.Files; -using System.Collections.Generic; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenThatIWantToMigrateBuildOptions : TestBase - { - [Fact] - public void MigratingDeprecatedCompilationOptionsWithEmitEntryPointPopulatesOutputTypeField() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""compilationOptions"": { - ""emitEntryPoint"": ""true"" - }, - ""exclude"": [ - ""node_modules"" - ] - }"); - - mockProj.Properties.Count(p => p.Name == "OutputType").Should().Be(1); - mockProj.Properties.First(p => p.Name == "OutputType").Value.Should().Be("Exe"); - - mockProj.Items.Count(i => i.ItemType.Equals("Compile", StringComparison.Ordinal)) - .Should().Be(1); - mockProj.Items.Count(i => - i.ItemType.Equals("Compile", StringComparison.Ordinal) && - i.Remove.Equals("node_modules")) - .Should().Be(1); - - mockProj.Items.Count(i => i.ItemType.Equals("EmbeddedResource", StringComparison.Ordinal)) - .Should().Be(1); - mockProj.Items.Count(i => - i.ItemType.Equals("EmbeddedResource", StringComparison.Ordinal) && - i.Remove.Equals("node_modules")) - .Should().Be(1); - } - - [Fact] - public void SpecifiedDefaultPropertiesAreRemovedWhenTheyExistInTheCsprojTemplate() - { - // Setup project with default properties - var defaultPropertiesExpectedToBeRemoved = new string[] - { - "OutputType", - "TargetExt" - }; - - var defaultValue = "defaultValue"; - - var templateProj = ProjectRootElement.Create(); - var defaultPropertyGroup = templateProj.AddPropertyGroup(); - - foreach (var defaultPropertyName in defaultPropertiesExpectedToBeRemoved) - { - defaultPropertyGroup.AddProperty(defaultPropertyName, defaultValue); - } - - // Setup projectcontext - var testProjectDirectory = TestAssets.Get("TestAppWithRuntimeOptions") - .CreateInstance() - .WithSourceFiles() - .Root.FullName; - var projectContext = ProjectContext.Create(testProjectDirectory, FrameworkConstants.CommonFrameworks.NetCoreApp10); - - var testSettings = MigrationSettings.CreateMigrationSettingsTestHook(testProjectDirectory, testProjectDirectory, templateProj); - var testInputs = new MigrationRuleInputs(new[] {projectContext}, templateProj, templateProj.AddItemGroup(), - templateProj.AddPropertyGroup()); - new MigrateBuildOptionsRule().Apply(testSettings, testInputs); - - defaultPropertyGroup.Properties.Count.Should().Be(0); - } - - [Fact] - public void MigratingEmptyBuildOptionsGeneratesAnEmptyCSProj() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { } - }"); - - mockProj.Items.Count().Should().Be(0); - } - - [Fact] - public void MigratingWebProjectWithoutCustomSourcesOrResourcesDoesNotEmitCompileAndEmbeddedResource() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""emitEntryPoint"": true - }, - ""dependencies"": { - ""Microsoft.AspNetCore.Mvc"" : { - ""version"": ""1.0.0"" - } - }, - ""frameworks"": { - ""netcoreapp1.0"": {} - } - }"); - - mockProj.Items.Count().Should().Be(0); - } - - [Fact] - public void MigratingConsoleProjectWithoutCustomSourcesOrResourcesDoesNotEmitCompileAndEmbeddedResource() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""emitEntryPoint"": true - }, - ""frameworks"": { - ""netcoreapp1.0"": {} - } - }"); - - mockProj.Items.Count().Should().Be(0); - } - - public void MigratingOutputNamePopulatesAssemblyName() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""outputName"": ""some name"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "AssemblyName").Should().Be(1); - mockProj.Properties.First(p => p.Name == "AssemblyName").Value.Should().Be("some name"); - } - - [Fact] - public void MigratingOutputNamePopulatesPackageIdWithTheProjectContainingFolderName() - { - var testDirectoryPath = Temp.CreateDirectory().Path; - var testDirectoryName = new DirectoryInfo(testDirectoryPath).Name; - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""outputName"": ""some name"" - } - }", - testDirectoryPath); - - mockProj.Properties.Count(p => p.Name == "PackageId").Should().Be(1); - mockProj.Properties.First(p => p.Name == "PackageId").Value.Should().Be(testDirectoryName); - } - - [Fact] - public void MigratingEmitEntryPointTruePopulatesOutputTypeField() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""emitEntryPoint"": ""true"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "OutputType").Should().Be(1); - mockProj.Properties.First(p => p.Name == "OutputType").Value.Should().Be("Exe"); - } - - [Fact] - public void MigratingEmitEntryPointFalsePopulatesOutputTypeFields() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""emitEntryPoint"": ""false"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "OutputType").Should().Be(1); - mockProj.Properties.First(p => p.Name == "OutputType").Value.Should().Be("Library"); - } - - [Fact] - public void MigratingDefinePopulatesDefineConstants() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""define"": [ ""DEBUG"", ""TRACE"" ] - } - }"); - - mockProj.Properties.Count(p => p.Name == "DefineConstants").Should().Be(1); - mockProj.Properties.First(p => p.Name == "DefineConstants") - .Value.Should().Be("$(DefineConstants);DEBUG;TRACE"); - } - - [Fact] - public void MigratingNowarnPopulatesNoWarn() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""nowarn"": [ ""CS0168"", ""CS0219"" ] - } - }"); - - mockProj.Properties.Count(p => p.Name == "NoWarn").Should().Be(1); - mockProj.Properties.First(p => p.Name == "NoWarn").Value.Should().Be("$(NoWarn);CS0168;CS0219"); - } - - [Fact] - public void MigratingWarningsAsErrorsPopulatesWarningsAsErrors() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""warningsAsErrors"": ""true"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "TreatWarningsAsErrors").Should().Be(1); - mockProj.Properties.First(p => p.Name == "TreatWarningsAsErrors").Value.Should().Be("true"); - - mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""warningsAsErrors"": ""false"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "TreatWarningsAsErrors").Should().Be(0); - } - - [Fact] - public void MigratingAllowUnsafePopulatesAllowUnsafeBlocks() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""allowUnsafe"": ""true"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "AllowUnsafeBlocks").Should().Be(1); - mockProj.Properties.First(p => p.Name == "AllowUnsafeBlocks").Value.Should().Be("true"); - - mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""allowUnsafe"": ""false"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "AllowUnsafeBlocks").Should().Be(0); - } - - [Fact] - public void MigratingOptimizePopulatesOptimize() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""optimize"": ""true"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "Optimize").Should().Be(1); - mockProj.Properties.First(p => p.Name == "Optimize").Value.Should().Be("true"); - - mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""optimize"": ""false"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "Optimize").Should().Be(0); - } - - [Fact] - public void MigratingPlatformPopulatesPlatformTarget() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""platform"": ""x64"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "PlatformTarget").Should().Be(1); - mockProj.Properties.First(p => p.Name == "PlatformTarget").Value.Should().Be("x64"); - - mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""platform"": ""x86"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "PlatformTarget").Should().Be(1); - mockProj.Properties.First(p => p.Name == "PlatformTarget").Value.Should().Be("x86"); - - mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""platform"": ""foo"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "PlatformTarget").Should().Be(1); - mockProj.Properties.First(p => p.Name == "PlatformTarget").Value.Should().Be("foo"); - } - - [Fact] - public void MigratingLanguageVersionPopulatesLangVersion() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""languageVersion"": ""5"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "LangVersion").Should().Be(1); - mockProj.Properties.First(p => p.Name == "LangVersion").Value.Should().Be("5"); - } - - [Fact] - public void MigratingLanguageVersionRemovesCsharpInLangVersion() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""languageVersion"": ""csharp5"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "LangVersion").Should().Be(1); - mockProj.Properties.First(p => p.Name == "LangVersion").Value.Should().Be("5"); - } - - [Fact] - public void MigratingKeyFilePopulatesAssemblyOriginatorKeyFileAndSignAssembly() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""keyFile"": ""../keyfile.snk"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "AssemblyOriginatorKeyFile").Should().Be(1); - mockProj.Properties.First(p => p.Name == "AssemblyOriginatorKeyFile").Value.Should().Be("../keyfile.snk"); - - mockProj.Properties.Count(p => p.Name == "SignAssembly").Should().Be(1); - mockProj.Properties.First(p => p.Name == "SignAssembly").Value.Should().Be("true"); - - mockProj.Properties.Count(p => p.Name == "PublicSign").Should().Be(1); - mockProj.Properties.First(p => p.Name == "PublicSign").Value.Should().Be("true"); - mockProj.Properties.First(p => p.Name == "PublicSign").Condition.Should().Be(" '$(OS)' != 'Windows_NT' "); - } - - [Fact] - public void MigratingDelaySignPopulatesDelaySign() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""delaySign"": ""true"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "DelaySign").Should().Be(1); - mockProj.Properties.First(p => p.Name == "DelaySign").Value.Should().Be("true"); - - mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""delaySign"": ""false"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "DelaySign").Should().Be(0); - } - - [Fact] - public void MigratingPublicSignPopulatesPublicSign() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""publicSign"": ""true"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "PublicSign").Should().Be(1); - mockProj.Properties.First(p => p.Name == "PublicSign").Value.Should().Be("true"); - - mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""publicSign"": ""false"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "PublicSign").Should().Be(0); - } - - [Fact] - public void MigratingDebugTypePopulatesDebugType() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""debugType"": ""full"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "DebugType").Should().Be(1); - mockProj.Properties.First(p => p.Name == "DebugType").Value.Should().Be("full"); - - mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""debugType"": ""foo"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "DebugType").Should().Be(1); - mockProj.Properties.First(p => p.Name == "DebugType").Value.Should().Be("foo"); - } - - [Fact] - public void MigratingXmlDocPopulatesGenerateDocumentationFile() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""xmlDoc"": ""true"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "GenerateDocumentationFile").Should().Be(1); - mockProj.Properties.First(p => p.Name == "GenerateDocumentationFile").Value.Should().Be("true"); - } - - [Fact] - public void ExcludedPatternsAreNotEmittedOnNoneWhenBuildingAWebProject() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""emitEntryPoint"": true, - ""copyToOutput"": { - ""include"": [""wwwroot"", ""**/*.cshtml"", ""appsettings.json"", ""web.config""], - } - }, - ""dependencies"": { - ""Microsoft.AspNetCore.Mvc"" : { - ""version"": ""1.0.0"" - } - }, - ""frameworks"": { - ""netcoreapp1.0"": {} - } - }"); - - mockProj.Items.Count(i => i.ItemType.Equals("None", StringComparison.Ordinal)).Should().Be(0); - } - - [Theory] - [InlineData("compile", "Compile", 3, "")] - [InlineData("embed", "EmbeddedResource", 3, ";rootfile.cs")] - public void MigratingGroupIncludeExcludePopulatesAppropriateProjectItemElement( - string group, - string itemName, - int expectedNumberOfCompileItems, - string expectedRootFiles) - { - var testDirectory = Temp.CreateDirectory().Path; - WriteExtraFiles(testDirectory); - - var pj = @" - { - ""buildOptions"": { - """": { - ""include"": [""root"", ""src"", ""rootfile.cs""], - ""exclude"": [""src"", ""rootfile.cs""], - ""includeFiles"": [""src/file1.cs"", ""src/file2.cs""], - ""excludeFiles"": [""src/file2.cs""] - } - } - }".Replace("", group); - - var mockProj = RunBuildOptionsRuleOnPj(pj, - testDirectory: testDirectory); - - mockProj.Items.Count(i => i.ItemType.Equals(itemName, StringComparison.Ordinal)) - .Should().Be(expectedNumberOfCompileItems); - - var defaultIncludePatterns = GetDefaultIncludePatterns(group); - var defaultExcludePatterns = GetDefaultExcludePatterns(group); - - foreach (var item in mockProj.Items.Where(i => i.ItemType.Equals(itemName, StringComparison.Ordinal))) - { - VerifyContentMetadata(item); - - if (string.IsNullOrEmpty(item.Include)) - { - item.Remove.Should() - .Be(@"src\**\*;rootfile.cs;src\file2.cs"); - } - else if (item.Include.Contains(@"src\file1.cs")) - { - item.Include.Should().Be(@"src\file1.cs;src\file2.cs"); - item.Exclude.Should().Be(@"src\file2.cs"); - } - else - { - if (defaultIncludePatterns.Any()) - { - item.Include.Should() - .Be($@"root\**\*;src\**\*{expectedRootFiles};" + string.Join(";", defaultIncludePatterns).Replace("/", "\\")); - } - else - { - item.Include.Should() - .Be($@"root\**\*;src\**\*{expectedRootFiles}"); - } - - if (defaultExcludePatterns.Any()) - { - item.Exclude.Should() - .Be(@"src\**\*;rootfile.cs;" + string.Join(";", defaultExcludePatterns).Replace("/", "\\") + - @";src\file2.cs"); - } - else - { - item.Exclude.Should() - .Be(@"src\**\*;rootfile.cs;src\file2.cs"); - } - } - } - } - - [Fact] - public void MigratingCopyToOutputIncludeExcludePopulatesAppropriateProjectItemElement() - { - var testDirectory = Temp.CreateDirectory().Path; - WriteExtraFiles(testDirectory); - - var pj = @" - { - ""buildOptions"": { - ""copyToOutput"": { - ""include"": [""root"", ""src"", ""rootfile.cs""], - ""exclude"": [""anothersource"", ""rootfile1.cs""], - ""includeFiles"": [""src/file1.cs"", ""src/file2.cs""], - ""excludeFiles"": [""src/file3.cs""] - } - } - }"; - - var mockProj = RunBuildOptionsRuleOnPj(pj, - testDirectory: testDirectory); - - mockProj.Items.Count(i => i.ItemType.Equals("None", StringComparison.Ordinal)) - .Should().Be(4); - - var copyItems = mockProj.Items.Where(i => - i.ItemType.Equals("None", StringComparison.Ordinal) && - i.Metadata.Any(m => m.Name == "CopyToOutputDirectory" && m.Value == "PreserveNewest")); - - copyItems.Count().Should().Be(2); - - var excludeItems = mockProj.Items.Where(i => - i.ItemType.Equals("None", StringComparison.Ordinal) && - i.Metadata.Any(m => m.Name == "CopyToOutputDirectory" && m.Value == "Never")); - - excludeItems.Count().Should().Be(2); - - foreach (var item in copyItems) - { - VerifyContentMetadata(item); - - if (item.Update.Contains(@"src\file1.cs")) - { - item.Update.Should().Be(@"src\file1.cs;src\file2.cs"); - } - else - { - item.Update.Should().Be(@"root\**\*;src\**\*;rootfile.cs"); - } - } - - foreach (var item in excludeItems) - { - VerifyContentMetadata(item); - - if (item.Update.Contains(@"src\file3.cs")) - { - item.Update.Should().Be(@"src\file3.cs"); - } - else - { - item.Update.Should().Be(@"anothersource\**\*;rootfile1.cs"); - } - } - } - - [Theory] - [InlineData("compile", "Compile", "")] - [InlineData("embed", "EmbeddedResource", ";rootfile.cs")] - public void MigratingGroupIncludeOnlyPopulatesAppropriateProjectItemElement( - string group, - string itemName, - string expectedRootFiles) - { - var testDirectory = Temp.CreateDirectory().Path; - WriteExtraFiles(testDirectory); - - var pj = @" - { - ""buildOptions"": { - """": [""root"", ""src"", ""rootfile.cs""] - } - }".Replace("", group); - - var mockProj = RunBuildOptionsRuleOnPj(pj, - testDirectory: testDirectory); - - mockProj.Items.Count(i => i.ItemType.Equals(itemName, StringComparison.Ordinal)).Should().Be(1); - - var defaultIncludePatterns = GetDefaultIncludePatterns(group); - var defaultExcludePatterns = GetDefaultExcludePatterns(group); - - foreach (var item in mockProj.Items.Where(i => i.ItemType.Equals(itemName, StringComparison.Ordinal))) - { - VerifyContentMetadata(item); - - if (defaultIncludePatterns.Any()) - { - item.Include.Should() - .Be($@"root\**\*;src\**\*{expectedRootFiles};" + string.Join(";", defaultIncludePatterns).Replace("/", "\\")); - } - else - { - item.Include.Should() - .Be($@"root\**\*;src\**\*{expectedRootFiles}"); - } - - if (defaultExcludePatterns.Any()) - { - item.Exclude.Should() - .Be(string.Join(";", defaultExcludePatterns).Replace("/", "\\")); - } - else - { - item.Exclude.Should() - .Be(string.Empty); - } - } - } - - [Theory] - [InlineData("copyToOutput", "None", ";rootfile.cs")] - public void MigratingCopyToOutputIncludeOnlyPopulatesAppropriateProjectItemElement( - string group, - string itemName, - string expectedRootFiles) - { - var testDirectory = Temp.CreateDirectory().Path; - WriteExtraFiles(testDirectory); - - var pj = @" - { - ""buildOptions"": { - """": [""root"", ""src"", ""rootfile.cs""] - } - }".Replace("", group); - - var mockProj = RunBuildOptionsRuleOnPj(pj, - testDirectory: testDirectory); - - mockProj.Items.Count(i => i.ItemType.Equals(itemName, StringComparison.Ordinal)).Should().Be(1); - - mockProj.Items.Single().Update.Should().Be($@"root\**\*;src\**\*{expectedRootFiles}"); - } - - [Fact] - public void MigratingTestProjectAddsGenerateRuntimeConfigurationFiles() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""testRunner"": ""xunit"" - }"); - - mockProj.Properties.Count(p => p.Name == "GenerateRuntimeConfigurationFiles").Should().Be(1); - mockProj.Properties.First(p => p.Name == "GenerateRuntimeConfigurationFiles").Value.Should().Be("true"); - } - - [Fact] - public void MigratingANonTestProjectDoesNotAddGenerateRuntimeConfigurationFiles() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - }"); - - mockProj.Properties.Count(p => p.Name == "GenerateRuntimeConfigurationFiles").Should().Be(0); - } - - [Fact] - public void MigratingAnAppWithAppConfigAddsItAsNoneToTheCsProj() - { - var tempDirectory = Temp.CreateDirectory().Path; - File.Create(Path.Combine(tempDirectory, "App.config")).Dispose(); - var mockProj = RunBuildOptionsRuleOnPj(@" - { - }", - tempDirectory); - - mockProj.Items.Count(i => i.ItemType == "None").Should().Be(1); - mockProj.Items.First(i => i.ItemType == "None").Include.Should().Be("App.config"); - } - - [Fact] - public void MigratingCompileIncludeWithPlainFileNamesRemovesThem() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""compile"": { - ""include"": [""filename1.cs"", ""filename2.cs""], - } - } - }"); - - mockProj.Items.Count(i => i.ItemType.Equals("Compile", StringComparison.Ordinal)).Should().Be(0); - } - - [Fact] - public void MigratingCompileIncludeFilesWithPlainFileNamesRemovesThem() - { - var mockProj = RunBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""compile"": { - ""includeFiles"": [""filename1.cs"", ""filename2.cs""], - } - } - }"); - - mockProj.Items.Count(i => i.ItemType.Equals("Compile", StringComparison.Ordinal)).Should().Be(0); - } - - [Fact] - public void MigratingProjectWithCompileResourcesPopulatesAppropriateProjectItemElements() - { - var testDirectory = Temp.CreateDirectory().Path; - WriteCompileResourceFiles(testDirectory); - - var pj = @" - { - ""version"": ""1.0.0-*"", - ""dependencies"": { - ""NETStandard.Library"": ""1.6.0"" - }, - ""frameworks"": { - ""netstandard1.5"": {} - } - }"; - - var mockProj = RunBuildOptionsRuleOnPj(pj, testDirectory); - - var compileItems = mockProj.Items.Where(i => i.ItemType.Equals("Compile", StringComparison.Ordinal)); - compileItems.Count().Should().Be(1); - var compileItem = compileItems.Single(); - compileItem.Include.Should().BeEmpty(); - compileItem.Exclude.Should().BeEmpty(); - compileItem.Remove.Should().Be(@"compiler\resources\*"); - - var embeddedResourceItems = mockProj.Items.Where( - i => i.ItemType.Equals("EmbeddedResource", StringComparison.Ordinal)); - embeddedResourceItems.Count().Should().Be(1); - var embeddedResourceItem = embeddedResourceItems.Single(); - embeddedResourceItem.Include.Should().Be(@"compiler\resources\*"); - embeddedResourceItem.Exclude.Should().BeEmpty(); - embeddedResourceItem.Remove.Should().BeEmpty(); - } - - [Fact] - public void MigratingProjectWithoutCompileResourcesDoesNotAddProjectItemElements() - { - var testDirectory = Temp.CreateDirectory().Path; - - var pj = @" - { - ""version"": ""1.0.0-*"", - ""dependencies"": { - ""NETStandard.Library"": ""1.6.0"" - }, - ""frameworks"": { - ""netstandard1.5"": {} - } - }"; - - var mockProj = RunBuildOptionsRuleOnPj(pj, testDirectory); - mockProj.Items.Count.Should().Be(0); - } - - private static IEnumerable GetDefaultExcludePatterns(string group) - { - var defaultExcludePatterns = new List(group == "copyToOutput" ? - Enumerable.Empty() : - ProjectFilesCollection.DefaultBuiltInExcludePatterns); - - if (group == "embed") - { - defaultExcludePatterns.Add("@(EmbeddedResource)"); - } - - return defaultExcludePatterns; - } - - private static IEnumerable GetDefaultIncludePatterns(string group) - { - return Enumerable.Empty(); - } - - private static void VerifyContentMetadata(ProjectItemElement item) - { - if (item.ItemType == "None") - { - item.Metadata.Count(m => m.Name == "CopyToOutputDirectory").Should().Be(1); - } - } - - private void WriteExtraFiles(string directory) - { - Directory.CreateDirectory(Path.Combine(directory, "root")); - Directory.CreateDirectory(Path.Combine(directory, "src")); - Directory.CreateDirectory(Path.Combine(directory, "anothersource")); - File.WriteAllText(Path.Combine(directory, "root", "file1.txt"), "content"); - File.WriteAllText(Path.Combine(directory, "root", "file2.txt"), "content"); - File.WriteAllText(Path.Combine(directory, "root", "file3.txt"), "content"); - File.WriteAllText(Path.Combine(directory, "src", "file1.cs"), "content"); - File.WriteAllText(Path.Combine(directory, "src", "file2.cs"), "content"); - File.WriteAllText(Path.Combine(directory, "src", "file3.cs"), "content"); - File.WriteAllText(Path.Combine(directory, "anothersource", "file4.cs"), "content"); - File.WriteAllText(Path.Combine(directory, "rootfile.cs"), "content"); - } - - private void WriteCompileResourceFiles(string directory) - { - Directory.CreateDirectory(Path.Combine(directory, "compiler")); - Directory.CreateDirectory(Path.Combine(directory, "compiler", "resources")); - File.WriteAllText(Path.Combine(directory, "compiler", "resources", "file.cs"), "content"); - } - - private ProjectRootElement RunBuildOptionsRuleOnPj(string s, string testDirectory = null) - { - testDirectory = testDirectory ?? Temp.CreateDirectory().Path; - return TemporaryProjectFileRuleRunner.RunRules(new IMigrationRule[] - { - new MigrateBuildOptionsRule() - }, s, testDirectory); - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateConfigurations.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateConfigurations.cs deleted file mode 100644 index d39a58258..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateConfigurations.cs +++ /dev/null @@ -1,684 +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.Threading.Tasks; -using Microsoft.Build.Construction; -using Microsoft.DotNet.ProjectJsonMigration; -using Microsoft.DotNet.Internal.ProjectModel; -using Microsoft.DotNet.Tools.Test.Utilities; -using NuGet.Frameworks; -using Xunit; -using FluentAssertions; -using Microsoft.DotNet.ProjectJsonMigration.Rules; -using Microsoft.DotNet.ProjectJsonMigration.Tests; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenThatIWantToMigrateConfigurations : TestBase - { - [Fact] - public void ConfigurationBuildOptionsProduceExpectedPropertiesInAGroupWithACondition() - { - var mockProj = RunConfigurationsRuleOnPj(@" - { - ""configurations"": { - ""testconfig"": { - ""buildOptions"": { - ""emitEntryPoint"": ""true"", - ""debugType"": ""full"" - } - } - } - }"); - - mockProj.Properties.Count( - prop => prop.Name == "OutputType" || prop.Name == "DebugType").Should().Be(2); - - mockProj.Properties.First(p => p.Name == "OutputType") - .Parent.Condition.Should() - .Contain("'$(Configuration)' == 'testconfig'"); - } - - [Fact] - public void FrameworksBuildOptionsProduceExpectedPropertiesInAGroupWithACondition() - { - var mockProj = RunConfigurationsRuleOnPj(@" - { - ""frameworks"": { - ""netcoreapp1.0"": { - ""buildOptions"": { - ""emitEntryPoint"": ""true"", - ""debugType"": ""full"" - } - } - } - }"); - - mockProj.Properties.Count( - prop => prop.Name == "OutputType" || prop.Name == "DebugType").Should().Be(2); - - mockProj.Properties.First(p => p.Name == "OutputType") - .Parent.Condition.Should() - .Contain("'$(TargetFramework)' == 'netcoreapp1.0'"); - } - - [Fact] - public void ItDoesNotAddADefineForTheFramework() - { - var mockProj = RunConfigurationsRuleOnPj(@" - { - ""frameworks"": { - ""netcoreapp1.0"": { - } - } - }"); - - mockProj.Properties.Count( - prop => prop.Name == "DefineConstants" && prop.Value.Contains("NETCOREAPP10")).Should().Be(0); - } - - [Fact] - public void ItDoesNotAddADefineForReleaseConfiguration() - { - var mockProj = RunRulesOnPj(@" - { - ""frameworks"": { - ""netcoreapp1.0"": { - } - } - }", - new IMigrationRule[] - { - new AddDefaultsToProjectRule(), - new MigrateConfigurationsRule(), - new RemoveDefaultsFromProjectRule() - }); - - mockProj.Properties.Count( - prop => prop.Name == "DefineConstants" && prop.Value.Contains("Release")).Should().Be(0); - } - - [Fact] - public void ItDoesNotAddADefineForDebugConfiguration() - { - var mockProj = RunRulesOnPj(@" - { - ""frameworks"": { - ""netcoreapp1.0"": { - } - } - }", - new IMigrationRule[] - { - new AddDefaultsToProjectRule(), - new MigrateConfigurationsRule(), - new RemoveDefaultsFromProjectRule() - }); - - mockProj.Properties.Count( - prop => prop.Name == "DefineConstants" && prop.Value.Contains("Debug")).Should().Be(0); - } - - [Fact] - public void ConfigurationBuildOptionsPropertiesAreNotWrittenWhenTheyOverlapWithBuildOptions() - { - var mockProj = RunConfigurationsAndBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""emitEntryPoint"": ""true"", - ""debugType"": ""full"" - }, - ""configurations"": { - ""testconfig"": { - ""buildOptions"": { - ""emitEntryPoint"": ""true"", - ""debugType"": ""full"" - } - } - } - }"); - - mockProj.Properties.Count(property => - property.Name == "OutputType" || property.Name == "DebugType") - .Should().Be(2); - - foreach (var property in mockProj.Properties.Where(property => - property.Name == "OutputType" || property.Name == "DebugType")) - { - property.Parent.Condition.Should().Be(string.Empty); - } - } - - [Fact] - public void ConfigurationBuildOptionsIncludesAndRemoveAreWrittenWhenTheyDifferFromBaseBuildOptions() - { - var mockProj = RunConfigurationsAndBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""copyToOutput"": { - ""include"": [""src""], - ""exclude"": [""anothersource"", ""rootfile.cs""], - ""includeFiles"": [""src/file1.cs"", ""src/file2.cs""], - ""excludeFiles"": [""anothersource/file2.cs""] - } - }, - ""configurations"": { - ""testconfig"": { - ""buildOptions"": { - ""copyToOutput"": { - ""include"": [""root"", ""src"", ""rootfile.cs""], - ""exclude"": [""anothersource"", ""root/rootfile.cs""], - ""includeFiles"": [""src/file1.cs"", ""src/file2.cs""], - ""excludeFiles"": [""src/file3.cs""] - } - } - } - } - }"); - - var contentItems = mockProj.Items.Where(item => item.ItemType == "None"); - - contentItems.Count().Should().Be(8); - - contentItems.Where(i => i.ConditionChain().Count() == 0).Should().HaveCount(4); - - contentItems.Where(i => - i.ConditionChain().Count() == 0 && - i.Metadata.Any(m => m.Value == "PreserveNewest")).Should().HaveCount(2); - contentItems.Where(i => - i.ConditionChain().Count() == 0 && - i.Metadata.Any(m => m.Value == "Never")).Should().HaveCount(2); - - contentItems.Where(i => i.ConditionChain().Count() == 1).Should().HaveCount(4); - contentItems.Where(i => - i.ConditionChain().Count() == 1 && - i.Metadata.Any(m => m.Value == "PreserveNewest")).Should().HaveCount(1); - contentItems.Where(i => - i.ConditionChain().Count() == 1 && - i.Metadata.Any(m => m.Value == "Never")).Should().HaveCount(2); - - contentItems.First(i => - i.ConditionChain().Count() == 1 && - i.Metadata.Any(m => m.Value == "PreserveNewest") && - !string.IsNullOrEmpty(i.Update)).Update.Should().Be(@"root;rootfile.cs"); - - contentItems.First(i => - i.ConditionChain().Count() == 1 && - i.Metadata.Any(m => m.Value == "Never") && - !string.IsNullOrEmpty(i.Update) && - i.Update.Contains(@"src\file3.cs")).Update.Should().Be(@"src\file3.cs"); - - contentItems.First(i => - i.ConditionChain().Count() == 1 && - i.Metadata.Any(m => m.Value == "Never") && - !string.IsNullOrEmpty(i.Update) && - i.Update.Contains(@"root\rootfile.cs")).Update.Should().Be(@"root\rootfile.cs"); - - contentItems.First(i => - i.ConditionChain().Count() == 0 && - i.Metadata.Any(m => m.Value == "PreserveNewest") && - !string.IsNullOrEmpty(i.Update) && - i.Update.Contains(@"src\file1.cs")).Update.Should().Be(@"src\file1.cs;src\file2.cs"); - - contentItems.First(i => - i.ConditionChain().Count() == 0 && - i.Metadata.Any(m => m.Value == "PreserveNewest") && - !string.IsNullOrEmpty(i.Update) && - i.Update.Equals(@"src")).Update.Should().Be(@"src"); - - contentItems.First(i => - i.ConditionChain().Count() == 0 && - i.Metadata.Any(m => m.Value == "Never") && - !string.IsNullOrEmpty(i.Update) && - i.Update.Equals(@"anothersource\file2.cs")).Update.Should().Be(@"anothersource\file2.cs"); - - contentItems.First(i => - i.ConditionChain().Count() == 0 && - i.Metadata.Any(m => m.Value == "Never") && - !string.IsNullOrEmpty(i.Update) && - i.Update.Equals(@"anothersource;rootfile.cs")).Update.Should().Be(@"anothersource;rootfile.cs"); - } - - [Fact] - public void ConfigurationBuildOptionsWhichHaveDifferentExcludesThanBuildOptionsOverwrites() - { - var mockProj = RunConfigurationsAndBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""copyToOutput"": { - ""include"": [""src""], - ""exclude"": [""rootfile.cs""], - ""includeFiles"": [""src/file1.cs"", ""src/file2.cs""], - ""excludeFiles"": [""src/file3.cs""] - } - }, - ""configurations"": { - ""testconfig"": { - ""buildOptions"": { - ""copyToOutput"": { - ""include"": [""root"", ""anothersource"", ""rootfile.cs""], - ""exclude"": [""rootfile.cs"", ""someotherfile.cs""], - ""includeFiles"": [""src/file1.cs"", ""src/file2.cs""], - ""excludeFiles"": [""src/file2.cs""] - } - } - } - } - }"); - - var contentItems = mockProj.Items.Where(item => item.ItemType == "None"); - - contentItems.Count().Should().Be(9); - contentItems.Where(i => i.ConditionChain().Count() == 0).Should().HaveCount(4); - contentItems.Where(i => i.ConditionChain().Count() == 1).Should().HaveCount(5); - - contentItems.Where(i => - i.ConditionChain().Count() == 0 && - i.Metadata.Any(m => m.Value == "PreserveNewest")).Should().HaveCount(2); - contentItems.Where(i => - i.ConditionChain().Count() == 0 && - i.Metadata.Any(m => m.Value == "Never")).Should().HaveCount(2); - - contentItems.Where(i => - i.ConditionChain().Count() == 1 && - i.Metadata.Any(m => m.Value == "PreserveNewest")).Should().HaveCount(1); - contentItems.Where(i => - i.ConditionChain().Count() == 1 && - i.Metadata.Any(m => m.Value == "Never")).Should().HaveCount(3); - - contentItems.First(i => - i.ConditionChain().Count() == 0 && - i.Metadata.Any(m => m.Value == "PreserveNewest") && - !string.IsNullOrEmpty(i.Update) && - i.Update.Contains(@"src\file1.cs")).Update.Should().Be(@"src\file1.cs;src\file2.cs"); - - contentItems.First(i => - i.ConditionChain().Count() == 0 && - i.Metadata.Any(m => m.Value == "PreserveNewest") && - !string.IsNullOrEmpty(i.Update) && - i.Update.Equals(@"src")).Update.Should().Be(@"src"); - - contentItems.First(i => - i.ConditionChain().Count() == 0 && - i.Metadata.Any(m => m.Value == "Never") && - !string.IsNullOrEmpty(i.Update) && - i.Update.Equals(@"src\file3.cs")).Update.Should().Be(@"src\file3.cs"); - - contentItems.First(i => - i.ConditionChain().Count() == 0 && - i.Metadata.Any(m => m.Value == "Never") && - !string.IsNullOrEmpty(i.Update) && - i.Update.Equals(@"rootfile.cs")).Update.Should().Be(@"rootfile.cs"); - - contentItems.First(i => - i.ConditionChain().Count() == 1 && - i.Metadata.Any(m => m.Value == "PreserveNewest") && - !string.IsNullOrEmpty(i.Update) && - i.Update.Contains(@"root;anothersource")).Update.Should().Be(@"root;anothersource"); - - contentItems.First(i => - i.ConditionChain().Count() == 1 && - i.Metadata.Any(m => m.Value == "Never") && - !string.IsNullOrEmpty(i.Update) && - i.Update.Contains(@"src\file2.cs")).Update.Should().Be(@"src\file2.cs"); - - contentItems.First(i => - i.ConditionChain().Count() == 1 && - i.Metadata.Any(m => m.Value == "Never") && - !string.IsNullOrEmpty(i.Update) && - i.Update.Contains(@"rootfile.cs")).Update.Should().Be(@"rootfile.cs"); - - contentItems.First(i => - i.ConditionChain().Count() == 1 && - i.Metadata.Any(m => m.Value == "Never") && - !string.IsNullOrEmpty(i.Update) && - i.Update.Contains(@"someotherfile.cs")).Update.Should().Be(@"someotherfile.cs"); - } - - [Fact] - public void ConfigurationBuildOptionsWhichHaveMappingsToDirectoryAddLinkMetadataWithItemMetadata() - { - var mockProj = RunConfigurationsAndBuildOptionsRuleOnPj(@" - { - ""configurations"": { - ""testconfig"": { - ""buildOptions"": { - ""copyToOutput"": { - ""mappings"": { - ""/some/dir/"" : { - ""include"": [""src"", ""root""], - ""exclude"": [""src"", ""rootfile.cs""], - ""includeFiles"": [""src/file1.cs"", ""src/file2.cs""], - ""excludeFiles"": [""src/file2.cs""] - } - } - } - } - } - } - }"); - - var contentItems = mockProj.Items.Where(item => item.ItemType == "None"); - - contentItems.Count().Should().Be(5); - contentItems.Where(i => i.ConditionChain().Count() == 1).Should().HaveCount(5); - - var configIncludeContentItem = contentItems.First(item => item.Update.Contains("root")); - var configIncludeContentItem2 = contentItems.First(item => item.Update.Contains(@"src\file1.cs")); - var configIncludeContentItem3 = contentItems.First(item => item.Update.Contains(@"src\file2.cs")); - var configIncludeContentItem4 = contentItems.First(item => item.Update.Equals(@"src")); - var configIncludeContentItem5 = contentItems.First(item => item.Update.Contains(@"rootfile.cs")); - - configIncludeContentItem.Updates().Should().BeEquivalentTo("root"); - configIncludeContentItem.GetMetadataWithName("Link").Should().NotBeNull(); - configIncludeContentItem.GetMetadataWithName("Link").Value.Should().Be("/some/dir/%(FileName)%(Extension)"); - configIncludeContentItem.GetMetadataWithName("CopyToOutputDirectory").Should().NotBeNull(); - configIncludeContentItem.GetMetadataWithName("CopyToOutputDirectory").Value.Should().Be("PreserveNewest"); - - configIncludeContentItem2.Updates().Should().BeEquivalentTo(@"src\file1.cs"); - configIncludeContentItem2.GetMetadataWithName("Link").Should().NotBeNull(); - configIncludeContentItem2.GetMetadataWithName("Link").Value.Should().Be("/some/dir/%(FileName)%(Extension)"); - configIncludeContentItem2.GetMetadataWithName("CopyToOutputDirectory").Should().NotBeNull(); - configIncludeContentItem2.GetMetadataWithName("CopyToOutputDirectory").Value.Should().Be("PreserveNewest"); - - configIncludeContentItem3.Updates().Should().BeEquivalentTo(@"src\file2.cs"); - configIncludeContentItem3.GetMetadataWithName("Link").Should().NotBeNull(); - configIncludeContentItem3.GetMetadataWithName("Link").Value.Should().Be("/some/dir/%(FileName)%(Extension)"); - configIncludeContentItem3.GetMetadataWithName("CopyToOutputDirectory").Should().NotBeNull(); - configIncludeContentItem3.GetMetadataWithName("CopyToOutputDirectory").Value.Should().Be("Never"); - - configIncludeContentItem4.Updates().Should().BeEquivalentTo(@"src"); - configIncludeContentItem4.GetMetadataWithName("Link").Should().NotBeNull(); - configIncludeContentItem4.GetMetadataWithName("Link").Value.Should().Be("/some/dir/%(FileName)%(Extension)"); - configIncludeContentItem4.GetMetadataWithName("CopyToOutputDirectory").Should().NotBeNull(); - configIncludeContentItem4.GetMetadataWithName("CopyToOutputDirectory").Value.Should().Be("Never"); - - configIncludeContentItem5.Updates().Should().BeEquivalentTo(@"rootfile.cs"); - configIncludeContentItem5.GetMetadataWithName("Link").Should().NotBeNull(); - configIncludeContentItem5.GetMetadataWithName("Link").Value.Should().Be("/some/dir/%(FileName)%(Extension)"); - configIncludeContentItem5.GetMetadataWithName("CopyToOutputDirectory").Should().NotBeNull(); - configIncludeContentItem5.GetMetadataWithName("CopyToOutputDirectory").Value.Should().Be("Never"); - } - - [Fact] - public void ConfigurationBuildOptionsWhichHaveMappingsOverlappingWithIncludesInSameConfigurationMergedItemsHaveLinkMetadata() - { - var mockProj = RunConfigurationsAndBuildOptionsRuleOnPj(@" - { - ""configurations"": { - ""testconfig"": { - ""buildOptions"": { - ""copyToOutput"": { - ""include"": [""src"", ""root""], - ""exclude"": [""src"", ""rootfile.cs""], - ""includeFiles"": [""src/file1.cs""], - ""excludeFiles"": [""src/file2.cs""], - ""mappings"": { - ""/some/dir/"" : { - ""include"": [""src""], - ""exclude"": [""src"", ""src/rootfile.cs""] - } - } - } - } - } - } - }"); - - var contentItems = mockProj.Items.Where(item => item.ItemType == "None"); - - contentItems.Count().Should().Be(6); - contentItems.Where(i => i.ConditionChain().Count() == 1).Should().HaveCount(6); - - var configIncludeContentItem = contentItems.First( - item => item.ConditionChain().Count() > 0 - && item.Update == "root"); - - var configIncludeContentItem2 = contentItems.First( - item => item.ConditionChain().Count() > 0 - && item.Update == "src"); - - var configIncludeContentItem3 = contentItems.First( - item => item.ConditionChain().Count() > 0 - && item.Update.Contains(@"src\file1.cs")); - - var configIncludeContentItem4 = contentItems.First( - item => item.ConditionChain().Count() > 0 - && item.Update.Contains(@"src\file2.cs")); - - var configIncludeContentItem5 = contentItems.First( - item => item.ConditionChain().Count() > 0 - && item.Update.Equals(@"rootfile.cs")); - - var configIncludeContentItem6 = contentItems.First( - item => item.ConditionChain().Count() > 0 - && item.Update.Equals(@"src\rootfile.cs")); - - configIncludeContentItem.Updates().Should().BeEquivalentTo("root"); - configIncludeContentItem.GetMetadataWithName("Link").Should().BeNull(); - configIncludeContentItem.GetMetadataWithName("CopyToOutputDirectory").Should().NotBeNull(); - configIncludeContentItem.GetMetadataWithName("CopyToOutputDirectory").Value.Should().Be("PreserveNewest"); - - configIncludeContentItem2.Update.Should().Be("src"); - configIncludeContentItem2.GetMetadataWithName("Link").Should().NotBeNull(); - configIncludeContentItem2.GetMetadataWithName("Link").Value.Should().Be("/some/dir/%(FileName)%(Extension)"); - configIncludeContentItem2.GetMetadataWithName("CopyToOutputDirectory").Should().NotBeNull(); - configIncludeContentItem2.GetMetadataWithName("CopyToOutputDirectory").Value.Should().Be("Never"); - - configIncludeContentItem3.Updates().Should().BeEquivalentTo(@"src\file1.cs"); - configIncludeContentItem3.GetMetadataWithName("Link").Should().BeNull(); - configIncludeContentItem3.GetMetadataWithName("CopyToOutputDirectory").Should().NotBeNull(); - configIncludeContentItem3.GetMetadataWithName("CopyToOutputDirectory").Value.Should().Be("PreserveNewest"); - - configIncludeContentItem4.Updates().Should().BeEquivalentTo(@"src\file2.cs"); - configIncludeContentItem4.GetMetadataWithName("Link").Should().BeNull(); - configIncludeContentItem4.GetMetadataWithName("CopyToOutputDirectory").Should().NotBeNull(); - configIncludeContentItem4.GetMetadataWithName("CopyToOutputDirectory").Value.Should().Be("Never"); - - configIncludeContentItem5.Updates().Should().BeEquivalentTo(@"rootfile.cs"); - configIncludeContentItem5.GetMetadataWithName("Link").Should().BeNull(); - configIncludeContentItem5.GetMetadataWithName("CopyToOutputDirectory").Should().NotBeNull(); - configIncludeContentItem5.GetMetadataWithName("CopyToOutputDirectory").Value.Should().Be("Never"); - - configIncludeContentItem6.Updates().Should().BeEquivalentTo(@"src\rootfile.cs"); - configIncludeContentItem6.GetMetadataWithName("Link").Value.Should().Be("/some/dir/%(FileName)%(Extension)"); - configIncludeContentItem6.GetMetadataWithName("CopyToOutputDirectory").Should().NotBeNull(); - configIncludeContentItem6.GetMetadataWithName("CopyToOutputDirectory").Value.Should().Be("Never"); - } - - [Fact] - public void ConfigurationBuildOptionsWhichHaveMappingsOverlappingWithIncludesInRootBuildoptionsHasRemove() - { - var mockProj = RunConfigurationsAndBuildOptionsRuleOnPj(@" - { - ""buildOptions"" : { - ""copyToOutput"": { - ""include"": [""src"", ""root""], - ""exclude"": [""src"", ""rootfile.cs""], - ""includeFiles"": [""src/file1.cs"", ""src/file2.cs""], - ""excludeFiles"": [""src/file2.cs""] - } - }, - ""configurations"": { - ""testconfig"": { - ""buildOptions"": { - ""copyToOutput"": { - ""mappings"": { - ""/some/dir/"" : { - ""include"": [""src""], - ""exclude"": [""src"", ""rootfile.cs""] - } - } - } - } - } - } - }"); - - var contentItems = mockProj.Items.Where(item => item.ItemType == "None"); - - contentItems.Count().Should().Be(8); - - var rootBuildOptionsContentItems = contentItems.Where(i => i.ConditionChain().Count() == 0).ToList(); - rootBuildOptionsContentItems.Count().Should().Be(5); - foreach (var buildOptionContentItem in rootBuildOptionsContentItems) - { - buildOptionContentItem.GetMetadataWithName("Link").Should().BeNull(); - } - - contentItems.First(i => - i.ConditionChain().Count() == 0 && - i.Metadata.Any(m => m.Value == "PreserveNewest") && - !string.IsNullOrEmpty(i.Update) && - i.Update.Equals(@"src\file1.cs")).Update.Should().Be(@"src\file1.cs"); - - contentItems.First(i => - i.ConditionChain().Count() == 0 && - i.Metadata.Any(m => m.Value == "PreserveNewest") && - !string.IsNullOrEmpty(i.Update) && - i.Update.Equals(@"root")).Update.Should().Be(@"root"); - - contentItems.First(i => - i.ConditionChain().Count() == 0 && - i.Metadata.Any(m => m.Value == "Never") && - !string.IsNullOrEmpty(i.Update) && - i.Update.Equals(@"src\file2.cs")).Update.Should().Be(@"src\file2.cs"); - - contentItems.First(i => - i.ConditionChain().Count() == 0 && - i.Metadata.Any(m => m.Value == "Never") && - !string.IsNullOrEmpty(i.Update) && - i.Update.Equals(@"src")).Update.Should().Be(@"src"); - - contentItems.First(i => - i.ConditionChain().Count() == 0 && - i.Metadata.Any(m => m.Value == "Never") && - !string.IsNullOrEmpty(i.Update) && - i.Update.Equals(@"rootfile.cs")).Update.Should().Be(@"rootfile.cs"); - - var configItems = contentItems.Where(i => i.ConditionChain().Count() == 1); - configItems.Should().HaveCount(3); - - var configIncludeContentItem = contentItems.First( - item => item.ConditionChain().Count() > 0 - && item.Update.Contains("src")); - - var configRemoveContentItem = contentItems.First( - item => item.ConditionChain().Count() > 0 - && !string.IsNullOrEmpty(item.Remove)); - - configIncludeContentItem.Update.Should().Be("src"); - - configIncludeContentItem.GetMetadataWithName("Link").Should().NotBeNull(); - configIncludeContentItem.GetMetadataWithName("Link").Value.Should().Be("/some/dir/%(FileName)%(Extension)"); - - configIncludeContentItem.GetMetadataWithName("CopyToOutputDirectory").Should().NotBeNull(); - configIncludeContentItem.GetMetadataWithName("CopyToOutputDirectory").Value.Should().Be("Never"); - - configRemoveContentItem.Remove.Should().Be("src;rootfile.cs"); - } - - [Fact] - public void ConfigurationBuildOptionsWhichHaveMappingsOverlappingWithIncludesInSameConfigurationAndRootBuildOptionsHaveRemovesAndLinkMetadataAndEncompassedItemsAreMerged() - { - var mockProj = RunConfigurationsAndBuildOptionsRuleOnPj(@" - { - ""buildOptions"" : { - ""copyToOutput"": { - ""include"": [""src"", ""root""], - ""exclude"": [""src"", ""rootfile.cs""], - ""includeFiles"": [""src/file1.cs""], - ""excludeFiles"": [""src/file2.cs""] - } - }, - ""configurations"": { - ""testconfig"": { - ""buildOptions"": { - ""copyToOutput"": { - ""include"": [""src"", ""root""], - ""exclude"": [""src"", ""rootfile.cs""], - ""includeFiles"": [""src/file3.cs""], - ""excludeFiles"": [""src/file2.cs""], - ""mappings"": { - ""/some/dir/"" : { - ""include"": [""src""], - ""exclude"": [""src"", ""src/rootfile.cs""] - } - } - } - } - } - } - }"); - - var contentItems = mockProj.Items.Where(item => item.ItemType == "None"); - - contentItems.Count().Should().Be(9); - contentItems.Where(i => i.ConditionChain().Count() == 1).Should().HaveCount(4); - - var rootBuildOptionsContentItems = contentItems.Where(i => i.ConditionChain().Count() == 0).ToList(); - rootBuildOptionsContentItems.Count().Should().Be(5); - foreach (var buildOptionContentItem in rootBuildOptionsContentItems) - { - buildOptionContentItem.GetMetadataWithName("Link").Should().BeNull(); - } - - var configIncludeEncompassedItem = contentItems.FirstOrDefault( - item => item.ConditionChain().Count() > 0 - && item.Update == "root"); - configIncludeEncompassedItem.Should().BeNull(); - - var configIncludeContentItem = contentItems.First( - item => item.ConditionChain().Count() > 0 - && item.Update == "src"); - - var configIncludeContentItem2 = contentItems.First( - item => item.ConditionChain().Count() > 0 - && item.Update.Contains(@"src\file3.cs")); - - var configRemoveContentItem = contentItems.First( - item => item.ConditionChain().Count() > 0 - && !string.IsNullOrEmpty(item.Remove)); - - configIncludeContentItem.Update.Should().Be("src"); - configIncludeContentItem.GetMetadataWithName("Link").Should().NotBeNull(); - configIncludeContentItem.GetMetadataWithName("Link").Value.Should().Be("/some/dir/%(FileName)%(Extension)"); - configIncludeContentItem.GetMetadataWithName("CopyToOutputDirectory").Should().NotBeNull(); - configIncludeContentItem.GetMetadataWithName("CopyToOutputDirectory").Value.Should().Be("Never"); - - configIncludeContentItem2.Updates().Should().BeEquivalentTo(@"src\file3.cs"); - configIncludeContentItem2.GetMetadataWithName("Link").Should().BeNull(); - configIncludeContentItem2.GetMetadataWithName("CopyToOutputDirectory").Should().NotBeNull(); - configIncludeContentItem2.GetMetadataWithName("CopyToOutputDirectory").Value.Should().Be("PreserveNewest"); - - configRemoveContentItem.Removes().Should().BeEquivalentTo("src"); - } - - private ProjectRootElement RunConfigurationsRuleOnPj(string s, string testDirectory = null) - { - testDirectory = testDirectory ?? Temp.CreateDirectory().Path; - return RunRulesOnPj(s, new[] { new MigrateConfigurationsRule() }, testDirectory); - } - - private ProjectRootElement RunConfigurationsAndBuildOptionsRuleOnPj(string s, string testDirectory = null) - { - return RunRulesOnPj( - s, - new IMigrationRule[] - { - new MigrateBuildOptionsRule(), - new MigrateConfigurationsRule() - }, - testDirectory); - } - - private ProjectRootElement RunRulesOnPj(string s, IMigrationRule[] migrationRules, string testDirectory = null) - { - testDirectory = testDirectory ?? Temp.CreateDirectory().Path; - return TemporaryProjectFileRuleRunner.RunRules(migrationRules, s, testDirectory); - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateJsonProperties.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateJsonProperties.cs deleted file mode 100644 index 3aeed10b8..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateJsonProperties.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.Linq; -using Microsoft.Build.Construction; -using Microsoft.DotNet.Tools.Test.Utilities; -using FluentAssertions; -using Microsoft.DotNet.ProjectJsonMigration.Rules; -using Xunit; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenThatIWantToMigrateJsonProperties : TestBase - { - [Fact] - public void It_does_not_migrate_missing_props() - { - var mockProj = RunPropertiesRuleOnPj(@" - {}"); - - mockProj.Properties.Count().Should().Be(0); - } - - [Fact] - public void It_migrates_userSecretsId() - { - var mockProj = RunPropertiesRuleOnPj(@" - { - ""userSecretsId"": ""XYZ"" - }"); - - mockProj.Properties.Count(p => p.Name == "UserSecretsId").Should().Be(1); - mockProj.Properties.First(p => p.Name == "UserSecretsId").Value.Should().Be("XYZ"); - } - - [Fact] - public void It_migrates_empty_userSecretsId() - { - var mockProj = RunPropertiesRuleOnPj(@" - { - ""userSecretsId"": """" - }"); - - mockProj.Properties.Count(p => p.Name == "UserSecretsId").Should().Be(0); - } - - private ProjectRootElement RunPropertiesRuleOnPj(string project, string testDirectory = null) - { - testDirectory = testDirectory ?? Temp.CreateDirectory().Path; - return TemporaryProjectFileRuleRunner.RunRules(new IMigrationRule[] - { - new MigrateJsonPropertiesRule() - }, project, testDirectory); - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigratePackOptions.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigratePackOptions.cs deleted file mode 100644 index 0ac5a9247..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigratePackOptions.cs +++ /dev/null @@ -1,354 +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.Build.Construction; -using Microsoft.DotNet.Tools.Test.Utilities; -using System.IO; -using System.Linq; -using Xunit; -using FluentAssertions; -using Microsoft.DotNet.ProjectJsonMigration.Rules; -using System; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenThatIWantToMigratePackOptions : TestBase - { - [Fact] - public void ItDoesNotMigrateSummary() - { - var mockProj = RunPackOptionsRuleOnPj(@" - { - ""packOptions"": { - ""summary"": ""Some not important summary"" - } - }"); - - EmitsOnlyAlwaysEmittedPackOptionsProperties(mockProj); - } - - [Fact] - public void ItDoesNotMigrateOwner() - { - var mockProj = RunPackOptionsRuleOnPj(@" - { - ""packOptions"": { - ""owner"": ""Some not important owner"" - } - }"); - - EmitsOnlyAlwaysEmittedPackOptionsProperties(mockProj); - } - - [Fact] - public void MigratingEmptyTagsDoesNotPopulatePackageTags() - { - var mockProj = RunPackOptionsRuleOnPj(@" - { - ""packOptions"": { - ""tags"": [] - } - }"); - - mockProj.Properties.Count(p => p.Name == "PackageTags").Should().Be(0); - } - - [Fact] - public void MigratingTagsPopulatesPackageTagsSemicolonDelimited() - { - var mockProj = RunPackOptionsRuleOnPj(@" - { - ""packOptions"": { - ""tags"": [""hyperscale"", ""cats""] - } - }"); - - mockProj.Properties.Count(p => p.Name == "PackageTags").Should().Be(1); - mockProj.Properties.First(p => p.Name == "PackageTags").Value.Should().Be("hyperscale;cats"); - } - - [Fact] - public void MigratingReleaseNotesPopulatesPackageReleaseNotes() - { - var mockProj = RunPackOptionsRuleOnPj(@" - { - ""packOptions"": { - ""releaseNotes"": ""Some release notes value."" - } - }"); - - mockProj.Properties.Count(p => p.Name == "PackageReleaseNotes").Should().Be(1); - mockProj.Properties.First(p => p.Name == "PackageReleaseNotes").Value.Should() - .Be("Some release notes value."); - } - - [Fact] - public void MigratingIconUrlPopulatesPackageIconUrl() - { - var mockProj = RunPackOptionsRuleOnPj(@" - { - ""packOptions"": { - ""iconUrl"": ""http://www.mylibrary.gov/favicon.ico"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "PackageIconUrl").Should().Be(1); - mockProj.Properties.First(p => p.Name == "PackageIconUrl").Value.Should() - .Be("http://www.mylibrary.gov/favicon.ico"); - } - - [Fact] - public void MigratingProjectUrlPopulatesPackageProjectUrl() - { - var mockProj = RunPackOptionsRuleOnPj(@" - { - ""packOptions"": { - ""projectUrl"": ""http://www.url.to.library.com"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "PackageProjectUrl").Should().Be(1); - mockProj.Properties.First(p => p.Name == "PackageProjectUrl").Value.Should() - .Be("http://www.url.to.library.com"); - } - - [Fact] - public void MigratingLicenseUrlPopulatesPackageLicenseUrl() - { - var mockProj = RunPackOptionsRuleOnPj(@" - { - ""packOptions"": { - ""licenseUrl"": ""http://www.url.to.library.com/licence"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "PackageLicenseUrl").Should().Be(1); - mockProj.Properties.First(p => p.Name == "PackageLicenseUrl").Value.Should() - .Be("http://www.url.to.library.com/licence"); - } - - [Fact] - public void MigratingRequireLicenseAcceptancePopulatesPackageRequireLicenseAcceptance() - { - var mockProj = RunPackOptionsRuleOnPj(@" - { - ""packOptions"": { - ""requireLicenseAcceptance"": ""true"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "PackageRequireLicenseAcceptance").Should().Be(1); - mockProj.Properties.First(p => p.Name == "PackageRequireLicenseAcceptance").Value.Should().Be("true"); - } - - [Fact] - public void MigratingRequireLicenseAcceptancePopulatesPackageRequireLicenseAcceptanceEvenIfItsValueIsFalse() - { - var mockProj = RunPackOptionsRuleOnPj(@" - { - ""packOptions"": { - ""requireLicenseAcceptance"": ""false"" - } - }"); - - mockProj.Properties.Count(p => p.Name == "PackageRequireLicenseAcceptance").Should().Be(1); - mockProj.Properties.First(p => p.Name == "PackageRequireLicenseAcceptance").Value.Should().Be("false"); - } - - [Fact] - public void MigratingRepositoryTypePopulatesRepositoryType() - { - var mockProj = RunPackOptionsRuleOnPj(@" - { - ""packOptions"": { - ""repository"": { - ""type"": ""git"" - } - } - }"); - - mockProj.Properties.Count(p => p.Name == "RepositoryType").Should().Be(1); - mockProj.Properties.First(p => p.Name == "RepositoryType").Value.Should().Be("git"); - } - - [Fact] - public void MigratingRepositoryUrlPopulatesRepositoryUrl() - { - var mockProj = RunPackOptionsRuleOnPj(@" - { - ""packOptions"": { - ""repository"": { - ""url"": ""http://github.com/dotnet/cli"" - } - } - }"); - - mockProj.Properties.Count(p => p.Name == "RepositoryUrl").Should().Be(1); - mockProj.Properties.First(p => p.Name == "RepositoryUrl").Value.Should().Be("http://github.com/dotnet/cli"); - } - - [Fact] - public void MigratingFilesWithoutMappingsPopulatesContentWithSamePathAsIncludeAndPackTrue() - { - var mockProj = RunPackOptionsRuleOnPj(@" - { - ""packOptions"": { - ""files"": { - ""include"": [""path/to/some/file.cs"", ""path/to/some/other/file.cs""] - } - } - }"); - - var contentItems = mockProj.Items - .Where(item => item.ItemType.Equals("None", StringComparison.Ordinal)) - .Where(item => item.GetMetadataWithName("Pack").Value == "true"); - - contentItems.Count().Should().Be(1); - contentItems.First().Update.Should().Be(@"path\to\some\file.cs;path\to\some\other\file.cs"); - } - - [Fact] - public void MigratingFilesWithExcludePopulatesNoneWithPackFalseForTheExcludedFiles() - { - var mockProj = RunPackOptionsRuleOnPj(@" - { - ""packOptions"": { - ""files"": { - ""include"": [""path/to/some/file.cs"", ""path/to/some/other/file.cs""], - ""exclude"": [""path/to/file/to/exclude.cs""] - } - } - }"); - - foreach (var item in mockProj.Items.Where(i => i.ItemType.Equals("None", StringComparison.Ordinal))) - { - Console.WriteLine($"Update: {item.Update}, Include: {item.Include}, Remove: {item.Remove}"); - foreach(var meta in item.Metadata) - { - Console.WriteLine($"\tMetadata: Name: {meta.Name}, Value: {meta.Value}"); - } - - foreach(var condition in item.ConditionChain()) - { - Console.WriteLine($"\tCondition: {condition}"); - } - } - - var contentItemsToInclude = mockProj.Items - .Where(item => item.ItemType.Equals("None", StringComparison.Ordinal)) - .Where(item => item.GetMetadataWithName("Pack").Value == "true"); - - contentItemsToInclude.Count().Should().Be(1); - contentItemsToInclude.First().Update.Should().Be(@"path\to\some\file.cs;path\to\some\other\file.cs"); - - var contentItemsToExclude = mockProj.Items - .Where(item => item.ItemType.Equals("None", StringComparison.Ordinal)) - .Where(item => item.GetMetadataWithName("Pack").Value == "false"); - - contentItemsToExclude.Count().Should().Be(1); - contentItemsToExclude.First().Update.Should().Be(@"path\to\file\to\exclude.cs"); - } - - [Fact] - public void MigratingFilesWithMappingsPopulatesContentPackagePathMetadata() - { - var mockProj = RunPackOptionsRuleOnPj(@" - { - ""packOptions"": { - ""files"": { - ""include"": [""path/to/some/file.cs""], - ""mappings"": { - ""some/other/path/file.cs"": ""path/to/some/file.cs"" - } - } - } - }"); - - var contentItems = mockProj.Items - .Where(item => item.ItemType.Equals("None", StringComparison.Ordinal)) - .Where(item => - item.GetMetadataWithName("Pack").Value == "true" && - item.GetMetadataWithName("PackagePath") != null); - - contentItems.Count().Should().Be(1); - contentItems.First().Update.Should().Be(@"path\to\some\file.cs"); - contentItems.First().GetMetadataWithName("PackagePath").Value.Should().Be( - Path.Combine("some", "other", "path")); - } - - [Fact] - public void MigratingFilesWithMappingsToRootPopulatesContentPackagePathMetadataButLeavesItEmpty() - { - var mockProj = RunPackOptionsRuleOnPj(@" - { - ""packOptions"": { - ""files"": { - ""include"": [""path/to/some/file.cs""], - ""mappings"": { - "".file.cs"": ""path/to/some/file.cs"" - } - } - } - }"); - - var contentItems = mockProj.Items - .Where(item => item.ItemType.Equals("None", StringComparison.Ordinal)) - .Where(item => - item.GetMetadataWithName("Pack").Value == "true" && - item.GetMetadataWithName("PackagePath") != null); - - contentItems.Count().Should().Be(1); - contentItems.First().Update.Should().Be(@"path\to\some\file.cs"); - contentItems.First().GetMetadataWithName("PackagePath").Value.Should().BeEmpty(); - } - - [Fact] - public void MigratingSameFileWithMultipleMappingsStringJoinsTheMappingsInPackagePath() - { - var mockProj = RunPackOptionsRuleOnPj(@" - { - ""packOptions"": { - ""files"": { - ""include"": [""path/to/some/file.cs""], - ""mappings"": { - ""other/path/file.cs"": ""path/to/some/file.cs"", - ""different/path/file1.cs"": ""path/to/some/file.cs"" - } - } - } - }"); - - var expectedPackagePath = string.Join( - ";", - new [] { - Path.Combine("different", "path"), - Path.Combine("other", "path") - }); - - var contentItems = mockProj.Items - .Where(item => item.ItemType.Equals("None", StringComparison.Ordinal)) - .Where(item => - item.GetMetadataWithName("Pack").Value == "true" && - item.GetMetadataWithName("PackagePath") != null); - - contentItems.Count().Should().Be(1); - contentItems.First().Update.Should().Be(@"path\to\some\file.cs"); - contentItems.First().GetMetadataWithName("PackagePath").Value.Should().Be(expectedPackagePath); - } - - private ProjectRootElement RunPackOptionsRuleOnPj(string packOptions, string testDirectory = null) - { - testDirectory = testDirectory ?? Temp.CreateDirectory().Path; - return TemporaryProjectFileRuleRunner.RunRules(new IMigrationRule[] - { - new MigratePackOptionsRule() - }, packOptions, testDirectory); - } - - private void EmitsOnlyAlwaysEmittedPackOptionsProperties(ProjectRootElement project) - { - project.Properties.Count().Should().Be(1); - project.Properties.All(p => p.Name == "PackageRequireLicenseAcceptance").Should().BeTrue(); - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigratePackageDependencies.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigratePackageDependencies.cs deleted file mode 100644 index c9c348e59..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigratePackageDependencies.cs +++ /dev/null @@ -1,521 +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.Build.Construction; -using Microsoft.DotNet.Tools.Test.Utilities; -using System.Linq; -using Xunit; -using FluentAssertions; -using Microsoft.DotNet.ProjectJsonMigration; -using Microsoft.DotNet.ProjectJsonMigration.Rules; -using System; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenThatIWantToMigratePackageDependencies : PackageDependenciesTestBase - { - [Fact] - public void ItMigratesBasicPackageReference() - { - var mockProj = RunPackageDependenciesRuleOnPj(@" - { - ""dependencies"": { - ""APackage"" : ""1.0.0-preview"", - ""BPackage"" : ""1.0.0"" - } - }"); - - EmitsPackageReferences(mockProj, Tuple.Create("APackage", "1.0.0-preview", ""), Tuple.Create("BPackage", "1.0.0", "")); - } - - [Fact] - public void ItMigratesTypeBuildToPrivateAssets() - { - var mockProj = RunPackageDependenciesRuleOnPj(@" - { - ""dependencies"": { - ""APackage"" : { - ""version"": ""1.0.0-preview"", - ""type"": ""build"" - } - } - }"); - - - var packageRef = mockProj.Items.First(i => i.Include == "APackage" && i.ItemType == "PackageReference"); - - var privateAssetsMetadata = packageRef.GetMetadataWithName("PrivateAssets"); - privateAssetsMetadata.Value.Should().NotBeNull(); - privateAssetsMetadata.Value.Should().Be("All"); - } - - [Fact] - public void ItMigratesSuppressParentArrayToPrivateAssets() - { - var mockProj = RunPackageDependenciesRuleOnPj(@" - { - ""dependencies"": { - ""APackage"" : { - ""version"": ""1.0.0-preview"", - ""suppressParent"":[ ""runtime"", ""native"" ] - } - } - }"); - var packageRef = mockProj.Items.First(i => i.Include == "APackage" && i.ItemType == "PackageReference"); - - var privateAssetsMetadata = packageRef.GetMetadataWithName("PrivateAssets"); - privateAssetsMetadata.Value.Should().NotBeNull(); - privateAssetsMetadata.Value.Should().Be("Native;Runtime"); - } - - [Fact] - public void ItMigratesSuppressParentStringToPrivateAssets() - { - var mockProj = RunPackageDependenciesRuleOnPj(@" - { - ""dependencies"": { - ""APackage"" : { - ""version"": ""1.0.0-preview"", - ""suppressParent"":""runtime"" - } - } - }"); - var packageRef = mockProj.Items.First(i => i.Include == "APackage" && i.ItemType == "PackageReference"); - - var privateAssetsMetadata = packageRef.GetMetadataWithName("PrivateAssets"); - privateAssetsMetadata.Value.Should().NotBeNull(); - privateAssetsMetadata.Value.Should().Be("Runtime"); - } - - [Fact] - public void ItMigratesIncludeExcludeArraysToIncludeAssets() - { - var mockProj = RunPackageDependenciesRuleOnPj(@" - { - ""dependencies"": { - ""APackage"" : { - ""version"": ""1.0.0-preview"", - ""include"": [ ""compile"", ""runtime"", ""native"" ], - ""exclude"": [ ""native"" ] - } - } - }"); - var packageRef = mockProj.Items.First(i => i.Include == "APackage" && i.ItemType == "PackageReference"); - - var includeAssetsMetadata = packageRef.GetMetadataWithName("IncludeAssets"); - includeAssetsMetadata.Value.Should().NotBeNull(); - includeAssetsMetadata.Value.Should().Be("Compile;Runtime"); - } - - [Fact] - public void ItMigratesIncludeStringToIncludeAssets() - { - var mockProj = RunPackageDependenciesRuleOnPj(@" - { - ""dependencies"": { - ""APackage"" : { - ""version"": ""1.0.0-preview"", - ""include"": ""compile"", - ""exclude"": ""runtime"" - } - } - }"); - var packageRef = mockProj.Items.First(i => i.Include == "APackage" && i.ItemType == "PackageReference"); - - var includeAssetsMetadata = packageRef.GetMetadataWithName("IncludeAssets"); - includeAssetsMetadata.Value.Should().NotBeNull(); - includeAssetsMetadata.Value.Should().Be("Compile"); - } - - [Fact] - public void ItMigratesIncludeExcludeOverlappingStringsToIncludeAssets() - { - var mockProj = RunPackageDependenciesRuleOnPj(@" - { - ""dependencies"": { - ""APackage"" : { - ""version"": ""1.0.0-preview"", - ""include"": ""compile"", - ""exclude"": ""compile"", - } - } - }"); - var packageRef = mockProj.Items.First(i => i.Include == "APackage" && i.ItemType == "PackageReference"); - - var includeAssetsMetadata = packageRef.GetMetadataWithName("IncludeAssets"); - includeAssetsMetadata.Value.Should().NotBeNull(); - includeAssetsMetadata.Value.Should().Be("None"); - } - - - [Fact] - public void ItMigratesTools() - { - var mockProj = RunPackageDependenciesRuleOnPj(@" - { - ""tools"": { - ""APackage"" : ""1.0.0-preview"", - ""BPackage"" : ""1.0.0"" - } - }"); - - EmitsToolReferences(mockProj, Tuple.Create("APackage", "1.0.0-preview"), Tuple.Create("BPackage", "1.0.0")); - } - - [Fact] - public void ItMigratesImportsPerFramework() - { - var importPropertyName = "PackageTargetFallback"; - - var mockProj = RunPackageDependenciesRuleOnPj(@" - { - ""frameworks"": { - ""netcoreapp1.0"" : { - ""imports"": [""netstandard1.3"", ""net451""] - }, - ""netstandard1.3"" : { - ""imports"": [""net451""] - }, - ""net451"" : { - ""imports"": ""netstandard1.3"" - } - } - }"); - - var imports = mockProj.Properties.Where(p => p.Name == importPropertyName); - imports.Should().HaveCount(3); - - var netcoreappImport = imports.First(p => p.Condition.Contains("netcoreapp1.0")); - var netstandardImport = imports.First(p => p.Condition.Contains("netstandard1.3")); - var net451Import = imports.First(p => p.Condition.Contains("net451")); - - netcoreappImport.Should().NotBe(netstandardImport); - - netcoreappImport.Condition.Should().Be(" '$(TargetFramework)' == 'netcoreapp1.0' "); - netstandardImport.Condition.Should().Be(" '$(TargetFramework)' == 'netstandard1.3' "); - net451Import.Condition.Should().Be(" '$(TargetFramework)' == 'net451' "); - - netcoreappImport.Value.Split(';').Should().BeEquivalentTo($"$({importPropertyName})", "netstandard1.3", "net451"); - netstandardImport.Value.Split(';').Should().BeEquivalentTo($"$({importPropertyName})", "net451"); - net451Import.Value.Split(';').Should().BeEquivalentTo($"$({importPropertyName})", "netstandard1.3"); - } - - [Fact] - public void ItDoesNotAddConditionToPackageTargetFallBackWhenMigratingASingleTFM() - { - var importPropertyName = "PackageTargetFallback"; - - var mockProj = RunPackageDependenciesRuleOnPj(@" - { - ""frameworks"": { - ""netcoreapp1.0"" : { - ""imports"": [""netstandard1.3"", ""net451""] - } - } - }"); - - var imports = mockProj.Properties.Where(p => p.Name == importPropertyName); - imports.Should().HaveCount(1); - - imports.Single().Condition.Should().BeEmpty(); - } - - [Fact] - public void ItAutoAddDesktopReferencesDuringMigrate() - { - var mockProj = RunPackageDependenciesRuleOnPj(@" - { - ""frameworks"": { - ""net35"" : {}, - ""net4"" : {}, - ""net451"" : {} - } - }"); - - var itemGroup = mockProj.ItemGroups.Where(i => i.Condition == " '$(TargetFramework)' == 'net451' "); - itemGroup.Should().HaveCount(1); - itemGroup.First().Items.Should().HaveCount(2); - var items = itemGroup.First().Items.ToArray(); - items[0].Include.Should().Be("System"); - items[1].Include.Should().Be("Microsoft.CSharp"); - - itemGroup = mockProj.ItemGroups.Where(i => i.Condition == " '$(TargetFramework)' == 'net40' "); - itemGroup.Should().HaveCount(1); - itemGroup.First().Items.Should().HaveCount(2); - items = itemGroup.First().Items.ToArray(); - items[0].Include.Should().Be("System"); - items[1].Include.Should().Be("Microsoft.CSharp"); - - itemGroup = mockProj.ItemGroups.Where(i => i.Condition == " '$(TargetFramework)' == 'net35' "); - itemGroup.Should().HaveCount(1); - itemGroup.First().Items.Should().HaveCount(1); - items = itemGroup.First().Items.ToArray(); - items[0].Include.Should().Be("System"); - } - - [Fact] - public void ItMigratesTestProjectsToHaveTestSdk() - { - var mockProj = RunPackageDependenciesRuleOnPj(@" - { - ""buildOptions"": { - ""emitEntryPoint"": true - }, - ""frameworks"": { - ""netcoreapp1.0"": {} - }, - ""testRunner"": ""somerunner"" - }"); - - mockProj.Items.Should().ContainSingle( - i => (i.Include == "Microsoft.NET.Test.Sdk" && - i.ItemType == "PackageReference" && - i.GetMetadataWithName("Version").Value == "15.0.0-preview-20170106-08" && - i.GetMetadataWithName("Version").ExpressedAsAttribute)); - - mockProj.Items.Should().NotContain( - i => (i.Include == "xunit" && i.ItemType == "PackageReference")); - - mockProj.Items.Should().NotContain( - i => (i.Include == "xunit.runner.visualstudio" && i.ItemType == "PackageReference")); - - mockProj.Items.Should().NotContain( - i => (i.Include == "MSTest.TestAdapter" && i.ItemType == "PackageReference")); - - mockProj.Items.Should().NotContain( - i => (i.Include == "MSTest.TestFramework" && i.ItemType == "PackageReference")); - } - - [Fact] - public void ItMigratesTestProjectsToHaveTestSdkAndXunitPackagedependencies() - { - var mockProj = RunPackageDependenciesRuleOnPj(@" - { - ""buildOptions"": { - ""emitEntryPoint"": true - }, - ""frameworks"": { - ""netcoreapp1.0"": {} - }, - ""testRunner"": ""xunit"" - }"); - - mockProj.Items.Should().ContainSingle( - i => (i.Include == "Microsoft.NET.Test.Sdk" && - i.ItemType == "PackageReference" && - i.GetMetadataWithName("Version").Value == "15.0.0-preview-20170106-08") && - i.GetMetadataWithName("Version").ExpressedAsAttribute); - - mockProj.Items.Should().ContainSingle( - i => (i.Include == "xunit" && - i.ItemType == "PackageReference" && - i.GetMetadataWithName("Version").Value == "2.2.0-beta5-build3474" && - i.GetMetadataWithName("Version").ExpressedAsAttribute)); - - mockProj.Items.Should().ContainSingle( - i => (i.Include == "xunit.runner.visualstudio" && - i.ItemType == "PackageReference" && - i.GetMetadataWithName("Version").Value == "2.2.0-beta5-build1225" && - i.GetMetadataWithName("Version").ExpressedAsAttribute)); - - mockProj.Items.Should().NotContain( - i => (i.Include == "MSTest.TestAdapter" && i.ItemType == "PackageReference")); - - mockProj.Items.Should().NotContain( - i => (i.Include == "MSTest.TestFramework" && i.ItemType == "PackageReference")); - } - - [Fact] - public void ItMigratesTestProjectsToHaveTestSdkAndXunitPackagedependenciesOverwriteExistingPackagedependencies() - { - var mockProj = RunPackageDependenciesRuleOnPj(@" - { - ""buildOptions"": { - ""emitEntryPoint"": true - }, - ""dependencies"": { - ""xunit"": ""2.2.0-beta3-build3330"" - }, - ""frameworks"": { - ""netcoreapp1.0"": {} - }, - ""testRunner"": ""xunit"" - }"); - - mockProj.Items.Should().ContainSingle( - i => (i.Include == "Microsoft.NET.Test.Sdk" && - i.ItemType == "PackageReference" && - i.GetMetadataWithName("Version").Value == "15.0.0-preview-20170106-08" && - i.GetMetadataWithName("Version").ExpressedAsAttribute)); - - mockProj.Items.Should().ContainSingle( - i => (i.Include == "xunit" && - i.ItemType == "PackageReference" && - i.GetMetadataWithName("Version").Value == "2.2.0-beta5-build3474" && - i.GetMetadataWithName("Version").ExpressedAsAttribute)); - - mockProj.Items.Should().ContainSingle( - i => (i.Include == "xunit.runner.visualstudio" && - i.ItemType == "PackageReference" && - i.GetMetadataWithName("Version").Value == "2.2.0-beta5-build1225" && - i.GetMetadataWithName("Version").ExpressedAsAttribute)); - - mockProj.Items.Should().NotContain( - i => (i.Include == "MSTest.TestAdapter" && i.ItemType == "PackageReference")); - - mockProj.Items.Should().NotContain( - i => (i.Include == "MSTest.TestFramework" && i.ItemType == "PackageReference")); - } - - [Fact] - public void ItMigratesTestProjectsToHaveTestSdkAndMstestPackagedependencies() - { - var mockProj = RunPackageDependenciesRuleOnPj(@" - { - ""buildOptions"": { - ""emitEntryPoint"": true - }, - ""frameworks"": { - ""netcoreapp1.0"": {} - }, - ""testRunner"": ""mstest"" - }"); - - mockProj.Items.Should().ContainSingle( - i => (i.Include == "Microsoft.NET.Test.Sdk" && - i.ItemType == "PackageReference" && - i.GetMetadataWithName("Version").Value == "15.0.0-preview-20170106-08" && - i.GetMetadataWithName("Version").ExpressedAsAttribute)); - - mockProj.Items.Should().ContainSingle( - i => (i.Include == "MSTest.TestAdapter" && - i.ItemType == "PackageReference" && - i.GetMetadataWithName("Version").Value == "1.1.8-rc" && - i.GetMetadataWithName("Version").ExpressedAsAttribute)); - - mockProj.Items.Should().ContainSingle( - i => (i.Include == "MSTest.TestFramework" && - i.ItemType == "PackageReference" && - i.GetMetadataWithName("Version").Value == "1.0.8-rc" && - i.GetMetadataWithName("Version").ExpressedAsAttribute)); - - mockProj.Items.Should().NotContain( - i => (i.Include == "xunit" && i.ItemType == "PackageReference")); - - mockProj.Items.Should().NotContain( - i => (i.Include == "xunit.runner.visualstudio" && i.ItemType == "PackageReference")); - } - - [Fact] - public void ItMigratesMicrosoftNETCoreAppMetaPackageToRuntimeFrameworkVersionProperty() - { - var mockProj = RunPackageDependenciesRuleOnPj( - @"{ ""dependencies"": { ""Microsoft.NETCore.App"" : { ""version"": ""1.1.0"", ""type"": ""build"" } } }"); - - mockProj.Items.Should().NotContain( - i => i.Include == "Microsoft.NETCore.App" && i.ItemType == "PackageReference"); - mockProj.Properties.Should().ContainSingle(p => p.Name == "RuntimeFrameworkVersion").Which.Value.Should().Be("1.1.1"); - } - - [Fact] - public void ItMigratesMicrosoftNETCoreAppMetaPackageToRuntimeFrameworkVersionPropertyConditionedOnTFMWhenMultiTFM() - { - var mockProj = RunPackageDependenciesRuleOnPj(@" - { - ""frameworks"": { - ""netcoreapp1.0"": { - ""dependencies"": { - ""Microsoft.NETCore.App"": ""1.1.0"" - } - }, - ""netcoreapp1.1"": { - } - } - }"); - - mockProj.Items.Should().NotContain( - i => i.Include == "Microsoft.NETCore.App" && i.ItemType == "PackageReference"); - var runtimeFrameworkVersion = mockProj.Properties.Should().ContainSingle(p => p.Name == "RuntimeFrameworkVersion").Which; - runtimeFrameworkVersion.Value.Should().Be("1.1.1"); - runtimeFrameworkVersion.Condition.Should().Contain("netcoreapp1.0"); - } - - [Fact] - public void ItMigratesMicrosoftNETCoreAppMetaPackageToRuntimeFrameworkVersionPropertyWithNoConditionedOnTFMWhenSingleTFM() - { - var mockProj = RunPackageDependenciesRuleOnPj(@" - { - ""frameworks"": { - ""netcoreapp1.0"": { - ""dependencies"": { - ""Microsoft.NETCore.App"": ""1.1.0"" - } - } - } - }"); - - mockProj.Items.Should().NotContain( - i => i.Include == "Microsoft.NETCore.App" && i.ItemType == "PackageReference"); - var runtimeFrameworkVersion = mockProj.Properties.Should().ContainSingle(p => p.Name == "RuntimeFrameworkVersion").Which; - runtimeFrameworkVersion.Value.Should().Be("1.1.1"); - runtimeFrameworkVersion.Condition.Should().BeEmpty(); - } - - [Fact] - public void ItMigratesNETStandardLibraryMetaPackageToNetStandardImplicitPackageVersionProperty() - { - var mockProj = RunPackageDependenciesRuleOnPj( - @"{ ""dependencies"": { ""NETStandard.Library"" : { ""version"": ""1.6.0"", ""type"": ""build"" } } }"); - - mockProj.Items.Should().NotContain( - i => i.Include == "NETStandard.Library" && i.ItemType == "PackageReference"); - mockProj.Properties.Should().ContainSingle(p => p.Name == "NetStandardImplicitPackageVersion").Which.Value.Should().Be("1.6.0"); - } - - [Fact] - public void ItMigratesNETStandardLibraryMetaPackageToNetStandardImplicitPackageVersionPropertyConditionedOnTFMWhenMultiTFM() - { - var mockProj = RunPackageDependenciesRuleOnPj(@" - { - ""frameworks"": { - ""netstandard1.3"": { - ""dependencies"": { - ""NETStandard.Library"": ""1.6.0"" - } - }, - ""netstandard1.5"": { - } - } - }"); - - mockProj.Items.Should().NotContain( - i => i.Include == "NETStandard.Library" && i.ItemType == "PackageReference"); - var netStandardImplicitPackageVersion = - mockProj.Properties.Should().ContainSingle(p => p.Name == "NetStandardImplicitPackageVersion").Which; - netStandardImplicitPackageVersion.Value.Should().Be("1.6.0"); - netStandardImplicitPackageVersion.Condition.Should().Contain("netstandard1.3"); - } - - [Fact] - public void ItMigratesNETStandardLibraryMetaPackageToNetStandardImplicitPackageVersionPropertyWithNoConditionOnTFMWhenSingleTFM() - { - var mockProj = RunPackageDependenciesRuleOnPj(@" - { - ""frameworks"": { - ""netstandard1.3"": { - ""dependencies"": { - ""NETStandard.Library"": ""1.6.0"" - } - } - } - }"); - - mockProj.Items.Should().NotContain( - i => i.Include == "NETStandard.Library" && i.ItemType == "PackageReference"); - var netStandardImplicitPackageVersion = - mockProj.Properties.Should().ContainSingle(p => p.Name == "NetStandardImplicitPackageVersion").Which; - netStandardImplicitPackageVersion.Value.Should().Be("1.6.0"); - netStandardImplicitPackageVersion.Condition.Should().BeEmpty(); - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigratePackagesToTheirLTSAndFTSVersions.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigratePackagesToTheirLTSAndFTSVersions.cs deleted file mode 100644 index c90929233..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigratePackagesToTheirLTSAndFTSVersions.cs +++ /dev/null @@ -1,319 +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.Tools.Test.Utilities; -using System.Linq; -using Xunit; -using FluentAssertions; -using System; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenThatIWantToMigratePackagesToTheirLTSAndFTSVersions : PackageDependenciesTestBase - { - [Theory] - [InlineData("1.0.0", "1.0.4")] - [InlineData("1.0.3-preview2", "1.0.4")] - [InlineData("1.1.0", "1.1.1")] - [InlineData("1.1.1-preview2", "1.1.1")] - public void ItUpliftsMicrosoftNETCoreAppMetaPackages( - string sourceVersion, - string targetVersion) - { - ValidateNetCoreAppMetaPackageMigration(sourceVersion, targetVersion); - } - - [Fact] - public void ItDoesNotDropMicrosoftNETCoreAppMetapackageThatDoNotHaveAMatchingVersionInTheMapping() - { - ValidateNetCoreAppMetaPackageMigration("1.2.0-*", "1.2.0-*"); - } - - [Theory] - [InlineData("1.4.0", "1.6.0")] - [InlineData("1.5.0", "1.6.0")] - public void ItUpliftsNetStandardMetaPackages( - string sourceVersion, - string targetVersion) - { - ValidateNetStandardMetaPackageMigration(sourceVersion, targetVersion); - } - - [Fact] - public void ItDoesNotDropNetStandardMetapackageThatDoNotHaveAMatchingVersionInTheMapping() - { - ValidateNetStandardMetaPackageMigration("1.6.2-*", "1.6.2-*"); - } - - [Theory] - [InlineData("System.Text.Encodings.Web", "4.4.0-*", "System.Text.Encodings.Web", "4.4.0-*")] - public void ItDoesNotDropDependenciesThatDoNotHaveAMatchingVersionInTheMapping( - string sourcePackageName, - string sourceVersion, - string targetPackageName, - string targetVersion) - { - ValidatePackageMigration(sourcePackageName, sourceVersion, targetPackageName, targetVersion); - } - - [Theory] - [InlineData("Microsoft.AspNetCore.Antiforgery", "1.0.0", "Microsoft.AspNetCore.Antiforgery", ConstantPackageVersions.AspNetLTSPackagesVersion)] - [InlineData("Microsoft.AspNetCore.Mvc", "1.0.0", "Microsoft.AspNetCore.Mvc", ConstantPackageVersions.AspNetLTSPackagesVersion)] - [InlineData("Microsoft.AspNetCore.Mvc.Abstractions", "1.0.0", "Microsoft.AspNetCore.Mvc.Abstractions", ConstantPackageVersions.AspNetLTSPackagesVersion)] - [InlineData("Microsoft.AspNetCore.Mvc.ApiExplorer", "1.0.0", "Microsoft.AspNetCore.Mvc.ApiExplorer", ConstantPackageVersions.AspNetLTSPackagesVersion)] - [InlineData("Microsoft.AspNetCore.Mvc.Core", "1.0.0", "Microsoft.AspNetCore.Mvc.Core", ConstantPackageVersions.AspNetLTSPackagesVersion)] - [InlineData("Microsoft.AspNetCore.Mvc.Cors", "1.0.0", "Microsoft.AspNetCore.Mvc.Cors", ConstantPackageVersions.AspNetLTSPackagesVersion)] - [InlineData("Microsoft.AspNetCore.Mvc.DataAnnotations", "1.0.0", "Microsoft.AspNetCore.Mvc.DataAnnotations", ConstantPackageVersions.AspNetLTSPackagesVersion)] - [InlineData("Microsoft.AspNetCore.Mvc.Formatters.Json", "1.0.0", "Microsoft.AspNetCore.Mvc.Formatters.Json", ConstantPackageVersions.AspNetLTSPackagesVersion)] - [InlineData("Microsoft.AspNetCore.Mvc.Formatters.Xml", "1.0.0", "Microsoft.AspNetCore.Mvc.Formatters.Xml", ConstantPackageVersions.AspNetLTSPackagesVersion)] - [InlineData("Microsoft.AspNetCore.Mvc.Localization", "1.0.0", "Microsoft.AspNetCore.Mvc.Localization", ConstantPackageVersions.AspNetLTSPackagesVersion)] - [InlineData("Microsoft.AspNetCore.Mvc.Razor", "1.0.0", "Microsoft.AspNetCore.Mvc.Razor", ConstantPackageVersions.AspNetLTSPackagesVersion)] - [InlineData("Microsoft.AspNetCore.Mvc.Razor.Host", "1.0.0", "Microsoft.AspNetCore.Mvc.Razor.Host", ConstantPackageVersions.AspNetLTSPackagesVersion)] - [InlineData("Microsoft.AspNetCore.Mvc.TagHelpers", "1.0.0", "Microsoft.AspNetCore.Mvc.TagHelpers", ConstantPackageVersions.AspNetLTSPackagesVersion)] - [InlineData("Microsoft.AspNetCore.Mvc.ViewFeatures", "1.0.0", "Microsoft.AspNetCore.Mvc.ViewFeatures", ConstantPackageVersions.AspNetLTSPackagesVersion)] - [InlineData("Microsoft.AspNetCore.Mvc.WebApiCompatShim", "1.0.0", "Microsoft.AspNetCore.Mvc.WebApiCompatShim", ConstantPackageVersions.AspNetLTSPackagesVersion)] - [InlineData("Microsoft.AspNetCore.Routing", "1.0.0", "Microsoft.AspNetCore.Routing", ConstantPackageVersions.AspNetLTSPackagesVersion)] - [InlineData("Microsoft.AspNetCore.Routing.Abstractions", "1.0.0", "Microsoft.AspNetCore.Routing.Abstractions", ConstantPackageVersions.AspNetLTSPackagesVersion)] - [InlineData("Microsoft.AspNetCore.Server.Kestrel", "1.0.0", "Microsoft.AspNetCore.Server.Kestrel", ConstantPackageVersions.AspNetLTSPackagesVersion)] - [InlineData("Microsoft.AspNetCore.Server.Kestrel.Https", "1.0.0", "Microsoft.AspNetCore.Server.Kestrel.Https", ConstantPackageVersions.AspNetLTSPackagesVersion)] - [InlineData("Microsoft.AspNetCore.Antiforgery", "1.1.0", "Microsoft.AspNetCore.Antiforgery", "1.1.1")] - [InlineData("Microsoft.AspNetCore.Mvc", "1.1.0", "Microsoft.AspNetCore.Mvc", "1.1.2")] - [InlineData("Microsoft.AspNetCore.Mvc.Abstractions", "1.1.0", "Microsoft.AspNetCore.Mvc.Abstractions", "1.1.2")] - [InlineData("Microsoft.AspNetCore.Mvc.ApiExplorer", "1.1.0", "Microsoft.AspNetCore.Mvc.ApiExplorer", "1.1.2")] - [InlineData("Microsoft.AspNetCore.Mvc.Core", "1.1.0", "Microsoft.AspNetCore.Mvc.Core", "1.1.2")] - [InlineData("Microsoft.AspNetCore.Mvc.Cors", "1.1.0", "Microsoft.AspNetCore.Mvc.Cors", "1.1.2")] - [InlineData("Microsoft.AspNetCore.Mvc.DataAnnotations", "1.1.0", "Microsoft.AspNetCore.Mvc.DataAnnotations", "1.1.2")] - [InlineData("Microsoft.AspNetCore.Mvc.Formatters.Json", "1.1.0", "Microsoft.AspNetCore.Mvc.Formatters.Json", "1.1.2")] - [InlineData("Microsoft.AspNetCore.Mvc.Formatters.Xml", "1.1.0", "Microsoft.AspNetCore.Mvc.Formatters.Xml", "1.1.2")] - [InlineData("Microsoft.AspNetCore.Mvc.Localization", "1.1.0", "Microsoft.AspNetCore.Mvc.Localization", "1.1.2")] - [InlineData("Microsoft.AspNetCore.Mvc.Razor", "1.1.0", "Microsoft.AspNetCore.Mvc.Razor", "1.1.2")] - [InlineData("Microsoft.AspNetCore.Mvc.Razor.Host", "1.1.0", "Microsoft.AspNetCore.Mvc.Razor.Host", "1.1.2")] - [InlineData("Microsoft.AspNetCore.Mvc.TagHelpers", "1.1.0", "Microsoft.AspNetCore.Mvc.TagHelpers", "1.1.2")] - [InlineData("Microsoft.AspNetCore.Mvc.ViewFeatures", "1.1.0", "Microsoft.AspNetCore.Mvc.ViewFeatures", "1.1.2")] - [InlineData("Microsoft.AspNetCore.Mvc.WebApiCompatShim", "1.1.0", "Microsoft.AspNetCore.Mvc.WebApiCompatShim", "1.1.2")] - [InlineData("Microsoft.AspNetCore.Routing", "1.1.0", "Microsoft.AspNetCore.Routing", "1.1.1")] - [InlineData("Microsoft.AspNetCore.Routing.Abstractions", "1.1.0", "Microsoft.AspNetCore.Routing.Abstractions", "1.1.1")] - [InlineData("Microsoft.AspNetCore.Server.Kestrel", "1.1.0", "Microsoft.AspNetCore.Server.Kestrel", "1.1.1")] - [InlineData("Microsoft.AspNetCore.Server.Kestrel.Https", "1.1.0", "Microsoft.AspNetCore.Server.Kestrel.Https", "1.1.1")] - public void ItUpliftsAspNetCorePackages( - string sourcePackageName, - string sourceVersion, - string targetPackageName, - string targetVersion) - { - ValidatePackageMigration(sourcePackageName, sourceVersion, targetPackageName, targetVersion); - } - - [Theory] - [InlineData("Microsoft.EntityFrameworkCore", "1.0.0", "Microsoft.EntityFrameworkCore", ConstantPackageVersions.EntityFrameworkLTSPackagesVersion)] - [InlineData("Microsoft.EntityFrameworkCore.InMemory", "1.0.0", "Microsoft.EntityFrameworkCore.InMemory", ConstantPackageVersions.EntityFrameworkLTSPackagesVersion)] - [InlineData("Microsoft.EntityFrameworkCore.Relational", "1.0.0", "Microsoft.EntityFrameworkCore.Relational", ConstantPackageVersions.EntityFrameworkLTSPackagesVersion)] - [InlineData("Microsoft.EntityFrameworkCore.Relational.Design", "1.0.0", "Microsoft.EntityFrameworkCore.Relational.Design", ConstantPackageVersions.EntityFrameworkLTSPackagesVersion)] - [InlineData("Microsoft.EntityFrameworkCore.Sqlite", "1.0.0", "Microsoft.EntityFrameworkCore.Sqlite", ConstantPackageVersions.EntityFrameworkLTSPackagesVersion)] - [InlineData("Microsoft.EntityFrameworkCore.Sqlite.Design", "1.0.0", "Microsoft.EntityFrameworkCore.Sqlite.Design", ConstantPackageVersions.EntityFrameworkLTSPackagesVersion)] - [InlineData("Microsoft.EntityFrameworkCore.SqlServer", "1.0.0", "Microsoft.EntityFrameworkCore.SqlServer", ConstantPackageVersions.EntityFrameworkLTSPackagesVersion)] - [InlineData("Microsoft.EntityFrameworkCore.SqlServer.Design", "1.0.0", "Microsoft.EntityFrameworkCore.SqlServer.Design", ConstantPackageVersions.EntityFrameworkLTSPackagesVersion)] - [InlineData("Microsoft.EntityFrameworkCore", "1.1.0", "Microsoft.EntityFrameworkCore", "1.1.1")] - [InlineData("Microsoft.EntityFrameworkCore.InMemory", "1.1.0", "Microsoft.EntityFrameworkCore.InMemory", "1.1.1")] - [InlineData("Microsoft.EntityFrameworkCore.Relational", "1.1.0", "Microsoft.EntityFrameworkCore.Relational", "1.1.1")] - [InlineData("Microsoft.EntityFrameworkCore.Relational.Design", "1.1.0", "Microsoft.EntityFrameworkCore.Relational.Design", "1.1.1")] - [InlineData("Microsoft.EntityFrameworkCore.Sqlite", "1.1.0", "Microsoft.EntityFrameworkCore.Sqlite", "1.1.1")] - [InlineData("Microsoft.EntityFrameworkCore.Sqlite.Design", "1.1.0", "Microsoft.EntityFrameworkCore.Sqlite.Design", "1.1.1")] - [InlineData("Microsoft.EntityFrameworkCore.SqlServer", "1.1.0", "Microsoft.EntityFrameworkCore.SqlServer", "1.1.1")] - [InlineData("Microsoft.EntityFrameworkCore.SqlServer.Design", "1.1.0", "Microsoft.EntityFrameworkCore.SqlServer.Design", "1.1.1")] - public void ItUpliftsEntityFrameworkCorePackages( - string sourcePackageName, - string sourceVersion, - string targetPackageName, - string targetVersion) - { - ValidatePackageMigration(sourcePackageName, sourceVersion, targetPackageName, targetVersion); - } - - [Theory] - [InlineData("Microsoft.NETCore.Jit", "1.0.0", "Microsoft.NETCore.Jit", "1.0.5")] - [InlineData("Microsoft.NETCore.Runtime.CoreCLR", "1.0.0", "Microsoft.NETCore.Runtime.CoreCLR", "1.0.5")] - [InlineData("Microsoft.NETCore.DotNetHost", "1.0.0", "Microsoft.NETCore.DotNetHost", "1.0.1")] - [InlineData("Microsoft.NETCore.DotNetHostPolicy", "1.0.0", "Microsoft.NETCore.DotNetHostPolicy", "1.0.3")] - [InlineData("Microsoft.NETCore.DotNetHostResolver", "1.0.0", "Microsoft.NETCore.DotNetHostResolver", "1.0.1")] - [InlineData("Microsoft.NETCore.Platforms", "1.0.0", "Microsoft.NETCore.Platforms", "1.0.2")] - [InlineData("Microsoft.NETCore.Targets", "1.0.0", "Microsoft.NETCore.Targets", "1.0.1")] - [InlineData("Microsoft.NETCore.Windows.ApiSets", "1.0.0", "Microsoft.NETCore.Windows.ApiSets", "1.0.1")] - public void ItUpliftsCoreCLRPackages( - string sourcePackageName, - string sourceVersion, - string targetPackageName, - string targetVersion) - { - ValidatePackageMigration(sourcePackageName, sourceVersion, targetPackageName, targetVersion); - } - - [Theory] - [InlineData("System.Net.Http", "1.0.0", "System.Net.Http", "4.1.1")] - [InlineData("System.AppContext", "1.0.0", "System.AppContext", "4.1.0")] - [InlineData("System.Buffers", "1.0.0", "System.Buffers", "4.0.0")] - [InlineData("System.Collections", "1.0.0", "System.Collections", "4.0.11")] - [InlineData("System.Collections.Concurrent", "1.0.0", "System.Collections.Concurrent", "4.0.12")] - [InlineData("System.Collections.Immutable", "1.0.0", "System.Collections.Immutable", "1.2.0")] - [InlineData("System.ComponentModel", "1.0.0", "System.ComponentModel", "4.0.1")] - [InlineData("System.Console", "1.0.0", "System.Console", "4.0.0")] - [InlineData("System.Diagnostics.Debug", "1.0.0", "System.Diagnostics.Debug", "4.0.11")] - [InlineData("System.Diagnostics.DiagnosticSource", "1.0.0", "System.Diagnostics.DiagnosticSource", "4.0.0")] - [InlineData("System.Diagnostics.FileVersionInfo", "1.0.0", "System.Diagnostics.FileVersionInfo", "4.0.0")] - [InlineData("System.Diagnostics.Process", "1.0.0", "System.Diagnostics.Process", "4.1.0")] - [InlineData("System.Diagnostics.StackTrace", "1.0.0", "System.Diagnostics.StackTrace", "4.0.1")] - [InlineData("System.Diagnostics.Tools", "1.0.0", "System.Diagnostics.Tools", "4.0.1")] - [InlineData("System.Diagnostics.Tracing", "1.0.0", "System.Diagnostics.Tracing", "4.1.0")] - [InlineData("System.Dynamic.Runtime", "1.0.0", "System.Dynamic.Runtime", "4.0.11")] - [InlineData("System.Globalization", "1.0.0", "System.Globalization", "4.0.11")] - [InlineData("System.Globalization.Calendars", "1.0.0", "System.Globalization.Calendars", "4.0.1")] - [InlineData("System.Globalization.Extensions", "1.0.0", "System.Globalization.Extensions", "4.0.1")] - [InlineData("System.IO", "1.0.0", "System.IO", "4.1.0")] - [InlineData("System.IO.Compression", "1.0.0", "System.IO.Compression", "4.1.0")] - [InlineData("System.IO.Compression.ZipFile", "1.0.0", "System.IO.Compression.ZipFile", "4.0.1")] - [InlineData("System.IO.MemoryMappedFiles", "1.0.0", "System.IO.MemoryMappedFiles", "4.0.0")] - [InlineData("System.IO.UnmanagedMemoryStream", "1.0.0", "System.IO.UnmanagedMemoryStream", "4.0.1")] - [InlineData("System.Linq", "1.0.0", "System.Linq", "4.1.0")] - [InlineData("System.Linq.Expressions", "1.0.0", "System.Linq.Expressions", "4.1.0")] - [InlineData("System.Linq.Parallel", "1.0.0", "System.Linq.Parallel", "4.0.1")] - [InlineData("System.Linq.Queryable", "1.0.0", "System.Linq.Queryable", "4.0.1")] - [InlineData("System.Net.NameResolution", "1.0.0", "System.Net.NameResolution", "4.0.0")] - [InlineData("System.Net.Primitives", "1.0.0", "System.Net.Primitives", "4.0.11")] - [InlineData("System.Net.Requests", "1.0.0", "System.Net.Requests", "4.0.11")] - [InlineData("System.Net.Security", "1.0.0", "System.Net.Security", "4.0.0")] - [InlineData("System.Net.Sockets", "1.0.0", "System.Net.Sockets", "4.1.0")] - [InlineData("System.Net.WebHeaderCollection", "1.0.0", "System.Net.WebHeaderCollection", "4.0.1")] - [InlineData("System.Numerics.Vectors", "1.0.0", "System.Numerics.Vectors", "4.1.1")] - [InlineData("System.ObjectModel", "1.0.0", "System.ObjectModel", "4.0.12")] - [InlineData("System.Reflection", "1.0.0", "System.Reflection", "4.1.0")] - [InlineData("System.Reflection.DispatchProxy", "1.0.0", "System.Reflection.DispatchProxy", "4.0.1")] - [InlineData("System.Reflection.Emit", "1.0.0", "System.Reflection.Emit", "4.0.1")] - [InlineData("System.Reflection.Emit.ILGeneration", "1.0.0", "System.Reflection.Emit.ILGeneration", "4.0.1")] - [InlineData("System.Reflection.Emit.Lightweight", "1.0.0", "System.Reflection.Emit.Lightweight", "4.0.1")] - [InlineData("System.Reflection.Extensions", "1.0.0", "System.Reflection.Extensions", "4.0.1")] - [InlineData("System.Reflection.Metadata", "1.0.0", "System.Reflection.Metadata", "1.3.0")] - [InlineData("System.Reflection.Primitives", "1.0.0", "System.Reflection.Primitives", "4.0.1")] - [InlineData("System.Reflection.TypeExtensions", "1.0.0", "System.Reflection.TypeExtensions", "4.1.0")] - [InlineData("System.Resources.Reader", "1.0.0", "System.Resources.Reader", "4.0.0")] - [InlineData("System.Resources.ResourceManager", "1.0.0", "System.Resources.ResourceManager", "4.0.1")] - [InlineData("System.Runtime", "1.0.0", "System.Runtime", "4.1.0")] - [InlineData("System.Runtime.Extensions", "1.0.0", "System.Runtime.Extensions", "4.1.0")] - [InlineData("System.Runtime.Handles", "1.0.0", "System.Runtime.Handles", "4.0.1")] - [InlineData("System.Runtime.InteropServices", "1.0.0", "System.Runtime.InteropServices", "4.1.0")] - [InlineData("System.Runtime.InteropServices.RuntimeInformation", "1.0.0", "System.Runtime.InteropServices.RuntimeInformation", "4.0.0")] - [InlineData("System.Runtime.Loader", "1.0.0", "System.Runtime.Loader", "4.0.0")] - [InlineData("System.Runtime.Numerics", "1.0.0", "System.Runtime.Numerics", "4.0.1")] - [InlineData("System.Security.Claims", "1.0.0", "System.Security.Claims", "4.0.1")] - [InlineData("System.Security.Cryptography.Algorithms", "1.0.0", "System.Security.Cryptography.Algorithms", "4.2.0")] - [InlineData("System.Security.Cryptography.Cng", "1.0.0", "System.Security.Cryptography.Cng", "4.2.0")] - [InlineData("System.Security.Cryptography.Csp", "1.0.0", "System.Security.Cryptography.Csp", "4.0.0")] - [InlineData("System.Security.Cryptography.Encoding", "1.0.0", "System.Security.Cryptography.Encoding", "4.0.0")] - [InlineData("System.Security.Cryptography.OpenSsl", "1.0.0", "System.Security.Cryptography.OpenSsl", "4.0.0")] - [InlineData("System.Security.Cryptography.Primitives", "1.0.0", "System.Security.Cryptography.Primitives", "4.0.0")] - [InlineData("System.Security.Cryptography.X509Certificates", "1.0.0", "System.Security.Cryptography.X509Certificates", "4.1.0")] - [InlineData("System.Security.Principal", "1.0.0", "System.Security.Principal", "4.0.1")] - [InlineData("System.Security.Principal.Windows", "1.0.0", "System.Security.Principal.Windows", "4.0.0")] - [InlineData("System.Text.Encoding", "1.0.0", "System.Text.Encoding", "4.0.11")] - [InlineData("System.Text.Encoding.CodePages", "1.0.0", "System.Text.Encoding.CodePages", "4.0.1")] - [InlineData("System.Text.Encoding.Extensions", "1.0.0", "System.Text.Encoding.Extensions", "4.0.11")] - [InlineData("System.Text.RegularExpressions", "1.0.0", "System.Text.RegularExpressions", "4.1.0")] - [InlineData("System.Threading", "1.0.0", "System.Threading", "4.0.11")] - [InlineData("System.Threading.Overlapped", "1.0.0", "System.Threading.Overlapped", "4.0.1")] - [InlineData("System.Threading.Tasks", "1.0.0", "System.Threading.Tasks", "4.0.11")] - [InlineData("System.Threading.Tasks.Dataflow", "1.0.0", "System.Threading.Tasks.Dataflow", "4.6.0")] - [InlineData("System.Threading.Tasks.Extensions", "1.0.0", "System.Threading.Tasks.Extensions", "4.0.0")] - [InlineData("System.Threading.Tasks.Parallel", "1.0.0", "System.Threading.Tasks.Parallel", "4.0.1")] - [InlineData("System.Threading.Thread", "1.0.0", "System.Threading.Thread", "4.0.0")] - [InlineData("System.Threading.ThreadPool", "1.0.0", "System.Threading.ThreadPool", "4.0.10")] - [InlineData("System.Threading.Timer", "1.0.0", "System.Threading.Timer", "4.0.1")] - [InlineData("System.Xml.ReaderWriter", "1.0.0", "System.Xml.ReaderWriter", "4.0.11")] - [InlineData("System.Xml.XDocument", "1.0.0", "System.Xml.XDocument", "4.0.11")] - [InlineData("System.Xml.XmlDocument", "1.0.0", "System.Xml.XmlDocument", "4.0.1")] - [InlineData("System.Xml.XPath", "1.0.0", "System.Xml.XPath", "4.0.1")] - [InlineData("runtime.native.System", "1.0.0", "runtime.native.System", "4.0.0")] - [InlineData("runtime.native.System.IO.Compression", "1.0.0", "runtime.native.System.IO.Compression", "4.1.0")] - [InlineData("runtime.native.System.Net.Http", "1.0.0", "runtime.native.System.Net.Http", "4.0.1")] - [InlineData("runtime.native.System.Net.Security", "1.0.0", "runtime.native.System.Net.Security", "4.0.1")] - [InlineData("runtime.native.System.Security.Cryptography", "1.0.0", "runtime.native.System.Security.Cryptography", "4.0.0")] - [InlineData("Libuv", "1.0.0", "Libuv", "1.9.1")] - [InlineData("Microsoft.CodeAnalysis.Analyzers", "1.0.0", "Microsoft.CodeAnalysis.Analyzers", "1.1.0")] - [InlineData("Microsoft.CodeAnalysis.Common", "1.0.0", "Microsoft.CodeAnalysis.Common", "1.3.0")] - [InlineData("Microsoft.CodeAnalysis.CSharp", "1.0.0", "Microsoft.CodeAnalysis.CSharp", "1.3.0")] - [InlineData("Microsoft.CodeAnalysis.VisualBasic", "1.0.0", "Microsoft.CodeAnalysis.VisualBasic", "1.3.0")] - [InlineData("Microsoft.CSharp", "1.0.0", "Microsoft.CSharp", "4.0.1")] - [InlineData("Microsoft.VisualBasic", "1.0.0", "Microsoft.VisualBasic", "10.0.1")] - [InlineData("Microsoft.Win32.Primitives", "1.0.0", "Microsoft.Win32.Primitives", "4.0.1")] - [InlineData("Microsoft.Win32.Registry", "1.0.0", "Microsoft.Win32.Registry", "4.0.0")] - [InlineData("System.IO.FileSystem", "1.0.0", "System.IO.FileSystem", "4.0.1")] - [InlineData("System.IO.FileSystem.Primitives", "1.0.0", "System.IO.FileSystem.Primitives", "4.0.1")] - [InlineData("System.IO.FileSystem.Watcher", "1.0.0", "System.IO.FileSystem.Watcher", "4.0.0")] - public void ItUpliftsMicrosoftNETCoreAppPackages( - string sourcePackageName, - string sourceVersion, - string targetPackageName, - string targetVersion) - { - ValidatePackageMigration(sourcePackageName, sourceVersion, targetPackageName, targetVersion); - } - - [Theory] - [InlineData("Microsoft.Extensions.Logging", "1.0.0", "Microsoft.Extensions.Logging", "1.0.2")] - [InlineData("Microsoft.Extensions.Logging.Console", "1.0.0", "Microsoft.Extensions.Logging.Console", "1.0.2")] - [InlineData("Microsoft.Extensions.Logging.Debug", "1.0.0", "Microsoft.Extensions.Logging.Debug", "1.0.2")] - [InlineData("Microsoft.Extensions.Configuration.Json", "1.0.0", "Microsoft.Extensions.Configuration.Json", "1.0.2")] - [InlineData("Microsoft.Extensions.Configuration.UserSecrets", "1.0.0", "Microsoft.Extensions.Configuration.UserSecrets", "1.0.2")] - [InlineData("Microsoft.Extensions.Logging", "1.1.0", "Microsoft.Extensions.Logging", "1.1.1")] - [InlineData("Microsoft.Extensions.Logging.Console", "1.1.0", "Microsoft.Extensions.Logging.Console", "1.1.1")] - [InlineData("Microsoft.Extensions.Logging.Debug", "1.1.0", "Microsoft.Extensions.Logging.Debug", "1.1.1")] - [InlineData("Microsoft.Extensions.Configuration.Json", "1.1.0", "Microsoft.Extensions.Configuration.Json", "1.1.1")] - [InlineData("Microsoft.Extensions.Configuration.UserSecrets", "1.1.0", "Microsoft.Extensions.Configuration.UserSecrets", "1.1.1")] - [InlineData("Microsoft.Extensions.Logging.AzureAppServices", "1.0.0-preview2", "Microsoft.Extensions.Logging.AzureAppServices", "1.0.1")] - public void ItUpliftsMicrosoftExtensionsPackages( - string sourcePackageName, - string sourceVersion, - string targetPackageName, - string targetVersion) - { - ValidatePackageMigration(sourcePackageName, sourceVersion, targetPackageName, targetVersion); - } - - private void ValidatePackageMigration( - string sourcePackageName, - string sourceVersion, - string targetPackageName, - string targetVersion) - { - var mockProj = RunPackageDependenciesRuleOnPj("{ \"dependencies\": { \"" + sourcePackageName + "\" : { \"version\": \"" + sourceVersion + "\", \"type\": \"build\" } } }"); - - var packageRef = mockProj.Items.First(i => i.Include == targetPackageName && i.ItemType == "PackageReference"); - - packageRef.GetMetadataWithName("Version").Value.Should().Be(targetVersion); - } - - private void ValidateNetStandardMetaPackageMigration( - string sourceVersion, - string targetVersion) - { - var mockProj = RunPackageDependenciesRuleOnPj("{ \"dependencies\": { \"NETStandard.Library\" : { \"version\": \"" + sourceVersion + "\", \"type\": \"build\" } } }"); - - mockProj.Items.Should().NotContain( - i => i.Include == "NETStandard.Library" && i.ItemType == "PackageReference"); - mockProj.Properties - .Should().ContainSingle(p => p.Name == "NetStandardImplicitPackageVersion") - .Which.Value.Should().Be(targetVersion); - } - - private void ValidateNetCoreAppMetaPackageMigration( - string sourceVersion, - string targetVersion) - { - var mockProj = RunPackageDependenciesRuleOnPj("{ \"dependencies\": { \"Microsoft.NETCore.App\" : { \"version\": \"" + sourceVersion + "\", \"type\": \"build\" } } }"); - - mockProj.Items.Should().NotContain( - i => i.Include == "Microsoft.NETCore.App" && i.ItemType == "PackageReference"); - mockProj.Properties - .Should().ContainSingle(p => p.Name == "RuntimeFrameworkVersion") - .Which.Value.Should().Be(targetVersion); - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateProjectDependencies.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateProjectDependencies.cs deleted file mode 100644 index 30f0f1792..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateProjectDependencies.cs +++ /dev/null @@ -1,368 +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.Build.Construction; -using Microsoft.DotNet.ProjectJsonMigration; -using Microsoft.DotNet.Internal.ProjectModel; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using NuGet.Frameworks; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Xunit; -using FluentAssertions; -using Microsoft.DotNet.ProjectJsonMigration.Rules; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenThatIWantToMigrateProjectDependencies : TestBase - { - [Fact] - public void ProjectDependenciesAreMigratedToProjectReference() - { - var solutionDirectory = TestAssets.Get("TestAppWithLibrary") - .CreateInstance(callingMethod: "p") - .WithSourceFiles() - .Root.FullName; - - var appDirectory = Path.Combine(solutionDirectory, "TestApp"); - - var projectContext = ProjectContext.Create(appDirectory, FrameworkConstants.CommonFrameworks.NetCoreApp11); - var mockProj = ProjectRootElement.Create(); - var testSettings = MigrationSettings.CreateMigrationSettingsTestHook(appDirectory, appDirectory, mockProj, null); - var testInputs = new MigrationRuleInputs(new[] {projectContext}, mockProj, mockProj.AddItemGroup(), - mockProj.AddPropertyGroup()); - new MigrateProjectDependenciesRule().Apply(testSettings, testInputs); - - var projectReferences = mockProj.Items.Where(item => item.ItemType.Equals("ProjectReference", StringComparison.Ordinal)); - projectReferences.Count().Should().Be(1); - - var projectReference = projectReferences.First(); - projectReference.Include.Should().Be(Path.Combine("..", "TestLibrary", "TestLibrary.csproj")); - projectReference.Parent.Condition.Should().BeEmpty(); - } - - [Fact] - public void ItDoesNotMigrateADependencyWithTargetPackageThatHasAMatchingProjectAsAProjectReference() - { - var solutionDirectory = TestAssets.Get("NonRestoredTestProjects", "AppWithProjectDependencyAsTarget") - .CreateInstance(callingMethod: "p") - .WithSourceFiles() - .Root.FullName; - - var appDirectory = Path.Combine(solutionDirectory, "TestApp"); - - var projectContext = ProjectContext.Create(appDirectory, FrameworkConstants.CommonFrameworks.NetCoreApp11); - var mockProj = ProjectRootElement.Create(); - var testSettings = MigrationSettings.CreateMigrationSettingsTestHook(appDirectory, appDirectory, mockProj, null); - var testInputs = new MigrationRuleInputs(new[] {projectContext}, mockProj, mockProj.AddItemGroup(), - mockProj.AddPropertyGroup()); - new MigrateProjectDependenciesRule().Apply(testSettings, testInputs); - - var projectReferences = mockProj.Items.Where( - item => item.ItemType.Equals("ProjectReference", StringComparison.Ordinal)); - projectReferences.Should().BeEmpty(); - } - - [Fact] - public void TFMSpecificProjectDependenciesAreMigratedToProjectReferenceUnderConditionItemGroup() - { - var solutionDirectory = TestAssets.Get("TestAppWithLibraryUnderTFM") - .CreateInstance(callingMethod: "p") - .WithSourceFiles() - .Root.FullName; - - var appDirectory = Path.Combine(solutionDirectory, "TestApp"); - - var projectContext = ProjectContext.Create(appDirectory, FrameworkConstants.CommonFrameworks.NetCoreApp11); - var mockProj = ProjectRootElement.Create(); - var testSettings = MigrationSettings.CreateMigrationSettingsTestHook(appDirectory, appDirectory, mockProj, null); - var testInputs = new MigrationRuleInputs(new[] {projectContext}, mockProj, mockProj.AddItemGroup(), - mockProj.AddPropertyGroup()); - new MigrateProjectDependenciesRule().Apply(testSettings, testInputs); - - var projectReferences = mockProj.Items.Where(item => item.ItemType.Equals("ProjectReference", StringComparison.Ordinal)); - projectReferences.Count().Should().Be(1); - - var projectReference = projectReferences.First(); - projectReference.Include.Should().Be(Path.Combine("..", "TestLibrary", "TestLibrary.csproj")); - projectReference.Parent.Condition.Should().Be(" '$(TargetFramework)' == 'netcoreapp1.1' "); - } - - [Fact] - public void ItThrowsWhenProjectDependencyIsUnresolved() - { - // No Lock file => unresolved - var solutionDirectory = TestAssets.Get("TestAppWithLibrary") - .CreateInstance() - .WithSourceFiles() - .Root.FullName; - - var appDirectory = Path.Combine(solutionDirectory, "TestApp"); - var libraryDirectory = Path.Combine(solutionDirectory, "TestLibrary"); - Directory.Delete(libraryDirectory, true); - - var projectContext = ProjectContext.Create(appDirectory, FrameworkConstants.CommonFrameworks.NetCoreApp11); - var mockProj = ProjectRootElement.Create(); - var testSettings = MigrationSettings.CreateMigrationSettingsTestHook(appDirectory, appDirectory, mockProj); - var testInputs = new MigrationRuleInputs(new[] {projectContext}, mockProj, mockProj.AddItemGroup(), mockProj.AddPropertyGroup()); - - Action action = () => new MigrateProjectDependenciesRule().Apply(testSettings, testInputs); - action.ShouldThrow() - .Where(e => e.Message.Contains("MIGRATE1014::Unresolved Dependency: Unresolved project dependency (TestLibrary)")); - } - - [Theory] - [InlineData(@"some/path/to.cSproj", new [] { @"some/path/to.cSproj" })] - [InlineData(@"to.CSPROJ",new [] { @"to.CSPROJ" })] - public void ItMigratesCsprojProjectReferenceInXproj(string projectReference, string[] expectedMigratedReferences) - { - var xproj = ProjectRootElement.Create(); - xproj.AddItem("ProjectReference", projectReference); - - var projectReferenceName = Path.GetFileNameWithoutExtension(projectReference); - - var projectJson = @" - { - ""dependencies"": {" + - $"\"{projectReferenceName}\"" + @": { - ""target"" : ""project"" - } - } - } - "; - - var testDirectory = Temp.CreateDirectory().Path; - var migratedProj = TemporaryProjectFileRuleRunner.RunRules(new IMigrationRule[] - { - new MigrateProjectDependenciesRule() - }, projectJson, testDirectory, xproj); - - var migratedProjectReferenceItems = migratedProj.Items.Where(i => i.ItemType == "ProjectReference"); - migratedProjectReferenceItems.Should().HaveCount(expectedMigratedReferences.Length); - migratedProjectReferenceItems.Select(m => m.Include).Should().BeEquivalentTo(expectedMigratedReferences); - } - - [Fact] - public void ItMigratesCsprojProjectReferenceInXprojIncludingConditionOnProjectReference() - { - var projectReference = "some/to.csproj"; - var xproj = ProjectRootElement.Create(); - var csprojReferenceItem = xproj.AddItem("ProjectReference", projectReference); - csprojReferenceItem.Condition = " '$(Foo)' == 'bar' "; - - var projectReferenceName = Path.GetFileNameWithoutExtension(projectReference); - - var projectJson = @" - { - ""dependencies"": {" + - $"\"{projectReferenceName}\"" + @": { - ""target"" : ""project"" - } - } - } - "; - - var testDirectory = Temp.CreateDirectory().Path; - var migratedProj = TemporaryProjectFileRuleRunner.RunRules(new IMigrationRule[] - { - new MigrateProjectDependenciesRule() - }, projectJson, testDirectory, xproj); - - var migratedProjectReferenceItems = migratedProj.Items.Where(i => i.ItemType == "ProjectReference"); - migratedProjectReferenceItems.Should().HaveCount(1); - - var migratedProjectReferenceItem = migratedProjectReferenceItems.First(); - migratedProjectReferenceItem.Include.Should().Be(projectReference); - migratedProjectReferenceItem.Condition.Should().Be(" '$(Foo)' == 'bar' "); - } - - [Fact] - public void ItMigratesCsprojProjectReferenceInXprojIncludingConditionOnProjectReferenceParent() - { - var projectReference = "some/to.csproj"; - var xproj = ProjectRootElement.Create(); - var csprojReferenceItem = xproj.AddItem("ProjectReference", projectReference); - csprojReferenceItem.Parent.Condition = " '$(Foo)' == 'bar' "; - - var projectReferenceName = Path.GetFileNameWithoutExtension(projectReference); - - var projectJson = @" - { - ""dependencies"": {" + - $"\"{projectReferenceName}\"" + @": { - ""target"" : ""project"" - } - } - } - "; - - var testDirectory = Temp.CreateDirectory().Path; - var migratedProj = TemporaryProjectFileRuleRunner.RunRules(new IMigrationRule[] - { - new MigrateProjectDependenciesRule() - }, projectJson, testDirectory, xproj); - - var migratedProjectReferenceItems = migratedProj.Items.Where(i => i.ItemType == "ProjectReference"); - migratedProjectReferenceItems.Should().HaveCount(1); - - var migratedProjectReferenceItem = migratedProjectReferenceItems.First(); - migratedProjectReferenceItem.Include.Should().Be(projectReference); - migratedProjectReferenceItem.Condition.Should().Be(" '$(Foo)' == 'bar' "); - } - - [Fact] - public void ItMigratesCsprojProjectReferenceInXprojIncludingConditionOnProjectReferenceParentAndItem() - { - var projectReference = "some/to.csproj"; - var xproj = ProjectRootElement.Create(); - var csprojReferenceItem = xproj.AddItem("ProjectReference", projectReference); - csprojReferenceItem.Parent.Condition = " '$(Foo)' == 'bar' "; - csprojReferenceItem.Condition = " '$(Bar)' == 'foo' "; - - var projectReferenceName = Path.GetFileNameWithoutExtension(projectReference); - - var projectJson = @" - { - ""dependencies"": {" + - $"\"{projectReferenceName}\"" + @": { - ""target"" : ""project"" - } - } - } - "; - - var testDirectory = Temp.CreateDirectory().Path; - var migratedProj = TemporaryProjectFileRuleRunner.RunRules(new IMigrationRule[] - { - new MigrateProjectDependenciesRule() - }, projectJson, testDirectory, xproj); - - var migratedProjectReferenceItems = migratedProj.Items.Where(i => i.ItemType == "ProjectReference"); - migratedProjectReferenceItems.Should().HaveCount(1); - - var migratedProjectReferenceItem = migratedProjectReferenceItems.First(); - migratedProjectReferenceItem.Include.Should().Be(projectReference); - migratedProjectReferenceItem.Condition.Should().Be(" '$(Bar)' == 'foo' and '$(Foo)' == 'bar' "); - } - - [Fact] - public void ItDoesNotPromoteP2PReferencesUpInTheDependencyChain() - { - var mockProj = MigrateProject("TestAppDependencyGraph", "ProjectA"); - - var projectReferences = mockProj.Items.Where( - item => item.ItemType.Equals("ProjectReference", StringComparison.Ordinal)); - projectReferences.Count().Should().Be(2); - } - - [Fact] - public void ItDoesNotPromoteFrameworkAssembliesFromP2PReferencesUpInTheDependencyChain() - { - var solutionDirectory = TestAssets.Get(TestAssetKinds.DesktopTestProjects, "TestAppWithFrameworkAssemblies") - .CreateInstance() - .WithSourceFiles().Root; - - var appDirectory = Path.Combine(solutionDirectory.FullName, "ProjectA"); - - var projectContext = ProjectContext.Create(appDirectory, FrameworkConstants.CommonFrameworks.Net451); - var mockProj = ProjectRootElement.Create(); - var testSettings = MigrationSettings.CreateMigrationSettingsTestHook(appDirectory, appDirectory, mockProj, null); - var testInputs = new MigrationRuleInputs(new[] {projectContext}, mockProj, mockProj.AddItemGroup(), - mockProj.AddPropertyGroup()); - new MigrateProjectDependenciesRule().Apply(testSettings, testInputs); - - var frameworkAssemblyReferences = mockProj.Items.Where( - item => item.ItemType == "Reference" && - item.Include == "System.ComponentModel.DataAnnotations" && - item.Parent.Condition == " '$(TargetFramework)' == 'net451' "); - frameworkAssemblyReferences.Count().Should().Be(0); - } - - [Fact] - public void NoP2PReferenceIsMarkedWithAFromP2PAttribute() - { - var expectedNonHoistedProjectReferences = new [] { - Path.Combine("..", "ProjectB", "ProjectB.csproj"), - Path.Combine("..", "ProjectC", "ProjectC.csproj") - }; - - var mockProj = MigrateProject("TestAppDependencyGraph", "ProjectA"); - - var projectReferences = mockProj.Items - .Where(item => - item.ItemType == "ProjectReference"); - - projectReferences.Should().HaveCount(c => c == 2) - .And.OnlyContain(item => item.GetMetadataWithName("FromP2P") == null); - - projectReferences.Select(i => i.Include).Should().BeEquivalentTo(expectedNonHoistedProjectReferences); - } - - [Fact] - public void ItMigratesUnqualifiedDependenciesAsProjectReferenceWhenAMatchingProjectIsFound() - { - var mockProj = MigrateProject("TestAppWithUnqualifiedDependencies", "ProjectA"); - var projectReferenceInclude = Path.Combine("..", "ProjectB", "ProjectB.csproj"); - - var projectReferences = mockProj.Items.Should().ContainSingle( - item => item.ItemType == "ProjectReference" && item.Include == projectReferenceInclude); - } - - [Fact] - public void ItDoesNotReferenceTheProjectUnderBackupWhenMigratingAPartiallyMigratedStructure() - { - var solutionDirectory = TestAssets.Get("NonRestoredTestProjects", "PJHalfMigrated") - .CreateInstance() - .WithSourceFiles() - .Root.FullName; - - var appDirectory = Path.Combine(solutionDirectory, "ProjectB"); - - var projectContext = ProjectContext.Create(appDirectory, FrameworkConstants.CommonFrameworks.NetCoreApp11); - var mockProj = ProjectRootElement.Create(); - var testSettings = MigrationSettings.CreateMigrationSettingsTestHook(appDirectory, appDirectory, mockProj, null); - var testInputs = new MigrationRuleInputs(new[] {projectContext}, mockProj, mockProj.AddItemGroup(), - mockProj.AddPropertyGroup()); - new MigrateProjectDependenciesRule().Apply(testSettings, testInputs); - - var projectReferences = mockProj.Items.Where( - item => item.ItemType.Equals("ProjectReference", StringComparison.Ordinal)); - projectReferences.Should().ContainSingle(); - projectReferences.Single().Include.Should().Be(Path.Combine("..", "src", "ProjectA", "ProjectA.csproj")); - } - - private ProjectRootElement MigrateProject(string solution, string project) - { - return MigrateProject(solution, project, FrameworkConstants.CommonFrameworks.NetCoreApp11); - } - - private ProjectRootElement MigrateProject( - string solution, - string project, - NuGetFramework targetFramework) - { - var solutionDirectory = TestAssets.Get(solution) - .CreateInstance(callingMethod: "p") - .WithSourceFiles() - .Root.FullName; - - var appDirectory = Path.Combine(solutionDirectory, project); - - var projectContext = ProjectContext.Create(appDirectory, targetFramework); - var mockProj = ProjectRootElement.Create(); - var testSettings = MigrationSettings.CreateMigrationSettingsTestHook(appDirectory, appDirectory, mockProj, null); - var testInputs = new MigrationRuleInputs(new[] {projectContext}, mockProj, mockProj.AddItemGroup(), - mockProj.AddPropertyGroup()); - new MigrateProjectDependenciesRule().Apply(testSettings, testInputs); - - var s = mockProj.Items.Select(p => $"ItemType = {p.ItemType}, Include = {p.Include}"); - Console.WriteLine(string.Join(Environment.NewLine, s)); - - return mockProj; - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigratePublishOptions.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigratePublishOptions.cs deleted file mode 100644 index a5aaf7ebb..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigratePublishOptions.cs +++ /dev/null @@ -1,353 +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.Build.Construction; -using Microsoft.DotNet.Internal.ProjectModel; -using Microsoft.DotNet.Internal.ProjectModel.Files; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using NuGet.Frameworks; -using Xunit; -using FluentAssertions; -using Microsoft.DotNet.ProjectJsonMigration.Rules; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenThatIWantToMigratePublishOptions : TestBase - { - [Fact] - private void MigratingPublishOptionsForConsoleAppIncludeExcludePopulatesContentItemWithInclude() - { - var testDirectory = Temp.CreateDirectory().Path; - WriteFilesInProjectDirectory(testDirectory); - - var mockProj = RunPublishOptionsRuleOnPj(@" - { - ""publishOptions"": { - ""include"": [""root"", ""src"", ""rootfile.cs""], - ""exclude"": [""src"", ""rootfile.cs""], - ""includeFiles"": [""src/file1.cs"", ""src/file2.cs""], - ""excludeFiles"": [""src/file2.cs""] - } - }", - testDirectory: testDirectory); - - mockProj.Items.Count(i => i.ItemType.Equals("None", StringComparison.Ordinal)).Should().Be(4); - - foreach (var item in mockProj.Items.Where(i => i.ItemType.Equals("None", StringComparison.Ordinal))) - { - item.Metadata.Count(m => m.Name == "CopyToPublishDirectory").Should().Be(1); - - if (item.Update.Contains(@"src\file1.cs")) - { - item.Update.Should().Be(@"src\file1.cs"); - item.Exclude.Should().BeEmpty(); - item.Metadata.Count(m => - m.Name == "CopyToPublishDirectory" && m.Value == "PreserveNewest").Should().Be(1); - } - else if (item.Update.Contains(@"src\file2.cs")) - { - item.Update.Should().Be(@"src\file2.cs"); - item.Exclude.Should().BeEmpty(); - item.Metadata.Count(m => - m.Name == "CopyToPublishDirectory" && m.Value == "Never").Should().Be(1); - } - else if (item.Update.Contains(@"root\**\*")) - { - item.Update.Should().Be(@"root\**\*"); - item.Exclude.Should().BeEmpty(); - item.Metadata.Count(m => - m.Name == "CopyToPublishDirectory" && m.Value == "PreserveNewest").Should().Be(1); - } - else - { - item.Update.Should().Be(@"src\**\*;rootfile.cs"); - item.Exclude.Should().BeEmpty(); - item.Metadata.Count(m => - m.Name == "CopyToPublishDirectory" && m.Value == "Never").Should().Be(1); - } - } - } - - [Fact] - private void MigratingPublishOptionsForWebAppIncludeExcludePopulatesContentItemWithUpdate() - { - var testDirectory = Temp.CreateDirectory().Path; - WriteFilesInProjectDirectory(testDirectory); - - var mockProj = RunPublishOptionsRuleOnPj(@" - { - ""publishOptions"": { - ""include"": [""root"", ""src"", ""rootfile.cs""], - ""exclude"": [""src"", ""rootfile.cs""], - ""includeFiles"": [""src/file1.cs"", ""src/file2.cs""], - ""excludeFiles"": [""src/file2.cs""] - }, - ""buildOptions"": { - ""emitEntryPoint"": true - }, - ""dependencies"": { - ""Microsoft.AspNetCore.Mvc"" : { - ""version"": ""1.0.0"" - } - }, - ""frameworks"": { - ""netcoreapp1.0"": {} - } - }", - testDirectory: testDirectory); - - mockProj.Items.Count(i => i.ItemType.Equals("None", StringComparison.Ordinal)).Should().Be(4); - - foreach (var item in mockProj.Items.Where(i => i.ItemType.Equals("None", StringComparison.Ordinal))) - { - item.Metadata.Count(m => m.Name == "CopyToPublishDirectory").Should().Be(1); - - if (item.Update.Contains(@"src\file1.cs")) - { - item.Update.Should().Be(@"src\file1.cs"); - item.Exclude.Should().BeEmpty(); - item.Metadata.Count(m => - m.Name == "CopyToPublishDirectory" && m.Value == "PreserveNewest").Should().Be(1); - } - else if (item.Update.Contains(@"src\file2.cs")) - { - item.Update.Should().Be(@"src\file2.cs"); - item.Exclude.Should().BeEmpty(); - item.Metadata.Count(m => - m.Name == "CopyToPublishDirectory" && m.Value == "Never").Should().Be(1); - } - else if (item.Update.Contains(@"root\**\*")) - { - item.Update.Should().Be(@"root\**\*"); - item.Exclude.Should().BeEmpty(); - item.Metadata.Count(m => - m.Name == "CopyToPublishDirectory" && m.Value == "PreserveNewest").Should().Be(1); - } - else - { - item.Update.Should().Be(@"src\**\*;rootfile.cs"); - item.Exclude.Should().BeEmpty(); - item.Metadata.Count(m => - m.Name == "CopyToPublishDirectory" && m.Value == "Never").Should().Be(1); - } - } - } - - [Fact] - private void MigratingConsoleAppWithPublishOptionsAndBuildOptionsCopyToOutputMergesContentItemsWithInclude() - { - var testDirectory = Temp.CreateDirectory().Path; - WriteFilesInProjectDirectory(testDirectory); - - var mockProj = RunPublishAndBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""copyToOutput"": { - ""include"": [""src"", ""rootfile.cs""], - ""exclude"": [""src"", ""rootfile.cs""], - ""includeFiles"": [""src/file1.cs"", ""src/file2.cs""], - ""excludeFiles"": [""src/file2.cs""] - } - }, - ""publishOptions"": { - ""include"": [""root"", ""src"", ""rootfile.cs""], - ""exclude"": [""src"", ""rootfile.cs""], - ""includeFiles"": [""src/file1.cs"", ""src/file2.cs""], - ""excludeFiles"": [""src/file3.cs""] - } - }", - testDirectory: testDirectory); - - mockProj.Items.Count(i => i.ItemType.Equals("None", StringComparison.Ordinal)).Should().Be(5); - - foreach (var item in mockProj.Items.Where(i => i.ItemType.Equals("None", StringComparison.Ordinal))) - { - if (item.Update.Contains(@"root\**\*")) - { - item.Update.Should().Be(@"root\**\*"); - item.Metadata.Count(m => - m.Name == "CopyToPublishDirectory" && m.Value == "PreserveNewest").Should().Be(1); - } - else if (item.Update.Contains(@"src\file1.cs")) - { - item.Update.Should().Be(@"src\file1.cs"); - item.Metadata.Count(m => - m.Name == "CopyToOutputDirectory" && m.Value == "PreserveNewest").Should().Be(1); - item.Metadata.Count(m => - m.Name == "CopyToPublishDirectory" && m.Value == "PreserveNewest").Should().Be(1); - } - else if (item.Update.Contains(@"src\file2.cs")) - { - item.Update.Should().Be(@"src\file2.cs"); - item.Metadata.Count(m => - m.Name == "CopyToOutputDirectory" && m.Value == "Never").Should().Be(1); - item.Metadata.Count(m => - m.Name == "CopyToPublishDirectory" && m.Value == "PreserveNewest").Should().Be(1); - } - else if (item.Update.Contains(@"src\file3.cs")) - { - item.Update.Should().Be(@"src\file3.cs"); - item.Metadata.Count(m => - m.Name == "CopyToPublishDirectory" && m.Value == "Never").Should().Be(1); - } - else - { - item.Update.Should() - .Be(@"src\**\*;rootfile.cs"); - item.Metadata.Count(m => - m.Name == "CopyToOutputDirectory" && m.Value == "Never").Should().Be(1); - item.Metadata.Count(m => - m.Name == "CopyToPublishDirectory" && m.Value == "Never").Should().Be(1); - } - } - } - - [Fact] - private void MigratingWebAppWithPublishOptionsAndBuildOptionsCopyToOutputMergesContentItemsWithUpdate() - { - var testDirectory = Temp.CreateDirectory().Path; - WriteFilesInProjectDirectory(testDirectory); - - var mockProj = RunPublishAndBuildOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""copyToOutput"": { - ""include"": [""src"", ""rootfile.cs""], - ""exclude"": [""src"", ""rootfile.cs""], - ""includeFiles"": [""src/file1.cs"", ""src/file2.cs""], - ""excludeFiles"": [""src/file2.cs""] - }, - ""emitEntryPoint"": true - }, - ""publishOptions"": { - ""include"": [""root"", ""src"", ""rootfile.cs""], - ""exclude"": [""src"", ""rootfile.cs""], - ""includeFiles"": [""src/file1.cs"", ""src/file2.cs""], - ""excludeFiles"": [""src/file3.cs""] - }, - ""dependencies"": { - ""Microsoft.AspNetCore.Mvc"" : { - ""version"": ""1.0.0"" - } - }, - ""frameworks"": { - ""netcoreapp1.0"": {} - } - }", - testDirectory: testDirectory); - - mockProj.Items.Count(i => i.ItemType.Equals("None", StringComparison.Ordinal)).Should().Be(5); - - // From ProjectReader #L725 (Both are empty) - var defaultIncludePatterns = Enumerable.Empty(); - var defaultExcludePatterns = Enumerable.Empty(); - - foreach (var item in mockProj.Items.Where(i => i.ItemType.Equals("None", StringComparison.Ordinal))) - { - var metadata = string.Join(",", item.Metadata.Select(m => m.Name)); - - if (item.Update.Contains(@"root\**\*")) - { - item.Update.Should().Be(@"root\**\*"); - item.Exclude.Should().BeEmpty(); - item.Metadata.Count(m => - m.Name == "CopyToPublishDirectory" && m.Value == "PreserveNewest").Should().Be(1); - } - else if (item.Update.Contains(@"src\file1.cs")) - { - item.Update.Should().Be(@"src\file1.cs"); - item.Exclude.Should().BeEmpty(); - item.Metadata.Count(m => - m.Name == "CopyToOutputDirectory" && m.Value == "PreserveNewest").Should().Be(1); - item.Metadata.Count(m => - m.Name == "CopyToPublishDirectory" && m.Value == "PreserveNewest").Should().Be(1); - } - else if (item.Update.Contains(@"src\file2.cs")) - { - item.Update.Should().Be(@"src\file2.cs"); - item.Exclude.Should().BeEmpty(); - item.Metadata.Count(m => - m.Name == "CopyToOutputDirectory" && m.Value == "Never").Should().Be(1); - item.Metadata.Count(m => - m.Name == "CopyToPublishDirectory" && m.Value == "PreserveNewest").Should().Be(1); - } - else if (item.Update.Contains(@"src\file3.cs")) - { - item.Update.Should().Be(@"src\file3.cs"); - item.Exclude.Should().BeEmpty(); - item.Metadata.Count(m => - m.Name == "CopyToPublishDirectory" && m.Value == "Never").Should().Be(1); - } - else - { - item.Update.Should().Be(@"src\**\*;rootfile.cs"); - item.Exclude.Should().BeEmpty(); - item.Metadata.Count(m => - m.Name == "CopyToOutputDirectory" && m.Value == "Never").Should().Be(1); - item.Metadata.Count(m => - m.Name == "CopyToPublishDirectory" && m.Value == "Never").Should().Be(1); - } - } - } - - [Fact] - public void ExcludedPatternsAreNotEmittedOnNoneWhenBuildingAWebProject() - { - var mockProj = RunPublishOptionsRuleOnPj(@" - { - ""buildOptions"": { - ""emitEntryPoint"": true - }, - ""publishOptions"": { - ""include"": [""wwwroot"", ""**/*.cshtml"", ""appsettings.json"", ""web.config""], - }, - ""dependencies"": { - ""Microsoft.AspNetCore.Mvc"" : { - ""version"": ""1.0.0"" - } - }, - ""frameworks"": { - ""netcoreapp1.0"": {} - } - }"); - - mockProj.Items.Count(i => i.ItemType.Equals("None", StringComparison.Ordinal)).Should().Be(0); - } - - private void WriteFilesInProjectDirectory(string testDirectory) - { - Directory.CreateDirectory(Path.Combine(testDirectory, "root")); - Directory.CreateDirectory(Path.Combine(testDirectory, "src")); - File.WriteAllText(Path.Combine(testDirectory, "root", "file1.txt"), "content"); - File.WriteAllText(Path.Combine(testDirectory, "root", "file2.txt"), "content"); - File.WriteAllText(Path.Combine(testDirectory, "root", "file3.txt"), "content"); - File.WriteAllText(Path.Combine(testDirectory, "src", "file1.cs"), "content"); - File.WriteAllText(Path.Combine(testDirectory, "src", "file2.cs"), "content"); - File.WriteAllText(Path.Combine(testDirectory, "src", "file3.cs"), "content"); - File.WriteAllText(Path.Combine(testDirectory, "rootfile.cs"), "content"); - } - - private ProjectRootElement RunPublishOptionsRuleOnPj(string s, string testDirectory = null) - { - testDirectory = testDirectory ?? Temp.CreateDirectory().Path; - return TemporaryProjectFileRuleRunner.RunRules(new IMigrationRule[] - { - new MigratePublishOptionsRule() - }, s, testDirectory); - } - - private ProjectRootElement RunPublishAndBuildOptionsRuleOnPj(string s, string testDirectory = null) - { - testDirectory = testDirectory ?? Temp.CreateDirectory().Path; - return TemporaryProjectFileRuleRunner.RunRules(new IMigrationRule[] - { - new MigrateBuildOptionsRule(), - new MigratePublishOptionsRule() - }, s, testDirectory); - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateRootOptions.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateRootOptions.cs deleted file mode 100644 index 77dca900a..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateRootOptions.cs +++ /dev/null @@ -1,37 +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.Linq; -using Microsoft.Build.Construction; -using Microsoft.DotNet.Tools.Test.Utilities; -using FluentAssertions; -using Microsoft.DotNet.ProjectJsonMigration.Rules; -using Xunit; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenThatIWantToMigrateRootOptions : TestBase - { - [Fact] - public void It_migrates_authors() - { - var mockProj = RunPropertiesRuleOnPj(@" - { - ""authors"": [ ""Some author"", ""Some other author"" ] - }"); - - mockProj.Properties.Count(p => p.Name == "Authors").Should().Be(1); - mockProj.Properties.First(p => p.Name == "Authors").Value.Should().Be( - "Some author;Some other author"); - } - - private ProjectRootElement RunPropertiesRuleOnPj(string project, string testDirectory = null) - { - testDirectory = testDirectory ?? Temp.CreateDirectory().Path; - return TemporaryProjectFileRuleRunner.RunRules(new IMigrationRule[] - { - new MigrateRootOptionsRule() - }, project, testDirectory); - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateRuntimeOptions.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateRuntimeOptions.cs deleted file mode 100644 index 283ba3626..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateRuntimeOptions.cs +++ /dev/null @@ -1,242 +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.Linq; -using FluentAssertions; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; -using Microsoft.DotNet.ProjectJsonMigration; -using System; -using System.IO; -using Microsoft.Build.Construction; -using Microsoft.DotNet.Internal.ProjectModel; -using NuGet.Frameworks; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System.Collections.Generic; -using Microsoft.DotNet.ProjectJsonMigration.Rules; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenThatIWantToMigrateRuntimeOptions : TestBase - { - private static readonly string s_runtimeConfigFileName = "runtimeconfig.template.json"; - - [Fact] - public void RuntimeOptionsAreCopiedFromProjectJsonToRuntimeConfigTemplateJsonFile() - { - var testInstance = TestAssets.Get("TestAppWithRuntimeOptions") - .CreateInstance() - .WithSourceFiles() - .Root; - - var projectDir = testInstance.FullName; - var projectPath = Path.Combine(projectDir, "project.json"); - - var project = JObject.Parse(File.ReadAllText(projectPath)); - var rawRuntimeOptions = (JObject)project.GetValue("runtimeOptions"); - - var projectContext = ProjectContext.Create(projectDir, FrameworkConstants.CommonFrameworks.NetCoreApp10); - - var testSettings = MigrationSettings.CreateMigrationSettingsTestHook(projectDir, projectDir, default(ProjectRootElement)); - var testInputs = new MigrationRuleInputs(new[] { projectContext }, null, null, null); - new MigrateRuntimeOptionsRule().Apply(testSettings, testInputs); - - var migratedRuntimeOptionsPath = Path.Combine(projectDir, s_runtimeConfigFileName); - - File.Exists(migratedRuntimeOptionsPath).Should().BeTrue(); - - var migratedRuntimeOptionsContent = JObject.Parse(File.ReadAllText(migratedRuntimeOptionsPath)); - JToken.DeepEquals(rawRuntimeOptions, migratedRuntimeOptionsContent).Should().BeTrue(); - } - - [Fact] - public void MigratingProjectJsonWithNoRuntimeOptionsProducesNoRuntimeConfigTemplateJsonFile() - { - var testInstance = TestAssets.Get("PJTestAppSimple") - .CreateInstance() - .WithSourceFiles() - .Root; - - var projectDir = testInstance.FullName; - - var projectContext = ProjectContext.Create(projectDir, FrameworkConstants.CommonFrameworks.NetCoreApp10); - - var testSettings = MigrationSettings.CreateMigrationSettingsTestHook(projectDir, projectDir, default(ProjectRootElement)); - var testInputs = new MigrationRuleInputs(new[] { projectContext }, null, null, null); - new MigrateRuntimeOptionsRule().Apply(testSettings, testInputs); - - var migratedRuntimeOptionsPath = Path.Combine(projectDir, s_runtimeConfigFileName); - - File.Exists(migratedRuntimeOptionsPath).Should().BeFalse(); - } - - [Fact] - public void MigratingProjectJsonWithOnlyServerGCRuntimeOptionsProducesNoRuntimeConfigTemplateJsonFile() - { - var testDirectory = Temp.CreateDirectory().Path; - - var pj = @" - { - ""runtimeOptions"": { - ""configProperties"": { - ""System.GC.Server"": true - } - } - }"; - - RunMigrateRuntimeOptionsRulePj(pj, testDirectory); - var migratedRuntimeOptionsPath = Path.Combine(testDirectory, s_runtimeConfigFileName); - File.Exists(migratedRuntimeOptionsPath).Should().BeFalse(); - } - - [Fact] - public void MigratingProjectJsonWithServerGCAndOtherConfigPropertiesProducesRuntimeConfigTemplateJsonFile() - { - var testDirectory = Temp.CreateDirectory().Path; - - var pj = @" - { - ""runtimeOptions"": { - ""configProperties"": { - ""System.GC.Server"": false, - ""Other"": false - } - } - }"; - - RunMigrateRuntimeOptionsRulePj(pj, testDirectory); - var migratedRuntimeOptionsPath = Path.Combine(testDirectory, s_runtimeConfigFileName); - File.Exists(migratedRuntimeOptionsPath).Should().BeTrue(); - - var root = JObject.Parse(File.ReadAllText(migratedRuntimeOptionsPath)); - var configProperties = root.Value("configProperties"); - configProperties.Should().NotBeNull(); - configProperties["System.GC.Server"].Should().BeNull(); - configProperties["Other"].Should().NotBeNull(); - } - - [Fact] - public void MigratingProjectJsonWithServerGCAndOtherRuntimeOptionsProducesRuntimeConfigTemplateJsonFile() - { - var testDirectory = Temp.CreateDirectory().Path; - - var pj = @" - { - ""runtimeOptions"": { - ""configProperties"": { - ""System.GC.Server"": false - }, - ""Other"": false - } - }"; - - RunMigrateRuntimeOptionsRulePj(pj, testDirectory); - var migratedRuntimeOptionsPath = Path.Combine(testDirectory, s_runtimeConfigFileName); - File.Exists(migratedRuntimeOptionsPath).Should().BeTrue(); - - var root = JObject.Parse(File.ReadAllText(migratedRuntimeOptionsPath)); - root.Value("configProperties").Should().BeNull(); - } - - [Fact] - public void MigratingProjectJsonWithServerGCTrueProducesServerGarbageCollectionProperty() - { - var testDirectory = Temp.CreateDirectory().Path; - - var pj = @" - { - ""runtimeOptions"": { - ""configProperties"": { - ""System.GC.Server"": true - } - } - }"; - - var mockProj = RunMigrateRuntimeOptionsRulePj(pj, testDirectory); - var props = mockProj.Properties.Where(p => p.Name.Equals("ServerGarbageCollection", StringComparison.Ordinal)); - props.Count().Should().Be(1); - props.First().Value.Should().Be("true"); - } - - [Fact] - public void MigratingProjectJsonWithServerGCFalseProducesServerGarbageCollectionProperty() - { - var testDirectory = Temp.CreateDirectory().Path; - - var pj = @" - { - ""runtimeOptions"": { - ""configProperties"": { - ""System.GC.Server"": false - } - } - }"; - - var mockProj = RunMigrateRuntimeOptionsRulePj(pj, testDirectory); - var props = mockProj.Properties.Where(p => p.Name.Equals("ServerGarbageCollection", StringComparison.Ordinal)); - props.Count().Should().Be(1); - props.First().Value.Should().Be("false"); - } - - [Fact] - public void MigratingWebProjectJsonWithServerGCTrueDoesNotProduceServerGarbageCollectionProperty() - { - var testDirectory = Temp.CreateDirectory().Path; - - var pj = @" - { - ""buildOptions"": { - ""emitEntryPoint"": true - }, - ""dependencies"": { - ""Microsoft.AspNetCore.Mvc"": ""1.0.0"" - }, - ""runtimeOptions"": { - ""configProperties"": { - ""System.GC.Server"": true - } - } - }"; - - var mockProj = RunMigrateRuntimeOptionsRulePj(pj, testDirectory); - var props = mockProj.Properties.Where(p => p.Name.Equals("ServerGarbageCollection", StringComparison.Ordinal)); - props.Count().Should().Be(0); - } - - [Fact] - public void MigratingWebProjectJsonWithServerGCFalseProducesServerGarbageCollectionProperty() - { - var testDirectory = Temp.CreateDirectory().Path; - - var pj = @" - { - ""buildOptions"": { - ""emitEntryPoint"": true - }, - ""dependencies"": { - ""Microsoft.AspNetCore.Mvc"": ""1.0.0"" - }, - ""runtimeOptions"": { - ""configProperties"": { - ""System.GC.Server"": false - } - } - }"; - - var mockProj = RunMigrateRuntimeOptionsRulePj(pj, testDirectory); - var props = mockProj.Properties.Where(p => p.Name.Equals("ServerGarbageCollection", StringComparison.Ordinal)); - props.Count().Should().Be(1); - props.First().Value.Should().Be("false"); - } - - private ProjectRootElement RunMigrateRuntimeOptionsRulePj(string s, string testDirectory = null) - { - testDirectory = testDirectory ?? Temp.CreateDirectory().Path; - return TemporaryProjectFileRuleRunner.RunRules(new IMigrationRule[] - { - new MigrateRuntimeOptionsRule() - }, s, testDirectory); - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateRuntimes.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateRuntimes.cs deleted file mode 100644 index 65cd00209..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateRuntimes.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 Microsoft.Build.Construction; -using Microsoft.DotNet.ProjectJsonMigration; -using Microsoft.DotNet.Tools.Test.Utilities; -using NuGet.Frameworks; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Xunit; -using FluentAssertions; -using Microsoft.DotNet.ProjectJsonMigration.Rules; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenThatIWantToMigrateRuntimes : TestBase - { - [Fact] - public void It_migrates_runtimes() - { - var projectJson = @" - { - ""runtimes"": { - ""win7-x64"": { }, - ""win7-x86"": { }, - ""osx.10.10-x64"": { } - } - } - "; - - var testDirectory = Temp.CreateDirectory().Path; - var migratedProj = TemporaryProjectFileRuleRunner.RunRules(new IMigrationRule[] - { - new MigrateRuntimesRule() - }, projectJson, testDirectory); - - migratedProj.Properties.Count(p => p.Name == "RuntimeIdentifiers").Should().Be(1); - migratedProj.Properties.First(p => p.Name == "RuntimeIdentifiers").Value - .Should().Be("win7-x64;win7-x86;osx.10.10-x64"); - } - - [Fact] - public void It_has_an_empty_runtime_node_to_migrate() - { - var projectJson = @" - { - ""runtimes"": { - } - } - "; - - var testDirectory = Temp.CreateDirectory().Path; - var migratedProj = TemporaryProjectFileRuleRunner.RunRules(new IMigrationRule[] - { - new MigrateRuntimesRule() - }, projectJson, testDirectory); - - migratedProj.Properties.Count(p => p.Name == "RuntimeIdentifiers").Should().Be(0); - } - - [Fact] - public void It_has_no_runtimes_to_migrate() - { - var projectJson = @" - { - } - "; - - var testDirectory = Temp.CreateDirectory().Path; - var migratedProj = TemporaryProjectFileRuleRunner.RunRules(new IMigrationRule[] - { - new MigrateRuntimesRule() - }, projectJson, testDirectory); - - migratedProj.Properties.Count(p => p.Name == "RuntimeIdentifiers").Should().Be(0); - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateScripts.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateScripts.cs deleted file mode 100644 index 73b749c2b..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateScripts.cs +++ /dev/null @@ -1,281 +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.Linq; -using FluentAssertions; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; -using Microsoft.DotNet.ProjectJsonMigration; -using System; -using System.IO; -using Microsoft.Build.Construction; -using Microsoft.DotNet.ProjectJsonMigration.Rules; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenThatIWantToMigrateScripts : TestBase - { - private const bool IsMultiTFM = true; - - [Theory] - [InlineData("compile:TargetFramework", "$(TargetFramework)")] - [InlineData("publish:TargetFramework", "$(TargetFramework)")] - [InlineData("compile:FullTargetFramework", "$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion)")] - [InlineData("compile:Configuration", "$(Configuration)")] - [InlineData("compile:OutputFile", "$(TargetPath)")] - [InlineData("compile:OutputDir", "$(TargetDir)")] - [InlineData("publish:ProjectPath", "$(MSBuildThisFileDirectory)")] - [InlineData("publish:Configuration", "$(Configuration)")] - [InlineData("publish:OutputPath", "$(TargetDir)")] - [InlineData("publish:FullTargetFramework", "$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion)")] - [InlineData("project:Version", "$(Version)")] - [InlineData("project:Name", "$(AssemblyName)")] - [InlineData("project:Directory", "$(MSBuildProjectDirectory)")] - [InlineData("publish:Runtime", "$(RuntimeIdentifier)")] - public void FormattingScriptCommandsReplacesVariablesWithTheRightMSBuildProperties( - string variable, - string msbuildReplacement) - { - var scriptMigrationRule = new MigrateScriptsRule(); - scriptMigrationRule.ReplaceScriptVariables($"%{variable}%").Should().Be(msbuildReplacement); - } - - [Theory] - [InlineData("compile:ResponseFile")] - [InlineData("compile:CompilerExitCode")] - [InlineData("compile:RuntimeOutputDir")] - [InlineData("compile:RuntimeIdentifier")] - public void FormattingScriptCommandsThrowsWhenVariableIsUnsupported(string unsupportedVariable) - { - var scriptMigrationRule = new MigrateScriptsRule(); - - Action formatScriptAction = () => scriptMigrationRule.ReplaceScriptVariables($"%{unsupportedVariable}%"); - formatScriptAction.ShouldThrow() - .Where(exc => exc.Message.Contains("is currently an unsupported script variable for project migration")); - } - - [Theory] - [InlineData("precompile", "BeforeBuild")] - [InlineData("prepublish", "PrepareForPublish")] - public void MigratingPreScriptsPopulatesBeforeTargetsWithAppropriateTarget( - string scriptName, - string targetName) - { - var scriptMigrationRule = new MigrateScriptsRule(); - ProjectRootElement mockProj = ProjectRootElement.Create(); - ProjectPropertyGroupElement commonPropertyGroup = mockProj.AddPropertyGroup(); - - var commands = new string[] { "fakecommand" }; - - var target = scriptMigrationRule.MigrateScriptSet( - mockProj, - commonPropertyGroup, - commands, - scriptName, - IsMultiTFM); - - target.BeforeTargets.Should().Be(targetName); - } - - [Theory] - [InlineData("postcompile", "Build")] - [InlineData("postpublish", "Publish")] - public void MigratingPostScriptsPopulatesAfterTargetsWithAppropriateTarget( - string scriptName, - string targetName) - { - var scriptMigrationRule = new MigrateScriptsRule(); - ProjectRootElement mockProj = ProjectRootElement.Create(); - ProjectPropertyGroupElement commonPropertyGroup = mockProj.AddPropertyGroup(); - var commands = new[] { "fakecommand" }; - - var target = scriptMigrationRule.MigrateScriptSet( - mockProj, - commonPropertyGroup, - commands, - scriptName, - IsMultiTFM); - - target.AfterTargets.Should().Be(targetName); - } - - [Theory] - [InlineData("precompile")] - [InlineData("postcompile")] - [InlineData("prepublish")] - [InlineData("postpublish")] - public void MigratingScriptsWithMultipleCommandsCreatesExecTaskForEach(string scriptName) - { - var scriptMigrationRule = new MigrateScriptsRule(); - ProjectRootElement mockProj = ProjectRootElement.Create(); - ProjectPropertyGroupElement commonPropertyGroup = mockProj.AddPropertyGroup(); - - var commands = new[] { "fakecommand1", "fakecommand2", "mockcommand3" }; - var commandsInTask = commands.ToDictionary(c => c, c => false); - - var target = scriptMigrationRule.MigrateScriptSet( - mockProj, - commonPropertyGroup, - commands, - scriptName, - IsMultiTFM); - - foreach (var task in target.Tasks) - { - var taskCommand = task.GetParameter("Command"); - var originalCommandCandidates = commands.Where(c => taskCommand.Contains(c)); - originalCommandCandidates.Count().Should().Be(1); - - var command = originalCommandCandidates.First(); - commandsInTask[command] - .Should().Be(false, "Expected to find each element from commands Array once"); - - commandsInTask[command] = true; - } - - commandsInTask.All(commandInTask => commandInTask.Value) - .Should() - .BeTrue("Expected each element from commands array to be found in a task"); - } - - [Theory] - [InlineData("precompile")] - [InlineData("postcompile")] - [InlineData("prepublish")] - [InlineData("postpublish")] - public void MigratedScriptSetHasExecAndReplacesVariables(string scriptName) - { - var scriptMigrationRule = new MigrateScriptsRule(); - ProjectRootElement mockProj = ProjectRootElement.Create(); - ProjectPropertyGroupElement commonPropertyGroup = mockProj.AddPropertyGroup(); - - var commands = new[] { "%compile:FullTargetFramework%", "%compile:Configuration%"}; - - var target = scriptMigrationRule.MigrateScriptSet( - mockProj, - commonPropertyGroup, - commands, - scriptName, - IsMultiTFM); - - target.Tasks.Count().Should().Be(commands.Length); - - foreach (var task in target.Tasks) - { - var taskCommand = task.GetParameter("Command"); - var commandIndex = Array.IndexOf(commands, taskCommand); - - commandIndex.Should().Be( - -1, - "Expected command array elements to be replaced by appropriate msbuild properties"); - } - } - - [Fact] - public void PublishIISCommandDoesNotGetMigratedBecauseItIsNowInTheWebSDK() - { - var scriptMigrationRule = new MigrateScriptsRule(); - ProjectRootElement mockProj = ProjectRootElement.Create(); - ProjectPropertyGroupElement commonPropertyGroup = mockProj.AddPropertyGroup(); - - var commands = new[] - { - "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" - }; - - var target = scriptMigrationRule.MigrateScriptSet( - mockProj, - commonPropertyGroup, - commands, - "postpublish", - IsMultiTFM); - target.Tasks.Should().BeEmpty(); - } - - [Fact] - public void MigratingScriptsReplacesRazorPrecompileWithProperty() - { - var scriptMigrationRule = new MigrateScriptsRule(); - ProjectRootElement mockProj = ProjectRootElement.Create(); - ProjectPropertyGroupElement commonPropertyGroup = mockProj.AddPropertyGroup(); - - var commands = new string[] { "dotnet razor-precompile --configuration %publish:Configuration% --framework %publish:TargetFramework% --output-path %publish:OutputPath% %publish:ProjectPath%" }; - - var target = scriptMigrationRule.MigrateScriptSet( - mockProj, - commonPropertyGroup, - commands, - "postpublish", - IsMultiTFM); - - target.Tasks.Should().BeEmpty(); - commonPropertyGroup.Properties.Count().Should().Be(1); - var propertyElement = commonPropertyGroup.Properties.First(); - propertyElement.Name.Should().Be("MvcRazorCompileOnPublish"); - propertyElement.Value.Should().Be("true"); - } - - [Fact] - public void FormattingScriptCommandsReplacesUnknownVariablesWithMSBuildPropertyForEnvironmentVariableSupport() - { - var scriptMigrationRule = new MigrateScriptsRule(); - scriptMigrationRule.ReplaceScriptVariables($"%UnknownVariable%").Should().Be("$(UnknownVariable)"); - } - - [Fact] - public void MigratingScriptsWithMultiTFMCreatesTargetWithIsCrosstargetingBuildNotEqualTrueCondition() - { - var scriptMigrationRule = new MigrateScriptsRule(); - ProjectRootElement mockProj = ProjectRootElement.Create(); - ProjectPropertyGroupElement commonPropertyGroup = mockProj.AddPropertyGroup(); - - var commands = new[] { "compile:FullTargetFramework", "compile:Configuration"}; - - var target = scriptMigrationRule.MigrateScriptSet( - mockProj, - commonPropertyGroup, - commands, - "prepublish", - IsMultiTFM); - target.Condition.Should().Be(" '$(IsCrossTargetingBuild)' != 'true' "); - } - - [Fact] - public void MigratingScriptsWithSingleTFMDoesNotCreateTargetWithIsCrosstargetingBuild() - { - var scriptMigrationRule = new MigrateScriptsRule(); - ProjectRootElement mockProj = ProjectRootElement.Create(); - ProjectPropertyGroupElement commonPropertyGroup = mockProj.AddPropertyGroup(); - - var commands = new[] { "compile:FullTargetFramework", "compile:Configuration"}; - - var target = scriptMigrationRule.MigrateScriptSet( - mockProj, - commonPropertyGroup, - commands, - "prepublish", - false); - target.Condition.Should().BeEmpty(); - } - - [Fact] - public void MigratingScriptsThrowsOnInvalidScriptSet() - { - var scriptMigrationRule = new MigrateScriptsRule(); - ProjectRootElement mockProj = ProjectRootElement.Create(); - ProjectPropertyGroupElement commonPropertyGroup = mockProj.AddPropertyGroup(); - - var commands = new string[] { "fakecommand" }; - - Action action = () => scriptMigrationRule.MigrateScriptSet( - mockProj, - commonPropertyGroup, - commands, - "invalidScriptSet", - IsMultiTFM); - - action.ShouldThrow() - .WithMessage("MIGRATE1019::Unsupported Script Event Hook: invalidScriptSet is an unsupported script event hook for project migration"); - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateTFMs.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateTFMs.cs deleted file mode 100644 index f93611e75..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateTFMs.cs +++ /dev/null @@ -1,202 +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.Build.Construction; -using Microsoft.DotNet.ProjectJsonMigration; -using Microsoft.DotNet.Internal.ProjectModel; -using Microsoft.DotNet.Tools.Test.Utilities; -using NuGet.Frameworks; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Xunit; -using FluentAssertions; -using Microsoft.DotNet.ProjectJsonMigration.Rules; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenThatIWantToMigrateTFMs : TestBase - { - [Fact(Skip="Emitting this until x-targeting full support is in")] - public void MigratingNetcoreappProjectDoesNotPopulateTargetFrameworkIdentifierAndTargetFrameworkVersion() - { - var testDirectory = Temp.CreateDirectory().Path; - var testPJ = new ProjectJsonBuilder(TestAssets) - .FromTestAssetBase("TestAppWithRuntimeOptions") - .WithCustomProperty("buildOptions", new Dictionary - { - { "emitEntryPoint", "false" } - }) - .SaveToDisk(testDirectory); - - var projectContext = ProjectContext.Create(testDirectory, FrameworkConstants.CommonFrameworks.NetCoreApp10); - var mockProj = ProjectRootElement.Create(); - - var migrationSettings = MigrationSettings.CreateMigrationSettingsTestHook(testDirectory, testDirectory, mockProj); - var migrationInputs = new MigrationRuleInputs( - new[] { projectContext }, - mockProj, - mockProj.AddItemGroup(), - mockProj.AddPropertyGroup()); - - new MigrateTFMRule().Apply(migrationSettings, migrationInputs); - - mockProj.Properties.Count(p => p.Name == "TargetFrameworkIdentifier").Should().Be(0); - mockProj.Properties.Count(p => p.Name == "TargetFrameworkVersion").Should().Be(0); - } - - [Fact] - public void MigratingMultiTFMProjectPopulatesTargetFrameworksWithShortTfms() - { - var testDirectory = Temp.CreateDirectory().Path; - var testPJ = new ProjectJsonBuilder(TestAssets) - .FromTestAssetBase("TestLibraryWithMultipleFrameworks") - .SaveToDisk(testDirectory); - - var projectContexts = ProjectContext.CreateContextForEachFramework(testDirectory); - var mockProj = ProjectRootElement.Create(); - - var migrationSettings = MigrationSettings.CreateMigrationSettingsTestHook(testDirectory, testDirectory, mockProj); - var migrationInputs = new MigrationRuleInputs( - projectContexts, - mockProj, - mockProj.AddItemGroup(), - mockProj.AddPropertyGroup()); - - new MigrateTFMRule().Apply(migrationSettings, migrationInputs); - - mockProj.Properties.Count(p => p.Name == "TargetFrameworks").Should().Be(1); - mockProj.Properties.First(p => p.Name == "TargetFrameworks") - .Value.Should().Be("net20;net35;net40;net461;netstandard1.5"); - } - - [Fact] - public void MigratingCoreAndDesktopTFMsDoesNoAddRuntimeIdentifiersOrRuntimeIdentifierWhenTheProjectDoesNothaveAnyAlready() - { - var testDirectory = Temp.CreateDirectory().Path; - var testPJ = new ProjectJsonBuilder(TestAssets) - .FromTestAssetBase("PJAppWithMultipleFrameworks") - .SaveToDisk(testDirectory); - - var projectContexts = ProjectContext.CreateContextForEachFramework(testDirectory); - var mockProj = ProjectRootElement.Create(); - - var migrationSettings = MigrationSettings.CreateMigrationSettingsTestHook(testDirectory, testDirectory, mockProj); - var migrationInputs = new MigrationRuleInputs( - projectContexts, - mockProj, - mockProj.AddItemGroup(), - mockProj.AddPropertyGroup()); - - new MigrateTFMRule().Apply(migrationSettings, migrationInputs); - - mockProj.Properties.Count(p => p.Name == "RuntimeIdentifiers").Should().Be(0); - mockProj.Properties.Count(p => p.Name == "RuntimeIdentifier").Should().Be(0); - } - - [Fact] - public void MigrateTFMRuleDoesNotAddRuntimesWhenMigratingDesktopTFMsWithRuntimesAlready() - { - var testDirectory = Temp.CreateDirectory().Path; - var testPJ = new ProjectJsonBuilder(TestAssets) - .FromTestAssetBase("TestAppWithMultipleFrameworksAndRuntimes") - .SaveToDisk(testDirectory); - - var projectContexts = ProjectContext.CreateContextForEachFramework(testDirectory); - var mockProj = ProjectRootElement.Create(); - - var migrationSettings = - MigrationSettings.CreateMigrationSettingsTestHook(testDirectory, testDirectory, mockProj); - var migrationInputs = new MigrationRuleInputs( - projectContexts, - mockProj, - mockProj.AddItemGroup(), - mockProj.AddPropertyGroup()); - - new MigrateTFMRule().Apply(migrationSettings, migrationInputs); - - mockProj.Properties.Count(p => p.Name == "RuntimeIdentifiers").Should().Be(0); - } - - [Fact] - public void MigratingProjectWithFullFrameworkTFMsDoesNotAddRuntimeIdentifiersOrRuntimeIdentiferWhenNoRuntimesExistAlready() - { - var testDirectory = Temp.CreateDirectory().Path; - var testPJ = new ProjectJsonBuilder(TestAssets) - .FromTestAssetBase("AppWith4netTfm0Rid") - .SaveToDisk(testDirectory); - - var projectContexts = ProjectContext.CreateContextForEachFramework(testDirectory); - var mockProj = ProjectRootElement.Create(); - - var migrationSettings = - MigrationSettings.CreateMigrationSettingsTestHook(testDirectory, testDirectory, mockProj); - var migrationInputs = new MigrationRuleInputs( - projectContexts, - mockProj, - mockProj.AddItemGroup(), - mockProj.AddPropertyGroup()); - - new MigrateTFMRule().Apply(migrationSettings, migrationInputs); - - mockProj.Properties.Count(p => p.Name == "RuntimeIdentifiers").Should().Be(0); - mockProj.Properties.Where(p => p.Name == "RuntimeIdentifier").Should().HaveCount(0); - } - - [Fact] - public void MigratingSingleTFMProjectPopulatesTargetFramework() - { - var testDirectory = Temp.CreateDirectory().Path; - var testPJ = new ProjectJsonBuilder(TestAssets) - .FromTestAssetBase("TestAppWithRuntimeOptions") - .WithCustomProperty("buildOptions", new Dictionary - { - { "emitEntryPoint", "false" } - }) - .SaveToDisk(testDirectory); - - var projectContexts = ProjectContext.CreateContextForEachFramework(testDirectory); - var mockProj = ProjectRootElement.Create(); - - // Run BuildOptionsRule - var migrationSettings = MigrationSettings.CreateMigrationSettingsTestHook(testDirectory, testDirectory, mockProj); - var migrationInputs = new MigrationRuleInputs( - projectContexts, - mockProj, - mockProj.AddItemGroup(), - mockProj.AddPropertyGroup()); - - new MigrateTFMRule().Apply(migrationSettings, migrationInputs); - Console.WriteLine(mockProj.RawXml); - - mockProj.Properties.Count(p => p.Name == "TargetFramework").Should().Be(1); - } - - [Fact] - public void MigratingLibWithMultipleTFMsDoesNotAddRuntimes() - { - var testDirectory = Temp.CreateDirectory().Path; - var testPJ = new ProjectJsonBuilder(TestAssets) - .FromTestAssetBase("PJLibWithMultipleFrameworks") - .SaveToDisk(testDirectory); - - var projectContexts = ProjectContext.CreateContextForEachFramework(testDirectory); - var mockProj = ProjectRootElement.Create(); - - var migrationSettings = - MigrationSettings.CreateMigrationSettingsTestHook(testDirectory, testDirectory, mockProj); - var migrationInputs = new MigrationRuleInputs( - projectContexts, - mockProj, - mockProj.AddItemGroup(), - mockProj.AddPropertyGroup()); - - new MigrateTFMRule().Apply(migrationSettings, migrationInputs); - - var reason = "Should not add runtime identifiers for libraries"; - mockProj.Properties.Count(p => p.Name == "RuntimeIdentifiers").Should().Be(0, reason); - mockProj.Properties.Count(p => p.Name == "RuntimeIdentifier").Should().Be(0, reason); - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateTools.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateTools.cs deleted file mode 100644 index 98ebc43e1..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateTools.cs +++ /dev/null @@ -1,107 +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.Tools.Test.Utilities; -using System.Linq; -using Xunit; -using FluentAssertions; -using System; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenThatIWantToMigrateTools : PackageDependenciesTestBase - { - [Theory] - [InlineData("Microsoft.EntityFrameworkCore.Tools", "1.0.0-preview2-final", "Microsoft.EntityFrameworkCore.Tools", ConstantPackageVersions.AspNetToolsVersion)] - [InlineData("Microsoft.VisualStudio.Web.CodeGenerators.Mvc", "1.0.0-preview2-final", "Microsoft.VisualStudio.Web.CodeGeneration.Design", ConstantPackageVersions.AspNetToolsVersion)] - [InlineData("Microsoft.VisualStudio.Web.CodeGenerators.Mvc", "1.0.0-*", "Microsoft.VisualStudio.Web.CodeGeneration.Design", ConstantPackageVersions.AspNetToolsVersion)] - [InlineData("Microsoft.VisualStudio.Web.CodeGenerators.Mvc", "1.0.1", "Microsoft.VisualStudio.Web.CodeGeneration.Design", ConstantPackageVersions.AspNetToolsVersion)] - [InlineData("Microsoft.VisualStudio.Web.CodeGenerators.Mvc", "1.0.0-preview3-final", "Microsoft.VisualStudio.Web.CodeGeneration.Design", ConstantPackageVersions.AspNetToolsVersion)] - [InlineData("Microsoft.VisualStudio.Web.CodeGenerators.Mvc", "1.1.0-preview4-final", "Microsoft.VisualStudio.Web.CodeGeneration.Design", ConstantPackageVersions.AspNet110ToolsVersion)] - [InlineData("Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design", "1.1.0-preview4-final", "Microsoft.AspNetCore.Mvc.Razor.ViewCompilation", ConstantPackageVersions.AspNet110ToolsVersion)] - [InlineData("Microsoft.VisualStudio.Web.BrowserLink.Loader", "14.0.0-preview2-final", "Microsoft.VisualStudio.Web.BrowserLink", "1.0.1")] - [InlineData("Microsoft.VisualStudio.Web.BrowserLink.Loader", "14.0.0-*", "Microsoft.VisualStudio.Web.BrowserLink", "1.0.1")] - [InlineData("Microsoft.VisualStudio.Web.BrowserLink.Loader", "14.0.1", "Microsoft.VisualStudio.Web.BrowserLink", "1.0.1")] - [InlineData("Microsoft.VisualStudio.Web.BrowserLink.Loader", "14.1.0-preview4-final", "Microsoft.VisualStudio.Web.BrowserLink", "1.1.0")] - public void ItMigratesProjectDependenciesToANewNameAndVersion( - string sourceToolName, - string sourceVersion, - string targetToolName, - string targetVersion) - { - var mockProj = RunPackageDependenciesRuleOnPj("{ \"dependencies\": { \"" + sourceToolName + "\" : { \"version\": \"" + sourceVersion + "\", \"type\": \"build\" } } }"); - - var packageRef = mockProj.Items.First(i => i.Include == targetToolName && i.ItemType == "PackageReference"); - - packageRef.GetMetadataWithName("Version").Value.Should().Be(targetVersion); - - packageRef.GetMetadataWithName("PrivateAssets").Value.Should().NotBeNull().And.Be("All"); - } - - [Theory] - [InlineData("Microsoft.AspNetCore.Razor.Tools")] - [InlineData("Microsoft.AspNetCore.Razor.Design")] - [InlineData("Microsoft.VisualStudio.Web.CodeGeneration.Tools")] - [InlineData("dotnet-test-xunit")] - [InlineData("dotnet-test-mstest")] - public void ItDoesNotMigrateProjectToolDependencyThatIsNoLongerNeeded(string dependencyName) - { - var mockProj = RunPackageDependenciesRuleOnPj(@" - { - ""dependencies"": { - """ + dependencyName + @""" : { - ""version"": ""1.0.0-preview2-final"", - ""type"": ""build"" - } - } - }"); - - var packageRef = mockProj.Items.Where(i => - i.Include != "Microsoft.NET.Sdk" && - i.Include != "NETStandard.Library" && - i.ItemType == "PackageReference").Should().BeEmpty(); - } - - [Theory] - [InlineData("Microsoft.EntityFrameworkCore.Tools.DotNet", "Microsoft.EntityFrameworkCore.Tools.DotNet", ConstantPackageVersions.AspNetToolsVersion)] - [InlineData("Microsoft.EntityFrameworkCore.Tools", "Microsoft.EntityFrameworkCore.Tools.DotNet", ConstantPackageVersions.AspNetToolsVersion)] - [InlineData("Microsoft.VisualStudio.Web.CodeGeneration.Tools", "Microsoft.VisualStudio.Web.CodeGeneration.Tools", ConstantPackageVersions.AspNetToolsVersion)] - [InlineData("Microsoft.DotNet.Watcher.Tools", "Microsoft.DotNet.Watcher.Tools", ConstantPackageVersions.AspNetToolsVersion)] - [InlineData("Microsoft.Extensions.SecretManager.Tools", "Microsoft.Extensions.SecretManager.Tools", ConstantPackageVersions.AspNetToolsVersion)] - [InlineData("BundlerMinifier.Core", "BundlerMinifier.Core", ConstantPackageVersions.BundleMinifierToolVersion)] - public void ItMigratesAspProjectToolsToANewNameAndVersion( - string sourceToolName, - string targetToolName, - string targetVersion) - { - const string anyVersion = "1.0.0-preview2-final"; - var mockProj = RunPackageDependenciesRuleOnPj("{ \"tools\": { \"" + sourceToolName + "\": \"" + anyVersion + "\" } }"); - - EmitsToolReferences(mockProj, Tuple.Create(targetToolName, targetVersion)); - } - - [Theory] - [InlineData("Microsoft.AspNetCore.Razor.Tools")] - [InlineData("Microsoft.AspNetCore.Server.IISIntegration.Tools")] - [InlineData("Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools")] - public void ItDoesNotMigrateAspProjectTool(string toolName) - { - var mockProj = RunPackageDependenciesRuleOnPj(@" - { - ""tools"": { - """ + toolName + @""": ""1.0.0-preview2-final"" - } - }"); - - var packageRef = mockProj.Items.Where(i => i.ItemType == "DotNetCliToolReference").Should().BeEmpty(); - } - - [Fact] - public void ItMergesEntityFrameworkCoreToolsAndEntityFrameworkCoreToolsDotNet() - { - var mockProj = RunPackageDependenciesRuleOnPj("{ \"tools\": { \"Microsoft.EntityFrameworkCore.Tools\": \"1.0.0-preview4-final\", \"Microsoft.EntityFrameworkCore.Tools.DotNet\": \"1.0.0-preview4-final\" } }"); - - EmitsToolReferences(mockProj, Tuple.Create("Microsoft.EntityFrameworkCore.Tools.DotNet", ConstantPackageVersions.AspNetToolsVersion)); - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateWebProjects.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateWebProjects.cs deleted file mode 100644 index 81a9f475a..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/GivenThatIWantToMigrateWebProjects.cs +++ /dev/null @@ -1,64 +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.Build.Construction; -using Microsoft.DotNet.Tools.Test.Utilities; -using System.Linq; -using Xunit; -using FluentAssertions; -using Microsoft.DotNet.ProjectJsonMigration; -using Microsoft.DotNet.ProjectJsonMigration.Rules; -using System; -using System.IO; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenThatIWantToMigrateWebProjects : PackageDependenciesTestBase - { - [Fact] - public void ItMigratesWebProjectsToHaveWebSdkInTheSdkAttribute() - { - var csprojFilePath = RunMigrateWebSdkRuleOnPj(@" - { - ""buildOptions"": { - ""emitEntryPoint"": true - }, - ""dependencies"": { - ""Microsoft.AspNetCore.Mvc"" : { - ""version"": ""1.0.0"" - } - }, - ""frameworks"": { - ""netcoreapp1.0"": {} - } - }"); - - File.ReadAllText(csprojFilePath).Should().Contain(@"Sdk=""Microsoft.NET.Sdk.Web"""); - } - - private string RunMigrateWebSdkRuleOnPj(string s, string testDirectory = null) - { - testDirectory = testDirectory ?? Temp.CreateDirectory().Path; - var csprojFilePath = Path.Combine(testDirectory, $"{GetContainingFolderName(testDirectory)}.csproj"); - - File.WriteAllText(csprojFilePath, @" - - - - "); - - TemporaryProjectFileRuleRunner.RunRules(new IMigrationRule[] - { - new MigrateWebSdkRule() - }, s, testDirectory); - - return csprojFilePath; - } - - private static string GetContainingFolderName(string projectDirectory) - { - projectDirectory = projectDirectory.TrimEnd(new char[] { '/', '\\' }); - return Path.GetFileName(projectDirectory); - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/PackageDependenciesTestBase.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/PackageDependenciesTestBase.cs deleted file mode 100644 index f97bc4a35..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Rules/PackageDependenciesTestBase.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.Build.Construction; -using Microsoft.DotNet.Tools.Test.Utilities; -using System.Linq; -using FluentAssertions; -using Microsoft.DotNet.ProjectJsonMigration.Rules; -using System; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class PackageDependenciesTestBase : TestBase - { - protected void EmitsPackageReferences(ProjectRootElement mockProj, params Tuple[] packageSpecs) - { - foreach (var packageSpec in packageSpecs) - { - var packageName = packageSpec.Item1; - var packageVersion = packageSpec.Item2; - var packageTFM = packageSpec.Item3; - - var items = mockProj.Items - .Where(i => i.ItemType == "PackageReference") - .Where(i => string.IsNullOrEmpty(packageTFM) || i.ConditionChain().Any(c => c.Contains(packageTFM))) - .Where(i => i.Include == packageName) - .Where(i => i.GetMetadataWithName("Version").Value == packageVersion && - i.GetMetadataWithName("Version").ExpressedAsAttribute); - - items.Should().HaveCount(1); - } - } - - protected void EmitsToolReferences(ProjectRootElement mockProj, params Tuple[] toolSpecs) - { - foreach (var toolSpec in toolSpecs) - { - var packageName = toolSpec.Item1; - var packageVersion = toolSpec.Item2; - - var items = mockProj.Items - .Where(i => i.ItemType == "DotNetCliToolReference") - .Where(i => i.Include == packageName) - .Where(i => i.GetMetadataWithName("Version").Value == packageVersion && - i.GetMetadataWithName("Version").ExpressedAsAttribute); - - items.Should().HaveCount(1); - } - } - - protected ProjectRootElement RunPackageDependenciesRuleOnPj(string s, string testDirectory = null) - { - testDirectory = - testDirectory ?? - Temp.CreateDirectory().DirectoryInfo.CreateSubdirectory("project").FullName; - - return TemporaryProjectFileRuleRunner.RunRules(new IMigrationRule[] - { - new MigratePackageDependenciesAndToolsRule() - }, s, testDirectory); - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/TemporaryProjectFileRuleRunner.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/TemporaryProjectFileRuleRunner.cs deleted file mode 100644 index 3ea3523a8..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/TemporaryProjectFileRuleRunner.cs +++ /dev/null @@ -1,86 +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.Build.Construction; -using Microsoft.DotNet.ProjectJsonMigration.Rules; -using Microsoft.DotNet.Internal.ProjectModel; -using Microsoft.DotNet.TestFramework; -using NuGet.Frameworks; -using System.IO; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - internal class TemporaryProjectFileRuleRunner - { - public static ProjectRootElement RunRules( - IEnumerable rules, - string projectJson, - string testDirectory, - ProjectRootElement xproj=null) - { - var projectContexts = GenerateProjectContextsFromString(testDirectory, projectJson); - return RunMigrationRulesOnGeneratedProject(rules, projectContexts, testDirectory, xproj); - } - - private static IEnumerable GenerateProjectContextsFromString( - string projectDirectory, - string json) - { - - var globalJson = Path.Combine(new DirectoryInfo(projectDirectory).Parent.FullName, "global.json"); - if (!File.Exists(globalJson)) - { - var file = new FileInfo(globalJson); - try - { - File.WriteAllText(file.FullName, @"{}"); - } - catch (IOException) - { - //this means there is someone else writing to the file already. So, just ignore it. - } - } - - var testPj = new ProjectJsonBuilder(null) - .FromStringBase(json) - .SaveToDisk(projectDirectory); - - var projectContexts = ProjectContext.CreateContextForEachFramework(projectDirectory); - - if (projectContexts.Count() == 0) - { - projectContexts = new [] - { - ProjectContext.Create(testPj, FrameworkConstants.CommonFrameworks.NetCoreApp10) - }; - } - - return projectContexts; - } - - private static ProjectRootElement RunMigrationRulesOnGeneratedProject( - IEnumerable rules, - IEnumerable projectContexts, - string testDirectory, - ProjectRootElement xproj) - { - var project = ProjectRootElement.Create(); - var testSettings = MigrationSettings.CreateMigrationSettingsTestHook(testDirectory, testDirectory, project); - var testInputs = new MigrationRuleInputs( - projectContexts, - project, - project.AddItemGroup(), - project.AddPropertyGroup(), - xproj); - - foreach (var rule in rules) - { - rule.Apply(testSettings, testInputs); - } - - return project; - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Transforms/GivenAConditionalTransform.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Transforms/GivenAConditionalTransform.cs deleted file mode 100644 index d4a5030e4..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Transforms/GivenAConditionalTransform.cs +++ /dev/null @@ -1,48 +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.ProjectJsonMigration; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Xunit; -using FluentAssertions; -using Microsoft.Build.Construction; -using Microsoft.DotNet.ProjectJsonMigration.Transforms; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenAConditionalTransform - { - [Fact] - public void It_returns_null_when_condition_is_false() - { - var conditionalTransform = new TestConditionalTransform(t => false); - conditionalTransform.Transform("astring").Should().BeNull(); - } - - [Fact] - public void It_returns_result_of_ConditionallyTransform_when_condition_is_true() - { - var conditionalTransform = new TestConditionalTransform(t => true); - - var property = conditionalTransform.Transform("astring"); - property.Should().NotBeNull(); - property.Name.Should().Be("astring"); - property.Value.Should().Be("astring"); - } - - private class TestConditionalTransform : ConditionalTransform - { - public TestConditionalTransform(Func condition) : base(condition) { } - - public override ProjectPropertyElement ConditionallyTransform(string source) - { - var property = ProjectRootElement.Create().CreatePropertyElement(source); - property.Value = source; - return property; - } - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Transforms/GivenATransformApplicator.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Transforms/GivenATransformApplicator.cs deleted file mode 100644 index 36a0fb196..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Transforms/GivenATransformApplicator.cs +++ /dev/null @@ -1,91 +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.Build.Construction; -using Xunit; -using FluentAssertions; -using System.Linq; -using Microsoft.DotNet.ProjectJsonMigration.Models; -using Microsoft.DotNet.ProjectJsonMigration.Transforms; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenATransformApplicator - { - [Fact] - public void It_merges_Metadata_and_Exclude_with_items_with_same_ItemType_and_Include_when_mergeExisting_is_true() - { - var metadata = new ItemMetadataValue[] - { - new ItemMetadataValue("metadata1", "value1"), - new ItemMetadataValue("metadata2", "value2") - }; - - var fullItemTransformSetIncludeValue = "include1;include2"; - - var transform1 = new AddItemTransform("item", - fullItemTransformSetIncludeValue, - "exclude1", - t => true) - .WithMetadata(metadata[0]); - - var transform2 = new AddItemTransform("item", - fullItemTransformSetIncludeValue, - "exclude2", - t => true) - .WithMetadata(metadata[1]); - - var mockProj = ProjectRootElement.Create(); - var itemGroup = mockProj.AddItemGroup(); - - var item1 = transform1.Transform("_"); - item1.AddMetadata(metadata[0].MetadataName, metadata[0].GetMetadataValue(null)); - - var item2 = transform2.Transform("_"); - item2.AddMetadata(metadata[1].MetadataName, metadata[1].GetMetadataValue(null)); - - var transformApplicator = new TransformApplicator(); - transformApplicator.Execute(new ProjectItemElement[] {item1, item2}.Select(i => i), itemGroup, mergeExisting:true); - - itemGroup.Items.Count.Should().Be(1); - - var item = itemGroup.Items.First(); - item.Exclude.Should().Be("exclude1;exclude2"); - - item.Metadata.Count().Should().Be(2); - var foundMetadata = metadata.ToDictionary, string, bool>(m => m.MetadataName, - m => false); - - foreach (var metadataEntry in item.Metadata) - { - foundMetadata.Should().ContainKey(metadataEntry.Name); - foundMetadata[metadataEntry.Name].Should().BeFalse(); - foundMetadata[metadataEntry.Name] = true; - } - - foundMetadata.All(kv => kv.Value).Should().BeTrue(); - } - - [Fact] - public void It_merges_Properties_value_split_by_semicolon_except_variables_when_mergeExisting_is_true() - { - var mockProj = ProjectRootElement.Create(); - var existingProperty = mockProj.AddProperty("property1","value1;$(Variable1);$(Variable2);value2"); - - var propertyGeneratorProject = ProjectRootElement.Create(); - var propertyToAdd = propertyGeneratorProject.AddProperty("property1", "$(Variable2);value1;value3;$(Variable3)"); - - var transformApplicator = new TransformApplicator(); - - transformApplicator.Execute(propertyToAdd, mockProj.AddPropertyGroup(), mergeExisting: true); - - var outputProperties = mockProj.Properties.Where(p => p.Name == "property1"); - outputProperties.Should().HaveCount(2); - - var mergedPropertyToAdd = outputProperties.Where(p => p.Value.Contains("value3")).First(); - - mergedPropertyToAdd.Value.Should().Be("$(Variable2);value3;$(Variable3)"); - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Transforms/GivenAnAddItemTransform.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Transforms/GivenAnAddItemTransform.cs deleted file mode 100644 index e97453c86..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Transforms/GivenAnAddItemTransform.cs +++ /dev/null @@ -1,89 +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.Build.Construction; -using Microsoft.DotNet.ProjectJsonMigration; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Xunit; -using FluentAssertions; -using Microsoft.DotNet.ProjectJsonMigration.Models; -using Microsoft.DotNet.ProjectJsonMigration.Transforms; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenAnAddItemTransform - { - [Fact] - public void It_returns_an_item_with_Include_Exclude_and_Metadata_to_project_when_condition_is_true() - { - var itemTransforms = GetFullItemTransformSet(true); - - foreach (var transform in itemTransforms) - { - var item = transform.Transform("_"); - - item.Should().NotBeNull(); - item.Include.Should().Be(FullItemTransformSetIncludeValue); - item.Exclude.Should().Be(FullItemTransformSetExcludeValue); - - item.HasMetadata.Should().BeTrue(); - - var metadata = item.Metadata.First(); - metadata.Name.Should().Be(FullItemTransformSetMetadataName); - metadata.Value.Should().Be(FullItemTransformSetMetadataValue); - } - } - - [Fact] - public void It_returns_null_when_condition_is_false() - { - var itemTransforms = GetFullItemTransformSet(false); - - foreach (var transform in itemTransforms) - { - transform.Transform("_").Should().BeNull(); - } - } - - private static string FullItemTransformSetItemNamePrefix => "item"; - private static string FullItemTransformSetIncludeValue => "include1;include2"; - private static string FullItemTransformSetExcludeValue => "exclude1;exclude2"; - private static string FullItemTransformSetMetadataName => "SomeName"; - private static string FullItemTransformSetMetadataValue => "SomeValue"; - - private AddItemTransform[] GetFullItemTransformSet(bool condition) - { - return new AddItemTransform[] - { - new AddItemTransform(FullItemTransformSetItemNamePrefix + "1", - FullItemTransformSetIncludeValue.Split(';'), - FullItemTransformSetExcludeValue.Split(';'), - t => condition) - .WithMetadata(FullItemTransformSetMetadataName, FullItemTransformSetMetadataValue), - new AddItemTransform(FullItemTransformSetItemNamePrefix + "2", - t => FullItemTransformSetIncludeValue, - t => FullItemTransformSetExcludeValue, - t => condition) - .WithMetadata(FullItemTransformSetMetadataName, t => FullItemTransformSetMetadataValue), - new AddItemTransform(FullItemTransformSetItemNamePrefix + "3", - FullItemTransformSetIncludeValue, - t => FullItemTransformSetExcludeValue, - t => condition) - .WithMetadata(new ItemMetadataValue(FullItemTransformSetMetadataName, FullItemTransformSetMetadataValue)), - new AddItemTransform(FullItemTransformSetItemNamePrefix + "4", - t => FullItemTransformSetIncludeValue, - FullItemTransformSetExcludeValue, - t => condition) - .WithMetadata(new ItemMetadataValue(FullItemTransformSetMetadataName, t => FullItemTransformSetMetadataValue)), - new AddItemTransform(FullItemTransformSetItemNamePrefix + "5", - FullItemTransformSetIncludeValue, - FullItemTransformSetExcludeValue, - t => condition) - .WithMetadata(FullItemTransformSetMetadataName, FullItemTransformSetMetadataValue) - }; - } - } -} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Transforms/GivenAnAddPropertyTransform.cs b/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Transforms/GivenAnAddPropertyTransform.cs deleted file mode 100644 index 008308948..000000000 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Transforms/GivenAnAddPropertyTransform.cs +++ /dev/null @@ -1,97 +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.Build.Construction; -using Microsoft.DotNet.ProjectJsonMigration; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Xunit; -using FluentAssertions; -using Microsoft.DotNet.ProjectJsonMigration.Transforms; - -namespace Microsoft.DotNet.ProjectJsonMigration.Tests -{ - public class GivenAnAddPropertyTransform - { - [Fact] - public void It_returns_a_property_with_specified_value() - { - var propertyName = "Property1"; - var propertyValue = "Value1"; - - var propertyTransform = new AddPropertyTransform(propertyName, propertyValue, t=>true); - var property = propertyTransform.Transform("_"); - - property.Name.Should().Be(propertyName); - property.Value.Should().Be(propertyValue); - } - - [Fact] - public void It_returns_a_property_with_computed_value() - { - var propertyName = "Property1"; - var propertyValue = "Value1"; - - var propertyTransform = new AddPropertyTransform(propertyName, t => t.ToUpper(), t => true); - var property = propertyTransform.Transform(propertyValue); - - property.Name.Should().Be(propertyName); - property.Value.Should().Be(propertyValue.ToUpper()); - } - - [Fact] - public void It_returns_null_when_condition_is_false() - { - var propertyName = "Property1"; - var propertyValue = "Value1"; - - var propertyTransform = new AddPropertyTransform(propertyName, propertyValue, t => false); - propertyTransform.Transform(propertyValue).Should().BeNull(); - } - - [Fact] - public void It_returns_a_property_when_source_is_null_and_propertyValue_is_a_string() - { - var propertyName = "Property1"; - var propertyValue = "Value1"; - - var propertyTransform = new AddPropertyTransform( - propertyName, - propertyValue, - t => true); - var property = propertyTransform.Transform(null); - property.Should().NotBeNull(); - property.Value.Should().Be(propertyValue); - } - - [Fact] - public void It_returns_a_property_when_source_is_null_and_propertyValue_is_a_Func_that_handles_null() - { - var propertyName = "Property1"; - var propertyValue = "Value1"; - - var propertyTransform = new AddPropertyTransform( - propertyName, - t=> t == null ? propertyValue.ToUpper() : propertyValue.ToLower(), - t => true); - var property = propertyTransform.Transform(null); - property.Value.Should().Be(propertyValue.ToUpper()); - } - - [Fact] - public void It_throws_when_source_is_null_and_propertyValue_is_a_Func_that_doesnt_handle_null() - { - var propertyName = "Property1"; - - var propertyTransform = new AddPropertyTransform( - propertyName, - t => t.ToUpper(), - t => true); - - Action transform = () => propertyTransform.Transform(null); - transform.ShouldThrow(); - } - } -} diff --git a/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj b/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj index 686afe6a3..3d762fb60 100644 --- a/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj +++ b/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj @@ -11,7 +11,6 @@ - @@ -22,5 +21,6 @@ + diff --git a/test/dotnet-add-package.Tests/GivenDotnetPackageAdd.cs b/test/dotnet-add-package.Tests/GivenDotnetPackageAdd.cs index 915b89545..678018d09 100644 --- a/test/dotnet-add-package.Tests/GivenDotnetPackageAdd.cs +++ b/test/dotnet-add-package.Tests/GivenDotnetPackageAdd.cs @@ -116,6 +116,27 @@ namespace Microsoft.DotNet.Cli.Package.Add.Tests cmd.StdErr.Should().BeEmpty(); } + [Fact] + public void WhenValidPackageIsPassedMSBuildDoesNotPrintVersionHeader() + { + var testAsset = "TestAppSimple"; + var projectDirectory = TestAssets + .Get(testAsset) + .CreateInstance() + .WithSourceFiles() + .Root + .FullName; + + var packageName = "Newtonsoft.Json"; + var packageVersion = "9.0.1"; + var cmd = new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .ExecuteWithCapturedOutput($"add package {packageName} --version {packageVersion}"); + cmd.Should().Pass(); + cmd.StdOut.Should().NotContain("Microsoft (R) Build Engine version"); + cmd.StdErr.Should().BeEmpty(); + } + [Fact] public void WhenMultiplePackagesArePassedCommandFails() { diff --git a/test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs b/test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs index a69479ff3..ed1011d3b 100644 --- a/test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs +++ b/test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs @@ -23,10 +23,25 @@ Arguments: Project to project references to add Options: - -h, --help Show help information + -h, --help Show help information. -f, --framework Add reference only when targeting a specific framework "; + private const string AddCommandHelpText = @".NET Add Command + +Usage: dotnet add [options] [command] + +Arguments: + The project file to operate on. If a file is not specified, the command will search the current directory for one. + +Options: + -h, --help Show help information. + +Commands: + package .NET Add Package reference Command + reference .NET Add Project to Project reference Command +"; + const string FrameworkNet451Arg = "-f net451"; const string ConditionFrameworkNet451 = "== 'net451'"; const string FrameworkNetCoreApp10Arg = "-f netcoreapp1.0"; @@ -103,6 +118,7 @@ Options: .ExecuteWithCapturedOutput($"add {commandName}"); cmd.Should().Fail(); cmd.StdErr.Should().Be("Required command was not provided."); + cmd.StdOut.Should().BeVisuallyEquivalentTo(AddCommandHelpText); } [Fact] diff --git a/test/dotnet-add-reference.Tests/dotnet-add-reference.Tests.csproj b/test/dotnet-add-reference.Tests/dotnet-add-reference.Tests.csproj index d07d2002a..71045dfbc 100644 --- a/test/dotnet-add-reference.Tests/dotnet-add-reference.Tests.csproj +++ b/test/dotnet-add-reference.Tests/dotnet-add-reference.Tests.csproj @@ -12,7 +12,6 @@ - @@ -22,5 +21,6 @@ + diff --git a/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs b/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs index 9ee1dafe5..f67f8556f 100644 --- a/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs +++ b/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs @@ -15,44 +15,46 @@ namespace Microsoft.DotNet.Help.Tests public class GivenThatIWantToShowHelpForDotnetCommand : TestBase { private const string HelpText = -@"Usage: dotnet [host-options] [command] [arguments] [common-options] +@"Usage: dotnet [runtime-options] [path-to-application] +Usage: dotnet [command] [arguments] [command-options] -Arguments: - [command] The command to execute - [arguments] Arguments to pass to the command - [host-options] Options specific to dotnet (host) - [common-options] Options common to all commands +path-to-application: + The path to an application .dll file to execute. + +SDK commands: + new Initialize .NET projects. + restore Restore dependencies specified in the .NET project. + run Compiles and immediately executes a .NET project. + build Builds a .NET project. + publish Publishes a .NET project for deployment (including the runtime). + test Runs unit tests using the test runner specified in the project. + pack Creates a NuGet package. + migrate Migrates a project.json based project to a msbuild based project. + clean Clean build output(s). + sln Modify solution (SLN) files. + add Add reference to the project. + remove Remove reference from the project. + list List reference in the project. + nuget Provides additional NuGet commands. + msbuild Runs Microsoft Build Engine (MSBuild). + vstest Runs Microsoft Test Execution Command Line Tool. + -v|--version Display .NET Core SDK version. + -i|--info Display .NET Core information. + -d|--diagnostics Enable diagnostic output. Common options: -v|--verbose Enable verbose output -h|--help Show help -Host options (passed before the command): - -d|--diagnostics Enable diagnostic output - --version Display .NET CLI Version Number - --info Display .NET CLI Info +Run 'dotnet COMMAND --help' for more information on a command. -Commands: - new Initialize .NET projects. - restore Restore dependencies specified in the .NET project. - build Builds a .NET project. - publish Publishes a .NET project for deployment (including the runtime). - run Compiles and immediately executes a .NET project. - test Runs unit tests using the test runner specified in the project. - pack Creates a NuGet package. - migrate Migrates a project.json based project to a msbuild based project. - clean Clean build output(s). - sln Modify solution (SLN) files. - -Project modification commands: - add Add items to the project. - remove Remove items from the project. - list List items in the project. - -Advanced Commands: - nuget Provides additional NuGet commands. - msbuild Runs Microsoft Build Engine (MSBuild). - vstest Runs Microsoft Test Execution Command Line Tool."; +runtime-options: + --additionalprobingpath Path containing probing policy and assemblies to probe for. + --depsfile Path to .deps.json file. + --runtimeconfig Path to .runtimeconfig.json file. + --fx-version Version of the installed Shared Framework to use to run the application. + --roll-forward-on-no-candidate-fx Roll forward on no candidate shared framework is enabled. + --additional-deps Path to additonal deps.json file."; [Theory] [InlineData("--help")] diff --git a/test/dotnet-list-reference.Tests/GivenDotnetListReference.cs b/test/dotnet-list-reference.Tests/GivenDotnetListReference.cs index bf716bb35..9f3bd680b 100644 --- a/test/dotnet-list-reference.Tests/GivenDotnetListReference.cs +++ b/test/dotnet-list-reference.Tests/GivenDotnetListReference.cs @@ -21,7 +21,21 @@ Arguments: The project file to operate on. If a file is not specified, the command will search the current directory for one. Options: - -h, --help Show help information + -h, --help Show help information. +"; + + private const string ListCommandHelpText = @".NET List Command + +Usage: dotnet list [options] [command] + +Arguments: + The project file to operate on. If a file is not specified, the command will search the current directory for one. + +Options: + -h, --help Show help information. + +Commands: + reference .NET Core Project-to-Project dependency viewer "; const string FrameworkNet451Arg = "-f net451"; @@ -48,6 +62,7 @@ Options: .ExecuteWithCapturedOutput($"list {commandName}"); cmd.Should().Fail(); cmd.StdErr.Should().Be("Required command was not provided."); + cmd.StdOut.Should().BeVisuallyEquivalentTo(ListCommandHelpText); } [Fact] diff --git a/test/dotnet-list-reference.Tests/dotnet-list-reference.Tests.csproj b/test/dotnet-list-reference.Tests/dotnet-list-reference.Tests.csproj index be7c7c2e4..0902fd8a6 100644 --- a/test/dotnet-list-reference.Tests/dotnet-list-reference.Tests.csproj +++ b/test/dotnet-list-reference.Tests/dotnet-list-reference.Tests.csproj @@ -11,7 +11,6 @@ - @@ -20,5 +19,6 @@ + diff --git a/test/dotnet-migrate.Tests/GivenThatAnAppWasMigrated.cs b/test/dotnet-migrate.Tests/GivenThatAnAppWasMigrated.cs deleted file mode 100644 index 4611ef0b1..000000000 --- a/test/dotnet-migrate.Tests/GivenThatAnAppWasMigrated.cs +++ /dev/null @@ -1,146 +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 FluentAssertions; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Common; -using Microsoft.DotNet.Tools.Test.Utilities; -using System; -using System.Collections.Generic; -using System.IO; -using Xunit; - -namespace Microsoft.DotNet.Migration.Tests -{ - public class GivenThatAnAppWasMigrated : TestBase - { - [Theory] - [InlineData("TestAppWithLibrary")] - public void WhenProjectMigrationSucceedsThenProjectJsonArtifactsGetMovedToBackup(string testProjectName) - { - var testRoot = TestAssets - .GetProjectJson(testProjectName) - .CreateInstance() - .WithSourceFiles() - .Root; - - var backupRoot = testRoot.GetDirectory("backup"); - - var migratableArtifacts = GetProjectJsonArtifacts(testRoot); - - new MigrateCommand() - .WithWorkingDirectory(testRoot) - .Execute() - .Should().Pass(); - - var backupArtifacts = GetProjectJsonArtifacts(backupRoot); - - backupArtifacts.Should().Equal(migratableArtifacts, "Because all of and only these artifacts should have been moved"); - - testRoot.Should().NotHaveFiles(backupArtifacts.Keys); - - backupRoot.Should().HaveTextFiles(backupArtifacts); - } - - [Theory] - [InlineData("PJTestAppSimple")] - public void WhenFolderMigrationSucceedsThenProjectJsonArtifactsGetMovedToBackup(string testProjectName) - { - var testRoot = TestAssets - .GetProjectJson(testProjectName) - .CreateInstance() - .WithSourceFiles() - .Root; - - var backupRoot = testRoot.GetDirectory("backup"); - - var migratableArtifacts = GetProjectJsonArtifacts(testRoot); - - new MigrateCommand() - .WithWorkingDirectory(testRoot) - .Execute() - .Should().Pass(); - - var backupArtifacts = GetProjectJsonArtifacts(backupRoot); - - backupArtifacts.Should().Equal(migratableArtifacts, "Because all of and only these artifacts should have been moved"); - - testRoot.Should().NotHaveFiles(backupArtifacts.Keys); - - backupRoot.Should().HaveTextFiles(backupArtifacts); - } - - [Theory] - [InlineData("TestAppWithLibraryAndMissingP2P")] - public void WhenMigrationFailsThenProjectJsonArtifactsDoNotGetMovedToBackup(string testProjectName) - { - var testRoot = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, testProjectName) - .CreateInstance(identifier: testProjectName) - .WithSourceFiles() - .Root; - - var backupRoot = testRoot.GetDirectory("backup"); - - var migratableArtifacts = GetProjectJsonArtifacts(testRoot); - - new MigrateCommand() - .WithWorkingDirectory(testRoot) - .Execute() - .Should().Fail(); - - backupRoot.Should().NotExist("Because migration failed and therefore no backup is needed."); - - testRoot.Should().HaveTextFiles(migratableArtifacts, "Because migration failed so nothing was moved to backup."); - } - - [Theory] - [InlineData("PJTestAppSimple")] - public void WhenSkipbackupSpecifiedThenProjectJsonArtifactsDoNotGetMovedToBackup(string testProjectName) - { - var testRoot = TestAssets - .GetProjectJson(testProjectName) - .CreateInstance(identifier: testProjectName) - .WithSourceFiles() - .Root; - - var backupRoot = testRoot.GetDirectory("backup"); - - var migratableArtifacts = GetProjectJsonArtifacts(testRoot); - - new MigrateCommand() - .WithWorkingDirectory(testRoot) - .Execute("--skip-backup") - .Should().Pass(); - - backupRoot.Should().NotExist("Because --skip-backup was specified."); - - testRoot.Should().HaveTextFiles(migratableArtifacts, "Because --skip-backup was specified."); - } - - private Dictionary GetProjectJsonArtifacts(DirectoryInfo root) - { - var catalog = new Dictionary(); - - var patterns = new[] { "global.json", "project.json", "project.lock.json", "*.xproj", "*.xproj.user" }; - - foreach (var pattern in patterns) - { - AddArtifactsToCatalog(catalog, root, pattern); - } - - return catalog; - } - - private void AddArtifactsToCatalog(Dictionary catalog, DirectoryInfo root, string pattern) - { - var files = root.GetFiles(pattern, SearchOption.AllDirectories); - - foreach (var file in files) - { - var key = PathUtility.GetRelativePath(root, file); - catalog.Add(key, File.ReadAllText(file.FullName)); - } - } - } -} diff --git a/test/dotnet-migrate.Tests/GivenThatIWantMigratedAppsToBinplaceContent.cs b/test/dotnet-migrate.Tests/GivenThatIWantMigratedAppsToBinplaceContent.cs deleted file mode 100644 index 4bbaa33ef..000000000 --- a/test/dotnet-migrate.Tests/GivenThatIWantMigratedAppsToBinplaceContent.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 Microsoft.Build.Construction; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Common; -using Microsoft.DotNet.Tools.Test.Utilities; -using System; -using System.Collections.Generic; -using System.Linq; -using Xunit; -using FluentAssertions; -using System.IO; -using Microsoft.DotNet.Tools.Migrate; -using BuildCommand = Microsoft.DotNet.Tools.Test.Utilities.BuildCommand; -using System.Runtime.Loader; -using Newtonsoft.Json.Linq; - -using MigrateCommand = Microsoft.DotNet.Tools.Migrate.MigrateCommand; - -namespace Microsoft.DotNet.Migration.Tests -{ - public class GivenThatIWantMigratedAppsToBinplaceContent : TestBase - { - [Fact(Skip="Unblocking CI")] - public void ItBinplacesContentOnBuildForConsoleApps() - { - var projectDirectory = TestAssets - .GetProjectJson("TestAppWithContents") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles() - .WithEmptyGlobalJson() - .Root; - - new TestCommand("dotnet") - .WithForwardingToConsole() - .Execute($"migrate {projectDirectory.FullName}") - .Should() - .Pass(); - - var command = new RestoreCommand() - .WithWorkingDirectory(projectDirectory) - .Execute() - .Should() - .Pass(); - - var result = new BuildCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput() - .Should() - .Pass(); - - var outputDir = projectDirectory.GetDirectory("bin", "Debug", "netcoreapp1.0"); - outputDir.Should().Exist().And.HaveFile("testcontentfile.txt"); - outputDir.GetDirectory("dir").Should().Exist().And.HaveFile("mappingfile.txt"); - } - - [Fact(Skip="Unblocking CI")] - public void ItBinplacesContentOnPublishForConsoleApps() - { - var projectDirectory = TestAssets - .GetProjectJson("TestAppWithContents") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles() - .WithEmptyGlobalJson() - .Root; - - new TestCommand("dotnet") - .WithForwardingToConsole() - .Execute($"migrate {projectDirectory.FullName}") - .Should() - .Pass(); - - var command = new RestoreCommand() - .WithWorkingDirectory(projectDirectory) - .Execute() - .Should() - .Pass(); - - var result = new PublishCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput() - .Should() - .Pass(); - - var publishDir = projectDirectory.GetDirectory("bin", "Debug", "netcoreapp1.0", "publish"); - publishDir.Should().Exist().And.HaveFile("testcontentfile.txt"); - publishDir.GetDirectory("dir").Should().Exist().And.HaveFile("mappingfile.txt"); - } - - [Fact(Skip="CI does not have NPM, which is required for the publish of this app.")] - public void ItBinplacesContentOnPublishForWebApps() - { - var projectDirectory = TestAssets - .GetProjectJson("ProjectJsonWebTemplate") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles() - .WithEmptyGlobalJson() - .Root; - - new TestCommand("dotnet") - .WithForwardingToConsole() - .Execute($"migrate {projectDirectory.FullName}") - .Should() - .Pass(); - - var command = new RestoreCommand() - .WithWorkingDirectory(projectDirectory) - .Execute() - .Should() - .Pass(); - - var result = new PublishCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput() - .Should() - .Pass(); - - var publishDir = projectDirectory.GetDirectory("bin", "Debug", "netcoreapp1.0", "publish"); - publishDir.Should().Exist().And.HaveFile("README.md"); - publishDir.GetDirectory("wwwroot").Should().Exist(); - } - } -} \ No newline at end of file diff --git a/test/dotnet-migrate.Tests/GivenThatIWantMigratedAppsToPackContent.cs b/test/dotnet-migrate.Tests/GivenThatIWantMigratedAppsToPackContent.cs deleted file mode 100644 index dabb842c7..000000000 --- a/test/dotnet-migrate.Tests/GivenThatIWantMigratedAppsToPackContent.cs +++ /dev/null @@ -1,62 +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.Build.Construction; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Common; -using Microsoft.DotNet.Tools.Test.Utilities; -using System; -using System.Collections.Generic; -using System.Linq; -using Xunit; -using FluentAssertions; -using System.IO; -using System.IO.Compression; -using Microsoft.DotNet.Tools.Migrate; -using BuildCommand = Microsoft.DotNet.Tools.Test.Utilities.BuildCommand; -using System.Runtime.Loader; -using Newtonsoft.Json.Linq; - -using MigrateCommand = Microsoft.DotNet.Tools.Migrate.MigrateCommand; - -namespace Microsoft.DotNet.Migration.Tests -{ - public class GivenThatIWantMigratedAppsToPackContent : TestBase - { - [Fact(Skip="Unblocking CI")] - public void ItPacksContentForLibraries() - { - var projectDirectory = TestAssets - .GetProjectJson("PJTestLibraryWithConfiguration") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles() - .WithEmptyGlobalJson() - .Root; - - new TestCommand("dotnet") - .WithForwardingToConsole() - .Execute($"migrate {projectDirectory.FullName}") - .Should() - .Pass(); - - var command = new RestoreCommand() - .WithWorkingDirectory(projectDirectory) - .Execute() - .Should() - .Pass(); - - var result = new PackCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput() - .Should() - .Pass(); - - using (var archive = ZipFile.OpenRead( - Path.Combine(projectDirectory.FullName, "bin", "debug", "PJTestLibraryWithConfiguration.1.0.0.nupkg"))) - { - archive.Entries.Select(e => e.FullName).Should().Contain("dir/contentitem.txt"); - } - } - } -} \ No newline at end of file diff --git a/test/dotnet-migrate.Tests/GivenThatIWantToMigrateAppsUsingGlobalJson.cs b/test/dotnet-migrate.Tests/GivenThatIWantToMigrateAppsUsingGlobalJson.cs deleted file mode 100644 index d4072691a..000000000 --- a/test/dotnet-migrate.Tests/GivenThatIWantToMigrateAppsUsingGlobalJson.cs +++ /dev/null @@ -1,80 +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 FluentAssertions; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using System.IO; -using Xunit; - -namespace Microsoft.DotNet.Migration.Tests -{ - public class GivenThatIWantToMigrateAppsUsingGlobalJson : TestBase - { - [Fact] - public void ItMigratesWhenBeingPassedAFullPathToGlobalJson() - { - var solutionDirectory = TestAssets - .GetProjectJson("AppWithPackageNamedAfterFolder") - .CreateInstance() - .WithSourceFiles() - .Root; - - var globalJsonPath = solutionDirectory.GetFile("global.json"); - - new TestCommand("dotnet") - .WithForwardingToConsole() - .Execute($"migrate {globalJsonPath.FullName}") - .Should() - .Pass(); - } - - [Fact] - public void WhenUsingGlobalJsonItOnlyMigratesProjectsInTheGlobalJsonNode() - { - var solutionDirectory = TestAssets - .GetProjectJson("AppWithPackageNamedAfterFolder") - .CreateInstance() - .WithSourceFiles() - .Root; - - var globalJsonPath = solutionDirectory.GetFile("global.json"); - - new TestCommand("dotnet") - .WithForwardingToConsole() - .Execute($"migrate {globalJsonPath.FullName}") - .Should() - .Pass(); - - solutionDirectory - .Should().HaveFiles(new [] - { - Path.Combine("src", "App", "App.csproj"), - Path.Combine("test", "App.Tests", "App.Tests.csproj"), - Path.Combine("TestAssets", "TestAsset", "project.json") - }); - - solutionDirectory - .Should().NotHaveFile(Path.Combine("TestAssets", "TestAsset", "TestAsset.csproj")); - } - - [Fact] - public void ItMigratesWhenBeingPassedJustGlobalJson() - { - var solutionDirectory = TestAssets - .GetProjectJson("AppWithPackageNamedAfterFolder") - .CreateInstance() - .WithSourceFiles() - .Root; - - var globalJsonPath = solutionDirectory.GetFile("global.json"); - - new TestCommand("dotnet") - .WithWorkingDirectory(solutionDirectory) - .WithForwardingToConsole() - .Execute($"migrate global.json") - .Should() - .Pass(); - } - } -} diff --git a/test/dotnet-migrate.Tests/GivenThatIWantToMigrateDeprecatedProjects.cs b/test/dotnet-migrate.Tests/GivenThatIWantToMigrateDeprecatedProjects.cs deleted file mode 100644 index 506d36aed..000000000 --- a/test/dotnet-migrate.Tests/GivenThatIWantToMigrateDeprecatedProjects.cs +++ /dev/null @@ -1,562 +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 FluentAssertions; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using System.IO; -using System.IO.Compression; -using System.Linq; -using System.Xml.Linq; -using Xunit; - -namespace Microsoft.DotNet.Migration.Tests -{ - public class GivenThatIWantToMigrateDeprecatedProjects : TestBase - { - [Fact] - public void WhenMigratingDeprecatedPackOptionsWarningsArePrinted() - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedPack") - .CreateInstance() - .WithSourceFiles() - .Root; - - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("migrate"); - - cmd.Should().Pass(); - - cmd.StdOut.Should().Contain( - "The 'repository' option in the root is deprecated. Use it in 'packOptions' instead."); - cmd.StdOut.Should().Contain( - "The 'projectUrl' option in the root is deprecated. Use it in 'packOptions' instead."); - cmd.StdOut.Should().Contain( - "The 'licenseUrl' option in the root is deprecated. Use it in 'packOptions' instead."); - cmd.StdOut.Should().Contain( - "The 'iconUrl' option in the root is deprecated. Use it in 'packOptions' instead."); - cmd.StdOut.Should().Contain( - "The 'owners' option in the root is deprecated. Use it in 'packOptions' instead."); - cmd.StdOut.Should().Contain( - "The 'tags' option in the root is deprecated. Use it in 'packOptions' instead."); - cmd.StdOut.Should().Contain( - "The 'releaseNotes' option in the root is deprecated. Use it in 'packOptions' instead."); - cmd.StdOut.Should().Contain( - "The 'requireLicenseAcceptance' option in the root is deprecated. Use it in 'packOptions' instead."); - cmd.StdOut.Should().Contain( - "The 'summary' option in the root is deprecated. Use it in 'packOptions' instead."); - cmd.StdOut.Should().Contain( - "The 'packInclude' option is deprecated. Use 'files' in 'packOptions' instead."); - } - - [Fact] - public void MigrateDeprecatedPack() - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedPack") - .CreateInstance() - .WithSourceFiles() - .Root; - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("migrate") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("restore") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("build -c Debug") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("pack -c Debug") - .Should().Pass(); - - var outputDir = projectDirectory.GetDirectory("bin", "Debug"); - outputDir.Should().Exist() - .And.HaveFile("PJDeprecatedPack.1.0.0.nupkg"); - - var outputPackage = outputDir.GetFile("PJDeprecatedPack.1.0.0.nupkg"); - - var zip = ZipFile.Open(outputPackage.FullName, ZipArchiveMode.Read); - zip.Entries.Should().Contain(e => e.FullName == "PJDeprecatedPack.nuspec") - .And.Contain(e => e.FullName == "content/Content1.txt") - .And.Contain(e => e.FullName == "content/Content2.txt"); - - var manifestReader = new StreamReader( - zip.Entries.First(e => e.FullName == "PJDeprecatedPack.nuspec").Open()); - - // NOTE: Commented out those that are not migrated. - // https://microsoft.sharepoint.com/teams/netfx/corefx/_layouts/15/WopiFrame.aspx?sourcedoc=%7B0cfbc196-0645-4781-84c6-5dffabd76bee%7D&action=edit&wd=target%28Planning%2FMSBuild%20CLI%20integration%2Eone%7C41D470DD-CF44-4595-8E05-0CE238864B55%2FProject%2Ejson%20Migration%7CA553D979-EBC6-484B-A12E-036E0730864A%2F%29 - var nuspecXml = XDocument.Parse(manifestReader.ReadToEnd()); - nuspecXml.Descendants().Single(e => e.Name.LocalName == "projectUrl").Value - .Should().Be("http://projecturl/"); - nuspecXml.Descendants().Single(e => e.Name.LocalName == "licenseUrl").Value - .Should().Be("http://licenseurl/"); - nuspecXml.Descendants().Single(e => e.Name.LocalName == "iconUrl").Value - .Should().Be("http://iconurl/"); - //nuspecXml.Descendants().Single(e => e.Name.LocalName == "owners").Value - // .Should().Be("owner1,owner2"); - nuspecXml.Descendants().Single(e => e.Name.LocalName == "tags").Value - .Should().Be("tag1 tag2"); - nuspecXml.Descendants().Single(e => e.Name.LocalName == "releaseNotes").Value - .Should().Be("releaseNotes"); - nuspecXml.Descendants().Single(e => e.Name.LocalName == "requireLicenseAcceptance").Value - .Should().Be("true"); - //nuspecXml.Descendants().Single(e => e.Name.LocalName == "summary").Value - // .Should().Be("summary"); - - var repositoryNode = nuspecXml.Descendants().Single(e => e.Name.LocalName == "repository"); - repositoryNode.Attributes("type").Single().Value.Should().Be("git"); - repositoryNode.Attributes("url").Single().Value.Should().Be("http://url/"); - } - - [Fact] - public void WhenMigratingDeprecatedCompilationOptionsWarningsArePrinted() - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedCompilation") - .CreateInstance() - .WithSourceFiles() - .Root; - - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("migrate"); - - cmd.Should().Pass(); - - cmd.StdOut.Should().Contain( - "The 'compilerName' option in the root is deprecated. Use it in 'buildOptions' instead."); - cmd.StdOut.Should().Contain( - "The 'compilationOptions' option is deprecated. Use 'buildOptions' instead."); - } - - [Fact] - public void MigratingDeprecatedCompilation() - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedCompilation") - .CreateInstance() - .WithSourceFiles() - .Root; - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("migrate") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("restore") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("build -c Debug") - .Should().Pass(); - } - - [Fact] - public void WhenMigratingDeprecatedContentOptionsWarningsArePrinted() - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedContent") - .CreateInstance() - .WithSourceFiles() - .Root; - - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("migrate"); - - cmd.Should().Pass(); - - cmd.StdOut.Should().Contain( - "The 'content' option is deprecated. Use 'publishOptions' to publish or 'copyToOutput' in 'buildOptions' to copy to build output instead."); - cmd.StdOut.Should().Contain( - "The 'contentExclude' option is deprecated. Use 'publishOptions' to publish or 'copyToOutput' in 'buildOptions' to copy to build output instead."); - cmd.StdOut.Should().Contain( - "The 'contentFiles' option is deprecated. Use 'publishOptions' to publish or 'copyToOutput' in 'buildOptions' to copy to build output instead."); - cmd.StdOut.Should().Contain( - "The 'contentBuiltIn' option is deprecated. Use 'publishOptions' to publish or 'copyToOutput' in 'buildOptions' to copy to build output instead."); - } - - [Fact] - public void MigratingDeprecatedContent() - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedContent") - .CreateInstance() - .WithSourceFiles() - .Root - .GetDirectory("project"); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("migrate") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("restore") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("build -c Debug") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("publish -c Debug") - .Should().Pass(); - - var outputDir = projectDirectory.GetDirectory("bin", "Debug", "netcoreapp1.1"); - outputDir.Should().Exist() - .And.HaveFiles(new[] - { - "ContentFile1.txt1", - "ContentFile2.txt1", - "ContentFileBuiltIn1.txt1", - "ContentFileBuiltIn2.txt1", - "IncludeThis.txt", - }); - Directory.Exists(Path.Combine(outputDir.FullName, "ExcludeThis1.txt")).Should().BeFalse(); - Directory.Exists(Path.Combine(outputDir.FullName, "ExcludeThis2.txt")).Should().BeFalse(); - - var publishDir = projectDirectory.GetDirectory("bin", "Debug", "netcoreapp1.1", "publish"); - publishDir.Should().Exist() - .And.HaveFiles(new[] - { - "ContentFile1.txt1", - "ContentFile2.txt1", - "ContentFileBuiltIn1.txt1", - "ContentFileBuiltIn2.txt1", - "IncludeThis.txt", - }); - Directory.Exists(Path.Combine(publishDir.FullName, "ExcludeThis1.txt")).Should().BeFalse(); - Directory.Exists(Path.Combine(publishDir.FullName, "ExcludeThis2.txt")).Should().BeFalse(); - } - - [Fact] - public void WhenMigratingDeprecatedCompileOptionsWarningsArePrinted() - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedCompile") - .CreateInstance() - .WithSourceFiles() - .Root; - - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("migrate"); - - cmd.Should().Pass(); - - cmd.StdOut.Should().Contain( - "The 'compile' option is deprecated. Use 'compile' in 'buildOptions' instead."); - cmd.StdOut.Should().Contain( - "The 'compileFiles' option is deprecated. Use 'compile' in 'buildOptions' instead."); - } - - [Fact] - public void MigratingDeprecatedCompile() - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedCompile") - .CreateInstance() - .WithSourceFiles() - .Root - .GetDirectory("project"); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("migrate") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("restore") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("build -c Debug") - .Should().Pass(); - } - - [Fact] - public void WhenMigratingDeprecatedCompileBuiltInOptionsWarningsArePrinted() - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedCompileBuiltIn") - .CreateInstance() - .WithSourceFiles() - .Root; - - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("migrate"); - - cmd.Should().Pass(); - - cmd.StdOut.Should().Contain( - "The 'compileBuiltIn' option is deprecated. Use 'compile' in 'buildOptions' instead."); - } - - [Fact] - public void MigratingDeprecatedCompileBuiltIn() - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedCompileBuiltIn") - .CreateInstance() - .WithSourceFiles() - .Root - .GetDirectory("project"); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("migrate") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("restore") - .Should().Pass(); - - //Issue: https://github.com/dotnet/cli/issues/5467 - //new DotnetCommand() - // .WithWorkingDirectory(projectDirectory) - // .Execute("build -c Debug") - // .Should().Pass(); - } - - [Fact] - public void WhenMigratingDeprecatedCompileExcludeOptionsWarningsArePrinted() - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedCompileExclude") - .CreateInstance() - .WithSourceFiles() - .Root; - - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("migrate"); - - cmd.Should().Pass(); - - cmd.StdOut.Should().Contain( - "The 'compileExclude' option is deprecated. Use 'compile' in 'buildOptions' instead."); - } - - [Fact] - public void MigratingDeprecatedCompileExclude() - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedCompileExclude") - .CreateInstance() - .WithSourceFiles() - .Root; - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("migrate") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("restore") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("build -c Debug") - .Should().Pass(); - } - - [Fact] - public void WhenMigratingDeprecatedResourceOptionsWarningsArePrinted() - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedResource") - .CreateInstance() - .WithSourceFiles() - .Root - .GetDirectory("project"); - - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("migrate"); - - cmd.Should().Pass(); - - cmd.StdOut.Should().Contain( - "The 'resource' option is deprecated. Use 'embed' in 'buildOptions' instead."); - cmd.StdOut.Should().Contain( - "The 'resourceFiles' option is deprecated. Use 'embed' in 'buildOptions' instead."); - } - - [Fact] - public void MigratingDeprecatedResource() - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedResource") - .CreateInstance() - .WithSourceFiles() - .Root - .GetDirectory("project"); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("migrate") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("restore") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("build -c Debug") - .Should().Pass(); - - if (!EnvironmentInfo.HasSharedFramework("netcoreapp1.1")) - { - // running the app requires netcoreapp1.1 - return; - } - - var cmd = new DotnetCommand(DotnetUnderTest.WithBackwardsCompatibleRuntimes) - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("run -c Debug"); - cmd.Should().Pass(); - cmd.StdOut.Should().Contain("3 Resources Found:"); - } - - [Fact] - public void WhenMigratingDeprecatedResourceBuiltInOptionsWarningsArePrinted() - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedResourceBuiltIn") - .CreateInstance() - .WithSourceFiles() - .Root - .GetDirectory("project"); - - var cmd = new DotnetCommand(DotnetUnderTest.WithBackwardsCompatibleRuntimes) - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("migrate"); - - cmd.Should().Pass(); - - cmd.StdOut.Should().Contain( - "The 'resourceBuiltIn' option is deprecated. Use 'embed' in 'buildOptions' instead."); - } - - [Fact] - public void MigratingDeprecatedResourceBuiltIn() - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedResourceBuiltIn") - .CreateInstance() - .WithSourceFiles() - .Root - .GetDirectory("project"); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("migrate") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("restore") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("build -c Debug") - .Should().Pass(); - - if (!EnvironmentInfo.HasSharedFramework("netcoreapp1.1")) - { - // running the app requires netcoreapp1.1 - return; - } - - var cmd = new DotnetCommand(DotnetUnderTest.WithBackwardsCompatibleRuntimes) - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("run -c Debug"); - cmd.Should().Pass(); - // Issue: https://github.com/dotnet/cli/issues/5467 - //cmd.StdOut.Should().Contain("2 Resources Found:"); - } - - [Fact] - public void WhenMigratingDeprecatedResourceExcludeOptionsWarningsArePrinted() - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedResourceExclude") - .CreateInstance() - .WithSourceFiles() - .Root; - - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("migrate"); - - cmd.Should().Pass(); - - cmd.StdOut.Should().Contain( - "The 'resourceExclude' option is deprecated. Use 'embed' in 'buildOptions' instead."); - } - - [Fact] - public void MigratingDeprecatedResourceExclude() - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJDeprecatedResourceExclude") - .CreateInstance() - .WithSourceFiles() - .Root; - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("migrate") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("restore") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("build -c Debug") - .Should().Pass(); - - if (!EnvironmentInfo.HasSharedFramework("netcoreapp1.1")) - { - // running the app requires netcoreapp1.1 - return; - } - - var cmd = new DotnetCommand(DotnetUnderTest.WithBackwardsCompatibleRuntimes) - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("run -c Debug"); - cmd.Should().Pass(); - cmd.StdOut.Should().Contain("0 Resources Found:"); - } - } -} diff --git a/test/dotnet-migrate.Tests/GivenThatIWantToMigrateSolutions.cs b/test/dotnet-migrate.Tests/GivenThatIWantToMigrateSolutions.cs index b3c679a86..af96bd2a2 100644 --- a/test/dotnet-migrate.Tests/GivenThatIWantToMigrateSolutions.cs +++ b/test/dotnet-migrate.Tests/GivenThatIWantToMigrateSolutions.cs @@ -14,36 +14,6 @@ namespace Microsoft.DotNet.Migration.Tests { public class GivenThatIWantToMigrateSolutions : TestBase { - [Theory] - [InlineData("PJAppWithSlnVersion14", "Visual Studio 15", "15.0.26114.2", "10.0.40219.1")] - [InlineData("PJAppWithSlnVersion15", "Visual Studio 15 Custom", "15.9.12345.4", "10.9.1234.5")] - [InlineData("PJAppWithSlnVersionUnknown", "Visual Studio 15", "15.0.26114.2", "10.0.40219.1")] - public void ItMigratesSlnAndEnsuresAtLeastVS15( - string projectName, - string productDescription, - string visualStudioVersion, - string minVisualStudioVersion) - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, projectName) - .CreateInstance(identifier: projectName) - .WithSourceFiles() - .WithEmptyGlobalJson() - .Root; - - var solutionRelPath = "TestApp.sln"; - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute($"migrate \"{solutionRelPath}\"") - .Should().Pass(); - - SlnFile slnFile = SlnFile.Read(Path.Combine(projectDirectory.FullName, solutionRelPath)); - slnFile.ProductDescription.Should().Be(productDescription); - slnFile.VisualStudioVersion.Should().Be(visualStudioVersion); - slnFile.MinimumVisualStudioVersion.Should().Be(minVisualStudioVersion); - } - [Fact] public void ItMigratesAndBuildsSln() { @@ -52,208 +22,6 @@ namespace Microsoft.DotNet.Migration.Tests "PJAppWithSlnAndXprojRefs"); } - [Fact] - public void ItOnlyMigratesProjectsInTheSlnFile() - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithSlnAndXprojRefs") - .CreateInstance() - .WithSourceFiles() - .WithEmptyGlobalJson() - .Root; - - var solutionRelPath = Path.Combine("TestApp", "TestApp.sln"); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute($"migrate \"{solutionRelPath}\"") - .Should().Pass(); - - projectDirectory - .Should().HaveFiles(new [] - { - Path.Combine("TestApp", "TestApp.csproj"), - Path.Combine("TestLibrary", "TestLibrary.csproj"), - Path.Combine("TestApp", "src", "subdir", "subdir.csproj"), - Path.Combine("TestApp", "TestAssets", "TestAsset", "project.json") - }); - - projectDirectory - .Should().NotHaveFile(Path.Combine("TestApp", "TestAssets", "TestAsset", "TestAsset.csproj")); - } - - [Fact] - public void WhenDirectoryAlreadyContainsCsprojFileItMigratesAndBuildsSln() - { - MigrateAndBuild( - "NonRestoredTestProjects", - "PJAppWithSlnAndXprojRefsAndUnrelatedCsproj"); - } - - [Fact] - public void WhenXprojReferencesCsprojAndSlnDoesNotItMigratesAndBuildsSln() - { - MigrateAndBuild( - "NonRestoredTestProjects", - "PJAppWithSlnThatDoesNotRefCsproj"); - } - - [Fact] - public void WhenSolutionContainsACsprojFileItGetsMovedToBackup() - { - var projectDirectory = TestAssets - .GetProjectJson("NonRestoredTestProjects", "PJAppWithSlnAndOneAlreadyMigratedCsproj") - .CreateInstance() - .WithSourceFiles() - .WithEmptyGlobalJson() - .Root; - - var solutionRelPath = Path.Combine("TestApp", "TestApp.sln"); - - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"migrate \"{solutionRelPath}\""); - - cmd.Should().Pass(); - - projectDirectory - .GetDirectory("TestLibrary") - .GetFile("TestLibrary.csproj") - .Should().Exist(); - - projectDirectory - .GetDirectory("TestLibrary") - .GetFile("TestLibrary.csproj.migration_in_place_backup") - .Should().NotExist(); - - projectDirectory - .GetDirectory("backup", "TestLibrary") - .GetFile("TestLibrary.csproj") - .Should().Exist(); - } - - [Fact] - public void WhenSolutionContainsACsprojFileItDoesNotTryToAddItAgain() - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithSlnAndOneAlreadyMigratedCsproj") - .CreateInstance() - .WithSourceFiles() - .WithEmptyGlobalJson() - .Root; - - var solutionRelPath = Path.Combine("TestApp", "TestApp.sln"); - - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"migrate \"{solutionRelPath}\""); - - cmd.Should().Pass(); - cmd.StdOut.Should().NotContain("already contains project"); - cmd.StdErr.Should().BeEmpty(); - } - - [Theory] - [InlineData("NoSolutionItemsAfterMigration.sln", false)] - [InlineData("ReadmeSolutionItemAfterMigration.sln", true)] - public void WhenMigratingAnSlnLinksReferencingItemsMovedToBackupAreRemoved( - string slnFileName, - bool solutionItemsContainsReadme) - { - var projectDirectory = TestAssets - .GetProjectJson(TestAssetKinds.NonRestoredTestProjects, "PJAppWithSlnAndSolutionItemsToMoveToBackup") - .CreateInstance(Path.GetFileNameWithoutExtension(slnFileName)) - .WithSourceFiles() - .Root - .FullName; - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute($"migrate \"{slnFileName}\"") - .Should().Pass(); - - var slnFile = SlnFile.Read(Path.Combine(projectDirectory, slnFileName)); - var solutionFolders = slnFile.Projects.Where(p => p.TypeGuid == ProjectTypeGuids.SolutionFolderGuid); - if (solutionItemsContainsReadme) - { - solutionFolders.Count().Should().Be(1); - var solutionItems = solutionFolders.Single().Sections.GetSection("SolutionItems"); - solutionItems.Should().NotBeNull(); - solutionItems.Properties.Count().Should().Be(1); - solutionItems.Properties["readme.txt"].Should().Be("readme.txt"); - } - else - { - solutionFolders.Count().Should().Be(0); - } - } - - [Fact] - public void ItMigratesSolutionInTheFolderWhenWeRunMigrationInThatFolder() - { - var projectDirectory = TestAssets - .Get("NonRestoredTestProjects", "PJAppWithSlnAndXprojRefs") - .CreateInstance() - .WithSourceFiles() - .WithEmptyGlobalJson() - .Root; - - var workingDirectory = new DirectoryInfo(Path.Combine(projectDirectory.FullName, "TestApp")); - var solutionRelPath = Path.Combine("TestApp", "TestApp.sln"); - - new DotnetCommand() - .WithWorkingDirectory(workingDirectory) - .Execute($"migrate") - .Should().Pass(); - - SlnFile slnFile = SlnFile.Read(Path.Combine(projectDirectory.FullName, solutionRelPath)); - - var nonSolutionFolderProjects = slnFile.Projects - .Where(p => p.TypeGuid != ProjectTypeGuids.SolutionFolderGuid); - - nonSolutionFolderProjects.Count().Should().Be(4); - - var slnProject = nonSolutionFolderProjects.Where((p) => p.Name == "TestApp").Single(); - slnProject.TypeGuid.Should().Be(ProjectTypeGuids.CSharpProjectTypeGuid); - slnProject.FilePath.Should().Be("TestApp.csproj"); - - slnProject = nonSolutionFolderProjects.Where((p) => p.Name == "TestLibrary").Single(); - slnProject.TypeGuid.Should().Be(ProjectTypeGuids.CSharpProjectTypeGuid); - slnProject.FilePath.Should().Be(Path.Combine("..", "TestLibrary", "TestLibrary.csproj")); - - slnProject = nonSolutionFolderProjects.Where((p) => p.Name == "subdir").Single(); - slnProject.FilePath.Should().Be(Path.Combine("src", "subdir", "subdir.csproj")); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute($"restore \"{solutionRelPath}\"") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute($"build \"{solutionRelPath}\"") - .Should().Pass(); - } - - [Fact] - public void WhenXprojNameIsDifferentThanDirNameItGetsRemovedFromSln() - { - var projectDirectory = TestAssets - .Get("NonRestoredTestProjects", "PJAppWithXprojNameDifferentThanDirName") - .CreateInstance() - .WithSourceFiles() - .Root; - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute($"migrate") - .Should().Pass(); - - var slnFile = SlnFile.Read(Path.Combine(projectDirectory.FullName, "FolderHasDifferentName.sln")); - slnFile.Projects.Count.Should().Be(1); - slnFile.Projects[0].FilePath.Should().Be("PJAppWithXprojNameDifferentThanDirName.csproj"); - } - private void MigrateAndBuild(string groupName, string projectName, [CallerMemberName] string callingMethod = "", string identifier = "") { var projectDirectory = TestAssets diff --git a/test/dotnet-migrate.Tests/GivenThatIWantToMigrateTestApps.cs b/test/dotnet-migrate.Tests/GivenThatIWantToMigrateTestApps.cs deleted file mode 100644 index 6a390cd9e..000000000 --- a/test/dotnet-migrate.Tests/GivenThatIWantToMigrateTestApps.cs +++ /dev/null @@ -1,1018 +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.Build.Construction; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Common; -using Microsoft.DotNet.Tools.Test.Utilities; -using System; -using System.Collections.Generic; -using System.Linq; -using Xunit; -using FluentAssertions; -using System.IO; -using Microsoft.DotNet.Tools.Migrate; -using BuildCommand = Microsoft.DotNet.Tools.Test.Utilities.BuildCommand; -using System.Runtime.Loader; -using Newtonsoft.Json.Linq; - -using MigrateCommand = Microsoft.DotNet.Tools.Migrate.MigrateCommand; - -[assembly: CollectionBehavior(DisableTestParallelization = true)] - -namespace Microsoft.DotNet.Migration.Tests -{ - public class GivenThatIWantToMigrateTestApps : TestBase - { - [Theory] - [InlineData("TestAppWithRuntimeOptions")] - [InlineData("TestAppWithContents")] - [InlineData("AppWithAssemblyInfo")] - [InlineData("TestAppWithEmbeddedResources")] - public void ItMigratesApps(string projectName) - { - var projectDirectory = TestAssets - .GetProjectJson(projectName) - .CreateInstance(identifier: projectName) - .WithSourceFiles() - .WithRestoreFiles() - .WithEmptyGlobalJson() - .Root; - - CleanBinObj(projectDirectory); - - var outputComparisonData = BuildProjectJsonMigrateBuildMSBuild(projectDirectory, projectName); - - var outputsIdentical = - outputComparisonData.ProjectJsonBuildOutputs.SetEquals(outputComparisonData.MSBuildBuildOutputs); - - if (!outputsIdentical) - { - OutputDiagnostics(outputComparisonData); - } - - outputsIdentical.Should().BeTrue(); - - VerifyAllMSBuildOutputsRunnable(projectDirectory); - - var outputCsProj = projectDirectory.GetFile(projectName + ".csproj"); - - outputCsProj.ReadAllText() - .Should().EndWith("\n"); - } - - [WindowsOnlyTheory] - [InlineData("AppWith2Tfm0Rid", null)] - [InlineData("AppWith4netTfm0Rid", "net461")] - public void ItMigratesAppsWithFullFramework(string projectName, string framework) - { - var projectDirectory = TestAssets - .GetProjectJson(projectName) - .CreateInstance(identifier: projectName) - .WithSourceFiles() - .WithRestoreFiles() - .WithEmptyGlobalJson() - .Root; - - CleanBinObj(projectDirectory); - - MigrateProject(new [] { projectDirectory.FullName }); - - Restore(projectDirectory); - - BuildMSBuild(projectDirectory, projectName, framework: framework); - } - - [Fact] - public void ItMigratesSignedApps() - { - var projectDirectory = TestAssets - .GetProjectJson("TestAppWithSigning") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles() - .WithEmptyGlobalJson() - .Root; - - CleanBinObj(projectDirectory); - - var outputComparisonData = BuildProjectJsonMigrateBuildMSBuild(projectDirectory, "TestAppWithSigning"); - - var outputsIdentical = - outputComparisonData.ProjectJsonBuildOutputs.SetEquals(outputComparisonData.MSBuildBuildOutputs); - - if (!outputsIdentical) - { - OutputDiagnostics(outputComparisonData); - } - - outputsIdentical.Should().BeTrue(); - - VerifyAllMSBuildOutputsRunnable(projectDirectory); - - VerifyAllMSBuildOutputsAreSigned(projectDirectory); - } - - [Fact] - public void ItMigratesDotnetNewConsoleWithIdenticalOutputs() - { - var projectDirectory = TestAssets - .GetProjectJson("ProjectJsonConsoleTemplate") - .CreateInstance() - .WithSourceFiles() - .WithEmptyGlobalJson() - .Root; - - var outputComparisonData = GetComparisonData(projectDirectory); - - var outputsIdentical = - outputComparisonData.ProjectJsonBuildOutputs.SetEquals(outputComparisonData.MSBuildBuildOutputs); - - if (!outputsIdentical) - { - OutputDiagnostics(outputComparisonData); - } - - outputsIdentical.Should().BeTrue(); - - VerifyAllMSBuildOutputsRunnable(projectDirectory); - } - - [Fact] - public void ItMigratesOldDotnetNewWebWithoutToolsWithOutputsContainingProjectJsonOutputs() - { - var projectDirectory = TestAssets - .GetProjectJson("ProjectJsonWebTemplate") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles() - .WithEmptyGlobalJson() - .Root; - - var globalDirectory = projectDirectory.Parent; - - WriteGlobalJson(globalDirectory); - - var outputComparisonData = GetComparisonData(projectDirectory); - - var outputsIdentical = - outputComparisonData.ProjectJsonBuildOutputs.SetEquals(outputComparisonData.MSBuildBuildOutputs); - - if (!outputsIdentical) - { - OutputDiagnostics(outputComparisonData); - } - - outputsIdentical.Should().BeTrue(); - } - - [Fact] - public void ItMigratesAndPublishesWebApp() - { - var projectName = "WebAppWithMissingFileInPublishOptions"; - - var projectDirectory = TestAssets - .GetProjectJson(projectName) - .CreateInstance() - .WithSourceFiles() - .WithEmptyGlobalJson() - .Root; - - File.Copy("NuGet.tempaspnetpatch.config", projectDirectory.GetFile("NuGet.Config").FullName); - - MigrateProject(new [] { projectDirectory.FullName }); - - Restore(projectDirectory); - PublishMSBuild(projectDirectory, projectName); - } - - [Fact] - public void ItMigratesAPackageReferenceAsSuchEvenIfAFolderWithTheSameNameExistsInTheRepo() - { - var solutionDirectory = TestAssets - .GetProjectJson("AppWithPackageNamedAfterFolder") - .CreateInstance() - .WithSourceFiles() - .WithEmptyGlobalJson() - .Root; - - var appProject = solutionDirectory - .GetDirectory("src", "App") - .GetFile("App.csproj"); - - MigrateProject(solutionDirectory.FullName); - - var projectRootElement = ProjectRootElement.Open(appProject.FullName); - - projectRootElement.Items.Where( - i => i.Include == "EntityFramework" && i.ItemType == "PackageReference") - .Should().HaveCount(2); - } - [Fact] - public void ItMigratesAProjectThatDependsOnAMigratedProjectWithTheSkipProjectReferenceFlag() - { - const string dependentProject = "ProjectA"; - const string dependencyProject = "ProjectB"; - - var projectDirectory = TestAssets - .GetProjectJson("TestAppDependencyGraph") - .CreateInstance() - .WithSourceFiles() - .WithEmptyGlobalJson() - .Root; - - MigrateProject(projectDirectory.GetDirectory(dependencyProject).FullName); - - MigrateProject("--skip-project-references", projectDirectory.GetDirectory(dependentProject).FullName); - } - - [Fact] - public void ItAddsMicrosoftNetWebSdkToTheSdkAttributeOfAWebApp() - { - var projectDirectory = TestAssets - .Get("ProjectJsonWebTemplate") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles() - .WithEmptyGlobalJson() - .Root; - - var globalDirectory = projectDirectory.Parent; - var projectJsonFile = projectDirectory.GetFile("project.json"); - - MigrateProject(new [] { projectDirectory.FullName }); - - var csProj = projectDirectory.GetFile($"{projectDirectory.Name}.csproj"); - - csProj.ReadAllText().Should().Contain(@"Sdk=""Microsoft.NET.Sdk.Web"""); - } - - [Theory] - [InlineData("TestLibraryWithTwoFrameworks")] - public void ItMigratesProjectsWithMultipleTFMs(string projectName) - { - var projectDirectory = TestAssets - .GetProjectJson(projectName) - .CreateInstance(identifier: projectName) - .WithSourceFiles() - .WithRestoreFiles() - .WithEmptyGlobalJson() - .Root; - - var outputComparisonData = BuildProjectJsonMigrateBuildMSBuild(projectDirectory, projectName); - - var outputsIdentical = - outputComparisonData.ProjectJsonBuildOutputs.SetEquals(outputComparisonData.MSBuildBuildOutputs); - - if (!outputsIdentical) - { - OutputDiagnostics(outputComparisonData); - } - - outputsIdentical.Should().BeTrue(); - } - - [WindowsOnlyFact] - public void ItMigratesLibraryWithMultipleTFMsAndFullFramework() - { - var projectName = "PJLibWithMultipleFrameworks"; - - var projectDirectory = TestAssets - .GetProjectJson(projectName) - .CreateInstance(identifier: projectName) - .WithSourceFiles() - .WithRestoreFiles() - .WithEmptyGlobalJson() - .Root; - - var outputComparisonData = BuildProjectJsonMigrateBuildMSBuild(projectDirectory, projectName); - - var outputsIdentical = - outputComparisonData.ProjectJsonBuildOutputs.SetEquals(outputComparisonData.MSBuildBuildOutputs); - - if (!outputsIdentical) - { - OutputDiagnostics(outputComparisonData); - } - - outputsIdentical.Should().BeTrue(); - } - - [Theory] - [InlineData("TestAppWithLibrary/TestLibrary")] - [InlineData("TestLibraryWithAnalyzer")] - [InlineData("PJTestLibraryWithConfiguration")] - public void ItMigratesALibrary(string projectName) - { - var projectDirectory = TestAssets - .GetProjectJson(projectName) - .CreateInstance(identifier: projectName) - .WithSourceFiles() - .WithRestoreFiles() - .WithEmptyGlobalJson() - .Root; - - var outputComparisonData = BuildProjectJsonMigrateBuildMSBuild( - projectDirectory, - Path.GetFileNameWithoutExtension(projectName)); - - var outputsIdentical = outputComparisonData - .ProjectJsonBuildOutputs - .SetEquals(outputComparisonData.MSBuildBuildOutputs); - - if (!outputsIdentical) - { - OutputDiagnostics(outputComparisonData); - } - - outputsIdentical.Should().BeTrue(); - } - - [Theory] - [InlineData("ProjectA", "ProjectA,ProjectB,ProjectC,ProjectD,ProjectE")] - [InlineData("ProjectB", "ProjectB,ProjectC,ProjectD,ProjectE")] - [InlineData("ProjectC", "ProjectC,ProjectD,ProjectE")] - [InlineData("ProjectD", "ProjectD")] - [InlineData("ProjectE", "ProjectE")] - public void ItMigratesRootProjectAndReferences(string projectName, string expectedProjects) - { - var projectDirectory = TestAssets - .GetProjectJson("TestAppDependencyGraph") - .CreateInstance(identifier: $"{projectName}.RefsTest") - .WithSourceFiles() - .WithEmptyGlobalJson() - .Root; - - MigrateProject(new [] { projectDirectory.GetDirectory(projectName).FullName }); - - string[] migratedProjects = expectedProjects.Split(new char[] { ',' }); - - VerifyMigration(migratedProjects, projectDirectory); - } - - [Theory] - [InlineData("ProjectA")] - [InlineData("ProjectB")] - [InlineData("ProjectC")] - [InlineData("ProjectD")] - [InlineData("ProjectE")] - public void ItMigratesRootProjectAndSkipsReferences(string projectName) - { - var projectDirectory = TestAssets - .GetProjectJson("TestAppDependencyGraph") - .CreateInstance($"{projectName}.SkipRefsTest") - .WithSourceFiles() - .WithEmptyGlobalJson() - .Root; - - MigrateProject(new [] { projectDirectory.GetDirectory(projectName).FullName, "--skip-project-references" }); - - VerifyMigration(Enumerable.Repeat(projectName, 1), projectDirectory); - } - - [Theory] - [InlineData(true)] - [InlineData(false)] - public void ItMigratesAllProjectsInGivenDirectory(bool skipRefs) - { - var projectDirectory = TestAssets - .GetProjectJson("TestAppDependencyGraph") - .CreateInstance(callingMethod: $"MigrateDirectory.SkipRefs.{skipRefs}") - .WithSourceFiles() - .WithEmptyGlobalJson() - .Root; - - if (skipRefs) - { - MigrateProject(new [] { projectDirectory.FullName, "--skip-project-references" }); - } - else - { - MigrateProject(new [] { projectDirectory.FullName }); - } - - string[] migratedProjects = new string[] { "ProjectA", "ProjectB", "ProjectC", "ProjectD", "ProjectE", "ProjectF", "ProjectG", "ProjectH", "ProjectI", "ProjectJ" }; - - VerifyMigration(migratedProjects, projectDirectory); - } - - [Fact] - public void ItMigratesGivenProjectJson() - { - var projectDirectory = TestAssets - .GetProjectJson("TestAppDependencyGraph") - .CreateInstance() - .WithSourceFiles() - .WithEmptyGlobalJson() - .Root; - - var project = projectDirectory - .GetDirectory("ProjectA") - .GetFile("project.json"); - - MigrateProject(new [] { project.FullName }); - - string[] migratedProjects = new string[] { "ProjectA", "ProjectB", "ProjectC", "ProjectD", "ProjectE" }; - - VerifyMigration(migratedProjects, projectDirectory); - } - - [Fact] - // regression test for https://github.com/dotnet/cli/issues/4269 - public void ItMigratesAndBuildsP2PReferences() - { - var assetsDir = TestAssets - .GetProjectJson("TestAppDependencyGraph") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles() - .WithEmptyGlobalJson() - .Root; - - var projectDirectory = assetsDir.GetDirectory("ProjectF"); - - var restoreDirectories = new DirectoryInfo[] - { - projectDirectory, - assetsDir.GetDirectory("ProjectG") - }; - - var outputComparisonData = BuildProjectJsonMigrateBuildMSBuild(projectDirectory, "ProjectF", new [] { projectDirectory.FullName }, restoreDirectories); - - var outputsIdentical = outputComparisonData.ProjectJsonBuildOutputs - .SetEquals(outputComparisonData.MSBuildBuildOutputs); - - if (!outputsIdentical) - { - OutputDiagnostics(outputComparisonData); - } - - outputsIdentical.Should().BeTrue(); - - VerifyAllMSBuildOutputsRunnable(projectDirectory); - } - - [Theory] - [InlineData("src", "H")] - [InlineData("src with spaces", "J")] - public void ItMigratesAndBuildsProjectsInGlobalJson(string path, string projectNameSuffix) - { - var assetsDir = TestAssets - .GetProjectJson("ProjectsWithGlobalJson") - .CreateInstance(identifier: projectNameSuffix) - .WithSourceFiles() - .WithRestoreFiles() - .WithEmptyGlobalJson() - .Root; - - var projectName = $"Project{projectNameSuffix}"; - - var globalJson = assetsDir.GetFile("global.json"); - - var restoreDirectories = new DirectoryInfo[] - { - assetsDir.GetDirectory("src", "ProjectH"), - assetsDir.GetDirectory("src", "ProjectI"), - assetsDir.GetDirectory("src with spaces", "ProjectJ") - }; - - var projectDirectory = assetsDir.GetDirectory(path, projectName); - - var outputComparisonData = BuildProjectJsonMigrateBuildMSBuild(projectDirectory, - projectName, - new [] { globalJson.FullName }, - restoreDirectories); - - var outputsIdentical = outputComparisonData.ProjectJsonBuildOutputs - .SetEquals(outputComparisonData.MSBuildBuildOutputs); - - if (!outputsIdentical) - { - OutputDiagnostics(outputComparisonData); - } - - outputsIdentical.Should().BeTrue(); - - VerifyAllMSBuildOutputsRunnable(projectDirectory); - } - - [Theory] - [InlineData(true)] - [InlineData(false)] - public void MigrationOutputsErrorWhenNoProjectsFound(bool useGlobalJson) - { - var projectDirectory = TestAssets.CreateTestDirectory("Migration_outputs_error_when_no_projects_found"); - - string argstr = string.Empty; - - string errorMessage = string.Empty; - - if (useGlobalJson) - { - var globalJson = projectDirectory.GetFile("global.json"); - - using (StreamWriter sw = globalJson.CreateText()) - { - sw.WriteLine("{"); - sw.WriteLine("\"projects\": [ \".\" ]"); - sw.WriteLine("}"); - } - - argstr = globalJson.FullName; - - errorMessage = "Unable to find any projects in global.json"; - } - else - { - argstr = projectDirectory.FullName; - - errorMessage = $"No project.json file found in '{projectDirectory.FullName}'"; - } - - var result = new TestCommand("dotnet") - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"migrate {argstr}"); - - // Expecting an error exit code. - result.ExitCode.Should().Be(1); - - // Verify the error messages. Note that debug builds also show the call stack, so we search - // for the error strings that should be present (rather than an exact match). - result.StdErr - .Should().Contain(errorMessage) - .And.Contain("Migration failed."); - } - - [RequiresSpecificFrameworkFact("netcoreapp1.0")] - public void ItMigratesAndPublishesProjectsWithRuntimes() - { - var projectName = "PJTestAppSimple"; - var projectDirectory = TestAssets - .GetProjectJson(projectName) - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles() - .WithEmptyGlobalJson() - .Root; - - CleanBinObj(projectDirectory); - BuildProjectJsonMigrateBuildMSBuild(projectDirectory, projectName); - PublishMSBuild(projectDirectory, projectName, "win7-x64"); - } - - [WindowsOnlyTheory] - [InlineData("DesktopTestProjects", "AutoAddDesktopReferencesDuringMigrate", true)] - [InlineData("TestProjects", "PJTestAppSimple", false)] - public void ItAutoAddDesktopReferencesDuringMigrate(string testGroup, string projectName, bool isDesktopApp) - { - var runtime = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier(); - - var projectDirectory = TestAssets - .GetProjectJson(testGroup, projectName) - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles() - .WithEmptyGlobalJson() - .Root; - - CleanBinObj(projectDirectory); - MigrateProject(new string[] { projectDirectory.FullName }); - Restore(projectDirectory, runtime: runtime); - BuildMSBuild(projectDirectory, projectName, runtime:runtime); - VerifyAutoInjectedDesktopReferences(projectDirectory, projectName, isDesktopApp); - VerifyAllMSBuildOutputsRunnable(projectDirectory); - } - - [Fact] - public void ItBuildsAMigratedAppWithAnIndirectDependency() - { - const string projectName = "ProjectA"; - - var solutionDirectory = TestAssets - .GetProjectJson("TestAppDependencyGraph") - .CreateInstance() - .WithSourceFiles() - .WithEmptyGlobalJson() - .Root; - - var projectDirectory = solutionDirectory.GetDirectory(projectName); - - MigrateProject(new string[] { projectDirectory.FullName }); - - Restore(projectDirectory); - - BuildMSBuild(projectDirectory, projectName); - - VerifyAllMSBuildOutputsRunnable(projectDirectory); - } - - [Fact] - public void ItMigratesProjectWithOutputName() - { - var projectName = "AppWithOutputAssemblyName"; - var expectedOutputName = "MyApp"; - - var projectDirectory = TestAssets - .GetProjectJson(projectName) - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles() - .WithEmptyGlobalJson() - .Root; - - var expectedCsprojPath = projectDirectory.GetFile($"{projectName}.csproj"); - - if (expectedCsprojPath.Exists) - { - expectedCsprojPath.Delete(); - } - - CleanBinObj(projectDirectory); - MigrateProject(projectDirectory.FullName); - - expectedCsprojPath.Refresh(); - - expectedCsprojPath.Should().Exist(); - - Restore(projectDirectory, projectName); - BuildMSBuild(projectDirectory, projectName); - projectDirectory - .GetDirectory("bin") - .EnumerateFiles($"{expectedOutputName}.pdb", SearchOption.AllDirectories) - .Count().Should().Be(1); - - PackMSBuild(projectDirectory, projectName); - - projectDirectory - .GetDirectory("bin") - .EnumerateFiles($"{projectName}.1.0.0.nupkg", SearchOption.AllDirectories) - .Count().Should().Be(1); - } - - [Theory] - [InlineData("LibraryWithoutNetStandardLibRef")] - [InlineData("LibraryWithNetStandardLibRef")] - public void ItMigratesAndBuildsLibrary(string projectName) - { - var projectDirectory = TestAssets - .GetProjectJson(projectName) - .CreateInstance(identifier: projectName) - .WithSourceFiles() - .WithEmptyGlobalJson() - .Root; - - MigrateProject(projectDirectory.FullName); - Restore(projectDirectory, projectName); - BuildMSBuild(projectDirectory, projectName); - } - - [Fact] - public void ItMigratesAndBuildsAppWithExplicitInclude() - { - const string projectName = "TestAppWithExplicitInclude"; - var projectDirectory = TestAssets.Get(projectName) - .CreateInstance() - .WithSourceFiles() - .Root; - - MigrateProject(projectDirectory.FullName); - Restore(projectDirectory, projectName); - BuildMSBuild(projectDirectory, projectName); - } - - [Fact] - public void ItMigratesAndBuildsAppWithExplicitIncludeGlob() - { - const string projectName = "TestAppWithExplicitIncludeGlob"; - var projectDirectory = TestAssets.Get(projectName) - .CreateInstance() - .WithSourceFiles() - .Root; - - MigrateProject(projectDirectory.FullName); - Restore(projectDirectory, projectName); - BuildMSBuild(projectDirectory, projectName); - } - - private void VerifyAutoInjectedDesktopReferences(DirectoryInfo projectDirectory, string projectName, bool shouldBePresent) - { - if (projectName != null) - { - projectName = projectName + ".csproj"; - } - - var root = ProjectRootElement.Open(projectDirectory.GetFile(projectName).FullName); - - var autoInjectedReferences = root - .Items - .Where(i => i.ItemType == "Reference" - && (i.Include == "System" || i.Include == "Microsoft.CSharp")); - - if (shouldBePresent) - { - autoInjectedReferences.Should().HaveCount(2); - } - else - { - autoInjectedReferences.Should().BeEmpty(); - } - } - - private void VerifyMigration(IEnumerable expectedProjects, DirectoryInfo rootDir) - { - var backupDir = rootDir.GetDirectory("backup"); - - var migratedProjects = rootDir.EnumerateFiles("*.csproj", SearchOption.AllDirectories) - .Where(s => !PathUtility.IsChildOfDirectory(backupDir.FullName, s.FullName)) - .Where(s => Directory.EnumerateFiles(Path.GetDirectoryName(s.FullName), "*.csproj").Count() == 1) - .Where(s => Path.GetFileName(Path.GetDirectoryName(s.FullName)).Contains("Project")) - .Select(s => Path.GetFileName(Path.GetDirectoryName(s.FullName))); - - migratedProjects.Should().BeEquivalentTo(expectedProjects); - } - - private MigratedBuildComparisonData GetComparisonData(DirectoryInfo projectDirectory) - { - File.Copy("NuGet.tempaspnetpatch.config", projectDirectory.GetFile("NuGet.Config").FullName); - - RestoreProjectJson(projectDirectory); - - var outputComparisonData = - BuildProjectJsonMigrateBuildMSBuild(projectDirectory, Path.GetFileNameWithoutExtension(projectDirectory.FullName)); - - return outputComparisonData; - } - - private void VerifyAllMSBuildOutputsRunnable(DirectoryInfo projectDirectory) - { - if (!EnvironmentInfo.HasSharedFramework("netcoreapp1.0")) - { - // running the apps requires netcoreapp1.0 - return; - } - - var dllFileName = Path.GetFileName(projectDirectory.FullName) + ".dll"; - - var runnableDlls = projectDirectory - .GetDirectory("bin") - .GetFiles(dllFileName, SearchOption.AllDirectories); - - foreach (var dll in runnableDlls) - { - new DotnetCommand(DotnetUnderTest.WithBackwardsCompatibleRuntimes).ExecuteWithCapturedOutput($"\"{dll.FullName}\"").Should().Pass(); - } - } - - private void VerifyAllMSBuildOutputsAreSigned(DirectoryInfo projectDirectory) - { - var dllFileName = Path.GetFileName(projectDirectory.FullName) + ".dll"; - - var runnableDlls = projectDirectory - .GetDirectory("bin") - .EnumerateFiles(dllFileName, SearchOption.AllDirectories); - - foreach (var dll in runnableDlls) - { - var assemblyName = AssemblyLoadContext.GetAssemblyName(dll.FullName); - - var token = assemblyName.GetPublicKeyToken(); - - token.Should().NotBeNullOrEmpty(); - } - } - - private MigratedBuildComparisonData BuildProjectJsonMigrateBuildMSBuild(DirectoryInfo projectDirectory, - string projectName) - { - return BuildProjectJsonMigrateBuildMSBuild(projectDirectory, - projectName, - new [] { projectDirectory.FullName }, - new [] { projectDirectory }); - } - - private MigratedBuildComparisonData BuildProjectJsonMigrateBuildMSBuild(DirectoryInfo projectDirectory, - string projectName, - string[] migrateArgs, - DirectoryInfo[] restoreDirectories) - { - BuildProjectJson(projectDirectory); - - var projectJsonBuildOutputs = new HashSet(CollectBuildOutputs(projectDirectory.FullName)); - - CleanBinObj(projectDirectory); - - // Remove lock file for migration - foreach(var dir in restoreDirectories) - { - dir.GetFile("project.lock.json").Delete(); - } - - MigrateProject(migrateArgs); - - DeleteXproj(projectDirectory); - - foreach(var dir in restoreDirectories) - { - Restore(dir); - } - - BuildMSBuild(projectDirectory, projectName); - - var msbuildBuildOutputs = new HashSet(CollectBuildOutputs(projectDirectory.FullName)); - - return new MigratedBuildComparisonData(projectJsonBuildOutputs, msbuildBuildOutputs); - } - - private IEnumerable CollectBuildOutputs(string projectDirectory) - { - var fullBinPath = Path.GetFullPath(Path.Combine(projectDirectory, "bin")); - - return Directory.EnumerateFiles(fullBinPath, "*", SearchOption.AllDirectories) - .Select(p => Path.GetFullPath(p).Substring(fullBinPath.Length)); - } - - private void CleanBinObj(DirectoryInfo projectDirectory) - { - var dirs = new DirectoryInfo[] { projectDirectory.GetDirectory("bin"), projectDirectory.GetDirectory("obj") }; - - foreach (var dir in dirs) - { - if(dir.Exists) - { - dir.Delete(true); - } - } - } - - private void BuildProjectJson(DirectoryInfo projectDirectory) - { - Console.WriteLine(projectDirectory); - - var projectFile = $"\"{projectDirectory.GetFile("project.json").FullName}\""; - - var result = new BuildPJCommand() - .WithCapturedOutput() - .WithForwardingToConsole() - .Execute(projectFile); - - result.Should().Pass(); - } - - private void MigrateProject(params string[] migrateArgs) - { - new TestCommand("dotnet") - .WithForwardingToConsole() - .Execute($"migrate {string.Join(" ", migrateArgs)}") - .Should() - .Pass(); - } - - private void RestoreProjectJson(DirectoryInfo projectDirectory) - { - var projectFile = $"\"{projectDirectory.GetFile("project.json").FullName}\""; - new RestoreProjectJsonCommand() - .Execute(projectFile) - .Should().Pass(); - } - - private void Restore(DirectoryInfo projectDirectory, string projectName=null, string runtime=null) - { - var command = new RestoreCommand() - .WithWorkingDirectory(projectDirectory) - .WithRuntime(runtime); - - if (projectName != null) - { - if (!Path.HasExtension(projectName)) - { - projectName += ".csproj"; - } - command.Execute($"{projectName} /p:SkipInvalidConfigurations=true;_InvalidConfigurationWarning=false") - .Should().Pass(); - } - else - { - command.Execute("/p:SkipInvalidConfigurations=true;_InvalidConfigurationWarning=false") - .Should().Pass(); - } - } - - private string BuildMSBuild( - DirectoryInfo projectDirectory, - string projectName, - string configuration="Debug", - string runtime=null, - string framework=null) - { - if (projectName != null && !Path.HasExtension(projectName)) - { - projectName = projectName + ".csproj"; - } - - DeleteXproj(projectDirectory); - - var result = new BuildCommand() - .WithWorkingDirectory(projectDirectory) - .WithRuntime(runtime) - .WithFramework(framework) - .ExecuteWithCapturedOutput($"{projectName} /p:Configuration={configuration}"); - - result - .Should().Pass(); - - return result.StdOut; - } - - private string PublishMSBuild( - DirectoryInfo projectDirectory, - string projectName, - string runtime = null, - string configuration = "Debug") - { - if (projectName != null) - { - projectName = projectName + ".csproj"; - } - - DeleteXproj(projectDirectory); - - var result = new PublishCommand() - .WithRuntime(runtime) - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"{projectName} /p:Configuration={configuration}"); - - result.Should().Pass(); - - return result.StdOut; - } - - private string PackMSBuild(DirectoryInfo projectDirectory, string projectName) - { - if (projectName != null && !Path.HasExtension(projectName)) - { - projectName = projectName + ".csproj"; - } - - var result = new PackCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"{projectName}"); - - result.Should().Pass(); - - return result.StdOut; - } - - private void DeleteXproj(DirectoryInfo projectDirectory) - { - var xprojFiles = projectDirectory.EnumerateFiles("*.xproj"); - - foreach (var xprojFile in xprojFiles) - { - xprojFile.Delete(); - } - } - - private void OutputDiagnostics(MigratedBuildComparisonData comparisonData) - { - OutputDiagnostics(comparisonData.MSBuildBuildOutputs, comparisonData.ProjectJsonBuildOutputs); - } - - private void OutputDiagnostics(HashSet msbuildBuildOutputs, HashSet projectJsonBuildOutputs) - { - Console.WriteLine("Project.json Outputs:"); - - Console.WriteLine(string.Join("\n", projectJsonBuildOutputs)); - - Console.WriteLine(""); - - Console.WriteLine("MSBuild Outputs:"); - - Console.WriteLine(string.Join("\n", msbuildBuildOutputs)); - } - - private class MigratedBuildComparisonData - { - public HashSet ProjectJsonBuildOutputs { get; } - - public HashSet MSBuildBuildOutputs { get; } - - public MigratedBuildComparisonData(HashSet projectJsonBuildOutputs, - HashSet msBuildBuildOutputs) - { - ProjectJsonBuildOutputs = projectJsonBuildOutputs; - - MSBuildBuildOutputs = msBuildBuildOutputs; - } - } - - private void WriteGlobalJson(DirectoryInfo globalDirectory) - { - var file = globalDirectory.GetFile("global.json"); - - File.WriteAllText(file.FullName, @" - { - ""projects"": [ ] - }"); - } - } -} diff --git a/test/dotnet-migrate.Tests/NuGet.tempaspnetpatch.config b/test/dotnet-migrate.Tests/NuGet.tempaspnetpatch.config index 33b9693d5..f38551286 100644 --- a/test/dotnet-migrate.Tests/NuGet.tempaspnetpatch.config +++ b/test/dotnet-migrate.Tests/NuGet.tempaspnetpatch.config @@ -6,6 +6,6 @@ - + \ No newline at end of file diff --git a/test/dotnet-migrate.Tests/dotnet-migrate.Tests.csproj b/test/dotnet-migrate.Tests/dotnet-migrate.Tests.csproj index 4663939f0..d12f9ae1d 100644 --- a/test/dotnet-migrate.Tests/dotnet-migrate.Tests.csproj +++ b/test/dotnet-migrate.Tests/dotnet-migrate.Tests.csproj @@ -17,7 +17,6 @@ - @@ -29,5 +28,6 @@ + diff --git a/test/dotnet-msbuild.Tests/GivenDotnetRestoreInvocation.cs b/test/dotnet-msbuild.Tests/GivenDotnetRestoreInvocation.cs index c900a6d48..dd55e2abd 100644 --- a/test/dotnet-msbuild.Tests/GivenDotnetRestoreInvocation.cs +++ b/test/dotnet-msbuild.Tests/GivenDotnetRestoreInvocation.cs @@ -10,7 +10,11 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests { public class GivenDotnetRestoreInvocation { - const string ExpectedPrefix = "exec /m /v:m /NoLogo /t:Restore /ConsoleLoggerParameters:Verbosity=Minimal"; + private const string ExpectedPrefix = + "exec /m /v:m /NoLogo /t:Restore"; + + private string ExpectedPrefixWithConsoleLoggerParamaters = + $"{ExpectedPrefix} /ConsoleLoggerParameters:Verbosity=Minimal"; [Theory] [InlineData(new string[] { }, "")] @@ -26,15 +30,26 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests [InlineData(new string[] { "--no-cache" }, "/p:RestoreNoCache=true")] [InlineData(new string[] { "--ignore-failed-sources" }, "/p:RestoreIgnoreFailedSources=true")] [InlineData(new string[] { "--no-dependencies" }, "/p:RestoreRecursive=false")] - [InlineData(new string[] { "-v", "minimal" }, @"/verbosity:minimal")] - [InlineData(new string[] { "--verbosity", "minimal" }, @"/verbosity:minimal")] - public void MsbuildInvocationIsCorrect(string[] args, string expectedAdditionalArgs) + public void MsbuildInvocationWithConsoleLoggerParametersIsCorrect(string[] args, string expectedAdditionalArgs) { expectedAdditionalArgs = (string.IsNullOrEmpty(expectedAdditionalArgs) ? "" : $" {expectedAdditionalArgs}"); var msbuildPath = ""; RestoreCommand.FromArgs(args, msbuildPath) - .GetProcessStartInfo().Arguments.Should().Be($"{ExpectedPrefix}{expectedAdditionalArgs}"); + .GetProcessStartInfo().Arguments + .Should().Be($"{ExpectedPrefixWithConsoleLoggerParamaters}{expectedAdditionalArgs}"); + } + + [InlineData(new string[] { "-v", "minimal" }, @"/verbosity:minimal")] + [InlineData(new string[] { "--verbosity", "minimal" }, @"/verbosity:minimal")] + public void MsbuildInvocationWithVerbosityIsCorrect(string[] args, string expectedAdditionalArgs) + { + expectedAdditionalArgs = (string.IsNullOrEmpty(expectedAdditionalArgs) ? "" : $" {expectedAdditionalArgs}"); + + var msbuildPath = ""; + RestoreCommand.FromArgs(args, msbuildPath) + .GetProcessStartInfo().Arguments + .Should().Be($"{ExpectedPrefix}{expectedAdditionalArgs}"); } } } diff --git a/test/dotnet-msbuild.Tests/GivenMsbuildForwardingApp.cs b/test/dotnet-msbuild.Tests/GivenMsbuildForwardingApp.cs index fab53877f..4450258ee 100644 --- a/test/dotnet-msbuild.Tests/GivenMsbuildForwardingApp.cs +++ b/test/dotnet-msbuild.Tests/GivenMsbuildForwardingApp.cs @@ -32,6 +32,7 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests [Theory] [InlineData("MSBuildExtensionsPath")] [InlineData("CscToolExe")] + [InlineData("VbcToolExe")] [InlineData("MSBuildSDKsPath")] [InlineData("DOTNET_CLI_TELEMETRY_SESSIONID")] public void ItSetsEnvironmentalVariables(string envVarName) @@ -76,6 +77,17 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests .Should().NotBeNull("constructor will throw on invalid path"); } + [Fact] + public void ItSetsVbcToolExePathToValidPath() + { + var msbuildPath = ""; + var envVar = "VbcToolExe"; + new FileInfo(new MSBuildForwardingApp(new string[0], msbuildPath) + .GetProcessStartInfo() + .Environment[envVar]) + .Should().NotBeNull("constructor will throw on invalid path"); + } + [Fact] public void ItSetsOrIgnoresTelemetrySessionId() { diff --git a/test/dotnet-new.Tests/GivenThatIWantANewApp.cs b/test/dotnet-new.Tests/GivenThatIWantANewApp.cs index 5c120645e..31f271f50 100644 --- a/test/dotnet-new.Tests/GivenThatIWantANewApp.cs +++ b/test/dotnet-new.Tests/GivenThatIWantANewApp.cs @@ -118,7 +118,7 @@ namespace Microsoft.DotNet.New.Tests var context = reader.Read(stream); var dependency = context .RuntimeLibraries - .Single(library => library.Name == packageName); + .Single(library => string.Equals(library.Name, packageName, StringComparison.OrdinalIgnoreCase)); return dependency.Version; } diff --git a/test/dotnet-new.Tests/NuGet.tempaspnetpatch.config b/test/dotnet-new.Tests/NuGet.tempaspnetpatch.config index 33b9693d5..f38551286 100644 --- a/test/dotnet-new.Tests/NuGet.tempaspnetpatch.config +++ b/test/dotnet-new.Tests/NuGet.tempaspnetpatch.config @@ -6,6 +6,6 @@ - + \ No newline at end of file diff --git a/test/dotnet-remove-package.Tests/GivenDotnetRemovePackage.cs b/test/dotnet-remove-package.Tests/GivenDotnetRemovePackage.cs new file mode 100644 index 000000000..fe709ec7a --- /dev/null +++ b/test/dotnet-remove-package.Tests/GivenDotnetRemovePackage.cs @@ -0,0 +1,89 @@ +// 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 FluentAssertions; +using Microsoft.DotNet.Tools.Test.Utilities; +using Xunit; + +namespace Microsoft.DotNet.Cli.Remove.Package.Tests +{ + public class GivenDotnetRemovePackage : TestBase + { + private const string HelpText = @".NET Remove Package reference Command. + +Usage: dotnet remove package [options] + +Arguments: + The project file to operate on. If a file is not specified, the command will search the current directory for one. + Package reference to remove. + +Options: + -h, --help Show help information. +"; + + private const string RemoveCommandHelpText = @".NET Remove Command + +Usage: dotnet remove [options] [command] + +Arguments: + The project file to operate on. If a file is not specified, the command will search the current directory for one. + +Options: + -h, --help Show help information. + +Commands: + package .NET Remove Package reference Command. + reference .NET Remove Project to Project reference Command +"; + + [Theory] + [InlineData("--help")] + [InlineData("-h")] + public void WhenHelpOptionIsPassedItPrintsUsage(string helpArg) + { + var cmd = new DotnetCommand().ExecuteWithCapturedOutput($"remove package {helpArg}"); + cmd.Should().Pass(); + cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); + } + + [Theory] + [InlineData("")] + [InlineData("unknownCommandName")] + public void WhenNoCommandIsPassedItPrintsError(string commandName) + { + var cmd = new DotnetCommand() + .ExecuteWithCapturedOutput($"remove {commandName}"); + cmd.Should().Fail(); + cmd.StdErr.Should().Be("Required command was not provided."); + cmd.StdOut.Should().BeVisuallyEquivalentTo(RemoveCommandHelpText); + } + + [Fact] + public void WhenReferencedPackageIsPassedItGetsRemoved() + { + var projectDirectory = TestAssets + .Get("TestAppSimple") + .CreateInstance() + .WithSourceFiles() + .Root + .FullName; + + var packageName = "Newtonsoft.Json"; + var add = new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .ExecuteWithCapturedOutput($"add package {packageName}"); + add.Should().Pass(); + + + var remove = new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .ExecuteWithCapturedOutput($"remove package {packageName}"); + + remove.Should().Pass(); + remove.StdOut.Should().Contain($"Removing PackageReference for package '{packageName}' from project '{projectDirectory + Path.DirectorySeparatorChar}TestAppSimple.csproj'."); + remove.StdErr.Should().BeEmpty(); + } + } +} diff --git a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Microsoft.DotNet.ProjectJsonMigration.Tests.csproj b/test/dotnet-remove-package.Tests/dotnet-remove-package.Tests.csproj similarity index 50% rename from test/Microsoft.DotNet.ProjectJsonMigration.Tests/Microsoft.DotNet.ProjectJsonMigration.Tests.csproj rename to test/dotnet-remove-package.Tests/dotnet-remove-package.Tests.csproj index b6989809a..4e04974e5 100644 --- a/test/Microsoft.DotNet.ProjectJsonMigration.Tests/Microsoft.DotNet.ProjectJsonMigration.Tests.csproj +++ b/test/dotnet-remove-package.Tests/dotnet-remove-package.Tests.csproj @@ -5,31 +5,21 @@ $(CliTargetFramework) $(CLI_SharedFrameworkVersion) true - Microsoft.DotNet.ProjectJsonMigration.Tests - ../../tools/test_key.snk - true - true - $(PackageTargetFallback);netstandardapp1.5;dotnet5.4;portable-net451+win8 + dotnet-remove-package.Tests + $(PackageTargetFallback);dotnet5.4;portable-net451+win8 - - - PreserveNewest - - - - - - + + - + diff --git a/test/dotnet-remove-reference.Tests/GivenDotnetRemoveP2P.cs b/test/dotnet-remove-reference.Tests/GivenDotnetRemoveP2P.cs index 29011c383..239c067c7 100644 --- a/test/dotnet-remove-reference.Tests/GivenDotnetRemoveP2P.cs +++ b/test/dotnet-remove-reference.Tests/GivenDotnetRemoveP2P.cs @@ -22,10 +22,25 @@ Arguments: Project to project references to remove Options: - -h, --help Show help information + -h, --help Show help information. -f, --framework Remove reference only when targeting a specific framework "; + private const string RemoveCommandHelpText = @".NET Remove Command + +Usage: dotnet remove [options] [command] + +Arguments: + The project file to operate on. If a file is not specified, the command will search the current directory for one. + +Options: + -h, --help Show help information. + +Commands: + package .NET Remove Package reference Command. + reference .NET Remove Project to Project reference Command +"; + const string FrameworkNet451Arg = "-f net451"; const string ConditionFrameworkNet451 = "== 'net451'"; const string FrameworkNetCoreApp10Arg = "-f netcoreapp1.0"; @@ -129,6 +144,7 @@ Options: .ExecuteWithCapturedOutput($"remove {commandName}"); cmd.Should().Fail(); cmd.StdErr.Should().Be("Required command was not provided."); + cmd.StdOut.Should().BeVisuallyEquivalentTo(RemoveCommandHelpText); } [Fact] diff --git a/test/dotnet-remove-reference.Tests/dotnet-remove-reference.Tests.csproj b/test/dotnet-remove-reference.Tests/dotnet-remove-reference.Tests.csproj index b3d7f3b16..946c6e332 100644 --- a/test/dotnet-remove-reference.Tests/dotnet-remove-reference.Tests.csproj +++ b/test/dotnet-remove-reference.Tests/dotnet-remove-reference.Tests.csproj @@ -11,7 +11,6 @@ - @@ -21,5 +20,6 @@ + diff --git a/test/dotnet-restore.Tests/GivenThatIWantToRestoreApp.cs b/test/dotnet-restore.Tests/GivenThatIWantToRestoreApp.cs index 3b5c44b42..40afaea2e 100644 --- a/test/dotnet-restore.Tests/GivenThatIWantToRestoreApp.cs +++ b/test/dotnet-restore.Tests/GivenThatIWantToRestoreApp.cs @@ -89,5 +89,30 @@ namespace Microsoft.DotNet.Restore.Tests Directory.Exists(fullPath).Should().BeTrue(); Directory.EnumerateFiles(fullPath, "*.dll", SearchOption.AllDirectories).Count().Should().BeGreaterThan(0); } + + [Fact] + public void ItRestoresWithTheSpecifiedVerbosity() + { + var rootPath = TestAssets.CreateTestDirectory().FullName; + + string dir = "pkgs"; + string fullPath = Path.GetFullPath(Path.Combine(rootPath, dir)); + + string newArgs = $"console -o \"{rootPath}\" --no-restore"; + new NewCommandShim() + .WithWorkingDirectory(rootPath) + .Execute(newArgs) + .Should() + .Pass(); + + string args = $"--configfile {RepoRootNuGetConfig} --packages \"{dir}\" --verbosity quiet"; + new RestoreCommand() + .WithWorkingDirectory(rootPath) + .ExecuteWithCapturedOutput(args) + .Should() + .Pass() + .And.NotHaveStdErr() + .And.NotHaveStdOut(); + } } } diff --git a/test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs b/test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs index c022a8d1c..1ea57b1eb 100644 --- a/test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs +++ b/test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs @@ -24,8 +24,25 @@ Arguments: Add one or more specified projects to the solution. Options: - -h, --help Show help information + -h, --help Show help information. "; + + private const string SlnCommandHelpText = @".NET modify solution file command + +Usage: dotnet sln [options] [command] + +Arguments: + Solution file to operate on. If not specified, the command will search the current directory for one. + +Options: + -h, --help Show help information. + +Commands: + add .NET Add project(s) to a solution file Command + list .NET List project(s) in a solution file Command + remove .NET Remove project(s) from a solution file Command +"; + private ITestOutputHelper _output; public GivenDotnetSlnAdd(ITestOutputHelper output) @@ -193,6 +210,7 @@ EndGlobal .ExecuteWithCapturedOutput($"sln {commandName}"); cmd.Should().Fail(); cmd.StdErr.Should().Be("Required command was not provided."); + cmd.StdOut.Should().BeVisuallyEquivalentTo(SlnCommandHelpText); } [Fact] @@ -234,7 +252,7 @@ EndGlobal .WithWorkingDirectory(projectDirectory) .ExecuteWithCapturedOutput($"sln InvalidSolution.sln add {projectToAdd}"); cmd.Should().Fail(); - cmd.StdErr.Should().Be("Invalid solution `InvalidSolution.sln`. Invalid format in line 1: File header is missing"); + cmd.StdErr.Should().Be("Invalid solution `InvalidSolution.sln`. Expected file header not found."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); } @@ -254,7 +272,7 @@ EndGlobal .WithWorkingDirectory(projectDirectory) .ExecuteWithCapturedOutput($"sln add {projectToAdd}"); cmd.Should().Fail(); - cmd.StdErr.Should().Be($"Invalid solution `{solutionPath}`. Invalid format in line 1: File header is missing"); + cmd.StdErr.Should().Be($"Invalid solution `{solutionPath}`. Expected file header not found."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); } @@ -462,6 +480,35 @@ EndGlobal cmd.StdErr.Should().BeEmpty(); } + [Theory] + [InlineData("TestAppWithSlnAndCsprojFiles")] + [InlineData("TestAppWithSlnAndCsprojProjectGuidFiles")] + [InlineData("TestAppWithEmptySln")] + public void WhenInvalidProjectIsPassedItDoesNotGetAdded(string testAsset) + { + var projectDirectory = TestAssets + .Get(testAsset) + .CreateInstance() + .WithSourceFiles() + .Root + .FullName; + + var projectToAdd = "Lib/Library.cs"; + var projectPath = Path.Combine("Lib", "Library.cs"); + var slnFile = SlnFile.Read(Path.Combine(projectDirectory, "App.sln")); + var expectedNumberOfProjects = slnFile.Projects.Count(); + + var cmd = new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .ExecuteWithCapturedOutput($"sln App.sln add {projectToAdd}"); + cmd.Should().Pass(); + cmd.StdOut.Should().BeEmpty(); + cmd.StdErr.Should().Match("Invalid project `*`. The project file could not be loaded.*"); + + slnFile = SlnFile.Read(Path.Combine(projectDirectory, "App.sln")); + slnFile.Projects.Count().Should().Be(expectedNumberOfProjects); + } + [Theory] [InlineData("TestAppWithSlnAndCsprojFiles")] [InlineData("TestAppWithSlnAndCsprojProjectGuidFiles")] diff --git a/test/dotnet-sln-list.Tests/GivenDotnetSlnList.cs b/test/dotnet-sln-list.Tests/GivenDotnetSlnList.cs index 781322e71..cd604a885 100644 --- a/test/dotnet-sln-list.Tests/GivenDotnetSlnList.cs +++ b/test/dotnet-sln-list.Tests/GivenDotnetSlnList.cs @@ -21,7 +21,23 @@ Arguments: Solution file to operate on. If not specified, the command will search the current directory for one. Options: - -h, --help Show help information + -h, --help Show help information. +"; + + private const string SlnCommandHelpText = @".NET modify solution file command + +Usage: dotnet sln [options] [command] + +Arguments: + Solution file to operate on. If not specified, the command will search the current directory for one. + +Options: + -h, --help Show help information. + +Commands: + add .NET Add project(s) to a solution file Command + list .NET List project(s) in a solution file Command + remove .NET Remove project(s) from a solution file Command "; [Theory] @@ -44,6 +60,7 @@ Options: .ExecuteWithCapturedOutput($"sln {commandName}"); cmd.Should().Fail(); cmd.StdErr.Should().Be("Required command was not provided."); + cmd.StdOut.Should().BeVisuallyEquivalentTo(SlnCommandHelpText); } [Fact] @@ -84,7 +101,7 @@ Options: .WithWorkingDirectory(projectDirectory) .ExecuteWithCapturedOutput("sln InvalidSolution.sln list"); cmd.Should().Fail(); - cmd.StdErr.Should().Be("Invalid solution `InvalidSolution.sln`. Invalid format in line 1: File header is missing"); + cmd.StdErr.Should().Be("Invalid solution `InvalidSolution.sln`. Expected file header not found."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); } @@ -103,7 +120,7 @@ Options: .WithWorkingDirectory(projectDirectory) .ExecuteWithCapturedOutput("sln list"); cmd.Should().Fail(); - cmd.StdErr.Should().Be($"Invalid solution `{solutionFullPath}`. Invalid format in line 1: File header is missing"); + cmd.StdErr.Should().Be($"Invalid solution `{solutionFullPath}`. Expected file header not found."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); } diff --git a/test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs b/test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs index f32bef616..858b89780 100644 --- a/test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs +++ b/test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs @@ -22,7 +22,23 @@ Arguments: Remove the specified project(s) from the solution. The project is not impacted. Options: - -h, --help Show help information + -h, --help Show help information. +"; + + private const string SlnCommandHelpText = @".NET modify solution file command + +Usage: dotnet sln [options] [command] + +Arguments: + Solution file to operate on. If not specified, the command will search the current directory for one. + +Options: + -h, --help Show help information. + +Commands: + add .NET Add project(s) to a solution file Command + list .NET List project(s) in a solution file Command + remove .NET Remove project(s) from a solution file Command "; private const string ExpectedSlnContentsAfterRemove = @" @@ -187,6 +203,7 @@ EndGlobal .ExecuteWithCapturedOutput($"sln {commandName}"); cmd.Should().Fail(); cmd.StdErr.Should().Be("Required command was not provided."); + cmd.StdOut.Should().BeVisuallyEquivalentTo(SlnCommandHelpText); } [Theory] @@ -219,7 +236,7 @@ EndGlobal .WithWorkingDirectory(projectDirectory) .ExecuteWithCapturedOutput($"sln InvalidSolution.sln remove {projectToRemove}"); cmd.Should().Fail(); - cmd.StdErr.Should().Be("Invalid solution `InvalidSolution.sln`. Invalid format in line 1: File header is missing"); + cmd.StdErr.Should().Be("Invalid solution `InvalidSolution.sln`. Expected file header not found."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); } @@ -239,7 +256,7 @@ EndGlobal .WithWorkingDirectory(projectDirectory) .ExecuteWithCapturedOutput($"sln remove {projectToRemove}"); cmd.Should().Fail(); - cmd.StdErr.Should().Be($"Invalid solution `{solutionPath}`. Invalid format in line 1: File header is missing"); + cmd.StdErr.Should().Be($"Invalid solution `{solutionPath}`. Expected file header not found."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); } diff --git a/test/dotnet-store.Tests/GivenDotnetStoresAndPublishesProjects.cs b/test/dotnet-store.Tests/GivenDotnetStoresAndPublishesProjects.cs index e2845ec19..f9cb595d5 100644 --- a/test/dotnet-store.Tests/GivenDotnetStoresAndPublishesProjects.cs +++ b/test/dotnet-store.Tests/GivenDotnetStoresAndPublishesProjects.cs @@ -45,7 +45,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests .WithOutput(localAssemblyCache) .WithRuntimeFrameworkVersion(_frameworkVersion) .WithIntermediateWorkingDirectory(intermediateWorkingDirectory) - .Execute($"--preserve-working-dir") + .Execute() .Should().Pass(); var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; @@ -143,7 +143,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests .WithOutput(localAssemblyCache) .WithRuntimeFrameworkVersion(_frameworkVersion) .WithIntermediateWorkingDirectory(intermediateWorkingDirectory) - .Execute($"--preserve-working-dir") + .Execute() .Should().Pass(); var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; diff --git a/test/dotnet.Tests/GivenThatICareAboutVBApps.cs b/test/dotnet.Tests/GivenThatICareAboutVBApps.cs new file mode 100644 index 000000000..4b7d0186b --- /dev/null +++ b/test/dotnet.Tests/GivenThatICareAboutVBApps.cs @@ -0,0 +1,70 @@ +// 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 FluentAssertions; +using Microsoft.DotNet.TestFramework; +using Microsoft.DotNet.Tools.Test.Utilities; +using Xunit; + +namespace Microsoft.DotNet.Tests +{ + public class GivenThatICareAboutVBApps : TestBase + { + private TestAssetInstance _testInstance; + + public GivenThatICareAboutVBApps() + { + _testInstance = TestAssets.Get("VBTestApp") + .CreateInstance() + .WithSourceFiles(); + + new RestoreCommand() + .WithWorkingDirectory(_testInstance.Root) + .Execute() + .Should().Pass(); + } + + [Fact] + public void ICanBuildVBApps() + { + new BuildCommand() + .WithWorkingDirectory(_testInstance.Root) + .Execute() + .Should().Pass(); + } + + [Fact] + public void ICanRunVBApps() + { + new RunCommand() + .WithWorkingDirectory(_testInstance.Root) + .Execute() + .Should().Pass(); + } + + [Fact] + public void ICanPublicAndRunVBApps() + { + new PublishCommand() + .WithWorkingDirectory(_testInstance.Root) + .Execute() + .Should().Pass(); + + var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; + var outputDll = Path.Combine( + _testInstance.Root.FullName, + "bin", + configuration, + "netcoreapp2.0", + "publish", + "VBTestApp.dll"); + + new DotnetCommand() + .ExecuteWithCapturedOutput(outputDll) + .Should().Pass() + .And.HaveStdOutContaining("Hello World"); + } + } +} diff --git a/test/dotnet.Tests/ParserTests/MigrateParserTests.cs b/test/dotnet.Tests/ParserTests/MigrateParserTests.cs index 814333dd0..165bffb72 100644 --- a/test/dotnet.Tests/ParserTests/MigrateParserTests.cs +++ b/test/dotnet.Tests/ParserTests/MigrateParserTests.cs @@ -32,7 +32,7 @@ namespace Microsoft.DotNet.Tests.ParserTests "-r \"C:\\report.wfw\" " + "--format-report-file-json"); - Action a = () => result["dotnet"]["migrate"].Value(); + Action a = () => result["dotnet"]["migrate"].Value(); a.ShouldNotThrow(); } diff --git a/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj b/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj index 5fd067694..e29aa4cdb 100644 --- a/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj +++ b/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj @@ -3,7 +3,7 @@ netcoreapp2.0 - $(CoreCLRRid) + $(SharedFrameworkRid) diff --git a/tools/Signing.Dependencies/Signing.Dependencies.csproj b/tools/Signing.Dependencies/Signing.Dependencies.csproj new file mode 100644 index 000000000..c98ee321a --- /dev/null +++ b/tools/Signing.Dependencies/Signing.Dependencies.csproj @@ -0,0 +1,12 @@ + + + + + netcoreapp1.0 + + + + + + +