diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..21e4302b9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,149 @@ +# editorconfig.org + +# top-most EditorConfig file +root = true + +# Default settings: +# A newline ending every file +# Use 4 spaces as indentation +[*] +insert_final_newline = true +indent_style = space +indent_size = 4 + +[project.json] +indent_size = 2 + +# C# files +[*.cs] +# New line preferences +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_within_query_expression_clauses = true + +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_switch_labels = true +csharp_indent_labels = flush_left + +# avoid this. unless absolutely necessary +dotnet_style_qualification_for_field = false:suggestion +dotnet_style_qualification_for_property = false:suggestion +dotnet_style_qualification_for_method = false:suggestion +dotnet_style_qualification_for_event = false:suggestion + +# only use var when it's obvious what the variable type is +csharp_style_var_for_built_in_types = false:none +csharp_style_var_when_type_is_apparent = false:none +csharp_style_var_elsewhere = false:suggestion + +# use language keywords instead of BCL types +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion +dotnet_style_predefined_type_for_member_access = true:suggestion + +# name all constant fields using PascalCase +dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields +dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style + +dotnet_naming_symbols.constant_fields.applicable_kinds = field +dotnet_naming_symbols.constant_fields.required_modifiers = const + +dotnet_naming_style.pascal_case_style.capitalization = pascal_case + +# internal and private fields should be _camelCase +dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion +dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields +dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style + +dotnet_naming_symbols.private_internal_fields.applicable_kinds = field +dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal + +dotnet_naming_style.camel_case_underscore_style.required_prefix = _ +dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case + +# Code style defaults +dotnet_sort_system_directives_first = true +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = false + +# Expression-level preferences +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion + +# Expression-bodied members +csharp_style_expression_bodied_methods = false:none +csharp_style_expression_bodied_constructors = false:none +csharp_style_expression_bodied_operators = false:none +csharp_style_expression_bodied_properties = true:none +csharp_style_expression_bodied_indexers = true:none +csharp_style_expression_bodied_accessors = true:none + +# Pattern matching +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion + +# Null checking preferences +csharp_style_throw_expression = true:suggestion +csharp_style_conditional_delegate_call = true:suggestion + +# Space preferences +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = do_not_ignore +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_between_square_brackets = false + +# C++ Files +[*.{cpp,h,in}] +curly_bracket_next_line = true +indent_brace_style = Allman + +# Xml project files +[*.{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}] +indent_size = 2 + +# Xml build files +[*.builds] +indent_size = 2 + +# Xml files +[*.{xml,stylecop,resx,ruleset}] +indent_size = 2 + +# Xml config files +[*.{props,targets,config,nuspec}] +indent_size = 2 + +# Shell scripts +[*.sh] +end_of_line = lf +[*.{cmd, bat}] +end_of_line = crlf diff --git a/.gitignore b/.gitignore index 19e5af704..847693d1d 100644 --- a/.gitignore +++ b/.gitignore @@ -99,6 +99,7 @@ dlldata.c # DNX project.lock.json artifacts/ +bin/ *_i.c *_p.c diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 000000000..a75ddc89a --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,70 @@ + + + + + + $(MSBuildThisFileDirectory) + + $(NUGET_PACKAGES) + $(RepoRoot)/.nuget/packages + + build_projects/dotnet-cli-build/bin + dotnet-cli-build.dll + $(RepoRoot)/$(RelativeCLIBuildBinaries)/$(RelativeCLIBuildDllName) + $(RepoRoot)/build_projects/dotnet-cli-build/bin/Microsoft.DotNet.Build.Tasks.Feed.dll + + true + true + + netcoreapp2.1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Documentation/README.md b/Documentation/README.md index 94edbb417..9d211c0a2 100644 --- a/Documentation/README.md +++ b/Documentation/README.md @@ -16,7 +16,7 @@ Documents Index ## Troubleshooting and issues reporting -- [CLI Known Issues](https://github.com/dotnet/core/blob/master/cli/known-issues.md) +- [CLI Known Issues](https://github.com/dotnet/core/blob/master/release-notes/2.0/2.0.0-known-issues.md) - [Filing migration issues](migration-issues.md) ## Specifications diff --git a/Documentation/general/tab-completion.md b/Documentation/general/tab-completion.md index bf6fefaa3..4687e897e 100644 --- a/Documentation/general/tab-completion.md +++ b/Documentation/general/tab-completion.md @@ -1,6 +1,6 @@ # .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. +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 in PowerShell, bash, or zsh by following the instructions below. Here are some examples of what it provides: @@ -26,17 +26,18 @@ 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. +Learn more about .NET Core: https://aka.ms/dotnet-docs +Use 'dotnet --help' to see available commands or visit: 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. +--------- +The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. + +Read more about .NET Core CLI 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. +-------------- +A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once. Decompressing 100% 4936 ms Expanding 100% 17195 ms ``` @@ -68,4 +69,4 @@ To enable tab completion in zsh, edit your `.zshrc` file to add the contents of ## 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). +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). diff --git a/Documentation/project-docs/developer-guide.md b/Documentation/project-docs/developer-guide.md index 0391adefa..7e8e76055 100644 --- a/Documentation/project-docs/developer-guide.md +++ b/Documentation/project-docs/developer-guide.md @@ -27,8 +27,7 @@ In order to build .NET Command Line Interface, you need the following installed ## Building/Running 1. Run `build.cmd` or `build.sh` from the root depending on your OS. If you don't want to execute tests, run `build.cmd /t:Compile` or `./build.sh /t:Compile`. - - To build the CLI in macOS Sierra, you need to set the DOTNET_RUNTIME_ID environment variable by running `export DOTNET_RUNTIME_ID=osx.10.11-x64`. -2. Use `artifacts/{RID}/stage2/dotnet` to try out the `dotnet` command. You can also add `artifacts/{os}-{arch}/stage2` to the PATH if you want to use the build output when invoking `dotnet` from the current console. +2. The CLI that is built (we call it stage 2) will be laid out in the `bin\2\{RID}\dotnet` folder. You can run `dotnet.exe` or `dotnet` from that folder to try out the `dotnet` command. ## A simple test Using the `dotnet` built in the previous step: @@ -40,8 +39,12 @@ Using the `dotnet` built in the previous step: ## Running tests -1. To run all tests invoke `build.cmd` or `build.sh` which will build the product and run the tests. -2. To run a specific test, cd into that test's directory and execute `dotnet test`. If using this approach, make sure to add `artifacts/{RID}/stage2` to your `PATH` and set the `NUGET_PACKAGES` environment variable to point to the repo's `.nuget/packages` directory. +1. To run all tests, invoke `build.cmd` or `build.sh` which will build the product and run the tests. +2. To run a specific test project: + - Run `scripts\cli-test-env.bat` on Windows, or [source](https://en.wikipedia.org/wiki/Source_(command)) `scripts/cli-test-env.sh` on Linux or OS X. This will add the stage 2 `dotnet` folder to your path and set up other environment variables which are used for running tests. + - `cd` into the test's directory + - Run `dotnet test` + - Refer to the command-line help for `dotnet test` if you want to run a specific test in the test project ## Adding a Command diff --git a/Documentation/specs/cli-installation-scenarios.md b/Documentation/specs/cli-installation-scenarios.md index 16182c234..654ae0e66 100644 --- a/Documentation/specs/cli-installation-scenarios.md +++ b/Documentation/specs/cli-installation-scenarios.md @@ -17,6 +17,8 @@ Obtaining .NET CLI * [Acquisition modes](#acquisition-modes) * [Native installers](#native-installers) * [Installation script](#installation-script) + * [Windows one-liner](#windows-command) + * [OSX/Linux one-liner](#osxlinux-shell-command) * [Complete manual installation](#complete-manual-installation) * [Docker](#docker) * [NuGet Packages](#nuget-packages) @@ -256,6 +258,18 @@ OSX/Linux: ./dotnet-install.sh --channel 2.0 ``` +#### Windows obtain one-liner example + +``` +@powershell -NoProfile -ExecutionPolicy unrestricted -Command "&([scriptblock]::Create((Invoke-WebRequest -useb 'https://dot.net/v1/dotnet-install.ps1'))) " +``` + +#### OSX/Linux obtain one-liner + +``` +curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin +``` + ### Docker [Docker](https://docs.docker.com/) has become a pretty good way to use developer tools, from trying them out in an interactive image use to using it for deployment. We have Docker images on DockerHub already. diff --git a/Documentation/specs/runtime-configuration-file.md b/Documentation/specs/runtime-configuration-file.md index fbf6e2c4c..b021f9358 100644 --- a/Documentation/specs/runtime-configuration-file.md +++ b/Documentation/specs/runtime-configuration-file.md @@ -9,8 +9,8 @@ The runtime configuration files store the dependencies of an application (former There are two runtime configuration files for a particular application. Given a project named `MyApp`, the compilation process produces the following files (on Windows, other platforms are similar): * `MyApp.dll` - The managed assembly for `MyApp`, including an ECMA-compliant entry point token. -* `MyApp.exe` - A copy of the `corehost.exe` executable. -* `MyApp.runtimeconfig.json` - An **optional** configuration file containing runtime configuration settings. +* `MyApp.exe` - A copy of the `corehost.exe` executable. Only present when the application is a self-contained application. +* `MyApp.runtimeconfig.json` - An **optional** configuration file containing runtime configuration settings. This file is required for portable applications, but not for self-contained apps. * `MyApp.deps.json` - A list of dependencies, as well as compilation context data and compilation dependencies. Not technically required, but required to use the servicing or package cache/shared package install features. The `MyApp.runtimeconfig.json` is designed to be user-editable (in the case of an app consumer wanting to change various CLR runtime options for an app, much like the `MyApp.exe.config` XML file works in .NET 4.x today). However, the `MyApp.deps.json` file is designed to be processed by automated tools and should not be user-edited. Having the files as separate makes this clearer. We could use a different format for the deps file, but if we're already integrating a JSON parser into the host, it seems most appropriate to re-use that here. Also, there are diagnostic benefits to being able to read the `.deps.json` file in a simple text editor. diff --git a/Microsoft.DotNet.Cli.sln b/Microsoft.DotNet.Cli.sln index 271579431..714749883 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.26510.0 +VisualStudioVersion = 15.0.27004.2008 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{ED2FE3E2-F7E7-4389-8231-B65123F2076F}" EndProject @@ -13,8 +13,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{17735A9D-BFD9-4585-A7CB-3208CA6EA8A7}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{0722D325-24C8-4E83-B5AF-0A083E7F0749}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build_projects", "build_projects", "{88278B81-7649-45DC-8A6A-D3A645C5AFC3}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestAssets", "TestAssets", "{ADA7052B-884B-4776-8B8D-D04191D0AA70}" @@ -38,6 +36,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4 build\Compile.targets = build\Compile.targets build\CrossGen.props = build\CrossGen.props build\DependencyVersions.props = build\DependencyVersions.props + build\DerivedHostMachineInfo.props = build\DerivedHostMachineInfo.props build\FileExtensions.props = build\FileExtensions.props build\GitCommitInfo.targets = build\GitCommitInfo.targets build\HostInfo.targets = build\HostInfo.targets @@ -54,12 +53,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4 build\Publish.targets = build\Publish.targets build\RestoreDependency.proj = build\RestoreDependency.proj build\sdks\sdks.csproj = build\sdks\sdks.csproj + build\SetupPreviousStage.props = build\SetupPreviousStage.props build\Signing.proj = build\Signing.proj - build\Stage0.props = build\Stage0.props build\Test.targets = build\Test.targets build\Version.props = build\Version.props - build\VersionBadge.props = build\VersionBadge.props - build\DerivedHostMachineInfo.props = build\DerivedHostMachineInfo.props EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "package", "package", "{FD7D515A-D10F-4F49-B8AE-21CF7ED071AE}" @@ -131,8 +128,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PackageWithFakeNativeDep", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ToolWithOutputName", "TestAssets\TestPackages\ToolWithOutputName\ToolWithOutputName.csproj", "{8FB83810-5A4C-4097-9A79-8E687E4981CB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-archive", "src\dotnet-archive\dotnet-archive.csproj", "{F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet", "src\dotnet\dotnet.csproj", "{203F0362-DAFC-4679-A01E-7FBC331D8647}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Archive", "src\Microsoft.DotNet.Archive\Microsoft.DotNet.Archive.csproj", "{F8C66E8A-FC59-40B3-AC0F-58CA22526F76}" @@ -143,16 +138,12 @@ 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.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}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "tool_msbuild", "src\tool_msbuild\tool_msbuild.csproj", "{D82A3246-9831-4024-A9B2-1932EEF3D56F}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "tool_nuget", "src\tool_nuget\tool_nuget.csproj", "{BE4C655A-DC54-4408-B739-743456D34111}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Archiver", "tools\Archiver\Archiver.csproj", "{2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ArgumentForwardingTests", "test\ArgumentForwardingTests\ArgumentForwardingTests.csproj", "{3E28672F-F4E4-44D5-AEFB-1F425DECC57E}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ArgumentsReflector", "test\ArgumentsReflector\ArgumentsReflector.csproj", "{A5CA696F-585E-40AB-912C-6316BC330C5E}" @@ -197,8 +188,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Tools.Test EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "msbuild.IntegrationTests", "test\msbuild.IntegrationTests\msbuild.IntegrationTests.csproj", "{23EE9BBB-3B33-4CF2-8D1A-29A8DB12E878}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Performance", "test\Performance\Performance.csproj", "{F5E27BA5-063B-4770-A6E8-87252E9AB22C}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Cli.Build.Framework", "build_projects\Microsoft.DotNet.Cli.Build.Framework\Microsoft.DotNet.Cli.Build.Framework.csproj", "{AA744891-5209-4335-8457-37EC347DF833}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "shared-build-targets-utils", "build_projects\shared-build-targets-utils\shared-build-targets-utils.csproj", "{DA3595A8-35DE-42B9-97A4-4A2461BAD554}" @@ -231,6 +220,20 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-add-package.Tests", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "tool_fsc", "src\tool_fsharp\tool_fsc.csproj", "{602976C5-2477-4B4C-AD9A-1EAFB250529A}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.MSBuildSdkResolver", "src\Microsoft.DotNet.MSBuildSdkResolver\Microsoft.DotNet.MSBuildSdkResolver.csproj", "{FCDFAF40-CC16-4D49-96C0-E49F195E7142}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-cli-build.Tests", "build_projects\dotnet-cli-build.Tests\dotnet-cli-build.Tests.csproj", "{84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-restore.Tests", "test\dotnet-restore.Tests\dotnet-restore.Tests.csproj", "{B4EE3671-C103-4A37-8DEB-C74E0134104E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.TestFramework", "test\Microsoft.DotNet.TestFramework\Microsoft.DotNet.TestFramework.csproj", "{44759218-B558-4AF0-8991-515F1100DCF5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Msbuild.Tests.Utilities", "test\Msbuild.Tests.Utilities\Msbuild.Tests.Utilities.csproj", "{E7C72EF2-8480-48B4-AAE8-A596F1A6048E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.ToolPackageObtainer.Tests", "test\Microsoft.DotNet.ToolPackageObtainer.Tests\Microsoft.DotNet.ToolPackageObtainer.Tests.csproj", "{F0D50831-9468-4ACB-8FD8-E9883DD553FB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.ShellShimMaker.Tests", "test\Microsoft.DotNet.ShellShimMaker.Tests\Microsoft.DotNet.ShellShimMaker.Tests.csproj", "{20376E28-68EB-4BE5-81A5-51500F1235E2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -511,30 +514,6 @@ Global {8FB83810-5A4C-4097-9A79-8E687E4981CB}.RelWithDebInfo|x64.Build.0 = Release|Any CPU {8FB83810-5A4C-4097-9A79-8E687E4981CB}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU {8FB83810-5A4C-4097-9A79-8E687E4981CB}.RelWithDebInfo|x86.Build.0 = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.Debug|x64.ActiveCfg = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.Debug|x64.Build.0 = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.Debug|x86.ActiveCfg = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.Debug|x86.Build.0 = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.MinSizeRel|Any CPU.ActiveCfg = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.MinSizeRel|Any CPU.Build.0 = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.MinSizeRel|x64.ActiveCfg = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.MinSizeRel|x64.Build.0 = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.MinSizeRel|x86.ActiveCfg = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.MinSizeRel|x86.Build.0 = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.Release|Any CPU.Build.0 = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.Release|x64.ActiveCfg = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.Release|x64.Build.0 = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.Release|x86.ActiveCfg = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.Release|x86.Build.0 = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.RelWithDebInfo|x64.Build.0 = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D}.RelWithDebInfo|x86.Build.0 = Release|Any CPU {203F0362-DAFC-4679-A01E-7FBC331D8647}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {203F0362-DAFC-4679-A01E-7FBC331D8647}.Debug|Any CPU.Build.0 = Debug|Any CPU {203F0362-DAFC-4679-A01E-7FBC331D8647}.Debug|x64.ActiveCfg = Release|Any CPU @@ -655,30 +634,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 - {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 - {6592A22C-2386-4E83-A4D3-FC08075C723A}.Debug|x64.Build.0 = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.Debug|x86.ActiveCfg = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.Debug|x86.Build.0 = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.MinSizeRel|Any CPU.ActiveCfg = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.MinSizeRel|Any CPU.Build.0 = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.MinSizeRel|x64.ActiveCfg = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.MinSizeRel|x64.Build.0 = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.MinSizeRel|x86.ActiveCfg = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.MinSizeRel|x86.Build.0 = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.Release|Any CPU.Build.0 = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.Release|x64.ActiveCfg = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.Release|x64.Build.0 = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.Release|x86.ActiveCfg = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.Release|x86.Build.0 = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.RelWithDebInfo|x64.Build.0 = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.RelWithDebInfo|x86.Build.0 = Release|Any CPU {098D9321-1201-4974-A75E-F58EBCD98ACF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {098D9321-1201-4974-A75E-F58EBCD98ACF}.Debug|Any CPU.Build.0 = Debug|Any CPU {098D9321-1201-4974-A75E-F58EBCD98ACF}.Debug|x64.ActiveCfg = Release|Any CPU @@ -751,30 +706,6 @@ Global {BE4C655A-DC54-4408-B739-743456D34111}.RelWithDebInfo|x64.Build.0 = Release|Any CPU {BE4C655A-DC54-4408-B739-743456D34111}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU {BE4C655A-DC54-4408-B739-743456D34111}.RelWithDebInfo|x86.Build.0 = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.Debug|x64.ActiveCfg = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.Debug|x64.Build.0 = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.Debug|x86.ActiveCfg = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.Debug|x86.Build.0 = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.MinSizeRel|Any CPU.ActiveCfg = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.MinSizeRel|Any CPU.Build.0 = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.MinSizeRel|x64.ActiveCfg = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.MinSizeRel|x64.Build.0 = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.MinSizeRel|x86.ActiveCfg = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.MinSizeRel|x86.Build.0 = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.Release|Any CPU.Build.0 = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.Release|x64.ActiveCfg = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.Release|x64.Build.0 = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.Release|x86.ActiveCfg = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.Release|x86.Build.0 = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.RelWithDebInfo|x64.Build.0 = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2}.RelWithDebInfo|x86.Build.0 = Release|Any CPU {3E28672F-F4E4-44D5-AEFB-1F425DECC57E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3E28672F-F4E4-44D5-AEFB-1F425DECC57E}.Debug|Any CPU.Build.0 = Debug|Any CPU {3E28672F-F4E4-44D5-AEFB-1F425DECC57E}.Debug|x64.ActiveCfg = Release|Any CPU @@ -1303,30 +1234,6 @@ Global {23EE9BBB-3B33-4CF2-8D1A-29A8DB12E878}.RelWithDebInfo|x64.Build.0 = Release|Any CPU {23EE9BBB-3B33-4CF2-8D1A-29A8DB12E878}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU {23EE9BBB-3B33-4CF2-8D1A-29A8DB12E878}.RelWithDebInfo|x86.Build.0 = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.Debug|x64.ActiveCfg = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.Debug|x64.Build.0 = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.Debug|x86.ActiveCfg = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.Debug|x86.Build.0 = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.MinSizeRel|Any CPU.ActiveCfg = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.MinSizeRel|Any CPU.Build.0 = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.MinSizeRel|x64.ActiveCfg = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.MinSizeRel|x64.Build.0 = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.MinSizeRel|x86.ActiveCfg = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.MinSizeRel|x86.Build.0 = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.Release|Any CPU.Build.0 = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.Release|x64.ActiveCfg = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.Release|x64.Build.0 = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.Release|x86.ActiveCfg = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.Release|x86.Build.0 = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.RelWithDebInfo|x64.Build.0 = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU - {F5E27BA5-063B-4770-A6E8-87252E9AB22C}.RelWithDebInfo|x86.Build.0 = Release|Any CPU {AA744891-5209-4335-8457-37EC347DF833}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AA744891-5209-4335-8457-37EC347DF833}.Debug|Any CPU.Build.0 = Debug|Any CPU {AA744891-5209-4335-8457-37EC347DF833}.Debug|x64.ActiveCfg = Release|Any CPU @@ -1567,6 +1474,198 @@ Global {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 + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.Debug|x64.ActiveCfg = Debug|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.Debug|x64.Build.0 = Debug|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.Debug|x86.ActiveCfg = Debug|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.Debug|x86.Build.0 = Debug|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.MinSizeRel|x86.ActiveCfg = Debug|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.MinSizeRel|x86.Build.0 = Debug|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.Release|Any CPU.Build.0 = Release|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.Release|x64.ActiveCfg = Release|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.Release|x64.Build.0 = Release|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.Release|x86.ActiveCfg = Release|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.Release|x86.Build.0 = Release|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.RelWithDebInfo|x64.Build.0 = Release|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU + {602976C5-2477-4B4C-AD9A-1EAFB250529A}.RelWithDebInfo|x86.Build.0 = Release|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.Debug|x64.ActiveCfg = Debug|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.Debug|x64.Build.0 = Debug|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.Debug|x86.ActiveCfg = Debug|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.Debug|x86.Build.0 = Debug|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.MinSizeRel|Any CPU.ActiveCfg = Release|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.MinSizeRel|Any CPU.Build.0 = Release|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.MinSizeRel|x64.ActiveCfg = Release|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.MinSizeRel|x64.Build.0 = Release|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.MinSizeRel|x86.ActiveCfg = Release|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.MinSizeRel|x86.Build.0 = Release|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.Release|Any CPU.Build.0 = Release|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.Release|x64.ActiveCfg = Release|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.Release|x64.Build.0 = Release|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.Release|x86.ActiveCfg = Release|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.Release|x86.Build.0 = Release|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.RelWithDebInfo|x64.Build.0 = Release|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU + {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.RelWithDebInfo|x86.Build.0 = Release|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Debug|Any CPU.Build.0 = Debug|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Debug|x64.ActiveCfg = Debug|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Debug|x64.Build.0 = Debug|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Debug|x86.ActiveCfg = Debug|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Debug|x86.Build.0 = Debug|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.MinSizeRel|x86.ActiveCfg = Debug|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.MinSizeRel|x86.Build.0 = Debug|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Release|Any CPU.ActiveCfg = Release|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Release|Any CPU.Build.0 = Release|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Release|x64.ActiveCfg = Release|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Release|x64.Build.0 = Release|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Release|x86.ActiveCfg = Release|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Release|x86.Build.0 = Release|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.RelWithDebInfo|x64.Build.0 = Release|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.RelWithDebInfo|x86.Build.0 = Release|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.Debug|x64.ActiveCfg = Debug|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.Debug|x64.Build.0 = Debug|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.Debug|x86.ActiveCfg = Debug|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.Debug|x86.Build.0 = Debug|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.MinSizeRel|x86.ActiveCfg = Debug|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.MinSizeRel|x86.Build.0 = Debug|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.Release|Any CPU.Build.0 = Release|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.Release|x64.ActiveCfg = Release|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.Release|x64.Build.0 = Release|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.Release|x86.ActiveCfg = Release|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.Release|x86.Build.0 = Release|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.RelWithDebInfo|x64.Build.0 = Release|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU + {B4EE3671-C103-4A37-8DEB-C74E0134104E}.RelWithDebInfo|x86.Build.0 = Release|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.Debug|x64.ActiveCfg = Debug|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.Debug|x64.Build.0 = Debug|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.Debug|x86.ActiveCfg = Debug|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.Debug|x86.Build.0 = Debug|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.MinSizeRel|x86.ActiveCfg = Debug|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.MinSizeRel|x86.Build.0 = Debug|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.Release|Any CPU.Build.0 = Release|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.Release|x64.ActiveCfg = Release|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.Release|x64.Build.0 = Release|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.Release|x86.ActiveCfg = Release|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.Release|x86.Build.0 = Release|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.RelWithDebInfo|x64.Build.0 = Release|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU + {44759218-B558-4AF0-8991-515F1100DCF5}.RelWithDebInfo|x86.Build.0 = Release|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.Debug|x64.ActiveCfg = Debug|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.Debug|x64.Build.0 = Debug|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.Debug|x86.ActiveCfg = Debug|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.Debug|x86.Build.0 = Debug|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.MinSizeRel|x86.ActiveCfg = Debug|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.MinSizeRel|x86.Build.0 = Debug|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.Release|Any CPU.Build.0 = Release|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.Release|x64.ActiveCfg = Release|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.Release|x64.Build.0 = Release|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.Release|x86.ActiveCfg = Release|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.Release|x86.Build.0 = Release|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.RelWithDebInfo|x64.Build.0 = Release|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E}.RelWithDebInfo|x86.Build.0 = Release|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.Debug|x64.ActiveCfg = Debug|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.Debug|x64.Build.0 = Debug|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.Debug|x86.ActiveCfg = Debug|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.Debug|x86.Build.0 = Debug|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.MinSizeRel|x86.ActiveCfg = Debug|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.MinSizeRel|x86.Build.0 = Debug|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.Release|Any CPU.Build.0 = Release|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.Release|x64.ActiveCfg = Release|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.Release|x64.Build.0 = Release|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.Release|x86.ActiveCfg = Release|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.Release|x86.Build.0 = Release|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.RelWithDebInfo|x64.Build.0 = Release|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU + {F0D50831-9468-4ACB-8FD8-E9883DD553FB}.RelWithDebInfo|x86.Build.0 = Release|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.Debug|x64.ActiveCfg = Debug|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.Debug|x64.Build.0 = Debug|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.Debug|x86.ActiveCfg = Debug|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.Debug|x86.Build.0 = Debug|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.MinSizeRel|x86.ActiveCfg = Debug|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.MinSizeRel|x86.Build.0 = Debug|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.Release|Any CPU.Build.0 = Release|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.Release|x64.ActiveCfg = Release|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.Release|x64.Build.0 = Release|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.Release|x86.ActiveCfg = Release|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.Release|x86.Build.0 = Release|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.RelWithDebInfo|x64.Build.0 = Release|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU + {20376E28-68EB-4BE5-81A5-51500F1235E2}.RelWithDebInfo|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1591,23 +1690,21 @@ Global {736BF068-7389-41B9-BF63-D4E49B9BC833} = {1AB5B24B-B317-4142-A5D1-A6E84F15BA34} {48408A19-CCC5-4C85-990B-0A9F827BF29A} = {1AB5B24B-B317-4142-A5D1-A6E84F15BA34} {8FB83810-5A4C-4097-9A79-8E687E4981CB} = {1AB5B24B-B317-4142-A5D1-A6E84F15BA34} - {F0CB08B6-2809-4D37-B1DD-A9B7F1B0D95D} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {203F0362-DAFC-4679-A01E-7FBC331D8647} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {F8C66E8A-FC59-40B3-AC0F-58CA22526F76} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {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} - {6592A22C-2386-4E83-A4D3-FC08075C723A} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {098D9321-1201-4974-A75E-F58EBCD98ACF} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {D82A3246-9831-4024-A9B2-1932EEF3D56F} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {BE4C655A-DC54-4408-B739-743456D34111} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} - {2DFCC95F-75F7-46E1-8F56-256DB4CA98B2} = {0722D325-24C8-4E83-B5AF-0A083E7F0749} {3E28672F-F4E4-44D5-AEFB-1F425DECC57E} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} {A5CA696F-585E-40AB-912C-6316BC330C5E} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} {4EF497BF-D717-4E03-90B1-932C7F51B918} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} {18B43540-346F-4AFF-8868-A82CF098FAFD} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} {C3845C85-1F59-4552-BE52-32F513CE795F} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} {BBB5A4C8-CD2D-4A6A-9159-0FEAF84B745E} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} + {8AA88E83-6A98-4AD6-86EB-2ED4F6EDA17F} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} {726D2CB9-80E5-4496-9C86-910AC452C45E} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} {EF745C56-0350-4C42-AA22-86D592E1D8D5} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} {87063BA1-454D-4433-ADF9-89C667275D62} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} @@ -1623,7 +1720,6 @@ Global {F228580D-9373-4A60-AB88-76DF58D11580} = {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} {AA744891-5209-4335-8457-37EC347DF833} = {88278B81-7649-45DC-8A6A-D3A645C5AFC3} {DA3595A8-35DE-42B9-97A4-4A2461BAD554} = {88278B81-7649-45DC-8A6A-D3A645C5AFC3} {F2D1A7DA-B3EB-4CA7-BAA9-A18CEC398853} = {88278B81-7649-45DC-8A6A-D3A645C5AFC3} @@ -1636,5 +1732,16 @@ Global {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} + {602976C5-2477-4B4C-AD9A-1EAFB250529A} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} + {FCDFAF40-CC16-4D49-96C0-E49F195E7142} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} + {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94} = {88278B81-7649-45DC-8A6A-D3A645C5AFC3} + {B4EE3671-C103-4A37-8DEB-C74E0134104E} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} + {44759218-B558-4AF0-8991-515F1100DCF5} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} + {E7C72EF2-8480-48B4-AAE8-A596F1A6048E} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} + {F0D50831-9468-4ACB-8FD8-E9883DD553FB} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} + {20376E28-68EB-4BE5-81A5-51500F1235E2} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B526D2CE-EE2D-4AD4-93EF-1867D90FF1F5} EndGlobalSection EndGlobal diff --git a/README.md b/README.md index e6d7174b4..7be34c7be 100644 --- a/README.md +++ b/README.md @@ -7,14 +7,14 @@ This repo contains the source code for cross-platform [.NET Core](http://github. 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), see https://dot.net/core. +If you are looking for the v2.0 release of the .NET Core tools (CLI, MSBuild and the new csproj), head over to https://dot.net/core and download! -> **Note:** the release/15.5 branch of the CLI repo is based on an upcoming update of the SDK and is considered pre-release. For production-level usage, please use the -> released version of the tools available at https://dot.net/core +> **Note:** the master branch of the CLI repo is based on post-v2.0 of .NET Core and is considered pre-release. For production-level usage, use the +> v2.0 of the tools. Found an issue? --------------- -You can consult the [Documents Index](Documentation/README.md) to find out the current issues and to see the workarounds. +You can consult the [Documents Index](Documentation/README.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,36 +23,27 @@ This project has adopted the code of conduct defined by the [Contributor Covenan Build Status ------------ -|Windows x64 |Windows x86 |Mac OS X |Linux x64 |Ubuntu 14.04 / Linux Mint 17 |Ubuntu 16.04 |Ubuntu 16.10 |Debian 8 |RHEL 7.2 | -|:------:|:------:|:------:|:------:|:------:|:------:|:------:|:------:|:------:| -|[![][win-x64-build-badge]][win-x64-build]|[![][win-x86-build-badge]][win-x86-build]|[![][osx-build-badge]][osx-build]|[![][linux-build-badge]][linux-build]|[![][ubuntu-14.04-build-badge]][ubuntu-14.04-build]|[![][ubuntu-16.04-build-badge]][ubuntu-16.04-build]|[![][ubuntu-16.10-build-badge]][ubuntu-16.10-build]|[![][debian-8-build-badge]][debian-8-build]|[![][rhel-build-badge]][rhel-build]| +|Windows x64 |Windows x86 |macOS |Linux x64 |Linux Native Installers |RHEL 6 Archive| +|:------:|:------:|:------:|:------:|:------:|:------:| +|[![][win-x64-build-badge]][win-x64-build]|[![][win-x86-build-badge]][win-x86-build]|[![][osx-build-badge]][osx-build]|[![][linux-build-badge]][linux-build]|[![][linuxnative-build-badge]][linuxnative-build]|[![][rhel6-build-badge]][rhel6-build]| -[win-x64-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/6786/badge -[win-x64-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=6786 +[win-x64-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/6902/badge +[win-x64-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=6902 -[win-x86-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/6787/badge -[win-x86-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=6787 +[win-x86-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/6901/badge +[win-x86-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=6901 -[osx-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/6781/badge -[osx-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=6781 +[osx-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/6900/badge +[osx-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=6900 -[linux-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/6780/badge -[linux-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=6780 +[linux-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/6899/badge +[linux-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=6899 -[ubuntu-14.04-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/6783/badge -[ubuntu-14.04-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=6783 +[linuxnative-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/7254/badge +[linuxnative-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=7254 -[ubuntu-16.04-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/6784/badge -[ubuntu-16.04-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=6784 - -[ubuntu-16.10-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/6785/badge -[ubuntu-16.10-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=6785 - -[debian-8-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/6778/badge -[debian-8-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=6778 - -[rhel-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/6782/badge -[rhel-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=6782 +[rhel6-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/7392/badge +[rhel6-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=7392 Installers and Binaries ----------------------- @@ -63,24 +54,21 @@ To download the .NET Core runtime **without** the SDK, visit https://github.com/ > **Note:** Be aware that the following installers are the **latest bits**. If you > want to install the latest released versions, check out the [preceding section](#looking-for-v1-of-the-net-core-tooling). +> In order to be able to restore these pre-release packages, you may need to add a NuGet feed pointing to https://dotnet.myget.org/F/dotnet-core/api/v3/index.json. Other feeds may also be necessary depending on what kind of project you are working with. -| Platform | Latest Daily Build
*release/15.5*
[![][version-badge]][version] | +| Platform | Latest Daily Build
*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] | -| **Mac OS X** | [Installer][osx-installer] - [Checksum][osx-installer-checksum]
[tar.gz][osx-targz] - [Checksum][osx-targz-checksum] | +| **macOS** | [Installer][osx-installer] - [Checksum][osx-installer-checksum]
[tar.gz][osx-targz] - [Checksum][osx-targz-checksum] | | **Linux x64** | [tar.gz][linux-targz] - [Checksum][linux-targz-checksum] | | **Ubuntu 14.04 / Linux Mint 17** | [Installer][ubuntu-14.04-installer] - [Checksum][ubuntu-14.04-installer-checksum]
_see installer note below_1
tar.gz - See **Linux x64** | | **Ubuntu 16.04** | [Installer][ubuntu-16.04-installer] - [Checksum][ubuntu-16.04-installer-checksum]
_see installer note below_1
tar.gz - See **Linux x64** | -| **Ubuntu 16.10** | [Installer][ubuntu-16.10-installer] - [Checksum][ubuntu-16.10-installer-checksum]
_see installer note below_1
tar.gz - See **Linux x64** | | **Debian 8** | [Installer][debian-8-installer] - [Checksum][debian-8-installer-checksum]
_see installer note below_1
tar.gz - See **Linux x64** | | **RHEL 7.2** | [Installer][rhel-7-installer] - [Checksum][rhel-7-installer-checksum]
_see installer note below_1
tar.gz - See **Linux x64** | -| **CentOS 7.1 / Oracle Linux 7** | tar.gz - See **Linux x64** | -| **Fedora 24** | tar.gz - See **Linux x64** | -| **OpenSUSE 42.1** | tar.gz - See **Linux x64** | +| **RHEL 6** | [tar.gz][rhel-6-targz] - [Checksum][rhel-6-targz-checksum] | - -| Latest Coherent Build2
*release/15.5* | +| Latest Coherent Build2
*master* | |:------:| | [![][coherent-version-badge]][coherent-version] | @@ -88,44 +76,44 @@ Reference notes: > **1**: *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.* >

**2**: *A 'coherent' build is defined as a build where the Runtime version matches between the CLI and Asp.NET.* +[version]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/latest.version +[coherent-version]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/latest.coherent.version [comment]: # (The latest versions are always the same across all platforms. Just need one to show, so picking win-x64's svg.) -[version]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/15.5/latest.version -[version-badge]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/15.5/win_x64_Release_version_badge.svg -[coherent-version]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/15.5/latest.coherent.version -[coherent-version-badge]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/15.5/win_x86_Release_coherent_badge.svg +[version-badge]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/win_x64_Release_version_badge.svg +[coherent-version-badge]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/win_x64_Release_coherent_badge.svg -[win-x64-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-win-x64.exe -[win-x64-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-win-x64.exe.sha -[win-x64-zip]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-win-x64.zip -[win-x64-zip-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-win-x64.zip.sha +[win-x64-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-win-x64.exe +[win-x64-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-win-x64.exe.sha +[win-x64-zip]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-win-x64.zip +[win-x64-zip-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-win-x64.zip.sha -[win-x86-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-win-x86.exe -[win-x86-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-win-x86.exe.sha -[win-x86-zip]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-win-x86.zip -[win-x86-zip-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-win-x86.zip.sha +[win-x86-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-win-x86.exe +[win-x86-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-win-x86.exe.sha +[win-x86-zip]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-win-x86.zip +[win-x86-zip-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-win-x86.zip.sha -[osx-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-osx-x64.pkg -[osx-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-osx-x64.pkg.sha -[osx-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-osx-x64.tar.gz -[osx-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-osx-x64.tar.gz.sha +[osx-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-osx-x64.pkg +[osx-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-osx-x64.pkg.sha +[osx-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-osx-x64.tar.gz +[osx-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-osx-x64.tar.gz.sha -[linux-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-linux-x64.tar.gz -[linux-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-linux-x64.tar.gz.sha +[linux-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-linux-x64.tar.gz +[linux-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-linux-x64.tar.gz.sha -[ubuntu-14.04-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-ubuntu-x64.deb -[ubuntu-14.04-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-ubuntu-x64.deb.sha +[ubuntu-14.04-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-ubuntu-x64.deb +[ubuntu-14.04-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-ubuntu-x64.deb.sha -[ubuntu-16.04-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-ubuntu.16.04-x64.deb -[ubuntu-16.04-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-ubuntu.16.04-x64.deb.sha +[ubuntu-16.04-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-ubuntu.16.04-x64.deb +[ubuntu-16.04-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-ubuntu.16.04-x64.deb.sha -[ubuntu-16.10-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-ubuntu.16.10-x64.deb -[ubuntu-16.10-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-ubuntu.16.10-x64.deb.sha +[debian-8-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-debian-x64.deb +[debian-8-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-debian-x64.deb.sha -[debian-8-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-debian-x64.deb -[debian-8-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-debian-x64.deb.sha +[rhel-7-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-rhel-x64.rpm +[rhel-7-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-rhel-x64.rpm.sha -[rhel-7-installer]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-rhel-x64.rpm -[rhel-7-installer-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/release/15.5/dotnet-sdk-latest-rhel-x64.rpm.sha +[rhel-6-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-rhel.6-x64.tar.gz +[rhel-6-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-rhel.6-x64.tar.gz.sha # Debian daily feed @@ -152,15 +140,6 @@ sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893 sudo apt-get update ``` -Ubuntu 16.10 -``` -sudo sh -c 'echo "deb [arch=amd64] http://apt-mo.trafficmanager.net/repos/dotnet/ yakkety main" > /etc/apt/sources.list.d/dotnetdev.list' - -sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893 - -sudo apt-get update -``` - Debian 8 ``` sudo sh -c 'echo "deb [arch=amd64] http://apt-mo.trafficmanager.net/repos/dotnet/ jessie main" > /etc/apt/sources.list.d/dotnetdev.list' diff --git a/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/App.csproj b/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/App.csproj index f72d85fc6..331a6e75f 100644 --- a/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/App.csproj +++ b/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/App.csproj @@ -2,10 +2,11 @@ - netcoreapp2.0;net451 + netcoreapp2.1;net451 Exe - $(AssetTargetFallback);portable-net45+win8;dnxcore50 + $(AssetTargetFallback);portable-net45+win8;dnxcore50 win7-x64;win7-x86;osx.10.10-x64;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.24-x64;opensuse.42.1-x64 + $(TEST_PACKAGES) diff --git a/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/NuGet.Config b/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsAndConfig/AppWithRedirectsAndConfig.csproj b/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsAndConfig/AppWithRedirectsAndConfig.csproj index 82a5ad25d..287b089bb 100644 --- a/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsAndConfig/AppWithRedirectsAndConfig.csproj +++ b/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsAndConfig/AppWithRedirectsAndConfig.csproj @@ -4,6 +4,7 @@ AppWithRedirectsAndConfig Exe win7-x64;win7-x86 + $(TEST_PACKAGES) diff --git a/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsNoConfig/AppWithRedirectsNoConfig.csproj b/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsNoConfig/AppWithRedirectsNoConfig.csproj index 94b99d56b..8e5fc172e 100644 --- a/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsNoConfig/AppWithRedirectsNoConfig.csproj +++ b/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsNoConfig/AppWithRedirectsNoConfig.csproj @@ -4,6 +4,7 @@ AppWithRedirectsNoConfig Exe win7-x64;win7-x86 + $(TEST_PACKAGES) diff --git a/TestAssets/DesktopTestProjects/BindingRedirectSample/NuGet.Config b/TestAssets/DesktopTestProjects/BindingRedirectSample/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/DesktopTestProjects/BindingRedirectSample/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/Lib.csproj b/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/Lib.csproj index d57f09629..81bd8b767 100644 --- a/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/Lib.csproj +++ b/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/Lib.csproj @@ -2,7 +2,8 @@ netstandard1.6;net451 Library - $(AssetTargetFallback);portable-net45+win8;dnxcore50;netcoreapp2.0 + $(AssetTargetFallback);portable-net45+win8;dnxcore50;netcoreapp2.1 + $(TEST_PACKAGES) diff --git a/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/NuGet.Config b/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/DesktopTestProjects/MultiTFMXunitProject/XUnitProject/XUnitProject.csproj b/TestAssets/DesktopTestProjects/MultiTFMXunitProject/XUnitProject/XUnitProject.csproj index 2ae7ce025..e11243d4f 100644 --- a/TestAssets/DesktopTestProjects/MultiTFMXunitProject/XUnitProject/XUnitProject.csproj +++ b/TestAssets/DesktopTestProjects/MultiTFMXunitProject/XUnitProject/XUnitProject.csproj @@ -2,7 +2,7 @@ - net461;netcoreapp2.0 + net461;netcoreapp2.1 diff --git a/TestAssets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/MultiTFMTestApp/MultiTFMTestApp.csproj b/TestAssets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/MultiTFMTestApp/MultiTFMTestApp.csproj index cc54ec8ae..465f0e78a 100644 --- a/TestAssets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/MultiTFMTestApp/MultiTFMTestApp.csproj +++ b/TestAssets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/MultiTFMTestApp/MultiTFMTestApp.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.0;net461 + netcoreapp2.1;net461 diff --git a/TestAssets/Directory.Build.props b/TestAssets/Directory.Build.props new file mode 100644 index 000000000..905549edc --- /dev/null +++ b/TestAssets/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/TestAssets/NonRestoredTestProjects/AppThrowingException/AppDependingOnOtherAsTool/AppDependingOnOtherAsTool.csproj b/TestAssets/NonRestoredTestProjects/AppThrowingException/AppDependingOnOtherAsTool/AppDependingOnOtherAsTool.csproj index 30c6823e7..72070fa83 100644 --- a/TestAssets/NonRestoredTestProjects/AppThrowingException/AppDependingOnOtherAsTool/AppDependingOnOtherAsTool.csproj +++ b/TestAssets/NonRestoredTestProjects/AppThrowingException/AppDependingOnOtherAsTool/AppDependingOnOtherAsTool.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/NonRestoredTestProjects/AppWithNonExistingToolDependency/AppWithNonExistingToolDependency.csproj b/TestAssets/NonRestoredTestProjects/AppWithNonExistingToolDependency/AppWithNonExistingToolDependency.csproj index db9d6f117..6edffa788 100644 --- a/TestAssets/NonRestoredTestProjects/AppWithNonExistingToolDependency/AppWithNonExistingToolDependency.csproj +++ b/TestAssets/NonRestoredTestProjects/AppWithNonExistingToolDependency/AppWithNonExistingToolDependency.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Broken/Broken.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Broken/Broken.csproj index 1a79fa49d..75167a0cf 100644 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Broken/Broken.csproj +++ b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Broken/Broken.csproj @@ -1,7 +1,7 @@  Library - net451;netcoreapp2.0 + net451;netcoreapp2.1 diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/EmptyItemGroup/EmptyItemGroup.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/EmptyItemGroup/EmptyItemGroup.csproj index 0bdb79506..930f5ff99 100644 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/EmptyItemGroup/EmptyItemGroup.csproj +++ b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/EmptyItemGroup/EmptyItemGroup.csproj @@ -3,10 +3,10 @@ Library - net451;netcoreapp2.0 + net451;netcoreapp2.1 - + diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Lib/Lib.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Lib/Lib.csproj index 1be153a79..764ed0f1e 100644 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Lib/Lib.csproj +++ b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Lib/Lib.csproj @@ -3,10 +3,10 @@ Library - net451;netcoreapp2.0;netstandard1.4 + net451;netcoreapp2.1;netstandard1.4 - + diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/MoreThanOne/a.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/MoreThanOne/a.csproj index 68b8ed617..527b9151c 100644 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/MoreThanOne/a.csproj +++ b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/MoreThanOne/a.csproj @@ -3,7 +3,7 @@ Library - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/MoreThanOne/b.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/MoreThanOne/b.csproj index 68b8ed617..527b9151c 100644 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/MoreThanOne/b.csproj +++ b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/MoreThanOne/b.csproj @@ -3,7 +3,7 @@ Library - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Net452AndNetCoreApp10Lib/Net452AndNetCoreApp10Lib.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Net452AndNetCoreApp10Lib/Net452AndNetCoreApp10Lib.csproj index e11e31084..799473702 100644 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Net452AndNetCoreApp10Lib/Net452AndNetCoreApp10Lib.csproj +++ b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Net452AndNetCoreApp10Lib/Net452AndNetCoreApp10Lib.csproj @@ -3,9 +3,9 @@ Library - net452;netcoreapp2.0 + net452;netcoreapp2.1 - + diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/ValidRef/ValidRef.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/ValidRef/ValidRef.csproj index 0fc35d3d8..6ec6e04f2 100644 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/ValidRef/ValidRef.csproj +++ b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/ValidRef/ValidRef.csproj @@ -5,7 +5,7 @@ Library net451;netcoreapp1.0;netstandard1.4 - + diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithDoubledRef/WithDoubledRef.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithDoubledRef/WithDoubledRef.csproj index f33aa7821..8fb413a56 100644 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithDoubledRef/WithDoubledRef.csproj +++ b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithDoubledRef/WithDoubledRef.csproj @@ -5,7 +5,7 @@ Library net451;netcoreapp1.0 - + diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondOnItem/WithExistingRefCondOnItem.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondOnItem/WithExistingRefCondOnItem.csproj index 8747ed6b7..b16235d3b 100644 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondOnItem/WithExistingRefCondOnItem.csproj +++ b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondOnItem/WithExistingRefCondOnItem.csproj @@ -5,7 +5,7 @@ Library net451;netcoreapp1.0 - + diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondWhitespaces/WithExistingRefCondWhitespaces.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondWhitespaces/WithExistingRefCondWhitespaces.csproj index 0b2792110..a552074b8 100644 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondWhitespaces/WithExistingRefCondWhitespaces.csproj +++ b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondWhitespaces/WithExistingRefCondWhitespaces.csproj @@ -5,7 +5,7 @@ Library net451;netcoreapp1.0 - + diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithRefNoCondNonUniform/WithRefNoCondNonUniform.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithRefNoCondNonUniform/WithRefNoCondNonUniform.csproj index 328fc5fb1..8c75a39c3 100644 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithRefNoCondNonUniform/WithRefNoCondNonUniform.csproj +++ b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithRefNoCondNonUniform/WithRefNoCondNonUniform.csproj @@ -5,7 +5,7 @@ Library net451;netcoreapp1.0 - + diff --git a/TestAssets/NonRestoredTestProjects/PJHalfMigrated/src/ProjectA/ProjectA.csproj b/TestAssets/NonRestoredTestProjects/PJHalfMigrated/src/ProjectA/ProjectA.csproj index 915cb3e07..165e565c0 100755 --- a/TestAssets/NonRestoredTestProjects/PJHalfMigrated/src/ProjectA/ProjectA.csproj +++ b/TestAssets/NonRestoredTestProjects/PJHalfMigrated/src/ProjectA/ProjectA.csproj @@ -1,7 +1,7 @@  - netcoreapp2.0 + netcoreapp2.1 portable ProjectA Exe diff --git a/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedPlatformDependency/TestProjectWithUnresolvedPlatformDependency.csproj b/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedPlatformDependency/TestProjectWithUnresolvedPlatformDependency.csproj index 261918eb3..b93e3b384 100755 --- a/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedPlatformDependency/TestProjectWithUnresolvedPlatformDependency.csproj +++ b/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedPlatformDependency/TestProjectWithUnresolvedPlatformDependency.csproj @@ -1,8 +1,8 @@  - netcoreapp2.0 + netcoreapp2.1 Exe - $(AssetTargetFallback);dnxcore50 + $(AssetTargetFallback);dnxcore50 diff --git a/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/AppWithDepOnTool/AppWithDepOnTool.csproj b/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/AppWithDepOnTool/AppWithDepOnTool.csproj index f5ab2f51a..366b7f409 100644 --- a/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/AppWithDepOnTool/AppWithDepOnTool.csproj +++ b/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/AppWithDepOnTool/AppWithDepOnTool.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 random-name diff --git a/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/ToolWithRandomPackageName/ToolWithRandomPackageName.csproj b/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/ToolWithRandomPackageName/ToolWithRandomPackageName.csproj index 9184414e8..145d47d10 100644 --- a/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/ToolWithRandomPackageName/ToolWithRandomPackageName.csproj +++ b/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/ToolWithRandomPackageName/ToolWithRandomPackageName.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 random-name $(GeneratedPackageId) dotnet-randompackage diff --git a/TestAssets/TestPackages/NuGet.Config b/TestAssets/TestPackages/NuGet.Config deleted file mode 100644 index 0750578cb..000000000 --- a/TestAssets/TestPackages/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestPackages/ToolWithOutputName/ToolWithOutputName.csproj b/TestAssets/TestPackages/ToolWithOutputName/ToolWithOutputName.csproj index 6c57ebe5d..c237cd483 100644 --- a/TestAssets/TestPackages/ToolWithOutputName/ToolWithOutputName.csproj +++ b/TestAssets/TestPackages/ToolWithOutputName/ToolWithOutputName.csproj @@ -2,7 +2,7 @@ - netcoreapp2.0 + netcoreapp2.1 dotnet-tool-with-output-name ToolWithOutputName Exe diff --git a/TestAssets/TestPackages/dotnet-dependency-context-test/dotnet-dependency-context-test.csproj b/TestAssets/TestPackages/dotnet-dependency-context-test/dotnet-dependency-context-test.csproj index 97e20d00d..57417fb03 100644 --- a/TestAssets/TestPackages/dotnet-dependency-context-test/dotnet-dependency-context-test.csproj +++ b/TestAssets/TestPackages/dotnet-dependency-context-test/dotnet-dependency-context-test.csproj @@ -3,7 +3,7 @@ 1.0.0-rc - netcoreapp2.0 + netcoreapp2.1 Exe 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 a6c5b91c1..38e6c9213 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 @@ -6,7 +6,7 @@ 1.0.0-rc - netcoreapp2.0 + netcoreapp2.1 Exe false diff --git a/TestAssets/TestPackages/dotnet-desktop-binding-redirects/dotnet-desktop-binding-redirects.csproj b/TestAssets/TestPackages/dotnet-desktop-binding-redirects/dotnet-desktop-binding-redirects.csproj index 4505fc5a0..f77a56e08 100644 --- a/TestAssets/TestPackages/dotnet-desktop-binding-redirects/dotnet-desktop-binding-redirects.csproj +++ b/TestAssets/TestPackages/dotnet-desktop-binding-redirects/dotnet-desktop-binding-redirects.csproj @@ -9,7 +9,7 @@ - + diff --git a/TestAssets/TestPackages/dotnet-fallbackfoldertool/dotnet-fallbackfoldertool.csproj b/TestAssets/TestPackages/dotnet-fallbackfoldertool/dotnet-fallbackfoldertool.csproj index 35e92a2bb..9e29a16a7 100644 --- a/TestAssets/TestPackages/dotnet-fallbackfoldertool/dotnet-fallbackfoldertool.csproj +++ b/TestAssets/TestPackages/dotnet-fallbackfoldertool/dotnet-fallbackfoldertool.csproj @@ -2,7 +2,7 @@ - netcoreapp2.0 + netcoreapp2.1 dotnet-fallbackfoldertool Exe diff --git a/TestAssets/TestPackages/dotnet-hello/v1/dotnet-hello/dotnet-hello.csproj b/TestAssets/TestPackages/dotnet-hello/v1/dotnet-hello/dotnet-hello.csproj index fd5621f08..4ff2b8d00 100644 --- a/TestAssets/TestPackages/dotnet-hello/v1/dotnet-hello/dotnet-hello.csproj +++ b/TestAssets/TestPackages/dotnet-hello/v1/dotnet-hello/dotnet-hello.csproj @@ -5,7 +5,7 @@ 1.0.0 - netcoreapp2.0 + netcoreapp2.1 dotnet-hello Exe win7-x64;win7-x86;osx.10.10-x64;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.24-x64;opensuse.42.1-x64 diff --git a/TestAssets/TestPackages/dotnet-hello/v2/dotnet-hello/dotnet-hello.csproj b/TestAssets/TestPackages/dotnet-hello/v2/dotnet-hello/dotnet-hello.csproj index 2391dfc1b..7e4bc54d0 100644 --- a/TestAssets/TestPackages/dotnet-hello/v2/dotnet-hello/dotnet-hello.csproj +++ b/TestAssets/TestPackages/dotnet-hello/v2/dotnet-hello/dotnet-hello.csproj @@ -5,7 +5,7 @@ 2.0.0 - netcoreapp2.0 + netcoreapp2.1 dotnet-hello Exe win7-x64;win7-x86;osx.10.10-x64;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.24-x64;opensuse.42.1-x64 diff --git a/TestAssets/TestPackages/dotnet-portable/dotnet-portable.csproj b/TestAssets/TestPackages/dotnet-portable/dotnet-portable.csproj index bc2925f73..70f8b0dde 100644 --- a/TestAssets/TestPackages/dotnet-portable/dotnet-portable.csproj +++ b/TestAssets/TestPackages/dotnet-portable/dotnet-portable.csproj @@ -2,7 +2,7 @@ - netcoreapp2.0 + netcoreapp2.1 Exe diff --git a/TestAssets/TestPackages/dotnet-prefercliruntime/dotnet-prefercliruntime.csproj b/TestAssets/TestPackages/dotnet-prefercliruntime/dotnet-prefercliruntime.csproj index 21eb0a6d1..1a4ab4176 100644 --- a/TestAssets/TestPackages/dotnet-prefercliruntime/dotnet-prefercliruntime.csproj +++ b/TestAssets/TestPackages/dotnet-prefercliruntime/dotnet-prefercliruntime.csproj @@ -2,7 +2,7 @@ - netcoreapp2.0 + netcoreapp2.1 Exe diff --git a/TestAssets/TestProjects/11TestAppWith10CLIToolReferences/11TestAppWith10CLIToolReferences.csproj b/TestAssets/TestProjects/11TestAppWith10CLIToolReferences/11TestAppWith10CLIToolReferences.csproj index 6dd25f7f6..c15ae1a16 100644 --- a/TestAssets/TestProjects/11TestAppWith10CLIToolReferences/11TestAppWith10CLIToolReferences.csproj +++ b/TestAssets/TestProjects/11TestAppWith10CLIToolReferences/11TestAppWith10CLIToolReferences.csproj @@ -4,6 +4,7 @@ Exe netcoreapp1.1 + $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/11TestAppWith10CLIToolReferences/NuGet.Config b/TestAssets/TestProjects/11TestAppWith10CLIToolReferences/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/TestProjects/11TestAppWith10CLIToolReferences/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/AppWithCorruptedLaunchSettings/AppWithCorruptedLaunchSettings.csproj b/TestAssets/TestProjects/AppWithCorruptedLaunchSettings/AppWithCorruptedLaunchSettings.csproj index 45a048433..fce4c7b68 100644 --- a/TestAssets/TestProjects/AppWithCorruptedLaunchSettings/AppWithCorruptedLaunchSettings.csproj +++ b/TestAssets/TestProjects/AppWithCorruptedLaunchSettings/AppWithCorruptedLaunchSettings.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 - win7-x64;win7-x86;osx.10.12-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64;opensuse.42.1-x64 + netcoreapp2.1 + win7-x64;win7-x86;osx.10.12-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;rhel.6-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64;opensuse.42.1-x64 diff --git a/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/AppWithDepOnToolWithOutputName.csproj b/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/AppWithDepOnToolWithOutputName.csproj index 9adf4c6fc..4ea5be23c 100755 --- a/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/AppWithDepOnToolWithOutputName.csproj +++ b/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/AppWithDepOnToolWithOutputName.csproj @@ -2,8 +2,9 @@ - netcoreapp2.0 + netcoreapp2.1 Exe + $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/NuGet.Config b/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj b/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj index df284421b..afcfb340e 100755 --- a/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj +++ b/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj @@ -2,8 +2,9 @@ - netcoreapp2.0 + netcoreapp2.1 Exe + $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/AppWithDirectAndToolDep/NuGet.Config b/TestAssets/TestProjects/AppWithDirectAndToolDep/NuGet.Config deleted file mode 100644 index dd7ccd7af..000000000 --- a/TestAssets/TestProjects/AppWithDirectAndToolDep/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj b/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj index 6995199ee..5b5c0f757 100755 --- a/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj +++ b/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj @@ -3,10 +3,11 @@ 1.0.0 - netcoreapp2.0 + netcoreapp2.1 AppWithDirectDep Exe false + $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/AppWithDirectDep/NuGet.Config b/TestAssets/TestProjects/AppWithDirectDep/NuGet.Config deleted file mode 100644 index dd7ccd7af..000000000 --- a/TestAssets/TestProjects/AppWithDirectDep/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/AppWithDirectDepWithOutputName/AppWithDirectDepWithOutputName.csproj b/TestAssets/TestProjects/AppWithDirectDepWithOutputName/AppWithDirectDepWithOutputName.csproj index 5afb24921..4eef16036 100755 --- a/TestAssets/TestProjects/AppWithDirectDepWithOutputName/AppWithDirectDepWithOutputName.csproj +++ b/TestAssets/TestProjects/AppWithDirectDepWithOutputName/AppWithDirectDepWithOutputName.csproj @@ -2,8 +2,9 @@ - netcoreapp2.0 + netcoreapp2.1 Exe + $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/AppWithDirectDepWithOutputName/NuGet.Config b/TestAssets/TestProjects/AppWithDirectDepWithOutputName/NuGet.Config deleted file mode 100644 index 4da396ac8..000000000 --- a/TestAssets/TestProjects/AppWithDirectDepWithOutputName/NuGet.Config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/AppWithFallbackFolderToolDependency.csproj b/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/AppWithFallbackFolderToolDependency.csproj index 705cf2077..76195b1ca 100755 --- a/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/AppWithFallbackFolderToolDependency.csproj +++ b/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/AppWithFallbackFolderToolDependency.csproj @@ -2,8 +2,9 @@ - netcoreapp2.0 + netcoreapp2.1 Exe + $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/NuGet.Config b/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/AppWithLaunchSettings/AppWithLaunchSettings.csproj b/TestAssets/TestProjects/AppWithLaunchSettings/AppWithLaunchSettings.csproj index 45a048433..fce4c7b68 100644 --- a/TestAssets/TestProjects/AppWithLaunchSettings/AppWithLaunchSettings.csproj +++ b/TestAssets/TestProjects/AppWithLaunchSettings/AppWithLaunchSettings.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 - win7-x64;win7-x86;osx.10.12-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64;opensuse.42.1-x64 + netcoreapp2.1 + win7-x64;win7-x86;osx.10.12-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;rhel.6-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64;opensuse.42.1-x64 diff --git a/TestAssets/TestProjects/AppWithLaunchSettingsNoDefault/AppWithLaunchSettingsNoDefault.csproj b/TestAssets/TestProjects/AppWithLaunchSettingsNoDefault/AppWithLaunchSettingsNoDefault.csproj index 45a048433..fce4c7b68 100644 --- a/TestAssets/TestProjects/AppWithLaunchSettingsNoDefault/AppWithLaunchSettingsNoDefault.csproj +++ b/TestAssets/TestProjects/AppWithLaunchSettingsNoDefault/AppWithLaunchSettingsNoDefault.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 - win7-x64;win7-x86;osx.10.12-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64;opensuse.42.1-x64 + netcoreapp2.1 + win7-x64;win7-x86;osx.10.12-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;rhel.6-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64;opensuse.42.1-x64 diff --git a/TestAssets/TestProjects/AppWithMultipleFxAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj b/TestAssets/TestProjects/AppWithMultipleFxAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj index 33cb2b5a7..abda3b8a9 100644 --- a/TestAssets/TestProjects/AppWithMultipleFxAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj +++ b/TestAssets/TestProjects/AppWithMultipleFxAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj @@ -3,13 +3,14 @@ Exe - net451;netcoreapp2.0 + net451;netcoreapp2.1 + $(TEST_PACKAGES) - + diff --git a/TestAssets/TestProjects/AppWithMultipleFxAndTools/NuGet.Config b/TestAssets/TestProjects/AppWithMultipleFxAndTools/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/TestProjects/AppWithMultipleFxAndTools/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/AppWithToolDependency/AppWithToolDependency.csproj b/TestAssets/TestProjects/AppWithToolDependency/AppWithToolDependency.csproj index 7f9c16848..a18ee9852 100755 --- a/TestAssets/TestProjects/AppWithToolDependency/AppWithToolDependency.csproj +++ b/TestAssets/TestProjects/AppWithToolDependency/AppWithToolDependency.csproj @@ -2,8 +2,9 @@ - netcoreapp2.0 + netcoreapp2.1 Exe + $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/AppWithToolDependency/NuGet.Config b/TestAssets/TestProjects/AppWithToolDependency/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/TestProjects/AppWithToolDependency/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/DependencyContextFromTool/DependencyContextFromTool.csproj b/TestAssets/TestProjects/DependencyContextFromTool/DependencyContextFromTool.csproj index 9c5447b05..2de1535e2 100755 --- a/TestAssets/TestProjects/DependencyContextFromTool/DependencyContextFromTool.csproj +++ b/TestAssets/TestProjects/DependencyContextFromTool/DependencyContextFromTool.csproj @@ -3,11 +3,12 @@ 1.0.0 - netcoreapp2.0 + netcoreapp2.1 DependencyContextFromTool Exe false $(AssetTargetFallback);dnxcore50;portable-net45+win8 + $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/DependencyContextFromTool/NuGet.Config b/TestAssets/TestProjects/DependencyContextFromTool/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/TestProjects/DependencyContextFromTool/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/FSharpTestAppSimple/TestAppSimple.fsproj b/TestAssets/TestProjects/FSharpTestAppSimple/TestAppSimple.fsproj index 1af08f3b6..7c81fcb9c 100644 --- a/TestAssets/TestProjects/FSharpTestAppSimple/TestAppSimple.fsproj +++ b/TestAssets/TestProjects/FSharpTestAppSimple/TestAppSimple.fsproj @@ -2,7 +2,7 @@ - netcoreapp2.0 + netcoreapp2.1 Exe true diff --git a/TestAssets/TestProjects/MSBuildAppWithMultipleFrameworks/MSBuildAppWithMultipleFrameworks.csproj b/TestAssets/TestProjects/MSBuildAppWithMultipleFrameworks/MSBuildAppWithMultipleFrameworks.csproj index 89aae6c65..4ef98259b 100644 --- a/TestAssets/TestProjects/MSBuildAppWithMultipleFrameworks/MSBuildAppWithMultipleFrameworks.csproj +++ b/TestAssets/TestProjects/MSBuildAppWithMultipleFrameworks/MSBuildAppWithMultipleFrameworks.csproj @@ -3,7 +3,7 @@ Exe - net451;netcoreapp2.0 + net451;netcoreapp2.1 \ No newline at end of file diff --git a/TestAssets/TestProjects/MSBuildAppWithMultipleFrameworksAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj b/TestAssets/TestProjects/MSBuildAppWithMultipleFrameworksAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj index 766c1ae66..a3aea4813 100644 --- a/TestAssets/TestProjects/MSBuildAppWithMultipleFrameworksAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj +++ b/TestAssets/TestProjects/MSBuildAppWithMultipleFrameworksAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj @@ -3,13 +3,13 @@ Exe - net451;netcoreapp2.0 + net451;netcoreapp2.1 - + diff --git a/TestAssets/TestProjects/MSBuildTestApp/MSBuildTestApp.csproj b/TestAssets/TestProjects/MSBuildTestApp/MSBuildTestApp.csproj index 79bceb82d..58e9e4b5b 100644 --- a/TestAssets/TestProjects/MSBuildTestApp/MSBuildTestApp.csproj +++ b/TestAssets/TestProjects/MSBuildTestApp/MSBuildTestApp.csproj @@ -3,8 +3,9 @@ Exe - netcoreapp2.0 - win7-x64;win7-x86;osx.10.12-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64;opensuse.42.1-x64 + netcoreapp2.1 + win7-x64;win7-x86;osx.10.12-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;rhel.6-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64;opensuse.42.1-x64 + $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/MSBuildTestApp/NuGet.Config b/TestAssets/TestProjects/MSBuildTestApp/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/TestProjects/MSBuildTestApp/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/MultiDependentProject/MultiDependentProject.csproj b/TestAssets/TestProjects/MultiDependentProject/MultiDependentProject.csproj index 8437d1b6d..9d52a2484 100644 --- a/TestAssets/TestProjects/MultiDependentProject/MultiDependentProject.csproj +++ b/TestAssets/TestProjects/MultiDependentProject/MultiDependentProject.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/TestProjects/NewtonSoftDependentProject/NewtonSoftDependentProject.csproj b/TestAssets/TestProjects/NewtonSoftDependentProject/NewtonSoftDependentProject.csproj index 48bba3bea..cff7d9c45 100644 --- a/TestAssets/TestProjects/NewtonSoftDependentProject/NewtonSoftDependentProject.csproj +++ b/TestAssets/TestProjects/NewtonSoftDependentProject/NewtonSoftDependentProject.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/TestProjects/NuGet.Config b/TestAssets/TestProjects/NuGet.Config deleted file mode 100644 index b03d4d16c..000000000 --- a/TestAssets/TestProjects/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/NuGetConfigDependentProject/NuGetConfigDependentProject.csproj b/TestAssets/TestProjects/NuGetConfigDependentProject/NuGetConfigDependentProject.csproj index fd76d5489..340e58180 100644 --- a/TestAssets/TestProjects/NuGetConfigDependentProject/NuGetConfigDependentProject.csproj +++ b/TestAssets/TestProjects/NuGetConfigDependentProject/NuGetConfigDependentProject.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/TestProjects/TestAppSimple/TestAppSimple.csproj b/TestAssets/TestProjects/TestAppSimple/TestAppSimple.csproj index e9f02f323..f99d38872 100755 --- a/TestAssets/TestProjects/TestAppSimple/TestAppSimple.csproj +++ b/TestAssets/TestProjects/TestAppSimple/TestAppSimple.csproj @@ -2,7 +2,7 @@ - netcoreapp2.0 + netcoreapp2.1 Exe true diff --git a/TestAssets/TestProjects/TestAppWithEmptySln/App/App.csproj b/TestAssets/TestProjects/TestAppWithEmptySln/App/App.csproj index ce5bf06cb..a4eeac8a4 100644 --- a/TestAssets/TestProjects/TestAppWithEmptySln/App/App.csproj +++ b/TestAssets/TestProjects/TestAppWithEmptySln/App/App.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/TestProjects/TestAppWithMultipleSlnFiles/App/App.csproj b/TestAssets/TestProjects/TestAppWithMultipleSlnFiles/App/App.csproj index 7a2163613..45701ff71 100644 --- a/TestAssets/TestProjects/TestAppWithMultipleSlnFiles/App/App.csproj +++ b/TestAssets/TestProjects/TestAppWithMultipleSlnFiles/App/App.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/TestProjects/TestAppWithProjDepTool/NuGet.Config b/TestAssets/TestProjects/TestAppWithProjDepTool/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/TestProjects/TestAppWithProjDepTool/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithProjDepTool/TestAppWithProjDepTool.csproj b/TestAssets/TestProjects/TestAppWithProjDepTool/TestAppWithProjDepTool.csproj index 3f8176791..b4e6c9844 100644 --- a/TestAssets/TestProjects/TestAppWithProjDepTool/TestAppWithProjDepTool.csproj +++ b/TestAssets/TestProjects/TestAppWithProjDepTool/TestAppWithProjDepTool.csproj @@ -3,7 +3,8 @@ Exe - netcoreapp2.0 + netcoreapp2.1 + $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/App/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/App/App.csproj index 3a31eb5bf..358a47d7c 100644 --- a/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/App/App.csproj +++ b/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/App/App.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/App/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/App/App.csproj index ce5bf06cb..a4eeac8a4 100644 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/App/App.csproj +++ b/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/App/App.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDir/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDir/App.csproj index 92f102c88..1fed155a1 100644 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDir/App.csproj +++ b/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDir/App.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDirToRemove/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDirToRemove/App.csproj index abea1bc3d..5ba5d5bac 100644 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDirToRemove/App.csproj +++ b/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDirToRemove/App.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojProjectGuidFiles/App/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCsprojProjectGuidFiles/App/App.csproj index ce5bf06cb..a4eeac8a4 100644 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojProjectGuidFiles/App/App.csproj +++ b/TestAssets/TestProjects/TestAppWithSlnAndCsprojProjectGuidFiles/App/App.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/App/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/App/App.csproj index 7a2163613..45701ff71 100644 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/App/App.csproj +++ b/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/App/App.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/TestProjects/TestAppWithSlnAndDuplicateProjectReferences/App/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndDuplicateProjectReferences/App/App.csproj index ce5bf06cb..a4eeac8a4 100644 --- a/TestAssets/TestProjects/TestAppWithSlnAndDuplicateProjectReferences/App/App.csproj +++ b/TestAssets/TestProjects/TestAppWithSlnAndDuplicateProjectReferences/App/App.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferences/App/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferences/App/App.csproj index 21cce6681..5469ce225 100644 --- a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferences/App/App.csproj +++ b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferences/App/App.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App/App.csproj index 21cce6681..5469ce225 100644 --- a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App/App.csproj +++ b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App/App.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/TestProjects/TestAppWithSlnAndLastCsprojInSubDirToRemove/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndLastCsprojInSubDirToRemove/App.csproj index abea1bc3d..5ba5d5bac 100644 --- a/TestAssets/TestProjects/TestAppWithSlnAndLastCsprojInSubDirToRemove/App.csproj +++ b/TestAssets/TestProjects/TestAppWithSlnAndLastCsprojInSubDirToRemove/App.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/TestProjects/TestAppWithSlnAndSolutionFolders/src/App/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndSolutionFolders/src/App/App.csproj index 3a31eb5bf..358a47d7c 100644 --- a/TestAssets/TestProjects/TestAppWithSlnAndSolutionFolders/src/App/App.csproj +++ b/TestAssets/TestProjects/TestAppWithSlnAndSolutionFolders/src/App/App.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/App.sln b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/App.sln new file mode 100644 index 000000000..97c495544 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/App.sln @@ -0,0 +1,44 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27110.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "App", "App\App.csproj", "{BB02B949-F6BD-4872-95CB-96A05B1FE026}" + ProjectSection(ProjectDependencies) = postProject + {4E952B56-841D-461D-89A9-7977DDCC0625} = {4E952B56-841D-461D-89A9-7977DDCC0625} + {D53E177A-8ECF-43D5-A01E-98B884D53CA6} = {D53E177A-8ECF-43D5-A01E-98B884D53CA6} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "First", "First\First.csproj", "{D53E177A-8ECF-43D5-A01E-98B884D53CA6}" + ProjectSection(ProjectDependencies) = postProject + {4E952B56-841D-461D-89A9-7977DDCC0625} = {4E952B56-841D-461D-89A9-7977DDCC0625} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Second", "Second\Second.csproj", "{4E952B56-841D-461D-89A9-7977DDCC0625}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BB02B949-F6BD-4872-95CB-96A05B1FE026}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BB02B949-F6BD-4872-95CB-96A05B1FE026}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BB02B949-F6BD-4872-95CB-96A05B1FE026}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BB02B949-F6BD-4872-95CB-96A05B1FE026}.Release|Any CPU.Build.0 = Release|Any CPU + {D53E177A-8ECF-43D5-A01E-98B884D53CA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D53E177A-8ECF-43D5-A01E-98B884D53CA6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D53E177A-8ECF-43D5-A01E-98B884D53CA6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D53E177A-8ECF-43D5-A01E-98B884D53CA6}.Release|Any CPU.Build.0 = Release|Any CPU + {4E952B56-841D-461D-89A9-7977DDCC0625}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4E952B56-841D-461D-89A9-7977DDCC0625}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4E952B56-841D-461D-89A9-7977DDCC0625}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4E952B56-841D-461D-89A9-7977DDCC0625}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F6D9A973-1CFD-41C9-84F2-1471C0FE67DF} + EndGlobalSection +EndGlobal diff --git a/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/App/App.csproj b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/App/App.csproj new file mode 100644 index 000000000..ce1697ae8 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/App/App.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp2.0 + + + diff --git a/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/App/Program.cs b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/App/Program.cs new file mode 100644 index 000000000..be4278310 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/App/Program.cs @@ -0,0 +1,12 @@ +using System; + +namespace App +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + } + } +} diff --git a/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/First/Class1.cs b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/First/Class1.cs new file mode 100644 index 000000000..3a358f6f2 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/First/Class1.cs @@ -0,0 +1,8 @@ +using System; + +namespace First +{ + public class Class1 + { + } +} diff --git a/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/First/First.csproj b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/First/First.csproj new file mode 100644 index 000000000..9f5c4f4ab --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/First/First.csproj @@ -0,0 +1,7 @@ + + + + netstandard2.0 + + + diff --git a/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/Second/Class1.cs b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/Second/Class1.cs new file mode 100644 index 000000000..a39ee63c8 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/Second/Class1.cs @@ -0,0 +1,8 @@ +using System; + +namespace Second +{ + public class Class1 + { + } +} diff --git a/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/Second/Second.csproj b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/Second/Second.csproj new file mode 100644 index 000000000..9f5c4f4ab --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/Second/Second.csproj @@ -0,0 +1,7 @@ + + + + netstandard2.0 + + + diff --git a/TestAssets/TestProjects/VBTestApp/VBTestApp.vbproj b/TestAssets/TestProjects/VBTestApp/VBTestApp.vbproj index ce1697ae8..23df6047f 100644 --- a/TestAssets/TestProjects/VBTestApp/VBTestApp.vbproj +++ b/TestAssets/TestProjects/VBTestApp/VBTestApp.vbproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/TestProjects/VSTestCore/VSTestCore.csproj b/TestAssets/TestProjects/VSTestCore/VSTestCore.csproj index 0d07738af..87c96e9b2 100644 --- a/TestAssets/TestProjects/VSTestCore/VSTestCore.csproj +++ b/TestAssets/TestProjects/VSTestCore/VSTestCore.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/TestProjects/VSTestMulti/VSTestDesktopAndNetCore.csproj b/TestAssets/TestProjects/VSTestMulti/VSTestDesktopAndNetCore.csproj index 1a8fb8e53..1311e72ea 100644 --- a/TestAssets/TestProjects/VSTestMulti/VSTestDesktopAndNetCore.csproj +++ b/TestAssets/TestProjects/VSTestMulti/VSTestDesktopAndNetCore.csproj @@ -2,7 +2,7 @@ - net46;netcoreapp2.0 + net46;netcoreapp2.1 diff --git a/TestAssets/TestProjects/XunitCore/XunitCore.csproj b/TestAssets/TestProjects/XunitCore/XunitCore.csproj index d6016beea..f2721a220 100644 --- a/TestAssets/TestProjects/XunitCore/XunitCore.csproj +++ b/TestAssets/TestProjects/XunitCore/XunitCore.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/TestAssets/TestProjects/XunitMulti/VSTestXunitDesktopAndNetCore.csproj b/TestAssets/TestProjects/XunitMulti/VSTestXunitDesktopAndNetCore.csproj index 3c971a5e9..350f2c991 100644 --- a/TestAssets/TestProjects/XunitMulti/VSTestXunitDesktopAndNetCore.csproj +++ b/TestAssets/TestProjects/XunitMulti/VSTestXunitDesktopAndNetCore.csproj @@ -2,7 +2,7 @@ - net46;netcoreapp2.0 + net46;netcoreapp2.1 win7-x86 win7-x86 @@ -11,7 +11,7 @@ DESKTOP;$(DefineConstants) - + diff --git a/TestAssets/TestProjects/global.json b/TestAssets/TestProjects/global.json deleted file mode 100644 index 09f20328d..000000000 --- a/TestAssets/TestProjects/global.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "projects": [ ".", "../../src" ] -} \ No newline at end of file diff --git a/build.proj b/build.proj index 85de07477..94babcb75 100644 --- a/build.proj +++ b/build.proj @@ -1,6 +1,6 @@ - + @@ -20,7 +20,7 @@ DependsOnTargets="MSBuildWorkaroundTarget; RestoreDotnetCliBuildFramework"> - @@ -40,7 +40,7 @@ $(ExtraRestoreArgs) --disable-parallel - @@ -52,6 +52,7 @@ + diff --git a/build.sh b/build.sh index 2177e91b7..99a136aa7 100755 --- a/build.sh +++ b/build.sh @@ -24,7 +24,7 @@ if [ -z "$HOME" ]; then mkdir -p $HOME fi -args=( "$@" ) +args= while [[ $# > 0 ]]; do lowerI="$(echo $1 | awk '{print tolower($0)}')" @@ -32,23 +32,15 @@ while [[ $# > 0 ]]; do --docker) export BUILD_IN_DOCKER=1 export DOCKER_IMAGENAME=$2 - # remove docker args - args=( "${args[@]/$1}" ) - args=( "${args[@]/$2}" ) shift ;; *) + args="$args $1" + ;; esac shift 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 -# -test "hello world" will be broken into three arguments instead of two, as it should. -temp="${args[@]}" -args=($temp) - dockerbuild() { BUILD_COMMAND=/opt/code/run-build.sh $DIR/scripts/dockerrun.sh --non-interactive "$@" @@ -56,7 +48,7 @@ dockerbuild() # Check if we need to build in docker if [ ! -z "$BUILD_IN_DOCKER" ]; then - dockerbuild "${args[@]}" + dockerbuild $args else - $DIR/run-build.sh "${args[@]}" + $DIR/run-build.sh $args fi diff --git a/build/AzureInfo.props b/build/AzureInfo.props index 2773a817c..0d85869ee 100644 --- a/build/AzureInfo.props +++ b/build/AzureInfo.props @@ -1,4 +1,4 @@ - + Sdk $(ARTIFACT_STORAGE_CONTAINER) diff --git a/build/BackwardsCompatibilityRuntimes.props b/build/BackwardsCompatibilityRuntimes.props index 9664fdadf..d9b7ddc24 100644 --- a/build/BackwardsCompatibilityRuntimes.props +++ b/build/BackwardsCompatibilityRuntimes.props @@ -1,4 +1,4 @@ - + release/1.1.0 1.1.2 diff --git a/build/BranchInfo.props b/build/BranchInfo.props index f048a677e..f62c8fd00 100644 --- a/build/BranchInfo.props +++ b/build/BranchInfo.props @@ -1,6 +1,6 @@ - + - release/15.5 - release/15.5 + master + master diff --git a/build/Branding.props b/build/Branding.props index ff634ec93..393b8d32e 100644 --- a/build/Branding.props +++ b/build/Branding.props @@ -1,23 +1,24 @@ - + - Microsoft .NET Core SDK - 2.1.2 + Microsoft .NET Core SDK 2.2.0 - Preview .NET Standard Support for Visual Studio 2015 - Microsoft .NET Core Runtime - 2.0.3 - Microsoft .NET Core Host - 2.0.1 - Microsoft .NET Core Host FX Resolver - 2.0.0 + Microsoft .NET Core Runtime 2.1.0 - Preview + Microsoft .NET Core Host 2.1.0 - Preview + Microsoft .NET Core Host FX Resolver 2.1.0 - Preview Microsoft.NETCore.App $(SharedFrameworkName) $(Rid) $(OSName)-$(Architecture) + $(HostRid) + '$(HostRid)' == 'fedora.24-x64' OR + '$(HostRid)' == 'rhel.6-x64' OR + '$(HostRid)' == 'opensuse.42.1-x64' ">$(HostRid) $(HostOSName)-$(Architecture) dotnet-sdk-internal @@ -31,6 +32,7 @@ $(ArtifactNameSdkSymbols)-$(SdkVersion)-$(ProductMonikerRid) $(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkVersion)-$(ProductMonikerRid) $(ArtifactNameSdkLanguagePack)-$(SdkVersion)-$(ProductMonikerRid) - $(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkVersion)-$(HostMonikerRid) + $(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkVersion)- + $(DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdkWithoutHostMonikerRid)$(HostMonikerRid) diff --git a/build/BuildAndPublishAllLinuxDistrosNativeInstallers.targets b/build/BuildAndPublishAllLinuxDistrosNativeInstallers.targets new file mode 100644 index 000000000..af2faa465 --- /dev/null +++ b/build/BuildAndPublishAllLinuxDistrosNativeInstallers.targets @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + true + + + \ No newline at end of file diff --git a/build/BuildDefaults.props b/build/BuildDefaults.props index 64eddcfd4..f13caffcd 100644 --- a/build/BuildDefaults.props +++ b/build/BuildDefaults.props @@ -1,11 +1,21 @@ - + Prepare;Compile;Test;Package;Publish Debug true + true false - true - true + true + true true + + + true + + + + NU1701 + + true diff --git a/build/BuildInfo.targets b/build/BuildInfo.targets index df28e1980..6abd51fa9 100644 --- a/build/BuildInfo.targets +++ b/build/BuildInfo.targets @@ -21,7 +21,7 @@ linux -<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project ToolsVersion="15.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 cbc7a67a0..82d926e11 100644 --- a/build/BundledRuntimes.props +++ b/build/BundledRuntimes.props @@ -1,4 +1,4 @@ - + $(HostRid) $(HostMonikerRid) @@ -21,9 +21,6 @@ $(CoreSetupRid) linux-x64 dotnet-runtime-$(SharedFrameworkVersion)-$(SharedFrameworkRid)$(ArchiveExtension) - - $([System.Text.RegularExpressions.Regex]::IsMatch($(SharedFrameworkVersion), '\d*\.\d*\.\d*-')) - $([System.Text.RegularExpressions.Regex]::Match($(SharedFrameworkVersion), '\d*\.\d*\.\d*').get_Groups().get_Item(0).ToString()) @@ -35,21 +32,17 @@ - $(CoreSetupBlobRootUrl)aspnetcore/store/$(AspNetCoreRuntimeAzureblobStoresSubfolderName) + $(CoreSetupBlobRootUrl)aspnetcore/store/$(AspNetCoreRuntimePackageFolderName) runtime.version $(PackagesDirectory)/$(AspNetCoreSharedRuntimeVersionFileName) - - $(HostOSName)$(Architecture) - $(HostOSName) - linux - - -$(AspNetCoreRuntimePackageTimestamp) - -$(AspNetCoreRelease)$(AspNetCoreRuntimeStoreSuffix) - Build.RS.$(AspNetCoreRuntimeInstallerArchiveFileNameOSToken)$(AspNetCoreRuntimeInstallerArchiveSuffix)$(ArchiveExtension) + win7-$(Architecture) + $(HostOSName)-$(Architecture) + linux-$(Architecture) + $(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreRuntimePackageVersion)-$(AspNetCoreRuntimeInstallerArchiveFileNameOSToken)$(ArchiveExtension) $(PackagesDirectory)/$(AspNetCoreRuntimeInstallerArchiveFileName) - AspNetCorePackageStoreLib$(Architecture)$(AspNetCoreRuntimeStoreSuffix).wixlib + AspNetCorePackageStoreLib_$(Architecture)-$(AspNetCoreRuntimePackageVersion).wixlib $(PackagesDirectory)/$(AspNetCoreRuntimeInstallerWixLibFileName) diff --git a/build/BundledSdks.props b/build/BundledSdks.props index b259c4a2a..77a089668 100644 --- a/build/BundledSdks.props +++ b/build/BundledSdks.props @@ -1,4 +1,4 @@ - + diff --git a/build/BundledTemplates.proj b/build/BundledTemplates.proj index 014f5bc92..dfc66e111 100644 --- a/build/BundledTemplates.proj +++ b/build/BundledTemplates.proj @@ -23,7 +23,7 @@ - diff --git a/build/BundledTemplates.props b/build/BundledTemplates.props index a7a7069ab..7b30af2ef 100644 --- a/build/BundledTemplates.props +++ b/build/BundledTemplates.props @@ -1,8 +1,8 @@ - + - - + + diff --git a/build/BundledTools.props b/build/BundledTools.props index b57577824..947148dd5 100644 --- a/build/BundledTools.props +++ b/build/BundledTools.props @@ -1,4 +1,4 @@ - + runtime.$(SharedFrameworkRid).microsoft.netcore.app $(NuGetPackagesDir)/$(RuntimeNETCoreAppPackageName)/$(CLI_SharedFrameworkVersion)/tools/crossgen$(ExeExtension) diff --git a/build/DependencyVersions.props b/build/DependencyVersions.props index 7258b411e..0ee460bb9 100644 --- a/build/DependencyVersions.props +++ b/build/DependencyVersions.props @@ -1,51 +1,43 @@ - + - 2.0.3 + 2.1.0-preview1-25929-02 15.5.179 2.6.0-beta3-62309-01 1.6.0-beta2-25304 - 4.2.0-rtm-171104-0 - pre-20171122-1 + 4.2.0-rtm-171122-0 + pre-20171012-1 2.6.0-$(CLI_Deps_Satellites_Build) 4.4.1-$(CLI_Deps_Satellites_Build) - 15.5.0-preview-20171116-1 + 2.1.0-preview1-20171121-1 $(CLI_NETSDK_Version) 4.5.0-rtm-4651 2.0.1-servicing-25908-02 - 2.0.0-rel-20171010-665 + 2.0.0-rel-20171110-671 15.5.0 $(CLI_SharedFrameworkVersion) $(CLI_SharedFrameworkVersion) $(CLI_SharedFrameworkVersion) 1.0.0-beta3-20171117-314 - 1.0.0-beta3-20171110-312 - 1.0.0-beta3-20171110-312 - 1.0.0-beta2-20170810-304 - 2.0.0 - 2.0.0 - 0.1.1-alpha-167 + 1.0.0-beta3-20171117-314 + 1.0.0-beta3-20171117-314 + 1.0.0-beta2-20171004-309 + 2.1.0-preview1-25929-02 + 2.1.0-preview1-25929-02 + 0.1.1-alpha-174 1.2.1-alpha-002133 0.2.0 0.2.0-beta-000042 - + 0.2.0-beta-000059 2.0.3 - - notimestamp - - 2.0.3 - rtm - 2.0.3 - 125 - aspnetcore-store - $(AspNetCoreVersion)-$(AspNetCoreRelease) - $(AspNetCoreBranchName)-$(AspNetCoreRuntimePackageTimestamp) + dev-26623 + 2.1.0-preview1-26623 diff --git a/build/DerivedHostMachineInfo.props b/build/DerivedHostMachineInfo.props index d9dc94444..534bc2167 100644 --- a/build/DerivedHostMachineInfo.props +++ b/build/DerivedHostMachineInfo.props @@ -1,7 +1,9 @@ - - - true - true - true - + + + true + true + + true + true + diff --git a/build/FileExtensions.props b/build/FileExtensions.props index 21f8a68d2..c9f943b13 100644 --- a/build/FileExtensions.props +++ b/build/FileExtensions.props @@ -1,4 +1,4 @@ - + .zip .tar.gz diff --git a/build/GenerateResxSource.targets b/build/GenerateResxSource.targets index b25582ee2..1eb51907e 100644 --- a/build/GenerateResxSource.targets +++ b/build/GenerateResxSource.targets @@ -1,4 +1,4 @@ - + diff --git a/build/GitCommitInfo.targets b/build/GitCommitInfo.targets index 4addb6c8a..6ac729e50 100644 --- a/build/GitCommitInfo.targets +++ b/build/GitCommitInfo.targets @@ -23,7 +23,7 @@ %(GitInfoCommitHashLines.Identity) -<Project ToolsVersion="15.0"> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <CommitCount>$(GitInfoCommitCount)</CommitCount> <CommitHash>$(GitInfoCommitHash)</CommitHash> diff --git a/build/HostInfo.targets b/build/HostInfo.targets index 50331f196..ed1046cc0 100644 --- a/build/HostInfo.targets +++ b/build/HostInfo.targets @@ -10,7 +10,7 @@ -<Project ToolsVersion="15.0"> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <HostRid>$(HostRid)</HostRid> <HostOSName>$(HostOSName)</HostOSName> diff --git a/build/InitRepo.props b/build/InitRepo.props index bc7d7e630..1b050bc4e 100644 --- a/build/InitRepo.props +++ b/build/InitRepo.props @@ -1,6 +1,7 @@ - $(RepoRoot)/artifacts/obj + bin/obj + $(RepoRoot)/$(RelativeGeneratedPropsDir) $(GeneratedPropsDir)/GitCommitInfo.props $(GeneratedPropsDir)/HostInfo.props $(GeneratedPropsDir)/BuildInfo.props diff --git a/build/InputDirectories.props b/build/InputDirectories.props index 0fc1b7a74..7564abe34 100644 --- a/build/InputDirectories.props +++ b/build/InputDirectories.props @@ -1,4 +1,4 @@ - + $(RepoRoot)/build_projects/dotnet-cli-build $(RepoRoot)/src diff --git a/build/InstallerInfo.props b/build/InstallerInfo.props index 036369fab..31fadd75e 100644 --- a/build/InstallerInfo.props +++ b/build/InstallerInfo.props @@ -1,4 +1,4 @@ - + $(PackagesDirectory) $(InstallerOutputDirectory)/$(ArtifactNameWithVersionSdk)$(InstallerExtension) diff --git a/build/LinuxDistrosNativeInstaller.props b/build/LinuxDistrosNativeInstaller.props new file mode 100644 index 000000000..d10dde9bc --- /dev/null +++ b/build/LinuxDistrosNativeInstaller.props @@ -0,0 +1,28 @@ + + + + ubuntu.16.04 + deb + $(ubuntu1604x64RepositoryId) + ubuntu.16.04-x64 + + + ubuntu.14.04 + deb + $(ubuntu1404x64RepositoryId) + ubuntu-x64 + + + debian + deb + $(debian8x64RepositoryId) + debian-x64 + + + rhel + rpm + $(rhel7x64RepositoryId) + rhel-x64 + + + \ No newline at end of file diff --git a/build/MSBuildExtensions.props b/build/MSBuildExtensions.props index c36782efe..26f27e8c4 100644 --- a/build/MSBuildExtensions.props +++ b/build/MSBuildExtensions.props @@ -1,4 +1,4 @@ - + $(RepoRoot)/resources/MSBuildImports diff --git a/build/MSBuildExtensions.targets b/build/MSBuildExtensions.targets index c6dd9f7ae..e24b2225b 100644 --- a/build/MSBuildExtensions.targets +++ b/build/MSBuildExtensions.targets @@ -75,7 +75,7 @@ NuGetPackagesDir=$(NuGetPackagesDir); DependencyPackageName=%(ExtensionPackageToRestore.Identity); DependencyPackageVersion=%(ExtensionPackageToRestore.Version); - Stage0Directory=$(Stage0Directory) + PreviousStageDirectory=$(PreviousStageDirectory) diff --git a/build/MicroBuild.props b/build/MicroBuild.props index 1cf77f45b..f55a5eea1 100644 --- a/build/MicroBuild.props +++ b/build/MicroBuild.props @@ -1,9 +1,6 @@ - - $(MSBuildThisFileDirectory)/.. - $(NUGET_PACKAGES) $(RepoRoot)/.nuget/packages $(NuGetPackagesDir)/microbuild.core/$(MicroBuildVersion)/build/ diff --git a/build/Microsoft.DotNet.Cli.tasks b/build/Microsoft.DotNet.Cli.tasks index 1c846d8b0..552ed1b34 100644 --- a/build/Microsoft.DotNet.Cli.tasks +++ b/build/Microsoft.DotNet.Cli.tasks @@ -33,6 +33,7 @@ + diff --git a/build/OutputDirectories.props b/build/OutputDirectories.props index 42e7d255a..5ffd7a590 100644 --- a/build/OutputDirectories.props +++ b/build/OutputDirectories.props @@ -1,23 +1,34 @@ - + - $(RepoRoot)/artifacts/$(Rid) - $(BaseOutputDirectory)/stage2 - $(BaseOutputDirectory)/stage2WithBackwardsCompatibleRuntimes + $([MSBuild]::Add($(CliOuterBuildStage), '1')) + 2 + + + $(RepoRoot)/bin/$(CliBuildStage)/$(Rid) + $([System.IO.Path]::GetFullPath('$(BaseOutputDirectory)/bin/$(MSBuildProjectName)')) + + $([System.IO.Path]::GetFullPath('$(BaseOutputDirectory)/obj/$(MSBuildProjectName)')) + $(BaseOutputDirectory)/dotnet + $(BaseOutputDirectory)/dotnetWithBackwardsCompatibleRuntimes $(OutputDirectory)/sdk/$(SdkVersion) - $(BaseOutputDirectory)/stage2symbols + $(BaseOutputDirectory)/symbols $(SdkOutputDirectory)/Roslyn $(SdkOutputDirectory)/FSharp - $(BaseOutputDirectory)/stage2compilation + $(BaseOutputDirectory)/compilation $(BaseOutputDirectory)/intermediate $(BaseOutputDirectory)/packages $(IntermediateDirectory)/sharedFrameworkPublish $(BaseOutputDirectory)/AspRT $(IntermediateDirectory)/backwardsCompatibleSharedFrameworksPublish - $(RepoRoot)/artifacts/testpackages/ + $(BaseOutputDirectory)/test/ $(OutputDirectory)/dotnet$(ExeExtension) $(IntermediateDirectory)/GeneratedMSBuildExtensions $(IntermediateDirectory)/MSBuildExtensionsLayout $(MSBuildExtensionsLayoutDirectory)/MSBuildSdkResolver + + $(BaseOutputDirectory)/PreviousStage.props diff --git a/build/Package.targets b/build/Package.targets index 8896bdb1f..eef514f56 100644 --- a/build/Package.targets +++ b/build/Package.targets @@ -7,10 +7,11 @@ + + DependsOnTargets="Prepare;Layout;GeneratePkgs;GenerateDebs;GenerateMsis;GenerateRpms" /> - + + + + \ No newline at end of file diff --git a/build/Prepare.targets b/build/Prepare.targets index 214b1f78d..2783c8214 100644 --- a/build/Prepare.targets +++ b/build/Prepare.targets @@ -4,7 +4,7 @@ + DependsOnTargets="Init;DownloadHostAndSharedFxArtifacts;RestoreSrcPackages;RestoreToolsPackages;IsolateArtifactsFromDirectoryBuildFiles;CreatePropsForNextStage" /> + + + @@ -31,7 +39,7 @@ %(_DownloadAndExtractItem.OverwriteDestination) True - + @@ -54,7 +62,7 @@ - @@ -79,7 +87,7 @@ - @@ -98,4 +106,39 @@ + + + + + + + + +<Project> + <PropertyGroup> + <PreviousStageDirectory>$(OutputDirectory)</PreviousStageDirectory> + <PreviousStageDotnet>$(DotnetInOutputDirectory)</PreviousStageDotnet> + <CliOuterBuildStage>$(CliBuildStage)</CliOuterBuildStage> + </PropertyGroup> +</Project> + + + + $([System.IO.File]::ReadAllText($(NextStagePropsPath))) + + + false + true + + + + + + diff --git a/build/Publish.targets b/build/Publish.targets index 9e911318c..b7dcf3b17 100644 --- a/build/Publish.targets +++ b/build/Publish.targets @@ -7,16 +7,25 @@ - + + + + Condition=" '$(PublishNativeInstallers)' == 'true' "/> - + @@ -76,4 +85,4 @@ ContainerName="$(ArtifactContainerName)" Items="@(CliVersionBadgeToUpload)" /> - \ No newline at end of file + diff --git a/build/RestoreDependency.proj b/build/RestoreDependency.proj index 142f5e929..19f209ce0 100644 --- a/build/RestoreDependency.proj +++ b/build/RestoreDependency.proj @@ -33,7 +33,7 @@ - diff --git a/build/SandBoxAndPackage.proj b/build/SandBoxAndPackage.proj new file mode 100644 index 000000000..26b2b4b0f --- /dev/null +++ b/build/SandBoxAndPackage.proj @@ -0,0 +1,79 @@ + + + + + + bin/WorkingCopy + $(SandBoxFolderName)/RelativeSandBoxPackageOutputFolder + $(RepoRoot)/$(SandBoxFolderName)/$(LinuxDistrosNeedNativeInstaller) + .nuget + bin/2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(SandBoxRepoRoot)/build.sh + $(CommandToInvokeBuildScriptInDockerToPackageInSandBox) --configuration $(BuildConfiguration) + $(CommandToInvokeBuildScriptInDockerToPackageInSandBox) --docker $(DockerFolder) + $(CommandToInvokeBuildScriptInDockerToPackageInSandBox) --skip-prereqs + $(CommandToInvokeBuildScriptInDockerToPackageInSandBox) /target:GenerateInstallersAndCopyOutOfSandBox + $(CommandToInvokeBuildScriptInDockerToPackageInSandBox) /p:RelativeSandBoxPackageOutputFolder=$(RelativeSandBoxPackageOutputFolder) + 0 + 2>&1 + + + + + + + + true + + + + + + + + + + + + \ No newline at end of file diff --git a/build/SandBoxAndPackageInParallel.proj b/build/SandBoxAndPackageInParallel.proj new file mode 100644 index 000000000..5ec1930f5 --- /dev/null +++ b/build/SandBoxAndPackageInParallel.proj @@ -0,0 +1,17 @@ + + + + + + + + + diff --git a/build/SetupPreviousStage.props b/build/SetupPreviousStage.props new file mode 100644 index 000000000..7545eddc7 --- /dev/null +++ b/build/SetupPreviousStage.props @@ -0,0 +1,13 @@ + + + $(RepoRoot)/.dotnet_stage0/$(Architecture) + $(PreviousStageDirectory)/dotnet$(ExeExtension) + + + + + + False + True + + diff --git a/build/Signing.proj b/build/Signing.proj index d3eebb140..da686886a 100644 --- a/build/Signing.proj +++ b/build/Signing.proj @@ -1,9 +1,15 @@ + + + + true + + + - - @@ -13,10 +19,6 @@ - $(RepoRoot)/artifacts/$(Rid) - $(BaseOutputDirectory)/stage2 - $(BaseOutputDirectory)/stage2compilation - $(BaseOutputDirectory)/packages $(BaseOutputDirectory)/intermediate/MSBuildExtensionsLayout/MSBuildSdkResolver - + $(InternalCertificateId) @@ -85,9 +84,6 @@ - - $(SdkResolverOutputDirectory) - $(InternalCertificateId) @@ -98,9 +94,6 @@ - - $(PackagesDirectory) - $(InternalCertificateId) @@ -114,9 +107,6 @@ - - $(PackagesDirectory) - $(InternalCertificateId) @@ -127,9 +117,6 @@ - - $(PackagesDirectory) - $(InternalCertificateId) diff --git a/build/Stage0.props b/build/Stage0.props deleted file mode 100644 index e5a6a0b50..000000000 --- a/build/Stage0.props +++ /dev/null @@ -1,9 +0,0 @@ - - - $(RepoRoot)/.dotnet_stage0/$(Architecture) - $(RepoRoot)/.dotnet_stage0PJ/$(Architecture) - $(Stage0Directory)/dotnet$(ExeExtension) - False - True - - diff --git a/build/Test.targets b/build/Test.targets index 0b8bc0620..388a2e1fe 100644 --- a/build/Test.targets +++ b/build/Test.targets @@ -12,24 +12,21 @@ $(TestOutputDir)/results/ - - - - - - @(TestTaskEnvironmentVariables) - - + DependsOnTargets="TestsForBuildItself;BuildTests;"> + + + CLIBuildDll=$(CLIBuildDll); Configuration=$(Configuration); - EnvironmentVariables=$(RunTestEnvironmentVariables); + TestArtifactsDir=$(TestArtifactsDir); + TestPackagesDir=$(TestPackagesDir); + PreviousStageProps=$(NextStagePropsPath); TestProject=%(TestProjects.Identity); TestResultXmlDir=$(TestResultXmlDir); ToolPath=$(OutputDirectory); @@ -38,35 +35,6 @@ - - - - $(OutputDirectory)/shared/Microsoft.NETCore.App/$(SharedFrameworkStableVersion) - $(Stage2WithBackwardsCompatibleRuntimesOutputDirectory)/shared/Microsoft.NETCore.App/$(SharedFrameworkStableVersion) - - - - - - - - - - - - - - - - - - - - + ProjectPath=""$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln"" + AdditionalParameters="/p:PreviousStageProps=$(NextStagePropsPath)" /> @@ -109,19 +73,26 @@ + ProjectPath="%(TestPackageProject.ProjectPath)" + AdditionalParameters="/p:RestoreAdditionalProjectSources=$(TestOutputDir)/packages /p:PreviousStageProps=$(NextStagePropsPath)" + /> + MsbuildArgs="%(TestPackageProject.MsbuildArgs) /p:SdkNuGetVersion=$(SdkNugetVersion) /p:RestoreAdditionalProjectSources=$(TestOutputDir)/packages /p:PreviousStageProps=$(NextStagePropsPath)" /> + + + + + ToolPath="$(PreviousStageDirectory)" /> diff --git a/build/Version.props b/build/Version.props index f0c026f0a..6e311dd4d 100644 --- a/build/Version.props +++ b/build/Version.props @@ -1,9 +1,9 @@ - + 2 - 1 - 2 - preview + 2 + 0 + preview1 $(VersionMajor).$(VersionMinor).$(VersionPatch)-$(ReleaseSuffix) $(VersionMajor).$(VersionMinor).$(VersionPatch).$(CommitCount) diff --git a/build/VersionBadge.props b/build/VersionBadge.props deleted file mode 100644 index 0dab52fb8..000000000 --- a/build/VersionBadge.props +++ /dev/null @@ -1,14 +0,0 @@ - - - $(OSName)_$(Architecture) - debian_8_x64 - rhel_7_x64 - ubuntu_14_04_x64 - ubuntu_16_04_x64 - ubuntu_16_10_x64 - linux_x64 - - $(BaseOutputDirectory)/$(VersionBadgeMoniker)_$(Configuration)_version_badge.svg - $(BaseOutputDirectory)/$(VersionBadgeMoniker)_$(Configuration)_coherent_badge.svg - - diff --git a/build/buildpipeline/security/DotNet-CLI-Security-Windows.json b/build/buildpipeline/security/DotNet-CLI-Security-Windows.json new file mode 100644 index 000000000..74362e939 --- /dev/null +++ b/build/buildpipeline/security/DotNet-CLI-Security-Windows.json @@ -0,0 +1,764 @@ +{ + "build": [ + { + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Workaround for BuildTools - Clone Core-Setup", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "filename": "$(PB_Git)", + "arguments": "clone $(CoreSetupUrl) core-setup", + "workingFolder": "$(Build.SourcesDirectory)", + "failOnStandardError": "false" + } + }, + { + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Workaround for BuildTools - Checkout Core-Setup master", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "filename": "$(PB_Git)", + "arguments": "checkout master", + "workingFolder": "$(build.SourcesDirectory)\\core-setup", + "failOnStandardError": "false" + } + }, + { + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Workaround for BuildTools - Run init-tools.cmd", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "filename": "init-tools.cmd", + "arguments": "", + "workingFolder": "$(Build.SourcesDirectory)\\core-setup", + "failOnStandardError": "false" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Workaround for BuildTools - Delete CLI dir.props", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "-path \"$(Build.SourcesDirectory)\"", + "workingFolder": "$(Build.SourcesDirectory)", + "inlineScript": "param ($path)\ngci \"$path\\dir.props\" | Remove-Item -Force", + "failOnStandardError": "true" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Download blobs from container $(PB_CloudDropAccountName)", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "c6c4c611-aa2e-4a33-b606-5eaba2196824", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "solution": "$(Build.SourcesDirectory)\\build\\buildpipeline\\security\\syncAzure.proj", + "msbuildLocationMethod": "version", + "msbuildVersion": "latest", + "msbuildArchitecture": "x64", + "msbuildLocation": "", + "platform": "x64", + "configuration": "$(BuildConfiguration)", + "msbuildArguments": "/p:AzureAccount=\"$(PB_CloudDropAccountName)\" /p:AzureToken=\"$(PB_CloudDropAccessToken)\" /p:BlobName=\"$(PB_BlobNameFilter)\" /verbosity:diag", + "clean": "false", + "maximumCpuCount": "false", + "restoreNugetPackages": "false", + "logProjectEvents": "false", + "createLogFile": "false" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Copy downloaded packages to security folder", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "refName": "PowerShell_23", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "-SrcDir \"$(Build.SourcesDirectory)\"", + "workingFolder": "$(Build.SourcesDirectory)", + "inlineScript": "param($SrcDir)\n$secDir = Join-Path \"$SrcDir\" \"security\"\n$pkgDir = \"$SrcDir\\core-setup\\packages\\AzureTransfer\"\nCopy-Item \"$pkgDir \" \"$secDir\" -Force -Recurse\n", + "failOnStandardError": "true" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Extract downloaded packages", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "-SrcDir \"$(Build.SourcesDirectory)\"", + "workingFolder": "$(Build.SourcesDirectory)", + "inlineScript": "param($SrcDir)\n$secDir = Join-Path \"$SrcDir\" \"security\"\ngci \"$secDir\\*.zip\" | % {\n$dstDir = Join-Path \"$secDir\" $($_.BaseName)\nExpand-Archive -Path $($_.FullName) -DestinationPath \"$dstDir\" -Force\nWrite-Host \"Expanded: $($_.FullName)\"\nRemove-Item $_.FullName -Force\n}\n", + "failOnStandardError": "true" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "List all files", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "$(Build.SourcesDirectory)", + "workingFolder": "$(Build.SourcesDirectory)", + "inlineScript": "param($SrcDir)\n$fileCount = 0\ngci $SrcDir -recurse | % {\nWrite-Host $($_.FullName)\n$fileCount += 1\n}\nWrite-Host \"File Count: $fileCount\"\n", + "failOnStandardError": "true" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Remove non-CLI folders", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "refName": "PowerShell_22", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "-SrcDir \"$(Build.SourcesDirectory)\"", + "workingFolder": "$(Build.SourcesDirectory)", + "inlineScript": "param($SrcDir)\n$secDir = Join-Path \"$SrcDir\" \"security\"\n\ngci \"$secDir\" | where {$_.PSIsContainer} | % {\n gci $_.FullName | where {$_.PSIsContainer} | % {\n if ($_.BaseName -ine \"sdk\" -and $_.BaseName -notmatch \"symbols\")\n {\n Remove-Item $_.FullName -Recurse -Force -ErrorAction Continue\n Write-Host \"Removed $($_.FullName)\"\n }\n }\n}", + "failOnStandardError": "false" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Workaround for long path - DELETE files with path length greater than or equal to 240 characters", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "refName": "Task_10", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "-SrcDir \"$(Build.SourcesDirectory)\"", + "workingFolder": "$(Build.SourcesDirectory)", + "inlineScript": "param($SrcDir)\n$longPath = New-Object System.Collections.ArrayList\ngci \"$SrcDir\\*\" -recurse | where {!$_.PSIsContainer} | % {\nif ($($_.FullName.Length) -ge 240)\n{\n$longPath.Add($($_.Directory.FullName)) | Out-Null\n}\n}\n$longPath | % {\nStart-Process \"cmd\" -ArgumentList \"/c rd /S /Q $_\" -Wait\nWrite-Host \"DELETED $_\"\n}\n", + "failOnStandardError": "false" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "List all files - post delete", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "refName": "Task_11", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "$(Build.SourcesDirectory)", + "workingFolder": "$(Build.SourcesDirectory)", + "inlineScript": "param($SrcDir)\n$fileCount = 0\ngci $SrcDir -recurse | % {\nWrite-Host $($_.FullName)\n$fileCount += 1\n}\nWrite-Host \"File Count: $fileCount\"\n", + "failOnStandardError": "true" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Get latest version info", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "refName": "PowerShell23", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "filePath", + "scriptName": "$(Build.SourcesDirectory)\\build\\buildpipeline\\security\\Get-LatestVersion.ps1", + "arguments": "-Branch \"$(CodeBase)\"", + "workingFolder": "", + "failOnStandardError": "true" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Workaround for long package Id", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "refName": "PowerShell24", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "-packageId $(CliLatestPackageId)", + "workingFolder": "", + "inlineScript": "param($packageId)\n\nif ($packageId.Length -ge 16)\n{\n Write-Host \"Build number for security build is the package Id. TSA has a limit of 16 characters for build number. Since package Id is greater than 16 characters, build number will be set to current date time in yyyymmddHHMMss format.\"\n $CliLatestPackageId = Get-Date -Format yyyymmddHHMMss\n Write-Host \"##vso[task.setvariable variable=CliLatestPackageId;]$CliLatestPackageId\"\n}", + "failOnStandardError": "true" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Run BinSkim ", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "3056813a-40e9-4b2f-8f6b-612d1bc4e045", + "versionSpec": "3.*", + "definitionType": "task" + }, + "inputs": { + "InputType": "CommandLine", + "arguments": "analyze $(Build.SourcesDirectory)\\security\\*.dll $(Build.SourcesDirectory)\\security\\*.exe --recurse --sympath $(Build.SourcesDirectory)\\security\\*.pdb --verbose --statistics", + "Function": "analyze", + "AnalyzeTarget": "$(Build.ArtifactStagingDirectory)", + "AnalyzeSymPath": "", + "AnalyzeConfigPath": "default", + "AnalyzePluginPath": "", + "AnalyzeRecurse": "true", + "AnalyzeVerbose": "true", + "AnalyzeHashes": "true", + "AnalyzeStatistics": "false", + "AnalyzeEnvironment": "false", + "ExportRulesOutputType": "SARIF", + "DumpTarget": "$(Build.ArtifactStagingDirectory)", + "DumpRecurse": "true", + "DumpVerbose": "true", + "toolVersion": "Latest" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Run APIScan", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "9adea2b1-3752-438c-80c6-a6f0a812abdd", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "targetMode": "binarysym", + "softwareFolder": "$(Build.SourcesDirectory)\\security", + "mpdFolder": "", + "softwareName": "CLI", + "softwareVersionNum": "$(CliLatestPackageId)", + "softwareBuildNum": "$(CliLatestPackageId)", + "modeType": "prerelease", + "noCopySymbols": "false", + "noCopyBinaries": "false", + "noDecompress": "true", + "exclusionList": "", + "email": "", + "symbolsFolder": "$(Build.SourcesDirectory)\\security", + "preBbtBinariesFolder": "", + "preBbtSymbolsFolder": "", + "isLargeApp": "false", + "analyzerTimeout": "00:00:00", + "preserveTempFiles": "false", + "toolVersion": "Latest" + } + }, + { + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Checkout CLI at SHA listed in latest.version", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "-sha \"$(CliLatestCommitSha)\" -git \"$(PB_Git)\"", + "workingFolder": "$(Build.SourcesDirectory)", + "inlineScript": "param($sha, $git)\n\nStart-Process \"$git\" -ArgumentList \"clean -df\" -Wait -Verbose -ErrorAction Stop\nStart-Process \"$git\" -ArgumentList \"checkout $sha\" -Wait -Verbose -ErrorAction Stop\nWrite-Host \"Checked out at $sha\"\n", + "failOnStandardError": "true" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Run Core-Setup clean.cmd", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "filename": "clean.cmd", + "arguments": "-all", + "workingFolder": "$(Build.SourcesDirectory)\\core-setup", + "failOnStandardError": "false" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Delete Core-Setup folder", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "-path \"$(Build.SourcesDirectory)\\core-setup\"", + "workingFolder": "", + "inlineScript": "param ($path)\nRemove-Item \"$path\" -Force -Recurse -ErrorAction Continue\n", + "failOnStandardError": "true" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "List all files - post checkout", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "$(Build.SourcesDirectory)", + "workingFolder": "$(Build.SourcesDirectory)", + "inlineScript": "param($SrcDir)\n$fileCount = 0\ngci $SrcDir -recurse | % {\nWrite-Host $($_.FullName)\n$fileCount += 1\n}\nWrite-Host \"File Count: $fileCount\"\n", + "failOnStandardError": "true" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Run CredScan", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "ea576cd4-c61f-48f8-97e7-a3cb07b90a6f", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "outputFormat": "pre", + "toolVersion": "Latest", + "scanFolder": "$(Build.SourcesDirectory)", + "searchersFileType": "Default", + "searchersFile": "", + "suppressionsFile": "", + "suppressAsError": "false", + "batchSize": "" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Run PoliCheck", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "d785890c-0d0d-46bd-8167-8fa9d49990c7", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "inputType": "Basic", + "cmdLineArgs": "/F:$(Build.SourcesDirectory) /T:9 /O:PoliCheck.xml", + "targetType": "F", + "targetArgument": "$(Build.SourcesDirectory)", + "importEx": "0", + "termTypeT": "0029a9", + "termTypeTCustom": "9", + "termTypeK": "", + "termTypeL": "", + "EXGT": "false", + "result": "PoliCheck.xml", + "optionsFC": "1", + "optionsXS": "1", + "optionsCTGLEN": "", + "optionsSEV": "", + "optionsPE": "", + "optionsHMENABLE": "", + "optionsHPATH": "", + "optionsHVER": "", + "optionsRulesDBPath": "", + "optionsRule": "", + "optionsXCLASS": "", + "optionsTASKNAME": "", + "optionsWORKINGDIRECTORY": "", + "optionsFTPATH": "", + "optionsD": "", + "optionsB1": "", + "optionsB2": "", + "optionsB3": "", + "optionsOCDB": "", + "toolVersion": "Latest" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Post Analysis", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "f5679091-e6da-4974-a8dc-0eec03a8ea63", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "APIScan": "true", + "BinScope": "false", + "BinSkim": "true", + "BinSkimBreakOn": "Error", + "CredScan": "true", + "FortifySCA": "false", + "FxCop": "false", + "FxCopBreakOn": "ErrorAbove", + "ModernCop": "false", + "ModernCopBreakOn": "Error", + "PoliCheck": "true", + "PoliCheckBreakOn": "Severity1", + "SDLNativeRules": "false", + "TSLint": "false", + "TSLintBreakOn": "Error" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Publish Security Analysis Logs", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "4096c760-3a8a-435d-9689-88c0311bbc0e", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "ArtifactName": "CodeAnalysisLogs", + "ArtifactType": "Container", + "TargetPath": "\\\\my\\share\\$(Build.DefinitionName)\\$(Build.BuildNumber)", + "RvName": "", + "ProductComponentName": "", + "ProductVersionNumber": "", + "PlatformName": "", + "SDLToolName": "", + "SDLToolResultFile": "" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "TSA upload to Codebase: DotNet-CLI-Trusted_$(CodeBase) Stamp: Azure", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "3da26988-bb64-4a23-8f06-45531d297dae", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "codebase": "NewOrUpdate", + "tsaStamp": "Azure", + "tsaWebApiUrl": "$(TSAStamp)", + "codeBaseName": "DotNet-CLI-Trusted_$(CodeBase)", + "notificationAlias": "$(NotificationAlias)", + "codeBaseAdmins": "NORTHAMERICA\\raeda", + "instanceUrlAzure": "MSAZURE", + "instanceUrlBing": "", + "instanceUrlCarbon": "", + "instanceUrlDevDiv": "DEVDIV", + "instanceUrlSkype": "", + "instanceUrlTsa": "", + "instanceUrlPpe": "", + "projectNameDAIPVSTF": "", + "projectNameDYNAMICSCRM": "", + "projectNameMSAZURE": "One", + "projectNameMSDYENG": "", + "projectNameMSECG": "", + "projectNameIDENTITYDIVISION": "Code Scan - TSA", + "projectNameVSTFRD": "", + "projectNameMSASG": "", + "projectNameMICROSOFTVSTS": "", + "projectNameMSDATA": "", + "projectNameMSENG": "", + "projectNameDEVDIV": "DevDiv", + "projectNameSKYPETEST2": "", + "projectNameONEDRIVE": "", + "projectNameSQLBUVSTS": "", + "projectNamePOWERBI": "", + "projectNameAZUREVSTFPPE": "", + "projectNameSKYPE": "", + "projectNameDOMOREEXP": "", + "projectNameSQLBUVSTSTEST": "", + "areaPath": "One\\DevDiv\\DotNetCore", + "iterationPath": "One", + "uploadAPIScan": "true", + "uploadBinScope": "false", + "uploadBinSkim": "true", + "uploadCredScan": "true", + "uploadFortifySCA": "false", + "uploadFxCop": "false", + "uploadModernCop": "false", + "uploadPoliCheck": "true", + "uploadPREfast": "false", + "validateToolOutput": "Warning", + "validateCompatibility": "Error", + "uploadAsync": "true" + } + } + ], + "options": [ + { + "enabled": false, + "definition": { + "id": "5bc3cfb7-6b54-4a4b-b5d2-a3905949f8a6" + }, + "inputs": {} + }, + { + "enabled": false, + "definition": { + "id": "7c555368-ca64-4199-add6-9ebaf0b0137d" + }, + "inputs": { + "multipliers": "[]", + "parallel": "false", + "continueOnError": "true", + "additionalFields": "{}" + } + }, + { + "enabled": false, + "definition": { + "id": "a9db38f9-9fdc-478c-b0f9-464221e58316" + }, + "inputs": { + "workItemType": "234347", + "assignToRequestor": "true", + "additionalFields": "{}" + } + }, + { + "enabled": false, + "definition": { + "id": "57578776-4c22-4526-aeb0-86b6da17ee9c" + }, + "inputs": {} + }, + { + "enabled": false, + "definition": { + "id": "5d58cc01-7c75-450c-be18-a388ddb129ec" + }, + "inputs": { + "branchFilters": "[\"+refs/heads/*\"]", + "additionalFields": "{}" + } + } + ], + "variables": { + "system.debug": { + "value": "false" + } + }, + "demands": [ + "Agent.OS -equals windows_nt", + "msbuild" + ], + "retentionRules": [ + { + "branches": [ + "+refs/heads/*" + ], + "artifacts": [ + "build.SourceLabel" + ], + "artifactTypesToDelete": [], + "daysToKeep": 10, + "minimumToKeep": 1, + "deleteBuildRecord": true, + "deleteTestResults": true + } + ], + "_links": { + "self": { + "href": "https://devdiv.visualstudio.com/0bdbc590-a062-4c3f-b0f6-9383f67865ee/_apis/build/Definitions/6661" + }, + "web": { + "href": "https://devdiv.visualstudio.com/_permalink/_build/index?collectionId=011b8bdf-6d56-4f87-be0d-0092136884d9&projectId=0bdbc590-a062-4c3f-b0f6-9383f67865ee&definitionId=6661" + }, + "editor": { + "href": "https://devdiv.visualstudio.com/_permalink/_build/definitionEditor?collectionId=011b8bdf-6d56-4f87-be0d-0092136884d9&projectId=0bdbc590-a062-4c3f-b0f6-9383f67865ee&definitionId=6661" + }, + "badge": { + "href": "https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/6661/badge" + } + }, + "buildNumberFormat": "$(date:yyyyMMdd)$(rev:-rr)", + "jobAuthorizationScope": 1, + "jobTimeoutInMinutes": 600, + "jobCancelTimeoutInMinutes": 5, + "badgeEnabled": true, + "repository": { + "properties": { + "cleanOptions": "3", + "labelSources": "0", + "labelSourcesFormat": "$(build.buildNumber)", + "reportBuildStatus": "true", + "gitLfsSupport": "false", + "skipSyncSource": "false", + "checkoutNestedSubmodules": "false", + "fetchDepth": "0" + }, + "id": "ceac4423-53f8-4c97-bc62-173630412581", + "type": "TfsGit", + "name": "DotNet-Cli-Trusted", + "url": "https://devdiv.visualstudio.com/DevDiv/_git/DotNet-Cli-Trusted", + "defaultBranch": "refs/heads/master", + "clean": "true", + "checkoutSubmodules": false + }, + "processParameters": {}, + "quality": "definition", + "authoredBy": { + "id": "9d5fdf9f-36b6-4d0c-a12e-2737a673af94", + "displayName": "Ravi Eda", + "uniqueName": "raeda@microsoft.com", + "url": "https://app.vssps.visualstudio.com/Aa44b2c06-f247-425c-8464-4a0676af910a/_apis/Identities/9d5fdf9f-36b6-4d0c-a12e-2737a673af94", + "imageUrl": "https://devdiv.visualstudio.com/_api/_common/identityImage?id=9d5fdf9f-36b6-4d0c-a12e-2737a673af94" + }, + "queue": { + "id": 36, + "name": "DotNet-Build", + "pool": { + "id": 39, + "name": "DotNet-Build" + } + }, + "id": 6733, + "name": "DotNet-CLI-Security-Windows", + "url": "https://devdiv.visualstudio.com/0bdbc590-a062-4c3f-b0f6-9383f67865ee/_apis/build/Definitions/6661", + "uri": "vstfs:///Build/Definition/6733", + "path": "\\", + "type": 2, + "revision": 6, + "createdDate": "2017-06-21T21:58:12.397Z", + "project": { + "id": "0bdbc590-a062-4c3f-b0f6-9383f67865ee", + "name": "DevDiv", + "description": "Visual Studio and DevDiv team project for git source code repositories. Work items will be added for Adams, Dev14 work items are tracked in vstfdevdiv. ", + "url": "https://devdiv.visualstudio.com/_apis/projects/0bdbc590-a062-4c3f-b0f6-9383f67865ee", + "state": "wellFormed", + "revision": 418097676, + "visibility": 0 + } +} diff --git a/build/buildpipeline/security/Get-LatestVersion.ps1 b/build/buildpipeline/security/Get-LatestVersion.ps1 new file mode 100644 index 000000000..2f921ef3a --- /dev/null +++ b/build/buildpipeline/security/Get-LatestVersion.ps1 @@ -0,0 +1,71 @@ +<# +.SYNOPSIS + Retrieves the latest commit SHA and the corresponding package Id for the specified branch of CLI. + This retrieval is achieved by downloading the latest.version file, which contains the commit SHA and package Id info. + If retrieval succeeds, then the commit is set as a VSTS Task Variable named CliLatestCommitSha, and similarly package Id is set as CliLatestPackageId. +.PARAMETER $Branch + Name of the CLI branch. +.PARAMETER $Filename + Name of the file that contains latest version info i.e. commit SHA and package Id. + If not specified, then the default value is latest.version +.PARAMETER $UrlPrefix + URL prefix for $Filename. + If not specified, then the default value is https://dotnetcli.blob.core.windows.net/dotnet/Sdk +#> + +param( + [Parameter(Mandatory=$true)] + [string]$Branch, + [string]$Filename="latest.version", + [string]$UrlPrefix="https://dotnetcli.blob.core.windows.net/dotnet/Sdk" +) + +function Get-VersionInfo +{ + Write-Host "Attempting to retrieve latest version info from $latestVersionUrl" + $retries = 3 + $retryCount = 1 + $oldEap = $ErrorActionPreference + + while ($retryCount -le $retries) + { + $ErrorActionPreference = "Stop" + + try + { + $content = (Invoke-WebRequest -Uri "$latestVersionUrl" -UseBasicParsing).Content + return $content.Split([Environment]::NewLine, [System.StringSplitOptions]::RemoveEmptyEntries) + } + catch + { + Sleep -Seconds (Get-Random -minimum 3 -maximum 10) + Write-Host "Exception occurred while attempting to get latest version info from $latestVersionUrl. $_" + Write-Host "Retry $retryCount of $retries" + } + finally + { + $ErrorActionPreference = $oldEap + } + + $retryCount++ + } +} + +$latestVersionUrl = "$UrlPrefix/$Branch/$Filename" +$latestVersionContent = Get-VersionInfo + +if ($latestVersionContent -ne $null -and $latestVersionContent.Length -eq 2) +{ + $CliLatestCommitSha = $latestVersionContent[0] + $CliLatestPackageId = $latestVersionContent[1] + + Write-Host "##vso[task.setvariable variable=CliLatestCommitSha;]$CliLatestCommitSha" + Write-Host "##vso[task.setvariable variable=CliLatestPackageId;]$CliLatestPackageId" + + Write-Host "The latest commit SHA in CLI $Branch is $CliLatestCommitSha" + Write-Host "The latest package Id in CLI $Branch is $CliLatestPackageId" +} +else +{ + Write-Error "Unable to get latest version info from $latestVersionUrl" +} diff --git a/build/buildpipeline/security/dir.props b/build/buildpipeline/security/dir.props new file mode 100644 index 000000000..3e28b4a52 --- /dev/null +++ b/build/buildpipeline/security/dir.props @@ -0,0 +1,4 @@ + + + + diff --git a/build/buildpipeline/security/pipeline.json b/build/buildpipeline/security/pipeline.json new file mode 100644 index 000000000..dbac3626b --- /dev/null +++ b/build/buildpipeline/security/pipeline.json @@ -0,0 +1,22 @@ +{ + "Repository": "cli", + "Definitions": { + "Path": ".", + "Type": "VSTS", + "BaseUrl": "https://devdiv.visualstudio.com/DefaultCollection", + "SkipBranchAndVersionOverrides": "false" + }, + "Pipelines": [ + { + "Name": "Security Build for Windows", + "Parameters": { + "TreatWarningsAsErrors": "false" + }, + "Definitions": [ + { + "Name": "DotNet-CLI-Security-Windows" + } + ] + } + ] +} diff --git a/build/buildpipeline/security/syncAzure.proj b/build/buildpipeline/security/syncAzure.proj new file mode 100644 index 000000000..45d7657eb --- /dev/null +++ b/build/buildpipeline/security/syncAzure.proj @@ -0,0 +1,21 @@ + + + + + + $(BuildToolsTaskDesktopDir)Microsoft.DotNet.Build.CloudTestTasks.dll + dotnet + $(PackagesDir)AzureTransfer + + + + + + + + + + + + + diff --git a/build/buildpipeline/security/syncAzure.targets b/build/buildpipeline/security/syncAzure.targets new file mode 100644 index 000000000..4cc360a11 --- /dev/null +++ b/build/buildpipeline/security/syncAzure.targets @@ -0,0 +1,31 @@ + + + + + + + $(PackagesDir)/AzureTransfer + + + + + + + + + <_OSFilteredBlobNames Include="@(_BlobList)" + Condition="'$(OSGroup)' == 'Windows_NT' AND + ('%(_BlobList.Extension)' == '.zip' OR '%(_BlobList.Extension)' == '.exe' OR '%(_BlobList.Extension)' == '.version')" /> + + + + + diff --git a/build/compile/LzmaArchive.targets b/build/compile/LzmaArchive.targets index 494164b26..c3e7d2b0b 100644 --- a/build/compile/LzmaArchive.targets +++ b/build/compile/LzmaArchive.targets @@ -5,7 +5,7 @@ ?$(CoreSetupBlobAccessToken) $(SdkOutputDirectory)/nuGetPackagesArchive.lzma - nuGetPackagesArchive.$(AspNetCoreRuntimePackageFlavor).lzma + nuGetPackagesArchive-$(AspNetCoreRuntimePackageVersion).lzma $(IntermediateDirectory)/$(NugetPackagesArchiveName) $(AspNetCoreRuntimeInstallerBlobRootUrl)/$(NugetPackagesArchiveName)$(CoreSetupBlobAccessTokenParam) diff --git a/build/package/CopySandBoxPackageOut.targets b/build/package/CopySandBoxPackageOut.targets new file mode 100644 index 000000000..a7bf6b524 --- /dev/null +++ b/build/package/CopySandBoxPackageOut.targets @@ -0,0 +1,9 @@ + + + + + + + diff --git a/build/package/Installer.DEB.proj b/build/package/Installer.DEB.proj index c3baf267b..4b684d161 100644 --- a/build/package/Installer.DEB.proj +++ b/build/package/Installer.DEB.proj @@ -25,7 +25,6 @@ - @@ -65,7 +64,7 @@ Mode="u+x" /> - - @@ -97,7 +95,7 @@ - @@ -125,7 +122,6 @@ - @@ -160,22 +156,12 @@ - + - - - - - - - diff --git a/build/package/Installer.DEB.targets b/build/package/Installer.DEB.targets index 00afd7f30..6e0020dbe 100644 --- a/build/package/Installer.DEB.targets +++ b/build/package/Installer.DEB.targets @@ -8,8 +8,7 @@ - dotnet-deb-tool-consumer.csproj - $(IntermediateDirectory)/$(DotnetDebToolConsumerProjectName) + $(MSBuildThisFileDirectory)/dotnet-deb-tool-consumer $(NuGetPackagesDir)/dotnet-deb-tool/$(DotnetDebToolVersion)/lib/netcoreapp2.0/tool/package_tool @@ -35,12 +34,8 @@ dotnet-hostfxr-$(HostFxrDebianPackageVersion) $(HostFxrDebianPackageName.ToLower()) dotnet-host - $(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersionAndRelease)-$(AspNetCoreRuntimePackageTimestamp) - $(AspNetCoreRuntimePackageBrandName)-2.0.0 - $(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersion) - $(HostRid) - $(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersionAndRelease)-$(AspNetCoreRuntimePackageTimestamp)-$(HostRidInAspNetCoreRuntimeDebInstallerFileName).deb - $(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersion)-$(HostRidInAspNetCoreRuntimeDebInstallerFileName).deb + $(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreRuntimePackageVersion) + $(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreRuntimePackageVersion)-$(HostRid).deb @@ -115,6 +110,9 @@ + + + @@ -124,13 +122,8 @@ - $(AspNetCoreRuntimePackageBrandName)-2.0.0-$(HostRidInAspNetCoreRuntimeDebInstallerFileName).deb - $(PackagesDirectory)/AspNetCoreRuntimeDebInstallerFileName200 $(PackagesDirectory)/$(AspNetCoreRuntimeDebInstallerFileName) - diff --git a/build/package/Installer.MSI.targets b/build/package/Installer.MSI.targets index 2a4e131b8..ea98d309a 100644 --- a/build/package/Installer.MSI.targets +++ b/build/package/Installer.MSI.targets @@ -199,7 +199,8 @@ + -DotnetDir '$(PreviousStageDirectory)' + -TestDir '$(TestOutputDir)'" /> - - - $(SdkVersion) - $(OutputDirectory)/sdk - $(InstallerOutputDirectory)/$(DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(InstallerExtension) - $(SdkInstallerFile) - $(RepoRoot)/Documentation/manpages - $(RepoRoot)/packaging/rpm/dotnet-config.json - $(IntermediateDirectory)/$(RpmPackageName)/$(RpmPackageVersion) - $(RpmIntermediatesDir)/debian-testResults.xml - /usr/share/dotnet - - - - $(RpmIntermediatesDir)/RpmLayoutDirectory/ - $(RpmLayoutDirectory)package_root - $(RpmLayoutPackageRoot)/sdk - $(RpmLayoutDirectory)docs - $(RpmLayoutDirectory)templates - $(RpmLayoutDirectory)scripts - - - - $(SdkVersion) - $(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkRpmPackageVersion) - $(SharedFrameworkVersion) - dotnet-runtime-$(SharedFxRpmPackageVersion) - $(SharedFxRpmPackageName.ToLower()) - $(HostFxrVersion) - dotnet-hostfxr-$(HostFxrRpmPackageVersion) - $(HostFxrRpmPackageName.ToLower()) - dotnet-host - $(HostRid) - $(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersionAndRelease)-$(AspNetCoreRuntimePackageTimestamp) - $(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersion) - $(AspNetCoreRuntimePackageBrandName)-2.0.0 - $(AspNetCoreVersion)-$(AspNetCoreRelease)-$(AspNetCoreRuntimePackageTimestamp) - $(AspNetCoreVersion) - $(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersionAndRelease)-$(AspNetCoreRuntimePackageTimestamp)-$(HostRidInAspNetCoreRuntimeRpmInstallerFileName).rpm - $(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersion)-$(HostRidInAspNetCoreRuntimeRpmInstallerFileName).rpm - $(ScriptsDir)/$(AfterInstallHostScriptName) - $(RpmLayoutScripts)/$(AfterInstallHostScriptName) - - - - $(RepoRoot)/test/EndToEnd/EndToEnd.csproj - + @@ -141,6 +96,11 @@ + + + + + @@ -183,16 +143,54 @@ - + + + $(SdkVersion) + $(OutputDirectory)/sdk + $(InstallerOutputDirectory)/$(DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(InstallerExtension) + $(SdkInstallerFile) + $(RepoRoot)/Documentation/manpages + $(RepoRoot)/packaging/rpm/dotnet-config.json + $(IntermediateDirectory)/$(RpmPackageName)/$(RpmPackageVersion) + $(RpmIntermediatesDir)/debian-testResults.xml + /usr/share/dotnet + + + + $(RpmIntermediatesDir)/RpmLayoutDirectory/ + $(RpmLayoutDirectory)package_root + $(RpmLayoutPackageRoot)/sdk + $(RpmLayoutDirectory)docs + $(RpmLayoutDirectory)templates + $(RpmLayoutDirectory)scripts + + + + $(SdkVersion) + $(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkRpmPackageVersion) + $(SharedFrameworkVersion) + dotnet-runtime-$(SharedFxRpmPackageVersion) + $(SharedFxRpmPackageName.ToLower()) + $(HostFxrVersion) + dotnet-hostfxr-$(HostFxrRpmPackageVersion) + $(HostFxrRpmPackageName.ToLower()) + dotnet-host + $(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreRuntimePackageVersion) + $(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreRuntimePackageVersion)-$(HostRid).rpm + $(ScriptsDir)/$(AfterInstallHostScriptName) + $(RpmLayoutScripts)/$(AfterInstallHostScriptName) + + + + $(RepoRoot)/test/EndToEnd/EndToEnd.csproj + + + + - $(AspNetCoreRuntimePackageBrandName)-2.0.0-$(HostRidInAspNetCoreRuntimeRpmInstallerFileName).rpm - $(PackagesDirectory)/$(AspNetCoreRuntimeRpmInstallerFileName200) $(PackagesDirectory)/$(AspNetCoreRuntimeRpmInstallerFileName) - @@ -219,7 +217,7 @@ - @@ -241,14 +238,13 @@ ToolPath="$(RpmInstalledDirectory)" /> - diff --git a/build/package/Nupkg.targets b/build/package/Nupkg.targets index 9158c2143..d7287c8b7 100644 --- a/build/package/Nupkg.targets +++ b/build/package/Nupkg.targets @@ -24,7 +24,7 @@ @@ -34,7 +34,7 @@ - diff --git a/build/package/dotnet-deb-tool-consumer.csproj b/build/package/dotnet-deb-tool-consumer/dotnet-deb-tool-consumer.csproj similarity index 74% rename from build/package/dotnet-deb-tool-consumer.csproj rename to build/package/dotnet-deb-tool-consumer/dotnet-deb-tool-consumer.csproj index a48d3d6f2..03e67c852 100644 --- a/build/package/dotnet-deb-tool-consumer.csproj +++ b/build/package/dotnet-deb-tool-consumer/dotnet-deb-tool-consumer.csproj @@ -1,6 +1,4 @@ - - netcoreapp2.0 $(CLI_SharedFrameworkVersion) diff --git a/build/prepare/CheckPrereqs.targets b/build/prepare/CheckPrereqs.targets index 1e7454410..03d743c35 100644 --- a/build/prepare/CheckPrereqs.targets +++ b/build/prepare/CheckPrereqs.targets @@ -8,8 +8,8 @@ DependsOnTargets="CheckUbuntuAptGetDependencies; CheckCentOsYumDependencies;"> - - + + - \ No newline at end of file + + + + $(OSName)_$(Architecture) + rhel.6_x64 + linux_x64 + all_linux_distros_native_installer + + $(BaseOutputDirectory)/$(VersionBadgeMoniker)_$(Configuration)_version_badge.svg + $(BaseOutputDirectory)/$(VersionBadgeMoniker)_$(Configuration)_coherent_badge.svg + + + diff --git a/build/publish/PublishDebian.targets b/build/publish/PublishDebian.targets index 43ab5abda..801230fb0 100644 --- a/build/publish/PublishDebian.targets +++ b/build/publish/PublishDebian.targets @@ -4,30 +4,20 @@ dotnet-sdk-$(SdkVersion) - - $(DotnetBlobRootUrl)/$(Product)/$(FullNugetVersion)/$(DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(InstallerExtension) - $(SdkDebianIntermediateDirectory)/package_upload.json - 1 + + + + - - { - "name":"$(SdkDebianPackageName)", - "version":"$(NugetVersion)-$(DebianRevisionNumber)", - "repositoryId":"$(REPO_ID)", - "sourceUrl": "$(SdkDebianUploadUrl)" - } - - - - - - - - - - - - - + diff --git a/build/sdks/sdks.csproj b/build/sdks/sdks.csproj index b7c9941c0..f246e1f9d 100755 --- a/build/sdks/sdks.csproj +++ b/build/sdks/sdks.csproj @@ -9,6 +9,7 @@ + diff --git a/build/test/RunTest.proj b/build/test/RunTest.proj index 8b1ec899f..0454d8a6f 100644 --- a/build/test/RunTest.proj +++ b/build/test/RunTest.proj @@ -11,7 +11,13 @@ - + + + + + + + test/Performance/Performance.csproj; + test/Microsoft.DotNet.TestFramework/Microsoft.DotNet.TestFramework.csproj" /> diff --git a/build_projects/Microsoft.DotNet.Cli.Build.Framework/Microsoft.DotNet.Cli.Build.Framework.csproj b/build_projects/Microsoft.DotNet.Cli.Build.Framework/Microsoft.DotNet.Cli.Build.Framework.csproj index dd2f94e91..fefc8affe 100644 --- a/build_projects/Microsoft.DotNet.Cli.Build.Framework/Microsoft.DotNet.Cli.Build.Framework.csproj +++ b/build_projects/Microsoft.DotNet.Cli.Build.Framework/Microsoft.DotNet.Cli.Build.Framework.csproj @@ -1,5 +1,4 @@  - netstandard1.5 diff --git a/build_projects/dotnet-cli-build.Tests/GivenActionAndRetryTimes.cs b/build_projects/dotnet-cli-build.Tests/GivenActionAndRetryTimes.cs new file mode 100644 index 000000000..47c83e0a7 --- /dev/null +++ b/build_projects/dotnet-cli-build.Tests/GivenActionAndRetryTimes.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using FluentAssertions; +using Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository; +using Xunit; + +namespace dotnet_cli_build.Tests +{ + public class GivenActionAndRetryTimes + { + public static IEnumerable NoWaitTimer() + { + while (true) + { + yield return Task.CompletedTask; + } + } + + [Fact] + public void ExponentialRetryShouldProvideIntervalSequence() + { + ExponentialRetry.Intervals.First().Should().Be(TimeSpan.FromSeconds(5)); + ExponentialRetry.Intervals.Skip(1).First().Should().Be(TimeSpan.FromSeconds(10)); + ExponentialRetry.Intervals.Skip(2).First().Should().Be(TimeSpan.FromSeconds(20)); + ExponentialRetry.Intervals.Skip(3).First().Should().Be(TimeSpan.FromSeconds(40)); + ExponentialRetry.Intervals.Skip(4).First().Should().Be(TimeSpan.FromSeconds(80)); + } + + [Fact] + public void ExponentialShouldNotRetryAfterFirstSucceess() + { + var fakeAction = new FakeAction(0); + ExponentialRetry.ExecuteWithRetry( + fakeAction.Run, + s => s == "success", + 10, + NoWaitTimer).Wait(); + fakeAction.Count.Should().Be(0); + } + + [Fact] + public void ExponentialShouldRetryUntilSuccess() + { + var fakeAction = new FakeAction(5); + ExponentialRetry.ExecuteWithRetry( + fakeAction.Run, + s => s == "success", + 10, + NoWaitTimer).Wait(); + fakeAction.Count.Should().Be(5); + } + + [Fact] + public void ExponentialShouldThrowAfterMaximumAmountReached() + { + var fakeAction = new FakeAction(10); + Action a = () => ExponentialRetry.ExecuteWithRetry( + fakeAction.Run, + s => s == "success", + 5, + NoWaitTimer, + "testing retry").Wait(); + a.ShouldThrow() + .WithMessage("Retry failed for testing retry after 5 times with result: fail"); + } + } + + public class FakeAction + { + private readonly int _successAfter; + + public FakeAction(int successAfter) + { + _successAfter = successAfter; + } + + public int Count { get; private set; } + + public Task Run() + { + if (_successAfter == Count) + { + return Task.FromResult("success"); + } + + Count++; + return Task.FromResult("fail"); + } + } +} \ No newline at end of file diff --git a/build_projects/dotnet-cli-build.Tests/dotnet-cli-build.Tests.csproj b/build_projects/dotnet-cli-build.Tests/dotnet-cli-build.Tests.csproj new file mode 100644 index 000000000..e28340dda --- /dev/null +++ b/build_projects/dotnet-cli-build.Tests/dotnet-cli-build.Tests.csproj @@ -0,0 +1,22 @@ + + + + + $(CliTargetFramework) + 1.0.0 + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81 + false + + + + + + + + + + + + + + diff --git a/build_projects/dotnet-cli-build/CheckIfAllBuildsHavePublished.cs b/build_projects/dotnet-cli-build/CheckIfAllBuildsHavePublished.cs index 1dfb0b3de..5b9073097 100644 --- a/build_projects/dotnet-cli-build/CheckIfAllBuildsHavePublished.cs +++ b/build_projects/dotnet-cli-build/CheckIfAllBuildsHavePublished.cs @@ -52,11 +52,9 @@ namespace Microsoft.DotNet.Cli.Build { "win_x86", false }, { "win_x64", false }, { "osx_x64", false }, - { "debian_8_x64", false }, - { "rhel_7_x64", false }, - { "ubuntu_14_04_x64", false }, - { "ubuntu_16_04_x64", false }, - { "linux_x64", false } + { "linux_x64", false }, + { "rhel.6_x64", false }, + { "all_linux_distros_native_installer", false} }; if (!badges.ContainsKey(VersionBadgeMoniker)) diff --git a/build_projects/dotnet-cli-build/DotNetMSBuildTool.cs b/build_projects/dotnet-cli-build/DotNetMSBuildTool.cs index 18cca3ab3..f0ab3f3a5 100644 --- a/build_projects/dotnet-cli-build/DotNetMSBuildTool.cs +++ b/build_projects/dotnet-cli-build/DotNetMSBuildTool.cs @@ -13,11 +13,13 @@ namespace Microsoft.DotNet.Cli.Build public string Verbosity { get; set; } + public string AdditionalParameters { get; set; } + protected override string Args { get { - return $"{GetVerbosityArg()} {GetMaxCpuCountArg()}"; + return $"{GetVerbosityArg()} {GetMaxCpuCountArg()} {GetAdditionalParameters()}"; } } @@ -40,5 +42,10 @@ namespace Microsoft.DotNet.Cli.Build return null; } + + private string GetAdditionalParameters() + { + return AdditionalParameters; + } } } diff --git a/build_projects/dotnet-cli-build/DotNetRestore.cs b/build_projects/dotnet-cli-build/DotNetRestore.cs index 88bca5e22..d7d984be3 100644 --- a/build_projects/dotnet-cli-build/DotNetRestore.cs +++ b/build_projects/dotnet-cli-build/DotNetRestore.cs @@ -12,13 +12,11 @@ namespace Microsoft.DotNet.Cli.Build protected override string Args { - get { return $"{base.Args} {GetProjectPath()} {GetConfigFile()} {GetSource()} {GetPackages()} {GetSkipInvalidConfigurations()} {GetRuntime()} {GetAdditionalParameters()}"; } + get { return $"{base.Args} {GetProjectPath()} {GetConfigFile()} {GetSource()} {GetPackages()} {GetSkipInvalidConfigurations()} {GetRuntime()} {AdditionalParameters}"; } } public string ConfigFile { get; set; } - public string AdditionalParameters { get; set; } - public string ProjectPath { get; set; } public string Source { get; set; } @@ -88,10 +86,5 @@ namespace Microsoft.DotNet.Cli.Build return null; } - - private string GetAdditionalParameters() - { - return AdditionalParameters; - } } } diff --git a/build_projects/dotnet-cli-build/EnsureFileExistsOnAzureBlobStorage.cs b/build_projects/dotnet-cli-build/EnsureFileExistsOnAzureBlobStorage.cs new file mode 100644 index 000000000..e795349ff --- /dev/null +++ b/build_projects/dotnet-cli-build/EnsureFileExistsOnAzureBlobStorage.cs @@ -0,0 +1,40 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using Microsoft.Build.Framework; +using Microsoft.WindowsAzure.Storage.Blob; +using System.Threading.Tasks; + +namespace Microsoft.DotNet.Build.CloudTestTasks +{ + public class EnsureFileExistsOnAzureBlobStorage : Microsoft.Build.Utilities.Task + { + [Required] + public string FileUrl{ get; set; } + + public override bool Execute() + { + if (!ExecuteAsync().GetAwaiter().GetResult()) + { + throw new FileDoesNotExistOnAzureBlobStorageException(FileUrl); + + } + return true; + } + + private Task ExecuteAsync() + { + var blobClient = new CloudBlockBlob(new Uri(FileUrl)); + return blobClient.ExistsAsync(); + } + + public class FileDoesNotExistOnAzureBlobStorageException : Exception + { + public FileDoesNotExistOnAzureBlobStorageException(string message) : base(message + " cannot be found on Azure Blob Storage") + { + } + } + } +} diff --git a/build_projects/dotnet-cli-build/MakeRelative.cs b/build_projects/dotnet-cli-build/MakeRelative.cs index e8f04b159..6361f341c 100644 --- a/build_projects/dotnet-cli-build/MakeRelative.cs +++ b/build_projects/dotnet-cli-build/MakeRelative.cs @@ -17,21 +17,12 @@ namespace Microsoft.DotNet.Cli.Build [Required] public string Path2 { get; set; } - public char SeparatorChar { get; set; } - [Output] public ITaskItem RelativePath { get; set; } public override bool Execute() { - if (SeparatorChar == default(char)) - { - SeparatorChar = Path.DirectorySeparatorChar; - } - - var relativePath = GetRelativePath(Path1, Path2, SeparatorChar); - - RelativePath = ToTaskItem(Path1, Path2, relativePath); + RelativePath = ToTaskItem(Path1, Path2, Path.GetRelativePath(Path1, Path2)); return true; } @@ -47,75 +38,5 @@ namespace Microsoft.DotNet.Cli.Build return framework; } - - private static string GetRelativePath(string path1, string path2, char separator = default(char)) - { - - StringComparison compare; - if (CurrentPlatform.IsWindows) - { - 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; - } - - 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; - } } } diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/AddPackageStrategy.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/AddPackageStrategy.cs new file mode 100644 index 000000000..eba259a7d --- /dev/null +++ b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/AddPackageStrategy.cs @@ -0,0 +1,62 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository +{ + internal class AddPackageStrategy : IAzurelinuxRepositoryServiceHttpStrategy + { + private readonly IdInRepositoryService _idInRepositoryService; + private readonly string _packageName; + private readonly string _packageVersion; + private readonly string _repositoryId; + + public AddPackageStrategy( + IdInRepositoryService idInRepositoryService, + string packageName, + string packageVersion, + string repositoryId) + { + _idInRepositoryService = idInRepositoryService + ?? throw new ArgumentNullException(nameof(idInRepositoryService)); + _packageName = packageName; + _packageVersion = packageVersion; + _repositoryId = repositoryId; + } + + public async Task Execute(HttpClient client, Uri baseAddress) + { + var debianUploadJsonContent = JsonConvert.SerializeObject(new Dictionary + { + ["name"] = _packageName, + ["version"] = AppendDebianRevisionNumber(_packageVersion), + ["fileId"] = _idInRepositoryService.Id, + ["repositoryId"] = _repositoryId + }); + var content = new StringContent(debianUploadJsonContent, + Encoding.UTF8, + "application/json"); + + using (var response = await client.PostAsync(new Uri(baseAddress, "/v1/packages"), content)) + { + if (!response.IsSuccessStatusCode) + throw new FailedToAddPackageToPackageRepositoryException( + $"request:{debianUploadJsonContent} response:{JsonConvert.SerializeObject(response)}"); + return response.Headers.GetValues("Location").Single(); + } + } + + private static string AppendDebianRevisionNumber(string packageVersion) + { + return packageVersion + "-1"; + } + } +} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/ExponentialRetry.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/ExponentialRetry.cs new file mode 100644 index 000000000..df3590940 --- /dev/null +++ b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/ExponentialRetry.cs @@ -0,0 +1,53 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository +{ + public static class ExponentialRetry + { + public static IEnumerable Intervals + { + get + { + var seconds = 5; + while (true) + { + yield return TimeSpan.FromSeconds(seconds); + seconds *= 2; + } + } + } + + public static async Task ExecuteWithRetry(Func> action, + Func isSuccess, + int maxRetryCount, + Func> timer, + string taskDescription = "") + { + var count = 0; + foreach (var t in timer()) + { + await t; + var result = await action(); + if (isSuccess(result)) + return; + count++; + if (count == maxRetryCount) + throw new RetryFailedException( + $"Retry failed for {taskDescription} after {count} times with result: {result}"); + } + throw new Exception("Timer should not be exhausted"); + } + + public static IEnumerable Timer(IEnumerable interval) + { + return interval.Select(Task.Delay); + } + } +} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/FailedToAddPackageToPackageRepositoryException.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/FailedToAddPackageToPackageRepositoryException.cs new file mode 100644 index 000000000..68c314c08 --- /dev/null +++ b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/FailedToAddPackageToPackageRepositoryException.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; + +namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository +{ + public class FailedToAddPackageToPackageRepositoryException : Exception + { + public FailedToAddPackageToPackageRepositoryException(string message) : base(message) + { + } + + public FailedToAddPackageToPackageRepositoryException() + { + } + + public FailedToAddPackageToPackageRepositoryException(string message, Exception innerException) : base(message, + innerException) + { + } + } +} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/FileUploadStrategy.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/FileUploadStrategy.cs new file mode 100644 index 000000000..e71eca436 --- /dev/null +++ b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/FileUploadStrategy.cs @@ -0,0 +1,49 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.IO; +using System.Net.Http; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository +{ + internal class FileUploadStrategy : IAzurelinuxRepositoryServiceHttpStrategy + { + private readonly string _pathToPackageToUpload; + + public FileUploadStrategy(string pathToPackageToUpload) + { + _pathToPackageToUpload = pathToPackageToUpload + ?? throw new ArgumentNullException(nameof(pathToPackageToUpload)); + } + + public async Task Execute(HttpClient client, Uri baseAddress) + { + var fileName = Path.GetFileName(_pathToPackageToUpload); + + using (var content = + new MultipartFormDataContent()) + { + var url = new Uri(baseAddress, "/v1/files"); + content.Add( + new StreamContent( + new MemoryStream( + File.ReadAllBytes(_pathToPackageToUpload))), + "file", + fileName); + using (var message = await client.PostAsync(url, content)) + { + if (!message.IsSuccessStatusCode) + { + throw new FailedToAddPackageToPackageRepositoryException( + $"{JsonConvert.SerializeObject(message)} failed to post file to {url} file name:{fileName} pathToPackageToUpload:{_pathToPackageToUpload}"); + } + return await message.Content.ReadAsStringAsync(); + } + } + } + } +} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/IAzurelinuxRepositoryServiceHttpStrategy.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/IAzurelinuxRepositoryServiceHttpStrategy.cs new file mode 100644 index 000000000..a829f398a --- /dev/null +++ b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/IAzurelinuxRepositoryServiceHttpStrategy.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Net.Http; +using System.Threading.Tasks; + +namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository +{ + internal interface IAzurelinuxRepositoryServiceHttpStrategy + { + Task Execute(HttpClient client, Uri baseAddress); + } +} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/IdInRepositoryService.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/IdInRepositoryService.cs new file mode 100644 index 000000000..b51ebb3be --- /dev/null +++ b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/IdInRepositoryService.cs @@ -0,0 +1,18 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; + +namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository +{ + internal class IdInRepositoryService + { + public IdInRepositoryService(string id) + { + Id = id ?? throw new ArgumentNullException(nameof(id)); + } + + public string Id { get; } + } +} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/LinuxPackageRepositoryDestiny.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/LinuxPackageRepositoryDestiny.cs new file mode 100644 index 000000000..aa2e6d9bc --- /dev/null +++ b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/LinuxPackageRepositoryDestiny.cs @@ -0,0 +1,38 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; + +namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository +{ + internal class LinuxPackageRepositoryDestiny + { + private readonly string _password; + private readonly string _server; + private readonly string _username; + + public LinuxPackageRepositoryDestiny(string username, + string password, + string server, + string repositoryId) + { + _username = username ?? throw new ArgumentNullException(nameof(username)); + _password = password ?? throw new ArgumentNullException(nameof(password)); + _server = server ?? throw new ArgumentNullException(nameof(server)); + RepositoryId = repositoryId ?? throw new ArgumentNullException(nameof(repositoryId)); + } + + public string RepositoryId { get; } + + public Uri GetBaseAddress() + { + return new Uri($"https://{_server}"); + } + + public string GetSimpleAuth() + { + return $"{_username}:{_password}"; + } + } +} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/LinuxPackageRepositoryHttpPrepare.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/LinuxPackageRepositoryHttpPrepare.cs new file mode 100644 index 000000000..7e1f9ade7 --- /dev/null +++ b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/LinuxPackageRepositoryHttpPrepare.cs @@ -0,0 +1,46 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Threading.Tasks; + +namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository +{ + internal class LinuxPackageRepositoryHttpPrepare + { + private readonly IAzurelinuxRepositoryServiceHttpStrategy _httpStrategy; + private readonly LinuxPackageRepositoryDestiny _linuxPackageRepositoryDestiny; + + public LinuxPackageRepositoryHttpPrepare( + LinuxPackageRepositoryDestiny linuxPackageRepositoryDestiny, + IAzurelinuxRepositoryServiceHttpStrategy httpStrategy + ) + { + _linuxPackageRepositoryDestiny = linuxPackageRepositoryDestiny + ?? throw new ArgumentNullException(nameof(linuxPackageRepositoryDestiny)); + _httpStrategy = httpStrategy ?? throw new ArgumentNullException(nameof(httpStrategy)); + } + + public async Task RemoteCall() + { + using (var handler = new HttpClientHandler()) + { + using (var client = new HttpClient(handler)) + { + var authHeader = + Convert.ToBase64String(Encoding.UTF8.GetBytes((string) _linuxPackageRepositoryDestiny.GetSimpleAuth())); + client.DefaultRequestHeaders.Authorization = + new AuthenticationHeaderValue("Basic", authHeader); + client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + client.Timeout = TimeSpan.FromMinutes(10); + + return await _httpStrategy.Execute(client, _linuxPackageRepositoryDestiny.GetBaseAddress()); + } + } + } + } +} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/PullQueuedPackageStatus.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/PullQueuedPackageStatus.cs new file mode 100644 index 000000000..393a160ae --- /dev/null +++ b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/PullQueuedPackageStatus.cs @@ -0,0 +1,34 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Net.Http; +using System.Threading.Tasks; +using Newtonsoft.Json.Linq; + +namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository +{ + internal class PullQueuedPackageStatus : IAzurelinuxRepositoryServiceHttpStrategy + { + private readonly QueueResourceLocation _queueResourceLocation; + + public PullQueuedPackageStatus(QueueResourceLocation queueResourceLocation) + { + _queueResourceLocation = queueResourceLocation + ?? throw new ArgumentNullException(nameof(queueResourceLocation)); + } + + public async Task Execute(HttpClient client, Uri baseAddress) + { + using (var response = await client.GetAsync(new Uri(baseAddress, _queueResourceLocation.Location))) + { + if (!response.IsSuccessStatusCode) + throw new FailedToAddPackageToPackageRepositoryException( + "Failed to make request to " + _queueResourceLocation.Location); + var body = await response.Content.ReadAsStringAsync(); + return !body.Contains("status") ? "" : JObject.Parse(body)["status"].ToString(); + } + } + } +} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/QueueResourceLocation.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/QueueResourceLocation.cs new file mode 100644 index 000000000..cbf11e48d --- /dev/null +++ b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/QueueResourceLocation.cs @@ -0,0 +1,18 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; + +namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository +{ + internal class QueueResourceLocation + { + public QueueResourceLocation(string location) + { + Location = location ?? throw new ArgumentNullException(nameof(location)); + } + + public string Location { get; } + } +} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/RetryFailedException.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/RetryFailedException.cs new file mode 100644 index 000000000..b251ec4b8 --- /dev/null +++ b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/RetryFailedException.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; + +namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository +{ + public class RetryFailedException : Exception + { + public RetryFailedException(string message) : base(message) + { + } + + public RetryFailedException() + { + } + + public RetryFailedException(string message, Exception innerException) : base(message, innerException) + { + } + } +} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/UploadToLinuxPackageRepository.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/UploadToLinuxPackageRepository.cs new file mode 100644 index 000000000..00099bd14 --- /dev/null +++ b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/UploadToLinuxPackageRepository.cs @@ -0,0 +1,121 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Net.Http; +using System.Threading.Tasks; +using Microsoft.Build.Framework; +using Newtonsoft.Json.Linq; +using Task = Microsoft.Build.Utilities.Task; + +namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository +{ + public class UploadToLinuxPackageRepository : Task + { + /// + /// The Azure repository service user name. + /// + [Required] + public string Username { get; set; } + + /// + /// The Azure repository service Password. + /// + [Required] + public string Password { get; set; } + + /// + /// The Azure repository service URL ex: "tux-devrepo.corp.microsoft.com". + /// + [Required] + public string Server { get; set; } + + [Required] + public string RepositoryId { get; set; } + + [Required] + public string PathOfPackageToUpload { get; set; } + + [Required] + public string PackageNameInLinuxPackageRepository { get; set; } + + + [Required] + public string PackageVersionInLinuxPackageRepository { get; set; } + + + public override bool Execute() + { + ExecuteAsyncWithRetry().GetAwaiter().GetResult(); + return true; + } + + private async System.Threading.Tasks.Task ExecuteAsyncWithRetry() + { + await ExponentialRetry.ExecuteWithRetry( + UploadAndAddpackageAndEnsureItIsReady, + s => s == "", + maxRetryCount: 3, + timer: () => ExponentialRetry.Timer(ExponentialRetry.Intervals), + taskDescription: $"running {nameof(UploadAndAddpackageAndEnsureItIsReady)}"); + } + + private async Task UploadAndAddpackageAndEnsureItIsReady() + { + try + { + Log.LogMessage( + MessageImportance.High, + "Begin uploading Linux Package to feed service, RepositoryId {0}, Server {1}, Package to upload {2}.", + RepositoryId, + Server, + PathOfPackageToUpload); + + var linuxPackageRepositoryDestiny = + new LinuxPackageRepositoryDestiny(Username, Password, Server, RepositoryId); + var uploadResponse = await new LinuxPackageRepositoryHttpPrepare( + linuxPackageRepositoryDestiny, + new FileUploadStrategy(PathOfPackageToUpload)).RemoteCall(); + + var idInRepositoryService = new IdInRepositoryService(JObject.Parse(uploadResponse)["id"].ToString()); + + var addPackageResponse = await new LinuxPackageRepositoryHttpPrepare( + linuxPackageRepositoryDestiny, + new AddPackageStrategy( + idInRepositoryService, + PackageNameInLinuxPackageRepository, + PackageVersionInLinuxPackageRepository, + linuxPackageRepositoryDestiny.RepositoryId)).RemoteCall(); + + var queueResourceLocation = new QueueResourceLocation(addPackageResponse); + + Func> pullQueuedPackageStatus = new LinuxPackageRepositoryHttpPrepare( + linuxPackageRepositoryDestiny, + new PullQueuedPackageStatus(queueResourceLocation)).RemoteCall; + + await ExponentialRetry.ExecuteWithRetry( + pullQueuedPackageStatus, + s => s == "fileReady", + 5, + () => ExponentialRetry.Timer(ExponentialRetry.Intervals), + $"PullQueuedPackageStatus location: {queueResourceLocation.Location}"); + + Log.LogMessage( + MessageImportance.High, + "Upload to feed service is completed, queue resource location {0}", + queueResourceLocation.Location); + + return ""; + } + catch (FailedToAddPackageToPackageRepositoryException e) + { + return e.ToString(); + } + catch (HttpRequestException e) + { + return e.ToString(); + } + } + } +} diff --git a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj index 07a4de29d..e18939f5e 100644 --- a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj +++ b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj @@ -1,5 +1,4 @@ - Build scripts for dotnet-cli 1.0.0 @@ -15,6 +14,7 @@ + @@ -22,12 +22,13 @@ + - + diff --git a/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj b/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj index 14a4c4a33..ed7002589 100644 --- a/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj +++ b/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj @@ -1,5 +1,4 @@  - Build scripts for dotnet-cli diff --git a/build_projects/update-dependencies/Config.cs b/build_projects/update-dependencies/Config.cs index 0bd5a0c6a..9ba4b41ea 100644 --- a/build_projects/update-dependencies/Config.cs +++ b/build_projects/update-dependencies/Config.cs @@ -20,7 +20,7 @@ namespace Microsoft.DotNet.Scripts /// /// The following Environment Variables can optionally be specified: /// - /// DOTNET_VERSION_URL - The Url to the root of the version information (this is combined with the fragments bellow) (ex. "https://raw.githubusercontent.com/dotnet/versions/master/build-info") + /// DOTNET_VERSION_URL - The Url to the root of the version information (this is combined with the fragments below) (ex. "https://raw.githubusercontent.com/dotnet/versions/master/build-info") /// ROSLYN_VERSION_FRAGMENT - The fragment to combine with DOTNET_VERSION_URL to get the current dotnet/roslyn package versions. (ex. "dotnet/roslyn/netcore1.0") /// CORESETUP_VERSION_FRAGMENT - The fragment to combine with DOTNET_VERSION_URL to get the current dotnet/core-setup package versions. (ex. "dotnet/core-setup/master") /// GITHUB_ORIGIN_OWNER - The owner of the GitHub fork to push the commit and create the PR from. (ex. "dotnet-bot") diff --git a/build_projects/update-dependencies/Directory.Build.props b/build_projects/update-dependencies/Directory.Build.props new file mode 100644 index 000000000..a8d332ca6 --- /dev/null +++ b/build_projects/update-dependencies/Directory.Build.props @@ -0,0 +1,8 @@ + + + + + diff --git a/build_projects/update-dependencies/update-dependencies.csproj b/build_projects/update-dependencies/update-dependencies.csproj index 2f82553fe..af401660d 100644 --- a/build_projects/update-dependencies/update-dependencies.csproj +++ b/build_projects/update-dependencies/update-dependencies.csproj @@ -4,7 +4,7 @@ Updates the repos dependencies Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/build_projects/update-dependencies/update-dependencies.ps1 b/build_projects/update-dependencies/update-dependencies.ps1 index b76d10bc1..4f23db26b 100644 --- a/build_projects/update-dependencies/update-dependencies.ps1 +++ b/build_projects/update-dependencies/update-dependencies.ps1 @@ -34,6 +34,8 @@ if (!$env:DOTNET_INSTALL_DIR) $env:DOTNET_INSTALL_DIR="$RepoRoot\.dotnet_stage0\$Architecture" } +$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + # Install a stage 0 Write-Output "Installing .NET Core CLI Stage 0" & "$RepoRoot\scripts\obtain\dotnet-install.ps1" -Channel "master" -Architecture $Architecture @@ -42,11 +44,6 @@ if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" } # Put the stage0 on the path $env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH" -# Restore the app -Write-Output "Restoring $ProjectPath..." -dotnet restore "$ProjectPath" -if($LASTEXITCODE -ne 0) { throw "Failed to restore" } - # Run the app Write-Output "Invoking App $ProjectPath..." dotnet run -p "$ProjectPath" "$ProjectArgs" diff --git a/build_projects/update-dependencies/update-dependencies.sh b/build_projects/update-dependencies/update-dependencies.sh index 4781c8453..5e4872bf9 100755 --- a/build_projects/update-dependencies/update-dependencies.sh +++ b/build_projects/update-dependencies/update-dependencies.sh @@ -30,6 +30,8 @@ if [ -z "${DOTNET_INSTALL_DIR:-}" ]; then export DOTNET_INSTALL_DIR=$REPO_ROOT/.dotnet_stage0/x64 fi +export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + # Install a stage 0 echo "Installing .NET Core CLI Stage 0" $REPO_ROOT/scripts/obtain/dotnet-install.sh -Channel master -Architecture x64 @@ -42,14 +44,6 @@ fi # Put the stage 0 on the path export PATH=$DOTNET_INSTALL_DIR:$PATH -echo "Restoring $PROJECT_PATH..." -dotnet restore "$PROJECT_PATH" - -if [ $? -ne 0 ]; then - echo "Failed to restore" - exit 1 -fi - echo "Invoking App $PROJECT_PATH..." dotnet run -p "$PROJECT_PATH" $@ diff --git a/dir.props b/dir.props index 756fccc32..875fe07ca 100644 --- a/dir.props +++ b/dir.props @@ -1,46 +1,4 @@ - - - - $(MSBuildThisFileDirectory) - - $(NUGET_PACKAGES) - $(RepoRoot)/.nuget/packages - - $(RepoRoot)/build_projects/dotnet-cli-build/bin/dotnet-cli-build.dll - - true - true - - netcoreapp2.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + diff --git a/netci.groovy b/netci.groovy index ca09235d7..fd1e9c520 100644 --- a/netci.groovy +++ b/netci.groovy @@ -9,7 +9,7 @@ def project = GithubProject def branch = GithubBranchName def isPR = true -def platformList = ['Linux:x64:Release', 'Debian8.2:x64:Debug', 'Ubuntu:x64:Release', 'Ubuntu16.04:x64:Debug', 'OSX10.12:x64:Release', 'Windows_NT:x64:Release', 'Windows_NT:x86:Debug', 'RHEL7.2:x64:Release', 'CentOS7.1:x64:Debug'] +def platformList = ['Linux:x64:Release', 'Debian8.2:x64:Debug', 'Ubuntu:x64:Release', 'Ubuntu16.04:x64:Debug', 'OSX10.12:x64:Release', 'Windows_NT:x64:Release', 'Windows_NT:x86:Debug', 'Windows_NT_ES:x64:Debug', 'RHEL7.2:x64:Release', 'CentOS7.1:x64:Debug', 'RHEL6:x64:Debug'] def static getBuildJobName(def configuration, def os, def architecture) { return configuration.toLowerCase() + '_' + os.toLowerCase() + '_' + architecture.toLowerCase() @@ -32,6 +32,13 @@ platformList.each { platform -> else if (os == 'Windows_2016') { buildCommand = ".\\build.cmd -Configuration ${configuration} -Architecture ${architecture} -RunInstallerTestsInDocker -Targets Default" } + else if (os == 'Windows_NT_ES') { + osUsedForMachineAffinity = 'Windows_NT' + buildCommand = """ +set DOTNET_CLI_UI_LANGUAGE=es +.\\build.cmd -Configuration ${configuration} -Architecture ${architecture} -Targets Default +""" + } else if (os == 'Ubuntu') { buildCommand = "./build.sh --skip-prereqs --configuration ${configuration} --docker ubuntu.14.04 --targets Default" } @@ -39,6 +46,10 @@ platformList.each { platform -> osUsedForMachineAffinity = 'Ubuntu16.04'; buildCommand = "./build.sh --linux-portable --skip-prereqs --configuration ${configuration} --targets Default" } + else if (os == 'RHEL6') { + osUsedForMachineAffinity = 'Ubuntu16.04'; + buildCommand = "./build.sh --skip-prereqs --configuration ${configuration} --runtime-id rhel.6-x64 --docker rhel.6 --targets Default" + } else { // Jenkins non-Ubuntu CI machines don't have docker buildCommand = "./build.sh --skip-prereqs --configuration ${configuration} --targets Default" @@ -47,7 +58,7 @@ platformList.each { platform -> def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) { // Set the label. steps { - if (os == 'Windows_NT' || os == 'Windows_2016') { + if (osUsedForMachineAffinity == 'Windows_NT' || osUsedForMachineAffinity == 'Windows_2016') { // Batch batchFile(buildCommand) } diff --git a/packaging/deb/postinst b/packaging/deb/postinst index 9eb33f532..4ac4d35e4 100755 --- a/packaging/deb/postinst +++ b/packaging/deb/postinst @@ -5,19 +5,18 @@ echo "Please visit http://aka.ms/dotnet-cli-eula for more information." # Run 'dotnet new' to trigger the first time experience to initialize the cache echo "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. +Learn more about .NET Core: https://aka.ms/dotnet-docs +Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli-docs -.NET Core Tools Telemetry +Telemetry +--------- +The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. + +Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry + +Configuring... -------------- -The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them. - -The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License. - -The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at https://aka.ms/dotnet-cli-telemetry. - -Installation Note --------------- -A command will be run during the install process that will improve project restore speed and enable offline access. It will take up to a minute to complete." +A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once." first_run() { /usr/share/dotnet/dotnet exec /usr/share/dotnet/sdk/%SDK_VERSION%/dotnet.dll internal-reportinstallsuccess "debianpackage" > /dev/null 2>&1 || true diff --git a/packaging/osx/clisdk/resources/cs.lproj/conclusion.html b/packaging/osx/clisdk/resources/cs.lproj/conclusion.html index 16f74ec00..f653dd2f5 100644 --- a/packaging/osx/clisdk/resources/cs.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/cs.lproj/conclusion.html @@ -7,8 +7,8 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.2
  • -
  • .NET Core Runtime 2.0.3
  • +
  • .NET Core SDK 2.2.0
  • +
  • .NET Core Runtime 2.1.0
  • Runtime Package Store
diff --git a/packaging/osx/clisdk/resources/de.lproj/conclusion.html b/packaging/osx/clisdk/resources/de.lproj/conclusion.html index 16f74ec00..f653dd2f5 100644 --- a/packaging/osx/clisdk/resources/de.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/de.lproj/conclusion.html @@ -7,8 +7,8 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.2
  • -
  • .NET Core Runtime 2.0.3
  • +
  • .NET Core SDK 2.2.0
  • +
  • .NET Core Runtime 2.1.0
  • Runtime Package Store
diff --git a/packaging/osx/clisdk/resources/en.lproj/conclusion.html b/packaging/osx/clisdk/resources/en.lproj/conclusion.html index 16f74ec00..f653dd2f5 100644 --- a/packaging/osx/clisdk/resources/en.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/en.lproj/conclusion.html @@ -7,8 +7,8 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.2
  • -
  • .NET Core Runtime 2.0.3
  • +
  • .NET Core SDK 2.2.0
  • +
  • .NET Core Runtime 2.1.0
  • Runtime Package Store
diff --git a/packaging/osx/clisdk/resources/es.lproj/conclusion.html b/packaging/osx/clisdk/resources/es.lproj/conclusion.html index 16f74ec00..f653dd2f5 100644 --- a/packaging/osx/clisdk/resources/es.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/es.lproj/conclusion.html @@ -7,8 +7,8 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.2
  • -
  • .NET Core Runtime 2.0.3
  • +
  • .NET Core SDK 2.2.0
  • +
  • .NET Core Runtime 2.1.0
  • Runtime Package Store
diff --git a/packaging/osx/clisdk/resources/fr.lproj/conclusion.html b/packaging/osx/clisdk/resources/fr.lproj/conclusion.html index 16f74ec00..f653dd2f5 100644 --- a/packaging/osx/clisdk/resources/fr.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/fr.lproj/conclusion.html @@ -7,8 +7,8 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.2
  • -
  • .NET Core Runtime 2.0.3
  • +
  • .NET Core SDK 2.2.0
  • +
  • .NET Core Runtime 2.1.0
  • Runtime Package Store
diff --git a/packaging/osx/clisdk/resources/it.lproj/conclusion.html b/packaging/osx/clisdk/resources/it.lproj/conclusion.html index 16f74ec00..f653dd2f5 100644 --- a/packaging/osx/clisdk/resources/it.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/it.lproj/conclusion.html @@ -7,8 +7,8 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.2
  • -
  • .NET Core Runtime 2.0.3
  • +
  • .NET Core SDK 2.2.0
  • +
  • .NET Core Runtime 2.1.0
  • Runtime Package Store
diff --git a/packaging/osx/clisdk/resources/ja.lproj/conclusion.html b/packaging/osx/clisdk/resources/ja.lproj/conclusion.html index 16f74ec00..f653dd2f5 100644 --- a/packaging/osx/clisdk/resources/ja.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/ja.lproj/conclusion.html @@ -7,8 +7,8 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.2
  • -
  • .NET Core Runtime 2.0.3
  • +
  • .NET Core SDK 2.2.0
  • +
  • .NET Core Runtime 2.1.0
  • Runtime Package Store
diff --git a/packaging/osx/clisdk/resources/ko.lproj/conclusion.html b/packaging/osx/clisdk/resources/ko.lproj/conclusion.html index 16f74ec00..f653dd2f5 100644 --- a/packaging/osx/clisdk/resources/ko.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/ko.lproj/conclusion.html @@ -7,8 +7,8 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.2
  • -
  • .NET Core Runtime 2.0.3
  • +
  • .NET Core SDK 2.2.0
  • +
  • .NET Core Runtime 2.1.0
  • Runtime Package Store
diff --git a/packaging/osx/clisdk/resources/pl.lproj/conclusion.html b/packaging/osx/clisdk/resources/pl.lproj/conclusion.html index 16f74ec00..f653dd2f5 100644 --- a/packaging/osx/clisdk/resources/pl.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/pl.lproj/conclusion.html @@ -7,8 +7,8 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.2
  • -
  • .NET Core Runtime 2.0.3
  • +
  • .NET Core SDK 2.2.0
  • +
  • .NET Core Runtime 2.1.0
  • Runtime Package Store
diff --git a/packaging/osx/clisdk/resources/pt-br.lproj/conclusion.html b/packaging/osx/clisdk/resources/pt-br.lproj/conclusion.html index 16f74ec00..f653dd2f5 100644 --- a/packaging/osx/clisdk/resources/pt-br.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/pt-br.lproj/conclusion.html @@ -7,8 +7,8 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.2
  • -
  • .NET Core Runtime 2.0.3
  • +
  • .NET Core SDK 2.2.0
  • +
  • .NET Core Runtime 2.1.0
  • Runtime Package Store
diff --git a/packaging/osx/clisdk/resources/ru.lproj/conclusion.html b/packaging/osx/clisdk/resources/ru.lproj/conclusion.html index 16f74ec00..f653dd2f5 100644 --- a/packaging/osx/clisdk/resources/ru.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/ru.lproj/conclusion.html @@ -7,8 +7,8 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.2
  • -
  • .NET Core Runtime 2.0.3
  • +
  • .NET Core SDK 2.2.0
  • +
  • .NET Core Runtime 2.1.0
  • Runtime Package Store
diff --git a/packaging/osx/clisdk/resources/tr.lproj/conclusion.html b/packaging/osx/clisdk/resources/tr.lproj/conclusion.html index 16f74ec00..f653dd2f5 100644 --- a/packaging/osx/clisdk/resources/tr.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/tr.lproj/conclusion.html @@ -7,8 +7,8 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.2
  • -
  • .NET Core Runtime 2.0.3
  • +
  • .NET Core SDK 2.2.0
  • +
  • .NET Core Runtime 2.1.0
  • Runtime Package Store
diff --git a/packaging/osx/clisdk/resources/zh-hans.lproj/conclusion.html b/packaging/osx/clisdk/resources/zh-hans.lproj/conclusion.html index 16f74ec00..f653dd2f5 100644 --- a/packaging/osx/clisdk/resources/zh-hans.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/zh-hans.lproj/conclusion.html @@ -7,8 +7,8 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.2
  • -
  • .NET Core Runtime 2.0.3
  • +
  • .NET Core SDK 2.2.0
  • +
  • .NET Core Runtime 2.1.0
  • Runtime Package Store
diff --git a/packaging/osx/clisdk/resources/zh-hant.lproj/conclusion.html b/packaging/osx/clisdk/resources/zh-hant.lproj/conclusion.html index 16f74ec00..f653dd2f5 100644 --- a/packaging/osx/clisdk/resources/zh-hant.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/zh-hant.lproj/conclusion.html @@ -7,8 +7,8 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.2
  • -
  • .NET Core Runtime 2.0.3
  • +
  • .NET Core SDK 2.2.0
  • +
  • .NET Core Runtime 2.1.0
  • Runtime Package Store
diff --git a/packaging/rpm/scripts/after_install_host.sh b/packaging/rpm/scripts/after_install_host.sh index 7bc9596c7..21999daaf 100644 --- a/packaging/rpm/scripts/after_install_host.sh +++ b/packaging/rpm/scripts/after_install_host.sh @@ -9,19 +9,18 @@ echo "Please visit http://aka.ms/dotnet-cli-eula for more information." # Run 'dotnet new' as the user to trigger the first time experience to initialize the cache echo "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. +Learn more about .NET Core: https://aka.ms/dotnet-docs +Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli-docs -.NET Core Tools Telemetry +Telemetry +--------- +The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. + +Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry + +Configuring... -------------- -The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them. - -The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License. - -The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at https://aka.ms/dotnet-cli-telemetry. - -Installation Note --------------- -A command will be run during the install process that will improve project restore speed and enable offline access. It will take up to a minute to complete." +A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once." first_run() { /usr/share/dotnet/dotnet exec /usr/share/dotnet/sdk/%SDK_VERSION%/dotnet.dll internal-reportinstallsuccess "rpmpackage" > /dev/null 2>&1 || true diff --git a/packaging/windows/clisdk/bundle.wxl b/packaging/windows/clisdk/bundle.wxl index 3f0bf43a2..75fbd629e 100644 --- a/packaging/windows/clisdk/bundle.wxl +++ b/packaging/windows/clisdk/bundle.wxl @@ -50,8 +50,8 @@ The installation was successful The following were installed at [DOTNETHOME] - • .NET Core SDK 2.1.2 - • .NET Core Runtime 2.0.3 + • .NET Core SDK 2.2.0 + • .NET Core Runtime 2.1.0 • Runtime Package Store This product collects usage data diff --git a/packaging/windows/eula.rtf b/packaging/windows/eula.rtf new file mode 100644 index 000000000..7f40e11a8 --- /dev/null +++ b/packaging/windows/eula.rtf @@ -0,0 +1,97 @@ +{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033\deflangfe1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Tahoma;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\froman\fprq2\fcharset0 Times New Roman;}{\f3\fswiss\fprq2\fcharset0 Calibri;}} +{\colortbl ;\red0\green0\blue0;\red0\green0\blue255;} +{\*\generator Riched20 10.0.10586}{\*\mmathPr\mnaryLim0\mdispDef1\mwrapIndent1440 }\viewkind4\uc1 +\pard\widctlpar\sb120\sa120\cf1\b\f0\fs24 MICROSOFT SOFTWARE LICENSE TERMS\fs28\par +\fs24 MICROSOFT .NET LIBRARY\fs28\par +\fs19 These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. The terms also apply to any Microsoft\par + +\pard\widctlpar\fi-363\li720\sb120\sa120\b0\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 updates,\par +\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 supplements,\par +\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 Internet-based services, and\par +\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 support services\par + +\pard\widctlpar\sb120\sa120\b for this software, unless other terms accompany those items. If so, those terms apply.\par +BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE.\par +IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE PERPETUAL RIGHTS BELOW.\par + +\pard\widctlpar\fi-357\li357\sb120\sa120\kerning36\fs20 1.\b0\f2\fs14\~\~\~\~\b\f0\fs19 INSTALLATION AND USE RIGHTS.\par + +\pard\widctlpar\fi-363\li720\sb120\sa120\kerning0\fs20 a.\b0\f2\fs14\~\~\~\~\b\f0\fs19 Installation and Use.\b0\fs20\~You may install and use any number of copies of the software to design, develop and test your programs.\b\fs19\par +\fs20 b.\b0\f2\fs14\~\~\~\~\b\f0\fs19 Third Party Programs.\b0\fs20\~The software may include third party programs that Microsoft, not the third party, licenses to you under this agreement. Notices, if any, for the third party program are included for your information only.\b\fs19\par + +\pard\widctlpar\fi-357\li357\sb120\sa120\kerning36\fs20 2.\b0\f2\fs14\~\~\~\~\b\f0\fs19 DATA.\~\kerning0\b0\fs20 The software may collect information about you and your use of the software, and send that to Microsoft. Microsoft may use this information to improve our products and services.\~You can learn more about data collection and use in the help documentation and the privacy statement at\~{\cf0\f3\fs24{\field{\*\fldinst{HYPERLINK "http://go.microsoft.com/fwlink/?LinkId=528096&clcid=0x409"}}{\fldrslt{\ul\cf2\cf2\ul\f0\fs20 http://go.microsoft.com/fwlink/?LinkId=528096}}}}\f0\fs20 . Your use of the software operates as your consent to these practices.\kerning36\b\fs19\par +\fs20 3.\b0\f2\fs14\~\~\~\~\b\f0\fs20 ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS.\fs19\par + +\pard\widctlpar\fi-363\li720\sb120\sa120\kerning0\fs20 a.\b0\f2\fs14\~\~\~\~\b\f0\fs20 DISTRIBUTABLE CODE.\~\~\b0 The software is comprised of Distributable Code. \ldblquote Distributable Code\rdblquote is code that you are permitted to distribute in programs you develop if you comply with the terms below.\b\fs19\par + +\pard\widctlpar\fi-357\li1077\sb120\sa120\fs20 i.\b0\f2\fs14\~\~\~\~\~\~\b\f0\fs20 Right to Use and Distribute.\b0\fs19\par + +\pard\widctlpar\fi-357\li1434\sb120\sa120\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 You may copy and distribute the object code form of the software.\fs19\par +\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 Third Party Distribution. You may permit distributors of your programs to copy and distribute the Distributable Code as part of those programs.\fs19\par + +\pard\widctlpar\fi-357\li1077\sb120\sa120\b\fs20 ii.\b0\f2\fs14\~\~\~\~\b\f0\fs20 Distribution Requirements.\b0\~\b For any Distributable Code you distribute, you must\b0\fs19\par + +\pard\widctlpar\fi-357\li1434\sb120\sa120\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 add significant primary functionality to it in your programs;\fs19\par +\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 require distributors and external end users to agree to terms that protect it at least as much as this agreement;\fs19\par +\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 display your valid copyright notice on your programs; and\fs19\par +\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 indemnify, defend, and hold harmless Microsoft from any claims, including attorneys\rquote fees, related to the distribution or use of your programs.\fs19\par + +\pard\widctlpar\fi-357\li1077\sb120\sa120\b\fs20 iii.\b0\f2\fs14\~\~\~\b\f0\fs20 Distribution Restrictions.\b0\~\b You may not\b0\fs19\par + +\pard\widctlpar\fi-357\li1434\sb120\sa120\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 alter any copyright, trademark or patent notice in the Distributable Code;\fs19\par +\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 use Microsoft\rquote s trademarks in your programs\rquote names or in a way that suggests your programs come from or are endorsed by Microsoft;\fs19\par +\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 include Distributable Code in malicious, deceptive or unlawful programs; or\fs19\par +\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 modify or distribute the source code of any Distributable Code so that any part of it becomes subject to an Excluded License. An Excluded License is one that requires, as a condition of use, modification or distribution, that\fs19\par + +\pard\widctlpar\fi-358\li1792\sb120\sa120\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 the code be disclosed or distributed in source code form; or\fs19\par +\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 others have the right to modify it.\fs19\par + +\pard\widctlpar\fi-357\li357\sb120\sa120\kerning36\b\fs20 4.\b0\f2\fs14\~\~\~\~\b\f0\fs19 SCOPE OF LICENSE.\~\b0 The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not\b\par + +\pard\widctlpar\fi-363\li720\sb120\sa120\kerning0\b0\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 work around any technical limitations in the software;\par +\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 reverse engineer, decompile or disassemble the software, except and only to the extent that applicable law expressly permits, despite this limitation;\par +\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 publish the software for others to copy;\par +\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 rent, lease or lend the software;\par +\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 transfer the software or this agreement to any third party; or\par +\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 use the software for commercial software hosting services.\par + +\pard\widctlpar\fi-357\li357\sb120\sa120\kerning36\b\fs20 5.\b0\f2\fs14\~\~\~\~\b\f0\fs19 BACKUP COPY.\~\b0 You may make one backup copy of the software. You may use it only to reinstall the software.\b\par +\fs20 6.\b0\f2\fs14\~\~\~\~\b\f0\fs19 DOCUMENTATION.\~\b0 Any person that has valid access to your computer or internal network may copy and use the documentation for your internal, reference purposes.\b\par +\fs20 7.\b0\f2\fs14\~\~\~\~\b\f0\fs19 EXPORT RESTRICTIONS.\~\b0 The software is subject to United States export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see\~{\cf0\fs20{\field{\*\fldinst{HYPERLINK www.microsoft.com/exporting }}{\fldrslt{www.microsoft.com/exporting\ul0\cf0}}}}\f0\fs19 .\b\par +\fs20 8.\b0\f2\fs14\~\~\~\~\b\f0\fs19 SUPPORT SERVICES.\~\b0 Because this software is \ldblquote as is,\rdblquote we may not provide support services for it.\b\par +\fs20 9.\b0\f2\fs14\~\~\~\~\b\f0\fs19 ENTIRE AGREEMENT.\~\b0 This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services.\b\par +\fs20 10.\b0\f2\fs14\~\~\~\b\f0\fs19 APPLICABLE LAW.\par + +\pard\widctlpar\fi-363\li720\sb120\sa120\kerning0\fs20 a.\b0\f2\fs14\~\~\~\~\b\f0\fs19 United States.\~\b0 If you acquired the software in the United States, Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live govern all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort.\b\par +\fs20 b.\b0\f2\fs14\~\~\~\~\b\f0\fs19 Outside the United States. If you acquired the software in any other country, the laws of that country apply.\par + +\pard\widctlpar\fi-357\li357\sb120\sa120\kerning36\fs20 11.\b0\f2\fs14\~\~\b\f0\fs19 LEGAL EFFECT.\~\b0 This agreement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your country if the laws of your country do not permit it to do so.\b\par +\fs20 12.\b0\f2\fs14\~\~\b\f0\fs19 DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED \ldblquote AS-IS.\rdblquote YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR CONDITIONS. YOU MAY HAVE ADDITIONAL CONSUMER RIGHTS OR STATUTORY GUARANTEES UNDER YOUR LOCAL LAWS WHICH THIS AGREEMENT CANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.\par + +\pard\widctlpar\li357\sb120\sa120\kerning0 FOR AUSTRALIA \endash YOU HAVE STATUTORY GUARANTEES UNDER THE AUSTRALIAN CONSUMER LAW AND NOTHING IN THESE TERMS IS INTENDED TO AFFECT THOSE RIGHTS.\b0\par + +\pard\widctlpar\fi-357\li357\sb120\sa120\kerning36\b\fs20 13.\b0\f2\fs14\~\~\b\f0\fs19 LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.\par + +\pard\widctlpar\li357\sb120\sa120\kerning0\b0 This limitation applies to\par + +\pard\widctlpar\fi-363\li720\sb120\sa120\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and\par +\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law.\par + +\pard\widctlpar\sb120\sa120 It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.\par +\lang9 Please note: As this software is distributed in Quebec, Canada, some of the clauses in this agreement are provided below in French.\lang1033\par +\lang9 Remarque : Ce logiciel \'e9tant distribu\'e9 au Qu\'e9bec, Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en fran\'e7ais.\lang1033\par +\kerning36\b EXON\'c9RATION DE GARANTIE.\~\b0 Le logiciel vis\'e9 par une licence est offert \'ab tel quel \'bb. Toute utilisation de ce logiciel est \'e0 votre seule risque et p\'e9ril. Microsoft n\rquote accorde aucune autre garantie expresse. Vous pouvez b\'e9n\'e9ficier de droits additionnels en vertu du droit local sur la protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualit\'e9 marchande, d\rquote ad\'e9quation \'e0 un usage particulier et d\rquote absence de contrefa\'e7on sont exclues.\b\par +LIMITATION DES DOMMAGES-INT\'c9R\'caTS ET EXCLUSION DE RESPONSABILIT\'c9 POUR LES DOMMAGES.\~\b0 Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages directs uniquement \'e0 hauteur de 5,00 $ US. Vous ne pouvez pr\'e9tendre \'e0 aucune indemnisation pour les autres dommages, y compris les dommages sp\'e9ciaux, indirects ou accessoires et pertes de b\'e9n\'e9fices.\b\par +\kerning0\b0\lang9 Cette limitation concerne :\lang1033\par + +\pard\widctlpar\li720\sb120\f1\lang9\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 tout ce qui est reli\'e9 au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers ; et\lang1033\par + +\pard\widctlpar\li720\sa120\f1\lang9\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 les r\'e9clamations au titre de violation de contrat ou de garantie, ou au titre de responsabilit\'e9 stricte, de n\'e9gligence ou d\rquote une autre faute dans la limite autoris\'e9e par la loi en vigueur.\lang1033\par + +\pard\widctlpar\sb120\sa120\lang9 Elle s\rquote applique \'e9galement, m\'eame si Microsoft connaissait ou devrait conna\'eetre l\rquote\'e9ventualit\'e9 d\rquote un tel dommage. Si votre pays n\rquote autorise pas l\rquote exclusion ou la limitation de responsabilit\'e9 pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l\rquote exclusion ci-dessus ne s\rquote appliquera pas \'e0 votre \'e9gard.\lang1033\par +\kerning36\b EFFET JURIDIQUE.\~\b0 Le pr\'e9sent contrat d\'e9crit certains droits juridiques. Vous pourriez avoir d\rquote autres droits pr\'e9vus par les lois de votre pays. Le pr\'e9sent contrat ne modifie pas les droits que vous conf\'e8rent les lois de votre pays si celles-ci ne le permettent pas.\b\par +\kerning0\fs20\lang1036\~\fs19\lang1033\par + +\pard\widctlpar\cf0\b0\f3\fs24\par +} + \ No newline at end of file diff --git a/run-build.ps1 b/run-build.ps1 index 366267f3e..4a2e484fa 100644 --- a/run-build.ps1 +++ b/run-build.ps1 @@ -53,18 +53,6 @@ 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" -} - -if (!(Test-Path $env:DOTNET_INSTALL_DIR_PJ)) -{ - mkdir $env:DOTNET_INSTALL_DIR_PJ | Out-Null -} - # Disable first run since we want to control all package sources @@ -80,16 +68,8 @@ $env:VSTEST_TRACE_BUILD=1 # install a stage0 $dotnetInstallPath = Join-Path $RepoRoot "scripts\obtain\dotnet-install.ps1" -Write-Output "$dotnetInstallPath -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture"" -Channel ""release/2.0.0""" -Invoke-Expression "$dotnetInstallPath -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture"" -Channel ""release/2.0.0""" -if ($LastExitCode -ne 0) -{ - Write-Output "The .NET CLI installation failed with exit code $LastExitCode" - exit $LastExitCode -} - -Write-Output "$dotnetInstallPath -InstallDir $env:DOTNET_INSTALL_DIR_PJ -Architecture ""$Architecture"" -Version 1.0.0-preview2-1-003177" -Invoke-Expression "$dotnetInstallPath -InstallDir $env:DOTNET_INSTALL_DIR_PJ -Architecture ""$Architecture"" -Version 1.0.0-preview2-1-003177" +Write-Output "$dotnetInstallPath -Channel ""master"" -version ""2.1.0-preview1-007172"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" +Invoke-Expression "$dotnetInstallPath -Channel ""master"" -version ""2.1.0-preview1-007172"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" if ($LastExitCode -ne 0) { Write-Output "The .NET CLI installation failed with exit code $LastExitCode" diff --git a/run-build.sh b/run-build.sh index 95154cdf6..f744a1367 100755 --- a/run-build.sh +++ b/run-build.sh @@ -51,6 +51,8 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" REPOROOT="$DIR" ARCHITECTURE="x64" +STAGE0_SOURCE_DIR= + source "$REPOROOT/scripts/common/_prettyprint.sh" BUILD=1 @@ -61,54 +63,47 @@ CUSTOM_BUILD_ARGS= # Set nuget package cache under the repo [ -z $NUGET_PACKAGES ] && export NUGET_PACKAGES="$REPOROOT/.nuget/packages" -args=( "$@" ) +args=( ) while [[ $# > 0 ]]; do lowerI="$(echo $1 | awk '{print tolower($0)}')" case $lowerI in -c|--configuration) export CONFIGURATION=$2 - args=( "${args[@]/$1}" ) - args=( "${args[@]/$2}" ) shift ;; --nopackage) export DOTNET_BUILD_SKIP_PACKAGING=1 - args=( "${args[@]/$1}" ) ;; --skip-prereqs) # Allow CI to disable prereqs check since the CI has the pre-reqs but not ldconfig it seems export DOTNET_INSTALL_SKIP_PREREQS=1 - args=( "${args[@]/$1}" ) ;; --nobuild) BUILD=0 ;; --architecture) ARCHITECTURE=$2 - args=( "${args[@]/$1}" ) - args=( "${args[@]/$2}" ) shift ;; --runtime-id) CUSTOM_BUILD_ARGS="/p:Rid=\"$2\"" - args=( "${args[@]/$1}" ) - args=( "${args[@]/$2}" ) shift ;; # This is here just to eat away this parameter because CI still passes this in. --targets) - args=( "${args[@]/$1}" ) - args=( "${args[@]/$2}" ) shift ;; --linux-portable) LINUX_PORTABLE_INSTALL_ARGS="--runtime-id linux-x64" CUSTOM_BUILD_ARGS="/p:Rid=\"linux-x64\" /p:OSName=\"linux\" /p:IslinuxPortable=\"true\"" - args=( "${args[@]/$1}" ) + ;; + --stage0) + STAGE0_SOURCE_DIR=$2 + shift ;; --help) - echo "Usage: $0 [--configuration ] [--targets ] [--skip-prereqs] [--nopackage] [--docker ] [--help]" + echo "Usage: $0 [--configuration ] [--skip-prereqs] [--nopackage] [--docker ] [--help]" echo "" echo "Options:" echo " --configuration Build the specified Configuration (Debug or Release, default: Debug)" @@ -117,10 +112,12 @@ while [[ $# > 0 ]]; do echo " --nobuild Skip building, showing the command that would be used to build" echo " --docker Build in Docker using the Dockerfile located in scripts/docker/IMAGENAME" echo " --linux-portable Builds the Linux portable .NET Tools instead of a distro-specific version." + echo " --stage0 Set the stage0 source directory. The default is to download it from Azure." echo " --help Display this help message" exit 0 ;; *) + args=$@ break ;; esac @@ -128,22 +125,10 @@ while [[ $# > 0 ]]; do shift 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 -# -test "hello world" will be broken into three arguments instead of two, as it should. -temp="${args[@]}" -args=($temp) - # 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 -# 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 @@ -155,7 +140,12 @@ export VSTEST_TRACE_BUILD=1 export DOTNET_MULTILEVEL_LOOKUP=0 # Install a stage 0 -(set -x ; "$REPOROOT/scripts/obtain/dotnet-install.sh" --channel "release/2.0.0" --install-dir "$DOTNET_INSTALL_DIR" --architecture "$ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS) +if [ "$STAGE0_SOURCE_DIR" == "" ]; then + (set -x ; "$REPOROOT/scripts/obtain/dotnet-install.sh" --channel "master" --version "2.1.0-preview1-007172" --install-dir "$DOTNET_INSTALL_DIR" --architecture "$ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS) +else + echo "Copying bootstrap cli from $BOOTSTRAP_CLI" + cp -r $STAGE0_SOURCE_DIR/* "$DOTNET_INSTALL_DIR" +fi EXIT_CODE=$? if [ $EXIT_CODE != 0 ]; then @@ -163,14 +153,6 @@ if [ $EXIT_CODE != 0 ]; then exit $EXIT_CODE fi -# 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: installing project-json based cli failed with exit code $EXIT_CODE." >&2 - exit $EXIT_CODE -fi - # Put stage 0 on the PATH (for this shell only) PATH="$DOTNET_INSTALL_DIR:$PATH" @@ -189,8 +171,8 @@ echo "${args[@]}" if [ $BUILD -eq 1 ]; then dotnet msbuild build.proj /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles - dotnet msbuild build.proj /m /v:normal /fl /flp:v=diag /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS "${args[@]}" + dotnet msbuild build.proj /m /v:normal /fl /flp:v=diag /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS $args else echo "Not building due to --nobuild" - echo "Command that would be run is: 'dotnet msbuild build.proj /m /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS ${args[@]}'" + echo "Command that would be run is: 'dotnet msbuild build.proj /m /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS $args'" fi diff --git a/scripts/cli-build-env.bat b/scripts/cli-build-env.bat new file mode 100644 index 000000000..03b6ded6f --- /dev/null +++ b/scripts/cli-build-env.bat @@ -0,0 +1,17 @@ +@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. + +REM Get normalized version of parent path +for %%i in (%~dp0..\) DO ( + SET CLI_REPO_ROOT=%%~dpi +) + +title CLI Build (%CLI_REPO_ROOT%) + +REM Add Stage 0 CLI to path +set PATH=%CLI_REPO_ROOT%.dotnet_stage0\x64;%PATH% + +set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +set DOTNET_MULTILEVEL_LOOKUP=0 +set NUGET_PACKAGES=%CLI_REPO_ROOT%.nuget\packages \ No newline at end of file diff --git a/scripts/dev-dotnet.sh b/scripts/cli-build-env.sh old mode 100755 new mode 100644 similarity index 68% rename from scripts/dev-dotnet.sh rename to scripts/cli-build-env.sh index e7d8e6eac..05231edcb --- a/scripts/dev-dotnet.sh +++ b/scripts/cli-build-env.sh @@ -4,22 +4,20 @@ # Licensed under the MIT license. See LICENSE file in the project root for full license information. # -set -e - SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" [[ "$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 )" -source "$DIR/common/_common.sh" +REPO_ROOT="$( cd -P "$( dirname "$SOURCE" )/../" && pwd )" -if [ -d "$STAGE2_DIR" ]; then - PATH=$STAGE2_DIR/bin:$PATH - dotnet "$@" -else - echo "You don't have a dev build!" 1>&2 - exit 1 -fi +STAGE0_DIR=$REPO_ROOT.dotnet_stage0/x64 +export PATH=$STAGE0_DIR:$PATH + + +export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +export DOTNET_MULTILEVEL_LOOKUP=0 + +export NUGET_PACKAGES=$REPO_ROOT/.nuget/packages diff --git a/scripts/cli-test-env.bat b/scripts/cli-test-env.bat new file mode 100644 index 000000000..91a31c078 --- /dev/null +++ b/scripts/cli-test-env.bat @@ -0,0 +1,20 @@ +@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. + +REM Get normalized version of parent path +for %%i in (%~dp0..\) DO ( + SET CLI_REPO_ROOT=%%~dpi +) + +title CLI Test (%CLI_REPO_ROOT%) + +REM Add Stage 2 CLI to path +set PATH=%CLI_REPO_ROOT%bin\2\win10-x64\dotnet;%PATH% + +set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +set DOTNET_MULTILEVEL_LOOKUP=0 +set NUGET_PACKAGES=%CLI_REPO_ROOT%.nuget\packages +set TEST_PACKAGES=%CLI_REPO_ROOT%bin\2\win10-x64\test\packages +set TEST_ARTIFACTS=%CLI_REPO_ROOT%bin\2\win10-x64\test\artifacts +set PreviousStageProps=%CLI_REPO_ROOT%bin\2\win10-x64\PreviousStage.props diff --git a/scripts/cli-test-env.sh b/scripts/cli-test-env.sh new file mode 100755 index 000000000..a6b3f3fc1 --- /dev/null +++ b/scripts/cli-test-env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ "$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 + +REPO_ROOT="$( cd -P "$( dirname "$SOURCE" )/../" && pwd )" + +uname=$(uname) +if [ "$(uname)" == "Darwin" ] +then + RID=osx.10.13-x64 +else + RID=linux-x64 +fi + +STAGE2_DIR=$REPO_ROOT/bin/2/$RID/dotnet +export PATH=$STAGE2_DIR:$PATH + + +export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +export DOTNET_MULTILEVEL_LOOKUP=0 + +export NUGET_PACKAGES=$REPO_ROOT/.nuget/packages +export TEST_PACKAGES=$REPO_ROOT/bin/2/$RID/test/packages +export TEST_ARTIFACTS=$REPO_ROOT/bin/2/$RID/test/artifacts +export PreviousStageProps=$REPO_ROOT/bin/2/$RID/PreviousStage.props \ No newline at end of file diff --git a/scripts/dev-dotnet.ps1 b/scripts/dev-dotnet.ps1 deleted file mode 100644 index afcfe46d5..000000000 --- a/scripts/dev-dotnet.ps1 +++ /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. -# - -$oldPath = $env:PATH -try { - # Put the stage2 output on the front of the path - if(!(Get-Command dotnet -ErrorAction SilentlyContinue)) { - throw "You need to have a version of 'dotnet' on your path so we can determine the RID" - } - - $rid = dotnet --version | where { $_ -match "^ Runtime Id:\s*(.*)$" } | foreach { $matches[1] } - $stage2 = "$PSScriptRoot\..\artifacts\$rid\stage2\bin" - if (Test-Path $stage2) { - $env:PATH="$stage2;$env:PATH" - } else { - Write-Output "You don't have a dev build in the 'artifacts\$rid\stage2' folder!" - } - - dotnet @args -} finally { - $env:PATH = $oldPath -} diff --git a/scripts/docker/rhel.6/Dockerfile b/scripts/docker/rhel.6/Dockerfile new file mode 100644 index 000000000..1275f3293 --- /dev/null +++ b/scripts/docker/rhel.6/Dockerfile @@ -0,0 +1,31 @@ +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +# Dockerfile that creates a container suitable to build dotnet-cli +FROM microsoft/dotnet-buildtools-prereqs:centos-6-376e1a3-20174311014331 + +# yum doesn't work with the special curl version we have in the base docker image, +# so we remove /usr/local/lib from the library path for this command +RUN yum -q -y install sudo + +# Setup User to match Host User, and give superuser permissions +ARG USER_ID=0 +RUN useradd -m code_executor -u ${USER_ID} -g root +RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# With the User Change, we need to change permssions on these directories +RUN chmod -R a+rwx /usr/local +RUN chmod -R a+rwx /home +RUN chmod -R 755 /usr/bin/sudo + +# Set user to the one we just created +USER ${USER_ID} + +# Set library path to make CURL and ICU libraries that are in /usr/local/lib visible +ENV LD_LIBRARY_PATH /usr/local/lib + +# Set working directory +WORKDIR /opt/code + diff --git a/scripts/docker/rhel/Dockerfile b/scripts/docker/rhel/Dockerfile index 17ad16cf5..ec809ea73 100644 --- a/scripts/docker/rhel/Dockerfile +++ b/scripts/docker/rhel/Dockerfile @@ -4,11 +4,7 @@ # # Dockerfile that creates a container suitable to build dotnet-cli -FROM microsoft/dotnet-buildtools-prereqs:rhel-7-rpmpkg-c982313-20174116044113 - -# Install from sudo main package TODO This package needs to be mirrored -RUN yum install -y https://www.sudo.ws/sudo/dist/packages/RHEL/7/sudo-1.8.20-3.el7.x86_64.rpm \ - && yum clean all +FROM microsoft/dotnet-buildtools-prereqs:rhel-7-rpmpkg-e1b4a89-20175311035359 # Setup User to match Host User, and give superuser permissions ARG USER_ID=0 diff --git a/scripts/dockerrun.sh b/scripts/dockerrun.sh index abdaec636..7f6493582 100755 --- a/scripts/dockerrun.sh +++ b/scripts/dockerrun.sh @@ -115,24 +115,20 @@ echo "Running command: $BUILD_COMMAND" echo "Using code from: $DOCKER_HOST_SHARE_DIR" [ -z "$INTERACTIVE" ] || echo "Running Interactive" +# Note: passwords/keys should not be passed in the environment docker run $INTERACTIVE -t --rm --sig-proxy=true \ --name $DOTNET_BUILD_CONTAINER_NAME \ -v $DOCKER_HOST_SHARE_DIR:/opt/code \ -e CHANNEL \ - -e CONNECTION_STRING \ -e REPO_ID \ -e REPO_USER \ - -e REPO_PASS \ -e REPO_SERVER \ -e DOTNET_BUILD_SKIP_CROSSGEN \ -e PUBLISH_TO_AZURE_BLOB \ -e NUGET_FEED_URL \ -e NUGET_API_KEY \ - -e GITHUB_PASSWORD \ - -e ARTIFACT_STORAGE_KEY \ -e ARTIFACT_STORAGE_ACCOUNT \ -e ARTIFACT_STORAGE_CONTAINER \ - -e CHECKSUM_STORAGE_KEY \ -e CHECKSUM_STORAGE_ACCOUNT \ -e CHECKSUM_STORAGE_CONTAINER \ -e CLIBUILD_SKIP_TESTS \ @@ -141,10 +137,7 @@ docker run $INTERACTIVE -t --rm --sig-proxy=true \ -e RELEASESUFFIX \ -e COREFXAZURECONTAINER \ -e AZUREACCOUNTNAME \ - -e AZUREACCESSTOKEN \ - -e VSOPASSWORD \ -e RELEASETOOLSGITURL \ -e CORESETUPBLOBROOTURL \ - -e CORESETUPBLOBACCESSTOKEN \ $DOTNET_BUILD_CONTAINER_TAG \ $BUILD_COMMAND "$@" diff --git a/scripts/obtain/dotnet-install.ps1 b/scripts/obtain/dotnet-install.ps1 index 89e6e74d8..b844693d1 100644 --- a/scripts/obtain/dotnet-install.ps1 +++ b/scripts/obtain/dotnet-install.ps1 @@ -194,6 +194,7 @@ function GetHTTPResponse([Uri] $Uri) $HttpClient = New-Object System.Net.Http.HttpClient -ArgumentList $HttpClientHandler } else { + $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 diff --git a/scripts/publish/repoapi_client.sh b/scripts/publish/repoapi_client.sh deleted file mode 100755 index 875210bff..000000000 --- a/scripts/publish/repoapi_client.sh +++ /dev/null @@ -1,194 +0,0 @@ -#!/bin/bash -# -# Copyright (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 is a VERY basic script for Create/Delete operations on repos and packages -# -# Environment Dependencies: -# $REPO_SERVER -# $REPO_USER -# $REPO_PASS - -cmd=$1 -urls=urls.txt -defaultPackageFile=new_package.json -defaultRepoFile=new_repo.json -repositoryId=$REPO_ID -server=$REPO_SERVER -user=$REPO_USER -pass=$REPO_PASS -protocol=https -port=443 -baseurl="$protocol://$user:$pass@$server:$port" - -echo $baseurl - -function BailIf -{ - if [ $1 -ne 0 ]; then - echo "Failure occurred communicating with $server" - exit 1 - fi -} - -# List packages, using $1 as a regex to filter results -function ListPackages -{ - curl -k "$baseurl/v1/packages" | sed 's/{/\n{/g' | egrep "$1" | sed 's/,/,\n/g' | sed 's/^"/\t"/g' - echo "" -} - -# Create a new Repo using the specified JSON file -function AddRepo -{ - repoFile=$1 - if [ -z $repoFile ]; then - echo "Error: Must specify a JSON-formatted file. Reference $defaultRepoFile.template" - exit 1 - fi - if [ ! -f $repoFile ]; then - echo "Error: Cannot create repo - $repoFile does not exist" - exit 1 - fi - packageUrl=$(grep "url" $repoFile | head -n 1 | awk '{print $2}' | tr -d ',') - echo "Creating new repo on $server [$packageUrl]" - curl -i -k "$baseurl/v1/repositories" --data @./$repoFile -H "Content-Type: application/json" - BailIf $? - echo "" -} - -# Upload a single package using the specified JSON file -function AddPackage -{ - packageFile=$1 - if [ -z $packageFile ]; then - echo "Error: Must specify a JSON-formatted file. Reference $defaultPackageFile.template" - exit 1 - fi - if [ ! -f $packageFile ]; then - echo "Error: Cannot add package - $packageFile does not exist" - exit 1 - fi - packageUrl=$(grep "sourceUrl" $packageFile | head -n 1 | awk '{print $2}') - echo "Adding package to $server [$packageUrl]" - curl -i -k "$baseurl/v1/packages" --data @$packageFile -H "Content-Type: application/json" - BailIf $? - echo "" -} - -# Upload a single package by dynamically creating a JSON file using a provided URL -function AddPackageByUrl -{ - # Parse URL - url=$(echo "$1") - if [ -z $url ]; then - return - fi - escapedUrl=$(echo "$url" | sed 's/\//\\\//g') - set -- "$1" - oldIFS=$IFS - IFS="/"; declare -a splitUrl=($*) - index=${#splitUrl[@]} - let "index -= 1" - filename=${splitUrl[$index]} - set -- "$filename" - IFS="_"; declare -a splitFile=($*) - IFS=$oldIFS - pkgName=${splitFile[0]} - pkgVer=${splitFile[1]} - if [ -z $pkgName ] || [ -z $pkgVer ]; then - echo "ERROR parsing $url" - return - fi - # Create Package .json file - cp $defaultPackageFile.template $defaultPackageFile - sed -i "s/PACKAGENAME/$pkgName/g" $defaultPackageFile - sed -i "s/PACKAGEVERSION/$pkgVer/g" $defaultPackageFile - sed -i "s/PACKAGEURL/$escapedUrl/g" $defaultPackageFile - sed -i "s/REPOSITORYID/$repositoryId/g" $defaultPackageFile - # Test that URL is ok - wget -q --spider "$url" - if [[ $? -eq 0 ]]; then - echo "Ready to upload $pkgName [$pkgVer]" - else - echo "ERROR testing URL $url" - return - fi - # Perform Upload - AddPackage $defaultPackageFile - # Cleanup - # rm $defaultPackageFile -} - -# Upload multiple packages by reading urls line-by-line from the specified file -function AddPackages -{ - urlFile=$1 - if [ -z $urlFile ]; then - echo "Error: Must specify a flat text file containing one or more URLs" - exit 1 - fi - if [ ! -f $urlFile ]; then - echo "Error: Cannot add packages. File $urlFile does not exist" - exit 1 - fi - for url in $(cat $urlFile); do - AddPackageByUrl "$url" - sleep 5 - done -} - -# Delete the specified repo -function DeleteRepo -{ - repoId=$1 - if [ -z $repoId ]; then - echo "Error: Please specify repository ID. Run -listrepos for a list of IDs" - exit 1 - fi - curl -I -k -X DELETE "$baseurl/v1/repositories/$repoId" - BailIf $? -} - -# Delete the specified package -function DeletePackage -{ - packageId=$1 - if [ -z $packageId ]; then - echo "Error: Please specify package ID. Run -listpkgs for a list of IDs" - exit 1 - fi - echo Removing pkgId $packageId from repo $repositoryId - curl -I -k -X DELETE "$baseurl/v1/packages/$packageId" - BailIf $? -} - -if [[ "$1" == "-listrepos" ]]; then - echo "Fetching repo list from $server..." - curl -k "$baseurl/v1/repositories" | sed 's/,/,\n/g' | sed 's/^"/\t"/g' - echo "" -elif [[ "$1" == "-listpkgs" ]]; then - echo "Fetching package list from $server" - ListPackages $2 -elif [[ "$1" == "-addrepo" ]]; then - AddRepo $2 -elif [[ "$1" == "-addpkg" ]]; then - AddPackage $2 -elif [[ "$1" == "-addpkgs" ]]; then - AddPackages $2 -elif [[ "$1" == "-delrepo" ]]; then - DeleteRepo $2 -elif [[ "$1" == "-delpkg" ]]; then - DeletePackage $2 -else - echo "USAGE: ./repotool.sh -OPTION" - echo "-listrepos: Gather a list of repos" - echo "-listpkgs: Gather a list of packages" - echo "-addrepo [FILENAME] : Create a new repo using the specified JSON file" - echo "-addpkg [FILENAME] : Add package to repo using the specified JSON file" - echo "-addpkgs [FILENAME] : Add packages to repo using urls contained in FILENAME" - echo "-delrepo REPOID : Delete the specified repo by ID" - echo "-delpkg PKGID : Delete the specified package by ID" -fi diff --git a/scripts/unuse-dev.ps1 b/scripts/unuse-dev.ps1 deleted file mode 100644 index fbf5f4c18..000000000 --- a/scripts/unuse-dev.ps1 +++ /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. -# - -# Remove the stage2 output from the path -$splat = $env:PATH.Split(";") -$stripped = @($splat | where { $_ -notlike "*artifacts\win7-x64\stage2*" }) -$env:PATH = [string]::Join(";", $stripped) diff --git a/scripts/use-dev.ps1 b/scripts/use-dev.ps1 deleted file mode 100644 index 1d7225bd6..000000000 --- a/scripts/use-dev.ps1 +++ /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. -# - -# Put the stage2 output on the front of the path -$stage2 = "$PSScriptRoot\..\artifacts\win10-x64\stage2" -if (Test-Path $stage2) { - $splat = $env:PATH.Split(";") - $stage2 = Convert-Path $stage2 - if ($splat -notcontains $stage2) { - $env:PATH="$stage2;$env:PATH" - } -} else { - Write-Output "You don't have a dev build in the 'artifacts\win10-x64\stage2' folder!" -} diff --git a/src/Microsoft.DotNet.Archive/CompressionUtility.cs b/src/Microsoft.DotNet.Archive/CompressionUtility.cs deleted file mode 100644 index 285799116..000000000 --- a/src/Microsoft.DotNet.Archive/CompressionUtility.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 SevenZip; -using System; -using System.IO; - -namespace Microsoft.DotNet.Archive -{ - internal static class CompressionUtility - { - enum MeasureBy - { - Input, - Output - } - - private class LzmaProgress : ICodeProgress - { - private IProgress progress; - private long totalSize; - private string phase; - private MeasureBy measureBy; - - public LzmaProgress(IProgress progress, string phase, long totalSize, MeasureBy measureBy) - { - this.progress = progress; - this.totalSize = totalSize; - this.phase = phase; - this.measureBy = measureBy; - } - - public void SetProgress(long inSize, long outSize) - { - progress.Report(phase, measureBy == MeasureBy.Input ? inSize : outSize, totalSize); - } - } - - public static void Compress(Stream inStream, Stream outStream, IProgress progress) - { - SevenZip.Compression.LZMA.Encoder encoder = new SevenZip.Compression.LZMA.Encoder(); - - CoderPropID[] propIDs = - { - CoderPropID.DictionarySize, - CoderPropID.PosStateBits, - CoderPropID.LitContextBits, - CoderPropID.LitPosBits, - CoderPropID.Algorithm, - CoderPropID.NumFastBytes, - CoderPropID.MatchFinder, - CoderPropID.EndMarker - }; - object[] properties = - { - (Int32)(1 << 26), - (Int32)(1), - (Int32)(8), - (Int32)(0), - (Int32)(2), - (Int32)(96), - "bt4", - false - }; - - encoder.SetCoderProperties(propIDs, properties); - encoder.WriteCoderProperties(outStream); - - Int64 inSize = inStream.Length; - for (int i = 0; i < 8; i++) - { - outStream.WriteByte((Byte)(inSize >> (8 * i))); - } - - var lzmaProgress = new LzmaProgress(progress, "Compressing", inSize, MeasureBy.Input); - lzmaProgress.SetProgress(0, 0); - encoder.Code(inStream, outStream, -1, -1, lzmaProgress); - lzmaProgress.SetProgress(inSize, outStream.Length); - } - - public static void Decompress(Stream inStream, Stream outStream, IProgress progress) - { - byte[] properties = new byte[5]; - - if (inStream.Read(properties, 0, 5) != 5) - throw (new Exception("input .lzma is too short")); - - SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder(); - decoder.SetDecoderProperties(properties); - - long outSize = 0; - for (int i = 0; i < 8; i++) - { - int v = inStream.ReadByte(); - if (v < 0) - throw (new Exception("Can't Read 1")); - outSize |= ((long)(byte)v) << (8 * i); - } - - long compressedSize = inStream.Length - inStream.Position; - var lzmaProgress = new LzmaProgress(progress, LocalizableStrings.Decompressing, outSize, MeasureBy.Output); - lzmaProgress.SetProgress(0, 0); - decoder.Code(inStream, outStream, compressedSize, outSize, lzmaProgress); - lzmaProgress.SetProgress(inStream.Length, outSize); - } - } -} diff --git a/src/Microsoft.DotNet.Archive/ConsoleProgressReport.cs b/src/Microsoft.DotNet.Archive/ConsoleProgressReport.cs deleted file mode 100644 index e8f6cd0df..000000000 --- a/src/Microsoft.DotNet.Archive/ConsoleProgressReport.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.Diagnostics; - -namespace Microsoft.DotNet.Archive -{ - public class ConsoleProgressReport : IProgress - { - private string _currentPhase; - private int _lastLineLength = 0; - private double _lastProgress = -1; - private Stopwatch _stopwatch; - private object _stateLock = new object(); - - public void Report(ProgressReport value) - { - long progress = (long)(100 * ((double)value.Ticks / value.Total)); - - if (progress == _lastProgress && value.Phase == _currentPhase) - { - return; - } - _lastProgress = progress; - - lock (_stateLock) - { - string line = $"{value.Phase} {progress}%"; - if (value.Phase == _currentPhase) - { - if (Console.IsOutputRedirected) - { - Console.Write($"...{progress}%"); - } - else - { - Console.Write(new string('\b', _lastLineLength)); - Console.Write(line); - } - - _lastLineLength = line.Length; - - if (progress == 100) - { - Console.WriteLine($" {_stopwatch.ElapsedMilliseconds} ms"); - } - } - else - { - Console.Write(line); - _currentPhase = value.Phase; - _lastLineLength = line.Length; - _stopwatch = Stopwatch.StartNew(); - } - } - } - } -} diff --git a/src/Microsoft.DotNet.Archive/IndexedArchive.cs b/src/Microsoft.DotNet.Archive/IndexedArchive.cs deleted file mode 100644 index fb0ef22f6..000000000 --- a/src/Microsoft.DotNet.Archive/IndexedArchive.cs +++ /dev/null @@ -1,538 +0,0 @@ -// Copyright (c) .NET 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.IO.Compression; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading; - -namespace Microsoft.DotNet.Archive -{ - public class IndexedArchive : IDisposable - { - private class DestinationFileInfo - { - public DestinationFileInfo(string destinationPath, string hash) - { - DestinationPath = destinationPath; - Hash = hash; - } - - public string DestinationPath { get; } - public string Hash { get; } - } - - private class ArchiveSource - { - public ArchiveSource(string sourceArchive, string sourceFile, string archivePath, string hash, long size) - { - SourceArchive = sourceArchive; - SourceFile = sourceFile; - ArchivePath = archivePath; - Hash = hash; - Size = size; - } - - public string SourceArchive { get; set; } - public string SourceFile { get; set; } - public string ArchivePath { get; } - public string Hash { get; } - public string FileName { get { return Path.GetFileNameWithoutExtension(ArchivePath); } } - public string Extension { get { return Path.GetExtension(ArchivePath); } } - public long Size { get; } - - public void CopyTo(Stream destination) - { - if (!String.IsNullOrEmpty(SourceArchive)) - { - using (var zip = new ZipArchive(File.OpenRead(SourceArchive), ZipArchiveMode.Read)) - using (var sourceStream = zip.GetEntry(SourceFile)?.Open()) - { - if (sourceStream == null) - { - throw new Exception($"Couldn't find entry {SourceFile} in archive {SourceArchive}"); - } - - sourceStream.CopyTo(destination); - } - } - else - { - using (var sourceStream = File.OpenRead(SourceFile)) - { - sourceStream.CopyTo(destination); - } - } - } - } - - static string[] ZipExtensions = new[] { ".zip", ".nupkg" }; - static string IndexFileName = "index.txt"; - - // maps file hash to archve path - // $ prefix indicates that the file is not in the archive and path is a hash - private Dictionary _archiveFiles = new Dictionary(); - // maps file hash to external path - private Dictionary _externalFiles = new Dictionary(); - // lists all extracted files & hashes - private List _destFiles = new List(); - private bool _disposed = false; - private ThreadLocal _sha = new ThreadLocal(() => SHA256.Create()); - - public IndexedArchive() - { } - - private static Stream CreateTemporaryStream() - { - string temp = Path.GetTempPath(); - string tempFile = Path.Combine(temp, Guid.NewGuid().ToString()); - return File.Create(tempFile, 4096, FileOptions.DeleteOnClose); - } - - private static FileStream CreateTemporaryFileStream() - { - string temp = Path.GetTempPath(); - string tempFile = Path.Combine(temp, Guid.NewGuid().ToString()); - return new FileStream(tempFile, FileMode.Create, FileAccess.ReadWrite, FileShare.Read | FileShare.Delete, 4096, FileOptions.DeleteOnClose); - } - - public void Save(string archivePath, IProgress progress) - { - CheckDisposed(); - - using (var archiveStream = CreateTemporaryStream()) - { - using (var archive = new ZipArchive(archiveStream, ZipArchiveMode.Create, true)) - { - BuildArchive(archive, progress); - } // close archive - - archiveStream.Seek(0, SeekOrigin.Begin); - - using (var lzmaStream = File.Create(archivePath)) - { - CompressionUtility.Compress(archiveStream, lzmaStream, progress); - } - } // close archiveStream - } - - private void BuildArchive(ZipArchive archive, IProgress progress) - { - // write the file index - var indexEntry = archive.CreateEntry(IndexFileName, CompressionLevel.NoCompression); - - using (var stream = indexEntry.Open()) - using (var textWriter = new StreamWriter(stream)) - { - foreach (var entry in _destFiles) - { - var archiveFile = _archiveFiles[entry.Hash]; - string archivePath = _archiveFiles[entry.Hash].ArchivePath; - if (archiveFile.SourceFile == null) - { - archivePath = "$" + archivePath; - } - - textWriter.WriteLine($"{entry.DestinationPath}|{archivePath}"); - } - } - - // sort the files so that similar files are close together - var filesToArchive = _archiveFiles.Values.ToList(); - filesToArchive.Sort((f1, f2) => - { - // first sort by extension - var comp = String.Compare(f1.Extension, f2.Extension, StringComparison.OrdinalIgnoreCase); - - if (comp == 0) - { - // then sort by filename - comp = String.Compare(f1.FileName, f2.FileName, StringComparison.OrdinalIgnoreCase); - } - - if (comp == 0) - { - // sort by file size (helps differentiate ref/lib/facade) - comp = f1.Size.CompareTo(f2.Size); - } - - if (comp == 0) - { - // finally sort by full archive path so we have stable output - comp = String.Compare(f1.ArchivePath, f2.ArchivePath, StringComparison.OrdinalIgnoreCase); - } - - return comp; - }); - - int filesAdded = 0; - // add all the files - foreach (var fileToArchive in filesToArchive) - { - var entry = archive.CreateEntry(fileToArchive.ArchivePath, CompressionLevel.NoCompression); - using (var entryStream = entry.Open()) - { - fileToArchive.CopyTo(entryStream); - } - - progress.Report("Archiving files", ++filesAdded, filesToArchive.Count); - } - } - - private abstract class ExtractOperation - { - public ExtractOperation(string destinationPath) - { - DestinationPath = destinationPath; - } - - public string DestinationPath { get; } - public virtual void DoOperation() - { - string directory = Path.GetDirectoryName(DestinationPath); - - if (!Directory.Exists(directory)) - { - Directory.CreateDirectory(directory); - } - - Execute(); - } - protected abstract void Execute(); - } - - private class CopyOperation : ExtractOperation - { - public CopyOperation(ExtractSource source, string destinationPath) : base(destinationPath) - { - Source = source; - } - public ExtractSource Source { get; } - protected override void Execute() - { - if (Source.LocalPath != null) - { - File.Copy(Source.LocalPath, DestinationPath, true); - } - else - { - using (var destinationStream = File.Create(DestinationPath)) - { - Source.CopyToStream(destinationStream); - } - } - } - } - - private class ZipOperation : ExtractOperation - { - public ZipOperation(string destinationPath) : base(destinationPath) - { - } - - private List> entries = new List>(); - - public void AddEntry(string entryName, ExtractSource source) - { - entries.Add(Tuple.Create(entryName, source)); - } - - protected override void Execute() - { - using (var archiveStream = File.Create(DestinationPath)) - using (var archive = new ZipArchive(archiveStream, ZipArchiveMode.Create)) - { - foreach(var zipSource in entries) - { - var entry = archive.CreateEntry(zipSource.Item1, CompressionLevel.Optimal); - using (var entryStream = entry.Open()) - { - zipSource.Item2.CopyToStream(entryStream); - } - } - } - } - } - - private class ExtractSource - { - private string _entryName; - private readonly string _localPath; - private ThreadLocalZipArchive _archive; - - public ExtractSource(string sourceString, Dictionary externalFiles, ThreadLocalZipArchive archive) - { - if (sourceString[0] == '$') - { - var externalHash = sourceString.Substring(1); - if (!externalFiles.TryGetValue(externalHash, out _localPath)) - { - throw new Exception("Could not find external file with hash {externalHash}."); - } - } - else - { - _entryName = sourceString; - _archive = archive; - } - } - - public string LocalPath { get { return _localPath; } } - - public void CopyToStream(Stream destinationStream) - { - if (_localPath != null) - { - using (var sourceStream = File.OpenRead(_localPath)) - { - sourceStream.CopyTo(destinationStream); - } - } - else - { - using (var sourceStream = _archive.Archive.GetEntry(_entryName).Open()) - { - sourceStream.CopyTo(destinationStream); - } - } - - } - } - - private static char[] pipeSeperator = new[] { '|' }; - public void Extract(string compressedArchivePath, string outputDirectory, IProgress progress) - { - using (var archiveStream = CreateTemporaryFileStream()) - { - // decompress the LZMA stream - using (var lzmaStream = File.OpenRead(compressedArchivePath)) - { - CompressionUtility.Decompress(lzmaStream, archiveStream, progress); - } - - var archivePath = ((FileStream)archiveStream).Name; - - // reset the uncompressed stream - archiveStream.Seek(0, SeekOrigin.Begin); - - // read as a zip archive - using (var archive = new ZipArchive(archiveStream, ZipArchiveMode.Read)) - using (var tlArchive = new ThreadLocalZipArchive(archivePath, archive)) - { - List extractOperations = new List(); - Dictionary sourceCache = new Dictionary(); - - // process the index to determine all extraction operations - var indexEntry = archive.GetEntry(IndexFileName); - using (var indexReader = new StreamReader(indexEntry.Open())) - { - Dictionary zipOperations = new Dictionary(StringComparer.OrdinalIgnoreCase); - for (var line = indexReader.ReadLine(); line != null; line = indexReader.ReadLine()) - { - var lineParts = line.Split(pipeSeperator); - if (lineParts.Length != 2) - { - throw new Exception("Unexpected index line format, too many '|'s."); - } - - string target = lineParts[0]; - string source = lineParts[1]; - - ExtractSource extractSource; - if (!sourceCache.TryGetValue(source, out extractSource)) - { - sourceCache[source] = extractSource = new ExtractSource(source, _externalFiles, tlArchive); - } - - var zipSeperatorIndex = target.IndexOf("::", StringComparison.OrdinalIgnoreCase); - - if (zipSeperatorIndex != -1) - { - string zipRelativePath = target.Substring(0, zipSeperatorIndex); - string zipEntryName = target.Substring(zipSeperatorIndex + 2); - string destinationPath = Path.Combine(outputDirectory, zipRelativePath); - - // operations on a zip file will be sequential - ZipOperation currentZipOperation; - - if (!zipOperations.TryGetValue(destinationPath, out currentZipOperation)) - { - extractOperations.Add(currentZipOperation = new ZipOperation(destinationPath)); - zipOperations.Add(destinationPath, currentZipOperation); - } - currentZipOperation.AddEntry(zipEntryName, extractSource); - } - else - { - string destinationPath = Path.Combine(outputDirectory, target); - extractOperations.Add(new CopyOperation(extractSource, destinationPath)); - } - } - } - - int opsExecuted = 0; - // execute all operations - //foreach(var extractOperation in extractOperations) - extractOperations.AsParallel().ForAll(extractOperation => - { - extractOperation.DoOperation(); - progress.Report(LocalizableStrings.Expanding, Interlocked.Increment(ref opsExecuted), extractOperations.Count); - }); - } - } - } - - public void AddExternalDirectory(string externalDirectory) - { - CheckDisposed(); - foreach (var externalFile in Directory.EnumerateFiles(externalDirectory, "*", SearchOption.AllDirectories)) - { - AddExternalFile(externalFile); - } - } - - public void AddExternalFile(string externalFile) - { - CheckDisposed(); - using (var fs = File.OpenRead(externalFile)) - { - string hash = GetHash(fs); - // $ prefix indicates that the file is not in the archive and path is relative to an external directory - _archiveFiles[hash] = new ArchiveSource(null, null, "$" + hash , hash, fs.Length); - _externalFiles[hash] = externalFile; - } - } - public void AddDirectory(string sourceDirectory, IProgress progress, string destinationDirectory = null) - { - var sourceFiles = Directory.EnumerateFiles(sourceDirectory, "*", SearchOption.AllDirectories).ToArray(); - int filesAdded = 0; - sourceFiles.AsParallel().ForAll(sourceFile => - { - // path relative to the destination/extracted directory to write the file - string destinationRelativePath = sourceFile.Substring(sourceDirectory.Length + 1); - - if (destinationDirectory != null) - { - destinationRelativePath = Path.Combine(destinationDirectory, destinationRelativePath); - } - - string extension = Path.GetExtension(sourceFile); - - if (ZipExtensions.Any(ze => ze.Equals(extension, StringComparison.OrdinalIgnoreCase))) - { - AddZip(sourceFile, destinationRelativePath); - } - else - { - AddFile(sourceFile, destinationRelativePath); - } - - progress.Report($"Adding {sourceDirectory}", Interlocked.Increment(ref filesAdded), sourceFiles.Length); - }); - } - - public void AddZip(string sourceZipFile, string destinationZipFile) - { - CheckDisposed(); - - using (var sourceArchive = new ZipArchive(File.OpenRead(sourceZipFile), ZipArchiveMode.Read)) - { - foreach(var entry in sourceArchive.Entries) - { - string hash = null; - long size = entry.Length; - string destinationPath = $"{destinationZipFile}::{entry.FullName}"; - using (var stream = entry.Open()) - { - hash = GetHash(stream); - } - - AddArchiveSource(sourceZipFile, entry.FullName, destinationPath, hash, size); - } - } - } - - public void AddFile(string sourceFilePath, string destinationPath) - { - CheckDisposed(); - - string hash; - long size; - // lifetime of this stream is managed by AddStream - using (var stream = File.Open(sourceFilePath, FileMode.Open)) - { - hash = GetHash(stream); - size = stream.Length; - } - - AddArchiveSource(null, sourceFilePath, destinationPath, hash, size); - } - - private void AddArchiveSource(string sourceArchive, string sourceFile, string destinationPath, string hash, long size) - { - lock (_archiveFiles) - { - _destFiles.Add(new DestinationFileInfo(destinationPath, hash)); - - // see if we already have this file in the archive/external - ArchiveSource existing = null; - if (_archiveFiles.TryGetValue(hash, out existing)) - { - // if we have raw source file, prefer that over a zipped source file - if (sourceArchive == null && existing.SourceArchive != null) - { - existing.SourceArchive = null; - existing.SourceFile = sourceFile; - } - } - else - { - var archivePath = Path.Combine(hash, Path.GetFileName(destinationPath)); - - _archiveFiles.Add(hash, new ArchiveSource(sourceArchive, sourceFile, archivePath, hash, size)); - } - } - } - - public string GetHash(Stream stream) - { - var hashBytes = _sha.Value.ComputeHash(stream); - - return GetHashString(hashBytes); - } - - private static string GetHashString(byte[] hashBytes) - { - StringBuilder builder = new StringBuilder(hashBytes.Length * 2); - foreach (var b in hashBytes) - { - builder.AppendFormat("{0:x2}", b); - } - return builder.ToString(); - } - - public void Dispose() - { - if (!_disposed) - { - if (_sha != null) - { - _sha.Dispose(); - _sha = null; - } - } - } - - private void CheckDisposed() - { - if (_disposed) - { - throw new ObjectDisposedException(nameof(IndexedArchive)); - } - } - } -} diff --git a/src/Microsoft.DotNet.Archive/LZMA/Common/CRC.cs b/src/Microsoft.DotNet.Archive/LZMA/Common/CRC.cs deleted file mode 100644 index 5d38bf911..000000000 --- a/src/Microsoft.DotNet.Archive/LZMA/Common/CRC.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. - -// Common/CRC.cs - -namespace SevenZip -{ - class CRC - { - public static readonly uint[] Table; - - static CRC() - { - Table = new uint[256]; - const uint kPoly = 0xEDB88320; - for (uint i = 0; i < 256; i++) - { - uint r = i; - for (int j = 0; j < 8; j++) - if ((r & 1) != 0) - r = (r >> 1) ^ kPoly; - else - r >>= 1; - Table[i] = r; - } - } - - uint _value = 0xFFFFFFFF; - - public void Init() { _value = 0xFFFFFFFF; } - - public void UpdateByte(byte b) - { - _value = Table[(((byte)(_value)) ^ b)] ^ (_value >> 8); - } - - public void Update(byte[] data, uint offset, uint size) - { - for (uint i = 0; i < size; i++) - _value = Table[(((byte)(_value)) ^ data[offset + i])] ^ (_value >> 8); - } - - public uint GetDigest() { return _value ^ 0xFFFFFFFF; } - - static uint CalculateDigest(byte[] data, uint offset, uint size) - { - CRC crc = new CRC(); - // crc.Init(); - crc.Update(data, offset, size); - return crc.GetDigest(); - } - - static bool VerifyDigest(uint digest, byte[] data, uint offset, uint size) - { - return (CalculateDigest(data, offset, size) == digest); - } - } -} diff --git a/src/Microsoft.DotNet.Archive/LZMA/Common/InBuffer.cs b/src/Microsoft.DotNet.Archive/LZMA/Common/InBuffer.cs deleted file mode 100644 index a26bf4a29..000000000 --- a/src/Microsoft.DotNet.Archive/LZMA/Common/InBuffer.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. - -// InBuffer.cs - -namespace SevenZip.Buffer -{ - public class InBuffer - { - byte[] m_Buffer; - uint m_Pos; - uint m_Limit; - uint m_BufferSize; - System.IO.Stream m_Stream; - bool m_StreamWasExhausted; - ulong m_ProcessedSize; - - public InBuffer(uint bufferSize) - { - m_Buffer = new byte[bufferSize]; - m_BufferSize = bufferSize; - } - - public void Init(System.IO.Stream stream) - { - m_Stream = stream; - m_ProcessedSize = 0; - m_Limit = 0; - m_Pos = 0; - m_StreamWasExhausted = false; - } - - public bool ReadBlock() - { - if (m_StreamWasExhausted) - return false; - m_ProcessedSize += m_Pos; - int aNumProcessedBytes = m_Stream.Read(m_Buffer, 0, (int)m_BufferSize); - m_Pos = 0; - m_Limit = (uint)aNumProcessedBytes; - m_StreamWasExhausted = (aNumProcessedBytes == 0); - return (!m_StreamWasExhausted); - } - - - public void ReleaseStream() - { - // m_Stream.Close(); - m_Stream = null; - } - - public bool ReadByte(byte b) // check it - { - if (m_Pos >= m_Limit) - if (!ReadBlock()) - return false; - b = m_Buffer[m_Pos++]; - return true; - } - - public byte ReadByte() - { - // return (byte)m_Stream.ReadByte(); - if (m_Pos >= m_Limit) - if (!ReadBlock()) - return 0xFF; - return m_Buffer[m_Pos++]; - } - - public ulong GetProcessedSize() - { - return m_ProcessedSize + m_Pos; - } - } -} diff --git a/src/Microsoft.DotNet.Archive/LZMA/Common/OutBuffer.cs b/src/Microsoft.DotNet.Archive/LZMA/Common/OutBuffer.cs deleted file mode 100644 index 429bccfc9..000000000 --- a/src/Microsoft.DotNet.Archive/LZMA/Common/OutBuffer.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. - -// OutBuffer.cs - -namespace SevenZip.Buffer -{ - public class OutBuffer - { - byte[] m_Buffer; - uint m_Pos; - uint m_BufferSize; - System.IO.Stream m_Stream; - ulong m_ProcessedSize; - - public OutBuffer(uint bufferSize) - { - m_Buffer = new byte[bufferSize]; - m_BufferSize = bufferSize; - } - - public void SetStream(System.IO.Stream stream) { m_Stream = stream; } - public void FlushStream() { m_Stream.Flush(); } - public void CloseStream() { m_Stream.Dispose(); } - public void ReleaseStream() { m_Stream = null; } - - public void Init() - { - m_ProcessedSize = 0; - m_Pos = 0; - } - - public void WriteByte(byte b) - { - m_Buffer[m_Pos++] = b; - if (m_Pos >= m_BufferSize) - FlushData(); - } - - public void FlushData() - { - if (m_Pos == 0) - return; - m_Stream.Write(m_Buffer, 0, (int)m_Pos); - m_Pos = 0; - } - - public ulong GetProcessedSize() { return m_ProcessedSize + m_Pos; } - } -} diff --git a/src/Microsoft.DotNet.Archive/LZMA/Compress/LZ/IMatchFinder.cs b/src/Microsoft.DotNet.Archive/LZMA/Compress/LZ/IMatchFinder.cs deleted file mode 100644 index 2916aedb0..000000000 --- a/src/Microsoft.DotNet.Archive/LZMA/Compress/LZ/IMatchFinder.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. - -// IMatchFinder.cs - -using System; - -namespace SevenZip.Compression.LZ -{ - interface IInWindowStream - { - void SetStream(System.IO.Stream inStream); - void Init(); - void ReleaseStream(); - Byte GetIndexByte(Int32 index); - UInt32 GetMatchLen(Int32 index, UInt32 distance, UInt32 limit); - UInt32 GetNumAvailableBytes(); - } - - interface IMatchFinder : IInWindowStream - { - void Create(UInt32 historySize, UInt32 keepAddBufferBefore, - UInt32 matchMaxLen, UInt32 keepAddBufferAfter); - UInt32 GetMatches(UInt32[] distances); - void Skip(UInt32 num); - } -} diff --git a/src/Microsoft.DotNet.Archive/LZMA/Compress/LZ/LzBinTree.cs b/src/Microsoft.DotNet.Archive/LZMA/Compress/LZ/LzBinTree.cs deleted file mode 100644 index 017cf8ea2..000000000 --- a/src/Microsoft.DotNet.Archive/LZMA/Compress/LZ/LzBinTree.cs +++ /dev/null @@ -1,370 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// LzBinTree.cs - -using System; - -namespace SevenZip.Compression.LZ -{ - public class BinTree : InWindow, IMatchFinder - { - UInt32 _cyclicBufferPos; - UInt32 _cyclicBufferSize = 0; - UInt32 _matchMaxLen; - - UInt32[] _son; - UInt32[] _hash; - - UInt32 _cutValue = 0xFF; - UInt32 _hashMask; - UInt32 _hashSizeSum = 0; - - bool HASH_ARRAY = true; - - const UInt32 kHash2Size = 1 << 10; - const UInt32 kHash3Size = 1 << 16; - const UInt32 kBT2HashSize = 1 << 16; - const UInt32 kStartMaxLen = 1; - const UInt32 kHash3Offset = kHash2Size; - const UInt32 kEmptyHashValue = 0; - const UInt32 kMaxValForNormalize = ((UInt32)1 << 31) - 1; - - UInt32 kNumHashDirectBytes = 0; - UInt32 kMinMatchCheck = 4; - UInt32 kFixHashSize = kHash2Size + kHash3Size; - - public void SetType(int numHashBytes) - { - HASH_ARRAY = (numHashBytes > 2); - if (HASH_ARRAY) - { - kNumHashDirectBytes = 0; - kMinMatchCheck = 4; - kFixHashSize = kHash2Size + kHash3Size; - } - else - { - kNumHashDirectBytes = 2; - kMinMatchCheck = 2 + 1; - kFixHashSize = 0; - } - } - - public new void SetStream(System.IO.Stream stream) { base.SetStream(stream); } - public new void ReleaseStream() { base.ReleaseStream(); } - - public new void Init() - { - base.Init(); - for (UInt32 i = 0; i < _hashSizeSum; i++) - _hash[i] = kEmptyHashValue; - _cyclicBufferPos = 0; - ReduceOffsets(-1); - } - - public new void MovePos() - { - if (++_cyclicBufferPos >= _cyclicBufferSize) - _cyclicBufferPos = 0; - base.MovePos(); - if (_pos == kMaxValForNormalize) - Normalize(); - } - - public new Byte GetIndexByte(Int32 index) { return base.GetIndexByte(index); } - - public new UInt32 GetMatchLen(Int32 index, UInt32 distance, UInt32 limit) - { return base.GetMatchLen(index, distance, limit); } - - public new UInt32 GetNumAvailableBytes() { return base.GetNumAvailableBytes(); } - - public void Create(UInt32 historySize, UInt32 keepAddBufferBefore, - UInt32 matchMaxLen, UInt32 keepAddBufferAfter) - { - if (historySize > kMaxValForNormalize - 256) - throw new Exception(); - _cutValue = 16 + (matchMaxLen >> 1); - - UInt32 windowReservSize = (historySize + keepAddBufferBefore + - matchMaxLen + keepAddBufferAfter) / 2 + 256; - - base.Create(historySize + keepAddBufferBefore, matchMaxLen + keepAddBufferAfter, windowReservSize); - - _matchMaxLen = matchMaxLen; - - UInt32 cyclicBufferSize = historySize + 1; - if (_cyclicBufferSize != cyclicBufferSize) - _son = new UInt32[(_cyclicBufferSize = cyclicBufferSize) * 2]; - - UInt32 hs = kBT2HashSize; - - if (HASH_ARRAY) - { - hs = historySize - 1; - hs |= (hs >> 1); - hs |= (hs >> 2); - hs |= (hs >> 4); - hs |= (hs >> 8); - hs >>= 1; - hs |= 0xFFFF; - if (hs > (1 << 24)) - hs >>= 1; - _hashMask = hs; - hs++; - hs += kFixHashSize; - } - if (hs != _hashSizeSum) - _hash = new UInt32[_hashSizeSum = hs]; - } - - public UInt32 GetMatches(UInt32[] distances) - { - UInt32 lenLimit; - if (_pos + _matchMaxLen <= _streamPos) - lenLimit = _matchMaxLen; - else - { - lenLimit = _streamPos - _pos; - if (lenLimit < kMinMatchCheck) - { - MovePos(); - return 0; - } - } - - UInt32 offset = 0; - UInt32 matchMinPos = (_pos > _cyclicBufferSize) ? (_pos - _cyclicBufferSize) : 0; - UInt32 cur = _bufferOffset + _pos; - UInt32 maxLen = kStartMaxLen; // to avoid items for len < hashSize; - UInt32 hashValue, hash2Value = 0, hash3Value = 0; - - if (HASH_ARRAY) - { - UInt32 temp = CRC.Table[_bufferBase[cur]] ^ _bufferBase[cur + 1]; - hash2Value = temp & (kHash2Size - 1); - temp ^= ((UInt32)(_bufferBase[cur + 2]) << 8); - hash3Value = temp & (kHash3Size - 1); - hashValue = (temp ^ (CRC.Table[_bufferBase[cur + 3]] << 5)) & _hashMask; - } - else - hashValue = _bufferBase[cur] ^ ((UInt32)(_bufferBase[cur + 1]) << 8); - - UInt32 curMatch = _hash[kFixHashSize + hashValue]; - if (HASH_ARRAY) - { - UInt32 curMatch2 = _hash[hash2Value]; - UInt32 curMatch3 = _hash[kHash3Offset + hash3Value]; - _hash[hash2Value] = _pos; - _hash[kHash3Offset + hash3Value] = _pos; - if (curMatch2 > matchMinPos) - if (_bufferBase[_bufferOffset + curMatch2] == _bufferBase[cur]) - { - distances[offset++] = maxLen = 2; - distances[offset++] = _pos - curMatch2 - 1; - } - if (curMatch3 > matchMinPos) - if (_bufferBase[_bufferOffset + curMatch3] == _bufferBase[cur]) - { - if (curMatch3 == curMatch2) - offset -= 2; - distances[offset++] = maxLen = 3; - distances[offset++] = _pos - curMatch3 - 1; - curMatch2 = curMatch3; - } - if (offset != 0 && curMatch2 == curMatch) - { - offset -= 2; - maxLen = kStartMaxLen; - } - } - - _hash[kFixHashSize + hashValue] = _pos; - - UInt32 ptr0 = (_cyclicBufferPos << 1) + 1; - UInt32 ptr1 = (_cyclicBufferPos << 1); - - UInt32 len0, len1; - len0 = len1 = kNumHashDirectBytes; - - if (kNumHashDirectBytes != 0) - { - if (curMatch > matchMinPos) - { - if (_bufferBase[_bufferOffset + curMatch + kNumHashDirectBytes] != - _bufferBase[cur + kNumHashDirectBytes]) - { - distances[offset++] = maxLen = kNumHashDirectBytes; - distances[offset++] = _pos - curMatch - 1; - } - } - } - - UInt32 count = _cutValue; - - while(true) - { - if(curMatch <= matchMinPos || count-- == 0) - { - _son[ptr0] = _son[ptr1] = kEmptyHashValue; - break; - } - UInt32 delta = _pos - curMatch; - UInt32 cyclicPos = ((delta <= _cyclicBufferPos) ? - (_cyclicBufferPos - delta) : - (_cyclicBufferPos - delta + _cyclicBufferSize)) << 1; - - UInt32 pby1 = _bufferOffset + curMatch; - UInt32 len = Math.Min(len0, len1); - if (_bufferBase[pby1 + len] == _bufferBase[cur + len]) - { - while(++len != lenLimit) - if (_bufferBase[pby1 + len] != _bufferBase[cur + len]) - break; - if (maxLen < len) - { - distances[offset++] = maxLen = len; - distances[offset++] = delta - 1; - if (len == lenLimit) - { - _son[ptr1] = _son[cyclicPos]; - _son[ptr0] = _son[cyclicPos + 1]; - break; - } - } - } - if (_bufferBase[pby1 + len] < _bufferBase[cur + len]) - { - _son[ptr1] = curMatch; - ptr1 = cyclicPos + 1; - curMatch = _son[ptr1]; - len1 = len; - } - else - { - _son[ptr0] = curMatch; - ptr0 = cyclicPos; - curMatch = _son[ptr0]; - len0 = len; - } - } - MovePos(); - return offset; - } - - public void Skip(UInt32 num) - { - do - { - UInt32 lenLimit; - if (_pos + _matchMaxLen <= _streamPos) - lenLimit = _matchMaxLen; - else - { - lenLimit = _streamPos - _pos; - if (lenLimit < kMinMatchCheck) - { - MovePos(); - continue; - } - } - - UInt32 matchMinPos = (_pos > _cyclicBufferSize) ? (_pos - _cyclicBufferSize) : 0; - UInt32 cur = _bufferOffset + _pos; - - UInt32 hashValue; - - if (HASH_ARRAY) - { - UInt32 temp = CRC.Table[_bufferBase[cur]] ^ _bufferBase[cur + 1]; - UInt32 hash2Value = temp & (kHash2Size - 1); - _hash[hash2Value] = _pos; - temp ^= ((UInt32)(_bufferBase[cur + 2]) << 8); - UInt32 hash3Value = temp & (kHash3Size - 1); - _hash[kHash3Offset + hash3Value] = _pos; - hashValue = (temp ^ (CRC.Table[_bufferBase[cur + 3]] << 5)) & _hashMask; - } - else - hashValue = _bufferBase[cur] ^ ((UInt32)(_bufferBase[cur + 1]) << 8); - - UInt32 curMatch = _hash[kFixHashSize + hashValue]; - _hash[kFixHashSize + hashValue] = _pos; - - UInt32 ptr0 = (_cyclicBufferPos << 1) + 1; - UInt32 ptr1 = (_cyclicBufferPos << 1); - - UInt32 len0, len1; - len0 = len1 = kNumHashDirectBytes; - - UInt32 count = _cutValue; - while (true) - { - if (curMatch <= matchMinPos || count-- == 0) - { - _son[ptr0] = _son[ptr1] = kEmptyHashValue; - break; - } - - UInt32 delta = _pos - curMatch; - UInt32 cyclicPos = ((delta <= _cyclicBufferPos) ? - (_cyclicBufferPos - delta) : - (_cyclicBufferPos - delta + _cyclicBufferSize)) << 1; - - UInt32 pby1 = _bufferOffset + curMatch; - UInt32 len = Math.Min(len0, len1); - if (_bufferBase[pby1 + len] == _bufferBase[cur + len]) - { - while (++len != lenLimit) - if (_bufferBase[pby1 + len] != _bufferBase[cur + len]) - break; - if (len == lenLimit) - { - _son[ptr1] = _son[cyclicPos]; - _son[ptr0] = _son[cyclicPos + 1]; - break; - } - } - if (_bufferBase[pby1 + len] < _bufferBase[cur + len]) - { - _son[ptr1] = curMatch; - ptr1 = cyclicPos + 1; - curMatch = _son[ptr1]; - len1 = len; - } - else - { - _son[ptr0] = curMatch; - ptr0 = cyclicPos; - curMatch = _son[ptr0]; - len0 = len; - } - } - MovePos(); - } - while (--num != 0); - } - - void NormalizeLinks(UInt32[] items, UInt32 numItems, UInt32 subValue) - { - for (UInt32 i = 0; i < numItems; i++) - { - UInt32 value = items[i]; - if (value <= subValue) - value = kEmptyHashValue; - else - value -= subValue; - items[i] = value; - } - } - - void Normalize() - { - UInt32 subValue = _pos - _cyclicBufferSize; - NormalizeLinks(_son, _cyclicBufferSize * 2, subValue); - NormalizeLinks(_hash, _hashSizeSum, subValue); - ReduceOffsets((Int32)subValue); - } - - public void SetCutValue(UInt32 cutValue) { _cutValue = cutValue; } - } -} diff --git a/src/Microsoft.DotNet.Archive/LZMA/Compress/LZ/LzInWindow.cs b/src/Microsoft.DotNet.Archive/LZMA/Compress/LZ/LzInWindow.cs deleted file mode 100644 index 1ee8282f1..000000000 --- a/src/Microsoft.DotNet.Archive/LZMA/Compress/LZ/LzInWindow.cs +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// LzInWindow.cs - -using System; - -namespace SevenZip.Compression.LZ -{ - public class InWindow - { - public Byte[] _bufferBase = null; // pointer to buffer with data - System.IO.Stream _stream; - UInt32 _posLimit; // offset (from _buffer) of first byte when new block reading must be done - bool _streamEndWasReached; // if (true) then _streamPos shows real end of stream - - UInt32 _pointerToLastSafePosition; - - public UInt32 _bufferOffset; - - public UInt32 _blockSize; // Size of Allocated memory block - public UInt32 _pos; // offset (from _buffer) of curent byte - UInt32 _keepSizeBefore; // how many BYTEs must be kept in buffer before _pos - UInt32 _keepSizeAfter; // how many BYTEs must be kept buffer after _pos - public UInt32 _streamPos; // offset (from _buffer) of first not read byte from Stream - - public void MoveBlock() - { - UInt32 offset = (UInt32)(_bufferOffset) + _pos - _keepSizeBefore; - // we need one additional byte, since MovePos moves on 1 byte. - if (offset > 0) - offset--; - - UInt32 numBytes = (UInt32)(_bufferOffset) + _streamPos - offset; - - // check negative offset ???? - for (UInt32 i = 0; i < numBytes; i++) - _bufferBase[i] = _bufferBase[offset + i]; - _bufferOffset -= offset; - } - - public virtual void ReadBlock() - { - if (_streamEndWasReached) - return; - while (true) - { - int size = (int)((0 - _bufferOffset) + _blockSize - _streamPos); - if (size == 0) - return; - int numReadBytes = _stream.Read(_bufferBase, (int)(_bufferOffset + _streamPos), size); - if (numReadBytes == 0) - { - _posLimit = _streamPos; - UInt32 pointerToPostion = _bufferOffset + _posLimit; - if (pointerToPostion > _pointerToLastSafePosition) - _posLimit = (UInt32)(_pointerToLastSafePosition - _bufferOffset); - - _streamEndWasReached = true; - return; - } - _streamPos += (UInt32)numReadBytes; - if (_streamPos >= _pos + _keepSizeAfter) - _posLimit = _streamPos - _keepSizeAfter; - } - } - - void Free() { _bufferBase = null; } - - public void Create(UInt32 keepSizeBefore, UInt32 keepSizeAfter, UInt32 keepSizeReserv) - { - _keepSizeBefore = keepSizeBefore; - _keepSizeAfter = keepSizeAfter; - UInt32 blockSize = keepSizeBefore + keepSizeAfter + keepSizeReserv; - if (_bufferBase == null || _blockSize != blockSize) - { - Free(); - _blockSize = blockSize; - _bufferBase = new Byte[_blockSize]; - } - _pointerToLastSafePosition = _blockSize - keepSizeAfter; - } - - public void SetStream(System.IO.Stream stream) { _stream = stream; } - public void ReleaseStream() { _stream = null; } - - public void Init() - { - _bufferOffset = 0; - _pos = 0; - _streamPos = 0; - _streamEndWasReached = false; - ReadBlock(); - } - - public void MovePos() - { - _pos++; - if (_pos > _posLimit) - { - UInt32 pointerToPostion = _bufferOffset + _pos; - if (pointerToPostion > _pointerToLastSafePosition) - MoveBlock(); - ReadBlock(); - } - } - - public Byte GetIndexByte(Int32 index) { return _bufferBase[_bufferOffset + _pos + index]; } - - // index + limit have not to exceed _keepSizeAfter; - public UInt32 GetMatchLen(Int32 index, UInt32 distance, UInt32 limit) - { - if (_streamEndWasReached) - if ((_pos + index) + limit > _streamPos) - limit = _streamPos - (UInt32)(_pos + index); - distance++; - // Byte *pby = _buffer + (size_t)_pos + index; - UInt32 pby = _bufferOffset + _pos + (UInt32)index; - - UInt32 i; - for (i = 0; i < limit && _bufferBase[pby + i] == _bufferBase[pby + i - distance]; i++); - return i; - } - - public UInt32 GetNumAvailableBytes() { return _streamPos - _pos; } - - public void ReduceOffsets(Int32 subValue) - { - _bufferOffset += (UInt32)subValue; - _posLimit -= (UInt32)subValue; - _pos -= (UInt32)subValue; - _streamPos -= (UInt32)subValue; - } - } -} diff --git a/src/Microsoft.DotNet.Archive/LZMA/Compress/LZ/LzOutWindow.cs b/src/Microsoft.DotNet.Archive/LZMA/Compress/LZ/LzOutWindow.cs deleted file mode 100644 index 479ae4f13..000000000 --- a/src/Microsoft.DotNet.Archive/LZMA/Compress/LZ/LzOutWindow.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. - -// LzOutWindow.cs - -namespace SevenZip.Compression.LZ -{ - public class OutWindow - { - byte[] _buffer = null; - uint _pos; - uint _windowSize = 0; - uint _streamPos; - System.IO.Stream _stream; - - public uint TrainSize = 0; - - public void Create(uint windowSize) - { - if (_windowSize != windowSize) - { - // System.GC.Collect(); - _buffer = new byte[windowSize]; - } - _windowSize = windowSize; - _pos = 0; - _streamPos = 0; - } - - public void Init(System.IO.Stream stream, bool solid) - { - ReleaseStream(); - _stream = stream; - if (!solid) - { - _streamPos = 0; - _pos = 0; - TrainSize = 0; - } - } - - public bool Train(System.IO.Stream stream) - { - long len = stream.Length; - uint size = (len < _windowSize) ? (uint)len : _windowSize; - TrainSize = size; - stream.Position = len - size; - _streamPos = _pos = 0; - while (size > 0) - { - uint curSize = _windowSize - _pos; - if (size < curSize) - curSize = size; - int numReadBytes = stream.Read(_buffer, (int)_pos, (int)curSize); - if (numReadBytes == 0) - return false; - size -= (uint)numReadBytes; - _pos += (uint)numReadBytes; - _streamPos += (uint)numReadBytes; - if (_pos == _windowSize) - _streamPos = _pos = 0; - } - return true; - } - - public void ReleaseStream() - { - Flush(); - _stream = null; - } - - public void Flush() - { - uint size = _pos - _streamPos; - if (size == 0) - return; - _stream.Write(_buffer, (int)_streamPos, (int)size); - if (_pos >= _windowSize) - _pos = 0; - _streamPos = _pos; - } - - public void CopyBlock(uint distance, uint len) - { - uint pos = _pos - distance - 1; - if (pos >= _windowSize) - pos += _windowSize; - for (; len > 0; len--) - { - if (pos >= _windowSize) - pos = 0; - _buffer[_pos++] = _buffer[pos++]; - if (_pos >= _windowSize) - Flush(); - } - } - - public void PutByte(byte b) - { - _buffer[_pos++] = b; - if (_pos >= _windowSize) - Flush(); - } - - public byte GetByte(uint distance) - { - uint pos = _pos - distance - 1; - if (pos >= _windowSize) - pos += _windowSize; - return _buffer[pos]; - } - } -} diff --git a/src/Microsoft.DotNet.Archive/LZMA/Compress/LZMA/LzmaBase.cs b/src/Microsoft.DotNet.Archive/LZMA/Compress/LZMA/LzmaBase.cs deleted file mode 100644 index f4a8f823f..000000000 --- a/src/Microsoft.DotNet.Archive/LZMA/Compress/LZMA/LzmaBase.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. - -// LzmaBase.cs - -namespace SevenZip.Compression.LZMA -{ - internal abstract class Base - { - public const uint kNumRepDistances = 4; - public const uint kNumStates = 12; - - // static byte []kLiteralNextStates = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5}; - // static byte []kMatchNextStates = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10}; - // static byte []kRepNextStates = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11}; - // static byte []kShortRepNextStates = {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11}; - - public struct State - { - public uint Index; - public void Init() { Index = 0; } - public void UpdateChar() - { - if (Index < 4) Index = 0; - else if (Index < 10) Index -= 3; - else Index -= 6; - } - public void UpdateMatch() { Index = (uint)(Index < 7 ? 7 : 10); } - public void UpdateRep() { Index = (uint)(Index < 7 ? 8 : 11); } - public void UpdateShortRep() { Index = (uint)(Index < 7 ? 9 : 11); } - public bool IsCharState() { return Index < 7; } - } - - public const int kNumPosSlotBits = 6; - public const int kDicLogSizeMin = 0; - // public const int kDicLogSizeMax = 30; - // public const uint kDistTableSizeMax = kDicLogSizeMax * 2; - - public const int kNumLenToPosStatesBits = 2; // it's for speed optimization - public const uint kNumLenToPosStates = 1 << kNumLenToPosStatesBits; - - public const uint kMatchMinLen = 2; - - public static uint GetLenToPosState(uint len) - { - len -= kMatchMinLen; - if (len < kNumLenToPosStates) - return len; - return (uint)(kNumLenToPosStates - 1); - } - - public const int kNumAlignBits = 4; - public const uint kAlignTableSize = 1 << kNumAlignBits; - public const uint kAlignMask = (kAlignTableSize - 1); - - public const uint kStartPosModelIndex = 4; - public const uint kEndPosModelIndex = 14; - public const uint kNumPosModels = kEndPosModelIndex - kStartPosModelIndex; - - public const uint kNumFullDistances = 1 << ((int)kEndPosModelIndex / 2); - - public const uint kNumLitPosStatesBitsEncodingMax = 4; - public const uint kNumLitContextBitsMax = 8; - - public const int kNumPosStatesBitsMax = 4; - public const uint kNumPosStatesMax = (1 << kNumPosStatesBitsMax); - public const int kNumPosStatesBitsEncodingMax = 4; - public const uint kNumPosStatesEncodingMax = (1 << kNumPosStatesBitsEncodingMax); - - public const int kNumLowLenBits = 3; - public const int kNumMidLenBits = 3; - public const int kNumHighLenBits = 8; - public const uint kNumLowLenSymbols = 1 << kNumLowLenBits; - public const uint kNumMidLenSymbols = 1 << kNumMidLenBits; - public const uint kNumLenSymbols = kNumLowLenSymbols + kNumMidLenSymbols + - (1 << kNumHighLenBits); - public const uint kMatchMaxLen = kMatchMinLen + kNumLenSymbols - 1; - } -} diff --git a/src/Microsoft.DotNet.Archive/LZMA/Compress/LZMA/LzmaDecoder.cs b/src/Microsoft.DotNet.Archive/LZMA/Compress/LZMA/LzmaDecoder.cs deleted file mode 100644 index 95d42eed0..000000000 --- a/src/Microsoft.DotNet.Archive/LZMA/Compress/LZMA/LzmaDecoder.cs +++ /dev/null @@ -1,402 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// LzmaDecoder.cs - -using System; - -namespace SevenZip.Compression.LZMA -{ - using RangeCoder; - - public class Decoder : ICoder, ISetDecoderProperties // ,System.IO.Stream - { - class LenDecoder - { - BitDecoder m_Choice = new BitDecoder(); - BitDecoder m_Choice2 = new BitDecoder(); - BitTreeDecoder[] m_LowCoder = new BitTreeDecoder[Base.kNumPosStatesMax]; - BitTreeDecoder[] m_MidCoder = new BitTreeDecoder[Base.kNumPosStatesMax]; - BitTreeDecoder m_HighCoder = new BitTreeDecoder(Base.kNumHighLenBits); - uint m_NumPosStates = 0; - - public void Create(uint numPosStates) - { - for (uint posState = m_NumPosStates; posState < numPosStates; posState++) - { - m_LowCoder[posState] = new BitTreeDecoder(Base.kNumLowLenBits); - m_MidCoder[posState] = new BitTreeDecoder(Base.kNumMidLenBits); - } - m_NumPosStates = numPosStates; - } - - public void Init() - { - m_Choice.Init(); - for (uint posState = 0; posState < m_NumPosStates; posState++) - { - m_LowCoder[posState].Init(); - m_MidCoder[posState].Init(); - } - m_Choice2.Init(); - m_HighCoder.Init(); - } - - public uint Decode(RangeCoder.Decoder rangeDecoder, uint posState) - { - if (m_Choice.Decode(rangeDecoder) == 0) - return m_LowCoder[posState].Decode(rangeDecoder); - else - { - uint symbol = Base.kNumLowLenSymbols; - if (m_Choice2.Decode(rangeDecoder) == 0) - symbol += m_MidCoder[posState].Decode(rangeDecoder); - else - { - symbol += Base.kNumMidLenSymbols; - symbol += m_HighCoder.Decode(rangeDecoder); - } - return symbol; - } - } - } - - class LiteralDecoder - { - struct Decoder2 - { - BitDecoder[] m_Decoders; - public void Create() { m_Decoders = new BitDecoder[0x300]; } - public void Init() { for (int i = 0; i < 0x300; i++) m_Decoders[i].Init(); } - - public byte DecodeNormal(RangeCoder.Decoder rangeDecoder) - { - uint symbol = 1; - do - symbol = (symbol << 1) | m_Decoders[symbol].Decode(rangeDecoder); - while (symbol < 0x100); - return (byte)symbol; - } - - public byte DecodeWithMatchByte(RangeCoder.Decoder rangeDecoder, byte matchByte) - { - uint symbol = 1; - do - { - uint matchBit = (uint)(matchByte >> 7) & 1; - matchByte <<= 1; - uint bit = m_Decoders[((1 + matchBit) << 8) + symbol].Decode(rangeDecoder); - symbol = (symbol << 1) | bit; - if (matchBit != bit) - { - while (symbol < 0x100) - symbol = (symbol << 1) | m_Decoders[symbol].Decode(rangeDecoder); - break; - } - } - while (symbol < 0x100); - return (byte)symbol; - } - } - - Decoder2[] m_Coders; - int m_NumPrevBits; - int m_NumPosBits; - uint m_PosMask; - - public void Create(int numPosBits, int numPrevBits) - { - if (m_Coders != null && m_NumPrevBits == numPrevBits && - m_NumPosBits == numPosBits) - return; - m_NumPosBits = numPosBits; - m_PosMask = ((uint)1 << numPosBits) - 1; - m_NumPrevBits = numPrevBits; - uint numStates = (uint)1 << (m_NumPrevBits + m_NumPosBits); - m_Coders = new Decoder2[numStates]; - for (uint i = 0; i < numStates; i++) - m_Coders[i].Create(); - } - - public void Init() - { - uint numStates = (uint)1 << (m_NumPrevBits + m_NumPosBits); - for (uint i = 0; i < numStates; i++) - m_Coders[i].Init(); - } - - uint GetState(uint pos, byte prevByte) - { return ((pos & m_PosMask) << m_NumPrevBits) + (uint)(prevByte >> (8 - m_NumPrevBits)); } - - public byte DecodeNormal(RangeCoder.Decoder rangeDecoder, uint pos, byte prevByte) - { return m_Coders[GetState(pos, prevByte)].DecodeNormal(rangeDecoder); } - - public byte DecodeWithMatchByte(RangeCoder.Decoder rangeDecoder, uint pos, byte prevByte, byte matchByte) - { return m_Coders[GetState(pos, prevByte)].DecodeWithMatchByte(rangeDecoder, matchByte); } - }; - - LZ.OutWindow m_OutWindow = new LZ.OutWindow(); - RangeCoder.Decoder m_RangeDecoder = new RangeCoder.Decoder(); - - BitDecoder[] m_IsMatchDecoders = new BitDecoder[Base.kNumStates << Base.kNumPosStatesBitsMax]; - BitDecoder[] m_IsRepDecoders = new BitDecoder[Base.kNumStates]; - BitDecoder[] m_IsRepG0Decoders = new BitDecoder[Base.kNumStates]; - BitDecoder[] m_IsRepG1Decoders = new BitDecoder[Base.kNumStates]; - BitDecoder[] m_IsRepG2Decoders = new BitDecoder[Base.kNumStates]; - BitDecoder[] m_IsRep0LongDecoders = new BitDecoder[Base.kNumStates << Base.kNumPosStatesBitsMax]; - - BitTreeDecoder[] m_PosSlotDecoder = new BitTreeDecoder[Base.kNumLenToPosStates]; - BitDecoder[] m_PosDecoders = new BitDecoder[Base.kNumFullDistances - Base.kEndPosModelIndex]; - - BitTreeDecoder m_PosAlignDecoder = new BitTreeDecoder(Base.kNumAlignBits); - - LenDecoder m_LenDecoder = new LenDecoder(); - LenDecoder m_RepLenDecoder = new LenDecoder(); - - LiteralDecoder m_LiteralDecoder = new LiteralDecoder(); - - uint m_DictionarySize; - uint m_DictionarySizeCheck; - - uint m_PosStateMask; - - public Decoder() - { - m_DictionarySize = 0xFFFFFFFF; - for (int i = 0; i < Base.kNumLenToPosStates; i++) - m_PosSlotDecoder[i] = new BitTreeDecoder(Base.kNumPosSlotBits); - } - - void SetDictionarySize(uint dictionarySize) - { - if (m_DictionarySize != dictionarySize) - { - m_DictionarySize = dictionarySize; - m_DictionarySizeCheck = Math.Max(m_DictionarySize, 1); - uint blockSize = Math.Max(m_DictionarySizeCheck, (1 << 12)); - m_OutWindow.Create(blockSize); - } - } - - void SetLiteralProperties(int lp, int lc) - { - if (lp > 8) - throw new InvalidParamException(); - if (lc > 8) - throw new InvalidParamException(); - m_LiteralDecoder.Create(lp, lc); - } - - void SetPosBitsProperties(int pb) - { - if (pb > Base.kNumPosStatesBitsMax) - throw new InvalidParamException(); - uint numPosStates = (uint)1 << pb; - m_LenDecoder.Create(numPosStates); - m_RepLenDecoder.Create(numPosStates); - m_PosStateMask = numPosStates - 1; - } - - bool _solid = false; - void Init(System.IO.Stream inStream, System.IO.Stream outStream) - { - m_RangeDecoder.Init(inStream); - m_OutWindow.Init(outStream, _solid); - - uint i; - for (i = 0; i < Base.kNumStates; i++) - { - for (uint j = 0; j <= m_PosStateMask; j++) - { - uint index = (i << Base.kNumPosStatesBitsMax) + j; - m_IsMatchDecoders[index].Init(); - m_IsRep0LongDecoders[index].Init(); - } - m_IsRepDecoders[i].Init(); - m_IsRepG0Decoders[i].Init(); - m_IsRepG1Decoders[i].Init(); - m_IsRepG2Decoders[i].Init(); - } - - m_LiteralDecoder.Init(); - for (i = 0; i < Base.kNumLenToPosStates; i++) - m_PosSlotDecoder[i].Init(); - // m_PosSpecDecoder.Init(); - for (i = 0; i < Base.kNumFullDistances - Base.kEndPosModelIndex; i++) - m_PosDecoders[i].Init(); - - m_LenDecoder.Init(); - m_RepLenDecoder.Init(); - m_PosAlignDecoder.Init(); - } - - public void Code(System.IO.Stream inStream, System.IO.Stream outStream, - Int64 inSize, Int64 outSize, ICodeProgress progress) - { - Init(inStream, outStream); - - Base.State state = new Base.State(); - state.Init(); - uint rep0 = 0, rep1 = 0, rep2 = 0, rep3 = 0; - - UInt64 nowPos64 = 0; - UInt64 outSize64 = (UInt64)outSize; - if (nowPos64 < outSize64) - { - if (m_IsMatchDecoders[state.Index << Base.kNumPosStatesBitsMax].Decode(m_RangeDecoder) != 0) - throw new DataErrorException(); - state.UpdateChar(); - byte b = m_LiteralDecoder.DecodeNormal(m_RangeDecoder, 0, 0); - m_OutWindow.PutByte(b); - nowPos64++; - } - while (nowPos64 < outSize64) - { - progress.SetProgress(inStream.Position, (long)nowPos64); - // UInt64 next = Math.Min(nowPos64 + (1 << 18), outSize64); - // while(nowPos64 < next) - { - uint posState = (uint)nowPos64 & m_PosStateMask; - if (m_IsMatchDecoders[(state.Index << Base.kNumPosStatesBitsMax) + posState].Decode(m_RangeDecoder) == 0) - { - byte b; - byte prevByte = m_OutWindow.GetByte(0); - if (!state.IsCharState()) - b = m_LiteralDecoder.DecodeWithMatchByte(m_RangeDecoder, - (uint)nowPos64, prevByte, m_OutWindow.GetByte(rep0)); - else - b = m_LiteralDecoder.DecodeNormal(m_RangeDecoder, (uint)nowPos64, prevByte); - m_OutWindow.PutByte(b); - state.UpdateChar(); - nowPos64++; - } - else - { - uint len; - if (m_IsRepDecoders[state.Index].Decode(m_RangeDecoder) == 1) - { - if (m_IsRepG0Decoders[state.Index].Decode(m_RangeDecoder) == 0) - { - if (m_IsRep0LongDecoders[(state.Index << Base.kNumPosStatesBitsMax) + posState].Decode(m_RangeDecoder) == 0) - { - state.UpdateShortRep(); - m_OutWindow.PutByte(m_OutWindow.GetByte(rep0)); - nowPos64++; - continue; - } - } - else - { - UInt32 distance; - if (m_IsRepG1Decoders[state.Index].Decode(m_RangeDecoder) == 0) - { - distance = rep1; - } - else - { - if (m_IsRepG2Decoders[state.Index].Decode(m_RangeDecoder) == 0) - distance = rep2; - else - { - distance = rep3; - rep3 = rep2; - } - rep2 = rep1; - } - rep1 = rep0; - rep0 = distance; - } - len = m_RepLenDecoder.Decode(m_RangeDecoder, posState) + Base.kMatchMinLen; - state.UpdateRep(); - } - else - { - rep3 = rep2; - rep2 = rep1; - rep1 = rep0; - len = Base.kMatchMinLen + m_LenDecoder.Decode(m_RangeDecoder, posState); - state.UpdateMatch(); - uint posSlot = m_PosSlotDecoder[Base.GetLenToPosState(len)].Decode(m_RangeDecoder); - if (posSlot >= Base.kStartPosModelIndex) - { - int numDirectBits = (int)((posSlot >> 1) - 1); - rep0 = ((2 | (posSlot & 1)) << numDirectBits); - if (posSlot < Base.kEndPosModelIndex) - rep0 += BitTreeDecoder.ReverseDecode(m_PosDecoders, - rep0 - posSlot - 1, m_RangeDecoder, numDirectBits); - else - { - rep0 += (m_RangeDecoder.DecodeDirectBits( - numDirectBits - Base.kNumAlignBits) << Base.kNumAlignBits); - rep0 += m_PosAlignDecoder.ReverseDecode(m_RangeDecoder); - } - } - else - rep0 = posSlot; - } - if (rep0 >= m_OutWindow.TrainSize + nowPos64 || rep0 >= m_DictionarySizeCheck) - { - if (rep0 == 0xFFFFFFFF) - break; - throw new DataErrorException(); - } - m_OutWindow.CopyBlock(rep0, len); - nowPos64 += len; - } - } - } - m_OutWindow.Flush(); - m_OutWindow.ReleaseStream(); - m_RangeDecoder.ReleaseStream(); - } - - public void SetDecoderProperties(byte[] properties) - { - if (properties.Length < 5) - throw new InvalidParamException(); - int lc = properties[0] % 9; - int remainder = properties[0] / 9; - int lp = remainder % 5; - int pb = remainder / 5; - if (pb > Base.kNumPosStatesBitsMax) - throw new InvalidParamException(); - UInt32 dictionarySize = 0; - for (int i = 0; i < 4; i++) - dictionarySize += ((UInt32)(properties[1 + i])) << (i * 8); - SetDictionarySize(dictionarySize); - SetLiteralProperties(lp, lc); - SetPosBitsProperties(pb); - } - - public bool Train(System.IO.Stream stream) - { - _solid = true; - return m_OutWindow.Train(stream); - } - - /* - public override bool CanRead { get { return true; }} - public override bool CanWrite { get { return true; }} - public override bool CanSeek { get { return true; }} - public override long Length { get { return 0; }} - public override long Position - { - get { return 0; } - set { } - } - public override void Flush() { } - public override int Read(byte[] buffer, int offset, int count) - { - return 0; - } - public override void Write(byte[] buffer, int offset, int count) - { - } - public override long Seek(long offset, System.IO.SeekOrigin origin) - { - return 0; - } - public override void SetLength(long value) {} - */ - } -} diff --git a/src/Microsoft.DotNet.Archive/LZMA/Compress/LZMA/LzmaEncoder.cs b/src/Microsoft.DotNet.Archive/LZMA/Compress/LZMA/LzmaEncoder.cs deleted file mode 100644 index 527a67e0c..000000000 --- a/src/Microsoft.DotNet.Archive/LZMA/Compress/LZMA/LzmaEncoder.cs +++ /dev/null @@ -1,1483 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// LzmaEncoder.cs - -using System; - -namespace SevenZip.Compression.LZMA -{ - using RangeCoder; - - public class Encoder : ICoder, ISetCoderProperties, IWriteCoderProperties - { - enum EMatchFinderType - { - BT2, - BT4, - }; - - const UInt32 kIfinityPrice = 0xFFFFFFF; - - static Byte[] g_FastPos = new Byte[1 << 11]; - - static Encoder() - { - const Byte kFastSlots = 22; - int c = 2; - g_FastPos[0] = 0; - g_FastPos[1] = 1; - for (Byte slotFast = 2; slotFast < kFastSlots; slotFast++) - { - UInt32 k = ((UInt32)1 << ((slotFast >> 1) - 1)); - for (UInt32 j = 0; j < k; j++, c++) - g_FastPos[c] = slotFast; - } - } - - static UInt32 GetPosSlot(UInt32 pos) - { - if (pos < (1 << 11)) - return g_FastPos[pos]; - if (pos < (1 << 21)) - return (UInt32)(g_FastPos[pos >> 10] + 20); - return (UInt32)(g_FastPos[pos >> 20] + 40); - } - - static UInt32 GetPosSlot2(UInt32 pos) - { - if (pos < (1 << 17)) - return (UInt32)(g_FastPos[pos >> 6] + 12); - if (pos < (1 << 27)) - return (UInt32)(g_FastPos[pos >> 16] + 32); - return (UInt32)(g_FastPos[pos >> 26] + 52); - } - - Base.State _state = new Base.State(); - Byte _previousByte; - UInt32[] _repDistances = new UInt32[Base.kNumRepDistances]; - - void BaseInit() - { - _state.Init(); - _previousByte = 0; - for (UInt32 i = 0; i < Base.kNumRepDistances; i++) - _repDistances[i] = 0; - } - - const int kDefaultDictionaryLogSize = 22; - const UInt32 kNumFastBytesDefault = 0x20; - - class LiteralEncoder - { - public struct Encoder2 - { - BitEncoder[] m_Encoders; - - public void Create() { m_Encoders = new BitEncoder[0x300]; } - - public void Init() { for (int i = 0; i < 0x300; i++) m_Encoders[i].Init(); } - - public void Encode(RangeCoder.Encoder rangeEncoder, byte symbol) - { - uint context = 1; - for (int i = 7; i >= 0; i--) - { - uint bit = (uint)((symbol >> i) & 1); - m_Encoders[context].Encode(rangeEncoder, bit); - context = (context << 1) | bit; - } - } - - public void EncodeMatched(RangeCoder.Encoder rangeEncoder, byte matchByte, byte symbol) - { - uint context = 1; - bool same = true; - for (int i = 7; i >= 0; i--) - { - uint bit = (uint)((symbol >> i) & 1); - uint state = context; - if (same) - { - uint matchBit = (uint)((matchByte >> i) & 1); - state += ((1 + matchBit) << 8); - same = (matchBit == bit); - } - m_Encoders[state].Encode(rangeEncoder, bit); - context = (context << 1) | bit; - } - } - - public uint GetPrice(bool matchMode, byte matchByte, byte symbol) - { - uint price = 0; - uint context = 1; - int i = 7; - if (matchMode) - { - for (; i >= 0; i--) - { - uint matchBit = (uint)(matchByte >> i) & 1; - uint bit = (uint)(symbol >> i) & 1; - price += m_Encoders[((1 + matchBit) << 8) + context].GetPrice(bit); - context = (context << 1) | bit; - if (matchBit != bit) - { - i--; - break; - } - } - } - for (; i >= 0; i--) - { - uint bit = (uint)(symbol >> i) & 1; - price += m_Encoders[context].GetPrice(bit); - context = (context << 1) | bit; - } - return price; - } - } - - Encoder2[] m_Coders; - int m_NumPrevBits; - int m_NumPosBits; - uint m_PosMask; - - public void Create(int numPosBits, int numPrevBits) - { - if (m_Coders != null && m_NumPrevBits == numPrevBits && m_NumPosBits == numPosBits) - return; - m_NumPosBits = numPosBits; - m_PosMask = ((uint)1 << numPosBits) - 1; - m_NumPrevBits = numPrevBits; - uint numStates = (uint)1 << (m_NumPrevBits + m_NumPosBits); - m_Coders = new Encoder2[numStates]; - for (uint i = 0; i < numStates; i++) - m_Coders[i].Create(); - } - - public void Init() - { - uint numStates = (uint)1 << (m_NumPrevBits + m_NumPosBits); - for (uint i = 0; i < numStates; i++) - m_Coders[i].Init(); - } - - public Encoder2 GetSubCoder(UInt32 pos, Byte prevByte) - { return m_Coders[((pos & m_PosMask) << m_NumPrevBits) + (uint)(prevByte >> (8 - m_NumPrevBits))]; } - } - - class LenEncoder - { - RangeCoder.BitEncoder _choice = new RangeCoder.BitEncoder(); - RangeCoder.BitEncoder _choice2 = new RangeCoder.BitEncoder(); - RangeCoder.BitTreeEncoder[] _lowCoder = new RangeCoder.BitTreeEncoder[Base.kNumPosStatesEncodingMax]; - RangeCoder.BitTreeEncoder[] _midCoder = new RangeCoder.BitTreeEncoder[Base.kNumPosStatesEncodingMax]; - RangeCoder.BitTreeEncoder _highCoder = new RangeCoder.BitTreeEncoder(Base.kNumHighLenBits); - - public LenEncoder() - { - for (UInt32 posState = 0; posState < Base.kNumPosStatesEncodingMax; posState++) - { - _lowCoder[posState] = new RangeCoder.BitTreeEncoder(Base.kNumLowLenBits); - _midCoder[posState] = new RangeCoder.BitTreeEncoder(Base.kNumMidLenBits); - } - } - - public void Init(UInt32 numPosStates) - { - _choice.Init(); - _choice2.Init(); - for (UInt32 posState = 0; posState < numPosStates; posState++) - { - _lowCoder[posState].Init(); - _midCoder[posState].Init(); - } - _highCoder.Init(); - } - - public void Encode(RangeCoder.Encoder rangeEncoder, UInt32 symbol, UInt32 posState) - { - if (symbol < Base.kNumLowLenSymbols) - { - _choice.Encode(rangeEncoder, 0); - _lowCoder[posState].Encode(rangeEncoder, symbol); - } - else - { - symbol -= Base.kNumLowLenSymbols; - _choice.Encode(rangeEncoder, 1); - if (symbol < Base.kNumMidLenSymbols) - { - _choice2.Encode(rangeEncoder, 0); - _midCoder[posState].Encode(rangeEncoder, symbol); - } - else - { - _choice2.Encode(rangeEncoder, 1); - _highCoder.Encode(rangeEncoder, symbol - Base.kNumMidLenSymbols); - } - } - } - - public void SetPrices(UInt32 posState, UInt32 numSymbols, UInt32[] prices, UInt32 st) - { - UInt32 a0 = _choice.GetPrice0(); - UInt32 a1 = _choice.GetPrice1(); - UInt32 b0 = a1 + _choice2.GetPrice0(); - UInt32 b1 = a1 + _choice2.GetPrice1(); - UInt32 i = 0; - for (i = 0; i < Base.kNumLowLenSymbols; i++) - { - if (i >= numSymbols) - return; - prices[st + i] = a0 + _lowCoder[posState].GetPrice(i); - } - for (; i < Base.kNumLowLenSymbols + Base.kNumMidLenSymbols; i++) - { - if (i >= numSymbols) - return; - prices[st + i] = b0 + _midCoder[posState].GetPrice(i - Base.kNumLowLenSymbols); - } - for (; i < numSymbols; i++) - prices[st + i] = b1 + _highCoder.GetPrice(i - Base.kNumLowLenSymbols - Base.kNumMidLenSymbols); - } - }; - - const UInt32 kNumLenSpecSymbols = Base.kNumLowLenSymbols + Base.kNumMidLenSymbols; - - class LenPriceTableEncoder : LenEncoder - { - UInt32[] _prices = new UInt32[Base.kNumLenSymbols << Base.kNumPosStatesBitsEncodingMax]; - UInt32 _tableSize; - UInt32[] _counters = new UInt32[Base.kNumPosStatesEncodingMax]; - - public void SetTableSize(UInt32 tableSize) { _tableSize = tableSize; } - - public UInt32 GetPrice(UInt32 symbol, UInt32 posState) - { - return _prices[posState * Base.kNumLenSymbols + symbol]; - } - - void UpdateTable(UInt32 posState) - { - SetPrices(posState, _tableSize, _prices, posState * Base.kNumLenSymbols); - _counters[posState] = _tableSize; - } - - public void UpdateTables(UInt32 numPosStates) - { - for (UInt32 posState = 0; posState < numPosStates; posState++) - UpdateTable(posState); - } - - public new void Encode(RangeCoder.Encoder rangeEncoder, UInt32 symbol, UInt32 posState) - { - base.Encode(rangeEncoder, symbol, posState); - if (--_counters[posState] == 0) - UpdateTable(posState); - } - } - - const UInt32 kNumOpts = 1 << 12; - class Optimal - { - public Base.State State; - - public bool Prev1IsChar; - public bool Prev2; - - public UInt32 PosPrev2; - public UInt32 BackPrev2; - - public UInt32 Price; - public UInt32 PosPrev; - public UInt32 BackPrev; - - public UInt32 Backs0; - public UInt32 Backs1; - public UInt32 Backs2; - public UInt32 Backs3; - - public void MakeAsChar() { BackPrev = 0xFFFFFFFF; Prev1IsChar = false; } - public void MakeAsShortRep() { BackPrev = 0; ; Prev1IsChar = false; } - public bool IsShortRep() { return (BackPrev == 0); } - }; - Optimal[] _optimum = new Optimal[kNumOpts]; - LZ.IMatchFinder _matchFinder = null; - RangeCoder.Encoder _rangeEncoder = new RangeCoder.Encoder(); - - RangeCoder.BitEncoder[] _isMatch = new RangeCoder.BitEncoder[Base.kNumStates << Base.kNumPosStatesBitsMax]; - RangeCoder.BitEncoder[] _isRep = new RangeCoder.BitEncoder[Base.kNumStates]; - RangeCoder.BitEncoder[] _isRepG0 = new RangeCoder.BitEncoder[Base.kNumStates]; - RangeCoder.BitEncoder[] _isRepG1 = new RangeCoder.BitEncoder[Base.kNumStates]; - RangeCoder.BitEncoder[] _isRepG2 = new RangeCoder.BitEncoder[Base.kNumStates]; - RangeCoder.BitEncoder[] _isRep0Long = new RangeCoder.BitEncoder[Base.kNumStates << Base.kNumPosStatesBitsMax]; - - RangeCoder.BitTreeEncoder[] _posSlotEncoder = new RangeCoder.BitTreeEncoder[Base.kNumLenToPosStates]; - - RangeCoder.BitEncoder[] _posEncoders = new RangeCoder.BitEncoder[Base.kNumFullDistances - Base.kEndPosModelIndex]; - RangeCoder.BitTreeEncoder _posAlignEncoder = new RangeCoder.BitTreeEncoder(Base.kNumAlignBits); - - LenPriceTableEncoder _lenEncoder = new LenPriceTableEncoder(); - LenPriceTableEncoder _repMatchLenEncoder = new LenPriceTableEncoder(); - - LiteralEncoder _literalEncoder = new LiteralEncoder(); - - UInt32[] _matchDistances = new UInt32[Base.kMatchMaxLen * 2 + 2]; - - UInt32 _numFastBytes = kNumFastBytesDefault; - UInt32 _longestMatchLength; - UInt32 _numDistancePairs; - - UInt32 _additionalOffset; - - UInt32 _optimumEndIndex; - UInt32 _optimumCurrentIndex; - - bool _longestMatchWasFound; - - UInt32[] _posSlotPrices = new UInt32[1 << (Base.kNumPosSlotBits + Base.kNumLenToPosStatesBits)]; - UInt32[] _distancesPrices = new UInt32[Base.kNumFullDistances << Base.kNumLenToPosStatesBits]; - UInt32[] _alignPrices = new UInt32[Base.kAlignTableSize]; - UInt32 _alignPriceCount; - - UInt32 _distTableSize = (kDefaultDictionaryLogSize * 2); - - int _posStateBits = 2; - UInt32 _posStateMask = (4 - 1); - int _numLiteralPosStateBits = 0; - int _numLiteralContextBits = 3; - - UInt32 _dictionarySize = (1 << kDefaultDictionaryLogSize); - UInt32 _dictionarySizePrev = 0xFFFFFFFF; - UInt32 _numFastBytesPrev = 0xFFFFFFFF; - - Int64 nowPos64; - bool _finished; - System.IO.Stream _inStream; - - EMatchFinderType _matchFinderType = EMatchFinderType.BT4; - bool _writeEndMark = false; - - bool _needReleaseMFStream; - - void Create() - { - if (_matchFinder == null) - { - LZ.BinTree bt = new LZ.BinTree(); - int numHashBytes = 4; - if (_matchFinderType == EMatchFinderType.BT2) - numHashBytes = 2; - bt.SetType(numHashBytes); - _matchFinder = bt; - } - _literalEncoder.Create(_numLiteralPosStateBits, _numLiteralContextBits); - - if (_dictionarySize == _dictionarySizePrev && _numFastBytesPrev == _numFastBytes) - return; - _matchFinder.Create(_dictionarySize, kNumOpts, _numFastBytes, Base.kMatchMaxLen + 1); - _dictionarySizePrev = _dictionarySize; - _numFastBytesPrev = _numFastBytes; - } - - public Encoder() - { - for (int i = 0; i < kNumOpts; i++) - _optimum[i] = new Optimal(); - for (int i = 0; i < Base.kNumLenToPosStates; i++) - _posSlotEncoder[i] = new RangeCoder.BitTreeEncoder(Base.kNumPosSlotBits); - } - - void SetWriteEndMarkerMode(bool writeEndMarker) - { - _writeEndMark = writeEndMarker; - } - - void Init() - { - BaseInit(); - _rangeEncoder.Init(); - - uint i; - for (i = 0; i < Base.kNumStates; i++) - { - for (uint j = 0; j <= _posStateMask; j++) - { - uint complexState = (i << Base.kNumPosStatesBitsMax) + j; - _isMatch[complexState].Init(); - _isRep0Long[complexState].Init(); - } - _isRep[i].Init(); - _isRepG0[i].Init(); - _isRepG1[i].Init(); - _isRepG2[i].Init(); - } - _literalEncoder.Init(); - for (i = 0; i < Base.kNumLenToPosStates; i++) - _posSlotEncoder[i].Init(); - for (i = 0; i < Base.kNumFullDistances - Base.kEndPosModelIndex; i++) - _posEncoders[i].Init(); - - _lenEncoder.Init((UInt32)1 << _posStateBits); - _repMatchLenEncoder.Init((UInt32)1 << _posStateBits); - - _posAlignEncoder.Init(); - - _longestMatchWasFound = false; - _optimumEndIndex = 0; - _optimumCurrentIndex = 0; - _additionalOffset = 0; - } - - void ReadMatchDistances(out UInt32 lenRes, out UInt32 numDistancePairs) - { - lenRes = 0; - numDistancePairs = _matchFinder.GetMatches(_matchDistances); - if (numDistancePairs > 0) - { - lenRes = _matchDistances[numDistancePairs - 2]; - if (lenRes == _numFastBytes) - lenRes += _matchFinder.GetMatchLen((int)lenRes - 1, _matchDistances[numDistancePairs - 1], - Base.kMatchMaxLen - lenRes); - } - _additionalOffset++; - } - - - void MovePos(UInt32 num) - { - if (num > 0) - { - _matchFinder.Skip(num); - _additionalOffset += num; - } - } - - UInt32 GetRepLen1Price(Base.State state, UInt32 posState) - { - return _isRepG0[state.Index].GetPrice0() + - _isRep0Long[(state.Index << Base.kNumPosStatesBitsMax) + posState].GetPrice0(); - } - - UInt32 GetPureRepPrice(UInt32 repIndex, Base.State state, UInt32 posState) - { - UInt32 price; - if (repIndex == 0) - { - price = _isRepG0[state.Index].GetPrice0(); - price += _isRep0Long[(state.Index << Base.kNumPosStatesBitsMax) + posState].GetPrice1(); - } - else - { - price = _isRepG0[state.Index].GetPrice1(); - if (repIndex == 1) - price += _isRepG1[state.Index].GetPrice0(); - else - { - price += _isRepG1[state.Index].GetPrice1(); - price += _isRepG2[state.Index].GetPrice(repIndex - 2); - } - } - return price; - } - - UInt32 GetRepPrice(UInt32 repIndex, UInt32 len, Base.State state, UInt32 posState) - { - UInt32 price = _repMatchLenEncoder.GetPrice(len - Base.kMatchMinLen, posState); - return price + GetPureRepPrice(repIndex, state, posState); - } - - UInt32 GetPosLenPrice(UInt32 pos, UInt32 len, UInt32 posState) - { - UInt32 price; - UInt32 lenToPosState = Base.GetLenToPosState(len); - if (pos < Base.kNumFullDistances) - price = _distancesPrices[(lenToPosState * Base.kNumFullDistances) + pos]; - else - price = _posSlotPrices[(lenToPosState << Base.kNumPosSlotBits) + GetPosSlot2(pos)] + - _alignPrices[pos & Base.kAlignMask]; - return price + _lenEncoder.GetPrice(len - Base.kMatchMinLen, posState); - } - - UInt32 Backward(out UInt32 backRes, UInt32 cur) - { - _optimumEndIndex = cur; - UInt32 posMem = _optimum[cur].PosPrev; - UInt32 backMem = _optimum[cur].BackPrev; - do - { - if (_optimum[cur].Prev1IsChar) - { - _optimum[posMem].MakeAsChar(); - _optimum[posMem].PosPrev = posMem - 1; - if (_optimum[cur].Prev2) - { - _optimum[posMem - 1].Prev1IsChar = false; - _optimum[posMem - 1].PosPrev = _optimum[cur].PosPrev2; - _optimum[posMem - 1].BackPrev = _optimum[cur].BackPrev2; - } - } - UInt32 posPrev = posMem; - UInt32 backCur = backMem; - - backMem = _optimum[posPrev].BackPrev; - posMem = _optimum[posPrev].PosPrev; - - _optimum[posPrev].BackPrev = backCur; - _optimum[posPrev].PosPrev = cur; - cur = posPrev; - } - while (cur > 0); - backRes = _optimum[0].BackPrev; - _optimumCurrentIndex = _optimum[0].PosPrev; - return _optimumCurrentIndex; - } - - UInt32[] reps = new UInt32[Base.kNumRepDistances]; - UInt32[] repLens = new UInt32[Base.kNumRepDistances]; - - - UInt32 GetOptimum(UInt32 position, out UInt32 backRes) - { - if (_optimumEndIndex != _optimumCurrentIndex) - { - UInt32 lenRes = _optimum[_optimumCurrentIndex].PosPrev - _optimumCurrentIndex; - backRes = _optimum[_optimumCurrentIndex].BackPrev; - _optimumCurrentIndex = _optimum[_optimumCurrentIndex].PosPrev; - return lenRes; - } - _optimumCurrentIndex = _optimumEndIndex = 0; - - UInt32 lenMain, numDistancePairs; - if (!_longestMatchWasFound) - { - ReadMatchDistances(out lenMain, out numDistancePairs); - } - else - { - lenMain = _longestMatchLength; - numDistancePairs = _numDistancePairs; - _longestMatchWasFound = false; - } - - UInt32 numAvailableBytes = _matchFinder.GetNumAvailableBytes() + 1; - if (numAvailableBytes < 2) - { - backRes = 0xFFFFFFFF; - return 1; - } - if (numAvailableBytes > Base.kMatchMaxLen) - numAvailableBytes = Base.kMatchMaxLen; - - UInt32 repMaxIndex = 0; - UInt32 i; - for (i = 0; i < Base.kNumRepDistances; i++) - { - reps[i] = _repDistances[i]; - repLens[i] = _matchFinder.GetMatchLen(0 - 1, reps[i], Base.kMatchMaxLen); - if (repLens[i] > repLens[repMaxIndex]) - repMaxIndex = i; - } - if (repLens[repMaxIndex] >= _numFastBytes) - { - backRes = repMaxIndex; - UInt32 lenRes = repLens[repMaxIndex]; - MovePos(lenRes - 1); - return lenRes; - } - - if (lenMain >= _numFastBytes) - { - backRes = _matchDistances[numDistancePairs - 1] + Base.kNumRepDistances; - MovePos(lenMain - 1); - return lenMain; - } - - Byte currentByte = _matchFinder.GetIndexByte(0 - 1); - Byte matchByte = _matchFinder.GetIndexByte((Int32)(0 - _repDistances[0] - 1 - 1)); - - if (lenMain < 2 && currentByte != matchByte && repLens[repMaxIndex] < 2) - { - backRes = (UInt32)0xFFFFFFFF; - return 1; - } - - _optimum[0].State = _state; - - UInt32 posState = (position & _posStateMask); - - _optimum[1].Price = _isMatch[(_state.Index << Base.kNumPosStatesBitsMax) + posState].GetPrice0() + - _literalEncoder.GetSubCoder(position, _previousByte).GetPrice(!_state.IsCharState(), matchByte, currentByte); - _optimum[1].MakeAsChar(); - - UInt32 matchPrice = _isMatch[(_state.Index << Base.kNumPosStatesBitsMax) + posState].GetPrice1(); - UInt32 repMatchPrice = matchPrice + _isRep[_state.Index].GetPrice1(); - - if (matchByte == currentByte) - { - UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(_state, posState); - if (shortRepPrice < _optimum[1].Price) - { - _optimum[1].Price = shortRepPrice; - _optimum[1].MakeAsShortRep(); - } - } - - UInt32 lenEnd = ((lenMain >= repLens[repMaxIndex]) ? lenMain : repLens[repMaxIndex]); - - if(lenEnd < 2) - { - backRes = _optimum[1].BackPrev; - return 1; - } - - _optimum[1].PosPrev = 0; - - _optimum[0].Backs0 = reps[0]; - _optimum[0].Backs1 = reps[1]; - _optimum[0].Backs2 = reps[2]; - _optimum[0].Backs3 = reps[3]; - - UInt32 len = lenEnd; - do - _optimum[len--].Price = kIfinityPrice; - while (len >= 2); - - for (i = 0; i < Base.kNumRepDistances; i++) - { - UInt32 repLen = repLens[i]; - if (repLen < 2) - continue; - UInt32 price = repMatchPrice + GetPureRepPrice(i, _state, posState); - do - { - UInt32 curAndLenPrice = price + _repMatchLenEncoder.GetPrice(repLen - 2, posState); - Optimal optimum = _optimum[repLen]; - if (curAndLenPrice < optimum.Price) - { - optimum.Price = curAndLenPrice; - optimum.PosPrev = 0; - optimum.BackPrev = i; - optimum.Prev1IsChar = false; - } - } - while (--repLen >= 2); - } - - UInt32 normalMatchPrice = matchPrice + _isRep[_state.Index].GetPrice0(); - - len = ((repLens[0] >= 2) ? repLens[0] + 1 : 2); - if (len <= lenMain) - { - UInt32 offs = 0; - while (len > _matchDistances[offs]) - offs += 2; - for (; ; len++) - { - UInt32 distance = _matchDistances[offs + 1]; - UInt32 curAndLenPrice = normalMatchPrice + GetPosLenPrice(distance, len, posState); - Optimal optimum = _optimum[len]; - if (curAndLenPrice < optimum.Price) - { - optimum.Price = curAndLenPrice; - optimum.PosPrev = 0; - optimum.BackPrev = distance + Base.kNumRepDistances; - optimum.Prev1IsChar = false; - } - if (len == _matchDistances[offs]) - { - offs += 2; - if (offs == numDistancePairs) - break; - } - } - } - - UInt32 cur = 0; - - while (true) - { - cur++; - if (cur == lenEnd) - return Backward(out backRes, cur); - UInt32 newLen; - ReadMatchDistances(out newLen, out numDistancePairs); - if (newLen >= _numFastBytes) - { - _numDistancePairs = numDistancePairs; - _longestMatchLength = newLen; - _longestMatchWasFound = true; - return Backward(out backRes, cur); - } - position++; - UInt32 posPrev = _optimum[cur].PosPrev; - Base.State state; - if (_optimum[cur].Prev1IsChar) - { - posPrev--; - if (_optimum[cur].Prev2) - { - state = _optimum[_optimum[cur].PosPrev2].State; - if (_optimum[cur].BackPrev2 < Base.kNumRepDistances) - state.UpdateRep(); - else - state.UpdateMatch(); - } - else - state = _optimum[posPrev].State; - state.UpdateChar(); - } - else - state = _optimum[posPrev].State; - if (posPrev == cur - 1) - { - if (_optimum[cur].IsShortRep()) - state.UpdateShortRep(); - else - state.UpdateChar(); - } - else - { - UInt32 pos; - if (_optimum[cur].Prev1IsChar && _optimum[cur].Prev2) - { - posPrev = _optimum[cur].PosPrev2; - pos = _optimum[cur].BackPrev2; - state.UpdateRep(); - } - else - { - pos = _optimum[cur].BackPrev; - if (pos < Base.kNumRepDistances) - state.UpdateRep(); - else - state.UpdateMatch(); - } - Optimal opt = _optimum[posPrev]; - if (pos < Base.kNumRepDistances) - { - if (pos == 0) - { - reps[0] = opt.Backs0; - reps[1] = opt.Backs1; - reps[2] = opt.Backs2; - reps[3] = opt.Backs3; - } - else if (pos == 1) - { - reps[0] = opt.Backs1; - reps[1] = opt.Backs0; - reps[2] = opt.Backs2; - reps[3] = opt.Backs3; - } - else if (pos == 2) - { - reps[0] = opt.Backs2; - reps[1] = opt.Backs0; - reps[2] = opt.Backs1; - reps[3] = opt.Backs3; - } - else - { - reps[0] = opt.Backs3; - reps[1] = opt.Backs0; - reps[2] = opt.Backs1; - reps[3] = opt.Backs2; - } - } - else - { - reps[0] = (pos - Base.kNumRepDistances); - reps[1] = opt.Backs0; - reps[2] = opt.Backs1; - reps[3] = opt.Backs2; - } - } - _optimum[cur].State = state; - _optimum[cur].Backs0 = reps[0]; - _optimum[cur].Backs1 = reps[1]; - _optimum[cur].Backs2 = reps[2]; - _optimum[cur].Backs3 = reps[3]; - UInt32 curPrice = _optimum[cur].Price; - - currentByte = _matchFinder.GetIndexByte(0 - 1); - matchByte = _matchFinder.GetIndexByte((Int32)(0 - reps[0] - 1 - 1)); - - posState = (position & _posStateMask); - - UInt32 curAnd1Price = curPrice + - _isMatch[(state.Index << Base.kNumPosStatesBitsMax) + posState].GetPrice0() + - _literalEncoder.GetSubCoder(position, _matchFinder.GetIndexByte(0 - 2)). - GetPrice(!state.IsCharState(), matchByte, currentByte); - - Optimal nextOptimum = _optimum[cur + 1]; - - bool nextIsChar = false; - if (curAnd1Price < nextOptimum.Price) - { - nextOptimum.Price = curAnd1Price; - nextOptimum.PosPrev = cur; - nextOptimum.MakeAsChar(); - nextIsChar = true; - } - - matchPrice = curPrice + _isMatch[(state.Index << Base.kNumPosStatesBitsMax) + posState].GetPrice1(); - repMatchPrice = matchPrice + _isRep[state.Index].GetPrice1(); - - if (matchByte == currentByte && - !(nextOptimum.PosPrev < cur && nextOptimum.BackPrev == 0)) - { - UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(state, posState); - if (shortRepPrice <= nextOptimum.Price) - { - nextOptimum.Price = shortRepPrice; - nextOptimum.PosPrev = cur; - nextOptimum.MakeAsShortRep(); - nextIsChar = true; - } - } - - UInt32 numAvailableBytesFull = _matchFinder.GetNumAvailableBytes() + 1; - numAvailableBytesFull = Math.Min(kNumOpts - 1 - cur, numAvailableBytesFull); - numAvailableBytes = numAvailableBytesFull; - - if (numAvailableBytes < 2) - continue; - if (numAvailableBytes > _numFastBytes) - numAvailableBytes = _numFastBytes; - if (!nextIsChar && matchByte != currentByte) - { - // try Literal + rep0 - UInt32 t = Math.Min(numAvailableBytesFull - 1, _numFastBytes); - UInt32 lenTest2 = _matchFinder.GetMatchLen(0, reps[0], t); - if (lenTest2 >= 2) - { - Base.State state2 = state; - state2.UpdateChar(); - UInt32 posStateNext = (position + 1) & _posStateMask; - UInt32 nextRepMatchPrice = curAnd1Price + - _isMatch[(state2.Index << Base.kNumPosStatesBitsMax) + posStateNext].GetPrice1() + - _isRep[state2.Index].GetPrice1(); - { - UInt32 offset = cur + 1 + lenTest2; - while (lenEnd < offset) - _optimum[++lenEnd].Price = kIfinityPrice; - UInt32 curAndLenPrice = nextRepMatchPrice + GetRepPrice( - 0, lenTest2, state2, posStateNext); - Optimal optimum = _optimum[offset]; - if (curAndLenPrice < optimum.Price) - { - optimum.Price = curAndLenPrice; - optimum.PosPrev = cur + 1; - optimum.BackPrev = 0; - optimum.Prev1IsChar = true; - optimum.Prev2 = false; - } - } - } - } - - UInt32 startLen = 2; // speed optimization - - for (UInt32 repIndex = 0; repIndex < Base.kNumRepDistances; repIndex++) - { - UInt32 lenTest = _matchFinder.GetMatchLen(0 - 1, reps[repIndex], numAvailableBytes); - if (lenTest < 2) - continue; - UInt32 lenTestTemp = lenTest; - do - { - while (lenEnd < cur + lenTest) - _optimum[++lenEnd].Price = kIfinityPrice; - UInt32 curAndLenPrice = repMatchPrice + GetRepPrice(repIndex, lenTest, state, posState); - Optimal optimum = _optimum[cur + lenTest]; - if (curAndLenPrice < optimum.Price) - { - optimum.Price = curAndLenPrice; - optimum.PosPrev = cur; - optimum.BackPrev = repIndex; - optimum.Prev1IsChar = false; - } - } - while(--lenTest >= 2); - lenTest = lenTestTemp; - - if (repIndex == 0) - startLen = lenTest + 1; - - // if (_maxMode) - if (lenTest < numAvailableBytesFull) - { - UInt32 t = Math.Min(numAvailableBytesFull - 1 - lenTest, _numFastBytes); - UInt32 lenTest2 = _matchFinder.GetMatchLen((Int32)lenTest, reps[repIndex], t); - if (lenTest2 >= 2) - { - Base.State state2 = state; - state2.UpdateRep(); - UInt32 posStateNext = (position + lenTest) & _posStateMask; - UInt32 curAndLenCharPrice = - repMatchPrice + GetRepPrice(repIndex, lenTest, state, posState) + - _isMatch[(state2.Index << Base.kNumPosStatesBitsMax) + posStateNext].GetPrice0() + - _literalEncoder.GetSubCoder(position + lenTest, - _matchFinder.GetIndexByte((Int32)lenTest - 1 - 1)).GetPrice(true, - _matchFinder.GetIndexByte((Int32)((Int32)lenTest - 1 - (Int32)(reps[repIndex] + 1))), - _matchFinder.GetIndexByte((Int32)lenTest - 1)); - state2.UpdateChar(); - posStateNext = (position + lenTest + 1) & _posStateMask; - UInt32 nextMatchPrice = curAndLenCharPrice + _isMatch[(state2.Index << Base.kNumPosStatesBitsMax) + posStateNext].GetPrice1(); - UInt32 nextRepMatchPrice = nextMatchPrice + _isRep[state2.Index].GetPrice1(); - - // for(; lenTest2 >= 2; lenTest2--) - { - UInt32 offset = lenTest + 1 + lenTest2; - while(lenEnd < cur + offset) - _optimum[++lenEnd].Price = kIfinityPrice; - UInt32 curAndLenPrice = nextRepMatchPrice + GetRepPrice(0, lenTest2, state2, posStateNext); - Optimal optimum = _optimum[cur + offset]; - if (curAndLenPrice < optimum.Price) - { - optimum.Price = curAndLenPrice; - optimum.PosPrev = cur + lenTest + 1; - optimum.BackPrev = 0; - optimum.Prev1IsChar = true; - optimum.Prev2 = true; - optimum.PosPrev2 = cur; - optimum.BackPrev2 = repIndex; - } - } - } - } - } - - if (newLen > numAvailableBytes) - { - newLen = numAvailableBytes; - for (numDistancePairs = 0; newLen > _matchDistances[numDistancePairs]; numDistancePairs += 2) ; - _matchDistances[numDistancePairs] = newLen; - numDistancePairs += 2; - } - if (newLen >= startLen) - { - normalMatchPrice = matchPrice + _isRep[state.Index].GetPrice0(); - while (lenEnd < cur + newLen) - _optimum[++lenEnd].Price = kIfinityPrice; - - UInt32 offs = 0; - while (startLen > _matchDistances[offs]) - offs += 2; - - for (UInt32 lenTest = startLen; ; lenTest++) - { - UInt32 curBack = _matchDistances[offs + 1]; - UInt32 curAndLenPrice = normalMatchPrice + GetPosLenPrice(curBack, lenTest, posState); - Optimal optimum = _optimum[cur + lenTest]; - if (curAndLenPrice < optimum.Price) - { - optimum.Price = curAndLenPrice; - optimum.PosPrev = cur; - optimum.BackPrev = curBack + Base.kNumRepDistances; - optimum.Prev1IsChar = false; - } - - if (lenTest == _matchDistances[offs]) - { - if (lenTest < numAvailableBytesFull) - { - UInt32 t = Math.Min(numAvailableBytesFull - 1 - lenTest, _numFastBytes); - UInt32 lenTest2 = _matchFinder.GetMatchLen((Int32)lenTest, curBack, t); - if (lenTest2 >= 2) - { - Base.State state2 = state; - state2.UpdateMatch(); - UInt32 posStateNext = (position + lenTest) & _posStateMask; - UInt32 curAndLenCharPrice = curAndLenPrice + - _isMatch[(state2.Index << Base.kNumPosStatesBitsMax) + posStateNext].GetPrice0() + - _literalEncoder.GetSubCoder(position + lenTest, - _matchFinder.GetIndexByte((Int32)lenTest - 1 - 1)). - GetPrice(true, - _matchFinder.GetIndexByte((Int32)lenTest - (Int32)(curBack + 1) - 1), - _matchFinder.GetIndexByte((Int32)lenTest - 1)); - state2.UpdateChar(); - posStateNext = (position + lenTest + 1) & _posStateMask; - UInt32 nextMatchPrice = curAndLenCharPrice + _isMatch[(state2.Index << Base.kNumPosStatesBitsMax) + posStateNext].GetPrice1(); - UInt32 nextRepMatchPrice = nextMatchPrice + _isRep[state2.Index].GetPrice1(); - - UInt32 offset = lenTest + 1 + lenTest2; - while (lenEnd < cur + offset) - _optimum[++lenEnd].Price = kIfinityPrice; - curAndLenPrice = nextRepMatchPrice + GetRepPrice(0, lenTest2, state2, posStateNext); - optimum = _optimum[cur + offset]; - if (curAndLenPrice < optimum.Price) - { - optimum.Price = curAndLenPrice; - optimum.PosPrev = cur + lenTest + 1; - optimum.BackPrev = 0; - optimum.Prev1IsChar = true; - optimum.Prev2 = true; - optimum.PosPrev2 = cur; - optimum.BackPrev2 = curBack + Base.kNumRepDistances; - } - } - } - offs += 2; - if (offs == numDistancePairs) - break; - } - } - } - } - } - - bool ChangePair(UInt32 smallDist, UInt32 bigDist) - { - const int kDif = 7; - return (smallDist < ((UInt32)(1) << (32 - kDif)) && bigDist >= (smallDist << kDif)); - } - - void WriteEndMarker(UInt32 posState) - { - if (!_writeEndMark) - return; - - _isMatch[(_state.Index << Base.kNumPosStatesBitsMax) + posState].Encode(_rangeEncoder, 1); - _isRep[_state.Index].Encode(_rangeEncoder, 0); - _state.UpdateMatch(); - UInt32 len = Base.kMatchMinLen; - _lenEncoder.Encode(_rangeEncoder, len - Base.kMatchMinLen, posState); - UInt32 posSlot = (1 << Base.kNumPosSlotBits) - 1; - UInt32 lenToPosState = Base.GetLenToPosState(len); - _posSlotEncoder[lenToPosState].Encode(_rangeEncoder, posSlot); - int footerBits = 30; - UInt32 posReduced = (((UInt32)1) << footerBits) - 1; - _rangeEncoder.EncodeDirectBits(posReduced >> Base.kNumAlignBits, footerBits - Base.kNumAlignBits); - _posAlignEncoder.ReverseEncode(_rangeEncoder, posReduced & Base.kAlignMask); - } - - void Flush(UInt32 nowPos) - { - ReleaseMFStream(); - WriteEndMarker(nowPos & _posStateMask); - _rangeEncoder.FlushData(); - _rangeEncoder.FlushStream(); - } - - public void CodeOneBlock(out Int64 inSize, out Int64 outSize, out bool finished) - { - inSize = 0; - outSize = 0; - finished = true; - - if (_inStream != null) - { - _matchFinder.SetStream(_inStream); - _matchFinder.Init(); - _needReleaseMFStream = true; - _inStream = null; - if (_trainSize > 0) - _matchFinder.Skip(_trainSize); - } - - if (_finished) - return; - _finished = true; - - - Int64 progressPosValuePrev = nowPos64; - if (nowPos64 == 0) - { - if (_matchFinder.GetNumAvailableBytes() == 0) - { - Flush((UInt32)nowPos64); - return; - } - UInt32 len, numDistancePairs; // it's not used - ReadMatchDistances(out len, out numDistancePairs); - UInt32 posState = (UInt32)(nowPos64) & _posStateMask; - _isMatch[(_state.Index << Base.kNumPosStatesBitsMax) + posState].Encode(_rangeEncoder, 0); - _state.UpdateChar(); - Byte curByte = _matchFinder.GetIndexByte((Int32)(0 - _additionalOffset)); - _literalEncoder.GetSubCoder((UInt32)(nowPos64), _previousByte).Encode(_rangeEncoder, curByte); - _previousByte = curByte; - _additionalOffset--; - nowPos64++; - } - if (_matchFinder.GetNumAvailableBytes() == 0) - { - Flush((UInt32)nowPos64); - return; - } - while (true) - { - UInt32 pos; - UInt32 len = GetOptimum((UInt32)nowPos64, out pos); - - UInt32 posState = ((UInt32)nowPos64) & _posStateMask; - UInt32 complexState = (_state.Index << Base.kNumPosStatesBitsMax) + posState; - if (len == 1 && pos == 0xFFFFFFFF) - { - _isMatch[complexState].Encode(_rangeEncoder, 0); - Byte curByte = _matchFinder.GetIndexByte((Int32)(0 - _additionalOffset)); - LiteralEncoder.Encoder2 subCoder = _literalEncoder.GetSubCoder((UInt32)nowPos64, _previousByte); - if (!_state.IsCharState()) - { - Byte matchByte = _matchFinder.GetIndexByte((Int32)(0 - _repDistances[0] - 1 - _additionalOffset)); - subCoder.EncodeMatched(_rangeEncoder, matchByte, curByte); - } - else - subCoder.Encode(_rangeEncoder, curByte); - _previousByte = curByte; - _state.UpdateChar(); - } - else - { - _isMatch[complexState].Encode(_rangeEncoder, 1); - if (pos < Base.kNumRepDistances) - { - _isRep[_state.Index].Encode(_rangeEncoder, 1); - if (pos == 0) - { - _isRepG0[_state.Index].Encode(_rangeEncoder, 0); - if (len == 1) - _isRep0Long[complexState].Encode(_rangeEncoder, 0); - else - _isRep0Long[complexState].Encode(_rangeEncoder, 1); - } - else - { - _isRepG0[_state.Index].Encode(_rangeEncoder, 1); - if (pos == 1) - _isRepG1[_state.Index].Encode(_rangeEncoder, 0); - else - { - _isRepG1[_state.Index].Encode(_rangeEncoder, 1); - _isRepG2[_state.Index].Encode(_rangeEncoder, pos - 2); - } - } - if (len == 1) - _state.UpdateShortRep(); - else - { - _repMatchLenEncoder.Encode(_rangeEncoder, len - Base.kMatchMinLen, posState); - _state.UpdateRep(); - } - UInt32 distance = _repDistances[pos]; - if (pos != 0) - { - for (UInt32 i = pos; i >= 1; i--) - _repDistances[i] = _repDistances[i - 1]; - _repDistances[0] = distance; - } - } - else - { - _isRep[_state.Index].Encode(_rangeEncoder, 0); - _state.UpdateMatch(); - _lenEncoder.Encode(_rangeEncoder, len - Base.kMatchMinLen, posState); - pos -= Base.kNumRepDistances; - UInt32 posSlot = GetPosSlot(pos); - UInt32 lenToPosState = Base.GetLenToPosState(len); - _posSlotEncoder[lenToPosState].Encode(_rangeEncoder, posSlot); - - if (posSlot >= Base.kStartPosModelIndex) - { - int footerBits = (int)((posSlot >> 1) - 1); - UInt32 baseVal = ((2 | (posSlot & 1)) << footerBits); - UInt32 posReduced = pos - baseVal; - - if (posSlot < Base.kEndPosModelIndex) - RangeCoder.BitTreeEncoder.ReverseEncode(_posEncoders, - baseVal - posSlot - 1, _rangeEncoder, footerBits, posReduced); - else - { - _rangeEncoder.EncodeDirectBits(posReduced >> Base.kNumAlignBits, footerBits - Base.kNumAlignBits); - _posAlignEncoder.ReverseEncode(_rangeEncoder, posReduced & Base.kAlignMask); - _alignPriceCount++; - } - } - UInt32 distance = pos; - for (UInt32 i = Base.kNumRepDistances - 1; i >= 1; i--) - _repDistances[i] = _repDistances[i - 1]; - _repDistances[0] = distance; - _matchPriceCount++; - } - _previousByte = _matchFinder.GetIndexByte((Int32)(len - 1 - _additionalOffset)); - } - _additionalOffset -= len; - nowPos64 += len; - if (_additionalOffset == 0) - { - // if (!_fastMode) - if (_matchPriceCount >= (1 << 7)) - FillDistancesPrices(); - if (_alignPriceCount >= Base.kAlignTableSize) - FillAlignPrices(); - inSize = nowPos64; - outSize = _rangeEncoder.GetProcessedSizeAdd(); - if (_matchFinder.GetNumAvailableBytes() == 0) - { - Flush((UInt32)nowPos64); - return; - } - - if (nowPos64 - progressPosValuePrev >= (1 << 12)) - { - _finished = false; - finished = false; - return; - } - } - } - } - - void ReleaseMFStream() - { - if (_matchFinder != null && _needReleaseMFStream) - { - _matchFinder.ReleaseStream(); - _needReleaseMFStream = false; - } - } - - void SetOutStream(System.IO.Stream outStream) { _rangeEncoder.SetStream(outStream); } - void ReleaseOutStream() { _rangeEncoder.ReleaseStream(); } - - void ReleaseStreams() - { - ReleaseMFStream(); - ReleaseOutStream(); - } - - void SetStreams(System.IO.Stream inStream, System.IO.Stream outStream, - Int64 inSize, Int64 outSize) - { - _inStream = inStream; - _finished = false; - Create(); - SetOutStream(outStream); - Init(); - - // if (!_fastMode) - { - FillDistancesPrices(); - FillAlignPrices(); - } - - _lenEncoder.SetTableSize(_numFastBytes + 1 - Base.kMatchMinLen); - _lenEncoder.UpdateTables((UInt32)1 << _posStateBits); - _repMatchLenEncoder.SetTableSize(_numFastBytes + 1 - Base.kMatchMinLen); - _repMatchLenEncoder.UpdateTables((UInt32)1 << _posStateBits); - - nowPos64 = 0; - } - - - public void Code(System.IO.Stream inStream, System.IO.Stream outStream, - Int64 inSize, Int64 outSize, ICodeProgress progress) - { - _needReleaseMFStream = false; - try - { - SetStreams(inStream, outStream, inSize, outSize); - while (true) - { - Int64 processedInSize; - Int64 processedOutSize; - bool finished; - CodeOneBlock(out processedInSize, out processedOutSize, out finished); - if (finished) - return; - if (progress != null) - { - progress.SetProgress(processedInSize, processedOutSize); - } - } - } - finally - { - ReleaseStreams(); - } - } - - const int kPropSize = 5; - Byte[] properties = new Byte[kPropSize]; - - public void WriteCoderProperties(System.IO.Stream outStream) - { - properties[0] = (Byte)((_posStateBits * 5 + _numLiteralPosStateBits) * 9 + _numLiteralContextBits); - for (int i = 0; i < 4; i++) - properties[1 + i] = (Byte)((_dictionarySize >> (8 * i)) & 0xFF); - outStream.Write(properties, 0, kPropSize); - } - - UInt32[] tempPrices = new UInt32[Base.kNumFullDistances]; - UInt32 _matchPriceCount; - - void FillDistancesPrices() - { - for (UInt32 i = Base.kStartPosModelIndex; i < Base.kNumFullDistances; i++) - { - UInt32 posSlot = GetPosSlot(i); - int footerBits = (int)((posSlot >> 1) - 1); - UInt32 baseVal = ((2 | (posSlot & 1)) << footerBits); - tempPrices[i] = BitTreeEncoder.ReverseGetPrice(_posEncoders, - baseVal - posSlot - 1, footerBits, i - baseVal); - } - - for (UInt32 lenToPosState = 0; lenToPosState < Base.kNumLenToPosStates; lenToPosState++) - { - UInt32 posSlot; - RangeCoder.BitTreeEncoder encoder = _posSlotEncoder[lenToPosState]; - - UInt32 st = (lenToPosState << Base.kNumPosSlotBits); - for (posSlot = 0; posSlot < _distTableSize; posSlot++) - _posSlotPrices[st + posSlot] = encoder.GetPrice(posSlot); - for (posSlot = Base.kEndPosModelIndex; posSlot < _distTableSize; posSlot++) - _posSlotPrices[st + posSlot] += ((((posSlot >> 1) - 1) - Base.kNumAlignBits) << RangeCoder.BitEncoder.kNumBitPriceShiftBits); - - UInt32 st2 = lenToPosState * Base.kNumFullDistances; - UInt32 i; - for (i = 0; i < Base.kStartPosModelIndex; i++) - _distancesPrices[st2 + i] = _posSlotPrices[st + i]; - for (; i < Base.kNumFullDistances; i++) - _distancesPrices[st2 + i] = _posSlotPrices[st + GetPosSlot(i)] + tempPrices[i]; - } - _matchPriceCount = 0; - } - - void FillAlignPrices() - { - for (UInt32 i = 0; i < Base.kAlignTableSize; i++) - _alignPrices[i] = _posAlignEncoder.ReverseGetPrice(i); - _alignPriceCount = 0; - } - - - static string[] kMatchFinderIDs = - { - "BT2", - "BT4", - }; - - static int FindMatchFinder(string s) - { - for (int m = 0; m < kMatchFinderIDs.Length; m++) - if (s == kMatchFinderIDs[m]) - return m; - return -1; - } - - public void SetCoderProperties(CoderPropID[] propIDs, object[] properties) - { - for (UInt32 i = 0; i < properties.Length; i++) - { - object prop = properties[i]; - switch (propIDs[i]) - { - case CoderPropID.NumFastBytes: - { - if (!(prop is Int32)) - throw new InvalidParamException(); - Int32 numFastBytes = (Int32)prop; - if (numFastBytes < 5 || numFastBytes > Base.kMatchMaxLen) - throw new InvalidParamException(); - _numFastBytes = (UInt32)numFastBytes; - break; - } - case CoderPropID.Algorithm: - { - /* - if (!(prop is Int32)) - throw new InvalidParamException(); - Int32 maximize = (Int32)prop; - _fastMode = (maximize == 0); - _maxMode = (maximize >= 2); - */ - break; - } - case CoderPropID.MatchFinder: - { - if (!(prop is String)) - throw new InvalidParamException(); - EMatchFinderType matchFinderIndexPrev = _matchFinderType; - int m = FindMatchFinder(((string)prop).ToUpper()); - if (m < 0) - throw new InvalidParamException(); - _matchFinderType = (EMatchFinderType)m; - if (_matchFinder != null && matchFinderIndexPrev != _matchFinderType) - { - _dictionarySizePrev = 0xFFFFFFFF; - _matchFinder = null; - } - break; - } - case CoderPropID.DictionarySize: - { - const int kDicLogSizeMaxCompress = 30; - if (!(prop is Int32)) - throw new InvalidParamException(); ; - Int32 dictionarySize = (Int32)prop; - if (dictionarySize < (UInt32)(1 << Base.kDicLogSizeMin) || - dictionarySize > (UInt32)(1 << kDicLogSizeMaxCompress)) - throw new InvalidParamException(); - _dictionarySize = (UInt32)dictionarySize; - int dicLogSize; - for (dicLogSize = 0; dicLogSize < (UInt32)kDicLogSizeMaxCompress; dicLogSize++) - if (dictionarySize <= ((UInt32)(1) << dicLogSize)) - break; - _distTableSize = (UInt32)dicLogSize * 2; - break; - } - case CoderPropID.PosStateBits: - { - if (!(prop is Int32)) - throw new InvalidParamException(); - Int32 v = (Int32)prop; - if (v < 0 || v > (UInt32)Base.kNumPosStatesBitsEncodingMax) - throw new InvalidParamException(); - _posStateBits = (int)v; - _posStateMask = (((UInt32)1) << (int)_posStateBits) - 1; - break; - } - case CoderPropID.LitPosBits: - { - if (!(prop is Int32)) - throw new InvalidParamException(); - Int32 v = (Int32)prop; - if (v < 0 || v > (UInt32)Base.kNumLitPosStatesBitsEncodingMax) - throw new InvalidParamException(); - _numLiteralPosStateBits = (int)v; - break; - } - case CoderPropID.LitContextBits: - { - if (!(prop is Int32)) - throw new InvalidParamException(); - Int32 v = (Int32)prop; - if (v < 0 || v > (UInt32)Base.kNumLitContextBitsMax) - throw new InvalidParamException(); ; - _numLiteralContextBits = (int)v; - break; - } - case CoderPropID.EndMarker: - { - if (!(prop is Boolean)) - throw new InvalidParamException(); - SetWriteEndMarkerMode((Boolean)prop); - break; - } - default: - throw new InvalidParamException(); - } - } - } - - uint _trainSize = 0; - public void SetTrainSize(uint trainSize) - { - _trainSize = trainSize; - } - - } -} diff --git a/src/Microsoft.DotNet.Archive/LZMA/Compress/RangeCoder/RangeCoder.cs b/src/Microsoft.DotNet.Archive/LZMA/Compress/RangeCoder/RangeCoder.cs deleted file mode 100644 index d9c2e30ce..000000000 --- a/src/Microsoft.DotNet.Archive/LZMA/Compress/RangeCoder/RangeCoder.cs +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright (c) .NET 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 SevenZip.Compression.RangeCoder -{ - class Encoder - { - public const uint kTopValue = (1 << 24); - - System.IO.Stream Stream; - - public UInt64 Low; - public uint Range; - uint _cacheSize; - byte _cache; - - long StartPosition; - - public void SetStream(System.IO.Stream stream) - { - Stream = stream; - } - - public void ReleaseStream() - { - Stream = null; - } - - public void Init() - { - StartPosition = Stream.Position; - - Low = 0; - Range = 0xFFFFFFFF; - _cacheSize = 1; - _cache = 0; - } - - public void FlushData() - { - for (int i = 0; i < 5; i++) - ShiftLow(); - } - - public void FlushStream() - { - Stream.Flush(); - } - - public void CloseStream() - { - Stream.Dispose(); - } - - public void Encode(uint start, uint size, uint total) - { - Low += start * (Range /= total); - Range *= size; - while (Range < kTopValue) - { - Range <<= 8; - ShiftLow(); - } - } - - public void ShiftLow() - { - if ((uint)Low < (uint)0xFF000000 || (uint)(Low >> 32) == 1) - { - byte temp = _cache; - do - { - Stream.WriteByte((byte)(temp + (Low >> 32))); - temp = 0xFF; - } - while (--_cacheSize != 0); - _cache = (byte)(((uint)Low) >> 24); - } - _cacheSize++; - Low = ((uint)Low) << 8; - } - - public void EncodeDirectBits(uint v, int numTotalBits) - { - for (int i = numTotalBits - 1; i >= 0; i--) - { - Range >>= 1; - if (((v >> i) & 1) == 1) - Low += Range; - if (Range < kTopValue) - { - Range <<= 8; - ShiftLow(); - } - } - } - - public void EncodeBit(uint size0, int numTotalBits, uint symbol) - { - uint newBound = (Range >> numTotalBits) * size0; - if (symbol == 0) - Range = newBound; - else - { - Low += newBound; - Range -= newBound; - } - while (Range < kTopValue) - { - Range <<= 8; - ShiftLow(); - } - } - - public long GetProcessedSizeAdd() - { - return _cacheSize + - Stream.Position - StartPosition + 4; - // (long)Stream.GetProcessedSize(); - } - } - - class Decoder - { - public const uint kTopValue = (1 << 24); - public uint Range; - public uint Code; - // public Buffer.InBuffer Stream = new Buffer.InBuffer(1 << 16); - public System.IO.Stream Stream; - - public void Init(System.IO.Stream stream) - { - // Stream.Init(stream); - Stream = stream; - - Code = 0; - Range = 0xFFFFFFFF; - for (int i = 0; i < 5; i++) - Code = (Code << 8) | (byte)Stream.ReadByte(); - } - - public void ReleaseStream() - { - // Stream.ReleaseStream(); - Stream = null; - } - - public void CloseStream() - { - Stream.Dispose(); - } - - public void Normalize() - { - while (Range < kTopValue) - { - Code = (Code << 8) | (byte)Stream.ReadByte(); - Range <<= 8; - } - } - - public void Normalize2() - { - if (Range < kTopValue) - { - Code = (Code << 8) | (byte)Stream.ReadByte(); - Range <<= 8; - } - } - - public uint GetThreshold(uint total) - { - return Code / (Range /= total); - } - - public void Decode(uint start, uint size, uint total) - { - Code -= start * Range; - Range *= size; - Normalize(); - } - - public uint DecodeDirectBits(int numTotalBits) - { - uint range = Range; - uint code = Code; - uint result = 0; - for (int i = numTotalBits; i > 0; i--) - { - range >>= 1; - /* - result <<= 1; - if (code >= range) - { - code -= range; - result |= 1; - } - */ - uint t = (code - range) >> 31; - code -= range & (t - 1); - result = (result << 1) | (1 - t); - - if (range < kTopValue) - { - code = (code << 8) | (byte)Stream.ReadByte(); - range <<= 8; - } - } - Range = range; - Code = code; - return result; - } - - public uint DecodeBit(uint size0, int numTotalBits) - { - uint newBound = (Range >> numTotalBits) * size0; - uint symbol; - if (Code < newBound) - { - symbol = 0; - Range = newBound; - } - else - { - symbol = 1; - Code -= newBound; - Range -= newBound; - } - Normalize(); - return symbol; - } - - // ulong GetProcessedSize() {return Stream.GetProcessedSize(); } - } -} diff --git a/src/Microsoft.DotNet.Archive/LZMA/Compress/RangeCoder/RangeCoderBit.cs b/src/Microsoft.DotNet.Archive/LZMA/Compress/RangeCoder/RangeCoderBit.cs deleted file mode 100644 index 46d27ed0f..000000000 --- a/src/Microsoft.DotNet.Archive/LZMA/Compress/RangeCoder/RangeCoderBit.cs +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace SevenZip.Compression.RangeCoder -{ - struct BitEncoder - { - public const int kNumBitModelTotalBits = 11; - public const uint kBitModelTotal = (1 << kNumBitModelTotalBits); - const int kNumMoveBits = 5; - const int kNumMoveReducingBits = 2; - public const int kNumBitPriceShiftBits = 6; - - uint Prob; - - public void Init() { Prob = kBitModelTotal >> 1; } - - public void UpdateModel(uint symbol) - { - if (symbol == 0) - Prob += (kBitModelTotal - Prob) >> kNumMoveBits; - else - Prob -= (Prob) >> kNumMoveBits; - } - - public void Encode(Encoder encoder, uint symbol) - { - // encoder.EncodeBit(Prob, kNumBitModelTotalBits, symbol); - // UpdateModel(symbol); - uint newBound = (encoder.Range >> kNumBitModelTotalBits) * Prob; - if (symbol == 0) - { - encoder.Range = newBound; - Prob += (kBitModelTotal - Prob) >> kNumMoveBits; - } - else - { - encoder.Low += newBound; - encoder.Range -= newBound; - Prob -= (Prob) >> kNumMoveBits; - } - if (encoder.Range < Encoder.kTopValue) - { - encoder.Range <<= 8; - encoder.ShiftLow(); - } - } - - private static UInt32[] ProbPrices = new UInt32[kBitModelTotal >> kNumMoveReducingBits]; - - static BitEncoder() - { - const int kNumBits = (kNumBitModelTotalBits - kNumMoveReducingBits); - for (int i = kNumBits - 1; i >= 0; i--) - { - UInt32 start = (UInt32)1 << (kNumBits - i - 1); - UInt32 end = (UInt32)1 << (kNumBits - i); - for (UInt32 j = start; j < end; j++) - ProbPrices[j] = ((UInt32)i << kNumBitPriceShiftBits) + - (((end - j) << kNumBitPriceShiftBits) >> (kNumBits - i - 1)); - } - } - - public uint GetPrice(uint symbol) - { - return ProbPrices[(((Prob - symbol) ^ ((-(int)symbol))) & (kBitModelTotal - 1)) >> kNumMoveReducingBits]; - } - public uint GetPrice0() { return ProbPrices[Prob >> kNumMoveReducingBits]; } - public uint GetPrice1() { return ProbPrices[(kBitModelTotal - Prob) >> kNumMoveReducingBits]; } - } - - struct BitDecoder - { - public const int kNumBitModelTotalBits = 11; - public const uint kBitModelTotal = (1 << kNumBitModelTotalBits); - const int kNumMoveBits = 5; - - uint Prob; - - public void UpdateModel(int numMoveBits, uint symbol) - { - if (symbol == 0) - Prob += (kBitModelTotal - Prob) >> numMoveBits; - else - Prob -= (Prob) >> numMoveBits; - } - - public void Init() { Prob = kBitModelTotal >> 1; } - - public uint Decode(RangeCoder.Decoder rangeDecoder) - { - uint newBound = (uint)(rangeDecoder.Range >> kNumBitModelTotalBits) * (uint)Prob; - if (rangeDecoder.Code < newBound) - { - rangeDecoder.Range = newBound; - Prob += (kBitModelTotal - Prob) >> kNumMoveBits; - if (rangeDecoder.Range < Decoder.kTopValue) - { - rangeDecoder.Code = (rangeDecoder.Code << 8) | (byte)rangeDecoder.Stream.ReadByte(); - rangeDecoder.Range <<= 8; - } - return 0; - } - else - { - rangeDecoder.Range -= newBound; - rangeDecoder.Code -= newBound; - Prob -= (Prob) >> kNumMoveBits; - if (rangeDecoder.Range < Decoder.kTopValue) - { - rangeDecoder.Code = (rangeDecoder.Code << 8) | (byte)rangeDecoder.Stream.ReadByte(); - rangeDecoder.Range <<= 8; - } - return 1; - } - } - } -} diff --git a/src/Microsoft.DotNet.Archive/LZMA/Compress/RangeCoder/RangeCoderBitTree.cs b/src/Microsoft.DotNet.Archive/LZMA/Compress/RangeCoder/RangeCoderBitTree.cs deleted file mode 100644 index f7985c47b..000000000 --- a/src/Microsoft.DotNet.Archive/LZMA/Compress/RangeCoder/RangeCoderBitTree.cs +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) .NET 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 SevenZip.Compression.RangeCoder -{ - struct BitTreeEncoder - { - BitEncoder[] Models; - int NumBitLevels; - - public BitTreeEncoder(int numBitLevels) - { - NumBitLevels = numBitLevels; - Models = new BitEncoder[1 << numBitLevels]; - } - - public void Init() - { - for (uint i = 1; i < (1 << NumBitLevels); i++) - Models[i].Init(); - } - - public void Encode(Encoder rangeEncoder, UInt32 symbol) - { - UInt32 m = 1; - for (int bitIndex = NumBitLevels; bitIndex > 0; ) - { - bitIndex--; - UInt32 bit = (symbol >> bitIndex) & 1; - Models[m].Encode(rangeEncoder, bit); - m = (m << 1) | bit; - } - } - - public void ReverseEncode(Encoder rangeEncoder, UInt32 symbol) - { - UInt32 m = 1; - for (UInt32 i = 0; i < NumBitLevels; i++) - { - UInt32 bit = symbol & 1; - Models[m].Encode(rangeEncoder, bit); - m = (m << 1) | bit; - symbol >>= 1; - } - } - - public UInt32 GetPrice(UInt32 symbol) - { - UInt32 price = 0; - UInt32 m = 1; - for (int bitIndex = NumBitLevels; bitIndex > 0; ) - { - bitIndex--; - UInt32 bit = (symbol >> bitIndex) & 1; - price += Models[m].GetPrice(bit); - m = (m << 1) + bit; - } - return price; - } - - public UInt32 ReverseGetPrice(UInt32 symbol) - { - UInt32 price = 0; - UInt32 m = 1; - for (int i = NumBitLevels; i > 0; i--) - { - UInt32 bit = symbol & 1; - symbol >>= 1; - price += Models[m].GetPrice(bit); - m = (m << 1) | bit; - } - return price; - } - - public static UInt32 ReverseGetPrice(BitEncoder[] Models, UInt32 startIndex, - int NumBitLevels, UInt32 symbol) - { - UInt32 price = 0; - UInt32 m = 1; - for (int i = NumBitLevels; i > 0; i--) - { - UInt32 bit = symbol & 1; - symbol >>= 1; - price += Models[startIndex + m].GetPrice(bit); - m = (m << 1) | bit; - } - return price; - } - - public static void ReverseEncode(BitEncoder[] Models, UInt32 startIndex, - Encoder rangeEncoder, int NumBitLevels, UInt32 symbol) - { - UInt32 m = 1; - for (int i = 0; i < NumBitLevels; i++) - { - UInt32 bit = symbol & 1; - Models[startIndex + m].Encode(rangeEncoder, bit); - m = (m << 1) | bit; - symbol >>= 1; - } - } - } - - struct BitTreeDecoder - { - BitDecoder[] Models; - int NumBitLevels; - - public BitTreeDecoder(int numBitLevels) - { - NumBitLevels = numBitLevels; - Models = new BitDecoder[1 << numBitLevels]; - } - - public void Init() - { - for (uint i = 1; i < (1 << NumBitLevels); i++) - Models[i].Init(); - } - - public uint Decode(RangeCoder.Decoder rangeDecoder) - { - uint m = 1; - for (int bitIndex = NumBitLevels; bitIndex > 0; bitIndex--) - m = (m << 1) + Models[m].Decode(rangeDecoder); - return m - ((uint)1 << NumBitLevels); - } - - public uint ReverseDecode(RangeCoder.Decoder rangeDecoder) - { - uint m = 1; - uint symbol = 0; - for (int bitIndex = 0; bitIndex < NumBitLevels; bitIndex++) - { - uint bit = Models[m].Decode(rangeDecoder); - m <<= 1; - m += bit; - symbol |= (bit << bitIndex); - } - return symbol; - } - - public static uint ReverseDecode(BitDecoder[] Models, UInt32 startIndex, - RangeCoder.Decoder rangeDecoder, int NumBitLevels) - { - uint m = 1; - uint symbol = 0; - for (int bitIndex = 0; bitIndex < NumBitLevels; bitIndex++) - { - uint bit = Models[startIndex + m].Decode(rangeDecoder); - m <<= 1; - m += bit; - symbol |= (bit << bitIndex); - } - return symbol; - } - } -} diff --git a/src/Microsoft.DotNet.Archive/LZMA/ICoder.cs b/src/Microsoft.DotNet.Archive/LZMA/ICoder.cs deleted file mode 100644 index 992f6823f..000000000 --- a/src/Microsoft.DotNet.Archive/LZMA/ICoder.cs +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// ICoder.h - -using System; - -namespace SevenZip -{ - /// - /// The exception that is thrown when an error in input stream occurs during decoding. - /// - class DataErrorException : Exception - { - public DataErrorException(): base("Data Error") { } - } - - /// - /// The exception that is thrown when the value of an argument is outside the allowable range. - /// - class InvalidParamException : Exception - { - public InvalidParamException(): base("Invalid Parameter") { } - } - - public interface ICodeProgress - { - /// - /// Callback progress. - /// - /// - /// input size. -1 if unknown. - /// - /// - /// output size. -1 if unknown. - /// - void SetProgress(Int64 inSize, Int64 outSize); - }; - - public interface ICoder - { - /// - /// Codes streams. - /// - /// - /// input Stream. - /// - /// - /// output Stream. - /// - /// - /// input Size. -1 if unknown. - /// - /// - /// output Size. -1 if unknown. - /// - /// - /// callback progress reference. - /// - /// - /// if input stream is not valid - /// - void Code(System.IO.Stream inStream, System.IO.Stream outStream, - Int64 inSize, Int64 outSize, ICodeProgress progress); - }; - - /* - public interface ICoder2 - { - void Code(ISequentialInStream []inStreams, - const UInt64 []inSizes, - ISequentialOutStream []outStreams, - UInt64 []outSizes, - ICodeProgress progress); - }; - */ - - /// - /// Provides the fields that represent properties idenitifiers for compressing. - /// - public enum CoderPropID - { - /// - /// Specifies default property. - /// - DefaultProp = 0, - /// - /// Specifies size of dictionary. - /// - DictionarySize, - /// - /// Specifies size of memory for PPM*. - /// - UsedMemorySize, - /// - /// Specifies order for PPM methods. - /// - Order, - /// - /// Specifies Block Size. - /// - BlockSize, - /// - /// Specifies number of postion state bits for LZMA (0 <= x <= 4). - /// - PosStateBits, - /// - /// Specifies number of literal context bits for LZMA (0 <= x <= 8). - /// - LitContextBits, - /// - /// Specifies number of literal position bits for LZMA (0 <= x <= 4). - /// - LitPosBits, - /// - /// Specifies number of fast bytes for LZ*. - /// - NumFastBytes, - /// - /// Specifies match finder. LZMA: "BT2", "BT4" or "BT4B". - /// - MatchFinder, - /// - /// Specifies the number of match finder cyckes. - /// - MatchFinderCycles, - /// - /// Specifies number of passes. - /// - NumPasses, - /// - /// Specifies number of algorithm. - /// - Algorithm, - /// - /// Specifies the number of threads. - /// - NumThreads, - /// - /// Specifies mode with end marker. - /// - EndMarker - }; - - - public interface ISetCoderProperties - { - void SetCoderProperties(CoderPropID[] propIDs, object[] properties); - }; - - public interface IWriteCoderProperties - { - void WriteCoderProperties(System.IO.Stream outStream); - } - - public interface ISetDecoderProperties - { - void SetDecoderProperties(byte[] properties); - } -} diff --git a/src/Microsoft.DotNet.Archive/LZMA/README.md b/src/Microsoft.DotNet.Archive/LZMA/README.md deleted file mode 100644 index 74e275852..000000000 --- a/src/Microsoft.DotNet.Archive/LZMA/README.md +++ /dev/null @@ -1,10 +0,0 @@ -## LZMA SDK -This source came from the C# implementation of LZMA from the LZMA SDK, version 16.02, from http://www.7-zip.org/sdk.html. - -## License -LZMA SDK is placed in the public domain. - -Anyone is free to copy, modify, publish, use, compile, sell, or distribute the original LZMA SDK code, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. - -## Thanks! -Thanks goes to Igor Pavlov for making this available. diff --git a/src/Microsoft.DotNet.Archive/LocalizableStrings.resx b/src/Microsoft.DotNet.Archive/LocalizableStrings.resx deleted file mode 100644 index 9f9b5a9e7..000000000 --- a/src/Microsoft.DotNet.Archive/LocalizableStrings.resx +++ /dev/null @@ -1,126 +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 - - - Expanding - - - Decompressing - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Archive/Microsoft.DotNet.Archive.csproj b/src/Microsoft.DotNet.Archive/Microsoft.DotNet.Archive.csproj deleted file mode 100644 index 04b8f25be..000000000 --- a/src/Microsoft.DotNet.Archive/Microsoft.DotNet.Archive.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - - Archive and compression types. - $(CliVersionPrefix) - netstandard1.3 - ../../tools/Key.snk - true - true - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Archive/ProgressReport.cs b/src/Microsoft.DotNet.Archive/ProgressReport.cs deleted file mode 100644 index 6eb955563..000000000 --- a/src/Microsoft.DotNet.Archive/ProgressReport.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; - -namespace Microsoft.DotNet.Archive -{ - public struct ProgressReport - { - public ProgressReport(string phase, long ticks, long total) - { - Phase = phase; - Ticks = ticks; - Total = total; - } - public string Phase { get; } - public long Ticks { get; } - public long Total { get; } - } - - public static class ProgressReportExtensions - { - public static void Report(this IProgress progress, string phase, long ticks, long total) - { - progress.Report(new ProgressReport(phase, ticks, total)); - } - } - -} diff --git a/src/Microsoft.DotNet.Archive/ThreadLocalZipArchive.cs b/src/Microsoft.DotNet.Archive/ThreadLocalZipArchive.cs deleted file mode 100644 index 7f61207cb..000000000 --- a/src/Microsoft.DotNet.Archive/ThreadLocalZipArchive.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.IO.Compression; -using System.Threading; - -namespace Microsoft.DotNet.Archive -{ - /// - /// Wraps ThreadLocal and exposes Dispose semantics that dispose all archives - /// - internal class ThreadLocalZipArchive : IDisposable - { - private ThreadLocal _archive; - private bool _disposed = false; - - public ThreadLocalZipArchive(string archivePath, ZipArchive local = null) - { - _archive = new ThreadLocal(() => - new ZipArchive(File.Open(archivePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete), ZipArchiveMode.Read), - trackAllValues:true); - - if (local != null) - { - // reuse provided one for current thread - _archive.Value = local; - } - } - - public ZipArchive Archive { get { return _archive.Value; } } - - public void Dispose() - { - if (!_disposed) - { - if (_archive != null) - { - // dispose all archives - if (_archive.Values != null) - { - foreach (var value in _archive.Values) - { - if (value != null) - { - value.Dispose(); - } - } - } - - // dispose ThreadLocal - _archive.Dispose(); - _archive = null; - } - } - } - } -} diff --git a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.cs.xlf b/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index 50f4e8538..000000000 --- a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Expanding - Rozbalení - - - - Decompressing - Dekomprese - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.de.xlf b/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index 137ac4d1e..000000000 --- a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Expanding - Aufklappen - - - - Decompressing - Dekomprimieren - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.es.xlf b/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index 0fd56bad0..000000000 --- a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Expanding - Expandiendo - - - - Decompressing - Descomprimiendo - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.fr.xlf b/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index c39aba992..000000000 --- a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Expanding - Développement - - - - Decompressing - Décompression - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.it.xlf b/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index be414bd1a..000000000 --- a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Expanding - Espansione - - - - Decompressing - Decompressione - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.ja.xlf b/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index f70a95565..000000000 --- a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Expanding - 展開中 - - - - Decompressing - 圧縮解除中 - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.ko.xlf b/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index bf7de8172..000000000 --- a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Expanding - 확장하는 중 - - - - Decompressing - 압축을 푸는 중 - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.pl.xlf b/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index 9772365f1..000000000 --- a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Expanding - Rozwijanie - - - - Decompressing - Dekompresja - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.pt-BR.xlf b/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index 1b3fad0d8..000000000 --- a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Expanding - Expandindo - - - - Decompressing - Descompactando - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.ru.xlf b/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index 2a8c6091d..000000000 --- a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Expanding - Идет расширение - - - - Decompressing - Идет извлечение - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.tr.xlf b/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index f1fde5d99..000000000 --- a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Expanding - Genişletme - - - - Decompressing - Daraltma - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.zh-Hans.xlf b/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index 65ab99d0b..000000000 --- a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Expanding - 正在扩展 - - - - Decompressing - 正在解压缩 - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.zh-Hant.xlf b/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index b5c24cae7..000000000 --- a/src/Microsoft.DotNet.Archive/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Expanding - 正在展開 - - - - Decompressing - 正在解壓縮 - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/Microsoft.DotNet.Cli.Sln.Internal.csproj b/src/Microsoft.DotNet.Cli.Sln.Internal/Microsoft.DotNet.Cli.Sln.Internal.csproj index 2b23027fd..8f76e2e04 100644 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/Microsoft.DotNet.Cli.Sln.Internal.csproj +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/Microsoft.DotNet.Cli.Sln.Internal.csproj @@ -1,5 +1,4 @@  - SLN file reader/writer diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/SlnFile.cs b/src/Microsoft.DotNet.Cli.Sln.Internal/SlnFile.cs index 87fad297e..d81d579d2 100644 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/SlnFile.cs +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/SlnFile.cs @@ -285,6 +285,14 @@ namespace Microsoft.DotNet.Cli.Sln.Internal get { return _sections; } } + public SlnSection Dependencies + { + get + { + return _sections.GetSection("ProjectDependencies", SlnSectionType.PostProcess); + } + } + internal void Read(TextReader reader, string line, ref int curLineNum) { Line = curLineNum; diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PackagedCommandSpecFactoryWithCliRuntime.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PackagedCommandSpecFactoryWithCliRuntime.cs index c22af40ba..5c3b64763 100644 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PackagedCommandSpecFactoryWithCliRuntime.cs +++ b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PackagedCommandSpecFactoryWithCliRuntime.cs @@ -13,11 +13,11 @@ namespace Microsoft.DotNet.Cli.Utils { public class PackagedCommandSpecFactoryWithCliRuntime : PackagedCommandSpecFactory { - public PackagedCommandSpecFactoryWithCliRuntime() : base(AddAditionalParameters) + public PackagedCommandSpecFactoryWithCliRuntime() : base(AddAdditionalParameters) { } - private static void AddAditionalParameters(string commandPath, IList arguments) + private static void AddAdditionalParameters(string commandPath, IList arguments) { if(PrefersCliRuntime(commandPath)) { diff --git a/src/Microsoft.DotNet.Cli.Utils/EnvironmentProvider.cs b/src/Microsoft.DotNet.Cli.Utils/EnvironmentProvider.cs index 6c23d4c9e..65db78e82 100644 --- a/src/Microsoft.DotNet.Cli.Utils/EnvironmentProvider.cs +++ b/src/Microsoft.DotNet.Cli.Utils/EnvironmentProvider.cs @@ -11,6 +11,8 @@ namespace Microsoft.DotNet.Cli.Utils { public class EnvironmentProvider : IEnvironmentProvider { + private static char[] s_pathSeparator = new char[] { Path.PathSeparator }; + private static char[] s_quote = new char[] { '"' }; private IEnumerable _searchPaths; private IEnumerable _executableExtensions; @@ -42,8 +44,8 @@ namespace Microsoft.DotNet.Cli.Utils searchPaths.AddRange(Environment .GetEnvironmentVariable("PATH") - .Split(Path.PathSeparator) - .Select(p => p.Trim('"'))); + .Split(s_pathSeparator) + .Select(p => p.Trim(s_quote))); _searchPaths = searchPaths; } diff --git a/src/Microsoft.DotNet.Cli.Utils/IEnvironmentPath.cs b/src/Microsoft.DotNet.Cli.Utils/IEnvironmentPath.cs new file mode 100644 index 000000000..7c8ddd6bd --- /dev/null +++ b/src/Microsoft.DotNet.Cli.Utils/IEnvironmentPath.cs @@ -0,0 +1,10 @@ +// Copyright (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.Utils +{ + public interface IEnvironmentPath: IEnvironmentPathInstruction + { + void AddPackageExecutablePathToUserPath(); + } +} diff --git a/src/Microsoft.DotNet.Cli.Utils/IEnvironmentPathInstruction.cs b/src/Microsoft.DotNet.Cli.Utils/IEnvironmentPathInstruction.cs new file mode 100644 index 000000000..1ab69e4a1 --- /dev/null +++ b/src/Microsoft.DotNet.Cli.Utils/IEnvironmentPathInstruction.cs @@ -0,0 +1,7 @@ +namespace Microsoft.DotNet.Cli.Utils +{ + public interface IEnvironmentPathInstruction + { + void PrintAddPathInstructionIfPathDoesNotExist(); + } +} \ No newline at end of file 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 ed1056755..600794faf 100644 --- a/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj +++ b/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj @@ -1,5 +1,4 @@  - $(SdkVersion) @@ -24,7 +23,7 @@ - +
diff --git a/src/Microsoft.DotNet.Cli.Utils/PathUtility.cs b/src/Microsoft.DotNet.Cli.Utils/PathUtility.cs index cbbc0d401..e0ad71840 100644 --- a/src/Microsoft.DotNet.Cli.Utils/PathUtility.cs +++ b/src/Microsoft.DotNet.Cli.Utils/PathUtility.cs @@ -151,7 +151,7 @@ namespace Microsoft.DotNet.Tools.Common { compare = StringComparison.OrdinalIgnoreCase; // check if paths are on the same volume - if (!string.Equals(Path.GetPathRoot(path1), Path.GetPathRoot(path2))) + if (!string.Equals(Path.GetPathRoot(path1), Path.GetPathRoot(path2), compare)) { // on different volumes, "relative" path is just path2 return path2; @@ -273,7 +273,22 @@ namespace Microsoft.DotNet.Tools.Common foreach (var component in components) { - if (!string.IsNullOrEmpty(component)) + if (string.IsNullOrEmpty(component)) + { + continue; + } + + if (string.IsNullOrEmpty(result)) + { + result = component; + + // On Windows, manually append a separator for drive references because Path.Combine won't do so + if (result.EndsWith(":") && RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows) + { + result += Path.DirectorySeparatorChar; + } + } + else { result = Path.Combine(result, component); } diff --git a/src/Microsoft.DotNet.Cli.Utils/Properties/AssemblyInfo.cs b/src/Microsoft.DotNet.Cli.Utils/Properties/AssemblyInfo.cs index 5ebd03235..b1d6f09ca 100644 --- a/src/Microsoft.DotNet.Cli.Utils/Properties/AssemblyInfo.cs +++ b/src/Microsoft.DotNet.Cli.Utils/Properties/AssemblyInfo.cs @@ -12,3 +12,4 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("Microsoft.DotNet.TestFramework, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.DotNet.Tools.Tests.Utilities, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.DotNet.ProjectJsonMigration, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: InternalsVisibleTo("Microsoft.DotNet.ShellShimMaker.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/Microsoft.DotNet.Configurer/CliFallbackFolderPathCalculator.cs b/src/Microsoft.DotNet.Configurer/CliFallbackFolderPathCalculator.cs deleted file mode 100644 index ddeac908f..000000000 --- a/src/Microsoft.DotNet.Configurer/CliFallbackFolderPathCalculator.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; -using System.IO; -using System.Runtime.InteropServices; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.PlatformAbstractions; -using NuGet.Common; - -namespace Microsoft.DotNet.Configurer -{ - public class CliFallbackFolderPathCalculator - { - public string CliFallbackFolderPath => - Environment.GetEnvironmentVariable("DOTNET_CLI_TEST_FALLBACKFOLDER") ?? - Path.Combine(new DirectoryInfo(AppContext.BaseDirectory).Parent.FullName, "NuGetFallbackFolder"); - - public string DotnetUserProfileFolderPath - { - get - { - string profileDir = Environment.GetEnvironmentVariable( - RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "USERPROFILE" : "HOME"); - - return Path.Combine(profileDir, ".dotnet"); - } - } - - public string NuGetUserSettingsDirectory => - NuGetEnvironment.GetFolderPath(NuGetFolderPath.UserSettingsDirectory); - } -} diff --git a/src/Microsoft.DotNet.Configurer/CliFolderPathCalculator.cs b/src/Microsoft.DotNet.Configurer/CliFolderPathCalculator.cs new file mode 100644 index 000000000..bdc5dbfe6 --- /dev/null +++ b/src/Microsoft.DotNet.Configurer/CliFolderPathCalculator.cs @@ -0,0 +1,38 @@ +// Copyright (c) .NET 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.Runtime.InteropServices; +using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.PlatformAbstractions; +using NuGet.Common; + +namespace Microsoft.DotNet.Configurer +{ + public class CliFolderPathCalculator + { + private const string ToolsFolderName = "tools"; + private const string DotnetProfileDirectoryName = ".dotnet"; + + public string CliFallbackFolderPath => Environment.GetEnvironmentVariable("DOTNET_CLI_TEST_FALLBACKFOLDER") ?? + Path.Combine(new DirectoryInfo(AppContext.BaseDirectory).Parent.FullName, "NuGetFallbackFolder"); + + public string ExecutablePackagesPath => Path.Combine(DotnetUserProfileFolderPath, ToolsFolderName) ; + public readonly string ExecutablePackagesPathOnMacEnvPath = $"~/{DotnetProfileDirectoryName}/{ToolsFolderName}"; + + public static string DotnetUserProfileFolderPath + { + get + { + string profileDir = Environment.GetEnvironmentVariable( + RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "USERPROFILE" : "HOME"); + + return Path.Combine(profileDir, DotnetProfileDirectoryName); + } + } + + public string NuGetUserSettingsDirectory => + NuGetEnvironment.GetFolderPath(NuGetFolderPath.UserSettingsDirectory); + } +} diff --git a/src/Microsoft.DotNet.Configurer/DotnetFirstTimeUseConfigurer.cs b/src/Microsoft.DotNet.Configurer/DotnetFirstTimeUseConfigurer.cs index 9a89bcb6f..29e17f7de 100644 --- a/src/Microsoft.DotNet.Configurer/DotnetFirstTimeUseConfigurer.cs +++ b/src/Microsoft.DotNet.Configurer/DotnetFirstTimeUseConfigurer.cs @@ -1,7 +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 System; using System.IO; +using System.Runtime.InteropServices; using Microsoft.DotNet.Cli.Utils; using Microsoft.Extensions.EnvironmentAbstractions; @@ -15,6 +17,7 @@ namespace Microsoft.DotNet.Configurer private INuGetCacheSentinel _nugetCacheSentinel; private IFirstTimeUseNoticeSentinel _firstTimeUseNoticeSentinel; private string _cliFallbackFolderPath; + private readonly IEnvironmentPath _pathAdder; public DotnetFirstTimeUseConfigurer( INuGetCachePrimer nugetCachePrimer, @@ -22,7 +25,8 @@ namespace Microsoft.DotNet.Configurer IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel, IEnvironmentProvider environmentProvider, IReporter reporter, - string cliFallbackFolderPath) + string cliFallbackFolderPath, + IEnvironmentPath pathAdder) { _nugetCachePrimer = nugetCachePrimer; _nugetCacheSentinel = nugetCacheSentinel; @@ -30,10 +34,13 @@ namespace Microsoft.DotNet.Configurer _environmentProvider = environmentProvider; _reporter = reporter; _cliFallbackFolderPath = cliFallbackFolderPath; + _pathAdder = pathAdder ?? throw new ArgumentNullException(nameof(pathAdder)); } public void Configure() { + AddPackageExecutablePath(); + if (ShouldPrintFirstTimeUseNotice()) { PrintFirstTimeUseNotice(); @@ -54,6 +61,23 @@ namespace Microsoft.DotNet.Configurer } } + private void AddPackageExecutablePath() + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + if (!_firstTimeUseNoticeSentinel.Exists()) + { + // Invoke when Windows first run + _pathAdder.AddPackageExecutablePathToUserPath(); + } + } + else + { + // Invoke during installer, otherwise, _pathAdder will be no op object that this point + _pathAdder.AddPackageExecutablePathToUserPath(); + } + } + private bool ShouldPrintFirstTimeUseNotice() { var showFirstTimeUseNotice = diff --git a/src/Microsoft.DotNet.Configurer/FirstTimeUseNoticeSentinel.cs b/src/Microsoft.DotNet.Configurer/FirstTimeUseNoticeSentinel.cs index d7335dee5..78ae9caa5 100644 --- a/src/Microsoft.DotNet.Configurer/FirstTimeUseNoticeSentinel.cs +++ b/src/Microsoft.DotNet.Configurer/FirstTimeUseNoticeSentinel.cs @@ -19,9 +19,9 @@ namespace Microsoft.DotNet.Configurer private string SentinelPath => Path.Combine(_dotnetUserProfileFolderPath, SENTINEL); - public FirstTimeUseNoticeSentinel(CliFallbackFolderPathCalculator cliFallbackFolderPathCalculator) : + public FirstTimeUseNoticeSentinel(CliFolderPathCalculator cliFolderPathCalculator) : this( - cliFallbackFolderPathCalculator.DotnetUserProfileFolderPath, + CliFolderPathCalculator.DotnetUserProfileFolderPath, FileSystemWrapper.Default.File, FileSystemWrapper.Default.Directory) { diff --git a/src/Microsoft.DotNet.Configurer/LocalizableStrings.resx b/src/Microsoft.DotNet.Configurer/LocalizableStrings.resx index 7b56bd336..173004d0d 100644 --- a/src/Microsoft.DotNet.Configurer/LocalizableStrings.resx +++ b/src/Microsoft.DotNet.Configurer/LocalizableStrings.resx @@ -120,18 +120,19 @@ 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. +Learn more about .NET Core: https://aka.ms/dotnet-docs +Use 'dotnet --help' to see available commands or visit: 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. +--------- +The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. + +Read more about .NET Core CLI 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. +-------------- +A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once. Failed to prime the NuGet cache. {0} failed with: {1} @@ -140,7 +141,7 @@ A command is running to initially populate your local package cache, to improve Permission denied to modify the '{0}' folder. Here are some options to fix this error: ---------------------- +---------------------------------------- 1. Re-run this command with elevated access. 2. Disabled the first run experience by setting the environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to true. 3. Copy the .NET Core SDK to a non-protected location and use it from there. diff --git a/src/Microsoft.DotNet.Configurer/Microsoft.DotNet.Configurer.csproj b/src/Microsoft.DotNet.Configurer/Microsoft.DotNet.Configurer.csproj index 25a33c6f8..bf89d36a3 100644 --- a/src/Microsoft.DotNet.Configurer/Microsoft.DotNet.Configurer.csproj +++ b/src/Microsoft.DotNet.Configurer/Microsoft.DotNet.Configurer.csproj @@ -1,5 +1,4 @@  - $(CliVersionPrefix) @@ -19,12 +18,12 @@ + - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Configurer/NuGetCachePrimer.cs b/src/Microsoft.DotNet.Configurer/NuGetCachePrimer.cs index 5233d3359..a0bc3bca5 100644 --- a/src/Microsoft.DotNet.Configurer/NuGetCachePrimer.cs +++ b/src/Microsoft.DotNet.Configurer/NuGetCachePrimer.cs @@ -17,15 +17,15 @@ namespace Microsoft.DotNet.Configurer private readonly INuGetCacheSentinel _nuGetCacheSentinel; - private readonly CliFallbackFolderPathCalculator _cliFallbackFolderPathCalculator; + private readonly CliFolderPathCalculator _cliFolderPathCalculator; public NuGetCachePrimer( INuGetPackagesArchiver nugetPackagesArchiver, INuGetCacheSentinel nuGetCacheSentinel, - CliFallbackFolderPathCalculator cliFallbackFolderPathCalculator) + CliFolderPathCalculator cliFolderPathCalculator) : this(nugetPackagesArchiver, nuGetCacheSentinel, - cliFallbackFolderPathCalculator, + cliFolderPathCalculator, FileSystemWrapper.Default.File) { } @@ -33,14 +33,14 @@ namespace Microsoft.DotNet.Configurer internal NuGetCachePrimer( INuGetPackagesArchiver nugetPackagesArchiver, INuGetCacheSentinel nuGetCacheSentinel, - CliFallbackFolderPathCalculator cliFallbackFolderPathCalculator, + CliFolderPathCalculator cliFolderPathCalculator, IFile file) { _nugetPackagesArchiver = nugetPackagesArchiver; _nuGetCacheSentinel = nuGetCacheSentinel; - _cliFallbackFolderPathCalculator = cliFallbackFolderPathCalculator; + _cliFolderPathCalculator = cliFolderPathCalculator; _file = file; } @@ -52,7 +52,7 @@ namespace Microsoft.DotNet.Configurer return; } - var nuGetFallbackFolder = _cliFallbackFolderPathCalculator.CliFallbackFolderPath; + var nuGetFallbackFolder = _cliFolderPathCalculator.CliFallbackFolderPath; _nugetPackagesArchiver.ExtractArchive(nuGetFallbackFolder); diff --git a/src/Microsoft.DotNet.Configurer/NuGetCacheSentinel.cs b/src/Microsoft.DotNet.Configurer/NuGetCacheSentinel.cs index bfc7a29d9..ebaff5819 100644 --- a/src/Microsoft.DotNet.Configurer/NuGetCacheSentinel.cs +++ b/src/Microsoft.DotNet.Configurer/NuGetCacheSentinel.cs @@ -27,8 +27,8 @@ namespace Microsoft.DotNet.Configurer private Stream InProgressSentinel { get; set; } - public NuGetCacheSentinel(CliFallbackFolderPathCalculator cliFallbackFolderPathCalculator) : - this(cliFallbackFolderPathCalculator.CliFallbackFolderPath, + public NuGetCacheSentinel(CliFolderPathCalculator cliFolderPathCalculator) : + this(cliFolderPathCalculator.CliFallbackFolderPath, FileSystemWrapper.Default.File, FileSystemWrapper.Default.Directory) { diff --git a/src/Microsoft.DotNet.Configurer/UserLevelCacheWriter.cs b/src/Microsoft.DotNet.Configurer/UserLevelCacheWriter.cs index 9e5fd4a78..eeb69e526 100644 --- a/src/Microsoft.DotNet.Configurer/UserLevelCacheWriter.cs +++ b/src/Microsoft.DotNet.Configurer/UserLevelCacheWriter.cs @@ -14,9 +14,9 @@ namespace Microsoft.DotNet.Configurer private readonly IDirectory _directory; private string _dotnetUserProfileFolderPath; - public UserLevelCacheWriter(CliFallbackFolderPathCalculator cliFallbackFolderPathCalculator) : + public UserLevelCacheWriter(CliFolderPathCalculator cliFolderPathCalculator) : this( - cliFallbackFolderPathCalculator.DotnetUserProfileFolderPath, + CliFolderPathCalculator.DotnetUserProfileFolderPath, FileSystemWrapper.Default.File, FileSystemWrapper.Default.Directory) { diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.cs.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.cs.xlf index 69c2a2361..d8fb164af 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.cs.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.cs.xlf @@ -5,19 +5,20 @@ 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. +Learn more about .NET Core: https://aka.ms/dotnet-docs +Use 'dotnet --help' to see available commands or visit: 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. - Vítá vás .NET Core! ---------------------- +--------- +The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. + +Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry + Vítá vás .NET Core! +------------------- Další informace o .NET Core najdete na https://aka.ms/dotnet-docs. Dostupné příkazy si zobrazíte pomocí dotnet --help, případně přejděte na https://aka.ms/dotnet-cli-docs. Telemetrie --------------- +---------- Nástroje .NET Core shromažďují data o využití s cílem vylepšit vaše prostředí. Data jsou anonymní a nezahrnují argumenty příkazového řádku. Data shromažďuje Microsoft, který je sdílí s komunitou. S telemetrií můžete vyjádřit výslovný nesouhlas, a to nastavením proměnné prostředí DOTNET_CLI_TELEMETRY_OPTOUT na 1 prostřednictvím svého oblíbeného rozhraní. Další informace o telemetrii nástrojů .NET Core si můžete přečíst na webu https://aka.ms/dotnet-cli-telemetry. @@ -30,10 +31,10 @@ Další informace o telemetrii nástrojů .NET Core si můžete přečíst na we 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. +-------------- +A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once. Probíhá konfigurace... -------------------- +---------------------- Běží příkaz pro počáteční naplnění vaší místní mezipaměti balíčků, aby se vylepšila rychlost obnovování a umožnil se offline přístup. Provádění tohoto příkazu může trvat až minutu a proběhne jen jednou. @@ -41,7 +42,7 @@ Běží příkaz pro počáteční naplnění vaší místní mezipaměti balí Permission denied to modify the '{0}' folder. Here are some options to fix this error: ---------------------- +---------------------------------------- 1. Re-run this command with elevated access. 2. Disabled the first run experience by setting the environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to true. 3. Copy the .NET Core SDK to a non-protected location and use it from there. @@ -49,7 +50,7 @@ Here are some options to fix this error: Oprávnění ke změně složky {0} bylo zamítnuto. Tuto chybu můžete opravit pomocí některé z těchto možností: ---------------------- +----------------------------------------------------------- 1. Znovu spusťte tento příkaz pomocí přístupu se zvýšenou úrovní oprávnění. 2. Zakažte software spouštěný při prvním zapnutí počítače tak, že nastavíte proměnnou prostředí DOTNET_SKIP_FIRST_TIME_EXPERIENCE na hodnotu Pravda. 3. Zkopírujte sadu .NET Core SDK do nechráněného umístění a použijte ji z tohoto umístění. diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.de.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.de.xlf index e101ef579..3080527b8 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.de.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.de.xlf @@ -5,19 +5,20 @@ 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. +Learn more about .NET Core: https://aka.ms/dotnet-docs +Use 'dotnet --help' to see available commands or visit: 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. - Willkommen bei .NET Core! ---------------------- +--------- +The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. + +Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry + Willkommen bei .NET Core! +------------------------- Weitere Informationen zu .NET Core finden Sie unter https://aka.ms/dotnet-docs. Verwenden Sie "dotnet --help", um die verfügbaren Befehle anzuzeigen, oder wechseln Sie zu https://aka.ms/dotnet-cli-docs. Telemetrie --------------- +---------- Über die .NET Core-Tools werden Nutzungsdaten erfasst, damit wir die Benutzeroberfläche weiter für Sie verbessern können. Die Daten sind anonym und enthalten keine Befehlszeilenargumente. Die Daten werden von Microsoft gesammelt und mit der Community geteilt. Sie können die Erfassung von Telemetriedaten deaktivieren, indem Sie die Umgebungsvariable DOTNET_CLI_TELEMETRY_OPTOUT mithilfe Ihrer bevorzugten Shell auf 1 festlegen. Weitere Informationen zur Telemetrie der .NET Core-Tools finden Sie unter https://aka.ms/dotnet-cli-telemetry. @@ -30,10 +31,10 @@ Weitere Informationen zur Telemetrie der .NET Core-Tools finden Sie unter https: 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. +-------------- +A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once. Konfiguration wird durchgeführt... -------------------- +---------------------------------- Ein Befehl wird ausgeführt, um Ihren lokalen Paketcache erstmals aufzufüllen, die Wiederherstellungsgeschwindigkeit zu verbessern und Onlinezugriff zu ermöglichen. Die Ausführung dieses Befehls nimmt bis zu einer Minute in Anspruch und wird einmalig ausgeführt. @@ -41,7 +42,7 @@ Ein Befehl wird ausgeführt, um Ihren lokalen Paketcache erstmals aufzufüllen, Permission denied to modify the '{0}' folder. Here are some options to fix this error: ---------------------- +---------------------------------------- 1. Re-run this command with elevated access. 2. Disabled the first run experience by setting the environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to true. 3. Copy the .NET Core SDK to a non-protected location and use it from there. @@ -49,7 +50,7 @@ Here are some options to fix this error: Die Berechtigung zum Ändern des Ordners "{0}" wurde verweigert. Im Folgenden finden Sie einige Optionen, um diesen Fehler zu beheben: ---------------------- +--------------------------------------------------------------------- 1. Führen Sie diesen Befehl mit erhöhten Zugriffsrechten noch mal aus. 2. Deaktivieren Sie die erste Ausführung, indem Sie die Umgebungsvariable DOTNET_SKIP_FIRST_TIME_EXPERIENCE auf "true" festlegen. 3. Kopieren Sie das .NET Core SDK an einen nicht geschützten Speicherort, und kopieren Sie es von dort. diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.es.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.es.xlf index 49e0cd07d..329577b0e 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.es.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.es.xlf @@ -5,19 +5,20 @@ 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. +Learn more about .NET Core: https://aka.ms/dotnet-docs +Use 'dotnet --help' to see available commands or visit: 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. - Bienvenido a .NET Core ---------------------- +--------- +The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. + +Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry + Bienvenido a .NET Core +---------------------- Aprenda sobre .NET Core en https://aka.ms/dotnet-docs. Use dotnet --help para ver los comandos disponibles o vaya a https://aka.ms/dotnet-cli-docs. Telemetría --------------- +---------- Las herramientas de .NET Core recopilan datos de uso con el fin de mejorar su experiencia. Los datos son anónimos y no incluyen argumentos de la línea de comandos. Microsoft recopila los datos y los comparte con la comunidad. Si desea optar por no participar en la telemetría, establezca una variable de entorno DOTNET_CLI_TELEMETRY_OPTOUT en 1 con el shell de su preferencia. Puede leer más información sobre la telemetría de las herramientas de .NET Core en https://aka.ms/dotnet-cli-telemetry. @@ -30,10 +31,10 @@ Puede leer más información sobre la telemetría de las herramientas de .NET Co 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. +-------------- +A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once. Configurando... -------------------- +--------------- Se está ejecutando un comando para rellenar inicialmente la caché de paquetes local, para mejorar la velocidad de restauración y habilitar el acceso sin conexión. Este comando tardará en completarse un minuto y solo sucederá una vez. @@ -41,7 +42,7 @@ Se está ejecutando un comando para rellenar inicialmente la caché de paquetes Permission denied to modify the '{0}' folder. Here are some options to fix this error: ---------------------- +---------------------------------------- 1. Re-run this command with elevated access. 2. Disabled the first run experience by setting the environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to true. 3. Copy the .NET Core SDK to a non-protected location and use it from there. @@ -49,7 +50,7 @@ Here are some options to fix this error: Permiso denegado para modificar la carpeta "{0}". Estas son algunas opciones para corregir este error: ---------------------- +---------------------------------------------------- 1. Vuelva a ejecutar este comando con acceso con privilegios elevados. 2. Deshabilite la primera experiencia de ejecución; para ello, establezca la variable de entorno DOTNET_SKIP_FIRST_TIME_EXPERIENCE en true. 3. Copie el SDK de .NET Core en una ubicación no protegida y úselo desde ahí. diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.fr.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.fr.xlf index fb9d015ce..782859b1d 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.fr.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.fr.xlf @@ -5,19 +5,20 @@ 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. +Learn more about .NET Core: https://aka.ms/dotnet-docs +Use 'dotnet --help' to see available commands or visit: 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. - Bienvenue dans .NET Core ! ---------------------- +--------- +The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. + +Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry + Bienvenue dans .NET Core ! +-------------------------- En savoir plus sur .NET Core @ https://aka.ms/dotnet-docs. Utilisez dotnet --help pour voir les commandes disponibles, ou accédez à https://aka.ms/dotnet-cli-docs. Télémétrie --------------- +---------- Les outils .NET Core collectent des données d'utilisation pour améliorer votre expérience utilisateur. Ces données sont anonymes et n'incluent aucun argument de ligne de commande. Les données sont collectées par Microsoft et partagées par la communauté. Vous pouvez refuser l'adhésion à la télémétrie en affectant la valeur 1 à la variable d'environnement DOTNET_CLI_TELEMETRY_OPTOUT via l'interpréteur de commandes de votre choix. Pour plus d'informations sur la télémétrie des outils .NET Core, consultez https://aka.ms/dotnet-cli-telemetry. @@ -30,10 +31,10 @@ Pour plus d'informations sur la télémétrie des outils .NET Core, consultez ht 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. +-------------- +A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once. Configuration en cours... -------------------- +------------------------- Une commande s'exécute pour remplir votre cache de package local, améliorer la vitesse de restauration et activer l'accès hors connexion. L'exécution de cette commande peut prendre jusqu'à une minute et n'a lieu qu'une seule fois. @@ -41,7 +42,7 @@ Une commande s'exécute pour remplir votre cache de package local, améliorer la Permission denied to modify the '{0}' folder. Here are some options to fix this error: ---------------------- +---------------------------------------- 1. Re-run this command with elevated access. 2. Disabled the first run experience by setting the environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to true. 3. Copy the .NET Core SDK to a non-protected location and use it from there. @@ -49,7 +50,7 @@ Here are some options to fix this error: Autorisation refusée pour la modification du dossier '{0}'. Voici quelques options pour corriger cette erreur : ---------------------- +--------------------------------------------------- 1. Réexécutez cette commande avec un accès élevé. 2. Désactivez l'introduction de l'interface logicielle lors de la première utilisation en affectant la valeur true à la variable d'environnement DOTNET_SKIP_FIRST_TIME_EXPERIENCE. 3. Copiez le kit .NET Core SDK à un emplacement non protégé à partir duquel vous l'utiliserez ensuite. diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.it.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.it.xlf index c24c80849..d9a154397 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.it.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.it.xlf @@ -5,19 +5,20 @@ 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. +Learn more about .NET Core: https://aka.ms/dotnet-docs +Use 'dotnet --help' to see available commands or visit: 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. - Benvenuti a .NET Core +--------- +The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. + +Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry + Benvenuti a .NET Core --------------------- Per altre informazioni su .NET Core, vedere https://aka.ms/dotnet-docs. Per visualizzare i comandi disponibili, usare dotnet --help oppure vedere https://aka.ms/dotnet-cli-docs. Telemetria --------------- +---------- Gli strumenti di .NET Core consentono di raccogliere i dati di utilizzo allo scopo di migliorare l'esperienza. I dati sono anonimi e non includono gli argomenti della riga di comando. Vengono raccolti da Microsoft e condivisi con la community. È possibile escludere la telemetria impostando la variabile di ambiente DOTNET_CLI_TELEMETRY_OPTOUT su 1 nella shell preferita. Per altre informazioni sulla telemetria degli strumenti di .NET Core, vedere https://aka.ms/dotnet-cli-telemetry. @@ -30,10 +31,10 @@ Per altre informazioni sulla telemetria degli strumenti di .NET Core, vedere htt 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. +-------------- +A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once. Configurazione... -------------------- +----------------- È in esecuzione un comando per popolare inizialmente la cache dei pacchetti locale, migliorare la velocità di ripristino e abilitare l'accesso offline. Il completamento di questo comando, che viene eseguito una sola volta, richiede circa un minuto. @@ -41,7 +42,7 @@ A command is running to initially populate your local package cache, to improve Permission denied to modify the '{0}' folder. Here are some options to fix this error: ---------------------- +---------------------------------------- 1. Re-run this command with elevated access. 2. Disabled the first run experience by setting the environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to true. 3. Copy the .NET Core SDK to a non-protected location and use it from there. @@ -49,7 +50,7 @@ Here are some options to fix this error: L'autorizzazione per modificare la cartella '{0}' è stata negata. Ecco alcune opzioni per correggere questo errore: ---------------------- +------------------------------------------------- 1. Eseguire di nuovo questo comando con privilegi di accesso elevati. 2. Disabilitare il completamento dell'installazione impostando su true la variabile di ambiente DOTNET_SKIP_FIRST_TIME_EXPERIENCE. 3. Copiare .NET Core SDK in un percorso non protetto e usarlo da tale posizione. diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ja.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ja.xlf index b201c5144..0e18db4ba 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ja.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ja.xlf @@ -5,19 +5,20 @@ 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. +Learn more about .NET Core: https://aka.ms/dotnet-docs +Use 'dotnet --help' to see available commands or visit: 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. - .NET Core へようこそ! ---------------------- +--------- +The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. + +Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry + .NET Core へようこそ! +-------------------- .NET Core について詳しくは、https://aka.ms/dotnet-docs をご覧ください。dotnet --help を使って使用可能なコマンドを確認するか、https://aka.ms/dotnet-cli-docs をご覧ください。 テレメトリ --------------- +--------- .NET Core ツールは、操作性を向上させるために利用状況データを収集します。データは匿名で、コマンドライン引数が含まれません。データは Microsoft によって収集され、コミュニティと共有されます。 テレメトリを無効にするには、お好きなシェルを使用して、DOTNET_CLI_TELEMETRY_OPTOUT 環境変数を 1 に設定します。 .NET Core ツールのテレメトリについて詳しくは、https://aka.ms/dotnet-cli-telemetry をお読みください。 @@ -30,10 +31,10 @@ 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. +-------------- +A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once. 構成中... -------------------- +--------- ローカル パッケージ キャッシュを最初に設定し、復元速度を向上させ、オフライン アクセスを可能にするため、コマンドを実行しています。このコマンドは 1 回だけ実行され、完了までに最大 1 分かかる場合があります。 @@ -41,7 +42,7 @@ A command is running to initially populate your local package cache, to improve Permission denied to modify the '{0}' folder. Here are some options to fix this error: ---------------------- +---------------------------------------- 1. Re-run this command with elevated access. 2. Disabled the first run experience by setting the environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to true. 3. Copy the .NET Core SDK to a non-protected location and use it from there. @@ -49,7 +50,7 @@ Here are some options to fix this error: '{0}' フォルダーを変更するためのアクセス許可が拒否されました。 このエラーを修正するためのいくつかのオプションを次に示します。 ---------------------- +-------------------------------------------------------- 1. 昇格したアクセス権でこのコマンドを再実行します。 2. 環境変数 DOTNET_SKIP_FIRST_TIME_EXPERIENCE を true に設定して、最初の実行エクスペリエンスを無効にします。 3. 保護されていない場所に .NET Core SDK をコピーし、そこから使用します。 diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ko.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ko.xlf index 6f912a283..ff74df291 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ko.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ko.xlf @@ -5,19 +5,20 @@ 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. +Learn more about .NET Core: https://aka.ms/dotnet-docs +Use 'dotnet --help' to see available commands or visit: 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. - .NET Core를 시작합니다! +--------- +The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. + +Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry + NET Core를 시작합니다! --------------------- .NET Core에 대한 자세한 내용은 https://aka.ms/dotnet-docs를 참조하세요. 사용 가능한 명령을 보려면 dotnet --help를 사용하거나 https://aka.ms/dotnet-cli-docs를 방문하세요. 원격 분석 --------------- +--------- .NET Core 도구는 사용자 환경 개선을 위해 사용량 데이터를 수집합니다. 데이터는 익명이며 명령줄 인수를 포함하지 않습니다. Microsoft에서 데이터를 수집하여 커뮤니티와 공유합니다. 자주 사용하는 셸에서 DOTNET_CLI_TELEMETRY_OPTOUT 환경 변수를 1로 설정하여 원격 분석을 옵트아웃할 수 있습니다. .NET Core 도구 원격 분석에 대한 자세한 내용은 https://aka.ms/dotnet-cli-telemetry에서 확인할 수 있습니다. @@ -30,10 +31,10 @@ 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. +-------------- +A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once. 구성 중... -------------------- +---------- 초기에 로컬 패키지 캐시를 채우고, 복원 속도를 개선하고, 오프라인 액세스를 사용하도록 설정하기 위한 명령을 실행하고 있습니다. 완료하는 데 최대 1분이 소요되며 한 번만 실행됩니다. @@ -41,7 +42,7 @@ A command is running to initially populate your local package cache, to improve Permission denied to modify the '{0}' folder. Here are some options to fix this error: ---------------------- +---------------------------------------- 1. Re-run this command with elevated access. 2. Disabled the first run experience by setting the environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to true. 3. Copy the .NET Core SDK to a non-protected location and use it from there. @@ -49,7 +50,7 @@ Here are some options to fix this error: '{0}' 폴더를 수정하는 데 필요한 사용 권한이 거부되었습니다. 이 오류를 해결하기 위한 옵션을 다음과 같습니다. ---------------------- +-------------------------------------------- 1. 높은 액세스 권한으로 이 명령을 다시 실행합니다. 2. 환경 변수 DOTNET_SKIP_FIRST_TIME_EXPERIENCE를 true로 설정하여 첫 실행 경험을 사용하지 않습니다. 3. .NET Core SDK를 보호되지 않은 위치로 복사한 후 이 위치에서 사용합니다. diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pl.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pl.xlf index e2d132a85..5d84cc685 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pl.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pl.xlf @@ -5,19 +5,20 @@ 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. +Learn more about .NET Core: https://aka.ms/dotnet-docs +Use 'dotnet --help' to see available commands or visit: 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. - .NET Core — Zapraszamy! ---------------------- +--------- +The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. + +Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry + .NET Core — Zapraszamy! +----------------------- Więcej informacji o programie .NET Core znajdziesz na stronie https://aka.ms/dotnet-docs. Aby wyświetlić dostępne polecenia, użyj polecenia dotnet --help lub przejdź na stronę https://aka.ms/dotnet-cli-docs. Telemetria --------------- +---------- Narzędzia programu .NET Core zbierają dane dotyczące użycia w celu ulepszenia Twojego środowiska pracy. Dane te są anonimowe i nie obejmują argumentów wiersza polecenia. Zbiera je firma Microsoft i udostępnia społeczności. Z telemetrii można zrezygnować, ustawiając zmienną środowiskową DOTNET_CLI_TELEMETRY_OPTOUT na wartość 1 przy użyciu ulubionej powłoki. Więcej informacji na temat telemetrii narzędzi programu .NET Core możesz znaleźć na stronie https://aka.ms/dotnet-cli-telemetry. @@ -30,10 +31,10 @@ Więcej informacji na temat telemetrii narzędzi programu .NET Core możesz znal 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. +-------------- +A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once. Trwa konfigurowanie… -------------------- +--------------------- Wykonywane jest polecenie w celu wstępnego wypełnienia lokalnej pamięci podręcznej pakietów, poprawy szybkości przywracania i włączenia dostępu offline. Wykonanie tego polecenia jest jednorazowe i zajmie maksymalnie minutę. @@ -41,7 +42,7 @@ Wykonywane jest polecenie w celu wstępnego wypełnienia lokalnej pamięci podr Permission denied to modify the '{0}' folder. Here are some options to fix this error: ---------------------- +---------------------------------------- 1. Re-run this command with elevated access. 2. Disabled the first run experience by setting the environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to true. 3. Copy the .NET Core SDK to a non-protected location and use it from there. @@ -49,7 +50,7 @@ Here are some options to fix this error: Odmowa uprawnień do zmodyfikowania folderu „{0}”. Oto kilka opcji naprawiania tego błędu: ---------------------- +--------------------------------------- 1. Uruchom to polecenie ponownie z podwyższonym poziomem uprawnień. 2. Wyłącz środowisko pierwszego uruchomienia, ustawiając dla zmiennej środowiskowej DOTNET_SKIP_FIRST_TIME_EXPERIENCE wartość true. 3. Skopiuj zestaw .NET Core SDK do lokalizacji niechronionej i tam z niego korzystaj. diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pt-BR.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pt-BR.xlf index 0a789402b..30672c3e3 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pt-BR.xlf @@ -5,19 +5,20 @@ 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. +Learn more about .NET Core: https://aka.ms/dotnet-docs +Use 'dotnet --help' to see available commands or visit: 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. - Bem-vindo ao .NET Core! ---------------------- +--------- +The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. + +Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry + Bem-vindo ao .NET Core! +----------------------- Saiba mais sobre o .NET Core em https://aka.ms/dotnet-docs. Use dotnet --help para ver os comandos disponíveis ou acesse https://aka.ms/dotnet-cli-docs. Telemetria --------------- +---------- As ferramentas do .NET Core coletam dados de uso para melhorar sua experiência. Os dados são anônimos e não incluem argumentos de linha de comando. Os dados são coletados pela Microsoft e compartilhados com a comunidade. É possível recusar a telemetria ao configurar uma variável de ambiente DOTNET_CLI_TELEMETRY_OPTOUT como 1 usando seu shell favorito. Leia mais sobre a telemetria das ferramentas do .NET Core em https://aka.ms/dotnet-cli-telemetry. @@ -30,10 +31,10 @@ Leia mais sobre a telemetria das ferramentas do .NET Core em https://aka.ms/dotn 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. +-------------- +A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once. Configurando... -------------------- +--------------- Um comando está sendo executado para popular inicialmente o cache do pacote local, a fim de melhorar a velocidade de restauração e habilitar o acesso offline. Esse comando levará até um minuto para ser concluído e só ocorrerá uma vez. @@ -41,7 +42,7 @@ Um comando está sendo executado para popular inicialmente o cache do pacote loc Permission denied to modify the '{0}' folder. Here are some options to fix this error: ---------------------- +---------------------------------------- 1. Re-run this command with elevated access. 2. Disabled the first run experience by setting the environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to true. 3. Copy the .NET Core SDK to a non-protected location and use it from there. @@ -49,7 +50,7 @@ Here are some options to fix this error: Permissão negada para modificar a pasta '{0}'. Aqui estão algumas opções para consertar este erro: ---------------------- +--------------------------------------------------- 1. Execute este comando novamente com acesso elevado. 2. Desabilite a primeira experiência de execução ao configurar a variável de ambiente DOTNET_SKIP_FIRST_TIME_EXPERIENCE como verdadeira. 3. Copie o SDK do .NET Core para uma localização não protegida e use-o de lá. diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ru.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ru.xlf index 46ceb61ef..4878d0cad 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ru.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ru.xlf @@ -5,19 +5,20 @@ 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. +Learn more about .NET Core: https://aka.ms/dotnet-docs +Use 'dotnet --help' to see available commands or visit: 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. - Добро пожаловать в .NET Core! ---------------------- +--------- +The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. + +Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry + Добро пожаловать в .NET Core! +----------------------------- Дополнительные сведения о .NET Core можно получить по адресу https://aka.ms/dotnet-docs. Для просмотра доступных команд используйте dotnet --help или перейдите на страницу https://aka.ms/dotnet-cli-docs. Телеметрия --------------- +---------- Средства .NET Core собирают данные об использовании для улучшения взаимодействия с пользователем. Эти данные анонимны и не включают в себя аргументы командной строки. Сбор данных осуществляется корпорацией Майкрософт, которая предоставляет их сообществу. Вы можете явно отказаться от телеметрии, присвоив переменной среды DOTNET_CLI_TELEMETRY_OPTOUT значение 1 с помощью предпочитаемой оболочки. Дополнительные сведения о телеметрии в средствах .NET Core см. по адресу https://aka.ms/dotnet-cli-telemetry. @@ -30,10 +31,10 @@ 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. +-------------- +A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once. Идет настройка... -------------------- +----------------- Выполняется команда для изначального заполнения локального кэша пакетов, повышения скорости восстановления и обеспечения автономного доступа. Ее выполнение может занять до одной минуты и производится только раз. @@ -41,7 +42,7 @@ A command is running to initially populate your local package cache, to improve Permission denied to modify the '{0}' folder. Here are some options to fix this error: ---------------------- +---------------------------------------- 1. Re-run this command with elevated access. 2. Disabled the first run experience by setting the environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to true. 3. Copy the .NET Core SDK to a non-protected location and use it from there. @@ -49,7 +50,7 @@ Here are some options to fix this error: Отменено разрешение на изменение папки "{0}". Ниже приведено несколько способов устранения этой ошибки. ---------------------- +--------------------------------------------------------- 1. Повторно выполните эту команду с правами повышенного доступа. 2. Отключите возможность первого запуска, задав для переменной среды DOTNET_SKIP_FIRST_TIME_EXPERIENCE значение "true". 3. Скопируйте пакет SDK для .NET Core в незащищенное расположение и используйте его оттуда. diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.tr.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.tr.xlf index b5762bc81..8889bad77 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.tr.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.tr.xlf @@ -5,19 +5,20 @@ 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. +Learn more about .NET Core: https://aka.ms/dotnet-docs +Use 'dotnet --help' to see available commands or visit: 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. - .NET Core’a Hoş Geldiniz! ---------------------- +--------- +The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. + +Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry + .NET Core’a Hoş Geldiniz! +------------------------- .NET Core hakkında daha fazla bilgi için bkz. https://aka.ms/dotnet-docs. Kullanılabilir komutları görmek için dotnet --help komutunu kullanın veya https://aka.ms/dotnet-cli-docs adresine gidin. Telemetri --------------- +--------- .NET Core araçları, deneyiminizi iyileştirmek için kullanım verileri toplar. Veriler anonimdir ve komut satırı bağımsız değişkenlerini içermez. Veriler Microsoft tarafından toplanır ve topluluk ile paylaşılır. Sık kullandığınız kabuk aracılığıyla DOTNET_CLI_TELEMETRY_OPTOUT ortam değişkenini 1 değerine ayarlayarak telemetri toplanmasını geri çevirebilirsiniz. .NET Core araçları telemetrisi hakkında daha faza bilgi için bkz. https://aka.ms/dotnet-cli-telemetry. @@ -30,8 +31,8 @@ Sık kullandığınız kabuk aracılığıyla DOTNET_CLI_TELEMETRY_OPTOUT ortam 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. +-------------- +A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once. Yapılandırılıyor... ------------------- Yerel paket önbelleğinizi başlangıçta doldurmak, geri yükleme hızını artırmak ve çevrimdışı erişimi etkinleştirmek için bir komut çalıştırılıyor. Bu komutun tamamlanması yaklaşık bir dakika sürer ve bu işlem yalnızca bir kez gerçekleştirilir. @@ -41,7 +42,7 @@ Yerel paket önbelleğinizi başlangıçta doldurmak, geri yükleme hızını ar Permission denied to modify the '{0}' folder. Here are some options to fix this error: ---------------------- +---------------------------------------- 1. Re-run this command with elevated access. 2. Disabled the first run experience by setting the environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to true. 3. Copy the .NET Core SDK to a non-protected location and use it from there. @@ -49,7 +50,7 @@ Here are some options to fix this error: '{0}' klasörünü değiştirme izni verilmedi. Bu hatayı düzeltmek için bazı seçenekler: ---------------------- +----------------------------------------- 1. Bu komutu yükseltilmiş erişim ile yeniden çalıştırın. 2. DOTNET_SKIP_FIRST_TIME_EXPERIENCE ortam değişkenini true olarak ayarlayarak ilk çalıştırma deneyimini devre dışı bırakın. 3. .NET Core SDK’sını korumasız bir konuma kopyalayarak oradan kullanın. diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.xlf index 64e3c6463..9d5a25e5b 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.xlf @@ -6,17 +6,18 @@ 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. +Learn more about .NET Core: https://aka.ms/dotnet-docs +Use 'dotnet --help' to see available commands or visit: 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. +--------- +The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. + +Read more about .NET Core CLI 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. +-------------- +A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once. diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hans.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hans.xlf index 7c5bfae32..2f91a7d24 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hans.xlf @@ -5,19 +5,20 @@ 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. +Learn more about .NET Core: https://aka.ms/dotnet-docs +Use 'dotnet --help' to see available commands or visit: 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. - 欢迎使用 .NET Core! ---------------------- +--------- +The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. + +Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry + 欢迎使用 .NET Core! +------------------ 若要详细了解 .NET Core,请访问 https://aka.ms/dotnet-docs。使用 dotnet --help 查看可用的命令或转到 https://aka.ms/dotnet-cli-docs。 遥测 --------------- +---- .NET Core 收集使用情况数据,以便改善用户体验。数据是匿名的且不包含命令行参数。数据由 Microsoft 收集,并与社区共享。 可选择使用你最喜爱的 shell 将 DOTNET_CLI_TELEMETRY_OPTOUT 环境变量设置为 1,从而退出遥测。 若要深入了解 .NET Core 工具遥测,请访问 https://aka.ms/dotnet-cli-telemetry。 @@ -30,10 +31,10 @@ 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. +-------------- +A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once. 正在配置... -------------------- +---------- 正在运行一项命令,以初步填充本地包缓存,从而提高还原速度并启用脱机访问。此命令最长需要一分钟才能完成,且仅可运行一次。 @@ -41,7 +42,7 @@ A command is running to initially populate your local package cache, to improve Permission denied to modify the '{0}' folder. Here are some options to fix this error: ---------------------- +---------------------------------------- 1. Re-run this command with elevated access. 2. Disabled the first run experience by setting the environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to true. 3. Copy the .NET Core SDK to a non-protected location and use it from there. diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hant.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hant.xlf index 5efc8642e..84f6acee3 100644 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hant.xlf @@ -5,15 +5,16 @@ 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. +Learn more about .NET Core: https://aka.ms/dotnet-docs +Use 'dotnet --help' to see available commands or visit: 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. - 歡迎使用 .NET Core! ---------------------- +--------- +The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. + +Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry + 歡迎使用 .NET Core! +------------------ 深入了解 .NET Core @ https://aka.ms/dotnet-docs。使用 dotnet --help 可查看可用的命令,或前往 https://aka.ms/dotnet-cli-docs。 遙測 @@ -30,10 +31,10 @@ 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. +-------------- +A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once. 正在設定... -------------------- +----------- 執行命令以初步填入您的本機套件快取,以改善還原速度並允許離線存取。此命令最長需要一分鐘的時間才可完成,且只會進行一次。 @@ -41,7 +42,7 @@ A command is running to initially populate your local package cache, to improve Permission denied to modify the '{0}' folder. Here are some options to fix this error: ---------------------- +---------------------------------------- 1. Re-run this command with elevated access. 2. Disabled the first run experience by setting the environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to true. 3. Copy the .NET Core SDK to a non-protected location and use it from there. @@ -49,7 +50,7 @@ Here are some options to fix this error: 權限無法修改 '{0}' 資料夾。 以下為修正此錯誤的一些選項: ---------------------- +------------------------- 1. 利用較高的存取權再次執行此命令。 2. 將環境變數 DOTNET_SKIP_FIRST_TIME_EXPERIENCE 設定為 true,停用第一次的執行體驗。 3. 將 .NET Core SDK 複製到不受保護的位置,並於該處使用此 SDK。 diff --git a/src/Microsoft.DotNet.InternalAbstractions/DirectoryPath.cs b/src/Microsoft.DotNet.InternalAbstractions/DirectoryPath.cs new file mode 100644 index 000000000..40e898d3e --- /dev/null +++ b/src/Microsoft.DotNet.InternalAbstractions/DirectoryPath.cs @@ -0,0 +1,47 @@ +// Copyright (c) .NET 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.Extensions.EnvironmentAbstractions +{ + public struct DirectoryPath + { + public string Value { get; } + + public DirectoryPath(string value) + { + Value = value; + } + + public DirectoryPath WithSubDirectories(params string[] paths) + { + string[] insertValueInFront = new string[paths.Length + 1]; + insertValueInFront[0] = Value; + Array.Copy(paths, 0, insertValueInFront, 1, paths.Length); + + return new DirectoryPath(Path.Combine(insertValueInFront)); + } + + public FilePath WithFile(string fileName) + { + return new FilePath(Path.Combine(Value, fileName)); + } + + public string ToQuotedString() + { + return $"\"{Value}\""; + } + + public override string ToString() + { + return ToQuotedString(); + } + + public DirectoryPath GetParentPath() + { + return new DirectoryPath(Directory.GetParent(Path.GetFullPath(Value)).FullName); + } + } +} diff --git a/src/Microsoft.DotNet.InternalAbstractions/FilePath.cs b/src/Microsoft.DotNet.InternalAbstractions/FilePath.cs new file mode 100644 index 000000000..9dbbf8c83 --- /dev/null +++ b/src/Microsoft.DotNet.InternalAbstractions/FilePath.cs @@ -0,0 +1,32 @@ +// Copyright (c) .NET 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.Extensions.EnvironmentAbstractions +{ + public struct FilePath + { + public string Value { get; } + + public FilePath(string value) + { + Value = value; + } + + public string ToQuotedString() + { + return $"\"{Value}\""; + } + + public override string ToString() + { + return ToQuotedString(); + } + + public DirectoryPath GetDirectoryPath() + { + return new DirectoryPath(Path.GetDirectoryName(Value)); + } + } +} diff --git a/src/Microsoft.DotNet.InternalAbstractions/Microsoft.DotNet.InternalAbstractions.csproj b/src/Microsoft.DotNet.InternalAbstractions/Microsoft.DotNet.InternalAbstractions.csproj index a5c6d9d6a..c4c930565 100644 --- a/src/Microsoft.DotNet.InternalAbstractions/Microsoft.DotNet.InternalAbstractions.csproj +++ b/src/Microsoft.DotNet.InternalAbstractions/Microsoft.DotNet.InternalAbstractions.csproj @@ -1,5 +1,4 @@  - Abstractions for making code that uses file system and environment testable. diff --git a/src/Microsoft.DotNet.InternalAbstractions/Properties/Properties.cs b/src/Microsoft.DotNet.InternalAbstractions/Properties/Properties.cs index 1ab5c59fd..3b1a181ad 100644 --- a/src/Microsoft.DotNet.InternalAbstractions/Properties/Properties.cs +++ b/src/Microsoft.DotNet.InternalAbstractions/Properties/Properties.cs @@ -6,6 +6,7 @@ using System.Runtime.CompilerServices; [assembly: AssemblyMetadataAttribute("Serviceable", "True")] [assembly: InternalsVisibleTo("Microsoft.Extensions.DependencyModel, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: InternalsVisibleTo("dotnet, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.DotNet.Tools.Tests.Utilities, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.Extensions.DependencyModel.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.DotNet.Configurer, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] @@ -13,3 +14,4 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] [assembly: InternalsVisibleTo("dotnet-test.UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100039ac461fa5c82c7dd2557400c4fd4e9dcdf7ac47e3d572548c04cd4673e004916610f4ea5cbf86f2b1ca1cb824f2a7b3976afecfcf4eb72d9a899aa6786effa10c30399e6580ed848231fec48374e41b3acf8811931343fc2f73acf72dae745adbcb7063cc4b50550618383202875223fc75401351cd89c44bf9b50e7fa3796")] [assembly: InternalsVisibleTo("Microsoft.DotNet.Tools.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: InternalsVisibleTo("Microsoft.DotNet.ShellShimMaker.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/Microsoft.DotNet.MSBuildSdkResolver/Interop.NETStandard.cs b/src/Microsoft.DotNet.MSBuildSdkResolver/Interop.NETStandard.cs index 74abc2a61..b672a5dfb 100644 --- a/src/Microsoft.DotNet.MSBuildSdkResolver/Interop.NETStandard.cs +++ b/src/Microsoft.DotNet.MSBuildSdkResolver/Interop.NETStandard.cs @@ -1,10 +1,10 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -// NOTE: Currently, only the NET46 build ships (with Visual Studio/desktop msbuild), -// but the netstandard1.5 adaptation here acts a proof-of-concept for cross-platform +// NOTE: the NET46 build ships with Visual Studio/desktop msbuild on Windows. +// The netstandard1.5 adaptation here acts a proof-of-concept for cross-platform // portability of the underlying hostfxr API and gives us build and test coverage -// on non-Windows machines. +// on non-Windows machines. It also ships with msbuild on Mono. #if NETSTANDARD1_5 using System; diff --git a/src/Microsoft.DotNet.MSBuildSdkResolver/Microsoft.DotNet.MSBuildSdkResolver.csproj b/src/Microsoft.DotNet.MSBuildSdkResolver/Microsoft.DotNet.MSBuildSdkResolver.csproj index ca8867c75..55d357272 100644 --- a/src/Microsoft.DotNet.MSBuildSdkResolver/Microsoft.DotNet.MSBuildSdkResolver.csproj +++ b/src/Microsoft.DotNet.MSBuildSdkResolver/Microsoft.DotNet.MSBuildSdkResolver.csproj @@ -1,5 +1,4 @@  - $(SdkVersion) diff --git a/src/Microsoft.DotNet.TestFramework/Properties/AssemblyInfo.cs b/src/Microsoft.DotNet.TestFramework/Properties/AssemblyInfo.cs deleted file mode 100644 index 110018e7f..000000000 --- a/src/Microsoft.DotNet.TestFramework/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) .NET 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; - -[assembly: AssemblyMetadataAttribute("Serviceable", "True")] diff --git a/src/dotnet/BundledTargetFramework.cs b/src/dotnet/BundledTargetFramework.cs new file mode 100644 index 000000000..e819a613a --- /dev/null +++ b/src/dotnet/BundledTargetFramework.cs @@ -0,0 +1,21 @@ +using System.Reflection; +using System.Runtime.Versioning; +using NuGet.Frameworks; + +namespace Microsoft.DotNet.Cli +{ + internal static class BundledTargetFramework + { + public static string GetTargetFrameworkMoniker() + { + TargetFrameworkAttribute targetFrameworkAttribute = typeof(BundledTargetFramework) + .GetTypeInfo() + .Assembly + .GetCustomAttribute(); + + return NuGetFramework + .Parse(targetFrameworkAttribute.FrameworkName) + .GetShortFolderName(); + } + } +} diff --git a/src/dotnet/HelpException.cs b/src/dotnet/HelpException.cs index 98f2eb6f7..f1f9eb5b4 100644 --- a/src/dotnet/HelpException.cs +++ b/src/dotnet/HelpException.cs @@ -6,7 +6,6 @@ namespace Microsoft.DotNet.Cli /// /// Allows control flow to be interrupted in order to display help in the console. /// - [Obsolete("This is intended to facilitate refactoring during parser replacement and should not be used after that work is done.")] public class HelpException : Exception { public HelpException(string message) : base(message) diff --git a/src/dotnet/MsbuildProject.cs b/src/dotnet/MsbuildProject.cs index 860d38799..34055cacc 100644 --- a/src/dotnet/MsbuildProject.cs +++ b/src/dotnet/MsbuildProject.cs @@ -256,7 +256,7 @@ namespace Microsoft.DotNet.Tools string fullPath = Path.GetFullPath(reference); ret.Add(fullPath); - ret.Add(PathUtility.GetRelativePath(ProjectDirectory, fullPath)); + ret.Add(Path.GetRelativePath(ProjectDirectory, fullPath)); return ret; } diff --git a/src/dotnet/Parser.cs b/src/dotnet/Parser.cs index 5f5bdd6c8..239cb81b8 100644 --- a/src/dotnet/Parser.cs +++ b/src/dotnet/Parser.cs @@ -19,7 +19,7 @@ namespace Microsoft.DotNet.Cli private static void ConfigureCommandLineLocalizedStrings() { DefaultHelpViewText.AdditionalArgumentsSection = - $"{UsageCommandsAdditionalArgsHeader}:{NewLine} {LocalizableStrings.RunCommandAdditionalArgsHelpText}"; + $"{UsageCommandsAdditionalArgsHeader}{NewLine} {LocalizableStrings.RunCommandAdditionalArgsHelpText}"; DefaultHelpViewText.ArgumentsSection.Title = UsageArgumentsHeader; DefaultHelpViewText.CommandsSection.Title = UsageCommandsHeader; DefaultHelpViewText.OptionsSection.Title = UsageOptionsHeader; diff --git a/src/dotnet/Program.cs b/src/dotnet/Program.cs index 6fb3c6512..7e6cafe8c 100644 --- a/src/dotnet/Program.cs +++ b/src/dotnet/Program.cs @@ -4,15 +4,19 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.InteropServices; using System.Text; using Microsoft.DotNet.Cli.CommandLine; using Microsoft.DotNet.Cli.Telemetry; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Configurer; using Microsoft.DotNet.PlatformAbstractions; +using Microsoft.DotNet.ShellShimMaker; using Microsoft.DotNet.Tools.Help; +using Microsoft.Extensions.EnvironmentAbstractions; using NuGet.Frameworks; using Command = Microsoft.DotNet.Cli.Utils.Command; +using RuntimeEnvironment = Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment; namespace Microsoft.DotNet.Cli { @@ -77,12 +81,12 @@ namespace Microsoft.DotNet.Cli { // CommandLineApplication is a bit restrictive, so we parse things ourselves here. Individual apps should use CLA. - bool? verbose = null; var success = true; var command = string.Empty; var lastArg = 0; - var cliFallbackFolderPathCalculator = new CliFallbackFolderPathCalculator(); + var cliFallbackFolderPathCalculator = new CliFolderPathCalculator(); TopLevelCommandParserResult topLevelCommandParserResult = TopLevelCommandParserResult.Empty; + using (INuGetCacheSentinel nugetCacheSentinel = new NuGetCacheSentinel(cliFallbackFolderPathCalculator)) using (IFirstTimeUseNoticeSentinel disposableFirstTimeUseNoticeSentinel = new FirstTimeUseNoticeSentinel(cliFallbackFolderPathCalculator)) @@ -92,7 +96,8 @@ namespace Microsoft.DotNet.Cli { if (IsArg(args[lastArg], "d", "diagnostics")) { - verbose = true; + Environment.SetEnvironmentVariable(CommandContext.Variables.Verbose, bool.TrueString); + CommandContext.SetVerbose(true); } else if (IsArg(args[lastArg], "version")) { @@ -111,7 +116,7 @@ namespace Microsoft.DotNet.Cli HelpCommand.PrintHelp(); return 0; } - else if (args[lastArg].StartsWith("-")) + else if (args[lastArg].StartsWith("-", StringComparison.OrdinalIgnoreCase)) { Reporter.Error.WriteLine($"Unknown option: {args[lastArg]}"); success = false; @@ -120,22 +125,24 @@ namespace Microsoft.DotNet.Cli { // It's the command, and we're done! command = args[lastArg]; - if (string.IsNullOrEmpty(command)) { command = "help"; } - topLevelCommandParserResult = new TopLevelCommandParserResult(args[lastArg]); + topLevelCommandParserResult = new TopLevelCommandParserResult(command); + var hasSuperUserAccess = false; if (IsDotnetBeingInvokedFromNativeInstaller(topLevelCommandParserResult)) { firstTimeUseNoticeSentinel = new NoOpFirstTimeUseNoticeSentinel(); + hasSuperUserAccess = true; } ConfigureDotNetForFirstTimeUse( nugetCacheSentinel, firstTimeUseNoticeSentinel, - cliFallbackFolderPathCalculator); + cliFallbackFolderPathCalculator, + hasSuperUserAccess); break; } @@ -159,9 +166,8 @@ namespace Microsoft.DotNet.Cli ? Enumerable.Empty() : args.Skip(lastArg + 1).ToArray(); - if (verbose.HasValue) + if (CommandContext.IsVerbose()) { - Environment.SetEnvironmentVariable(CommandContext.Variables.Verbose, verbose.ToString()); Console.WriteLine($"Telemetry is: {(telemetryClient.Enabled ? "Enabled" : "Disabled")}"); } @@ -170,7 +176,12 @@ namespace Microsoft.DotNet.Cli int exitCode; if (BuiltInCommandsCatalog.Commands.TryGetValue(topLevelCommandParserResult.Command, out var builtIn)) { - TelemetryEventEntry.SendFiltered(Parser.Instance.ParseFrom($"dotnet {topLevelCommandParserResult.Command}", appArgs.ToArray())); + var parseResult = Parser.Instance.ParseFrom($"dotnet {topLevelCommandParserResult.Command}", appArgs.ToArray()); + if (!parseResult.Errors.Any()) + { + TelemetryEventEntry.SendFiltered(parseResult); + } + exitCode = builtIn.Command(appArgs.ToArray()); } else @@ -193,24 +204,29 @@ namespace Microsoft.DotNet.Cli private static void ConfigureDotNetForFirstTimeUse( INuGetCacheSentinel nugetCacheSentinel, IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel, - CliFallbackFolderPathCalculator cliFallbackFolderPathCalculator) + CliFolderPathCalculator cliFolderPathCalculator, + bool hasSuperUserAccess) { + var environmentProvider = new EnvironmentProvider(); + using (PerfTrace.Current.CaptureTiming()) { var nugetPackagesArchiver = new NuGetPackagesArchiver(); - var environmentProvider = new EnvironmentProvider(); + var environmentPath = + EnvironmentPathFactory.CreateEnvironmentPath(cliFolderPathCalculator, hasSuperUserAccess, environmentProvider); var commandFactory = new DotNetCommandFactory(alwaysRunOutOfProc: true); var nugetCachePrimer = new NuGetCachePrimer( nugetPackagesArchiver, nugetCacheSentinel, - cliFallbackFolderPathCalculator); + cliFolderPathCalculator); var dotnetConfigurer = new DotnetFirstTimeUseConfigurer( nugetCachePrimer, nugetCacheSentinel, firstTimeUseNoticeSentinel, environmentProvider, Reporter.Output, - cliFallbackFolderPathCalculator.CliFallbackFolderPath); + cliFolderPathCalculator.CliFallbackFolderPath, + environmentPath); dotnetConfigurer.Configure(); } @@ -261,7 +277,8 @@ namespace Microsoft.DotNet.Cli private static bool IsArg(string candidate, string shortName, string longName) { - return (shortName != null && candidate.Equals("-" + shortName)) || (longName != null && candidate.Equals("--" + longName)); + return (shortName != null && candidate.Equals("-" + shortName, StringComparison.OrdinalIgnoreCase)) || + (longName != null && candidate.Equals("--" + longName, StringComparison.OrdinalIgnoreCase)); } private static string GetDisplayRid(DotnetVersionFile versionFile) diff --git a/src/dotnet/Properties/AssemblyInfo.cs b/src/dotnet/Properties/AssemblyInfo.cs index d7ae131d6..334c80f95 100644 --- a/src/dotnet/Properties/AssemblyInfo.cs +++ b/src/dotnet/Properties/AssemblyInfo.cs @@ -17,3 +17,5 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("dotnet-sln-remove.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("dotnet-msbuild.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("dotnet-run.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: InternalsVisibleTo("Microsoft.DotNet.ToolPackageObtainer.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: InternalsVisibleTo("Microsoft.DotNet.ShellShimMaker.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/dotnet/ShellShimMaker/DoNothingEnvironmentPath.cs b/src/dotnet/ShellShimMaker/DoNothingEnvironmentPath.cs new file mode 100644 index 000000000..79ee09564 --- /dev/null +++ b/src/dotnet/ShellShimMaker/DoNothingEnvironmentPath.cs @@ -0,0 +1,22 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Diagnostics; +using System.IO; +using System.Linq; +using Microsoft.DotNet.Cli.Utils; + +namespace Microsoft.DotNet.ShellShimMaker +{ + public class DoNothingEnvironmentPath : IEnvironmentPath + { + public void AddPackageExecutablePathToUserPath() + { + } + + public void PrintAddPathInstructionIfPathDoesNotExist() + { + } + } +} diff --git a/src/dotnet/ShellShimMaker/EnvironmentPathFactory.cs b/src/dotnet/ShellShimMaker/EnvironmentPathFactory.cs new file mode 100644 index 000000000..48ffce82f --- /dev/null +++ b/src/dotnet/ShellShimMaker/EnvironmentPathFactory.cs @@ -0,0 +1,66 @@ +// Copyright (c) .NET 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.Runtime.InteropServices; +using System.Xml.Xsl; +using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Configurer; +using Microsoft.Extensions.EnvironmentAbstractions; + +namespace Microsoft.DotNet.ShellShimMaker +{ + internal static class EnvironmentPathFactory + { + public static IEnvironmentPath CreateEnvironmentPath( + CliFolderPathCalculator cliFolderPathCalculator = null, + bool hasSuperUserAccess = false, + IEnvironmentProvider environmentProvider = null) + { + if (cliFolderPathCalculator == null) + { + cliFolderPathCalculator = new CliFolderPathCalculator(); + } + + if (environmentProvider == null) + { + environmentProvider = new EnvironmentProvider(); + } + + IEnvironmentPath environmentPath = new DoNothingEnvironmentPath(); + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + environmentPath = new WindowsEnvironmentPath( + cliFolderPathCalculator.ExecutablePackagesPath, + Reporter.Output, + environmentProvider); + } + else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && hasSuperUserAccess) + { + environmentPath = new LinuxEnvironmentPath( + cliFolderPathCalculator.ExecutablePackagesPath, + Reporter.Output, + environmentProvider, new FileWrapper()); + } + else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && hasSuperUserAccess) + { + environmentPath = new OSXEnvironmentPath( + packageExecutablePathWithTilde: cliFolderPathCalculator.ExecutablePackagesPathOnMacEnvPath, + fullPackageExecutablePath: cliFolderPathCalculator.ExecutablePackagesPath, + reporter: Reporter.Output, + environmentProvider: environmentProvider, + fileSystem: new FileWrapper()); + } + + return environmentPath; + } + + public static IEnvironmentPathInstruction CreateEnvironmentPathInstruction( + CliFolderPathCalculator cliFolderPathCalculator = null, + IEnvironmentProvider environmentProvider = null) + { + return CreateEnvironmentPath(cliFolderPathCalculator, true, environmentProvider); + } + } +} diff --git a/src/dotnet/ShellShimMaker/LinuxEnvironmentPath.cs b/src/dotnet/ShellShimMaker/LinuxEnvironmentPath.cs new file mode 100644 index 000000000..0868a6fcf --- /dev/null +++ b/src/dotnet/ShellShimMaker/LinuxEnvironmentPath.cs @@ -0,0 +1,78 @@ +// Copyright (c) .NET 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.Utils; +using Microsoft.Extensions.EnvironmentAbstractions; + +namespace Microsoft.DotNet.ShellShimMaker +{ + internal class LinuxEnvironmentPath : IEnvironmentPath + { + private readonly IFile _fileSystem; + private readonly IEnvironmentProvider _environmentProvider; + private readonly IReporter _reporter; + private const string PathName = "PATH"; + private readonly string _packageExecutablePath; + + private readonly string _profiledDotnetCliToolsPath + = Environment.GetEnvironmentVariable("DOTNET_CLI_TEST_LINUX_PROFILED_PATH") + ?? @"/etc/profile.d/dotnet-cli-tools-bin-path.sh"; + + internal LinuxEnvironmentPath( + string packageExecutablePath, + IReporter reporter, + IEnvironmentProvider environmentProvider, + IFile fileSystem) + { + _fileSystem = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem)); + _environmentProvider + = environmentProvider ?? throw new ArgumentNullException(nameof(environmentProvider)); + _reporter + = reporter ?? throw new ArgumentNullException(nameof(reporter)); + _packageExecutablePath + = packageExecutablePath ?? throw new ArgumentNullException(nameof(packageExecutablePath)); + } + + public void AddPackageExecutablePathToUserPath() + { + if (PackageExecutablePathExists()) + { + return; + } + + var script = $"export PATH=\"$PATH:{_packageExecutablePath}\""; + _fileSystem.WriteAllText(_profiledDotnetCliToolsPath, script); + } + + private bool PackageExecutablePathExists() + { + return _environmentProvider + .GetEnvironmentVariable(PathName) + .Split(':').Contains(_packageExecutablePath); + } + + public void PrintAddPathInstructionIfPathDoesNotExist() + { + if (!PackageExecutablePathExists()) + { + if (_fileSystem.Exists(_profiledDotnetCliToolsPath)) + { + _reporter.WriteLine("Since you just installed the .NET Core SDK, you will need to logout or restart your session before running the tool you installed."); + } + else + { + // similar to https://code.visualstudio.com/docs/setup/mac + _reporter.WriteLine( + $"Cannot find the tools executable path. Please ensure {_packageExecutablePath} is added to your PATH.{Environment.NewLine}" + + $"If you are using bash. You can do this by running the following command:{Environment.NewLine}{Environment.NewLine}" + + $"cat << EOF >> ~/.bash_profile{Environment.NewLine}" + + $"# Add .NET Core SDK tools{Environment.NewLine}" + + $"export PATH=\"$PATH:{_packageExecutablePath}\"{Environment.NewLine}" + + $"EOF"); + } + } + } + } +} diff --git a/src/dotnet/ShellShimMaker/OsxEnvironmentPath.cs b/src/dotnet/ShellShimMaker/OsxEnvironmentPath.cs new file mode 100644 index 000000000..cc8f8eac8 --- /dev/null +++ b/src/dotnet/ShellShimMaker/OsxEnvironmentPath.cs @@ -0,0 +1,85 @@ +// Copyright (c) .NET 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.Utils; +using Microsoft.Extensions.EnvironmentAbstractions; + +namespace Microsoft.DotNet.ShellShimMaker +{ + internal class OSXEnvironmentPath : IEnvironmentPath + { + private const string PathName = "PATH"; + private readonly string _packageExecutablePathWithTilde; + private readonly string _fullPackageExecutablePath; + private readonly IFile _fileSystem; + private readonly IEnvironmentProvider _environmentProvider; + private readonly IReporter _reporter; + + private static readonly string PathDDotnetCliToolsPath + = Environment.GetEnvironmentVariable("DOTNET_CLI_TEST_OSX_PATHSD_PATH") + ?? @"/etc/paths.d/dotnet-cli-tools"; + + public OSXEnvironmentPath( + string packageExecutablePathWithTilde, + string fullPackageExecutablePath, + IReporter reporter, + IEnvironmentProvider environmentProvider, + IFile fileSystem + ) + { + _fullPackageExecutablePath = fullPackageExecutablePath ?? + throw new ArgumentNullException(nameof(fullPackageExecutablePath)); + _packageExecutablePathWithTilde = packageExecutablePathWithTilde ?? + throw new ArgumentNullException(nameof(packageExecutablePathWithTilde)); + _fileSystem = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem)); + _environmentProvider + = environmentProvider ?? throw new ArgumentNullException(nameof(environmentProvider)); + _reporter + = reporter ?? throw new ArgumentNullException(nameof(reporter)); + } + + public void AddPackageExecutablePathToUserPath() + { + if (PackageExecutablePathExists()) + { + return; + } + + var script = $"{_packageExecutablePathWithTilde}"; + _fileSystem.WriteAllText(PathDDotnetCliToolsPath, script); + } + + private bool PackageExecutablePathExists() + { + return _environmentProvider.GetEnvironmentVariable(PathName).Split(':') + .Contains(_packageExecutablePathWithTilde) || + _environmentProvider.GetEnvironmentVariable(PathName).Split(':') + .Contains(_fullPackageExecutablePath); + } + + public void PrintAddPathInstructionIfPathDoesNotExist() + { + if (!PackageExecutablePathExists()) + { + if (_fileSystem.Exists(PathDDotnetCliToolsPath)) + { + _reporter.WriteLine( + "Since you just installed the .NET Core SDK, you will need to reopen terminal before running the tool you installed."); + } + else + { + // similar to https://code.visualstudio.com/docs/setup/mac + _reporter.WriteLine( + $"Cannot find the tools executable path. Please ensure {_fullPackageExecutablePath} is added to your PATH.{Environment.NewLine}" + + $"If you are using bash, You can do this by running the following command:{Environment.NewLine}{Environment.NewLine}" + + $"cat << EOF >> ~/.bash_profile{Environment.NewLine}" + + $"# Add .NET Core SDK tools{Environment.NewLine}" + + $"export PATH=\"$PATH:{_fullPackageExecutablePath}\"{Environment.NewLine}" + + $"EOF"); + } + } + } + } +} diff --git a/src/dotnet/ShellShimMaker/ShellShimMaker.cs b/src/dotnet/ShellShimMaker/ShellShimMaker.cs new file mode 100644 index 000000000..6a56f226b --- /dev/null +++ b/src/dotnet/ShellShimMaker/ShellShimMaker.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 System.Runtime.InteropServices; +using System.Text; +using Microsoft.DotNet.Cli.Utils; +using Microsoft.Extensions.EnvironmentAbstractions; + +namespace Microsoft.DotNet.ShellShimMaker +{ + public class ShellShimMaker + { + private readonly string _pathToPlaceShim; + + public ShellShimMaker(string pathToPlaceShim) + { + _pathToPlaceShim = + pathToPlaceShim ?? throw new ArgumentNullException(nameof(pathToPlaceShim)); + } + + public void CreateShim(string packageExecutablePath, string shellCommandName) + { + var packageExecutable = new FilePath(packageExecutablePath); + + var script = new StringBuilder(); + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + script.AppendLine("@echo off"); + script.AppendLine($"dotnet {packageExecutable.ToQuotedString()} %*"); + } + else + { + script.AppendLine("#!/bin/sh"); + script.AppendLine($"dotnet {packageExecutable.ToQuotedString()} \"$@\""); + } + + FilePath scriptPath = GetScriptPath(shellCommandName); + File.WriteAllText(scriptPath.Value, script.ToString()); + + SetUserExecutionPermissionToShimFile(scriptPath); + } + + public void EnsureCommandNameUniqueness(string shellCommandName) + { + if (File.Exists(Path.Combine(_pathToPlaceShim, shellCommandName))) + { + throw new GracefulException( + $"Failed to install tool {shellCommandName}. A command with the same name already exists."); + } + } + + public void Remove(string shellCommandName) + { + File.Delete(GetScriptPath(shellCommandName).Value); + } + + private FilePath GetScriptPath(string shellCommandName) + { + var scriptPath = Path.Combine(_pathToPlaceShim, shellCommandName); + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + scriptPath += ".cmd"; + } + + return new FilePath(scriptPath); + } + + private static void SetUserExecutionPermissionToShimFile(FilePath scriptPath) + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) return; + + CommandResult result = new CommandFactory() + .Create("chmod", new[] {"u+x", scriptPath.Value}) + .CaptureStdOut() + .CaptureStdErr() + .Execute(); + + if (result.ExitCode != 0) + { + throw new GracefulException( + "Failed to change permission:" + + $"{Environment.NewLine}Error: " + result.StdErr + + $"{Environment.NewLine}Output: " + result.StdOut); + } + } + } +} diff --git a/src/dotnet/ShellShimMaker/WindowsEnvironmentPath.cs b/src/dotnet/ShellShimMaker/WindowsEnvironmentPath.cs new file mode 100644 index 000000000..bc229d04d --- /dev/null +++ b/src/dotnet/ShellShimMaker/WindowsEnvironmentPath.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.Linq; +using Microsoft.DotNet.Cli.Utils; +using Microsoft.Extensions.EnvironmentAbstractions; + +namespace Microsoft.DotNet.ShellShimMaker +{ + internal class WindowsEnvironmentPath : IEnvironmentPath + { + private readonly IReporter _reporter; + private readonly IEnvironmentProvider _environmentProvider; + private const string PathName = "PATH"; + private readonly string _packageExecutablePath; + + public WindowsEnvironmentPath( + string packageExecutablePath, IReporter reporter, + IEnvironmentProvider environmentProvider) + { + _packageExecutablePath + = packageExecutablePath ?? throw new ArgumentNullException(nameof(packageExecutablePath)); + _environmentProvider + = environmentProvider ?? throw new ArgumentNullException(nameof(environmentProvider)); + _reporter + = reporter ?? throw new ArgumentNullException(nameof(reporter)); + } + + public void AddPackageExecutablePathToUserPath() + { + if (PackageExecutablePathExists()) + { + return; + } + + var existingUserEnvPath = Environment.GetEnvironmentVariable(PathName, EnvironmentVariableTarget.User); + + Environment.SetEnvironmentVariable( + PathName, + $"{existingUserEnvPath};{_packageExecutablePath}", + EnvironmentVariableTarget.User); + } + + private bool PackageExecutablePathExists() + { + return _environmentProvider.GetEnvironmentVariable(PathName).Split(';').Contains(_packageExecutablePath); + } + + public void PrintAddPathInstructionIfPathDoesNotExist() + { + if (!PackageExecutablePathExists()) + { + if (Environment.GetEnvironmentVariable(PathName, EnvironmentVariableTarget.User).Split(';') + .Contains(_packageExecutablePath)) + { + _reporter.WriteLine( + "Since you just installed the .NET Core SDK, you will need to reopen the Command Prompt window before running the tool you installed."); + } + else + { + _reporter.WriteLine( + $"Cannot find the tools executable path. Please ensure {_packageExecutablePath} is added to your PATH.{Environment.NewLine}" + + $"You can do this by running the following command:{Environment.NewLine}{Environment.NewLine}" + + $"setx PATH \\\"%PATH%;{_packageExecutablePath}\"{Environment.NewLine}"); + } + } + } + } +} diff --git a/src/dotnet/SlnFileExtensions.cs b/src/dotnet/SlnFileExtensions.cs index 24848dffa..789318476 100644 --- a/src/dotnet/SlnFileExtensions.cs +++ b/src/dotnet/SlnFileExtensions.cs @@ -23,7 +23,7 @@ namespace Microsoft.DotNet.Tools.Common throw new ArgumentException(); } - var relativeProjectPath = PathUtility.GetRelativePath( + var relativeProjectPath = Path.GetRelativePath( PathUtility.EnsureTrailingSlash(slnFile.BaseDirectory), fullProjectPath); @@ -247,6 +247,22 @@ namespace Microsoft.DotNet.Tools.Common string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, slnProject.FilePath)); } + foreach (var project in slnFile.Projects) + { + var dependencies = project.Dependencies; + if (dependencies == null) + { + continue; + } + + dependencies.SkipIfEmpty = true; + + foreach (var removed in projectsToRemove) + { + dependencies.Properties.Remove(removed.Id); + } + } + projectRemoved = true; } diff --git a/src/dotnet/Telemetry/TelemetryCommonProperties.cs b/src/dotnet/Telemetry/TelemetryCommonProperties.cs index a14c5cf84..c19060ab3 100644 --- a/src/dotnet/Telemetry/TelemetryCommonProperties.cs +++ b/src/dotnet/Telemetry/TelemetryCommonProperties.cs @@ -24,7 +24,7 @@ namespace Microsoft.DotNet.Cli.Telemetry _hasher = hasher ?? Sha256Hasher.Hash; _getMACAddress = getMACAddress ?? MacAddressGetter.GetMacAddress; _dockerContainerDetector = dockerContainerDetector ?? new DockerContainerDetectorForTelemetry(); - _userLevelCacheWriter = userLevelCacheWriter ?? new UserLevelCacheWriter(new CliFallbackFolderPathCalculator()); + _userLevelCacheWriter = userLevelCacheWriter ?? new UserLevelCacheWriter(new CliFolderPathCalculator()); } private readonly IDockerContainerDetector _dockerContainerDetector; diff --git a/src/dotnet/ToolPackageObtainer/IPackageToProjectFileAdder.cs b/src/dotnet/ToolPackageObtainer/IPackageToProjectFileAdder.cs new file mode 100644 index 000000000..00a8d2e66 --- /dev/null +++ b/src/dotnet/ToolPackageObtainer/IPackageToProjectFileAdder.cs @@ -0,0 +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.Extensions.EnvironmentAbstractions; + +namespace Microsoft.DotNet.ToolPackageObtainer +{ + internal interface IPackageToProjectFileAdder + { + void Add(FilePath projectPath, string packageId); + } +} diff --git a/src/dotnet/ToolPackageObtainer/IProjectRestorer.cs b/src/dotnet/ToolPackageObtainer/IProjectRestorer.cs new file mode 100644 index 000000000..d53898427 --- /dev/null +++ b/src/dotnet/ToolPackageObtainer/IProjectRestorer.cs @@ -0,0 +1,15 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Microsoft.Extensions.EnvironmentAbstractions; + +namespace Microsoft.DotNet.ToolPackageObtainer +{ + internal interface IProjectRestorer + { + void Restore( + FilePath projectPath, + DirectoryPath assetJsonOutput, + FilePath? nugetconfig); + } +} diff --git a/src/dotnet/ToolPackageObtainer/PackageObtainException.cs b/src/dotnet/ToolPackageObtainer/PackageObtainException.cs new file mode 100644 index 000000000..db15e8b1b --- /dev/null +++ b/src/dotnet/ToolPackageObtainer/PackageObtainException.cs @@ -0,0 +1,22 @@ +// Copyright (c) .NET 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.ToolPackageObtainer +{ + internal class PackageObtainException : Exception + { + public PackageObtainException() + { + } + + public PackageObtainException(string message) : base(message) + { + } + + public PackageObtainException(string message, Exception innerException) : base(message, innerException) + { + } + } +} diff --git a/src/dotnet/ToolPackageObtainer/PackageVersion.cs b/src/dotnet/ToolPackageObtainer/PackageVersion.cs new file mode 100644 index 000000000..da7d6aa3d --- /dev/null +++ b/src/dotnet/ToolPackageObtainer/PackageVersion.cs @@ -0,0 +1,28 @@ +// Copyright (c) .NET 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.ToolPackageObtainer +{ + internal class PackageVersion + { + public PackageVersion(string packageVersion) + { + if (packageVersion == null) + { + Value = Path.GetRandomFileName(); + IsPlaceholder = true; + } + else + { + Value = packageVersion; + IsPlaceholder = false; + } + } + + public bool IsPlaceholder { get; } + public string Value { get; } + public bool IsConcreteValue => !IsPlaceholder; + } +} diff --git a/src/dotnet/ToolPackageObtainer/ToolConfiguration.cs b/src/dotnet/ToolPackageObtainer/ToolConfiguration.cs new file mode 100644 index 000000000..1b0a32cb3 --- /dev/null +++ b/src/dotnet/ToolPackageObtainer/ToolConfiguration.cs @@ -0,0 +1,46 @@ +// Copyright (c) .NET 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.ToolPackageObtainer +{ + internal class ToolConfiguration + { + public ToolConfiguration( + string commandName, + string toolAssemblyEntryPoint) + { + if (string.IsNullOrWhiteSpace(commandName)) + { + throw new ArgumentNullException(nameof(commandName), "Cannot be null or whitespace"); + } + + EnsureNoInvalidFilenameCharacters(commandName, nameof(toolAssemblyEntryPoint)); + + if (string.IsNullOrWhiteSpace(toolAssemblyEntryPoint)) + { + throw new ArgumentNullException(nameof(toolAssemblyEntryPoint), "Cannot be null or whitespace"); + } + + CommandName = commandName; + ToolAssemblyEntryPoint = toolAssemblyEntryPoint; + } + + private void EnsureNoInvalidFilenameCharacters(string commandName, string nameOfParam) + { + // https://stackoverflow.com/questions/1976007/what-characters-are-forbidden-in-windows-and-linux-directory-names + char[] invalidCharactors = {'/', '<', '>', ':', '"', '/', '\\', '|', '?', '*'}; + if (commandName.IndexOfAny(invalidCharactors) != -1) + { + throw new ArgumentException( + paramName: nameof(nameOfParam), + message: "Cannot contain following character " + new string(invalidCharactors)); + } + } + + + public string CommandName { get; } + public string ToolAssemblyEntryPoint { get; } + } +} diff --git a/src/dotnet/ToolPackageObtainer/ToolConfigurationAndExecutableDirectory.cs b/src/dotnet/ToolPackageObtainer/ToolConfigurationAndExecutableDirectory.cs new file mode 100644 index 000000000..4dc6a220d --- /dev/null +++ b/src/dotnet/ToolPackageObtainer/ToolConfigurationAndExecutableDirectory.cs @@ -0,0 +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 Microsoft.Extensions.EnvironmentAbstractions; + +namespace Microsoft.DotNet.ToolPackageObtainer +{ + internal class ToolConfigurationAndExecutableDirectory + { + public ToolConfigurationAndExecutableDirectory( + ToolConfiguration toolConfiguration, + DirectoryPath executableDirectory) + { + Configuration = toolConfiguration; + ExecutableDirectory = executableDirectory; + } + + public ToolConfiguration Configuration { get; } + public DirectoryPath ExecutableDirectory { get; } + } +} diff --git a/src/dotnet/ToolPackageObtainer/ToolConfigurationDeserialization/DotNetCliTool.cs b/src/dotnet/ToolPackageObtainer/ToolConfigurationDeserialization/DotNetCliTool.cs new file mode 100644 index 000000000..b64db01e2 --- /dev/null +++ b/src/dotnet/ToolPackageObtainer/ToolConfigurationDeserialization/DotNetCliTool.cs @@ -0,0 +1,13 @@ +using System.Diagnostics; +using System.Xml.Serialization; + +namespace Microsoft.DotNet.ToolPackageObtainer.ToolConfigurationDeserialization +{ + [DebuggerStepThrough] + [XmlRoot(Namespace = "", IsNullable = false)] + public class DotNetCliTool + { + [XmlArrayItem("Command", IsNullable = false)] + public DotNetCliToolCommand[] Commands { get; set; } + } +} diff --git a/src/dotnet/ToolPackageObtainer/ToolConfigurationDeserialization/DotNetCliToolCommand.cs b/src/dotnet/ToolPackageObtainer/ToolConfigurationDeserialization/DotNetCliToolCommand.cs new file mode 100644 index 000000000..159f6e993 --- /dev/null +++ b/src/dotnet/ToolPackageObtainer/ToolConfigurationDeserialization/DotNetCliToolCommand.cs @@ -0,0 +1,21 @@ +using System; +using System.Diagnostics; +using System.Xml.Serialization; + +namespace Microsoft.DotNet.ToolPackageObtainer.ToolConfigurationDeserialization +{ + [Serializable] + [DebuggerStepThrough] + [XmlType(AnonymousType = true)] + public class DotNetCliToolCommand + { + [XmlAttribute] + public string Name { get; set; } + + [XmlAttribute] + public string EntryPoint { get; set; } + + [XmlAttribute] + public string Runner { get; set; } + } +} diff --git a/src/dotnet/ToolPackageObtainer/ToolConfigurationDeserializer.cs b/src/dotnet/ToolPackageObtainer/ToolConfigurationDeserializer.cs new file mode 100644 index 000000000..534cbf50c --- /dev/null +++ b/src/dotnet/ToolPackageObtainer/ToolConfigurationDeserializer.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.IO; +using System.Xml; +using System.Xml.Serialization; +using Microsoft.DotNet.ToolPackageObtainer.ToolConfigurationDeserialization; + +namespace Microsoft.DotNet.ToolPackageObtainer +{ + internal static class ToolConfigurationDeserializer + { + public static ToolConfiguration Deserialize(string pathToXml) + { + var serializer = new XmlSerializer(typeof(DotNetCliTool)); + + DotNetCliTool dotNetCliTool; + + using (var fs = new FileStream(pathToXml, FileMode.Open)) + { + var reader = XmlReader.Create(fs); + + try + { + dotNetCliTool = (DotNetCliTool)serializer.Deserialize(reader); + } + catch (InvalidOperationException e) when (e.InnerException is XmlException) + { + throw new ToolConfigurationException( + "Failed to retrive tool configuration exception, configuration is malformed xml. " + + e.InnerException.Message); + } + } + + if (dotNetCliTool.Commands.Length != 1) + { + throw new ToolConfigurationException( + "Failed to retrive tool configuration exception, one and only one command is supported."); + } + + if (dotNetCliTool.Commands[0].Runner != "dotnet") + { + throw new ToolConfigurationException( + "Failed to retrive tool configuration exception, only dotnet as runner is supported."); + } + + var commandName = dotNetCliTool.Commands[0].Name; + var toolAssemblyEntryPoint = dotNetCliTool.Commands[0].EntryPoint; + + try + { + return new ToolConfiguration(commandName, toolAssemblyEntryPoint); + } + catch (ArgumentException e) + { + throw new ToolConfigurationException("Configuration content error. " + e.Message); + } + } + } +} diff --git a/src/dotnet/ToolPackageObtainer/ToolConfigurationException.cs b/src/dotnet/ToolPackageObtainer/ToolConfigurationException.cs new file mode 100644 index 000000000..074010aa0 --- /dev/null +++ b/src/dotnet/ToolPackageObtainer/ToolConfigurationException.cs @@ -0,0 +1,14 @@ +// Copyright (c) .NET 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.ToolPackageObtainer +{ + internal class ToolConfigurationException : ArgumentException + { + public ToolConfigurationException(string message) : base(message) + { + } + } +} diff --git a/src/dotnet/ToolPackageObtainer/ToolPackageObtainer.cs b/src/dotnet/ToolPackageObtainer/ToolPackageObtainer.cs new file mode 100644 index 000000000..faf4ed461 --- /dev/null +++ b/src/dotnet/ToolPackageObtainer/ToolPackageObtainer.cs @@ -0,0 +1,190 @@ +using System; +using System.IO; +using System.Linq; +using System.Xml.Linq; +using Microsoft.Extensions.EnvironmentAbstractions; + +namespace Microsoft.DotNet.ToolPackageObtainer +{ + internal class ToolPackageObtainer + { + private readonly Lazy _bundledTargetFrameworkMoniker; + private readonly Func _getTempProjectPath; + private readonly IPackageToProjectFileAdder _packageToProjectFileAdder; + private readonly IProjectRestorer _projectRestorer; + private readonly DirectoryPath _toolsPath; + + public ToolPackageObtainer( + DirectoryPath toolsPath, + Func getTempProjectPath, + Lazy bundledTargetFrameworkMoniker, + IPackageToProjectFileAdder packageToProjectFileAdder, + IProjectRestorer projectRestorer + ) + { + _getTempProjectPath = getTempProjectPath; + _bundledTargetFrameworkMoniker = bundledTargetFrameworkMoniker; + _projectRestorer = projectRestorer ?? throw new ArgumentNullException(nameof(projectRestorer)); + _packageToProjectFileAdder = packageToProjectFileAdder ?? + throw new ArgumentNullException(nameof(packageToProjectFileAdder)); + _toolsPath = toolsPath; + } + + public ToolConfigurationAndExecutableDirectory ObtainAndReturnExecutablePath( + string packageId, + string packageVersion = null, + FilePath? nugetconfig = null, + string targetframework = null) + { + if (packageId == null) + { + throw new ArgumentNullException(nameof(packageId)); + } + + if (targetframework == null) + { + targetframework = _bundledTargetFrameworkMoniker.Value; + } + + var packageVersionOrPlaceHolder = new PackageVersion(packageVersion); + + DirectoryPath individualToolVersion = + CreateIndividualToolVersionDirectory(packageId, packageVersionOrPlaceHolder); + + FilePath tempProjectPath = CreateTempProject( + packageId, + packageVersionOrPlaceHolder, + targetframework, + individualToolVersion); + + if (packageVersionOrPlaceHolder.IsPlaceholder) + { + InvokeAddPackageRestore( + nugetconfig, + tempProjectPath, + packageId); + } + + InvokeRestore(nugetconfig, tempProjectPath, individualToolVersion); + + if (packageVersionOrPlaceHolder.IsPlaceholder) + { + var concreteVersion = + new DirectoryInfo( + Directory.GetDirectories( + individualToolVersion.WithSubDirectories(packageId).Value).Single()).Name; + DirectoryPath concreteVersionIndividualToolVersion = + individualToolVersion.GetParentPath().WithSubDirectories(concreteVersion); + Directory.Move(individualToolVersion.Value, concreteVersionIndividualToolVersion.Value); + + individualToolVersion = concreteVersionIndividualToolVersion; + packageVersion = concreteVersion; + } + + ToolConfiguration toolConfiguration = GetConfiguration(packageId, packageVersion, individualToolVersion); + + return new ToolConfigurationAndExecutableDirectory( + toolConfiguration, + individualToolVersion.WithSubDirectories( + packageId, + packageVersion, + "tools", + targetframework)); + } + + private static ToolConfiguration GetConfiguration( + string packageId, + string packageVersion, + DirectoryPath individualToolVersion) + { + FilePath toolConfigurationPath = + individualToolVersion + .WithSubDirectories(packageId, packageVersion, "tools") + .WithFile("DotnetToolsConfig.xml"); + + ToolConfiguration toolConfiguration = + ToolConfigurationDeserializer.Deserialize(toolConfigurationPath.Value); + + return toolConfiguration; + } + + private void InvokeRestore( + FilePath? nugetconfig, + FilePath tempProjectPath, + DirectoryPath individualToolVersion) + { + _projectRestorer.Restore(tempProjectPath, individualToolVersion, nugetconfig); + } + + private FilePath CreateTempProject( + string packageId, + PackageVersion packageVersion, + string targetframework, + DirectoryPath individualToolVersion) + { + FilePath tempProjectPath = _getTempProjectPath(); + if (Path.GetExtension(tempProjectPath.Value) != "csproj") + { + tempProjectPath = new FilePath(Path.ChangeExtension(tempProjectPath.Value, "csproj")); + } + + EnsureDirectoryExists(tempProjectPath.GetDirectoryPath()); + var tempProjectContent = new XDocument( + new XElement("Project", + new XAttribute("Sdk", "Microsoft.NET.Sdk"), + new XElement("PropertyGroup", + new XElement("TargetFramework", targetframework), + new XElement("RestorePackagesPath", individualToolVersion.Value), + new XElement("DisableImplicitFrameworkReferences", "true") + ), + packageVersion.IsConcreteValue + ? new XElement("ItemGroup", + new XElement("PackageReference", + new XAttribute("Include", packageId), + new XAttribute("Version", packageVersion.Value) + )) + : null)); + + File.WriteAllText(tempProjectPath.Value, + tempProjectContent.ToString()); + + return tempProjectPath; + } + + private void InvokeAddPackageRestore( + FilePath? nugetconfig, + FilePath tempProjectPath, + string packageId) + { + if (nugetconfig != null) + { + File.Copy( + nugetconfig.Value.Value, + tempProjectPath + .GetDirectoryPath() + .WithFile("nuget.config") + .Value); + } + + _packageToProjectFileAdder.Add(tempProjectPath, packageId); + } + + private DirectoryPath CreateIndividualToolVersionDirectory( + string packageId, + PackageVersion packageVersion) + { + DirectoryPath individualTool = _toolsPath.WithSubDirectories(packageId); + DirectoryPath individualToolVersion = individualTool.WithSubDirectories(packageVersion.Value); + EnsureDirectoryExists(individualToolVersion); + return individualToolVersion; + } + + private static void EnsureDirectoryExists(DirectoryPath path) + { + if (!Directory.Exists(path.Value)) + { + Directory.CreateDirectory(path.Value); + } + } + } +} diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/LocalizableStrings.resx b/src/dotnet/commands/dotnet-add/dotnet-add-package/LocalizableStrings.resx index c18e94039..61a8f320f 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/LocalizableStrings.resx +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/LocalizableStrings.resx @@ -162,4 +162,7 @@ PACKAGE_DIRECTORY + + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + \ No newline at end of file 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 a72a413a1..c0af31625 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/Program.cs +++ b/src/dotnet/commands/dotnet-add/dotnet-add-package/Program.cs @@ -66,8 +66,18 @@ namespace Microsoft.DotNet.Tools.Add.PackageReference if (!_appliedCommand.HasOption("no-restore")) { - // Create a Dependency Graph file for the project - tempDgFilePath = Path.GetTempFileName(); + + try + { + // Create a Dependency Graph file for the project + tempDgFilePath = Path.GetTempFileName(); + } + catch (IOException ioex) + { + // Catch IOException from Path.GetTempFileName() and throw a graceful exception to the user. + throw new GracefulException(string.Format(LocalizableStrings.CmdDGFileIOException, projectFilePath), ioex); + } + GetProjectDependencyGraph(projectFilePath, tempDgFilePath); } 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 11241842a..1526517de 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 @@ -77,6 +77,11 @@ PACKAGE_NAME + + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + + \ 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 2ccf2d7be..f77e3ce04 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 @@ -77,6 +77,11 @@ PACKAGE_NAME + + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + + \ 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 54fcd62ea..73e06ea60 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 @@ -77,6 +77,11 @@ PACKAGE_NAME + + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + + \ 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 a3bbfa6a5..2c49dd6b5 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 @@ -77,6 +77,11 @@ PACKAGE_NAME + + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + + \ 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 8292d3314..ec09dc849 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 @@ -77,6 +77,11 @@ NOME_PACCHETTO + + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + + \ 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 7170969df..943605373 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 @@ -77,6 +77,11 @@ PACKAGE_NAME + + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + + \ 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 d60e087eb..d4b6b2ec0 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 @@ -77,6 +77,11 @@ PACKAGE_NAME + + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + + \ 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 80aaba9ee..3f0c90355 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 @@ -77,6 +77,11 @@ NAZWA_PAKIETU + + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + + \ 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 f99ea83f1..adc1f0d66 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 @@ -77,6 +77,11 @@ PACKAGE_NAME + + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + + \ 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 3f749fa66..5edddb7f6 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 @@ -77,6 +77,11 @@ PACKAGE_NAME + + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + + \ 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 3b3214f1c..2c2946ab8 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 @@ -77,6 +77,11 @@ PACKAGE_NAME + + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + + \ 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 288e9561f..831f1f59a 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 @@ -77,6 +77,11 @@ PACKAGE_NAME + + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + + \ 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 320a7ccd8..0ddb306ef 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 @@ -77,6 +77,11 @@ PACKAGE_NAME + + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + Unable to generate a temporary file for project '{0}'. Cannot add package reference. Please clear the temp directory and try again. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/Program.cs b/src/dotnet/commands/dotnet-add/dotnet-add-reference/Program.cs index 72498b37f..e79ebfc0c 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/Program.cs +++ b/src/dotnet/commands/dotnet-add/dotnet-add-reference/Program.cs @@ -91,7 +91,7 @@ namespace Microsoft.DotNet.Tools.Add.ProjectToProjectReference } var relativePathReferences = _appliedCommand.Arguments.Select((r) => - PathUtility.GetRelativePath(msbuildProj.ProjectDirectory, Path.GetFullPath(r))) + Path.GetRelativePath(msbuildProj.ProjectDirectory, Path.GetFullPath(r))) .ToList(); int numberOfAddedReferences = msbuildProj.AddProjectToProjectReferences( diff --git a/src/dotnet/commands/dotnet-help/HelpCommand.cs b/src/dotnet/commands/dotnet-help/HelpCommand.cs index 799ba9314..2398e11b1 100644 --- a/src/dotnet/commands/dotnet-help/HelpCommand.cs +++ b/src/dotnet/commands/dotnet-help/HelpCommand.cs @@ -102,7 +102,8 @@ namespace Microsoft.DotNet.Tools.Help { if (BuiltInCommandsCatalog.Commands.TryGetValue( _appliedOption.Arguments.Single(), - out BuiltInCommandMetadata builtIn)) + out BuiltInCommandMetadata builtIn) && + !string.IsNullOrEmpty(builtIn.DocLink)) { var process = ConfigureProcess(builtIn.DocLink); process.Start(); diff --git a/src/dotnet/commands/dotnet-help/HelpUsageText.cs b/src/dotnet/commands/dotnet-help/HelpUsageText.cs index 68c637f06..cdf7f4ec1 100644 --- a/src/dotnet/commands/dotnet-help/HelpUsageText.cs +++ b/src/dotnet/commands/dotnet-help/HelpUsageText.cs @@ -27,6 +27,8 @@ path-to-application: nuget {LocalizableStrings.NugetDefinition} msbuild {LocalizableStrings.MsBuildDefinition} vstest {LocalizableStrings.VsTestDefinition} + store {LocalizableStrings.StoreDefinition} + help {LocalizableStrings.HelpDefinition} {LocalizableStrings.CommonOptions}: -v|--verbosity {CommonLocalizableStrings.VerbosityOptionDescription} diff --git a/src/dotnet/commands/dotnet-help/LocalizableStrings.resx b/src/dotnet/commands/dotnet-help/LocalizableStrings.resx index 5552d40c5..28e17697b 100644 --- a/src/dotnet/commands/dotnet-help/LocalizableStrings.resx +++ b/src/dotnet/commands/dotnet-help/LocalizableStrings.resx @@ -180,6 +180,9 @@ Migrates a project.json based project to a msbuild based project. + + Stores the specified assemblies in the runtime store. + Project modification commands @@ -256,6 +259,6 @@ Roll forward on no candidate shared framework is enabled. - Path to additonal deps.json file. + Path to additional deps.json file. \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.cs.xlf index 86d28776a..fe84fd587 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.cs.xlf @@ -233,8 +233,13 @@ - Path to additonal deps.json file. - Cesta k dodatečnému souboru deps.json. + Path to additional deps.json file. + Cesta k dodatečnému souboru deps.json. + + + + Stores the specified assemblies in the runtime store. + Stores the specified assemblies in the runtime store. diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.de.xlf index 419026640..e58a2e1d2 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.de.xlf @@ -233,8 +233,13 @@ - Path to additonal deps.json file. - Pfad zur zusätzlichen "deps.json"-Datei. + Path to additional deps.json file. + Pfad zur zusätzlichen "deps.json"-Datei. + + + + Stores the specified assemblies in the runtime store. + Stores the specified assemblies in the runtime store. diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.es.xlf index a4ae3a445..0f2649fe4 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.es.xlf @@ -233,8 +233,13 @@ - Path to additonal deps.json file. - Ruta de acceso al archivo deps.json adicional. + Path to additional deps.json file. + Ruta de acceso al archivo deps.json adicional. + + + + Stores the specified assemblies in the runtime store. + Stores the specified assemblies in the runtime store. diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.fr.xlf index 62ac2526e..015575287 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.fr.xlf @@ -233,8 +233,13 @@ - Path to additonal deps.json file. - Chemin du fichier deps.json supplémentaire. + Path to additional deps.json file. + Chemin du fichier deps.json supplémentaire. + + + + Stores the specified assemblies in the runtime store. + Stores the specified assemblies in the runtime store. diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.it.xlf index 5e5d2bd4f..36d5647bf 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.it.xlf @@ -233,8 +233,13 @@ - Path to additonal deps.json file. - Percorso del file deps.json aggiuntivo. + Path to additional deps.json file. + Percorso del file deps.json aggiuntivo. + + + + Stores the specified assemblies in the runtime store. + Stores the specified assemblies in the runtime store. diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ja.xlf index d26220439..cc2f6b0cb 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ja.xlf @@ -233,8 +233,13 @@ - Path to additonal deps.json file. - 追加 deps.json ファイルへのパス。 + Path to additional deps.json file. + 追加 deps.json ファイルへのパス。 + + + + Stores the specified assemblies in the runtime store. + Stores the specified assemblies in the runtime store. diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ko.xlf index e31fcdf82..9da185477 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ko.xlf @@ -233,8 +233,13 @@ - Path to additonal deps.json file. - 추가 deps.json 파일의 경로입니다. + Path to additional deps.json file. + 추가 deps.json 파일의 경로입니다. + + + + Stores the specified assemblies in the runtime store. + Stores the specified assemblies in the runtime store. diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.pl.xlf index 66792532c..e2e6d82f6 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.pl.xlf @@ -233,8 +233,13 @@ - Path to additonal deps.json file. - Ścieżka do dodatkowego pliku deps.json. + Path to additional deps.json file. + Ścieżka do dodatkowego pliku deps.json. + + + + Stores the specified assemblies in the runtime store. + Stores the specified assemblies in the runtime store. 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 738bb3734..4d431f8b5 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.pt-BR.xlf @@ -233,8 +233,13 @@ - Path to additonal deps.json file. - Caminho para o arquivo deps.json adicional. + Path to additional deps.json file. + Caminho para o arquivo deps.json adicional. + + + + Stores the specified assemblies in the runtime store. + Stores the specified assemblies in the runtime store. diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ru.xlf index a4ce7b230..1334e8319 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ru.xlf @@ -233,8 +233,13 @@ - Path to additonal deps.json file. - Путь к дополнительному файлу deps.json. + Path to additional deps.json file. + Путь к дополнительному файлу deps.json. + + + + Stores the specified assemblies in the runtime store. + Stores the specified assemblies in the runtime store. diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.tr.xlf index 55ef67760..a49aef24c 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.tr.xlf @@ -233,8 +233,13 @@ - Path to additonal deps.json file. - Ek deps.json dosyasının yolu. + Path to additional deps.json file. + Ek deps.json dosyasının yolu. + + + + Stores the specified assemblies in the runtime store. + Stores the specified assemblies in the runtime store. 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 b2d8cfd42..bfe670ba9 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.zh-Hans.xlf @@ -233,8 +233,13 @@ - Path to additonal deps.json file. - 其他 deps.json 文件的路径。 + Path to additional deps.json file. + 其他 deps.json 文件的路径。 + + + + Stores the specified assemblies in the runtime store. + Stores the specified assemblies in the runtime store. 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 19f53ffe6..231232fbe 100644 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.zh-Hant.xlf @@ -233,8 +233,13 @@ - Path to additonal deps.json file. - 其他 deps.json 檔案的路徑。 + Path to additional deps.json file. + 其他 deps.json 檔案的路徑。 + + + + Stores the specified assemblies in the runtime store. + Stores the specified assemblies in the runtime store. diff --git a/src/dotnet/commands/dotnet-install/PackageToProjectFileAdder.cs b/src/dotnet/commands/dotnet-install/PackageToProjectFileAdder.cs new file mode 100644 index 000000000..21de01ddb --- /dev/null +++ b/src/dotnet/commands/dotnet-install/PackageToProjectFileAdder.cs @@ -0,0 +1,49 @@ +// Copyright (c) .NET 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.ToolPackageObtainer; +using Microsoft.Extensions.EnvironmentAbstractions; + +namespace Microsoft.DotNet.Cli +{ + + internal class PackageToProjectFileAdder : IPackageToProjectFileAdder + { + public void Add(FilePath projectPath, string packageId) + { + if (packageId == null) + { + throw new ArgumentNullException(nameof(packageId)); + } + + var argsToPassToRestore = new List + { + projectPath.Value, + "package", + packageId, + "--no-restore" + }; + + var command = new DotNetCommandFactory(alwaysRunOutOfProc: true) + .Create( + "add", + argsToPassToRestore) + .CaptureStdOut() + .CaptureStdErr(); + + var result = command.Execute(); + if (result.ExitCode != 0) + { + throw new PackageObtainException("Failed to add package. " + + $"{Environment.NewLine}WorkingDirectory: " + + result.StartInfo.WorkingDirectory + + $"{Environment.NewLine}Arguments: " + + result.StartInfo.Arguments + + $"{Environment.NewLine}Output: " + + result.StdErr + result.StdOut); + } + } + } +} diff --git a/src/dotnet/commands/dotnet-install/ProjectRestorer.cs b/src/dotnet/commands/dotnet-install/ProjectRestorer.cs new file mode 100644 index 000000000..a9717ed69 --- /dev/null +++ b/src/dotnet/commands/dotnet-install/ProjectRestorer.cs @@ -0,0 +1,55 @@ +// Copyright (c) .NET 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.ToolPackageObtainer; +using Microsoft.DotNet.PlatformAbstractions; +using Microsoft.Extensions.EnvironmentAbstractions; + +namespace Microsoft.DotNet.Cli +{ + internal class ProjectRestorer : IProjectRestorer + { + public void Restore( + FilePath projectPath, + DirectoryPath assetJsonOutput, + FilePath? nugetconfig) + { + var argsToPassToRestore = new List(); + + argsToPassToRestore.Add(projectPath.ToQuotedString()); + if (nugetconfig != null) + { + argsToPassToRestore.Add("--configfile"); + argsToPassToRestore.Add(nugetconfig.Value.ToQuotedString()); + } + + argsToPassToRestore.AddRange(new List + { + "--runtime", + RuntimeEnvironment.GetRuntimeIdentifier(), + $"/p:BaseIntermediateOutputPath={assetJsonOutput.ToQuotedString()}" + }); + + var command = new DotNetCommandFactory(alwaysRunOutOfProc: true) + .Create( + "restore", + argsToPassToRestore) + .CaptureStdOut() + .CaptureStdErr(); + + var result = command.Execute(); + if (result.ExitCode != 0) + { + throw new PackageObtainException("Failed to restore package. " + + $"{Environment.NewLine}WorkingDirectory: " + + result.StartInfo.WorkingDirectory + + $"{Environment.NewLine}Arguments: " + + result.StartInfo.Arguments + + $"{Environment.NewLine}Output: " + + result.StdErr + result.StdOut); + } + } + } +} diff --git a/src/dotnet/commands/dotnet-msbuild/MSBuildLogger.cs b/src/dotnet/commands/dotnet-msbuild/MSBuildLogger.cs index 1a6433f90..2f60d7d1b 100644 --- a/src/dotnet/commands/dotnet-msbuild/MSBuildLogger.cs +++ b/src/dotnet/commands/dotnet-msbuild/MSBuildLogger.cs @@ -14,7 +14,7 @@ namespace Microsoft.DotNet.Tools.MSBuild public sealed class MSBuildLogger : Logger { private readonly IFirstTimeUseNoticeSentinel _sentinel = - new FirstTimeUseNoticeSentinel(new CliFallbackFolderPathCalculator()); + new FirstTimeUseNoticeSentinel(new CliFolderPathCalculator()); private readonly ITelemetry _telemetry; private const string NewEventName = "msbuild"; private const string TargetFrameworkTelemetryEventName = "targetframeworkeval"; diff --git a/src/dotnet/commands/dotnet-new/NewCommandShim.cs b/src/dotnet/commands/dotnet-new/NewCommandShim.cs index 4b92bdaa8..8c0c2acd4 100644 --- a/src/dotnet/commands/dotnet-new/NewCommandShim.cs +++ b/src/dotnet/commands/dotnet-new/NewCommandShim.cs @@ -32,7 +32,7 @@ namespace Microsoft.DotNet.Tools.New var sessionId = Environment.GetEnvironmentVariable(MSBuildForwardingApp.TelemetrySessionIdEnvironmentVariableName); var telemetry = - new Telemetry(new FirstTimeUseNoticeSentinel(new CliFallbackFolderPathCalculator()), sessionId); + new Telemetry(new FirstTimeUseNoticeSentinel(new CliFolderPathCalculator()), sessionId); var logger = new TelemetryLogger(null); if (telemetry.Enabled) diff --git a/src/dotnet/commands/dotnet-pack/LocalizableStrings.resx b/src/dotnet/commands/dotnet-pack/LocalizableStrings.resx index d297d15e2..58ac50f04 100644 --- a/src/dotnet/commands/dotnet-pack/LocalizableStrings.resx +++ b/src/dotnet/commands/dotnet-pack/LocalizableStrings.resx @@ -130,7 +130,7 @@ Directory in which to place built packages. - Skip building the project prior to packing. By default, the project will be built. + Do not build project before packing. Implies --no-restore. Include packages with symbols in addition to regular packages in output directory. diff --git a/src/dotnet/commands/dotnet-pack/PackCommand.cs b/src/dotnet/commands/dotnet-pack/PackCommand.cs index a781fe254..6aa36b73e 100644 --- a/src/dotnet/commands/dotnet-pack/PackCommand.cs +++ b/src/dotnet/commands/dotnet-pack/PackCommand.cs @@ -43,7 +43,7 @@ namespace Microsoft.DotNet.Tools.Pack msbuildArgs.AddRange(parsedPack.Arguments); - bool noRestore = parsedPack.HasOption("--no-restore"); + bool noRestore = parsedPack.HasOption("--no-restore") || parsedPack.HasOption("--no-build"); return new PackCommand( msbuildArgs, diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.cs.xlf index 85c8ccece..e47c9374d 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.cs.xlf @@ -23,8 +23,8 @@ - Skip building the project prior to packing. By default, the project will be built. - Přeskočí sestavení projektu, dokud ho nezabalíte. Projekt se sestaví automaticky. + Do not build project before packing. Implies --no-restore. + Přeskočí sestavení projektu, dokud ho nezabalíte. Projekt se sestaví automaticky. diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.de.xlf index 9a72dc7b1..f17726346 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.de.xlf @@ -23,8 +23,8 @@ - Skip building the project prior to packing. By default, the project will be built. - Hiermit wird das Projekt nicht vor dem Packen erstellt. Standardmäßig wird das Projekt erstellt. + Do not build project before packing. Implies --no-restore. + Hiermit wird das Projekt nicht vor dem Packen erstellt. Standardmäßig wird das Projekt erstellt. diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.es.xlf index 46223a4b2..571c84f60 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.es.xlf @@ -23,8 +23,8 @@ - Skip building the project prior to packing. By default, the project will be built. - Omita la compilación del proyecto antes de empaquetar. El proyecto se compilará de manera predeterminada. + Do not build project before packing. Implies --no-restore. + Omita la compilación del proyecto antes de empaquetar. El proyecto se compilará de manera predeterminada. diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.fr.xlf index e30934547..63e283824 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.fr.xlf @@ -23,8 +23,8 @@ - Skip building the project prior to packing. By default, the project will be built. - Ignorez la génération du projet avant la compression. Par défaut, le projet est généré. + Do not build project before packing. Implies --no-restore. + Ignorez la génération du projet avant la compression. Par défaut, le projet est généré. diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.it.xlf index d6fde8790..719bb384b 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.it.xlf @@ -23,8 +23,8 @@ - Skip building the project prior to packing. By default, the project will be built. - Consente di ignorare la compilazione del progetto prima di creare il pacchetto. Per impostazione predefinita, il progetto verrà compilato. + Do not build project before packing. Implies --no-restore. + Consente di ignorare la compilazione del progetto prima di creare il pacchetto. Per impostazione predefinita, il progetto verrà compilato. diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ja.xlf index 32500da1a..274d56557 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ja.xlf @@ -23,8 +23,8 @@ - Skip building the project prior to packing. By default, the project will be built. - パッキングの前に、プロジェクトの構築をスキップします。既定では、プロジェクトは構築されます。 + Do not build project before packing. Implies --no-restore. + パッキングの前に、プロジェクトの構築をスキップします。既定では、プロジェクトは構築されます。 diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ko.xlf index 134bb3f08..be5531232 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ko.xlf @@ -23,8 +23,8 @@ - Skip building the project prior to packing. By default, the project will be built. - 압축하기 전에 프로젝트를 빌드하지 않습니다. 기본적으로 프로젝트가 빌드됩니다. + Do not build project before packing. Implies --no-restore. + 압축하기 전에 프로젝트를 빌드하지 않습니다. 기본적으로 프로젝트가 빌드됩니다. diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pl.xlf index 65a8a64ab..5f1d77a40 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pl.xlf @@ -23,8 +23,8 @@ - Skip building the project prior to packing. By default, the project will be built. - Pomiń kompilację projektu przed pakowaniem. Domyślnie projekt zostanie skompilowany. + Do not build project before packing. Implies --no-restore. + Pomiń kompilację projektu przed pakowaniem. Domyślnie projekt zostanie skompilowany. 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 fd7dd4b59..e360f927b 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pt-BR.xlf @@ -23,8 +23,8 @@ - Skip building the project prior to packing. By default, the project will be built. - Ignorar a compilação do projeto antes do empacotamento. Por padrão, o projeto será compilado. + Do not build project before packing. Implies --no-restore. + Ignorar a compilação do projeto antes do empacotamento. Por padrão, o projeto será compilado. diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ru.xlf index 36c29f987..f8fdb23d3 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ru.xlf @@ -23,8 +23,8 @@ - Skip building the project prior to packing. By default, the project will be built. - Пропуск сборки проекта перед упаковкой. По умолчанию выполняется сборка проекта. + Do not build project before packing. Implies --no-restore. + Пропуск сборки проекта перед упаковкой. По умолчанию выполняется сборка проекта. diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.tr.xlf index 0e6d13a56..87e5239d2 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.tr.xlf @@ -23,8 +23,8 @@ - Skip building the project prior to packing. By default, the project will be built. - Projeyi paketlemeden önce derlemeyi atlayın. Varsayılan olarak, proje derlenir. + Do not build project before packing. Implies --no-restore. + Projeyi paketlemeden önce derlemeyi atlayın. Varsayılan olarak, proje derlenir. 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 e45821421..67c059863 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hans.xlf @@ -23,8 +23,8 @@ - Skip building the project prior to packing. By default, the project will be built. - 在打包之前跳过生成项目。默认情况下,将生成项目。 + Do not build project before packing. Implies --no-restore. + 在打包之前跳过生成项目。默认情况下,将生成项目。 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 4f8d86032..f51450f97 100644 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hant.xlf @@ -23,8 +23,8 @@ - Skip building the project prior to packing. By default, the project will be built. - 在封裝前跳過建置專案。預設會建置專案。 + Do not build project before packing. Implies --no-restore. + 在封裝前跳過建置專案。預設會建置專案。 diff --git a/src/dotnet/commands/dotnet-run/LocalizableStrings.resx b/src/dotnet/commands/dotnet-run/LocalizableStrings.resx index a939d42a8..c9676caa0 100644 --- a/src/dotnet/commands/dotnet-run/LocalizableStrings.resx +++ b/src/dotnet/commands/dotnet-run/LocalizableStrings.resx @@ -124,14 +124,11 @@ Command used to run .NET apps - Skip building the project prior to running. By default, the project will be built. + Do not build project before running. Implies --no-restore. Build and run the app using the specified framework. The framework has to be specified in the project file. - - Do not build the project before running. - The path to the project file to run (defaults to the current directory if there is only one project). diff --git a/src/dotnet/commands/dotnet-run/RunCommandParser.cs b/src/dotnet/commands/dotnet-run/RunCommandParser.cs index a89a4dc3d..7ed8e64b2 100644 --- a/src/dotnet/commands/dotnet-run/RunCommandParser.cs +++ b/src/dotnet/commands/dotnet-run/RunCommandParser.cs @@ -26,7 +26,7 @@ namespace Microsoft.DotNet.Cli project: o.SingleArgumentOrDefault("--project"), launchProfile: o.SingleArgumentOrDefault("--launch-profile"), noLaunchProfile: o.HasOption("--no-launch-profile"), - noRestore: o.HasOption("--no-restore"), + noRestore: o.HasOption("--no-restore") || o.HasOption("--no-build"), restoreArgs: o.OptionValuesToBeForwarded(), args: o.Arguments )), @@ -51,7 +51,8 @@ namespace Microsoft.DotNet.Cli "--no-build", LocalizableStrings.CommandOptionNoBuildDescription, Accept.NoArguments()), - CommonOptions.NoRestoreOption() + CommonOptions.NoRestoreOption(), + CommonOptions.VerbosityOption() }); } } \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.cs.xlf index ac8c36c54..431f623f9 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.cs.xlf @@ -33,13 +33,8 @@ - Skip building the project prior to running. By default, the project will be built. - Před spuštěním vynechá sestavení projektu. Standardně se projekt sestaví. - - - - Do not build the project before running. - Před spuštěním nesestavovat projekt + Do not build project before running. Implies --no-restore. + Před spuštěním vynechá sestavení projektu. Standardně se projekt sestaví. diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.de.xlf index 6cd88af92..7dbfe2ce4 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.de.xlf @@ -33,13 +33,8 @@ - Skip building the project prior to running. By default, the project will be built. - Überspringen Sie die Erstellung des Projekts vor dem Ausführen. Das Projekt wird standardmäßig erstellt. - - - - Do not build the project before running. - Erstellen Sie das Projekt nicht vor dem Ausführen. + Do not build project before running. Implies --no-restore. + Überspringen Sie die Erstellung des Projekts vor dem Ausführen. Das Projekt wird standardmäßig erstellt. diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.es.xlf index 5b7eae94b..d75ed555a 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.es.xlf @@ -33,13 +33,8 @@ - Skip building the project prior to running. By default, the project will be built. - Omite la compilación del proyecto antes de ejecutarlo. El proyecto se compilará de manera predeterminada. - - - - Do not build the project before running. - No se compila el proyecto antes de ejecutarlo. + Do not build project before running. Implies --no-restore. + Omite la compilación del proyecto antes de ejecutarlo. El proyecto se compilará de manera predeterminada. diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.fr.xlf index 6c1b28f07..3d0ff971a 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.fr.xlf @@ -33,13 +33,8 @@ - Skip building the project prior to running. By default, the project will be built. - Ignorez la génération du projet avant l'exécution. Par défaut, le projet est généré. - - - - Do not build the project before running. - Ne générez pas le projet avant l'exécution. + Do not build project before running. Implies --no-restore. + Ignorez la génération du projet avant l'exécution. Par défaut, le projet est généré. diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.it.xlf index 2d180a233..8e3e538af 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.it.xlf @@ -33,13 +33,8 @@ - Skip building the project prior to running. By default, the project will be built. - Consente di ignorare la compilazione del progetto prima dell'esecuzione. Per impostazione predefinita, il progetto verrà compilato. - - - - Do not build the project before running. - Non compilare il progetto prima dell'esecuzione. + Do not build project before running. Implies --no-restore. + Consente di ignorare la compilazione del progetto prima dell'esecuzione. Per impostazione predefinita, il progetto verrà compilato. diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ja.xlf index dee300d42..dcc5d91d3 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ja.xlf @@ -33,13 +33,8 @@ - Skip building the project prior to running. By default, the project will be built. - 実行の前に、プロジェクトのビルドをスキップします。既定では、プロジェクトはビルドされます。 - - - - Do not build the project before running. - 実行する前にプロジェクトをビルドしません。 + Do not build project before running. Implies --no-restore. + 実行の前に、プロジェクトのビルドをスキップします。既定では、プロジェクトはビルドされます。 diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ko.xlf index b3e5d55c4..d0b480ff8 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ko.xlf @@ -33,13 +33,8 @@ - Skip building the project prior to running. By default, the project will be built. - 실행하기 전에 프로젝트를 빌드하지 않습니다. 기본적으로 프로젝트가 빌드됩니다. - - - - Do not build the project before running. - 실행하기 전에 프로젝트를 빌드하지 않습니다. + Do not build project before running. Implies --no-restore. + 실행하기 전에 프로젝트를 빌드하지 않습니다. 기본적으로 프로젝트가 빌드됩니다. diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pl.xlf index 768e31fd1..39dcedebe 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pl.xlf @@ -33,13 +33,8 @@ - Skip building the project prior to running. By default, the project will be built. - Pomiń kompilację projektu przed uruchomieniem. Domyślnie projekt zostanie skompilowany. - - - - Do not build the project before running. - Nie kompiluj projektu przed uruchomieniem. + Do not build project before running. Implies --no-restore. + Pomiń kompilację projektu przed uruchomieniem. Domyślnie projekt zostanie skompilowany. 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 f398083f8..ee50c4971 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.pt-BR.xlf @@ -33,13 +33,8 @@ - Skip building the project prior to running. By default, the project will be built. - Ignorar a compilação do projeto antes da execução. Por padrão, o projeto será compilado. - - - - Do not build the project before running. - Não compilar o projeto antes da execução. + Do not build project before running. Implies --no-restore. + Ignorar a compilação do projeto antes da execução. Por padrão, o projeto será compilado. diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ru.xlf index cb41939f1..197d17537 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.ru.xlf @@ -33,13 +33,8 @@ - Skip building the project prior to running. By default, the project will be built. - Пропуск сборки проекта перед запуском. По умолчанию выполняется сборка проекта. - - - - Do not build the project before running. - Не выполнять сборку проекта перед запуском. + Do not build project before running. Implies --no-restore. + Пропуск сборки проекта перед запуском. По умолчанию выполняется сборка проекта. diff --git a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.tr.xlf index c38bf1e18..db3f3ec62 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.tr.xlf @@ -33,13 +33,8 @@ - Skip building the project prior to running. By default, the project will be built. - Projeyi çalıştırmadan önce derlemeyi atlayın. Varsayılan olarak, proje derlenir. - - - - Do not build the project before running. - Projeyi çalıştırmadan önce derleme. + Do not build project before running. Implies --no-restore. + Projeyi çalıştırmadan önce derlemeyi atlayın. Varsayılan olarak, proje derlenir. 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 9775bb8bd..5c0a8b2d6 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hans.xlf @@ -33,13 +33,8 @@ - Skip building the project prior to running. By default, the project will be built. - 在运行之前跳过项目生成操作。将默认生成项目。 - - - - Do not build the project before running. - 运行之前不要生成项目。 + Do not build project before running. Implies --no-restore. + 在运行之前跳过项目生成操作。将默认生成项目。 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 6c88ba3c0..a718c8144 100644 --- a/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-run/xlf/LocalizableStrings.zh-Hant.xlf @@ -33,13 +33,8 @@ - Skip building the project prior to running. By default, the project will be built. - 在執行之前跳過建置該專案。根據預設,將會建置該專案。 - - - - Do not build the project before running. - 請勿在執行之前建置專案。 + Do not build project before running. Implies --no-restore. + 在執行之前跳過建置該專案。根據預設,將會建置該專案。 diff --git a/src/dotnet/commands/dotnet-sln/remove/Program.cs b/src/dotnet/commands/dotnet-sln/remove/Program.cs index ce2b88703..973294c6e 100644 --- a/src/dotnet/commands/dotnet-sln/remove/Program.cs +++ b/src/dotnet/commands/dotnet-sln/remove/Program.cs @@ -41,7 +41,7 @@ namespace Microsoft.DotNet.Tools.Sln.Remove SlnFile slnFile = SlnFileFactory.CreateFromFileOrDirectory(_fileOrDirectory); var relativeProjectPaths = _appliedCommand.Arguments.Select(p => - PathUtility.GetRelativePath( + Path.GetRelativePath( PathUtility.EnsureTrailingSlash(slnFile.BaseDirectory), Path.GetFullPath(p))) .ToList(); diff --git a/src/dotnet/commands/dotnet-test/LocalizableStrings.resx b/src/dotnet/commands/dotnet-test/LocalizableStrings.resx index 1ff6b6d07..8d336388a 100644 --- a/src/dotnet/commands/dotnet-test/LocalizableStrings.resx +++ b/src/dotnet/commands/dotnet-test/LocalizableStrings.resx @@ -162,7 +162,9 @@ Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + Examples: + Log in trx format using a unqiue file name: --logger trx + Log in trx format using the specified file name: --logger "trx;LogFileName=<TestResults.trx>" More info on logger arguments support:https://aka.ms/vstest-report @@ -191,7 +193,7 @@ Logs are written to the provided file. - Do not build project before testing. + Do not build project before testing. Implies --no-restore. The directory where the test results are going to be placed. The specified directory will be created if it does not exist. @@ -216,4 +218,7 @@ RunSettings arguments: Enables data collector for the test run. More info here : https://aka.ms/vstest-collect + + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/Program.cs b/src/dotnet/commands/dotnet-test/Program.cs index d714d2f9e..69c7739f6 100644 --- a/src/dotnet/commands/dotnet-test/Program.cs +++ b/src/dotnet/commands/dotnet-test/Program.cs @@ -70,7 +70,7 @@ namespace Microsoft.DotNet.Tools.Test } } - bool noRestore = parsedTest.HasOption("--no-restore"); + bool noRestore = parsedTest.HasOption("--no-restore") || parsedTest.HasOption("--no-build"); return new TestCommand( msbuildArgs, diff --git a/src/dotnet/commands/dotnet-test/TestCommandParser.cs b/src/dotnet/commands/dotnet-test/TestCommandParser.cs index 5afd91272..d6dc05df8 100644 --- a/src/dotnet/commands/dotnet-test/TestCommandParser.cs +++ b/src/dotnet/commands/dotnet-test/TestCommandParser.cs @@ -85,6 +85,11 @@ namespace Microsoft.DotNet.Cli Accept.OneOrMoreArguments() .With(name: LocalizableStrings.cmdCollectFriendlyName) .ForwardAsSingle(o => $"/p:VSTestCollect=\"{string.Join(";", o.Arguments)}\"")), + Create.Option( + "--blame", + LocalizableStrings.CmdBlameDescription, + Accept.NoArguments() + .ForwardAsSingle(o => "/p:VSTestBlame=true")), CommonOptions.NoRestoreOption(), CommonOptions.VerbosityOption()); diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.cs.xlf index f5d414b52..5eccc7329 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.cs.xlf @@ -73,9 +73,11 @@ Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + Examples: + Log in trx format using a unqiue file name: --logger trx + Log in trx format using the specified file name: --logger "trx;LogFileName=<TestResults.trx>" More info on logger arguments support:https://aka.ms/vstest-report - Zadejte protokolovací nástroj pro výsledky testů. + Zadejte protokolovací nástroj pro výsledky testů. Příklad: --logger "trx[;LogFileName=<Standardně se nastaví jedinečný název souboru>]" Další informace o podpoře argumentů protokolovacího nástroje: https://aka.ms/vstest-report @@ -123,8 +125,8 @@ - Do not build project before testing. - Nesestavujte projekt dříve, než ho otestujete. + Do not build project before testing. Implies --no-restore. + Nesestavujte projekt dříve, než ho otestujete. @@ -173,6 +175,11 @@ Argumenty RunSettings: Další informace: https://aka.ms/vstest-collect + + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.de.xlf index ee42ac82e..6ee595be1 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.de.xlf @@ -73,9 +73,11 @@ Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + Examples: + Log in trx format using a unqiue file name: --logger trx + Log in trx format using the specified file name: --logger "trx;LogFileName=<TestResults.trx>" More info on logger arguments support:https://aka.ms/vstest-report - Geben Sie eine Protokollierung für Testergebnisse an. + Geben Sie eine Protokollierung für Testergebnisse an. Beispiel: --logger "trx[;LogFileName=<Standardmäßig der eindeutige Dateiname>]" Weitere Informationen zur Unterstützung von Protokollierungsargumenten: https://aka.ms/vstest-report @@ -123,8 +125,8 @@ - Do not build project before testing. - Erstellen Sie das Projekt nicht vor dem Testen. + Do not build project before testing. Implies --no-restore. + Erstellen Sie das Projekt nicht vor dem Testen. @@ -173,6 +175,11 @@ RunSettings-Argumente: Weitere Informationen finden Sie hier: https://aka.ms/vstest-collect + + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.es.xlf index d50458ccc..cf343bec2 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.es.xlf @@ -73,9 +73,11 @@ Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + Examples: + Log in trx format using a unqiue file name: --logger trx + Log in trx format using the specified file name: --logger "trx;LogFileName=<TestResults.trx>" More info on logger arguments support:https://aka.ms/vstest-report - Especifica un registrador para los resultados de prueba. + Especifica un registrador para los resultados de prueba. Ejemplo: --logger "trx[;LogFileName=<Adopta como valor predeterminado un nombre de archivo único>]" Más información sobre la compatibilidad con los argumentos de registrador: https://aka.ms/vstest-report @@ -123,8 +125,8 @@ - Do not build project before testing. - El proyecto no se compila antes de probarlo. + Do not build project before testing. Implies --no-restore. + El proyecto no se compila antes de probarlo. @@ -173,6 +175,11 @@ Argumentos RunSettings: Más información aquí: https://aka.ms/vstest-collect + + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.fr.xlf index 488c2a39a..57e4efeb1 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.fr.xlf @@ -73,9 +73,11 @@ Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + Examples: + Log in trx format using a unqiue file name: --logger trx + Log in trx format using the specified file name: --logger "trx;LogFileName=<TestResults.trx>" More info on logger arguments support:https://aka.ms/vstest-report - Spécifiez un enregistreur d'événements pour les résultats des tests. + Spécifiez un enregistreur d'événements pour les résultats des tests. Exemple : --logger "trx[;LogFileName=<Nom de fichier unique par défaut>]" En savoir plus sur la prise en charge des arguments de l'enregistreur d'événements : https://aka.ms/vstest-report @@ -123,8 +125,8 @@ - Do not build project before testing. - Ne générez pas le projet avant les tests. + Do not build project before testing. Implies --no-restore. + Ne générez pas le projet avant les tests. @@ -173,6 +175,11 @@ Arguments de RunSettings : Plus d'informations ici : https://aka.ms/vstest-collect + + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.it.xlf index 6baa3d8a9..ad28514b2 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.it.xlf @@ -73,9 +73,11 @@ Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + Examples: + Log in trx format using a unqiue file name: --logger trx + Log in trx format using the specified file name: --logger "trx;LogFileName=<TestResults.trx>" More info on logger arguments support:https://aka.ms/vstest-report - Consente di specificare un logger per i risultati dei test. + Consente di specificare un logger per i risultati dei test. Esempio: --logger "trx[;LogFileName=<l'impostazione predefinita è un nome file univoco>]" Per altre informazioni sul supporto degli argomenti del logger, vedere: https://aka.ms/vstest-report @@ -123,8 +125,8 @@ - Do not build project before testing. - Il progetto non viene compilato prima del test. + Do not build project before testing. Implies --no-restore. + Il progetto non viene compilato prima del test. @@ -173,6 +175,11 @@ Argomenti di RunSettings: Per altre informazioni, vedere: https://aka.ms/vstest-collect + + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ja.xlf index 18139bb2a..6ca09f209 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ja.xlf @@ -73,9 +73,11 @@ Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + Examples: + Log in trx format using a unqiue file name: --logger trx + Log in trx format using the specified file name: --logger "trx;LogFileName=<TestResults.trx>" More info on logger arguments support:https://aka.ms/vstest-report - テスト結果のロガーを指定します。 + テスト結果のロガーを指定します。 例: --logger "trx[;LogFileName=<Defaults to unique file name>]" ロガー引数サポートの詳細:https://aka.ms/vstest-report @@ -123,8 +125,8 @@ - Do not build project before testing. - テストする前にプロジェクトを構築しないでください。 + Do not build project before testing. Implies --no-restore. + テストする前にプロジェクトを構築しないでください。 @@ -173,6 +175,11 @@ RunSettings 引数: 詳細情報: https://aka.ms/vstest-collect + + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ko.xlf index 76e80193b..cf0ef9eef 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ko.xlf @@ -73,9 +73,11 @@ Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + Examples: + Log in trx format using a unqiue file name: --logger trx + Log in trx format using the specified file name: --logger "trx;LogFileName=<TestResults.trx>" More info on logger arguments support:https://aka.ms/vstest-report - 테스트 결과에 대해 로거를 지정합니다. + 테스트 결과에 대해 로거를 지정합니다. 예: --logger "trx[;LogFileName=<고유한 파일 이름을 기본값으로 설정>]" 로거 인수 지원에 대한 추가 정보: https://aka.ms/vstest-report @@ -123,8 +125,8 @@ - Do not build project before testing. - 테스트하기 전에 프로젝트를 빌드하지 않습니다. + Do not build project before testing. Implies --no-restore. + 테스트하기 전에 프로젝트를 빌드하지 않습니다. @@ -173,6 +175,11 @@ RunSettings 인수: 자세한 정보: https://aka.ms/vstest-collect + + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pl.xlf index eb78cae41..0f0b15bb4 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pl.xlf @@ -73,9 +73,11 @@ Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + Examples: + Log in trx format using a unqiue file name: --logger trx + Log in trx format using the specified file name: --logger "trx;LogFileName=<TestResults.trx>" More info on logger arguments support:https://aka.ms/vstest-report - Określ rejestrator wyników testów. + Określ rejestrator wyników testów. Przykład: --logger "trx[;LogFileName=<domyślnie jest to unikatowa nazwa pliku>]" Więcej informacji o obsłudze argumentów rejestratora: https://aka.ms/vstest-report @@ -123,8 +125,8 @@ - Do not build project before testing. - Nie kompiluj projektu przed przeprowadzeniem testów. + Do not build project before testing. Implies --no-restore. + Nie kompiluj projektu przed przeprowadzeniem testów. @@ -173,6 +175,11 @@ Argumenty RunSettings: Więcej informacji można znaleźć tutaj: https://aka.ms/vstest-collect + + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + + \ No newline at end of file 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 24ab9fbb7..35315e4c8 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.pt-BR.xlf @@ -73,9 +73,11 @@ Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + Examples: + Log in trx format using a unqiue file name: --logger trx + Log in trx format using the specified file name: --logger "trx;LogFileName=<TestResults.trx>" More info on logger arguments support:https://aka.ms/vstest-report - Especifique um agente para os resultados de teste. + Especifique um agente para os resultados de teste. Exemplo: --logger "trx[;LogFileName=<Defaults to unique file name>]" Mais informações sobre suporte a argumentos de agente: https://aka.ms/vstest-report @@ -123,8 +125,8 @@ - Do not build project before testing. - Não compile o projeto antes de testar. + Do not build project before testing. Implies --no-restore. + Não compile o projeto antes de testar. @@ -173,6 +175,11 @@ Argumentos RunSettings: Mais informações aqui: https://aka.ms/vstest-collect + + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ru.xlf index 977af9974..3605ef2e4 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.ru.xlf @@ -73,9 +73,11 @@ Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + Examples: + Log in trx format using a unqiue file name: --logger trx + Log in trx format using the specified file name: --logger "trx;LogFileName=<TestResults.trx>" More info on logger arguments support:https://aka.ms/vstest-report - Укажите средство ведения журнала для результатов теста. + Укажите средство ведения журнала для результатов теста. Пример: --logger "trx[;LogFileName=<по умолчанию используется уникальное имя файла>]" Дополнительные сведения о поддержке аргументов средства ведения журнала: https://aka.ms/vstest-report @@ -123,8 +125,8 @@ - Do not build project before testing. - Не выполнять сборку проектов перед тестированием. + Do not build project before testing. Implies --no-restore. + Не выполнять сборку проектов перед тестированием. @@ -173,6 +175,11 @@ RunSettings arguments: Дополнительные сведения: https://aka.ms/vstest-collect + + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.tr.xlf index a6d961ac2..480bfe8af 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.tr.xlf @@ -73,9 +73,11 @@ Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + Examples: + Log in trx format using a unqiue file name: --logger trx + Log in trx format using the specified file name: --logger "trx;LogFileName=<TestResults.trx>" More info on logger arguments support:https://aka.ms/vstest-report - Test sonuçları için bir günlükçü belirtin. + Test sonuçları için bir günlükçü belirtin. Örnek: --logger "trx[;LogFileName=<Varsayılan olarak benzersiz dosya adı kullanılır>]" Günlükçü bağımsız değişkenleri desteği hakkında daha fazla bilgi: https://aka.ms/vstest-report @@ -123,8 +125,8 @@ - Do not build project before testing. - Projeyi derlemeden önce test edin. + Do not build project before testing. Implies --no-restore. + Projeyi derlemeden önce test edin. @@ -173,6 +175,11 @@ RunSettings bağımsız değişkenleri: Daha fazla bilgi için bkz. https://aka.ms/vstest-collect + + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + + \ No newline at end of file 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 0f365ad49..6992b6683 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.zh-Hans.xlf @@ -73,9 +73,11 @@ Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + Examples: + Log in trx format using a unqiue file name: --logger trx + Log in trx format using the specified file name: --logger "trx;LogFileName=<TestResults.trx>" More info on logger arguments support:https://aka.ms/vstest-report - 指定测试结果的记录器。 + 指定测试结果的记录器。 示例: --logger "trx[;LogFileName=<Defaults to unique file name>]" 有关记录器参数的详细信息,请访问 support:https://aka.ms/vstest-report @@ -123,8 +125,8 @@ - Do not build project before testing. - 测试之前不要生成项目。 + Do not build project before testing. Implies --no-restore. + 测试之前不要生成项目。 @@ -173,6 +175,11 @@ RunSettings 参数: 有关详细信息,请访问: https://aka.ms/vstest-collect + + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + + \ No newline at end of file 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 e3af79f81..35e49489c 100644 --- a/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-test/xlf/LocalizableStrings.zh-Hant.xlf @@ -73,9 +73,11 @@ Specify a logger for test results. - Example: --logger "trx[;LogFileName=<Defaults to unique file name>]" + Examples: + Log in trx format using a unqiue file name: --logger trx + Log in trx format using the specified file name: --logger "trx;LogFileName=<TestResults.trx>" More info on logger arguments support:https://aka.ms/vstest-report - 指定測試結果的記錄器。 + 指定測試結果的記錄器。 範例: --logger "trx[;LogFileName=<預設為唯一的檔案名稱>]" 記錄器引數支援的詳細資訊: https://aka.ms/vstest-report @@ -123,8 +125,8 @@ - Do not build project before testing. - 請勿在測試前建置專案。 + Do not build project before testing. Implies --no-restore. + 請勿在測試前建置專案。 @@ -173,6 +175,11 @@ RunSettings 引數: 如需詳細資訊,請參閱: https://aka.ms/vstest-collect + + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + Runs the test in blame mode. This option is helpful in isolating the problematic test causing test host crash. It creates an output file in the current directory as "Sequence.xml", that captures the order of execution of test before the crash. + + \ No newline at end of file diff --git a/src/dotnet/dotnet.csproj b/src/dotnet/dotnet.csproj index 71da96676..f0c913b9d 100644 --- a/src/dotnet/dotnet.csproj +++ b/src/dotnet/dotnet.csproj @@ -1,14 +1,13 @@  - $(SdkVersion) - netcoreapp2.0 + $(CliTargetFramework) dotnet Exe ../../tools/Key.snk true true - $(AssetTargetFallback);dotnet5.4 + dotnet5.4 Microsoft.DotNet.Cli @@ -44,7 +43,6 @@ - @@ -68,6 +66,7 @@ + diff --git a/src/redist/redist.csproj b/src/redist/redist.csproj index dcfa97725..524687064 100644 --- a/src/redist/redist.csproj +++ b/src/redist/redist.csproj @@ -1,16 +1,15 @@  - - + $(CliVersionPrefix) - netcoreapp2.0 + $(CliTargetFramework) $(CLI_SharedFrameworkVersion) true false - $(AssetTargetFallback);dotnet5.4 + dotnet5.4 $(SdkOutputDirectory) $(CommitCount) @@ -28,7 +27,6 @@ - @@ -94,7 +92,7 @@ ReplacementPatterns="$(ReplacementPattern)" ReplacementStrings="$(ReplacementString)" /> @@ -104,7 +102,7 @@ - @@ -183,7 +181,7 @@ SdkLayoutDirectory=$(SdkOutputDirectory)/Sdks/%(BundledSdk.Identity); DependencyPackageName=%(BundledSdk.Identity); DependencyPackageVersion=%(BundledSdk.Version); - Stage0Directory=$(Stage0Directory) + PreviousStageDirectory=$(PreviousStageDirectory) @@ -202,7 +200,7 @@ TemplateLayoutDirectory=$(SdkOutputDirectory)/Templates; TemplatePackageName=%(BundledTemplate.Identity); TemplatePackageVersion=%(BundledTemplate.Version); - Stage0Directory=$(Stage0Directory) + PreviousStageDirectory=$(PreviousStageDirectory)
@@ -221,7 +219,7 @@ + AfterTargets="PublishSdks"> @@ -230,13 +228,15 @@ + + + + + - - - @@ -298,7 +298,7 @@ CreateSymbols="$(CreateCrossgenSymbols)" DiasymReaderPath="@(DiasymReaderPath)" PlatformAssemblyPaths="@(PlatformAssemblies);@(FSharpFolders);$(SharedFrameworkNameVersionPath)" /> - + - - + $(CliVersionPrefix) - netcoreapp2.0 + $(CliTargetFramework) true $(FSharpDirectory) $(CommitCount) @@ -14,6 +13,7 @@ + @@ -36,10 +36,15 @@ SectionName="%(AssetsToRemoveFromDeps.SectionName)" AssetPath="%(AssetsToRemoveFromDeps.Identity)" /> + + - $(CliVersionPrefix) diff --git a/src/tool_nuget/tool_nuget.csproj b/src/tool_nuget/tool_nuget.csproj index 5a4e4121f..9d00b23cb 100644 --- a/src/tool_nuget/tool_nuget.csproj +++ b/src/tool_nuget/tool_nuget.csproj @@ -1,5 +1,4 @@  - $(CliVersionPrefix) diff --git a/src/tool_roslyn_satellites/tool_roslyn_satellites.csproj b/src/tool_roslyn_satellites/tool_roslyn_satellites.csproj index d42c632b0..daad81747 100644 --- a/src/tool_roslyn_satellites/tool_roslyn_satellites.csproj +++ b/src/tool_roslyn_satellites/tool_roslyn_satellites.csproj @@ -1,5 +1,4 @@ - diff --git a/test/ArgumentForwardingTests/ArgumentForwardingTests.csproj b/test/ArgumentForwardingTests/ArgumentForwardingTests.csproj index c71c5cf15..3227ead22 100644 --- a/test/ArgumentForwardingTests/ArgumentForwardingTests.csproj +++ b/test/ArgumentForwardingTests/ArgumentForwardingTests.csproj @@ -1,5 +1,4 @@  - $(CliTargetFramework) @@ -15,16 +14,17 @@
- - - + + + - + + diff --git a/test/ArgumentsReflector/ArgumentsReflector.csproj b/test/ArgumentsReflector/ArgumentsReflector.csproj index 4ad634f31..012295b52 100644 --- a/test/ArgumentsReflector/ArgumentsReflector.csproj +++ b/test/ArgumentsReflector/ArgumentsReflector.csproj @@ -1,5 +1,4 @@  - $(CliTargetFramework) diff --git a/test/dir.props b/test/Directory.Build.props similarity index 83% rename from test/dir.props rename to test/Directory.Build.props index 8d5c8cc42..406c4f8c1 100644 --- a/test/dir.props +++ b/test/Directory.Build.props @@ -1,5 +1,5 @@ - + false diff --git a/test/EndToEnd/EndToEnd.csproj b/test/EndToEnd/EndToEnd.csproj index 83c4a521a..5eb588bef 100644 --- a/test/EndToEnd/EndToEnd.csproj +++ b/test/EndToEnd/EndToEnd.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -22,10 +20,9 @@
- - - - + + + diff --git a/test/EndToEnd/GivenDotNetUsesMSBuild.cs b/test/EndToEnd/GivenDotNetUsesMSBuild.cs index f714ee38c..9c79fb94e 100644 --- a/test/EndToEnd/GivenDotNetUsesMSBuild.cs +++ b/test/EndToEnd/GivenDotNetUsesMSBuild.cs @@ -19,7 +19,7 @@ namespace Microsoft.DotNet.Tests.EndToEnd { string projectDirectory = directory.Path; - string newArgs = "console -f netcoreapp2.0 --debug:ephemeral-hive --no-restore"; + string newArgs = "console -f netcoreapp2.1 --debug:ephemeral-hive --no-restore"; new NewCommandShim() .WithWorkingDirectory(projectDirectory) .Execute(newArgs) @@ -112,7 +112,7 @@ namespace Microsoft.DotNet.Tests.EndToEnd new DotnetCommand(DotnetUnderTest.WithBackwardsCompatibleRuntimes) .WithWorkingDirectory(testProjectDirectory) .ExecuteWithCapturedOutput( - $"-d dependency-tool-invoker -c {configuration} -f netcoreapp2.0 portable") + $"-d dependency-tool-invoker -c {configuration} -f netcoreapp2.1 portable") .Should().Pass() .And.HaveStdOutContaining("Hello Portable World!");; } diff --git a/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/Microsoft.DotNet.Cli.Msi.Tests.csproj b/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/Microsoft.DotNet.Cli.Msi.Tests.csproj index e576ed679..17220aaf1 100644 --- a/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/Microsoft.DotNet.Cli.Msi.Tests.csproj +++ b/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/Microsoft.DotNet.Cli.Msi.Tests.csproj @@ -1,6 +1,4 @@  - - net46 true @@ -17,8 +15,8 @@ - - + + diff --git a/test/Installer/testmsi.ps1 b/test/Installer/testmsi.ps1 index 198999c78..47db57c58 100644 --- a/test/Installer/testmsi.ps1 +++ b/test/Installer/testmsi.ps1 @@ -3,7 +3,8 @@ param( [string]$InputMsi, - [string]$DotnetDir + [string]$DotnetDir, + [string]$TestDir ) . "$PSScriptRoot\..\..\scripts\common\_common.ps1" @@ -37,7 +38,7 @@ if(!(Test-Path $inputMsi)) $testName = "Microsoft.DotNet.Cli.Msi.Tests" $testProj="$PSScriptRoot\$testName\$testName.csproj" -$testBin="$RepoRoot\artifacts\tests\$testName" +$testBin="$TestDir\$testName" pushd "$DotnetDir" diff --git a/test/Microsoft.DotNet.Cli.Sln.Internal.Tests/Microsoft.DotNet.Cli.Sln.Internal.Tests.csproj b/test/Microsoft.DotNet.Cli.Sln.Internal.Tests/Microsoft.DotNet.Cli.Sln.Internal.Tests.csproj index 0cc22883c..d06acedaf 100644 --- a/test/Microsoft.DotNet.Cli.Sln.Internal.Tests/Microsoft.DotNet.Cli.Sln.Internal.Tests.csproj +++ b/test/Microsoft.DotNet.Cli.Sln.Internal.Tests/Microsoft.DotNet.Cli.Sln.Internal.Tests.csproj @@ -1,6 +1,4 @@ - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -17,13 +15,13 @@ - +
- - - + + + \ No newline at end of file diff --git a/test/Microsoft.DotNet.Cli.Tests.sln b/test/Microsoft.DotNet.Cli.Tests.sln index c3d64f5d7..5f0d406d3 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.26419.0 +VisualStudioVersion = 15.0.27004.2008 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 @@ -74,11 +74,17 @@ 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}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-remove-package.Tests", "dotnet-remove-package.Tests\dotnet-remove-package.Tests.csproj", "{CF517B15-B307-4660-87D5-CC036ADECD4B}" 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 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dotnet-clean.Tests", "dotnet-clean.Tests\dotnet-clean.Tests.csproj", "{D9A582B8-1FE2-45D5-B139-0BA828FE3691}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-clean.Tests", "dotnet-clean.Tests\dotnet-clean.Tests.csproj", "{D9A582B8-1FE2-45D5-B139-0BA828FE3691}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.TestFramework", "Microsoft.DotNet.TestFramework\Microsoft.DotNet.TestFramework.csproj", "{D23AFC9C-8FD5-45DD-A84C-0E6528C42F0E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.ToolPackageObtainer.Tests", "Microsoft.DotNet.ToolPackageObtainer.Tests\Microsoft.DotNet.ToolPackageObtainer.Tests.csproj", "{C2A907A3-677B-4C73-9AA4-E53613E13C78}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.ShellShimMaker.Tests", "Microsoft.DotNet.ShellShimMaker.Tests\Microsoft.DotNet.ShellShimMaker.Tests.csproj", "{1146EAAC-E434-404A-8198-B4F0CB23BC57}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -488,16 +494,16 @@ Global {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}.Debug|x64.ActiveCfg = Debug|Any CPU + {CF517B15-B307-4660-87D5-CC036ADECD4B}.Debug|x64.Build.0 = Debug|Any CPU + {CF517B15-B307-4660-87D5-CC036ADECD4B}.Debug|x86.ActiveCfg = Debug|Any CPU + {CF517B15-B307-4660-87D5-CC036ADECD4B}.Debug|x86.Build.0 = Debug|Any CPU {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 + {CF517B15-B307-4660-87D5-CC036ADECD4B}.Release|x64.ActiveCfg = Release|Any CPU + {CF517B15-B307-4660-87D5-CC036ADECD4B}.Release|x64.Build.0 = Release|Any CPU + {CF517B15-B307-4660-87D5-CC036ADECD4B}.Release|x86.ActiveCfg = Release|Any CPU + {CF517B15-B307-4660-87D5-CC036ADECD4B}.Release|x86.Build.0 = Release|Any CPU {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 @@ -512,16 +518,52 @@ Global {42A0CAB4-FFAD-47D4-9880-C0F4EDCF93DE}.Release|x86.Build.0 = Release|Any CPU {D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Debug|x64.ActiveCfg = Debug|x64 - {D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Debug|x64.Build.0 = Debug|x64 - {D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Debug|x86.ActiveCfg = Debug|x86 - {D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Debug|x86.Build.0 = Debug|x86 + {D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Debug|x64.ActiveCfg = Debug|Any CPU + {D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Debug|x64.Build.0 = Debug|Any CPU + {D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Debug|x86.ActiveCfg = Debug|Any CPU + {D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Debug|x86.Build.0 = Debug|Any CPU {D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Release|Any CPU.ActiveCfg = Release|Any CPU {D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Release|Any CPU.Build.0 = Release|Any CPU - {D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Release|x64.ActiveCfg = Release|x64 - {D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Release|x64.Build.0 = Release|x64 - {D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Release|x86.ActiveCfg = Release|x86 - {D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Release|x86.Build.0 = Release|x86 + {D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Release|x64.ActiveCfg = Release|Any CPU + {D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Release|x64.Build.0 = Release|Any CPU + {D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Release|x86.ActiveCfg = Release|Any CPU + {D9A582B8-1FE2-45D5-B139-0BA828FE3691}.Release|x86.Build.0 = Release|Any CPU + {D23AFC9C-8FD5-45DD-A84C-0E6528C42F0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D23AFC9C-8FD5-45DD-A84C-0E6528C42F0E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D23AFC9C-8FD5-45DD-A84C-0E6528C42F0E}.Debug|x64.ActiveCfg = Debug|Any CPU + {D23AFC9C-8FD5-45DD-A84C-0E6528C42F0E}.Debug|x64.Build.0 = Debug|Any CPU + {D23AFC9C-8FD5-45DD-A84C-0E6528C42F0E}.Debug|x86.ActiveCfg = Debug|Any CPU + {D23AFC9C-8FD5-45DD-A84C-0E6528C42F0E}.Debug|x86.Build.0 = Debug|Any CPU + {D23AFC9C-8FD5-45DD-A84C-0E6528C42F0E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D23AFC9C-8FD5-45DD-A84C-0E6528C42F0E}.Release|Any CPU.Build.0 = Release|Any CPU + {D23AFC9C-8FD5-45DD-A84C-0E6528C42F0E}.Release|x64.ActiveCfg = Release|Any CPU + {D23AFC9C-8FD5-45DD-A84C-0E6528C42F0E}.Release|x64.Build.0 = Release|Any CPU + {D23AFC9C-8FD5-45DD-A84C-0E6528C42F0E}.Release|x86.ActiveCfg = Release|Any CPU + {D23AFC9C-8FD5-45DD-A84C-0E6528C42F0E}.Release|x86.Build.0 = Release|Any CPU + {C2A907A3-677B-4C73-9AA4-E53613E13C78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C2A907A3-677B-4C73-9AA4-E53613E13C78}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C2A907A3-677B-4C73-9AA4-E53613E13C78}.Debug|x64.ActiveCfg = Debug|Any CPU + {C2A907A3-677B-4C73-9AA4-E53613E13C78}.Debug|x64.Build.0 = Debug|Any CPU + {C2A907A3-677B-4C73-9AA4-E53613E13C78}.Debug|x86.ActiveCfg = Debug|Any CPU + {C2A907A3-677B-4C73-9AA4-E53613E13C78}.Debug|x86.Build.0 = Debug|Any CPU + {C2A907A3-677B-4C73-9AA4-E53613E13C78}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C2A907A3-677B-4C73-9AA4-E53613E13C78}.Release|Any CPU.Build.0 = Release|Any CPU + {C2A907A3-677B-4C73-9AA4-E53613E13C78}.Release|x64.ActiveCfg = Release|Any CPU + {C2A907A3-677B-4C73-9AA4-E53613E13C78}.Release|x64.Build.0 = Release|Any CPU + {C2A907A3-677B-4C73-9AA4-E53613E13C78}.Release|x86.ActiveCfg = Release|Any CPU + {C2A907A3-677B-4C73-9AA4-E53613E13C78}.Release|x86.Build.0 = Release|Any CPU + {1146EAAC-E434-404A-8198-B4F0CB23BC57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1146EAAC-E434-404A-8198-B4F0CB23BC57}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1146EAAC-E434-404A-8198-B4F0CB23BC57}.Debug|x64.ActiveCfg = Debug|Any CPU + {1146EAAC-E434-404A-8198-B4F0CB23BC57}.Debug|x64.Build.0 = Debug|Any CPU + {1146EAAC-E434-404A-8198-B4F0CB23BC57}.Debug|x86.ActiveCfg = Debug|Any CPU + {1146EAAC-E434-404A-8198-B4F0CB23BC57}.Debug|x86.Build.0 = Debug|Any CPU + {1146EAAC-E434-404A-8198-B4F0CB23BC57}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1146EAAC-E434-404A-8198-B4F0CB23BC57}.Release|Any CPU.Build.0 = Release|Any CPU + {1146EAAC-E434-404A-8198-B4F0CB23BC57}.Release|x64.ActiveCfg = Release|Any CPU + {1146EAAC-E434-404A-8198-B4F0CB23BC57}.Release|x64.Build.0 = Release|Any CPU + {1146EAAC-E434-404A-8198-B4F0CB23BC57}.Release|x86.ActiveCfg = Release|Any CPU + {1146EAAC-E434-404A-8198-B4F0CB23BC57}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -531,4 +573,7 @@ Global {5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF} = {15DDC326-69C3-4081-8AA1-B578B2BDE2C6} {92BA9F90-E25B-4A1C-9598-2295D3DFC12F} = {BB393A93-1770-4753-B7D6-56F0DD378177} EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7AF6777A-0133-453A-B302-FDD974B8F39C} + EndGlobalSection EndGlobal diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectDependenciesCommandFactory.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectDependenciesCommandFactory.cs index 109a449fc..a3f5976f5 100644 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectDependenciesCommandFactory.cs +++ b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectDependenciesCommandFactory.cs @@ -8,6 +8,7 @@ using Microsoft.DotNet.TestFramework; using Microsoft.DotNet.Tools.Test.Utilities; using NuGet.Frameworks; using Xunit; +using Microsoft.DotNet.Tools.Tests.Utilities; namespace Microsoft.DotNet.Cli.Utils.Tests { @@ -189,7 +190,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests .Should().Pass(); var factory = new ProjectDependenciesCommandFactory( - FrameworkConstants.CommonFrameworks.NetCoreApp20, + NuGetFrameworks.NetCoreApp21, configuration, null, null, @@ -198,7 +199,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests var command = factory.Create("dotnet-tool-with-output-name", null); command.CommandArgs.Should().Contain( - Path.Combine("toolwithoutputname", "1.0.0", "lib", "netcoreapp2.0", "dotnet-tool-with-output-name.dll")); + Path.Combine("toolwithoutputname", "1.0.0", "lib", "netcoreapp2.1", "dotnet-tool-with-output-name.dll")); } } } diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectDependencyCommandResolver.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectDependencyCommandResolver.cs index 74e4ec4e1..a7b6c402e 100644 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectDependencyCommandResolver.cs +++ b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectDependencyCommandResolver.cs @@ -11,6 +11,7 @@ using Microsoft.DotNet.TestFramework; using Microsoft.DotNet.Tools.Test.Utilities; using NuGet.Frameworks; using Xunit; +using Microsoft.DotNet.Tools.Tests.Utilities; namespace Microsoft.DotNet.Cli.Utils.Tests { @@ -47,7 +48,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests CommandName = "dotnet-portable", Configuration = "Debug", ProjectDirectory = MSBuildTestProjectInstance.Root.FullName, - Framework = FrameworkConstants.CommonFrameworks.NetCoreApp20 + Framework = NuGetFrameworks.NetCoreApp21 }; var result = projectDependenciesCommandResolver.Resolve(commandResolverArguments); @@ -83,7 +84,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests CommandName = "dotnet-portable", Configuration = "Debug", ProjectDirectory = MSBuildTestProjectInstance.Root.FullName, - Framework = FrameworkConstants.CommonFrameworks.NetCoreApp20 + Framework = NuGetFrameworks.NetCoreApp21 }; var result = projectDependenciesCommandResolver.Resolve(commandResolverArguments); @@ -109,7 +110,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests CommandName = "nonexistent-command", CommandArguments = null, ProjectDirectory = MSBuildTestProjectInstance.Root.FullName, - Framework = FrameworkConstants.CommonFrameworks.NetCoreApp20 + Framework = NuGetFrameworks.NetCoreApp21 }; var result = projectDependenciesCommandResolver.Resolve(commandResolverArguments); @@ -135,7 +136,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests CommandName = "dotnet-portable", Configuration = "Debug", ProjectDirectory = testInstance.Root.FullName, - Framework = FrameworkConstants.CommonFrameworks.NetCoreApp20, + Framework = NuGetFrameworks.NetCoreApp21, OutputPath = outputDir.FullName }; diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs index bbb61cd5f..4b5a3874b 100644 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs +++ b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs @@ -12,13 +12,14 @@ using NuGet.Frameworks; using NuGet.ProjectModel; using NuGet.Versioning; using Xunit; +using Microsoft.DotNet.Tools.Tests.Utilities; namespace Microsoft.DotNet.Tests { public class GivenAProjectToolsCommandResolver : TestBase { private static readonly NuGetFramework s_toolPackageFramework = - FrameworkConstants.CommonFrameworks.NetCoreApp20; + NuGetFrameworks.NetCoreApp21; private const string TestProjectName = "AppWithToolDependency"; @@ -303,7 +304,7 @@ namespace Microsoft.DotNet.Tests result.Should().NotBeNull(); - result.Args.Should().Contain("--fx-version 2.0.3"); + result.Args.Should().Contain("--fx-version 2.1.0"); } [Fact] @@ -369,7 +370,7 @@ namespace Microsoft.DotNet.Tests "dotnet-fallbackfoldertool", "1.0.0", "lib", - "netcoreapp2.0", + "netcoreapp2.1", "dotnet-fallbackfoldertool.dll")); } diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.csproj b/test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.csproj index dce7b8e2e..63ddee901 100644 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.csproj +++ b/test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -30,15 +28,16 @@
- - + + - + + diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/PathUtilityTests.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/PathUtilityTests.cs new file mode 100644 index 000000000..70e7768c7 --- /dev/null +++ b/test/Microsoft.DotNet.Cli.Utils.Tests/PathUtilityTests.cs @@ -0,0 +1,34 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Microsoft.DotNet.Tools.Common; +using Microsoft.DotNet.Tools.Test.Utilities; +using Xunit; + +namespace Microsoft.DotNet.Cli.Utils +{ + public class PathUtilityTests : TestBase + { + /// + /// Tests that PathUtility.GetRelativePath treats drive references as case insensitive on Windows. + /// + [WindowsOnlyFact] + public void GetRelativePathWithCaseInsensitiveDrives() + { + Assert.Equal(@"bar\", PathUtility.GetRelativePath(@"C:\foo\", @"C:\foo\bar\")); + Assert.Equal(@"Bar\Baz\", PathUtility.GetRelativePath(@"c:\foo\", @"C:\Foo\Bar\Baz\")); + Assert.Equal(@"baz\Qux\", PathUtility.GetRelativePath(@"C:\fOO\bar\", @"c:\foo\BAR\baz\Qux\")); + Assert.Equal(@"d:\foo\", PathUtility.GetRelativePath(@"C:\foo\", @"d:\foo\")); + } + + /// + /// Tests that PathUtility.RemoveExtraPathSeparators works correctly with drive references on Windows. + /// + [WindowsOnlyFact] + public void RemoveExtraPathSeparatorsWithDrives() + { + Assert.Equal(@"c:\foo\bar\baz\", PathUtility.RemoveExtraPathSeparators(@"c:\\\foo\\\\bar\baz\\")); + Assert.Equal(@"D:\QUX\", PathUtility.RemoveExtraPathSeparators(@"D:\\\\\QUX\")); + } + } +} diff --git a/test/Microsoft.DotNet.Configurer.UnitTests/GivenADotnetFirstTimeUseConfigurer.cs b/test/Microsoft.DotNet.Configurer.UnitTests/GivenADotnetFirstTimeUseConfigurer.cs index a9a0e904b..f3c549582 100644 --- a/test/Microsoft.DotNet.Configurer.UnitTests/GivenADotnetFirstTimeUseConfigurer.cs +++ b/test/Microsoft.DotNet.Configurer.UnitTests/GivenADotnetFirstTimeUseConfigurer.cs @@ -20,6 +20,7 @@ namespace Microsoft.DotNet.Configurer.UnitTests private Mock _firstTimeUseNoticeSentinelMock; private Mock _environmentProviderMock; private Mock _reporterMock; + private Mock _pathAdder; public GivenADotnetFirstTimeUseConfigurer() { @@ -28,6 +29,7 @@ namespace Microsoft.DotNet.Configurer.UnitTests _firstTimeUseNoticeSentinelMock = new Mock(); _environmentProviderMock = new Mock(); _reporterMock = new Mock(); + _pathAdder = new Mock(); _environmentProviderMock .Setup(e => e.GetEnvironmentVariableAsBool("DOTNET_SKIP_FIRST_TIME_EXPERIENCE", false)) @@ -48,7 +50,8 @@ namespace Microsoft.DotNet.Configurer.UnitTests _firstTimeUseNoticeSentinelMock.Object, _environmentProviderMock.Object, _reporterMock.Object, - CliFallbackFolderPath); + CliFallbackFolderPath, + _pathAdder.Object); dotnetFirstTimeUseConfigurer.Configure(); @@ -70,7 +73,8 @@ namespace Microsoft.DotNet.Configurer.UnitTests _firstTimeUseNoticeSentinelMock.Object, _environmentProviderMock.Object, _reporterMock.Object, - CliFallbackFolderPath); + CliFallbackFolderPath, + _pathAdder.Object); dotnetFirstTimeUseConfigurer.Configure(); @@ -92,7 +96,8 @@ namespace Microsoft.DotNet.Configurer.UnitTests _firstTimeUseNoticeSentinelMock.Object, _environmentProviderMock.Object, _reporterMock.Object, - CliFallbackFolderPath); + CliFallbackFolderPath, + _pathAdder.Object); dotnetFirstTimeUseConfigurer.Configure(); @@ -111,7 +116,8 @@ namespace Microsoft.DotNet.Configurer.UnitTests _firstTimeUseNoticeSentinelMock.Object, _environmentProviderMock.Object, _reporterMock.Object, - CliFallbackFolderPath); + CliFallbackFolderPath, + _pathAdder.Object); dotnetFirstTimeUseConfigurer.Configure(); @@ -130,7 +136,8 @@ namespace Microsoft.DotNet.Configurer.UnitTests _firstTimeUseNoticeSentinelMock.Object, _environmentProviderMock.Object, _reporterMock.Object, - CliFallbackFolderPath); + CliFallbackFolderPath, + _pathAdder.Object); dotnetFirstTimeUseConfigurer.Configure(); @@ -148,7 +155,8 @@ namespace Microsoft.DotNet.Configurer.UnitTests _firstTimeUseNoticeSentinelMock.Object, _environmentProviderMock.Object, _reporterMock.Object, - CliFallbackFolderPath); + CliFallbackFolderPath, + _pathAdder.Object); dotnetFirstTimeUseConfigurer.Configure(); @@ -166,7 +174,8 @@ namespace Microsoft.DotNet.Configurer.UnitTests _firstTimeUseNoticeSentinelMock.Object, _environmentProviderMock.Object, _reporterMock.Object, - CliFallbackFolderPath); + CliFallbackFolderPath, + _pathAdder.Object); dotnetFirstTimeUseConfigurer.Configure(); @@ -187,7 +196,8 @@ namespace Microsoft.DotNet.Configurer.UnitTests _firstTimeUseNoticeSentinelMock.Object, _environmentProviderMock.Object, _reporterMock.Object, - CliFallbackFolderPath); + CliFallbackFolderPath, + _pathAdder.Object); dotnetFirstTimeUseConfigurer.Configure(); @@ -205,7 +215,8 @@ namespace Microsoft.DotNet.Configurer.UnitTests _firstTimeUseNoticeSentinelMock.Object, _environmentProviderMock.Object, _reporterMock.Object, - CliFallbackFolderPath); + CliFallbackFolderPath, + _pathAdder.Object); dotnetFirstTimeUseConfigurer.Configure(); @@ -224,7 +235,8 @@ namespace Microsoft.DotNet.Configurer.UnitTests _firstTimeUseNoticeSentinelMock.Object, _environmentProviderMock.Object, _reporterMock.Object, - CliFallbackFolderPath); + CliFallbackFolderPath, + _pathAdder.Object); dotnetFirstTimeUseConfigurer.Configure(); @@ -246,7 +258,8 @@ namespace Microsoft.DotNet.Configurer.UnitTests _firstTimeUseNoticeSentinelMock.Object, _environmentProviderMock.Object, _reporterMock.Object, - CliFallbackFolderPath); + CliFallbackFolderPath, + _pathAdder.Object); dotnetFirstTimeUseConfigurer.Configure(); @@ -258,6 +271,26 @@ namespace Microsoft.DotNet.Configurer.UnitTests _reporterMock.Verify(r => r.Write(It.IsAny()), Times.Never); } + [Fact] + public void It_adds_executable_package_path_to_environment_path_when_the_first_notice_sentinel_does_not_exist() + { + _nugetCacheSentinelMock.Setup(n => n.Exists()).Returns(true); + _firstTimeUseNoticeSentinelMock.Setup(n => n.Exists()).Returns(false); + + var dotnetFirstTimeUseConfigurer = new DotnetFirstTimeUseConfigurer( + _nugetCachePrimerMock.Object, + new FakeCreateWillExistNuGetCacheSentinel(false, true), + new FakeCreateWillExistFirstTimeUseNoticeSentinel(false), + _environmentProviderMock.Object, + _reporterMock.Object, + CliFallbackFolderPath, + _pathAdder.Object); + + dotnetFirstTimeUseConfigurer.Configure(); + + _pathAdder.Verify(p => p.AddPackageExecutablePathToUserPath(), Times.AtLeastOnce); + } + [Fact] public void It_prints_the_unauthorized_notice_if_the_cache_sentinel_reports_Unauthorized() { @@ -269,7 +302,8 @@ namespace Microsoft.DotNet.Configurer.UnitTests _firstTimeUseNoticeSentinelMock.Object, _environmentProviderMock.Object, _reporterMock.Object, - CliFallbackFolderPath); + CliFallbackFolderPath, + _pathAdder.Object); dotnetFirstTimeUseConfigurer.Configure(); @@ -295,11 +329,69 @@ namespace Microsoft.DotNet.Configurer.UnitTests _firstTimeUseNoticeSentinelMock.Object, _environmentProviderMock.Object, _reporterMock.Object, - CliFallbackFolderPath); + CliFallbackFolderPath, + _pathAdder.Object); dotnetFirstTimeUseConfigurer.Configure(); _nugetCachePrimerMock.Verify(r => r.PrimeCache(), Times.Never); } + + private class FakeCreateWillExistFirstTimeUseNoticeSentinel : IFirstTimeUseNoticeSentinel + { + private bool _exists; + + public FakeCreateWillExistFirstTimeUseNoticeSentinel(bool exists) + { + _exists = exists; + } + + public void Dispose() + { + } + + public bool Exists() + { + return _exists; + } + + public void CreateIfNotExists() + { + _exists = true; + } + } + + private class FakeCreateWillExistNuGetCacheSentinel : INuGetCacheSentinel + { + private bool _inProgressSentinelAlreadyExists; + private bool _exists; + + public FakeCreateWillExistNuGetCacheSentinel(bool inProgressSentinelAlreadyExists, bool exists) + { + _inProgressSentinelAlreadyExists = inProgressSentinelAlreadyExists; + _exists = exists; + } + + public void Dispose() + { + } + + public bool InProgressSentinelAlreadyExists() + { + return _inProgressSentinelAlreadyExists; + } + + public bool Exists() + { + return _exists; + } + + public void CreateIfNotExists() + { + _exists = true; + } + + public bool UnauthorizedAccess { get; set; } + } } } diff --git a/test/Microsoft.DotNet.Configurer.UnitTests/GivenANuGetCachePrimer.cs b/test/Microsoft.DotNet.Configurer.UnitTests/GivenANuGetCachePrimer.cs index f51fccb84..106afadac 100644 --- a/test/Microsoft.DotNet.Configurer.UnitTests/GivenANuGetCachePrimer.cs +++ b/test/Microsoft.DotNet.Configurer.UnitTests/GivenANuGetCachePrimer.cs @@ -26,7 +26,7 @@ namespace Microsoft.DotNet.Configurer.UnitTests private Mock _nugetPackagesArchiverMock; private Mock _nugetCacheSentinel; - private CliFallbackFolderPathCalculator _cliFallbackFolderPathCalculator; + private CliFolderPathCalculator _cliFolderPathCalculator; public GivenANuGetCachePrimer() { @@ -40,12 +40,12 @@ namespace Microsoft.DotNet.Configurer.UnitTests _nugetCacheSentinel = new Mock(); - _cliFallbackFolderPathCalculator = new CliFallbackFolderPathCalculator(); + _cliFolderPathCalculator = new CliFolderPathCalculator(); var nugetCachePrimer = new NuGetCachePrimer( _nugetPackagesArchiverMock.Object, _nugetCacheSentinel.Object, - _cliFallbackFolderPathCalculator, + _cliFolderPathCalculator, _fileSystemMock.File); nugetCachePrimer.PrimeCache(); @@ -63,7 +63,7 @@ namespace Microsoft.DotNet.Configurer.UnitTests var nugetCachePrimer = new NuGetCachePrimer( nugetPackagesArchiverMock.Object, _nugetCacheSentinel.Object, - _cliFallbackFolderPathCalculator, + _cliFolderPathCalculator, fileSystemMock.File); nugetCachePrimer.PrimeCache(); @@ -75,7 +75,7 @@ namespace Microsoft.DotNet.Configurer.UnitTests public void It_extracts_the_archive_to_the_fallback_folder() { _nugetPackagesArchiverMock.Verify(n => - n.ExtractArchive(_cliFallbackFolderPathCalculator.CliFallbackFolderPath), + n.ExtractArchive(_cliFolderPathCalculator.CliFallbackFolderPath), Times.Exactly(1)); } @@ -95,7 +95,7 @@ namespace Microsoft.DotNet.Configurer.UnitTests var nugetCachePrimer = new NuGetCachePrimer( nugetPackagesArchiveMock.Object, nugetCacheSentinel.Object, - _cliFallbackFolderPathCalculator, + _cliFolderPathCalculator, _fileSystemMock.File); Action action = () => nugetCachePrimer.PrimeCache(); diff --git a/test/Microsoft.DotNet.Configurer.UnitTests/Microsoft.DotNet.Configurer.UnitTests.csproj b/test/Microsoft.DotNet.Configurer.UnitTests/Microsoft.DotNet.Configurer.UnitTests.csproj index 69269abf5..2511c7eae 100644 --- a/test/Microsoft.DotNet.Configurer.UnitTests/Microsoft.DotNet.Configurer.UnitTests.csproj +++ b/test/Microsoft.DotNet.Configurer.UnitTests/Microsoft.DotNet.Configurer.UnitTests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -19,10 +17,11 @@
- - + + - + + 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 a21bb4731..b60f6abe6 100644 --- a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj +++ b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) diff --git a/test/Microsoft.DotNet.ShellShimMaker.Tests/FakeEnvironmentProvider.cs b/test/Microsoft.DotNet.ShellShimMaker.Tests/FakeEnvironmentProvider.cs new file mode 100644 index 000000000..4057febef --- /dev/null +++ b/test/Microsoft.DotNet.ShellShimMaker.Tests/FakeEnvironmentProvider.cs @@ -0,0 +1,48 @@ +// Copyright (c) .NET 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.Cli.Utils; + +namespace Microsoft.DotNet.ShellShimMaker.Tests +{ + internal class FakeEnvironmentProvider : IEnvironmentProvider + { + private readonly Dictionary _environmentVariables; + + public FakeEnvironmentProvider(Dictionary environmentVariables) + { + _environmentVariables = + environmentVariables ?? throw new ArgumentNullException(nameof(environmentVariables)); + } + + public IEnumerable ExecutableExtensions { get; } + + public string GetCommandPath(string commandName, params string[] extensions) + { + throw new NotImplementedException(); + } + + public string GetCommandPathFromRootPath(string rootPath, string commandName, params string[] extensions) + { + throw new NotImplementedException(); + } + + public string GetCommandPathFromRootPath(string rootPath, string commandName, + IEnumerable extensions) + { + throw new NotImplementedException(); + } + + public bool GetEnvironmentVariableAsBool(string name, bool defaultValue) + { + throw new NotImplementedException(); + } + + public string GetEnvironmentVariable(string name) + { + return _environmentVariables.ContainsKey(name) ? _environmentVariables[name] : ""; + } + } +} diff --git a/test/Microsoft.DotNet.ShellShimMaker.Tests/FakeFile.cs b/test/Microsoft.DotNet.ShellShimMaker.Tests/FakeFile.cs new file mode 100644 index 000000000..a881758b9 --- /dev/null +++ b/test/Microsoft.DotNet.ShellShimMaker.Tests/FakeFile.cs @@ -0,0 +1,55 @@ +// Copyright (c) .NET 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.Extensions.EnvironmentAbstractions; + +namespace Microsoft.DotNet.ShellShimMaker.Tests +{ + internal class FakeFile : IFile + { + private Dictionary _files; + + public FakeFile(Dictionary files) + { + _files = files; + } + + public bool Exists(string path) + { + return _files.ContainsKey(path); + } + + public string ReadAllText(string path) + { + throw new NotImplementedException(); + } + + public Stream OpenRead(string path) + { + throw new NotImplementedException(); + } + + public Stream OpenFile(string path, FileMode fileMode, FileAccess fileAccess, FileShare fileShare, + int bufferSize, + FileOptions fileOptions) + { + throw new NotImplementedException(); + } + + + public void CreateEmptyFile(string path) + { + _files.Add(path, String.Empty); + } + + public void WriteAllText(string path, string content) + { + _files[path] = content; + } + + public static FakeFile Empty => new FakeFile(new Dictionary()); + } +} diff --git a/test/Microsoft.DotNet.ShellShimMaker.Tests/FakeReporter.cs b/test/Microsoft.DotNet.ShellShimMaker.Tests/FakeReporter.cs new file mode 100644 index 000000000..3075cf470 --- /dev/null +++ b/test/Microsoft.DotNet.ShellShimMaker.Tests/FakeReporter.cs @@ -0,0 +1,28 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using Microsoft.DotNet.Cli.Utils; + +namespace Microsoft.DotNet.ShellShimMaker.Tests +{ + internal class FakeReporter : IReporter + { + public string Message { get; private set; } = ""; + + public void WriteLine(string message) + { + Message = message; + } + + public void WriteLine() + { + throw new NotImplementedException(); + } + + public void Write(string message) + { + throw new NotImplementedException(); + } + } +} diff --git a/test/Microsoft.DotNet.ShellShimMaker.Tests/LinuxEnvironmentPathTests.cs b/test/Microsoft.DotNet.ShellShimMaker.Tests/LinuxEnvironmentPathTests.cs new file mode 100644 index 000000000..910721210 --- /dev/null +++ b/test/Microsoft.DotNet.ShellShimMaker.Tests/LinuxEnvironmentPathTests.cs @@ -0,0 +1,82 @@ +// Copyright (c) .NET 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.Diagnostics; +using System.Runtime.InteropServices; +using FluentAssertions; +using Microsoft.DotNet.Tools.Test.Utilities; +using Microsoft.Extensions.DependencyModel.Tests; +using Xunit; + +namespace Microsoft.DotNet.ShellShimMaker.Tests +{ + public class LinuxEnvironmentPathTests + { + [Fact] + public void GivenEnvironmentAndReporterItCanPrintOutInstructionToAddPath() + { + var fakeReporter = new FakeReporter(); + var linuxEnvironmentPath = new LinuxEnvironmentPath( + @"executable\path", + fakeReporter, + new FakeEnvironmentProvider( + new Dictionary + { + {"PATH", ""} + }), + FakeFile.Empty); + + linuxEnvironmentPath.PrintAddPathInstructionIfPathDoesNotExist(); + + // similar to https://code.visualstudio.com/docs/setup/mac + fakeReporter.Message.Should().Be( + $"Cannot find the tools executable path. Please ensure executable\\path is added to your PATH.{Environment.NewLine}" + + $"If you are using bash. You can do this by running the following command:{Environment.NewLine}{Environment.NewLine}" + + $"cat << EOF >> ~/.bash_profile{Environment.NewLine}" + + $"# Add .NET Core SDK tools{Environment.NewLine}" + + $"export PATH=\"$PATH:executable\\path\"{Environment.NewLine}" + + $"EOF"); + } + + [Fact] + public void GivenEnvironmentAndReporterItPrintsNothingWhenenvironmentExists() + { + var fakeReporter = new FakeReporter(); + var linuxEnvironmentPath = new LinuxEnvironmentPath( + @"executable\path", + fakeReporter, + new FakeEnvironmentProvider( + new Dictionary + { + {"PATH", @"executable\path"} + }), + FakeFile.Empty); + + linuxEnvironmentPath.PrintAddPathInstructionIfPathDoesNotExist(); + + fakeReporter.Message.Should().BeEmpty(); + } + + [Fact] + public void GivenAddPackageExecutablePathToUserPathJustRunItPrintsInstructionToLogout() + { + var fakeReporter = new FakeReporter(); + var linuxEnvironmentPath = new LinuxEnvironmentPath( + @"executable\path", + fakeReporter, + new FakeEnvironmentProvider( + new Dictionary + { + {"PATH", @""} + }), + FakeFile.Empty); + linuxEnvironmentPath.AddPackageExecutablePathToUserPath(); + + linuxEnvironmentPath.PrintAddPathInstructionIfPathDoesNotExist(); + + fakeReporter.Message.Should().Be("Since you just installed the .NET Core SDK, you will need to logout or restart your session before running the tool you installed."); + } + } +} diff --git a/test/Microsoft.DotNet.ShellShimMaker.Tests/Microsoft.DotNet.ShellShimMaker.Tests.csproj b/test/Microsoft.DotNet.ShellShimMaker.Tests/Microsoft.DotNet.ShellShimMaker.Tests.csproj new file mode 100644 index 000000000..3a9912ff0 --- /dev/null +++ b/test/Microsoft.DotNet.ShellShimMaker.Tests/Microsoft.DotNet.ShellShimMaker.Tests.csproj @@ -0,0 +1,25 @@ + + + $(CliTargetFramework) + $(CLI_SharedFrameworkVersion) + ../../tools/Key.snk + true + true + $(AssetTargetFallback);dotnet5.4;portable-net451+win8 + + + + + + + + + + + + + + + + + diff --git a/test/Microsoft.DotNet.ShellShimMaker.Tests/OsxEnvironmentPathTests.cs b/test/Microsoft.DotNet.ShellShimMaker.Tests/OsxEnvironmentPathTests.cs new file mode 100644 index 000000000..23b5e9462 --- /dev/null +++ b/test/Microsoft.DotNet.ShellShimMaker.Tests/OsxEnvironmentPathTests.cs @@ -0,0 +1,88 @@ +// Copyright (c) .NET 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.Diagnostics; +using System.Runtime.InteropServices; +using FluentAssertions; +using Microsoft.DotNet.Tools.Test.Utilities; +using Microsoft.Extensions.DependencyModel.Tests; +using Xunit; + +namespace Microsoft.DotNet.ShellShimMaker.Tests +{ + public class OsxEnvironmentPathTests + { + [Fact] + public void GivenEnvironmentAndReporterItCanPrintOutInstructionToAddPath() + { + var fakeReporter = new FakeReporter(); + var osxEnvironmentPath = new OSXEnvironmentPath( + @"~/executable/path", + @"/Users/name/executable/path", + fakeReporter, + new FakeEnvironmentProvider( + new Dictionary + { + {"PATH", ""} + }), + FakeFile.Empty); + + osxEnvironmentPath.PrintAddPathInstructionIfPathDoesNotExist(); + + // similar to https://code.visualstudio.com/docs/setup/mac + fakeReporter.Message.Should().Be( + $"Cannot find the tools executable path. Please ensure /Users/name/executable/path is added to your PATH.{Environment.NewLine}" + + $"If you are using bash, You can do this by running the following command:{Environment.NewLine}{Environment.NewLine}" + + $"cat << EOF >> ~/.bash_profile{Environment.NewLine}" + + $"# Add .NET Core SDK tools{Environment.NewLine}" + + $"export PATH=\"$PATH:/Users/name/executable/path\"{Environment.NewLine}" + + $"EOF"); + } + + [Theory] + [InlineData("/Users/name/executable/path")] + [InlineData("~/executable/path")] + public void GivenEnvironmentAndReporterItPrintsNothingWhenenvironmentExists(string existingPath) + { + var fakeReporter = new FakeReporter(); + var osxEnvironmentPath = new OSXEnvironmentPath( + @"~/executable/path", + @"/Users/name/executable/path", + fakeReporter, + new FakeEnvironmentProvider( + new Dictionary + { + {"PATH", existingPath} + }), + FakeFile.Empty); + + osxEnvironmentPath.PrintAddPathInstructionIfPathDoesNotExist(); + + fakeReporter.Message.Should().BeEmpty(); + } + + [Fact] + public void GivenAddPackageExecutablePathToUserPathJustRunItPrintsInstructionToLogout() + { + var fakeReporter = new FakeReporter(); + var osxEnvironmentPath = new OSXEnvironmentPath( + @"~/executable/path", + @"/Users/name/executable/path", + fakeReporter, + new FakeEnvironmentProvider( + new Dictionary + { + {"PATH", @""} + }), + FakeFile.Empty); + osxEnvironmentPath.AddPackageExecutablePathToUserPath(); + + osxEnvironmentPath.PrintAddPathInstructionIfPathDoesNotExist(); + + fakeReporter.Message.Should().Be( + "Since you just installed the .NET Core SDK, you will need to reopen terminal before running the tool you installed."); + } + } +} diff --git a/test/Microsoft.DotNet.ShellShimMaker.Tests/ShellShimMakerTests.cs b/test/Microsoft.DotNet.ShellShimMaker.Tests/ShellShimMakerTests.cs new file mode 100644 index 000000000..d9391729e --- /dev/null +++ b/test/Microsoft.DotNet.ShellShimMaker.Tests/ShellShimMakerTests.cs @@ -0,0 +1,126 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using FluentAssertions; +using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.TestFramework; +using Microsoft.DotNet.Tools.Test.Utilities; +using Xunit; + +namespace Microsoft.DotNet.ShellShimMaker.Tests +{ + public class ShellShimMakerTests : TestBase + { + private readonly string _pathToPlaceShim; + + public ShellShimMakerTests() + { + _pathToPlaceShim = Path.GetTempPath(); + } + + [Fact] + public void GivenAnExecutablePathItCanGenerateShimFile() + { + var outputDll = MakeHelloWorldExecutableDll(); + + var shellShimMaker = new ShellShimMaker(_pathToPlaceShim); + var shellCommandName = nameof(ShellShimMakerTests) + Path.GetRandomFileName(); + + shellShimMaker.CreateShim( + outputDll.FullName, + shellCommandName); + var stdOut = ExecuteInShell(shellCommandName); + + stdOut.Should().Contain("Hello World"); + } + + [Fact] + public void GivenAnExecutablePathWithExistingSameNameShimItThrows() + { + var shellCommandName = nameof(ShellShimMakerTests) + Path.GetRandomFileName(); + + MakeNameConflictingCommand(_pathToPlaceShim, shellCommandName); + + var shellShimMaker = new ShellShimMaker(_pathToPlaceShim); + + Action a = () => shellShimMaker.EnsureCommandNameUniqueness(shellCommandName); + a.ShouldThrow() + .And.Message + .Should().Contain( + $"Failed to install tool {shellCommandName}. A command with the same name already exists."); + } + + + [Fact] + public void GivenAnExecutablePathWithoutExistingSameNameShimItShouldNotThrow() + { + var shellCommandName = nameof(ShellShimMakerTests) + Path.GetRandomFileName(); + + var shellShimMaker = new ShellShimMaker(_pathToPlaceShim); + + Action a = () => shellShimMaker.EnsureCommandNameUniqueness(shellCommandName); + a.ShouldNotThrow(); + } + + private static void MakeNameConflictingCommand(string pathToPlaceShim, string shellCommandName) + { + File.WriteAllText(Path.Combine(pathToPlaceShim, shellCommandName), string.Empty); + } + + private string ExecuteInShell(string shellCommandName) + { + ProcessStartInfo processStartInfo; + + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + processStartInfo = new ProcessStartInfo + { + FileName = "CMD.exe", + Arguments = $"/C {shellCommandName}", + UseShellExecute = false + }; + } + else + { + processStartInfo = new ProcessStartInfo + { + FileName = "sh", + Arguments = shellCommandName, + UseShellExecute = false + }; + } + processStartInfo.WorkingDirectory = _pathToPlaceShim; + processStartInfo.EnvironmentVariables["PATH"] = Path.GetDirectoryName(new Muxer().MuxerPath); + + processStartInfo.ExecuteAndCaptureOutput(out var stdOut, out var stdErr); + + stdErr.Should().BeEmpty(); + + return stdOut ?? ""; + } + + private static FileInfo MakeHelloWorldExecutableDll() + { + const string testAppName = "TestAppSimple"; + const string emptySpaceToTestSpaceInPath = " "; + TestAssetInstance testInstance = TestAssets.Get(testAppName) + .CreateInstance(testAppName + emptySpaceToTestSpaceInPath) + .UseCurrentRuntimeFrameworkVersion() + .WithRestoreFiles() + .WithBuildFiles(); + + var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; + + FileInfo outputDll = testInstance.Root.GetDirectory("bin", configuration) + .GetDirectories().Single() + .GetFile($"{testAppName}.dll"); + + return outputDll; + } + } +} diff --git a/src/Microsoft.DotNet.TestFramework/Extensions/DirectoryInfoExtensions.cs b/test/Microsoft.DotNet.TestFramework/Extensions/DirectoryInfoExtensions.cs similarity index 100% rename from src/Microsoft.DotNet.TestFramework/Extensions/DirectoryInfoExtensions.cs rename to test/Microsoft.DotNet.TestFramework/Extensions/DirectoryInfoExtensions.cs diff --git a/src/Microsoft.DotNet.TestFramework/Microsoft.DotNet.TestFramework.csproj b/test/Microsoft.DotNet.TestFramework/Microsoft.DotNet.TestFramework.csproj similarity index 72% rename from src/Microsoft.DotNet.TestFramework/Microsoft.DotNet.TestFramework.csproj rename to test/Microsoft.DotNet.TestFramework/Microsoft.DotNet.TestFramework.csproj index 4e9b4a96f..d9663e868 100644 --- a/src/Microsoft.DotNet.TestFramework/Microsoft.DotNet.TestFramework.csproj +++ b/test/Microsoft.DotNet.TestFramework/Microsoft.DotNet.TestFramework.csproj @@ -1,5 +1,4 @@  - Microsoft.DotNet.TestFramework Class Library @@ -8,10 +7,11 @@ ../../tools/Key.snk true true + 1.6.0 - + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Archive/Properties/AssemblyInfo.cs b/test/Microsoft.DotNet.TestFramework/Properties/AssemblyInfo.cs similarity index 100% rename from src/Microsoft.DotNet.Archive/Properties/AssemblyInfo.cs rename to test/Microsoft.DotNet.TestFramework/Properties/AssemblyInfo.cs diff --git a/src/Microsoft.DotNet.TestFramework/TestAssetInfo.cs b/test/Microsoft.DotNet.TestFramework/TestAssetInfo.cs similarity index 70% rename from src/Microsoft.DotNet.TestFramework/TestAssetInfo.cs rename to test/Microsoft.DotNet.TestFramework/TestAssetInfo.cs index f5ca0aebe..bec0b5729 100644 --- a/src/Microsoft.DotNet.TestFramework/TestAssetInfo.cs +++ b/test/Microsoft.DotNet.TestFramework/TestAssetInfo.cs @@ -15,13 +15,15 @@ namespace Microsoft.DotNet.TestFramework public string AssetName { get; private set; } - public FileInfo DotnetExeFile { get; private set; } + public FileInfo DotnetExeFile => _testAssets.DotnetCsprojExe; - public string ProjectFilePattern { get; private set; } + public string ProjectFilePattern => "*.csproj"; public DirectoryInfo Root { get; private set; } - internal TestAssetInfo(DirectoryInfo root, string assetName, FileInfo dotnetExeFile, string projectFilePattern) + private TestAssets _testAssets { get; } + + internal TestAssetInfo(DirectoryInfo root, string assetName, TestAssets testAssets) { if (root == null) { @@ -33,23 +35,16 @@ namespace Microsoft.DotNet.TestFramework throw new ArgumentException("Argument cannot be null or whitespace", nameof(assetName)); } - if (dotnetExeFile == null) + if (testAssets == null) { - throw new ArgumentNullException(nameof(dotnetExeFile)); - } - - if (string.IsNullOrWhiteSpace(projectFilePattern)) - { - throw new ArgumentException("Argument cannot be null or whitespace", nameof(projectFilePattern)); + throw new ArgumentNullException(nameof(testAssets)); } Root = root; AssetName = assetName; - DotnetExeFile = dotnetExeFile; - - ProjectFilePattern = projectFilePattern; + _testAssets = testAssets; } public TestAssetInstance CreateInstance([CallerMemberName] string callingMethod = "", string identifier = "") @@ -71,12 +66,7 @@ namespace Microsoft.DotNet.TestFramework private DirectoryInfo GetTestDestinationDirectory(string callingMethod, string identifier) { -#if NET451 - string baseDirectory = AppDomain.CurrentDomain.BaseDirectory; -#else - string baseDirectory = AppContext.BaseDirectory; -#endif - return new DirectoryInfo(Path.Combine(baseDirectory, callingMethod + identifier, AssetName)); + return _testAssets.CreateTestDirectory(AssetName, callingMethod, identifier); } private void ThrowIfTestAssetDoesNotExist() diff --git a/src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs b/test/Microsoft.DotNet.TestFramework/TestAssetInstance.cs similarity index 97% rename from src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs rename to test/Microsoft.DotNet.TestFramework/TestAssetInstance.cs index bf75f00c2..4d27d0fe7 100644 --- a/src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs +++ b/test/Microsoft.DotNet.TestFramework/TestAssetInstance.cs @@ -51,7 +51,14 @@ namespace Microsoft.DotNet.TestFramework if (Root.Exists) { - Root.Delete(recursive: true); + try + { + Root.Delete(recursive: true); + } + catch (IOException ex) + { + throw new InvalidOperationException("Unable to delete directory: " + Root.FullName, ex); + } } Root.Create(); diff --git a/src/Microsoft.DotNet.TestFramework/TestAssetInventoryFiles.cs b/test/Microsoft.DotNet.TestFramework/TestAssetInventoryFiles.cs similarity index 100% rename from src/Microsoft.DotNet.TestFramework/TestAssetInventoryFiles.cs rename to test/Microsoft.DotNet.TestFramework/TestAssetInventoryFiles.cs diff --git a/src/Microsoft.DotNet.TestFramework/TestAssetKinds.cs b/test/Microsoft.DotNet.TestFramework/TestAssetKinds.cs similarity index 100% rename from src/Microsoft.DotNet.TestFramework/TestAssetKinds.cs rename to test/Microsoft.DotNet.TestFramework/TestAssetKinds.cs diff --git a/src/Microsoft.DotNet.TestFramework/TestAssets.cs b/test/Microsoft.DotNet.TestFramework/TestAssets.cs similarity index 64% rename from src/Microsoft.DotNet.TestFramework/TestAssets.cs rename to test/Microsoft.DotNet.TestFramework/TestAssets.cs index 0e47e3ba9..6d05788fd 100644 --- a/src/Microsoft.DotNet.TestFramework/TestAssets.cs +++ b/test/Microsoft.DotNet.TestFramework/TestAssets.cs @@ -17,13 +17,11 @@ namespace Microsoft.DotNet.TestFramework private FileInfo _dotnetCsprojExe; - private FileInfo _dotnetProjectJsonExe; + private string _testWorkingFolder; - private const string ProjectJsonSearchPattern = "project.json"; + public FileInfo DotnetCsprojExe => _dotnetCsprojExe; - private const string CsprojSearchPattern = "*.csproj"; - - public TestAssets(DirectoryInfo assetsRoot, FileInfo dotnetCsprojExe, FileInfo dotnetProjectJsonExe) + public TestAssets(DirectoryInfo assetsRoot, FileInfo dotnetCsprojExe, string testWorkingFolder) { if (assetsRoot == null) { @@ -35,11 +33,6 @@ namespace Microsoft.DotNet.TestFramework throw new ArgumentNullException(nameof(dotnetCsprojExe)); } - if (dotnetProjectJsonExe == null) - { - throw new ArgumentNullException(nameof(dotnetProjectJsonExe)); - } - if (!assetsRoot.Exists) { throw new DirectoryNotFoundException($"Directory not found at '{assetsRoot}'"); @@ -50,16 +43,10 @@ namespace Microsoft.DotNet.TestFramework throw new FileNotFoundException("Csproj dotnet executable must exist", dotnetCsprojExe.FullName); } - if (!dotnetProjectJsonExe.Exists) - { - throw new FileNotFoundException("project.json dotnet executable must exist", dotnetProjectJsonExe.FullName); - } - _root = assetsRoot; _dotnetCsprojExe = dotnetCsprojExe; - - _dotnetProjectJsonExe = dotnetProjectJsonExe; + _testWorkingFolder = testWorkingFolder; } public TestAssetInfo Get(string name) @@ -74,24 +61,7 @@ namespace Microsoft.DotNet.TestFramework return new TestAssetInfo( assetDirectory, name, - _dotnetCsprojExe, - CsprojSearchPattern); - } - - public TestAssetInfo GetProjectJson(string name) - { - return GetProjectJson(TestAssetKinds.TestProjects, name); - } - - public TestAssetInfo GetProjectJson(string kind, string name) - { - var assetDirectory = new DirectoryInfo(Path.Combine(_root.FullName, kind, name)); - - return new TestAssetInfo( - assetDirectory, - name, - _dotnetProjectJsonExe, - ProjectJsonSearchPattern); + this); } public DirectoryInfo CreateTestDirectory(string testProjectName = "temp", [CallerMemberName] string callingMethod = "", string identifier = "") @@ -112,7 +82,10 @@ namespace Microsoft.DotNet.TestFramework #else string baseDirectory = AppContext.BaseDirectory; #endif - return Path.Combine(baseDirectory, callingMethod + identifier, testProjectName); + // Find the name of the assembly the test comes from based on the the base directory and how the output path has been constructed + string testAssemblyName = new DirectoryInfo(baseDirectory).Parent.Parent.Name; + + return Path.Combine(_testWorkingFolder, testAssemblyName, callingMethod + identifier, testProjectName); } } } diff --git a/test/Microsoft.DotNet.ToolPackageObtainer.Tests/DotnetToolsConfigGolden.xml b/test/Microsoft.DotNet.ToolPackageObtainer.Tests/DotnetToolsConfigGolden.xml new file mode 100644 index 000000000..cd4f20107 --- /dev/null +++ b/test/Microsoft.DotNet.ToolPackageObtainer.Tests/DotnetToolsConfigGolden.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/test/Microsoft.DotNet.ToolPackageObtainer.Tests/DotnetToolsConfigMalformed.xml b/test/Microsoft.DotNet.ToolPackageObtainer.Tests/DotnetToolsConfigMalformed.xml new file mode 100644 index 000000000..0aa8173ad --- /dev/null +++ b/test/Microsoft.DotNet.ToolPackageObtainer.Tests/DotnetToolsConfigMalformed.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/test/Microsoft.DotNet.ToolPackageObtainer.Tests/DotnetToolsConfigMissing.xml b/test/Microsoft.DotNet.ToolPackageObtainer.Tests/DotnetToolsConfigMissing.xml new file mode 100644 index 000000000..87134da29 --- /dev/null +++ b/test/Microsoft.DotNet.ToolPackageObtainer.Tests/DotnetToolsConfigMissing.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/test/Microsoft.DotNet.ToolPackageObtainer.Tests/Microsoft.DotNet.ToolPackageObtainer.Tests.csproj b/test/Microsoft.DotNet.ToolPackageObtainer.Tests/Microsoft.DotNet.ToolPackageObtainer.Tests.csproj new file mode 100644 index 000000000..cf8b5f9cd --- /dev/null +++ b/test/Microsoft.DotNet.ToolPackageObtainer.Tests/Microsoft.DotNet.ToolPackageObtainer.Tests.csproj @@ -0,0 +1,56 @@ + + + $(CliTargetFramework) + $(CLI_SharedFrameworkVersion) + true + ../../tools/Key.snk + true + true + $(AssetTargetFallback);dotnet5.4;portable-net451+win8 + + + + + + + + + + + + + + + + + + + Always + + + Always + + + Always + + + Always + + + + + + + + + + + $(BaseOutputPath)/TestAsset/SampleGlobalTool + + + + + + + + diff --git a/test/Microsoft.DotNet.ToolPackageObtainer.Tests/SampleGlobalTool/DotnetToolsConfig.xml b/test/Microsoft.DotNet.ToolPackageObtainer.Tests/SampleGlobalTool/DotnetToolsConfig.xml new file mode 100644 index 000000000..b9c18a1e7 --- /dev/null +++ b/test/Microsoft.DotNet.ToolPackageObtainer.Tests/SampleGlobalTool/DotnetToolsConfig.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/test/Microsoft.DotNet.ToolPackageObtainer.Tests/SampleGlobalTool/Program.cs b/test/Microsoft.DotNet.ToolPackageObtainer.Tests/SampleGlobalTool/Program.cs new file mode 100644 index 000000000..1140102df --- /dev/null +++ b/test/Microsoft.DotNet.ToolPackageObtainer.Tests/SampleGlobalTool/Program.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; + +namespace consoledemo +{ + class Program + { + static void Main(string[] args) + { + var greeting = "Hello World from Global Tool"; + Console.WriteLine(greeting); + } + } +} diff --git a/test/Microsoft.DotNet.ToolPackageObtainer.Tests/SampleGlobalTool/consoledemo.csproj b/test/Microsoft.DotNet.ToolPackageObtainer.Tests/SampleGlobalTool/consoledemo.csproj new file mode 100644 index 000000000..4e16cac58 --- /dev/null +++ b/test/Microsoft.DotNet.ToolPackageObtainer.Tests/SampleGlobalTool/consoledemo.csproj @@ -0,0 +1,7 @@ + + + Exe + netcoreapp2.1 + consoledemo + + \ No newline at end of file diff --git a/test/Microsoft.DotNet.ToolPackageObtainer.Tests/SampleGlobalTool/includepublish.nuspec b/test/Microsoft.DotNet.ToolPackageObtainer.Tests/SampleGlobalTool/includepublish.nuspec new file mode 100644 index 000000000..89686425e --- /dev/null +++ b/test/Microsoft.DotNet.ToolPackageObtainer.Tests/SampleGlobalTool/includepublish.nuspec @@ -0,0 +1,13 @@ + + + + global.tool.console.demo + 1.0.4 + test app + testauthor + + + + + + \ No newline at end of file diff --git a/test/Microsoft.DotNet.ToolPackageObtainer.Tests/ToolConfigurationDeserializerTests.cs b/test/Microsoft.DotNet.ToolPackageObtainer.Tests/ToolConfigurationDeserializerTests.cs new file mode 100644 index 000000000..4c81f787a --- /dev/null +++ b/test/Microsoft.DotNet.ToolPackageObtainer.Tests/ToolConfigurationDeserializerTests.cs @@ -0,0 +1,52 @@ +// Copyright (c) .NET 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 NuGet.Protocol.Core.Types; +using Xunit; + +namespace Microsoft.DotNet.ToolPackageObtainer.Tests +{ + public class ToolConfigurationDeserializerTests + { + [Fact] + public void GivenXmlPathItShouldGetToolConfiguration() + { + ToolConfiguration toolConfiguration = ToolConfigurationDeserializer.Deserialize("DotnetToolsConfigGolden.xml"); + + toolConfiguration.CommandName.Should().Be("sayhello"); + toolConfiguration.ToolAssemblyEntryPoint.Should().Be("console.dll"); + } + + [Fact] + public void GivenMalformedPathItThrows() + { + Action a = () => ToolConfigurationDeserializer.Deserialize("DotnetToolsConfigMalformed.xml"); + a.ShouldThrow() + .And.Message.Should() + .Contain("Failed to retrive tool configuration exception, configuration is malformed xml"); + } + + [Fact] + public void GivenMissingContentItThrows() + { + Action a = () => ToolConfigurationDeserializer.Deserialize("DotnetToolsConfigMissing.xml"); + a.ShouldThrow() + .And.Message.Should() + .Contain("Configuration content error"); + } + + [Fact] + public void GivenInvalidCharAsFileNameItThrows() + { + Action a = () => new ToolConfiguration("na***me", "my.dll"); + a.ShouldThrow() + .And.Message.Should() + .Contain("Cannot contain following character"); + } + } +} diff --git a/test/Microsoft.DotNet.ToolPackageObtainer.Tests/ToolPackageObtainerTests.cs b/test/Microsoft.DotNet.ToolPackageObtainer.Tests/ToolPackageObtainerTests.cs new file mode 100644 index 000000000..01606f251 --- /dev/null +++ b/test/Microsoft.DotNet.ToolPackageObtainer.Tests/ToolPackageObtainerTests.cs @@ -0,0 +1,208 @@ +// Copyright (c) .NET 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 Microsoft.Extensions.EnvironmentAbstractions; +using Microsoft.DotNet.Cli; +using Xunit; + +namespace Microsoft.DotNet.ToolPackageObtainer.Tests +{ + public class ToolPackageObtainerTests : TestBase + { + [Fact] + public void GivenNugetConfigAndPackageNameAndVersionAndTargetFrameworkWhenCallItCanDownloadThePackage() + { + FilePath nugetConfigPath = WriteNugetConfigFileToPointToTheFeed(); + var toolsPath = Path.Combine(Directory.GetCurrentDirectory(), Path.GetRandomFileName()); + + var packageObtainer = + ConstructDefaultPackageObtainer(toolsPath); + ToolConfigurationAndExecutableDirectory toolConfigurationAndExecutableDirectory = packageObtainer.ObtainAndReturnExecutablePath( + packageId: TestPackageId, + packageVersion: TestPackageVersion, + nugetconfig: nugetConfigPath, + targetframework: _testTargetframework); + + var executable = toolConfigurationAndExecutableDirectory + .ExecutableDirectory + .WithFile( + toolConfigurationAndExecutableDirectory + .Configuration + .ToolAssemblyEntryPoint); + + File.Exists(executable.Value) + .Should() + .BeTrue(executable + " should have the executable"); + } + + [Fact] + public void GivenNugetConfigAndPackageNameAndVersionAndTargetFrameworkWhenCallItCreateAssetFile() + { + var nugetConfigPath = WriteNugetConfigFileToPointToTheFeed(); + var toolsPath = Path.Combine(Directory.GetCurrentDirectory(), Path.GetRandomFileName()); + + var packageObtainer = + ConstructDefaultPackageObtainer(toolsPath); + ToolConfigurationAndExecutableDirectory toolConfigurationAndExecutableDirectory = + packageObtainer.ObtainAndReturnExecutablePath( + packageId: TestPackageId, + packageVersion: TestPackageVersion, + nugetconfig: nugetConfigPath, + targetframework: _testTargetframework); + + var assetJsonPath = toolConfigurationAndExecutableDirectory + .ExecutableDirectory + .GetParentPath() + .GetParentPath() + .GetParentPath() + .GetParentPath() + .WithFile("project.assets.json").Value; + + File.Exists(assetJsonPath) + .Should() + .BeTrue(assetJsonPath + " should be created"); + } + + [Fact] + public void GivenAllButNoNugetConfigFilePathItCanDownloadThePackage() + { + var uniqueTempProjectPath = GetUniqueTempProjectPathEachTest(); + var tempProjectDirectory = uniqueTempProjectPath.GetDirectoryPath(); + var nugetConfigPath = WriteNugetConfigFileToPointToTheFeed(); + var toolsPath = Path.Combine(Directory.GetCurrentDirectory(), Path.GetRandomFileName()); + + Directory.CreateDirectory(tempProjectDirectory.Value); + + /* + * No nuget config means you don't need nuget config passed in during call + * NuGet needs a way to find the package, in production, it will keep look up folders for Nuget.Config + * and use the feed there. + * In test, we don't want NuGet to keep look up, so we just copy paste beside the project. + */ + File.Copy(nugetConfigPath.Value, + tempProjectDirectory.WithFile("nuget.config").Value); + + var packageObtainer = + new ToolPackageObtainer( + new DirectoryPath(toolsPath), + () => uniqueTempProjectPath, + new Lazy(), + new PackageToProjectFileAdder(), + new ProjectRestorer()); + ToolConfigurationAndExecutableDirectory toolConfigurationAndExecutableDirectory = packageObtainer.ObtainAndReturnExecutablePath( + packageId: TestPackageId, + packageVersion: TestPackageVersion, + targetframework: _testTargetframework); + + var executable = toolConfigurationAndExecutableDirectory + .ExecutableDirectory + .WithFile( + toolConfigurationAndExecutableDirectory + .Configuration + .ToolAssemblyEntryPoint); + + File.Exists(executable.Value) + .Should() + .BeTrue(executable + " should have the executable"); + } + + [Fact] + public void GivenAllButNoPackageVersionItCanDownloadThePackage() + { + var nugetConfigPath = WriteNugetConfigFileToPointToTheFeed(); + var toolsPath = Path.Combine(Directory.GetCurrentDirectory(), Path.GetRandomFileName()); + + var packageObtainer = + ConstructDefaultPackageObtainer(toolsPath); + ToolConfigurationAndExecutableDirectory toolConfigurationAndExecutableDirectory = packageObtainer.ObtainAndReturnExecutablePath( + packageId: TestPackageId, + nugetconfig: nugetConfigPath, + targetframework: _testTargetframework); + + var executable = toolConfigurationAndExecutableDirectory + .ExecutableDirectory + .WithFile( + toolConfigurationAndExecutableDirectory + .Configuration + .ToolAssemblyEntryPoint); + + File.Exists(executable.Value) + .Should() + .BeTrue(executable + " should have the executable"); + } + + [Fact] + public void GivenAllButNoTargetFrameworkItCanDownloadThePackage() + { + var nugetConfigPath = WriteNugetConfigFileToPointToTheFeed(); + var toolsPath = Path.Combine(Directory.GetCurrentDirectory(), Path.GetRandomFileName()); + + var packageObtainer = + new ToolPackageObtainer( + new DirectoryPath(toolsPath), + GetUniqueTempProjectPathEachTest, + new Lazy(() => BundledTargetFramework.GetTargetFrameworkMoniker()), + new PackageToProjectFileAdder(), + new ProjectRestorer()); + ToolConfigurationAndExecutableDirectory toolConfigurationAndExecutableDirectory = + packageObtainer.ObtainAndReturnExecutablePath( + packageId: TestPackageId, + packageVersion: TestPackageVersion, + nugetconfig: nugetConfigPath); + + var executable = toolConfigurationAndExecutableDirectory + .ExecutableDirectory + .WithFile( + toolConfigurationAndExecutableDirectory + .Configuration + .ToolAssemblyEntryPoint); + + File.Exists(executable.Value) + .Should() + .BeTrue(executable + " should have the executable"); + } + + private static readonly Func GetUniqueTempProjectPathEachTest = () => + { + var tempProjectDirectory = + new DirectoryPath(Path.GetTempPath()).WithSubDirectories(Path.GetRandomFileName()); + var tempProjectPath = + tempProjectDirectory.WithFile(Path.GetRandomFileName() + ".csproj"); + return tempProjectPath; + }; + + private static ToolPackageObtainer ConstructDefaultPackageObtainer(string toolsPath) + { + return new ToolPackageObtainer( + new DirectoryPath(toolsPath), + GetUniqueTempProjectPathEachTest, + new Lazy(), + new PackageToProjectFileAdder(), + new ProjectRestorer()); + } + + private static FilePath WriteNugetConfigFileToPointToTheFeed() + { + var nugetConfigName = Path.GetRandomFileName() + ".config"; + var executeDirectory = + Path.GetDirectoryName( + System.Reflection + .Assembly + .GetExecutingAssembly() + .Location); + NuGetConfig.Write( + directory: executeDirectory, + configname: nugetConfigName, + localFeedPath: Path.Combine(executeDirectory, "TestAssetLocalNugetFeed")); + return new FilePath(Path.GetFullPath(nugetConfigName)); + } + + private readonly string _testTargetframework = BundledTargetFramework.GetTargetFrameworkMoniker(); + private const string TestPackageVersion = "1.0.4"; + private const string TestPackageId = "global.tool.console.demo"; + } +} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Assertions/CommandResultAssertions.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Assertions/CommandResultAssertions.cs index f8317f34a..bdb460302 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Assertions/CommandResultAssertions.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Assertions/CommandResultAssertions.cs @@ -69,6 +69,13 @@ namespace Microsoft.DotNet.Tools.Test.Utilities return new AndConstraint(this); } + public AndConstraint NotHaveStdOutContaining(string pattern) + { + Execute.Assertion.ForCondition(!_commandResult.StdOut.Contains(pattern)) + .FailWith(AppendDiagnosticsTo($"The command output contained a result it should not have contained: {pattern}{Environment.NewLine}")); + return new AndConstraint(this); + } + public AndConstraint HaveStdOutMatching(string pattern, RegexOptions options = RegexOptions.None) { Execute.Assertion.ForCondition(Regex.Match(_commandResult.StdOut, pattern, options).Success) diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/BuildPJCommand.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/BuildPJCommand.cs deleted file mode 100644 index 6b05edfe8..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/BuildPJCommand.cs +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) .NET 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.Cli.Utils; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Tools.Test.Utilities -{ - public sealed class BuildPJCommand : TestCommand - { - - private bool _captureOutput; - - private string _configuration; - - private NuGetFramework _framework; - - private string _runtime; - - private bool _noDependencies; - - private DirectoryInfo _outputPath; - - private FileInfo _projectFile; - - private DirectoryInfo _workingDirectory; - - public BuildPJCommand() - : base(new RepoDirectoriesProvider().PjDotnet) - { - } - - public override CommandResult Execute(string args = "") - { - args = $"build {GetNoDependencies()} {GetProjectFile()} {GetOutputPath()} {GetConfiguration()} {GetFramework()} {GetRuntime()} {args}"; - - if (_workingDirectory != null) - { - this.WithWorkingDirectory(_workingDirectory.FullName); - } - - if (_captureOutput) - { - return base.ExecuteWithCapturedOutput(args); - } - else - { - return base.Execute(args); - } - } - - public override CommandResult ExecuteWithCapturedOutput(string args = "") - { - WithCapturedOutput(); - - return Execute(args); - } - - public BuildPJCommand WithCapturedOutput() - { - _captureOutput = true; - - return this; - } - - public BuildPJCommand WithConfiguration(string configuration) - { - _configuration = configuration; - - return this; - } - - public BuildPJCommand WithFramework(NuGetFramework framework) - { - _framework = framework; - - return this; - } - - public BuildPJCommand WithRuntime(string runtime) - { - _runtime = runtime; - - return this; - } - - public BuildPJCommand WithNoDependencies() - { - _noDependencies = true; - - return this; - } - - public BuildPJCommand WithOutputPath(DirectoryInfo outputPath) - { - _outputPath = outputPath; - - return this; - } - - public BuildPJCommand WithProjectDirectory(DirectoryInfo projectDirectory) - { - _workingDirectory = projectDirectory; - - return this; - } - - public BuildPJCommand WithProjectFile(FileInfo projectFile) - { - _projectFile = projectFile; - - return this; - } - - public BuildPJCommand WithWorkingDirectory(DirectoryInfo workingDirectory) - { - _workingDirectory = workingDirectory; - - return this; - } - - private string GetConfiguration() - { - if (_configuration == null) - { - return null; - } - - return $"--configuration {_configuration}"; - } - - private string GetFramework() - { - if (_framework == null) - { - return null; - } - - return $"--framework {_framework.GetShortFolderName()}"; - } - - private string GetRuntime() - { - if (_runtime == null) - { - return null; - } - - return $"--runtime {_runtime}"; - } - - private string GetNoDependencies() - { - if (!_noDependencies) - { - return null; - } - - return "--no-dependencies"; - } - - private string GetOutputPath() - { - if (_outputPath == null) - { - return null; - } - - return $"\"{_outputPath.FullName}\""; - } - - private string GetProjectFile() - { - if (_projectFile == null) - { - return null; - } - - return $"\"{_projectFile.FullName}\""; - } - } -} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreProjectJsonCommand.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreProjectJsonCommand.cs deleted file mode 100644 index a54d89605..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreProjectJsonCommand.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 Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.Tools.Test.Utilities -{ - public sealed class RestoreProjectJsonCommand : TestCommand - { - public RestoreProjectJsonCommand() - : base(new RepoDirectoriesProvider().PjDotnet) - { - } - - public override CommandResult Execute(string args="") - { - args = $"restore {args}"; - - return base.Execute(args); - } - - public override CommandResult ExecuteWithCapturedOutput(string args = "") - { - args = $"restore {args}"; - return base.ExecuteWithCapturedOutput(args); - } - } -} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/TestCommand.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/TestCommand.cs index 03ee56d6c..b8f3ca9cc 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/TestCommand.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/TestCommand.cs @@ -238,6 +238,9 @@ namespace Microsoft.DotNet.Tools.Test.Utilities psi.Environment[item.Key] = item.Value; #endif } + + // Flow the TEST_PACKAGES environment variable to the child process + psi.Environment["TEST_PACKAGES"] = System.Environment.GetEnvironmentVariable("TEST_PACKAGES"); } private void AddWorkingDirectoryTo(ProcessStartInfo psi) diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/EnvironmentInfo.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/EnvironmentInfo.cs index 2f50d2e4e..436aa506c 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/EnvironmentInfo.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/EnvironmentInfo.cs @@ -14,6 +14,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities switch (rid) { case "fedora.24-x64": + case "rhel.6-x64": case "opensuse.42.1-x64": case "ubuntu.16.10-x64": case "linux-x64": @@ -25,6 +26,15 @@ namespace Microsoft.DotNet.Tools.Test.Utilities switch (rid) { case "linux-x64": + case "rhel.6-x64": + return false; + } + } + else if (framework == "netcoreapp2.0") + { + switch (rid) + { + case "rhel.6-x64": return false; } } @@ -32,4 +42,4 @@ namespace Microsoft.DotNet.Tools.Test.Utilities return true; } } -} \ No newline at end of file +} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj b/test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj index c13629f52..669024a6a 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj @@ -1,6 +1,4 @@  - - Microsoft.DotNet.Tools.Tests.Utilities Class Library netstandard1.5 @@ -13,14 +11,14 @@ - + - + \ No newline at end of file diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/NuGetConfig.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/NuGetConfig.cs index f6f05bd51..356eab384 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/NuGetConfig.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/NuGetConfig.cs @@ -23,5 +23,23 @@ namespace Microsoft.DotNet.Tools.Test.Utilities File.WriteAllText(path, contents); } + + public static void Write(string directory, string configname, string localFeedPath) + { + const string template = @" + + + + + + + + +"; + + var path = Path.Combine(directory, configname); + + File.WriteAllText(path, string.Format(template, localFeedPath)); + } } } diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/NuGetFrameworks.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/NuGetFrameworks.cs new file mode 100644 index 000000000..c82d78051 --- /dev/null +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/NuGetFrameworks.cs @@ -0,0 +1,14 @@ +using NuGet.Frameworks; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.DotNet.Tools.Tests.Utilities +{ + // This class is for frameworks that aren't yet in NuGet's FrameworkConstants.CommonFrameworks class + public static class NuGetFrameworks + { + public static readonly NuGetFramework NetCoreApp21 + = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCoreApp, new Version(2, 1, 0, 0)); + } +} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/PeReaderUtils.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/PeReaderUtils.cs index fc3d19587..73cb9e64f 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/PeReaderUtils.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/PeReaderUtils.cs @@ -78,7 +78,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities { // TODO: Nick Guerrera (Nick.Guerrera@microsoft.com) hacked this method for temporary use. // There is a blob decoder feature in progress but it won't ship in time for our milestone. - // Replace this method with the blob decoder feature when later it is availale. + // Replace this method with the blob decoder feature when later it is available. var signature = reader.GetMemberReference((MemberReferenceHandle)attribute.Constructor).Signature; var signatureReader = reader.GetBlobReader(signature); diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs index 2f5e1e830..056b1c197 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs @@ -20,7 +20,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities private string _stage2Sdk; private string _stage2WithBackwardsCompatibleRuntimesDirectory; private string _testPackages; - private string _pjDotnet; + private string _testWorkingFolder; public static string RepoRoot { @@ -37,9 +37,14 @@ namespace Microsoft.DotNet.Tools.Test.Utilities string directory = AppContext.BaseDirectory; #endif - while (!Directory.Exists(Path.Combine(directory, ".git")) && directory != null) + while (directory != null) { - directory = Directory.GetParent(directory).FullName; + var gitDirOrFile = Path.Combine(directory, ".git"); + if (Directory.Exists(gitDirOrFile) || File.Exists(gitDirOrFile)) + { + break; + } + directory = Directory.GetParent(directory)?.FullName; } if (directory == null) @@ -58,7 +63,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities { if (string.IsNullOrEmpty(s_buildRid)) { - var buildInfoPath = Path.Combine(RepoRoot, "artifacts", "obj", "BuildInfo.props"); + var buildInfoPath = Path.Combine(RepoRoot, "bin", "obj", "BuildInfo.props"); var root = XDocument.Load(buildInfoPath).Root; var ns = root.Name.Namespace; @@ -81,38 +86,46 @@ namespace Microsoft.DotNet.Tools.Test.Utilities public string Artifacts => _artifacts; public string BuiltDotnet => _builtDotnet; public string NugetPackages => _nugetPackages; - public string PjDotnet => _pjDotnet; public string Stage2Sdk => _stage2Sdk; public string Stage2WithBackwardsCompatibleRuntimesDirectory => _stage2WithBackwardsCompatibleRuntimesDirectory; public string TestPackages => _testPackages; + public string TestWorkingFolder => _testWorkingFolder; public RepoDirectoriesProvider( string artifacts = null, string builtDotnet = null, string nugetPackages = null, string corehostPackages = null, - string corehostDummyPackages = null, - string pjDotnet = null) + string corehostDummyPackages = null) { - _artifacts = artifacts ?? Path.Combine(RepoRoot, "artifacts", BuildRid); + // Ideally this wouldn't be hardcoded, so that you could use stage n to build stage n + 1, and then use stage n + 1 to run tests + int previousStage = 2; + + _artifacts = artifacts ?? Path.Combine(RepoRoot, + "bin", + previousStage.ToString(), + BuildRid); _builtDotnet = builtDotnet ?? Path.Combine(_artifacts, "intermediate", "sharedFrameworkPublish"); _nugetPackages = nugetPackages ?? Path.Combine(RepoRoot, ".nuget", "packages"); - _pjDotnet = pjDotnet ?? GetPjDotnetPath(); _stage2Sdk = Directory - .EnumerateDirectories(Path.Combine(_artifacts, "stage2", "sdk")) + .EnumerateDirectories(Path.Combine(_artifacts, "dotnet", "sdk")) .First(d => !d.Contains("NuGetFallbackFolder")); _stage2WithBackwardsCompatibleRuntimesDirectory = - Path.Combine(_artifacts, "stage2WithBackwardsCompatibleRuntimes"); - _testPackages = Path.Combine(RepoRoot, "artifacts", "testpackages", "packages"); - } + Path.Combine(_artifacts, "dotnetWithBackwardsCompatibleRuntimes"); - private string GetPjDotnetPath() - { - return new DirectoryInfo(Path.Combine(RepoRoot, ".dotnet_stage0PJ")) - .GetDirectories().First() - .GetFiles("dotnet*").First() - .FullName; + _testPackages = Environment.GetEnvironmentVariable("TEST_PACKAGES"); + if (string.IsNullOrEmpty(_testPackages)) + { + throw new InvalidOperationException("TEST_PACKAGES environment variable not set"); + } + + _testWorkingFolder = Path.Combine(RepoRoot, + "bin", + (previousStage + 1).ToString(), + BuildRid, + "test"); + } } } diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/TestBase.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/TestBase.cs index b377b4331..6c2c43346 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/TestBase.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/TestBase.cs @@ -53,7 +53,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities s_testAssets = new TestAssets( new DirectoryInfo(assetsRoot), new FileInfo(new Muxer().MuxerPath), - new FileInfo(new RepoDirectoriesProvider().PjDotnet)); + new RepoDirectoriesProvider().TestWorkingFolder); } return s_testAssets; diff --git a/test/MsBuildScript.Tests/runtests.target b/test/MsBuildScript.Tests/runtests.target new file mode 100644 index 000000000..3039fbe39 --- /dev/null +++ b/test/MsBuildScript.Tests/runtests.target @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj b/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj index ded34abd0..b6b9a6ed0 100644 --- a/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj +++ b/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj @@ -1,16 +1,17 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) Msbuild.Tests.Utilities $(AssetTargetFallback);dotnet5.4;portable-net451+win8 + ../../tools/Key.snk + true + true - + @@ -19,7 +20,7 @@ - + diff --git a/test/binding-redirects.Tests/NuGet.Config b/test/binding-redirects.Tests/NuGet.Config deleted file mode 100644 index 507db39a6..000000000 --- a/test/binding-redirects.Tests/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/test/binding-redirects.Tests/binding-redirects.Tests.csproj b/test/binding-redirects.Tests/binding-redirects.Tests.csproj index 7922a876d..c1a94e084 100644 --- a/test/binding-redirects.Tests/binding-redirects.Tests.csproj +++ b/test/binding-redirects.Tests/binding-redirects.Tests.csproj @@ -1,5 +1,4 @@  - $(CliTargetFramework) @@ -7,6 +6,7 @@ true binding-redirects.Tests $(AssetTargetFallback);dotnet5.4;portable-net451+win8 + $(TestOutputDir)/packages @@ -14,9 +14,9 @@ - - - + + + diff --git a/test/crossgen.Tests/crossgen.Tests.csproj b/test/crossgen.Tests/crossgen.Tests.csproj index 980cd78e7..1849d5995 100644 --- a/test/crossgen.Tests/crossgen.Tests.csproj +++ b/test/crossgen.Tests/crossgen.Tests.csproj @@ -1,5 +1,4 @@  - $(CliTargetFramework) @@ -15,8 +14,8 @@ - - - + + + diff --git a/test/dotnet-add-package.Tests/GivenDotnetPackageAdd.cs b/test/dotnet-add-package.Tests/GivenDotnetPackageAdd.cs index 356d86ce4..268c64f33 100644 --- a/test/dotnet-add-package.Tests/GivenDotnetPackageAdd.cs +++ b/test/dotnet-add-package.Tests/GivenDotnetPackageAdd.cs @@ -107,7 +107,7 @@ namespace Microsoft.DotNet.Cli.Package.Add.Tests var packageName = "Newtonsoft.Json"; var packageVersion = "9.0.1"; - var framework = "netcoreapp2.0"; + var framework = "netcoreapp2.1"; var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) .ExecuteWithCapturedOutput($"add package {packageName} --version {packageVersion} --framework {framework}"); diff --git a/test/dotnet-add-package.Tests/dotnet-add-package.Tests.csproj b/test/dotnet-add-package.Tests/dotnet-add-package.Tests.csproj index 36ec73b00..c6c69f4b5 100644 --- a/test/dotnet-add-package.Tests/dotnet-add-package.Tests.csproj +++ b/test/dotnet-add-package.Tests/dotnet-add-package.Tests.csproj @@ -1,6 +1,4 @@ - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -17,14 +15,14 @@ - +
- - - + + + diff --git a/test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs b/test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs index bbe339071..ba37b1e73 100644 --- a/test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs +++ b/test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs @@ -661,7 +661,7 @@ Commands: [InlineData("nonexistingframeworkname")] public void WhenFrameworkSwitchIsNotMatchingAnyOfTargetedFrameworksItPrintsError(string framework) { - var setup = Setup(); + var setup = Setup(framework); var lib = new ProjDir(setup.LibDir); var net45lib = new ProjDir(Path.Combine(setup.TestRoot, "Net45Lib")); 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 46b4c5b3a..2159632fc 100644 --- a/test/dotnet-add-reference.Tests/dotnet-add-reference.Tests.csproj +++ b/test/dotnet-add-reference.Tests/dotnet-add-reference.Tests.csproj @@ -1,5 +1,4 @@  - $(CliTargetFramework) @@ -20,10 +19,10 @@
- - + + - + diff --git a/test/dotnet-back-compat.Tests/dotnet-back-compat.Tests.csproj b/test/dotnet-back-compat.Tests/dotnet-back-compat.Tests.csproj index 0b7b9fa26..5e9a3b304 100644 --- a/test/dotnet-back-compat.Tests/dotnet-back-compat.Tests.csproj +++ b/test/dotnet-back-compat.Tests/dotnet-back-compat.Tests.csproj @@ -1,6 +1,4 @@ - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -13,8 +11,8 @@
- - - + + + diff --git a/test/dotnet-build.Tests/GivenDotnetBuildBuildsCsproj.cs b/test/dotnet-build.Tests/GivenDotnetBuildBuildsCsproj.cs index febd7a9b3..26845ee01 100644 --- a/test/dotnet-build.Tests/GivenDotnetBuildBuildsCsproj.cs +++ b/test/dotnet-build.Tests/GivenDotnetBuildBuildsCsproj.cs @@ -29,7 +29,7 @@ namespace Microsoft.DotNet.Cli.Build.Tests var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; - var outputDll = testInstance.Root.GetDirectory("bin", configuration, "netcoreapp2.0") + var outputDll = testInstance.Root.GetDirectory("bin", configuration, "netcoreapp2.1") .GetFile($"{testAppName}.dll"); var outputRunCommand = new DotnetCommand(); @@ -66,7 +66,7 @@ namespace Microsoft.DotNet.Cli.Build.Tests new BuildCommand() .WithWorkingDirectory(projectDirectory) - .Execute("--framework netcoreapp2.0") + .Execute("--framework netcoreapp2.1") .Should().Pass(); } @@ -93,7 +93,7 @@ namespace Microsoft.DotNet.Cli.Build.Tests string dir = "pkgs"; string args = $"--packages {dir}"; - string newArgs = $"console -f netcoreapp2.0 -o \"{rootPath}\" --debug:ephemeral-hive --no-restore"; + string newArgs = $"console -f netcoreapp2.1 -o \"{rootPath}\" --debug:ephemeral-hive --no-restore"; new NewCommandShim() .WithWorkingDirectory(rootPath) .Execute(newArgs) @@ -115,7 +115,7 @@ namespace Microsoft.DotNet.Cli.Build.Tests var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; var outputDll = Directory.EnumerateFiles( - Path.Combine(rootPath, "bin", configuration, "netcoreapp2.0"), "*.dll", + Path.Combine(rootPath, "bin", configuration, "netcoreapp2.1"), "*.dll", SearchOption.TopDirectoryOnly) .Single(); @@ -131,7 +131,7 @@ namespace Microsoft.DotNet.Cli.Build.Tests { var testAppName = "MSBuildTestApp"; var testInstance = TestAssets.Get(testAppName) - .CreateInstance(testAppName) + .CreateInstance() .WithSourceFiles() .WithRestoreFiles(); diff --git a/test/dotnet-build.Tests/dotnet-build.Tests.csproj b/test/dotnet-build.Tests/dotnet-build.Tests.csproj index d72a8f986..3475413bc 100644 --- a/test/dotnet-build.Tests/dotnet-build.Tests.csproj +++ b/test/dotnet-build.Tests/dotnet-build.Tests.csproj @@ -1,5 +1,4 @@  - $(CliTargetFramework) @@ -14,9 +13,9 @@
- - - + + + diff --git a/test/dotnet-clean.Tests/GivenDotnetCleanCleansBuildArtifacts.cs b/test/dotnet-clean.Tests/GivenDotnetCleanCleansBuildArtifacts.cs index 7ac4dd0e6..474a7f2b1 100644 --- a/test/dotnet-clean.Tests/GivenDotnetCleanCleansBuildArtifacts.cs +++ b/test/dotnet-clean.Tests/GivenDotnetCleanCleansBuildArtifacts.cs @@ -28,7 +28,7 @@ namespace Microsoft.DotNet.Cli.Clean.Tests .Should().Pass(); var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; - var outputFolder = testInstance.Root.GetDirectory("bin", configuration, "netcoreapp2.0", "win7-x64"); + var outputFolder = testInstance.Root.GetDirectory("bin", configuration, "netcoreapp2.1", "win7-x64"); outputFolder.Should().NotBeEmpty(); diff --git a/test/dotnet-clean.Tests/dotnet-clean.Tests.csproj b/test/dotnet-clean.Tests/dotnet-clean.Tests.csproj index 831a64d3b..598fee5cf 100644 --- a/test/dotnet-clean.Tests/dotnet-clean.Tests.csproj +++ b/test/dotnet-clean.Tests/dotnet-clean.Tests.csproj @@ -1,6 +1,4 @@ - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -14,9 +12,9 @@
- - - + + + diff --git a/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs b/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs index 29c00b2fb..a04148507 100644 --- a/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs +++ b/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs @@ -38,6 +38,8 @@ SDK commands: nuget Provides additional NuGet commands. msbuild Runs Microsoft Build Engine (MSBuild). vstest Runs Microsoft Test Execution Command Line Tool. + store Stores the specified assemblies in the runtime store. + help Show help. Common options: -v|--verbosity Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. @@ -54,7 +56,7 @@ runtime-options: --additionalprobingpath Path containing probing policy and assemblies to probe for. --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."; + --additional-deps Path to additional deps.json file."; [Theory] [InlineData("--help")] @@ -89,6 +91,19 @@ runtime-options: cmd.StdOut.Should().ContainVisuallySameFragmentIfNotLocalized(HelpText); } + [Theory] + [InlineData("complete")] + [InlineData("parse")] + public void WhenCommandWithoutDocLinkIsPassedToDotnetHelpItPrintsError(string command) + { + var cmd = new DotnetCommand() + .ExecuteWithCapturedOutput($"help {command}"); + + cmd.Should().Fail(); + cmd.StdErr.Should().Contain(string.Format(Tools.Help.LocalizableStrings.CommandDoesNotExist, command)); + cmd.StdOut.Should().ContainVisuallySameFragmentIfNotLocalized(HelpText); + } + [WindowsOnlyFact] public void WhenRunOnWindowsDotnetHelpCommandShouldContainProperProcessInformation() { diff --git a/test/dotnet-help.Tests/dotnet-help.Tests.csproj b/test/dotnet-help.Tests/dotnet-help.Tests.csproj index 88443c674..2200ed754 100644 --- a/test/dotnet-help.Tests/dotnet-help.Tests.csproj +++ b/test/dotnet-help.Tests/dotnet-help.Tests.csproj @@ -1,6 +1,4 @@ - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -18,9 +16,9 @@
- - + + - + 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 c62326007..c8cbdc0bc 100644 --- a/test/dotnet-list-reference.Tests/dotnet-list-reference.Tests.csproj +++ b/test/dotnet-list-reference.Tests/dotnet-list-reference.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -19,9 +17,9 @@
- - - + + + diff --git a/test/dotnet-migrate.Tests/dotnet-migrate.Tests.csproj b/test/dotnet-migrate.Tests/dotnet-migrate.Tests.csproj index 2a9fe2963..e15451f82 100644 --- a/test/dotnet-migrate.Tests/dotnet-migrate.Tests.csproj +++ b/test/dotnet-migrate.Tests/dotnet-migrate.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -23,11 +21,12 @@
- - - + + + + diff --git a/test/dotnet-msbuild.Tests/GivenDotnetPackInvocation.cs b/test/dotnet-msbuild.Tests/GivenDotnetPackInvocation.cs index 74559a6fa..fa666f150 100644 --- a/test/dotnet-msbuild.Tests/GivenDotnetPackInvocation.cs +++ b/test/dotnet-msbuild.Tests/GivenDotnetPackInvocation.cs @@ -12,6 +12,7 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests public class GivenDotnetPackInvocation { const string ExpectedPrefix = "exec /m /v:m /restore /t:pack"; + const string ExpectedNoBuildPrefix = "exec /m /v:m /t:pack"; [Theory] [InlineData(new string[] { }, "")] @@ -34,9 +35,10 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests var msbuildPath = ""; var command = PackCommand.FromArgs(args, msbuildPath); + var expectedPrefix = args.FirstOrDefault() == "--no-build" ? ExpectedNoBuildPrefix : ExpectedPrefix; command.SeparateRestoreCommand.Should().BeNull(); - command.GetProcessStartInfo().Arguments.Should().Be($"{ExpectedPrefix}{expectedAdditionalArgs}"); + command.GetProcessStartInfo().Arguments.Should().Be($"{expectedPrefix}{expectedAdditionalArgs}"); } } } diff --git a/test/dotnet-msbuild.Tests/dotnet-msbuild.Tests.csproj b/test/dotnet-msbuild.Tests/dotnet-msbuild.Tests.csproj index 4a20f6cf9..6259dcebe 100644 --- a/test/dotnet-msbuild.Tests/dotnet-msbuild.Tests.csproj +++ b/test/dotnet-msbuild.Tests/dotnet-msbuild.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -18,8 +16,8 @@
- - - + + + diff --git a/test/dotnet-new.Tests/AspNetNuGetConfiguration.cs b/test/dotnet-new.Tests/AspNetNuGetConfiguration.cs new file mode 100644 index 000000000..b49c81009 --- /dev/null +++ b/test/dotnet-new.Tests/AspNetNuGetConfiguration.cs @@ -0,0 +1,17 @@ +using System.IO; + +namespace Microsoft.DotNet.New.Tests +{ + public class AspNetNuGetConfiguration + { + public static void WriteNuGetConfigWithAspNetPrivateFeeds(string path) + { + string resourceName = "dotnet-new.Tests.NuGet.tempaspnetpatch.config"; + using (Stream input = typeof(GivenThatIWantANewAppWithSpecifiedType).Assembly.GetManifestResourceStream(resourceName)) + using (Stream output = File.OpenWrite(path)) + { + input.CopyTo(output); + } + } + } +} \ No newline at end of file diff --git a/test/dotnet-new.Tests/GivenThatIWantANewApp.cs b/test/dotnet-new.Tests/GivenThatIWantANewApp.cs index cac098694..ad0f8106c 100644 --- a/test/dotnet-new.Tests/GivenThatIWantANewApp.cs +++ b/test/dotnet-new.Tests/GivenThatIWantANewApp.cs @@ -44,11 +44,17 @@ namespace Microsoft.DotNet.New.Tests var rootPath = TestAssets.CreateTestDirectory().FullName; var packagesDirectory = Path.Combine(rootPath, "packages"); + // For testing the 2.1 templates - some of their packages are currently only in private feeds. + var configFile = Path.Combine(rootPath, "NuGet.Config"); + AspNetNuGetConfiguration.WriteNuGetConfigWithAspNetPrivateFeeds(configFile); + // For "normal" builds, once the packages needed for 2.1 templates are in the public feeds + //var configFile = Path.Combine(RepoDirectoriesProvider.RepoRoot, "NuGet.Config"); + foreach (string cSharpTemplate in cSharpTemplates) { var projectFolder = Path.Combine(rootPath, cSharpTemplate + "1"); Directory.CreateDirectory(projectFolder); - CreateAndRestoreNewProject(cSharpTemplate, projectFolder, packagesDirectory); + CreateAndRestoreNewProject(cSharpTemplate, projectFolder, packagesDirectory, configFile); } Directory.EnumerateFiles(packagesDirectory, $"*.nupkg", SearchOption.AllDirectories) @@ -58,31 +64,30 @@ namespace Microsoft.DotNet.New.Tests private void CreateAndRestoreNewProject( string projectType, string projectFolder, - string packagesDirectory) + string packagesDirectory, + string configFile) { - var repoRootNuGetConfig = Path.Combine(RepoDirectoriesProvider.RepoRoot, "NuGet.Config"); - new NewCommand() .WithWorkingDirectory(projectFolder) .Execute($"{projectType} --debug:ephemeral-hive --no-restore") .Should().Pass(); - // https://github.com/dotnet/templating/issues/946 - remove DisableImplicitAssetTargetFallback once this is fixed. new RestoreCommand() .WithWorkingDirectory(projectFolder) - .Execute($"--configfile {repoRootNuGetConfig} --packages {packagesDirectory} /p:DisableImplicitAssetTargetFallback=true") + .Execute($"--configfile {configFile} --packages {packagesDirectory}") .Should().Pass(); } [Theory] [InlineData("console", "microsoft.netcore.app")] - [InlineData("classlib", "netstandard.library")] + // re-enable when this bug is resolved: https://github.com/dotnet/cli/issues/7574 + //[InlineData("classlib", "netstandard.library")] public void NewProjectRestoresCorrectPackageVersion(string type, string packageName) { var rootPath = TestAssets.CreateTestDirectory(identifier: $"_{type}").FullName; var packagesDirectory = Path.Combine(rootPath, "packages"); var projectName = "Project"; - var expectedVersion = "2.0.0"; + var expectedVersion = GetFrameworkPackageVersion(); var repoRootNuGetConfig = Path.Combine(RepoDirectoriesProvider.RepoRoot, "NuGet.Config"); new NewCommand() @@ -98,6 +103,32 @@ namespace Microsoft.DotNet.New.Tests new DirectoryInfo(Path.Combine(packagesDirectory, packageName)) .Should().Exist() .And.HaveDirectory(expectedVersion); + + string GetFrameworkPackageVersion() + { + var dotnetDir = new FileInfo(DotnetUnderTest.FullName).Directory; + var sharedFxDir = dotnetDir + .GetDirectory("shared", "Microsoft.NETCore.App") + .EnumerateDirectories() + .Single(d => d.Name.StartsWith("2.1.0")); + + if (packageName == "microsoft.netcore.app") + { + return sharedFxDir.Name; + } + + var depsFile = Path.Combine(sharedFxDir.FullName, "Microsoft.NETCore.App.deps.json"); + using (var stream = File.OpenRead(depsFile)) + using (var reader = new DependencyContextJsonReader()) + { + var context = reader.Read(stream); + var dependency = context + .RuntimeLibraries + .Single(library => string.Equals(library.Name, packageName, StringComparison.OrdinalIgnoreCase)); + + return dependency.Version; + } + } } } } diff --git a/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs b/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs index 96bb47c51..e1c1fea85 100644 --- a/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs +++ b/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs @@ -20,14 +20,15 @@ namespace Microsoft.DotNet.New.Tests [InlineData("C#", "classlib", false, false)] [InlineData("C#", "mstest", false, false)] [InlineData("C#", "xunit", false, false)] - [InlineData("C#", "web", false, false)] - [InlineData("C#", "mvc", false, false)] - [InlineData("C#", "webapi", false, false)] + [InlineData("C#", "web", true, false)] + [InlineData("C#", "mvc", true, false)] + [InlineData("C#", "webapi", true, false)] [InlineData("C#", "angular", false, true)] [InlineData("C#", "react", false, true)] [InlineData("C#", "reactredux", false, true)] [InlineData("F#", "console", false, false)] - [InlineData("F#", "classlib", false, false)] + // re-enable when this bug is resolved: https://github.com/dotnet/cli/issues/7574 + //[InlineData("F#", "classlib", false, false)] [InlineData("F#", "mstest", false, false)] [InlineData("F#", "xunit", false, false)] [InlineData("F#", "mvc", true, false)] @@ -50,8 +51,7 @@ namespace Microsoft.DotNet.New.Tests if (useNuGetConfigForAspNet) { - var configFile = new FileInfo(Path.Combine(rootPath, "..", "..", "..", "..", "..", "NuGet.tempaspnetpatch.config")); - File.Copy(configFile.FullName, Path.Combine(rootPath, "NuGet.Config")); + AspNetNuGetConfiguration.WriteNuGetConfigWithAspNetPrivateFeeds(Path.Combine(rootPath, "NuGet.Config")); } if (skipSpaWebpackSteps) @@ -61,10 +61,9 @@ namespace Microsoft.DotNet.New.Tests Directory.CreateDirectory(Path.Combine(rootPath, "wwwroot", "dist")); } - // https://github.com/dotnet/templating/issues/946 - remove DisableImplicitAssetTargetFallback once this is fixed. new TestCommand("dotnet") .WithWorkingDirectory(rootPath) - .Execute($"restore /p:DisableImplicitAssetTargetFallback=true") + .Execute($"restore") .Should().Pass(); var buildResult = new TestCommand("dotnet") diff --git a/test/dotnet-new.Tests/NuGet.tempaspnetpatch.config b/test/dotnet-new.Tests/NuGet.tempaspnetpatch.config index 33b9693d5..87150a28d 100644 --- a/test/dotnet-new.Tests/NuGet.tempaspnetpatch.config +++ b/test/dotnet-new.Tests/NuGet.tempaspnetpatch.config @@ -5,6 +5,7 @@ + diff --git a/test/dotnet-new.Tests/dotnet-new.Tests.csproj b/test/dotnet-new.Tests/dotnet-new.Tests.csproj index 7dc7368f6..133fd9730 100644 --- a/test/dotnet-new.Tests/dotnet-new.Tests.csproj +++ b/test/dotnet-new.Tests/dotnet-new.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -9,15 +7,20 @@ $(AssetTargetFallback);dnxcore50;portable-net45+win8 + + + + + - - + + - + diff --git a/test/dotnet-nuget.UnitTests/dotnet-nuget.UnitTests.csproj b/test/dotnet-nuget.UnitTests/dotnet-nuget.UnitTests.csproj index 327ad4bec..4eb2c0794 100644 --- a/test/dotnet-nuget.UnitTests/dotnet-nuget.UnitTests.csproj +++ b/test/dotnet-nuget.UnitTests/dotnet-nuget.UnitTests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -16,9 +14,10 @@
- - - + + + + diff --git a/test/dotnet-pack.Tests/PackTests.cs b/test/dotnet-pack.Tests/PackTests.cs index 32b940a45..1c24fa5c9 100644 --- a/test/dotnet-pack.Tests/PackTests.cs +++ b/test/dotnet-pack.Tests/PackTests.cs @@ -186,6 +186,25 @@ namespace Microsoft.DotNet.Tools.Pack.Tests .Should().Pass(); } + [Fact] + public void ItDoesNotImplicitlyBuildAProjectWhenPackagingWithTheNoBuildOption() + { + var testInstance = TestAssets.Get("TestAppSimple") + .CreateInstance() + .WithSourceFiles(); + + var result = new PackCommand() + .WithWorkingDirectory(testInstance.Root) + .ExecuteWithCapturedOutput("--no-build"); + + result.Should().Fail(); + if (!DotnetUnderTest.IsLocalized()) + { + result.Should().NotHaveStdOutContaining("Restore") + .And.HaveStdOutContaining("project.assets.json"); + } + } + [Fact] public void ItDoesNotImplicitlyRestoreAProjectWhenPackagingWithTheNoRestoreOption() { diff --git a/test/dotnet-pack.Tests/dotnet-pack.Tests.csproj b/test/dotnet-pack.Tests/dotnet-pack.Tests.csproj index 755ce3f43..a33adc3bb 100644 --- a/test/dotnet-pack.Tests/dotnet-pack.Tests.csproj +++ b/test/dotnet-pack.Tests/dotnet-pack.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -22,9 +20,9 @@
- - + + - + diff --git a/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs b/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs index 2db2018fa..aa705a0c2 100644 --- a/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs +++ b/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs @@ -33,11 +33,11 @@ namespace Microsoft.DotNet.Cli.Publish.Tests new PublishCommand() .WithWorkingDirectory(testProjectDirectory) - .Execute("--framework netcoreapp2.0") + .Execute("--framework netcoreapp2.1") .Should().Pass(); var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; - var outputDll = Path.Combine(testProjectDirectory, "bin", configuration, "netcoreapp2.0", "publish", $"{testAppName}.dll"); + var outputDll = Path.Combine(testProjectDirectory, "bin", configuration, "netcoreapp2.1", "publish", $"{testAppName}.dll"); new DotnetCommand() .ExecuteWithCapturedOutput(outputDll) @@ -57,7 +57,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests new PublishCommand() .WithWorkingDirectory(testProjectDirectory) - .Execute("--framework netcoreapp2.0") + .Execute("--framework netcoreapp2.1") .Should().Pass(); } @@ -74,7 +74,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests new PublishCommand() .WithWorkingDirectory(projectDirectory) - .Execute("--framework netcoreapp2.0") + .Execute("--framework netcoreapp2.1") .Should().Pass(); } @@ -90,7 +90,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests new PublishCommand() .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput("--framework netcoreapp2.0 --no-restore") + .ExecuteWithCapturedOutput("--framework netcoreapp2.1 --no-restore") .Should().Fail() .And.HaveStdOutContaining("project.assets.json"); } @@ -110,7 +110,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests var rid = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier(); new PublishCommand() - .WithFramework("netcoreapp2.0") + .WithFramework("netcoreapp2.1") .WithRuntime(rid) .WithWorkingDirectory(testProjectDirectory) .Execute() @@ -119,7 +119,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; var outputProgram = testProjectDirectory - .GetDirectory("bin", configuration, "netcoreapp2.0", rid, "publish", $"{testAppName}{Constants.ExeSuffix}") + .GetDirectory("bin", configuration, "netcoreapp2.1", rid, "publish", $"{testAppName}{Constants.ExeSuffix}") .FullName; EnsureProgramIsRunnable(outputProgram); @@ -185,7 +185,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; return testProjectDirectory - .GetDirectory("bin", configuration, "netcoreapp2.0", rid, "publish"); + .GetDirectory("bin", configuration, "netcoreapp2.1", rid, "publish"); } private static void EnsureProgramIsRunnable(string path) @@ -227,7 +227,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; var outputProgram = rootDir - .GetDirectory("bin", configuration, "netcoreapp2.0", "publish", $"{rootDir.Name}.dll") + .GetDirectory("bin", configuration, "netcoreapp2.1", "publish", $"{rootDir.Name}.dll") .FullName; new TestCommand(outputProgram) diff --git a/test/dotnet-publish.Tests/dotnet-publish.Tests.csproj b/test/dotnet-publish.Tests/dotnet-publish.Tests.csproj index 5641910fa..31a477569 100644 --- a/test/dotnet-publish.Tests/dotnet-publish.Tests.csproj +++ b/test/dotnet-publish.Tests/dotnet-publish.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -21,8 +19,8 @@
- - - + + + diff --git a/test/dotnet-remove-package.Tests/dotnet-remove-package.Tests.csproj b/test/dotnet-remove-package.Tests/dotnet-remove-package.Tests.csproj index 84669fe6d..3d884fbd5 100644 --- a/test/dotnet-remove-package.Tests/dotnet-remove-package.Tests.csproj +++ b/test/dotnet-remove-package.Tests/dotnet-remove-package.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -19,9 +17,9 @@
- - - + + + 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 53a68dce5..4d571f9e4 100644 --- a/test/dotnet-remove-reference.Tests/dotnet-remove-reference.Tests.csproj +++ b/test/dotnet-remove-reference.Tests/dotnet-remove-reference.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -19,9 +17,9 @@ - - - + + + diff --git a/test/dotnet-restore.Tests/dotnet-restore.Tests.csproj b/test/dotnet-restore.Tests/dotnet-restore.Tests.csproj index 812246448..f92bf8f68 100644 --- a/test/dotnet-restore.Tests/dotnet-restore.Tests.csproj +++ b/test/dotnet-restore.Tests/dotnet-restore.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -15,10 +13,10 @@ - - + + - + diff --git a/test/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs b/test/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs index 5fa67328e..6f3f14e65 100644 --- a/test/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs +++ b/test/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs @@ -70,11 +70,30 @@ namespace Microsoft.DotNet.Cli.Run.Tests new RunCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("--framework netcoreapp2.0") + .ExecuteWithCapturedOutput("--framework netcoreapp2.1") .Should().Pass() .And.HaveStdOutContaining("This string came from the test library!"); } + [Fact] + public void ItDoesNotImplicitlyBuildAProjectWhenRunningWithTheNoBuildOption() + { + var testAppName = "MSBuildTestApp"; + var testInstance = TestAssets.Get(testAppName) + .CreateInstance() + .WithSourceFiles(); + + var result = new RunCommand() + .WithWorkingDirectory(testInstance.Root.FullName) + .ExecuteWithCapturedOutput("--no-build -v:m"); + + result.Should().Fail(); + if (!DotnetUnderTest.IsLocalized()) + { + result.Should().NotHaveStdOutContaining("Restore"); + } + } + [Fact] public void ItDoesNotImplicitlyRestoreAProjectWhenRunningWithTheNoRestoreOption() { @@ -131,7 +150,7 @@ namespace Microsoft.DotNet.Cli.Run.Tests new RunCommand() .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput("--framework netcoreapp2.0") + .ExecuteWithCapturedOutput("--framework netcoreapp2.1") .Should().Pass() .And.HaveStdOutContaining("Hello World!"); } @@ -518,5 +537,27 @@ namespace Microsoft.DotNet.Cli.Run.Tests .And.HaveStdOutContaining("(NO MESSAGE)") .And.HaveStdErrContaining(string.Format(LocalizableStrings.RunCommandExceptionCouldNotApplyLaunchSettings, LocalizableStrings.DefaultLaunchProfileDisplayName, "").Trim()); } + + [Fact] + public void ItRunsWithTheSpecifiedVerbosity() + { + var testAppName = "MSBuildTestApp"; + var testInstance = TestAssets.Get(testAppName) + .CreateInstance() + .WithSourceFiles(); + + var result = new RunCommand() + .WithWorkingDirectory( testInstance.Root.FullName) + .ExecuteWithCapturedOutput("-v:n"); + + result.Should().Pass() + .And.HaveStdOutContaining("Hello World!"); + + if (!DotnetUnderTest.IsLocalized()) + { + result.Should().HaveStdOutContaining("Restore") + .And.HaveStdOutContaining("CoreCompile"); + } + } } } diff --git a/test/dotnet-run.Tests/dotnet-run.Tests.csproj b/test/dotnet-run.Tests/dotnet-run.Tests.csproj index e1b7fbe50..e00d11b48 100644 --- a/test/dotnet-run.Tests/dotnet-run.Tests.csproj +++ b/test/dotnet-run.Tests/dotnet-run.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -18,8 +16,8 @@ - - - + + + diff --git a/test/dotnet-sln-add.Tests/dotnet-sln-add.Tests.csproj b/test/dotnet-sln-add.Tests/dotnet-sln-add.Tests.csproj index 6bc9287df..b3ccdaa4b 100644 --- a/test/dotnet-sln-add.Tests/dotnet-sln-add.Tests.csproj +++ b/test/dotnet-sln-add.Tests/dotnet-sln-add.Tests.csproj @@ -1,6 +1,4 @@ - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -17,14 +15,14 @@ - + - - - + + + diff --git a/test/dotnet-sln-list.Tests/dotnet-sln-list.Tests.csproj b/test/dotnet-sln-list.Tests/dotnet-sln-list.Tests.csproj index a7b806863..127f0ef56 100644 --- a/test/dotnet-sln-list.Tests/dotnet-sln-list.Tests.csproj +++ b/test/dotnet-sln-list.Tests/dotnet-sln-list.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -17,13 +15,13 @@ - + - - - + + + diff --git a/test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs b/test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs index 78f64b25f..0b0b6a7e2 100644 --- a/test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs +++ b/test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs @@ -169,6 +169,42 @@ Global {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86 EndGlobalSection EndGlobal +"; + + private const string ExpectedSlnContentsAfterRemoveProjectWithDependencies = @" +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27110.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project(""{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"") = ""App"", ""App\App.csproj"", ""{BB02B949-F6BD-4872-95CB-96A05B1FE026}"" + ProjectSection(ProjectDependencies) = postProject + {D53E177A-8ECF-43D5-A01E-98B884D53CA6} = {D53E177A-8ECF-43D5-A01E-98B884D53CA6} + EndProjectSection +EndProject +Project(""{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"") = ""First"", ""First\First.csproj"", ""{D53E177A-8ECF-43D5-A01E-98B884D53CA6}"" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BB02B949-F6BD-4872-95CB-96A05B1FE026}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BB02B949-F6BD-4872-95CB-96A05B1FE026}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BB02B949-F6BD-4872-95CB-96A05B1FE026}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BB02B949-F6BD-4872-95CB-96A05B1FE026}.Release|Any CPU.Build.0 = Release|Any CPU + {D53E177A-8ECF-43D5-A01E-98B884D53CA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D53E177A-8ECF-43D5-A01E-98B884D53CA6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D53E177A-8ECF-43D5-A01E-98B884D53CA6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D53E177A-8ECF-43D5-A01E-98B884D53CA6}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F6D9A973-1CFD-41C9-84F2-1471C0FE67DF} + EndGlobalSection +EndGlobal "; [Theory] @@ -556,5 +592,27 @@ EndGlobal File.ReadAllText(solutionPath) .Should().BeVisuallyEquivalentTo(ExpectedSlnContentsAfterRemoveLastNestedProj); } + + [Fact] + public void WhenProjectIsRemovedThenDependenciesOnProjectAreAlsoRemoved() + { + var projectDirectory = TestAssets + .Get("TestAppWithSlnProjectDependencyToRemove") + .CreateInstance() + .WithSourceFiles() + .Root + .FullName; + + var solutionPath = Path.Combine(projectDirectory, "App.sln"); + + var projectToRemove = Path.Combine("Second", "Second.csproj"); + var cmd = new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .ExecuteWithCapturedOutput($"sln remove {projectToRemove}"); + cmd.Should().Pass(); + + File.ReadAllText(solutionPath) + .Should().BeVisuallyEquivalentTo(ExpectedSlnContentsAfterRemoveProjectWithDependencies); + } } } diff --git a/test/dotnet-sln-remove.Tests/dotnet-sln-remove.Tests.csproj b/test/dotnet-sln-remove.Tests/dotnet-sln-remove.Tests.csproj index 8609bdb05..c539b822b 100644 --- a/test/dotnet-sln-remove.Tests/dotnet-sln-remove.Tests.csproj +++ b/test/dotnet-sln-remove.Tests/dotnet-sln-remove.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -17,13 +15,13 @@ - + - - - + + + diff --git a/test/dotnet-store.Tests/GivenDotnetStoresAndPublishesProjects.cs b/test/dotnet-store.Tests/GivenDotnetStoresAndPublishesProjects.cs index 00360f446..a0e95d8f9 100644 --- a/test/dotnet-store.Tests/GivenDotnetStoresAndPublishesProjects.cs +++ b/test/dotnet-store.Tests/GivenDotnetStoresAndPublishesProjects.cs @@ -13,7 +13,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests { public class GivenDotnetStoresAndPublishesProjects : TestBase { - private static string _tfm = "netcoreapp2.0"; + private static string _tfm = "netcoreapp2.1"; private static string _frameworkVersion = TestAssetInstance.CurrentRuntimeFrameworkVersion; private static string _arch = RuntimeEnvironment.RuntimeArchitecture.ToLowerInvariant(); @@ -108,7 +108,8 @@ namespace Microsoft.DotNet.Cli.Publish.Tests " path: 'lib/netstandard1.3/NuGet.Configuration.dll'"); } - [Fact] + // Windows only for now due to https://github.com/dotnet/cli/issues/7501 + [WindowsOnlyFact] public void ItPublishesAnAppWithMultipleProfiles() { var testAppName = "MultiDependentProject"; diff --git a/test/dotnet-store.Tests/dotnet-store.Tests.csproj b/test/dotnet-store.Tests/dotnet-store.Tests.csproj index 650b63b6a..11e732e03 100644 --- a/test/dotnet-store.Tests/dotnet-store.Tests.csproj +++ b/test/dotnet-store.Tests/dotnet-store.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -14,8 +12,8 @@ - - - + + + diff --git a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestFromCsprojForMultipleTFM.cs b/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestFromCsprojForMultipleTFM.cs index 0a6e2e0fd..801879573 100644 --- a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestFromCsprojForMultipleTFM.cs +++ b/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestFromCsprojForMultipleTFM.cs @@ -97,7 +97,7 @@ namespace Microsoft.DotNet.Cli.Test.Tests new DotnetTestCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"{TestBase.ConsoleLoggerOutputNormal} --framework netcoreapp2.0") + .ExecuteWithCapturedOutput($"{TestBase.ConsoleLoggerOutputNormal} --framework netcoreapp2.1") .Should().Pass(); } } diff --git a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs b/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs index 050b547e1..3b06797aa 100644 --- a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs +++ b/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs @@ -117,17 +117,18 @@ namespace Microsoft.DotNet.Cli.Test.Tests var testProjectDirectory = this.CopyAndRestoreVSTestDotNetCoreTestApp("5"); string configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; string expectedError = Path.Combine(testProjectDirectory, "bin", - configuration, "netcoreapp2.0", "VSTestCore.dll"); + configuration, "netcoreapp2.1", "VSTestCore.dll"); expectedError = "The test source file " + "\"" + expectedError + "\"" + " provided was not found."; // Call test CommandResult result = new DotnetTestCommand() .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput("--no-build"); + .ExecuteWithCapturedOutput("--no-build -v:m"); // Verify if (!DotnetUnderTest.IsLocalized()) { + result.StdOut.Should().NotContain("Restore"); result.StdErr.Should().Contain(expectedError); } diff --git a/test/dotnet-test.Tests/dotnet-test.Tests.csproj b/test/dotnet-test.Tests/dotnet-test.Tests.csproj index a47ee9357..a69fe3555 100644 --- a/test/dotnet-test.Tests/dotnet-test.Tests.csproj +++ b/test/dotnet-test.Tests/dotnet-test.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -14,8 +12,8 @@ - - - + + + diff --git a/test/dotnet-vstest.Tests/VSTestTests.cs b/test/dotnet-vstest.Tests/VSTestTests.cs index d1de1e8e8..c6a7dd035 100644 --- a/test/dotnet-vstest.Tests/VSTestTests.cs +++ b/test/dotnet-vstest.Tests/VSTestTests.cs @@ -31,7 +31,7 @@ namespace Microsoft.DotNet.Cli.VSTest.Tests .Should().Pass(); var outputDll = testRoot - .GetDirectory("bin", configuration, "netcoreapp2.0") + .GetDirectory("bin", configuration, "netcoreapp2.1") .GetFile($"{testAppName}.dll"); var argsForVstest = $"\"{outputDll.FullName}\" --logger:console;verbosity=normal"; diff --git a/test/dotnet-vstest.Tests/dotnet-vstest.Tests.csproj b/test/dotnet-vstest.Tests/dotnet-vstest.Tests.csproj index c774406bd..2601d659f 100644 --- a/test/dotnet-vstest.Tests/dotnet-vstest.Tests.csproj +++ b/test/dotnet-vstest.Tests/dotnet-vstest.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -14,8 +12,8 @@ - - - + + + diff --git a/test/dotnet.Tests/BundledTargetFramworkTests.cs b/test/dotnet.Tests/BundledTargetFramworkTests.cs new file mode 100644 index 000000000..4f67d03fa --- /dev/null +++ b/test/dotnet.Tests/BundledTargetFramworkTests.cs @@ -0,0 +1,39 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.IO; +using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Tools.Test.Utilities; +using Xunit; +using FluentAssertions; +using NuGet.Frameworks; + +namespace Microsoft.DotNet.Tests +{ + public class BundledTargetFrameworkTests : TestBase + { + [Fact] + public void VersionCommandDisplaysCorrectVersion() + { + var filePath = Path.Combine( + AppContext.BaseDirectory, + "ExpectedTargetFrameworkMoniker.txt"); + var targetFrameworkMoniker = GetTargetFrameworkMonikerFromFile(filePath); + var shortFolderName = NuGetFramework + .Parse(targetFrameworkMoniker) + .GetShortFolderName(); + BundledTargetFramework + .GetTargetFrameworkMoniker() + .Should().Be(shortFolderName); + } + + private static string GetTargetFrameworkMonikerFromFile(string versionFilePath) + { + using (var reader = new StreamReader(File.OpenRead(versionFilePath))) + { + return reader.ReadLine(); + } + } + } +} diff --git a/test/dotnet.Tests/GivenThatICareAboutVBApps.cs b/test/dotnet.Tests/GivenThatICareAboutVBApps.cs index 4b7d0186b..26fb40dd4 100644 --- a/test/dotnet.Tests/GivenThatICareAboutVBApps.cs +++ b/test/dotnet.Tests/GivenThatICareAboutVBApps.cs @@ -57,7 +57,7 @@ namespace Microsoft.DotNet.Tests _testInstance.Root.FullName, "bin", configuration, - "netcoreapp2.0", + "netcoreapp2.1", "publish", "VBTestApp.dll"); diff --git a/test/dotnet.Tests/GivenThatTheUserIsRunningDotNetForTheFirstTime.cs b/test/dotnet.Tests/GivenThatTheUserIsRunningDotNetForTheFirstTime.cs index 4fd1fb660..18e850ca4 100644 --- a/test/dotnet.Tests/GivenThatTheUserIsRunningDotNetForTheFirstTime.cs +++ b/test/dotnet.Tests/GivenThatTheUserIsRunningDotNetForTheFirstTime.cs @@ -28,6 +28,8 @@ namespace Microsoft.DotNet.Tests _testDirectory = TestAssets.CreateTestDirectory("Dotnet_first_time_experience_tests").FullName; var testNuGetHome = Path.Combine(_testDirectory, "nuget_home"); var cliTestFallbackFolder = Path.Combine(testNuGetHome, ".dotnet", "NuGetFallbackFolder"); + var profiled = Path.Combine(_testDirectory, "profile.d"); + var pathsd = Path.Combine(_testDirectory, "paths.d"); var command = new DotnetCommand() .WithWorkingDirectory(_testDirectory); @@ -35,6 +37,8 @@ namespace Microsoft.DotNet.Tests command.Environment["USERPROFILE"] = testNuGetHome; command.Environment["APPDATA"] = testNuGetHome; command.Environment["DOTNET_CLI_TEST_FALLBACKFOLDER"] = cliTestFallbackFolder; + command.Environment["DOTNET_CLI_TEST_LINUX_PROFILED_PATH"] = profiled; + command.Environment["DOTNET_CLI_TEST_OSX_PATHSD_PATH"] = pathsd; command.Environment["DOTNET_SKIP_FIRST_TIME_EXPERIENCE"] = ""; command.Environment["SkipInvalidConfigurations"] = "true"; @@ -92,6 +96,8 @@ namespace Microsoft.DotNet.Tests public void ItDoesNotCreateAFirstUseSentinelFileUnderTheDotDotNetFolderWhenInternalReportInstallSuccessIsInvoked() { var emptyHome = Path.Combine(_testDirectory, "empty_home"); + var profiled = Path.Combine(_testDirectory, "profile.d"); + var pathsd = Path.Combine(_testDirectory, "paths.d"); var command = new DotnetCommand() .WithWorkingDirectory(_testDirectory); @@ -100,6 +106,8 @@ namespace Microsoft.DotNet.Tests command.Environment["APPDATA"] = emptyHome; command.Environment["DOTNET_CLI_TEST_FALLBACKFOLDER"] = _nugetFallbackFolder.FullName; command.Environment["DOTNET_SKIP_FIRST_TIME_EXPERIENCE"] = ""; + command.Environment["DOTNET_CLI_TEST_LINUX_PROFILED_PATH"] = profiled; + command.Environment["DOTNET_CLI_TEST_OSX_PATHSD_PATH"] = pathsd; // Disable to prevent the creation of the .dotnet folder by optimizationdata. command.Environment["DOTNET_DISABLE_MULTICOREJIT"] = "true"; command.Environment["SkipInvalidConfigurations"] = "true"; @@ -116,6 +124,8 @@ namespace Microsoft.DotNet.Tests { var newHome = Path.Combine(_testDirectory, "new_home"); var newHomeFolder = new DirectoryInfo(Path.Combine(newHome, ".dotnet")); + var profiled = Path.Combine(_testDirectory, "profile.d"); + var pathsd = Path.Combine(_testDirectory, "paths.d"); var command = new DotnetCommand() .WithWorkingDirectory(_testDirectory); @@ -123,6 +133,8 @@ namespace Microsoft.DotNet.Tests command.Environment["USERPROFILE"] = newHome; command.Environment["APPDATA"] = newHome; command.Environment["DOTNET_CLI_TEST_FALLBACKFOLDER"] = _nugetFallbackFolder.FullName; + command.Environment["DOTNET_CLI_TEST_LINUX_PROFILED_PATH"] = profiled; + command.Environment["DOTNET_CLI_TEST_OSX_PATHSD_PATH"] = pathsd; command.Environment["DOTNET_SKIP_FIRST_TIME_EXPERIENCE"] = ""; command.Environment["SkipInvalidConfigurations"] = "true"; diff --git a/test/dotnet.Tests/PackagedCommandTests.cs b/test/dotnet.Tests/PackagedCommandTests.cs index 27c08b918..6e36eb87f 100644 --- a/test/dotnet.Tests/PackagedCommandTests.cs +++ b/test/dotnet.Tests/PackagedCommandTests.cs @@ -175,7 +175,7 @@ namespace Microsoft.DotNet.Tests ".tools", toolName); - // Other tests may have restored the tool for netcoreapp2.0, so delete its tools folder + // Other tests may have restored the tool for netcoreapp2.1, so delete its tools folder if (Directory.Exists(toolFolder)) { Directory.Delete(toolFolder, true); @@ -246,8 +246,8 @@ namespace Microsoft.DotNet.Tests .CreateInstance() .WithSourceFiles() .WithRestoreFiles(); - - const string framework = ".NETCoreApp,Version=v2.0"; + + string framework = Tools.Tests.Utilities.NuGetFrameworks.NetCoreApp21.DotNetFrameworkName; new BuildCommand() .WithProjectDirectory(testInstance.Root) @@ -423,7 +423,7 @@ namespace Microsoft.DotNet.Tests .WithRestoreFiles(); var assetsFile = new DirectoryInfo(new RepoDirectoriesProvider().NugetPackages) - .GetDirectory(".tools", "dotnet-portable", "1.0.0", "netcoreapp2.0") + .GetDirectory(".tools", "dotnet-portable", "1.0.0", "netcoreapp2.1") .GetFile("project.assets.json"); var stopWatch = Stopwatch.StartNew(); diff --git a/test/dotnet.Tests/ParserTests/RunParserTests.cs b/test/dotnet.Tests/ParserTests/RunParserTests.cs index 6fdee951b..b70e78c9a 100644 --- a/test/dotnet.Tests/ParserTests/RunParserTests.cs +++ b/test/dotnet.Tests/ParserTests/RunParserTests.cs @@ -20,7 +20,7 @@ namespace Microsoft.DotNet.Tests.ParserTests private readonly ITestOutputHelper output; [Fact] - public void RunParserCanGetArguementFromDoubleDash() + public void RunParserCanGetArgumentFromDoubleDash() { var runCommand = RunCommand.FromArgs(new[]{ "--", "foo" }); runCommand.Args.Single().Should().Be("foo"); diff --git a/test/dotnet.Tests/TelemetryCommandTest.cs b/test/dotnet.Tests/TelemetryCommandTest.cs index af231ecc7..3668dee1a 100644 --- a/test/dotnet.Tests/TelemetryCommandTest.cs +++ b/test/dotnet.Tests/TelemetryCommandTest.cs @@ -7,6 +7,7 @@ using Microsoft.DotNet.Cli.Telemetry; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools.Test.Utilities; using System.Collections.Generic; +using System; using Xunit; namespace Microsoft.DotNet.Tests @@ -26,6 +27,22 @@ namespace Microsoft.DotNet.Tests TelemetryEventEntry.TelemetryFilter = new TelemetryFilter(Sha256Hasher.HashWithNormalizedCasing); } + [Fact] + public void NoTelemetryIfCommandIsInvalid() + { + string[] args = { "publish", "-r"}; + Action a = () => { Cli.Program.ProcessArgs(args); }; + a.ShouldNotThrow(); + } + + [Fact] + public void NoTelemetryIfCommandIsInvalid2() + { + string[] args = { "restore", "-v" }; + Action a = () => { Cli.Program.ProcessArgs(args); }; + a.ShouldNotThrow(); + } + [Fact] public void TopLevelCommandNameShouldBeSentToTelemetry() { @@ -145,7 +162,9 @@ namespace Microsoft.DotNet.Tests public void DotnetNugetCommandFirstArgumentShouldBeSentToTelemetry() { const string argumentToSend = "push"; - string[] args = { "nuget", argumentToSend, "aRoot" }; + + string[] args = { "nuget", argumentToSend }; + Cli.Program.ProcessArgs(args); _fakeTelemetry .LogEntries.Should() diff --git a/test/dotnet.Tests/VersionTest.cs b/test/dotnet.Tests/VersionTest.cs index 0192f5fd8..3b0e1c92e 100644 --- a/test/dotnet.Tests/VersionTest.cs +++ b/test/dotnet.Tests/VersionTest.cs @@ -17,7 +17,7 @@ namespace Microsoft.DotNet.Tests [Fact] public void VersionCommandDisplaysCorrectVersion() { - var versionFilePath = Path.Combine(AppContext.BaseDirectory, ".version"); + var versionFilePath = Path.Combine(AppContext.BaseDirectory, "ExpectedSdkVersion.txt"); var version = GetVersionFromFile(versionFilePath); CommandResult result = new DotnetCommand() @@ -31,14 +31,8 @@ namespace Microsoft.DotNet.Tests { using (var reader = new StreamReader(File.OpenRead(versionFilePath))) { - SkipCommit(reader); return reader.ReadLine(); } } - - private void SkipCommit(StreamReader reader) - { - reader.ReadLine(); - } } } diff --git a/test/dotnet.Tests/dotnet.Tests.csproj b/test/dotnet.Tests/dotnet.Tests.csproj index 12467295b..35c0fa458 100644 --- a/test/dotnet.Tests/dotnet.Tests.csproj +++ b/test/dotnet.Tests/dotnet.Tests.csproj @@ -1,5 +1,4 @@  - $(CliTargetFramework) @@ -23,11 +22,52 @@ PreserveNewest PreserveNewest - - .version - PreserveNewest - + + + + + $(IntermediateOutputPath)ExpectedSdkVersion.txt + + $(SdkVersion) + + $([System.IO.File]::ReadAllText($(ExpectedVersionFileInIntermediateFolder))) + + + false + true + + + + + + + + + + + + + $(IntermediateOutputPath)ExpectedTargetFrameworkMoniker.txt + $(TargetFrameworkMoniker) + + $([System.IO.File]::ReadAllText($(ExpectedTargetFrameworkMonikerFileInIntermediateFolder))) + + false + true + + + + + + + @@ -37,10 +77,9 @@ - - - - + + + diff --git a/test/msbuild.IntegrationTests/msbuild.IntegrationTests.csproj b/test/msbuild.IntegrationTests/msbuild.IntegrationTests.csproj index cab0ce168..6f178d749 100644 --- a/test/msbuild.IntegrationTests/msbuild.IntegrationTests.csproj +++ b/test/msbuild.IntegrationTests/msbuild.IntegrationTests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) @@ -14,8 +12,8 @@ - - - + + + diff --git a/testAsset.props b/testAsset.props index 4c05b30f1..b130414b8 100644 --- a/testAsset.props +++ b/testAsset.props @@ -1,3 +1,7 @@ + + $(TEST_PACKAGES) + true + diff --git a/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj b/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj index e29aa4cdb..33051ba8e 100644 --- a/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj +++ b/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj @@ -1,6 +1,4 @@  - - netcoreapp2.0 $(SharedFrameworkRid) diff --git a/tools/Signing.Dependencies/Signing.Dependencies.csproj b/tools/Signing.Dependencies/Signing.Dependencies.csproj index c98ee321a..dc8cd6914 100644 --- a/tools/Signing.Dependencies/Signing.Dependencies.csproj +++ b/tools/Signing.Dependencies/Signing.Dependencies.csproj @@ -1,6 +1,4 @@ - - netcoreapp1.0