diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9271b689e..3e0f963fa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,4 +6,4 @@ See [Contributing](https://github.com/dotnet/corefx/blob/master/Documentation/pr Developers ========== -See the [Developer Guide](Documentation/project-docs/developer-guide.md) for details about developing in this repo. \ No newline at end of file +If you are looking to contribute to the verbs that ship with the SDK, please go to the [CLI Repo](https://github.com/dotnet/cli). \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index f0719c9ce..f17318773 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -43,24 +43,23 @@ tools\TestAssetsDependencies\TestAssetsDependencies.csproj - - - + + + - diff --git a/Documentation/ProjectJsonToCSProj.md b/Documentation/ProjectJsonToCSProj.md deleted file mode 100644 index 3b3e404e8..000000000 --- a/Documentation/ProjectJsonToCSProj.md +++ /dev/null @@ -1,63 +0,0 @@ -.NET CLI preview 3 is here, and with it comes the .csproj project file format and msbuild engine. The team has put a lot of focus on making the transition as seamless as possible, but as with any change of this magnitude there are some gotcha's to keep in mind. This issue explains how to use the .NET CLI during this transitional period. - -# Overview -Starting with @coolcsh's great post [Changes to Project.json](https://blogs.msdn.microsoft.com/dotnet/2016/05/23/changes-to-project-json/) the team has been hard at work moving the .NET command line story from project.json to msbuild. Our plan was fairly straightforward: -- Create a preview3 fork of the CLI -- Temporarily support both project.json and msbuild in the preview3 fork - - This allowed the team to use the CLI to build the new CLI - - msbuild support lit up through `3` verbs such as `build3`, `publish3`, `restore3` -- Once the msbuild support matures enough to build working applications, remove project.json support - -In addition to lighting up the msbuild scenario, the team also provided a migration tool called `dotnet migrate` that converts project.json files to csproj files. - -# Where are we now? -The team is feature complete to the plan above. The transition to msbuild is done and the migration tool is already part of the preview3 CLI. Of course there are still many issues to address before we can claim that we're ready to drop the `preview` suffix, but the core functionality is in place. - -# How do I... -Until we are ready to call the `preview3+` CLI ready for prime-time we find ourselves in a world where it is interesting to work on csproj, project.json, or both. How can we make that work? - -## How do I keep working with project.json? -Developers who are waiting for the new CLI to ship will continue using the `preview2` CLI. As long as they don't install any `preview3` or later bits on their machine they will be able to continue using Visual Studio 2015 preview tooling and maintain their existing developer experience. - -The `preview3` CLI does not offer any benefits for developers that want to keep using `project.json` for the time being. - -## How do I work with csproj only? -Developers who want to try out the new csproj / msbuild CLI and don't have project.json-based code to worry about can just install the `preview3` tooling. Any build starting at `1.0.0-preview3-004056` is sufficient to get started. Once installed, you can open a command prompt and: -- `dotnet new` to get a new csproj console application -- `dotnet restore` to get required nuget packages -- `dotnet build` to build the project -- `dotnet run` to run the project - -## How do I work with project.json while trying out csproj? -This scenario presents a few options. First, you can use the `dotnet migrate` tool to migrate your existing `project.json` assets to csproj. Alternatively, you can maintain both workflows side-by-side with some care, described below. - -### How do I migrate project.json to csproj? -I'll start with a warning. Migration is fairly complex and `preview3` is the first preview of this capability. The tool will be better in future releases, and it will need your project.json files in order to redo the migration in the future. `dotnet migrate` moves your `project.json` assets into a `backup` folder whose structure matches the layout of your solution. If you intend to migrate with newer tooling in the future then keep this folder in source control so you can put the files back when needed. - -To migrate a project open a command prompt and go to the project's root directory. From here, type `dotnet migrate` and let the tool do its work. For most projects, that's it! There are some special cases where the tool will complain and ask for some help, however: -- Projects are expected to have been updated to the `preview2` format for `project.json`. If you had noticed the previous CLI complaining about `deprecated` properties, these warnings will need to be cleaned up prior to migration. -- Some advanced capabilities, particularly some script variables, do not have an equivalent in the csproj world. The migration tool will ask you to remove these before migration can complete. - -Once migration is done you can use the same verbs as before to build, run, publish, etc. your project. - -### How do I work with project.json and csproj on the same machine? -This is an important scenario, as many folks will keep working with the existing tooling while experimenting with the preview3 implementations. - -To work with both project.json and csproj a developer will install two CLIs: one `preview2` for project.json and one `preview3` for csproj. There will only be one `dotnet` on the PATH, of course, so the CLI will need some help knowing which version to choose. This is accomplished with the help of the `global.json` file. - -When `preview2` shipped the Visual Studio new project templates included both a `project.json` file and a `global.json` file. The latter was fairly empty, including project locations and a `version` property. That `version` specified the `preview2` CLI that shipped with the tools. - - -``` -{ - "projects": [ "src", "test" ], - "sdk": { - "version": "1.0.0-preview2-003121" - } -} -``` - -We included this file by default as a future-proofing tactic. When the CLI launches it looks for this file in the current directory, or the nearest parent directory, and tries to find a matching version of itself. If an exact match is found then it is used. Otherwise, `dotnet.exe` picks the latest installed CLI. When there is no exact match AND preview3 is installed then we get into trouble because preview3 cannot reason about project.json files. - -When working with `preview2` and `preview3` on the same machine we need to be sure that `preview2` projects have a global.json present and that the `version` property is set to an installed preview2 version. This will typically be `1.0.0-preview2-003121` or `1.0.0-preview2-003131`. You can check what is installed by looking in `%PROGRAM FILES%\dotnet\sdk` and checking the folder names. - diff --git a/Documentation/README.md b/Documentation/README.md deleted file mode 100644 index 94edbb417..000000000 --- a/Documentation/README.md +++ /dev/null @@ -1,27 +0,0 @@ -Documents Index -=============== - -## Overview and general information - -- [Intro to .NET Core CLI](general/intro-to-cli.md) -- [CLI UX Guidelines](general/cli-ux-guidelines.md) -- [.NET Core native pre-requisities document](https://github.com/dotnet/core/blob/master/Documentation/prereqs.md) -- [Roadmap and OS support](https://github.com/dotnet/core/blob/master/roadmap.md) -- [Comprehensive CLI documentation](https://docs.microsoft.com/en-us/dotnet/articles/core/preview3/tools/) - -## Working with the CLI repo - -- [Developer Guide](project-docs/developer-guide.md) -- [How to file issues](project-docs/issue-filing-guide.md) - -## Troubleshooting and issues reporting - -- [CLI Known Issues](https://github.com/dotnet/core/blob/master/cli/known-issues.md) -- [Filing migration issues](migration-issues.md) - -## Specifications - -- [CLI installation scenarios](specs/cli-installation-scenarios.md) -- [Corehost specification](specs/corehost.md) -- [Runtime configuration file specification](specs/runtime-configuration-file.md) - diff --git a/Documentation/general/cli-ux-guidelines.md b/Documentation/general/cli-ux-guidelines.md deleted file mode 100644 index 69b8c0325..000000000 --- a/Documentation/general/cli-ux-guidelines.md +++ /dev/null @@ -1,157 +0,0 @@ -.NET Core Command-Line Tools UX Guidelines -------------------------------------------- - -This document outlines the User Experience (UX) of the .NET Core command lline tools (CLI).These guideliens are intended for anyone that wants to add a new command to the CLI. - -The guidelines presented in this document have been adopted to provide a clear and concise -command line syntax that is easy to learn, remember and work with, and that has an added benefit -of being familiar to people who have used other command-line interfaces as well as existing -Visual Studio users. - -## Naming the commands - -In the .NET Core CLI, commands should be **verbs**. This rule was adopted -because most of the commands do *something*. - -Sub-commands are supported in the CLI, and they are usually nouns. A good -example of this is the “dotnet add reference” command. If there is a need to add -a subcommand, that subcommand should usually specialize what the parent command -does. - -## Create/Read/Update/Delete (CRUD) commands -New CRUD commands should be named according to the following logic: - -- Does the command work on data in the project (either properties or - items)? If yes, then it should be added as a noun to the “dotnet - add/list/remove/update”, e.g. “dotnet add foo”. - -- Does the command work on the solution (SLN) file? If yes, then it should be - added as a verb to the “dotnet sln” command. - -- Does the command work on a completely new artifact (e.g. a new metadata file - that is added in the future)? If yes, it should be created as a top level - noun with all of the underlying operations defined as sub-commands. - -- If the command adds a new artifact to the project, it should become an item - template that is dropped with “dotnet new” command. - - -If none of the above applies, the proposal should clearly outline why none of -the above applies and suggest an alternative naming that will be decided on -during the process described above. - -If the command works on the project or solution, it must also accept an optional -argument that specifies which project or solution to work on. The current -convention is for that argument to follow the verb in the CRUD command. For -example: - -> dotnet add \ reference \ - -All the existing CRUD commands have this argument defined and it will be passed -to the sub-command as part of the overall options. The sub-command is expected -to consider this optional argument. - -## Options -CLI follows the [GNU convention](https://www.gnu.org/prep/standards/html_node/Command_002dLine-Interfaces.html) for options’ format, which is based on the POSIX -standard. The summary is: - -- Command can have both short and long options. - -- The short format starts with a single dash (“-“), and has **exactly** one - letter. The letter is usually the start letter of the longer form of the - option, e.g. “-o” for “--output” or any of its words. This provides a good - mnemonic. - - - **Example:** “dotnet build -o path/to/where/to/put/output” - -- The long format starts with double dashes (“--“) and can have one or more - words. Multiple words are separated by a single dash (“-“). - - - **Example:** “dotnet test --test-case-filter” - -- The double dashes (“--“) on their own mark the **argument separator**. - Anything after this option is passed verbatim to whatever the command starts - as a sub-process. - - - **Example:** “dotnet run -- --app-arg-1” - -- Windows-style forward slash options (e.g. “/p”) are supported **only for - MSBuild parameters.** - -- PowerShell-style single dashes with a word (e.g. “-Filter”) are **not - supported**. - -- Help options are predefined as “-h \| --help” and those should be used. - -There are common options in the CLI that are reserved for certain concepts. The -table below outlines those common options. If a command needs to accept the same -options, it should use these and it must not replace their semantics (e.g. use -“--output” to mean something different or redefine what “-f” means for just that -command). - -| Long option | Short option | Description | -|------------------|--------------|--------------------------------------------------------------| -| \--framework | \-f | Specifies which framework (target) to use in the invocation. | -| \--output | \-o | Specifies where the output of the command should be placed. | -| \--runtime | \-r | Specifies the runtime ID (RID) to use in the invocation. | -| \--configuration | \-c | Specifies the configuration to use in the invocation. | -| \--verbosity | \-v | Specifies the verbosity level of the command. | -| \--help | \-h | Shows the help for the command. | - -One special area is interacting with MSBuild. If a command has the need to do -that, there are two additional requirements with regards to options: - -1. The commands need to be able to take “/p” parameters in addition to whatever - other properties they require. - -2. If the command invokes a predefined MSBuild target, it needs to block - “/t:\” and “/target:\” options and throw an error that is - pre-defined in the CLI. - -It is important to note that commands that invoke user-specified targets -should not be submitted to the CLI, since the CLI comes with “dotnet msbuild” -command that does precisely that. - -## Arguments -Arguments can have any name that authors of the commands being added need. We do have predefined -argument names for the SLN file and project file. They are defined in the CLI -source code and should be used if the command has the need to use those two -arguments. - -## Help messages -Help messages are automatically generated based on the arguments, options and -command name. No other work should be required here apart from setting up the -above mentioned and their descriptions. - -## Output -For commands that are invoking MSBuild, the output will be controlled by MSBuild -itself. - -In case of a long running operation, the command needs to provide a feedback -mechanism to the user to help the user reason about whether the command has -crashed or is just waiting for I/O. The feedback mechanism guidelines are below: - -1. Feedback should not require fonts with special glyphs for display. -2. Pure text is acceptable (e.g. `Running background process...`) as a feedback mechanism. -3. Spinners that conform to rule \#1 above are also acceptable. - - -### Verbosity -If the command interacts with MSBuild, it is required that it can accept a -“--verbosity \| -v” argument and pass it to MSBuild verbatim. - -If the command’s verbosity levels cannot fit naturally in [MSBuild’s verbosity levels](https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-command-line-reference) or the command does not interact with MSBuild but still has an option to set the verbosity, it -is the job of the command to map them in the most appropriate way. This way, the -verbosity levels will be uniform across all commands which brings consistency to -the toolset. - -#### Example -As an example, let us consider a “dotnet configure” command. It doesn’t interact -with MSBuild. I wish to have verbosity on it, but it really has only two levels: -quiet (just successes or errors) and verbose (every operation) that I've defined for the command. To satisfy the -above-mentioned requirement, in my command I would define the “--verbosity \| --v” option and would map the arguments in the following way: - -- “Quiet” gets mapped naturally to “quiet” - -- “Minimal”, “Normal” and “Diagnostic” get mapped into “verbose” diff --git a/Documentation/general/intro-to-cli.md b/Documentation/general/intro-to-cli.md deleted file mode 100644 index 0fca2016f..000000000 --- a/Documentation/general/intro-to-cli.md +++ /dev/null @@ -1,62 +0,0 @@ -Introduction to .NET Core CLI -============================= - -The .NET Core CLI is a simple, extensible and standalone set of tools for building, managing and otherwise operating on .NET projects. It will or already includes commands such as compilation, NuGet package management and launching a debugger session. It is intended to be fully featured, enabling extensive library and app development functionality appropriate at the command-line. It should provide everything you'd need to develop an app in an SSH session! It is also intended to be a fundamental building block for building finished experiences in tools such as Visual Studio. - -Goals: - -- Language agnostic - embrace "common language runtime". -- Target agnostic - multi-targets. -- Simple extensibility and layering - "you had one job!" -- Cross-platform - support and personality. -- Semantic user interface over [MSBuild](https://github.com/Microsoft/msbuild). - -Experience -========== - -The [.NET Core command-line tools](https://github.com/dotnet/cli) present the "dotnet" tool as the entry-point tool. It provides higher-level commands, often using multiple tools together to complete a task. It's a convenience wrapper over the other tools, which can also be used directly. "dotnet" isn't magical at all, but a very simple aggregator of other tools. - -You can get a sense of using the tools from the examples below. - -**dotnet restore** - -`dotnet restore` restores dependent package from a given NuGet feed (e.g. NuGet.org) for the project in scope. - -**dotnet run** - -`dotnet run` compiles and runs your app with one step. - -**dotnet build** - -`dotnet build` compiles your app or library as an IL binary. - -Design -====== - -There are a couple of moving pieces that you make up the general design of the .NET Core CLI: - -* The `dotnet` driver -* Specific commands that are part of the package - -The `dotnet` driver is very simple and its primary role is to run commands and give users basic information about usage. - -The way the `dotnet` driver finds the command it is instructed to run using `dotnet {command}` is via a convention; any executable that is placed in the PATH and is named `dotnet-{command}` will be available to the driver. For example, when you install the CLI toolchain there will be an executable called `dotnet-build` in your PATH; when you run `dotnet build`, the driver will run the `dotnet-build` executable. All of the arguments following the command are passed to the command being invoked. So, in the invocation of `dotnet build --native`, the `--native` switch will be passed to `dotnet-build` executable that will do some action based on it (in this case, produce a single native binary). - -Adding a new command to the .NET Core CLI -========================================= - -If you want to contribute to the actual .NET Core CLI by adding a new command that you think would be useful, please refer to the [developer guide](developer-guide.md) in this directory. It contains all of the guidance on both the process as well as the infrastructure that you need to adhere to when adding a new command to the CLI toolchain. - -After you familiarize yourself with the process of working with the source code in the repo, please consult the [CLI UX guidelines](cli-ux-guidelines.md) to get to know the user experience tenants the CLI has. - -Adding a new command locally -============================ -If you wish to extend the CLI, you can read more about supported extensibility models in the [official extensibility document](https://docs.microsoft.com/en-us/dotnet/articles/core/tools/extensibility)/. - -Guidance on how to write a command -================================== -How you write a given command depends largely on whether you are trying to add it to the CLI project or want to add the command locally, that is on your machine or server. - -For the former case, the [developer guide](developer-guide.md) has all of the details that you will need to get going. - -If you are adding a command on your own machine(s), then there is really no special model to keep in mind. However, since your users will be using the local commands through the `dotnet` driver, we strongly suggest to keep to the principles outlined in the [CLI UX guidelines](cli-ux-guidelines.md) to have an unified user experience for your users. diff --git a/Documentation/general/tab-completion.md b/Documentation/general/tab-completion.md deleted file mode 100644 index bf6fefaa3..000000000 --- a/Documentation/general/tab-completion.md +++ /dev/null @@ -1,71 +0,0 @@ -# .NET CLI Tab Completion - -In version 2.0 of the .NET Core CLI, we have added support for providing suggestions when you press `tab`. While it's not yet enabled by default, you can try it out today by installing a [preview build](https://github.com/dotnet/cli#installers-and-binaries) from the master branch or by building from source. - -Here are some examples of what it provides: - -Input | becomes | because -:------------------------------------|:----------------------------------------------------------------------------|:-------------------------------- -`dotnet a⇥` | `dotnet add` | `add` is the first subcommand, alphabetically. -`dotnet add p⇥` | `dotnet add --help` | it matches substrings and `--help` comes first alphabetically. -`dotnet add p⇥⇥` | `dotnet add package` | pressing tab a second time brings up the next suggestion. -`dotnet add package Microsoft⇥` | `dotnet add package Microsoft.ApplicationInsights.Web` | results are returned alphabetically. -`dotnet remove reference ⇥` | `dotnet remove reference ..\..\src\OmniSharp.DotNet\OmniSharp.DotNet.csproj` | it is project file aware. - -## How to enable it - -Tab completion is currently supported in three shells: PowerShell, bash, and zsh. These scripts assume that `dotnet` v2.0 is on your path. You can verify that you have the correct version of `dotnet` on your path by trying out the new `complete` command directly: - -``` -[04/26/2017 11:38:20] C:\ -> dotnet complete "dotnet add p" -``` - -If you just installed `dotnet` you may see the first-run output: - -``` -Welcome to .NET Core! ---------------------- -Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. - -Telemetry --------------- -The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. -You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. -You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry. - -Configuring... -------------------- -A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once. -Decompressing 100% 4936 ms -Expanding 100% 17195 ms -``` - -You should see the following ouput (perhaps coming at the end of the first-run output). This indicates that `dotnet` is resolving to a v2.0 installation that supports completion. - -``` ---help -package -``` - -### PowerShell - -To enable tab completion in PowerShell, edit your PowerShell profile: - -``` -notepad $PROFILE -``` - -Add the contents of [register-completions.ps1](https://github.com/dotnet/cli/blob/master/scripts/register-completions.ps1) to this file and save. - -### bash - -To enable tab completion in bash, edit your `.bashrc` file to add the contents of [register-completions.bash](https://github.com/dotnet/cli/blob/master/scripts/register-completions.bash). - -### zsh - -To enable tab completion in zsh, edit your `.zshrc` file to add the contents of [register-completions.zsh](https://github.com/dotnet/cli/blob/master/scripts/register-completions.zsh). - -## How it works - -Each of these scripts provides a hook for completions for its respective shell. The logic that determines which suggestions to provide is in the CLI itself, configured using [our new parser](https://github.com/dotnet/CliCommandLineParser). You can see a code example [here](https://github.com/dotnet/cli/blob/master/src/dotnet/commands/dotnet-add/dotnet-add-package/AddPackageParser.cs#L23). diff --git a/Documentation/manpages/sdk/dotnet-build.1 b/Documentation/manpages/sdk/dotnet-build.1 deleted file mode 100644 index 1cbb21fb7..000000000 --- a/Documentation/manpages/sdk/dotnet-build.1 +++ /dev/null @@ -1,96 +0,0 @@ -.\" Automatically generated by Pandoc 1.15.1 -.\" -.hy -.TH "DOTNET\-BUILD" "1" "April 2016" "" "" -.SS NAME -.PP -dotnet\-build \-\- Builds a project and all of its dependencies -.SS SYNOPSIS -.PP -\f[C]dotnet\ build\ [\-\-output]\ \ \ \ \ \ \ [\-\-build\-base\-path]\ [\-\-framework]\ \ \ \ \ \ \ [\-\-configuration]\ \ [\-\-runtime]\ [\-\-version\-suffix]\ \ \ \ \ [\-\-build\-profile]\ \ [\-\-no\-incremental]\ [\-\-no\-dependencies]\ \ \ \ \ []\f[] -.SS DESCRIPTION -.PP -The \f[C]dotnet\ build\f[] command builds multiple source file from a -source project and its dependencies into a binary. -The binary will be in Intermediate Language (IL) by default and will -have a DLL extension. -\f[C]dotnet\ build\f[] will also drop a \f[C]\\*.deps\f[] file which -outlines what the host needs to run the application. -.PP -Building requires the existence of a lock file, which means that you -have to run \f[C]dotnet\ restore\f[] (dotnet-restore.md) prior to -building your code. -.PP -Before any compilation begins, the build verb analyzes the project and -its dependencies for incremental safety checks. -If all checks pass, then build proceeds with incremental compilation of -the project and its dependencies; otherwise, it falls back to -non\-incremental compilation. -Via a profile flag, users can choose to receive additional information -on how they can improve their build times. -.PP -All projects in the dependency graph that need compilation must pass the -following safety checks in order for the compilation process to be -incremental: \- not use pre/post compile scripts \- not load compilation -tools from PATH (for example, resgen, compilers) \- use only known -compilers (csc, vbc, fsc) -.PP -In order to build an executable application, you need a special -configuration section in your project.json file: -.IP -.nf -\f[C] -{\ -\ \ \ \ "compilerOptions":\ { -\ \ \ \ \ \ "emitEntryPoint":\ true -\ \ \ \ } -} -\f[] -.fi -.SS OPTIONS -.PP -\f[C]\-o\f[], \f[C]\-\-output\f[] [DIR] -.PP -Directory in which to place the built binaries. -.PP -\f[C]\-b\f[], \f[C]\-\-build\-base\-path\f[] [DIR] -.PP -Directory in which to place temporary outputs. -.PP -\f[C]\-f\f[], \f[C]\-\-framework\f[] [FRAMEWORK] -.PP -Compiles for a specific framework. -The framework needs to be defined in the project.json file. -.PP -\f[C]\-c\f[], \f[C]\-\-configuration\f[] [Debug|Release] -.PP -Defines a configuration under which to build. -If omitted, it defaults to Debug. -.PP -\f[C]\-r\f[], \f[C]\-\-runtime\f[] [RUNTIME_IDENTIFIER] -.PP -Target runtime to build for. -.PP -\-\-version\-suffix [VERSION_SUFFIX] -.PP -Defines what \f[C]*\f[] should be replaced with in the version field in -the project.json file. -The format follows NuGet\[aq]s version guidelines. -.PP -\f[C]\-\-build\-profile\f[] -.PP -Prints out the incremental safety checks that users need to address in -order for incremental compilation to be automatically turned on. -.PP -\f[C]\-\-no\-incremental\f[] -.PP -Marks the build as unsafe for incremental build. -This turns off incremental compilation and forces a clean rebuild of the -project dependency graph. -.PP -\f[C]\-\-no\-dependencies\f[] -.PP -Ignores project\-to\-project references and only builds the root project -specified to build. -.SH AUTHORS -Microsoft Corporation dotnetclifeedback\@microsoft.com. diff --git a/Documentation/manpages/sdk/dotnet-compile-native.1 b/Documentation/manpages/sdk/dotnet-compile-native.1 deleted file mode 100644 index 17b4fed31..000000000 --- a/Documentation/manpages/sdk/dotnet-compile-native.1 +++ /dev/null @@ -1,125 +0,0 @@ -.\" Automatically generated by Pandoc 1.15.1 -.\" -.hy -.TH "dotnet-native" "1" "January 2016" "" "" -.SH NAME -.PP -dotnet\-compile\-native \-\- Compiles IL binaries to native binaries. -.SH SYNOPSIS -.PP -dotnet compile [\-\-appdepsdk] [\-\-configuration] [\-\-ilcargs] -[\-\-linklib] [\-\-logpath] [\-\-mode] [\-\-out] [\-\-reference] -[\-\-temp\-out] [\-\-verbose] -.SH DESCRIPTION -.PP -The \f[C]compile\-native\f[] command compiles IL assemblies to native -machine code. -It is used by \f[C]dotnet\-compile\ \-\-native\f[]. -.PP -The output is a native exe that conforms to the architecture of the -underlying operating system (i.e. -running on 64\-bit OS will produce a native 64\-bit exe). -This can be overriden via the \-\-arch switch and specifying the wanted -architecture. -The executable has a default extension of "" on Linux and OS X and -".exe" on Windows. -The source must include a `static void Main(string[] args) entry point -and specify compilationOptions.emitEntryPoint in the project.json. -.PP -Output files are written to the child \f[C]bin\f[] folder, which will be -created if it doesn\[aq]t exist. -Files will be overwritten as needed. -.SH OPTIONS -.PP -\f[C]\-\-appdepsdk\ \f[] -.IP -.nf -\f[C] -Path\ to\ custom\ AppDepSDK -\f[] -.fi -.PP -\f[C]\-c,\ \-\-configuration\ [debug|release]\f[] -.IP -.nf -\f[C] -Build\ configuration.\ Defaults\ to\ `debug`. -\f[] -.fi -.PP -\f[C]\-\-ilcargs\ \f[] -.IP -.nf -\f[C] -Custom\ arguments\ for\ the\ IL\ Compiler. -\f[] -.fi -.PP -\f[C]\-\-ilcpath\ \f[] -.IP -.nf -\f[C] -Path\ to\ a\ custom\ ilc.exe -\f[] -.fi -.PP -\f[C]\-\-linklib\ \f[] -.IP -.nf -\f[C] -Path\ to\ static\ lib\ to\ link -\f[] -.fi -.PP -\f[C]\-\-logpath\ \f[] -.IP -.nf -\f[C] -Enables\ logging\ and\ writes\ native\ compilation\ logs\ to\ the\ given\ path. -\f[] -.fi -.PP -\f[C]\-m,\ \-\-mode\ [cpp|ryujit|custom]\f[] -.IP -.nf -\f[C] -Code\ generation\ mode.\ Defaults\ to\ ryujit. -\f[] -.fi -.PP -\f[C]\-o,\ \-\-out\ directoryname\f[] -.IP -.nf -\f[C] -Output\ directory\ for\ the\ native\ executable. -\f[] -.fi -.PP -\f[C]\-r,\ \-\-reference\f[] -.IP -.nf -\f[C] -Path\ to\ a\ managed\ dll\ reference\ for\ the\ app. -\f[] -.fi -.PP -\f[C]\-t,\ \-\-temp\-out\f[] -.IP -.nf -\f[C] -Specifies\ temporary\ directory\ for\ intermediate\ files. -\f[] -.fi -.PP -\f[C]\-v,\ \-\-verbose\f[] -.IP -.nf -\f[C] -Prints\ verbose\ logging\ information,\ to\ follow\ the\ flow\ of\ execution\ of\ the\ command. -\f[] -.fi -.SH SEE ALSO -.PP -dotnet\-compile(1), dotnet(1), dotnet\-restore(1) -.SH AUTHORS -Zlatko Knezevic zlakne\@microsoft.com. diff --git a/Documentation/manpages/sdk/dotnet-compile.1 b/Documentation/manpages/sdk/dotnet-compile.1 deleted file mode 100644 index de2963110..000000000 --- a/Documentation/manpages/sdk/dotnet-compile.1 +++ /dev/null @@ -1,157 +0,0 @@ -.\" Automatically generated by Pandoc 1.15.1 -.\" -.hy -.TH "dotnet-compiler" "1" "January 2016" "" "" -.SH NAME -.PP -dotnet\-compile \-\- Compiles source files for a single project to a -binary format and saves to a target file. -.SH SYNOPSIS -.PP -dotnet compile [\-\-native] [\-\-output] [\-\-temp\-output] -[\-\-framework] [\-\-configuration] [\-\-output] [\-\-arch] [\-\-cpp] -[\-ilc\-args] [\-\-verbose] -.SH DESCRIPTION -.PP -The compile command compiles source files from a single project to a -binary file, either intermediate language (IL) byte code or native -machine code, depending on the options provided. -The default option is compilation to IL byte code, but may change in the -future. -Users who want to benefit from incremental builds and who want to -compile both the project and its dependencies should use the -dotnet\-build(1) command. -.PP -The result of compilation is by default an executable file that can be -ran. -Output files, are written to the child \f[C]bin\f[] folder, which will -be created if it doesn\[aq]t exist. -Files will be overwritten as needed. -The temporary files that are created during compilation are placed in -the child \f[C]obj\f[] folder. -.PP -The executables also require a special configuration section in -project.json: -.IP -.nf -\f[C] -{\ -\ \ \ \ "compilationOptions":\ { -\ \ \ \ \ \ "emitEntryPoint":\ true -\ \ \ \ } -} -\f[] -.fi -.PP -The default native [\-\-native] output is a native exe that conforms to -the architecture of the underlying operating system (i.e. -running on 64\-bit OS will produce a native 64\-bit exe). -This can be overriden via the \-\-arch switch and specifying the wanted -architecture. -The executable has a default extension of "" on Linux and OS X and -".exe" on Windows. -The source must include a static void main entry point, or it is an -error, unless otherwise specified in the project.json. -The dynamic library [dylib] output option has the default extension of -".so" on Linux/UNIX, ".dynlib" on OS X and ".dll" on Windows. -The static library [staticlib] option has the default extension of ".a" -on Linux, UNIX and OS X and ".lib" on Windows. -.PP -This command relies on the following artifacts: source files, -project.json project file and the "lock" file (project.lock.json). -Prior to invoking dotnet\-compile, dotnet\-restore(1) should be run to -restore any dependencies that are needed for the application. -.SH OPTIONS -.PP -\f[C]\-n,\ \-\-native\f[] -.IP -.nf -\f[C] -Compiles\ source\ to\ native\ machine\ code,\ for\ the\ local\ machine.\ The\ default\ is\ a\ native\ executable.\ The\ default\ executable\ extension\ is\ no\ extension\ and\ ".exe"\ on\ Windows. -\f[] -.fi -.PP -\f[C]\-t,\ \-\-temp\-output\ \f[] -.IP -.nf -\f[C] -Path\ where\ to\ drop\ the\ temporary\ binaries\ that\ are\ produced\ during\ compile.\ By\ default,\ the\ temporary\ binaries\ are\ dropped\ in\ the\ `obj`\ directory\ in\ the\ directory\ where\ `project.json`\ files\ lives,\ that\ is,\ where\ the\ application\ lives.\ \ -\f[] -.fi -.PP -\f[C]\-f,\ \-\-framework\ \f[] -.IP -.nf -\f[C] -Compile\ the\ application\ for\ the\ specified\ framework.\ If\ the\ framework\ is\ not\ specified,\ one\ specified\ in\ `project.json`\ will\ be\ used.\ -\f[] -.fi -.PP -\f[C]\-c,\ \-\-configuration\ \f[] -.IP -.nf -\f[C] -Compile\ the\ application\ under\ the\ specified\ configuration.\ If\ not\ specified,\ the\ configuration\ will\ default\ to\ "Debug".\ \ -\f[] -.fi -.PP -\f[C]\-o,\ \-\-output\ filename\f[] -.IP -.nf -\f[C] -Specifies\ the\ filename\ to\ be\ used.\ By\ default,\ the\ resulting\ filename\ will\ be\ the\ same\ as\ the\ project\ name\ specified\ in\ `project.json`,\ if\ one\ exists,\ or\ the\ directory\ in\ which\ the\ source\ files\ reside.\ -\f[] -.fi -.PP -\f[C]\-\-no\-project\-dependencies\f[] -.IP -.nf -\f[C] -Skips\ building\ cross\-project\ references.\ The\ effect\ of\ this\ is\ that\ only\ the\ current\ project\ will\ be\ built.\ -\f[] -.fi -.PP -\f[C]\-a,\ \-\-arch\f[] -.IP -.nf -\f[C] -The\ architecture\ for\ which\ to\ compile.\ x64\ only\ currently\ supported. -\f[] -.fi -.PP -\f[C]\-\-ilc\-args\ \f[] -.IP -.nf -\f[C] -Specified\ parameters\ are\ passed\ through\ to\ ILC\ and\ are\ used\ by\ the\ engine\ when\ doing\ native\ compilation.\ -\f[] -.fi -.PP -\f[C]\-\-cpp\f[] -.IP -.nf -\f[C] -Specify\ the\ C++\ code\ generator\ to\ do\ native\ compilation\ of\ code\ instead\ of\ the\ default\ RyuJIT.\ \ \ \ \ \ \ -\f[] -.fi -.PP -\f[C]\-v,\ \-\-verbose\f[] -.IP -.nf -\f[C] -Prints\ verbose\ logging\ information,\ to\ follow\ the\ flow\ of\ execution\ of\ the\ command. -\f[] -.fi -.PP -\f[C]\-h,\ \-\-help\f[] -.IP -.nf -\f[C] -Show\ short\ help.\ -\f[] -.fi -.SH SEE ALSO -.PP -dotnet\-restore(1), dotnet\-publish(1), dotnet(1) -.SH AUTHORS -Zlatko Knezevic zlakne\@microsoft.com. diff --git a/Documentation/manpages/sdk/dotnet-new.1 b/Documentation/manpages/sdk/dotnet-new.1 deleted file mode 100644 index 5dfdbd490..000000000 --- a/Documentation/manpages/sdk/dotnet-new.1 +++ /dev/null @@ -1,81 +0,0 @@ -.\" Automatically generated by Pandoc 1.15.1 -.\" -.hy -.TH "DOTNET\-NEW" "1" "June 2016" "" "" -.SS NAME -.PP -dotnet\-new \-\- Create a new sample .NET Core project -.SS SYNOPSIS -.PP -dotnet new [\-\-type] [\-\-lang] -.SS DESCRIPTION -.PP -The \f[C]dotnet\ new\f[] command provides a convenient way to initialize -a valid .NET Core project and sample source code to try out the Command -Line Interface (CLI) toolset. -.PP -This command is invoked in the context of a directory. -When invoked, the command will result in two main artifacts being -dropped to the directory: -.IP "1." 3 -A \f[C]Program.cs\f[] (or \f[C]Program.fs\f[]) file that contains a -sample "Hello World" program. -.IP "2." 3 -A valid \f[C]project.json\f[] file. -.PP -After this, the project is ready to be compiled and/or edited further. -.SS Options -.PP -\f[C]\-l\f[], \f[C]\-\-lang\ [C#|F#]\f[] -.PP -Language of the project. -Defaults to \f[C]C#\f[]. -\f[C]csharp\f[] (\f[C]fsharp\f[]) or \f[C]cs\f[] (\f[C]fs\f[]) are also -valid options. -.PP -\f[C]\-t\f[], \f[C]\-\-type\f[] -.PP -Type of the project. -Valid values for C# are: -.IP \[bu] 2 -\f[C]console\f[] -.IP \[bu] 2 -\f[C]web\f[] -.IP \[bu] 2 -\f[C]lib\f[] -.IP \[bu] 2 -\f[C]xunittest\f[] -.PP -Valid values for F# are: -.IP \[bu] 2 -\f[C]console\f[] -.SS EXAMPLES -.PP -\f[C]dotnet\ new\f[] -.IP -.nf -\f[C] -Drops\ a\ sample\ C##\ project\ in\ the\ current\ directory. -\f[] -.fi -.PP -\f[C]dotnet\ new\ \-\-lang\ f##\f[] -.IP -.nf -\f[C] -Drops\ a\ sample\ F##\ project\ in\ the\ current\ directory. -\f[] -.fi -.PP -\f[C]dotnet\ new\ \-\-lang\ c##\f[] -.IP -.nf -\f[C] -Drops\ a\ sample\ C##\ project\ in\ the\ current\ directory. -\f[] -.fi -.SH SEE ALSO -.PP -dotnet\-run(1) -.SH AUTHORS -Microsoft Corporation dotnetclifeedback\@microsoft.com. diff --git a/Documentation/manpages/sdk/dotnet-pack.1 b/Documentation/manpages/sdk/dotnet-pack.1 deleted file mode 100644 index 6cb751efd..000000000 --- a/Documentation/manpages/sdk/dotnet-pack.1 +++ /dev/null @@ -1,91 +0,0 @@ -.\" Automatically generated by Pandoc 1.15.1 -.\" -.hy -.TH "DOTNET\-PACK" "1" "June 2016" "" "" -.SS NAME -.PP -\f[C]dotnet\-pack\f[] \- Packs the code into a NuGet package -.SS SYNOPSIS -.PP -\f[C]dotnet\ pack\ [\-\-output]\ \ \ \ \ \ \ [\-\-no\-build]\ [\-\-build\-base\-path]\ \ \ \ \ \ \ [\-\-configuration]\ \ [\-\-version\-suffix]\ \ \ \ \ []\f[] -.SS DESCRIPTION -.PP -The \f[C]dotnet\ pack\f[] command builds the project and creates NuGet -packages. -The result of this operation is two packages with the \f[C]nupkg\f[] -extension. -One package contains the code and the other contains the debug symbols. -.PP -NuGet dependencies of the project being packed are added to the nuspec -file, so they are able to be resolved when the package is installed. -Project\-to\-project references are not packaged inside the project by -default. -If you wish to do this, you need to reference the required project in -your dependencies node with a \f[C]type\f[] set to "build" like in the -following example: -.IP -.nf -\f[C] -{ -\ \ \ \ "version":\ "1.0.0\-*", -\ \ \ \ "dependencies":\ { -\ \ \ \ \ \ \ \ "ProjectA":\ { -\ \ \ \ \ \ \ \ \ \ \ \ "target":\ "project", -\ \ \ \ \ \ \ \ \ \ \ \ "type":\ "build" -\ \ \ \ \ \ \ \ } -\ \ \ \ } -} -\f[] -.fi -.PP -\f[C]dotnet\ pack\f[] by default first builds the project. -If you wish to avoid this, pass the \f[C]\-\-no\-build\f[] option. -This can be useful in Continuous Integration (CI) build scenarios in -which you know the code was just previously built, for example. -.SS OPTIONS -.PP -\f[C][project]\f[] -.PP -The project to pack. -It can be either a path to a \f[C]project.json\f[] file or to a -directory. -If omitted, it will default to the current directory. -.PP -\f[C]\-o\f[], \f[C]\-\-output\f[] [DIR] -.PP -Places the built packages in the directory specified. -.PP -\f[C]\-\-no\-build\f[] -.PP -Skips the building phase of the packing process. -.PP -\f[C]\-\-build\-base\-path\f[] -.PP -Places the temporary build artifacts in the specified directory. -By default, they go to the obj directory in the current directory. -.PP -\f[C]\-c\f[], \f[C]\-\-configuration\ [Debug|Release]\f[] -.PP -Configuration to use when building the project. -If not specified, will default to "Debug". -.SS EXAMPLES -.PP -\f[C]dotnet\ pack\f[] -.PP -Packs the current project. -.PP -\f[C]dotnet\ pack\ ~/projects/app1/project.json\f[] -.PP -Packs the app1 project. -.PP -\f[C]dotnet\ pack\ \-\-output\ nupkgs\f[] -.PP -Packs the current application and place the resulting packages into the -specified folder. -.PP -\f[C]dotnet\ pack\ \-\-no\-build\ \-\-output\ nupkgs\f[] -.PP -Packs the current project into the specified folder and skips the build -step. -.SH AUTHORS -Microsoft Corporation dotnetclifeedback\@microsoft.com. diff --git a/Documentation/manpages/sdk/dotnet-publish.1 b/Documentation/manpages/sdk/dotnet-publish.1 deleted file mode 100644 index 40393ec2a..000000000 --- a/Documentation/manpages/sdk/dotnet-publish.1 +++ /dev/null @@ -1,107 +0,0 @@ -.\" Automatically generated by Pandoc 1.15.1 -.\" -.hy -.TH "DOTNET\-PUBLISH" "1" "June 2016" "" "" -.SS NAME -.PP -\f[C]dotnet\-publish\f[] \- Packs the application and all of its -dependencies into a folder getting it ready for publishing -.SS SYNOPSIS -.PP -\f[C]dotnet\ publish\ [\-\-framework]\ \ \ \ \ \ \ [\-\-runtime]\ [\-\-build\-base\-path]\ [\-\-output]\ \ \ \ \ \ \ [\-\-version\-suffix]\ [\-\-configuration]\ \ \ \ \ \ \ []\f[] -.SS DESCRIPTION -.PP -\f[C]dotnet\ publish\f[] compiles the application, reads through its -dependencies specified in the \f[C]project.json\f[] file and publishes -the resulting set of files to a directory. -.PP -Depending on the type of portable app, the resulting directory will -contain the following: -.IP "1." 3 -\f[B]Portable application\f[] \- application\[aq]s intermediate language -(IL) code and all of application\[aq]s managed dependencies. -.RS 4 -.IP \[bu] 2 -\f[B]Portable application with native dependencies\f[] \- same as above -with a sub\-directory for the supported platform of each native -dependency. -.RE -.IP "2." 3 -\f[B]Self\-contained application\f[] \- same as above plus the entire -runtime for the targeted platform. -.PP -The above types are covered in more details in the types of portable -applications (../../app-types.md) topic. -.SS OPTIONS -.PP -\f[C][project]\f[] -.PP -\f[C]dotnet\ publish\f[] needs access to the \f[C]project.json\f[] file -to work. -If it is not specified on invocation via [project], -\f[C]project.json\f[] in the current directory will be the default. -.PD 0 -.P -.PD -If no \f[C]project.json\f[] can be found, \f[C]dotnet\ publish\f[] will -throw an error. -.PP -\f[C]\-f\f[], \f[C]\-\-framework\f[] [FID] -.PP -Publishes the application for a given framework identifier (FID). -If not specified, FID is read from \f[C]project.json\f[]. -In no valid framework is found, the command will throw an error. -If multiple valid frameworks are found, the command will publish for all -valid frameworks. -.PP -\f[C]\-r\f[], \f[C]\-\-runtime\f[] [RID] -.PP -Publishes the application for a given runtime. -.PP -\f[C]\-b\f[], \f[C]\-\-build\-base\-path\f[] [DIR] -.PP -Directory in which to place temporary outputs. -.PP -\f[C]\-o\f[], \f[C]\-\-output\f[] -.PP -Specify the path where to place the directory. -If not specified, it will default to -\f[I]\&./bin/[configuration]/[framework]/\f[] for portable applications -or \f[I]\&./bin/[configuration]/[framework]/[runtime]\f[] for -self\-contained applications. -.PP -\-\-version\-suffix [VERSION_SUFFIX] -.PP -Defines what \f[C]*\f[] should be replaced with in the version field in -the project.json file. -.PP -\f[C]\-c\f[], \f[C]\-\-configuration\ [Debug|Release]\f[] -.PP -Configuration to use when publishing. -The default value is Debug. -.SS EXAMPLES -.PP -\f[C]dotnet\ publish\f[] -.PP -Publishes an application using the framework found in -\f[C]project.json\f[]. -If \f[C]project.json\f[] contains \f[C]runtimes\f[] node, publish for -the RID of the current platform. -.PP -\f[C]dotnet\ publish\ ~/projects/app1/project.json\f[] -.PP -Publishes the application using the specified \f[C]project.json\f[]. -.PP -\f[C]dotnet\ publish\ \-\-framework\ netcoreapp1.0\f[] -.PP -Publishes the current application using the \f[C]netcoreapp1.0\f[] -framework. -.PP -\f[C]dotnet\ publish\ \-\-framework\ netcoreapp1.0\ \-\-runtime\ osx.10.11\-x64\f[] -.PP -Publishes the current application using the \f[C]netcoreapp1.0\f[] -framework and runtime for \f[C]OS\ X\ 10.10\f[]. -This RID has to exist in the \f[C]project.json\f[] \f[C]runtimes\f[] -node. -.SH AUTHORS -Microsoft Corporation dotnetclifeedback\@microsoft.com. diff --git a/Documentation/manpages/sdk/dotnet-restore.1 b/Documentation/manpages/sdk/dotnet-restore.1 deleted file mode 100644 index 0befbf747..000000000 --- a/Documentation/manpages/sdk/dotnet-restore.1 +++ /dev/null @@ -1,97 +0,0 @@ -.\" Automatically generated by Pandoc 1.15.1 -.\" -.hy -.TH "DOTNET\-RESTORE" "1" "June 2016" "" "" -.SS NAME -.PP -\f[C]dotnet\-restore\f[] \- Restores the dependencies and tools of a -project -.SS SYNOPSIS -.PP -\f[C]dotnet\ restore\ [\-\-source]\ \ \ \ \ \ \ [\-\-packages]\ [\-\-disable\-parallel]\ \ \ \ \ \ \ [\-\-fallbacksource]\ [\-\-configfile]\ [\-\-verbosity]\ \ \ \ \ []\f[] -.SS DESCRIPTION -.PP -The \f[C]dotnet\ restore\f[] command uses NuGet to restore dependencies -as well as project\-specific tools that are specified in the -project.json file. -By default, the restoration of dependencies and tools are done in -parallel. -.PP -In order to restore the dependencies, NuGet needs the feeds where the -packages are located. -Feeds are usually provided via the NuGet.config configuration file; a -default one is present when the CLI tools are installed. -You can specify more feeds by creating your own NuGet.config file in the -project directory. -Feeds can also be specified per invocation on the command line. -.PP -For dependencies, you can specify where the restored packages are placed -during the restore operation using the \f[C]\-\-packages\f[] argument. -If not specified, the default NuGet package cache is used. -It is found in the \f[C]\&.nuget/packages\f[] directory in the -user\[aq]s home directory on all operating systems (for example, -\f[C]/home/user1\f[] on Linux or \f[C]C:\\Users\\user1\f[] on Windows). -.PP -For project\-specific tooling, \f[C]dotnet\ restore\f[] first restores -the package in which the tool is packed, and then proceeds to restore -the tool\[aq]s dependencies as specified in its project.json. -.SS OPTIONS -.PP -\f[C][root]\f[] -.PP -A list of projects or project folders to restore. -The list can contain either a path to a \f[C]project.json\f[] file, or a -path to \f[C]global.json\f[] file or folder. -The restore operation runs recursively for all subdirectories and -restores for each given project.json file it finds. -.PP -\f[C]\-s\f[], \f[C]\-\-source\f[] [SOURCE] -.PP -Specifies a source to use during the restore operation. -This overrides all of the sources specified in the NuGet.config file(s). -.PP -\f[C]\-\-packages\f[] [DIR] -.PP -Specifies the directory to place the restored packages in. -.PP -\f[C]\-\-disable\-parallel\f[] -.PP -Disables restoring multiple projects in parallel. -.PP -\f[C]\-f\f[], \f[C]\-\-fallbacksource\f[] [FEED] -.PP -Specifies a fallback source that will be used in the restore operation -if all other sources fail. -All valid feed formats are allowed. -.PP -\f[C]\-\-configfile\f[] [FILE] -.PP -Configuration file (NuGet.config) to use for the restore operation. -.PP -\f[C]\-\-verbosity\f[] [LEVEL] -.PP -The verbosity of logging to use. -Allowed values: Debug, Verbose, Information, Minimal, Warning, or Error. -.SS EXAMPLES -.PP -\f[C]dotnet\ restore\f[] -.PP -Restores dependencies and tools for the project in the current -directory. -.PP -\f[C]dotnet\ restore\ ~/projects/app1/project.json\f[] -.PP -Restores dependencies and tools for the \f[C]app1\f[] project found in -the given path. -.PP -\f[C]dotnet\ restore\ \-\-f\ c:\\packages\\mypackages\f[] -.PP -Restores the dependencies and tools for the project in the current -directory using the file path provided as the fallback source. -.PP -\f[C]dotnet\ restore\ \-\-verbosity\ Error\f[] -.PP -Restores dependencies and tools for the project in the current directory -and shows only errors in the output. -.SH AUTHORS -Microsoft Corporation dotnetclifeedback\@microsoft.com. diff --git a/Documentation/manpages/sdk/dotnet-run.1 b/Documentation/manpages/sdk/dotnet-run.1 deleted file mode 100644 index 3dd7d1feb..000000000 --- a/Documentation/manpages/sdk/dotnet-run.1 +++ /dev/null @@ -1,88 +0,0 @@ -.\" Automatically generated by Pandoc 1.15.1 -.\" -.hy -.TH "DOTNET\-RUN" "1" "June 2016" "" "" -.SS NAME -.PP -dotnet\-run \-\- Runs source code \[aq]in\-place\[aq] without any -explicit compile or launch commands. -.SS SYNOPSIS -.PP -\f[C]dotnet\ run\ [\-\-framework]\ [\-\-configuration]\ \ \ \ \ [\-\-project]\ [\-\-help]\ [\-\-]\f[] -.SS DESCRIPTION -.PP -The \f[C]dotnet\ run\f[] command provides a convenient option to run -your application from the source code with one command. -It compiles source code, generates an output program and then runs that -program. -This command is useful for fast iterative development and can also be -used to run a source\-distributed program (for example, a website). -.PP -This command relies on \f[C]dotnet\ build\f[] (dotnet-build.md) to build -source inputs to a .NET assembly, before launching the program. -The requirements for this command and the handling of source inputs are -all inherited from the build command. -The documentation for the build command provides more information on -those requirements. -.PP -Output files are written to the child \f[C]bin\f[] folder, which will be -created if it doesn\[aq]t exist. -Files will be overwritten as needed. -Temporary files are written to the child \f[C]obj\f[] folder. -.PP -In case of a project with multiple specified frameworks, -\f[C]dotnet\ run\f[] will first select the .NET Core frameworks. -If those do not exist, it will error out. -To specify other frameworks, use the \f[C]\-\-framework\f[] argument. -.PP -The \f[C]dotnet\ run\f[] command must be used in the context of -projects, not built assemblies. -If you\[aq]re trying to execute a DLL instead, you should use -\f[C]dotnet\f[] (dotnet.md) without any command like in the following -example: -.PP -\f[C]dotnet\ myapp.dll\f[] -.PP -For more information about the \f[C]dotnet\f[] driver, see the \&.NET -Core Command Line Tools (CLI) (overview.md) topic. -.SS OPTIONS -.PP -\f[C]\-\-\f[] -.PP -Delimits arguments to \f[C]dotnet\ run\f[] from arguments for the -application being run. -All arguments after this one will be passed to the application being -run. -.PP -\f[C]\-f\f[], \f[C]\-\-framework\f[] [FID] -.PP -Runs the application for a given framework identifier (FID). -.PP -\f[C]\-c\f[], \f[C]\-\-configuration\ [Debug|Release]\f[] -.PP -Configuration to use when publishing. -The default value is "Debug". -.PP -\f[C]\-p\f[], \f[C]\-\-project\ [PATH]\f[] -.PP -Specifies which project to run. -It can be a path to a project.json file or to a directory containing a -project.json file. -It defaults to current directory if not specified. -.SS EXAMPLES -.PP -\f[C]dotnet\ run\f[] -.PP -Runs the project in the current directory. -.PP -\f[C]dotnet\ run\ \-\-project\ /projects/proj1/project.json\f[] -.PP -Runs the project specified. -.PP -\f[C]dotnet\ run\ \-\-configuration\ Release\ \-\-\ \-\-help\f[] -.PP -Runs the project in the current directory. -The \f[C]\-\-help\f[] argument above is passed to the application being -run, since the \f[C]\-\-\f[] argument was used. -.SH AUTHORS -Microsoft Corporation dotnetclifeedback\@microsoft.com. diff --git a/Documentation/manpages/sdk/dotnet-test.1 b/Documentation/manpages/sdk/dotnet-test.1 deleted file mode 100644 index 84a2cf23f..000000000 --- a/Documentation/manpages/sdk/dotnet-test.1 +++ /dev/null @@ -1,170 +0,0 @@ -.\" Automatically generated by Pandoc 1.15.1 -.\" -.hy -.TH "DOTNET\-TEST" "1" "April 2016" "" "" -.SH Dotnet Test, Adapters and Test Runners -.PP -This document covers the interactions between dotnet test, a potential -adapter (like VS) and test runners (like -xunit (https://github.com/dotnet/coreclr.xunit)). -.PP -It describes the communication protocol for these agents, the parameters -that the runner needs to support and the modes on which dotnet test and -the runner work. -.SS Running modes -.PP -Dotnet test supports two running modes: -.IP "1." 3 -Console: In console mode, dotnet test simply executes fully whatever -command gets passed to it and outputs the results. -Anytime you invoke dotnet test without passing \-\-port, it will run in -console mode, which in turn will cause the runner to run in console -mode. -.IP "2." 3 -Design time: Anytime you pass a port to dotnet test, we will run in -design time. -That means that dotnet test will connect to that port using TCP and will -then exchange a established set of messages with whatever else is -connected to that port. -When this happens, the runner also receives a port (a new one, mind you) -that dotnet test will use to communicate with it. -The reason why the runner also uses TCP to communicate with dotnet test -is because in design mode, it is not sufficient to just output results -to the console. -We need to send the adapter structure messages containing the results of -the test execution. -.SS Communication protocol in design time. -.IP "1." 3 -Because during design time, dotnet test connects to a port when it -starts up, the adapter needs to be listening on that port otherwise -dotnet test will fail. -We did it like this so that the adapter could reserve all the ports it -needs by binding and listening to them before dotnet test ran and tried -to get ports for the runner. -.IP "2." 3 -Once dotnet test starts, it sends a TestSession.Connected message to the -adapter indicating that it is ready to receive messages. -.IP "3." 3 -It is possible to send an optional version -check (https://github.com/dotnet/cli/blob/rel/1.0.0/src/Microsoft.Extensions.Testing.Abstractions/Messages/ProtocolVersionMessage.cs) -message with the adapter version of the protocol in it. -Dotnet test will send back the version of the protocol that it supports. -.PP -All messages have the format described here: -Message.cs (https://github.com/dotnet/cli/blob/rel/1.0.0/src/Microsoft.Extensions.Testing.Abstractions/Messages/Message.cs). -The payload formats for each message is described in links to the -classes used to de/serialize the information in the description of the -protocol. -.SS Test Execution -.PP -[IMAGE: alt -tag (../../../../Documentation/images/DotnetTestExecuteTests.png)] -.IP "1." 3 -After the optional version check, the adapter sends a -TestExecution.GetTestRunnerProcessStartInfo, with the -tests (https://github.com/dotnet/cli/blob/rel/1.0.0/src/Microsoft.Extensions.Testing.Abstractions/Messages/RunTestsMessage.cs) -it wants to execute inside of it. -Dotnet test sends back a FileName and Arguments inside a -TestStartInfo (https://github.com/dotnet/cli/blob/rel/1.0.0/src/dotnet/commands/dotnet-test/TestStartInfo.cs) -payload that the adapter can use to start the runner. -In the past, we would send the list of tests to run as part of that -argument, but we were actually going over the command line size limit -for some test projects. -.IP "2." 3 -As part of the arguments, we send a port that the runner should connect -to and for executing tests, a \-\-wait\-command flag, that indicates -that the runner should connect to the port and wait for commands, -instead of going ahead and executing the tests. -.IP "3." 3 -At this point, the adapter can launch the runner (and attach to it for -debugging if it chooses to). -.IP "4." 3 -Once the runner starts, it sends dotnet test a TestRunner.WaitCommand -message that indicates it is ready to receive commands, at which point -dotnet test sends a TestRunner.Execute with the list of -tests (https://github.com/dotnet/cli/blob/rel/1.0.0/src/Microsoft.Extensions.Testing.Abstractions/Messages/RunTestsMessage.cs) -to run. -This bypasses the command line size limit described above. -.IP "5." 3 -The runner then sends dotnet test (and it passes forward to the adapter) -a TestExecution.TestStarted for each tests as they start with the -test (https://github.com/dotnet/cli/blob/rel/1.0.0/src/Microsoft.Extensions.Testing.Abstractions/Test.cs) -information inside of it. -.IP "6." 3 -The runner also sends dotnet test (and it forwards to the adapter) a -TestExecution.TestResult for each test with the individual -result (https://github.com/dotnet/cli/blob/rel/1.0.0/src/Microsoft.Extensions.Testing.Abstractions/TestResult.cs) -of the test. -.IP "7." 3 -After all tests finish, the runner sends a TestRunner.Completed message -to dotnet test, which dotnet test sends as TestExecution.Completed to -the adapter. -.IP "8." 3 -Once the adapter is done, it sends dotnet test a TestSession.Terminate -which will cause dotnet test to shutdown. -.SS Test discovery -.PP -[IMAGE: alt -tag (../../../..//Documentation/images/DotnetTestDiscoverTests.png)] -.IP "1." 3 -After the optional version check, the adapter sends a -TestDiscovery.Start message. -Because in this case, the adapter does not need to attach to the -process, dotnet test will start the runner itself. -Also, since there is no long list of arguments to be passed to the -runner, no \-\-wait\-command flag is needed to be passed to the runner. -dotnet test only passes a \-\-list argument to the runner, which means -the runner should not run the tests, just list them. -.IP "2." 3 -The runner then sends dotnet test (and it passes forward to the adapter) -a TestDiscovery.TestFound for each -test (https://github.com/dotnet/cli/blob/rel/1.0.0/src/Microsoft.Extensions.Testing.Abstractions/Test.cs) -found. -.IP "3." 3 -After all tests are discovered, the runner sends a TestRunner.Completed -message to dotnet test, which dotnet test sends as -TestDiscovery.Completed to the adapter. -.IP "4." 3 -Once the adapter is done, it sends dotnet test a TestSession.Terminate -which will cause dotnet test to shutdown. -.SS Dotnet test parameters -.PP -Any parameters not accepted by dotnet test will be forwarded to the -runner. -This is the list of parameters supported by dotnet test from its own -help print out: -.PP -Usage: dotnet test [arguments] [options] -.PP -Arguments: The project to test, defaults to the current directory. -Can be a path to a project.json or a project directory. -.PP -Options: \-?|\-h|\-\-help Show help information \-\-parentProcessId Used -by IDEs to specify their process ID. -Test will exit if the parent process does. -\-\-port Used by IDEs to specify a port number to listen for a -connection. -\-c|\-\-configuration Configuration under which to build \-o|\-\-output -Directory in which to find the binaries to be run -\-b|\-\-build\-base\-path Directory in which to find temporary outputs -\-f|\-\-framework Looks for test binaries for a specific framework -\-r|\-\-runtime Look for test binaries for a for the specified runtime -\-\-no\-build Do not build project before testing -.SS Minimum parameters that the runner needs to support -.IP \[bu] 2 -AssemblyUnderTest: Path to the dll that contains the tests to be run. -.IP \[bu] 2 -\-\-port: Used by dotnet test to specify a port number that the runner -should connect to. -.IP \[bu] 2 -\-\-list: Indicates that the tests should only be listed and not -executed. -.IP \[bu] 2 -\-\-designtime: Indicates that the runner is running in design time, for -instance, inside an adapter. -.IP \[bu] 2 -\-\-wait\-command: Indicates that the runner should wait to receive -commands through the TCP channel instead of running tests right away. -We use this to get around the command line size limit. -.SH AUTHORS -Microsoft Corporation dotnetclifeedback\@microsoft.com. diff --git a/Documentation/migration-issues.md b/Documentation/migration-issues.md deleted file mode 100644 index 331f6c480..000000000 --- a/Documentation/migration-issues.md +++ /dev/null @@ -1,17 +0,0 @@ -## Getting help on migration issues -You're using the new .NET Core tools that are MSBuild-based. You took your project.json project and ran `dotnet migrate` or migrated from Visual Studio 2017...and you maybe ran into problems. - -The best way to get help is to [file an issue](https://github.com/dotnet/cli/issues/new) on this repo and we will investigate and provide help and/or fixes as part of new CLI builds. Please make sure to read the instructions below and to **add the [MIGRATION] prefix to the issue title**. - -### Filing an migration issue -CLI is a very high-traffic repository in terms of issues. In order to be able to respond fast to migration issues, we need the issue to be formatted in a certain way: - -* Add `[MIGRATION]:` prefix to the title of the issue. -* Make sure that we can see your project.json - * If you have a GH repo or this is an OSS project, share the URL to the repo. - * Otherwise attach or paste the project.json contents into the issue. - * Add all of the errors that any operation like `dotnet restore`, `dotnet build` or others reported. This will help us speedily triage where the potential problem will be. -* Add output of `dotnet --info` to the issue so we know what build you are running. -* Mention @blackdwarf and @livarcocc in the issue body. - -From there on, we will start investigating the issue and respond. diff --git a/Documentation/project-docs/developer-guide.md b/Documentation/project-docs/developer-guide.md deleted file mode 100644 index 0391adefa..000000000 --- a/Documentation/project-docs/developer-guide.md +++ /dev/null @@ -1,74 +0,0 @@ -Developer Guide -=============== - -## Prerequisites - -In order to build .NET Command Line Interface, you need the following installed on you machine. - -### For Windows - -1. git (available from http://www.git-scm.com/) on the PATH. - -### For Linux - -1. git (available from http://www.git-scm.com/) on the PATH. - -### For OS X - -1. Xcode -2. git (available from http://www.git-scm.com/) on the PATH. -3. Install OpenSSL (a .NET Core requirement) - - brew update - - brew install openssl - - mkdir -p /usr/local/lib - - ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/ - - ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/ - -## 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. - -## A simple test -Using the `dotnet` built in the previous step: - -1. `cd {new directory}` -2. `dotnet new` -3. `dotnet restore` -4. `dotnet run` - -## 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. - -## Adding a Command - -The dotnet CLI supports several models for adding new commands: - -1. In the CLI itself via `dotnet.dll` -2. Through a `tool` NuGet package -3. Through MSBuild tasks & targets in a NuGet package -4. Via the user's `PATH` - -### Commands in dotnet.dll -Developers are generally encouraged to avoid adding commands to `dotnet.dll` or the CLI installer directly. This is appropriate for very general commands such as restore, build, publish, test, and clean, but is generally too broad of a distribution mechanism for new commands. Please create an issue and engage the team if you feel there is a missing core command that you would like to add. - -### Tools NuGet packages -Many existing extensions, including those for ASP.NET Web applications, extend the CLI using Tools NuGet packages. For an example of a working packaged command look at `TestAssets/TestPackages/dotnet-hello/v1/`. - -### MSBuild tasks & targets -NuGet allows adding tasks and targets to a project through a NuGet package. This mechanism, in fact, is how all .NET Core projects pull in the .NET SDK. Extending the CLI through this model has several advantages: - -1. Targets have access to the MSBuild Project Context, allowing them to reason about the files and properties being used to build a particular project. -2. Targets are not CLI-specific, making them easy to share across command-line and IDE environments - -Commands added as targets can be invoked once the target project adds a reference to the containing NuGet package and restores. -Targets are invoked by calling `dotnet msbuild /t:{TargetName}` - -### Commands on the PATH -The dotnet CLI considers any executable on the path named `dotnet-{commandName}` to be a command it can call out to. - -## Things to Know -- Any added commands are usually invoked through `dotnet {command}`. As a result of this, stdout and stderr are redirected through the driver (`dotnet`) and buffered by line. As a result of this, child commands should use Console.WriteLine in any cases where they expect output to be written immediately. Any uses of Console.Write should be followed by Console.WriteLine to ensure the output is written. diff --git a/Documentation/project-docs/issue-filing-guide.md b/Documentation/project-docs/issue-filing-guide.md deleted file mode 100644 index d91132709..000000000 --- a/Documentation/project-docs/issue-filing-guide.md +++ /dev/null @@ -1,45 +0,0 @@ -Filing issues for .NET Core CLI -=============================== - -As you may notice based on our issues page, the CLI repo is what is known as a -"high-profile" and "high-volume" repo; we -get a lot of issues. This, in turn, may mean that some issues get -lost in the noise and/or are not reacted on with the needed speed. - -In order to help with the above situation, we need to have a certain way to file -issues so that the core team of maintainers can react as fast as -possible and can triage effectively. - -The below steps are something that we believe is not a huge increase in process, -but would help us react much faster to any issues that are filed. - -1. Check if the [known issues](https://github.com/dotnet/core/blob/master/cli/known-issues.md) cover the issue you are running -into. We are collecting issues that are known and that have workarounds, so it -could be that you can get unblocked pretty easily. - -4. /cc the person that the issue should be assigned to (or @blackdwarf) so that person -would get notified. In this way the correct person can immediately jump on the -issue and triage it. - -5. For bugs, please be as concrete as possible on what is working, what -is not working. Things like operating system, the version of the tools, the -version of the installer and when you installed all help us determine the -potential problem and allows us to easily reproduce the problem at hand. - -6. For enhancements please be as concrete as possible on what is the addition -you would like to see, what scenario it covers and especially why the current -tools cannot satisfy that scenario. - -Thanks and happy filing! :) - -## Providing the repro for bugs -For bugs, what we need more than anything is a good repro of the defective -behavior. We would like to go towards the "clone, run, repro" model. In short: - -1. If you find a bug, package up a repro in a git repo somewhere (GitHub is -usually a good place :)). -2. Inside the issue, specify what needs to be done (steps) to get an accurate -repro of the bug. Ideally, this should be "here is how to build, these are the -commands you run from the dotnet tools". -3. We use the above to get the repro, investigate and fix! - diff --git a/Documentation/specs/canonical.md b/Documentation/specs/canonical.md deleted file mode 100644 index 8c331cc9f..000000000 --- a/Documentation/specs/canonical.md +++ /dev/null @@ -1,445 +0,0 @@ -Canonical scenarios -=================== - -# Contents - -* [Overview](#overview) -* [Acquisition](#acquisition) -* Scenarios - * [Starting a new console application](#starting-a-new-console-application) - * [Starting a new class library](#starting-a-new-class-library) - * [Adding 3rd party dependencies to the projects](#adding-3rd-party-dependencies-to-the-projects) - * [Running unit tests](#running-unit-tests) - * [Publishing a shared runtime console application](#publishing-a-shared-runtime-console-application) - * [Publishing a self-contained console application for all platforms](#publishing-a-self-contained-console-application-for-all-platforms) - * [Packaging a class library](#packaging-a-class-library) - * [Installing `dotnet` extensions as tools](#installing-dotnet-extensions-as-tools) - -# Overview - -This document outlines the End-to-End canonical scenarios for the CLI tooling. The scenarios outline the planned steps that the developer needs to do to work with her applications. - -Each scenario is organized around a narrative, which provides an explanation on what the developers are trying to do, steps that are needed for the user to achieve the needed narrative. Steps are organized as commands that the developer would need to execute on the command line to achieve the result. - -These scenarios are focused on console applications and libraries. - -# Acquisition -All of the scenarios below assume that the CLI tools have been acquired in some way. The acquisition of the CLI tools is explained in detail in a [separate specification](cli-install-experience.md). This document only contains a very short summary of that document. - -There are two main ways to acquire the CLI toolset: -1. Using targeted platform's native installers - this approach is used by developers who want to get stable bits on their development machines and don't mind the system-wide installation and need for elevated privileges. -2. Using a local install (a zip/tarball) - this approach is used by developers who want to enable their build servers to use CLI toolset or who want to have multiple, side-by-side installs. - -The bits that are gotten are same modulo potential differences in stability of the bits, however, the smoothness of the experience is not. With native installers the installers themselves do as much as possible to set up a working environment (installing dependencies where possible, setting needed environment variables etc.). Local installs require all of the work to be done by developers after dropping bits on the machine. - -The below scenarios must work regardless of the way used to acquire the tools. - - - -# Starting a new console application - -## Narrative -The developer would like to kick the tires on .NET Core by writing a console application. She would like to use the new .NET Core CLI tooling to help her get started, manage dependencies and quickly test out the console application by running it from source. She would then like to try building the code and running it using the shared host that is installed with the CLI toolset. - -## Steps -1. Create a C# console application via `dotnet new` command - -``` -/myapp> dotnet new myapp - -``` -2. Edit the C# code - -``` - namespace myapp - { - public static class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello, World!"); - } - } - } -``` - -3. Restore packages - ``` - /myapp> dotnet restore - - [messages about restore progress] - - Writing lock file /myapp/project.lock.json - - /myapp> - ``` - -4. Run from source for a quick test - -``` -/myapp> dotnet run - -Hello World! - -/myapp> -``` - -5. Build a binary that can be executed by the shared host - -``` -/myapp> dotnet build - -[information about the build] - - Creating build output: - /myapp/bin/Debug/netstandardapp1.5/myapp.dll - /myapp/bin/Debug/netstandardapp1.5/myapp.deps - /myapp/bin/Debug/netstandardapp1.5/[All dependencies' IL assemblies].dll - -/myapp> -``` - -6. Run the built version using the shared host in the installed toolset - -``` -/myapp> dotnet run /myapp/bin/Debug/netstandardapp1.5/myapp.dll -Hello World! -``` - - -# Starting a new class library - -## Narrative -Once started, the developer wants to also include a class library in order to have a place to share common code. She wants to use the CLI toolset to bootstrap this effort as well. - -## Steps - -1. Create a new class library using `dotnet new` - -``` -/> dotnet new mylib --type lib - -Creating a "mylib" class library in "mylib" - -/mylib> -``` - -2. Restore the dependencies - - ``` - /mylib> dotnet restore - - [messages about restore progress] - - Writing lock file /mylib/project.lock.json - - /mylib> - ``` - - -3. Edit the `MyLib.cs` file - -``` - namespace mylib - { - public class mylib - { - public void Method1() - { - } - } - } -``` - -4. Build the code - -``` -/mylib> dotnet build - -[information about the build] - - Creating build output: - /mylib/bin/Debug/netstandardapp1.5/mylib.dll - /mylib/bin/Debug/netstandardapp1.5/mylib.deps - /mylib/bin/Debug/netstandardapp1.5/[All dependencies' IL assemblies].dll - -/mylib> - -``` - -# Adding 3rd party dependencies to the projects - -## Narrative -Working towards a complete application, the developer realizes she needs to add good JSON parsing support. Searching across the internet, she finds JSON.NET to be the most recommended choice. She now uses the CLI tooling to install a dependency off of NuGet. - ->**NOTE:** the shape of the commands used in this scenario is still being discussed. - -## Steps - -1. Install the package - -``` -/myapp> dotnet pkg install Newtonsoft.Json --version 8.0.2 - -[lots of messages about getting JSON.NET] - -Writing lock file /tests/project.lock.json - -/myapp> -``` - -2. Change the code to use the new dependency - -``` - using Newtonsoft.Json; - namespace myapp - { - public static class Program - { - public static void Main(string[] args) - { - var thing = JsonConvert.DeserializeObject("{ 'item': 1 }"); - Console.WriteLine("Hello, World!"); - Console.WriteLine(thing.item); - } - } - } -``` - -3. Run code from source - -``` -/myapp> dotnet run -Hello, World! -1 -/myapp> -``` - -# Running unit tests - -## Narrative -Writing tests is important, and our developer knows that. She is now writing out the shared logic in her class library and she wants to make sure that she has test coverage. Investigating the manuals, she realizes that the CLI toolset comes with support for xUnit tests including the test runner. - -## Steps - -1. Create a new xunit test project using `dotnet new` - -``` -/> dotnet new tests --type xunit -Created "tests" xunit test project in "tests". - -/tests> -``` -2. Restore the runner and dependencies - - ``` - /tests> dotnet restore - - [messages about restore progress] - - Writing lock file /tests/project.lock.json - - [messages about tool dependencies restore] - - /tests> - ``` - -3. Add a test to the test class -``` -using System; -using Xunit; - -namespace tests -{ - public class Tests - { - [Fact] - public void AssertTrue() { - Assert.True(true); - } - } -} -``` - -3. Run tests using `dotnet test` - -``` -/tests> dotnet test - -[information about discovery of tests] - -=== TEST EXECUTION SUMMARY === - test Total: 1, Errors: 0, Failed: 0, Skipped: 0, Time: 0.323s - -/tests> -``` - -# Publishing a shared runtime console application - -## Narrative -Coding away on the application has proven worthwhile and our developer wants to share her progress with another developer on her team. She wants to give just the application and its dependencies. Luckily, another developer can easily install the .NET Core SDK and get a shared host, which would be enough to run the application. The CLI toolset allows our developer to publish just the application's code (in IL) and dependencies. - -## Steps - -1. Publish the application -``` - /myapp> dotnet publish --output /pubapp - - [Lots of messages about publishing stuff] - - Creating publish output: - /pubapp/myapp/myapp.dll - /pubapp/myapp/myapp.deps - /pubapp/myapp/[All dependencies' IL assemblies].dll - - /myapp> - ``` - -2. Run the project publish output: - ``` - /myapp> cd /pubapp/myapp - /pubapp/myapp> dotnet ./myapp.dll - Hello, World! - - /published/myapp> - ``` -3. The published application can be transferred over to a machine that has the .NET Core shared host installed and it is possible for it to be ran. - -# Publishing a self-contained console application for all platforms - -## Narrative -After getting feedback from her colleague developer, our developer decides to test on another machine. However, this machine doesn't have the shared host installed and she cannot get it installed. Luckily, she realizes that .NET Core has support for self-contained applications - -**NOTE**: some of the behaviours in this scenario are still being discussed with the relevant stakeholders. - -## Steps - -1. Modify the project file to enable it to be published as a standalone, platform-specific application (one that doesn't require `dotnet` on the target machine to run) for the desired platforms by adding the `"runtimes"` section: - ``` - { - "imports": { - "Microsoft.ProjectType.ConsoleApplication": "1.0.0" - }, - "runtimes": { - "linux-x64": { }, - "win7-x64": { } - } - } - ``` - -2. Restore the project's dependencies again to ensure the platform-specific dependencies for the specified runtimes are acquired: - ``` - /myapp> dotnet restore - - [lots of messages about restoring stuff] - - Writing lock file /myapp/project.lock.json - - /myapp> - ``` - - - -3. Publish the project again. In this case, the publish will publish for each runtime in the `project.json` file - ``` - /myapp> dotnet publish --output /published/myapp - - [Lots of messages about publishing stuff] - - Creating publish output for (linux-x64): - /published/myapp-linux-x64/myapp - /published/myapp-linux-x64/myapp.dll - /published/myapp-linux-x64/myapp.deps - /published/myapp-linux-x64/[All dependencies' IL & platform-specific assemblies, inc. stdlib] - - Creating publish output for (win7-x64): - /published/myapp-win7-x64/myapp - /published/myapp-win7-x64/myapp.dll - /published/myapp-win7-x64/myapp.deps - /published/myapp-win7-x64/[All dependencies' IL & platform-specific assemblies, inc. stdlib] - - /myapp> - - ``` - -4. Any of the outputs above can be xcopied to the platform in question and it will work without having to have the shared host installed. - -5. Publish the project for a specific platform (win7-x64): - -``` - /myapp> dotnet publish --output /win7/myapp --runtime win7-x64 - - [Lots of messages about publishing stuff] - - Creating publish output for (win7-x64): - /published/myapp-win7-x64/myapp - /published/myapp-win7-x64/myapp.dll - /published/myapp-win7-x64/myapp.deps - /published/myapp-win7-x64/[All dependencies' IL & platform-specific assemblies, inc. stdlib] - - /myapp> - ``` - -# Packaging a class library - -## Narrative -The developer wants to take the library she built and package it up as a NuGet package in order to share it with the rest of the ecosystem. Again, she would like to use the CLI toolset to achieve this. Since she wants to be sure that all her code is in a pristine condition, she will also build it one more time, run tests and then package it. - -## Steps -1. Build the code to make sure no build errors have crept in - -``` -/mylib> dotnet build - -[information about the build] - - Creating build output: - /myapp/bin/Debug/netstandardapp1.5/myapp.dll - /myapp/bin/Debug/netstandardapp1.5/myapp.deps - /myapp/bin/Debug/netstandardapp1.5/[All dependencies' IL assemblies].dll - -/mylib> - -``` - -2. Switch to the test project and run unit tests - -```console -[switch to the directory containing unit tests] -/mytests> dotnet test - -[info about tests flies around] - -=== TEST EXECUTION SUMMARY === - test Total: 50, Errors: 0, Failed: 0, Skipped: 0, Time: 5.323s - -/mytests> - -``` - -3. Package the library - -```console -[switch to the library directory] - -/mylib> dotnet pack - -[information about build is shown] - -Producing nuget package "mylib.1.0.0" for mylib -mylib -> /mylib/bin/Debug/mylib.1.0.0.nupkg -Producing nuget package "mylib.1.0.0.symbols" for mylib -mylib -> /mylib/bin/Debug/mylib.1.0.0.symbols.nupkg - -/mylib> -``` - -# Installing `dotnet` extensions as tools - -## Narrative -As our developer is going further with her usage of the CLI tools, she figures out that there is an easy way to extend the CLI tools on her machine by adding project-level tools to her `project.json`. She uses the CLI to work with the tools and she is able to extend the default toolset to further fit her needs. - -## Steps ->**TODO:** at this point, this needs more work to figure out how it will surface; it is listed here so it is not forgotten. - - diff --git a/Documentation/specs/cli-installation-scenarios.md b/Documentation/specs/cli-installation-scenarios.md deleted file mode 100644 index 16182c234..000000000 --- a/Documentation/specs/cli-installation-scenarios.md +++ /dev/null @@ -1,468 +0,0 @@ -Obtaining .NET CLI -================== - -## Contents -* [Overview](#overview) -* [General principles](#general-principles) -* [Components that can be installed](#components-that-can-be-installed) -* [Installation process](#installation-process) -* [Removal process](#removal-process) -* [Upgrading the CLI](#upgrading-the-cli) -* [Layout on disk](#layout-on-disk) -* [Native dependencies](#native-dependencies) -* [Channels](#channels) -* [Funnels and discovery mechanisms for CLI bits](#funnels-and-discovery-mechanisms-for-cli-bits) - * [Getting Started page](#getting-started-page) - * [Repo landing page](#repo-landing-page) -* [Acquisition modes](#acquisition-modes) - * [Native installers](#native-installers) - * [Installation script](#installation-script) - * [Complete manual installation](#complete-manual-installation) - * [Docker](#docker) - * [NuGet Packages](#nuget-packages) -* [Acquiring through other products](#acquiring-through-other-products) - * [IDEs and editors](#ides-and-editors) - - -## Overview -This document/spec outlines the CLI install experience. This covers the technologies being used for install, the principles that are driving the installation experience, the ways users are coming to the installs and what each of the installs contains, in terms of stability and similar. - -## General principles - -- Upgrades using the native installers Just Work(tm) -- All user facing materials point to the getting started page -- Defaults are stable bits; users need extra effort to install Future builds -- Only HTTPS links are allowed in any online property -- Provide native installers for each supported platform -- Provide automation-ready installers for each target platform - -## Components that can be installed -Overall, there are two significant installable components: - -1. The .NET Core SDK -2. Shared runtime redistributable - -The .NET Core SDK contains the following items: - -1. A given version of the CLI toolset - "SDK" -2. A given version of the shared runtime - "redist" - this will be consumed by both end-customers and CLI toolset -3. A given version of the shared host - "muxer" - shared component that is in charge of running the applications and the CLI commands - it should be treated as an implementation detail - -## Installation process -Each of the components listed in the previous section will have an installer/package. The dependencies of the installers between themseslves are given in the table below. - -| Installer | Depends on | -|----------- |------------ | -| SDK | redist | -| redist | muxer | -| muxer | - | - -The installation process will depend on the platform and the way of the install. For those installers that don't have automatic dependency resolution (Windows installer, OS X PKG) the installers will chain the installers of the components they depend on. DEB, RPM and similar will declare proper dependencies and the package manager will do the Right Thing(tm) by default. - -From the table, we can see that if you install the SDK using `apt-get` for instance, you will get also a redist and a muxer. They will be separate packages, but will be declared as dependencies (similar for `yum`). Similar for the redist package. - -The muxer is slightly a special case. Though there will be an installer, as mentioned in the previous section, it is an implementation detail. That means that acquiring the muxer should be done through either the SDK or the shared runtime installers. The only situation where this rule would not be true is if there was a major servicing event (e.g. a security update); in that case, the users would use the installer for the muxer directly, as we would rev its version accordingly. - -The script installers are slightly different as they operate on zips/tarballs. The zip/tarball for the SDK will contain the entire set of things needed to be put on the disk. - -## Removal process -Removing the bits from the machine **must** follow the order outlined above in installation. If the SDK is installed, it needs to be removed first and then the Redist and only then the muxer. Similar for the Redist. - -## Upgrading the CLI -The semantics of installing the CLI will be side-by-side by default. This means that each new version will get installed besides any existing versions on disk. The [layout section](#layout-on-disk) covers how that will look like on disk. - -Since this is the case, there is no special "upgrade". When the user needs a new version, the user just installs the new version using any of the installers specified in this document. The installer will just drop a new version at the predefined location. - -This, however, does have one specific constraint: **newer versions must be installed in the same location the previous version was in**. This constraint is due to the fact that the "muxer" uses convention to figure out how to find the actual driver that the user reuqested. - -## Layout on disk -``` -/ (%PATH%) - dotnet ("muxer", has platform dependant file extension) - hostfxr (implementation detail for "muxer", platform dependant file extension) - sdk/ - / (i.e. "1.0.0-rc2-002543") - ... (binaries like: dotnet.dll, csc.dll) - / - ... (binaries) - ... - shared/ ("redist" or "shared framework") - / (currently only "Microsoft.NETCore.App") - / (i.e. "1.0.0-rc2-3002543") - ... (binaries like: coreclr.dll, mscorlib.ni.dll, System.*.dll, dotnet-hostimpl.dll, dotnet, netcoreapp.deps.json) - / - ... (binaries) -``` - -## Native dependencies -.NET Core CLI is built on top of CoreFX and CoreCLR and as such its' dependencies set is defined by the platform that those two combine. Whether or not those dependencies will be installed depends on the installer being used. The table below lists out the installers and whether or not they bring in dependencies. - -| Installer | Dependencies Y/N | -|------------ |----------------------------------- | -| EXE | Y (chains them in) | -| PKG | N (need to be manually installed*) | -| apt-get | Y | -| rpm | Y | - -`*` PKG cannot specify and automatically install native dependencies - -A list of dependencies can be found on [dependency list](TBD). - -## Channels -Channels represent a way for users who are getting the CLI to reason about the stability and quality of the bits they are getting. This is one more way for the user to be fully aware of the state the bits that are being installed are in and to set proper expectations on first use. - -| Channel | Description | -|------------------ |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| LTS | Latest long-term supported release. | -| Current | Most current release - typically 'preview' releases. | - - -## Funnels and discovery mechanisms for CLI bits -There are multiple ways that we will funnel users towards the installers for the CLI: - -1. [Getting Started Page](https://aka.ms/dotnetcoregs) -2. [Repo landing page](../../README.md) -3. Package repositories for platforms (`apt-get`, `brew` etc.) -4. IDEs and editors that integrate with CLI (e.g. Visual Studio, VS Code, Sublime etc.) - -Out of the above, the first two funnels are under the control of the CLI team so we will go into slightly more details. The rest of the funnels will use a prescribed way to get to the bits and will have guidance on what bits to use. - -### Getting Started page -The page can be found on https://aka.ms/dotnetcoregs. This is the main curated first-run funnel for the dotnet CLI. The intent of the page is to help users test out the CLI quickly and become familiar with what the platform offers. This should be the most stable and curated experience we can offer. - -The Getting Started page should only point users to curated install experiences that can contain only stable or LKG bits. - -The below table shows other pertinent information for installs on the "Getting started" page. - -| Property | Description | -|----------------------- |--------------------------------------------------------------- | -| Debian feed | Development | -| Brew repo/tap | Brew binary repo (https://github.com/Homebrew/homebrew-binary) | -| CentOS feed | TBD | - - -### Repo landing page -The repo landing page can be found on: [Repo landing page](../../README.md). Download links on the landing page should be decreased in importance. First thing for "you want to get started" section should link to the getting started page on the marketing site. The Repo Landing Page should be used primarily by contributors to the CLI. There should be a separate page that has instructions on how to install both the latest stable as well as latest development with proper warnings around it. The separate page is to really avoid the situation from people accidentally installing unstable bits (since search engines can drop them in the repo first). - -The source branches and other items are actually branch specific for the repo landing page. As the user switches branches, the links and badges on the page will change to reflect the builds from that branch. - -## Acquisition modes -There are multiple acquisition modes that the CLI will have: - -1. Native installers -2. Install scripts -3. NuGet packages (for use in other people's commands/code) -4. Docker - -Let's dig into some details. - -### Native installers -These installation experiences are the primary way new users are getting the bits. The primary way to get information about this mode of installation is the [Getting Started page](#getting-started-page). The native installers are considered to be stable by default; this does not imply lack of bugs, but it does imply predictable behavior. They are generated from the stable branches and are never used to get the Future bits. - -There are three main components that will be installed - -The native installers are: - -| Platform | Installer | Status | Package name | -|--------------------- |------------------ |---------- |-------------------- | -| Windows | Bundle installer | Done | dotnet-{version}; | -| Ubuntu 14.04/Debian | apt-get feed | Done | dotnet; dotnet-dbg | -| OS X | PKG | Done | dotnet | -| OS X | Homebrew | Not done | dotnet | -| CentOS/RH | RPM | Not done | dotnet | - - - -### Installation script -This approach is a shell one-liner that downloads an installation script and runs it. The installation script will download the latest zip/tarball (depending on the script used) and will unpack it to a given location. After that, the script will print out what needs to be set for the entire CLI to work (env variables, $PATH modification etc.). - -This install covers the following main scenario: - -* Local installation on a dev machine -* Acquiring tools on a CI build server - - -The features the script needs to support/have are: -* Support for specifying the channel -* Support for specifying the version -* Support for specifying the installation location -* Automatically add the install to $PATH unless --no-path/-NoPath is present - -It is recommended to use the stable version that is hosted on [.NET Core main website](https://dot.net). The direct path to the scripts are: - -* https://dot.net/v1/dotnet-install.sh (bash, UNIX) -* https://dot.net/v1/dotnet-install.ps1 (powershell, Windows) - - -#### Installation script features -The following arguments are needed for the installation script: - -| dotnet-install.sh arg (Linux, OSX) | dotnet-install.ps1 arg (Windows) | Defaults | Description | -|------------------------------------|----------------------------------|-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| --channel | -Channel | "LTS" | Which channel (i.e. "LTS", "Current", "1.0", "2.0", etc) to install from. | -| --version | -Version | Latest | Which version of CLI to install; you need to specify the version as 3-part version (i.e. 1.0.0-13232). The 'version' parameter supersedes the 'channel' parameter. | -| --install-dir | -InstallDir | .dotnet | Path to where to install the CLI bundle. The directory is created if it doesn't exist. On Linux/OSX this directory is created in the user home directory (`$HOME`). On Windows, this directory is created in `%LocalAppData%`. | -| --no-path | -NoPath | false | Do not export the installdir to the path for the current session. This makes CLI tools available immediately after install. | -| --shared-runtime | -SharedRuntime | false | Install just the shared runtime bits, not the entire SDK. | -| --architecture | -Architecture | Current OS (``) | Architecture to install. The possible values are ``, `x64` and `x86`. | -| --dry-run | -DryRun | false | If set, it will not perform the installation but will show, on standard output, what the invocation of the script will do with the options selected. | -| --verbose | -Verbose | false | Display diagnostic information. | -| N/A | -ProxyAddress | "" | If set, the installer will use the specified proxy server for all of its invocations. | - -> Note: Powershell arg naming convention is supported on Windows and non-Windows platforms. Non-Windows platforms do additionally support convention specific to their platform. - -##### Install the 1.1.0 of the shared runtime - -Windows: -``` -./dotnet-install.ps1 -SharedRuntime -Version 1.1.0 -``` - -macOS/Linux: -``` -./dotnet-install.sh --shared-runtime --version 1.1.0 -``` - -##### Install the latest supported CLI - -Windows: -``` -./dotnet-install.ps1 -Channel LTS -``` -OSX/Linux: -``` -./dotnet-install.sh --channel LTS -``` - -##### Install the latest CLI to specified location - -Windows: -``` -./dotnet-install.ps1 -Channel Current -InstallDir C:\cli -``` -OSX/Linux: -``` -./dotnet-install.sh --channel Current --install-dir ~/cli -``` - -##### Install the latest CLI in the 2.0 channel - -Windows: -``` -./dotnet-install.ps1 -Channel 2.0 -``` -OSX/Linux: -``` -./dotnet-install.sh --channel 2.0 -``` - -### 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. - -Docker images should always be updated as we make new releases. We should have Docker images of stable releases, built from the release branches. - -### NuGet packages -NuGet packages of the CLI bits that make sense are published to relevant feeds. The developer who wishes to use these needs to specify a version. The actual "installation" here is restoring the package as a dependency for a certain project (i.e. `ProjectServer` or similar). - -## Acquiring through other products - -### IDEs and editors -Anything that goes into the higher-level tools should always use a stable build of CLI coming frol release branches as required. - -If there exist any mechanism that notifies users of updates of the CLI, it should ideally point users to the Getting Started page to acquire the installers, or, if that is deemed too heavy-handed, it should point people to the last stable release. If there is a need of the URL to be "baked in" to the higher-level tool, that URL should be an aka.ms URL because it needs to be stable on that end. - -Cross-platform IDEs/editors will work in similar way as above. The notification should also point people to the Getting Started page. The reason is simple: it is the one page where users can pick and choose their installation experience. - -### Visual Studio -Visual Studio will not be shipping CLI in-box. However, it will use CLI when installed. The install will be tied into other installs like WET and similar. The URL that is baked in VS should be an aka.ms URL or other stable URL/location. - -# Detecting dotnet/cli installation - -## Windows - -### Requirements for CLI SDK and shared framework installer -- Support side by side installation and can be compatible with older versions of themselves -- Supports removing of any side by side version -- Prerelease versions are compatible only with the same prerelease versions - -#### Scenarios -- Installing the product produces registry value informing about full version of the product which is being installed -- Installing the product produces registry values informing about compatible versions of the products -- Removing the product removes the registry keys if none of the versions of the product is supporting the given version. Specifically at least one registry key with full version should be removed. -- Installing older version of the product is possible - -#### Registry keys and values -- Full version refers to NuGet semantic version which contains the build number -- Version refers to NuGet semantic version which does *not* contain build number - -Registry key should be created under following path: -``` -HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\\\[REG_DWORD]=1 -``` - -`=(x86|x64)` -`=(sdk|sharedfx)` - -Example output (installing CLI SDK x86 with version 1.0.3-123456): - -``` -HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0=1 -HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.1=1 -HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.2=1 -HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.3=1 -HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.3-123456=1 -``` - -Note: 1.0.3 has two entries - -Explanation: -CLI SDK version 1.0.3-123456 is compatible with any build of 1.0.3, 1.0.2, 1.0.1 and 1.0.0. If another installer is trying to find if there exists CLI SDK which supports specific version of installer they can check for presence of the value 1 under the registry path. - -### Requirements for shared host installer -- Supports only in-place updated and is assumed to be always compatible with older versions of itself - -#### Scenarios -- Installing the product produces one registry value containing the latest version -- Installing older version on top of the other is not possible -- Removing removes the product completely with its registry keys, regardless of any previous installations - -Registry key should be created under following path: -``` -HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\\[REG_SZ]sharedhost= -``` - -##### Example -``` -HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\dotnet\Setup\x64\[REG_SZ]sharedhost=1.0.0-rc2-123456 -``` - -### Other Examples - -Operations: -`NOP` - key already existed, do nothing with it -`ADD` - add -`DEL` - delete -`RF+` - not adding because key already exist (installer will increse ref count on GUID related to this value) -`RF-` - not deleting because something else is compatible with this (decrease ref count) - -#### Scenario 1 - -Installing 1.0.3-123456 (RTM) to a clean machine - -Note: Installer is compatible with all previous versions and all their RCs. - -``` -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0-rc1=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0-rc2=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.1-rc1=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.1-rc2=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.1=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.2-rc1=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.2-rc2=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.2=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.3-rc1=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.3-rc2=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.3=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.3-123456=1 -``` - -Installing 1.0.4-234567 (RTM) on top of that - -``` -RF+ HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0-rc1=1 -RF+ HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0-rc2=1 -RF+ HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0=1 -RF+ HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.1-rc1=1 -RF+ HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.1-rc2=1 -RF+ HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.1=1 -RF+ HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.2-rc1=1 -RF+ HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.2-rc2=1 -RF+ HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.2=1 -RF+ HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.3-rc1=1 -RF+ HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.3-rc2=1 -RF+ HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.3=1 -NOP HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.3-123456=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.4-rc1=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.4-rc2=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.4=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.4-234567=1 -``` - -Removing 1.0.3-123456 - -``` -RF- HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0-rc1=1 -RF- HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0-rc2=1 -RF- HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0=1 -RF- HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.1-rc1=1 -RF- HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.1-rc2=1 -RF- HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.1=1 -RF- HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.2-rc1=1 -RF- HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.2-rc2=1 -RF- HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.2=1 -RF- HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.3-rc1=1 -RF- HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.3-rc2=1 -RF- HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.3=1 -DEL HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.3-123456=1 -NOP HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.4-rc1=1 -NOP HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.4-rc2=1 -NOP HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.4=1 -NOP HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.4-234567=1 -``` - -#### Scenario 2 - -Installing 1.0.0-123456 (RTM) to a clean machine - -``` -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0-rc1=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0-rc2=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0-123456=1 -``` - -Installing 1.1.0-567890 (RTM) which is incompatible since 1.0.2 - -Note: User is unable to run apps targeting 1.0.1 or 1.0.2 until compatible version is installed. - -``` -NOP HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0-rc1=1 -NOP HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0-rc2=1 -NOP HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0=1 -NOP HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0-123456=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.3-rc1=1 (first back-incompatible version) -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.3-rc2=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.3=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.4-rc1=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.4-rc2=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.4=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.1.0-rc1=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.1.0-rc2=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.1.0=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.1.0-567890=1 -``` - -#### Scenario 3 - -Installing 1.0.0-rc2-123456 to a clean machine - -Note: User is unable to run apps targeting 1.0.0 until RTM is installed. - -``` -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0-rc1=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0-rc2=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0-rc2-123456=1 -``` - -Installing 1.0.1-rc1-234567 - -Note: User is still unable to run apps targeting 1.0.0 until any 1.0.0+ RTM is installed. - -``` -NOP HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0-rc1=1 -NOP HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0-rc2=1 -NOP HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.0-rc2-123456=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.1-rc1=1 -ADD HKLM\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sdk\[REG_DWORD]1.0.1-rc1-123456=1 -``` diff --git a/Documentation/specs/corehost.md b/Documentation/specs/corehost.md deleted file mode 100644 index 88ed8e40b..000000000 --- a/Documentation/specs/corehost.md +++ /dev/null @@ -1,101 +0,0 @@ -# corehost runtime/assembly resolution - -The shared host locates assemblies and native libraries using a combination of: Servicing Index, Files in the application folder (aka "app-local") and files from package caches. - -## Definitions and Formats - -### Terms/Notes - -* The term "Library" (Title Case) is used throughout this document to refer to a NuGet Package. We use this term because it is used in the code to represent multiple things: Packages, Projects and Framework Assemblies are all types of "Library". -* All of the assembly resolution here refers to setting up the default assembly load context for the runtime. Further dynamic loads (plugins, etc.) can still have custom resolution logic provided by using an `AssemblyLoadContext` in the managed code. Essentially, we are setting up the necessary assemblies to launch the `Program.Main` (and all the assemblies that are statically-referenced by that). - -### Servicing Index - -The servicing index is loaded when the `DOTNET_SERVICING` environment variable is non-empty. When this variable is non-empty, it points to a directory that will be the **Servicing Root**. There may be platform-specific default locations, to be determined later. - -An index file is located at the path defined by `$DOTNET_SERVICING/servicing_index.txt`. In this file are a series of lines of one of the following formats: - -``` -# Lines starting with a '#' and blank lines are ignored. - -# Identifies an asset from a NuGet Package that has been serviced. -package|[Package ID]|[Package Version]|[Original Asset Relative Path]=[New Asset Path, relative to Servicing Root] -package|System.Threading.Thread|1.2.3.4|lib/dotnet5.4/System.Threading.Thread.dll=patches/abc123/System.Threading.Thread.dll - -# TBD: Host/Runtime servicing entries. -``` - -Paths in this file are **always** specified using `/`, even on Windows. They must be converted to platform-specific directory separators. - -This index is loaded when needed during the Resolution Process (see below). - -### Runtime Configuration File - -The runtime configuration file is used to determine settings to apply to the runtime during initialization and for building the TPA and Native Library Search Path lists. See the [spec for the runtime configuration file](runtime-configuration-file.md) for more information. - -### Files in the application folder - -Any file with the suffix `.dll` in the same folder as the managed application being loaded (the "Application Base") will be considered a viable assembly during the resolution process. The host **assumes** that the assembly's short name is the same as the file name with the `.dll` suffix removed (yes, this is not technically required by the CLR, but we assume it for use with this host). - -### Files from package caches - -Only assemblies listed in the dependencies file can be resolved from a package cache. To resolve those assemblies, two environment variables are used: - -* `DOTNET_PACKAGES` - The primary package cache. If not set, defaults to `$HOME/.nuget/packages` on Unix or `%LOCALAPPDATA%\NuGet\Packages` (TBD) on Windows. **NOTE**: Currently the host uses different folders as we are still coordinating with NuGet to get the directories right (there are compatability considerations). Currently we always use `$HOME/.dnx/packages`(Unix)/`%USERPROFILE%\.dnx\packages`(Win). -* `DOTNET_PACKAGES_CACHE` - The secondary cache. This is used by shared hosts (such as Azure) to provide a cache of pre-downloaded common packages on a faster disk. If not set, it is not used. - -Given the Package ID, Package Version, Package Hash and Asset Relative Path provided in the runtime configuration file, **and the assembly is not serviced** (see the full resolution algorithm below) resolution proceeds as follows (Unix-style paths will be used for convenience but these variables and paths all apply to Windows as well): - -1. If `DOTNET_PACKAGES_CACHE` is non-empty, read the file `$DOTNET_PACKAGES_CACHE/[Package ID]/[Package Version]/[Package Id].[Package Version].nupkg.sha512` if present. If the file is present and the content matches the `[Package Hash]` value from the dependencies file. Use that location as the Package Root and go to 3 -2. Using `DOTNET_PACKAGES`, or it's default value, use `$DOTNET_PACKAGES/[Package ID]/[Package Version]` as the Package Root -3. Concatenate the Package Root and the Asset Relative Path. This is the path to the asset (managed assembly or native library). - -## Assembly Resolution - -During host start-up, the host identifies if a runtime configuration file is present and loads it. It also scans the files located in the Application Base and determines the assembly name for each (using the file name). It builds a set of assembly names to be loaded by the union of the assembly names listed in runtime configuration file and the assemblies located in the Application Base. - -A runtime configuration file is **not** required to successfully launch an application, but without it, all the dependent assemblies must be located within the same folder as the application. Also, since servicing is performed on the basis of packages, an application without a runtime configuration file file cannot use the servicing index to override the location of assemblies. - -The host looks for the `.deps` file in the Application Base with the file name `[AssemblyName].deps`. The path to the deps file can be overridden by specifying `--depsfile:{path to deps file}` as the first parameter to the application. - -Given the set of assembly names, the host performs the following resolution. In some steps, the Package ID/Version/Relative Path data is required. This is only available if the assembly was listed in the deps file. If the assembly comes from the app-local folder, these resolution steps are skipped. - -1. If there is an entry in the servicing index for the Package ID/Version/Relative Path associated with the assembly, the Servicing Root is concatenated with the New Asset Path from the index and used as the Assembly Path. This occurs **even if the assembly is also located app-local**, as long as it is also in the runtime configuration file. -2. If there is a file in the Application Base with the file name `[AssemblyName].dll`, `[AssemblyName].ni.dll`, `[AssemblyName].exe`, or `[AssemblyName].ni.exe` (in that order), it its full path is used as the Assembly Path -3. The Assembly Path is resolved out of the Package Caches using the algorithm above (in 'Files from package caches'). - -A similar process is used to produce a list of Native Library Paths. Native libraries are listed in the runtime configuration file (under the `native` asset section) and searched in the same way as managed assemblies (Servicing, then app-local, then package caches). The main exception is that the app-local file extensions vary by platform (`.dll` on Windows, `.so` on Linux, `.dylib` on Mac OS X) - -Once a the list of assemblies and native libraries is produced, the host will check for duplicates. If both an `.ni.dll`/`.ni.exe` image and a `.dll`/`.exe` assembly are found for an assembly, the native image will be preferred and the IL-only assembly will be removed. The presence of two different paths for the same assembly name will be considered an error. The managed assemblies are provided in the Trusted Platform Assemblies (TPA) list for the CoreCLR during startup. The folder paths for each native library are deduplicated and provided in the Native Search Paths list for the CoreCLR during startup. - -**NOTE**: The CLR may add support for providing a similar structure as the TPA list for native libraries (i.e. a flat list of full file paths). - -### Satellite Assemblies - -Satellite Assemblies (assemblies containing only embedded resources used in place of the resources provided by an assembly) are detected by path convention in the host. The convention will be to look at the last two segments of the path (the file name and the immediate parent directory name). If the parent directory matches an [IETF Language Tag](https://en.wikipedia.org/wiki/IETF_language_tag) (or more specifically, a value usable in the Culture field for a CLR Assembly Name), then the assembly is considered culture-specific (for the culture specified in that folder name). Upon determining this, the host will place the culture-neutral assemblies on the TPA list and provide the directories containing the assemblies as Platform Resource Roots to the CLR to allow it to locate the assemblies. - -## Runtime Resolution - -Runtime resolution is controlled by these environment variables: - -* `DOTNET_RUNTIME_SERVICING` -> Global override for runtime -* `DOTNET_PACKAGES_CACHE` -> Secondary cache -* `DOTNET_PACKAGES` -> Package restore location - -The runtime is located by searching the following paths in order, where `APP_BASE` refers to the directory containing the managed application assembly and `LIBCORECLR` refers to the platform-specific name for the CoreCLR library (`libcoreclr.so` on Unix, `libcoreclr.dylib` on Mac OS X, `coreclr.dll` on Windows). The first path that matches is used as the path to load the CoreCLR from. - -* `$DOTNET_RUNTIME_SERVICING/runtime/coreclr/LIBCORECLR` -* `$DOTNET_PACKAGES_CACHE///runtimes//native/LICORECLR` -* `APP_BASE/LIBCORECLR` -* `$DOTNET_PACKAGES///runtimes//native/LIBCORECLR` -* On Unix: - * `/usr/local/share/dotnet/runtime/coreclr/LIBCORECLR` [1] - * `/usr/share/dotnet/runtime/coreclr/LIBCORECLR` -* On Windows: - * `%LocalAppData%\dotnet\runtime\coreclr\LIBCORECLR` - * `%ProgramFiles%\dotnet\runtime\coreclr\LIBCORECLR` [2] - -Notes: - -1. The Unix paths should be this way but are reversed in the actual code. Generally `/usr/local` is considered to have higher precedence than `/usr` -2. Not yet implemented. diff --git a/Documentation/specs/runtime-configuration-file.md b/Documentation/specs/runtime-configuration-file.md deleted file mode 100644 index fbf6e2c4c..000000000 --- a/Documentation/specs/runtime-configuration-file.md +++ /dev/null @@ -1,391 +0,0 @@ -# Runtime Configuration Files - -The runtime configuration files store the dependencies of an application (formerly stored in the `.deps` file). They also include runtime configuration options, such as the Garbage Collector mode. Optionally they can also include data for runtime compilation (compilation settings used to compile the original application, and reference assemblies used by the application). - -**Note:** This document doesn't provide full explanations as to why individual items are needed in this file. That is covered in the [`corehost` spec](corehost.md) and via the `Microsoft.Extensions.DependencyModel` assembly. - -## What produces the files and where are they? - -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.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. - -**IMPORTANT**: Portable Applications, i.e. those published without a specific RID, have some adjustments to this spec which is covered at the end. - -## File format - -The files are both JSON files stored in UTF-8 encoding. Below are sample files. Note that not all sections are required and some will be opt-in only (see below for more details). The `.runtimeconfig.json` file is completely optional, and in the `.deps.json` file, only the `runtimeTarget`, `targets` and `libraries` sections are required (and within the `targets` section, only the runtime-specific target is required). - -### [appname].runtimeconfig.json -```json -{ - "runtimeOptions": { - - "configProperties": { - "System.GC.Server": true, - "System.GC.Concurrent": true, - "System.Threading.ThreadPool.MinThreads": 4, - "System.Threading.ThreadPool.MaxThreads": 8 - }, - - "framework": { - "name": "Microsoft.DotNetCore", - "version": "1.0.1" - }, - - "applyPatches": false - } -} -``` - -### [appname].deps.json -```json -{ - "runtimeTarget": ".NETStandardApp,Version=v1.5/osx.10.10-x64", - "compilationOptions": { - "defines": [ "DEBUG" ] - }, - "targets": { - ".NETStandardApp,Version=v1.5": { - "MyApp/1.0": { - "type": "project", - "dependencies": { - "AspNet.Mvc": "1.0.0" - } - }, - "System.Foo/1.0.0": { - "type": "package", - }, - "System.Banana/1.0.0": { - "type": "package", - "dependencies": { - "System.Foo": "1.0.0" - }, - "compile": { - "ref/dotnet5.4/System.Banana.dll": { } - } - } - }, - ".NETStandardApp,Version=v1.5/osx.10.10-x64": { - "MyApp/1.0": { - "type": "project", - "dependencies": { - "AspNet.Mvc": "1.0.0" - } - }, - "System.Foo/1.0.0": { - "type": "package", - "runtime": { - "lib/dnxcore50/System.Foo.dll": { } - } - }, - "System.Banana/1.0.0": { - "type": "package", - "dependencies": { - "System.Foo": "1.0.0" - }, - "runtime": { - "lib/dnxcore50/System.Banana.dll": { } - }, - "resources": { - "lib/dnxcore50/fr-FR/System.Banana.resources.dll": { "locale": "fr-FR" } - }, - "native": { - "runtimes/osx.10.10-x64/native/libbananahelper.dylib": { } - } - } - } - }, - "libraries": { - "MyApp/1.0": { - "type": "project" - }, - "System.Foo/1.0": { - "type": "package", - "serviceable": true, - "sha512": "[base64 string]" - }, - "System.Banana/1.0": { - "type": "package", - "sha512": "[base64 string]" - } - } -} -``` - -## Sections - -### `runtimeOptions` Section (`.runtimeconfig.json`) - -This section is copied verbatim from an identical section in the input `project.json` file (with the exception of the `target` parameter which is generated by the compilation process). The `runtimeConfig` section specifies parameters to be provided to the runtime during initialization. Known parameters include: -* `configProperties` - Indicates configuration properties to configure the runtime and the framework - * Examples: - * Full list of [configuration properties](https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/clr-configuration-knobs.md) for CoreCLR. - * `System.GC.Server` (old: `gcServer`) - Boolean indicating if the server GC should be used (Default: `true`). - * `System.GC.Concurrent` (old: `gcConcurrent`) - Boolean indicating if background garbage collection should be used. -* `framework` - Indicates the `name`, `version`, and other properties of the shared framework to use when activating the application. The presence of this section indicates that the application is a portable app designed to use a shared redistributable framework. -* `applyPatches` - When `false`, the framework version is strictly obeyed by the host. When `applyPatches` is unspecified or specified as `true`, the framework from either the same or a higher version that differs only in the `SemVer` patch field will be used. - * For example, if `version=1.0.1` and `applyPatches` is `true`, the host would load the shared framework from `1.0.{n}`, where `n >= 1`, but will not load from `1.1.0`, even if present. When `applyPatches` is `false`, the shared framework will be loaded from `1.0.1` strictly. - * **Note:** This does not apply to `SemVer`'s `prerelease` versions, but only for `production` releases. - * **Note:** This section will not be used for standalone applications that do not rely upon a shared framework. - -* Others _TBD_ - -These settings are read by `corehost` to determine how to initialize the runtime. All versions of `corehost` **must ignore** settings in this section that they do not understand (thus allowing new settings to be added in later versions). - -### `compilationOptions` Section (`.deps.json`) - -This section is copied by storing the merged `compilationOptions` from the input `project.json`. The `project.json` can define three sets of compilation options: Global, Per-Configuration, and Per-Framework. However, the `[appname].runtimeconfig.json` is specific to a configuration and framework so there is only one merged section here. - -The exact settings found here are specific to the compiler that produced the original application binary. Some example settings include: `defines`, `languageVersion` (C#/VB), `allowUnsafe` (C#), etc. - -As an example, here is a possible `project.json` file: - -```json -{ - "compilationOptions": { - "allowUnsafe": true - }, - "frameworks": { - "net451": { - "compilationOptions": { - "defines": [ "DESKTOP_CLR" ] - } - }, - "dnxcore50": { - "compilationOptions": { - "defines": [ "CORE_CLR" ] - } - } - }, - "configurations": { - "Debug": { - "compilationOptions": { - "defines": [ "DEBUG_MODE" ] - } - } - } -} -``` - -When this project is built for `dnxcore50` in the `Debug` configuration, the outputted `MyApp.deps.json` file will have the following `compilationOptions` section: - -```json -{ - "compilationOptions": { - "allowUnsafe": true, - "defines": [ "CORE_CLR", "DEBUG_MODE" ] - } -} -``` - -### `runtimeTarget` Section (`.deps.json`) - -This property contains the name of the target from `targets` that should be used by the runtime. This is present to simplify `corehost` so that it does not have to parse or understand target names and the meaning thereof. - -### `targets` Section (`.deps.json`) - -This section contains subsetted data from the input `project.lock.json`. - -Each property under `targets` describes a "target", which is a collection of libraries required by the application when run or compiled in a certain framework and platform context. A target **must** specify a Framework name, and **may** specify a Runtime Identifier. Targets without Runtime Identifiers represent the dependencies and assets used for compiling the application for a particular framework. Targets with Runtime Identifiers represent the dependencies and assets used for running the application under a particular framework and on the platform defined by the Runtime Identifier. In the example above, the `.NETStandardApp,Version=v1.5` target lists the dependencies and assets used to compile the application for `dnxcore50`, and the `.NETStandardApp,Version=v1.5/osx.10.10-x64` target lists the dependencies and assets used to run the application on `dnxcore50` on a 64-bit Mac OS X 10.10 machine. - -There will always be two targets in the `[appname].runtimeconfig.json` file: A compilation target, and a runtime target. The compilation target will be named with the framework name used for the compilation (`.NETStandardApp,Version=v1.5` in the example above). The runtime target will be named with the framework name and runtime identifier used to execute the application (`.NETStandardApp,Version=v1.5/osx.10.10-x64` in the example above). However, the runtime target will also be identified by name in the `runtimeOptions` section, so that `corehost` need not parse and understand target names. - -The content of each target property in the JSON is a JSON object. Each property of that JSON object represents a single dependency required by the application when compiled for/run on that target. The name of the property contains the ID and Version of the dependency in the form `[Id]/[Version]`. The content of the property is another JSON object containing metadata about the dependency. - -The `type` property of a dependency object defines what kind of entity satisfied the dependency. Possible values include `project` and `package` (further comments on dependency types below). - -**Open Question:** `type` is also present in the `libraries` section. We don't really need it in both. It's in both now because the lock file does that and we want the formats to be similar. Should we remove it? - -The `dependencies` property of a dependency object defines the ID and Version of direct dependencies of this node. It is a JSON object where the property names are the ID of the dependency and the content of each property is the Version of the dependency. - -The `runtime` property of a dependency object lists the relative paths to Managed Assemblies required to be available at runtime in order to satisfy this dependency. The paths are relative to the location of the Dependency (see below for further details on locating a dependency). - -The `resources` property of a dependency object lists the relative paths and locales of Managed Satellite Assemblies which provide resources for other languages. Each item contains a `locale` property specifying the [IETF Language Tag](https://en.wikipedia.org/wiki/IETF_language_tag) for the satellite assembly (or more specifically, a value usable in the Culture field for a CLR Assembly Name). - -The `native` property of a dependency object lists the relative paths to Native Libraries required to be available at runtime in order to satisfy this dependency. The paths are relative to the location of the Dependency (see below for further details on locating a dependency). - -In compilation targets, the `runtime`, `resources` and `native` properties of a dependency are omitted, because they are not relevant to compilation. Similarly, in runtime targets, the `compile` property is omitted, because it is not relevant to runtime. - -Only dependencies with a `type` value of `package` should be considered by `corehost`. There may be other items, used for other purposes (for example, Projects, Reference Assemblies, etc. - -### `libraries` Section (`.deps.json`) - -This section contains a union of all the dependencies found in the various targets, and contains common metadata for them. Specifically, it contains the `type`, as well as a boolean indicating if the library can be serviced (`serviceable`, only for `package`-typed libraries) and a SHA-512 hash of the package file (`sha512`, only for `package`-typed libraries. - -## How the file is used - -The file is read by two different components: - -* `corehost` uses it to determine what to place on the TPA and Native Library Search Path lists, as well as what runtime settings to apply (GC type, etc.). See [the `corehost` spec](corehost.md). -* `Microsoft.Extensions.DependencyModel` uses it to allow a running managed application to query various data about it's dependencies. For example: - * To find all dependencies that depend on a particular package (used by ASP.NET MVC and other plugin-based systems to identify assemblies that should be searched for possible plugin implementations) - * To determine the reference assemblies used by the application when it was compiled in order to allow runtime compilation to use the same reference assemblies (used by ASP.NET Razor to compile views) - * To determine the compilation settings used by the application in order to allow runtime compilation to use the same settings (also used by ASP.NET Razor views). - -## Opt-In Compilation Data - -Some of the sections in the `.deps.json` file contain data used for runtime compilation. This data is not provided in the file by default. Instead, a project.json setting `preserveCompilationContext` must be set to true in order to ensure this data is added. Without this setting, the `compilationOptions` will not be present in the file, and the `targets` section will contain only the runtime target. For example, if the `preserveCompilationContext` setting was not present in the `project.json` that generated the above example, the `.deps.json` file would only contain the following content: - -```json -{ - "runtimeTarget": { - "name": ".NETStandardApp,Version=v1.5/osx.10.10-x64", - "portable": false - }, - "targets": { - ".NETStandardApp,Version=v1.5/osx.10.10-x64": { - "MyApp/1.0": { - "dependencies": { - "AspNet.Mvc": "1.0.0" - } - }, - "System.Foo/1.0.0": { - "runtime": { - "lib/dnxcore50/System.Foo.dll": { } - } - }, - "System.Banana/1.0.0": { - "dependencies": { - "System.Foo": "1.0.0" - }, - "runtime": { - "lib/dnxcore50/System.Banana.dll": { } - }, - "resources": { - "lib/dnxcore50/fr-FR/System.Banana.resources.dll": { "locale": "fr-FR" } - }, - "native": { - "runtimes/osx.10.10-x64/native/libbananahelper.dylib": { } - } - } - } - }, - "libraries": { - "MyApp/1.0": { - "type": "project" - }, - "System.Foo/1.0": { - "type": "package", - "serviceable": true, - "sha512": "[base64 string]" - }, - "System.Banana/1.0": { - "type": "package", - "sha512": "[base64 string]" - } - } -} -``` - -## Portable Deployment Model - -An application can be deployed in a "portable" deployment model. In this case, the RID-specific assets of packages are published within a folder structure that preserves the RID metadata. However, `corehost` does not use this folder structure, rather it reads data from the `.deps.json` file. Also, during deployment, the `.exe` file (`corehost` renamed) is not deployed. - -In the portable deployment model, the `*.runtimeConfig.json` file will contain the `runtimeOptions.framework` section: - -```json -{ - "runtimeOptions": { - "framework": { - "name": "NETCore.App", - "version": "1.0.1" - } - } -} -``` - -This data is used to locate the shared framework folder. The exact mechanics of which version are selected are defined elsewhere, but in general, it locates the shared runtime in the `shared` folder located beside it by using the relative path `shared/[runtimeOptions.framework.name]/[runtimeOptions.framework.version]`. Once it has applied any version roll-forward logic and come to a final path to the shared framework, it locates the `[runtimeOptions.framework.name].deps.json` file within that folder and loads it **first**. - -Next, the deps file from the application is loaded and merged into this deps file (this is conceptual, the host implementation doesn't necessary have to directly merge the data ;)). Data from the app-local deps file trumps data from the shared framework. - -The shared framework's deps file will also contain a `runtimes` section defining the fallback logic for all RIDs known to that shared framework. For example, a shared framework deps file installed into a Ubuntu machine may look something like the following: - -```json -{ - "runtimeTarget": { - "name": ".NETStandardApp,Version=v1.5", - "portable": false - }, - "targets": { - ".NETStandardApp,Version=v1.5": { - "System.Runtime/4.0.0": { - "runtime": "lib/netstandard1.5/System.Runtime.dll" - }, - "... other libraries ...": {} - } - }, - "libraries": { - "System.Runtime/4.0.0": { - "type": "package", - "serviceable": true, - "sha512": "[base64 string]" - }, - "... other libraries ...": {} - }, - "runtimes": { - "ubuntu.15.04-x64": [ "ubuntu.14.10-x64", "ubuntu.14.04-x64", "debian.8-x64", "linux-x64", "linux", "unix", "any", "base" ], - "ubuntu.14.10-x64": [ "ubuntu.14.04-x64", "debian.8-x64", "linux-x64", "linux", "unix", "any", "base" ], - "ubuntu.14.04-x64": [ "debian.8-x64", "linux-x64", "linux", "unix", "any", "base" ] - } -} -``` - -The host will have a RID embedded in it during compilation (for example, `win10-x64` for Windows 64-bit). It will look up the corresponding entry in the `runtimes` section to identify what the fallback list is for `win10-x64`. The fallbacks are identified from most-specific to least-specific. In the case of `win10-x64` and the example above, the fallback list is: `"win10-x64", "win10", "win81-x64", "win81", "win8-x64", "win8", "win7-x64", "win7", "win-x64", "win", "any", "base"` (note that an exact match on the RID itself is the first preference, followed by the first item in the fallback list, then the next item, and so on). - -In the app-local deps file for a `portable` application, the package entries may have an additional `runtimeTargets` section detailing RID-specific assets. The `corehost` application should use this data, along with the current RID and the RID fallback data defined in the `runtimes` section of the shared framework deps file to select one **and only one** RID value out of each package individually. The most specific RID present within the package should always be selected. - -Consider `corehost` built for `ubuntu.14.04-x64` and the following snippet from an app-local deps file (some sections removed for brevity). - -```json -{ - "targets": { - ".NETStandardApp,Version=v1.5": { - "System.Data.SqlClient/4.0.0": { - "compile": { - "ref/netstandard1.5/System.Data.SqlClient.dll": {} - }, - "runtimeTargets": { - "runtimes/unix/lib/netstandard1.5/System.Data.SqlClient.dll": { - "assetType": "runtime", - "rid": "unix" - }, - "runtimes/win7-x64/lib/netstandard1.5/System.Data.SqlClient.dll": { - "assetType": "runtime", - "rid": "win7-x64" - }, - "runtimes/win7-x86/lib/netstandard1.5/System.Data.SqlClient.dll": { - "assetType": "runtime", - "rid": "win7-x86" - }, - "runtimes/win7-x64/native/sni.dll": { - "assetType": "native", - "rid": "win7-x64" - }, - "runtimes/win7-x86/native/sni.dll": { - "assetType": "native", - "rid": "win7-x86" - } - } - } - } - } -} -``` - -When setting up the TPA and native library lists, it will do the following for the `System.Data.SqlClient` entry in the example above: - -1. Add all entries from the root `runtime` and `native` sections (not present in the example). (Note: This is essentially the current behavior for the existing deps file format) -2. Add all appropriate entries from the `runtimeTargets` section, based on the `rid` property of each item: - 1. Attempt to locate any item for the RID `ubuntu.14.04-x64`. If any asset is matched, take **only** the items matching that RID exactly and add them to the appropriate lists based on the `assetType` value (`runtime` for managed code, `native` for native code) - 2. Reattempt the previous step using the first RID in the list provided by the list in the `runtimes."ubuntu.14.04-x64"` section of the shared framework deps file. If any asset is matched, take **only** the items matching that RID exactly and add them to the appropriate lists - 3. Continue to reattempt the previous search for each RID in the list, from left to right until a match is found or the list is exhausted. Exhausting the list without finding an asset, when a `runtimeTargets` section is present is **not** an error, it simply indicates that there is no need for a runtime-specific asset for that package. - -Note one important aspect about asset resolution: The resolution scope is **per-package**, **not per-application**, **nor per-asset**. For each individual package, the most appropriate RID is selected, and **all** assets taken from that package must match the selected RID exactly. For example, if a package provides both a `linux-x64` and a `unix` RID (in the `ubuntu.14.04-x64` example above), **only** the `linux-x64` asset would be selected for that package. However, if a different package provides only a `unix` RID, then the asset from the `unix` RID would be selected. - -The path to a runtime-specific asset is resolved in the same way as a normal asset (first check Servicing, then Package Cache, App-Local, Global Packages Location, etc.) with **one exception**. When searching app-local, rather than just looking for the simple file name in the app-local directory, a runtime-specific asset is expected to be located in a subdirectory matching the relative path information for that asset in the lock file. So the `native` `sni.dll` asset for `win7-x64` in the `System.Data.SqlClient` example above would be located at `APPROOT/runtimes/win7-x64/native/sni.dll`, rather than the normal app-local path of `APPROOT/sni.dll`. diff --git a/ISSUE_TEMPLATE b/ISSUE_TEMPLATE deleted file mode 100644 index 673155920..000000000 --- a/ISSUE_TEMPLATE +++ /dev/null @@ -1,17 +0,0 @@ -## Steps to reproduce - - -## Expected behavior - - -## Actual behavior - - -## Environment data -`dotnet --info` output: - - - - - - diff --git a/NuGet.master.config b/NuGet.master.config deleted file mode 100644 index b004e5cc7..000000000 --- a/NuGet.master.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/.noautobuild b/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/App.csproj b/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/App.csproj deleted file mode 100644 index 6b6514fb3..000000000 --- a/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/App.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - - netcoreapp2.0;net451 - Exe - $(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/Program.cs b/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/Program.cs deleted file mode 100644 index 2130cd0a7..000000000 --- a/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsAndConfig/AppWithRedirectsAndConfig.csproj b/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsAndConfig/AppWithRedirectsAndConfig.csproj deleted file mode 100644 index 287b089bb..000000000 --- a/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsAndConfig/AppWithRedirectsAndConfig.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - net46 - AppWithRedirectsAndConfig - Exe - win7-x64;win7-x86 - $(TEST_PACKAGES) - - - - - - - - - - - - - - - - - - - - - - - diff --git a/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsAndConfig/app.config b/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsAndConfig/app.config deleted file mode 100644 index 25aeea673..000000000 --- a/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsAndConfig/app.config +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsNoConfig/AppWithRedirectsNoConfig.csproj b/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsNoConfig/AppWithRedirectsNoConfig.csproj deleted file mode 100644 index 8e5fc172e..000000000 --- a/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsNoConfig/AppWithRedirectsNoConfig.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - net46 - AppWithRedirectsNoConfig - Exe - win7-x64;win7-x86 - $(TEST_PACKAGES) - - - - - - - - - - - - - - - - - - - - - - - diff --git a/TestAssets/DesktopTestProjects/BindingRedirectSample/src/Program.cs b/TestAssets/DesktopTestProjects/BindingRedirectSample/src/Program.cs deleted file mode 100644 index 57ecd14fc..000000000 --- a/TestAssets/DesktopTestProjects/BindingRedirectSample/src/Program.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Reflection; - -namespace BindingRedirects -{ - public class Program - { - private const string ExpectedNewtonSoftVersion = "8.0.0.0"; - - public static int Main(string[] args) - { - return VerifyJsonLoad(); - } - - private static int VerifyJsonLoad() - { - WriteLine("=======Verifying Redirected Newtonsoft.Json assembly load======="); - - int result = 0; - - try - { - var jsonAsm = typeof(Newtonsoft.Json.JsonConvert).Assembly; - var version = jsonAsm.GetName().Version.ToString(); - if (version != ExpectedNewtonSoftVersion) - { - WriteLine($"Failure - Newtonsoft.Json: ExpectedVersion - {ExpectedNewtonSoftVersion}, ActualVersion - {version}"); - result = -1; - } - } - catch (Exception ex) - { - WriteLine($"Failed to load type 'Newtonsoft.Json.JsonConvert'"); - throw ex; - } - - return result; - } - - private static void WriteLine(string str) - { - var currentAssembly = Assembly.GetExecutingAssembly().GetName().Name; - Console.WriteLine($"{currentAssembly}: {str}"); - } - } -} diff --git a/TestAssets/DesktopTestProjects/DesktopAppWithNativeDep/.noautobuild b/TestAssets/DesktopTestProjects/DesktopAppWithNativeDep/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/DesktopTestProjects/DesktopAppWithNativeDep/Program.cs b/TestAssets/DesktopTestProjects/DesktopAppWithNativeDep/Program.cs deleted file mode 100644 index 71b9980f3..000000000 --- a/TestAssets/DesktopTestProjects/DesktopAppWithNativeDep/Program.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace DesktopAppWithNativeDep -{ - public static class Program - { - public static void Main(string[] args) - { - } - } -} diff --git a/TestAssets/DesktopTestProjects/DesktopAppWithNativeDep/project.json b/TestAssets/DesktopTestProjects/DesktopAppWithNativeDep/project.json deleted file mode 100644 index 30113b6e3..000000000 --- a/TestAssets/DesktopTestProjects/DesktopAppWithNativeDep/project.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": "1.0.0-*", - "dependencies": { - "PackageWithFakeNativeDep": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1" - }, - "buildOptions": { - "emitEntryPoint": true - }, - "frameworks": { - "net451": {} - } -} diff --git a/TestAssets/DesktopTestProjects/DesktopAppWithRuntimes/.noautobuild b/TestAssets/DesktopTestProjects/DesktopAppWithRuntimes/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/DesktopTestProjects/DesktopAppWithRuntimes/Program.cs b/TestAssets/DesktopTestProjects/DesktopAppWithRuntimes/Program.cs deleted file mode 100644 index 758142805..000000000 --- a/TestAssets/DesktopTestProjects/DesktopAppWithRuntimes/Program.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace DesktopAppWithRuntimes -{ - public static class Program - { - public static void Main(string[] args) - { - } - } -} diff --git a/TestAssets/DesktopTestProjects/DesktopAppWithRuntimes/project.json b/TestAssets/DesktopTestProjects/DesktopAppWithRuntimes/project.json deleted file mode 100644 index aca443945..000000000 --- a/TestAssets/DesktopTestProjects/DesktopAppWithRuntimes/project.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": "1.0.0-*", - "dependencies": { - "Microsoft.NETCore.Windows.ApiSets": "1.0.1-rc3-24206-00" - }, - "buildOptions": { - "emitEntryPoint": true - }, - "frameworks": { - "net451": {} - }, - "runtimes": { - "win7-x64": {} - } -} diff --git a/TestAssets/DesktopTestProjects/DesktopKestrelSample/KestrelDesktop/.noautobuild b/TestAssets/DesktopTestProjects/DesktopKestrelSample/KestrelDesktop/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/DesktopTestProjects/DesktopKestrelSample/KestrelDesktop/project.json b/TestAssets/DesktopTestProjects/DesktopKestrelSample/KestrelDesktop/project.json deleted file mode 100644 index 5bd1f2723..000000000 --- a/TestAssets/DesktopTestProjects/DesktopKestrelSample/KestrelDesktop/project.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": "1.0.0-*", - "dependencies": { - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-20113", - "Microsoft.AspNetCore.Hosting": "1.0.0-rc2-20113", - "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-20254", - "Microsoft.NETCore.Platforms": "1.0.1" - }, - "buildOptions": { - "emitEntryPoint": true, - "compile": { - "include": [ - "../src/*.cs" - ] - } - }, - "frameworks": { - "net451": {} - } -} diff --git a/TestAssets/DesktopTestProjects/DesktopKestrelSample/KestrelDesktopForce32/.noautobuild b/TestAssets/DesktopTestProjects/DesktopKestrelSample/KestrelDesktopForce32/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/DesktopTestProjects/DesktopKestrelSample/KestrelDesktopForce32/project.json b/TestAssets/DesktopTestProjects/DesktopKestrelSample/KestrelDesktopForce32/project.json deleted file mode 100644 index 93adffa3d..000000000 --- a/TestAssets/DesktopTestProjects/DesktopKestrelSample/KestrelDesktopForce32/project.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": "1.0.0-*", - "dependencies": { - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-20113", - "Microsoft.AspNetCore.Hosting": "1.0.0-rc2-20113", - "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-20254", - "Microsoft.NETCore.Platforms": "1.0.1" - }, - "buildOptions": { - "platform": "anycpu32bitpreferred", - "emitEntryPoint": true, - "compile": { - "include": [ - "../src/*.cs" - ] - } - }, - "frameworks": { - "net451": {} - } -} diff --git a/TestAssets/DesktopTestProjects/DesktopKestrelSample/KestrelDesktopWithRuntimes/.noautobuild b/TestAssets/DesktopTestProjects/DesktopKestrelSample/KestrelDesktopWithRuntimes/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/DesktopTestProjects/DesktopKestrelSample/KestrelDesktopWithRuntimes/project.json b/TestAssets/DesktopTestProjects/DesktopKestrelSample/KestrelDesktopWithRuntimes/project.json deleted file mode 100644 index 700f1e2f7..000000000 --- a/TestAssets/DesktopTestProjects/DesktopKestrelSample/KestrelDesktopWithRuntimes/project.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "version": "1.0.0-*", - "dependencies": { - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-20113", - "Microsoft.AspNetCore.Hosting": "1.0.0-rc2-20113", - "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-20254", - "Microsoft.NETCore.Platforms": "1.0.1" - }, - "buildOptions": { - "emitEntryPoint": true, - "compile": { - "include": [ - "../src/*.cs" - ] - } - }, - "frameworks": { - "net451": {} - }, - "runtimes": { - "win7-x86": {}, - "win7-x64": {}, - "osx.10.11-x64": {} - } -} diff --git a/TestAssets/DesktopTestProjects/DesktopKestrelSample/src/Startup.cs b/TestAssets/DesktopTestProjects/DesktopKestrelSample/src/Startup.cs deleted file mode 100644 index c54634573..000000000 --- a/TestAssets/DesktopTestProjects/DesktopKestrelSample/src/Startup.cs +++ /dev/null @@ -1,88 +0,0 @@ -// 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.Security.Cryptography.X509Certificates; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Server.Kestrel; -using Microsoft.AspNetCore.Server.Kestrel.Filter; -using Microsoft.Extensions.Logging; - -namespace SampleApp -{ - public class Startup - { - private static string Args { get; set; } - private static CancellationTokenSource ServerCancellationTokenSource { get; set; } - - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) - { - var ksi = app.ServerFeatures.Get(); - ksi.NoDelay = true; - - loggerFactory.AddConsole(LogLevel.Error); - - app.UseKestrelConnectionLogging(); - - app.Run(async context => - { - Console.WriteLine("{0} {1}{2}{3}", - context.Request.Method, - context.Request.PathBase, - context.Request.Path, - context.Request.QueryString); - Console.WriteLine($"Method: {context.Request.Method}"); - Console.WriteLine($"PathBase: {context.Request.PathBase}"); - Console.WriteLine($"Path: {context.Request.Path}"); - Console.WriteLine($"QueryString: {context.Request.QueryString}"); - - var connectionFeature = context.Connection; - Console.WriteLine($"Peer: {connectionFeature.RemoteIpAddress?.ToString()} {connectionFeature.RemotePort}"); - Console.WriteLine($"Sock: {connectionFeature.LocalIpAddress?.ToString()} {connectionFeature.LocalPort}"); - - var content = $"Hello world!{Environment.NewLine}Received '{Args}' from command line."; - context.Response.ContentLength = content.Length; - context.Response.ContentType = "text/plain"; - await context.Response.WriteAsync(content); - }); - } - - public static int Main(string[] args) - { - if (args.Length == 0) - { - Console.WriteLine("KestrelHelloWorld "); - return 1; - } - - var url = new Uri(args[0]); - Args = string.Join(" ", args); - - var host = new WebHostBuilder() - .UseServer("Microsoft.AspNetCore.Server.Kestrel") - .UseUrls(url.ToString()) - .UseStartup() - .Build(); - - ServerCancellationTokenSource = new CancellationTokenSource(); - - // shutdown server after 20s. - var shutdownTask = Task.Run(async () => - { - await Task.Delay(20000); - ServerCancellationTokenSource.Cancel(); - }); - - host.Run(ServerCancellationTokenSource.Token); - shutdownTask.Wait(); - - return 0; - } - } -} diff --git a/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/.noautobuild b/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/Lib.csproj b/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/Lib.csproj deleted file mode 100644 index bad19bf93..000000000 --- a/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/Lib.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - netstandard1.6;net451 - Library - $(AssetTargetFallback);portable-net45+win8;dnxcore50;netcoreapp2.0 - $(TEST_PACKAGES) - - - - - - - - - - - - - - diff --git a/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/Program.cs b/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/Program.cs deleted file mode 100644 index 2130cd0a7..000000000 --- a/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/DesktopTestProjects/MultiTFMXunitProject/TestLibrary/Helper.cs b/TestAssets/DesktopTestProjects/MultiTFMXunitProject/TestLibrary/Helper.cs deleted file mode 100644 index 67b32cfdb..000000000 --- a/TestAssets/DesktopTestProjects/MultiTFMXunitProject/TestLibrary/Helper.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace TestLibrary -{ - public static class Helper - { - /// - /// Gets the message from the helper. This comment is here to help test XML documentation file generation, please do not remove it. - /// - /// A message - public static string GetMessage() - { - return "This string came from the test library!"; - } - - public static void SayHi() - { - Console.WriteLine("Hello there!"); - } - } -} \ No newline at end of file diff --git a/TestAssets/DesktopTestProjects/MultiTFMXunitProject/TestLibrary/TestLibrary.csproj b/TestAssets/DesktopTestProjects/MultiTFMXunitProject/TestLibrary/TestLibrary.csproj deleted file mode 100644 index 9f5c4f4ab..000000000 --- a/TestAssets/DesktopTestProjects/MultiTFMXunitProject/TestLibrary/TestLibrary.csproj +++ /dev/null @@ -1,7 +0,0 @@ - - - - netstandard2.0 - - - diff --git a/TestAssets/DesktopTestProjects/MultiTFMXunitProject/XUnitProject/UnitTest1.cs b/TestAssets/DesktopTestProjects/MultiTFMXunitProject/XUnitProject/UnitTest1.cs deleted file mode 100644 index f86168c43..000000000 --- a/TestAssets/DesktopTestProjects/MultiTFMXunitProject/XUnitProject/UnitTest1.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using TestLibrary; -using Xunit; - -namespace TestNamespace -{ - public class VSTestXunitTests - { - [Fact] - public void VSTestXunitPassTest() - { - Assert.Equal("This string came from the test library!", Helper.GetMessage()); - } - - [Fact] - public void VSTestXunitFailTest() - { - Assert.Equal(2, 2); - } - } -} diff --git a/TestAssets/DesktopTestProjects/MultiTFMXunitProject/XUnitProject/XUnitProject.csproj b/TestAssets/DesktopTestProjects/MultiTFMXunitProject/XUnitProject/XUnitProject.csproj deleted file mode 100644 index 2ae7ce025..000000000 --- a/TestAssets/DesktopTestProjects/MultiTFMXunitProject/XUnitProject/XUnitProject.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - net461;netcoreapp2.0 - - - - - - - - - - - - diff --git a/TestAssets/DesktopTestProjects/TestAppWithFrameworkAssemblies/ProjectA/.noautobuild b/TestAssets/DesktopTestProjects/TestAppWithFrameworkAssemblies/ProjectA/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/DesktopTestProjects/TestAppWithFrameworkAssemblies/ProjectA/Program.cs b/TestAssets/DesktopTestProjects/TestAppWithFrameworkAssemblies/ProjectA/Program.cs deleted file mode 100644 index 1d1f78b84..000000000 --- a/TestAssets/DesktopTestProjects/TestAppWithFrameworkAssemblies/ProjectA/Program.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Diagnostics; -using TestLibrary; - -namespace TestApp -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine("This string came from ProjectA"); - Console.WriteLine($"{ProjectD.GetMessage()}"); - return 0; - } - } -} diff --git a/TestAssets/DesktopTestProjects/TestAppWithFrameworkAssemblies/ProjectA/project.json b/TestAssets/DesktopTestProjects/TestAppWithFrameworkAssemblies/ProjectA/project.json deleted file mode 100644 index 1fb29b170..000000000 --- a/TestAssets/DesktopTestProjects/TestAppWithFrameworkAssemblies/ProjectA/project.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "dependencies": { - "ProjectB": { - "target": "project", - "version": "1.0.0-*" - } - }, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": "1.1.0" - } - }, - "net451": {} - }, - "runtimes": { - "win7-x64": {}, - "win7-x86": {}, - "osx.10.10-x64": {}, - "osx.10.11-x64": {}, - "ubuntu.14.04-x64": {}, - "ubuntu.16.04-x64": {}, - "centos.7-x64": {}, - "rhel.7.2-x64": {}, - "debian.8-x64": {}, - "fedora.23-x64": {}, - "opensuse.13.2-x64": {} - } -} diff --git a/TestAssets/DesktopTestProjects/TestAppWithFrameworkAssemblies/ProjectB/.noautobuild b/TestAssets/DesktopTestProjects/TestAppWithFrameworkAssemblies/ProjectB/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/DesktopTestProjects/TestAppWithFrameworkAssemblies/ProjectB/Helper.cs b/TestAssets/DesktopTestProjects/TestAppWithFrameworkAssemblies/ProjectB/Helper.cs deleted file mode 100644 index 5a986d891..000000000 --- a/TestAssets/DesktopTestProjects/TestAppWithFrameworkAssemblies/ProjectB/Helper.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace TestLibrary -{ - public static class ProjectB - { - public static string GetMessage() - { - return "This string came from ProjectB"; - } - } -} diff --git a/TestAssets/DesktopTestProjects/TestAppWithFrameworkAssemblies/ProjectB/project.json b/TestAssets/DesktopTestProjects/TestAppWithFrameworkAssemblies/ProjectB/project.json deleted file mode 100644 index 0e9d0db62..000000000 --- a/TestAssets/DesktopTestProjects/TestAppWithFrameworkAssemblies/ProjectB/project.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "nowarn": [ - "CS1591" - ], - "xmlDoc": true, - "additionalArguments": [ - "-highentropyva+" - ] - }, - "dependencies": { - "NETStandard.Library": "1.6.0" - }, - "frameworks": { - "netstandard1.5": {}, - "net451": { - "frameworkAssemblies": { - "System.ComponentModel.DataAnnotations": "" - } - } - } -} diff --git a/TestAssets/LockFiles/ExportFiles/invalid_missing-exports/project.fragment.lock.json b/TestAssets/LockFiles/ExportFiles/invalid_missing-exports/project.fragment.lock.json deleted file mode 100644 index d803c7d2c..000000000 --- a/TestAssets/LockFiles/ExportFiles/invalid_missing-exports/project.fragment.lock.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "version": 2, - "exports": { - "ClassLibrary2/1.0.0": { - "type": "project", - "framework": ".NETFramework,Version=v4.6", - "compile": { - "bin/Debug/ClassLibrary2.dll": {} - }, - "runtime": { - "bin/Debug/ClassLibrary2.dll": {} - } - }, - "ClassLibrary3/1.0.0": { - "type": "project", - "framework": ".NETFramework,Version=v4.6", - "compile": { - "bin/Debug/ClassLibrary3.dll": {} - }, - "runtime": { - "bin/Debug/ClassLibrary3.dll": {} - } - } - } -} \ No newline at end of file diff --git a/TestAssets/LockFiles/ExportFiles/invalid_missing-exports/project.json b/TestAssets/LockFiles/ExportFiles/invalid_missing-exports/project.json deleted file mode 100644 index 34284fa19..000000000 --- a/TestAssets/LockFiles/ExportFiles/invalid_missing-exports/project.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true - }, - "frameworks": { - "net46": { - "dependencies": { - "ClassLibrary1": { - "target": "project" - }, - "ClassLibrary2": { - "target": "project" - }, - "ClassLibrary3": { - "target": "project" - } - } - } - } -} \ No newline at end of file diff --git a/TestAssets/LockFiles/ExportFiles/invalid_missing-exports/project.lock.json b/TestAssets/LockFiles/ExportFiles/invalid_missing-exports/project.lock.json deleted file mode 100644 index 244c3771b..000000000 --- a/TestAssets/LockFiles/ExportFiles/invalid_missing-exports/project.lock.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "locked": false, - "version": 2, - "targets": { - ".NETFramework,Version=v4.6": { - "ClassLibrary1/1.0.0": { - "type": "project" - }, - "ClassLibrary2/1.0.0": { - "type": "project" - }, - "ClassLibrary3/1.0.0": { - "type": "project" - } - }, - ".NETFramework,Version=v4.6/win7-x64": { - "ClassLibrary1/1.0.0": { - "type": "project" - }, - "ClassLibrary2/1.0.0": { - "type": "project" - }, - "ClassLibrary3/1.0.0": { - "type": "project" - } - }, - ".NETFramework,Version=v4.6/win7-x86": { - "ClassLibrary1/1.0.0": { - "type": "project" - }, - "ClassLibrary2/1.0.0": { - "type": "project" - }, - "ClassLibrary3/1.0.0": { - "type": "project" - } - } - }, - "libraries": { - "ClassLibrary1/1.0.0": { - "type": "project", - "msbuildProject": "../../ClassLibrary1/ClassLibrary1.csproj" - }, - "ClassLibrary2/1.0.0": { - "type": "project", - "msbuildProject": "../../ClassLibrary2/ClassLibrary2.csproj" - }, - "ClassLibrary3/1.0.0": { - "type": "project", - "msbuildProject": "../../ClassLibrary3/ClassLibrary3.csproj" - } - }, - "projectFileDependencyGroups": { - "": [], - ".NETFramework,Version=v4.6": [ - "ClassLibrary1", - "ClassLibrary2", - "ClassLibrary3" - ] - } -} \ No newline at end of file diff --git a/TestAssets/LockFiles/ExportFiles/invalid_missmatching-versions/project.fragment.lock.json b/TestAssets/LockFiles/ExportFiles/invalid_missmatching-versions/project.fragment.lock.json deleted file mode 100644 index 7b6738e49..000000000 --- a/TestAssets/LockFiles/ExportFiles/invalid_missmatching-versions/project.fragment.lock.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "version": 3, - "exports": { - "ClassLibrary1/1.0.0": { - "type": "project", - "framework": ".NETFramework,Version=v4.5.2", - "compile": { - "bin/Debug/ClassLibrary1.dll": {} - }, - "runtime": { - "bin/Debug/ClassLibrary1.dll": {} - } - }, - "ClassLibrary2/1.0.0": { - "type": "project", - "framework": ".NETFramework,Version=v4.6", - "compile": { - "bin/Debug/ClassLibrary2.dll": {} - }, - "runtime": { - "bin/Debug/ClassLibrary2.dll": {} - } - }, - "ClassLibrary3/1.0.0": { - "type": "project", - "framework": ".NETFramework,Version=v4.6", - "compile": { - "bin/Debug/ClassLibrary3.dll": {} - }, - "runtime": { - "bin/Debug/ClassLibrary3.dll": {} - } - } - } -} \ No newline at end of file diff --git a/TestAssets/LockFiles/ExportFiles/invalid_missmatching-versions/project.json b/TestAssets/LockFiles/ExportFiles/invalid_missmatching-versions/project.json deleted file mode 100644 index 34284fa19..000000000 --- a/TestAssets/LockFiles/ExportFiles/invalid_missmatching-versions/project.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true - }, - "frameworks": { - "net46": { - "dependencies": { - "ClassLibrary1": { - "target": "project" - }, - "ClassLibrary2": { - "target": "project" - }, - "ClassLibrary3": { - "target": "project" - } - } - } - } -} \ No newline at end of file diff --git a/TestAssets/LockFiles/ExportFiles/invalid_missmatching-versions/project.lock.json b/TestAssets/LockFiles/ExportFiles/invalid_missmatching-versions/project.lock.json deleted file mode 100644 index 244c3771b..000000000 --- a/TestAssets/LockFiles/ExportFiles/invalid_missmatching-versions/project.lock.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "locked": false, - "version": 2, - "targets": { - ".NETFramework,Version=v4.6": { - "ClassLibrary1/1.0.0": { - "type": "project" - }, - "ClassLibrary2/1.0.0": { - "type": "project" - }, - "ClassLibrary3/1.0.0": { - "type": "project" - } - }, - ".NETFramework,Version=v4.6/win7-x64": { - "ClassLibrary1/1.0.0": { - "type": "project" - }, - "ClassLibrary2/1.0.0": { - "type": "project" - }, - "ClassLibrary3/1.0.0": { - "type": "project" - } - }, - ".NETFramework,Version=v4.6/win7-x86": { - "ClassLibrary1/1.0.0": { - "type": "project" - }, - "ClassLibrary2/1.0.0": { - "type": "project" - }, - "ClassLibrary3/1.0.0": { - "type": "project" - } - } - }, - "libraries": { - "ClassLibrary1/1.0.0": { - "type": "project", - "msbuildProject": "../../ClassLibrary1/ClassLibrary1.csproj" - }, - "ClassLibrary2/1.0.0": { - "type": "project", - "msbuildProject": "../../ClassLibrary2/ClassLibrary2.csproj" - }, - "ClassLibrary3/1.0.0": { - "type": "project", - "msbuildProject": "../../ClassLibrary3/ClassLibrary3.csproj" - } - }, - "projectFileDependencyGroups": { - "": [], - ".NETFramework,Version=v4.6": [ - "ClassLibrary1", - "ClassLibrary2", - "ClassLibrary3" - ] - } -} \ No newline at end of file diff --git a/TestAssets/LockFiles/ExportFiles/invalid_nofragment/project.json b/TestAssets/LockFiles/ExportFiles/invalid_nofragment/project.json deleted file mode 100644 index 34284fa19..000000000 --- a/TestAssets/LockFiles/ExportFiles/invalid_nofragment/project.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true - }, - "frameworks": { - "net46": { - "dependencies": { - "ClassLibrary1": { - "target": "project" - }, - "ClassLibrary2": { - "target": "project" - }, - "ClassLibrary3": { - "target": "project" - } - } - } - } -} \ No newline at end of file diff --git a/TestAssets/LockFiles/ExportFiles/invalid_nofragment/project.lock.json b/TestAssets/LockFiles/ExportFiles/invalid_nofragment/project.lock.json deleted file mode 100644 index 244c3771b..000000000 --- a/TestAssets/LockFiles/ExportFiles/invalid_nofragment/project.lock.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "locked": false, - "version": 2, - "targets": { - ".NETFramework,Version=v4.6": { - "ClassLibrary1/1.0.0": { - "type": "project" - }, - "ClassLibrary2/1.0.0": { - "type": "project" - }, - "ClassLibrary3/1.0.0": { - "type": "project" - } - }, - ".NETFramework,Version=v4.6/win7-x64": { - "ClassLibrary1/1.0.0": { - "type": "project" - }, - "ClassLibrary2/1.0.0": { - "type": "project" - }, - "ClassLibrary3/1.0.0": { - "type": "project" - } - }, - ".NETFramework,Version=v4.6/win7-x86": { - "ClassLibrary1/1.0.0": { - "type": "project" - }, - "ClassLibrary2/1.0.0": { - "type": "project" - }, - "ClassLibrary3/1.0.0": { - "type": "project" - } - } - }, - "libraries": { - "ClassLibrary1/1.0.0": { - "type": "project", - "msbuildProject": "../../ClassLibrary1/ClassLibrary1.csproj" - }, - "ClassLibrary2/1.0.0": { - "type": "project", - "msbuildProject": "../../ClassLibrary2/ClassLibrary2.csproj" - }, - "ClassLibrary3/1.0.0": { - "type": "project", - "msbuildProject": "../../ClassLibrary3/ClassLibrary3.csproj" - } - }, - "projectFileDependencyGroups": { - "": [], - ".NETFramework,Version=v4.6": [ - "ClassLibrary1", - "ClassLibrary2", - "ClassLibrary3" - ] - } -} \ No newline at end of file diff --git a/TestAssets/LockFiles/ExportFiles/valid/project.fragment.lock.json b/TestAssets/LockFiles/ExportFiles/valid/project.fragment.lock.json deleted file mode 100644 index 415fc75d8..000000000 --- a/TestAssets/LockFiles/ExportFiles/valid/project.fragment.lock.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "version": 2, - "exports": { - "ClassLibrary1/1.0.0": { - "type": "project", - "framework": ".NETFramework,Version=v4.5.2", - "compile": { - "bin/Debug/ClassLibrary1.dll": {} - }, - "runtime": { - "bin/Debug/ClassLibrary1.dll": {} - } - }, - "ClassLibrary2/1.0.0": { - "type": "project", - "framework": ".NETFramework,Version=v4.6", - "compile": { - "bin/Debug/ClassLibrary2.dll": {} - }, - "runtime": { - "bin/Debug/ClassLibrary2.dll": {} - } - }, - "ClassLibrary3/1.0.0": { - "type": "project", - "framework": ".NETFramework,Version=v4.6", - "compile": { - "bin/Debug/ClassLibrary3.dll": {} - }, - "runtime": { - "bin/Debug/ClassLibrary3.dll": {} - } - } - } -} \ No newline at end of file diff --git a/TestAssets/LockFiles/ExportFiles/valid/project.json b/TestAssets/LockFiles/ExportFiles/valid/project.json deleted file mode 100644 index 34284fa19..000000000 --- a/TestAssets/LockFiles/ExportFiles/valid/project.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true - }, - "frameworks": { - "net46": { - "dependencies": { - "ClassLibrary1": { - "target": "project" - }, - "ClassLibrary2": { - "target": "project" - }, - "ClassLibrary3": { - "target": "project" - } - } - } - } -} \ No newline at end of file diff --git a/TestAssets/LockFiles/ExportFiles/valid/project.lock.json b/TestAssets/LockFiles/ExportFiles/valid/project.lock.json deleted file mode 100644 index 099c3246c..000000000 --- a/TestAssets/LockFiles/ExportFiles/valid/project.lock.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "locked": false, - "version": 2, - "targets": { - ".NETFramework,Version=v4.6": { - "ClassLibrary1/1.0.0": { - "type": "project" - }, - "ClassLibrary2/1.0.0": { - "type": "project" - }, - "ClassLibrary3/1.0.0": { - "type": "project" - } - }, - ".NETFramework,Version=v4.6/win7-x64": { - "ClassLibrary1/1.0.0": { - "type": "project" - }, - "ClassLibrary2/1.0.0": { - "type": "project" - }, - "ClassLibrary3/1.0.0": { - "type": "project" - } - }, - ".NETFramework,Version=v4.6/win7-x86": { - "ClassLibrary1/1.0.0": { - "type": "project" - }, - "ClassLibrary2/1.0.0": { - "type": "project" - }, - "ClassLibrary3/1.0.0": { - "type": "project" - } - } - }, - "libraries": { - "ClassLibrary1/1.0.0": { - "type": "project", - "msbuildProject": "../../ClassLibrary1/ClassLibrary1.csproj" - }, - "ClassLibrary2/1.0.0": { - "type": "project", - "msbuildProject": "../../ClassLibrary2/ClassLibrary2.csproj" - }, - "ClassLibrary3/1.0.0": { - "type": "project", - "msbuildProject": "../../ClassLibrary3/ClassLibrary3.csproj" - } - }, - "projectFileDependencyGroups": { - "": [], - ".NETFramework,Version=v4.6": [ - "ClassLibrary1", - "ClassLibrary2", - "ClassLibrary3" - ] - }, - "packageFolders": { - "/foo/packages": {}, - "/foo/packages2": {} - } -} \ No newline at end of file diff --git a/TestAssets/LockFiles/ExportFiles/valid_staleFragment/project.fragment.lock.json b/TestAssets/LockFiles/ExportFiles/valid_staleFragment/project.fragment.lock.json deleted file mode 100644 index 415fc75d8..000000000 --- a/TestAssets/LockFiles/ExportFiles/valid_staleFragment/project.fragment.lock.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "version": 2, - "exports": { - "ClassLibrary1/1.0.0": { - "type": "project", - "framework": ".NETFramework,Version=v4.5.2", - "compile": { - "bin/Debug/ClassLibrary1.dll": {} - }, - "runtime": { - "bin/Debug/ClassLibrary1.dll": {} - } - }, - "ClassLibrary2/1.0.0": { - "type": "project", - "framework": ".NETFramework,Version=v4.6", - "compile": { - "bin/Debug/ClassLibrary2.dll": {} - }, - "runtime": { - "bin/Debug/ClassLibrary2.dll": {} - } - }, - "ClassLibrary3/1.0.0": { - "type": "project", - "framework": ".NETFramework,Version=v4.6", - "compile": { - "bin/Debug/ClassLibrary3.dll": {} - }, - "runtime": { - "bin/Debug/ClassLibrary3.dll": {} - } - } - } -} \ No newline at end of file diff --git a/TestAssets/LockFiles/ExportFiles/valid_staleFragment/project.json b/TestAssets/LockFiles/ExportFiles/valid_staleFragment/project.json deleted file mode 100644 index beec156b7..000000000 --- a/TestAssets/LockFiles/ExportFiles/valid_staleFragment/project.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true - }, - "frameworks": { - "net46": {} - } -} \ No newline at end of file diff --git a/TestAssets/LockFiles/ExportFiles/valid_staleFragment/project.lock.json b/TestAssets/LockFiles/ExportFiles/valid_staleFragment/project.lock.json deleted file mode 100644 index e7b45e57d..000000000 --- a/TestAssets/LockFiles/ExportFiles/valid_staleFragment/project.lock.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "locked": false, - "version": 2, - "targets": { - ".NETFramework,Version=v4.6": { } - }, - "libraries": { - }, - "projectFileDependencyGroups": { - "": [], - ".NETFramework,Version=v4.6": [] - } -} \ No newline at end of file diff --git a/TestAssets/NonRestoredTestProjects/AppThrowingException/App/AppThrowingException.csproj b/TestAssets/NonRestoredTestProjects/AppThrowingException/App/AppThrowingException.csproj deleted file mode 100644 index 6fede9c95..000000000 --- a/TestAssets/NonRestoredTestProjects/AppThrowingException/App/AppThrowingException.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - Exe - netcoreapp1.1 - dotnet-throwingtool - $(AssemblyName) - - - - - $(ProjectRuntimeConfigFilePath) - - - - diff --git a/TestAssets/NonRestoredTestProjects/AppThrowingException/App/Program.cs b/TestAssets/NonRestoredTestProjects/AppThrowingException/App/Program.cs deleted file mode 100644 index eadcb36e6..000000000 --- a/TestAssets/NonRestoredTestProjects/AppThrowingException/App/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace AppThrowing -{ - class MyException : Exception - { - static void Main(string[] args) - { - throw new MyException(); - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/AppThrowingException/AppDependingOnOtherAsTool/AppDependingOnOtherAsTool.csproj b/TestAssets/NonRestoredTestProjects/AppThrowingException/AppDependingOnOtherAsTool/AppDependingOnOtherAsTool.csproj deleted file mode 100644 index 30c6823e7..000000000 --- a/TestAssets/NonRestoredTestProjects/AppThrowingException/AppDependingOnOtherAsTool/AppDependingOnOtherAsTool.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Exe - netcoreapp2.0 - - - - - - - diff --git a/TestAssets/NonRestoredTestProjects/AppThrowingException/AppDependingOnOtherAsTool/NuGet.Config b/TestAssets/NonRestoredTestProjects/AppThrowingException/AppDependingOnOtherAsTool/NuGet.Config deleted file mode 100644 index 97af9d3d0..000000000 --- a/TestAssets/NonRestoredTestProjects/AppThrowingException/AppDependingOnOtherAsTool/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/NonRestoredTestProjects/AppThrowingException/AppDependingOnOtherAsTool/Program.cs b/TestAssets/NonRestoredTestProjects/AppThrowingException/AppDependingOnOtherAsTool/Program.cs deleted file mode 100644 index d2db0fffd..000000000 --- a/TestAssets/NonRestoredTestProjects/AppThrowingException/AppDependingOnOtherAsTool/Program.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -class Program -{ - static void Main(string[] args) - { - } -} diff --git a/TestAssets/NonRestoredTestProjects/AppWithNonExistingToolDependency/AppWithNonExistingToolDependency.csproj b/TestAssets/NonRestoredTestProjects/AppWithNonExistingToolDependency/AppWithNonExistingToolDependency.csproj deleted file mode 100644 index db9d6f117..000000000 --- a/TestAssets/NonRestoredTestProjects/AppWithNonExistingToolDependency/AppWithNonExistingToolDependency.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Exe - netcoreapp2.0 - - - - - - - diff --git a/TestAssets/NonRestoredTestProjects/AppWithNonExistingToolDependency/Program.cs b/TestAssets/NonRestoredTestProjects/AppWithNonExistingToolDependency/Program.cs deleted file mode 100644 index 2130cd0a7..000000000 --- a/TestAssets/NonRestoredTestProjects/AppWithNonExistingToolDependency/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/AppWithProjectDependencyAsTarget/TestApp/Program.cs b/TestAssets/NonRestoredTestProjects/AppWithProjectDependencyAsTarget/TestApp/Program.cs deleted file mode 100644 index 855776696..000000000 --- a/TestAssets/NonRestoredTestProjects/AppWithProjectDependencyAsTarget/TestApp/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/AppWithProjectDependencyAsTarget/TestApp/project.json b/TestAssets/NonRestoredTestProjects/AppWithProjectDependencyAsTarget/TestApp/project.json deleted file mode 100644 index 98e6c1f8f..000000000 --- a/TestAssets/NonRestoredTestProjects/AppWithProjectDependencyAsTarget/TestApp/project.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true - }, - "dependencies": { - "Microsoft.NETCore.App": "1.1.1", - "TestLibraryAsAPackage": { - "version": "1.0.0", - "target": "package" - } - }, - "frameworks": { - "netcoreapp1.1": {} - }, - "runtimes": { - "win7-x64": {}, - "win7-x86": {}, - "osx.10.10-x64": {}, - "osx.10.11-x64": {}, - "ubuntu.14.04-x64": {}, - "ubuntu.16.04-x64": {}, - "centos.7-x64": {}, - "rhel.7.2-x64": {}, - "debian.8-x64": {}, - "fedora.23-x64": {}, - "opensuse.13.2-x64": {} - } -} diff --git a/TestAssets/NonRestoredTestProjects/AppWithProjectDependencyAsTarget/TestLibraryAsAPackage/.noautobuild b/TestAssets/NonRestoredTestProjects/AppWithProjectDependencyAsTarget/TestLibraryAsAPackage/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/NonRestoredTestProjects/AppWithProjectDependencyAsTarget/TestLibraryAsAPackage/Helper.cs b/TestAssets/NonRestoredTestProjects/AppWithProjectDependencyAsTarget/TestLibraryAsAPackage/Helper.cs deleted file mode 100644 index 8c643796b..000000000 --- a/TestAssets/NonRestoredTestProjects/AppWithProjectDependencyAsTarget/TestLibraryAsAPackage/Helper.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace TestLibrary -{ - public static class Helper - { - /// - /// Gets the message from the helper. This comment is here to help test XML documentation file generation, please do not remove it. - /// - /// A message - public static string GetMessage() - { - return "This string came from the test library!"; - } - - public static void SayHi() - { - Console.WriteLine("Hello there!"); - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/AppWithProjectDependencyAsTarget/TestLibraryAsAPackage/project.json b/TestAssets/NonRestoredTestProjects/AppWithProjectDependencyAsTarget/TestLibraryAsAPackage/project.json deleted file mode 100644 index 48bc772d8..000000000 --- a/TestAssets/NonRestoredTestProjects/AppWithProjectDependencyAsTarget/TestLibraryAsAPackage/project.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "nowarn": [ - "CS1591" - ], - "xmlDoc": true, - "additionalArguments": [ - "-highentropyva+" - ] - }, - "dependencies": { - "NETStandard.Library": "1.6.0" - }, - "frameworks": { - "netstandard1.5": {} - } -} diff --git a/TestAssets/NonRestoredTestProjects/AppWithProjectDependencyAsTarget/global.json b/TestAssets/NonRestoredTestProjects/AppWithProjectDependencyAsTarget/global.json deleted file mode 100644 index 8c0927574..000000000 --- a/TestAssets/NonRestoredTestProjects/AppWithProjectDependencyAsTarget/global.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "projects": [ "." ] -} \ No newline at end of file diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Broken/Broken.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Broken/Broken.csproj deleted file mode 100644 index 1a79fa49d..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Broken/Broken.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - Library - net451;netcoreapp2.0 - - - - - - diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/EmptyItemGroup/EmptyItemGroup.cs b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/EmptyItemGroup/EmptyItemGroup.cs deleted file mode 100644 index 6b4e993f1..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/EmptyItemGroup/EmptyItemGroup.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. - -public class EmptyItemGroup -{ -} diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/EmptyItemGroup/EmptyItemGroup.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/EmptyItemGroup/EmptyItemGroup.csproj deleted file mode 100644 index 0bdb79506..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/EmptyItemGroup/EmptyItemGroup.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Library - net451;netcoreapp2.0 - - - - - - - - - - diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Lib/Lib.cs b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Lib/Lib.cs deleted file mode 100644 index 734d29ed8..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Lib/Lib.cs +++ /dev/null @@ -1,4 +0,0 @@ -// Dummy reference - it can be used as an existing reference in any of the projects -public class Lib -{ -} diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Lib/Lib.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Lib/Lib.csproj deleted file mode 100644 index 1be153a79..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Lib/Lib.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Library - net451;netcoreapp2.0;netstandard1.4 - - - - - - diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/MoreThanOne/SomeSourceFile.cs b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/MoreThanOne/SomeSourceFile.cs deleted file mode 100644 index 4b9f356dc..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/MoreThanOne/SomeSourceFile.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. - -public class SomeClass -{ -} diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/MoreThanOne/a.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/MoreThanOne/a.csproj deleted file mode 100644 index 68b8ed617..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/MoreThanOne/a.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Library - netcoreapp2.0 - - - - - - diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/MoreThanOne/b.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/MoreThanOne/b.csproj deleted file mode 100644 index 68b8ed617..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/MoreThanOne/b.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Library - netcoreapp2.0 - - - - - - diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Net452AndNetCoreApp10Lib/Net452AndNetCoreApp10Lib.cs b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Net452AndNetCoreApp10Lib/Net452AndNetCoreApp10Lib.cs deleted file mode 100644 index 7fd23b9ef..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Net452AndNetCoreApp10Lib/Net452AndNetCoreApp10Lib.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. - -public class Net452AndNetCoreApp10Lib -{ -} diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Net452AndNetCoreApp10Lib/Net452AndNetCoreApp10Lib.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Net452AndNetCoreApp10Lib/Net452AndNetCoreApp10Lib.csproj deleted file mode 100644 index e11e31084..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Net452AndNetCoreApp10Lib/Net452AndNetCoreApp10Lib.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Library - net452;netcoreapp2.0 - - - - - diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Net45Lib/Net45Lib.cs b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Net45Lib/Net45Lib.cs deleted file mode 100644 index a0e97f3ee..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Net45Lib/Net45Lib.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. - -public class Net45Lib -{ -} diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Net45Lib/Net45Lib.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Net45Lib/Net45Lib.csproj deleted file mode 100644 index 3e8feea35..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Net45Lib/Net45Lib.csproj +++ /dev/null @@ -1,6 +0,0 @@ - - - Library - net45 - - diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/ValidRef/ValidRef.cs b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/ValidRef/ValidRef.cs deleted file mode 100644 index 675dbba01..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/ValidRef/ValidRef.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Dummy reference - it should not be referenced by any other project directly -// it should be used as a reference passed to the dotnet add p2p -public class ValidRef -{ -} diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/ValidRef/ValidRef.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/ValidRef/ValidRef.csproj deleted file mode 100644 index 0fc35d3d8..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/ValidRef/ValidRef.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Library - net451;netcoreapp1.0;netstandard1.4 - - - - - diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithDoubledRef/WithDoubledRef.cs b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithDoubledRef/WithDoubledRef.cs deleted file mode 100644 index d093e4a49..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithDoubledRef/WithDoubledRef.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. - -public class WithDoubledRef -{ -} diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithDoubledRef/WithDoubledRef.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithDoubledRef/WithDoubledRef.csproj deleted file mode 100644 index f33aa7821..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithDoubledRef/WithDoubledRef.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Library - net451;netcoreapp1.0 - - - - - - - - - - diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondOnItem/WithExistingRefCondOnItem.cs b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondOnItem/WithExistingRefCondOnItem.cs deleted file mode 100644 index 4d402e492..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondOnItem/WithExistingRefCondOnItem.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. - -public class WithExistingRefCondOnItem -{ -} diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondOnItem/WithExistingRefCondOnItem.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondOnItem/WithExistingRefCondOnItem.csproj deleted file mode 100644 index 8747ed6b7..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondOnItem/WithExistingRefCondOnItem.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - Library - net451;netcoreapp1.0 - - - - - - - - - diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondWhitespaces/WithExistingRefCondWhitespaces.cs b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondWhitespaces/WithExistingRefCondWhitespaces.cs deleted file mode 100644 index 1bcd39cfd..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondWhitespaces/WithExistingRefCondWhitespaces.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. - -public class WithExistingRefCondWhitespaces -{ -} diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondWhitespaces/WithExistingRefCondWhitespaces.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondWhitespaces/WithExistingRefCondWhitespaces.csproj deleted file mode 100644 index 0b2792110..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondWhitespaces/WithExistingRefCondWhitespaces.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - - Library - net451;netcoreapp1.0 - - - - - - - - diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithRefCondNonUniform/WithRefCondNonUniform.cs b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithRefCondNonUniform/WithRefCondNonUniform.cs deleted file mode 100644 index f3fcd06dc..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithRefCondNonUniform/WithRefCondNonUniform.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. - -public class WithRefCondNonUniform -{ -} diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithRefCondNonUniform/WithRefCondNonUniform.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithRefCondNonUniform/WithRefCondNonUniform.csproj deleted file mode 100644 index decd23bec..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithRefCondNonUniform/WithRefCondNonUniform.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - Library - net451;netcoreapp1.0 - - - - - - - - - diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithRefNoCondNonUniform/WithRefNoCondNonUniform.cs b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithRefNoCondNonUniform/WithRefNoCondNonUniform.cs deleted file mode 100644 index 931aa9634..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithRefNoCondNonUniform/WithRefNoCondNonUniform.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. - -public class WithRefNoCondNonUniform -{ -} diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithRefNoCondNonUniform/WithRefNoCondNonUniform.csproj b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithRefNoCondNonUniform/WithRefNoCondNonUniform.csproj deleted file mode 100644 index 328fc5fb1..000000000 --- a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithRefNoCondNonUniform/WithRefNoCondNonUniform.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Library - net451;netcoreapp1.0 - - - - - - - - - - diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/Program.cs b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/Program.cs deleted file mode 100644 index fa982665c..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/Program.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Diagnostics; - -namespace TestApp -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine(TestLibrary.Helper.GetMessage()); - Console.WriteLine(subdir.Helper.GetMessage()); - return 100; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/TestApp.sln b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/TestApp.sln deleted file mode 100644 index 3dc27a305..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/TestApp.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestApp", "TestApp.xproj", "{0138CB8F-4AA9-4029-A21E-C07C30F425BA}" -EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestLibrary", "..\TestLibrary\TestLibrary.xproj", "{DC0B35D0-8A36-4B52-8A11-B86739F055D2}" -EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "subdir", "src\subdir\subdir.xproj", "{F8F96F4A-F10C-4C54-867C-A9EFF55494C8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.Build.0 = Release|Any CPU - {DC0B35D0-8A36-4B52-8A11-B86739F055D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DC0B35D0-8A36-4B52-8A11-B86739F055D2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DC0B35D0-8A36-4B52-8A11-B86739F055D2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DC0B35D0-8A36-4B52-8A11-B86739F055D2}.Release|Any CPU.Build.0 = Release|Any CPU - {F8F96F4A-F10C-4C54-867C-A9EFF55494C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F8F96F4A-F10C-4C54-867C-A9EFF55494C8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F8F96F4A-F10C-4C54-867C-A9EFF55494C8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F8F96F4A-F10C-4C54-867C-A9EFF55494C8}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/TestApp.xproj b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/TestApp.xproj deleted file mode 100644 index d18702195..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/TestApp.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0.23107 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 0138cb8f-4aa9-4029-a21e-c07c30f425ba - TestAppWithContents - ..\..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\..\artifacts\ - - - 2.0 - - - diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/TestAssets/TestAsset/Program.cs b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/TestAssets/TestAsset/Program.cs deleted file mode 100644 index dc6aad3b3..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/TestAssets/TestAsset/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace App.Tests -{ - public class TestAssetProgram - { - public static void TestAssetMain(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/TestAssets/TestAsset/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/TestAssets/TestAsset/project.json deleted file mode 100644 index be38f2878..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/TestAssets/TestAsset/project.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "frameworks": { - "netcoreapp1.1": { - "imports": [ - "portable-net451+win8" - ], - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.1.0", - "type": "platform" - } - } - } - } -} \ No newline at end of file diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/project.json deleted file mode 100644 index 788896dab..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/project.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "dependencies": { - "TestLibrary": { - "target": "project", - "version": "1.0.0-*" - }, - "subdir": { - "target": "project", - "version": "1.0.0-*" - }, - "Microsoft.NETCore.App": "1.1.1" - }, - "frameworks": { - "netcoreapp1.1": {} - }, - "runtimes": { - "win7-x64": {}, - "win7-x86": {}, - "osx.10.10-x64": {}, - "osx.10.11-x64": {}, - "ubuntu.14.04-x64": {}, - "ubuntu.16.04-x64": {}, - "centos.7-x64": {}, - "rhel.7.2-x64": {}, - "debian.8-x64": {}, - "fedora.23-x64": {}, - "opensuse.13.2-x64": {} - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/src/subdir/Helper.cs b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/src/subdir/Helper.cs deleted file mode 100644 index 2d937c387..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/src/subdir/Helper.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace subdir -{ - public static class Helper - { - public static string GetMessage() - { - return "This string came from the subdir test library!"; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/src/subdir/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/src/subdir/project.json deleted file mode 100644 index bdf53dd6e..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/src/subdir/project.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "nowarn": [ - "CS1591" - ], - "additionalArguments": [ - "-highentropyva+" - ] - },"dependencies": { - "NETStandard.Library": "1.6.0" - }, - "frameworks": { - "netstandard1.5": {} - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/src/subdir/subdir.xproj b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/src/subdir/subdir.xproj deleted file mode 100644 index 8f183ae93..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestApp/src/subdir/subdir.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0.23107 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - F8F96F4A-F10C-4C54-867C-A9EFF55494C8 - TestAppWithContents - ..\..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\..\artifacts\ - - - 2.0 - - - diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestLibrary/Helper.cs b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestLibrary/Helper.cs deleted file mode 100644 index 6c3bc0e53..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestLibrary/Helper.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace TestLibrary -{ - public static class Helper - { - public static string GetMessage() - { - return "This string came from the test library!"; - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestLibrary/TestLibrary.xproj b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestLibrary/TestLibrary.xproj deleted file mode 100644 index dc8eb7060..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestLibrary/TestLibrary.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0.23107 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - dc0b35d0-8a36-4b52-8a11-b86739f055d2 - TestAppWithContents - ..\..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\..\artifacts\ - - - 2.0 - - - diff --git a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestLibrary/project.json b/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestLibrary/project.json deleted file mode 100644 index 032754312..000000000 --- a/TestAssets/NonRestoredTestProjects/PJAppWithSlnAndXprojRefs/TestLibrary/project.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": "1.0.0-*", - "dependencies": { - "NETStandard.Library": "1.6.0" - }, - "frameworks": { - "netstandard1.5": {} - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedNamedResource/Program.cs b/TestAssets/NonRestoredTestProjects/PJDeprecatedNamedResource/Program.cs deleted file mode 100644 index ca20e2e00..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedNamedResource/Program.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Linq; -using System.Reflection; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - var thisAssembly = typeof(Program).GetTypeInfo().Assembly; - var resources = from resourceName in thisAssembly.GetManifestResourceNames() - select resourceName; - - var resourceNames = string.Join(",", resources); - Console.WriteLine($"{resources.Count()} Resources Found: {resourceNames}"); - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJDeprecatedNamedResource/project.json b/TestAssets/NonRestoredTestProjects/PJDeprecatedNamedResource/project.json deleted file mode 100644 index fce9b2e1a..000000000 --- a/TestAssets/NonRestoredTestProjects/PJDeprecatedNamedResource/project.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": "1.0.0-*", - "namedResource": [ "My.Alias", "Strings.resx" ], - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true - }, - "dependencies": {}, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.0" - } - }, - "imports": "dnxcore50" - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJHalfMigrated/ProjectB/Program.cs b/TestAssets/NonRestoredTestProjects/PJHalfMigrated/ProjectB/Program.cs deleted file mode 100755 index 2130cd0a7..000000000 --- a/TestAssets/NonRestoredTestProjects/PJHalfMigrated/ProjectB/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJHalfMigrated/ProjectB/project.json b/TestAssets/NonRestoredTestProjects/PJHalfMigrated/ProjectB/project.json deleted file mode 100755 index 7de792cd3..000000000 --- a/TestAssets/NonRestoredTestProjects/PJHalfMigrated/ProjectB/project.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true - }, - "dependencies": { - "ProjectA": { - "target": "project" - } - }, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.0" - } - }, - "imports": "dnxcore50" - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJHalfMigrated/backup/src/ProjectA/project.json b/TestAssets/NonRestoredTestProjects/PJHalfMigrated/backup/src/ProjectA/project.json deleted file mode 100755 index ce67b3a46..000000000 --- a/TestAssets/NonRestoredTestProjects/PJHalfMigrated/backup/src/ProjectA/project.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true - }, - "dependencies": {}, - "frameworks": { - "netcoreapp1.0": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.0.0" - } - }, - "imports": "dnxcore50" - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJHalfMigrated/global.json b/TestAssets/NonRestoredTestProjects/PJHalfMigrated/global.json deleted file mode 100644 index b0323e428..000000000 --- a/TestAssets/NonRestoredTestProjects/PJHalfMigrated/global.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "projects": [ "src" ] -} \ No newline at end of file diff --git a/TestAssets/NonRestoredTestProjects/PJHalfMigrated/src/ProjectA/Program.cs b/TestAssets/NonRestoredTestProjects/PJHalfMigrated/src/ProjectA/Program.cs deleted file mode 100755 index 2130cd0a7..000000000 --- a/TestAssets/NonRestoredTestProjects/PJHalfMigrated/src/ProjectA/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/PJHalfMigrated/src/ProjectA/ProjectA.csproj b/TestAssets/NonRestoredTestProjects/PJHalfMigrated/src/ProjectA/ProjectA.csproj deleted file mode 100755 index 915cb3e07..000000000 --- a/TestAssets/NonRestoredTestProjects/PJHalfMigrated/src/ProjectA/ProjectA.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - netcoreapp2.0 - portable - ProjectA - Exe - ProjectA - $(AssetTargetFallback);dnxcore50 - 1.0.3 - - - diff --git a/TestAssets/NonRestoredTestProjects/TestLibraryWithProjectFileWithoutFrameworks/project.json b/TestAssets/NonRestoredTestProjects/TestLibraryWithProjectFileWithoutFrameworks/project.json deleted file mode 100644 index d685d1947..000000000 --- a/TestAssets/NonRestoredTestProjects/TestLibraryWithProjectFileWithoutFrameworks/project.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "dependencies": { - "Microsoft.VisualStudio.Web.CodeGeneration.Tools" : { - "version": "1.0.0-preview2-final", - "type": "build" - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/TestProjectWithSelfReferencingDependency/.noautobuild b/TestAssets/NonRestoredTestProjects/TestProjectWithSelfReferencingDependency/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/NonRestoredTestProjects/TestProjectWithSelfReferencingDependency/Program.cs b/TestAssets/NonRestoredTestProjects/TestProjectWithSelfReferencingDependency/Program.cs deleted file mode 100644 index 855776696..000000000 --- a/TestAssets/NonRestoredTestProjects/TestProjectWithSelfReferencingDependency/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/TestProjectWithSelfReferencingDependency/project.json b/TestAssets/NonRestoredTestProjects/TestProjectWithSelfReferencingDependency/project.json deleted file mode 100644 index 92c28da27..000000000 --- a/TestAssets/NonRestoredTestProjects/TestProjectWithSelfReferencingDependency/project.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true - }, - "dependencies": { - "TestProjectWithSelfReferencingDependency": { - "target": "project" - } - }, - "frameworks": { - "netcoreapp1.1": { - "imports": "dnxcore50" - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedDependency/.noautobuild b/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedDependency/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedDependency/Program.cs b/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedDependency/Program.cs deleted file mode 100644 index 2130cd0a7..000000000 --- a/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedDependency/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedDependency/project.json b/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedDependency/project.json deleted file mode 100644 index eafa839b9..000000000 --- a/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedDependency/project.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true - }, - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.0" - }, - "ThisIsNotARealDependencyAndIfSomeoneGoesAndAddsAProjectWithThisNameIWillFindThemAndPunishThem": { - "target": "project" - } - }, - "frameworks": { - "netcoreapp1.1": { - "imports": "dnxcore50" - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedPlatformDependency/.noautobuild b/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedPlatformDependency/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedPlatformDependency/Program.cs b/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedPlatformDependency/Program.cs deleted file mode 100644 index 2130cd0a7..000000000 --- a/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedPlatformDependency/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedPlatformDependency/TestProjectWithUnresolvedPlatformDependency.csproj b/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedPlatformDependency/TestProjectWithUnresolvedPlatformDependency.csproj deleted file mode 100755 index 261918eb3..000000000 --- a/TestAssets/NonRestoredTestProjects/TestProjectWithUnresolvedPlatformDependency/TestProjectWithUnresolvedPlatformDependency.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - netcoreapp2.0 - Exe - $(AssetTargetFallback);dnxcore50 - - - - - - \ No newline at end of file diff --git a/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/AppWithDepOnTool/AppWithDepOnTool.csproj b/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/AppWithDepOnTool/AppWithDepOnTool.csproj deleted file mode 100644 index f5ab2f51a..000000000 --- a/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/AppWithDepOnTool/AppWithDepOnTool.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - - Exe - netcoreapp2.0 - random-name - - - - - - - diff --git a/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/AppWithDepOnTool/NuGet.Config b/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/AppWithDepOnTool/NuGet.Config deleted file mode 100644 index 97af9d3d0..000000000 --- a/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/AppWithDepOnTool/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/AppWithDepOnTool/Program.cs b/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/AppWithDepOnTool/Program.cs deleted file mode 100644 index d2db0fffd..000000000 --- a/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/AppWithDepOnTool/Program.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -class Program -{ - static void Main(string[] args) - { - } -} diff --git a/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/ToolWithRandomPackageName/Program.cs b/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/ToolWithRandomPackageName/Program.cs deleted file mode 100644 index 0ea7804c7..000000000 --- a/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/ToolWithRandomPackageName/Program.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -class Program -{ - static void Main(string[] args) - { - Console.WriteLine("Hello World from tool!"); - } -} diff --git a/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/ToolWithRandomPackageName/ToolWithRandomPackageName.csproj b/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/ToolWithRandomPackageName/ToolWithRandomPackageName.csproj deleted file mode 100644 index 9184414e8..000000000 --- a/TestAssets/NonRestoredTestProjects/ToolWithRandomPackageName/ToolWithRandomPackageName/ToolWithRandomPackageName.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - - Exe - netcoreapp2.0 - random-name - $(GeneratedPackageId) - dotnet-randompackage - - - - - $(ProjectRuntimeConfigFilePath) - - - - diff --git a/TestAssets/TestPackages/PackageWithFakeNativeDep/Lib.cs b/TestAssets/TestPackages/PackageWithFakeNativeDep/Lib.cs deleted file mode 100644 index 07a5ba6b0..000000000 --- a/TestAssets/TestPackages/PackageWithFakeNativeDep/Lib.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace PackageWithFakeNativeDep -{ - public static class Lib - { - public static string GetMessage() - { - return "Hello, World"; - } - } -} diff --git a/TestAssets/TestPackages/PackageWithFakeNativeDep/PackageWithFakeNativeDep.csproj b/TestAssets/TestPackages/PackageWithFakeNativeDep/PackageWithFakeNativeDep.csproj deleted file mode 100644 index de9c330de..000000000 --- a/TestAssets/TestPackages/PackageWithFakeNativeDep/PackageWithFakeNativeDep.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - net45 - PackageWithFakeNativeDep - - - - - runtimes/ - true - - - - - - - - - - - - - diff --git a/TestAssets/TestPackages/PackageWithFakeNativeDep/runtimes/win7-x64/native/the-win-x64-version.txt b/TestAssets/TestPackages/PackageWithFakeNativeDep/runtimes/win7-x64/native/the-win-x64-version.txt deleted file mode 100644 index ee3c10a16..000000000 --- a/TestAssets/TestPackages/PackageWithFakeNativeDep/runtimes/win7-x64/native/the-win-x64-version.txt +++ /dev/null @@ -1 +0,0 @@ -This is just a marker to ensure things are deployed right diff --git a/TestAssets/TestPackages/PackageWithFakeNativeDep/runtimes/win7-x86/native/the-win-x86-version.txt b/TestAssets/TestPackages/PackageWithFakeNativeDep/runtimes/win7-x86/native/the-win-x86-version.txt deleted file mode 100644 index ee3c10a16..000000000 --- a/TestAssets/TestPackages/PackageWithFakeNativeDep/runtimes/win7-x86/native/the-win-x86-version.txt +++ /dev/null @@ -1 +0,0 @@ -This is just a marker to ensure things are deployed right diff --git a/TestAssets/TestPackages/ToolWithOutputName/Program.cs b/TestAssets/TestPackages/ToolWithOutputName/Program.cs deleted file mode 100644 index 91bf8b3c7..000000000 --- a/TestAssets/TestPackages/ToolWithOutputName/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Tool with output name!"); - } - } -} diff --git a/TestAssets/TestPackages/ToolWithOutputName/ToolWithOutputName.csproj b/TestAssets/TestPackages/ToolWithOutputName/ToolWithOutputName.csproj deleted file mode 100644 index 6c57ebe5d..000000000 --- a/TestAssets/TestPackages/ToolWithOutputName/ToolWithOutputName.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - - netcoreapp2.0 - dotnet-tool-with-output-name - ToolWithOutputName - Exe - - - diff --git a/TestAssets/TestPackages/dotnet-dependency-context-test/Program.cs b/TestAssets/TestPackages/dotnet-dependency-context-test/Program.cs deleted file mode 100644 index c2d8368b9..000000000 --- a/TestAssets/TestPackages/dotnet-dependency-context-test/Program.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Linq; -using Microsoft.Extensions.DependencyModel; - -namespace Microsoft.DotNet.Tools.DependencyContextTest -{ - public class Program - { - public static int Main(string[] args) - { - if(args.Length > 0 && args[0] == "--debug") - { - Console.WriteLine("Waiting for Debugger to attach, press ENTER to continue"); - Console.WriteLine($"Process ID: {System.Diagnostics.Process.GetCurrentProcess().Id}"); - Console.ReadLine(); - } - - if(DependencyContext.Default != null) - { - Console.WriteLine("DependencyContext.Default is set!"); - } - else - { - Console.Error.WriteLine("DependencyContext.Default is NULL!"); - return 1; - } - - if(DependencyContext.Default.RuntimeGraph.Any()) - { - Console.WriteLine("DependencyContext.Default.RuntimeGraph has items!"); - } - else - { - Console.WriteLine("DependencyContext.Default.RuntimeGraph is empty!"); - return 1; - } - - Console.WriteLine("Tests succeeded!"); - return 0; - } - } -} 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 deleted file mode 100644 index 97e20d00d..000000000 --- a/TestAssets/TestPackages/dotnet-dependency-context-test/dotnet-dependency-context-test.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - - 1.0.0-rc - netcoreapp2.0 - 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..dc08ecdd0 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 @@ -12,13 +12,9 @@ false - - $(CliVersionPrefix)-* - - - + diff --git a/TestAssets/TestPackages/dotnet-desktop-and-portable/NuGet.Config b/TestAssets/TestPackages/dotnet-desktop-and-portable/NuGet.Config deleted file mode 100644 index e80222c1f..000000000 --- a/TestAssets/TestPackages/dotnet-desktop-and-portable/NuGet.Config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/TestAssets/TestPackages/dotnet-desktop-and-portable/Program.cs b/TestAssets/TestPackages/dotnet-desktop-and-portable/Program.cs deleted file mode 100644 index 121c1f775..000000000 --- a/TestAssets/TestPackages/dotnet-desktop-and-portable/Program.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Reflection; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { -#if NET451 - Console.WriteLine($"Hello {string.Join(" ", args)} From .NETFramework,Version=v4.5.1"); -#elif NETCOREAPP1_0 - Console.WriteLine($"Hello {string.Join(" ", args)} From .NETCoreApp,Version=v1.0"); -#endif - var currentAssemblyPath = typeof(ConsoleApplication.Program).GetTypeInfo().Assembly.Location; - Console.WriteLine($"Current Assembly Directory - {currentAssemblyPath}"); - } - } -} diff --git a/TestAssets/TestPackages/dotnet-desktop-and-portable/dotnet-desktop-and-portable.csproj b/TestAssets/TestPackages/dotnet-desktop-and-portable/dotnet-desktop-and-portable.csproj deleted file mode 100644 index 185ef41f0..000000000 --- a/TestAssets/TestPackages/dotnet-desktop-and-portable/dotnet-desktop-and-portable.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - - 1.0.0-rc - netcoreapp1.1;net451 - dotnet-desktop-and-portable - Exe - win7-x64;win7-x86 - - - - 1.1.1 - - - - - - - diff --git a/TestAssets/TestPackages/dotnet-desktop-binding-redirects/Program.cs b/TestAssets/TestPackages/dotnet-desktop-binding-redirects/Program.cs deleted file mode 100644 index 57ecd14fc..000000000 --- a/TestAssets/TestPackages/dotnet-desktop-binding-redirects/Program.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Reflection; - -namespace BindingRedirects -{ - public class Program - { - private const string ExpectedNewtonSoftVersion = "8.0.0.0"; - - public static int Main(string[] args) - { - return VerifyJsonLoad(); - } - - private static int VerifyJsonLoad() - { - WriteLine("=======Verifying Redirected Newtonsoft.Json assembly load======="); - - int result = 0; - - try - { - var jsonAsm = typeof(Newtonsoft.Json.JsonConvert).Assembly; - var version = jsonAsm.GetName().Version.ToString(); - if (version != ExpectedNewtonSoftVersion) - { - WriteLine($"Failure - Newtonsoft.Json: ExpectedVersion - {ExpectedNewtonSoftVersion}, ActualVersion - {version}"); - result = -1; - } - } - catch (Exception ex) - { - WriteLine($"Failed to load type 'Newtonsoft.Json.JsonConvert'"); - throw ex; - } - - return result; - } - - private static void WriteLine(string str) - { - var currentAssembly = Assembly.GetExecutingAssembly().GetName().Name; - Console.WriteLine($"{currentAssembly}: {str}"); - } - } -} 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 deleted file mode 100644 index f77a56e08..000000000 --- a/TestAssets/TestPackages/dotnet-desktop-binding-redirects/dotnet-desktop-binding-redirects.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - 1.0.0-rc - net451 - dotnet-desktop-binding-redirects - Exe - win7-x86;win7-x64 - true - - - - - - - - - - - - - diff --git a/TestAssets/TestPackages/dotnet-fallbackfoldertool/Program.cs b/TestAssets/TestPackages/dotnet-fallbackfoldertool/Program.cs deleted file mode 100644 index c936da285..000000000 --- a/TestAssets/TestPackages/dotnet-fallbackfoldertool/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello Fallback folder World!"); - } - } -} diff --git a/TestAssets/TestPackages/dotnet-fallbackfoldertool/dotnet-fallbackfoldertool.csproj b/TestAssets/TestPackages/dotnet-fallbackfoldertool/dotnet-fallbackfoldertool.csproj deleted file mode 100644 index 35e92a2bb..000000000 --- a/TestAssets/TestPackages/dotnet-fallbackfoldertool/dotnet-fallbackfoldertool.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - - netcoreapp2.0 - dotnet-fallbackfoldertool - Exe - - - - diff --git a/TestAssets/TestPackages/dotnet-hello/v1/dotnet-hello/Program.cs b/TestAssets/TestPackages/dotnet-hello/v1/dotnet-hello/Program.cs deleted file mode 100644 index bf77cb409..000000000 --- a/TestAssets/TestPackages/dotnet-hello/v1/dotnet-hello/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello"); - } - } -} diff --git a/TestAssets/TestPackages/dotnet-hello/v1/dotnet-hello/dotnet-hello.csproj b/TestAssets/TestPackages/dotnet-hello/v1/dotnet-hello/dotnet-hello.csproj deleted file mode 100644 index fd5621f08..000000000 --- a/TestAssets/TestPackages/dotnet-hello/v1/dotnet-hello/dotnet-hello.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - - 1.0.0 - - - netcoreapp2.0 - 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/Program.cs b/TestAssets/TestPackages/dotnet-hello/v2/dotnet-hello/Program.cs deleted file mode 100644 index 2130cd0a7..000000000 --- a/TestAssets/TestPackages/dotnet-hello/v2/dotnet-hello/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/TestPackages/dotnet-hello/v2/dotnet-hello/dotnet-hello.csproj b/TestAssets/TestPackages/dotnet-hello/v2/dotnet-hello/dotnet-hello.csproj deleted file mode 100644 index 2391dfc1b..000000000 --- a/TestAssets/TestPackages/dotnet-hello/v2/dotnet-hello/dotnet-hello.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - - 2.0.0 - - - netcoreapp2.0 - 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-outputsframeworkversion/dotnet-outputsframeworkversion-netcoreapp1.0/Program.cs b/TestAssets/TestPackages/dotnet-outputsframeworkversion/dotnet-outputsframeworkversion-netcoreapp1.0/Program.cs deleted file mode 100644 index 02952b8b4..000000000 --- a/TestAssets/TestPackages/dotnet-outputsframeworkversion/dotnet-outputsframeworkversion-netcoreapp1.0/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main() - { - Console.WriteLine("netcoreapp1.0"); - } - } -} diff --git a/TestAssets/TestPackages/dotnet-outputsframeworkversion/dotnet-outputsframeworkversion-netcoreapp1.0/dotnet-outputsframeworkversion-netcoreapp1.0.csproj b/TestAssets/TestPackages/dotnet-outputsframeworkversion/dotnet-outputsframeworkversion-netcoreapp1.0/dotnet-outputsframeworkversion-netcoreapp1.0.csproj deleted file mode 100644 index e26afd464..000000000 --- a/TestAssets/TestPackages/dotnet-outputsframeworkversion/dotnet-outputsframeworkversion-netcoreapp1.0/dotnet-outputsframeworkversion-netcoreapp1.0.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - - - netcoreapp1.0 - dotnet-outputsframeworkversion-netcoreapp1.0 - Exe - 1.1.1 - - diff --git a/TestAssets/TestPackages/dotnet-portable-v1-prefercli/dotnet-portable-v1-prefercli.csproj b/TestAssets/TestPackages/dotnet-portable-v1-prefercli/dotnet-portable-v1-prefercli.csproj deleted file mode 100644 index 10cc9b117..000000000 --- a/TestAssets/TestPackages/dotnet-portable-v1-prefercli/dotnet-portable-v1-prefercli.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - - netcoreapp1.1 - Exe - - - - - $(ProjectRuntimeConfigFilePath) - - - - - - - diff --git a/TestAssets/TestPackages/dotnet-portable-v1/dotnet-portable-v1.csproj b/TestAssets/TestPackages/dotnet-portable-v1/dotnet-portable-v1.csproj deleted file mode 100644 index b1bddfee9..000000000 --- a/TestAssets/TestPackages/dotnet-portable-v1/dotnet-portable-v1.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - - netcoreapp1.1 - Exe - - - - - - diff --git a/TestAssets/TestProjects/11TestAppWith10CLIToolReferences/11TestAppWith10CLIToolReferences.csproj b/TestAssets/TestProjects/11TestAppWith10CLIToolReferences/11TestAppWith10CLIToolReferences.csproj deleted file mode 100644 index c15ae1a16..000000000 --- a/TestAssets/TestProjects/11TestAppWith10CLIToolReferences/11TestAppWith10CLIToolReferences.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Exe - netcoreapp1.1 - $(TEST_PACKAGES) - - - - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/11TestAppWith10CLIToolReferences/Program.cs b/TestAssets/TestProjects/11TestAppWith10CLIToolReferences/Program.cs deleted file mode 100644 index 2130cd0a7..000000000 --- a/TestAssets/TestProjects/11TestAppWith10CLIToolReferences/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/TestProjects/AppWithAppDependency/TestApp1/Program.cs b/TestAssets/TestProjects/AppWithAppDependency/TestApp1/Program.cs deleted file mode 100644 index 2130cd0a7..000000000 --- a/TestAssets/TestProjects/AppWithAppDependency/TestApp1/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/TestProjects/AppWithAppDependency/TestApp1/project.json b/TestAssets/TestProjects/AppWithAppDependency/TestApp1/project.json deleted file mode 100644 index f863c3161..000000000 --- a/TestAssets/TestProjects/AppWithAppDependency/TestApp1/project.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "buildOptions": { - "emitEntryPoint": true - }, - "dependencies": { - "TestApp2": { - "target": "project" - } - }, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.0" - } - } - } - } -} diff --git a/TestAssets/TestProjects/AppWithAppDependency/TestApp2/Program.cs b/TestAssets/TestProjects/AppWithAppDependency/TestApp2/Program.cs deleted file mode 100644 index 2130cd0a7..000000000 --- a/TestAssets/TestProjects/AppWithAppDependency/TestApp2/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/TestProjects/AppWithAppDependency/TestApp2/project.json b/TestAssets/TestProjects/AppWithAppDependency/TestApp2/project.json deleted file mode 100644 index 2cfedcea8..000000000 --- a/TestAssets/TestProjects/AppWithAppDependency/TestApp2/project.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "buildOptions": { - "emitEntryPoint": true - }, - "dependencies": {}, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.0" - } - } - } - } -} diff --git a/TestAssets/TestProjects/AppWithAppDependency/global.json b/TestAssets/TestProjects/AppWithAppDependency/global.json deleted file mode 100644 index 9e26dfeeb..000000000 --- a/TestAssets/TestProjects/AppWithAppDependency/global.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/TestAssets/TestProjects/AppWithCorruptedLaunchSettings/AppWithCorruptedLaunchSettings.csproj b/TestAssets/TestProjects/AppWithCorruptedLaunchSettings/AppWithCorruptedLaunchSettings.csproj deleted file mode 100644 index 45a048433..000000000 --- a/TestAssets/TestProjects/AppWithCorruptedLaunchSettings/AppWithCorruptedLaunchSettings.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - - 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 - - diff --git a/TestAssets/TestProjects/AppWithCorruptedLaunchSettings/Program.cs b/TestAssets/TestProjects/AppWithCorruptedLaunchSettings/Program.cs deleted file mode 100644 index 042e99826..000000000 --- a/TestAssets/TestProjects/AppWithCorruptedLaunchSettings/Program.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace MSBuildTestApp -{ - public class Program - { - public static void Main(string[] args) - { - if (args.Length > 0) - { - Console.WriteLine("echo args:" + string.Join(";", args)); - } - string message = Environment.GetEnvironmentVariable("Message"); - - if (string.IsNullOrEmpty(message)) - { - message = "(NO MESSAGE)"; - } - - Console.WriteLine(message); - } - } -} diff --git a/TestAssets/TestProjects/AppWithCorruptedLaunchSettings/Properties/launchSettings.json b/TestAssets/TestProjects/AppWithCorruptedLaunchSettings/Properties/launchSettings.json deleted file mode 100644 index 4307944ab..000000000 --- a/TestAssets/TestProjects/AppWithCorruptedLaunchSettings/Properties/launchSettings.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:49850/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "First": { - "commandName": "Project", - "environmentVariables": [ ] - }, - "Second": { - "commandName": "Project", - "environmentVariables": { - "Message": "Second" - } - } - } -} \ No newline at end of file diff --git a/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/AppWithDepOnToolWithOutputName.csproj b/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/AppWithDepOnToolWithOutputName.csproj deleted file mode 100755 index 0559ffd92..000000000 --- a/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/AppWithDepOnToolWithOutputName.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - - netcoreapp2.0 - Exe - $(TEST_PACKAGES) - - - - - - diff --git a/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/Program.cs b/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/Program.cs deleted file mode 100644 index cbcb20f55..000000000 --- a/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("App with a dependency on a tool whose package name is different from the dll name!"); - } - } -} diff --git a/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj b/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj deleted file mode 100755 index d94296238..000000000 --- a/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - netcoreapp2.0 - Exe - $(TEST_PACKAGES) - - - - - - - - - - diff --git a/TestAssets/TestProjects/AppWithDirectAndToolDep/Program.cs b/TestAssets/TestProjects/AppWithDirectAndToolDep/Program.cs deleted file mode 100644 index 2130cd0a7..000000000 --- a/TestAssets/TestProjects/AppWithDirectAndToolDep/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj b/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj deleted file mode 100755 index f8fea864c..000000000 --- a/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - 1.0.0 - netcoreapp2.0 - AppWithDirectDep - Exe - false - $(TEST_PACKAGES) - - - - - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/AppWithDirectDep/Program.cs b/TestAssets/TestProjects/AppWithDirectDep/Program.cs deleted file mode 100644 index 2130cd0a7..000000000 --- a/TestAssets/TestProjects/AppWithDirectDep/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/TestProjects/AppWithDirectDepWithOutputName/AppWithDirectDepWithOutputName.csproj b/TestAssets/TestProjects/AppWithDirectDepWithOutputName/AppWithDirectDepWithOutputName.csproj deleted file mode 100755 index 3a99fed0d..000000000 --- a/TestAssets/TestProjects/AppWithDirectDepWithOutputName/AppWithDirectDepWithOutputName.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - netcoreapp2.0 - Exe - $(TEST_PACKAGES) - - - - - - - - - - diff --git a/TestAssets/TestProjects/AppWithDirectDepWithOutputName/Program.cs b/TestAssets/TestProjects/AppWithDirectDepWithOutputName/Program.cs deleted file mode 100644 index 4178a0e4b..000000000 --- a/TestAssets/TestProjects/AppWithDirectDepWithOutputName/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Contains a dependency on a tool whose package name is different from the dll name."); - } - } -} diff --git a/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/AppWithFallbackFolderToolDependency.csproj b/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/AppWithFallbackFolderToolDependency.csproj deleted file mode 100755 index 1410deeb4..000000000 --- a/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/AppWithFallbackFolderToolDependency.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - - netcoreapp2.0 - Exe - $(TEST_PACKAGES) - - - - - - diff --git a/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/Program.cs b/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/Program.cs deleted file mode 100644 index 2130cd0a7..000000000 --- a/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/TestProjects/AppWithLaunchSettings/AppWithLaunchSettings.csproj b/TestAssets/TestProjects/AppWithLaunchSettings/AppWithLaunchSettings.csproj deleted file mode 100644 index 45a048433..000000000 --- a/TestAssets/TestProjects/AppWithLaunchSettings/AppWithLaunchSettings.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - - 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 - - diff --git a/TestAssets/TestProjects/AppWithLaunchSettings/Program.cs b/TestAssets/TestProjects/AppWithLaunchSettings/Program.cs deleted file mode 100644 index 042e99826..000000000 --- a/TestAssets/TestProjects/AppWithLaunchSettings/Program.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace MSBuildTestApp -{ - public class Program - { - public static void Main(string[] args) - { - if (args.Length > 0) - { - Console.WriteLine("echo args:" + string.Join(";", args)); - } - string message = Environment.GetEnvironmentVariable("Message"); - - if (string.IsNullOrEmpty(message)) - { - message = "(NO MESSAGE)"; - } - - Console.WriteLine(message); - } - } -} diff --git a/TestAssets/TestProjects/AppWithLaunchSettings/Properties/launchSettings.json b/TestAssets/TestProjects/AppWithLaunchSettings/Properties/launchSettings.json deleted file mode 100644 index 615a345f2..000000000 --- a/TestAssets/TestProjects/AppWithLaunchSettings/Properties/launchSettings.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:49850/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "First": { - "commandName": "Project", - "environmentVariables": { - "Message": "First" - } - }, - "Second": { - "commandName": "Project", - "environmentVariables": { - "Message": "Second" - } - } - } -} \ No newline at end of file diff --git a/TestAssets/TestProjects/AppWithLaunchSettingsNoDefault/AppWithLaunchSettingsNoDefault.csproj b/TestAssets/TestProjects/AppWithLaunchSettingsNoDefault/AppWithLaunchSettingsNoDefault.csproj deleted file mode 100644 index 45a048433..000000000 --- a/TestAssets/TestProjects/AppWithLaunchSettingsNoDefault/AppWithLaunchSettingsNoDefault.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - - 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 - - diff --git a/TestAssets/TestProjects/AppWithLaunchSettingsNoDefault/Program.cs b/TestAssets/TestProjects/AppWithLaunchSettingsNoDefault/Program.cs deleted file mode 100644 index 042e99826..000000000 --- a/TestAssets/TestProjects/AppWithLaunchSettingsNoDefault/Program.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace MSBuildTestApp -{ - public class Program - { - public static void Main(string[] args) - { - if (args.Length > 0) - { - Console.WriteLine("echo args:" + string.Join(";", args)); - } - string message = Environment.GetEnvironmentVariable("Message"); - - if (string.IsNullOrEmpty(message)) - { - message = "(NO MESSAGE)"; - } - - Console.WriteLine(message); - } - } -} diff --git a/TestAssets/TestProjects/AppWithLaunchSettingsNoDefault/Properties/launchSettings.json b/TestAssets/TestProjects/AppWithLaunchSettingsNoDefault/Properties/launchSettings.json deleted file mode 100644 index 010893fd5..000000000 --- a/TestAssets/TestProjects/AppWithLaunchSettingsNoDefault/Properties/launchSettings.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:49850/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} \ No newline at end of file diff --git a/TestAssets/TestProjects/AppWithMultipleFxAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj b/TestAssets/TestProjects/AppWithMultipleFxAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj deleted file mode 100644 index 3f38586d5..000000000 --- a/TestAssets/TestProjects/AppWithMultipleFxAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - - Exe - net451;netcoreapp2.0 - $(TEST_PACKAGES) - - - - - - - - - - - - - - diff --git a/TestAssets/TestProjects/AppWithMultipleFxAndTools/Program.cs b/TestAssets/TestProjects/AppWithMultipleFxAndTools/Program.cs deleted file mode 100644 index 6cf5d8c9e..000000000 --- a/TestAssets/TestProjects/AppWithMultipleFxAndTools/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main() - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/TestProjects/AppWithToolDependency/AppWithToolDependency.csproj b/TestAssets/TestProjects/AppWithToolDependency/AppWithToolDependency.csproj deleted file mode 100755 index 6f493b0c3..000000000 --- a/TestAssets/TestProjects/AppWithToolDependency/AppWithToolDependency.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - - netcoreapp2.0 - Exe - $(TEST_PACKAGES) - - - - - - - diff --git a/TestAssets/TestProjects/AppWithToolDependency/Program.cs b/TestAssets/TestProjects/AppWithToolDependency/Program.cs deleted file mode 100644 index 2130cd0a7..000000000 --- a/TestAssets/TestProjects/AppWithToolDependency/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/TestProjects/DependencyContextFromTool/DependencyContextFromTool.csproj b/TestAssets/TestProjects/DependencyContextFromTool/DependencyContextFromTool.csproj deleted file mode 100755 index 4e7b4cd9d..000000000 --- a/TestAssets/TestProjects/DependencyContextFromTool/DependencyContextFromTool.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - 1.0.0 - netcoreapp2.0 - DependencyContextFromTool - Exe - false - $(AssetTargetFallback);dnxcore50;portable-net45+win8 - $(TEST_PACKAGES) - - - - - - diff --git a/TestAssets/TestProjects/DependencyContextFromTool/Program.cs b/TestAssets/TestProjects/DependencyContextFromTool/Program.cs deleted file mode 100644 index 27e3fa454..000000000 --- a/TestAssets/TestProjects/DependencyContextFromTool/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace DependencyContextFromTool -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hi!"); - } - } -} diff --git a/TestAssets/TestProjects/FSharpTestAppSimple/Program.fs b/TestAssets/TestProjects/FSharpTestAppSimple/Program.fs deleted file mode 100644 index 65479d645..000000000 --- a/TestAssets/TestProjects/FSharpTestAppSimple/Program.fs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -module ConsoleApplication.Program - -open System - -[] -let main argv = - printfn "Hello World!" - 0 diff --git a/TestAssets/TestProjects/FSharpTestAppSimple/TestAppSimple.fsproj b/TestAssets/TestProjects/FSharpTestAppSimple/TestAppSimple.fsproj deleted file mode 100644 index 1af08f3b6..000000000 --- a/TestAssets/TestProjects/FSharpTestAppSimple/TestAppSimple.fsproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - netcoreapp2.0 - Exe - - true - - - - - - - diff --git a/TestAssets/TestProjects/FSharpTestProjects/global.json b/TestAssets/TestProjects/FSharpTestProjects/global.json deleted file mode 100644 index 9e455db71..000000000 --- a/TestAssets/TestProjects/FSharpTestProjects/global.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "projects": [ ".", "../../../src" ] -} diff --git a/TestAssets/TestProjects/FluentProfile/FluentFilterProfile.xml b/TestAssets/TestProjects/FluentProfile/FluentFilterProfile.xml deleted file mode 100644 index ec16d69ab..000000000 --- a/TestAssets/TestProjects/FluentProfile/FluentFilterProfile.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/TestAssets/TestProjects/FluentProfile/FluentProfile.xml b/TestAssets/TestProjects/FluentProfile/FluentProfile.xml deleted file mode 100644 index 512290d00..000000000 --- a/TestAssets/TestProjects/FluentProfile/FluentProfile.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/TestAssets/TestProjects/InvalidSolution/InvalidSolution.sln b/TestAssets/TestProjects/InvalidSolution/InvalidSolution.sln deleted file mode 100644 index 6527f5d32..000000000 --- a/TestAssets/TestProjects/InvalidSolution/InvalidSolution.sln +++ /dev/null @@ -1 +0,0 @@ -This is a test of an invalid solution. diff --git a/TestAssets/TestProjects/InvalidSolution/Lib/Lib.csproj b/TestAssets/TestProjects/InvalidSolution/Lib/Lib.csproj deleted file mode 100644 index 9f8bcbb51..000000000 --- a/TestAssets/TestProjects/InvalidSolution/Lib/Lib.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard1.4 - - - - - - - diff --git a/TestAssets/TestProjects/InvalidSolution/Lib/Library.cs b/TestAssets/TestProjects/InvalidSolution/Lib/Library.cs deleted file mode 100644 index 71a4d4832..000000000 --- a/TestAssets/TestProjects/InvalidSolution/Lib/Library.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Lib -{ - public class Library - { - public static string GetMessage() - { - return "Message from Lib"; - } - } -} diff --git a/TestAssets/TestProjects/LibraryWithOutputAssemblyName/.noautobuild b/TestAssets/TestProjects/LibraryWithOutputAssemblyName/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/LibraryWithOutputAssemblyName/Class.cs b/TestAssets/TestProjects/LibraryWithOutputAssemblyName/Class.cs deleted file mode 100644 index ed618e6bc..000000000 --- a/TestAssets/TestProjects/LibraryWithOutputAssemblyName/Class.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace LibraryWithOutputAssemblyName -{ - public class MyClass - { - } -} diff --git a/TestAssets/TestProjects/LibraryWithOutputAssemblyName/MyLibrary.csproj b/TestAssets/TestProjects/LibraryWithOutputAssemblyName/MyLibrary.csproj deleted file mode 100755 index af0401580..000000000 --- a/TestAssets/TestProjects/LibraryWithOutputAssemblyName/MyLibrary.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - netstandard1.5 - - - - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/LibraryWithUnresolvablePackageReference/LibraryWithUnresolvablePackageReference.csproj b/TestAssets/TestProjects/LibraryWithUnresolvablePackageReference/LibraryWithUnresolvablePackageReference.csproj deleted file mode 100755 index 66c164859..000000000 --- a/TestAssets/TestProjects/LibraryWithUnresolvablePackageReference/LibraryWithUnresolvablePackageReference.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard1.5 - - - - - - - diff --git a/TestAssets/TestProjects/MSBuildAppWithMultipleFrameworks/MSBuildAppWithMultipleFrameworks.csproj b/TestAssets/TestProjects/MSBuildAppWithMultipleFrameworks/MSBuildAppWithMultipleFrameworks.csproj deleted file mode 100644 index 89aae6c65..000000000 --- a/TestAssets/TestProjects/MSBuildAppWithMultipleFrameworks/MSBuildAppWithMultipleFrameworks.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - - Exe - net451;netcoreapp2.0 - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/MSBuildAppWithMultipleFrameworks/Program.cs b/TestAssets/TestProjects/MSBuildAppWithMultipleFrameworks/Program.cs deleted file mode 100644 index 6cf5d8c9e..000000000 --- a/TestAssets/TestProjects/MSBuildAppWithMultipleFrameworks/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main() - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/TestProjects/MSBuildAppWithMultipleFrameworksAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj b/TestAssets/TestProjects/MSBuildAppWithMultipleFrameworksAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj deleted file mode 100644 index 766c1ae66..000000000 --- a/TestAssets/TestProjects/MSBuildAppWithMultipleFrameworksAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - - Exe - net451;netcoreapp2.0 - - - - - - - - - - - - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/MSBuildBareBonesProject/BareBones.proj b/TestAssets/TestProjects/MSBuildBareBonesProject/BareBones.proj deleted file mode 100644 index e0b870644..000000000 --- a/TestAssets/TestProjects/MSBuildBareBonesProject/BareBones.proj +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/MSBuildIntegration/build.proj b/TestAssets/TestProjects/MSBuildIntegration/build.proj deleted file mode 100644 index 203f96df3..000000000 --- a/TestAssets/TestProjects/MSBuildIntegration/build.proj +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/MSBuildIntegration/build.props b/TestAssets/TestProjects/MSBuildIntegration/build.props deleted file mode 100644 index 3d640d339..000000000 --- a/TestAssets/TestProjects/MSBuildIntegration/build.props +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/MultiDependentProject/MultiDependentProject.csproj b/TestAssets/TestProjects/MultiDependentProject/MultiDependentProject.csproj deleted file mode 100644 index 8437d1b6d..000000000 --- a/TestAssets/TestProjects/MultiDependentProject/MultiDependentProject.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Exe - netcoreapp2.0 - - - - - - - diff --git a/TestAssets/TestProjects/MultiDependentProject/Program.cs b/TestAssets/TestProjects/MultiDependentProject/Program.cs deleted file mode 100644 index 248a4d29f..000000000 --- a/TestAssets/TestProjects/MultiDependentProject/Program.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections; -using Newtonsoft.Json.Linq; -using FluentAssertions; - -class Program -{ - public static void Main(string[] args) - { - ArrayList argList = new ArrayList(args); - JObject jObject = new JObject(); - - foreach (string arg in argList) - { - jObject[arg] = arg; - } - - jObject.Count.Should().Be(0); - Console.WriteLine(jObject.ToString()); - } -} diff --git a/TestAssets/TestProjects/NewtonSoftDependentProject/NewtonSoftDependentProject.csproj b/TestAssets/TestProjects/NewtonSoftDependentProject/NewtonSoftDependentProject.csproj deleted file mode 100644 index 48bba3bea..000000000 --- a/TestAssets/TestProjects/NewtonSoftDependentProject/NewtonSoftDependentProject.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - Exe - netcoreapp2.0 - - - - - - diff --git a/TestAssets/TestProjects/NewtonSoftDependentProject/Program.cs b/TestAssets/TestProjects/NewtonSoftDependentProject/Program.cs deleted file mode 100644 index 2debeaadb..000000000 --- a/TestAssets/TestProjects/NewtonSoftDependentProject/Program.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections; -using Newtonsoft.Json.Linq; - -class Program -{ - public static void Main(string[] args) - { - ArrayList argList = new ArrayList(args); - JObject jObject = new JObject(); - - foreach (string arg in argList) - { - jObject[arg] = arg; - } - - Console.WriteLine(jObject.ToString()); - } -} diff --git a/TestAssets/TestProjects/NewtonsoftProfile/NewtonsoftFilterProfile.xml b/TestAssets/TestProjects/NewtonsoftProfile/NewtonsoftFilterProfile.xml deleted file mode 100644 index 8f5abe95e..000000000 --- a/TestAssets/TestProjects/NewtonsoftProfile/NewtonsoftFilterProfile.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/TestAssets/TestProjects/NewtonsoftProfile/NewtonsoftProfile.xml b/TestAssets/TestProjects/NewtonsoftProfile/NewtonsoftProfile.xml deleted file mode 100644 index 6cc6c5cdc..000000000 --- a/TestAssets/TestProjects/NewtonsoftProfile/NewtonsoftProfile.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/TestAssets/TestProjects/NuGetConfigDependentProject/NuGetConfigDependentProject.csproj b/TestAssets/TestProjects/NuGetConfigDependentProject/NuGetConfigDependentProject.csproj deleted file mode 100644 index fd76d5489..000000000 --- a/TestAssets/TestProjects/NuGetConfigDependentProject/NuGetConfigDependentProject.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - Exe - netcoreapp2.0 - - - - - - diff --git a/TestAssets/TestProjects/NuGetConfigDependentProject/Program.cs b/TestAssets/TestProjects/NuGetConfigDependentProject/Program.cs deleted file mode 100644 index f6d539fe6..000000000 --- a/TestAssets/TestProjects/NuGetConfigDependentProject/Program.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections; -using NuGet.Configuration; - -class Program -{ - public static void Main(string[] args) - { - var settingValue = new SettingValue("key", "value", false); - - Console.WriteLine(settingValue.Key); - } -} diff --git a/TestAssets/TestProjects/NuGetConfigProfile/NuGetConfigFilterProfile.xml b/TestAssets/TestProjects/NuGetConfigProfile/NuGetConfigFilterProfile.xml deleted file mode 100644 index cb238e3f0..000000000 --- a/TestAssets/TestProjects/NuGetConfigProfile/NuGetConfigFilterProfile.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/TestAssets/TestProjects/NuGetConfigProfile/NuGetConfigProfile.xml b/TestAssets/TestProjects/NuGetConfigProfile/NuGetConfigProfile.xml deleted file mode 100644 index da70b1394..000000000 --- a/TestAssets/TestProjects/NuGetConfigProfile/NuGetConfigProfile.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/TestAssets/TestProjects/PJAppWithMultipleFrameworks/.noautobuild b/TestAssets/TestProjects/PJAppWithMultipleFrameworks/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/PJAppWithMultipleFrameworks/Program.cs b/TestAssets/TestProjects/PJAppWithMultipleFrameworks/Program.cs deleted file mode 100644 index 6cf5d8c9e..000000000 --- a/TestAssets/TestProjects/PJAppWithMultipleFrameworks/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main() - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/TestProjects/PJAppWithMultipleFrameworks/project.json b/TestAssets/TestProjects/PJAppWithMultipleFrameworks/project.json deleted file mode 100644 index ebe6ac518..000000000 --- a/TestAssets/TestProjects/PJAppWithMultipleFrameworks/project.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true - }, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NetCore.App": { - "version": "1.1.0", - "type": "platform" - } - } - }, - "net20": {}, - "net35": {}, - "net40": {}, - "net461": {} - } -} diff --git a/TestAssets/TestProjects/Packages/SharedContentA.1.0.0.nupkg b/TestAssets/TestProjects/Packages/SharedContentA.1.0.0.nupkg deleted file mode 100644 index 22c50bfed..000000000 Binary files a/TestAssets/TestProjects/Packages/SharedContentA.1.0.0.nupkg and /dev/null differ diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferences/SlnFileWithNoProjectReferences.sln b/TestAssets/TestProjects/SlnFileWithNoProjectReferences/SlnFileWithNoProjectReferences.sln deleted file mode 100644 index 5b61df887..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferences/SlnFileWithNoProjectReferences.sln +++ /dev/null @@ -1,18 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndCSharpProject/App.sln b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndCSharpProject/App.sln deleted file mode 100644 index 5b61df887..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndCSharpProject/App.sln +++ /dev/null @@ -1,18 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndCSharpProject/CSharpProject/App.config b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndCSharpProject/CSharpProject/App.config deleted file mode 100644 index 88fa4027b..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndCSharpProject/CSharpProject/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndCSharpProject/CSharpProject/CSharpProject.csproj b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndCSharpProject/CSharpProject/CSharpProject.csproj deleted file mode 100644 index 7d36c9d22..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndCSharpProject/CSharpProject/CSharpProject.csproj +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Debug - AnyCPU - {AE23AD01-99E0-446F-A5F6-16ADBDD0D1E5} - Exe - CSharpProject - CSharpProject - v4.5.2 - 512 - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndCSharpProject/CSharpProject/Program.cs b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndCSharpProject/CSharpProject/Program.cs deleted file mode 100644 index 6c5339907..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndCSharpProject/CSharpProject/Program.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace CSharpProject -{ - class Program - { - static void Main(string[] args) - { - } - } -} diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndCSharpProject/CSharpProject/Properties/AssemblyInfo.cs b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndCSharpProject/CSharpProject/Properties/AssemblyInfo.cs deleted file mode 100644 index c008db98b..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndCSharpProject/CSharpProject/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("CSharpProject")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("CSharpProject")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("ae23ad01-99e0-446f-a5f6-16adbdd0d1e5")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndFSharpProject/App.sln b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndFSharpProject/App.sln deleted file mode 100644 index 5b61df887..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndFSharpProject/App.sln +++ /dev/null @@ -1,18 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndFSharpProject/FSharpProject/App.config b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndFSharpProject/FSharpProject/App.config deleted file mode 100644 index 88fa4027b..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndFSharpProject/FSharpProject/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndFSharpProject/FSharpProject/AssemblyInfo.fs b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndFSharpProject/FSharpProject/AssemblyInfo.fs deleted file mode 100644 index d8b2c37d6..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndFSharpProject/FSharpProject/AssemblyInfo.fs +++ /dev/null @@ -1,41 +0,0 @@ -namespace FSharpProject.AssemblyInfo - -open System.Reflection -open System.Runtime.CompilerServices -open System.Runtime.InteropServices - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[] -[] -[] -[] -[] -[] -[] -[] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [] -[] -[] - -do - () \ No newline at end of file diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndFSharpProject/FSharpProject/FSharpProject.fsproj b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndFSharpProject/FSharpProject/FSharpProject.fsproj deleted file mode 100644 index cad8d59ce..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndFSharpProject/FSharpProject/FSharpProject.fsproj +++ /dev/null @@ -1,81 +0,0 @@ - - - - - Debug - AnyCPU - 2.0 - 52161bb2-18bf-4304-87e7-8d7f0c98ccf3 - Exe - FSharpProject - FSharpProject - v4.5.2 - true - 4.4.1.0 - FSharpProject - - - true - full - false - false - bin\$(Configuration)\ - DEBUG;TRACE - 3 - AnyCPU - bin\$(Configuration)\$(AssemblyName).XML - true - - - pdbonly - true - true - bin\$(Configuration)\ - TRACE - 3 - AnyCPU - bin\$(Configuration)\$(AssemblyName).XML - true - - - 11 - - - - - $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets - - - - - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets - - - - - - - - - - - - - - True - - - - - - ..\packages\System.ValueTuple.4.0.0-rc3-24212-01\lib\netstandard1.1\System.ValueTuple.dll - - - - diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndFSharpProject/FSharpProject/Program.fs b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndFSharpProject/FSharpProject/Program.fs deleted file mode 100644 index 2bcf7f989..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndFSharpProject/FSharpProject/Program.fs +++ /dev/null @@ -1,7 +0,0 @@ -// Learn more about F# at http://fsharp.org -// See the 'F# Tutorial' project for more help. - -[] -let main argv = - printfn "%A" argv - 0 // return an integer exit code diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndFSharpProject/FSharpProject/packages.config b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndFSharpProject/FSharpProject/packages.config deleted file mode 100644 index 2688d2baf..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndFSharpProject/FSharpProject/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProject/App.sln b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProject/App.sln deleted file mode 100644 index 5b61df887..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProject/App.sln +++ /dev/null @@ -1,18 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProject/UnknownProject/UnknownProject.unknownproj b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProject/UnknownProject/UnknownProject.unknownproj deleted file mode 100644 index 8b39c56a6..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProject/UnknownProject/UnknownProject.unknownproj +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProjectWithMultipleProjectTypeGuids/App.sln b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProjectWithMultipleProjectTypeGuids/App.sln deleted file mode 100644 index 5b61df887..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProjectWithMultipleProjectTypeGuids/App.sln +++ /dev/null @@ -1,18 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProjectWithMultipleProjectTypeGuids/UnknownProject/UnknownProject.unknownproj b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProjectWithMultipleProjectTypeGuids/UnknownProject/UnknownProject.unknownproj deleted file mode 100644 index c5e694360..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProjectWithMultipleProjectTypeGuids/UnknownProject/UnknownProject.unknownproj +++ /dev/null @@ -1,6 +0,0 @@ - - - - {20E2F8CC-55AA-4705-B10F-7ABA6F107ECE};{130159A9-F047-44B3-88CF-0CF7F02ED50F} - - diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProjectWithSingleProjectTypeGuid/App.sln b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProjectWithSingleProjectTypeGuid/App.sln deleted file mode 100644 index 5b61df887..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProjectWithSingleProjectTypeGuid/App.sln +++ /dev/null @@ -1,18 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProjectWithSingleProjectTypeGuid/UnknownProject/UnknownProject.unknownproj b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProjectWithSingleProjectTypeGuid/UnknownProject/UnknownProject.unknownproj deleted file mode 100644 index 2615598f1..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProjectWithSingleProjectTypeGuid/UnknownProject/UnknownProject.unknownproj +++ /dev/null @@ -1,6 +0,0 @@ - - - - {130159A9-F047-44B3-88CF-0CF7F02ED50F} - - diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/App.sln b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/App.sln deleted file mode 100644 index 5b61df887..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/App.sln +++ /dev/null @@ -1,18 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/App.config b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/App.config deleted file mode 100644 index 88fa4027b..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/Module1.vb b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/Module1.vb deleted file mode 100644 index 5d7e3a343..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/Module1.vb +++ /dev/null @@ -1,7 +0,0 @@ -Module Module1 - - Sub Main() - - End Sub - -End Module diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/My Project/Application.Designer.vb b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/My Project/Application.Designer.vb deleted file mode 100644 index 88dd01c78..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/My Project/Application.Designer.vb +++ /dev/null @@ -1,13 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/My Project/Application.myapp b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/My Project/Application.myapp deleted file mode 100644 index e62f1a533..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/My Project/Application.myapp +++ /dev/null @@ -1,10 +0,0 @@ - - - false - false - 0 - true - 0 - 2 - true - diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/My Project/AssemblyInfo.vb b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/My Project/AssemblyInfo.vb deleted file mode 100644 index e06141688..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/My Project/AssemblyInfo.vb +++ /dev/null @@ -1,35 +0,0 @@ -Imports System -Imports System.Reflection -Imports System.Runtime.InteropServices - -' General Information about an assembly is controlled through the following -' set of attributes. Change these attribute values to modify the information -' associated with an assembly. - -' Review the values of the assembly attributes - - - - - - - - - - -'The following GUID is for the ID of the typelib if this project is exposed to COM - - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: -' - - - diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/My Project/Resources.Designer.vb b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/My Project/Resources.Designer.vb deleted file mode 100644 index 7b5d7f7fb..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/My Project/Resources.Designer.vb +++ /dev/null @@ -1,62 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Namespace My.Resources - - 'This class was auto-generated by the StronglyTypedResourceBuilder - 'class via a tool like ResGen or Visual Studio. - 'To add or remove a member, edit your .ResX file then rerun ResGen - 'with the /str option, or rebuild your VS project. - ''' - ''' A strongly-typed resource class, for looking up localized strings, etc. - ''' - _ - Friend Module Resources - - Private resourceMan As Global.System.Resources.ResourceManager - - Private resourceCulture As Global.System.Globalization.CultureInfo - - ''' - ''' Returns the cached ResourceManager instance used by this class. - ''' - _ - Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager - Get - If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("VBProject.Resources", GetType(Resources).Assembly) - resourceMan = temp - End If - Return resourceMan - End Get - End Property - - ''' - ''' Overrides the current thread's CurrentUICulture property for all - ''' resource lookups using this strongly typed resource class. - ''' - _ - Friend Property Culture() As Global.System.Globalization.CultureInfo - Get - Return resourceCulture - End Get - Set(ByVal value As Global.System.Globalization.CultureInfo) - resourceCulture = value - End Set - End Property - End Module -End Namespace diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/My Project/Resources.resx b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/My Project/Resources.resx deleted file mode 100644 index af7dbebba..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/My Project/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/My Project/Settings.Designer.vb b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/My Project/Settings.Designer.vb deleted file mode 100644 index 40d08710c..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/My Project/Settings.Designer.vb +++ /dev/null @@ -1,73 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Namespace My - - _ - Partial Friend NotInheritable Class MySettings - Inherits Global.System.Configuration.ApplicationSettingsBase - - Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) - -#Region "My.Settings Auto-Save Functionality" -#If _MyType = "WindowsForms" Then - Private Shared addedHandler As Boolean - - Private Shared addedHandlerLockObject As New Object - - _ - Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) - If My.Application.SaveMySettingsOnExit Then - My.Settings.Save() - End If - End Sub -#End If -#End Region - - Public Shared ReadOnly Property [Default]() As MySettings - Get - -#If _MyType = "WindowsForms" Then - If Not addedHandler Then - SyncLock addedHandlerLockObject - If Not addedHandler Then - AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings - addedHandler = True - End If - End SyncLock - End If -#End If - Return defaultInstance - End Get - End Property - End Class -End Namespace - -Namespace My - - _ - Friend Module MySettingsProperty - - _ - Friend ReadOnly Property Settings() As Global.VBProject.My.MySettings - Get - Return Global.VBProject.My.MySettings.Default - End Get - End Property - End Module -End Namespace diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/My Project/Settings.settings b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/My Project/Settings.settings deleted file mode 100644 index 85b890b3c..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/My Project/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/VBProject.vbproj b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/VBProject.vbproj deleted file mode 100644 index e383214a4..000000000 --- a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndVBProject/VBProject/VBProject.vbproj +++ /dev/null @@ -1,109 +0,0 @@ - - - - - Debug - AnyCPU - {399CECC0-BEAD-436F-9D5F-BB50EBD683DF} - Exe - VBProject.Module1 - VBProject - VBProject - 512 - Console - v4.5.2 - true - - - AnyCPU - true - full - true - true - bin\Debug\ - VBProject.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - AnyCPU - pdbonly - false - true - true - bin\Release\ - VBProject.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - On - - - Binary - - - Off - - - On - - - - - - - - - - - - - - - - - - - - - - - - - - - True - Application.myapp - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - - - diff --git a/TestAssets/TestProjects/TestAppSimple/Program.cs b/TestAssets/TestProjects/TestAppSimple/Program.cs deleted file mode 100644 index 2130cd0a7..000000000 --- a/TestAssets/TestProjects/TestAppSimple/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/TestAssets/TestProjects/TestAppSimple/TestAppSimple.csproj b/TestAssets/TestProjects/TestAppSimple/TestAppSimple.csproj deleted file mode 100755 index e9f02f323..000000000 --- a/TestAssets/TestProjects/TestAppSimple/TestAppSimple.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - - - netcoreapp2.0 - Exe - - true - - \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppWithEmptySln/App.sln b/TestAssets/TestProjects/TestAppWithEmptySln/App.sln deleted file mode 100644 index 8eca25366..000000000 --- a/TestAssets/TestProjects/TestAppWithEmptySln/App.sln +++ /dev/null @@ -1,5 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 diff --git a/TestAssets/TestProjects/TestAppWithEmptySln/App/App.csproj b/TestAssets/TestProjects/TestAppWithEmptySln/App/App.csproj deleted file mode 100644 index ce5bf06cb..000000000 --- a/TestAssets/TestProjects/TestAppWithEmptySln/App/App.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - Exe - netcoreapp2.0 - - - - - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithEmptySln/App/Program.cs b/TestAssets/TestProjects/TestAppWithEmptySln/App/Program.cs deleted file mode 100644 index b71a6fdb4..000000000 --- a/TestAssets/TestProjects/TestAppWithEmptySln/App/Program.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -class Program -{ - static void Main(string[] args) - { - Console.WriteLine("Hello from the main app"); - Console.WriteLine(Lib.Library.GetMessage()); - } -} diff --git a/TestAssets/TestProjects/TestAppWithEmptySln/Lib/Lib.csproj b/TestAssets/TestProjects/TestAppWithEmptySln/Lib/Lib.csproj deleted file mode 100644 index 9f8bcbb51..000000000 --- a/TestAssets/TestProjects/TestAppWithEmptySln/Lib/Lib.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard1.4 - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithEmptySln/Lib/Library.cs b/TestAssets/TestProjects/TestAppWithEmptySln/Lib/Library.cs deleted file mode 100644 index 71a4d4832..000000000 --- a/TestAssets/TestProjects/TestAppWithEmptySln/Lib/Library.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Lib -{ - public class Library - { - public static string GetMessage() - { - return "Message from Lib"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithLibraryUnderTFM/TestApp/Program.cs b/TestAssets/TestProjects/TestAppWithLibraryUnderTFM/TestApp/Program.cs deleted file mode 100644 index ac3163a58..000000000 --- a/TestAssets/TestProjects/TestAppWithLibraryUnderTFM/TestApp/Program.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Diagnostics; - -namespace TestApp -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine(TestLibrary.Helper.GetMessage()); - return 100; - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithLibraryUnderTFM/TestApp/project.json b/TestAssets/TestProjects/TestAppWithLibraryUnderTFM/TestApp/project.json deleted file mode 100644 index a77fe2343..000000000 --- a/TestAssets/TestProjects/TestAppWithLibraryUnderTFM/TestApp/project.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "dependencies": { - "Microsoft.NETCore.App": "1.1.0" - }, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "TestLibrary": { - "target": "project", - "version": "1.0.0-*" - } - } - } - }, - "runtimes": { - "win7-x64": {}, - "win7-x86": {}, - "osx.10.10-x64": {}, - "osx.10.11-x64": {}, - "ubuntu.14.04-x64": {}, - "ubuntu.16.04-x64": {}, - "centos.7-x64": {}, - "rhel.7.2-x64": {}, - "debian.8-x64": {}, - "fedora.23-x64": {}, - "opensuse.13.2-x64": {} - } -} diff --git a/TestAssets/TestProjects/TestAppWithLibraryUnderTFM/TestLibrary/.noautobuild b/TestAssets/TestProjects/TestAppWithLibraryUnderTFM/TestLibrary/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestAppWithLibraryUnderTFM/TestLibrary/Helper.cs b/TestAssets/TestProjects/TestAppWithLibraryUnderTFM/TestLibrary/Helper.cs deleted file mode 100644 index 8c643796b..000000000 --- a/TestAssets/TestProjects/TestAppWithLibraryUnderTFM/TestLibrary/Helper.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace TestLibrary -{ - public static class Helper - { - /// - /// Gets the message from the helper. This comment is here to help test XML documentation file generation, please do not remove it. - /// - /// A message - public static string GetMessage() - { - return "This string came from the test library!"; - } - - public static void SayHi() - { - Console.WriteLine("Hello there!"); - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithLibraryUnderTFM/TestLibrary/project.json b/TestAssets/TestProjects/TestAppWithLibraryUnderTFM/TestLibrary/project.json deleted file mode 100644 index 48bc772d8..000000000 --- a/TestAssets/TestProjects/TestAppWithLibraryUnderTFM/TestLibrary/project.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "nowarn": [ - "CS1591" - ], - "xmlDoc": true, - "additionalArguments": [ - "-highentropyva+" - ] - }, - "dependencies": { - "NETStandard.Library": "1.6.0" - }, - "frameworks": { - "netstandard1.5": {} - } -} diff --git a/TestAssets/TestProjects/TestAppWithLibraryUnderTFM/global.json b/TestAssets/TestProjects/TestAppWithLibraryUnderTFM/global.json deleted file mode 100644 index 3a4684c26..000000000 --- a/TestAssets/TestProjects/TestAppWithLibraryUnderTFM/global.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "projects": [ "."] -} \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppWithMigrateableScripts/.noautobuild b/TestAssets/TestProjects/TestAppWithMigrateableScripts/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestAppWithMigrateableScripts/Program.cs b/TestAssets/TestProjects/TestAppWithMigrateableScripts/Program.cs deleted file mode 100644 index 7bcd4fbd3..000000000 --- a/TestAssets/TestProjects/TestAppWithMigrateableScripts/Program.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Diagnostics; - -namespace TestApp -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine("Hello World"); - return 0; - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithMigrateableScripts/echoscript b/TestAssets/TestProjects/TestAppWithMigrateableScripts/echoscript deleted file mode 100755 index 778a035de..000000000 --- a/TestAssets/TestProjects/TestAppWithMigrateableScripts/echoscript +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env sh -echo $@ \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppWithMigrateableScripts/echoscript.cmd b/TestAssets/TestProjects/TestAppWithMigrateableScripts/echoscript.cmd deleted file mode 100644 index a996a370f..000000000 --- a/TestAssets/TestProjects/TestAppWithMigrateableScripts/echoscript.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -echo %* \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppWithMigrateableScripts/project.json b/TestAssets/TestProjects/TestAppWithMigrateableScripts/project.json deleted file mode 100644 index a453cbddb..000000000 --- a/TestAssets/TestProjects/TestAppWithMigrateableScripts/project.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true - }, - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.0" - } - }, - "frameworks": { - "netcoreapp1.1": {} - }, - "scripts": { - "prepublish": [ - "./echoscript prepublish_output ?%publish:ProjectPath%? ?%publish:Configuration%? ?%publish:OutputPath%? ?%publish:FullTargetFramework%?" - ], - "postpublish": [ - "./echoscript postpublish_output ?%publish:ProjectPath%? ?%publish:Configuration%? ?%publish:OutputPath%? ?%publish:FullTargetFramework%?" - ], - "precompile": [ - "./echoscript precompile_output ?%compile:Configuration%? ?%compile:OutputDir%? ?%compile:FullTargetFramework%?" - ], - "postcompile": [ - "./echoscript postcompile_output ?%compile:Configuration%? ?%compile:OutputDir%? ?%compile:FullTargetFramework%?" - ] - } -} diff --git a/TestAssets/TestProjects/TestAppWithMultipleFrameworksAndRuntimes/.noautobuild b/TestAssets/TestProjects/TestAppWithMultipleFrameworksAndRuntimes/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestAppWithMultipleFrameworksAndRuntimes/Program.cs b/TestAssets/TestProjects/TestAppWithMultipleFrameworksAndRuntimes/Program.cs deleted file mode 100644 index 1b3eb2ea9..000000000 --- a/TestAssets/TestProjects/TestAppWithMultipleFrameworksAndRuntimes/Program.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Xml; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main() - { - Console.WriteLine("Hello World!"); -#if NET20 || NET35 || NET45 || NET461 - // Force XmlDocument to be used - var doc = new XmlDocument(); -#endif - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithMultipleFrameworksAndRuntimes/project.json b/TestAssets/TestProjects/TestAppWithMultipleFrameworksAndRuntimes/project.json deleted file mode 100644 index 352eedd80..000000000 --- a/TestAssets/TestProjects/TestAppWithMultipleFrameworksAndRuntimes/project.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true - }, - "dependencies": {}, - "frameworks": { - "net20": { - "frameworkAssemblies": { - "System.Xml": {} - } - }, - "net35": { - "frameworkAssemblies": { - "System.Xml": {} - } - }, - "net40": { - "frameworkAssemblies": { - "System.Xml": {} - } - }, - "net461": { - "frameworkAssemblies": { - "System.Xml": {} - } - }, - "netcoreapp1.0": { - "dependencies": { - "Microsoft.NetCore.App": "1.0.3" - } - } - }, - "runtimes": { - "win7-x64": {}, - "win7-x86": {} - } -} diff --git a/TestAssets/TestProjects/TestAppWithMultipleSlnFiles/App.sln b/TestAssets/TestProjects/TestAppWithMultipleSlnFiles/App.sln deleted file mode 100644 index 1a6639b73..000000000 --- a/TestAssets/TestProjects/TestAppWithMultipleSlnFiles/App.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "App", "App\App.csproj", "{7072A694-548F-4CAE-A58F-12D257D5F486}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/TestProjects/TestAppWithMultipleSlnFiles/App/App.csproj b/TestAssets/TestProjects/TestAppWithMultipleSlnFiles/App/App.csproj deleted file mode 100644 index 7a2163613..000000000 --- a/TestAssets/TestProjects/TestAppWithMultipleSlnFiles/App/App.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Exe - netcoreapp2.0 - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithMultipleSlnFiles/App/Program.cs b/TestAssets/TestProjects/TestAppWithMultipleSlnFiles/App/Program.cs deleted file mode 100644 index da2c8fe6e..000000000 --- a/TestAssets/TestProjects/TestAppWithMultipleSlnFiles/App/Program.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -class Program -{ - static void Main(string[] args) - { - Console.WriteLine("Hello"); - } -} diff --git a/TestAssets/TestProjects/TestAppWithMultipleSlnFiles/App2.sln b/TestAssets/TestProjects/TestAppWithMultipleSlnFiles/App2.sln deleted file mode 100644 index 1a6639b73..000000000 --- a/TestAssets/TestProjects/TestAppWithMultipleSlnFiles/App2.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "App", "App\App.csproj", "{7072A694-548F-4CAE-A58F-12D257D5F486}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/App.sln b/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/App.sln deleted file mode 100644 index c8573d702..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/App.sln +++ /dev/null @@ -1,39 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "App", "src\App\App.csproj", "{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Src", "Src", "{72BFCA87-B033-4721-8712-4D12166B4A39}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|x64.ActiveCfg = Debug|x64 - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|x64.Build.0 = Debug|x64 - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|x86.ActiveCfg = Debug|x86 - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|x86.Build.0 = Debug|x86 - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|Any CPU.Build.0 = Release|Any CPU - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|x64.ActiveCfg = Release|x64 - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|x64.Build.0 = Release|x64 - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|x86.ActiveCfg = Release|x86 - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A} = {72BFCA87-B033-4721-8712-4D12166B4A39} - EndGlobalSection -EndGlobal diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/App/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/App/App.csproj deleted file mode 100644 index 3a31eb5bf..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/App/App.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - Exe - netcoreapp2.0 - - - - - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/App/Program.cs b/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/App/Program.cs deleted file mode 100644 index b71a6fdb4..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/App/Program.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -class Program -{ - static void Main(string[] args) - { - Console.WriteLine("Hello from the main app"); - Console.WriteLine(Lib.Library.GetMessage()); - } -} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/Lib/Lib.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/Lib/Lib.csproj deleted file mode 100644 index 9f8bcbb51..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/Lib/Lib.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard1.4 - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/Lib/Library.cs b/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/Lib/Library.cs deleted file mode 100644 index 71a4d4832..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCaseSensitiveSolutionFolders/src/Lib/Library.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Lib -{ - public class Library - { - public static string GetMessage() - { - return "Message from Lib"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/App.sln b/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/App.sln deleted file mode 100644 index 1a6639b73..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/App.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "App", "App\App.csproj", "{7072A694-548F-4CAE-A58F-12D257D5F486}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/App/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/App/App.csproj deleted file mode 100644 index ce5bf06cb..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/App/App.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - Exe - netcoreapp2.0 - - - - - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/App/Program.cs b/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/App/Program.cs deleted file mode 100644 index b71a6fdb4..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/App/Program.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -class Program -{ - static void Main(string[] args) - { - Console.WriteLine("Hello from the main app"); - Console.WriteLine(Lib.Library.GetMessage()); - } -} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/Lib/Lib.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/Lib/Lib.csproj deleted file mode 100644 index 9f8bcbb51..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/Lib/Lib.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard1.4 - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/Lib/Library.cs b/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/Lib/Library.cs deleted file mode 100644 index 71a4d4832..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/Lib/Library.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Lib -{ - public class Library - { - public static string GetMessage() - { - return "Message from Lib"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDir/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDir/App.csproj deleted file mode 100644 index 92f102c88..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDir/App.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - Exe - netcoreapp2.0 - - - - - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDir/App.sln b/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDir/App.sln deleted file mode 100644 index 7bd8cded0..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDir/App.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "App", "App.csproj", "{7072A694-548F-4CAE-A58F-12D257D5F486}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDir/Program.cs b/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDir/Program.cs deleted file mode 100644 index b71a6fdb4..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDir/Program.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -class Program -{ - static void Main(string[] args) - { - Console.WriteLine("Hello from the main app"); - Console.WriteLine(Lib.Library.GetMessage()); - } -} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDir/src/Lib/Lib.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDir/src/Lib/Lib.csproj deleted file mode 100644 index aacaac752..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDir/src/Lib/Lib.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - netstandard1.4 - {84A45D44-B677-492D-A6DA-B3A71135AB8E} - - - - - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDir/src/Lib/Library.cs b/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDir/src/Lib/Library.cs deleted file mode 100644 index 71a4d4832..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDir/src/Lib/Library.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Lib -{ - public class Library - { - public static string GetMessage() - { - return "Message from Lib"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDirToRemove/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDirToRemove/App.csproj deleted file mode 100644 index abea1bc3d..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDirToRemove/App.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Exe - netcoreapp2.0 - - - - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDirToRemove/App.sln b/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDirToRemove/App.sln deleted file mode 100644 index b00300a34..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDirToRemove/App.sln +++ /dev/null @@ -1,62 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "App", "App.csproj", "{7072A694-548F-4CAE-A58F-12D257D5F486}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{7B86CE74-F620-4B32-99FE-82D40F8D6BF2}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Lib", "Lib", "{EAB71280-AF32-4531-8703-43CDBA261AA3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lib", "src\Lib\Lib.csproj", "{84A45D44-B677-492D-A6DA-B3A71135AB8E}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NotLastProjInSrc", "NotLastProjInSrc", "{1C5EE322-7073-4298-A077-B7816B1CE15F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NotLastProjInSrc", "src\NotLastProjInSrc\NotLastProjInSrc.csproj", "{96E9FA7D-FE59-4866-AE1E-F9EC2BB2FC67}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|x64.ActiveCfg = Debug|x64 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|x64.Build.0 = Debug|x64 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|x86.ActiveCfg = Debug|x86 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|x86.Build.0 = Debug|x86 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|Any CPU.Build.0 = Release|Any CPU - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|x64.ActiveCfg = Release|x64 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|x64.Build.0 = Release|x64 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|x86.ActiveCfg = Release|x86 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {EAB71280-AF32-4531-8703-43CDBA261AA3} = {7B86CE74-F620-4B32-99FE-82D40F8D6BF2} - {84A45D44-B677-492D-A6DA-B3A71135AB8E} = {EAB71280-AF32-4531-8703-43CDBA261AA3} - {1C5EE322-7073-4298-A077-B7816B1CE15F} = {7B86CE74-F620-4B32-99FE-82D40F8D6BF2} - {96E9FA7D-FE59-4866-AE1E-F9EC2BB2FC67} = {1C5EE322-7073-4298-A077-B7816B1CE15F} - EndGlobalSection -EndGlobal diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDirToRemove/Program.cs b/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDirToRemove/Program.cs deleted file mode 100644 index b71a6fdb4..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDirToRemove/Program.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -class Program -{ - static void Main(string[] args) - { - Console.WriteLine("Hello from the main app"); - Console.WriteLine(Lib.Library.GetMessage()); - } -} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDirToRemove/src/Lib/Lib.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDirToRemove/src/Lib/Lib.csproj deleted file mode 100644 index aacaac752..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDirToRemove/src/Lib/Lib.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - netstandard1.4 - {84A45D44-B677-492D-A6DA-B3A71135AB8E} - - - - - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDirToRemove/src/Lib/Library.cs b/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDirToRemove/src/Lib/Library.cs deleted file mode 100644 index 71a4d4832..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojInSubDirToRemove/src/Lib/Library.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Lib -{ - public class Library - { - public static string GetMessage() - { - return "Message from Lib"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojProjectGuidFiles/App.sln b/TestAssets/TestProjects/TestAppWithSlnAndCsprojProjectGuidFiles/App.sln deleted file mode 100644 index 1a6639b73..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojProjectGuidFiles/App.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "App", "App\App.csproj", "{7072A694-548F-4CAE-A58F-12D257D5F486}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojProjectGuidFiles/App/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCsprojProjectGuidFiles/App/App.csproj deleted file mode 100644 index ce5bf06cb..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojProjectGuidFiles/App/App.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - Exe - netcoreapp2.0 - - - - - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojProjectGuidFiles/App/Program.cs b/TestAssets/TestProjects/TestAppWithSlnAndCsprojProjectGuidFiles/App/Program.cs deleted file mode 100644 index b71a6fdb4..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojProjectGuidFiles/App/Program.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -class Program -{ - static void Main(string[] args) - { - Console.WriteLine("Hello from the main app"); - Console.WriteLine(Lib.Library.GetMessage()); - } -} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojProjectGuidFiles/Lib/Lib.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCsprojProjectGuidFiles/Lib/Lib.csproj deleted file mode 100644 index 4a0fd46d5..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojProjectGuidFiles/Lib/Lib.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard1.4 - {84A45D44-B677-492D-A6DA-B3A71135AB8E} - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojProjectGuidFiles/Lib/Library.cs b/TestAssets/TestProjects/TestAppWithSlnAndCsprojProjectGuidFiles/Lib/Library.cs deleted file mode 100644 index 71a4d4832..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojProjectGuidFiles/Lib/Library.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Lib -{ - public class Library - { - public static string GetMessage() - { - return "Message from Lib"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/App.sln b/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/App.sln deleted file mode 100644 index 6af5ab783..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/App.sln +++ /dev/null @@ -1,45 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "App", "App\App.csproj", "{7072A694-548F-4CAE-A58F-12D257D5F486}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Lib", "Lib\Lib.csproj", "{21D9159F-60E6-4F65-BC6B-D01B71B15FFC}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86 - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Debug|x64.ActiveCfg = Debug|x64 - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Debug|x64.Build.0 = Debug|x64 - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Debug|x86.ActiveCfg = Debug|x86 - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Debug|x86.Build.0 = Debug|x86 - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Release|Any CPU.Build.0 = Release|Any CPU - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Release|x64.ActiveCfg = Release|x64 - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Release|x64.Build.0 = Release|x64 - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Release|x86.ActiveCfg = Release|x86 - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Release|x86.Build.0 = Release|x86 - EndGlobalSection -EndGlobal diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/App/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/App/App.csproj deleted file mode 100644 index 7a2163613..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/App/App.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Exe - netcoreapp2.0 - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/App/Program.cs b/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/App/Program.cs deleted file mode 100644 index 11f138d4d..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/App/Program.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -class Program -{ - static void Main(string[] args) - { - Console.WriteLine("Hello from the main app"); - } -} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/Lib/Lib.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/Lib/Lib.csproj deleted file mode 100644 index 9f8bcbb51..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/Lib/Lib.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard1.4 - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/Lib/Library.cs b/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/Lib/Library.cs deleted file mode 100644 index 71a4d4832..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/Lib/Library.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Lib -{ - public class Library - { - public static string GetMessage() - { - return "Message from Lib"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndDuplicateProjectReferences/App.sln b/TestAssets/TestProjects/TestAppWithSlnAndDuplicateProjectReferences/App.sln deleted file mode 100644 index 95e9f988e..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndDuplicateProjectReferences/App.sln +++ /dev/null @@ -1,38 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "App", "App\App.csproj", "{7072A694-548F-4CAE-A58F-12D257D5F486}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lib", "Lib\Lib.csproj", "{B38B1FA5-B4C9-456A-8B71-8FCD62ACF400}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lib", "Lib\Lib.csproj", "{B38B1FA5-B4C9-456A-8B71-8FCD62ACF400}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/TestProjects/TestAppWithSlnAndDuplicateProjectReferences/App/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndDuplicateProjectReferences/App/App.csproj deleted file mode 100644 index ce5bf06cb..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndDuplicateProjectReferences/App/App.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - Exe - netcoreapp2.0 - - - - - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithSlnAndDuplicateProjectReferences/App/Program.cs b/TestAssets/TestProjects/TestAppWithSlnAndDuplicateProjectReferences/App/Program.cs deleted file mode 100644 index b71a6fdb4..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndDuplicateProjectReferences/App/Program.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -class Program -{ - static void Main(string[] args) - { - Console.WriteLine("Hello from the main app"); - Console.WriteLine(Lib.Library.GetMessage()); - } -} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndDuplicateProjectReferences/Lib/Lib.csproj b/TestAssets/TestProjects/TestAppWithSlnAndDuplicateProjectReferences/Lib/Lib.csproj deleted file mode 100644 index 9f8bcbb51..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndDuplicateProjectReferences/Lib/Lib.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard1.4 - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithSlnAndDuplicateProjectReferences/Lib/Library.cs b/TestAssets/TestProjects/TestAppWithSlnAndDuplicateProjectReferences/Lib/Library.cs deleted file mode 100644 index 71a4d4832..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndDuplicateProjectReferences/Lib/Library.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Lib -{ - public class Library - { - public static string GetMessage() - { - return "Message from Lib"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferences/App.sln b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferences/App.sln deleted file mode 100644 index dab4a7da7..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferences/App.sln +++ /dev/null @@ -1,36 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "App", "App\App.csproj", "{7072A694-548F-4CAE-A58F-12D257D5F486}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lib", "Lib\Lib.csproj", "{B38B1FA5-B4C9-456A-8B71-8FCD62ACF400}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferences/App/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferences/App/App.csproj deleted file mode 100644 index 21cce6681..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferences/App/App.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - - Exe - netcoreapp2.0 - - - - - - - - - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferences/App/Program.cs b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferences/App/Program.cs deleted file mode 100644 index b71a6fdb4..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferences/App/Program.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -class Program -{ - static void Main(string[] args) - { - Console.WriteLine("Hello from the main app"); - Console.WriteLine(Lib.Library.GetMessage()); - } -} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferences/Lib/Lib.csproj b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferences/Lib/Lib.csproj deleted file mode 100644 index 9f8bcbb51..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferences/Lib/Lib.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard1.4 - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferences/Lib/Library.cs b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferences/Lib/Library.cs deleted file mode 100644 index 71a4d4832..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferences/Lib/Library.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Lib -{ - public class Library - { - public static string GetMessage() - { - return "Message from Lib"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App.sln b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App.sln deleted file mode 100644 index 17cd062c5..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App.sln +++ /dev/null @@ -1,36 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "App", "App\App.csproj", "{7072A694-548F-4CAE-A58F-12D257D5F486}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lib", "Lib\\Lib.csproj", "{B38B1FA5-B4C9-456A-8B71-8FCD62ACF400}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App/App.csproj deleted file mode 100644 index 21cce6681..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App/App.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - - Exe - netcoreapp2.0 - - - - - - - - - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App/Program.cs b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App/Program.cs deleted file mode 100644 index b71a6fdb4..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/App/Program.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -class Program -{ - static void Main(string[] args) - { - Console.WriteLine("Hello from the main app"); - Console.WriteLine(Lib.Library.GetMessage()); - } -} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/Lib/Lib.csproj b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/Lib/Lib.csproj deleted file mode 100644 index 9f8bcbb51..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/Lib/Lib.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard1.4 - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/Lib/Library.cs b/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/Lib/Library.cs deleted file mode 100644 index 71a4d4832..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep/Lib/Library.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Lib -{ - public class Library - { - public static string GetMessage() - { - return "Message from Lib"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndLastCsprojInSubDirToRemove/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndLastCsprojInSubDirToRemove/App.csproj deleted file mode 100644 index abea1bc3d..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndLastCsprojInSubDirToRemove/App.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Exe - netcoreapp2.0 - - - - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/TestAppWithSlnAndLastCsprojInSubDirToRemove/App.sln b/TestAssets/TestProjects/TestAppWithSlnAndLastCsprojInSubDirToRemove/App.sln deleted file mode 100644 index ac77ad340..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndLastCsprojInSubDirToRemove/App.sln +++ /dev/null @@ -1,53 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "App", "App.csproj", "{7072A694-548F-4CAE-A58F-12D257D5F486}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{7B86CE74-F620-4B32-99FE-82D40F8D6BF2}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Lib", "Lib", "{EAB71280-AF32-4531-8703-43CDBA261AA3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lib", "src\Lib\Lib.csproj", "{84A45D44-B677-492D-A6DA-B3A71135AB8E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|x64.ActiveCfg = Debug|x64 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|x64.Build.0 = Debug|x64 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|x86.ActiveCfg = Debug|x86 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|x86.Build.0 = Debug|x86 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|Any CPU.Build.0 = Release|Any CPU - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|x64.ActiveCfg = Release|x64 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|x64.Build.0 = Release|x64 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|x86.ActiveCfg = Release|x86 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {EAB71280-AF32-4531-8703-43CDBA261AA3} = {7B86CE74-F620-4B32-99FE-82D40F8D6BF2} - {84A45D44-B677-492D-A6DA-B3A71135AB8E} = {EAB71280-AF32-4531-8703-43CDBA261AA3} - EndGlobalSection -EndGlobal diff --git a/TestAssets/TestProjects/TestAppWithSlnAndLastCsprojInSubDirToRemove/Program.cs b/TestAssets/TestProjects/TestAppWithSlnAndLastCsprojInSubDirToRemove/Program.cs deleted file mode 100644 index b71a6fdb4..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndLastCsprojInSubDirToRemove/Program.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -class Program -{ - static void Main(string[] args) - { - Console.WriteLine("Hello from the main app"); - Console.WriteLine(Lib.Library.GetMessage()); - } -} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndLastCsprojInSubDirToRemove/src/Lib/Lib.csproj b/TestAssets/TestProjects/TestAppWithSlnAndLastCsprojInSubDirToRemove/src/Lib/Lib.csproj deleted file mode 100644 index aacaac752..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndLastCsprojInSubDirToRemove/src/Lib/Lib.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - netstandard1.4 - {84A45D44-B677-492D-A6DA-B3A71135AB8E} - - - - - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithSlnAndLastCsprojInSubDirToRemove/src/Lib/Library.cs b/TestAssets/TestProjects/TestAppWithSlnAndLastCsprojInSubDirToRemove/src/Lib/Library.cs deleted file mode 100644 index 71a4d4832..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndLastCsprojInSubDirToRemove/src/Lib/Library.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Lib -{ - public class Library - { - public static string GetMessage() - { - return "Message from Lib"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndSolutionFolders/App.sln b/TestAssets/TestProjects/TestAppWithSlnAndSolutionFolders/App.sln deleted file mode 100644 index 6b63b4437..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndSolutionFolders/App.sln +++ /dev/null @@ -1,39 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "App", "src\App\App.csproj", "{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{72BFCA87-B033-4721-8712-4D12166B4A39}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|x64.ActiveCfg = Debug|x64 - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|x64.Build.0 = Debug|x64 - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|x86.ActiveCfg = Debug|x86 - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|x86.Build.0 = Debug|x86 - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|Any CPU.Build.0 = Release|Any CPU - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|x64.ActiveCfg = Release|x64 - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|x64.Build.0 = Release|x64 - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|x86.ActiveCfg = Release|x86 - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {DDF3765C-59FB-4AA6-BE83-779ED13AA64A} = {72BFCA87-B033-4721-8712-4D12166B4A39} - EndGlobalSection -EndGlobal diff --git a/TestAssets/TestProjects/TestAppWithSlnAndSolutionFolders/src/App/App.csproj b/TestAssets/TestProjects/TestAppWithSlnAndSolutionFolders/src/App/App.csproj deleted file mode 100644 index 3a31eb5bf..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndSolutionFolders/src/App/App.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - Exe - netcoreapp2.0 - - - - - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithSlnAndSolutionFolders/src/App/Program.cs b/TestAssets/TestProjects/TestAppWithSlnAndSolutionFolders/src/App/Program.cs deleted file mode 100644 index b71a6fdb4..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndSolutionFolders/src/App/Program.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -class Program -{ - static void Main(string[] args) - { - Console.WriteLine("Hello from the main app"); - Console.WriteLine(Lib.Library.GetMessage()); - } -} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndSolutionFolders/src/src/Lib/Lib.csproj b/TestAssets/TestProjects/TestAppWithSlnAndSolutionFolders/src/src/Lib/Lib.csproj deleted file mode 100644 index 9f8bcbb51..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndSolutionFolders/src/src/Lib/Lib.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard1.4 - - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithSlnAndSolutionFolders/src/src/Lib/Library.cs b/TestAssets/TestProjects/TestAppWithSlnAndSolutionFolders/src/src/Lib/Library.cs deleted file mode 100644 index 71a4d4832..000000000 --- a/TestAssets/TestProjects/TestAppWithSlnAndSolutionFolders/src/src/Lib/Library.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Lib -{ - public class Library - { - public static string GetMessage() - { - return "Message from Lib"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithUnqualifiedDependencies/ProjectA/.noautobuild b/TestAssets/TestProjects/TestAppWithUnqualifiedDependencies/ProjectA/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestAppWithUnqualifiedDependencies/ProjectA/Program.cs b/TestAssets/TestProjects/TestAppWithUnqualifiedDependencies/ProjectA/Program.cs deleted file mode 100644 index 9576b17c4..000000000 --- a/TestAssets/TestProjects/TestAppWithUnqualifiedDependencies/ProjectA/Program.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Diagnostics; -using TestLibrary; - -namespace TestApp -{ - public class Program - { - public static int Main(string[] args) - { - Console.WriteLine("This string came from ProjectA"); - Console.WriteLine($"{ProjectB.GetMessage()}"); - return 0; - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithUnqualifiedDependencies/ProjectA/project.json b/TestAssets/TestProjects/TestAppWithUnqualifiedDependencies/ProjectA/project.json deleted file mode 100644 index 1ff04d86a..000000000 --- a/TestAssets/TestProjects/TestAppWithUnqualifiedDependencies/ProjectA/project.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "dependencies": { - "ProjectB": "1.0.0-*", - "Microsoft.NETCore.App": "1.1.0" - }, - "frameworks": { - "netcoreapp1.1": {} - }, - "runtimes": { - "win7-x64": {}, - "win7-x86": {}, - "osx.10.10-x64": {}, - "osx.10.11-x64": {}, - "ubuntu.14.04-x64": {}, - "ubuntu.16.04-x64": {}, - "centos.7-x64": {}, - "rhel.7.2-x64": {}, - "debian.8-x64": {}, - "fedora.23-x64": {}, - "opensuse.13.2-x64": {} - } -} diff --git a/TestAssets/TestProjects/TestAppWithUnqualifiedDependencies/ProjectB/.noautobuild b/TestAssets/TestProjects/TestAppWithUnqualifiedDependencies/ProjectB/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestAppWithUnqualifiedDependencies/ProjectB/Helper.cs b/TestAssets/TestProjects/TestAppWithUnqualifiedDependencies/ProjectB/Helper.cs deleted file mode 100644 index 5a986d891..000000000 --- a/TestAssets/TestProjects/TestAppWithUnqualifiedDependencies/ProjectB/Helper.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace TestLibrary -{ - public static class ProjectB - { - public static string GetMessage() - { - return "This string came from ProjectB"; - } - } -} diff --git a/TestAssets/TestProjects/TestAppWithUnqualifiedDependencies/ProjectB/project.json b/TestAssets/TestProjects/TestAppWithUnqualifiedDependencies/ProjectB/project.json deleted file mode 100644 index 48bc772d8..000000000 --- a/TestAssets/TestProjects/TestAppWithUnqualifiedDependencies/ProjectB/project.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "nowarn": [ - "CS1591" - ], - "xmlDoc": true, - "additionalArguments": [ - "-highentropyva+" - ] - }, - "dependencies": { - "NETStandard.Library": "1.6.0" - }, - "frameworks": { - "netstandard1.5": {} - } -} diff --git a/TestAssets/TestProjects/TestAppWithUnqualifiedDependencies/global.json b/TestAssets/TestProjects/TestAppWithUnqualifiedDependencies/global.json deleted file mode 100644 index 9e26dfeeb..000000000 --- a/TestAssets/TestProjects/TestAppWithUnqualifiedDependencies/global.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/TestAssets/TestProjects/TestLibraryWithConfiguration/.noautobuild b/TestAssets/TestProjects/TestLibraryWithConfiguration/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestLibraryWithConfiguration/Helper.cs b/TestAssets/TestProjects/TestLibraryWithConfiguration/Helper.cs deleted file mode 100644 index 8c643796b..000000000 --- a/TestAssets/TestProjects/TestLibraryWithConfiguration/Helper.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace TestLibrary -{ - public static class Helper - { - /// - /// Gets the message from the helper. This comment is here to help test XML documentation file generation, please do not remove it. - /// - /// A message - public static string GetMessage() - { - return "This string came from the test library!"; - } - - public static void SayHi() - { - Console.WriteLine("Hello there!"); - } - } -} diff --git a/TestAssets/TestProjects/TestLibraryWithConfiguration/TestLibraryWithConfiguration.csproj b/TestAssets/TestProjects/TestLibraryWithConfiguration/TestLibraryWithConfiguration.csproj deleted file mode 100755 index 9c427890c..000000000 --- a/TestAssets/TestProjects/TestLibraryWithConfiguration/TestLibraryWithConfiguration.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - netstandard1.5 - $(NoWarn);CS1591 - true - - - - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/TestLibraryWithMultipleFrameworks/.noautobuild b/TestAssets/TestProjects/TestLibraryWithMultipleFrameworks/.noautobuild deleted file mode 100644 index e69de29bb..000000000 diff --git a/TestAssets/TestProjects/TestLibraryWithMultipleFrameworks/Program.cs b/TestAssets/TestProjects/TestLibraryWithMultipleFrameworks/Program.cs deleted file mode 100644 index 1b3eb2ea9..000000000 --- a/TestAssets/TestProjects/TestLibraryWithMultipleFrameworks/Program.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Xml; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main() - { - Console.WriteLine("Hello World!"); -#if NET20 || NET35 || NET45 || NET461 - // Force XmlDocument to be used - var doc = new XmlDocument(); -#endif - } - } -} diff --git a/TestAssets/TestProjects/TestLibraryWithMultipleFrameworks/project.json b/TestAssets/TestProjects/TestLibraryWithMultipleFrameworks/project.json deleted file mode 100644 index 396636d98..000000000 --- a/TestAssets/TestProjects/TestLibraryWithMultipleFrameworks/project.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": false - }, - "dependencies": {}, - "frameworks": { - "net20": { - "frameworkAssemblies": { - "System.Xml": {} - } - }, - "net35": { - "frameworkAssemblies": { - "System.Xml": {} - } - }, - "net40": { - "frameworkAssemblies": { - "System.Xml": {} - } - }, - "net461": { - "frameworkAssemblies": { - "System.Xml": {} - } - }, - "netstandard1.5": { - "imports": "dnxcore50", - "dependencies": { - "NETStandard.Library": "1.6.0" - } - } - } -} diff --git a/TestAssets/TestProjects/VBTestApp/Program.vb b/TestAssets/TestProjects/VBTestApp/Program.vb deleted file mode 100644 index 46283ca23..000000000 --- a/TestAssets/TestProjects/VBTestApp/Program.vb +++ /dev/null @@ -1,7 +0,0 @@ -Imports System - -Module Program - Sub Main(args As String()) - Console.WriteLine("Hello World!") - End Sub -End Module diff --git a/TestAssets/TestProjects/VBTestApp/VBTestApp.vbproj b/TestAssets/TestProjects/VBTestApp/VBTestApp.vbproj deleted file mode 100644 index ce1697ae8..000000000 --- a/TestAssets/TestProjects/VBTestApp/VBTestApp.vbproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - Exe - netcoreapp2.0 - - - diff --git a/TestAssets/TestProjects/VSTestCore/Tests.cs b/TestAssets/TestProjects/VSTestCore/Tests.cs deleted file mode 100644 index 1bd3cb13f..000000000 --- a/TestAssets/TestProjects/VSTestCore/Tests.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace TestNamespace -{ - [TestClass] - public class VSTestTests - { - [TestMethod] - public void VSTestPassTest() - { - } - - [TestMethod] - public void VSTestFailTest() - { - Assert.Fail(); - } - } -} diff --git a/TestAssets/TestProjects/VSTestCore/VSTestCore.csproj b/TestAssets/TestProjects/VSTestCore/VSTestCore.csproj deleted file mode 100644 index 0d07738af..000000000 --- a/TestAssets/TestProjects/VSTestCore/VSTestCore.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - - Exe - netcoreapp2.0 - - - - - - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/VSTestMulti/Tests.cs b/TestAssets/TestProjects/VSTestMulti/Tests.cs deleted file mode 100644 index 67b494cd5..000000000 --- a/TestAssets/TestProjects/VSTestMulti/Tests.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace TestNamespace -{ - [TestClass] - public class VSTestTests - { - [TestMethod] - public void VSTestPassTest() - { - } - - [TestMethod] - public void VSTestFailTest() - { - Assert.Fail(); - } - -#if DESKTOP - [TestMethod] - public void VSTestPassTestDesktop() - { - } -#else - [TestMethod] - public void VSTestFailTestNetCoreApp() - { - Assert.Fail(); - } -#endif - } -} diff --git a/TestAssets/TestProjects/VSTestMulti/VSTestDesktopAndNetCore.csproj b/TestAssets/TestProjects/VSTestMulti/VSTestDesktopAndNetCore.csproj deleted file mode 100644 index 1a8fb8e53..000000000 --- a/TestAssets/TestProjects/VSTestMulti/VSTestDesktopAndNetCore.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - net46;netcoreapp2.0 - - - - DESKTOP;$(DefineConstants) - - - - - - - - \ No newline at end of file diff --git a/TestAssets/TestProjects/XunitCore/UnitTest1.cs b/TestAssets/TestProjects/XunitCore/UnitTest1.cs deleted file mode 100644 index 6a8094053..000000000 --- a/TestAssets/TestProjects/XunitCore/UnitTest1.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using Xunit; - -namespace TestNamespace -{ - public class VSTestXunitTests - { - [Fact] - public void VSTestXunitPassTest() - { - } - - [Fact] - public void VSTestXunitFailTest() - { - Assert.Equal(1, 2); - } - } -} diff --git a/TestAssets/TestProjects/XunitCore/XunitCore.csproj b/TestAssets/TestProjects/XunitCore/XunitCore.csproj deleted file mode 100644 index d6016beea..000000000 --- a/TestAssets/TestProjects/XunitCore/XunitCore.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - Exe - netcoreapp2.0 - - - - - - - - - diff --git a/TestAssets/TestProjects/XunitMulti/UnitTest1.cs b/TestAssets/TestProjects/XunitMulti/UnitTest1.cs deleted file mode 100644 index f98bf0fe4..000000000 --- a/TestAssets/TestProjects/XunitMulti/UnitTest1.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using Xunit; - -namespace TestNamespace -{ - public class VSTestXunitTests - { - [Fact] - public void VSTestXunitPassTest() - { - } - - [Fact] - public void VSTestXunitFailTest() - { - Assert.Equal(1, 2); - } - -#if DESKTOP - [Fact] - public void VSTestXunitPassTestDesktop() - { - } -#else - [Fact] - public void VSTestXunitFailTestNetCoreApp() - { - Assert.Equal(1, 2); - } -#endif - } -} diff --git a/TestAssets/TestProjects/XunitMulti/VSTestXunitDesktopAndNetCore.csproj b/TestAssets/TestProjects/XunitMulti/VSTestXunitDesktopAndNetCore.csproj deleted file mode 100644 index 3c971a5e9..000000000 --- a/TestAssets/TestProjects/XunitMulti/VSTestXunitDesktopAndNetCore.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - - net46;netcoreapp2.0 - win7-x86 - win7-x86 - - - - DESKTOP;$(DefineConstants) - - - - - - - - - - - - diff --git a/build.proj b/build.proj index 837cf150e..982770597 100644 --- a/build.proj +++ b/build.proj @@ -49,7 +49,7 @@ - + diff --git a/build/BranchInfo.props b/build/BranchInfo.props index 622960a55..739bd41b9 100644 --- a/build/BranchInfo.props +++ b/build/BranchInfo.props @@ -1,6 +1,6 @@ - release/2.0.0 - release/2.0.0 + dev/repo-refactoring + dev/repo-refactoring diff --git a/build/BuildDefaults.props b/build/BuildDefaults.props index 8561a45b0..399abbf8b 100644 --- a/build/BuildDefaults.props +++ b/build/BuildDefaults.props @@ -1,6 +1,6 @@ - Prepare;Compile;Test;Package;Publish + Prepare;ComposeSdk;Test;Package;Publish Debug true false diff --git a/build/BundledSdks.props b/build/BundledSdks.props deleted file mode 100644 index 77a089668..000000000 --- a/build/BundledSdks.props +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/build/BundledTools.props b/build/BundledTools.props deleted file mode 100644 index 947148dd5..000000000 --- a/build/BundledTools.props +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/build/BundledToolset.props b/build/BundledToolset.props new file mode 100644 index 000000000..ec75255f6 --- /dev/null +++ b/build/BundledToolset.props @@ -0,0 +1,22 @@ + + + $(ArtifactNameSdk)-$(ToolsetVersion)-$(SharedFrameworkRid)$(ArchiveExtension) + + + + + $(DotnetBlobRootUrl)/Sdk/$(ToolsetVersion)/ + $(ToolsetRootUrl)$(ToolsetCompressedFileName)$(CoreSetupBlobAccessTokenParam) + $(IntermediateDirectory)/toolsetDownload/$(ToolsetVersion)/ + $(ToolsetDownloadDirectory)$(ToolsetCompressedFileName) + + + + <_DownloadAndExtractItem Include="ToolsetArchive" + Condition="!Exists('$(ToolsetArchive)')"> + $(ToolsetDownloadUrl) + $(ToolsetArchive) + $(ToolsetPublishDirectory) + + + diff --git a/build/Compile.targets b/build/Compile.targets deleted file mode 100644 index d2a3747aa..000000000 --- a/build/Compile.targets +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/build/ComposeSdk.targets b/build/ComposeSdk.targets new file mode 100644 index 000000000..0f47564ea --- /dev/null +++ b/build/ComposeSdk.targets @@ -0,0 +1,115 @@ + + + + + + $(SdkOutputDirectory) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TemplateLayoutDirectory=$(SdkOutputDirectory)/Templates; + TemplatePackageName=%(BundledTemplate.Identity); + TemplatePackageVersion=%(BundledTemplate.Version); + PreviousStageDirectory=$(PreviousStageDirectory) + + + + + + + + + + + + + + + + + + + + diff --git a/build/DependencyVersions.props b/build/DependencyVersions.props index 7dec2bd7e..9d8e3ee7b 100644 --- a/build/DependencyVersions.props +++ b/build/DependencyVersions.props @@ -3,35 +3,16 @@ 2.0.1 15.4.7 - 2.3.2-beta1-61921-05 - 2.3.0-pre-20170727-1 - 1.6.0-beta2-25304 - 4.2.0-rc-170630-0 - 4.4.1-pre-20170727-1 - - - 2.0.1-servicing-20170926-1 - $(CLI_NETSDK_Version) - 4.4.0-preview3-4475 - 2.0.0-preview3-25514-04 - 2.0.0-rel-20170908-653 - 15.3.0-preview-20170628-02 + + 2.0.3-servicing-007004 $(CLI_SharedFrameworkVersion) $(CLI_SharedFrameworkVersion) $(CLI_SharedFrameworkVersion) - 1.0.0-beta2-20170810-304 1.0.0-beta2-20170810-304 1.0.0-beta2-20170810-304 - 2.0.0 - 2.0.0 - 0.1.1-alpha-167 - 1.2.1-alpha-002133 0.2.0 1.0.417 - 0.2.0-beta-000042 notimestamp @@ -44,6 +25,9 @@ aspnetcore-store $(AspNetCoreVersion)-$(AspNetCoreRelease) $(AspNetCoreBranchName)-$(AspNetCoreRuntimePackageTimestamp) + + 0.1.1-alpha-167 + 2.1.0-preview1-25806-02 diff --git a/build/MSBuildExtensions.props b/build/MSBuildExtensions.props deleted file mode 100644 index 26f27e8c4..000000000 --- a/build/MSBuildExtensions.props +++ /dev/null @@ -1,9 +0,0 @@ - - - $(RepoRoot)/resources/MSBuildImports - - - - - - diff --git a/build/MSBuildExtensions.targets b/build/MSBuildExtensions.targets deleted file mode 100644 index e24b2225b..000000000 --- a/build/MSBuildExtensions.targets +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(MSBuildExtensionsLayoutDirectory)/%(VSMSBuildExtensionsContent.DeploymentSubpath)%(RecursiveDir)%(Filename)%(Extension) - - - - - - - - - Microsoft.NET.Build.Extensions - 15.0 - $(NuGetPackagesDir)/$(MSBuildExtensionsPackageName.ToLower())/$(CLI_MSBuildExtensions_Version.ToLower()) - - NETStandard.Library.NETFramework - $(NuGetPackagesDir)/$(NETStandardLibraryNETFrameworkPackageName.ToLower())/$(CLI_NETStandardLibraryNETFrameworkVersion.ToLower()) - - - - - - - - - - - CLIBuildDll=$(CLIBuildDll); - NuGetPackagesDir=$(NuGetPackagesDir); - DependencyPackageName=%(ExtensionPackageToRestore.Identity); - DependencyPackageVersion=%(ExtensionPackageToRestore.Version); - PreviousStageDirectory=$(PreviousStageDirectory) - - - - - - - - - - - Microsoft.NETCoreSdk.BundledVersions.props - - - - - <_NETStandardLibraryVersions Include="@(PackageDefinitions->'%(Version)')" - Condition="%(PackageDefinitions.Name) == 'NetStandard.Library'" /> - - - - - - <_NETCoreAppPackageVersion>$(CLI_SharedFrameworkVersion) - <_NETStandardPackageVersion>@(_NETStandardLibraryVersions->Distinct()) - - - <_NETCoreAppTargetFrameworkVersion>$(_NETCoreAppPackageVersion.Split('.')[0]).$(_NETCoreAppPackageVersion.Split('.')[1]) - <_NETStandardTargetFrameworkVersion>$(_NETStandardPackageVersion.Split('.')[0]).$(_NETStandardPackageVersion.Split('.')[1]) - - - - - - $(_NETCoreAppTargetFrameworkVersion) - $(_NETCoreAppPackageVersion) - $(_NETStandardTargetFrameworkVersion) - $(_NETStandardPackageVersion) - - -]]> - - - - - - - diff --git a/build/OutputDirectories.props b/build/OutputDirectories.props index 3f2121980..2edc9734b 100644 --- a/build/OutputDirectories.props +++ b/build/OutputDirectories.props @@ -12,7 +12,8 @@ $([System.IO.Path]::GetFullPath('$(BaseOutputDirectory)/obj/$(MSBuildProjectName)')) $(BaseOutputDirectory)/dotnet $(BaseOutputDirectory)/dotnetWithBackwardsCompatibleRuntimes - $(OutputDirectory)/sdk/$(SdkVersion) + + $(OutputDirectory)/sdk/$(ToolsetVersion) $(BaseOutputDirectory)/symbols $(SdkOutputDirectory)/Roslyn $(SdkOutputDirectory)/FSharp @@ -20,6 +21,7 @@ $(BaseOutputDirectory)/intermediate $(BaseOutputDirectory)/packages $(IntermediateDirectory)/sharedFrameworkPublish + $(IntermediateDirectory)/toolsetPublish $(BaseOutputDirectory)/AspRT $(IntermediateDirectory)/backwardsCompatibleSharedFrameworksPublish diff --git a/build/Package.targets b/build/Package.targets index 8896bdb1f..6d324830d 100644 --- a/build/Package.targets +++ b/build/Package.targets @@ -2,7 +2,6 @@ - @@ -16,7 +15,6 @@ DependsOnTargets="BuildDotnetCliBuildFramework; Init; Layout; - GenerateNugetPackages; GenerateArchives; GenerateInstallers" /> diff --git a/build/Prepare.targets b/build/Prepare.targets index 3b373ecfc..df136668e 100644 --- a/build/Prepare.targets +++ b/build/Prepare.targets @@ -4,7 +4,7 @@ + DependsOnTargets="Init;DownloadHostAndSharedFxArtifacts;DownloadToolsetArtifacts;RestoreSrcPackages;RestoreToolsPackages;IsolateArtifactsFromDirectoryBuildFiles;CreatePropsForNextStage" /> + + + - $(LayoutDirectory)/$(ArtifactNameSdkDebug) $(LayoutDirectory)/$(ArtifactNameCombinedHostHostFxrFrameworkSdk) - $(LayoutDirectory)/$(ArtifactNameSdkLanguagePack) - *.resources.dll - .*.resources.dll - - - - - - - - - - - - - - - - - - - - @@ -70,13 +38,6 @@ $(ArtifactNameSdk) - - @(SdkDebugLayoutInput) - @(SdkDebugRelativeOutputFiles -> '$(SdkDebugLayoutOutputDirectory)/%(Identity)') - $(ArtifactNameWithVersionSdkDebug) - $(ArtifactNameSdkDebug) - - @(CombinedHostHostFxrFrameworkSdkInput) @(CombinedHostHostFxrFrameworkSdkRelativeOutputFiles -> '$(CombinedHostHostFxrFrameworkSdkOutputDirectory)/%(Identity)') @@ -85,20 +46,6 @@ $(WindowsSatelliteAssembliesRegEx) $(SatelliteAssemblies) - - - @(SdkLanguagePackInput) - @(SdkLanguagePackRelativeOutputFiles -> '$(SdkLanguagePackOutputDirectory)/%(Identity)') - $(ArtifactNameWithVersionSdkLanguagePack) - $(ArtifactNameSdkLanguagePack) - - - - - - @(CombinedMSBuildExtensionsInput) - @(CombinedMSBuildExtensionsRelativeOutputFiles -> '$(MSBuildExtensionsOutputDirectory)/%(Identity)') - diff --git a/build/package/Nupkg.targets b/build/package/Nupkg.targets deleted file mode 100644 index d7287c8b7..000000000 --- a/build/package/Nupkg.targets +++ /dev/null @@ -1,41 +0,0 @@ - - - - $(CompilationDirectory)/forPackaging - - - - - - Microsoft.DotNet.Cli.Utils - $(SdkNugetVersion) - - - Microsoft.DotNet.MSBuildSdkResolver - $(SdkNugetVersion) - - - - - - - - - - - - - - - - diff --git a/build/sdks/sdks.csproj b/build/sdks/sdks.csproj deleted file mode 100755 index f246e1f9d..000000000 --- a/build/sdks/sdks.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Library - netcoreapp1.0 - false - - - - - - - - - diff --git a/build/test/TestPackageProjects.targets b/build/test/TestPackageProjects.targets index fea46690c..c77244ad5 100644 --- a/build/test/TestPackageProjects.targets +++ b/build/test/TestPackageProjects.targets @@ -20,55 +20,6 @@ - - Microsoft.DotNet.Cli.Utils - Microsoft.DotNet.Cli.Utils.csproj - True - True - $(CliVersionPrefix) - $(VersionSuffix) - False - - - Microsoft.DotNet.Cli.Utils - Microsoft.DotNet.Cli.Utils.csproj - True - True - $(CliVersionPrefix) - $(VersionSuffix) - False - /p:TargetFramework=netstandard1.5 - - - Microsoft.DotNet.InternalAbstractions - Microsoft.DotNet.InternalAbstractions.csproj - True - True - 2.0.0 - $(VersionSuffix) - False - - - PackageWithFakeNativeDep - PackageWithFakeNativeDep.csproj - False - True - 1.0.0 - - True - - - dotnet-dependency-context-test - dotnet-dependency-context-test.csproj - True - True - $(CliVersionPrefix) - $(VersionSuffix) - True - dotnet-dependency-tool-invoker dotnet-dependency-tool-invoker.csproj @@ -78,54 +29,6 @@ $(VersionSuffix) True - - dotnet-desktop-and-portable - dotnet-desktop-and-portable.csproj - True - True - $(CliVersionPrefix) - $(VersionSuffix) - True - - - dotnet-desktop-binding-redirects - dotnet-desktop-binding-redirects.csproj - True - True - $(DesktopAvailable) - $(CliVersionPrefix) - $(VersionSuffix) - True - - - dotnet-hello - dotnet-hello.csproj - True - True - 1.0.0 - - True - - - dotnet-hello - dotnet-hello.csproj - True - True - 2.0.0 - - True - - - dotnet-outputsframeworkversion-netcoreapp1.0 - dotnet-outputsframeworkversion-netcoreapp1.0.csproj - True - True - 1.0.0 - - True - dotnet-portable dotnet-portable.csproj @@ -135,33 +38,6 @@ True - - dotnet-portable - dotnet-portable-v1.csproj - True - True - 1.0.0 - - True - - - dotnet-portable - dotnet-portable-v1-prefercli.csproj - True - True - 1.0.0 - - True - - - dotnet-fallbackfoldertool - dotnet-fallbackfoldertool.csproj - True - True - 1.0.0 - - True - dotnet-prefercliruntime dotnet-prefercliruntime.csproj @@ -171,16 +47,6 @@ True - - dotnet-tool-with-output-name - ToolWithOutputName.csproj - ToolWithOutputName - True - True - 1.0.0 - - True - $(RepoRoot)%(Identity)/ diff --git a/build/test/TestProjects.targets b/build/test/TestProjects.targets index 20045c923..7af148240 100644 --- a/build/test/TestProjects.targets +++ b/build/test/TestProjects.targets @@ -6,20 +6,9 @@ - - - - - + Include="test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj; + test/Microsoft.DotNet.TestFramework/Microsoft.DotNet.TestFramework.csproj" /> diff --git a/global.json b/global.json deleted file mode 100644 index 79c8d8d60..000000000 --- a/global.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "projects": [ "src", "test", "tools", "build_projects" ] -} diff --git a/resources/MSBuild.exe.config b/resources/MSBuild.exe.config deleted file mode 100644 index 76d340ed2..000000000 --- a/resources/MSBuild.exe.config +++ /dev/null @@ -1,75 +0,0 @@ - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/MSBuildImports/15.0/Microsoft.Common.CrossTargeting.targets/ImportAfter/Microsoft.TestPlatform.CrossTargeting.targets b/resources/MSBuildImports/15.0/Microsoft.Common.CrossTargeting.targets/ImportAfter/Microsoft.TestPlatform.CrossTargeting.targets deleted file mode 100644 index 0b4916558..000000000 --- a/resources/MSBuildImports/15.0/Microsoft.Common.CrossTargeting.targets/ImportAfter/Microsoft.TestPlatform.CrossTargeting.targets +++ /dev/null @@ -1,84 +0,0 @@ - - - - $(MSBuildExtensionsPath)\Microsoft.TestPlatform.Build.dll - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - - - - <_TargetFramework Include="$(TargetFrameworks)" /> - - - - - - - - - - - - - - - - - - - - - - VSTest - - - diff --git a/resources/MSBuildImports/15.0/Microsoft.Common.targets/ImportAfter/Microsoft.NuGet.ImportAfter.targets b/resources/MSBuildImports/15.0/Microsoft.Common.targets/ImportAfter/Microsoft.NuGet.ImportAfter.targets deleted file mode 100644 index 433922aac..000000000 --- a/resources/MSBuildImports/15.0/Microsoft.Common.targets/ImportAfter/Microsoft.NuGet.ImportAfter.targets +++ /dev/null @@ -1,18 +0,0 @@ - - - - - $(MSBuildExtensionsPath)\NuGet.targets - - - diff --git a/resources/MSBuildImports/15.0/Microsoft.Common.targets/ImportAfter/Microsoft.TestPlatform.ImportAfter.targets b/resources/MSBuildImports/15.0/Microsoft.Common.targets/ImportAfter/Microsoft.TestPlatform.ImportAfter.targets deleted file mode 100644 index d1572027e..000000000 --- a/resources/MSBuildImports/15.0/Microsoft.Common.targets/ImportAfter/Microsoft.TestPlatform.ImportAfter.targets +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - $(MSBuildExtensionsPath)\Microsoft.TestPlatform.targets - - - diff --git a/resources/MSBuildImports/15.0/SolutionFile/ImportAfter/Microsoft.NuGet.ImportAfter.targets b/resources/MSBuildImports/15.0/SolutionFile/ImportAfter/Microsoft.NuGet.ImportAfter.targets deleted file mode 100644 index 433922aac..000000000 --- a/resources/MSBuildImports/15.0/SolutionFile/ImportAfter/Microsoft.NuGet.ImportAfter.targets +++ /dev/null @@ -1,18 +0,0 @@ - - - - - $(MSBuildExtensionsPath)\NuGet.targets - - - diff --git a/run-build.ps1 b/run-build.ps1 index 6acbb15ce..f3eba115e 100644 --- a/run-build.ps1 +++ b/run-build.ps1 @@ -66,7 +66,8 @@ $env:VSTEST_BUILD_TRACE=1 $env:VSTEST_TRACE_BUILD=1 # install a stage0 -$dotnetInstallPath = Join-Path $RepoRoot "scripts\obtain\dotnet-install.ps1" +$dotnetInstallPath = Join-Path $RepoRoot "bin\dotnet-install.ps1" +Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile "$dotnetInstallPath" Write-Output "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" Invoke-Expression "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" diff --git a/run-build.sh b/run-build.sh index 0dce787e9..4e480e4ce 100755 --- a/run-build.sh +++ b/run-build.sh @@ -150,7 +150,7 @@ 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) +curl -sSL "https://dot.net/v1/dotnet-install.sh" | bash /dev/stdin --channel "release/2.0.0" --install-dir "$DOTNET_INSTALL_DIR" --architecture "$ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS EXIT_CODE=$? if [ $EXIT_CODE != 0 ]; then diff --git a/scripts/obtain/dotnet-install.ps1 b/scripts/obtain/dotnet-install.ps1 deleted file mode 100644 index 89e6e74d8..000000000 --- a/scripts/obtain/dotnet-install.ps1 +++ /dev/null @@ -1,510 +0,0 @@ -# -# Copyright (c) .NET Foundation and contributors. All rights reserved. -# Licensed under the MIT license. See LICENSE file in the project root for full license information. -# - -<# -.SYNOPSIS - Installs dotnet cli -.DESCRIPTION - Installs dotnet cli. If dotnet installation already exists in the given directory - it will update it only if the requested version differs from the one already installed. -.PARAMETER Channel - Default: LTS - Download from the Channel specified. Possible values: - - Current - most current release - - LTS - most current supported release - - 2-part version in a format A.B - represents a specific release - examples: 2.0; 1.0 - - Branch name - examples: release/2.0.0; Master -.PARAMETER Version - Default: latest - Represents a build version on specific channel. Possible values: - - latest - most latest build on specific channel - - coherent - most latest coherent build on specific channel - coherent applies only to SDK downloads - - 3-part version in a format A.B.C - represents specific version of build - examples: 2.0.0-preview2-006120; 1.1.0 -.PARAMETER InstallDir - Default: %LocalAppData%\Microsoft\dotnet - Path to where to install dotnet. Note that binaries will be placed directly in a given directory. -.PARAMETER Architecture - Default: - this value represents currently running OS architecture - Architecture of dotnet binaries to be installed. - Possible values are: , x64 and x86 -.PARAMETER SharedRuntime - Default: false - Installs just the shared runtime bits, not the entire SDK -.PARAMETER DryRun - If set it will not perform installation but instead display what command line to use to consistently install - currently requested version of dotnet cli. In example if you specify version 'latest' it will display a link - with specific version so that this command can be used deterministicly in a build script. - It also displays binaries location if you prefer to install or download it yourself. -.PARAMETER NoPath - By default this script will set environment variable PATH for the current process to the binaries folder inside installation folder. - If set it will display binaries location but not set any environment variable. -.PARAMETER Verbose - Displays diagnostics information. -.PARAMETER AzureFeed - Default: https://dotnetcli.azureedge.net/dotnet - This parameter typically is not changed by the user. - It allows to change URL for the Azure feed used by this installer. -.PARAMETER UncachedFeed - This parameter typically is not changed by the user. - It allows to change URL for the Uncached feed used by this installer. -.PARAMETER ProxyAddress - If set, the installer will use the proxy when making web requests -.PARAMETER ProxyUseDefaultCredentials - Default: false - Use default credentials, when using proxy address. -.PARAMETER SkipNonVersionedFiles - Default: false - Skips installing non-versioned files if they already exist, such as dotnet.exe. -#> -[cmdletbinding()] -param( - [string]$Channel="LTS", - [string]$Version="Latest", - [string]$InstallDir="", - [string]$Architecture="", - [switch]$SharedRuntime, - [switch]$DryRun, - [switch]$NoPath, - [string]$AzureFeed="https://dotnetcli.azureedge.net/dotnet", - [string]$UncachedFeed="https://dotnetcli.blob.core.windows.net/dotnet", - [string]$ProxyAddress, - [switch]$ProxyUseDefaultCredentials, - [switch]$SkipNonVersionedFiles -) - -Set-StrictMode -Version Latest -$ErrorActionPreference="Stop" -$ProgressPreference="SilentlyContinue" - -$BinFolderRelativePath="" - -# example path with regex: shared/1.0.0-beta-12345/somepath -$VersionRegEx="/\d+\.\d+[^/]+/" -$OverrideNonVersionedFiles = !$SkipNonVersionedFiles - -function Say($str) { - Write-Host "dotnet-install: $str" -} - -function Say-Verbose($str) { - Write-Verbose "dotnet-install: $str" -} - -function Say-Invocation($Invocation) { - $command = $Invocation.MyCommand; - $args = (($Invocation.BoundParameters.Keys | foreach { "-$_ `"$($Invocation.BoundParameters[$_])`"" }) -join " ") - Say-Verbose "$command $args" -} - -function Invoke-With-Retry([ScriptBlock]$ScriptBlock, [int]$MaxAttempts = 3, [int]$SecondsBetweenAttempts = 1) { - $Attempts = 0 - - while ($true) { - try { - return $ScriptBlock.Invoke() - } - catch { - $Attempts++ - if ($Attempts -lt $MaxAttempts) { - Start-Sleep $SecondsBetweenAttempts - } - else { - throw - } - } - } -} - -function Get-Machine-Architecture() { - Say-Invocation $MyInvocation - - # possible values: AMD64, IA64, x86 - return $ENV:PROCESSOR_ARCHITECTURE -} - -# TODO: Architecture and CLIArchitecture should be unified -function Get-CLIArchitecture-From-Architecture([string]$Architecture) { - Say-Invocation $MyInvocation - - switch ($Architecture.ToLower()) { - { $_ -eq "" } { return Get-CLIArchitecture-From-Architecture $(Get-Machine-Architecture) } - { ($_ -eq "amd64") -or ($_ -eq "x64") } { return "x64" } - { $_ -eq "x86" } { return "x86" } - default { throw "Architecture not supported. If you think this is a bug, please report it at https://github.com/dotnet/cli/issues" } - } -} - -function Get-Version-Info-From-Version-Text([string]$VersionText) { - Say-Invocation $MyInvocation - - $Data = @($VersionText.Split([char[]]@(), [StringSplitOptions]::RemoveEmptyEntries)); - - $VersionInfo = @{} - $VersionInfo.CommitHash = $Data[0].Trim() - $VersionInfo.Version = $Data[1].Trim() - return $VersionInfo -} - -function Load-Assembly([string] $Assembly) { - try { - Add-Type -Assembly $Assembly | Out-Null - } - catch { - # On Nano Server, Powershell Core Edition is used. Add-Type is unable to resolve base class assemblies because they are not GAC'd. - # Loading the base class assemblies is not unnecessary as the types will automatically get resolved. - } -} - -function GetHTTPResponse([Uri] $Uri) -{ - Invoke-With-Retry( - { - - $HttpClient = $null - - try { - # HttpClient is used vs Invoke-WebRequest in order to support Nano Server which doesn't support the Invoke-WebRequest cmdlet. - Load-Assembly -Assembly System.Net.Http - - if(-not $ProxyAddress) { - try { - # Despite no proxy being explicitly specified, we may still be behind a default proxy - $DefaultProxy = [System.Net.WebRequest]::DefaultWebProxy; - if($DefaultProxy -and (-not $DefaultProxy.IsBypassed($Uri))) { - $ProxyAddress = $DefaultProxy.GetProxy($Uri).OriginalString - $ProxyUseDefaultCredentials = $true - } - } catch { - # Eat the exception and move forward as the above code is an attempt - # at resolving the DefaultProxy that may not have been a problem. - $ProxyAddress = $null - Say-Verbose("Exception ignored: $_.Exception.Message - moving forward...") - } - } - - if($ProxyAddress) { - $HttpClientHandler = New-Object System.Net.Http.HttpClientHandler - $HttpClientHandler.Proxy = New-Object System.Net.WebProxy -Property @{Address=$ProxyAddress;UseDefaultCredentials=$ProxyUseDefaultCredentials} - $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 - # 10 minutes allows it to work over much slower connections. - $HttpClient.Timeout = New-TimeSpan -Minutes 10 - $Response = $HttpClient.GetAsync($Uri).Result - if (($Response -eq $null) -or (-not ($Response.IsSuccessStatusCode))) { - $ErrorMsg = "Failed to download $Uri." - if ($Response -ne $null) { - $ErrorMsg += " $Response" - } - - throw $ErrorMsg - } - - return $Response - } - finally { - if ($HttpClient -ne $null) { - $HttpClient.Dispose() - } - } - }) -} - - -function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel, [bool]$Coherent) { - Say-Invocation $MyInvocation - - $VersionFileUrl = $null - if ($SharedRuntime) { - $VersionFileUrl = "$UncachedFeed/Runtime/$Channel/latest.version" - } - else { - if ($Coherent) { - $VersionFileUrl = "$UncachedFeed/Sdk/$Channel/latest.coherent.version" - } - else { - $VersionFileUrl = "$UncachedFeed/Sdk/$Channel/latest.version" - } - } - - $Response = GetHTTPResponse -Uri $VersionFileUrl - $StringContent = $Response.Content.ReadAsStringAsync().Result - - switch ($Response.Content.Headers.ContentType) { - { ($_ -eq "application/octet-stream") } { $VersionText = $StringContent } - { ($_ -eq "text/plain") } { $VersionText = $StringContent } - { ($_ -eq "text/plain; charset=UTF-8") } { $VersionText = $StringContent } - default { throw "``$Response.Content.Headers.ContentType`` is an unknown .version file content type." } - } - - $VersionInfo = Get-Version-Info-From-Version-Text $VersionText - - return $VersionInfo -} - - -function Get-Specific-Version-From-Version([string]$AzureFeed, [string]$Channel, [string]$Version) { - Say-Invocation $MyInvocation - - switch ($Version.ToLower()) { - { $_ -eq "latest" } { - $LatestVersionInfo = Get-Latest-Version-Info -AzureFeed $AzureFeed -Channel $Channel -Coherent $False - return $LatestVersionInfo.Version - } - { $_ -eq "coherent" } { - $LatestVersionInfo = Get-Latest-Version-Info -AzureFeed $AzureFeed -Channel $Channel -Coherent $True - return $LatestVersionInfo.Version - } - default { return $Version } - } -} - -function Get-Download-Link([string]$AzureFeed, [string]$SpecificVersion, [string]$CLIArchitecture) { - Say-Invocation $MyInvocation - - if ($SharedRuntime) { - $PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/dotnet-runtime-$SpecificVersion-win-$CLIArchitecture.zip" - } - else { - $PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-sdk-$SpecificVersion-win-$CLIArchitecture.zip" - } - - Say-Verbose "Constructed primary payload URL: $PayloadURL" - - return $PayloadURL -} - -function Get-LegacyDownload-Link([string]$AzureFeed, [string]$SpecificVersion, [string]$CLIArchitecture) { - Say-Invocation $MyInvocation - - if ($SharedRuntime) { - $PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/dotnet-win-$CLIArchitecture.$SpecificVersion.zip" - } - else { - $PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-dev-win-$CLIArchitecture.$SpecificVersion.zip" - } - - Say-Verbose "Constructed legacy payload URL: $PayloadURL" - - return $PayloadURL -} - -function Get-User-Share-Path() { - Say-Invocation $MyInvocation - - $InstallRoot = $env:DOTNET_INSTALL_DIR - if (!$InstallRoot) { - $InstallRoot = "$env:LocalAppData\Microsoft\dotnet" - } - return $InstallRoot -} - -function Resolve-Installation-Path([string]$InstallDir) { - Say-Invocation $MyInvocation - - if ($InstallDir -eq "") { - return Get-User-Share-Path - } - return $InstallDir -} - -function Get-Version-Info-From-Version-File([string]$InstallRoot, [string]$RelativePathToVersionFile) { - Say-Invocation $MyInvocation - - $VersionFile = Join-Path -Path $InstallRoot -ChildPath $RelativePathToVersionFile - Say-Verbose "Local version file: $VersionFile" - - if (Test-Path $VersionFile) { - $VersionText = cat $VersionFile - Say-Verbose "Local version file text: $VersionText" - return Get-Version-Info-From-Version-Text $VersionText - } - - Say-Verbose "Local version file not found." - - return $null -} - -function Is-Dotnet-Package-Installed([string]$InstallRoot, [string]$RelativePathToPackage, [string]$SpecificVersion) { - Say-Invocation $MyInvocation - - $DotnetPackagePath = Join-Path -Path $InstallRoot -ChildPath $RelativePathToPackage | Join-Path -ChildPath $SpecificVersion - Say-Verbose "Is-Dotnet-Package-Installed: Path to a package: $DotnetPackagePath" - return Test-Path $DotnetPackagePath -PathType Container -} - -function Get-Absolute-Path([string]$RelativeOrAbsolutePath) { - # Too much spam - # Say-Invocation $MyInvocation - - return $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($RelativeOrAbsolutePath) -} - -function Get-Path-Prefix-With-Version($path) { - $match = [regex]::match($path, $VersionRegEx) - if ($match.Success) { - return $entry.FullName.Substring(0, $match.Index + $match.Length) - } - - return $null -} - -function Get-List-Of-Directories-And-Versions-To-Unpack-From-Dotnet-Package([System.IO.Compression.ZipArchive]$Zip, [string]$OutPath) { - Say-Invocation $MyInvocation - - $ret = @() - foreach ($entry in $Zip.Entries) { - $dir = Get-Path-Prefix-With-Version $entry.FullName - if ($dir -ne $null) { - $path = Get-Absolute-Path $(Join-Path -Path $OutPath -ChildPath $dir) - if (-Not (Test-Path $path -PathType Container)) { - $ret += $dir - } - } - } - - $ret = $ret | Sort-Object | Get-Unique - - $values = ($ret | foreach { "$_" }) -join ";" - Say-Verbose "Directories to unpack: $values" - - return $ret -} - -# Example zip content and extraction algorithm: -# Rule: files if extracted are always being extracted to the same relative path locally -# .\ -# a.exe # file does not exist locally, extract -# b.dll # file exists locally, override only if $OverrideFiles set -# aaa\ # same rules as for files -# ... -# abc\1.0.0\ # directory contains version and exists locally -# ... # do not extract content under versioned part -# abc\asd\ # same rules as for files -# ... -# def\ghi\1.0.1\ # directory contains version and does not exist locally -# ... # extract content -function Extract-Dotnet-Package([string]$ZipPath, [string]$OutPath) { - Say-Invocation $MyInvocation - - Load-Assembly -Assembly System.IO.Compression.FileSystem - Set-Variable -Name Zip - try { - $Zip = [System.IO.Compression.ZipFile]::OpenRead($ZipPath) - - $DirectoriesToUnpack = Get-List-Of-Directories-And-Versions-To-Unpack-From-Dotnet-Package -Zip $Zip -OutPath $OutPath - - foreach ($entry in $Zip.Entries) { - $PathWithVersion = Get-Path-Prefix-With-Version $entry.FullName - if (($PathWithVersion -eq $null) -Or ($DirectoriesToUnpack -contains $PathWithVersion)) { - $DestinationPath = Get-Absolute-Path $(Join-Path -Path $OutPath -ChildPath $entry.FullName) - $DestinationDir = Split-Path -Parent $DestinationPath - $OverrideFiles=$OverrideNonVersionedFiles -Or (-Not (Test-Path $DestinationPath)) - if ((-Not $DestinationPath.EndsWith("\")) -And $OverrideFiles) { - New-Item -ItemType Directory -Force -Path $DestinationDir | Out-Null - [System.IO.Compression.ZipFileExtensions]::ExtractToFile($entry, $DestinationPath, $OverrideNonVersionedFiles) - } - } - } - } - finally { - if ($Zip -ne $null) { - $Zip.Dispose() - } - } -} - -function DownloadFile([Uri]$Uri, [string]$OutPath) { - $Stream = $null - - try { - $Response = GetHTTPResponse -Uri $Uri - $Stream = $Response.Content.ReadAsStreamAsync().Result - $File = [System.IO.File]::Create($OutPath) - $Stream.CopyTo($File) - $File.Close() - } - finally { - if ($Stream -ne $null) { - $Stream.Dispose() - } - } -} - -function Prepend-Sdk-InstallRoot-To-Path([string]$InstallRoot, [string]$BinFolderRelativePath) { - $BinPath = Get-Absolute-Path $(Join-Path -Path $InstallRoot -ChildPath $BinFolderRelativePath) - if (-Not $NoPath) { - Say "Adding to current process PATH: `"$BinPath`". Note: This change will not be visible if PowerShell was run as a child process." - $env:path = "$BinPath;" + $env:path - } - else { - Say "Binaries of dotnet can be found in $BinPath" - } -} - -$CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture -$SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -Channel $Channel -Version $Version -$DownloadLink = Get-Download-Link -AzureFeed $AzureFeed -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture -$LegacyDownloadLink = Get-LegacyDownload-Link -AzureFeed $AzureFeed -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture - -if ($DryRun) { - Say "Payload URLs:" - Say "Primary - $DownloadLink" - Say "Legacy - $LegacyDownloadLink" - Say "Repeatable invocation: .\$($MyInvocation.Line)" - exit 0 -} - -$InstallRoot = Resolve-Installation-Path $InstallDir -Say-Verbose "InstallRoot: $InstallRoot" - -$IsSdkInstalled = Is-Dotnet-Package-Installed -InstallRoot $InstallRoot -RelativePathToPackage "sdk" -SpecificVersion $SpecificVersion -Say-Verbose ".NET SDK installed? $IsSdkInstalled" -if ($IsSdkInstalled) { - Say ".NET SDK version $SpecificVersion is already installed." - Prepend-Sdk-InstallRoot-To-Path -InstallRoot $InstallRoot -BinFolderRelativePath $BinFolderRelativePath - exit 0 -} - -New-Item -ItemType Directory -Force -Path $InstallRoot | Out-Null - -$installDrive = $((Get-Item $InstallRoot).PSDrive.Name); -$free = Get-CimInstance -Class win32_logicaldisk | where Deviceid -eq "${installDrive}:" -if ($free.Freespace / 1MB -le 100 ) { - Say "There is not enough disk space on drive ${installDrive}:" - exit 0 -} - -$ZipPath = [System.IO.Path]::combine([System.IO.Path]::GetTempPath(), [System.IO.Path]::GetRandomFileName()) -Say-Verbose "Zip path: $ZipPath" -Say "Downloading link: $DownloadLink" -try { - DownloadFile -Uri $DownloadLink -OutPath $ZipPath -} -catch { - Say "Cannot download: $DownloadLink" - $DownloadLink = $LegacyDownloadLink - $ZipPath = [System.IO.Path]::combine([System.IO.Path]::GetTempPath(), [System.IO.Path]::GetRandomFileName()) - Say-Verbose "Legacy zip path: $ZipPath" - Say "Downloading legacy link: $DownloadLink" - DownloadFile -Uri $DownloadLink -OutPath $ZipPath -} - -Say "Extracting zip from $DownloadLink" -Extract-Dotnet-Package -ZipPath $ZipPath -OutPath $InstallRoot - -Remove-Item $ZipPath - -Prepend-Sdk-InstallRoot-To-Path -InstallRoot $InstallRoot -BinFolderRelativePath $BinFolderRelativePath - -Say "Installation finished" -exit 0 diff --git a/scripts/obtain/dotnet-install.sh b/scripts/obtain/dotnet-install.sh deleted file mode 100755 index a3a7b6ed8..000000000 --- a/scripts/obtain/dotnet-install.sh +++ /dev/null @@ -1,848 +0,0 @@ -#!/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. -# - -# Stop script on NZEC -set -e -# Stop script if unbound variable found (use ${var:-} if intentional) -set -u -# By default cmd1 | cmd2 returns exit code of cmd2 regardless of cmd1 success -# This is causing it to fail -set -o pipefail - -# Use in the the functions: eval $invocation -invocation='say_verbose "Calling: ${yellow:-}${FUNCNAME[0]} ${green:-}$*${normal:-}"' - -# standard output may be used as a return value in the functions -# we need a way to write text on the screen in the functions so that -# it won't interfere with the return value. -# Exposing stream 3 as a pipe to standard output of the script itself -exec 3>&1 - -# Setup some colors to use. These need to work in fairly limited shells, like the Ubuntu Docker container where there are only 8 colors. -# See if stdout is a terminal -if [ -t 1 ]; then - # see if it supports colors - ncolors=$(tput colors) - if [ -n "$ncolors" ] && [ $ncolors -ge 8 ]; then - bold="$(tput bold || echo)" - normal="$(tput sgr0 || echo)" - black="$(tput setaf 0 || echo)" - red="$(tput setaf 1 || echo)" - green="$(tput setaf 2 || echo)" - yellow="$(tput setaf 3 || echo)" - blue="$(tput setaf 4 || echo)" - magenta="$(tput setaf 5 || echo)" - cyan="$(tput setaf 6 || echo)" - white="$(tput setaf 7 || echo)" - fi -fi - -say_err() { - printf "%b\n" "${red:-}dotnet_install: Error: $1${normal:-}" >&2 -} - -say() { - # using stream 3 (defined in the beginning) to not interfere with stdout of functions - # which may be used as return value - printf "%b\n" "${cyan:-}dotnet-install:${normal:-} $1" >&3 -} - -say_verbose() { - if [ "$verbose" = true ]; then - say "$1" - fi -} - -# This platform list is finite - if the SDK/Runtime has supported Linux distribution-specific assets, -# then and only then should the Linux distribution appear in this list. -# Adding a Linux distribution to this list does not imply distribution-specific support. -get_os_download_name_from_platform() { - eval $invocation - - platform="$1" - case "$platform" in - "centos.7") - echo "centos" - return 0 - ;; - "debian.8") - echo "debian" - return 0 - ;; - "fedora.23") - echo "fedora.23" - return 0 - ;; - "fedora.24") - echo "fedora.24" - return 0 - ;; - "opensuse.13.2") - echo "opensuse.13.2" - return 0 - ;; - "opensuse.42.1") - echo "opensuse.42.1" - return 0 - ;; - "rhel.6"*) - echo "rhel.6" - return 0 - ;; - "rhel.7"*) - echo "rhel" - return 0 - ;; - "ubuntu.14.04") - echo "ubuntu" - return 0 - ;; - "ubuntu.16.04") - echo "ubuntu.16.04" - return 0 - ;; - "ubuntu.16.10") - echo "ubuntu.16.10" - return 0 - ;; - "alpine.3.4.3") - echo "alpine" - return 0 - ;; - esac - return 1 -} - -get_current_os_name() { - eval $invocation - - local uname=$(uname) - if [ "$uname" = "Darwin" ]; then - echo "osx" - return 0 - elif [ "$uname" = "Linux" ]; then - local distro_specific_osname - distro_specific_osname=$(get_distro_specific_os_name) || return 1 - - if [ "$distro_specific_osname" = "rhel.6" ]; then - echo $distro_specific_osname - return 0 - else - echo "linux" - return 0 - fi - fi - - say_err "OS name could not be detected: $ID.$VERSION_ID" - return 1 -} - -get_distro_specific_os_name() { - eval $invocation - - local uname=$(uname) - if [ "$uname" = "Darwin" ]; then - echo "osx" - return 0 - elif [ -n "$runtime_id" ]; then - echo $(get_os_download_name_from_platform "${runtime_id%-*}" || echo "${runtime_id%-*}") - return 0 - else - if [ -e /etc/os-release ]; then - . /etc/os-release - os=$(get_os_download_name_from_platform "$ID.$VERSION_ID" || echo "") - if [ -n "$os" ]; then - echo "$os" - return 0 - fi - elif [ -e /etc/redhat-release ]; then - local redhatRelease=$( /dev/null 2>&1 - return $? -} - - -check_min_reqs() { - local hasMinimum=false - if machine_has "curl"; then - hasMinimum=true - elif machine_has "wget"; then - hasMinimum=true - fi - - if [ "$hasMinimum" = "false" ]; then - say_err "curl (recommended) or wget are required to download dotnet. Install missing prerequisite to proceed." - return 1 - fi - return 0 -} - -check_pre_reqs() { - eval $invocation - - local failing=false; - - if [ "${DOTNET_INSTALL_SKIP_PREREQS:-}" = "1" ]; then - return 0 - fi - - if [ "$(uname)" = "Linux" ]; then - if ! [ -x "$(command -v ldconfig)" ]; then - echo "ldconfig is not in PATH, trying /sbin/ldconfig." - LDCONFIG_COMMAND="/sbin/ldconfig" - else - LDCONFIG_COMMAND="ldconfig" - fi - - local librarypath=${LD_LIBRARY_PATH:-} - LDCONFIG_COMMAND="$LDCONFIG_COMMAND -NXv ${librarypath//:/ }" - - [ -z "$($LDCONFIG_COMMAND | grep libunwind)" ] && say_err "Unable to locate libunwind. Install libunwind to continue" && failing=true - [ -z "$($LDCONFIG_COMMAND | grep libssl)" ] && say_err "Unable to locate libssl. Install libssl to continue" && failing=true - [ -z "$($LDCONFIG_COMMAND | grep libicu)" ] && say_err "Unable to locate libicu. Install libicu to continue" && failing=true - [ -z "$($LDCONFIG_COMMAND | grep -F libcurl.so)" ] && say_err "Unable to locate libcurl. Install libcurl to continue" && failing=true - fi - - if [ "$failing" = true ]; then - return 1 - fi - - return 0 -} - -# args: -# input - $1 -to_lowercase() { - #eval $invocation - - echo "$1" | tr '[:upper:]' '[:lower:]' - return 0 -} - -# args: -# input - $1 -remove_trailing_slash() { - #eval $invocation - - local input=${1:-} - echo "${input%/}" - return 0 -} - -# args: -# input - $1 -remove_beginning_slash() { - #eval $invocation - - local input=${1:-} - echo "${input#/}" - return 0 -} - -# args: -# root_path - $1 -# child_path - $2 - this parameter can be empty -combine_paths() { - eval $invocation - - # TODO: Consider making it work with any number of paths. For now: - if [ ! -z "${3:-}" ]; then - say_err "combine_paths: Function takes two parameters." - return 1 - fi - - local root_path=$(remove_trailing_slash $1) - local child_path=$(remove_beginning_slash ${2:-}) - say_verbose "combine_paths: root_path=$root_path" - say_verbose "combine_paths: child_path=$child_path" - echo "$root_path/$child_path" - return 0 -} - -get_machine_architecture() { - eval $invocation - - # Currently the only one supported - echo "x64" - return 0 -} - -# args: -# architecture - $1 -get_normalized_architecture_from_architecture() { - eval $invocation - - local architecture=$(to_lowercase $1) - case $architecture in - \) - echo "$(get_normalized_architecture_from_architecture $(get_machine_architecture))" - return 0 - ;; - amd64|x64) - echo "x64" - return 0 - ;; - x86) - say_err "Architecture \`x86\` currently not supported" - return 1 - ;; - esac - - say_err "Architecture \`$architecture\` not supported. If you think this is a bug, please report it at https://github.com/dotnet/cli/issues" - return 1 -} - -# version_info is a conceptual two line string representing commit hash and 4-part version -# format: -# Line 1: # commit_hash -# Line 2: # 4-part version - -# args: -# version_text - stdin -get_version_from_version_info() { - eval $invocation - - cat | tail -n 1 | sed 's/\r$//' - return 0 -} - -# args: -# version_text - stdin -get_commit_hash_from_version_info() { - eval $invocation - - cat | head -n 1 | sed 's/\r$//' - return 0 -} - -# args: -# install_root - $1 -# relative_path_to_package - $2 -# specific_version - $3 -is_dotnet_package_installed() { - eval $invocation - - local install_root=$1 - local relative_path_to_package=$2 - local specific_version=${3//[$'\t\r\n']} - - local dotnet_package_path=$(combine_paths $(combine_paths $install_root $relative_path_to_package) $specific_version) - say_verbose "is_dotnet_package_installed: dotnet_package_path=$dotnet_package_path" - - if [ -d "$dotnet_package_path" ]; then - return 0 - else - return 1 - fi -} - -# args: -# azure_feed - $1 -# channel - $2 -# normalized_architecture - $3 -# coherent - $4 -get_latest_version_info() { - eval $invocation - - local azure_feed=$1 - local channel=$2 - local normalized_architecture=$3 - local coherent=$4 - - local version_file_url=null - if [ "$shared_runtime" = true ]; then - version_file_url="$uncached_feed/Runtime/$channel/latest.version" - else - if [ "$coherent" = true ]; then - version_file_url="$uncached_feed/Sdk/$channel/latest.coherent.version" - else - version_file_url="$uncached_feed/Sdk/$channel/latest.version" - fi - fi - say_verbose "get_latest_version_info: latest url: $version_file_url" - - download $version_file_url - return $? -} - -# args: -# azure_feed - $1 -# channel - $2 -# normalized_architecture - $3 -# version - $4 -get_specific_version_from_version() { - eval $invocation - - local azure_feed=$1 - local channel=$2 - local normalized_architecture=$3 - local version=$(to_lowercase $4) - - case $version in - latest) - local version_info - version_info="$(get_latest_version_info $azure_feed $channel $normalized_architecture false)" || return 1 - say_verbose "get_specific_version_from_version: version_info=$version_info" - echo "$version_info" | get_version_from_version_info - return 0 - ;; - coherent) - local version_info - version_info="$(get_latest_version_info $azure_feed $channel $normalized_architecture true)" || return 1 - say_verbose "get_specific_version_from_version: version_info=$version_info" - echo "$version_info" | get_version_from_version_info - return 0 - ;; - *) - echo $version - return 0 - ;; - esac -} - -# args: -# azure_feed - $1 -# channel - $2 -# normalized_architecture - $3 -# specific_version - $4 -construct_download_link() { - eval $invocation - - local azure_feed=$1 - local channel=$2 - local normalized_architecture=$3 - local specific_version=${4//[$'\t\r\n']} - - local osname - osname=$(get_current_os_name) || return 1 - - local download_link=null - if [ "$shared_runtime" = true ]; then - download_link="$azure_feed/Runtime/$specific_version/dotnet-runtime-$specific_version-$osname-$normalized_architecture.tar.gz" - else - download_link="$azure_feed/Sdk/$specific_version/dotnet-sdk-$specific_version-$osname-$normalized_architecture.tar.gz" - fi - - echo "$download_link" - return 0 -} - -# args: -# azure_feed - $1 -# channel - $2 -# normalized_architecture - $3 -# specific_version - $4 -construct_legacy_download_link() { - eval $invocation - - local azure_feed=$1 - local channel=$2 - local normalized_architecture=$3 - local specific_version=${4//[$'\t\r\n']} - - local distro_specific_osname - distro_specific_osname=$(get_distro_specific_os_name) || return 1 - - local legacy_download_link=null - if [ "$shared_runtime" = true ]; then - legacy_download_link="$azure_feed/Runtime/$specific_version/dotnet-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz" - else - legacy_download_link="$azure_feed/Sdk/$specific_version/dotnet-dev-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz" - fi - - echo "$legacy_download_link" - return 0 -} - -get_user_install_path() { - eval $invocation - - if [ ! -z "${DOTNET_INSTALL_DIR:-}" ]; then - echo $DOTNET_INSTALL_DIR - else - echo "$HOME/.dotnet" - fi - return 0 -} - -# args: -# install_dir - $1 -resolve_installation_path() { - eval $invocation - - local install_dir=$1 - if [ "$install_dir" = "" ]; then - local user_install_path=$(get_user_install_path) - say_verbose "resolve_installation_path: user_install_path=$user_install_path" - echo "$user_install_path" - return 0 - fi - - echo "$install_dir" - return 0 -} - -# args: -# install_root - $1 -get_installed_version_info() { - eval $invocation - - local install_root=$1 - local version_file=$(combine_paths "$install_root" "$local_version_file_relative_path") - say_verbose "Local version file: $version_file" - if [ ! -z "$version_file" ] | [ -r "$version_file" ]; then - local version_info="$(cat $version_file)" - echo "$version_info" - return 0 - fi - - say_verbose "Local version file not found." - return 0 -} - -# args: -# relative_or_absolute_path - $1 -get_absolute_path() { - eval $invocation - - local relative_or_absolute_path=$1 - echo $(cd $(dirname "$1") && pwd -P)/$(basename "$1") - return 0 -} - -# args: -# input_files - stdin -# root_path - $1 -# out_path - $2 -# override - $3 -copy_files_or_dirs_from_list() { - eval $invocation - - local root_path=$(remove_trailing_slash $1) - local out_path=$(remove_trailing_slash $2) - local override=$3 - local override_switch=$(if [ "$override" = false ]; then printf -- "-n"; fi) - - cat | uniq | while read -r file_path; do - local path=$(remove_beginning_slash ${file_path#$root_path}) - local target=$out_path/$path - if [ "$override" = true ] || (! ([ -d "$target" ] || [ -e "$target" ])); then - mkdir -p $out_path/$(dirname $path) - cp -R $override_switch $root_path/$path $target - fi - done -} - -# args: -# zip_path - $1 -# out_path - $2 -extract_dotnet_package() { - eval $invocation - - local zip_path=$1 - local out_path=$2 - - local temp_out_path=$(mktemp -d $temporary_file_template) - - local failed=false - tar -xzf "$zip_path" -C "$temp_out_path" > /dev/null || failed=true - - local folders_with_version_regex='^.*/[0-9]+\.[0-9]+[^/]+/' - find $temp_out_path -type f | grep -Eo $folders_with_version_regex | copy_files_or_dirs_from_list $temp_out_path $out_path false - find $temp_out_path -type f | grep -Ev $folders_with_version_regex | copy_files_or_dirs_from_list $temp_out_path $out_path $override_non_versioned_files - - rm -rf $temp_out_path - - if [ "$failed" = true ]; then - say_err "Extraction failed" - return 1 - fi -} - -# args: -# remote_path - $1 -# [out_path] - $2 - stdout if not provided -download() { - eval $invocation - - local remote_path=$1 - local out_path=${2:-} - - local failed=false - if machine_has "curl"; then - downloadcurl $remote_path $out_path || failed=true - elif machine_has "wget"; then - downloadwget $remote_path $out_path || failed=true - else - failed=true - fi - if [ "$failed" = true ]; then - say_verbose "Download failed: $remote_path" - return 1 - fi - return 0 -} - -downloadcurl() { - eval $invocation - local remote_path=$1 - local out_path=${2:-} - - local failed=false - if [ -z "$out_path" ]; then - curl --retry 10 -sSL -f --create-dirs $remote_path || failed=true - else - curl --retry 10 -sSL -f --create-dirs -o $out_path $remote_path || failed=true - fi - if [ "$failed" = true ]; then - say_verbose "Curl download failed" - return 1 - fi - return 0 -} - -downloadwget() { - eval $invocation - local remote_path=$1 - local out_path=${2:-} - - local failed=false - if [ -z "$out_path" ]; then - wget -q --tries 10 -O - $remote_path || failed=true - else - wget -v --tries 10 -O $out_path $remote_path || failed=true - fi - if [ "$failed" = true ]; then - say_verbose "Wget download failed" - return 1 - fi - return 0 -} - -calculate_vars() { - eval $invocation - valid_legacy_download_link=true - - normalized_architecture=$(get_normalized_architecture_from_architecture "$architecture") - say_verbose "normalized_architecture=$normalized_architecture" - - specific_version=$(get_specific_version_from_version $azure_feed $channel $normalized_architecture $version) - say_verbose "specific_version=$specific_version" - if [ -z "$specific_version" ]; then - say_err "Could not get version information." - return 1 - fi - - download_link=$(construct_download_link $azure_feed $channel $normalized_architecture $specific_version) - say_verbose "download_link=$download_link" - - legacy_download_link=$(construct_legacy_download_link $azure_feed $channel $normalized_architecture $specific_version) || valid_legacy_download_link=false - - if [ "$valid_legacy_download_link" = true ]; then - say_verbose "legacy_download_link=$legacy_download_link" - else - say_verbose "Cound not construct a legacy_download_link; omitting..." - fi - - install_root=$(resolve_installation_path $install_dir) - say_verbose "install_root=$install_root" -} - -install_dotnet() { - eval $invocation - local download_failed=false - - if is_dotnet_package_installed $install_root "sdk" $specific_version; then - say ".NET SDK version $specific_version is already installed." - return 0 - fi - - mkdir -p $install_root - zip_path=$(mktemp $temporary_file_template) - say_verbose "Zip path: $zip_path" - - say "Downloading link: $download_link" - # Failures are normal in the non-legacy case for ultimately legacy downloads. - # Do not output to stderr, since output to stderr is considered an error. - download "$download_link" $zip_path 2>&1 || download_failed=true - - # if the download fails, download the legacy_download_link - if [ "$download_failed" = true ] && [ "$valid_legacy_download_link" = true ]; then - say "Cannot download: $download_link" - download_link=$legacy_download_link - zip_path=$(mktemp $temporary_file_template) - say_verbose "Legacy zip path: $zip_path" - say "Downloading legacy link: $download_link" - download "$download_link" $zip_path - fi - - say "Extracting zip from $download_link" - extract_dotnet_package $zip_path $install_root - - return 0 -} - -local_version_file_relative_path="/.version" -bin_folder_relative_path="" -temporary_file_template="${TMPDIR:-/tmp}/dotnet.XXXXXXXXX" - -channel="LTS" -version="Latest" -install_dir="" -architecture="" -dry_run=false -no_path=false -azure_feed="https://dotnetcli.azureedge.net/dotnet" -uncached_feed="https://dotnetcli.blob.core.windows.net/dotnet" -verbose=false -shared_runtime=false -runtime_id="" -override_non_versioned_files=true - -while [ $# -ne 0 ] -do - name=$1 - case $name in - -c|--channel|-[Cc]hannel) - shift - channel=$1 - ;; - -v|--version|-[Vv]ersion) - shift - version="$1" - ;; - -i|--install-dir|-[Ii]nstall[Dd]ir) - shift - install_dir="$1" - ;; - --arch|--architecture|-[Aa]rch|-[Aa]rchitecture) - shift - architecture="$1" - ;; - --shared-runtime|-[Ss]hared[Rr]untime) - shared_runtime=true - ;; - --dry-run|-[Dd]ry[Rr]un) - dry_run=true - ;; - --no-path|-[Nn]o[Pp]ath) - no_path=true - ;; - --verbose|-[Vv]erbose) - verbose=true - ;; - --azure-feed|-[Aa]zure[Ff]eed) - shift - azure_feed="$1" - ;; - --uncached-feed|-[Uu]ncached[Ff]eed) - shift - uncached_feed="$1" - ;; - --runtime-id|-[Rr]untime[Ii]d) - shift - runtime_id="$1" - ;; - --skip-non-versioned-files|-[Ss]kip[Nn]on[Vv]ersioned[Ff]iles) - shift - override_non_versioned_files=false - ;; - -?|--?|-h|--help|-[Hh]elp) - script_name="$(basename $0)" - echo ".NET Tools Installer" - echo "Usage: $script_name [-c|--channel ] [-v|--version ] [-p|--prefix ]" - echo " $script_name -h|-?|--help" - echo "" - echo "$script_name is a simple command line interface for obtaining dotnet cli." - echo "" - echo "Options:" - echo " -c,--channel Download from the CHANNEL specified, Defaults to \`$channel\`." - echo " -Channel" - echo " Possible values:" - echo " - Current - most current release" - echo " - LTS - most current supported release" - echo " - 2-part version in a format A.B - represents a specific release" - echo " examples: 2.0; 1.0" - echo " - Branch name" - echo " examples: release/2.0.0; Master" - echo " -v,--version Use specific VERSION, Defaults to \`$version\`." - echo " -Version" - echo " Possible values:" - echo " - latest - most latest build on specific channel" - echo " - coherent - most latest coherent build on specific channel" - echo " coherent applies only to SDK downloads" - echo " - 3-part version in a format A.B.C - represents specific version of build" - echo " examples: 2.0.0-preview2-006120; 1.1.0" - echo " -i,--install-dir Install under specified location (see Install Location below)" - echo " -InstallDir" - echo " --architecture Architecture of .NET Tools. Currently only x64 is supported." - echo " --arch,-Architecture,-Arch" - echo " --shared-runtime Installs just the shared runtime bits, not the entire SDK." - echo " -SharedRuntime" - echo " --skip-non-versioned-files Skips non-versioned files if they already exist, such as the dotnet executable." - echo " -SkipNonVersionedFiles" - echo " --dry-run,-DryRun Do not perform installation. Display download link." - echo " --no-path, -NoPath Do not set PATH for the current process." - echo " --verbose,-Verbose Display diagnostics information." - echo " --azure-feed,-AzureFeed Azure feed location. Defaults to $azure_feed, This parameter typically is not changed by the user." - echo " --uncached-feed,-UncachedFeed Uncached feed location. This parameter typically is not changed by the user." - echo " --runtime-id Installs the .NET Tools for the given platform (use linux-x64 for portable linux)." - echo " -RuntimeId" - echo " -?,--?,-h,--help,-Help Shows this help message" - echo "" - echo "Install Location:" - echo " Location is chosen in following order:" - echo " - --install-dir option" - echo " - Environmental variable DOTNET_INSTALL_DIR" - echo " - $HOME/.dotnet" - exit 0 - ;; - *) - say_err "Unknown argument \`$name\`" - exit 1 - ;; - esac - - shift -done - -check_min_reqs -calculate_vars - -if [ "$dry_run" = true ]; then - say "Payload URL: $download_link" - if [ "$valid_legacy_download_link" = true ]; then - say "Legacy payload URL: $legacy_download_link" - fi - say "Repeatable invocation: ./$(basename $0) --version $specific_version --channel $channel --install-dir $install_dir" - exit 0 -fi - -check_pre_reqs -install_dotnet - -bin_path=$(get_absolute_path $(combine_paths $install_root $bin_folder_relative_path)) -if [ "$no_path" = false ]; then - say "Adding to current process PATH: \`$bin_path\`. Note: This change will be visible only when sourcing script." - export PATH=$bin_path:$PATH -else - say "Binaries of dotnet can be found in $bin_path" -fi - -say "Installation finished successfully." diff --git a/scripts/obtain/uninstall/dotnet-uninstall-debian-packages.sh b/scripts/obtain/uninstall/dotnet-uninstall-debian-packages.sh deleted file mode 100755 index a62ce9ed4..000000000 --- a/scripts/obtain/uninstall/dotnet-uninstall-debian-packages.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/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. -# - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -current_userid=$(id -u) -if [ $current_userid -ne 0 ]; then - echo "$(basename "$0") uninstallation script requires superuser privileges to run" - exit 1 -fi - -host_package_name="dotnet-host" -aspnetcore_package_store_package_name="^aspnetcore-store.*" - -remove_all(){ - apt-get purge -y $aspnetcore_package_store_package_name - apt-get purge -y $host_package_name -} - -is_dotnet_host_installed(){ - local out="$(dpkg -l | grep $host_package_name)" - [ -z "$out" ] -} - -is_dotnet_host_installed -[ "$?" -eq 0 ] && echo "Unable to find dotnet installation to remove." >&2 \ - && exit 0 - -remove_all -[ "$?" -ne 0 ] && echo "Failed to remove dotnet packages." >&2 && exit 1 - -is_dotnet_host_installed -[ "$?" -ne 0 ] && \ - echo "dotnet package removal succeeded but appear to still be installed. Please file an issue at https://github.com/dotnet/cli" >&2 && \ - exit 1 - -echo "dotnet package removal succeeded." >&2 -exit 0 diff --git a/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh b/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh deleted file mode 100755 index 31a5d8e99..000000000 --- a/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/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. -# - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -current_userid=$(id -u) -if [ $current_userid -ne 0 ]; then - echo "$(basename "$0") uninstallation script requires superuser privileges to run" >&2 - exit 1 -fi - -# this is the common suffix for all the dotnet pkgs -dotnet_pkg_name_suffix="com.microsoft.dotnet" -dotnet_install_root="/usr/local/share/dotnet" -dotnet_path_file="/etc/paths.d/dotnet" - -remove_dotnet_pkgs(){ - installed_pkgs=($(pkgutil --pkgs | grep $dotnet_pkg_name_suffix)) - - for i in "${installed_pkgs[@]}" - do - echo "Removing dotnet component - \"$i\"" >&2 - pkgutil --force --forget "$i" - done -} - -remove_dotnet_pkgs -[ "$?" -ne 0 ] && echo "Failed to remove dotnet packages." >&2 && exit 1 - -echo "Deleting install root - $dotnet_install_root" >&2 -rm -rf "$dotnet_install_root" -rm -f "$dotnet_path_file" - -echo "dotnet packages removal succeeded." >&2 -exit 0 diff --git a/scripts/obtain/uninstall/dotnet-uninstall-rpm-packages.sh b/scripts/obtain/uninstall/dotnet-uninstall-rpm-packages.sh deleted file mode 100755 index ef7be91af..000000000 --- a/scripts/obtain/uninstall/dotnet-uninstall-rpm-packages.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/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. -# - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -current_userid=$(id -u) -if [ $current_userid -ne 0 ]; then - echo "$(basename "$0") uninstallation script requires superuser privileges to run" - exit 1 -fi - -host_package_name="dotnet-host" -aspnetcore_package_store_package_name="aspnetcore-store*" - -remove_all(){ - yum remove -y $host_package_name - yum remove -y $aspnetcore_package_store_package_name -} - -is_dotnet_host_installed(){ - local out="$(yum list installed | grep $host_package_name)" - [ -z "$out" ] -} - -is_dotnet_host_installed -[ "$?" -eq 0 ] && echo "Unable to find dotnet installation to remove." >&2 \ - && exit 0 - -remove_all -[ "$?" -ne 0 ] && echo "Failed to remove dotnet packages." >&2 && exit 1 - -is_dotnet_host_installed -[ "$?" -ne 0 ] && \ - echo "dotnet package removal succeeded but appear to still be installed. Please file an issue at https://github.com/dotnet/cli" >&2 && \ - exit 1 - -echo "dotnet package removal succeeded." >&2 -exit 0 diff --git a/scripts/register-completions.bash b/scripts/register-completions.bash deleted file mode 100644 index b4753def3..000000000 --- a/scripts/register-completions.bash +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# bash parameter completion for the dotnet CLI - -_dotnet_bash_complete() -{ - local word=${COMP_WORDS[COMP_CWORD]} - local dotnetPath=${COMP_WORDS[1]} - - local completions=("$(dotnet complete --position ${COMP_POINT} "${COMP_LINE}")") - - COMPREPLY=( $(compgen -W "$completions" -- "$word") ) -} - -complete -f -F _dotnet_bash_complete dotnet \ No newline at end of file diff --git a/scripts/register-completions.ps1 b/scripts/register-completions.ps1 deleted file mode 100644 index 88c416cd8..000000000 --- a/scripts/register-completions.ps1 +++ /dev/null @@ -1,7 +0,0 @@ -# PowerShell parameter completion shim for the dotnet CLI -Register-ArgumentCompleter -Native -CommandName dotnet -ScriptBlock { - param($commandName, $wordToComplete, $cursorPosition) - dotnet complete --position $cursorPosition "$wordToComplete" | ForEach-Object { - [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) - } - } \ No newline at end of file diff --git a/scripts/register-completions.zsh b/scripts/register-completions.zsh deleted file mode 100644 index 9f290bc68..000000000 --- a/scripts/register-completions.zsh +++ /dev/null @@ -1,12 +0,0 @@ -# zsh parameter completion for the dotnet CLI - -_dotnet_zsh_complete() -{ - local dotnetPath=$words[1] - - local completions=("$(dotnet complete "$words")") - - reply=( "${(ps:\n:)completions}" ) -} - -compctl -K _dotnet_zsh_complete dotnet \ No newline at end of file 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 0fec393cb..000000000 --- a/src/Microsoft.DotNet.Archive/Microsoft.DotNet.Archive.csproj +++ /dev/null @@ -1,21 +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/FileManipulation/FileUtil.cs b/src/Microsoft.DotNet.Cli.Sln.Internal/FileManipulation/FileUtil.cs deleted file mode 100644 index ce4329199..000000000 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/FileManipulation/FileUtil.cs +++ /dev/null @@ -1,155 +0,0 @@ -// -// FileUtil.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; -using System.IO; -using System.Text; - -namespace Microsoft.DotNet.Cli.Sln.Internal.FileManipulation -{ - static internal class FileUtil - { - internal static TextFormatInfo GetTextFormatInfo(string file) - { - var info = new TextFormatInfo(); - - string newLine = null; - Encoding encoding; - - using (FileStream fs = File.OpenRead(file)) - { - byte[] buf = new byte[1024]; - int nread, i; - - if ((nread = fs.Read(buf, 0, buf.Length)) <= 0) - { - return info; - } - - if (TryParse(buf, nread, out encoding)) - { - i = encoding.GetPreamble().Length; - } - else - { - encoding = null; - i = 0; - } - - do - { - while (i < nread) - { - if (buf[i] == '\r') - { - newLine = "\r\n"; - break; - } - else if (buf[i] == '\n') - { - newLine = "\n"; - break; - } - - i++; - } - - if (newLine == null) - { - if ((nread = fs.Read(buf, 0, buf.Length)) <= 0) - { - newLine = "\n"; - break; - } - - i = 0; - } - } while (newLine == null); - - info.EndsWithEmptyLine = fs.Seek(-1, SeekOrigin.End) > 0 && fs.ReadByte() == (int)'\n'; - info.NewLine = newLine; - info.Encoding = encoding; - return info; - } - } - - private static bool TryParse(byte[] buffer, int available, out Encoding encoding) - { - if (buffer.Length >= 2) - { - for (int i = 0; i < table.Length; i++) - { - bool matched = true; - - if (available < table[i].GetPreamble().Length) - { - continue; - } - - for (int j = 0; j < table[i].GetPreamble().Length; j++) - { - if (buffer[j] != table[i].GetPreamble()[j]) - { - matched = false; - break; - } - } - - if (matched) - { - encoding = table[i]; - return true; - } - } - } - - encoding = null; - - return false; - } - - private static readonly Encoding[] table = new[] { - Encoding.UTF7, - Encoding.UTF8, - Encoding.UTF32, - Encoding.ASCII, - }; - } - - internal class TextFormatInfo - { - public TextFormatInfo() - { - NewLine = Environment.NewLine; - Encoding = null; - EndsWithEmptyLine = true; - } - - public string NewLine { get; set; } - public Encoding Encoding { get; set; } - public bool EndsWithEmptyLine { get; set; } - } -} diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/LocalizableStrings.resx b/src/Microsoft.DotNet.Cli.Sln.Internal/LocalizableStrings.resx deleted file mode 100644 index 205037931..000000000 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/LocalizableStrings.resx +++ /dev/null @@ -1,153 +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 - - - Invalid format in line {0}: {1} - - - Project section is missing '{0}' when parsing the line starting at position {1} - - - Property set is missing '{0}' - - - Global section specified more than once - - - Global section not closed - - - File header is missing version - - - Expected file header not found - - - Project section not closed - - - Invalid section type: {0} - - - Section id missing - - - Closing section tag not found - - \ 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 deleted file mode 100644 index 8f76e2e04..000000000 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/Microsoft.DotNet.Cli.Sln.Internal.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - - SLN file reader/writer - $(CliVersionPrefix) - netstandard1.6 - portable - Microsoft.DotNet.Cli.Sln.Internal - ../../tools/Key.snk - true - true - - - - - - - - - - - - - - - - - diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/ProjectTypeGuids.cs b/src/Microsoft.DotNet.Cli.Sln.Internal/ProjectTypeGuids.cs deleted file mode 100644 index 547e93eef..000000000 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/ProjectTypeGuids.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.DotNet.Cli.Sln.Internal -{ - public static class ProjectTypeGuids - { - public const string CSharpProjectTypeGuid = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"; - public const string SolutionFolderGuid = "{2150E333-8FDC-42A3-9474-1A3956D46DE8}"; - } -} diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/Properties/AssemblyInfo.cs b/src/Microsoft.DotNet.Cli.Sln.Internal/Properties/AssemblyInfo.cs deleted file mode 100644 index b67942279..000000000 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Microsoft.DotNet.Cli.Sln.Internal.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100039ac461fa5c82c7dd2557400c4fd4e9dcdf7ac47e3d572548c04cd4673e004916610f4ea5cbf86f2b1ca1cb824f2a7b3976afecfcf4eb72d9a899aa6786effa10c30399e6580ed848231fec48374e41b3acf8811931343fc2f73acf72dae745adbcb7063cc4b50550618383202875223fc75401351cd89c44bf9b50e7fa3796")] -[assembly: InternalsVisibleTo("dotnet-sln-add.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("dotnet-sln-list.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("dotnet-sln-remove.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] - - diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/SlnFile.cs b/src/Microsoft.DotNet.Cli.Sln.Internal/SlnFile.cs deleted file mode 100644 index 87fad297e..000000000 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/SlnFile.cs +++ /dev/null @@ -1,1185 +0,0 @@ -// -// SlnFile.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (c) 2016 Xamarin, Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.IO; -using System.Collections; -using System.Globalization; -using System.Reflection; -using Microsoft.DotNet.Cli.Sln.Internal.FileManipulation; -using Microsoft.DotNet.Tools.Common; - -namespace Microsoft.DotNet.Cli.Sln.Internal -{ - public class SlnFile - { - private SlnProjectCollection _projects = new SlnProjectCollection(); - private SlnSectionCollection _sections = new SlnSectionCollection(); - private SlnPropertySet _metadata = new SlnPropertySet(true); - private int _prefixBlankLines = 1; - private TextFormatInfo _format = new TextFormatInfo(); - - public string FormatVersion { get; set; } - public string ProductDescription { get; set; } - - public string VisualStudioVersion - { - get { return _metadata.GetValue("VisualStudioVersion"); } - set { _metadata.SetValue("VisualStudioVersion", value); } - } - - public string MinimumVisualStudioVersion - { - get { return _metadata.GetValue("MinimumVisualStudioVersion"); } - set { _metadata.SetValue("MinimumVisualStudioVersion", value); } - } - - public string BaseDirectory - { - get { return Path.GetDirectoryName(FullPath); } - } - - public string FullPath { get; set; } - - public SlnPropertySet SolutionConfigurationsSection - { - get - { - return _sections - .GetOrCreateSection("SolutionConfigurationPlatforms", SlnSectionType.PreProcess) - .Properties; - } - } - - public SlnPropertySetCollection ProjectConfigurationsSection - { - get - { - return _sections - .GetOrCreateSection("ProjectConfigurationPlatforms", SlnSectionType.PostProcess) - .NestedPropertySets; - } - } - - public SlnSectionCollection Sections - { - get { return _sections; } - } - - public SlnProjectCollection Projects - { - get { return _projects; } - } - - public SlnFile() - { - _projects.ParentFile = this; - _sections.ParentFile = this; - } - - public static SlnFile Read(string file) - { - SlnFile slnFile = new SlnFile(); - slnFile.FullPath = Path.GetFullPath(file); - slnFile._format = FileUtil.GetTextFormatInfo(file); - - using (var sr = new StreamReader(new FileStream(file, FileMode.Open))) - { - slnFile.Read(sr); - } - - return slnFile; - } - - private void Read(TextReader reader) - { - const string HeaderPrefix = "Microsoft Visual Studio Solution File, Format Version"; - - string line; - int curLineNum = 0; - bool globalFound = false; - bool productRead = false; - - while ((line = reader.ReadLine()) != null) - { - curLineNum++; - line = line.Trim(); - if (line.StartsWith(HeaderPrefix, StringComparison.Ordinal)) - { - if (line.Length <= HeaderPrefix.Length) - { - throw new InvalidSolutionFormatException( - curLineNum, - LocalizableStrings.FileHeaderMissingVersionError); - } - - FormatVersion = line.Substring(HeaderPrefix.Length).Trim(); - _prefixBlankLines = curLineNum - 1; - } - if (line.StartsWith("# ", StringComparison.Ordinal)) - { - if (!productRead) - { - productRead = true; - ProductDescription = line.Substring(2); - } - } - else if (line.StartsWith("Project", StringComparison.Ordinal)) - { - SlnProject p = new SlnProject(); - p.Read(reader, line, ref curLineNum); - _projects.Add(p); - } - else if (line == "Global") - { - if (globalFound) - { - throw new InvalidSolutionFormatException( - curLineNum, - LocalizableStrings.GlobalSectionMoreThanOnceError); - } - globalFound = true; - while ((line = reader.ReadLine()) != null) - { - curLineNum++; - line = line.Trim(); - if (line == "EndGlobal") - { - break; - } - else if (line.StartsWith("GlobalSection", StringComparison.Ordinal)) - { - var sec = new SlnSection(); - sec.Read(reader, line, ref curLineNum); - _sections.Add(sec); - } - else // Ignore text that's out of place - { - continue; - } - } - if (line == null) - { - throw new InvalidSolutionFormatException( - curLineNum, - LocalizableStrings.GlobalSectionNotClosedError); - } - } - else if (line.IndexOf('=') != -1) - { - _metadata.ReadLine(line, curLineNum); - } - } - if (FormatVersion == null) - { - throw new InvalidSolutionFormatException(LocalizableStrings.FileHeaderMissingError); - } - } - - public void Write(string file = null) - { - if (!string.IsNullOrEmpty(file)) - { - FullPath = Path.GetFullPath(file); - } - var sw = new StringWriter(); - Write(sw); - File.WriteAllText(FullPath, sw.ToString()); - } - - private void Write(TextWriter writer) - { - writer.NewLine = _format.NewLine; - for (int n = 0; n < _prefixBlankLines; n++) - { - writer.WriteLine(); - } - writer.WriteLine("Microsoft Visual Studio Solution File, Format Version " + FormatVersion); - writer.WriteLine("# " + ProductDescription); - - _metadata.Write(writer); - - foreach (var p in _projects) - { - p.Write(writer); - } - - writer.WriteLine("Global"); - foreach (SlnSection s in _sections) - { - s.Write(writer, "GlobalSection"); - } - writer.WriteLine("EndGlobal"); - } - } - - public class SlnProject - { - private SlnSectionCollection _sections = new SlnSectionCollection(); - - private SlnFile _parentFile; - - public SlnFile ParentFile - { - get - { - return _parentFile; - } - internal set - { - _parentFile = value; - _sections.ParentFile = _parentFile; - } - } - - public string Id { get; set; } - public string TypeGuid { get; set; } - public string Name { get; set; } - - private string _filePath; - public string FilePath - { - get - { - return _filePath; - } - set - { - _filePath = PathUtility.RemoveExtraPathSeparators( - PathUtility.GetPathWithDirectorySeparator(value)); - } - } - - public int Line { get; private set; } - internal bool Processed { get; set; } - - public SlnSectionCollection Sections - { - get { return _sections; } - } - - internal void Read(TextReader reader, string line, ref int curLineNum) - { - Line = curLineNum; - - int n = 0; - FindNext(curLineNum, line, ref n, '('); - n++; - FindNext(curLineNum, line, ref n, '"'); - int n2 = n + 1; - FindNext(curLineNum, line, ref n2, '"'); - TypeGuid = line.Substring(n + 1, n2 - n - 1); - - n = n2 + 1; - FindNext(curLineNum, line, ref n, ')'); - FindNext(curLineNum, line, ref n, '='); - - FindNext(curLineNum, line, ref n, '"'); - n2 = n + 1; - FindNext(curLineNum, line, ref n2, '"'); - Name = line.Substring(n + 1, n2 - n - 1); - - n = n2 + 1; - FindNext(curLineNum, line, ref n, ','); - FindNext(curLineNum, line, ref n, '"'); - n2 = n + 1; - FindNext(curLineNum, line, ref n2, '"'); - FilePath = line.Substring(n + 1, n2 - n - 1); - - n = n2 + 1; - FindNext(curLineNum, line, ref n, ','); - FindNext(curLineNum, line, ref n, '"'); - n2 = n + 1; - FindNext(curLineNum, line, ref n2, '"'); - Id = line.Substring(n + 1, n2 - n - 1); - - while ((line = reader.ReadLine()) != null) - { - curLineNum++; - line = line.Trim(); - if (line == "EndProject") - { - return; - } - if (line.StartsWith("ProjectSection", StringComparison.Ordinal)) - { - if (_sections == null) - { - _sections = new SlnSectionCollection(); - } - var sec = new SlnSection(); - _sections.Add(sec); - sec.Read(reader, line, ref curLineNum); - } - } - - throw new InvalidSolutionFormatException( - curLineNum, - LocalizableStrings.ProjectSectionNotClosedError); - } - - private void FindNext(int ln, string line, ref int i, char c) - { - var inputIndex = i; - i = line.IndexOf(c, i); - if (i == -1) - { - throw new InvalidSolutionFormatException( - ln, - string.Format(LocalizableStrings.ProjectParsingErrorFormatString, c, inputIndex)); - } - } - - internal void Write(TextWriter writer) - { - writer.Write("Project(\""); - writer.Write(TypeGuid); - writer.Write("\") = \""); - writer.Write(Name); - writer.Write("\", \""); - writer.Write(PathUtility.GetPathWithBackSlashes(FilePath)); - writer.Write("\", \""); - writer.Write(Id); - writer.WriteLine("\""); - if (_sections != null) - { - foreach (SlnSection s in _sections) - { - s.Write(writer, "ProjectSection"); - } - } - writer.WriteLine("EndProject"); - } - } - - public class SlnSection - { - private SlnPropertySetCollection _nestedPropertySets; - private SlnPropertySet _properties; - private List _sectionLines; - private int _baseIndex; - - public string Id { get; set; } - public int Line { get; private set; } - - internal bool Processed { get; set; } - - public SlnFile ParentFile { get; internal set; } - - public bool IsEmpty - { - get - { - return (_properties == null || _properties.Count == 0) && - (_nestedPropertySets == null || _nestedPropertySets.All(t => t.IsEmpty)) && - (_sectionLines == null || _sectionLines.Count == 0); - } - } - - /// - /// If true, this section won't be written to the file if it is empty - /// - /// true if skip if empty; otherwise, false. - public bool SkipIfEmpty { get; set; } - - public void Clear() - { - _properties = null; - _nestedPropertySets = null; - _sectionLines = null; - } - - public SlnPropertySet Properties - { - get - { - if (_properties == null) - { - _properties = new SlnPropertySet(); - _properties.ParentSection = this; - if (_sectionLines != null) - { - foreach (var line in _sectionLines) - { - _properties.ReadLine(line, Line); - } - _sectionLines = null; - } - } - return _properties; - } - } - - public SlnPropertySetCollection NestedPropertySets - { - get - { - if (_nestedPropertySets == null) - { - _nestedPropertySets = new SlnPropertySetCollection(this); - if (_sectionLines != null) - { - LoadPropertySets(); - } - } - return _nestedPropertySets; - } - } - - public void SetContent(IEnumerable> lines) - { - _sectionLines = new List(lines.Select(p => p.Key + " = " + p.Value)); - _properties = null; - _nestedPropertySets = null; - } - - public IEnumerable> GetContent() - { - if (_sectionLines != null) - { - return _sectionLines.Select(li => - { - int i = li.IndexOf('='); - if (i != -1) - { - return new KeyValuePair(li.Substring(0, i).Trim(), li.Substring(i + 1).Trim()); - } - else - { - return new KeyValuePair(li.Trim(), ""); - } - }); - } - else - { - return new KeyValuePair[0]; - } - } - - public SlnSectionType SectionType { get; set; } - - private SlnSectionType ToSectionType(int curLineNum, string s) - { - if (s == "preSolution" || s == "preProject") - { - return SlnSectionType.PreProcess; - } - if (s == "postSolution" || s == "postProject") - { - return SlnSectionType.PostProcess; - } - throw new InvalidSolutionFormatException( - curLineNum, - String.Format(LocalizableStrings.InvalidSectionTypeError, s)); - } - - private string FromSectionType(bool isProjectSection, SlnSectionType type) - { - if (type == SlnSectionType.PreProcess) - { - return isProjectSection ? "preProject" : "preSolution"; - } - else - { - return isProjectSection ? "postProject" : "postSolution"; - } - } - - internal void Read(TextReader reader, string line, ref int curLineNum) - { - Line = curLineNum; - int k = line.IndexOf('('); - if (k == -1) - { - throw new InvalidSolutionFormatException( - curLineNum, - LocalizableStrings.SectionIdMissingError); - } - var tag = line.Substring(0, k).Trim(); - var k2 = line.IndexOf(')', k); - if (k2 == -1) - { - throw new InvalidSolutionFormatException( - curLineNum, - LocalizableStrings.SectionIdMissingError); - } - Id = line.Substring(k + 1, k2 - k - 1); - - k = line.IndexOf('=', k2); - SectionType = ToSectionType(curLineNum, line.Substring(k + 1).Trim()); - - var endTag = "End" + tag; - - _sectionLines = new List(); - _baseIndex = ++curLineNum; - while ((line = reader.ReadLine()) != null) - { - curLineNum++; - line = line.Trim(); - if (line == endTag) - { - break; - } - _sectionLines.Add(line); - } - if (line == null) - { - throw new InvalidSolutionFormatException( - curLineNum, - LocalizableStrings.ClosingSectionTagNotFoundError); - } - } - - private void LoadPropertySets() - { - if (_sectionLines != null) - { - SlnPropertySet curSet = null; - for (int n = 0; n < _sectionLines.Count; n++) - { - var line = _sectionLines[n]; - if (string.IsNullOrEmpty(line.Trim())) - { - continue; - } - var i = line.IndexOf('.'); - if (i == -1) - { - throw new InvalidSolutionFormatException( - _baseIndex + n, - string.Format(LocalizableStrings.InvalidPropertySetFormatString, '.')); - } - var id = line.Substring(0, i); - if (curSet == null || id != curSet.Id) - { - curSet = new SlnPropertySet(id); - _nestedPropertySets.Add(curSet); - } - curSet.ReadLine(line.Substring(i + 1), _baseIndex + n); - } - _sectionLines = null; - } - } - - internal void Write(TextWriter writer, string sectionTag) - { - if (SkipIfEmpty && IsEmpty) - { - return; - } - - writer.Write("\t"); - writer.Write(sectionTag); - writer.Write('('); - writer.Write(Id); - writer.Write(") = "); - writer.WriteLine(FromSectionType(sectionTag == "ProjectSection", SectionType)); - if (_sectionLines != null) - { - foreach (var l in _sectionLines) - { - writer.WriteLine("\t\t" + l); - } - } - else if (_properties != null) - { - _properties.Write(writer); - } - else if (_nestedPropertySets != null) - { - foreach (var ps in _nestedPropertySets) - { - ps.Write(writer); - } - } - writer.WriteLine("\tEnd" + sectionTag); - } - } - - /// - /// A collection of properties - /// - public class SlnPropertySet : IDictionary - { - private OrderedDictionary _values = new OrderedDictionary(); - private bool _isMetadata; - - internal bool Processed { get; set; } - - public SlnFile ParentFile - { - get { return ParentSection != null ? ParentSection.ParentFile : null; } - } - - public SlnSection ParentSection { get; set; } - - /// - /// Text file line of this section in the original file - /// - /// The line. - public int Line { get; private set; } - - internal SlnPropertySet() - { - } - - /// - /// Creates a new property set with the specified ID - /// - /// Identifier. - public SlnPropertySet(string id) - { - Id = id; - } - - internal SlnPropertySet(bool isMetadata) - { - _isMetadata = isMetadata; - } - - public bool IsEmpty - { - get - { - return _values.Count == 0; - } - } - - internal void ReadLine(string line, int currentLine) - { - if (Line == 0) - { - Line = currentLine; - } - int k = line.IndexOf('='); - if (k != -1) - { - var name = line.Substring(0, k).Trim(); - var val = line.Substring(k + 1).Trim(); - _values[name] = val; - } - else - { - line = line.Trim(); - if (!string.IsNullOrWhiteSpace(line)) - { - _values.Add(line, null); - } - } - } - - internal void Write(TextWriter writer) - { - foreach (DictionaryEntry e in _values) - { - if (!_isMetadata) - { - writer.Write("\t\t"); - } - if (Id != null) - { - writer.Write(Id + "."); - } - writer.WriteLine(e.Key + " = " + e.Value); - } - } - - public string Id { get; private set; } - - public string GetValue(string name, string defaultValue = null) - { - string res; - if (TryGetValue(name, out res)) - { - return res; - } - else - { - return defaultValue; - } - } - - public T GetValue(string name) - { - return (T)GetValue(name, typeof(T), default(T)); - } - - public T GetValue(string name, T defaultValue) - { - return (T)GetValue(name, typeof(T), defaultValue); - } - - public object GetValue(string name, Type t, object defaultValue) - { - string val; - if (TryGetValue(name, out val)) - { - if (t == typeof(bool)) - { - return (object)val.Equals("true", StringComparison.OrdinalIgnoreCase); - } - if (t.GetTypeInfo().IsEnum) - { - return Enum.Parse(t, val, true); - } - if (t.GetTypeInfo().IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>)) - { - var at = t.GetTypeInfo().GetGenericArguments()[0]; - if (string.IsNullOrEmpty(val)) - { - return null; - } - return Convert.ChangeType(val, at, CultureInfo.InvariantCulture); - - } - return Convert.ChangeType(val, t, CultureInfo.InvariantCulture); - } - else - { - return defaultValue; - } - } - - public void SetValue(string name, string value, string defaultValue = null, bool preserveExistingCase = false) - { - if (value == null && defaultValue == "") - { - value = ""; - } - if (value == defaultValue) - { - // if the value is default, only remove the property if it was not already the default - // to avoid unnecessary project file churn - string res; - if (TryGetValue(name, out res) && - !string.Equals(defaultValue ?? "", - res, preserveExistingCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal)) - { - Remove(name); - } - return; - } - string currentValue; - if (preserveExistingCase && TryGetValue(name, out currentValue) && - string.Equals(value, currentValue, StringComparison.OrdinalIgnoreCase)) - { - return; - } - _values[name] = value; - } - - public void SetValue(string name, object value, object defaultValue = null) - { - var isDefault = object.Equals(value, defaultValue); - if (isDefault) - { - // if the value is default, only remove the property if it was not already the default - // to avoid unnecessary project file churn - if (ContainsKey(name) && (defaultValue == null || - !object.Equals(defaultValue, GetValue(name, defaultValue.GetType(), null)))) - { - Remove(name); - } - return; - } - - if (value is bool) - { - _values[name] = (bool)value ? "TRUE" : "FALSE"; - } - else - { - _values[name] = Convert.ToString(value, CultureInfo.InvariantCulture); - } - } - - void IDictionary.Add(string key, string value) - { - SetValue(key, value); - } - - public bool ContainsKey(string key) - { - return _values.Contains(key); - } - - public bool Remove(string key) - { - var wasThere = _values.Contains(key); - _values.Remove(key); - return wasThere; - } - - public bool TryGetValue(string key, out string value) - { - value = (string)_values[key]; - return value != null; - } - - public string this[string index] - { - get - { - return (string)_values[index]; - } - set - { - _values[index] = value; - } - } - - public ICollection Values - { - get - { - return _values.Values.Cast().ToList(); - } - } - - public ICollection Keys - { - get { return _values.Keys.Cast().ToList(); } - } - - void ICollection>.Add(KeyValuePair item) - { - SetValue(item.Key, item.Value); - } - - public void Clear() - { - _values.Clear(); - } - - internal void ClearExcept(HashSet keys) - { - foreach (var k in _values.Keys.Cast().Except(keys).ToArray()) - { - _values.Remove(k); - } - } - - bool ICollection>.Contains(KeyValuePair item) - { - var val = GetValue(item.Key); - return val == item.Value; - } - - public void CopyTo(KeyValuePair[] array, int arrayIndex) - { - foreach (DictionaryEntry de in _values) - { - array[arrayIndex++] = new KeyValuePair((string)de.Key, (string)de.Value); - } - } - - bool ICollection>.Remove(KeyValuePair item) - { - if (((ICollection>)this).Contains(item)) - { - Remove(item.Key); - return true; - } - else - { - return false; - } - } - - public int Count - { - get - { - return _values.Count; - } - } - - internal void SetLines(IEnumerable> lines) - { - _values.Clear(); - foreach (var line in lines) - { - _values[line.Key] = line.Value; - } - } - - bool ICollection>.IsReadOnly - { - get - { - return false; - } - } - - public IEnumerator> GetEnumerator() - { - foreach (DictionaryEntry de in _values) - { - yield return new KeyValuePair((string)de.Key, (string)de.Value); - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - foreach (DictionaryEntry de in _values) - { - yield return new KeyValuePair((string)de.Key, (string)de.Value); - } - } - } - - public class SlnProjectCollection : Collection - { - private SlnFile _parentFile; - - internal SlnFile ParentFile - { - get - { - return _parentFile; - } - set - { - _parentFile = value; - foreach (var it in this) - { - it.ParentFile = _parentFile; - } - } - } - - public SlnProject GetProject(string id) - { - return this.FirstOrDefault(s => s.Id == id); - } - - public SlnProject GetOrCreateProject(string id) - { - var p = this.FirstOrDefault(s => s.Id.Equals(id, StringComparison.OrdinalIgnoreCase)); - if (p == null) - { - p = new SlnProject { Id = id }; - Add(p); - } - return p; - } - - protected override void InsertItem(int index, SlnProject item) - { - base.InsertItem(index, item); - item.ParentFile = ParentFile; - } - - protected override void SetItem(int index, SlnProject item) - { - base.SetItem(index, item); - item.ParentFile = ParentFile; - } - - protected override void RemoveItem(int index) - { - var it = this[index]; - it.ParentFile = null; - base.RemoveItem(index); - } - - protected override void ClearItems() - { - foreach (var it in this) - { - it.ParentFile = null; - } - base.ClearItems(); - } - } - - public class SlnSectionCollection : Collection - { - private SlnFile _parentFile; - - internal SlnFile ParentFile - { - get - { - return _parentFile; - } - set - { - _parentFile = value; - foreach (var it in this) - { - it.ParentFile = _parentFile; - } - } - } - - public SlnSection GetSection(string id) - { - return this.FirstOrDefault(s => s.Id == id); - } - - public SlnSection GetSection(string id, SlnSectionType sectionType) - { - return this.FirstOrDefault(s => s.Id == id && s.SectionType == sectionType); - } - - public SlnSection GetOrCreateSection(string id, SlnSectionType sectionType) - { - if (id == null) - { - throw new ArgumentNullException("id"); - } - var sec = this.FirstOrDefault(s => s.Id == id); - if (sec == null) - { - sec = new SlnSection { Id = id }; - sec.SectionType = sectionType; - Add(sec); - } - return sec; - } - - public void RemoveSection(string id) - { - if (id == null) - { - throw new ArgumentNullException("id"); - } - var s = GetSection(id); - if (s != null) - { - Remove(s); - } - } - - protected override void InsertItem(int index, SlnSection item) - { - base.InsertItem(index, item); - item.ParentFile = ParentFile; - } - - protected override void SetItem(int index, SlnSection item) - { - base.SetItem(index, item); - item.ParentFile = ParentFile; - } - - protected override void RemoveItem(int index) - { - var it = this[index]; - it.ParentFile = null; - base.RemoveItem(index); - } - - protected override void ClearItems() - { - foreach (var it in this) - { - it.ParentFile = null; - } - base.ClearItems(); - } - } - - public class SlnPropertySetCollection : Collection - { - private SlnSection _parentSection; - - internal SlnPropertySetCollection(SlnSection parentSection) - { - _parentSection = parentSection; - } - - public SlnPropertySet GetPropertySet(string id, bool ignoreCase = false) - { - var sc = ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; - return this.FirstOrDefault(s => s.Id.Equals(id, sc)); - } - - public SlnPropertySet GetOrCreatePropertySet(string id, bool ignoreCase = false) - { - var ps = GetPropertySet(id, ignoreCase); - if (ps == null) - { - ps = new SlnPropertySet(id); - Add(ps); - } - return ps; - } - - protected override void InsertItem(int index, SlnPropertySet item) - { - base.InsertItem(index, item); - item.ParentSection = _parentSection; - } - - protected override void SetItem(int index, SlnPropertySet item) - { - base.SetItem(index, item); - item.ParentSection = _parentSection; - } - - protected override void RemoveItem(int index) - { - var it = this[index]; - it.ParentSection = null; - base.RemoveItem(index); - } - - protected override void ClearItems() - { - foreach (var it in this) - { - it.ParentSection = null; - } - base.ClearItems(); - } - } - - public class InvalidSolutionFormatException : Exception - { - public InvalidSolutionFormatException(string details) - : base(details) - { - } - - public InvalidSolutionFormatException(int line, string details) - : base(string.Format(LocalizableStrings.ErrorMessageFormatString, line, details)) - { - } - } - - public enum SlnSectionType - { - PreProcess, - PostProcess - } -} - diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.cs.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index 5d973eb64..000000000 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - Global section specified more than once - Několikrát zadaný globální oddíl - - - - Global section not closed - Neuzavřený globální oddíl - - - - Expected file header not found - Nenalezena očekávaná hlavička souboru - - - - Project section not closed - Neuzavřený oddíl projektu - - - - Invalid section type: {0} - Neplatný typ oddílu: {0} - - - - Section id missing - Chybí ID oddílu - - - - Closing section tag not found - Nenalezena koncová značka oddílu - - - - Invalid format in line {0}: {1} - Neplatný formát na řádku {0}: {1} - - - - Project section is missing '{0}' when parsing the line starting at position {1} - V oddíle projektu chybí {0}, když analýza řádku začíná na pozici {1}. - - - - Property set is missing '{0}' - V sadě vlastností chybí {0}. - - - - File header is missing version - Chybějící verze v hlavičce souboru - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.de.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index 5e6f48830..000000000 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - Global section specified more than once - Globaler Abschnitt mehrmals angegeben - - - - Global section not closed - Globaler Abschnitt nicht geschlossen - - - - Expected file header not found - Erwarteter Dateiheader nicht gefunden. - - - - Project section not closed - Projektabschnitt nicht geschlossen - - - - Invalid section type: {0} - Ungültiger Abschnittstyp: {0} - - - - Section id missing - Abschnitts-ID fehlt - - - - Closing section tag not found - Schließendes Abschnittstag nicht gefunden - - - - Invalid format in line {0}: {1} - Ungültiges Format in Zeile {0}: {1} - - - - Project section is missing '{0}' when parsing the line starting at position {1} - Im Projektabschnitt fehlt "{0}" beim Analysieren des Zeilenbeginns in Position {1} - - - - Property set is missing '{0}' - Im Eigenschaftensatz fehlt "{0}" - - - - File header is missing version - Der Dateiheader enthält keine Version. - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.es.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index 365664c20..000000000 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - Global section specified more than once - Sección global especificada más de una vez - - - - Global section not closed - Sección global no cerrada - - - - Expected file header not found - No se encontró el encabezado de archivo esperado - - - - Project section not closed - Sección de proyecto no cerrada - - - - Invalid section type: {0} - Tipo de sección no válido: {0} - - - - Section id missing - Id. de sección omitido - - - - Closing section tag not found - No se encuentra la etiqueta de cierre de la sección - - - - Invalid format in line {0}: {1} - Formato no válido en línea {0}: {1} - - - - Project section is missing '{0}' when parsing the line starting at position {1} - Falta la sección del proyecto "{0}" al analizar la línea que inicia en la posición {1} - - - - Property set is missing '{0}' - A la propiedad establecida le falta "{0}" - - - - File header is missing version - Falta la versión del encabezado de archivo - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.fr.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index dd00afbe0..000000000 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - Global section specified more than once - Section Global spécifiée plusieurs fois - - - - Global section not closed - Section Global non fermée - - - - Expected file header not found - En-tête de fichier attendu introuvable - - - - Project section not closed - Section Project non fermée - - - - Invalid section type: {0} - Type de section non valide : {0} - - - - Section id missing - ID de section manquant - - - - Closing section tag not found - Balise de fermeture de section introuvable - - - - Invalid format in line {0}: {1} - Format non valide dans la ligne {0} : {1} - - - - Project section is missing '{0}' when parsing the line starting at position {1} - '{0}' est manquant dans la section de projet lors de l'analyse de la ligne à partir de la position {1} - - - - Property set is missing '{0}' - '{0}' est manquant dans le jeu de propriétés - - - - File header is missing version - Version manquante pour l'en-tête de fichier - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.it.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index a19ec0313..000000000 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - Global section specified more than once - La sezione Global è stata specificata più di una volta - - - - Global section not closed - La sezione Global non è stata chiusa - - - - Expected file header not found - L'intestazione del file prevista non è stata trovata - - - - Project section not closed - La sezione Project non è stata chiusa - - - - Invalid section type: {0} - Tipo di sezione non valido: {0} - - - - Section id missing - Manca l'ID sezione - - - - Closing section tag not found - Il tag di chiusura sessione non è stato trovato - - - - Invalid format in line {0}: {1} - Formato non valido alla riga {0}: {1} - - - - Project section is missing '{0}' when parsing the line starting at position {1} - Nella sezione del progetto manca '{0}' quando si analizza la riga a partire dalla posizione {1} - - - - Property set is missing '{0}' - Nel set di proprietà manca '{0}' - - - - File header is missing version - Nell'intestazione del file manca la versione - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.ja.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index 0f7670d89..000000000 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - Global section specified more than once - グローバル セクションが 2 回以上指定されています - - - - Global section not closed - グローバル セクションが閉じられていません - - - - Expected file header not found - 予期されたファイル ヘッダーがありません - - - - Project section not closed - プロジェクト セクションが閉じられていません - - - - Invalid section type: {0} - 無効なセクションの種類: {0} - - - - Section id missing - セクション ID がありません - - - - Closing section tag not found - 終了セクション タグが見つかりません - - - - Invalid format in line {0}: {1} - 行 {0} の形式が無効です: {1} - - - - Project section is missing '{0}' when parsing the line starting at position {1} - 位置 {1} から始まる行の解析中にプロジェクト セクションが見つかりません '{0}' - - - - Property set is missing '{0}' - プロパティ セットが見つかりません '{0}' - - - - File header is missing version - ファイル ヘッダーにバージョンが見つかりません - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.ko.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index 7d8766ad5..000000000 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - Global section specified more than once - 전역 섹션이 두 번 이상 지정됨 - - - - Global section not closed - 전역 섹션이 닫히지 않음 - - - - Expected file header not found - 필요한 파일 헤더가 없음 - - - - Project section not closed - 프로젝트 섹션이 닫히지 않음 - - - - Invalid section type: {0} - 잘못된 섹션 유형: {0} - - - - Section id missing - 섹션 ID가 누락됨 - - - - Closing section tag not found - 닫기 섹션 태그를 찾을 수 없음 - - - - Invalid format in line {0}: {1} - {0} 줄에 잘못된 형식: {1} - - - - Project section is missing '{0}' when parsing the line starting at position {1} - {1} 위치에서 시작하는 줄을 구문 분석할 때 프로젝트 섹션에 '{0}'이(가) 없습니다. - - - - Property set is missing '{0}' - 속성 설정에 '{0}'이(가) 없습니다. - - - - File header is missing version - 파일 헤더에 버전이 없습니다. - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.pl.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index 957ee2041..000000000 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - Global section specified more than once - Sekcja globalna została określona więcej niż raz - - - - Global section not closed - Nie zamknięto sekcji globalnej - - - - Expected file header not found - Nie znaleziono oczekiwanego nagłówka pliku - - - - Project section not closed - Nie zamknięto sekcji projektu - - - - Invalid section type: {0} - Nieprawidłowy typ sekcji: {0} - - - - Section id missing - Brak identyfikatora sekcji - - - - Closing section tag not found - Nie odnaleziono tagu zamykającego sekcję - - - - Invalid format in line {0}: {1} - Nieprawidłowy format w wierszu {0}: {1} - - - - Project section is missing '{0}' when parsing the line starting at position {1} - W sekcji projektu brakuje elementu „{0}” podczas analizowania wiersza, począwszy od pozycji {1} - - - - Property set is missing '{0}' - W zestawie właściwości brakuje elementu „{0}” - - - - File header is missing version - Brak wersji nagłówka pliku - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.pt-BR.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index 877faf844..000000000 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - Global section specified more than once - Seção global especificada mais de uma vez - - - - Global section not closed - Seção global não fechada - - - - Expected file header not found - Cabeçalho do arquivo esperado não encontrado - - - - Project section not closed - Seção de projeto não fechada - - - - Invalid section type: {0} - Tipo de seção inválido: {0} - - - - Section id missing - ID de sessão ausente - - - - Closing section tag not found - Marca de fechamento de seção não encontrada - - - - Invalid format in line {0}: {1} - Formato inválido na linha {0}: {1} - - - - Project section is missing '{0}' when parsing the line starting at position {1} - A seção do projeto está sem o '{0}' ao analisar a linha na posição {1} - - - - Property set is missing '{0}' - O conjunto de propriedade está sem '{0}' - - - - File header is missing version - O cabeçalho do arquivo está sem a versão - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.ru.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index 7caa01a43..000000000 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - Global section specified more than once - Глобальный раздел указан более одного раза. - - - - Global section not closed - Глобальный раздел не закрыт. - - - - Expected file header not found - Отсутствует требуемый заголовок файла - - - - Project section not closed - Раздел проекта не закрыт. - - - - Invalid section type: {0} - Недопустимый тип раздела: {0} - - - - Section id missing - Отсутствует идентификатор раздела. - - - - Closing section tag not found - Закрывающий тег раздела не найден. - - - - Invalid format in line {0}: {1} - Формат в строке {0} недопустим: {1} - - - - Project section is missing '{0}' when parsing the line starting at position {1} - В разделе проекта отсутствует "{0}" при анализе строки с начальной позицией {1} - - - - Property set is missing '{0}' - В наборе свойств отсутствует "{0}" - - - - File header is missing version - В заголовке файла отсутствует версия - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.tr.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index a7c5cba6b..000000000 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - Global section specified more than once - Genel bölüm birden çok kez belirtilmiş - - - - Global section not closed - Genel bölüm kapatılmadı - - - - Expected file header not found - Beklenen dosya üst bilgisi bulunamadı - - - - Project section not closed - Proje bölümü kapatılmadı - - - - Invalid section type: {0} - Geçersiz bölüm türü: {0} - - - - Section id missing - Bölüm kimliği eksik - - - - Closing section tag not found - Kapatma bölümü etiketi bulunamadı - - - - Invalid format in line {0}: {1} - {0}. satırda geçersiz biçim: {1} - - - - Project section is missing '{0}' when parsing the line starting at position {1} - {1}. konumdan başlayan satır ayrıştırılırken proje bölümünde '{0}' eksik - - - - Property set is missing '{0}' - Özellik kümesinde '{0}' eksik - - - - File header is missing version - Dosya üst bilgisinde sürüm eksik - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.xlf deleted file mode 100644 index 743ec3778..000000000 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - Global section specified more than once - - - - Global section not closed - - - - Expected file header not found - - - - Project section not closed - - - - Invalid section type: {0} - - - - Section id missing - - - - Closing section tag not found - - - - Invalid format in line {0}: {1} - - - - Project section is missing '{0}' when parsing the line starting at position {1} - - - - Property set is missing '{0}' - - - - File header is missing version - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.zh-Hans.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index b353d1247..000000000 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - Global section specified more than once - 多次指定了全局节 - - - - Global section not closed - 未关闭全局节 - - - - Expected file header not found - 未找到必需的文件头 - - - - Project section not closed - 未关闭项目节 - - - - Invalid section type: {0} - 无效的节类型: {0} - - - - Section id missing - 缺少节 ID - - - - Closing section tag not found - 未找到结束节标记 - - - - Invalid format in line {0}: {1} - 行 {0} 存在无效格式: {1} - - - - Project section is missing '{0}' when parsing the line starting at position {1} - 分析从位置 {1} 开始的行时,项目节缺少“{0}” - - - - Property set is missing '{0}' - 属性集缺少“{0}” - - - - File header is missing version - 文件头缺少版本 - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.zh-Hant.xlf b/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index 7fef8a4f8..000000000 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - Global section specified more than once - 全域區段指定了一次以上 - - - - Global section not closed - 全域區段未關閉 - - - - Expected file header not found - 找不到預期的檔案標頭 - - - - Project section not closed - 專案區段未關閉 - - - - Invalid section type: {0} - 區段類型無效: {0} - - - - Section id missing - 遺漏區段識別碼 - - - - Closing section tag not found - 找不到關閉區段標記 - - - - Invalid format in line {0}: {1} - 第 {0} 行的格式不正確: {1} - - - - Project section is missing '{0}' when parsing the line starting at position {1} - 從位置 {1} 開始剖析程式行時,專案區段缺少 '{0}' - - - - Property set is missing '{0}' - 屬性集缺少 '{0}' - - - - File header is missing version - 檔案標頭遺漏版本 - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/AnsiColorExtensions.cs b/src/Microsoft.DotNet.Cli.Utils/AnsiColorExtensions.cs deleted file mode 100644 index 08c617e87..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/AnsiColorExtensions.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.DotNet.Cli.Utils -{ - public static class AnsiColorExtensions - { - public static string Black(this string text) - { - return "\x1B[30m" + text + "\x1B[39m"; - } - - public static string Red(this string text) - { - return "\x1B[31m" + text + "\x1B[39m"; - } - public static string Green(this string text) - { - return "\x1B[32m" + text + "\x1B[39m"; - } - - public static string Yellow(this string text) - { - return "\x1B[33m" + text + "\x1B[39m"; - } - - public static string Blue(this string text) - { - return "\x1B[34m" + text + "\x1B[39m"; - } - - public static string Magenta(this string text) - { - return "\x1B[35m" + text + "\x1B[39m"; - } - - public static string Cyan(this string text) - { - return "\x1B[36m" + text + "\x1B[39m"; - } - - public static string White(this string text) - { - return "\x1B[37m" + text + "\x1B[39m"; - } - - public static string Bold(this string text) - { - return "\x1B[1m" + text + "\x1B[22m"; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/AnsiConsole.cs b/src/Microsoft.DotNet.Cli.Utils/AnsiConsole.cs deleted file mode 100644 index 0cb60923f..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/AnsiConsole.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class AnsiConsole - { - private const int Light = 0x08; - - private AnsiConsole(TextWriter writer) - { - Writer = writer; - - OriginalForegroundColor = Console.ForegroundColor; - _boldRecursion = ((int)OriginalForegroundColor & Light) != 0 ? 1 : 0; - } - - private int _boldRecursion; - - public static AnsiConsole GetOutput() - { - return new AnsiConsole(Console.Out); - } - - public static AnsiConsole GetError() - { - return new AnsiConsole(Console.Error); - } - - public TextWriter Writer { get; } - - public ConsoleColor OriginalForegroundColor { get; } - - private void SetColor(ConsoleColor color) - { - int c = (int)color; - - Console.ForegroundColor = - c < 0 ? color : // unknown, just use it - _boldRecursion > 0 ? (ConsoleColor)(c | Light) : // ensure color is light - (ConsoleColor)(c & ~Light); // ensure color is dark - } - - private void SetBold(bool bold) - { - _boldRecursion += bold ? 1 : -1; - if (_boldRecursion > 1 || (_boldRecursion == 1 && !bold)) - { - return; - } - - // switches on _boldRecursion to handle boldness - SetColor(Console.ForegroundColor); - } - - public void WriteLine(string message) - { - Write(message); - Writer.WriteLine(); - } - - - public void Write(string message) - { - var escapeScan = 0; - for (;;) - { - var escapeIndex = message.IndexOf("\x1b[", escapeScan, StringComparison.Ordinal); - if (escapeIndex == -1) - { - var text = message.Substring(escapeScan); - Writer.Write(text); - break; - } - else - { - var startIndex = escapeIndex + 2; - var endIndex = startIndex; - while (endIndex != message.Length && - message[endIndex] >= 0x20 && - message[endIndex] <= 0x3f) - { - endIndex += 1; - } - - var text = message.Substring(escapeScan, escapeIndex - escapeScan); - Writer.Write(text); - if (endIndex == message.Length) - { - break; - } - - switch (message[endIndex]) - { - case 'm': - int value; - if (int.TryParse(message.Substring(startIndex, endIndex - startIndex), out value)) - { - switch (value) - { - case 1: - SetBold(true); - break; - case 22: - SetBold(false); - break; - case 30: - SetColor(ConsoleColor.Black); - break; - case 31: - SetColor(ConsoleColor.Red); - break; - case 32: - SetColor(ConsoleColor.Green); - break; - case 33: - SetColor(ConsoleColor.Yellow); - break; - case 34: - SetColor(ConsoleColor.Blue); - break; - case 35: - SetColor(ConsoleColor.Magenta); - break; - case 36: - SetColor(ConsoleColor.Cyan); - break; - case 37: - SetColor(ConsoleColor.Gray); - break; - case 39: - Console.ForegroundColor = OriginalForegroundColor; - break; - } - } - break; - } - - escapeScan = endIndex + 1; - } - } - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/ArgumentEscaper.cs b/src/Microsoft.DotNet.Cli.Utils/ArgumentEscaper.cs deleted file mode 100644 index c8469a9ac..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/ArgumentEscaper.cs +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Microsoft.DotNet.Cli.Utils -{ - public static class ArgumentEscaper - { - /// - /// Undo the processing which took place to create string[] args in Main, - /// so that the next process will receive the same string[] args - /// - /// See here for more info: - /// http://blogs.msdn.com/b/twistylittlepassagesallalike/archive/2011/04/23/everyone-quotes-arguments-the-wrong-way.aspx - /// - /// - /// - public static string EscapeAndConcatenateArgArrayForProcessStart(IEnumerable args) - { - return string.Join(" ", EscapeArgArray(args)); - } - - /// - /// Undo the processing which took place to create string[] args in Main, - /// so that the next process will receive the same string[] args - /// - /// See here for more info: - /// http://blogs.msdn.com/b/twistylittlepassagesallalike/archive/2011/04/23/everyone-quotes-arguments-the-wrong-way.aspx - /// - /// - /// - public static string EscapeAndConcatenateArgArrayForCmdProcessStart(IEnumerable args) - { - return string.Join(" ", EscapeArgArrayForCmd(args)); - } - - /// - /// Undo the processing which took place to create string[] args in Main, - /// so that the next process will receive the same string[] args - /// - /// See here for more info: - /// http://blogs.msdn.com/b/twistylittlepassagesallalike/archive/2011/04/23/everyone-quotes-arguments-the-wrong-way.aspx - /// - /// - /// - private static IEnumerable EscapeArgArray(IEnumerable args) - { - var escapedArgs = new List(); - - foreach (var arg in args) - { - escapedArgs.Add(EscapeSingleArg(arg)); - } - - return escapedArgs; - } - - /// - /// This prefixes every character with the '^' character to force cmd to - /// interpret the argument string literally. An alternative option would - /// be to do this only for cmd metacharacters. - /// - /// See here for more info: - /// http://blogs.msdn.com/b/twistylittlepassagesallalike/archive/2011/04/23/everyone-quotes-arguments-the-wrong-way.aspx - /// - /// - /// - private static IEnumerable EscapeArgArrayForCmd(IEnumerable arguments) - { - var escapedArgs = new List(); - - foreach (var arg in arguments) - { - escapedArgs.Add(EscapeArgForCmd(arg)); - } - - return escapedArgs; - } - - public static string EscapeSingleArg(string arg) - { - var sb = new StringBuilder(); - - var needsQuotes = ShouldSurroundWithQuotes(arg); - var isQuoted = needsQuotes || IsSurroundedWithQuotes(arg); - - if (needsQuotes) sb.Append("\""); - - for (int i = 0; i < arg.Length; ++i) - { - var backslashCount = 0; - - // Consume All Backslashes - while (i < arg.Length && arg[i] == '\\') - { - backslashCount++; - i++; - } - - // Escape any backslashes at the end of the arg - // when the argument is also quoted. - // This ensures the outside quote is interpreted as - // an argument delimiter - if (i == arg.Length && isQuoted) - { - sb.Append('\\', 2 * backslashCount); - } - - // At then end of the arg, which isn't quoted, - // just add the backslashes, no need to escape - else if (i == arg.Length) - { - sb.Append('\\', backslashCount); - } - - // Escape any preceding backslashes and the quote - else if (arg[i] == '"') - { - sb.Append('\\', (2 * backslashCount) + 1); - sb.Append('"'); - } - - // Output any consumed backslashes and the character - else - { - sb.Append('\\', backslashCount); - sb.Append(arg[i]); - } - } - - if (needsQuotes) sb.Append("\""); - - return sb.ToString(); - } - - /// - /// Prepare as single argument to - /// roundtrip properly through cmd. - /// - /// This prefixes every character with the '^' character to force cmd to - /// interpret the argument string literally. An alternative option would - /// be to do this only for cmd metacharacters. - /// - /// See here for more info: - /// http://blogs.msdn.com/b/twistylittlepassagesallalike/archive/2011/04/23/everyone-quotes-arguments-the-wrong-way.aspx - /// - /// - /// - private static string EscapeArgForCmd(string argument) - { - var sb = new StringBuilder(); - - var quoted = ShouldSurroundWithQuotes(argument); - - if (quoted) sb.Append("^\""); - - // Prepend every character with ^ - // This is harmless when passing through cmd - // and ensures cmd metacharacters are not interpreted - // as such - foreach (var character in argument) - { - sb.Append("^"); - sb.Append(character); - } - - if (quoted) sb.Append("^\""); - - return sb.ToString(); - } - - internal static bool ShouldSurroundWithQuotes(string argument) - { - // Don't quote already quoted strings - if (IsSurroundedWithQuotes(argument)) - { - return false; - } - - // Only quote if whitespace exists in the string - return ArgumentContainsWhitespace(argument); - } - - internal static bool IsSurroundedWithQuotes(string argument) - { - return argument.StartsWith("\"", StringComparison.Ordinal) && - argument.EndsWith("\"", StringComparison.Ordinal); - } - - internal static bool ArgumentContainsWhitespace(string argument) - { - return argument.Contains(" ") || argument.Contains("\t") || argument.Contains("\n"); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/BlockingMemoryStream.cs b/src/Microsoft.DotNet.Cli.Utils/BlockingMemoryStream.cs deleted file mode 100644 index e80061b01..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/BlockingMemoryStream.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Concurrent; -using System.IO; -using System.Threading; - -namespace Microsoft.DotNet.Cli.Utils -{ - /// - /// An in-memory stream that will block any read calls until something was written to it. - /// - public sealed class BlockingMemoryStream : Stream - { - private readonly BlockingCollection _buffers = new BlockingCollection(); - private ArraySegment _remaining; - - public override void Write(byte[] buffer, int offset, int count) - { - byte[] tmp = new byte[count]; - Buffer.BlockCopy(buffer, offset, tmp, 0, count); - _buffers.Add(tmp); - } - - public override int Read(byte[] buffer, int offset, int count) - { - if (count == 0) - { - return 0; - } - - if (_remaining.Count == 0) - { - byte[] tmp; - if (!_buffers.TryTake(out tmp, Timeout.Infinite) || tmp.Length == 0) - { - return 0; - } - _remaining = new ArraySegment(tmp, 0, tmp.Length); - } - - if (_remaining.Count <= count) - { - count = _remaining.Count; - Buffer.BlockCopy(_remaining.Array, _remaining.Offset, buffer, offset, count); - _remaining = default(ArraySegment); - } - else - { - Buffer.BlockCopy(_remaining.Array, _remaining.Offset, buffer, offset, count); - _remaining = new ArraySegment(_remaining.Array, _remaining.Offset + count, _remaining.Count - count); - } - return count; - } - - public void DoneWriting() - { - _buffers.CompleteAdding(); - } - - protected override void Dispose(bool disposing) - { - if (disposing) - { - _buffers.Dispose(); - } - - base.Dispose(disposing); - } - - public override bool CanRead => true; - public override bool CanSeek => false; - public override bool CanWrite => true; - public override long Length { get { throw new NotImplementedException(); } } - public override long Position { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } - public override void Flush() { } - public override long Seek(long offset, SeekOrigin origin) { throw new NotImplementedException(); } - public override void SetLength(long value) { throw new NotImplementedException(); } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/BuiltInCommand.cs b/src/Microsoft.DotNet.Cli.Utils/BuiltInCommand.cs deleted file mode 100644 index f862ba83d..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/BuiltInCommand.cs +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) .NET 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.IO; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -namespace Microsoft.DotNet.Cli.Utils -{ - /// - /// A Command that is capable of running in the current process. - /// - public class BuiltInCommand : ICommand - { - private readonly IEnumerable _commandArgs; - private readonly Func _builtInCommand; - private readonly IBuiltInCommandEnvironment _environment; - private readonly StreamForwarder _stdOut; - private readonly StreamForwarder _stdErr; - private string _workingDirectory; - - public string CommandName { get; } - public string CommandArgs => string.Join(" ", _commandArgs); - - public BuiltInCommand(string commandName, IEnumerable commandArgs, Func builtInCommand) - : this(commandName, commandArgs, builtInCommand, new BuiltInCommandEnvironment()) - { - } - - internal BuiltInCommand(string commandName, IEnumerable commandArgs, Func builtInCommand, IBuiltInCommandEnvironment environment) - { - CommandName = commandName; - _commandArgs = commandArgs; - _builtInCommand = builtInCommand; - _environment = environment; - - _stdOut = new StreamForwarder(); - _stdErr = new StreamForwarder(); - } - - public CommandResult Execute() - { - TextWriter originalConsoleOut = _environment.GetConsoleOut(); - TextWriter originalConsoleError = _environment.GetConsoleError(); - string originalWorkingDirectory = _environment.GetWorkingDirectory(); - - try - { - // redirecting the standard out and error so we can forward - // the output to the caller - using (BlockingMemoryStream outStream = new BlockingMemoryStream()) - using (BlockingMemoryStream errorStream = new BlockingMemoryStream()) - { - _environment.SetConsoleOut(new StreamWriter(outStream) { AutoFlush = true }); - _environment.SetConsoleError(new StreamWriter(errorStream) { AutoFlush = true }); - - // Reset the Reporters to the new Console Out and Error. - Reporter.Reset(); - - if (!string.IsNullOrEmpty(_workingDirectory)) - { - _environment.SetWorkingDirectory(_workingDirectory); - } - - var taskOut = _stdOut.BeginRead(new StreamReader(outStream)); - var taskErr = _stdErr.BeginRead(new StreamReader(errorStream)); - - int exitCode = _builtInCommand(_commandArgs.ToArray()); - - outStream.DoneWriting(); - errorStream.DoneWriting(); - - Task.WaitAll(taskOut, taskErr); - - // fake out a ProcessStartInfo using the Muxer command name, since this is a built-in command - ProcessStartInfo startInfo = new ProcessStartInfo(new Muxer().MuxerPath, $"{CommandName} {CommandArgs}"); - return new CommandResult(startInfo, exitCode, null, null); - } - } - finally - { - _environment.SetConsoleOut(originalConsoleOut); - _environment.SetConsoleError(originalConsoleError); - _environment.SetWorkingDirectory(originalWorkingDirectory); - - Reporter.Reset(); - } - } - - public ICommand OnOutputLine(Action handler) - { - if (handler == null) - { - throw new ArgumentNullException(nameof(handler)); - } - - _stdOut.ForwardTo(writeLine: handler); - - return this; - } - - public ICommand OnErrorLine(Action handler) - { - if (handler == null) - { - throw new ArgumentNullException(nameof(handler)); - } - - _stdErr.ForwardTo(writeLine: handler); - - return this; - } - - public ICommand WorkingDirectory(string workingDirectory) - { - _workingDirectory = workingDirectory; - - return this; - } - - private class BuiltInCommandEnvironment : IBuiltInCommandEnvironment - { - public TextWriter GetConsoleOut() - { - return Console.Out; - } - - public void SetConsoleOut(TextWriter newOut) - { - Console.SetOut(newOut); - } - - public TextWriter GetConsoleError() - { - return Console.Error; - } - - public void SetConsoleError(TextWriter newError) - { - Console.SetError(newError); - } - - public string GetWorkingDirectory() - { - return Directory.GetCurrentDirectory(); - } - - public void SetWorkingDirectory(string path) - { - Directory.SetCurrentDirectory(path); - } - } - - public CommandResolutionStrategy ResolutionStrategy - { - get - { - throw new NotImplementedException(); - } - } - - public ICommand CaptureStdErr() - { - _stdErr.Capture(); - - return this; - } - - public ICommand CaptureStdOut() - { - _stdOut.Capture(); - - return this; - } - - public ICommand EnvironmentVariable(string name, string value) - { - throw new NotImplementedException(); - } - - public ICommand ForwardStdErr(TextWriter to = null, bool onlyIfVerbose = false, bool ansiPassThrough = true) - { - throw new NotImplementedException(); - } - - public ICommand ForwardStdOut(TextWriter to = null, bool onlyIfVerbose = false, bool ansiPassThrough = true) - { - throw new NotImplementedException(); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/Command.cs b/src/Microsoft.DotNet.Cli.Utils/Command.cs deleted file mode 100644 index 3413c1350..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/Command.cs +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright (c) .NET 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.IO; -using System.Linq; -using System.Runtime.CompilerServices; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class Command : ICommand - { - private readonly Process _process; - - private StreamForwarder _stdOut; - - private StreamForwarder _stdErr; - - private bool _running = false; - - private Command(CommandSpec commandSpec) - { - var psi = new ProcessStartInfo - { - FileName = commandSpec.Path, - Arguments = commandSpec.Args, - UseShellExecute = false - }; - - foreach(var environmentVariable in commandSpec.EnvironmentVariables) - { - if (!psi.Environment.ContainsKey(environmentVariable.Key)) - { - psi.Environment.Add(environmentVariable.Key, environmentVariable.Value); - } - } - - _process = new Process - { - StartInfo = psi - }; - - ResolutionStrategy = commandSpec.ResolutionStrategy; - } - - public static Command CreateDotNet( - string commandName, - IEnumerable args, - NuGetFramework framework = null, - string configuration = Constants.DefaultConfiguration) - { - return Create("dotnet", - new[] { commandName }.Concat(args), - framework, - configuration: configuration); - } - - /// - /// Create a command with the specified arg array. Args will be - /// escaped properly to ensure that exactly the strings in this - /// array will be present in the corresponding argument array - /// in the command's process. - /// - public static Command Create( - string commandName, - IEnumerable args, - NuGetFramework framework = null, - string configuration = Constants.DefaultConfiguration, - string outputPath = null, - string applicationName = null) - { - return Create( - new DefaultCommandResolverPolicy(), - commandName, - args, - framework, - configuration, - outputPath, - applicationName); - } - - public static Command Create( - ICommandResolverPolicy commandResolverPolicy, - string commandName, - IEnumerable args, - NuGetFramework framework = null, - string configuration = Constants.DefaultConfiguration, - string outputPath = null, - string applicationName = null) - { - var commandSpec = CommandResolver.TryResolveCommandSpec( - commandResolverPolicy, - commandName, - args, - framework, - configuration: configuration, - outputPath: outputPath, - applicationName: applicationName); - - if (commandSpec == null) - { - throw new CommandUnknownException(commandName); - } - - var command = new Command(commandSpec); - - return command; - } - - public static Command Create(CommandSpec commandSpec) - { - return new Command(commandSpec); - } - - public CommandResult Execute() - { - - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.RunningFileNameArguments, - _process.StartInfo.FileName, - _process.StartInfo.Arguments)); - - ThrowIfRunning(); - - _running = true; - - _process.EnableRaisingEvents = true; - -#if DEBUG - var sw = Stopwatch.StartNew(); - - Reporter.Verbose.WriteLine($"> {FormatProcessInfo(_process.StartInfo)}".White()); -#endif - using (PerfTrace.Current.CaptureTiming($"{Path.GetFileNameWithoutExtension(_process.StartInfo.FileName)} {_process.StartInfo.Arguments}")) - { - _process.Start(); - - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.ProcessId, - _process.Id)); - - var taskOut = _stdOut?.BeginRead(_process.StandardOutput); - var taskErr = _stdErr?.BeginRead(_process.StandardError); - _process.WaitForExit(); - - taskOut?.Wait(); - taskErr?.Wait(); - } - - var exitCode = _process.ExitCode; - -#if DEBUG - var message = string.Format( - LocalizableStrings.ProcessExitedWithCode, - FormatProcessInfo(_process.StartInfo), - exitCode, - sw.ElapsedMilliseconds); - if (exitCode == 0) - { - Reporter.Verbose.WriteLine(message.Green()); - } - else - { - Reporter.Verbose.WriteLine(message.Red().Bold()); - } -#endif - - return new CommandResult( - _process.StartInfo, - exitCode, - _stdOut?.CapturedOutput, - _stdErr?.CapturedOutput); - } - - public ICommand WorkingDirectory(string projectDirectory) - { - _process.StartInfo.WorkingDirectory = projectDirectory; - return this; - } - - public ICommand EnvironmentVariable(string name, string value) - { -#if NET451 - _process.StartInfo.EnvironmentVariables[name] = value; -#else - _process.StartInfo.Environment[name] = value; -#endif - return this; - } - - public ICommand CaptureStdOut() - { - ThrowIfRunning(); - EnsureStdOut(); - _stdOut.Capture(); - return this; - } - - public ICommand CaptureStdErr() - { - ThrowIfRunning(); - EnsureStdErr(); - _stdErr.Capture(); - return this; - } - - public ICommand ForwardStdOut(TextWriter to = null, bool onlyIfVerbose = false, bool ansiPassThrough = true) - { - ThrowIfRunning(); - if (!onlyIfVerbose || CommandContext.IsVerbose()) - { - EnsureStdOut(); - - if (to == null) - { - _stdOut.ForwardTo(writeLine: Reporter.Output.WriteLine); - EnvironmentVariable(CommandContext.Variables.AnsiPassThru, ansiPassThrough.ToString()); - } - else - { - _stdOut.ForwardTo(writeLine: to.WriteLine); - } - } - return this; - } - - public ICommand ForwardStdErr(TextWriter to = null, bool onlyIfVerbose = false, bool ansiPassThrough = true) - { - ThrowIfRunning(); - if (!onlyIfVerbose || CommandContext.IsVerbose()) - { - EnsureStdErr(); - - if (to == null) - { - _stdErr.ForwardTo(writeLine: Reporter.Error.WriteLine); - EnvironmentVariable(CommandContext.Variables.AnsiPassThru, ansiPassThrough.ToString()); - } - else - { - _stdErr.ForwardTo(writeLine: to.WriteLine); - } - } - return this; - } - - public ICommand OnOutputLine(Action handler) - { - ThrowIfRunning(); - EnsureStdOut(); - - _stdOut.ForwardTo(writeLine: handler); - return this; - } - - public ICommand OnErrorLine(Action handler) - { - ThrowIfRunning(); - EnsureStdErr(); - - _stdErr.ForwardTo(writeLine: handler); - return this; - } - - public CommandResolutionStrategy ResolutionStrategy { get; } - - public string CommandName => _process.StartInfo.FileName; - - public string CommandArgs => _process.StartInfo.Arguments; - - private string FormatProcessInfo(ProcessStartInfo info) - { - if (string.IsNullOrWhiteSpace(info.Arguments)) - { - return info.FileName; - } - - return info.FileName + " " + info.Arguments; - } - - private void EnsureStdOut() - { - _stdOut = _stdOut ?? new StreamForwarder(); - _process.StartInfo.RedirectStandardOutput = true; - } - - private void EnsureStdErr() - { - _stdErr = _stdErr ?? new StreamForwarder(); - _process.StartInfo.RedirectStandardError = true; - } - - private void ThrowIfRunning([CallerMemberName] string memberName = null) - { - if (_running) - { - throw new InvalidOperationException(string.Format( - LocalizableStrings.UnableToInvokeMemberNameAfterCommand, - memberName)); - } - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandContext.cs b/src/Microsoft.DotNet.Cli.Utils/CommandContext.cs deleted file mode 100644 index 9913cde73..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandContext.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Microsoft.DotNet.Cli.Utils -{ - public static class CommandContext - { - public static class Variables - { - private static readonly string Prefix = "DOTNET_CLI_CONTEXT_"; - public static readonly string Verbose = Prefix + "VERBOSE"; - public static readonly string AnsiPassThru = Prefix + "ANSI_PASS_THRU"; - } - - private static Lazy _verbose = new Lazy(() => Env.GetEnvironmentVariableAsBool(Variables.Verbose)); - private static Lazy _ansiPassThru = new Lazy(() => Env.GetEnvironmentVariableAsBool(Variables.AnsiPassThru)); - - public static bool IsVerbose() - { - return _verbose.Value; - } - - public static bool ShouldPassAnsiCodesThrough() - { - return _ansiPassThru.Value; - } - - public static void SetVerbose(bool value) - { - _verbose = new Lazy(() => value); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandFactory.cs b/src/Microsoft.DotNet.Cli.Utils/CommandFactory.cs deleted file mode 100644 index f4802113b..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandFactory.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class CommandFactory : ICommandFactory - { - public ICommand Create( - string commandName, - IEnumerable args, - NuGetFramework framework = null, - string configuration = Constants.DefaultConfiguration) - { - return Command.Create(commandName, args, framework, configuration); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandParsing/Chain.cs b/src/Microsoft.DotNet.Cli.Utils/CommandParsing/Chain.cs deleted file mode 100644 index 5032b659f..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandParsing/Chain.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.DotNet.Cli.Utils.CommandParsing -{ - public struct Chain - { - public Chain(TLeft left, TDown down) - : this() - { - Left = left; - Down = down; - } - - public readonly TLeft Left; - public readonly TDown Down; - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandParsing/CommandGrammar.cs b/src/Microsoft.DotNet.Cli.Utils/CommandParsing/CommandGrammar.cs deleted file mode 100644 index 5d682ab39..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandParsing/CommandGrammar.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.Cli.Utils.CommandParsing -{ - public class CommandGrammar : Grammar - { - private CommandGrammar(Func variable, bool preserveSurroundingQuotes) - { - var environmentVariablePiece = Ch('%').And(Rep(Ch().Not(Ch('%')))).And(Ch('%')).Left().Down().Str() - .Build(key => variable(key) ?? "%" + key + "%"); - - var escapeSequencePiece = - Ch('%').And(Ch('%')).Build(_=>"%") - .Or(Ch('^').And(Ch('^')).Build(_ => "^")) - .Or(Ch('\\').And(Ch('\\')).Build(_ => "\\")) - .Or(Ch('\\').And(Ch('\"')).Build(_ => "\"")) - ; - - var specialPiece = environmentVariablePiece.Or(escapeSequencePiece); - - var unquotedPiece = Rep1(Ch().Not(specialPiece).Not(Ch(' '))).Str(); - - var quotedPiece = Rep1(Ch().Not(specialPiece).Not(Ch('\"'))).Str(); - - var unquotedTerm = Rep1(unquotedPiece.Or(specialPiece)).Str(); - - var quotedTerm = Ch('\"').And(Rep(quotedPiece.Or(specialPiece)).Str()).And(Ch('\"')).Left().Down(); - if (preserveSurroundingQuotes) - { - // Str() value assigned to quotedTerm does not include quotation marks surrounding the quoted or - // special piece. Add those quotes back if requested. - quotedTerm = quotedTerm.Build(str => "\"" + str + "\""); - } - - var whitespace = Rep(Ch(' ')); - - var term = whitespace.And(quotedTerm.Or(unquotedTerm)).And(whitespace).Left().Down(); - - Parse = Rep(term); - } - - public readonly Parser> Parse; - - public static string[] Process(string text, Func variables, bool preserveSurroundingQuotes) - { - var grammar = new CommandGrammar(variables, preserveSurroundingQuotes); - var cursor = new Cursor(text, 0, text.Length); - - var result = grammar.Parse(cursor); - if (!result.Remainder.IsEnd) - { - throw new ArgumentException(string.Format(LocalizableStrings.MalformedText, nameof(text))); - } - return result.Value.ToArray(); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandParsing/Cursor.cs b/src/Microsoft.DotNet.Cli.Utils/CommandParsing/Cursor.cs deleted file mode 100644 index b46bf92e3..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandParsing/Cursor.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.DotNet.Cli.Utils.CommandParsing -{ - public struct Cursor - { - private readonly string _text; - private readonly int _start; - private readonly int _end; - - public Cursor(string text, int start, int end) - { - _text = text; - _start = start; - _end = end; - } - - public bool IsEnd - { - get { return _start == _end; } - } - - public char Peek(int index) - { - return (index + _start) >= _end ? (char)0 : _text[index + _start]; - } - - public Result Advance(TValue result, int length) - { - return new Result(result, new Cursor(_text, _start + length, _end)); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandParsing/Grammar.cs b/src/Microsoft.DotNet.Cli.Utils/CommandParsing/Grammar.cs deleted file mode 100644 index 431e65023..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandParsing/Grammar.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.DotNet.Cli.Utils.CommandParsing -{ - public class Grammar - { - protected static Parser> Rep1(Parser parser) - { - Parser> rep = Rep(parser); - return pos => - { - var result = rep(pos); - return result.IsEmpty || !result.Value.Any() ? Result>.Empty : result; - }; - } - - protected static Parser> Rep(Parser parser) - { - return pos => - { - var data = new List(); - for (; ; ) - { - var result = parser(pos); - if (result.IsEmpty) break; - data.Add(result.Value); - pos = result.Remainder; - } - return new Result>(data, pos); - }; - } - - protected static Parser Ch() - { - return pos => pos.IsEnd ? Result.Empty : pos.Advance(pos.Peek(0), 1); - } - - private static Parser IsEnd() - { - return pos => pos.IsEnd ? pos.Advance(true, 0) : Result.Empty; - } - - protected static Parser Ch(char ch) - { - return pos => pos.Peek(0) != ch ? Result.Empty : pos.Advance(ch, 1); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandParsing/Parser.cs b/src/Microsoft.DotNet.Cli.Utils/CommandParsing/Parser.cs deleted file mode 100644 index 6be28ec40..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandParsing/Parser.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.DotNet.Cli.Utils.CommandParsing -{ - public delegate Result Parser(Cursor cursor); -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandParsing/ParserExtensions.cs b/src/Microsoft.DotNet.Cli.Utils/CommandParsing/ParserExtensions.cs deleted file mode 100644 index 69be3968b..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandParsing/ParserExtensions.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.DotNet.Cli.Utils.CommandParsing -{ - public static class ParserExtensions - { - public static Parser> And(this Parser parser1, - Parser parser2) - { - return pos => - { - var result1 = parser1(pos); - if (result1.IsEmpty) return Result>.Empty; - var result2 = parser2(result1.Remainder); - if (result2.IsEmpty) return Result>.Empty; - return result2.AsValue(new Chain(result1.Value, result2.Value)); - }; - } - - public static Parser Or(this Parser parser1, Parser parser2) - { - return pos => - { - var result1 = parser1(pos); - if (!result1.IsEmpty) return result1; - var result2 = parser2(pos); - if (!result2.IsEmpty) return result2; - return Result.Empty; - }; - } - - public static Parser Not(this Parser parser1, Parser parser2) - { - return pos => - { - var result2 = parser2(pos); - if (!result2.IsEmpty) return Result.Empty; - return parser1(pos); - }; - } - - public static Parser Left(this Parser> parser) - { - return pos => - { - var result = parser(pos); - return result.IsEmpty ? Result.Empty : result.AsValue(result.Value.Left); - }; - } - - public static Parser Down(this Parser> parser) - { - return pos => - { - var result = parser(pos); - return result.IsEmpty ? Result.Empty : result.AsValue(result.Value.Down); - }; - } - - public static Parser Build(this Parser parser, Func builder) - { - return pos => - { - var result = parser(pos); - if (result.IsEmpty) return Result.Empty; - return result.AsValue(builder(result.Value)); - }; - } - - public static Parser Str(this Parser> parser) - { - return parser.Build(x => new string(x.ToArray())); - } - - public static Parser Str(this Parser> parser) - { - return parser.Build(x => String.Concat(x.ToArray())); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandParsing/Result.cs b/src/Microsoft.DotNet.Cli.Utils/CommandParsing/Result.cs deleted file mode 100644 index 26eff19e6..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandParsing/Result.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. - -namespace Microsoft.DotNet.Cli.Utils.CommandParsing -{ - public struct Result - { - public Result(TValue value, Cursor remainder) - : this() - { - Value = value; - Remainder = remainder; - } - - public readonly TValue Value; - public readonly Cursor Remainder; - - public bool IsEmpty - { - get { return Equals(this, default(Result)); } - } - - public static Result Empty - { - get { return default(Result); } - } - - public Result AsValue(TValue2 value2) - { - return new Result(value2, Remainder); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/AbstractPathBasedCommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/AbstractPathBasedCommandResolver.cs deleted file mode 100644 index 396083fbc..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/AbstractPathBasedCommandResolver.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -namespace Microsoft.DotNet.Cli.Utils -{ - public abstract class AbstractPathBasedCommandResolver : ICommandResolver - { - protected IEnvironmentProvider _environment; - protected IPlatformCommandSpecFactory _commandSpecFactory; - - public AbstractPathBasedCommandResolver(IEnvironmentProvider environment, - IPlatformCommandSpecFactory commandSpecFactory) - { - if (environment == null) - { - throw new ArgumentNullException(nameof(environment)); - } - - if (commandSpecFactory == null) - { - throw new ArgumentNullException(nameof(commandSpecFactory)); - } - - _environment = environment; - _commandSpecFactory = commandSpecFactory; - } - - public CommandSpec Resolve(CommandResolverArguments commandResolverArguments) - { - if (commandResolverArguments.CommandName == null) - { - return null; - } - - var commandPath = ResolveCommandPath(commandResolverArguments); - - if (commandPath == null) - { - return null; - } - - return _commandSpecFactory.CreateCommandSpec( - commandResolverArguments.CommandName, - commandResolverArguments.CommandArguments.OrEmptyIfNull(), - commandPath, - GetCommandResolutionStrategy(), - _environment); - } - - internal abstract string ResolveCommandPath(CommandResolverArguments commandResolverArguments); - internal abstract CommandResolutionStrategy GetCommandResolutionStrategy(); - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/AppBaseCommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/AppBaseCommandResolver.cs deleted file mode 100644 index 85192dc29..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/AppBaseCommandResolver.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.PlatformAbstractions; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class AppBaseCommandResolver : AbstractPathBasedCommandResolver - { - public AppBaseCommandResolver(IEnvironmentProvider environment, - IPlatformCommandSpecFactory commandSpecFactory) : base(environment, commandSpecFactory) { } - - internal override string ResolveCommandPath(CommandResolverArguments commandResolverArguments) - { - return _environment.GetCommandPathFromRootPath( - ApplicationEnvironment.ApplicationBasePath, - commandResolverArguments.CommandName); - } - - internal override CommandResolutionStrategy GetCommandResolutionStrategy() - { - return CommandResolutionStrategy.BaseDirectory; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/AppBaseDllCommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/AppBaseDllCommandResolver.cs deleted file mode 100644 index 95310fc8e..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/AppBaseDllCommandResolver.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.IO; -using System.Linq; -using Microsoft.DotNet.PlatformAbstractions; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class AppBaseDllCommandResolver : ICommandResolver - { - public CommandSpec Resolve(CommandResolverArguments commandResolverArguments) - { - if (commandResolverArguments.CommandName == null) - { - return null; - } - if (commandResolverArguments.CommandName.EndsWith(FileNameSuffixes.DotNet.DynamicLib)) - { - var localPath = Path.Combine(ApplicationEnvironment.ApplicationBasePath, - commandResolverArguments.CommandName); - if (File.Exists(localPath)) - { - var escapedArgs = ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart( - new[] { localPath } - .Concat(commandResolverArguments.CommandArguments.OrEmptyIfNull())); - return new CommandSpec( - new Muxer().MuxerPath, - escapedArgs, - CommandResolutionStrategy.RootedPath); - } - } - return null; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/CommandResolutionStrategy.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/CommandResolutionStrategy.cs deleted file mode 100644 index da52bf31b..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/CommandResolutionStrategy.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.DotNet.Cli.Utils -{ - public enum CommandResolutionStrategy - { - // command loaded from a deps file - DepsFile, - - // command loaded from project dependencies nuget package - ProjectDependenciesPackage, - - // command loaded from project tools nuget package - ProjectToolsPackage, - - // command loaded from the same directory as the executing assembly - BaseDirectory, - - // command loaded from the same directory as a project.json file - ProjectLocal, - - // command loaded from PATH environment variable - Path, - - // command loaded from rooted path - RootedPath, - - // command loaded from project build output path - OutputPath, - - // command not found - None - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/CommandResolverArguments.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/CommandResolverArguments.cs deleted file mode 100644 index 2658dea5e..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/CommandResolverArguments.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class CommandResolverArguments - { - public string CommandName { get; set; } - - public IEnumerable CommandArguments { get; set; } - - public NuGetFramework Framework { get; set; } - - public string OutputPath { get; set; } - - public string ProjectDirectory { get; set; } - - public string Configuration { get; set; } - - public IEnumerable InferredExtensions { get; set; } - - public string BuildBasePath { get; set; } - - public string DepsJsonFile { get; set; } - - public string ApplicationName { get; set; } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/CompositeCommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/CompositeCommandResolver.cs deleted file mode 100644 index 35a1ee041..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/CompositeCommandResolver.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class CompositeCommandResolver : ICommandResolver - { - private IList _orderedCommandResolvers; - - public IEnumerable OrderedCommandResolvers - { - get - { - return _orderedCommandResolvers; - } - } - - public CompositeCommandResolver() - { - _orderedCommandResolvers = new List(); - } - - public void AddCommandResolver(ICommandResolver commandResolver) - { - _orderedCommandResolvers.Add(commandResolver); - } - - public CommandSpec Resolve(CommandResolverArguments commandResolverArguments) - { - foreach (var commandResolver in _orderedCommandResolvers) - { - var commandSpec = commandResolver.Resolve(commandResolverArguments); - - if (commandSpec != null) - { - return commandSpec; - } - } - - return null; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/DefaultCommandResolverPolicy.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/DefaultCommandResolverPolicy.cs deleted file mode 100644 index d8a2c464b..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/DefaultCommandResolverPolicy.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.PlatformAbstractions; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class DefaultCommandResolverPolicy : ICommandResolverPolicy - { - public CompositeCommandResolver CreateCommandResolver() - { - return Create(); - } - - public static CompositeCommandResolver Create() - { - var environment = new EnvironmentProvider(); - var packagedCommandSpecFactory = new PackagedCommandSpecFactoryWithCliRuntime(); - var publishedPathCommandSpecFactory = new PublishPathCommandSpecFactory(); - - var platformCommandSpecFactory = default(IPlatformCommandSpecFactory); - if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows) - { - platformCommandSpecFactory = new WindowsExePreferredCommandSpecFactory(); - } - else - { - platformCommandSpecFactory = new GenericPlatformCommandSpecFactory(); - } - - return CreateDefaultCommandResolver( - environment, - packagedCommandSpecFactory, - platformCommandSpecFactory, - publishedPathCommandSpecFactory); - } - - public static CompositeCommandResolver CreateDefaultCommandResolver( - IEnvironmentProvider environment, - IPackagedCommandSpecFactory packagedCommandSpecFactory, - IPlatformCommandSpecFactory platformCommandSpecFactory, - IPublishedPathCommandSpecFactory publishedPathCommandSpecFactory) - { - var compositeCommandResolver = new CompositeCommandResolver(); - - compositeCommandResolver.AddCommandResolver(new MuxerCommandResolver()); - compositeCommandResolver.AddCommandResolver(new RootedCommandResolver()); - compositeCommandResolver.AddCommandResolver( - new ProjectToolsCommandResolver(packagedCommandSpecFactory, environment)); - compositeCommandResolver.AddCommandResolver(new AppBaseDllCommandResolver()); - compositeCommandResolver.AddCommandResolver( - new AppBaseCommandResolver(environment, platformCommandSpecFactory)); - compositeCommandResolver.AddCommandResolver( - new PathCommandResolver(environment, platformCommandSpecFactory)); - compositeCommandResolver.AddCommandResolver( - new PublishedPathCommandResolver(environment, publishedPathCommandSpecFactory)); - - return compositeCommandResolver; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/DepsJsonCommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/DepsJsonCommandResolver.cs deleted file mode 100644 index 387dfc28f..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/DepsJsonCommandResolver.cs +++ /dev/null @@ -1,256 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -using Microsoft.Extensions.DependencyModel; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class DepsJsonCommandResolver : ICommandResolver - { - private static readonly string[] s_extensionPreferenceOrder = new[] - { - "", - ".exe", - ".dll" - }; - - private string _nugetPackageRoot; - private Muxer _muxer; - - public DepsJsonCommandResolver(string nugetPackageRoot) - : this(new Muxer(), nugetPackageRoot) { } - - public DepsJsonCommandResolver(Muxer muxer, string nugetPackageRoot) - { - _muxer = muxer; - _nugetPackageRoot = nugetPackageRoot; - } - - public CommandSpec Resolve(CommandResolverArguments commandResolverArguments) - { - if (commandResolverArguments.CommandName == null - || commandResolverArguments.DepsJsonFile == null) - { - return null; - } - - return ResolveFromDepsJsonFile( - commandResolverArguments.CommandName, - commandResolverArguments.CommandArguments.OrEmptyIfNull(), - commandResolverArguments.DepsJsonFile); - } - - private CommandSpec ResolveFromDepsJsonFile( - string commandName, - IEnumerable commandArgs, - string depsJsonFile) - { - var dependencyContext = LoadDependencyContextFromFile(depsJsonFile); - - var commandPath = GetCommandPathFromDependencyContext(commandName, dependencyContext); - if (commandPath == null) - { - return null; - } - - return CreateCommandSpecUsingMuxerIfPortable( - commandPath, - commandArgs, - depsJsonFile, - CommandResolutionStrategy.DepsFile, - _nugetPackageRoot, - IsPortableApp(commandPath)); - } - - public DependencyContext LoadDependencyContextFromFile(string depsJsonFile) - { - DependencyContext dependencyContext = null; - DependencyContextJsonReader contextReader = new DependencyContextJsonReader(); - - using (var contextStream = File.OpenRead(depsJsonFile)) - { - dependencyContext = contextReader.Read(contextStream); - } - - return dependencyContext; - } - - public string GetCommandPathFromDependencyContext(string commandName, DependencyContext dependencyContext) - { - var commandCandidates = new List(); - - var assemblyCommandCandidates = GetCommandCandidates( - commandName, - dependencyContext, - CommandCandidateType.RuntimeCommandCandidate); - var nativeCommandCandidates = GetCommandCandidates( - commandName, - dependencyContext, - CommandCandidateType.NativeCommandCandidate); - - commandCandidates.AddRange(assemblyCommandCandidates); - commandCandidates.AddRange(nativeCommandCandidates); - - var command = ChooseCommandCandidate(commandCandidates); - - return command?.GetAbsoluteCommandPath(_nugetPackageRoot); - } - - private IEnumerable GetCommandCandidates( - string commandName, - DependencyContext dependencyContext, - CommandCandidateType commandCandidateType) - { - var commandCandidates = new List(); - - foreach (var runtimeLibrary in dependencyContext.RuntimeLibraries) - { - IEnumerable runtimeAssetGroups = null; - - if (commandCandidateType == CommandCandidateType.NativeCommandCandidate) - { - runtimeAssetGroups = runtimeLibrary.NativeLibraryGroups; - } - else if (commandCandidateType == CommandCandidateType.RuntimeCommandCandidate) - { - runtimeAssetGroups = runtimeLibrary.RuntimeAssemblyGroups; - } - - commandCandidates.AddRange(GetCommandCandidatesFromRuntimeAssetGroups( - commandName, - runtimeAssetGroups, - runtimeLibrary.Name, - runtimeLibrary.Version)); - } - - return commandCandidates; - } - - private IEnumerable GetCommandCandidatesFromRuntimeAssetGroups( - string commandName, - IEnumerable runtimeAssetGroups, - string PackageName, - string PackageVersion) - { - var candidateAssetGroups = runtimeAssetGroups - .Where(r => r.Runtime == string.Empty) - .Where(a => - a.AssetPaths.Any(p => - Path.GetFileNameWithoutExtension(p).Equals(commandName, StringComparison.OrdinalIgnoreCase))); - - var commandCandidates = new List(); - foreach (var candidateAssetGroup in candidateAssetGroups) - { - var candidateAssetPaths = candidateAssetGroup.AssetPaths.Where( - p => Path.GetFileNameWithoutExtension(p) - .Equals(commandName, StringComparison.OrdinalIgnoreCase)); - - foreach (var candidateAssetPath in candidateAssetPaths) - { - commandCandidates.Add(new CommandCandidate - { - PackageName = PackageName, - PackageVersion = PackageVersion, - RelativeCommandPath = candidateAssetPath - }); - } - } - - return commandCandidates; - } - - private CommandCandidate ChooseCommandCandidate(IEnumerable commandCandidates) - { - foreach (var extension in s_extensionPreferenceOrder) - { - var candidate = commandCandidates - .FirstOrDefault(p => Path.GetExtension(p.RelativeCommandPath) - .Equals(extension, StringComparison.OrdinalIgnoreCase)); - - if (candidate != null) - { - return candidate; - } - } - - return null; - } - - private CommandSpec CreateCommandSpecUsingMuxerIfPortable( - string commandPath, - IEnumerable commandArgs, - string depsJsonFile, - CommandResolutionStrategy commandResolutionStrategy, - string nugetPackagesRoot, - bool isPortable) - { - var depsFileArguments = GetDepsFileArguments(depsJsonFile); - var additionalProbingPathArguments = GetAdditionalProbingPathArguments(); - - var muxerArgs = new List(); - muxerArgs.Add("exec"); - muxerArgs.AddRange(depsFileArguments); - muxerArgs.AddRange(additionalProbingPathArguments); - muxerArgs.Add(commandPath); - muxerArgs.AddRange(commandArgs); - - var escapedArgString = ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart(muxerArgs); - - return new CommandSpec(_muxer.MuxerPath, escapedArgString, commandResolutionStrategy); - } - - private bool IsPortableApp(string commandPath) - { - var commandDir = Path.GetDirectoryName(commandPath); - - var runtimeConfigPath = Directory.EnumerateFiles(commandDir) - .FirstOrDefault(x => x.EndsWith("runtimeconfig.json")); - - if (runtimeConfigPath == null) - { - return false; - } - - var runtimeConfig = new RuntimeConfig(runtimeConfigPath); - - return runtimeConfig.IsPortable; - } - - private IEnumerable GetDepsFileArguments(string depsJsonFile) - { - return new[] { "--depsfile", depsJsonFile }; - } - - private IEnumerable GetAdditionalProbingPathArguments() - { - return new[] { "--additionalProbingPath", _nugetPackageRoot }; - } - - private class CommandCandidate - { - public string PackageName { get; set; } - public string PackageVersion { get; set; } - public string RelativeCommandPath { get; set; } - - public string GetAbsoluteCommandPath(string nugetPackageRoot) - { - return Path.Combine( - nugetPackageRoot.Replace('/', Path.DirectorySeparatorChar), - PackageName.Replace('/', Path.DirectorySeparatorChar), - PackageVersion.Replace('/', Path.DirectorySeparatorChar), - RelativeCommandPath.Replace('/', Path.DirectorySeparatorChar)); - } - } - - private enum CommandCandidateType - { - NativeCommandCandidate, - RuntimeCommandCandidate - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/GenericPlatformCommandSpecFactory.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/GenericPlatformCommandSpecFactory.cs deleted file mode 100644 index f190699a0..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/GenericPlatformCommandSpecFactory.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class GenericPlatformCommandSpecFactory : IPlatformCommandSpecFactory - { - public CommandSpec CreateCommandSpec( - string commandName, - IEnumerable args, - string commandPath, - CommandResolutionStrategy resolutionStrategy, - IEnvironmentProvider environment) - { - var escapedArgs = ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart(args); - return new CommandSpec(commandPath, escapedArgs, resolutionStrategy); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ICommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ICommandResolver.cs deleted file mode 100644 index e3b05842f..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ICommandResolver.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.DotNet.Cli.Utils -{ - public interface ICommandResolver - { - CommandSpec Resolve(CommandResolverArguments arguments); - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ICommandResolverPolicy.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ICommandResolverPolicy.cs deleted file mode 100644 index a38b32605..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ICommandResolverPolicy.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.DotNet.Cli.Utils -{ - public interface ICommandResolverPolicy - { - CompositeCommandResolver CreateCommandResolver(); - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/IPackagedCommandSpecFactory.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/IPackagedCommandSpecFactory.cs deleted file mode 100644 index 5f409a09f..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/IPackagedCommandSpecFactory.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using NuGet.ProjectModel; - -namespace Microsoft.DotNet.Cli.Utils -{ - public interface IPackagedCommandSpecFactory - { - CommandSpec CreateCommandSpecFromLibrary( - LockFileTargetLibrary toolLibrary, - string commandName, - IEnumerable commandArguments, - IEnumerable allowedExtensions, - LockFile lockFile, - CommandResolutionStrategy commandResolutionStrategy, - string depsFilePath, - string runtimeConfigPath); - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/IPlatformCommandSpecFactory.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/IPlatformCommandSpecFactory.cs deleted file mode 100644 index f91877bcf..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/IPlatformCommandSpecFactory.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; - -namespace Microsoft.DotNet.Cli.Utils -{ - public interface IPlatformCommandSpecFactory - { - CommandSpec CreateCommandSpec( - string commandName, - IEnumerable args, - string commandPath, - CommandResolutionStrategy resolutionStrategy, - IEnvironmentProvider environment); - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/IProject.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/IProject.cs deleted file mode 100644 index 534d77ebe..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/IProject.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using NuGet.Frameworks; -using NuGet.ProjectModel; - -namespace Microsoft.DotNet.Cli.Utils -{ - internal interface IProject - { - LockFile GetLockFile(); - - bool TryGetLockFile(out LockFile lockFile); - - IEnumerable GetTools(); - - string DepsJsonPath { get; } - - string ProjectRoot { get; } - - string RuntimeConfigJsonPath { get; } - - string FullOutputPath { get; } - - NuGetFramework DotnetCliToolTargetFramework { get; } - - Dictionary EnvironmentVariables { get; } - - string ToolDepsJsonGeneratorProject { get; } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/IPublishedPathCommandSpecFactory.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/IPublishedPathCommandSpecFactory.cs deleted file mode 100644 index 115f9c352..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/IPublishedPathCommandSpecFactory.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; - -namespace Microsoft.DotNet.Cli.Utils -{ - public interface IPublishedPathCommandSpecFactory - { - CommandSpec CreateCommandSpecFromPublishFolder( - string commandPath, - IEnumerable commandArguments, - CommandResolutionStrategy commandResolutionStrategy, - string depsFilePath, - string runtimeConfigPath); - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/LockFileTargetExtensions.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/LockFileTargetExtensions.cs deleted file mode 100644 index f09b9d1f5..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/LockFileTargetExtensions.cs +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Linq; -using NuGet.Packaging.Core; -using NuGet.ProjectModel; - -namespace Microsoft.DotNet.Cli.Utils -{ - internal static class LockFileTargetExtensions - { - public static bool IsPortable(this LockFileTarget lockFileTarget) - { - return string.IsNullOrEmpty(lockFileTarget.RuntimeIdentifier) && - lockFileTarget.GetPlatformLibrary() != null; - } - - public static LockFileTargetLibrary GetPlatformLibrary(this LockFileTarget lockFileTarget) - { - // TODO: https://github.com/dotnet/sdk/issues/17 get this from the lock file - var platformPackageName = "Microsoft.NETCore.App"; - var platformLibrary = lockFileTarget - .Libraries - .FirstOrDefault(e => e.Name.Equals(platformPackageName, StringComparison.OrdinalIgnoreCase)); - - return platformLibrary; - } - - public static HashSet GetPlatformExclusionList( - this LockFileTarget lockFileTarget, - IDictionary libraryLookup) - { - var platformLibrary = lockFileTarget.GetPlatformLibrary(); - var exclusionList = new HashSet(); - - exclusionList.Add(platformLibrary.Name); - CollectDependencies(libraryLookup, platformLibrary.Dependencies, exclusionList); - - return exclusionList; - } - - public static IEnumerable GetRuntimeLibraries(this LockFileTarget lockFileTarget) - { - IEnumerable runtimeLibraries = lockFileTarget.Libraries; - Dictionary libraryLookup = - runtimeLibraries.ToDictionary(e => e.Name, StringComparer.OrdinalIgnoreCase); - - HashSet allExclusionList = new HashSet(); - - if (lockFileTarget.IsPortable()) - { - allExclusionList.UnionWith(lockFileTarget.GetPlatformExclusionList(libraryLookup)); - } - - return runtimeLibraries.Filter(allExclusionList).ToArray(); - } - - public static IEnumerable GetCompileLibraries(this LockFileTarget lockFileTarget) - { - return lockFileTarget.Libraries; - } - - public static IEnumerable Filter( - this IEnumerable libraries, - HashSet exclusionList) - { - return libraries.Where(e => !exclusionList.Contains(e.Name)); - } - - public static IEnumerable> GetRuntimeTargetsGroups( - this LockFileTargetLibrary library, - string assetType) - { - return library.RuntimeTargets - .FilterPlaceHolderFiles() - .Cast() - .Where(t => string.Equals(t.AssetType, assetType, StringComparison.OrdinalIgnoreCase)) - .GroupBy(t => t.Runtime); - } - - private static void CollectDependencies( - IDictionary libraryLookup, - IEnumerable dependencies, - HashSet exclusionList) - { - foreach (PackageDependency dependency in dependencies) - { - LockFileTargetLibrary library = libraryLookup[dependency.Id]; - if (library.Version.Equals(dependency.VersionRange.MinVersion)) - { - if (exclusionList.Add(library.Name)) - { - CollectDependencies(libraryLookup, library.Dependencies, exclusionList); - } - } - } - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/MSBuildProject.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/MSBuildProject.cs deleted file mode 100644 index f5473c278..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/MSBuildProject.cs +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Microsoft.Build.Evaluation; -using NuGet.Frameworks; -using NuGet.ProjectModel; - -namespace Microsoft.DotNet.Cli.Utils -{ - internal class MSBuildProject : IProject - { - private static readonly NuGetFramework s_toolPackageFramework = FrameworkConstants.CommonFrameworks.NetCoreApp10; - - private Project _project; - - private string _projectRoot; - - private string _msBuildExePath; - - public string DepsJsonPath - { - get - { - return _project - .AllEvaluatedProperties - .FirstOrDefault(p => p.Name.Equals("ProjectDepsFilePath")) - .EvaluatedValue; - } - } - - public string RuntimeConfigJsonPath - { - get - { - return _project - .AllEvaluatedProperties - .FirstOrDefault(p => p.Name.Equals("ProjectRuntimeConfigFilePath")) - .EvaluatedValue; - } - } - - public string FullOutputPath - { - get - { - return _project - .AllEvaluatedProperties - .FirstOrDefault(p => p.Name.Equals("TargetDir")) - .EvaluatedValue; - } - } - - public string ProjectRoot - { - get - { - return _projectRoot; - } - } - - public NuGetFramework DotnetCliToolTargetFramework - { - get - { - var frameworkString = _project - .AllEvaluatedProperties - .FirstOrDefault(p => p.Name.Equals("DotnetCliToolTargetFramework")) - ?.EvaluatedValue; - - if (string.IsNullOrEmpty(frameworkString)) - { - return s_toolPackageFramework; - } - - return NuGetFramework.Parse(frameworkString); - } - } - - - public Dictionary EnvironmentVariables - { - get - { - return new Dictionary - { - { Constants.MSBUILD_EXE_PATH, _msBuildExePath } - }; - } - } - - public string ToolDepsJsonGeneratorProject - { - get - { - var generatorProject = _project - .AllEvaluatedProperties - .FirstOrDefault(p => p.Name.Equals("ToolDepsJsonGeneratorProject")) - ?.EvaluatedValue; - - return generatorProject; - } - } - - public MSBuildProject( - string msBuildProjectPath, - NuGetFramework framework, - string configuration, - string outputPath, - string msBuildExePath) - { - _projectRoot = msBuildExePath; - - var globalProperties = new Dictionary() - { - { "MSBuildExtensionsPath", Path.GetDirectoryName(msBuildExePath) } - }; - - if(framework != null) - { - globalProperties.Add("TargetFramework", framework.GetShortFolderName()); - } - - if(outputPath != null) - { - globalProperties.Add("OutputPath", outputPath); - } - - if(configuration != null) - { - globalProperties.Add("Configuration", configuration); - } - - _project = ProjectCollection.GlobalProjectCollection.LoadProject( - msBuildProjectPath, - globalProperties, - null); - - _msBuildExePath = msBuildExePath; - } - - public IEnumerable GetTools() - { - var toolsReferences = _project.AllEvaluatedItems.Where(i => i.ItemType.Equals("DotNetCliToolReference")); - var tools = toolsReferences.Select(t => new SingleProjectInfo( - t.EvaluatedInclude, - t.GetMetadataValue("Version"), - Enumerable.Empty())); - - return tools; - } - - public LockFile GetLockFile() - { - var lockFilePath = GetLockFilePathFromProjectLockFileProperty() ?? - GetLockFilePathFromIntermediateBaseOutputPath(); - - return new LockFileFormat() - .ReadWithLock(lockFilePath) - .Result; - } - - public bool TryGetLockFile(out LockFile lockFile) - { - lockFile = null; - - var lockFilePath = GetLockFilePathFromProjectLockFileProperty() ?? - GetLockFilePathFromIntermediateBaseOutputPath(); - - if (lockFilePath == null) - { - return false; - } - - if (!File.Exists(lockFilePath)) - { - return false; - } - - lockFile = new LockFileFormat() - .ReadWithLock(lockFilePath) - .Result; - return true; - } - - private string GetLockFilePathFromProjectLockFileProperty() - { - return _project - .AllEvaluatedProperties - .Where(p => p.Name.Equals("ProjectAssetsFile")) - .Select(p => p.EvaluatedValue) - .FirstOrDefault(p => Path.IsPathRooted(p) && File.Exists(p)); - } - - private string GetLockFilePathFromIntermediateBaseOutputPath() - { - var intermediateOutputPath = _project - .AllEvaluatedProperties - .FirstOrDefault(p => p.Name.Equals("BaseIntermediateOutputPath")) - .EvaluatedValue; - return Path.Combine(intermediateOutputPath, "project.assets.json"); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/MuxerCommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/MuxerCommandResolver.cs deleted file mode 100644 index a61a0c4d7..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/MuxerCommandResolver.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.DotNet.Cli.Utils -{ - public class MuxerCommandResolver : ICommandResolver - { - public CommandSpec Resolve(CommandResolverArguments commandResolverArguments) - { - if (commandResolverArguments.CommandName == Muxer.MuxerName) - { - var muxer = new Muxer(); - var escapedArgs = ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart( - commandResolverArguments.CommandArguments.OrEmptyIfNull()); - return new CommandSpec(muxer.MuxerPath, escapedArgs, CommandResolutionStrategy.RootedPath); - } - return null; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/NuGetUtils.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/NuGetUtils.cs deleted file mode 100644 index 72aa0a545..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/NuGetUtils.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using NuGet.Packaging.Core; -using NuGet.ProjectModel; - -namespace Microsoft.DotNet.Cli.Utils -{ - internal static class NuGetUtils - { - public static bool IsPlaceholderFile(string path) - { - return string.Equals(Path.GetFileName(path), PackagingCoreConstants.EmptyFolder, StringComparison.Ordinal); - } - - public static IEnumerable FilterPlaceHolderFiles(this IEnumerable files) - { - return files.Where(f => !IsPlaceholderFile(f.Path)); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/OutputPathCommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/OutputPathCommandResolver.cs deleted file mode 100644 index 76f492420..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/OutputPathCommandResolver.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using System.IO; -using Microsoft.DotNet.Cli.Utils; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class OutputPathCommandResolver : AbstractPathBasedCommandResolver - { - public OutputPathCommandResolver(IEnvironmentProvider environment, - IPlatformCommandSpecFactory commandSpecFactory) : base(environment, commandSpecFactory) - { } - - - internal override string ResolveCommandPath(CommandResolverArguments commandResolverArguments) - { - if (commandResolverArguments.Framework == null - || commandResolverArguments.ProjectDirectory == null - || commandResolverArguments.Configuration == null - || commandResolverArguments.CommandName == null) - { - return null; - } - - return ResolveFromProjectOutput( - commandResolverArguments.ProjectDirectory, - commandResolverArguments.Framework, - commandResolverArguments.Configuration, - commandResolverArguments.CommandName, - commandResolverArguments.CommandArguments.OrEmptyIfNull(), - commandResolverArguments.OutputPath, - commandResolverArguments.BuildBasePath); - } - - private string ResolveFromProjectOutput( - string projectDirectory, - NuGetFramework framework, - string configuration, - string commandName, - IEnumerable commandArguments, - string outputPath, - string buildBasePath) - { - var projectFactory = new ProjectFactory(_environment); - - var project = projectFactory.GetProject( - projectDirectory, - framework, - configuration, - buildBasePath, - outputPath); - - if (project == null) - { - return null; - } - - var buildOutputPath = project.FullOutputPath; - - if (!Directory.Exists(buildOutputPath)) - { - Reporter.Verbose.WriteLine( - string.Format(LocalizableStrings.BuildOutputPathDoesNotExist, buildOutputPath)); - return null; - } - - return _environment.GetCommandPathFromRootPath(buildOutputPath, commandName); - } - - internal override CommandResolutionStrategy GetCommandResolutionStrategy() - { - return CommandResolutionStrategy.OutputPath; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PackagedCommandSpecFactory.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PackagedCommandSpecFactory.cs deleted file mode 100644 index 2ee8bcb6a..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PackagedCommandSpecFactory.cs +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Microsoft.DotNet.Tools.Common; -using NuGet.Packaging; -using NuGet.ProjectModel; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class PackagedCommandSpecFactory : IPackagedCommandSpecFactory - { - private const string PackagedCommandSpecFactoryName = "packagedcommandspecfactory"; - - private Action> _addAdditionalArguments; - - internal PackagedCommandSpecFactory(Action> addAdditionalArguments = null) - { - _addAdditionalArguments = addAdditionalArguments; - } - - public CommandSpec CreateCommandSpecFromLibrary( - LockFileTargetLibrary toolLibrary, - string commandName, - IEnumerable commandArguments, - IEnumerable allowedExtensions, - LockFile lockFile, - CommandResolutionStrategy commandResolutionStrategy, - string depsFilePath, - string runtimeConfigPath) - { - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.AttemptingToFindCommand, - PackagedCommandSpecFactoryName, - commandName, - toolLibrary.Name)); - - var toolAssembly = toolLibrary?.RuntimeAssemblies - .FirstOrDefault(r => Path.GetFileNameWithoutExtension(r.Path) == commandName); - - if (toolAssembly == null) - { - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.FailedToFindToolAssembly, - PackagedCommandSpecFactoryName, - commandName)); - - return null; - } - - var commandPath = GetCommandFilePath(lockFile, toolLibrary, toolAssembly); - - if (!File.Exists(commandPath)) - { - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.FailedToFindCommandPath, - PackagedCommandSpecFactoryName, - commandPath)); - - return null; - } - - return CreateCommandSpecWrappingWithMuxerIfDll( - commandPath, - commandArguments, - depsFilePath, - commandResolutionStrategy, - lockFile.GetNormalizedPackageFolders(), - runtimeConfigPath); - } - - private string GetCommandFilePath( - LockFile lockFile, - LockFileTargetLibrary toolLibrary, - LockFileItem runtimeAssembly) - { - var packageDirectory = lockFile.GetPackageDirectory(toolLibrary); - - if (packageDirectory == null) - { - throw new GracefulException(string.Format( - LocalizableStrings.CommandAssembliesNotFound, - toolLibrary.Name)); - } - - var filePath = Path.Combine( - packageDirectory, - PathUtility.GetPathWithDirectorySeparator(runtimeAssembly.Path)); - - return filePath; - } - - private CommandSpec CreateCommandSpecWrappingWithMuxerIfDll( - string commandPath, - IEnumerable commandArguments, - string depsFilePath, - CommandResolutionStrategy commandResolutionStrategy, - IEnumerable packageFolders, - string runtimeConfigPath) - { - var commandExtension = Path.GetExtension(commandPath); - - if (commandExtension == FileNameSuffixes.DotNet.DynamicLib) - { - return CreatePackageCommandSpecUsingMuxer( - commandPath, - commandArguments, - depsFilePath, - commandResolutionStrategy, - packageFolders, - runtimeConfigPath); - } - - return CreateCommandSpec(commandPath, commandArguments, commandResolutionStrategy); - } - - private CommandSpec CreatePackageCommandSpecUsingMuxer( - string commandPath, - IEnumerable commandArguments, - string depsFilePath, - CommandResolutionStrategy commandResolutionStrategy, - IEnumerable packageFolders, - string runtimeConfigPath) - { - var host = string.Empty; - var arguments = new List(); - - var muxer = new Muxer(); - - host = muxer.MuxerPath; - if (host == null) - { - throw new Exception(LocalizableStrings.UnableToLocateDotnetMultiplexer); - } - - arguments.Add("exec"); - - if (runtimeConfigPath != null) - { - arguments.Add("--runtimeconfig"); - arguments.Add(runtimeConfigPath); - } - - if (depsFilePath != null) - { - arguments.Add("--depsfile"); - arguments.Add(depsFilePath); - } - - foreach (var packageFolder in packageFolders) - { - arguments.Add("--additionalprobingpath"); - arguments.Add(packageFolder); - } - - if(_addAdditionalArguments != null) - { - _addAdditionalArguments(commandPath, arguments); - } - - arguments.Add(commandPath); - arguments.AddRange(commandArguments); - - return CreateCommandSpec(host, arguments, commandResolutionStrategy); - } - - private CommandSpec CreateCommandSpec( - string commandPath, - IEnumerable commandArguments, - CommandResolutionStrategy commandResolutionStrategy) - { - var escapedArgs = ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart(commandArguments); - - return new CommandSpec(commandPath, escapedArgs, commandResolutionStrategy); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PackagedCommandSpecFactoryWithCliRuntime.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PackagedCommandSpecFactoryWithCliRuntime.cs deleted file mode 100644 index c22af40ba..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PackagedCommandSpecFactoryWithCliRuntime.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Microsoft.DotNet.Tools.Common; -using NuGet.Packaging; -using NuGet.ProjectModel; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class PackagedCommandSpecFactoryWithCliRuntime : PackagedCommandSpecFactory - { - public PackagedCommandSpecFactoryWithCliRuntime() : base(AddAditionalParameters) - { - } - - private static void AddAditionalParameters(string commandPath, IList arguments) - { - if(PrefersCliRuntime(commandPath)) - { - var runtimeConfigFile = Path.ChangeExtension(commandPath, FileNameSuffixes.RuntimeConfigJson); - - if (!File.Exists(runtimeConfigFile)) - { - throw new GracefulException(string.Format(LocalizableStrings.CouldNotFindToolRuntimeConfigFile, - nameof(PackagedCommandSpecFactory), - Path.GetFileName(commandPath))); - } - - var runtimeConfig = new RuntimeConfig(runtimeConfigFile); - - var muxer = new Muxer(); - - Version currentFrameworkSimpleVersion = GetVersionWithoutPrerelease(muxer.SharedFxVersion); - Version toolFrameworkSimpleVersion = GetVersionWithoutPrerelease(runtimeConfig.Framework.Version); - - if (currentFrameworkSimpleVersion.Major != toolFrameworkSimpleVersion.Major) - { - Reporter.Verbose.WriteLine( - string.Format( - LocalizableStrings.IgnoringPreferCLIRuntimeFile, - nameof(PackagedCommandSpecFactory), - runtimeConfig.Framework.Version, - muxer.SharedFxVersion)); - } - else - { - arguments.Add("--fx-version"); - arguments.Add(muxer.SharedFxVersion); - } - } - } - - private static Version GetVersionWithoutPrerelease(string version) - { - int dashOrPlusIndex = version.IndexOfAny(new char[] { '-', '+' }); - - if (dashOrPlusIndex >= 0) - { - version = version.Substring(0, dashOrPlusIndex); - } - - return new Version(version); - } - - private static bool PrefersCliRuntime(string commandPath) - { - var libTFMPackageDirectory = Path.GetDirectoryName(commandPath); - var packageDirectory = Path.Combine(libTFMPackageDirectory, "..", ".."); - var preferCliRuntimePath = Path.Combine(packageDirectory, "prefercliruntime"); - - Reporter.Verbose.WriteLine( - string.Format( - LocalizableStrings.LookingForPreferCliRuntimeFile, - nameof(PackagedCommandSpecFactory), - preferCliRuntimePath)); - - return File.Exists(preferCliRuntimePath); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PathCommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PathCommandResolver.cs deleted file mode 100644 index cf36ac00c..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PathCommandResolver.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.DotNet.Cli.Utils -{ - public class PathCommandResolver : AbstractPathBasedCommandResolver - { - public PathCommandResolver(IEnvironmentProvider environment, - IPlatformCommandSpecFactory commandSpecFactory) : base(environment, commandSpecFactory) { } - - internal override string ResolveCommandPath(CommandResolverArguments commandResolverArguments) - { - return _environment.GetCommandPath(commandResolverArguments.CommandName); - } - - internal override CommandResolutionStrategy GetCommandResolutionStrategy() - { - return CommandResolutionStrategy.Path; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PathCommandResolverPolicy.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PathCommandResolverPolicy.cs deleted file mode 100644 index 40a5b3787..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PathCommandResolverPolicy.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.PlatformAbstractions; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class PathCommandResolverPolicy : ICommandResolverPolicy - { - public CompositeCommandResolver CreateCommandResolver() - { - return Create(); - } - - public static CompositeCommandResolver Create() - { - var environment = new EnvironmentProvider(); - - var platformCommandSpecFactory = default(IPlatformCommandSpecFactory); - if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows) - { - platformCommandSpecFactory = new WindowsExePreferredCommandSpecFactory(); - } - else - { - platformCommandSpecFactory = new GenericPlatformCommandSpecFactory(); - } - - return CreatePathCommandResolverPolicy( - environment, - platformCommandSpecFactory); - } - - public static CompositeCommandResolver CreatePathCommandResolverPolicy( - IEnvironmentProvider environment, - IPlatformCommandSpecFactory platformCommandSpecFactory) - { - var compositeCommandResolver = new CompositeCommandResolver(); - - compositeCommandResolver.AddCommandResolver( - new PathCommandResolver(environment, platformCommandSpecFactory)); - - return compositeCommandResolver; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectDependenciesCommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectDependenciesCommandResolver.cs deleted file mode 100644 index 557ca3b25..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectDependenciesCommandResolver.cs +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Microsoft.DotNet.Tools.Common; -using NuGet.Frameworks; -using NuGet.ProjectModel; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class ProjectDependenciesCommandResolver : ICommandResolver - { - private const string ProjectDependenciesCommandResolverName = "projectdependenciescommandresolver"; - - private static readonly CommandResolutionStrategy s_commandResolutionStrategy = - CommandResolutionStrategy.ProjectDependenciesPackage; - - private readonly IEnvironmentProvider _environment; - private readonly IPackagedCommandSpecFactory _packagedCommandSpecFactory; - - public ProjectDependenciesCommandResolver( - IEnvironmentProvider environment, - IPackagedCommandSpecFactory packagedCommandSpecFactory) - { - if (environment == null) - { - throw new ArgumentNullException(nameof(environment)); - } - - if (packagedCommandSpecFactory == null) - { - throw new ArgumentNullException(nameof(packagedCommandSpecFactory)); - } - - _environment = environment; - _packagedCommandSpecFactory = packagedCommandSpecFactory; - } - - public CommandSpec Resolve(CommandResolverArguments commandResolverArguments) - { - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.AttemptingToResolve, - ProjectDependenciesCommandResolverName, - commandResolverArguments.CommandName)); - - if (commandResolverArguments.Framework == null - || commandResolverArguments.ProjectDirectory == null - || commandResolverArguments.Configuration == null - || commandResolverArguments.CommandName == null) - { - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.InvalidCommandResolverArguments, - ProjectDependenciesCommandResolverName)); - - return null; - } - - return ResolveFromProjectDependencies( - commandResolverArguments.ProjectDirectory, - commandResolverArguments.Framework, - commandResolverArguments.Configuration, - commandResolverArguments.CommandName, - commandResolverArguments.CommandArguments.OrEmptyIfNull(), - commandResolverArguments.OutputPath, - commandResolverArguments.BuildBasePath); - } - - private CommandSpec ResolveFromProjectDependencies( - string projectDirectory, - NuGetFramework framework, - string configuration, - string commandName, - IEnumerable commandArguments, - string outputPath, - string buildBasePath) - { - var allowedExtensions = GetAllowedCommandExtensionsFromEnvironment(_environment); - - var projectFactory = new ProjectFactory(_environment); - var project = projectFactory.GetProject( - projectDirectory, - framework, - configuration, - buildBasePath, - outputPath); - - if (project == null) - { - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.DidNotFindAMatchingProject, - ProjectDependenciesCommandResolverName, - projectDirectory)); - return null; - } - - var depsFilePath = project.DepsJsonPath; - - if (!File.Exists(depsFilePath)) - { - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.DoesNotExist, - ProjectDependenciesCommandResolverName, - depsFilePath)); - return null; - } - - var runtimeConfigPath = project.RuntimeConfigJsonPath; - - if (!File.Exists(runtimeConfigPath)) - { - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.DoesNotExist, - ProjectDependenciesCommandResolverName, - runtimeConfigPath)); - return null; - } - - var lockFile = project.GetLockFile(); - var toolLibrary = GetToolLibraryForContext(lockFile, commandName, framework); - - var commandSpec = _packagedCommandSpecFactory.CreateCommandSpecFromLibrary( - toolLibrary, - commandName, - commandArguments, - allowedExtensions, - lockFile, - s_commandResolutionStrategy, - depsFilePath, - runtimeConfigPath); - - commandSpec?.AddEnvironmentVariablesFromProject(project); - - return commandSpec; - } - - private LockFileTargetLibrary GetToolLibraryForContext( - LockFile lockFile, string commandName, NuGetFramework targetFramework) - { - var toolLibraries = lockFile.Targets - .FirstOrDefault(t => t.TargetFramework.GetShortFolderName() - .Equals(targetFramework.GetShortFolderName())) - ?.Libraries.Where(l => l.Name == commandName || - l.RuntimeAssemblies.Any(r => Path.GetFileNameWithoutExtension(r.Path) == commandName)).ToList(); - - if (toolLibraries?.Count() > 1) - { - throw new InvalidOperationException(string.Format( - LocalizableStrings.AmbiguousCommandName, - commandName)); - } - - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.ToolLibraryFound, - ProjectDependenciesCommandResolverName, - toolLibraries?.Count() > 0)); - - return toolLibraries?.FirstOrDefault(); - } - - private IEnumerable GetAllowedCommandExtensionsFromEnvironment(IEnvironmentProvider environment) - { - var allowedCommandExtensions = new List(); - allowedCommandExtensions.AddRange(environment.ExecutableExtensions); - allowedCommandExtensions.Add(FileNameSuffixes.DotNet.DynamicLib); - - return allowedCommandExtensions; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectFactory.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectFactory.cs deleted file mode 100644 index 31dd409ac..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectFactory.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Microsoft.Build.Exceptions; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Cli.Utils -{ - internal class ProjectFactory - { - private const string ProjectFactoryName = "projectfactory"; - - private IEnvironmentProvider _environment; - - public ProjectFactory(IEnvironmentProvider environment) - { - _environment = environment; - } - - public IProject GetProject( - string projectDirectory, - NuGetFramework framework, - string configuration, - string buildBasePath, - string outputPath) - { - return GetMSBuildProj(projectDirectory, framework, configuration, outputPath); - } - - private IProject GetMSBuildProj(string projectDirectory, NuGetFramework framework, string configuration, string outputPath) - { - var msBuildExePath = _environment.GetEnvironmentVariable(Constants.MSBUILD_EXE_PATH); - - msBuildExePath = string.IsNullOrEmpty(msBuildExePath) ? - Path.Combine(AppContext.BaseDirectory, "MSBuild.dll") : - msBuildExePath; - - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.MSBuildExePath, - ProjectFactoryName, - msBuildExePath)); - - string msBuildProjectPath = GetMSBuildProjPath(projectDirectory); - - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.MSBuildProjectPath, - ProjectFactoryName, - msBuildProjectPath)); - - if(msBuildProjectPath == null) - { - return null; - } - - try - { - return new MSBuildProject(msBuildProjectPath, framework, configuration, outputPath, msBuildExePath); - } - catch (InvalidProjectFileException ex) - { - Reporter.Verbose.WriteLine(ex.ToString().Red()); - - return null; - } - } - - private string GetMSBuildProjPath(string projectDirectory) - { - IEnumerable projectFiles = Directory - .GetFiles(projectDirectory, "*.*proj") - .Where(d => !d.EndsWith(".xproj")); - - if (projectFiles.Count() == 0) - { - return null; - } - else if (projectFiles.Count() > 1) - { - throw new GracefulException(string.Format( - LocalizableStrings.MultipleProjectFilesFound, - projectDirectory)); - } - - return projectFiles.First(); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectPathCommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectPathCommandResolver.cs deleted file mode 100644 index 4ace64660..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectPathCommandResolver.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.DotNet.Cli.Utils -{ - public class ProjectPathCommandResolver : AbstractPathBasedCommandResolver - { - public ProjectPathCommandResolver(IEnvironmentProvider environment, - IPlatformCommandSpecFactory commandSpecFactory) : base(environment, commandSpecFactory) { } - - internal override string ResolveCommandPath(CommandResolverArguments commandResolverArguments) - { - if (commandResolverArguments.ProjectDirectory == null) - { - return null; - } - - return _environment.GetCommandPathFromRootPath( - commandResolverArguments.ProjectDirectory, - commandResolverArguments.CommandName, - commandResolverArguments.InferredExtensions.OrEmptyIfNull()); - } - - internal override CommandResolutionStrategy GetCommandResolutionStrategy() - { - return CommandResolutionStrategy.ProjectLocal; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsCommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsCommandResolver.cs deleted file mode 100644 index a75472142..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsCommandResolver.cs +++ /dev/null @@ -1,438 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.DotNet.Tools.Common; -using Microsoft.Extensions.DependencyModel; -using NuGet.Configuration; -using NuGet.Frameworks; -using NuGet.ProjectModel; -using NuGet.Versioning; -using ConcurrencyUtilities = NuGet.Common.ConcurrencyUtilities; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class ProjectToolsCommandResolver : ICommandResolver - { - private const string ProjectToolsCommandResolverName = "projecttoolscommandresolver"; - - private static readonly CommandResolutionStrategy s_commandResolutionStrategy = - CommandResolutionStrategy.ProjectToolsPackage; - - private List _allowedCommandExtensions; - private IPackagedCommandSpecFactory _packagedCommandSpecFactory; - - private IEnvironmentProvider _environment; - - public ProjectToolsCommandResolver( - IPackagedCommandSpecFactory packagedCommandSpecFactory, - IEnvironmentProvider environment) - { - _packagedCommandSpecFactory = packagedCommandSpecFactory; - _environment = environment; - - _allowedCommandExtensions = new List() - { - FileNameSuffixes.DotNet.DynamicLib - }; - } - - public CommandSpec Resolve(CommandResolverArguments commandResolverArguments) - { - if (commandResolverArguments.CommandName == null - || commandResolverArguments.ProjectDirectory == null) - { - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.InvalidCommandResolverArguments, - ProjectToolsCommandResolverName)); - - return null; - } - - return ResolveFromProjectTools(commandResolverArguments); - } - - private CommandSpec ResolveFromProjectTools(CommandResolverArguments commandResolverArguments) - { - var projectFactory = new ProjectFactory(_environment); - - var project = projectFactory.GetProject( - commandResolverArguments.ProjectDirectory, - commandResolverArguments.Framework, - commandResolverArguments.Configuration, - commandResolverArguments.BuildBasePath, - commandResolverArguments.OutputPath); - - if (project == null) - { - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.DidNotFindProject, ProjectToolsCommandResolverName)); - - return null; - } - - var tools = project.GetTools(); - - return ResolveCommandSpecFromAllToolLibraries( - tools, - commandResolverArguments.CommandName, - commandResolverArguments.CommandArguments.OrEmptyIfNull(), - project); - } - - private CommandSpec ResolveCommandSpecFromAllToolLibraries( - IEnumerable toolsLibraries, - string commandName, - IEnumerable args, - IProject project) - { - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.ResolvingCommandSpec, - ProjectToolsCommandResolverName, - toolsLibraries.Count())); - - foreach (var toolLibrary in toolsLibraries) - { - var commandSpec = ResolveCommandSpecFromToolLibrary( - toolLibrary, - commandName, - args, - project); - - if (commandSpec != null) - { - return commandSpec; - } - } - - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.FailedToResolveCommandSpec, - ProjectToolsCommandResolverName)); - - return null; - } - - private CommandSpec ResolveCommandSpecFromToolLibrary( - SingleProjectInfo toolLibraryRange, - string commandName, - IEnumerable args, - IProject project) - { - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.AttemptingToResolveCommandSpec, - ProjectToolsCommandResolverName, - toolLibraryRange.Name)); - - var possiblePackageRoots = GetPossiblePackageRoots(project).ToList(); - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.NuGetPackagesRoot, - ProjectToolsCommandResolverName, - string.Join(Environment.NewLine, possiblePackageRoots.Select((p) => $"- {p}")))); - - List toolFrameworksToCheck = new List(); - toolFrameworksToCheck.Add(project.DotnetCliToolTargetFramework); - - // NuGet restore in Visual Studio may restore for netcoreapp1.0. So if that happens, fall back to - // looking for a netcoreapp1.0 or netcoreapp1.1 tool restore. - if (project.DotnetCliToolTargetFramework.Framework == FrameworkConstants.FrameworkIdentifiers.NetCoreApp && - project.DotnetCliToolTargetFramework.Version >= new Version(2, 0, 0)) - { - toolFrameworksToCheck.Add(NuGetFramework.Parse("netcoreapp1.1")); - toolFrameworksToCheck.Add(NuGetFramework.Parse("netcoreapp1.0")); - } - - - LockFile toolLockFile = null; - NuGetFramework toolTargetFramework = null; ; - - foreach (var toolFramework in toolFrameworksToCheck) - { - toolLockFile = GetToolLockFile( - toolLibraryRange, - toolFramework, - possiblePackageRoots); - - if (toolLockFile != null) - { - toolTargetFramework = toolFramework; - break; - } - } - - if (toolLockFile == null) - { - return null; - } - - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.FoundToolLockFile, - ProjectToolsCommandResolverName, - toolLockFile.Path)); - - var toolLibrary = toolLockFile.Targets - .FirstOrDefault(t => toolTargetFramework == t.TargetFramework) - ?.Libraries.FirstOrDefault( - l => StringComparer.OrdinalIgnoreCase.Equals(l.Name, toolLibraryRange.Name)); - if (toolLibrary == null) - { - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.LibraryNotFoundInLockFile, - ProjectToolsCommandResolverName)); - - return null; - } - - var depsFileRoot = Path.GetDirectoryName(toolLockFile.Path); - - var depsFilePath = GetToolDepsFilePath( - toolLibraryRange, - toolTargetFramework, - toolLockFile, - depsFileRoot, - project.ToolDepsJsonGeneratorProject); - - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.AttemptingToCreateCommandSpec, - ProjectToolsCommandResolverName)); - - var commandSpec = _packagedCommandSpecFactory.CreateCommandSpecFromLibrary( - toolLibrary, - commandName, - args, - _allowedCommandExtensions, - toolLockFile, - s_commandResolutionStrategy, - depsFilePath, - null); - - if (commandSpec == null) - { - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.CommandSpecIsNull, - ProjectToolsCommandResolverName)); - } - - commandSpec?.AddEnvironmentVariablesFromProject(project); - - return commandSpec; - } - - private IEnumerable GetPossiblePackageRoots(IProject project) - { - if (project.TryGetLockFile(out LockFile lockFile)) - { - return lockFile.PackageFolders.Select((packageFolder) => packageFolder.Path); - } - - return Enumerable.Empty(); - } - - private LockFile GetToolLockFile( - SingleProjectInfo toolLibrary, - NuGetFramework framework, - IEnumerable possibleNugetPackagesRoot) - { - foreach (var packagesRoot in possibleNugetPackagesRoot) - { - if (TryGetToolLockFile(toolLibrary, framework, packagesRoot, out LockFile lockFile)) - { - return lockFile; - } - } - - return null; - } - - - private static async Task FileExistsWithLock(string path) - { - return await ConcurrencyUtilities.ExecuteWithFileLockedAsync( - path, - lockedToken => Task.FromResult(File.Exists(path)), - CancellationToken.None); - } - - private bool TryGetToolLockFile( - SingleProjectInfo toolLibrary, - NuGetFramework framework, - string nugetPackagesRoot, - out LockFile lockFile) - { - lockFile = null; - var lockFilePath = GetToolLockFilePath(toolLibrary, framework, nugetPackagesRoot); - - if (!FileExistsWithLock(lockFilePath).Result) - { - return false; - } - - try - { - lockFile = new LockFileFormat() - .ReadWithLock(lockFilePath) - .Result; - } - catch (FileFormatException ex) - { - throw ex; - } - - return true; - } - - private string GetToolLockFilePath( - SingleProjectInfo toolLibrary, - NuGetFramework framework, - string nugetPackagesRoot) - { - var toolPathCalculator = new ToolPathCalculator(nugetPackagesRoot); - - return toolPathCalculator.GetBestLockFilePath( - toolLibrary.Name, - VersionRange.Parse(toolLibrary.Version), - framework); - } - - private string GetToolDepsFilePath( - SingleProjectInfo toolLibrary, - NuGetFramework framework, - LockFile toolLockFile, - string depsPathRoot, - string toolDepsJsonGeneratorProject) - { - var depsJsonPath = Path.Combine( - depsPathRoot, - toolLibrary.Name + FileNameSuffixes.DepsJson); - - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.ExpectDepsJsonAt, - ProjectToolsCommandResolverName, - depsJsonPath)); - - EnsureToolJsonDepsFileExists(toolLockFile, framework, depsJsonPath, toolLibrary, toolDepsJsonGeneratorProject); - - return depsJsonPath; - } - - private void EnsureToolJsonDepsFileExists( - LockFile toolLockFile, - NuGetFramework framework, - string depsPath, - SingleProjectInfo toolLibrary, - string toolDepsJsonGeneratorProject) - { - if (!File.Exists(depsPath)) - { - GenerateDepsJsonFile(toolLockFile, framework, depsPath, toolLibrary, toolDepsJsonGeneratorProject); - } - } - - internal void GenerateDepsJsonFile( - LockFile toolLockFile, - NuGetFramework framework, - string depsPath, - SingleProjectInfo toolLibrary, - string toolDepsJsonGeneratorProject) - { - if (string.IsNullOrEmpty(toolDepsJsonGeneratorProject) || - !File.Exists(toolDepsJsonGeneratorProject)) - { - throw new GracefulException(LocalizableStrings.DepsJsonGeneratorProjectNotSet); - } - - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.GeneratingDepsJson, - depsPath)); - - var tempDepsFile = Path.GetTempFileName(); - - var args = new List(); - - args.Add(toolDepsJsonGeneratorProject); - args.Add($"/p:ProjectAssetsFile=\"{toolLockFile.Path}\""); - args.Add($"/p:ToolName={toolLibrary.Name}"); - args.Add($"/p:ProjectDepsFilePath={tempDepsFile}"); - - var toolTargetFramework = toolLockFile.Targets.First().TargetFramework.GetShortFolderName(); - args.Add($"/p:TargetFramework={toolTargetFramework}"); - - - // Look for the .props file in the Microsoft.NETCore.App package, until NuGet - // generates .props and .targets files for tool restores (https://github.com/NuGet/Home/issues/5037) - var platformLibrary = toolLockFile.Targets - .FirstOrDefault(t => framework == t.TargetFramework) - ?.GetPlatformLibrary(); - - if (platformLibrary != null) - { - string buildRelativePath = platformLibrary.Build.FirstOrDefault()?.Path; - - var platformLibraryPath = toolLockFile.GetPackageDirectory(platformLibrary); - - if (platformLibraryPath != null && buildRelativePath != null) - { - // Get rid of "_._" filename - buildRelativePath = Path.GetDirectoryName(buildRelativePath); - - string platformLibraryBuildFolderPath = Path.Combine(platformLibraryPath, buildRelativePath); - var platformLibraryPropsFile = Directory.GetFiles(platformLibraryBuildFolderPath, "*.props").FirstOrDefault(); - - if (platformLibraryPropsFile != null) - { - args.Add($"/p:AdditionalImport={platformLibraryPropsFile}"); - } - } - } - - // Delete temporary file created by Path.GetTempFileName(), otherwise the GenerateBuildDependencyFile target - // will think the deps file is up-to-date and skip executing - File.Delete(tempDepsFile); - - var msBuildExePath = _environment.GetEnvironmentVariable(Constants.MSBUILD_EXE_PATH); - - msBuildExePath = string.IsNullOrEmpty(msBuildExePath) ? - Path.Combine(AppContext.BaseDirectory, "MSBuild.dll") : - msBuildExePath; - - var result = new MSBuildForwardingAppWithoutLogging(args, msBuildExePath) - .GetProcessStartInfo() - .ExecuteAndCaptureOutput(out string stdOut, out string stdErr); - - if (result != 0) - { - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.UnableToGenerateDepsJson, - stdOut + Environment.NewLine + stdErr)); - - throw new GracefulException(string.Format(LocalizableStrings.UnableToGenerateDepsJson, toolDepsJsonGeneratorProject)); - } - - try - { - File.Move(tempDepsFile, depsPath); - } - catch (Exception e) - { - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.UnableToGenerateDepsJson, - e.Message)); - - try - { - File.Delete(tempDepsFile); - } - catch (Exception e2) - { - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.UnableToDeleteTemporaryDepsJson, - e2.Message)); - } - } - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PublishPathCommandSpecFactory.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PublishPathCommandSpecFactory.cs deleted file mode 100644 index c3b3e1a31..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PublishPathCommandSpecFactory.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class PublishPathCommandSpecFactory : IPublishedPathCommandSpecFactory - { - public CommandSpec CreateCommandSpecFromPublishFolder( - string commandPath, - IEnumerable commandArguments, - CommandResolutionStrategy commandResolutionStrategy, - string depsFilePath, - string runtimeConfigPath) - { - return CreateCommandSpecWrappingWithMuxerIfDll( - commandPath, - commandArguments, - depsFilePath, - commandResolutionStrategy, - runtimeConfigPath); - } - - private CommandSpec CreateCommandSpecWrappingWithMuxerIfDll( - string commandPath, - IEnumerable commandArguments, - string depsFilePath, - CommandResolutionStrategy commandResolutionStrategy, - string runtimeConfigPath) - { - var commandExtension = Path.GetExtension(commandPath); - - if (commandExtension == FileNameSuffixes.DotNet.DynamicLib) - { - return CreatePackageCommandSpecUsingMuxer( - commandPath, - commandArguments, - depsFilePath, - commandResolutionStrategy, - runtimeConfigPath); - } - - return CreateCommandSpec(commandPath, commandArguments, commandResolutionStrategy); - } - private CommandSpec CreatePackageCommandSpecUsingMuxer( - string commandPath, - IEnumerable commandArguments, - string depsFilePath, - CommandResolutionStrategy commandResolutionStrategy, - string runtimeConfigPath) - { - var arguments = new List(); - - var muxer = new Muxer(); - - var host = muxer.MuxerPath; - if (host == null) - { - throw new Exception(LocalizableStrings.UnableToLocateDotnetMultiplexer); - } - - arguments.Add("exec"); - - if (runtimeConfigPath != null) - { - arguments.Add("--runtimeconfig"); - arguments.Add(runtimeConfigPath); - } - - if (depsFilePath != null) - { - arguments.Add("--depsfile"); - arguments.Add(depsFilePath); - } - - arguments.Add(commandPath); - arguments.AddRange(commandArguments); - - return CreateCommandSpec(host, arguments, commandResolutionStrategy); - } - - private CommandSpec CreateCommandSpec( - string commandPath, - IEnumerable commandArguments, - CommandResolutionStrategy commandResolutionStrategy) - { - var escapedArgs = ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart(commandArguments); - - return new CommandSpec(commandPath, escapedArgs, commandResolutionStrategy); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PublishedPathCommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PublishedPathCommandResolver.cs deleted file mode 100644 index 0b17a73aa..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PublishedPathCommandResolver.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) .NET 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.Cli.Utils -{ - public class PublishedPathCommandResolver : ICommandResolver - { - private const string PublishedPathCommandResolverName = "PublishedPathCommandResolver"; - - private readonly IEnvironmentProvider _environment; - private readonly IPublishedPathCommandSpecFactory _commandSpecFactory; - - public PublishedPathCommandResolver( - IEnvironmentProvider environment, - IPublishedPathCommandSpecFactory commandSpecFactory) - { - _environment = environment; - _commandSpecFactory = commandSpecFactory; - } - - public CommandSpec Resolve(CommandResolverArguments commandResolverArguments) - { - var publishDirectory = commandResolverArguments.OutputPath; - var commandName = commandResolverArguments.CommandName; - var applicationName = commandResolverArguments.ApplicationName; - - if (publishDirectory == null || commandName == null || applicationName == null) - { - return null; - } - - var commandPath = ResolveCommandPath(publishDirectory, commandName); - - if (commandPath == null) - { - return null; - } - - var depsFilePath = Path.Combine(publishDirectory, $"{applicationName}.deps.json"); - if (!File.Exists(depsFilePath)) - { - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.DoesNotExist, - PublishedPathCommandResolverName, - depsFilePath)); - return null; - } - - var runtimeConfigPath = Path.Combine(publishDirectory, $"{applicationName}.runtimeconfig.json"); - if (!File.Exists(runtimeConfigPath)) - { - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.DoesNotExist, - PublishedPathCommandResolverName, - runtimeConfigPath)); - return null; - } - - return _commandSpecFactory.CreateCommandSpecFromPublishFolder( - commandPath, - commandResolverArguments.CommandArguments.OrEmptyIfNull(), - CommandResolutionStrategy.OutputPath, - depsFilePath, - runtimeConfigPath); - } - - private string ResolveCommandPath(string publishDirectory, string commandName) - { - if (!Directory.Exists(publishDirectory)) - { - Reporter.Verbose.WriteLine(string.Format( - LocalizableStrings.DoesNotExist, - PublishedPathCommandResolverName, - publishDirectory)); - return null; - } - - return _environment.GetCommandPathFromRootPath(publishDirectory, commandName, ".dll"); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ResourceAssemblyInfo.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ResourceAssemblyInfo.cs deleted file mode 100644 index 12183f077..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ResourceAssemblyInfo.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.DotNet.Cli.Utils -{ - internal class ResourceAssemblyInfo - { - public string Culture { get; } - public string RelativePath { get; } - - public ResourceAssemblyInfo(string culture, string relativePath) - { - Culture = culture; - RelativePath = relativePath; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/RootedCommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/RootedCommandResolver.cs deleted file mode 100644 index b80848c5f..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/RootedCommandResolver.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.IO; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class RootedCommandResolver : ICommandResolver - { - public CommandSpec Resolve(CommandResolverArguments commandResolverArguments) - { - if (commandResolverArguments.CommandName == null) - { - return null; - } - - if (Path.IsPathRooted(commandResolverArguments.CommandName)) - { - var escapedArgs = ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart( - commandResolverArguments.CommandArguments.OrEmptyIfNull()); - - return new CommandSpec(commandResolverArguments.CommandName, escapedArgs, CommandResolutionStrategy.RootedPath); - } - - return null; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ScriptCommandResolverPolicy.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ScriptCommandResolverPolicy.cs deleted file mode 100644 index 10dafbd10..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ScriptCommandResolverPolicy.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.PlatformAbstractions; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class ScriptCommandResolverPolicy - { - public static CompositeCommandResolver Create() - { - var environment = new EnvironmentProvider(); - - var platformCommandSpecFactory = default(IPlatformCommandSpecFactory); - if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows) - { - platformCommandSpecFactory = new WindowsExePreferredCommandSpecFactory(); - } - else - { - platformCommandSpecFactory = new GenericPlatformCommandSpecFactory(); - } - - return CreateScriptCommandResolver(environment, platformCommandSpecFactory); - } - - public static CompositeCommandResolver CreateScriptCommandResolver( - IEnvironmentProvider environment, - IPlatformCommandSpecFactory platformCommandSpecFactory) - { - var compositeCommandResolver = new CompositeCommandResolver(); - - compositeCommandResolver.AddCommandResolver(new RootedCommandResolver()); - compositeCommandResolver.AddCommandResolver(new MuxerCommandResolver()); - compositeCommandResolver.AddCommandResolver(new ProjectPathCommandResolver(environment, platformCommandSpecFactory)); - compositeCommandResolver.AddCommandResolver(new AppBaseCommandResolver(environment, platformCommandSpecFactory)); - compositeCommandResolver.AddCommandResolver(new PathCommandResolver(environment, platformCommandSpecFactory)); - - return compositeCommandResolver; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/SingleProjectInfo.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/SingleProjectInfo.cs deleted file mode 100644 index 02d9b7c99..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/SingleProjectInfo.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; - -namespace Microsoft.DotNet.Cli.Utils -{ - internal class SingleProjectInfo - { - public string Name { get; } - public string Version { get; } - - public IEnumerable ResourceAssemblies { get; } - - public SingleProjectInfo(string name, string version, IEnumerable resourceAssemblies) - { - Name = name; - Version = version; - ResourceAssemblies = resourceAssemblies; - } - - public string GetOutputName() - { - return $"{Name}.dll"; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ToolPathCalculator.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ToolPathCalculator.cs deleted file mode 100644 index ffa4097fa..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ToolPathCalculator.cs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using NuGet.Frameworks; -using NuGet.Versioning; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class ToolPathCalculator - { - private readonly string _packagesDirectory; - - public ToolPathCalculator(string packagesDirectory) - { - _packagesDirectory = packagesDirectory; - } - - public string GetBestLockFilePath(string packageId, VersionRange versionRange, NuGetFramework framework) - { - if (versionRange == null) - { - throw new ArgumentNullException(nameof(versionRange)); - } - - if (framework == null) - { - throw new ArgumentNullException(nameof(framework)); - } - - var availableToolVersions = GetAvailableToolVersions(packageId); - - var bestVersion = versionRange.FindBestMatch(availableToolVersions); - if (bestVersion == null) - { - throw new GracefulException(string.Format( - LocalizableStrings.VersionForPackageCouldNotBeResolved, - packageId)); - } - - return GetLockFilePath(packageId, bestVersion, framework); - } - - public string GetLockFilePath(string packageId, NuGetVersion version, NuGetFramework framework) - { - if (version == null) - { - throw new ArgumentNullException(nameof(version)); - } - - if (framework == null) - { - throw new ArgumentNullException(nameof(framework)); - } - - return Path.Combine( - GetBaseToolPath(packageId), - version.ToNormalizedString().ToLowerInvariant(), - framework.GetShortFolderName(), - "project.assets.json"); - } - - private string GetBaseToolPath(string packageId) - { - return Path.Combine( - _packagesDirectory, - ".tools", - packageId.ToLowerInvariant()); - } - - private IEnumerable GetAvailableToolVersions(string packageId) - { - var availableVersions = new List(); - - var toolBase = GetBaseToolPath(packageId); - if (!Directory.Exists(toolBase)) - { - return Enumerable.Empty(); - } - - var versionDirectories = Directory.EnumerateDirectories(toolBase); - - foreach (var versionDirectory in versionDirectories) - { - var version = Path.GetFileName(versionDirectory); - - NuGetVersion nugetVersion = null; - NuGetVersion.TryParse(version, out nugetVersion); - - if (nugetVersion != null) - { - availableVersions.Add(nugetVersion); - } - } - - return availableVersions; - } - - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/WindowsExePreferredCommandSpecFactory.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/WindowsExePreferredCommandSpecFactory.cs deleted file mode 100644 index 7815c77f0..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/WindowsExePreferredCommandSpecFactory.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class WindowsExePreferredCommandSpecFactory : IPlatformCommandSpecFactory - { - public CommandSpec CreateCommandSpec( - string commandName, - IEnumerable args, - string commandPath, - CommandResolutionStrategy resolutionStrategy, - IEnvironmentProvider environment) - { - var useCmdWrapper = false; - - if (Path.GetExtension(commandPath).Equals(".cmd", StringComparison.OrdinalIgnoreCase)) - { - var preferredCommandPath = environment.GetCommandPath(commandName, ".exe"); - - if (preferredCommandPath == null) - { - useCmdWrapper = true; - } - else - { - commandPath = preferredCommandPath; - } - } - - return useCmdWrapper - ? CreateCommandSpecWrappedWithCmd(commandPath, args, resolutionStrategy) - : CreateCommandSpecFromExecutable(commandPath, args, resolutionStrategy); - } - - private CommandSpec CreateCommandSpecFromExecutable( - string command, - IEnumerable args, - CommandResolutionStrategy resolutionStrategy) - { - var escapedArgs = ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart(args); - return new CommandSpec(command, escapedArgs, resolutionStrategy); - } - - private CommandSpec CreateCommandSpecWrappedWithCmd( - string command, - IEnumerable args, - CommandResolutionStrategy resolutionStrategy) - { - var comSpec = Environment.GetEnvironmentVariable("ComSpec") ?? "cmd.exe"; - - // Handle the case where ComSpec is already the command - if (command.Equals(comSpec, StringComparison.OrdinalIgnoreCase)) - { - command = args.FirstOrDefault(); - args = args.Skip(1); - } - - var cmdEscapedArgs = ArgumentEscaper.EscapeAndConcatenateArgArrayForCmdProcessStart(args); - - if (ArgumentEscaper.ShouldSurroundWithQuotes(command)) - { - command = $"\"{command}\""; - } - - var escapedArgString = $"/s /c \"{command} {cmdEscapedArgs}\""; - - return new CommandSpec(comSpec, escapedArgString, resolutionStrategy); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolver.cs deleted file mode 100644 index 2759550d5..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolver.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using System.IO; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Cli.Utils -{ - internal class CommandResolver - { - public static CommandSpec TryResolveCommandSpec( - string commandName, - IEnumerable args, - NuGetFramework framework = null, - string configuration = Constants.DefaultConfiguration, - string outputPath = null, - string applicationName = null) - { - return TryResolveCommandSpec( - new DefaultCommandResolverPolicy(), - commandName, - args, - framework, - configuration, - outputPath, - applicationName); - } - - public static CommandSpec TryResolveCommandSpec( - ICommandResolverPolicy commandResolverPolicy, - string commandName, - IEnumerable args, - NuGetFramework framework = null, - string configuration = Constants.DefaultConfiguration, - string outputPath = null, - string applicationName = null) - { - var commandResolverArgs = new CommandResolverArguments - { - CommandName = commandName, - CommandArguments = args, - Framework = framework, - ProjectDirectory = Directory.GetCurrentDirectory(), - Configuration = configuration, - OutputPath = outputPath, - ApplicationName = applicationName - }; - - var defaultCommandResolver = commandResolverPolicy.CreateCommandResolver(); - - return defaultCommandResolver.Resolve(commandResolverArgs); - } - } -} - diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResult.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResult.cs deleted file mode 100644 index 7ffb87b74..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResult.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Diagnostics; - -namespace Microsoft.DotNet.Cli.Utils -{ - public struct CommandResult - { - public static readonly CommandResult Empty = new CommandResult(); - - public ProcessStartInfo StartInfo { get; } - public int ExitCode { get; } - public string StdOut { get; } - public string StdErr { get; } - - public CommandResult(ProcessStartInfo startInfo, int exitCode, string stdOut, string stdErr) - { - StartInfo = startInfo; - ExitCode = exitCode; - StdOut = stdOut; - StdErr = stdErr; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandSpec.cs b/src/Microsoft.DotNet.Cli.Utils/CommandSpec.cs deleted file mode 100644 index 4847f2d7d..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandSpec.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class CommandSpec - { - public CommandSpec( - string path, - string args, - CommandResolutionStrategy resolutionStrategy, - Dictionary environmentVariables = null) - { - Path = path; - Args = args; - ResolutionStrategy = resolutionStrategy; - EnvironmentVariables = environmentVariables ?? new Dictionary(); - } - - public string Path { get; } - - public string Args { get; } - - public Dictionary EnvironmentVariables { get; } - - public CommandResolutionStrategy ResolutionStrategy { get; } - - internal void AddEnvironmentVariablesFromProject(IProject project) - { - foreach (var environmentVariable in project.EnvironmentVariables) - { - EnvironmentVariables.Add(environmentVariable.Key, environmentVariable.Value); - } - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandUnknownException.cs b/src/Microsoft.DotNet.Cli.Utils/CommandUnknownException.cs deleted file mode 100644 index 1b943f14c..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/CommandUnknownException.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class CommandUnknownException : GracefulException - { - public CommandUnknownException(string commandName) : base(string.Format( - LocalizableStrings.NoExecutableFoundMatchingCommand, - commandName)) - { - } - - public CommandUnknownException(string commandName, Exception innerException) : base( - string.Format( - LocalizableStrings.NoExecutableFoundMatchingCommand, - commandName), - innerException) - { - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/Constants.cs b/src/Microsoft.DotNet.Cli.Utils/Constants.cs deleted file mode 100644 index 187a451d2..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/Constants.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.PlatformAbstractions; - -namespace Microsoft.DotNet.Cli.Utils -{ - public static class Constants - { - private static Platform CurrentPlatform => RuntimeEnvironment.OperatingSystemPlatform; - public const string DefaultConfiguration = "Debug"; - - public static readonly string ProjectFileName = "project.json"; - public static readonly string ExeSuffix = CurrentPlatform == Platform.Windows ? ".exe" : string.Empty; - - public static readonly string BinDirectoryName = "bin"; - public static readonly string ObjDirectoryName = "obj"; - - public static readonly string MSBUILD_EXE_PATH = "MSBUILD_EXE_PATH"; - public static readonly string MSBuildExtensionsPath = "MSBuildExtensionsPath"; - - public static readonly string ProjectArgumentName = ""; - public static readonly string SolutionArgumentName = ""; - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/DebugHelper.cs b/src/Microsoft.DotNet.Cli.Utils/DebugHelper.cs deleted file mode 100644 index 03610371f..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/DebugHelper.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Diagnostics; -using System.Linq; - -namespace Microsoft.DotNet.Cli.Utils -{ - public static class DebugHelper - { - [Conditional("DEBUG")] - public static void HandleDebugSwitch(ref string[] args) - { - if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase)) - { - args = args.Skip(1).ToArray(); - WaitForDebugger(); - } - } - - public static void WaitForDebugger() - { - Console.WriteLine(LocalizableStrings.WaitingForDebuggerToAttach); - Console.WriteLine(string.Format(LocalizableStrings.ProcessId, Process.GetCurrentProcess().Id)); - Console.ReadLine(); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/DepsJsonCommandFactory.cs b/src/Microsoft.DotNet.Cli.Utils/DepsJsonCommandFactory.cs deleted file mode 100644 index 33f89529a..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/DepsJsonCommandFactory.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class DepsJsonCommandFactory : ICommandFactory - { - private DepsJsonCommandResolver _depsJsonCommandResolver; - private string _temporaryDirectory; - private string _depsJsonFile; - private string _runtimeConfigFile; - - public DepsJsonCommandFactory( - string depsJsonFile, - string runtimeConfigFile, - string nugetPackagesRoot, - string temporaryDirectory) - { - _depsJsonCommandResolver = new DepsJsonCommandResolver(nugetPackagesRoot); - - _temporaryDirectory = temporaryDirectory; - _depsJsonFile = depsJsonFile; - _runtimeConfigFile = runtimeConfigFile; - } - - public ICommand Create( - string commandName, - IEnumerable args, - NuGetFramework framework = null, - string configuration = Constants.DefaultConfiguration) - { - var commandResolverArgs = new CommandResolverArguments() - { - CommandName = commandName, - CommandArguments = args, - DepsJsonFile = _depsJsonFile - }; - - var commandSpec = _depsJsonCommandResolver.Resolve(commandResolverArgs); - - return Command.Create(commandSpec); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/DotnetFiles.cs b/src/Microsoft.DotNet.Cli.Utils/DotnetFiles.cs deleted file mode 100644 index 3a5accdfb..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/DotnetFiles.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using System.Reflection; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.PlatformAbstractions; - -namespace Microsoft.DotNet.Cli -{ - internal static class DotnetFiles - { - private static string SdkRootFolder => Path.Combine(typeof(DotnetFiles).GetTypeInfo().Assembly.Location, ".."); - - private static Lazy s_versionFileObject = - new Lazy(() => new DotnetVersionFile(VersionFile)); - - /// - /// The CLI ships with a .version file that stores the commit information and CLI version - /// - public static string VersionFile => Path.GetFullPath(Path.Combine(SdkRootFolder, ".version")); - - internal static DotnetVersionFile VersionFileObject - { - get { return s_versionFileObject.Value; } - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/DotnetVersionFile.cs b/src/Microsoft.DotNet.Cli.Utils/DotnetVersionFile.cs deleted file mode 100644 index 1f76067f2..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/DotnetVersionFile.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using System.IO; - -namespace Microsoft.DotNet.Cli.Utils -{ - internal class DotnetVersionFile - { - public bool Exists { get; set; } - - public string CommitSha { get; set; } - - public string BuildNumber { get; set; } - - /// - /// The runtime identifier (rid) that this CLI was built for. - /// - /// - /// This is different than RuntimeEnvironment.GetRuntimeIdentifier() because the - /// BuildRid is a RID that is guaranteed to exist and works on the current machine. The - /// RuntimeEnvironment.GetRuntimeIdentifier() may be for a new version of the OS that - /// doesn't have full support yet. - /// - public string BuildRid { get; set; } - - public DotnetVersionFile(string versionFilePath) - { - Exists = File.Exists(versionFilePath); - - if (Exists) - { - IEnumerable lines = File.ReadLines(versionFilePath); - - int index = 0; - foreach (string line in lines) - { - if (index == 0) - { - CommitSha = line.Substring(0, 10); - } - else if (index == 1) - { - BuildNumber = line; - } - else if (index == 2) - { - BuildRid = line; - } - else - { - break; - } - - index++; - } - } - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/Env.cs b/src/Microsoft.DotNet.Cli.Utils/Env.cs deleted file mode 100644 index 6aad6f4c4..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/Env.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; - -namespace Microsoft.DotNet.Cli.Utils -{ - public static class Env - { - private static IEnvironmentProvider _environment = new EnvironmentProvider(); - - public static IEnumerable ExecutableExtensions - { - get - { - return _environment.ExecutableExtensions; - } - } - - public static string GetCommandPath(string commandName, params string[] extensions) - { - return _environment.GetCommandPath(commandName, extensions); - } - - public static string GetCommandPathFromRootPath(string rootPath, string commandName, params string[] extensions) - { - return _environment.GetCommandPathFromRootPath(rootPath, commandName, extensions); - } - - public static string GetCommandPathFromRootPath(string rootPath, string commandName, IEnumerable extensions) - { - return _environment.GetCommandPathFromRootPath(rootPath, commandName, extensions); - } - - public static bool GetEnvironmentVariableAsBool(string name, bool defaultValue = false) - { - return _environment.GetEnvironmentVariableAsBool(name, defaultValue); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/EnvironmentProvider.cs b/src/Microsoft.DotNet.Cli.Utils/EnvironmentProvider.cs deleted file mode 100644 index 6c23d4c9e..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/EnvironmentProvider.cs +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Microsoft.DotNet.PlatformAbstractions; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class EnvironmentProvider : IEnvironmentProvider - { - private IEnumerable _searchPaths; - private IEnumerable _executableExtensions; - - public IEnumerable ExecutableExtensions - { - get - { - if (_executableExtensions == null) - { - - _executableExtensions = RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows - ? Environment.GetEnvironmentVariable("PATHEXT") - .Split(';') - .Select(e => e.ToLower().Trim('"')) - : new [] { string.Empty }; - } - - return _executableExtensions; - } - } - - private IEnumerable SearchPaths - { - get - { - if (_searchPaths == null) - { - var searchPaths = new List { ApplicationEnvironment.ApplicationBasePath }; - - searchPaths.AddRange(Environment - .GetEnvironmentVariable("PATH") - .Split(Path.PathSeparator) - .Select(p => p.Trim('"'))); - - _searchPaths = searchPaths; - } - - return _searchPaths; - } - } - - public EnvironmentProvider( - IEnumerable extensionsOverride = null, - IEnumerable searchPathsOverride = null) - { - _executableExtensions = extensionsOverride; - _searchPaths = searchPathsOverride; - } - - public string GetCommandPath(string commandName, params string[] extensions) - { - if (!extensions.Any()) - { - extensions = ExecutableExtensions.ToArray(); - } - - var commandPath = SearchPaths.Join( - extensions, - p => true, s => true, - (p, s) => Path.Combine(p, commandName + s)) - .FirstOrDefault(File.Exists); - - return commandPath; - } - - public string GetCommandPathFromRootPath(string rootPath, string commandName, params string[] extensions) - { - if (!extensions.Any()) - { - extensions = ExecutableExtensions.ToArray(); - } - - var commandPath = extensions.Select(e => Path.Combine(rootPath, commandName + e)) - .FirstOrDefault(File.Exists); - - return commandPath; - } - - public string GetCommandPathFromRootPath(string rootPath, string commandName, IEnumerable extensions) - { - var extensionsArr = extensions.OrEmptyIfNull().ToArray(); - - return GetCommandPathFromRootPath(rootPath, commandName, extensionsArr); - } - - public string GetEnvironmentVariable(string name) - { - return Environment.GetEnvironmentVariable(name); - } - - public bool GetEnvironmentVariableAsBool(string name, bool defaultValue) - { - var str = Environment.GetEnvironmentVariable(name); - if (string.IsNullOrEmpty(str)) - { - return defaultValue; - } - - switch (str.ToLowerInvariant()) - { - case "true": - case "1": - case "yes": - return true; - case "false": - case "0": - case "no": - return false; - default: - return defaultValue; - } - } - - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/ExceptionExtensions.cs b/src/Microsoft.DotNet.Cli.Utils/ExceptionExtensions.cs deleted file mode 100644 index 265edd05e..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/ExceptionExtensions.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Microsoft.DotNet.Cli.Utils -{ - internal static class ExceptionExtensions - { - public static TException DisplayAsError(this TException exception) - where TException : Exception - { - exception.Data.Add(CLI_User_Displayed_Exception, true); - return exception; - } - - public static void ReportAsWarning(this Exception e) - { - Reporter.Verbose.WriteLine($"Warning: Ignoring exception: {e.ToString().Yellow()}"); - } - - public static bool ShouldBeDisplayedAsError(this Exception e) => - e.Data.Contains(CLI_User_Displayed_Exception); - - internal const string CLI_User_Displayed_Exception = "CLI_User_Displayed_Exception"; - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/Extensions/CollectionsExtensions.cs b/src/Microsoft.DotNet.Cli.Utils/Extensions/CollectionsExtensions.cs deleted file mode 100644 index 08779f65e..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/Extensions/CollectionsExtensions.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.DotNet.Cli.Utils -{ - public static class CollectionsExtensions - { - public static IEnumerable OrEmptyIfNull(this IEnumerable enumerable) - { - return enumerable == null - ? Enumerable.Empty() - : enumerable; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/Extensions/LockFileExtensions.cs b/src/Microsoft.DotNet.Cli.Utils/Extensions/LockFileExtensions.cs deleted file mode 100644 index a54a502a9..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/Extensions/LockFileExtensions.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Tools.Common; -using NuGet.Packaging; -using NuGet.ProjectModel; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Microsoft.DotNet.Cli.Utils -{ - static class LockFileExtensions - { - public static string GetPackageDirectory(this LockFile lockFile, LockFileTargetLibrary library) - { - var packageFolders = lockFile.GetNormalizedPackageFolders(); - - var packageFoldersCount = packageFolders.Count(); - var userPackageFolder = packageFoldersCount == 1 ? string.Empty : packageFolders.First(); - var fallbackPackageFolders = packageFoldersCount > 1 ? packageFolders.Skip(1) : packageFolders; - - var packageDirectory = new FallbackPackagePathResolver(userPackageFolder, fallbackPackageFolders) - .GetPackageDirectory(library.Name, library.Version); - - return packageDirectory; - } - - public static IEnumerable GetNormalizedPackageFolders(this LockFile lockFile) - { - return lockFile.PackageFolders.Select(p => - PathUtility.EnsureNoTrailingDirectorySeparator(p.Path)); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/Extensions/LockFileFormatExtensions.cs b/src/Microsoft.DotNet.Cli.Utils/Extensions/LockFileFormatExtensions.cs deleted file mode 100644 index 559d6bebe..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/Extensions/LockFileFormatExtensions.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using System.Threading; -using System.Threading.Tasks; -using NuGet.Common; -using NuGet.ProjectModel; - -namespace Microsoft.DotNet.Cli.Utils -{ - public static class LockFileFormatExtensions - { - public static async Task ReadWithLock(this LockFileFormat subject, string path) - { - return await ConcurrencyUtilities.ExecuteWithFileLockedAsync( - path, - lockedToken => - { - if (!File.Exists(path)) - { - throw new GracefulException(string.Join( - Environment.NewLine, - string.Format(LocalizableStrings.FileNotFound, path), - LocalizableStrings.ProjectNotRestoredOrRestoreFailed)); - } - - var lockFile = FileAccessRetrier.RetryOnFileAccessFailure(() => subject.Read(path)); - - return lockFile; - }, - CancellationToken.None); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/FileAccessRetryer.cs b/src/Microsoft.DotNet.Cli.Utils/FileAccessRetryer.cs deleted file mode 100644 index f73d5d4d1..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/FileAccessRetryer.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using System.Threading.Tasks; - -namespace Microsoft.DotNet.Cli.Utils -{ - public static class FileAccessRetrier - { - public static async Task RetryOnFileAccessFailure(Func func, int maxRetries = 3000, TimeSpan sleepDuration = default(TimeSpan)) - { - var attemptsLeft = maxRetries; - - if (sleepDuration == default(TimeSpan)) - { - sleepDuration = TimeSpan.FromMilliseconds(10); - } - - while (true) - { - if (attemptsLeft < 1) - { - throw new InvalidOperationException(LocalizableStrings.CouldNotAccessAssetsFile); - } - - attemptsLeft--; - - try - { - return func(); - } - catch (UnauthorizedAccessException) - { - // This can occur when the file is being deleted - // Or when an admin user has locked the file - await Task.Delay(sleepDuration); - - continue; - } - catch (IOException) - { - await Task.Delay(sleepDuration); - - continue; - } - } - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/FileNameSuffixes.cs b/src/Microsoft.DotNet.Cli.Utils/FileNameSuffixes.cs deleted file mode 100644 index 5bb3fc795..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/FileNameSuffixes.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using Microsoft.DotNet.PlatformAbstractions; - -namespace Microsoft.DotNet.Cli.Utils -{ - public static class FileNameSuffixes - { - public const string DepsJson = ".deps.json"; - public const string RuntimeConfigJson = ".runtimeconfig.json"; - public const string RuntimeConfigDevJson = ".runtimeconfig.dev.json"; - - public static PlatformFileNameSuffixes CurrentPlatform - { - get - { - switch (RuntimeEnvironment.OperatingSystemPlatform) - { - case Platform.Windows: - return Windows; - case Platform.Darwin: - return OSX; - case Platform.Linux: - return Linux; - default: - throw new InvalidOperationException("Unknown Platform"); - } - } - } - - public static PlatformFileNameSuffixes DotNet { get; } = new PlatformFileNameSuffixes - { - DynamicLib = ".dll", - Exe = ".exe", - ProgramDatabase = ".pdb", - StaticLib = ".lib" - }; - - public static PlatformFileNameSuffixes Windows { get; } = new PlatformFileNameSuffixes - { - DynamicLib = ".dll", - Exe = ".exe", - ProgramDatabase = ".pdb", - StaticLib = ".lib" - }; - - public static PlatformFileNameSuffixes OSX { get; } = new PlatformFileNameSuffixes - { - DynamicLib = ".dylib", - Exe = "", - ProgramDatabase = ".pdb", - StaticLib = ".a" - }; - - public static PlatformFileNameSuffixes Linux { get; } = new PlatformFileNameSuffixes - { - DynamicLib = ".so", - Exe = "", - ProgramDatabase = ".pdb", - StaticLib = ".a" - }; - - public struct PlatformFileNameSuffixes - { - public string DynamicLib { get; internal set; } - - public string Exe { get; internal set; } - - public string ProgramDatabase { get; internal set; } - - public string StaticLib { get; internal set; } - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/ForwardingAppImplementation.cs b/src/Microsoft.DotNet.Cli.Utils/ForwardingAppImplementation.cs deleted file mode 100644 index 72e65aa3c..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/ForwardingAppImplementation.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using System.Diagnostics; -using Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.Cli.Utils -{ - /// - /// A class which encapsulates logic needed to forward arguments from the current process to another process - /// invoked with the dotnet.exe host. - /// - internal class ForwardingAppImplementation - { - private const string HostExe = "dotnet"; - - private readonly string _forwardApplicationPath; - private readonly IEnumerable _argsToForward; - private readonly string _depsFile; - private readonly string _runtimeConfig; - private readonly string _additionalProbingPath; - private Dictionary _environmentVariables; - - private readonly string[] _allArgs; - - public ForwardingAppImplementation( - string forwardApplicationPath, - IEnumerable argsToForward, - string depsFile = null, - string runtimeConfig = null, - string additionalProbingPath = null, - Dictionary environmentVariables = null) - { - _forwardApplicationPath = forwardApplicationPath; - _argsToForward = argsToForward; - _depsFile = depsFile; - _runtimeConfig = runtimeConfig; - _additionalProbingPath = additionalProbingPath; - _environmentVariables = environmentVariables; - - var allArgs = new List(); - allArgs.Add("exec"); - - if (_depsFile != null) - { - allArgs.Add("--depsfile"); - allArgs.Add(_depsFile); - } - - if (_runtimeConfig != null) - { - allArgs.Add("--runtimeconfig"); - allArgs.Add(_runtimeConfig); - } - - if (_additionalProbingPath != null) - { - allArgs.Add("--additionalprobingpath"); - allArgs.Add(_additionalProbingPath); - } - - allArgs.Add(_forwardApplicationPath); - allArgs.AddRange(_argsToForward); - - _allArgs = allArgs.ToArray(); - } - - public int Execute() - { - return GetProcessStartInfo().Execute(); - } - - public ProcessStartInfo GetProcessStartInfo() - { - var processInfo = new ProcessStartInfo - { - FileName = GetHostExeName(), - Arguments = ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart(_allArgs), - UseShellExecute = false - }; - - if (_environmentVariables != null) - { - foreach (var entry in _environmentVariables) - { - processInfo.Environment[entry.Key] = entry.Value; - } - } - - return processInfo; - } - - public ForwardingAppImplementation WithEnvironmentVariable(string name, string value) - { - _environmentVariables = _environmentVariables ?? new Dictionary(); - - _environmentVariables.Add(name, value); - - return this; - } - - private string GetHostExeName() - { - return $"{HostExe}{FileNameSuffixes.CurrentPlatform.Exe}"; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/FrameworkDependencyFile.cs b/src/Microsoft.DotNet.Cli.Utils/FrameworkDependencyFile.cs deleted file mode 100644 index 202c07e9c..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/FrameworkDependencyFile.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using System.Linq; -using Microsoft.DotNet.PlatformAbstractions; - -using Microsoft.Extensions.DependencyModel; - -namespace Microsoft.DotNet.Cli.Utils -{ - /// - /// Represents the .deps.json file in the shared framework - /// that the CLI is running against. - /// - internal class FrameworkDependencyFile - { - private readonly string _depsFilePath; - private readonly Lazy _dependencyContext; - - private DependencyContext DependencyContext => _dependencyContext.Value; - - public FrameworkDependencyFile() - { - _depsFilePath = Muxer.GetDataFromAppDomain("FX_DEPS_FILE"); - _dependencyContext = new Lazy(CreateDependencyContext); - } - - public bool SupportsCurrentRuntime() - { - return IsRuntimeSupported(RuntimeEnvironment.GetRuntimeIdentifier()); - } - - public bool IsRuntimeSupported(string runtimeIdentifier) - { - return DependencyContext.RuntimeGraph.Any(g => g.Runtime == runtimeIdentifier); - } - - public string GetNetStandardLibraryVersion() - { - return DependencyContext - .RuntimeLibraries - .FirstOrDefault(l => "netstandard.library".Equals(l.Name, StringComparison.OrdinalIgnoreCase)) - ?.Version; - } - - private DependencyContext CreateDependencyContext() - { - using (Stream depsFileStream = File.OpenRead(_depsFilePath)) - using (DependencyContextJsonReader reader = new DependencyContextJsonReader()) - { - return reader.Read(depsFileStream); - } - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/GracefulException.cs b/src/Microsoft.DotNet.Cli.Utils/GracefulException.cs deleted file mode 100644 index 50ab33a0b..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/GracefulException.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class GracefulException : Exception - { - public GracefulException(string message) : base(message) - { - Data.Add(ExceptionExtensions.CLI_User_Displayed_Exception, true); - } - - public GracefulException(string format, params string[] args) : this(string.Format(format, args)) - { - } - - public GracefulException(string message, Exception innerException) : base(message, innerException) - { - Data.Add(ExceptionExtensions.CLI_User_Displayed_Exception, true); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/IBuiltInCommandEnvironment.cs b/src/Microsoft.DotNet.Cli.Utils/IBuiltInCommandEnvironment.cs deleted file mode 100644 index e71cbdb22..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/IBuiltInCommandEnvironment.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.IO; - -namespace Microsoft.DotNet.Cli.Utils -{ - internal interface IBuiltInCommandEnvironment - { - TextWriter GetConsoleOut(); - void SetConsoleOut(TextWriter newOut); - - TextWriter GetConsoleError(); - void SetConsoleError(TextWriter newError); - - string GetWorkingDirectory(); - void SetWorkingDirectory(string path); - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/ICommand.cs b/src/Microsoft.DotNet.Cli.Utils/ICommand.cs deleted file mode 100644 index 9f1cfe3a2..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/ICommand.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; - -namespace Microsoft.DotNet.Cli.Utils -{ - public interface ICommand - { - CommandResult Execute(); - - ICommand WorkingDirectory(string projectDirectory); - - ICommand EnvironmentVariable(string name, string value); - - ICommand CaptureStdOut(); - - ICommand CaptureStdErr(); - - ICommand ForwardStdOut(TextWriter to = null, bool onlyIfVerbose = false, bool ansiPassThrough = true); - - ICommand ForwardStdErr(TextWriter to = null, bool onlyIfVerbose = false, bool ansiPassThrough = true); - - ICommand OnOutputLine(Action handler); - - ICommand OnErrorLine(Action handler); - - CommandResolutionStrategy ResolutionStrategy { get; } - - string CommandName { get; } - - string CommandArgs { get; } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/ICommandFactory.cs b/src/Microsoft.DotNet.Cli.Utils/ICommandFactory.cs deleted file mode 100644 index 017d7a0d5..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/ICommandFactory.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Cli.Utils -{ - public interface ICommandFactory - { - ICommand Create( - string commandName, - IEnumerable args, - NuGetFramework framework = null, - string configuration = Constants.DefaultConfiguration); - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/IEnvironmentProvider.cs b/src/Microsoft.DotNet.Cli.Utils/IEnvironmentProvider.cs deleted file mode 100644 index 43830b6f5..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/IEnvironmentProvider.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; - -namespace Microsoft.DotNet.Cli.Utils -{ - public interface IEnvironmentProvider - { - IEnumerable ExecutableExtensions { get; } - - string GetCommandPath(string commandName, params string[] extensions); - - string GetCommandPathFromRootPath(string rootPath, string commandName, params string[] extensions); - - string GetCommandPathFromRootPath(string rootPath, string commandName, IEnumerable extensions); - - bool GetEnvironmentVariableAsBool(string name, bool defaultValue); - - string GetEnvironmentVariable(string name); - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/IReporter.cs b/src/Microsoft.DotNet.Cli.Utils/IReporter.cs deleted file mode 100644 index db04fc1d2..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/IReporter.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.DotNet.Cli.Utils -{ - public interface IReporter - { - - void WriteLine(string message); - - void WriteLine(); - - void Write(string message); - - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/ITelemetryFilter.cs b/src/Microsoft.DotNet.Cli.Utils/ITelemetryFilter.cs deleted file mode 100644 index a1a8f5a1e..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/ITelemetryFilter.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; - -namespace Microsoft.DotNet.Cli.Utils -{ - public interface ITelemetryFilter - { - IEnumerable Filter(object o); - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/LocalizableStrings.resx b/src/Microsoft.DotNet.Cli.Utils/LocalizableStrings.resx deleted file mode 100644 index 0fe90333b..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/LocalizableStrings.resx +++ /dev/null @@ -1,259 +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 - - - Malformed command text '{0}' - - - outputpathresolver: {0} does not exist - - - {0}: attempting to find command {1} in {2} - - - {0}: failed to find toolAssembly for {1} - - - {0}: failed to find commandPath {1} - - - Unable to locate dotnet multiplexer - - - {0}: Looking for prefercliruntime file at `{1}` - - - {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) - - - {0}: Could not find runtimeconfig.json file for tool {1} - - - {0}: attempting to resolve {1} - - - {0}: Did not find a matching project {1}. - - - {0}: invalid commandResolverArguments - - - {0}: {1} does not exist - - - Ambiguous command name: {0} - - - {0}: tool library found {1} - - - {0}: MSBUILD_EXE_PATH = {1} - - - {0}: MSBuild project path = {1} - - - Specify which project file to use because this '{0}' contains more than one project file. - - - {0}: ProjectFactory did not find Project. - - - {0}: resolving commandspec from {1} Tool Libraries. - - - {0}: failed to resolve commandspec from library. - - - {0}: Attempting to resolve command spec from tool {1} - - - {0}: nuget packages root: -{1} - - - {0}: found tool lockfile at : {1} - - - {0}: library not found in lock file. - - - {0}: attempting to create commandspec - - - {0}: commandSpec is null. - - - {0}: expect deps.json at: {1} - - - Generating deps.json at: {0} - - - unable to generate deps.json, it may have been already generated: {0} - - - Unable to find deps.json generator project. - - - unable to delete temporary deps.json file: {0} - - - Version for package `{0}` could not be resolved. - - - File not found `{0}`. - - - The project may not have been restored or restore failed - run `dotnet restore` - - - No executable found matching command "{0}" - - - The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` - - - Waiting for debugger to attach. Press ENTER to continue - - - Process ID: {0} - - - Could not access assets file. - - - .NET Command Line Tools - - - WriteLine forwarder set previously - - - Already capturing stream! - - - Running {0} {1} - - - < {0} exited with {1} in {2} ms. - - - Unable to invoke {0} after the command has been run - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs b/src/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs deleted file mode 100644 index 500ab7b30..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; - -namespace Microsoft.DotNet.Cli.Utils -{ - internal class MSBuildForwardingAppWithoutLogging - { - private const string MSBuildExeName = "MSBuild.dll"; - - private const string SdksDirectoryName = "Sdks"; - - private readonly ForwardingAppImplementation _forwardingApp; - - private readonly Dictionary _msbuildRequiredEnvironmentVariables = - new Dictionary - { - { "MSBuildExtensionsPath", AppContext.BaseDirectory }, - { "CscToolExe", GetRunCscPath() }, - { "VbcToolExe", GetRunVbcPath() }, - { "MSBuildSDKsPath", GetMSBuildSDKsPath() } - }; - - private readonly IEnumerable _msbuildRequiredParameters = - new List { "/m", "/v:m" }; - - public MSBuildForwardingAppWithoutLogging(IEnumerable argsToForward, string msbuildPath = null) - { - _forwardingApp = new ForwardingAppImplementation( - msbuildPath ?? GetMSBuildExePath(), - _msbuildRequiredParameters.Concat(argsToForward.Select(Escape)), - environmentVariables: _msbuildRequiredEnvironmentVariables); - } - - public virtual ProcessStartInfo GetProcessStartInfo() - { - return _forwardingApp - .GetProcessStartInfo(); - } - - public int Execute() - { - return GetProcessStartInfo().Execute(); - } - - private static string Escape(string arg) => - // this is a workaround for https://github.com/Microsoft/msbuild/issues/1622 - (arg.StartsWith("/p:RestoreSources=", StringComparison.OrdinalIgnoreCase)) ? - arg.Replace(";", "%3B") - .Replace("://", ":%2F%2F") : - arg; - - private static string GetMSBuildExePath() - { - return Path.Combine( - AppContext.BaseDirectory, - MSBuildExeName); - } - - private static string GetMSBuildSDKsPath() - { - var envMSBuildSDKsPath = Environment.GetEnvironmentVariable("MSBuildSDKsPath"); - - if (envMSBuildSDKsPath != null) - { - return envMSBuildSDKsPath; - } - - return Path.Combine( - AppContext.BaseDirectory, - SdksDirectoryName); - } - - private static string GetRunVbcPath() - { - return GetRunToolPath("Vbc"); - } - - private static string GetRunCscPath() - { - return GetRunToolPath("Csc"); - } - - private static string GetRunToolPath(string compilerName) - { - var scriptExtension = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".cmd" : ".sh"; - return Path.Combine(AppContext.BaseDirectory, "Roslyn", $"Run{compilerName}{scriptExtension}"); - } - } -} - diff --git a/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj b/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj deleted file mode 100644 index a1dd1e22f..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj +++ /dev/null @@ -1,40 +0,0 @@ - - - - $(SdkVersion) - netstandard1.5;net46 - netstandard1.5 - true - ../../tools/Key.snk - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Microsoft.DotNet.Cli.Utils/Muxer.cs b/src/Microsoft.DotNet.Cli.Utils/Muxer.cs deleted file mode 100644 index e603205bd..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/Muxer.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using System.Reflection; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class Muxer - { - public static readonly string MuxerName = "dotnet"; - private static readonly string s_muxerFileName = MuxerName + Constants.ExeSuffix; - - private string _muxerPath; - - internal string SharedFxVersion - { - get - { - var depsFile = new FileInfo(GetDataFromAppDomain("FX_DEPS_FILE")); - return depsFile.Directory.Name; - } - } - - public string MuxerPath - { - get - { - if (_muxerPath == null) - { - throw new InvalidOperationException(LocalizableStrings.UnableToLocateDotnetMultiplexer); - } - return _muxerPath; - } - } - - public Muxer() - { - if (!TryResolveMuxerFromParentDirectories()) - { - TryResolverMuxerFromPath(); - } - } - - public static string GetDataFromAppDomain(string propertyName) - { - var appDomainType = typeof(object).GetTypeInfo().Assembly?.GetType("System.AppDomain"); - var currentDomain = appDomainType?.GetProperty("CurrentDomain")?.GetValue(null); - var deps = appDomainType?.GetMethod("GetData")?.Invoke(currentDomain, new[] { propertyName }); - - return deps as string; - } - - private bool TryResolveMuxerFromParentDirectories() - { - var fxDepsFile = GetDataFromAppDomain("FX_DEPS_FILE"); - if (string.IsNullOrEmpty(fxDepsFile)) - { - return false; - } - - var muxerDir = new FileInfo(fxDepsFile).Directory?.Parent?.Parent?.Parent; - if (muxerDir == null) - { - return false; - } - - var muxerCandidate = Path.Combine(muxerDir.FullName, s_muxerFileName); - - if (!File.Exists(muxerCandidate)) - { - return false; - } - - _muxerPath = muxerCandidate; - return true; - } - - private bool TryResolverMuxerFromPath() - { - var muxerPath = Env.GetCommandPath(MuxerName, Constants.ExeSuffix); - - if (muxerPath == null || !File.Exists(muxerPath)) - { - return false; - } - - _muxerPath = muxerPath; - - return true; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/PathUtility.cs b/src/Microsoft.DotNet.Cli.Utils/PathUtility.cs deleted file mode 100644 index cbbc0d401..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/PathUtility.cs +++ /dev/null @@ -1,342 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.PlatformAbstractions; - -namespace Microsoft.DotNet.Tools.Common -{ - public static class PathUtility - { - public static bool IsPlaceholderFile(string path) - { - return string.Equals(Path.GetFileName(path), "_._", StringComparison.Ordinal); - } - - public static bool IsChildOfDirectory(string dir, string candidate) - { - if (dir == null) - { - throw new ArgumentNullException(nameof(dir)); - } - if (candidate == null) - { - throw new ArgumentNullException(nameof(candidate)); - } - dir = Path.GetFullPath(dir); - dir = EnsureTrailingSlash(dir); - candidate = Path.GetFullPath(candidate); - return candidate.StartsWith(dir, StringComparison.OrdinalIgnoreCase); - } - - public static string EnsureTrailingSlash(string path) - { - return EnsureTrailingCharacter(path, Path.DirectorySeparatorChar); - } - - public static string EnsureTrailingForwardSlash(string path) - { - return EnsureTrailingCharacter(path, '/'); - } - - private static string EnsureTrailingCharacter(string path, char trailingCharacter) - { - if (path == null) - { - throw new ArgumentNullException(nameof(path)); - } - - // if the path is empty, we want to return the original string instead of a single trailing character. - if (path.Length == 0 || path[path.Length - 1] == trailingCharacter) - { - return path; - } - - return path + trailingCharacter; - } - - public static string EnsureNoTrailingDirectorySeparator(string path) - { - if (!string.IsNullOrEmpty(path)) - { - char lastChar = path[path.Length - 1]; - if (lastChar == Path.DirectorySeparatorChar) - { - path = path.Substring(0, path.Length - 1); - } - } - - return path; - } - - public static void EnsureParentDirectoryExists(string filePath) - { - string directory = Path.GetDirectoryName(filePath); - - EnsureDirectoryExists(directory); - } - - public static void EnsureDirectoryExists(string directoryPath) - { - if (!Directory.Exists(directoryPath)) - { - Directory.CreateDirectory(directoryPath); - } - } - - public static bool TryDeleteDirectory(string directoryPath) - { - try - { - Directory.Delete(directoryPath, true); - - return true; - } - catch - { - return false; - } - } - - /// - /// Returns childItem relative to directory, with Path.DirectorySeparatorChar as separator - /// - public static string GetRelativePath(DirectoryInfo directory, FileSystemInfo childItem) - { - var path1 = EnsureTrailingSlash(directory.FullName); - - var path2 = childItem.FullName; - - return GetRelativePath(path1, path2, Path.DirectorySeparatorChar, true); - } - - /// - /// Returns path2 relative to path1, with Path.DirectorySeparatorChar as separator - /// - public static string GetRelativePath(string path1, string path2) - { - return GetRelativePath(path1, path2, Path.DirectorySeparatorChar, true); - } - - /// - /// Returns path2 relative to path1, with Path.DirectorySeparatorChar as separator but ignoring directory - /// traversals. - /// - public static string GetRelativePathIgnoringDirectoryTraversals(string path1, string path2) - { - return GetRelativePath(path1, path2, Path.DirectorySeparatorChar, false); - } - - /// - /// Returns path2 relative to path1, with given path separator - /// - public static string GetRelativePath(string path1, string path2, char separator, bool includeDirectoryTraversals) - { - if (string.IsNullOrEmpty(path1)) - { - throw new ArgumentException("Path must have a value", nameof(path1)); - } - - if (string.IsNullOrEmpty(path2)) - { - throw new ArgumentException("Path must have a value", nameof(path2)); - } - - StringComparison compare; - if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows) - { - compare = StringComparison.OrdinalIgnoreCase; - // check if paths are on the same volume - if (!string.Equals(Path.GetPathRoot(path1), Path.GetPathRoot(path2))) - { - // on different volumes, "relative" path is just path2 - return path2; - } - } - else - { - compare = StringComparison.Ordinal; - } - - var index = 0; - var path1Segments = path1.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); - var path2Segments = path2.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); - // if path1 does not end with / it is assumed the end is not a directory - // we will assume that is isn't a directory by ignoring the last split - var len1 = path1Segments.Length - 1; - var len2 = path2Segments.Length; - - // find largest common absolute path between both paths - var min = Math.Min(len1, len2); - while (min > index) - { - if (!string.Equals(path1Segments[index], path2Segments[index], compare)) - { - break; - } - // Handle scenarios where folder and file have same name (only if os supports same name for file and directory) - // e.g. /file/name /file/name/app - else if ((len1 == index && len2 > index + 1) || (len1 > index && len2 == index + 1)) - { - break; - } - ++index; - } - - var path = ""; - - // check if path2 ends with a non-directory separator and if path1 has the same non-directory at the end - if (len1 + 1 == len2 && !string.IsNullOrEmpty(path1Segments[index]) && - string.Equals(path1Segments[index], path2Segments[index], compare)) - { - return path; - } - - if (includeDirectoryTraversals) - { - for (var i = index; len1 > i; ++i) - { - path += ".." + separator; - } - } - - for (var i = index; len2 - 1 > i; ++i) - { - path += path2Segments[i] + separator; - } - // if path2 doesn't end with an empty string it means it ended with a non-directory name, so we add it back - if (!string.IsNullOrEmpty(path2Segments[len2 - 1])) - { - path += path2Segments[len2 - 1]; - } - - return path; - } - - public static string GetAbsolutePath(string basePath, string relativePath) - { - if (basePath == null) - { - throw new ArgumentNullException(nameof(basePath)); - } - - if (relativePath == null) - { - throw new ArgumentNullException(nameof(relativePath)); - } - - Uri resultUri = new Uri(new Uri(basePath), new Uri(relativePath, UriKind.Relative)); - return resultUri.LocalPath; - } - - public static string GetDirectoryName(string path) - { - path = path.TrimEnd(Path.DirectorySeparatorChar); - return path.Substring(Path.GetDirectoryName(path).Length).Trim(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); - } - - public static string GetPathWithForwardSlashes(string path) - { - return path.Replace('\\', '/'); - } - - public static string GetPathWithBackSlashes(string path) - { - return path.Replace('/', '\\'); - } - - public static string GetPathWithDirectorySeparator(string path) - { - if (Path.DirectorySeparatorChar == '/') - { - return GetPathWithForwardSlashes(path); - } - else - { - return GetPathWithBackSlashes(path); - } - } - - public static string RemoveExtraPathSeparators(string path) - { - if (string.IsNullOrEmpty(path)) - { - return path; - } - - var components = path.Split(Path.DirectorySeparatorChar); - var result = string.Empty; - - foreach (var component in components) - { - if (!string.IsNullOrEmpty(component)) - { - result = Path.Combine(result, component); - } - } - - if (path[path.Length-1] == Path.DirectorySeparatorChar) - { - result += Path.DirectorySeparatorChar; - } - - return result; - } - - public static bool HasExtension(this string filePath, string extension) - { - var comparison = StringComparison.Ordinal; - - if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows) - { - comparison = StringComparison.OrdinalIgnoreCase; - } - - return Path.GetExtension(filePath).Equals(extension, comparison); - } - - /// - /// Gets the fully-qualified path without failing if the - /// path is empty. - /// - public static string GetFullPath(string path) - { - if (string.IsNullOrWhiteSpace(path)) - { - return path; - } - - return Path.GetFullPath(path); - } - - public static void EnsureAllPathsExist( - IReadOnlyCollection paths, - string pathDoesNotExistLocalizedFormatString) - { - var notExisting = new List(); - - foreach (var p in paths) - { - if (!File.Exists(p)) - { - notExisting.Add(p); - } - } - - if (notExisting.Count > 0) - { - throw new GracefulException( - string.Join( - Environment.NewLine, - notExisting.Select(p => string.Format(pathDoesNotExistLocalizedFormatString, p)))); - } - } - - public static bool IsDirectory(this string path) => - File.GetAttributes(path).HasFlag(FileAttributes.Directory); - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/ProcessStartInfoExtensions.cs b/src/Microsoft.DotNet.Cli.Utils/ProcessStartInfoExtensions.cs deleted file mode 100644 index 0d11313b9..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/ProcessStartInfoExtensions.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Diagnostics; - -namespace Microsoft.DotNet.Cli.Utils -{ - internal static class ProcessStartInfoExtensions - { - public static int Execute(this ProcessStartInfo startInfo) - { - if (startInfo == null) - { - throw new ArgumentNullException(nameof(startInfo)); - } - - var process = new Process - { - StartInfo = startInfo - }; - - process.Start(); - process.WaitForExit(); - - return process.ExitCode; - } - - public static int ExecuteAndCaptureOutput(this ProcessStartInfo startInfo, out string stdOut, out string stdErr) - { - var outStream = new StreamForwarder().Capture(); - var errStream = new StreamForwarder().Capture(); - - startInfo.RedirectStandardOutput = true; - startInfo.RedirectStandardError = true; - - var process = new Process - { - StartInfo = startInfo - }; - - process.EnableRaisingEvents = true; - - process.Start(); - - var taskOut = outStream.BeginRead(process.StandardOutput); - var taskErr = errStream.BeginRead(process.StandardError); - - process.WaitForExit(); - - taskOut.Wait(); - taskErr.Wait(); - - stdOut = outStream.CapturedOutput; - stdErr = errStream.CapturedOutput; - - return process.ExitCode; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/Product.cs b/src/Microsoft.DotNet.Cli.Utils/Product.cs deleted file mode 100644 index 8811847b3..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/Product.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Reflection; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class Product - { - public static string LongName => LocalizableStrings.DotNetCommandLineTools; - public static readonly string Version = GetProductVersion(); - - private static string GetProductVersion() - { - var attr = typeof(Product) - .GetTypeInfo() - .Assembly - .GetCustomAttribute(); - return attr?.InformationalVersion; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/ProjectDependenciesCommandFactory.cs b/src/Microsoft.DotNet.Cli.Utils/ProjectDependenciesCommandFactory.cs deleted file mode 100644 index 43dc094e3..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/ProjectDependenciesCommandFactory.cs +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using Microsoft.DotNet.PlatformAbstractions; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class ProjectDependenciesCommandFactory : ICommandFactory - { - private readonly NuGetFramework _nugetFramework; - private readonly string _configuration; - private readonly string _outputPath; - private readonly string _buildBasePath; - private readonly string _projectDirectory; - - public ProjectDependenciesCommandFactory( - NuGetFramework nugetFramework, - string configuration, - string outputPath, - string buildBasePath, - string projectDirectory) - { - _nugetFramework = nugetFramework; - _configuration = configuration; - _outputPath = outputPath; - _buildBasePath = buildBasePath; - _projectDirectory = projectDirectory; - - if (_configuration == null) - { - _configuration = Constants.DefaultConfiguration; - } - } - - public ICommand Create( - string commandName, - IEnumerable args, - NuGetFramework framework = null, - string configuration = null) - { - if (string.IsNullOrEmpty(configuration)) - { - configuration = _configuration; - } - - if (framework == null) - { - framework = _nugetFramework; - } - - var commandSpec = FindProjectDependencyCommands( - commandName, - args, - configuration, - framework, - _outputPath, - _buildBasePath, - _projectDirectory); - - return Command.Create(commandSpec); - } - - private CommandSpec FindProjectDependencyCommands( - string commandName, - IEnumerable commandArgs, - string configuration, - NuGetFramework framework, - string outputPath, - string buildBasePath, - string projectDirectory) - { - var commandResolverArguments = new CommandResolverArguments - { - CommandName = commandName, - CommandArguments = commandArgs, - Framework = framework, - Configuration = configuration, - OutputPath = outputPath, - BuildBasePath = buildBasePath, - ProjectDirectory = projectDirectory - }; - - var commandResolver = GetProjectDependenciesCommandResolver(framework); - - var commandSpec = commandResolver.Resolve(commandResolverArguments); - if (commandSpec == null) - { - throw new CommandUnknownException(commandName); - } - - return commandSpec; - } - - private ICommandResolver GetProjectDependenciesCommandResolver(NuGetFramework framework) - { - var environment = new EnvironmentProvider(); - - if (framework.IsDesktop()) - { - IPlatformCommandSpecFactory platformCommandSpecFactory = null; - if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows) - { - platformCommandSpecFactory = new WindowsExePreferredCommandSpecFactory(); - } - else - { - platformCommandSpecFactory = new GenericPlatformCommandSpecFactory(); - } - - return new OutputPathCommandResolver(environment, platformCommandSpecFactory); - } - else - { - var packagedCommandSpecFactory = new PackagedCommandSpecFactory(); - return new ProjectDependenciesCommandResolver(environment, packagedCommandSpecFactory); - } - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/Properties/AssemblyInfo.cs b/src/Microsoft.DotNet.Cli.Utils/Properties/AssemblyInfo.cs deleted file mode 100644 index 5ebd03235..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: AssemblyMetadataAttribute("Serviceable", "True")] -[assembly: InternalsVisibleTo("dotnet, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("dotnet.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("Microsoft.DotNet.Tools.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("Microsoft.DotNet.Cli.Utils.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("Microsoft.DotNet.TestFramework, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("Microsoft.DotNet.Tools.Tests.Utilities, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("Microsoft.DotNet.ProjectJsonMigration, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/Microsoft.DotNet.Cli.Utils/PublishedPathCommandFactory.cs b/src/Microsoft.DotNet.Cli.Utils/PublishedPathCommandFactory.cs deleted file mode 100644 index 24fac7d35..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/PublishedPathCommandFactory.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.Collections.Generic; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class PublishedPathCommandFactory : ICommandFactory - { - private readonly string _publishDirectory; - private readonly string _applicationName; - - public PublishedPathCommandFactory(string publishDirectory, string applicationName) - { - _publishDirectory = publishDirectory; - _applicationName = applicationName; - } - - public ICommand Create( - string commandName, - IEnumerable args, - NuGetFramework framework = null, - string configuration = Constants.DefaultConfiguration) - { - return Command.Create(commandName, args, framework, configuration, _publishDirectory, _applicationName); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/Reporter.cs b/src/Microsoft.DotNet.Cli.Utils/Reporter.cs deleted file mode 100644 index 51b9b1c02..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/Reporter.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (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 -{ - // Stupid-simple console manager - public class Reporter : IReporter - { - private static readonly Reporter NullReporter = new Reporter(console: null); - private static object _lock = new object(); - - private readonly AnsiConsole _console; - - static Reporter() - { - Reset(); - } - - private Reporter(AnsiConsole console) - { - _console = console; - } - - public static Reporter Output { get; private set; } - public static Reporter Error { get; private set; } - public static Reporter Verbose { get; private set; } - - /// - /// Resets the Reporters to write to the current Console Out/Error. - /// - public static void Reset() - { - lock (_lock) - { - Output = new Reporter(AnsiConsole.GetOutput()); - Error = new Reporter(AnsiConsole.GetError()); - Verbose = IsVerbose ? - new Reporter(AnsiConsole.GetOutput()) : - NullReporter; - } - } - - public static bool IsVerbose => CommandContext.IsVerbose(); - - public void WriteLine(string message) - { - lock (_lock) - { - if (CommandContext.ShouldPassAnsiCodesThrough()) - { - _console?.Writer?.WriteLine(message); - } - else - { - _console?.WriteLine(message); - } - } - } - - public void WriteLine() - { - lock (_lock) - { - _console?.Writer?.WriteLine(); - } - } - - public void Write(string message) - { - lock (_lock) - { - if (CommandContext.ShouldPassAnsiCodesThrough()) - { - _console?.Writer?.Write(message); - } - else - { - _console?.Write(message); - } - } - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/RuntimeConfig.cs b/src/Microsoft.DotNet.Cli.Utils/RuntimeConfig.cs deleted file mode 100644 index 51574b3d5..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/RuntimeConfig.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System.IO; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class RuntimeConfig - { - public bool IsPortable { get; } - public RuntimeConfigFramework Framework { get; } - - public RuntimeConfig(string runtimeConfigPath) - { - JObject runtimeConfigJson; - using (var streamReader = new StreamReader(File.OpenRead(runtimeConfigPath))) - { - runtimeConfigJson = OpenRuntimeConfig(streamReader); - } - - Framework = ParseFramework(runtimeConfigJson); - - IsPortable = Framework != null; - } - - public static bool IsApplicationPortable(string entryAssemblyPath) - { - var runtimeConfigFile = Path.ChangeExtension(entryAssemblyPath, FileNameSuffixes.RuntimeConfigJson); - if (File.Exists(runtimeConfigFile)) - { - var runtimeConfig = new RuntimeConfig(runtimeConfigFile); - return runtimeConfig.IsPortable; - } - return false; - } - - private JObject OpenRuntimeConfig(StreamReader streamReader) - { - var reader = new JsonTextReader(streamReader); - - return JObject.Load(reader); - } - - private RuntimeConfigFramework ParseFramework(JObject runtimeConfigRoot) - { - var runtimeOptionsRoot = runtimeConfigRoot["runtimeOptions"]; - if (runtimeOptionsRoot == null) - { - return null; - } - - var framework = (JObject) runtimeOptionsRoot["framework"]; - if (framework == null) - { - return null; - } - - return RuntimeConfigFramework.ParseFromFrameworkRoot(framework); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/RuntimeConfigFramework.cs b/src/Microsoft.DotNet.Cli.Utils/RuntimeConfigFramework.cs deleted file mode 100644 index b8f8dcea5..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/RuntimeConfigFramework.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Linq; -using Newtonsoft.Json.Linq; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class RuntimeConfigFramework - { - public string Name { get; set; } - public string Version { get; set; } - - public static RuntimeConfigFramework ParseFromFrameworkRoot(JObject framework) - { - var properties = framework.Properties(); - - var name = properties.FirstOrDefault(p => p.Name.Equals("name", StringComparison.OrdinalIgnoreCase)); - var version = properties.FirstOrDefault(p => p.Name.Equals("version", StringComparison.OrdinalIgnoreCase)); - - if (name == null || version == null) - { - return null; - } - - return new RuntimeConfigFramework - { - Name = name.Value.ToString(), - Version = version.Value.ToString() - }; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/RuntimeEnvironmentRidExtensions.cs b/src/Microsoft.DotNet.Cli.Utils/RuntimeEnvironmentRidExtensions.cs deleted file mode 100644 index b758f047e..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/RuntimeEnvironmentRidExtensions.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.Collections.Generic; -using Microsoft.DotNet.PlatformAbstractions; - -namespace Microsoft.DotNet.Cli.Utils -{ - // This is to support some legacy stuff. - // dnu restore (and thus dotnet restore) always uses win7-x64 as the Windows restore target, - // so, when picking targets out of the lock file, we need to do version fallback since the - // active RID might be higher than the RID in the lock file. - // - // We should clean this up. Filed #619 to track. - public static class RuntimeEnvironmentRidExtensions - { - // Gets the identfier that is used for restore by default (this is different from the actual RID, but only on Windows) - public static string GetLegacyRestoreRuntimeIdentifier() - { - if (RuntimeEnvironment.OperatingSystemPlatform != Platform.Windows) - { - return RuntimeEnvironment.GetRuntimeIdentifier(); - } - else - { - var arch = RuntimeEnvironment.RuntimeArchitecture.ToLowerInvariant(); - return "win7-" + arch; - } - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/StreamForwarder.cs b/src/Microsoft.DotNet.Cli.Utils/StreamForwarder.cs deleted file mode 100644 index 654b9e754..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/StreamForwarder.cs +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Microsoft.DotNet.Cli.Utils -{ - public sealed class StreamForwarder - { - private static readonly char[] s_ignoreCharacters = new char[] { '\r' }; - private static readonly char s_flushBuilderCharacter = '\n'; - - private StringBuilder _builder; - private StringWriter _capture; - private Action _writeLine; - - public string CapturedOutput - { - get - { - return _capture?.GetStringBuilder()?.ToString(); - } - } - - public StreamForwarder Capture() - { - ThrowIfCaptureSet(); - - _capture = new StringWriter(); - - return this; - } - - public StreamForwarder ForwardTo(Action writeLine) - { - ThrowIfNull(writeLine); - - ThrowIfForwarderSet(); - - _writeLine = writeLine; - - return this; - } - - public Task BeginRead(TextReader reader) - { - return Task.Run(() => Read(reader)); - } - - public void Read(TextReader reader) - { - var bufferSize = 1; - - int readCharacterCount; - char currentCharacter; - - var buffer = new char[bufferSize]; - _builder = new StringBuilder(); - - // Using Read with buffer size 1 to prevent looping endlessly - // like we would when using Read() with no buffer - while ((readCharacterCount = reader.Read(buffer, 0, bufferSize)) > 0) - { - currentCharacter = buffer[0]; - - if (currentCharacter == s_flushBuilderCharacter) - { - WriteBuilder(); - } - else if (! s_ignoreCharacters.Contains(currentCharacter)) - { - _builder.Append(currentCharacter); - } - } - - // Flush anything else when the stream is closed - // Which should only happen if someone used console.Write - WriteBuilder(); - } - - private void WriteBuilder() - { - if (_builder.Length == 0) - { - return; - } - - WriteLine(_builder.ToString()); - _builder.Clear(); - } - - private void WriteLine(string str) - { - if (_capture != null) - { - _capture.WriteLine(str); - } - - if (_writeLine != null) - { - _writeLine(str); - } - } - - private void ThrowIfNull(object obj) - { - if (obj == null) - { - throw new ArgumentNullException(nameof(obj)); - } - } - - private void ThrowIfForwarderSet() - { - if (_writeLine != null) - { - throw new InvalidOperationException(LocalizableStrings.WriteLineForwarderSetPreviously); - } - } - - private void ThrowIfCaptureSet() - { - if (_capture != null) - { - throw new InvalidOperationException(LocalizableStrings.AlreadyCapturingStream); - } - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/TelemetryEventEntry.cs b/src/Microsoft.DotNet.Cli.Utils/TelemetryEventEntry.cs deleted file mode 100644 index fbbf9d559..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/TelemetryEventEntry.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Microsoft.DotNet.Cli.Utils -{ - public static class TelemetryEventEntry - { - public static event EventHandler EntryPosted; - public static ITelemetryFilter TelemetryFilter { get; set; } = new BlockFilter(); - - public static void TrackEvent( - string eventName = null, - IDictionary properties = null, - IDictionary measurements = null) - { - EntryPosted?.Invoke(typeof(TelemetryEventEntry), - new InstrumentationEventArgs(eventName, properties, measurements)); - } - - public static void SendFiltered(object o = null) - { - if (o == null) - { - return; - } - - foreach (ApplicationInsightsEntryFormat entry in TelemetryFilter.Filter(o)) - { - TrackEvent(entry.EventName, entry.Properties, entry.Measurements); - } - } - - public static void Subscribe(Action, - IDictionary> subscriber) - { - void Handler(object sender, InstrumentationEventArgs eventArgs) - { - subscriber(eventArgs.EventName, eventArgs.Properties, eventArgs.Measurements); - } - - EntryPosted += Handler; - } - } - - public class BlockFilter : ITelemetryFilter - { - public IEnumerable Filter(object o) - { - return new List(); - } - } - - public class InstrumentationEventArgs : EventArgs - { - internal InstrumentationEventArgs( - string eventName, - IDictionary properties, - IDictionary measurements) - { - EventName = eventName; - Properties = properties; - Measurements = measurements; - } - - public string EventName { get; } - public IDictionary Properties { get; } - public IDictionary Measurements { get; } - } - - public class ApplicationInsightsEntryFormat - { - public ApplicationInsightsEntryFormat( - string eventName = null, - IDictionary properties = null, - IDictionary measurements = null) - { - EventName = eventName; - Properties = properties; - Measurements = measurements; - } - - public string EventName { get; } - public IDictionary Properties { get; } - public IDictionary Measurements { get; } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/Tracing/PerfTrace.cs b/src/Microsoft.DotNet.Cli.Utils/Tracing/PerfTrace.cs deleted file mode 100644 index 696c00195..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/Tracing/PerfTrace.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Threading; - -namespace Microsoft.DotNet.Cli.Utils -{ - public static class PerfTrace - { - private static ConcurrentBag _threads = new ConcurrentBag(); - - [ThreadStatic] - private static PerfTraceThreadContext _current; - - public static bool Enabled { get; set; } - - public static PerfTraceThreadContext Current => _current ?? (_current = InitializeCurrent()); - - private static PerfTraceThreadContext InitializeCurrent() - { - var context = new PerfTraceThreadContext(Thread.CurrentThread.ManagedThreadId); - _threads.Add(context); - return context; - } - - public static IEnumerable GetEvents() - { - return _threads; - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/Tracing/PerfTraceEvent.cs b/src/Microsoft.DotNet.Cli.Utils/Tracing/PerfTraceEvent.cs deleted file mode 100644 index 9bf2e36ee..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/Tracing/PerfTraceEvent.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class PerfTraceEvent - { - public string Type { get; } - public string Instance { get; } - public DateTime StartUtc { get; } - public TimeSpan Duration { get; } - public IList Children { get; } - - public PerfTraceEvent(string type, string instance, IEnumerable children, DateTime startUtc, TimeSpan duration) - { - Type = type; - Instance = instance; - StartUtc = startUtc; - Duration = duration; - Children = children.OrderBy(e => e.StartUtc).ToList(); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/Tracing/PerfTraceOutput.cs b/src/Microsoft.DotNet.Cli.Utils/Tracing/PerfTraceOutput.cs deleted file mode 100644 index f1b3b8cfb..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/Tracing/PerfTraceOutput.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Text; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class PerfTraceOutput - { - private static TimeSpan _minDuration = TimeSpan.FromSeconds(0.001); - - public static void Print(Reporter reporter, IEnumerable contexts) - { - foreach (var threadContext in contexts) - { - Print(reporter, new[] { threadContext.Root }, threadContext.Root, null); - } - } - - private static void Print(Reporter reporter, IEnumerable events, PerfTraceEvent root, PerfTraceEvent parent, int padding = 0) - { - foreach (var e in events) - { - if (e.Duration < _minDuration) - { - continue; - } - reporter.Write(new string(' ', padding)); - reporter.WriteLine(FormatEvent(e, root, parent)); - Print(reporter, e.Children, root, e, padding + 2); - } - } - - private static string FormatEvent(PerfTraceEvent e, PerfTraceEvent root, PerfTraceEvent parent) - { - var builder = new StringBuilder(); - FormatEventTimeStat(builder, e, root, parent); - builder.Append($" {e.Type.Bold()} {e.Instance}"); - return builder.ToString(); - } - - private static void FormatEventTimeStat(StringBuilder builder, PerfTraceEvent e, PerfTraceEvent root, PerfTraceEvent parent) - { - builder.Append("["); - if (root != e) - { - AppendTime(builder, e.Duration.TotalSeconds / root.Duration.TotalSeconds, 0.2); - } - AppendTime(builder, e.Duration.TotalSeconds / parent?.Duration.TotalSeconds, 0.5); - builder.Append($"{e.Duration.ToString("ss\\.fff\\s").Blue()}]"); - } - - private static void AppendTime(StringBuilder builder, double? percent, double treshold) - { - if (percent != null) - { - var formattedPercent = $"{percent*100:00\\.00%}"; - if (percent > treshold) - { - builder.Append(formattedPercent.Red()); - } - else if (percent > treshold / 2) - { - builder.Append(formattedPercent.Yellow()); - } - else if (percent > treshold / 5) - { - builder.Append(formattedPercent.Green()); - } - else - { - builder.Append(formattedPercent); - } - builder.Append(" "); - } - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/Tracing/PerfTraceThreadContext.cs b/src/Microsoft.DotNet.Cli.Utils/Tracing/PerfTraceThreadContext.cs deleted file mode 100644 index 2be2af011..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/Tracing/PerfTraceThreadContext.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Concurrent; -using System.Diagnostics; -using System.IO; -using System.Runtime.CompilerServices; -using System.Threading; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class PerfTraceThreadContext - { - private readonly int _threadId; - - private TimerDisposable _activeEvent; - - public PerfTraceEvent Root => _activeEvent.CreateEvent(); - - public PerfTraceThreadContext(int threadId) - { - _activeEvent = new TimerDisposable(this, "Thread", $"{threadId.ToString()}"); - _threadId = threadId; - } - - public IDisposable CaptureTiming(string instance = "", [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "") - { - if(!PerfTrace.Enabled) - { - return null; - } - - var newTimer = new TimerDisposable(this, $"{Path.GetFileNameWithoutExtension(filePath)}:{memberName}", instance); - var previousTimer = Interlocked.Exchange(ref _activeEvent, newTimer); - newTimer.Parent = previousTimer; - return newTimer; - } - - private void RecordTiming(PerfTraceEvent newEvent, TimerDisposable parent) - { - Interlocked.Exchange(ref _activeEvent, parent); - _activeEvent.Children.Add(newEvent); - } - - private class TimerDisposable : IDisposable - { - private readonly PerfTraceThreadContext _context; - private string _eventType; - private string _instance; - private DateTime _startUtc; - private Stopwatch _stopwatch = Stopwatch.StartNew(); - - public TimerDisposable Parent { get; set; } - - public ConcurrentBag Children { get; set; } = new ConcurrentBag(); - - public TimerDisposable(PerfTraceThreadContext context, string eventType, string instance) - { - _context = context; - _eventType = eventType; - _instance = instance; - _startUtc = DateTime.UtcNow; - } - - public void Dispose() - { - _stopwatch.Stop(); - - _context.RecordTiming(CreateEvent(), Parent); - } - - public PerfTraceEvent CreateEvent() => new PerfTraceEvent(_eventType, _instance, Children, _startUtc, _stopwatch.Elapsed); - } - } -} diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.cs.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index 1aaef6cd5..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - Malformed command text '{0}' - Nesprávně naformátovaný text příkazu {0} - - - - outputpathresolver: {0} does not exist - outputpathresolver: {0} neexistuje - - - - {0}: attempting to find command {1} in {2} - {0}: Pokus o nalezení příkazu {1} v {2} - - - - {0}: failed to find toolAssembly for {1} - {0}: Nepodařilo se najít toolAssembly pro {1} - - - - {0}: failed to find commandPath {1} - {0}: Nepodařilo se najít commandPath {1} - - - - Unable to locate dotnet multiplexer - Nepodařilo se najít multiplexor dotnetu. - - - - {0}: Looking for prefercliruntime file at `{1}` - {0}: Hledání souboru prefercliruntime v {1} - - - - {0}: attempting to resolve {1} - {0}: Pokus o vyřešení {1} - - - - {0}: Did not find a matching project {1}. - {0}: Nepodařilo se najít shodný projekt {1}. - - - - {0}: invalid commandResolverArguments - {0}: Neplatné hodnoty commandResolverArguments - - - - {0}: {1} does not exist - {0}: {1} neexistuje. - - - - Ambiguous command name: {0} - Nejednoznačný název příkazu {0} - - - - {0}: tool library found {1} - {0}: Nalezena knihovna nástrojů {1} - - - - {0}: MSBUILD_EXE_PATH = {1} - {0}: MSBUILD_EXE_PATH = {1} - - - - {0}: MSBuild project path = {1} - {0}: Cesta k projektu MSBuildu = {1} - - - - Specify which project file to use because this '{0}' contains more than one project file. - Zadejte, jaký soubor projektu se použije, protože {0} obsahuje více souborů projektů. - - - - {0}: ProjectFactory did not find Project. - {0}: Objekt pro vytváření projektů ProjectFactory nenašel projekt. - - - - {0}: resolving commandspec from {1} Tool Libraries. - {0}: Řeší se specifikace příkazu commandspec z knihoven nástroje {1}. - - - - {0}: failed to resolve commandspec from library. - {0}: Specifikaci příkazu commandspec z knihovny se nepodařilo vyřešit. - - - - {0}: Attempting to resolve command spec from tool {1} - {0}: Pokus o vyřešení specifikace příkazu nástroje {1} - - - - {0}: nuget packages root: -{1} - {0}: Kořen balíčků NuGet: -{1} - - - - {0}: found tool lockfile at : {1} - {0}: Zjištěný lockfile nástroje na: {1} - - - - {0}: library not found in lock file. - {0}: Knihovna nebyla v souboru lock nalezena. - - - - {0}: attempting to create commandspec - {0}: Pokus o vytvoření specifikace příkazu commandspec - - - - {0}: commandSpec is null. - {0}: Specifikace příkazu commandSpec je null. - - - - {0}: expect deps.json at: {1} - {0}: Soubor deps.json se očekává v: {1} - - - - Generating deps.json at: {0} - Generování souboru deps.json do: {0} - - - - unable to generate deps.json, it may have been already generated: {0} - Soubor deps.json se nepodařilo vygenerovat, protože už je pravděpodobně vygenerovaný: {0} - - - - unable to delete temporary deps.json file: {0} - nepodařilo se odstranit dočasný soubor deps.json: {0} - - - - Version for package `{0}` could not be resolved. - Verzi balíčku {0} se nepodařilo vyřešit. - - - - File not found `{0}`. - Soubor {0} nebyl nenalezen. - - - - The project may not have been restored or restore failed - run `dotnet restore` - Projekt se nepodařilo obnovit nebo jeho obnovení nebylo úspěšné. Spusťte příkaz „dotnet restore“. - - - - No executable found matching command "{0}" - Nenalezen spustitelný soubor odpovídající příkazu {0} - - - - Waiting for debugger to attach. Press ENTER to continue - Čeká se na připojení ladicího programu. Pokračujte stisknutím ENTER. - - - - Process ID: {0} - ID procesu: {0} - - - - Could not access assets file. - Nepodařilo se získat přístup k souboru prostředků. - - - - .NET Command Line Tools - Nástroje příkazového řádku .NET - - - - WriteLine forwarder set previously - Předávání WriteLine už je nastavené. - - - - Already capturing stream! - Stream už se zaznamenává. - - - - Running {0} {1} - Spuštěno {0} {1} - - - - < {0} exited with {1} in {2} ms. - < {0} skončil s {1} za {2} ms. - - - - Unable to invoke {0} after the command has been run - Po spuštění příkazu se nepodařilo volat {0}. - - - - {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) - {0}: Soubor prefercliruntime se ignoruje, protože cílová architektura nástroje ({1}) má jinou hlavní verzi než aktuální modul runtime rozhraní příkazového řádku ({2}). - - - - {0}: Could not find runtimeconfig.json file for tool {1} - {0}: Soubor runtimeconfig.json nástroje {1} se nenašel. - - - - Unable to find deps.json generator project. - Projekt generátoru deps.json se nenašel. - - - - The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` - Spustitelný soubor příkazu {0} se nenašel. Projekt se nepodařilo obnovit nebo jeho obnovení nebylo úspěšné. Spusťte příkaz dotnet restore. - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.de.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index 03af407f7..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - Malformed command text '{0}' - Fehlerhafter Befehlstext "{0}". - - - - outputpathresolver: {0} does not exist - outputpathresolver: {0} nicht vorhanden - - - - {0}: attempting to find command {1} in {2} - {0}: Nach Befehl {1} wird in {2} gesucht - - - - {0}: failed to find toolAssembly for {1} - {0}: toolAssembly für {1} nicht gefunden - - - - {0}: failed to find commandPath {1} - {0}: commandPath für {1} nicht gefunden - - - - Unable to locate dotnet multiplexer - Dotnetmultiplexer nicht gefunden - - - - {0}: Looking for prefercliruntime file at `{1}` - {0}: Suche nach prefercliruntime-Datei unter {1} - - - - {0}: attempting to resolve {1} - {0}: Es wird versucht, {1} aufzulösen - - - - {0}: Did not find a matching project {1}. - {0}: Kein passendes Projekt {1} gefunden. - - - - {0}: invalid commandResolverArguments - {0}: ungültige commandResolverArguments - - - - {0}: {1} does not exist - {0}: {1} nicht vorhanden - - - - Ambiguous command name: {0} - Nicht eindeutiger Befehlsname: {0} - - - - {0}: tool library found {1} - {0}: Toolbibliothek gefunden: {1} - - - - {0}: MSBUILD_EXE_PATH = {1} - {0}: MSBUILD_EXE_PATH = {1} - - - - {0}: MSBuild project path = {1} - {0}: MSBuild-Projektpfad = {1} - - - - Specify which project file to use because this '{0}' contains more than one project file. - Geben Sie an, welche Projektdatei verwendet werden soll, weil "{0}" mehrere Projektdateien enthält. - - - - {0}: ProjectFactory did not find Project. - {0}: ProjectFactory hat das Projekt nicht gefunden. - - - - {0}: resolving commandspec from {1} Tool Libraries. - {0}: commandspec aus {1} Toolbibliotheken wird aufgelöst. - - - - {0}: failed to resolve commandspec from library. - {0}: commandspec aus Bibliothek konnte nicht aufgelöst werden. - - - - {0}: Attempting to resolve command spec from tool {1} - {0}: Es wird versucht, commandspec aus Tool {1} aufzulösen. - - - - {0}: nuget packages root: -{1} - {0}: NuGet-Paketstamm: -{1} - - - - {0}: found tool lockfile at : {1} - {0}: Toolsperrdatei gefunden unter: {1} - - - - {0}: library not found in lock file. - {0}: Bibliothek nicht in Sperrdatei gefunden. - - - - {0}: attempting to create commandspec - {0}: Es wird versucht, commandspec zu erstellen - - - - {0}: commandSpec is null. - {0}: commandspec ist NULL. - - - - {0}: expect deps.json at: {1} - {0}: "deps.json" vermutet unter: {1} - - - - Generating deps.json at: {0} - "deps.json" wird erzeugt unter: {0} - - - - unable to generate deps.json, it may have been already generated: {0} - "deps.json" kann nicht erzeugt werden; sie wurde vielleicht bereits erzeugt: {0} - - - - unable to delete temporary deps.json file: {0} - Temporäre deps.json-Datei kann nicht gelöscht werden: {0} - - - - Version for package `{0}` could not be resolved. - Version für Paket "{0}" konnte nicht aufgelöst werden. - - - - File not found `{0}`. - Datei nicht gefunden: "{0}". - - - - The project may not have been restored or restore failed - run `dotnet restore` - Das Projekt wurde möglicherweise nicht wiederhergestellt, oder bei der Wiederherstellung ist ein Fehler aufgetreten. führen Sie "dotnet restore" aus. - - - - No executable found matching command "{0}" - Keine ausführbare Datei zum Befehl "{0}" gefunden. - - - - Waiting for debugger to attach. Press ENTER to continue - Auf das Anfügen des Debuggers wird gewartet. Drücken Sie zum Fortsetzen die EINGABETASTE. - - - - Process ID: {0} - Prozess-ID: {0} - - - - Could not access assets file. - Zugriff auf Ressourcendatei nicht möglich. - - - - .NET Command Line Tools - .NET-Befehlszeilentools - - - - WriteLine forwarder set previously - WriteLine-Weiterleitung wurde bereits festgelegt. - - - - Already capturing stream! - Datenstrom wird bereits erfasst! - - - - Running {0} {1} - {0} {1} wird ausgeführt. - - - - < {0} exited with {1} in {2} ms. - < {0} wurde nach {2} ms mit {1} beendet. - - - - Unable to invoke {0} after the command has been run - {0} kann nach Ausführung des Befehls nicht aufgerufen werden. - - - - {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) - {0}: Die Datei "prefercliruntime" wird ignoriert, da das Tool-Ziellaufwerk ({1}) eine andere Hauptversion aufweist als die aktuelle CLI-Laufzeit ({2}). - - - - {0}: Could not find runtimeconfig.json file for tool {1} - {0}: Die Datei "runtimeconfig.json" wurde für das Tool {1} nicht gefunden. - - - - Unable to find deps.json generator project. - Das deps.json-Generatorprojekt wurde nicht gefunden. - - - - The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` - Der für "{0}" auszuführende Befehl wurde nicht gefunden. Das Projekt wurde möglicherweise nicht wiederhergestellt, oder bei der Wiederherstellung ist ein Fehler aufgetreten. Führen Sie "dotnet restore" aus. - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.es.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index c235b3cd2..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - Malformed command text '{0}' - Texto de comando con formato incorrecto "{0}" - - - - outputpathresolver: {0} does not exist - outputpathresolver: {0} no existe - - - - {0}: attempting to find command {1} in {2} - {0}: intentando encontrar el comando {1} en {2} - - - - {0}: failed to find toolAssembly for {1} - {0}: no se pudo encontrar toolAssembly para {1} - - - - {0}: failed to find commandPath {1} - {0}: no se pudo encontrar commandPath {1} - - - - Unable to locate dotnet multiplexer - No se puede ubicar el multiplexor dotnet - - - - {0}: Looking for prefercliruntime file at `{1}` - {0}: buscando el archivo prefercliruntime en "{1}" - - - - {0}: attempting to resolve {1} - {0}: intentando resolver {1} - - - - {0}: Did not find a matching project {1}. - {0}: no se encontró un proyecto coincidente {1}. - - - - {0}: invalid commandResolverArguments - {0}: commandResolverArguments no válidos - - - - {0}: {1} does not exist - {0}: {1} no existe - - - - Ambiguous command name: {0} - Nombre de comando ambiguo: {0} - - - - {0}: tool library found {1} - {0}: se encontró biblioteca de herramientas {1} - - - - {0}: MSBUILD_EXE_PATH = {1} - {0}: MSBUILD_EXE_PATH = {1} - - - - {0}: MSBuild project path = {1} - {0}: ruta del proyecto MSBuild = {1} - - - - Specify which project file to use because this '{0}' contains more than one project file. - Especifique el archivo de proyecto que se debe usar porque "{0}" contiene más de un archivo de proyecto. - - - - {0}: ProjectFactory did not find Project. - {0}: ProjectFactory no encontró el proyecto. - - - - {0}: resolving commandspec from {1} Tool Libraries. - {0}: resolviendo commandspec desde las bibliotecas de herramientas de {1}. - - - - {0}: failed to resolve commandspec from library. - {0}: no se pudo resolver commandspec desde la biblioteca. - - - - {0}: Attempting to resolve command spec from tool {1} - {0}: intentando resolver especificaciones de comando desde la herramienta {1} - - - - {0}: nuget packages root: -{1} - {0}: raíz de paquetes NuGet: -{1} - - - - {0}: found tool lockfile at : {1} - {0}: se encontró el archivo de bloqueo de herramienta en: {1} - - - - {0}: library not found in lock file. - {0}: no se encontró la biblioteca en el archivo de bloqueo. - - - - {0}: attempting to create commandspec - {0}: intentando crear commandspec - - - - {0}: commandSpec is null. - {0}: commandSpec es nulo. - - - - {0}: expect deps.json at: {1} - {0}: se espera deps.json en: {1} - - - - Generating deps.json at: {0} - Generando deps.json en: {0} - - - - unable to generate deps.json, it may have been already generated: {0} - no se puede generar deps.json; es posible que ya se haya generado: {0} - - - - unable to delete temporary deps.json file: {0} - no se puede eliminar el archivo deps.json temporal: {0} - - - - Version for package `{0}` could not be resolved. - No se pudo resolver la versión del paquete "{0}". - - - - File not found `{0}`. - No se encontró el archivo "{0}". - - - - The project may not have been restored or restore failed - run `dotnet restore` - Es posible que el proyecto no se haya restaurado o que hubo un error en la restauración; ejecute "dotnet restore" - - - - No executable found matching command "{0}" - No se encontró ningún ejecutable que coincida con el comando "{0}" - - - - Waiting for debugger to attach. Press ENTER to continue - Esperando anexar el depurador. Presione ENTRAR para continuar - - - - Process ID: {0} - Id. de proceso: {0} - - - - Could not access assets file. - No se pudo tener acceso al archivo de recursos. - - - - .NET Command Line Tools - Herramientas de la línea de comandos .NET - - - - WriteLine forwarder set previously - El reenviador WriteLine se estableció previamente - - - - Already capturing stream! - Ya se está capturando la secuencia. - - - - Running {0} {1} - Ejecutando {0} {1} - - - - < {0} exited with {1} in {2} ms. - < {0} se cerró con {1} en {2} ms. - - - - Unable to invoke {0} after the command has been run - No se puede invocar {0} después de la ejecución del comando - - - - {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) - {0}: se ignorará el archivo prefercliruntime dado que la plataforma de destino de la herramienta ({1}) tiene una versión mayor que el entorno de tiempo de ejecución actual de la CLI ({2}) - - - - {0}: Could not find runtimeconfig.json file for tool {1} - {0}: no se pudo encontrar el archivo runtimeconfig.json para la herramienta {1} - - - - Unable to find deps.json generator project. - No se puede encontrar el proyecto de generador deps.json. - - - - The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` - No se encontró el comando ejecutable para "{0}". Puede que el proyecto no se haya restaurado o que la restauración no haya tenido éxito. Ejecute "dotnet restore" - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.fr.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index 507b69cec..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - Malformed command text '{0}' - Texte de commande incorrect '{0}' - - - - outputpathresolver: {0} does not exist - outputpathresolver : {0} n'existe pas - - - - {0}: attempting to find command {1} in {2} - {0} : tentative de recherche de la commande {1} dans {2} - - - - {0}: failed to find toolAssembly for {1} - {0} : échec de la recherche de toolAssembly pour {1} - - - - {0}: failed to find commandPath {1} - {0} : échec de la recherche de commandPath {1} - - - - Unable to locate dotnet multiplexer - Le multiplexeur dotnet est introuvable - - - - {0}: Looking for prefercliruntime file at `{1}` - {0} : recherche du fichier prefercliruntime sur '{1}' - - - - {0}: attempting to resolve {1} - {0} : tentative de résolution de {1} - - - - {0}: Did not find a matching project {1}. - {0} : projet correspondant introuvable {1}. - - - - {0}: invalid commandResolverArguments - {0} : commandResolverArguments non valide - - - - {0}: {1} does not exist - {0} : {1} n'existe pas - - - - Ambiguous command name: {0} - Nom de commande ambigu : {0} - - - - {0}: tool library found {1} - {0} : bibliothèque d'outils trouvée {1} - - - - {0}: MSBUILD_EXE_PATH = {1} - {0} : CHEMIN_MSBUILD_EXE = {1} - - - - {0}: MSBuild project path = {1} - {0} : chemin de projet MSBuild = {1} - - - - Specify which project file to use because this '{0}' contains more than one project file. - Spécifiez le fichier projet à utiliser, car '{0}' contient plusieurs fichiers projet. - - - - {0}: ProjectFactory did not find Project. - {0} : ProjectFactory n'a pas trouvé le projet. - - - - {0}: resolving commandspec from {1} Tool Libraries. - {0} : résolution de la spécification de commande à partir des bibliothèques d'outils {1}. - - - - {0}: failed to resolve commandspec from library. - {0} : échec de la résolution de la spécification de commande à partir de la bibliothèque. - - - - {0}: Attempting to resolve command spec from tool {1} - {0} : tentative de résolution de la spécification de commande à partir de l'outil {1} - - - - {0}: nuget packages root: -{1} - {0} : racine des packages NuGet : -{1} - - - - {0}: found tool lockfile at : {1} - {0} : fichier de verrouillage d'outil trouvé sur : {1} - - - - {0}: library not found in lock file. - {0} : bibliothèque introuvable dans le fichier de verrouillage. - - - - {0}: attempting to create commandspec - {0} : tentative de création de la spécification de commande - - - - {0}: commandSpec is null. - {0} : commandSpec a une valeur null. - - - - {0}: expect deps.json at: {1} - {0} : deps.json attendu sur {1} - - - - Generating deps.json at: {0} - Génération de deps.json sur : {0} - - - - unable to generate deps.json, it may have been already generated: {0} - impossible de générer deps.json, il a peut-être été déjà généré : {0} - - - - unable to delete temporary deps.json file: {0} - impossible de supprimer le fichier temporaire deps.json : {0} - - - - Version for package `{0}` could not be resolved. - La version du package '{0}' n'a pas pu être résolue. - - - - File not found `{0}`. - Fichier introuvable '{0}'. - - - - The project may not have been restored or restore failed - run `dotnet restore` - Le projet n'a peut-être pas été restauré, ou la restauration n'a pas fonctionné - exécutez 'dotnet restore' - - - - No executable found matching command "{0}" - Aucun exécutable ne correspond à la commande "{0}" - - - - Waiting for debugger to attach. Press ENTER to continue - En attente d'attachement du débogueur. Appuyez sur ENTRÉE pour continuer - - - - Process ID: {0} - ID de processus : {0} - - - - Could not access assets file. - Impossible d'accéder au fichier de composants. - - - - .NET Command Line Tools - Outils en ligne de commande .NET - - - - WriteLine forwarder set previously - Redirecteur WriteLine déjà défini - - - - Already capturing stream! - Flux déjà en cours de capture ! - - - - Running {0} {1} - Exécution de {0} {1} - - - - < {0} exited with {1} in {2} ms. - < {0} s'est arrêté avec {1} en {2} ms. - - - - Unable to invoke {0} after the command has been run - Impossible d'appeler {0} après l'exécution de la commande - - - - {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) - {0} : fichier prefercliruntime ignoré, car le framework cible de l'outil ({1}) a une autre version principale que celle du runtime CLI actuel ({2}) - - - - {0}: Could not find runtimeconfig.json file for tool {1} - {0} : le fichier runtimeconfig.json est introuvable pour l'outil {1} - - - - Unable to find deps.json generator project. - Le projet de générateur deps.json est introuvable. - - - - The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` - La commande exécutable pour "{0}" est introuvable. Le projet n'a peut-être pas été restauré, ou la restauration n'a pas fonctionné - exécutez 'dotnet restore' - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.it.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index 84efa6a29..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - Malformed command text '{0}' - Il testo del comando '{0}' non è corretto - - - - outputpathresolver: {0} does not exist - outputpathresolver: {0} non esiste - - - - {0}: attempting to find command {1} in {2} - {0}: tentativo di individuazione del comando {1} in {2} - - - - {0}: failed to find toolAssembly for {1} - {0}: toolAssembly per {1} non trovato - - - - {0}: failed to find commandPath {1} - {0}: commandPath {1} non trovato - - - - Unable to locate dotnet multiplexer - Il multiplexer dotnet non è stato trovato - - - - {0}: Looking for prefercliruntime file at `{1}` - {0}: ricerca del file prefercliruntime in `{1}` - - - - {0}: attempting to resolve {1} - {0}: tentativo di risolvere {1} - - - - {0}: Did not find a matching project {1}. - {0}: non è stato trovato alcun progetto {1} corrispondente. - - - - {0}: invalid commandResolverArguments - {0}: commandResolverArguments non valido - - - - {0}: {1} does not exist - {0}: {1} non esiste - - - - Ambiguous command name: {0} - Nome di comando ambiguo: {0} - - - - {0}: tool library found {1} - {0}: libreria degli strumenti {1} trovata - - - - {0}: MSBUILD_EXE_PATH = {1} - {0}: PERCORSO_EXE_MSBUILD = {1} - - - - {0}: MSBuild project path = {1} - {0}: percorso del progetto MSBuild = {1} - - - - Specify which project file to use because this '{0}' contains more than one project file. - Specificare il file di progetto da usare perché questo elemento '{0}' contiene più file di progetto. - - - - {0}: ProjectFactory did not find Project. - {0}: ProjectFactory non ha trovato l'elemento Project. - - - - {0}: resolving commandspec from {1} Tool Libraries. - {0}: risoluzione di commandSpec dalle librerie degli strumenti di {1}. - - - - {0}: failed to resolve commandspec from library. - {0}: non è stato possibile risolvere commandSpec dalla libreria. - - - - {0}: Attempting to resolve command spec from tool {1} - {0}: tentativo di risolvere commandSpec dallo strumento {1} - - - - {0}: nuget packages root: -{1} - {0}: radice dei pacchetti NuGet: -{1} - - - - {0}: found tool lockfile at : {1} - {0}: il file di blocco dello strumento è stato trovato in: {1} - - - - {0}: library not found in lock file. - {0}: la libreria non è stata trovata nel file di blocco. - - - - {0}: attempting to create commandspec - {0}: tentativo di creare commandSpec - - - - {0}: commandSpec is null. - {0}: commandSpec è Null. - - - - {0}: expect deps.json at: {1} - {0}: è previsto deps.json in: {1} - - - - Generating deps.json at: {0} - Generazione del file deps.json in: {0} - - - - unable to generate deps.json, it may have been already generated: {0} - non è possibile generare deps.json. Potrebbe essere già stato generato: {0} - - - - unable to delete temporary deps.json file: {0} - non è possibile eliminare il file deps.json temporaneo: {0} - - - - Version for package `{0}` could not be resolved. - Non è stato possibile risolvere la versione per il pacchetto `{0}`. - - - - File not found `{0}`. - Il file `{0}` non è stato trovato. - - - - The project may not have been restored or restore failed - run `dotnet restore` - È possibile che il progetto non sia stato ripristinato o che il ripristino non sia riuscito. Eseguire `dotnet restore` - - - - No executable found matching command "{0}" - Non è stato trovato alcun file eseguibile corrispondente al comando "{0}" - - - - Waiting for debugger to attach. Press ENTER to continue - In attesa del collegamento del debugger. Premere INVIO per continuare - - - - Process ID: {0} - ID processo: {0} - - - - Could not access assets file. - Non è stato possibile accedere al file di risorse. - - - - .NET Command Line Tools - Strumenti da riga di comando di .NET - - - - WriteLine forwarder set previously - Il forwarder WriteLine è stato impostato in precedenza - - - - Already capturing stream! - L'acquisizione del flusso è già in corso. - - - - Running {0} {1} - {0} in esecuzione: {1} - - - - < {0} exited with {1} in {2} ms. - < {0} è stato terminato con {1} in {2} ms. - - - - Unable to invoke {0} after the command has been run - Non è possibile richiamare {0} dopo l'esecuzione del comando - - - - {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) - {0}: il file prefercliruntime verrà ignorato perché la versione principale del framework di destinazione dello strumento ({1}) è diversa rispetto a quella del runtime corrente dell'interfaccia della riga di comando ({2}) - - - - {0}: Could not find runtimeconfig.json file for tool {1} - {0}: il file runtimeconfig.json per lo strumento {1} non è stato trovato - - - - Unable to find deps.json generator project. - Il progetto del generatore deps.json non è stato trovato. - - - - The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` - L'eseguibile del comando per "{0}" non è stato trovato. È possibile che il progetto non sia stato ripristinato o che il ripristino non sia riuscito. Eseguire `dotnet restore` - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.ja.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index 88387b742..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - Malformed command text '{0}' - 無効な形式のコマンド テキスト '{0}' - - - - outputpathresolver: {0} does not exist - outputpathresolver: {0} は存在しません - - - - {0}: attempting to find command {1} in {2} - {0}: {2} でコマンド {1} を検索しています - - - - {0}: failed to find toolAssembly for {1} - {0}: {1} の toolAssembly が見つかりませんでした - - - - {0}: failed to find commandPath {1} - {0}: commandPath {1} が見つかりませんでした - - - - Unable to locate dotnet multiplexer - dotnet マルチプレクサーが見つかりません - - - - {0}: Looking for prefercliruntime file at `{1}` - {0}:`{1}` で prefercliruntime ファイルを検索しています - - - - {0}: attempting to resolve {1} - {0}: {1} を解決しようとしています - - - - {0}: Did not find a matching project {1}. - {0}: 一致するプロジェクト {1}.が見つかりませんでした。 - - - - {0}: invalid commandResolverArguments - {0}: 無効な commandResolverArguments - - - - {0}: {1} does not exist - {0}: {1} は存在しません - - - - Ambiguous command name: {0} - あいまいなコマンド名: {0} - - - - {0}: tool library found {1} - {0}: ツール ライブラリで {1} が見つかりました - - - - {0}: MSBUILD_EXE_PATH = {1} - {0}: MSBUILD_EXE_PATH = {1} - - - - {0}: MSBuild project path = {1} - {0}: MSBuild project path = {1} - - - - Specify which project file to use because this '{0}' contains more than one project file. - この '{0}' には複数のプロジェクト ファイルが含まれているため、使用するプロジェクト ファイルを指定します。 - - - - {0}: ProjectFactory did not find Project. - {0}:ProjectFactory でプロジェクトが見つかりませんでした。 - - - - {0}: resolving commandspec from {1} Tool Libraries. - {0}: {1} ツール ライブラリから commandspec を解決しています。 - - - - {0}: failed to resolve commandspec from library. - {0}: ライブラリから commandspec を解決できませんでした。 - - - - {0}: Attempting to resolve command spec from tool {1} - {0}: ツール {1} から commandspec を解決しようとしています - - - - {0}: nuget packages root: -{1} - {0}: NuGet パッケージ ルート: -{1} - - - - {0}: found tool lockfile at : {1} - {0}: {1} でツールのロックファイルが見つかりました - - - - {0}: library not found in lock file. - {0}: ロック ファイルにライブラリが見つかりませんでした。 - - - - {0}: attempting to create commandspec - {0}: commandspec を作成しようとしています - - - - {0}: commandSpec is null. - {0}: commandSpec が null です。 - - - - {0}: expect deps.json at: {1} - {0}: {1} で deps.json が必要です - - - - Generating deps.json at: {0} - {0} で deps.json を生成しています - - - - unable to generate deps.json, it may have been already generated: {0} - deps.json を生成できません。既に生成されている可能性があります: {0} - - - - unable to delete temporary deps.json file: {0} - deps.json 一時ファイルを削除できません: {0} - - - - Version for package `{0}` could not be resolved. - パッケージ `{0}` のバージョンを解決できませんでした。 - - - - File not found `{0}`. - ファイルが見つかりません: `{0}`。 - - - - The project may not have been restored or restore failed - run `dotnet restore` - プロジェクトが復元されていないか、復元に失敗した可能性があります。`dotnet restore` を実行します - - - - No executable found matching command "{0}" - コマンド "{0}" に一致する実行可能ファイルが見つかりません - - - - Waiting for debugger to attach. Press ENTER to continue - デバッガーのアタッチを待っています。続行するには、ENTER キーを押してください - - - - Process ID: {0} - プロセス ID: {0} - - - - Could not access assets file. - 資産ファイルにアクセスできませんでした。 - - - - .NET Command Line Tools - .NET コマンド ライン ツール - - - - WriteLine forwarder set previously - 以前に設定した WriteLine フォワーダー - - - - Already capturing stream! - 既にストリームをキャプチャ中です! - - - - Running {0} {1} - {0} {1} を実行しています - - - - < {0} exited with {1} in {2} ms. - < {0} が {1} で終了しました ({2} ミリ秒)。 - - - - Unable to invoke {0} after the command has been run - コマンドの実行後、{0} を呼び出せません - - - - {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) - {0}: ツール ターゲット フレームワーク ({1}) のメジャー バージョンが現在の CLI ランタイム ({2}) と異なるため、prefercliruntime ファイルは無視されます。 - - - - {0}: Could not find runtimeconfig.json file for tool {1} - {0}: ツール {1} で runtimeconfig.json ファイルが見つかりませんでした - - - - Unable to find deps.json generator project. - deps.json ジェネレーター プロジェクトが見つかりません。 - - - - The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` - "{0}" で実行可能なコマンドが見つかりませんでした。プロジェクトが復元されていない可能性があるか、または復元に失敗しました。`dotnet restore` を実行します。 - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.ko.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index ff639f8e2..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - Malformed command text '{0}' - 형식이 잘못된 명령 텍스트 '{0}' - - - - outputpathresolver: {0} does not exist - outputpathresolver: {0}이(가) 없습니다. - - - - {0}: attempting to find command {1} in {2} - {0}: {2}에서 {1} 명령을 찾으려고 시도 중 - - - - {0}: failed to find toolAssembly for {1} - {0}: {1}용 toolAssembly 찾기 실패 - - - - {0}: failed to find commandPath {1} - {0}: commandPath {1} 찾기 실패 - - - - Unable to locate dotnet multiplexer - dotnet multiplexer를 찾을 수 없음 - - - - {0}: Looking for prefercliruntime file at `{1}` - {0}: '{1}'에서 prefercliruntime 파일을 찾는 중 - - - - {0}: attempting to resolve {1} - {0}: {1} 확인을 시도 중 - - - - {0}: Did not find a matching project {1}. - {0}: 일치하는 프로젝트 {1}을(를) 찾지 못했습니다. - - - - {0}: invalid commandResolverArguments - {0}: 잘못된 commandResolverArguments - - - - {0}: {1} does not exist - {0}: {1}이(가) 없습니다. - - - - Ambiguous command name: {0} - 모호한 명령 이름: {0} - - - - {0}: tool library found {1} - {0}: 도구 라이브러리가 발견됨({1}) - - - - {0}: MSBUILD_EXE_PATH = {1} - {0}: MSBUILD_EXE_PATH = {1} - - - - {0}: MSBuild project path = {1} - {0}: MSBuild 프로젝트 경로 = {1} - - - - Specify which project file to use because this '{0}' contains more than one project file. - 이 '{0}'에 둘 이상의 프로젝트 파일이 포함되어 있으므로 사용할 프로젝트 파일을 지정하세요. - - - - {0}: ProjectFactory did not find Project. - {0}: ProjectFactory에서 프로젝트를 찾지 못했습니다. - - - - {0}: resolving commandspec from {1} Tool Libraries. - {0}: {1} 도구 라이브러리에서 commandspec을 확인하는 중입니다. - - - - {0}: failed to resolve commandspec from library. - {0}: 라이브러리에서 commandspec을 확인하지 못했습니다. - - - - {0}: Attempting to resolve command spec from tool {1} - {0}: {1} 도구에서 command spec을 확인하려고 시도하는 중입니다. - - - - {0}: nuget packages root: -{1} - {0}: nuget 패키지 루트: -{1} - - - - {0}: found tool lockfile at : {1} - {0}: {1}에서 도구 잠금 파일을 찾았습니다. - - - - {0}: library not found in lock file. - {0}: 잠금 파일에서 라이브러리를 찾지 못했습니다. - - - - {0}: attempting to create commandspec - {0}: commandspec 만들기 시도 중 - - - - {0}: commandSpec is null. - {0}: commandSpec이 null입니다. - - - - {0}: expect deps.json at: {1} - {0}: {1}에서 deps.json 필요 - - - - Generating deps.json at: {0} - {0}에서 deps.json 생성 중 - - - - unable to generate deps.json, it may have been already generated: {0} - deps.json을 생성할 수 없습니다. 이미 생성되었을 수 있습니다. {0} - - - - unable to delete temporary deps.json file: {0} - 임시 deps.json 파일을 삭제할 수 없습니다. {0} - - - - Version for package `{0}` could not be resolved. - '{0}' 패키지의 버전을 확인할 수 없습니다. - - - - File not found `{0}`. - '{0}' 파일을 찾을 수 없습니다. - - - - The project may not have been restored or restore failed - run `dotnet restore` - 프로젝트가 복원되지 않았거나 복원이 실패했을 수 있습니다. 'dotnet restore'를 실행하세요. - - - - No executable found matching command "{0}" - "{0}" 명령과 일치하는 실행 파일을 찾을 수 없습니다. - - - - Waiting for debugger to attach. Press ENTER to continue - 디버거가 연결될 때까지 대기하는 중입니다. 계속하려면 <Enter> 키를 누르세요. - - - - Process ID: {0} - 프로세스 ID: {0} - - - - Could not access assets file. - 자산 파일에 액세스할 수 없습니다. - - - - .NET Command Line Tools - .NET 명령줄 도구 - - - - WriteLine forwarder set previously - WriteLine 전달자가 이전에 설정됨 - - - - Already capturing stream! - 이미 스트림을 캡처하는 중입니다! - - - - Running {0} {1} - {0} {1} 실행 중 - - - - < {0} exited with {1} in {2} ms. - < {0}이(가) {2}ms만에 {1}과(와) 함께 종료되었습니다. - - - - Unable to invoke {0} after the command has been run - 명령이 실행된 후 {0}을(를) 호출할 수 없음 - - - - {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) - {0}: 도구 대상 프레임워크({1})에 현재 CLI 런타임({2})과 다른 주 버전이 있으므로 prefercliruntime 파일 무시 - - - - {0}: Could not find runtimeconfig.json file for tool {1} - {0}: 도구 {1}에 대한 runtimeconfig.json 파일을 찾을 수 없음 - - - - Unable to find deps.json generator project. - deps.json 생성기 프로젝트를 찾을 수 없습니다. - - - - The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` - "{0}"에 대해 실행 가능한 명령을 찾지 못했습니다. 프로젝트가 복원되지 않았거나 복원이 실패했을 수 있습니다. 'dotnet restore'를 실행하세요. - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.pl.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index a36aa643d..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - Malformed command text '{0}' - Nieprawidłowo sformułowany tekst polecenia „{0}” - - - - outputpathresolver: {0} does not exist - Element outputpathresolver: {0} nie istnieje - - - - {0}: attempting to find command {1} in {2} - {0}: Próba odnalezienia polecenia {1} w lokalizacji {2} - - - - {0}: failed to find toolAssembly for {1} - {0}: Nie udało się odnaleźć elementu toolAssembly dla elementu {1} - - - - {0}: failed to find commandPath {1} - {0}: Nie udało się odnaleźć ścieżki commandPath {1} - - - - Unable to locate dotnet multiplexer - Nie można zlokalizować multipleksera dotnet - - - - {0}: Looking for prefercliruntime file at `{1}` - {0}: Wyszukiwanie pliku prefercliruntime w lokalizacji „{1}” - - - - {0}: attempting to resolve {1} - {0}: Próba rozpoznania elementu {1} - - - - {0}: Did not find a matching project {1}. - {0}: Nie znaleziono pasującego projektu {1}. - - - - {0}: invalid commandResolverArguments - {0}: Nieprawidłowa wartość elementu commandResolverArguments - - - - {0}: {1} does not exist - {0}: Element {1} nie istnieje - - - - Ambiguous command name: {0} - Niejednoznaczna nazwa polecenia: {0} - - - - {0}: tool library found {1} - {0}: Znaleziono bibliotekę narzędzia {1} - - - - {0}: MSBUILD_EXE_PATH = {1} - {0}: Ścieżka MSBUILD_EXE_PATH = {1} - - - - {0}: MSBuild project path = {1} - {0}: Ścieżka projektu programu MSBuild = {1} - - - - Specify which project file to use because this '{0}' contains more than one project file. - Określ, który plik ma zostać użyty, ponieważ w tym elemencie „{0}” podano kilka plików projektu. - - - - {0}: ProjectFactory did not find Project. - {0}: Element ProjectFactory nie odnalazł projektu. - - - - {0}: resolving commandspec from {1} Tool Libraries. - {0}: Rozpoznawanie elementu commandspec z bibliotek narzędzia {1}. - - - - {0}: failed to resolve commandspec from library. - {0}: Nie udało się rozpoznać elementu commandspec z biblioteki. - - - - {0}: Attempting to resolve command spec from tool {1} - {0}: Próba rozpoznania specyfikacji polecenia z narzędzia {1} - - - - {0}: nuget packages root: -{1} - {0}: Katalog główny pakietów NuGet: -{1} - - - - {0}: found tool lockfile at : {1} - {0}: Odnaleziono plik blokady narzędzia w lokalizacji: {1} - - - - {0}: library not found in lock file. - {0}: Nie odnaleziono biblioteki w pliku blokady. - - - - {0}: attempting to create commandspec - {0}: Próba utworzenia elementu commandspec - - - - {0}: commandSpec is null. - {0}: Element commandSpec ma wartość null. - - - - {0}: expect deps.json at: {1} - {0}: Oczekiwano pliku deps.json w lokalizacji: {1} - - - - Generating deps.json at: {0} - Generowanie pliku deps.json w lokalizacji: {0} - - - - unable to generate deps.json, it may have been already generated: {0} - nie można wygenerować pliku deps.json, być może został już wygenerowany: {0} - - - - unable to delete temporary deps.json file: {0} - nie można usunąć tymczasowego pliku deps.json: {0} - - - - Version for package `{0}` could not be resolved. - Nie można rozpoznać wersji pakietu „{0}”. - - - - File not found `{0}`. - Nie odnaleziono pliku „{0}”. - - - - The project may not have been restored or restore failed - run `dotnet restore` - Projekt mógł nie zostać przywrócony lub przywracanie zakończyło się niepowodzeniem — uruchom polecenie „dotnet restore” - - - - No executable found matching command "{0}" - Nie odnaleziono pliku wykonywalnego zgodnego z poleceniem „{0}” - - - - Waiting for debugger to attach. Press ENTER to continue - Oczekiwanie na dołączenie debugera. Naciśnij klawisz ENTER, aby kontynuować - - - - Process ID: {0} - Identyfikator procesu: {0} - - - - Could not access assets file. - Nie można uzyskać dostępu do pliku zasobów. - - - - .NET Command Line Tools - Narzędzia wiersza polecenia programu .NET - - - - WriteLine forwarder set previously - Ustawiona wcześniej usługa przesyłania dalej WriteLine - - - - Already capturing stream! - Strumień jest już przechwytywany! - - - - Running {0} {1} - Uruchamianie procesu {0} {1} - - - - < {0} exited with {1} in {2} ms. - < Proces {0} zakończył się z kodem {1} w ciągu {2} ms. - - - - Unable to invoke {0} after the command has been run - Nie można wywołać elementu {0} po uruchomieniu polecenia - - - - {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) - {0}: plik prefercliruntime zostanie zignorowany, ponieważ wersja platforma docelowa narzędzia ({1}) różni się od wersji bieżącego środowiska uruchomieniowego interfejsu wiersza polecenia ({2}) - - - - {0}: Could not find runtimeconfig.json file for tool {1} - {0}: nie można odnaleźć pliku runtimeconfig.json dla narzędzia {1} - - - - Unable to find deps.json generator project. - Nie można odnaleźć projektu generatora deps.json. - - - - The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` - Nie znaleziono pliku wykonywalnego polecenia dla elementu „{0}”. Projekt mógł nie zostać przywrócony lub przywracanie zakończyło się niepowodzeniem — uruchom polecenie „dotnet restore” - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.pt-BR.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index aa7c61690..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - Malformed command text '{0}' - Texto do comando malformado '{0}' - - - - outputpathresolver: {0} does not exist - outputpathresolver: {0} não existe - - - - {0}: attempting to find command {1} in {2} - {0}: tentando encontrar o comando {1} em {2} - - - - {0}: failed to find toolAssembly for {1} - {0}: falha ao encontrar toolAssembly para {1} - - - - {0}: failed to find commandPath {1} - {0}: falha ao encontrar commandPath {1} - - - - Unable to locate dotnet multiplexer - Não é possível localizar o multiplexador do dotnet - - - - {0}: Looking for prefercliruntime file at `{1}` - {0}: procurando o arquivo prefercliruntime em '{1}' - - - - {0}: attempting to resolve {1} - {0}: tentando resolver {1} - - - - {0}: Did not find a matching project {1}. - {0}: não encontrou um projeto {1} correspondente. - - - - {0}: invalid commandResolverArguments - {0}: commandResolverArguments inválido - - - - {0}: {1} does not exist - {0}: {1} não existe - - - - Ambiguous command name: {0} - Nome de comando ambíguo: {0} - - - - {0}: tool library found {1} - {0}: a biblioteca de ferramentas encontrou {1} - - - - {0}: MSBUILD_EXE_PATH = {1} - {0}: MSBUILD_EXE_PATH = {1} - - - - {0}: MSBuild project path = {1} - {0}: caminho de projeto do MSBuild = {1} - - - - Specify which project file to use because this '{0}' contains more than one project file. - Especifique qual arquivo de projeto será usado, pois este '{0}' contém mais de um arquivo de projeto. - - - - {0}: ProjectFactory did not find Project. - {0}: ProjectFactory não encontrou o Projeto. - - - - {0}: resolving commandspec from {1} Tool Libraries. - {0}: resolvendo commandspec por meio das Bibliotecas de Ferramentas de {1}. - - - - {0}: failed to resolve commandspec from library. - {0}: falha ao resolver commandspec por meio da biblioteca. - - - - {0}: Attempting to resolve command spec from tool {1} - {0}: tentando resolver commandspec por meio da ferramenta {1} - - - - {0}: nuget packages root: -{1} - {0}: raiz de pacotes NuGet: -{1} - - - - {0}: found tool lockfile at : {1} - {0}: arquivo de bloqueio de ferramenta encontrado em: {1} - - - - {0}: library not found in lock file. - {0}: biblioteca não encontrada no arquivo de bloqueio. - - - - {0}: attempting to create commandspec - {0}: tentando criar commandspec - - - - {0}: commandSpec is null. - {0}: commandSpec é nulo. - - - - {0}: expect deps.json at: {1} - {0}: espera de deps.json em: {1} - - - - Generating deps.json at: {0} - Gerando deps.json em: {0} - - - - unable to generate deps.json, it may have been already generated: {0} - não é possível gerar deps.json; ele pode já ter sido gerado: {0} - - - - unable to delete temporary deps.json file: {0} - não é possível excluir o arquivo temporário deps.json: {0} - - - - Version for package `{0}` could not be resolved. - A versão do pacote '{0}' não pôde ser resolvida. - - - - File not found `{0}`. - Arquivo não encontrado '{0}'. - - - - The project may not have been restored or restore failed - run `dotnet restore` - O projeto pode não ter sido restaurado ou a restauração falhou – execute 'dotnet restore' - - - - No executable found matching command "{0}" - Nenhum executável encontrado correspondente ao comando "{0}" - - - - Waiting for debugger to attach. Press ENTER to continue - Aguardando o depurador anexar. Pressione ENTER para continuar - - - - Process ID: {0} - ID do processo: {0} - - - - Could not access assets file. - Não foi possível acessar o arquivo de ativos. - - - - .NET Command Line Tools - Ferramentas de Linha de Comando do .NET - - - - WriteLine forwarder set previously - Encaminhador WriteLine definido anteriormente - - - - Already capturing stream! - O fluxo já está sendo capturado. - - - - Running {0} {1} - Executando {0} {1} - - - - < {0} exited with {1} in {2} ms. - < {0} foi fechado com {1} em {2} ms. - - - - Unable to invoke {0} after the command has been run - Não é possível invocar {0} após a execução do comando - - - - {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) - {0}: ignorando o arquivo prefercliruntime, uma vez que a estrutura de destino da ferramenta ({1}) tem uma versão principal diferente daquela do tempo de execução atual da CLI ({2}) - - - - {0}: Could not find runtimeconfig.json file for tool {1} - {0}: não foi possível localizar o arquivo runtimeconfig.json para a ferramenta {1} - - - - Unable to find deps.json generator project. - Não é possível localizar o projeto do gerador deps.json. - - - - The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` - O comando executável para "{0}" não foi encontrado. O projeto pode não ter sido restaurado ou a restauração falhou – execute `dotnet restore` - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.ru.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index d4bb9fefd..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - Malformed command text '{0}' - Неправильный формат текста команды "{0}" - - - - outputpathresolver: {0} does not exist - outputpathresolver: {0} не существует. - - - - {0}: attempting to find command {1} in {2} - {0}: попытка найти команду {1} в {2} - - - - {0}: failed to find toolAssembly for {1} - {0}: не удалось найти toolAssembly для {1}. - - - - {0}: failed to find commandPath {1} - {0}: не удалось найти commandPath {1}. - - - - Unable to locate dotnet multiplexer - Не удается найти мультиплексор dotnet. - - - - {0}: Looking for prefercliruntime file at `{1}` - {0}: поиск файла prefercliruntime в "{1}" - - - - {0}: attempting to resolve {1} - {0}: попытка разрешить {1} - - - - {0}: Did not find a matching project {1}. - {0}: не найден подходящий проект {1}. - - - - {0}: invalid commandResolverArguments - {0}: недопустимый commandResolverArguments - - - - {0}: {1} does not exist - {0}: {1} не существует. - - - - Ambiguous command name: {0} - Неоднозначное имя команды: {0} - - - - {0}: tool library found {1} - {0}: найдена библиотека средств {1}. - - - - {0}: MSBUILD_EXE_PATH = {1} - {0}: MSBUILD_EXE_PATH = {1} - - - - {0}: MSBuild project path = {1} - {0}: путь проекта MSBuild — {1} - - - - Specify which project file to use because this '{0}' contains more than one project file. - Укажите используемый файл проекта, так как этот "{0}" содержит несколько таких файлов. - - - - {0}: ProjectFactory did not find Project. - {0}: фабрика проектов не нашла проект. - - - - {0}: resolving commandspec from {1} Tool Libraries. - {0}: разрешение спецификации команды из библиотек средств {1}. - - - - {0}: failed to resolve commandspec from library. - {0}: не удалось разрешить спецификацию команды из библиотеки. - - - - {0}: Attempting to resolve command spec from tool {1} - {0}: попытка разрешить спецификацию команды из средства {1} - - - - {0}: nuget packages root: -{1} - {0}: корень пакетов nuget: -{1} - - - - {0}: found tool lockfile at : {1} - {0}: найден файл блокировки средства в: {1}. - - - - {0}: library not found in lock file. - {0}: не найдена библиотека в файле блокировки. - - - - {0}: attempting to create commandspec - {0}: попытка создать спецификацию команды - - - - {0}: commandSpec is null. - {0}: commandSpec имеет значение NULL. - - - - {0}: expect deps.json at: {1} - {0}: ожидается deps.json в: {1}. - - - - Generating deps.json at: {0} - Выполняется создание deps.json в: {0}. - - - - unable to generate deps.json, it may have been already generated: {0} - не удается создать deps.json, возможно, он уже создан: {0} - - - - unable to delete temporary deps.json file: {0} - не удается удалить временный файл deps.json: {0} - - - - Version for package `{0}` could not be resolved. - Не удалось разрешить версию для пакета "{0}". - - - - File not found `{0}`. - Файл не найден: "{0}". - - - - The project may not have been restored or restore failed - run `dotnet restore` - Возможно, проект не был восстановлен или его восстановление завершилось со сбоем. Запустите команду "dotnet restore". - - - - No executable found matching command "{0}" - Не найден исполняемый файл, соответствующий команде "{0}". - - - - Waiting for debugger to attach. Press ENTER to continue - Ожидание подключения отладчика. Для продолжения нажмите клавишу ВВОД. - - - - Process ID: {0} - Идентификатор процесса: {0} - - - - Could not access assets file. - Не удалось получить доступ к файлу активов. - - - - .NET Command Line Tools - Программы командной строки .NET - - - - WriteLine forwarder set previously - Сервер пересылки WriteLine, заданный ранее - - - - Already capturing stream! - Захват потока уже выполняется! - - - - Running {0} {1} - Выполнение {0} {1} - - - - < {0} exited with {1} in {2} ms. - < {0} выполнил выход с {1} через {2} мс. - - - - Unable to invoke {0} after the command has been run - Не удается вызвать {0} после запуска команды. - - - - {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) - {0}: файл prefercliruntime игнорируется, так как основные номера версии целевой платформы средства ({1}) и текущей среды выполнения CLI ({2}) различаются - - - - {0}: Could not find runtimeconfig.json file for tool {1} - {0}: не удалось найти файл runtimeconfig.json для средства {1} - - - - Unable to find deps.json generator project. - Не удалось найти проект генератора deps.json. - - - - The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` - Исполняемый файл команды для "{0}" не найден. Возможно, проект не был восстановлен или его восстановление завершилось сбоем. Запустите команду "dotnet restore". - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.tr.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index f0634cf3e..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - Malformed command text '{0}' - Hatalı biçimlendirilmiş komut metni: '{0}' - - - - outputpathresolver: {0} does not exist - outputpathresolver: {0} yok - - - - {0}: attempting to find command {1} in {2} - {0}: {2} içinde {1} komutu bulunmaya çalışılıyor - - - - {0}: failed to find toolAssembly for {1} - {0}: {1} için toolAssembly bulunamadı - - - - {0}: failed to find commandPath {1} - {0}: {1} commandPath bulunamadı - - - - Unable to locate dotnet multiplexer - Dotnet çoğullayıcısı bulunamadı - - - - {0}: Looking for prefercliruntime file at `{1}` - {0}: `{1}` konumunda prefercliruntime dosyası aranıyor - - - - {0}: attempting to resolve {1} - {0}: {1} öğesi çözümlenmeye çalışılıyor - - - - {0}: Did not find a matching project {1}. - {0}: Eşleşen {1} projesi bulunamadı. - - - - {0}: invalid commandResolverArguments - {0}: geçersiz commandResolverArguments - - - - {0}: {1} does not exist - {0}: {1} yok - - - - Ambiguous command name: {0} - Belirsiz komut adı: {0} - - - - {0}: tool library found {1} - {0}: araç kitaplığı bulundu {1} - - - - {0}: MSBUILD_EXE_PATH = {1} - {0}: MSBUILD_EXE_PATH = {1} - - - - {0}: MSBuild project path = {1} - {0}: MSBuild proje yolu = {1} - - - - Specify which project file to use because this '{0}' contains more than one project file. - Bu '{0}' birden çok proje dosyası içerdiğinden, hangi proje dosyasının kullanılacağını belirtmeniz gerekir. - - - - {0}: ProjectFactory did not find Project. - {0}: ProjectFactory, Projeyi bulamadı. - - - - {0}: resolving commandspec from {1} Tool Libraries. - {0}: {1} Araç Kitaplıklarından commandspec çözümleniyor. - - - - {0}: failed to resolve commandspec from library. - {0}: kitaplıktan commandspec çözümlenemedi. - - - - {0}: Attempting to resolve command spec from tool {1} - {0}: {1} aracından commandspec çözümlenmeye çalışılıyor - - - - {0}: nuget packages root: -{1} - {0}: NuGet paketleri kökü: -{1} - - - - {0}: found tool lockfile at : {1} - {0}: araç kilit dosyası şurada bulundu : {1} - - - - {0}: library not found in lock file. - {0}: kitaplık, kilit dosyasında bulunamadı. - - - - {0}: attempting to create commandspec - {0}: commandspec oluşturulmaya çalışılıyor - - - - {0}: commandSpec is null. - {0}: commandSpec null. - - - - {0}: expect deps.json at: {1} - {0}: şu konumda deps.json bekleniyor: {1} - - - - Generating deps.json at: {0} - Şu konumda deps.json oluşturuluyor: {0} - - - - unable to generate deps.json, it may have been already generated: {0} - deps.json oluşturulamadı, zaten oluşturulmuş olabilir: {0} - - - - unable to delete temporary deps.json file: {0} - geçici deps.json dosyası silinemedi: {0} - - - - Version for package `{0}` could not be resolved. - `{0}` paketi için sürüm çözümlenemedi. - - - - File not found `{0}`. - Dosya bulunamadı `{0}`. - - - - The project may not have been restored or restore failed - run `dotnet restore` - Proje geri yüklenmemiş veya geri yükleme başarısız olmuş olabilir - `dotnet restore` çalıştırın - - - - No executable found matching command "{0}" - "{0}" komutuyla eşleşen yürütülebilir bulunamadı - - - - Waiting for debugger to attach. Press ENTER to continue - Hata ayıklayıcının eklenmesi bekleniyor. Devam etmek için ENTER tuşuna basın - - - - Process ID: {0} - İşlem kimliği: {0} - - - - Could not access assets file. - Varlık dosyasına erişilemiyor. - - - - .NET Command Line Tools - .NET Komut Satırı Araçları - - - - WriteLine forwarder set previously - WriteLine ileticisi önceden ayarlandı - - - - Already capturing stream! - Akış zaten yakalanıyor! - - - - Running {0} {1} - {0} {1} çalıştırılıyor - - - - < {0} exited with {1} in {2} ms. - < {0} öğesinden {2} ms içinde {1} ile çıkıldı. - - - - Unable to invoke {0} after the command has been run - Komut çalıştırıldıktan sonra {0} çağrılamıyor - - - - {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) - {0}: Araç hedef çerçevesi ({1}), geçerli CLI çalışma zamanından farklı bir ana sürüme ({2}) sahip olduğundan prefercliruntime dosyası yok sayılıyor - - - - {0}: Could not find runtimeconfig.json file for tool {1} - {0}: {1} aracı için runtimeconfig.json dosyası bulunamadı - - - - Unable to find deps.json generator project. - deps.json oluşturucu projesi bulunamıyor. - - - - The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` - "{0}" için komut yürütülebilir dosyası bulunamadı. Proje geri yüklenmemiş veya geri yükleme başarısız olmuş olabilir - `dotnet restore` çalıştırın - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.xlf deleted file mode 100644 index edd61956b..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - Malformed command text '{0}' - - - - outputpathresolver: {0} does not exist - - - - {0}: attempting to find command {1} in {2} - - - - {0}: failed to find toolAssembly for {1} - - - - {0}: failed to find commandPath {1} - - - - Unable to locate dotnet multiplexer - - - - {0}: Looking for prefercliruntime file at `{1}` - - - - {0}: attempting to resolve {1} - - - - {0}: Did not find a matching project {1}. - - - - {0}: invalid commandResolverArguments - - - - {0}: {1} does not exist - - - - Ambiguous command name: {0} - - - - {0}: tool library found {1} - - - - {0}: MSBUILD_EXE_PATH = {1} - - - - {0}: MSBuild project path = {1} - - - - Specify which project file to use because this '{0}' contains more than one project file. - - - - {0}: ProjectFactory did not find Project. - - - - {0}: resolving commandspec from {1} Tool Libraries. - - - - {0}: failed to resolve commandspec from library. - - - - {0}: Attempting to resolve command spec from tool {1} - - - - {0}: nuget packages root: -{1} - - - - {0}: found tool lockfile at : {1} - - - - {0}: library not found in lock file. - - - - {0}: attempting to create commandspec - - - - {0}: commandSpec is null. - - - - {0}: expect deps.json at: {1} - - - - Generating deps.json at: {0} - - - - unable to generate deps.json, it may have been already generated: {0} - - - - unable to delete temporary deps.json file: {0} - - - - Version for package `{0}` could not be resolved. - - - - File not found `{0}`. - - - - The project may not have been restored or restore failed - run `dotnet restore` - - - - No executable found matching command "{0}" - - - - Waiting for debugger to attach. Press ENTER to continue - - - - Process ID: {0} - - - - Could not access assets file. - - - - .NET Command Line Tools - - - - WriteLine forwarder set previously - - - - Already capturing stream! - - - - Running {0} {1} - - - - < {0} exited with {1} in {2} ms. - - - - Unable to invoke {0} after the command has been run - - - - {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) - - - - {0}: Could not find runtimeconfig.json file for tool {1} - - - - Unable to find deps.json generator project. - - - - The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.zh-Hans.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index 6ae013bb9..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - Malformed command text '{0}' - 命令文本“{0}”格式错误 - - - - outputpathresolver: {0} does not exist - outputpathresolver: {0} 不存在 - - - - {0}: attempting to find command {1} in {2} - {0}: 尝试在 {2} 中查找命令 {1} - - - - {0}: failed to find toolAssembly for {1} - {0}: 未能找到 {1} 的 toolAssembly - - - - {0}: failed to find commandPath {1} - {0}: 未能找到 commandPath {1} - - - - Unable to locate dotnet multiplexer - 找不到 dotnet 多路复用器 - - - - {0}: Looking for prefercliruntime file at `{1}` - {0}: 在“{1}”查找 prefercliruntime 文件 - - - - {0}: attempting to resolve {1} - {0}: 尝试解析 {1} - - - - {0}: Did not find a matching project {1}. - {0}: 未能找到匹配的项目 {1}。 - - - - {0}: invalid commandResolverArguments - {0}: 无效的 commandResolverArguments - - - - {0}: {1} does not exist - {0}: {1} 不存在 - - - - Ambiguous command name: {0} - 模糊命令名: {0} - - - - {0}: tool library found {1} - {0}: 找到工具库 {1} - - - - {0}: MSBUILD_EXE_PATH = {1} - {0}: MSBUILD_EXE_PATH = {1} - - - - {0}: MSBuild project path = {1} - {0}: MSBuild 项目路径 = {1} - - - - Specify which project file to use because this '{0}' contains more than one project file. - 指定要使用的项目文件,因为此“{0}”包含多个项目文件。 - - - - {0}: ProjectFactory did not find Project. - {0}: ProjectFactory 未找到项目。 - - - - {0}: resolving commandspec from {1} Tool Libraries. - {0}: 正在从 {1} 工具库解析 commandspec。 - - - - {0}: failed to resolve commandspec from library. - {0}: 未能从库解析 commandspec。 - - - - {0}: Attempting to resolve command spec from tool {1} - {0}: 正在尝试从工具 {1} 解析命令 spec - - - - {0}: nuget packages root: -{1} - {0}: nuget 包根目录: -{1} - - - - {0}: found tool lockfile at : {1} - {0}: 在 {1} 中找到工具 lockfile - - - - {0}: library not found in lock file. - {0}: 在锁定文件中未找到库。 - - - - {0}: attempting to create commandspec - {0}: 尝试创建 commandspec - - - - {0}: commandSpec is null. - {0}: commandSpec 为 null。 - - - - {0}: expect deps.json at: {1} - {0}: 需要 deps.json: {1} - - - - Generating deps.json at: {0} - 即将生成 deps.json: {0} - - - - unable to generate deps.json, it may have been already generated: {0} - 无法生成 deps.json,该文件可能已生成: {0} - - - - unable to delete temporary deps.json file: {0} - 无法删除临时 deps.json 文件: {0} - - - - Version for package `{0}` could not be resolved. - 无法解析包“{0}”的版本。 - - - - File not found `{0}`. - 未找到文件“{0}”。 - - - - The project may not have been restored or restore failed - run `dotnet restore` - 可能未还原项目或还原失败 - 运行“dotnet restore” - - - - No executable found matching command "{0}" - 未找到与命令“{0}”匹配的可执行文件 - - - - Waiting for debugger to attach. Press ENTER to continue - 正在等待调试程序附加。按 Enter 继续操作 - - - - Process ID: {0} - 进程 ID: {0} - - - - Could not access assets file. - 无法访问资产文件。 - - - - .NET Command Line Tools - .NET 命令行工具 - - - - WriteLine forwarder set previously - 以前设置的 WriteLine 转发器 - - - - Already capturing stream! - 已在捕获流! - - - - Running {0} {1} - 正在运行 {0} {1} - - - - < {0} exited with {1} in {2} ms. - < {0}通过了 {1} 在 {2} ms 内退出 - - - - Unable to invoke {0} after the command has been run - 运行命令后无法调用 {0} - - - - {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) - {0}: 忽略 prefercliruntime 文件,因为工具目标框架({1})的主要版本不是当前 CLI 运行时({2}) - - - - {0}: Could not find runtimeconfig.json file for tool {1} - {0}: 找不到工具 {1} 的 runtimeconfig.json 文件 - - - - Unable to find deps.json generator project. - 找不到 deps.json 生成器项目。 - - - - The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` - 找不到可为“{0}”执行的命令。可能未还原项目或还原失败 - 运行 `dotnet restore` - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.zh-Hant.xlf b/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index 88c9e644b..000000000 --- a/src/Microsoft.DotNet.Cli.Utils/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - Malformed command text '{0}' - 命令文字 '{0}' 格式錯誤 - - - - outputpathresolver: {0} does not exist - outputpathresolver: {0} 不存在 - - - - {0}: attempting to find command {1} in {2} - {0}: 正在嘗試於 {2} 中尋找命令 {1} - - - - {0}: failed to find toolAssembly for {1} - {0}: 找不到 {1} 的 toolAssembly - - - - {0}: failed to find commandPath {1} - {0}: 找不到 commandPath {1} - - - - Unable to locate dotnet multiplexer - 找不到 dotnet multiplexer - - - - {0}: Looking for prefercliruntime file at `{1}` - {0}: 正在於 `{1}` 尋找 prefercliruntime 檔 - - - - {0}: attempting to resolve {1} - {0}: 正在嘗試解析 {1} - - - - {0}: Did not find a matching project {1}. - {0}: 未找到相符的專案 {1}。 - - - - {0}: invalid commandResolverArguments - {0}: commandResolverArguments 無效 - - - - {0}: {1} does not exist - {0}: {1} 不存在 - - - - Ambiguous command name: {0} - 不明確的命令名稱: {0} - - - - {0}: tool library found {1} - {0}: 找到工具程式庫 {1} - - - - {0}: MSBUILD_EXE_PATH = {1} - {0}: MSBUILD_EXE_PATH = {1} - - - - {0}: MSBuild project path = {1} - {0}: MSBuild 專案路徑 = {1} - - - - Specify which project file to use because this '{0}' contains more than one project file. - 指定要使用的專案檔,因為這個 '{0}' 包含多個專案檔。 - - - - {0}: ProjectFactory did not find Project. - {0}: ProjectFactory 未找到專案。 - - - - {0}: resolving commandspec from {1} Tool Libraries. - {0}: 正在從 {1} 工具程式庫解析 commandspec。 - - - - {0}: failed to resolve commandspec from library. - {0}: 無法從程式庫解析 commandspec。 - - - - {0}: Attempting to resolve command spec from tool {1} - {0}: 正在嘗試從工具 {1} 解析 command spec - - - - {0}: nuget packages root: -{1} - {0}: NuGet 套件根: -{1} - - - - {0}: found tool lockfile at : {1} - {0}: 於 {1} 找到工具鎖定檔案 - - - - {0}: library not found in lock file. - {0}: 鎖定檔案中找不到程式庫。 - - - - {0}: attempting to create commandspec - {0}: 正在嘗試建立 commandspec - - - - {0}: commandSpec is null. - {0}: commandSpec 為 null。 - - - - {0}: expect deps.json at: {1} - {0}: 於 {1} 需要 deps.json - - - - Generating deps.json at: {0} - 正在於 {0} 產生 deps.json - - - - unable to generate deps.json, it may have been already generated: {0} - 無法產生 deps.json,可能已產生過: {0} - - - - unable to delete temporary deps.json file: {0} - 無法刪除暫存 deps.json 檔: {0} - - - - Version for package `{0}` could not be resolved. - 無法解析套件 `{0}` 的版本。 - - - - File not found `{0}`. - 找不到檔案 `{0}`。 - - - - The project may not have been restored or restore failed - run `dotnet restore` - 專案可能尚未還原或還原失敗 - 執行 `dotnet restore` - - - - No executable found matching command "{0}" - 沒有與命令 "{0}" 相符的可執行檔 - - - - Waiting for debugger to attach. Press ENTER to continue - 正在等候附加偵錯工具。按 ENTER 繼續進行 - - - - Process ID: {0} - 處理序識別碼: {0} - - - - Could not access assets file. - 無法存取資產檔案。 - - - - .NET Command Line Tools - .NET 命令列工具 - - - - WriteLine forwarder set previously - 先前已設定 WriteLine 轉寄站 - - - - Already capturing stream! - 已在擷取資料流! - - - - Running {0} {1} - 正在執行 {0} {1} - - - - < {0} exited with {1} in {2} ms. - < {0} 已結束,{1} 於 {2} 毫秒後。 - - - - Unable to invoke {0} after the command has been run - 執行命令後無法叫用 {0} - - - - {0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2}) - {0}: 因為工具目標架構 ({1}) 的主要版本與目前的 CLI 執行階段 ({2}) 不同,所以將忽略 prefercliruntime 檔案 - - - - {0}: Could not find runtimeconfig.json file for tool {1} - {0}: 找不到工具 {1} 的 runtimeconfig.json 檔案 - - - - Unable to find deps.json generator project. - 找不到 deps.json 產生器專案。 - - - - The command executable for "{0}" was not found. The project may not have been restored or restore failed - run `dotnet restore` - 找不到 "{0}" 的命令可執行檔。該專案可能尚未還原或還原失敗 - 請執行 `dotnet restore` - - - - - \ No newline at end of file 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/DotnetFirstTimeUseConfigurer.cs b/src/Microsoft.DotNet.Configurer/DotnetFirstTimeUseConfigurer.cs deleted file mode 100644 index 9a89bcb6f..000000000 --- a/src/Microsoft.DotNet.Configurer/DotnetFirstTimeUseConfigurer.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) .NET 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 Microsoft.Extensions.EnvironmentAbstractions; - -namespace Microsoft.DotNet.Configurer -{ - public class DotnetFirstTimeUseConfigurer - { - private IReporter _reporter; - private IEnvironmentProvider _environmentProvider; - private INuGetCachePrimer _nugetCachePrimer; - private INuGetCacheSentinel _nugetCacheSentinel; - private IFirstTimeUseNoticeSentinel _firstTimeUseNoticeSentinel; - private string _cliFallbackFolderPath; - - public DotnetFirstTimeUseConfigurer( - INuGetCachePrimer nugetCachePrimer, - INuGetCacheSentinel nugetCacheSentinel, - IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel, - IEnvironmentProvider environmentProvider, - IReporter reporter, - string cliFallbackFolderPath) - { - _nugetCachePrimer = nugetCachePrimer; - _nugetCacheSentinel = nugetCacheSentinel; - _firstTimeUseNoticeSentinel = firstTimeUseNoticeSentinel; - _environmentProvider = environmentProvider; - _reporter = reporter; - _cliFallbackFolderPath = cliFallbackFolderPath; - } - - public void Configure() - { - if (ShouldPrintFirstTimeUseNotice()) - { - PrintFirstTimeUseNotice(); - } - - if (ShouldPrimeNugetCache()) - { - if (_nugetCacheSentinel.UnauthorizedAccess) - { - PrintUnauthorizedAccessMessage(); - } - else - { - PrintNugetCachePrimeMessage(); - - _nugetCachePrimer.PrimeCache(); - } - } - } - - private bool ShouldPrintFirstTimeUseNotice() - { - var showFirstTimeUseNotice = - _environmentProvider.GetEnvironmentVariableAsBool("DOTNET_PRINT_TELEMETRY_MESSAGE", true); - - return ShouldRunFirstRunExperience() && - showFirstTimeUseNotice && - !_firstTimeUseNoticeSentinel.Exists(); - } - - private void PrintFirstTimeUseNotice() - { - _reporter.WriteLine(); - _reporter.WriteLine(LocalizableStrings.FirstTimeWelcomeMessage); - - _firstTimeUseNoticeSentinel.CreateIfNotExists(); - } - - private void PrintUnauthorizedAccessMessage() - { - _reporter.WriteLine(); - _reporter.WriteLine(string.Format( - LocalizableStrings.UnauthorizedAccessMessage, - _cliFallbackFolderPath)); - } - - private bool ShouldPrimeNugetCache() - { - return ShouldRunFirstRunExperience() && - !_nugetCacheSentinel.Exists() && - !_nugetCacheSentinel.InProgressSentinelAlreadyExists() && - !_nugetCachePrimer.SkipPrimingTheCache(); - } - - private void PrintNugetCachePrimeMessage() - { - string cachePrimeMessage = LocalizableStrings.NugetCachePrimeMessage; - _reporter.WriteLine(); - _reporter.WriteLine(cachePrimeMessage); - } - - private bool ShouldRunFirstRunExperience() - { - var skipFirstTimeExperience = - _environmentProvider.GetEnvironmentVariableAsBool("DOTNET_SKIP_FIRST_TIME_EXPERIENCE", false); - - return !skipFirstTimeExperience; - } - } -} diff --git a/src/Microsoft.DotNet.Configurer/FirstTimeUseNoticeSentinel.cs b/src/Microsoft.DotNet.Configurer/FirstTimeUseNoticeSentinel.cs deleted file mode 100644 index d7335dee5..000000000 --- a/src/Microsoft.DotNet.Configurer/FirstTimeUseNoticeSentinel.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.IO; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.Extensions.EnvironmentAbstractions; -using NuGet.Configuration; - -namespace Microsoft.DotNet.Configurer -{ - public class FirstTimeUseNoticeSentinel : IFirstTimeUseNoticeSentinel - { - public static readonly string SENTINEL = $"{Product.Version}.dotnetFirstUseSentinel"; - - private readonly IFile _file; - private readonly IDirectory _directory; - - private string _dotnetUserProfileFolderPath; - - private string SentinelPath => Path.Combine(_dotnetUserProfileFolderPath, SENTINEL); - - public FirstTimeUseNoticeSentinel(CliFallbackFolderPathCalculator cliFallbackFolderPathCalculator) : - this( - cliFallbackFolderPathCalculator.DotnetUserProfileFolderPath, - FileSystemWrapper.Default.File, - FileSystemWrapper.Default.Directory) - { - } - - internal FirstTimeUseNoticeSentinel(string dotnetUserProfileFolderPath, IFile file, IDirectory directory) - { - _file = file; - _directory = directory; - _dotnetUserProfileFolderPath = dotnetUserProfileFolderPath; - } - - public bool Exists() - { - return _file.Exists(SentinelPath); - } - - public void CreateIfNotExists() - { - if (!Exists()) - { - if (!_directory.Exists(_dotnetUserProfileFolderPath)) - { - _directory.CreateDirectory(_dotnetUserProfileFolderPath); - } - - _file.CreateEmptyFile(SentinelPath); - } - } - - public void Dispose() - { - } - } -} diff --git a/src/Microsoft.DotNet.Configurer/IFirstTimeUseNoticeSentinel.cs b/src/Microsoft.DotNet.Configurer/IFirstTimeUseNoticeSentinel.cs deleted file mode 100644 index c0d1878fa..000000000 --- a/src/Microsoft.DotNet.Configurer/IFirstTimeUseNoticeSentinel.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Microsoft.DotNet.Configurer -{ - public interface IFirstTimeUseNoticeSentinel : IDisposable - { - bool Exists(); - - void CreateIfNotExists(); - } -} diff --git a/src/Microsoft.DotNet.Configurer/INuGetCachePrimer.cs b/src/Microsoft.DotNet.Configurer/INuGetCachePrimer.cs deleted file mode 100644 index 14770532b..000000000 --- a/src/Microsoft.DotNet.Configurer/INuGetCachePrimer.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.DotNet.Configurer -{ - public interface INuGetCachePrimer - { - void PrimeCache(); - bool SkipPrimingTheCache(); - } -} diff --git a/src/Microsoft.DotNet.Configurer/INuGetCacheSentinel.cs b/src/Microsoft.DotNet.Configurer/INuGetCacheSentinel.cs deleted file mode 100644 index 9564145e8..000000000 --- a/src/Microsoft.DotNet.Configurer/INuGetCacheSentinel.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Microsoft.DotNet.Configurer -{ - public interface INuGetCacheSentinel : IDisposable - { - bool InProgressSentinelAlreadyExists(); - - bool Exists(); - - void CreateIfNotExists(); - - bool UnauthorizedAccess { get; } - } -} diff --git a/src/Microsoft.DotNet.Configurer/INuGetPackagesArchiver.cs b/src/Microsoft.DotNet.Configurer/INuGetPackagesArchiver.cs deleted file mode 100644 index 421a37584..000000000 --- a/src/Microsoft.DotNet.Configurer/INuGetPackagesArchiver.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Microsoft.DotNet.Configurer -{ - public interface INuGetPackagesArchiver - { - string NuGetPackagesArchive { get; } - - void ExtractArchive(string archiveDestination); - } -} diff --git a/src/Microsoft.DotNet.Configurer/IUserLevelCacheWriter.cs b/src/Microsoft.DotNet.Configurer/IUserLevelCacheWriter.cs deleted file mode 100644 index c41b55920..000000000 --- a/src/Microsoft.DotNet.Configurer/IUserLevelCacheWriter.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Microsoft.DotNet.Configurer -{ - public interface IUserLevelCacheWriter - { - string RunWithCache(string cacheKey, Func getValueToCache); - } -} diff --git a/src/Microsoft.DotNet.Configurer/LocalizableStrings.resx b/src/Microsoft.DotNet.Configurer/LocalizableStrings.resx deleted file mode 100644 index 7b56bd336..000000000 --- a/src/Microsoft.DotNet.Configurer/LocalizableStrings.resx +++ /dev/null @@ -1,149 +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 - - - Welcome to .NET Core! ---------------------- -Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. - -Telemetry --------------- -The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. -You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. -You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry. - - - Configuring... -------------------- -A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once. - - - Failed to prime the NuGet cache. {0} failed with: {1} - - - 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 deleted file mode 100644 index 49f4fceb5..000000000 --- a/src/Microsoft.DotNet.Configurer/Microsoft.DotNet.Configurer.csproj +++ /dev/null @@ -1,29 +0,0 @@ - - - - $(CliVersionPrefix) - netstandard1.5 - true - ../../tools/Key.snk - true - true - git - git://github.com/dotnet/cli - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Configurer/NoOpFirstTimeUseNoticeSentinel.cs b/src/Microsoft.DotNet.Configurer/NoOpFirstTimeUseNoticeSentinel.cs deleted file mode 100644 index a801d4ee6..000000000 --- a/src/Microsoft.DotNet.Configurer/NoOpFirstTimeUseNoticeSentinel.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.IO; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.Extensions.EnvironmentAbstractions; -using NuGet.Configuration; - -namespace Microsoft.DotNet.Configurer -{ - public class NoOpFirstTimeUseNoticeSentinel : IFirstTimeUseNoticeSentinel - { - public bool Exists() - { - return true; - } - - public void CreateIfNotExists() - { - } - - public void Dispose() - { - } - } -} diff --git a/src/Microsoft.DotNet.Configurer/NuGetCachePrimer.cs b/src/Microsoft.DotNet.Configurer/NuGetCachePrimer.cs deleted file mode 100644 index 5233d3359..000000000 --- a/src/Microsoft.DotNet.Configurer/NuGetCachePrimer.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.IO; -using System.Collections.Generic; -using System.Linq; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.Extensions.EnvironmentAbstractions; - -namespace Microsoft.DotNet.Configurer -{ - public class NuGetCachePrimer : INuGetCachePrimer - { - private readonly IFile _file; - - private readonly INuGetPackagesArchiver _nugetPackagesArchiver; - - private readonly INuGetCacheSentinel _nuGetCacheSentinel; - - private readonly CliFallbackFolderPathCalculator _cliFallbackFolderPathCalculator; - - public NuGetCachePrimer( - INuGetPackagesArchiver nugetPackagesArchiver, - INuGetCacheSentinel nuGetCacheSentinel, - CliFallbackFolderPathCalculator cliFallbackFolderPathCalculator) - : this(nugetPackagesArchiver, - nuGetCacheSentinel, - cliFallbackFolderPathCalculator, - FileSystemWrapper.Default.File) - { - } - - internal NuGetCachePrimer( - INuGetPackagesArchiver nugetPackagesArchiver, - INuGetCacheSentinel nuGetCacheSentinel, - CliFallbackFolderPathCalculator cliFallbackFolderPathCalculator, - IFile file) - { - _nugetPackagesArchiver = nugetPackagesArchiver; - - _nuGetCacheSentinel = nuGetCacheSentinel; - - _cliFallbackFolderPathCalculator = cliFallbackFolderPathCalculator; - - _file = file; - } - - public void PrimeCache() - { - if (SkipPrimingTheCache()) - { - return; - } - - var nuGetFallbackFolder = _cliFallbackFolderPathCalculator.CliFallbackFolderPath; - - _nugetPackagesArchiver.ExtractArchive(nuGetFallbackFolder); - - _nuGetCacheSentinel.CreateIfNotExists(); - } - - public bool SkipPrimingTheCache() - { - return !_file.Exists(_nugetPackagesArchiver.NuGetPackagesArchive); - } - } -} diff --git a/src/Microsoft.DotNet.Configurer/NuGetCacheSentinel.cs b/src/Microsoft.DotNet.Configurer/NuGetCacheSentinel.cs deleted file mode 100644 index bfc7a29d9..000000000 --- a/src/Microsoft.DotNet.Configurer/NuGetCacheSentinel.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.Extensions.EnvironmentAbstractions; -using NuGet.Configuration; - -namespace Microsoft.DotNet.Configurer -{ - public class NuGetCacheSentinel : INuGetCacheSentinel - { - public static readonly string SENTINEL = $"{Product.Version}.dotnetSentinel"; - public static readonly string INPROGRESS_SENTINEL = $"{Product.Version}.inprogress.dotnetSentinel"; - - public bool UnauthorizedAccess { get; private set; } - - private readonly IFile _file; - - private readonly IDirectory _directory; - - private string _nugetCachePath; - - private string SentinelPath => Path.Combine(_nugetCachePath, SENTINEL); - private string InProgressSentinelPath => Path.Combine(_nugetCachePath, INPROGRESS_SENTINEL); - - private Stream InProgressSentinel { get; set; } - - public NuGetCacheSentinel(CliFallbackFolderPathCalculator cliFallbackFolderPathCalculator) : - this(cliFallbackFolderPathCalculator.CliFallbackFolderPath, - FileSystemWrapper.Default.File, - FileSystemWrapper.Default.Directory) - { - } - - internal NuGetCacheSentinel(string nugetCachePath, IFile file, IDirectory directory) - { - _nugetCachePath = nugetCachePath; - _file = file; - _directory = directory; - - SetInProgressSentinel(); - } - - public bool InProgressSentinelAlreadyExists() - { - return CouldNotGetAHandleToTheInProgressSentinel() && !UnauthorizedAccess; - } - - public bool Exists() - { - return _file.Exists(SentinelPath); - } - - public void CreateIfNotExists() - { - if (!Exists()) - { - _file.CreateEmptyFile(SentinelPath); - } - } - - private bool CouldNotGetAHandleToTheInProgressSentinel() - { - return InProgressSentinel == null; - } - - private void SetInProgressSentinel() - { - try - { - if (!_directory.Exists(_nugetCachePath)) - { - _directory.CreateDirectory(_nugetCachePath); - } - - // open an exclusive handle to the in-progress sentinel and mark it for delete on close. - // we open with exclusive FileShare.None access to indicate that the operation is in progress. - // buffer size is minimum since we won't be reading or writing from the file. - // delete on close is to indicate that the operation is no longer in progress when we dispose - // this. - InProgressSentinel = _file.OpenFile( - InProgressSentinelPath, - FileMode.OpenOrCreate, - FileAccess.ReadWrite, - FileShare.None, - 1, - FileOptions.DeleteOnClose); - } - catch (UnauthorizedAccessException) - { - UnauthorizedAccess = true; - } - catch { } - } - - public void Dispose() - { - if (InProgressSentinel != null) - { - InProgressSentinel.Dispose(); - } - } - } -} diff --git a/src/Microsoft.DotNet.Configurer/NuGetPackagesArchiver.cs b/src/Microsoft.DotNet.Configurer/NuGetPackagesArchiver.cs deleted file mode 100644 index df2993ab4..000000000 --- a/src/Microsoft.DotNet.Configurer/NuGetPackagesArchiver.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using Microsoft.DotNet.Archive; -using Microsoft.Extensions.EnvironmentAbstractions; - -namespace Microsoft.DotNet.Configurer -{ - public class NuGetPackagesArchiver : INuGetPackagesArchiver - { - public string NuGetPackagesArchive => - Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "nuGetPackagesArchive.lzma")); - - public void ExtractArchive(string archiveDestination) - { - var progress = new ConsoleProgressReport(); - var archive = new IndexedArchive(); - - archive.Extract(NuGetPackagesArchive, archiveDestination, progress); - } - } -} diff --git a/src/Microsoft.DotNet.Configurer/Properties/Properties.cs b/src/Microsoft.DotNet.Configurer/Properties/Properties.cs deleted file mode 100644 index ae22fe8f9..000000000 --- a/src/Microsoft.DotNet.Configurer/Properties/Properties.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: AssemblyMetadataAttribute("Serviceable", "True")] -[assembly: InternalsVisibleTo("Microsoft.DotNet.Configurer.UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("dotnet.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/Microsoft.DotNet.Configurer/UserLevelCacheWriter.cs b/src/Microsoft.DotNet.Configurer/UserLevelCacheWriter.cs deleted file mode 100644 index 9e5fd4a78..000000000 --- a/src/Microsoft.DotNet.Configurer/UserLevelCacheWriter.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.Extensions.EnvironmentAbstractions; - -namespace Microsoft.DotNet.Configurer -{ - public class UserLevelCacheWriter : IUserLevelCacheWriter - { - private readonly IFile _file; - private readonly IDirectory _directory; - private string _dotnetUserProfileFolderPath; - - public UserLevelCacheWriter(CliFallbackFolderPathCalculator cliFallbackFolderPathCalculator) : - this( - cliFallbackFolderPathCalculator.DotnetUserProfileFolderPath, - FileSystemWrapper.Default.File, - FileSystemWrapper.Default.Directory) - { - } - - public string RunWithCache(string cacheKey, Func getValueToCache) - { - var cacheFilepath = GetCacheFilePath(cacheKey); - try - { - if (!_file.Exists(cacheFilepath)) - { - if (!_directory.Exists(_dotnetUserProfileFolderPath)) - { - _directory.CreateDirectory(_dotnetUserProfileFolderPath); - } - - var runResult = getValueToCache(); - - _file.WriteAllText(cacheFilepath, runResult); - return runResult; - } - else - { - return _file.ReadAllText(cacheFilepath); - } - } - catch (Exception ex) - { - if (ex is UnauthorizedAccessException - || ex is PathTooLongException - || ex is IOException) - { - return getValueToCache(); - } - - throw; - } - - } - - internal UserLevelCacheWriter(string dotnetUserProfileFolderPath, IFile file, IDirectory directory) - { - _file = file; - _directory = directory; - _dotnetUserProfileFolderPath = dotnetUserProfileFolderPath; - } - - private string GetCacheFilePath(string cacheKey) - { - return Path.Combine(_dotnetUserProfileFolderPath, $"{Product.Version}_{cacheKey}.dotnetUserLevelCache"); - } - } -} diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.cs.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index 69c2a2361..000000000 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - Welcome to .NET Core! ---------------------- -Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. - -Telemetry --------------- -The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. -You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. -You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry. - 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. - - - - Failed to prime the NuGet cache. {0} failed with: {1} - Nepodařilo se naplnit mezipaměť NuGet. {0} selhalo s: {1} - - - - 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. - 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. - - - - 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. - - 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í. - - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.de.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index e101ef579..000000000 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - Welcome to .NET Core! ---------------------- -Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. - -Telemetry --------------- -The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. -You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. -You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry. - 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. - - - - Failed to prime the NuGet cache. {0} failed with: {1} - Fehler beim Vorbereiten des NuGet-Caches. Fehler von {0} mit: {1} - - - - 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. - 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. - - - - 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. - - 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. - - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.es.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index 49e0cd07d..000000000 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - Welcome to .NET Core! ---------------------- -Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. - -Telemetry --------------- -The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. -You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. -You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry. - 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. - - - - Failed to prime the NuGet cache. {0} failed with: {1} - No se pudo desbloquear la caché de NuGet. Error de {0} con: {1} - - - - 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. - 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. - - - - 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. - - 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í. - - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.fr.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index fb9d015ce..000000000 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - Welcome to .NET Core! ---------------------- -Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. - -Telemetry --------------- -The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. -You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. -You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry. - 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. - - - - Failed to prime the NuGet cache. {0} failed with: {1} - Échec de la préparation du cache NuGet. Échec de {0} : {1} - - - - 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. - 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. - - - - 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. - - 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. - - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.it.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index c24c80849..000000000 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - Welcome to .NET Core! ---------------------- -Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. - -Telemetry --------------- -The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. -You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. -You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry. - 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. - - - - Failed to prime the NuGet cache. {0} failed with: {1} - Non è possibile inizializzare la cache NuGet. {0} non riuscito. Errore: {1} - - - - 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. - 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. - - - - 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. - - 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. - - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ja.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index b201c5144..000000000 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - Welcome to .NET Core! ---------------------- -Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. - -Telemetry --------------- -The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. -You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. -You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry. - .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 をお読みください。 - - - - Failed to prime the NuGet cache. {0} failed with: {1} - NuGet キャッシュを準備できませんでした。{0} は {1} で失敗しました - - - - 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. - 構成中... -------------------- -ローカル パッケージ キャッシュを最初に設定し、復元速度を向上させ、オフライン アクセスを可能にするため、コマンドを実行しています。このコマンドは 1 回だけ実行され、完了までに最大 1 分かかる場合があります。 - - - - 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. - - '{0}' フォルダーを変更するためのアクセス許可が拒否されました。 - -このエラーを修正するためのいくつかのオプションを次に示します。 ---------------------- -1. 昇格したアクセス権でこのコマンドを再実行します。 -2. 環境変数 DOTNET_SKIP_FIRST_TIME_EXPERIENCE を true に設定して、最初の実行エクスペリエンスを無効にします。 -3. 保護されていない場所に .NET Core SDK をコピーし、そこから使用します。 - - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ko.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index 6f912a283..000000000 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - Welcome to .NET Core! ---------------------- -Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. - -Telemetry --------------- -The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. -You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. -You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry. - .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에서 확인할 수 있습니다. - - - - Failed to prime the NuGet cache. {0} failed with: {1} - NuGet 캐시를 초기화하지 못했습니다. {0} 실패: {1} - - - - 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. - 구성 중... -------------------- -초기에 로컬 패키지 캐시를 채우고, 복원 속도를 개선하고, 오프라인 액세스를 사용하도록 설정하기 위한 명령을 실행하고 있습니다. 완료하는 데 최대 1분이 소요되며 한 번만 실행됩니다. - - - - 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. - - '{0}' 폴더를 수정하는 데 필요한 사용 권한이 거부되었습니다. - -이 오류를 해결하기 위한 옵션을 다음과 같습니다. ---------------------- -1. 높은 액세스 권한으로 이 명령을 다시 실행합니다. -2. 환경 변수 DOTNET_SKIP_FIRST_TIME_EXPERIENCE를 true로 설정하여 첫 실행 경험을 사용하지 않습니다. -3. .NET Core SDK를 보호되지 않은 위치로 복사한 후 이 위치에서 사용합니다. - - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pl.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index e2d132a85..000000000 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - Welcome to .NET Core! ---------------------- -Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. - -Telemetry --------------- -The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. -You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. -You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry. - .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. - - - - Failed to prime the NuGet cache. {0} failed with: {1} - Nie można utworzyć głównej pamięci podręcznej NuGet. Operacja {0} zakończyła się niepowodzeniem: {1} - - - - 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. - 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ę. - - - - 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. - - 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. - - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pt-BR.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index 0a789402b..000000000 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - Welcome to .NET Core! ---------------------- -Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. - -Telemetry --------------- -The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. -You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. -You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry. - 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. - - - - Failed to prime the NuGet cache. {0} failed with: {1} - Falha ao preparar o cache do NuGet. {0} falhou com: {1} - - - - 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. - 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. - - - - 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. - - 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á. - - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ru.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index 46ceb61ef..000000000 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - Welcome to .NET Core! ---------------------- -Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. - -Telemetry --------------- -The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. -You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. -You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry. - Добро пожаловать в .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. - - - - Failed to prime the NuGet cache. {0} failed with: {1} - Не удалось изначально создать кэш NuGet. {0} завершился с ошибкой: {1} - - - - 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. - Идет настройка... -------------------- -Выполняется команда для изначального заполнения локального кэша пакетов, повышения скорости восстановления и обеспечения автономного доступа. Ее выполнение может занять до одной минуты и производится только раз. - - - - 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. - - Отменено разрешение на изменение папки "{0}". - -Ниже приведено несколько способов устранения этой ошибки. ---------------------- -1. Повторно выполните эту команду с правами повышенного доступа. -2. Отключите возможность первого запуска, задав для переменной среды DOTNET_SKIP_FIRST_TIME_EXPERIENCE значение "true". -3. Скопируйте пакет SDK для .NET Core в незащищенное расположение и используйте его оттуда. - - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.tr.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index b5762bc81..000000000 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - Welcome to .NET Core! ---------------------- -Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. - -Telemetry --------------- -The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. -You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. -You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry. - .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. - - - - Failed to prime the NuGet cache. {0} failed with: {1} - Birincil NuGet önbelleği hazırlanamadı. {0} şu hata ile başarısız oldu: {1} - - - - 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. - 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. - - - - 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. - - '{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. - - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.xlf deleted file mode 100644 index 64e3c6463..000000000 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - Welcome to .NET Core! ---------------------- -Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. - -Telemetry --------------- -The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. -You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. -You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry. - -Configuring... -------------------- -A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once. - - - - Failed to prime the NuGet cache. {0} failed with: {1} - - - - - diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hans.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index 7c5bfae32..000000000 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - Welcome to .NET Core! ---------------------- -Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. - -Telemetry --------------- -The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. -You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. -You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry. - 欢迎使用 .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。 - - - - Failed to prime the NuGet cache. {0} failed with: {1} - 未能准备好 NuGet 缓存。{0} 失败,错误为: {1} - - - - 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. - 正在配置... -------------------- -正在运行一项命令,以初步填充本地包缓存,从而提高还原速度并启用脱机访问。此命令最长需要一分钟才能完成,且仅可运行一次。 - - - - 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. - - 修改“{0}”文件夹的权限被拒绝。 - -以下是修复该错误的选项: ---------------------- -1. 以提升的访问权限重新运行该命令。 -2. 通过将环境变量 DOTNET_SKIP_FIRST_TIME_EXPERIENCE 设置为 true,禁用首次运行体验。 -3. 将 .NET Core SDK 复制到未受保护的位置并从该位置使用。 - - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hant.xlf b/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index 5efc8642e..000000000 --- a/src/Microsoft.DotNet.Configurer/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - Welcome to .NET Core! ---------------------- -Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. - -Telemetry --------------- -The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. -You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. -You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry. - 歡迎使用 .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。 - - - - Failed to prime the NuGet cache. {0} failed with: {1} - 無法備妥 NuGet 快取。{0} 失敗,發生: {1} - - - - 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. - 正在設定... -------------------- -執行命令以初步填入您的本機套件快取,以改善還原速度並允許離線存取。此命令最長需要一分鐘的時間才可完成,且只會進行一次。 - - - - 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. - - 權限無法修改 '{0}' 資料夾。 - -以下為修正此錯誤的一些選項: ---------------------- -1. 利用較高的存取權再次執行此命令。 -2. 將環境變數 DOTNET_SKIP_FIRST_TIME_EXPERIENCE 設定為 true,停用第一次的執行體驗。 -3. 將 .NET Core SDK 複製到不受保護的位置,並於該處使用此 SDK。 - - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.InternalAbstractions/DirectoryWrapper.cs b/src/Microsoft.DotNet.InternalAbstractions/DirectoryWrapper.cs deleted file mode 100644 index d0c26bd70..000000000 --- a/src/Microsoft.DotNet.InternalAbstractions/DirectoryWrapper.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using System.IO; -using Microsoft.DotNet.InternalAbstractions; - -namespace Microsoft.Extensions.EnvironmentAbstractions -{ - internal class DirectoryWrapper: IDirectory - { - public bool Exists(string path) - { - return Directory.Exists(path); - } - - public ITemporaryDirectory CreateTemporaryDirectory() - { - return new TemporaryDirectory(); - } - - public IEnumerable GetFiles(string path, string searchPattern) - { - return Directory.GetFiles(path, searchPattern); - } - - public string GetDirectoryFullName(string path) - { - var directoryFullName = string.Empty; - if (Exists(path)) - { - directoryFullName = new DirectoryInfo(path).FullName; - } - else - { - var fileInfo = new FileInfo(path); - if (fileInfo.Directory != null) - { - directoryFullName = fileInfo.Directory.FullName; - } - } - - return directoryFullName; - } - - public void CreateDirectory(string path) - { - Directory.CreateDirectory(path); - } - } -} diff --git a/src/Microsoft.DotNet.InternalAbstractions/EnvironmentWrapper.cs b/src/Microsoft.DotNet.InternalAbstractions/EnvironmentWrapper.cs deleted file mode 100644 index 8e81a0ca4..000000000 --- a/src/Microsoft.DotNet.InternalAbstractions/EnvironmentWrapper.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Microsoft.Extensions.EnvironmentAbstractions -{ - internal class EnvironmentWrapper : IEnvironment - { - public static IEnvironment Default = new EnvironmentWrapper(); - - public string GetEnvironmentVariable(string name) - { - return Environment.GetEnvironmentVariable(name); - } - } -} diff --git a/src/Microsoft.DotNet.InternalAbstractions/FileSystemWrapper.cs b/src/Microsoft.DotNet.InternalAbstractions/FileSystemWrapper.cs deleted file mode 100644 index 881807431..000000000 --- a/src/Microsoft.DotNet.InternalAbstractions/FileSystemWrapper.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.Extensions.EnvironmentAbstractions -{ - internal class FileSystemWrapper : IFileSystem - { - public static IFileSystem Default { get; } = new FileSystemWrapper(); - - public IFile File { get; } = new FileWrapper(); - - public IDirectory Directory { get; } = new DirectoryWrapper(); - } -} diff --git a/src/Microsoft.DotNet.InternalAbstractions/FileWrapper.cs b/src/Microsoft.DotNet.InternalAbstractions/FileWrapper.cs deleted file mode 100644 index 385c2deb8..000000000 --- a/src/Microsoft.DotNet.InternalAbstractions/FileWrapper.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; - -namespace Microsoft.Extensions.EnvironmentAbstractions -{ - internal class FileWrapper: IFile - { - public bool Exists(string path) - { - return File.Exists(path); - } - - public string ReadAllText(string path) - { - return File.ReadAllText(path); - } - - public Stream OpenRead(string path) - { - return File.OpenRead(path); - } - - public Stream OpenFile( - string path, - FileMode fileMode, - FileAccess fileAccess, - FileShare fileShare, - int bufferSize, - FileOptions fileOptions) - { - return new FileStream(path, fileMode, fileAccess, fileShare, bufferSize, fileOptions); - } - - public void CreateEmptyFile(string path) - { - using (File.Create(path)) - { - } - } - - public void WriteAllText(string path, string content) - { - File.WriteAllText(path, content); - } - } -} diff --git a/src/Microsoft.DotNet.InternalAbstractions/IDirectory.cs b/src/Microsoft.DotNet.InternalAbstractions/IDirectory.cs deleted file mode 100644 index 8590bab5a..000000000 --- a/src/Microsoft.DotNet.InternalAbstractions/IDirectory.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; - -namespace Microsoft.Extensions.EnvironmentAbstractions -{ - internal interface IDirectory - { - bool Exists(string path); - - ITemporaryDirectory CreateTemporaryDirectory(); - - IEnumerable GetFiles(string path, string searchPattern); - - string GetDirectoryFullName(string path); - - void CreateDirectory(string path); - } -} diff --git a/src/Microsoft.DotNet.InternalAbstractions/IEnvironment.cs b/src/Microsoft.DotNet.InternalAbstractions/IEnvironment.cs deleted file mode 100644 index 8b3785c20..000000000 --- a/src/Microsoft.DotNet.InternalAbstractions/IEnvironment.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.Extensions.EnvironmentAbstractions -{ - internal interface IEnvironment - { - string GetEnvironmentVariable(string name); - } -} diff --git a/src/Microsoft.DotNet.InternalAbstractions/IFile.cs b/src/Microsoft.DotNet.InternalAbstractions/IFile.cs deleted file mode 100644 index 1feb4b481..000000000 --- a/src/Microsoft.DotNet.InternalAbstractions/IFile.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.IO; - -namespace Microsoft.Extensions.EnvironmentAbstractions -{ - internal interface IFile - { - bool Exists(string path); - - string ReadAllText(string path); - - Stream OpenRead(string path); - - Stream OpenFile( - string path, - FileMode fileMode, - FileAccess fileAccess, - FileShare fileShare, - int bufferSize, - FileOptions fileOptions); - - void CreateEmptyFile(string path); - - void WriteAllText(string path, string content); - } -} diff --git a/src/Microsoft.DotNet.InternalAbstractions/IFileSystem.cs b/src/Microsoft.DotNet.InternalAbstractions/IFileSystem.cs deleted file mode 100644 index 87e5f9863..000000000 --- a/src/Microsoft.DotNet.InternalAbstractions/IFileSystem.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.Extensions.EnvironmentAbstractions -{ - internal interface IFileSystem - { - IFile File { get; } - IDirectory Directory { get; } - } -} diff --git a/src/Microsoft.DotNet.InternalAbstractions/ITemporaryDirectory.cs b/src/Microsoft.DotNet.InternalAbstractions/ITemporaryDirectory.cs deleted file mode 100644 index 1c9bd4b75..000000000 --- a/src/Microsoft.DotNet.InternalAbstractions/ITemporaryDirectory.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; - -namespace Microsoft.Extensions.EnvironmentAbstractions -{ - internal interface ITemporaryDirectory : IDisposable - { - string DirectoryPath { get; } - } -} diff --git a/src/Microsoft.DotNet.InternalAbstractions/Microsoft.DotNet.InternalAbstractions.csproj b/src/Microsoft.DotNet.InternalAbstractions/Microsoft.DotNet.InternalAbstractions.csproj deleted file mode 100644 index c4c930565..000000000 --- a/src/Microsoft.DotNet.InternalAbstractions/Microsoft.DotNet.InternalAbstractions.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - Abstractions for making code that uses file system and environment testable. - 2.0.0-beta - netstandard1.3 - true - true - ../../tools/Key.snk - true - true - git - git://github.com/dotnet/cli - - - - - - - - - - - - - - - - - diff --git a/src/Microsoft.DotNet.InternalAbstractions/Properties/Properties.cs b/src/Microsoft.DotNet.InternalAbstractions/Properties/Properties.cs deleted file mode 100644 index 1ab5c59fd..000000000 --- a/src/Microsoft.DotNet.InternalAbstractions/Properties/Properties.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: AssemblyMetadataAttribute("Serviceable", "True")] -[assembly: InternalsVisibleTo("Microsoft.Extensions.DependencyModel, 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")] -[assembly: InternalsVisibleTo("Microsoft.DotNet.Configurer.UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] -[assembly: InternalsVisibleTo("dotnet-test.UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100039ac461fa5c82c7dd2557400c4fd4e9dcdf7ac47e3d572548c04cd4673e004916610f4ea5cbf86f2b1ca1cb824f2a7b3976afecfcf4eb72d9a899aa6786effa10c30399e6580ed848231fec48374e41b3acf8811931343fc2f73acf72dae745adbcb7063cc4b50550618383202875223fc75401351cd89c44bf9b50e7fa3796")] -[assembly: InternalsVisibleTo("Microsoft.DotNet.Tools.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/Microsoft.DotNet.InternalAbstractions/TemporaryDirectory.cs b/src/Microsoft.DotNet.InternalAbstractions/TemporaryDirectory.cs deleted file mode 100644 index d43683e15..000000000 --- a/src/Microsoft.DotNet.InternalAbstractions/TemporaryDirectory.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.Extensions.EnvironmentAbstractions; -using System.IO; - -namespace Microsoft.DotNet.InternalAbstractions -{ - internal class TemporaryDirectory : ITemporaryDirectory - { - public string DirectoryPath { get; } - - public TemporaryDirectory() - { - DirectoryPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); - Directory.CreateDirectory(DirectoryPath); - } - - public void Dispose() - { - try - { - Directory.Delete(DirectoryPath, true); - } - catch - { - // Ignore failures here. - } - } - } -} diff --git a/src/Microsoft.DotNet.MSBuildSdkResolver/EnvironmentProvider.cs b/src/Microsoft.DotNet.MSBuildSdkResolver/EnvironmentProvider.cs deleted file mode 100644 index c45ad256c..000000000 --- a/src/Microsoft.DotNet.MSBuildSdkResolver/EnvironmentProvider.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices; - -namespace Microsoft.DotNet.MSBuildSdkResolver -{ - internal class EnvironmentProvider - { - private IEnumerable _searchPaths; - - private readonly Func _getEnvironmentVariable; - - public EnvironmentProvider(Func getEnvironmentVariable) - { - _getEnvironmentVariable = getEnvironmentVariable; - } - - public string ExecutableExtension - { - get - { - return Interop.RunningOnWindows ? ".exe" : string.Empty; - } - } - - private IEnumerable SearchPaths - { - get - { - if (_searchPaths == null) - { - var searchPaths = new List(); - - searchPaths.AddRange( - _getEnvironmentVariable("PATH") - .Split(Path.PathSeparator) - .Select(p => p.Trim('"'))); - - _searchPaths = searchPaths; - } - - return _searchPaths; - } - } - - public string GetCommandPath(string commandName) - { - var commandNameWithExtension = commandName + ExecutableExtension; - var commandPath = SearchPaths - .Select(p => Path.Combine(p, commandNameWithExtension)) - .FirstOrDefault(File.Exists); - - return commandPath; - } - } -} diff --git a/src/Microsoft.DotNet.MSBuildSdkResolver/FXVersion.cs b/src/Microsoft.DotNet.MSBuildSdkResolver/FXVersion.cs deleted file mode 100644 index 076f2f237..000000000 --- a/src/Microsoft.DotNet.MSBuildSdkResolver/FXVersion.cs +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.DotNet.MSBuildSdkResolver -{ - // Note: This is not SemVer (esp., in comparing pre-release part, fx_ver_t does not - // compare multiple dot separated identifiers individually.) ex: 1.0.0-beta.2 vs. 1.0.0-beta.11 - // See the original version of this code here: https://github.com/dotnet/core-setup/blob/master/src/corehost/cli/fxr/fx_ver.cpp - internal sealed class FXVersion - { - public int Major { get; } - public int Minor { get; } - public int Patch { get; } - public string Pre { get; } - public string Build { get; } - - public FXVersion(int major, int minor, int patch, string pre = "", string build = "") - { - Major = major; - Minor = minor; - Patch = patch; - Pre = pre; - Build = build; - } - - public static int Compare(FXVersion s1, FXVersion s2) - { - if (s1.Major != s2.Major) - { - return s1.Major > s2.Major ? 1 : -1; - } - - if (s1.Minor != s2.Minor) - { - return s1.Minor > s2.Minor ? 1 : -1; - } - - if (s1.Patch != s2.Patch) - { - return s1.Patch > s2.Patch ? 1 : -1; - } - - if (string.IsNullOrEmpty(s1.Pre) != string.IsNullOrEmpty(s2.Pre)) - { - return string.IsNullOrEmpty(s1.Pre) ? 1 : -1; - } - - int preCompare = string.CompareOrdinal(s1.Pre, s2.Pre); - if (preCompare != 0) - { - return preCompare; - } - - return string.CompareOrdinal(s1.Build, s2.Build); - } - - public static bool TryParse(string fxVersionString, out FXVersion FXVersion) - { - FXVersion = null; - if (string.IsNullOrEmpty(fxVersionString)) - { - return false; - } - - int majorSeparator = fxVersionString.IndexOf("."); - if (majorSeparator == -1) - { - return false; - } - - int major = 0; - if (!int.TryParse(fxVersionString.Substring(0, majorSeparator), out major)) - { - return false; - } - - int minorStart = majorSeparator + 1; - int minorSeparator = fxVersionString.IndexOf(".", minorStart); - if (minorSeparator == -1) - { - return false; - } - - int minor = 0; - if (!int.TryParse(fxVersionString.Substring(minorStart, minorSeparator - minorStart), out minor)) - { - return false; - } - - int patch = 0; - int patchStart = minorSeparator + 1; - int patchSeparator = fxVersionString.FindFirstNotOf("0123456789", patchStart); - if (patchSeparator == -1) - { - if (!int.TryParse(fxVersionString.Substring(patchStart), out patch)) - { - return false; - } - - FXVersion = new FXVersion(major, minor, patch); - return true; - } - - if (!int.TryParse(fxVersionString.Substring(patchStart, patchSeparator - patchStart), out patch)) - { - return false; - } - - int preStart = patchSeparator; - int preSeparator = fxVersionString.IndexOf("+", preStart); - if (preSeparator == -1) - { - FXVersion = new FXVersion(major, minor, patch, fxVersionString.Substring(preStart)); - } - else - { - int buildStart = preSeparator + 1; - FXVersion = new FXVersion( - major, - minor, - patch, - fxVersionString.Substring(preStart, preSeparator - preStart), - fxVersionString.Substring(buildStart)); - } - - return true; - } - } -} \ No newline at end of file diff --git a/src/Microsoft.DotNet.MSBuildSdkResolver/InternalsVisibleToTests.cs b/src/Microsoft.DotNet.MSBuildSdkResolver/InternalsVisibleToTests.cs deleted file mode 100644 index f767ffc2b..000000000 --- a/src/Microsoft.DotNet.MSBuildSdkResolver/InternalsVisibleToTests.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.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Microsoft.DotNet.MSBuildSdkResolver.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/Microsoft.DotNet.MSBuildSdkResolver/Interop.Common.cs b/src/Microsoft.DotNet.MSBuildSdkResolver/Interop.Common.cs deleted file mode 100644 index 580d1220b..000000000 --- a/src/Microsoft.DotNet.MSBuildSdkResolver/Interop.Common.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Diagnostics; -using System.Text; - -namespace Microsoft.DotNet.MSBuildSdkResolver -{ - internal static partial class Interop - { - internal static string hostfxr_resolve_sdk(string exe_dir, string working_dir) - { - var buffer = new StringBuilder(capacity: 64); - - for (;;) - { - int size = hostfxr_resolve_sdk(exe_dir, working_dir, buffer, buffer.Capacity); - if (size <= 0) - { - Debug.Assert(size == 0); - return null; - } - - if (size <= buffer.Capacity) - { - break; - } - - buffer.Capacity = size; - } - - return buffer.ToString(); - } - } -} \ No newline at end of file diff --git a/src/Microsoft.DotNet.MSBuildSdkResolver/Interop.NETFramework.cs b/src/Microsoft.DotNet.MSBuildSdkResolver/Interop.NETFramework.cs deleted file mode 100644 index 2101637f3..000000000 --- a/src/Microsoft.DotNet.MSBuildSdkResolver/Interop.NETFramework.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#if NET46 - -using System; -using System.IO; -using System.Runtime.InteropServices; -using System.Text; - -namespace Microsoft.DotNet.MSBuildSdkResolver -{ - internal static partial class Interop - { - internal static readonly bool RunningOnWindows = true; - - static Interop() - { - PreloadLibrary("hostfxr.dll"); - } - - // MSBuild SDK resolvers are required to be AnyCPU, but we have a native dependency and .NETFramework does not - // have a built-in facility for dynamically loading user native dlls for the appropriate platform. We therefore - // preload the version with the correct architecture (from a corresponding sub-folder relative to us) on static - // construction so that subsequent P/Invokes can find it. - private static void PreloadLibrary(string dllFileName) - { - string basePath = Path.GetDirectoryName(typeof(Interop).Assembly.Location); - string architecture = IntPtr.Size == 8 ? "x64" : "x86"; - string dllPath = Path.Combine(basePath, architecture, dllFileName); - - // return value is intentially ignored as we let the subsequent P/Invokes fail naturally. - LoadLibraryExW(dllPath, IntPtr.Zero, LOAD_WITH_ALTERED_SEARCH_PATH); - } - - // lpFileName passed to LoadLibraryEx must be a full path. - private const int LOAD_WITH_ALTERED_SEARCH_PATH = 0x8; - - [DllImport("kernel32", CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)] - private static extern IntPtr LoadLibraryExW(string lpFileName, IntPtr hFile, int dwFlags); - - [DllImport("hostfxr", CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - private static extern int hostfxr_resolve_sdk(string exe_dir, string working_dir, [Out] StringBuilder buffer, int buffer_size); - } -} - -#endif // NET46 \ No newline at end of file diff --git a/src/Microsoft.DotNet.MSBuildSdkResolver/Interop.NETStandard.cs b/src/Microsoft.DotNet.MSBuildSdkResolver/Interop.NETStandard.cs deleted file mode 100644 index 74abc2a61..000000000 --- a/src/Microsoft.DotNet.MSBuildSdkResolver/Interop.NETStandard.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// 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 -// portability of the underlying hostfxr API and gives us build and test coverage -// on non-Windows machines. -#if NETSTANDARD1_5 - -using System; -using System.Runtime.InteropServices; -using System.Text; - -namespace Microsoft.DotNet.MSBuildSdkResolver -{ - internal static partial class Interop - { - internal static readonly bool RunningOnWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); - - internal static string realpath(string path) - { - var ptr = unix_realpath(path, IntPtr.Zero); - var result = Marshal.PtrToStringAnsi(ptr); // uses UTF8 on Unix - unix_free(ptr); - return result; - } - - private static int hostfxr_resolve_sdk(string exe_dir, string working_dir, [Out] StringBuilder buffer, int buffer_size) - { - // hostfxr string encoding is platform -specific so dispatch to the - // appropriately annotated P/Invoke for the current platform. - return RunningOnWindows - ? windows_hostfxr_resolve_sdk(exe_dir, working_dir, buffer, buffer_size) - : unix_hostfxr_resolve_sdk(exe_dir, working_dir, buffer, buffer_size); - } - - [DllImport("hostfxr", EntryPoint = nameof(hostfxr_resolve_sdk), CharSet = CharSet.Unicode, ExactSpelling=true, CallingConvention = CallingConvention.Cdecl)] - private static extern int windows_hostfxr_resolve_sdk(string exe_dir, string working_dir, [Out] StringBuilder buffer, int buffer_size); - - // CharSet.Ansi is UTF8 on Unix - [DllImport("hostfxr", EntryPoint = nameof(hostfxr_resolve_sdk), CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - private static extern int unix_hostfxr_resolve_sdk(string exe_dir, string working_dir, [Out] StringBuilder buffer, int buffer_size); - - // CharSet.Ansi is UTF8 on Unix - [DllImport("libc", EntryPoint = nameof(realpath), CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - private static extern IntPtr unix_realpath(string path, IntPtr buffer); - - [DllImport("libc", EntryPoint = "free", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - private static extern void unix_free(IntPtr ptr); - } -} - -#endif // NETSTANDARD1_5 \ No newline at end of file diff --git a/src/Microsoft.DotNet.MSBuildSdkResolver/MSBuildSdkResolver.cs b/src/Microsoft.DotNet.MSBuildSdkResolver/MSBuildSdkResolver.cs deleted file mode 100644 index 08a552479..000000000 --- a/src/Microsoft.DotNet.MSBuildSdkResolver/MSBuildSdkResolver.cs +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.Build.Framework; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; - -namespace Microsoft.DotNet.MSBuildSdkResolver -{ - public sealed class DotNetMSBuildSdkResolver : SdkResolver - { - public override string Name => "Microsoft.DotNet.MSBuildSdkResolver"; - - // Default resolver has priority 10000 and we want to go before it and leave room on either side of us. - public override int Priority => 5000; - - private readonly Func _getEnvironmentVariable; - - public DotNetMSBuildSdkResolver() - : this(Environment.GetEnvironmentVariable) - { - } - - // Test hook to provide environment variables without polluting the test process. - internal DotNetMSBuildSdkResolver(Func getEnvironmentVariable) - { - _getEnvironmentVariable = getEnvironmentVariable; - } - - public override SdkResult Resolve(SdkReference sdkReference, SdkResolverContext context, SdkResultFactory factory) - { - // These are overrides that are used to force the resolved SDK tasks and targets to come from a given - // base directory and report a given version to msbuild (which may be null if unknown. One key use case - // for this is to test SDK tasks and targets without deploying them inside the .NET Core SDK. - string msbuildSdksDir = _getEnvironmentVariable("DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR"); - string netcoreSdkVersion = _getEnvironmentVariable("DOTNET_MSBUILD_SDK_RESOLVER_SDKS_VER"); - - if (msbuildSdksDir == null) - { - string netcoreSdkDir = ResolveNetcoreSdkDirectory(context); - if (netcoreSdkDir == null) - { - return factory.IndicateFailure( - new[] - { - "Unable to locate the .NET Core SDK. Check that it is installed and that the version" - + " specified in global.json (if any) matches the installed version." - }); - } - - msbuildSdksDir = Path.Combine(netcoreSdkDir, "Sdks"); - netcoreSdkVersion = new DirectoryInfo(netcoreSdkDir).Name; - - if (IsNetCoreSDKSmallerThanTheMinimumVersion(netcoreSdkVersion, sdkReference.MinimumVersion)) - { - return factory.IndicateFailure( - new[] - { - $"Version {netcoreSdkVersion} of the .NET Core SDK is smaller than the minimum version" - + $" {sdkReference.MinimumVersion} requested. Check that a recent enough .NET Core SDK is" - + " installed, increase the minimum version specified in the project, or increase" - + " the version specified in global.json." - }); - } - - string minimumMSBuildVersionString = GetMinimumMSBuildVersion(netcoreSdkDir); - var minimumMSBuildVersion = Version.Parse(minimumMSBuildVersionString); - if (context.MSBuildVersion < minimumMSBuildVersion) - { - return factory.IndicateFailure( - new[] - { - $"Version {netcoreSdkVersion} of the .NET Core SDK requires at least version {minimumMSBuildVersionString}" - + $" of MSBuild. The current available version of MSBuild is {context.MSBuildVersion.ToString()}." - + " Change the .NET Core SDK specified in global.json to an older version that requires the MSBuild" - + " version currently available." - }); - } - - string minimumVSDefinedSDKVersion = GetMinimumVSDefinedSDKVersion(); - if (IsNetCoreSDKSmallerThanTheMinimumVersion(netcoreSdkVersion, minimumVSDefinedSDKVersion)) - { - return factory.IndicateFailure( - new[] - { - $"Version {netcoreSdkVersion} of the .NET Core SDK is smaller than the minimum version" - + $" {minimumVSDefinedSDKVersion} required by Visual Studio. Check that a recent enough" - + " .NET Core SDK is installed or increase the version specified in global.json." - }); - } - } - - string msbuildSdkDir = Path.Combine(msbuildSdksDir, sdkReference.Name, "Sdk"); - if (!Directory.Exists(msbuildSdkDir)) - { - return factory.IndicateFailure( - new[] - { - $"{msbuildSdkDir} not found. Check that a recent enough .NET Core SDK is installed" - + " and/or increase the version specified in global.json." - }); - } - - return factory.IndicateSuccess(msbuildSdkDir, netcoreSdkVersion); - } - - private static string GetMinimumMSBuildVersion(string netcoreSdkDir) - { - string minimumVersionFilePath = Path.Combine(netcoreSdkDir, "minimumMSBuildVersion"); - if (!File.Exists(minimumVersionFilePath)) - { - // smallest version that had resolver support and also - // greater than or equal to the version required by any - // .NET Core SDK that did not have this file. - return "15.3.0"; - } - - return File.ReadLines(minimumVersionFilePath).First().Trim(); - } - - private static string GetMinimumVSDefinedSDKVersion() - { - string dotnetMSBuildSdkResolverDirectory = - Path.GetDirectoryName(typeof(DotNetMSBuildSdkResolver).GetTypeInfo().Assembly.Location); - string minimumVSDefinedSdkVersionFilePath = - Path.Combine(dotnetMSBuildSdkResolverDirectory, "minimumVSDefinedSDKVersion"); - - if (!File.Exists(minimumVSDefinedSdkVersionFilePath)) - { - // smallest version that is required by VS 15.3. - return "1.0.4"; - } - - return File.ReadLines(minimumVSDefinedSdkVersionFilePath).First().Trim(); - } - - private bool IsNetCoreSDKSmallerThanTheMinimumVersion(string netcoreSdkVersion, string minimumVersion) - { - FXVersion netCoreSdkFXVersion; - FXVersion minimumFXVersion; - - if (string.IsNullOrEmpty(minimumVersion)) - { - return false; - } - - if (!FXVersion.TryParse(netcoreSdkVersion, out netCoreSdkFXVersion) || - !FXVersion.TryParse(minimumVersion, out minimumFXVersion)) - { - return true; - } - - return FXVersion.Compare(netCoreSdkFXVersion, minimumFXVersion) < 0; - } - - private string ResolveNetcoreSdkDirectory(SdkResolverContext context) - { - string exeDir = GetDotnetExeDirectory(); - string workingDir = context.SolutionFilePath ?? context.ProjectFilePath; - string netcoreSdkDir = Interop.hostfxr_resolve_sdk(exeDir, workingDir); - - return netcoreSdkDir; - } - - private string GetDotnetExeDirectory() - { - string environmentOverride = _getEnvironmentVariable("DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR"); - if (environmentOverride != null) - { - return environmentOverride; - } - - var environmentProvider = new EnvironmentProvider(_getEnvironmentVariable); - var dotnetExe = environmentProvider.GetCommandPath("dotnet"); - -#if NETSTANDARD1_5 - if (dotnetExe != null && !Interop.RunningOnWindows) - { - // e.g. on Linux the 'dotnet' command from PATH is a symlink so we need to - // resolve it to get the actual path to the binary - dotnetExe = Interop.realpath(dotnetExe) ?? dotnetExe; - } -#endif - - return Path.GetDirectoryName(dotnetExe); - } - } -} diff --git a/src/Microsoft.DotNet.MSBuildSdkResolver/Microsoft.DotNet.MSBuildSdkResolver.csproj b/src/Microsoft.DotNet.MSBuildSdkResolver/Microsoft.DotNet.MSBuildSdkResolver.csproj deleted file mode 100644 index 55d357272..000000000 --- a/src/Microsoft.DotNet.MSBuildSdkResolver/Microsoft.DotNet.MSBuildSdkResolver.csproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - $(SdkVersion) - netstandard1.5;net46 - netstandard1.5 - AnyCPU - win-x86;win-x64 - true - ../../tools/Key.snk - true - true - false - $(SdkResolverOutputDirectory) - - - - - - - - - - - - - - - x86/hostfxr.dll - PreserveNewest - - - x64/hostfxr.dll - PreserveNewest - - - - diff --git a/src/Microsoft.DotNet.MSBuildSdkResolver/Microsoft.DotNet.MSBuildSdkResolver.sln b/src/Microsoft.DotNet.MSBuildSdkResolver/Microsoft.DotNet.MSBuildSdkResolver.sln deleted file mode 100644 index 08c449079..000000000 --- a/src/Microsoft.DotNet.MSBuildSdkResolver/Microsoft.DotNet.MSBuildSdkResolver.sln +++ /dev/null @@ -1,60 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26425.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.MSBuildSdkResolver", "Microsoft.DotNet.MSBuildSdkResolver.csproj", "{DCB2A518-7BC6-43F5-BE2C-13B11A1F3961}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.MSBuildSdkResolver.Tests", "..\..\test\Microsoft.DotNet.MSBuildSdkResolver.Tests\Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj", "{CC488F39-E106-4BF4-9599-19A265AFD9AC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Tools.Tests.Utilities", "..\..\test\Microsoft.DotNet.Tools.Tests.Utilities\Microsoft.DotNet.Tools.Tests.Utilities.csproj", "{E548D3D0-50E3-4485-B531-95585A5D0B85}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.TestFramework", "..\Microsoft.DotNet.TestFramework\Microsoft.DotNet.TestFramework.csproj", "{182FFFA6-AE8F-431C-9B17-2F30B2A8FE42}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestDependencies", "TestDependencies", "{0F45009E-9053-401D-91CA-8046D9EB310B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.Cli.Utils", "..\Microsoft.DotNet.Cli.Utils\Microsoft.DotNet.Cli.Utils.csproj", "{7F68DEFE-F2D3-453C-B155-51B674604D29}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.InternalAbstractions", "..\Microsoft.DotNet.InternalAbstractions\Microsoft.DotNet.InternalAbstractions.csproj", "{A54567A1-E8DE-4B8C-9156-D895B9D016DB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DCB2A518-7BC6-43F5-BE2C-13B11A1F3961}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DCB2A518-7BC6-43F5-BE2C-13B11A1F3961}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DCB2A518-7BC6-43F5-BE2C-13B11A1F3961}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DCB2A518-7BC6-43F5-BE2C-13B11A1F3961}.Release|Any CPU.Build.0 = Release|Any CPU - {CC488F39-E106-4BF4-9599-19A265AFD9AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CC488F39-E106-4BF4-9599-19A265AFD9AC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CC488F39-E106-4BF4-9599-19A265AFD9AC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CC488F39-E106-4BF4-9599-19A265AFD9AC}.Release|Any CPU.Build.0 = Release|Any CPU - {E548D3D0-50E3-4485-B531-95585A5D0B85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E548D3D0-50E3-4485-B531-95585A5D0B85}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E548D3D0-50E3-4485-B531-95585A5D0B85}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E548D3D0-50E3-4485-B531-95585A5D0B85}.Release|Any CPU.Build.0 = Release|Any CPU - {182FFFA6-AE8F-431C-9B17-2F30B2A8FE42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {182FFFA6-AE8F-431C-9B17-2F30B2A8FE42}.Debug|Any CPU.Build.0 = Debug|Any CPU - {182FFFA6-AE8F-431C-9B17-2F30B2A8FE42}.Release|Any CPU.ActiveCfg = Release|Any CPU - {182FFFA6-AE8F-431C-9B17-2F30B2A8FE42}.Release|Any CPU.Build.0 = Release|Any CPU - {7F68DEFE-F2D3-453C-B155-51B674604D29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7F68DEFE-F2D3-453C-B155-51B674604D29}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7F68DEFE-F2D3-453C-B155-51B674604D29}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7F68DEFE-F2D3-453C-B155-51B674604D29}.Release|Any CPU.Build.0 = Release|Any CPU - {A54567A1-E8DE-4B8C-9156-D895B9D016DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A54567A1-E8DE-4B8C-9156-D895B9D016DB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A54567A1-E8DE-4B8C-9156-D895B9D016DB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A54567A1-E8DE-4B8C-9156-D895B9D016DB}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {E548D3D0-50E3-4485-B531-95585A5D0B85} = {0F45009E-9053-401D-91CA-8046D9EB310B} - {182FFFA6-AE8F-431C-9B17-2F30B2A8FE42} = {0F45009E-9053-401D-91CA-8046D9EB310B} - {7F68DEFE-F2D3-453C-B155-51B674604D29} = {0F45009E-9053-401D-91CA-8046D9EB310B} - {A54567A1-E8DE-4B8C-9156-D895B9D016DB} = {0F45009E-9053-401D-91CA-8046D9EB310B} - EndGlobalSection -EndGlobal diff --git a/src/Microsoft.DotNet.MSBuildSdkResolver/StringExtensions.cs b/src/Microsoft.DotNet.MSBuildSdkResolver/StringExtensions.cs deleted file mode 100644 index 8382008c9..000000000 --- a/src/Microsoft.DotNet.MSBuildSdkResolver/StringExtensions.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Microsoft.DotNet.MSBuildSdkResolver -{ - internal static class StringExtensions - { - public static int FindFirstNotOf(this string s, string chars, int startIndex) - { - for (int i = startIndex; i < s.Length; i++) - { - if (chars.IndexOf(s[i]) == -1) return i; - } - - return -1; - } - } -} \ No newline at end of file diff --git a/src/Microsoft.DotNet.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/AppliedOptionExtensions.cs b/src/dotnet/AppliedOptionExtensions.cs deleted file mode 100644 index 8158c0f83..000000000 --- a/src/dotnet/AppliedOptionExtensions.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; - -namespace Microsoft.DotNet.Cli -{ - public static class AppliedOptionExtensions - { - public static T ValueOrDefault(this AppliedOption parseResult, string alias) - { - return parseResult - .AppliedOptions - .Where(o => o.HasAlias(alias)) - .Select(o => o.Value()) - .SingleOrDefault(); - } - - public static string SingleArgumentOrDefault(this AppliedOption parseResult, string alias) - { - return parseResult - .AppliedOptions - .Where(o => o.HasAlias(alias)) - .Select(o => o.Arguments.Single()) - .SingleOrDefault(); - } - } -} diff --git a/src/dotnet/ArgumentForwardingExtensions.cs b/src/dotnet/ArgumentForwardingExtensions.cs deleted file mode 100644 index da4a3cdc9..000000000 --- a/src/dotnet/ArgumentForwardingExtensions.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; - -namespace Microsoft.DotNet.Cli -{ - public static class ArgumentForwardingExtensions - { - public static ArgumentsRule Forward( - this ArgumentsRule rule) => - rule.MaterializeAs(o => new ForwardedArgument(o.Arguments.SingleOrDefault())); - - public static ArgumentsRule ForwardAs( - this ArgumentsRule rule, - string value) => - rule.MaterializeAs(o => new ForwardedArgument(value)); - - public static ArgumentsRule ForwardAsSingle( - this ArgumentsRule rule, - Func format) => - rule.MaterializeAs(o => - new ForwardedArgument(format(o))); - - public static ArgumentsRule ForwardAsMany( - this ArgumentsRule rule, - Func> format) => - rule.MaterializeAs(o => - new ForwardedArgument(format(o).ToArray())); - - public static IEnumerable OptionValuesToBeForwarded( - this AppliedOption command) => - command.AppliedOptions - .Select(o => o.Value()) - .OfType() - .SelectMany(o => o.Values); - - private class ForwardedArgument - { - public ForwardedArgument(params string[] values) - { - Values = values; - } - - public string[] Values { get; } - } - } -} \ No newline at end of file diff --git a/src/dotnet/BuiltInCommandMetadata.cs b/src/dotnet/BuiltInCommandMetadata.cs deleted file mode 100644 index bb2d48181..000000000 --- a/src/dotnet/BuiltInCommandMetadata.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; - -namespace Microsoft.DotNet.Cli -{ - public class BuiltInCommandMetadata - { - public Func Command { get; set; } - public string DocLink { get; set; } - } -} \ No newline at end of file diff --git a/src/dotnet/BuiltInCommandsCatalog.cs b/src/dotnet/BuiltInCommandsCatalog.cs deleted file mode 100644 index 25c69fdbd..000000000 --- a/src/dotnet/BuiltInCommandsCatalog.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) .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.Add; -using Microsoft.DotNet.Tools.Build; -using Microsoft.DotNet.Tools.Clean; -using Microsoft.DotNet.Tools.Help; -using Microsoft.DotNet.Tools.List; -using Microsoft.DotNet.Tools.Migrate; -using Microsoft.DotNet.Tools.MSBuild; -using Microsoft.DotNet.Tools.New; -using Microsoft.DotNet.Tools.NuGet; -using Microsoft.DotNet.Tools.Pack; -using Microsoft.DotNet.Tools.Publish; -using Microsoft.DotNet.Tools.Remove; -using Microsoft.DotNet.Tools.Restore; -using Microsoft.DotNet.Tools.Run; -using Microsoft.DotNet.Tools.Sln; -using Microsoft.DotNet.Tools.Store; -using Microsoft.DotNet.Tools.Test; -using Microsoft.DotNet.Tools.VSTest; -using System.Collections.Generic; - -namespace Microsoft.DotNet.Cli -{ - public static class BuiltInCommandsCatalog - { - public static Dictionary Commands = new Dictionary - { - ["add"] = new BuiltInCommandMetadata - { - Command = AddCommand.Run, - // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-add-reference - DocLink = "https://aka.ms/dotnet-add" - }, - ["build"] = new BuiltInCommandMetadata - { - Command = BuildCommand.Run, - // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-build - DocLink = "https://aka.ms/dotnet-build" - }, - ["clean"] = new BuiltInCommandMetadata - { - Command = CleanCommand.Run, - // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-clean - DocLink = "https://aka.ms/dotnet-clean" - }, - ["help"] = new BuiltInCommandMetadata - { - Command = HelpCommand.Run, - // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-help - DocLink = "https://aka.ms/dotnet-help" - }, - ["list"] = new BuiltInCommandMetadata - { - Command = ListCommand.Run, - // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-list-reference - DocLink = "https://aka.ms/dotnet-list" - }, - ["migrate"] = new BuiltInCommandMetadata - { - Command = MigrateCommandCompose.Run, - // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-migrate - DocLink = "http://aka.ms/dotnet-migrate" - - }, - ["msbuild"] = new BuiltInCommandMetadata - { - Command = MSBuildCommand.Run, - // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-msbuild - DocLink = "https://aka.ms/dotnet-msbuild" - }, - ["new"] = new BuiltInCommandMetadata - { - Command = NewCommandShim.Run, - // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-new - DocLink = "https://aka.ms/dotnet-new" - }, - ["nuget"] = new BuiltInCommandMetadata - { - Command = NuGetCommand.Run, - // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-nuget-locals - DocLink = "https://aka.ms/dotnet-nuget" - }, - ["pack"] = new BuiltInCommandMetadata - { - Command = PackCommand.Run, - // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-pack - DocLink = "https://aka.ms/dotnet-pack" - }, - ["publish"] = new BuiltInCommandMetadata - { - Command = PublishCommand.Run, - // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-publish - DocLink = "https://aka.ms/dotnet-publish" - }, - ["remove"] = new BuiltInCommandMetadata - { - Command = RemoveCommand.Run, - // aka.ms link: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-remove-reference - DocLink = "https://aka.ms/dotnet-remove" - }, - ["restore"] = new BuiltInCommandMetadata - { - Command = RestoreCommand.Run, - // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-restore - DocLink = "https://aka.ms/dotnet-restore" - }, - ["run"] = new BuiltInCommandMetadata - { - Command = RunCommand.Run, - // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-run - DocLink = "https://aka.ms/dotnet-run" - }, - ["sln"] = new BuiltInCommandMetadata - { - Command = SlnCommand.Run, - // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-sln - DocLink = "https://aka.ms/dotnet-sln" - }, - ["store"] = new BuiltInCommandMetadata - { - Command = StoreCommand.Run, - // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-store - DocLink = "https://aka.ms/dotnet-store" - }, - ["test"] = new BuiltInCommandMetadata - { - Command = TestCommand.Run, - // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-test - DocLink = "https://aka.ms/dotnet-test" - }, - ["vstest"] = new BuiltInCommandMetadata - { - Command = VSTestCommand.Run, - // aka.ms target: https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-vstest - DocLink = "https://aka.ms/dotnet-vstest" - }, - ["complete"] = new BuiltInCommandMetadata - { - Command = CompleteCommand.Run - }, - ["parse"] = new BuiltInCommandMetadata - { - Command = ParseCommand.Run - }, - ["internal-reportinstallsuccess"] = new BuiltInCommandMetadata - { - Command = InternalReportinstallsuccess.Run - } - }; - } -} \ No newline at end of file diff --git a/src/dotnet/CommandBase.cs b/src/dotnet/CommandBase.cs deleted file mode 100644 index 2f4e6316a..000000000 --- a/src/dotnet/CommandBase.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Cli.CommandLine; - -namespace Microsoft.DotNet.Cli -{ - public abstract class CommandBase - { - protected CommandBase(ParseResult parseResult) - { - ShowHelpOrErrorIfAppropriate(parseResult); - } - - protected virtual void ShowHelpOrErrorIfAppropriate(ParseResult parseResult) - { - parseResult.ShowHelpOrErrorIfAppropriate(); - } - - public abstract int Execute(); - } -} diff --git a/src/dotnet/CommandCreationException.cs b/src/dotnet/CommandCreationException.cs deleted file mode 100644 index 837b86ec0..000000000 --- a/src/dotnet/CommandCreationException.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Text; - -namespace Microsoft.DotNet.Cli -{ - internal class CommandCreationException : Exception - { - public int ExitCode { get; private set; } - - public CommandCreationException(int exitCode) - { - ExitCode = exitCode; - } - } -} diff --git a/src/dotnet/CommandLine/CommandArgument.cs b/src/dotnet/CommandLine/CommandArgument.cs deleted file mode 100644 index 045609d79..000000000 --- a/src/dotnet/CommandLine/CommandArgument.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.DotNet.Cli.CommandLine -{ - internal class CommandArgument - { - public CommandArgument() - { - Values = new List(); - } - - public string Name { get; set; } - public string Description { get; set; } - public List Values { get; private set; } - public bool MultipleValues { get; set; } - public string Value - { - get - { - return Values.FirstOrDefault(); - } - } - } -} diff --git a/src/dotnet/CommandLine/CommandLineApplication.cs b/src/dotnet/CommandLine/CommandLineApplication.cs deleted file mode 100644 index 64b6b3d17..000000000 --- a/src/dotnet/CommandLine/CommandLineApplication.cs +++ /dev/null @@ -1,693 +0,0 @@ -// Copyright (c) .NET 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; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Microsoft.DotNet.Cli.CommandLine -{ - internal class CommandLineApplication - { - private enum ParseOptionResult - { - Succeeded, - ShowHelp, - ShowVersion, - UnexpectedArgs, - } - - // Indicates whether the parser should throw an exception when it runs into an unexpected argument. - // If this field is set to false, the parser will stop parsing when it sees an unexpected argument, and all - // remaining arguments, including the first unexpected argument, will be stored in RemainingArguments property. - private readonly bool _throwOnUnexpectedArg; - - public CommandLineApplication(bool throwOnUnexpectedArg = true) - { - _throwOnUnexpectedArg = throwOnUnexpectedArg; - Options = new List(); - Arguments = new List(); - Commands = new List(); - RemainingArguments = new List(); - Invoke = () => 0; - } - - public CommandLineApplication Parent { get; set; } - public string Name { get; set; } - public string FullName { get; set; } - public string Syntax { get; set; } - public string Description { get; set; } - public List Options { get; private set; } - public CommandOption OptionHelp { get; private set; } - public CommandOption OptionVersion { get; private set; } - public List Arguments { get; private set; } - public List RemainingArguments { get; private set; } - public bool IsShowingInformation { get; protected set; } // Is showing help or version? - public Func Invoke { get; set; } - public Func LongVersionGetter { get; set; } - public Func ShortVersionGetter { get; set; } - public List Commands { get; private set; } - public bool HandleResponseFiles { get; set; } - public bool AllowArgumentSeparator { get; set; } - public bool HandleRemainingArguments { get; set; } - public string ArgumentSeparatorHelpText { get; set; } - - public CommandLineApplication AddCommand(string name, bool throwOnUnexpectedArg = true) - { - return AddCommand(name, _ => { }, throwOnUnexpectedArg); - } - - public CommandLineApplication AddCommand(string name, Action configuration, - bool throwOnUnexpectedArg = true) - { - var command = new CommandLineApplication(throwOnUnexpectedArg) { Name = name }; - return AddCommand(command, configuration, throwOnUnexpectedArg); - } - - public CommandLineApplication AddCommand(CommandLineApplication command, bool throwOnUnexpectedArg = true) - { - return AddCommand(command, _ => { }, throwOnUnexpectedArg); - } - - public CommandLineApplication AddCommand( - CommandLineApplication command, - Action configuration, - bool throwOnUnexpectedArg = true) - { - if (command == null || configuration == null) - { - throw new NullReferenceException(); - } - - command.Parent = this; - Commands.Add(command); - configuration(command); - return command; - } - - public CommandOption Option(string template, string description, CommandOptionType optionType) - { - return Option(template, description, optionType, _ => { }); - } - - public CommandOption Option(string template, string description, CommandOptionType optionType, Action configuration) - { - var option = new CommandOption(template, optionType) { Description = description }; - Options.Add(option); - configuration(option); - return option; - } - - public CommandArgument Argument(string name, string description, bool multipleValues = false) - { - return Argument(name, description, _ => { }, multipleValues); - } - - public CommandArgument Argument(string name, string description, Action configuration, bool multipleValues = false) - { - var lastArg = Arguments.LastOrDefault(); - if (lastArg != null && lastArg.MultipleValues) - { - var message = string.Format(LocalizableStrings.LastArgumentMultiValueError, - lastArg.Name); - throw new InvalidOperationException(message); - } - - var argument = new CommandArgument { Name = name, Description = description, MultipleValues = multipleValues }; - Arguments.Add(argument); - configuration(argument); - return argument; - } - - public void OnExecute(Func invoke) - { - Invoke = invoke; - } - - public void OnExecute(Func> invoke) - { - Invoke = () => invoke().Result; - } - - public int Execute(params string[] args) - { - CommandLineApplication command = this; - CommandArgumentEnumerator arguments = null; - - if (HandleResponseFiles) - { - args = ExpandResponseFiles(args).ToArray(); - } - - for (var index = 0; index < args.Length; index++) - { - var arg = args[index]; - - bool isLongOption = arg.StartsWith("--"); - if (arg == "-?" || arg == "/?") - { - command.ShowHelp(); - return 0; - } - else if (isLongOption || arg.StartsWith("-")) - { - CommandOption option; - - var result = ParseOption(isLongOption, command, args, ref index, out option); - - - if (result == ParseOptionResult.ShowHelp) - { - command.ShowHelp(); - return 0; - } - else if (result == ParseOptionResult.ShowVersion) - { - command.ShowVersion(); - return 0; - } - else if (result == ParseOptionResult.UnexpectedArgs) - { - break; - } - } - else - { - var subcommand = ParseSubCommand(arg, command); - if (subcommand != null) - { - command = subcommand; - } - else - { - if (arguments == null || arguments.CommandName != command.Name) - { - arguments = new CommandArgumentEnumerator(command.Arguments.GetEnumerator(), command.Name); - } - - if (arguments.MoveNext()) - { - arguments.Current.Values.Add(arg); - } - else - { - HandleUnexpectedArg(command, args, index, argTypeName: "command or argument"); - break; - } - } - } - } - - if (Commands.Count > 0 && command == this) - { - throw new CommandParsingException( - command, - "Required command missing", - isRequiredSubCommandMissing: true); - } - - return command.Invoke(); - } - - private ParseOptionResult ParseOption( - bool isLongOption, - CommandLineApplication command, - string[] args, - ref int index, - out CommandOption option) - { - option = null; - ParseOptionResult result = ParseOptionResult.Succeeded; - var arg = args[index]; - - int optionPrefixLength = isLongOption ? 2 : 1; - string[] optionComponents = arg.Substring(optionPrefixLength).Split(new[] { ':', '=' }, 2); - string optionName = optionComponents[0]; - - if (isLongOption) - { - option = command.Options.SingleOrDefault( - opt => string.Equals(opt.LongName, optionName, StringComparison.Ordinal)); - } - else - { - option = command.Options.SingleOrDefault( - opt => string.Equals(opt.ShortName, optionName, StringComparison.Ordinal)); - - if (option == null) - { - option = command.Options.SingleOrDefault( - opt => string.Equals(opt.SymbolName, optionName, StringComparison.Ordinal)); - } - } - - if (option == null) - { - if (isLongOption && string.IsNullOrEmpty(optionName) && - !command._throwOnUnexpectedArg && AllowArgumentSeparator) - { - // a stand-alone "--" is the argument separator, so skip it and - // handle the rest of the args as unexpected args - index++; - } - - HandleUnexpectedArg(command, args, index, argTypeName: "option"); - result = ParseOptionResult.UnexpectedArgs; - } - else if (command.OptionHelp == option) - { - result = ParseOptionResult.ShowHelp; - } - else if (command.OptionVersion == option) - { - result = ParseOptionResult.ShowVersion; - } - else - { - if (optionComponents.Length == 2) - { - if (!option.TryParse(optionComponents[1])) - { - command.ShowHint(); - throw new CommandParsingException(command, - String.Format(LocalizableStrings.UnexpectedValueForOptionError, optionComponents[1], optionName)); - } - } - else - { - if (option.OptionType == CommandOptionType.NoValue || - option.OptionType == CommandOptionType.BoolValue) - { - // No value is needed for this option - option.TryParse(null); - } - else - { - index++; - - if (index < args.Length) - { - arg = args[index]; - if (!option.TryParse(arg)) - { - command.ShowHint(); - throw new CommandParsingException( - command, - String.Format(LocalizableStrings.UnexpectedValueForOptionError, arg, optionName)); - } - } - else - { - command.ShowHint(); - throw new CommandParsingException( - command, - String.Format(LocalizableStrings.OptionRequiresSingleValueWhichIsMissing, arg, optionName)); - } - } - } - } - - return result; - } - - private CommandLineApplication ParseSubCommand(string arg, CommandLineApplication command) - { - foreach (var subcommand in command.Commands) - { - if (string.Equals(subcommand.Name, arg, StringComparison.OrdinalIgnoreCase)) - { - return subcommand; - } - } - - return null; - } - - // Helper method that adds a help option - public CommandOption HelpOption(string template) - { - // Help option is special because we stop parsing once we see it - // So we store it separately for further use - OptionHelp = Option(template, LocalizableStrings.ShowHelpInfo, CommandOptionType.NoValue); - - return OptionHelp; - } - - public CommandOption VersionOption(string template, - string shortFormVersion, - string longFormVersion = null) - { - if (longFormVersion == null) - { - return VersionOption(template, () => shortFormVersion); - } - else - { - return VersionOption(template, () => shortFormVersion, () => longFormVersion); - } - } - - // Helper method that adds a version option - public CommandOption VersionOption(string template, - Func shortFormVersionGetter, - Func longFormVersionGetter = null) - { - // Version option is special because we stop parsing once we see it - // So we store it separately for further use - OptionVersion = Option(template, LocalizableStrings.ShowVersionInfo, CommandOptionType.NoValue); - ShortVersionGetter = shortFormVersionGetter; - LongVersionGetter = longFormVersionGetter ?? shortFormVersionGetter; - - return OptionVersion; - } - - // Show short hint that reminds users to use help option - public void ShowHint() - { - if (OptionHelp != null) - { - Console.WriteLine(string.Format(LocalizableStrings.ShowHintInfo, OptionHelp.LongName)); - } - } - - // Show full help - public void ShowHelp(string commandName = null) - { - var headerBuilder = new StringBuilder(LocalizableStrings.UsageHeader); - var usagePrefixLength = headerBuilder.Length; - for (var cmd = this; cmd != null; cmd = cmd.Parent) - { - cmd.IsShowingInformation = true; - if (cmd != this && cmd.Arguments.Any()) - { - var args = string.Join(" ", cmd.Arguments.Select(arg => arg.Name)); - headerBuilder.Insert(usagePrefixLength, string.Format(" {0} {1}", cmd.Name, args)); - } - else - { - headerBuilder.Insert(usagePrefixLength, string.Format(" {0}", cmd.Name)); - } - } - - CommandLineApplication target; - - if (commandName == null || string.Equals(Name, commandName, StringComparison.OrdinalIgnoreCase)) - { - target = this; - } - else - { - target = Commands.SingleOrDefault(cmd => string.Equals(cmd.Name, commandName, StringComparison.OrdinalIgnoreCase)); - - if (target != null) - { - headerBuilder.AppendFormat(" {0}", commandName); - } - else - { - // The command name is invalid so don't try to show help for something that doesn't exist - target = this; - } - - } - - var optionsBuilder = new StringBuilder(); - var commandsBuilder = new StringBuilder(); - var argumentsBuilder = new StringBuilder(); - var argumentSeparatorBuilder = new StringBuilder(); - - int maxArgLen = 0; - for (var cmd = target; cmd != null; cmd = cmd.Parent) - { - if (cmd.Arguments.Any()) - { - if (cmd == target) - { - headerBuilder.Append(LocalizableStrings.UsageArgumentsToken); - } - - if (argumentsBuilder.Length == 0) - { - argumentsBuilder.AppendLine(); - argumentsBuilder.AppendLine(LocalizableStrings.UsageArgumentsHeader); - } - - maxArgLen = Math.Max(maxArgLen, MaxArgumentLength(cmd.Arguments)); - } - } - - for (var cmd = target; cmd != null; cmd = cmd.Parent) - { - if (cmd.Arguments.Any()) - { - foreach (var arg in cmd.Arguments) - { - argumentsBuilder.AppendFormat( - " {0}{1}", - arg.Name.PadRight(maxArgLen + 2), - arg.Description); - argumentsBuilder.AppendLine(); - } - } - } - - if (target.Options.Any()) - { - headerBuilder.Append(LocalizableStrings.UsageOptionsToken); - - optionsBuilder.AppendLine(); - optionsBuilder.AppendLine(LocalizableStrings.UsageOptionsHeader); - var maxOptLen = MaxOptionTemplateLength(target.Options); - var outputFormat = string.Format(" {{0, -{0}}}{{1}}", maxOptLen + 2); - foreach (var opt in target.Options) - { - optionsBuilder.AppendFormat(outputFormat, opt.Template, opt.Description); - optionsBuilder.AppendLine(); - } - } - - if (target.Commands.Any()) - { - headerBuilder.Append(LocalizableStrings.UsageCommandToken); - - commandsBuilder.AppendLine(); - commandsBuilder.AppendLine(LocalizableStrings.UsageCommandsHeader); - var maxCmdLen = MaxCommandLength(target.Commands); - var outputFormat = string.Format(" {{0, -{0}}}{{1}}", maxCmdLen + 2); - foreach (var cmd in target.Commands.OrderBy(c => c.Name)) - { - commandsBuilder.AppendFormat(outputFormat, cmd.Name, cmd.Description); - commandsBuilder.AppendLine(); - } - - if (OptionHelp != null) - { - commandsBuilder.AppendLine(); - commandsBuilder.AppendFormat(LocalizableStrings.UsageCommandsDetailHelp, Name); - commandsBuilder.AppendLine(); - } - } - - if (target.AllowArgumentSeparator || target.HandleRemainingArguments) - { - if (target.AllowArgumentSeparator) - { - headerBuilder.Append(LocalizableStrings.UsageCommandAdditionalArgs); - } - else - { - headerBuilder.Append(LocalizableStrings.UsageCommandArgs); - } - - if (!string.IsNullOrEmpty(target.ArgumentSeparatorHelpText)) - { - argumentSeparatorBuilder.AppendLine(); - argumentSeparatorBuilder.AppendLine(LocalizableStrings.UsageCommandsAdditionalArgsHeader); - argumentSeparatorBuilder.AppendLine(String.Format(" {0}", target.ArgumentSeparatorHelpText)); - argumentSeparatorBuilder.AppendLine(); - } - } - - headerBuilder.AppendLine(); - - var nameAndVersion = new StringBuilder(); - nameAndVersion.AppendLine(GetFullNameAndVersion()); - nameAndVersion.AppendLine(); - - Console.Write("{0}{1}{2}{3}{4}{5}", nameAndVersion, headerBuilder, argumentsBuilder, optionsBuilder, commandsBuilder, argumentSeparatorBuilder); - } - - public void ShowVersion() - { - for (var cmd = this; cmd != null; cmd = cmd.Parent) - { - cmd.IsShowingInformation = true; - } - - Console.WriteLine(FullName); - Console.WriteLine(LongVersionGetter()); - } - - public string GetFullNameAndVersion() - { - return ShortVersionGetter == null ? FullName : string.Format("{0} {1}", FullName, ShortVersionGetter()); - } - - public void ShowRootCommandFullNameAndVersion() - { - var rootCmd = this; - while (rootCmd.Parent != null) - { - rootCmd = rootCmd.Parent; - } - - Console.WriteLine(rootCmd.GetFullNameAndVersion()); - Console.WriteLine(); - } - - private int MaxOptionTemplateLength(IEnumerable options) - { - var maxLen = 0; - foreach (var opt in options) - { - maxLen = opt.Template.Length > maxLen ? opt.Template.Length : maxLen; - } - return maxLen; - } - - private int MaxCommandLength(IEnumerable commands) - { - var maxLen = 0; - foreach (var cmd in commands) - { - maxLen = cmd.Name.Length > maxLen ? cmd.Name.Length : maxLen; - } - return maxLen; - } - - private int MaxArgumentLength(IEnumerable arguments) - { - var maxLen = 0; - foreach (var arg in arguments) - { - maxLen = arg.Name.Length > maxLen ? arg.Name.Length : maxLen; - } - return maxLen; - } - - private void HandleUnexpectedArg(CommandLineApplication command, string[] args, int index, string argTypeName) - { - if (command._throwOnUnexpectedArg) - { - command.ShowHint(); - throw new CommandParsingException(command, String.Format(LocalizableStrings.UnexpectedArgumentError, argTypeName, args[index])); - } - else - { - // All remaining arguments are stored for further use - command.RemainingArguments.AddRange(new ArraySegment(args, index, args.Length - index)); - } - } - - private IEnumerable ExpandResponseFiles(IEnumerable args) - { - foreach (var arg in args) - { - if (!arg.StartsWith("@", StringComparison.Ordinal)) - { - yield return arg; - } - else - { - var fileName = arg.Substring(1); - - var responseFileArguments = ParseResponseFile(fileName); - - // ParseResponseFile can suppress expanding this response file by - // returning null. In that case, we'll treat the response - // file token as a regular argument. - - if (responseFileArguments == null) - { - yield return arg; - } - else - { - foreach (var responseFileArgument in responseFileArguments) - yield return responseFileArgument.Trim(); - } - } - } - } - - private IEnumerable ParseResponseFile(string fileName) - { - if (!HandleResponseFiles) - return null; - - if (!File.Exists(fileName)) - { - throw new InvalidOperationException(String.Format(LocalizableStrings.ResponseFileNotFoundError, fileName)); - } - - return File.ReadLines(fileName); - } - - private class CommandArgumentEnumerator : IEnumerator - { - private readonly IEnumerator _enumerator; - - public CommandArgumentEnumerator( - IEnumerator enumerator, - string commandName) - { - CommandName = commandName; - _enumerator = enumerator; - } - - public string CommandName { get; } - - public CommandArgument Current - { - get - { - return _enumerator.Current; - } - } - - object IEnumerator.Current - { - get - { - return Current; - } - } - - public void Dispose() - { - _enumerator.Dispose(); - } - - public bool MoveNext() - { - if (Current == null || !Current.MultipleValues) - { - return _enumerator.MoveNext(); - } - - // If current argument allows multiple values, we don't move forward and - // all later values will be added to current CommandArgument.Values - return true; - } - - public void Reset() - { - _enumerator.Reset(); - } - } - } -} diff --git a/src/dotnet/CommandLine/CommandLineValidationMessages.cs b/src/dotnet/CommandLine/CommandLineValidationMessages.cs deleted file mode 100644 index 1321559d5..000000000 --- a/src/dotnet/CommandLine/CommandLineValidationMessages.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Linq; - -namespace Microsoft.DotNet.Cli.CommandLine -{ - internal sealed class CommandLineValidationMessages : IValidationMessages - { - public string CommandAcceptsOnlyOneArgument(string command, int argumentCount) => - string.Format(LocalizableStrings.CommandAcceptsOnlyOneArgument, command, argumentCount); - - public string CommandAcceptsOnlyOneSubcommand(string command, string subcommandsSpecified) => - string.Format(LocalizableStrings.CommandAcceptsOnlyOneSubcommand, command, subcommandsSpecified); - - public string FileDoesNotExist(string filePath) => - string.Format(LocalizableStrings.FileDoesNotExist, filePath); - - public string NoArgumentsAllowed(string option) => - string.Format(LocalizableStrings.NoArgumentsAllowed, option); - - public string OptionAcceptsOnlyOneArgument(string option, int argumentCount) => - string.Format(LocalizableStrings.OptionAcceptsOnlyOneArgument, option, argumentCount); - - public string RequiredArgumentMissingForCommand(string command) => - string.Format(LocalizableStrings.RequiredArgumentMissingForCommand, command); - - public string RequiredArgumentMissingForOption(string option) => - string.Format(LocalizableStrings.RequiredArgumentMissingForOption, option); - - public string RequiredCommandWasNotProvided() => - string.Format(LocalizableStrings.RequiredCommandWasNotProvided); - - public string UnrecognizedArgument(string unrecognizedArg, string[] allowedValues) => - string.Format(LocalizableStrings.UnrecognizedArgument, unrecognizedArg, $"\n\t{string.Join("\n\t", allowedValues.Select(v => $"'{v}'"))}"); - - public string UnrecognizedCommandOrArgument(string arg) => - string.Format(LocalizableStrings.UnrecognizedCommandOrArgument, arg); - - public string UnrecognizedOption(string unrecognizedOption, string[] allowedValues) => - string.Format(LocalizableStrings.UnrecognizedOption, unrecognizedOption, $"\n\t{string.Join("\n\t", allowedValues.Select(v => $"'{v}'"))}"); - } -} diff --git a/src/dotnet/CommandLine/CommandOption.cs b/src/dotnet/CommandLine/CommandOption.cs deleted file mode 100644 index caed0bd77..000000000 --- a/src/dotnet/CommandLine/CommandOption.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. - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.DotNet.Cli.CommandLine -{ - internal class CommandOption - { - public CommandOption(string template, CommandOptionType optionType) - { - Template = template; - OptionType = optionType; - Values = new List(); - - foreach (var part in Template.Split(new[] { ' ', '|' }, StringSplitOptions.RemoveEmptyEntries)) - { - if (part.StartsWith("--")) - { - LongName = part.Substring(2); - } - else if (part.StartsWith("-")) - { - var optName = part.Substring(1); - - // If there is only one char and it is not an English letter, it is a symbol option (e.g. "-?") - if (optName.Length == 1 && !IsEnglishLetter(optName[0])) - { - SymbolName = optName; - } - else - { - ShortName = optName; - } - } - else if (part.StartsWith("<") && part.EndsWith(">")) - { - ValueName = part.Substring(1, part.Length - 2); - } - else if (optionType == CommandOptionType.MultipleValue && part.StartsWith("<") && part.EndsWith(">...")) - { - ValueName = part.Substring(1, part.Length - 5); - } - else - { - throw new ArgumentException(String.Format(LocalizableStrings.InvalidTemplateError, nameof(template))); - } - } - - if (string.IsNullOrEmpty(LongName) && string.IsNullOrEmpty(ShortName) && string.IsNullOrEmpty(SymbolName)) - { - throw new ArgumentException(LocalizableStrings.InvalidTemplateError, nameof(template)); - } - } - - public string Template { get; set; } - public string ShortName { get; set; } - public string LongName { get; set; } - public string SymbolName { get; set; } - public string ValueName { get; set; } - public string Description { get; set; } - public List Values { get; private set; } - public bool? BoolValue { get; private set; } - public CommandOptionType OptionType { get; private set; } - - public bool TryParse(string value) - { - switch (OptionType) - { - case CommandOptionType.MultipleValue: - Values.Add(value); - break; - case CommandOptionType.SingleValue: - if (Values.Any()) - { - return false; - } - Values.Add(value); - break; - case CommandOptionType.BoolValue: - if (Values.Any()) - { - return false; - } - - if (value == null) - { - // add null to indicate that the option was present, but had no value - Values.Add(null); - BoolValue = true; - } - else - { - bool boolValue; - if (!bool.TryParse(value, out boolValue)) - { - return false; - } - - Values.Add(value); - BoolValue = boolValue; - } - break; - case CommandOptionType.NoValue: - if (value != null) - { - return false; - } - // Add a value to indicate that this option was specified - Values.Add("on"); - break; - default: - break; - } - return true; - } - - public bool HasValue() - { - return Values.Any(); - } - - public string Value() - { - return HasValue() ? Values[0] : null; - } - - private bool IsEnglishLetter(char c) - { - return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); - } - } -} diff --git a/src/dotnet/CommandLine/CommandOptionType.cs b/src/dotnet/CommandLine/CommandOptionType.cs deleted file mode 100644 index 6cee7406b..000000000 --- a/src/dotnet/CommandLine/CommandOptionType.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - - -namespace Microsoft.DotNet.Cli.CommandLine -{ - internal enum CommandOptionType - { - MultipleValue, - SingleValue, - BoolValue, - NoValue - } -} diff --git a/src/dotnet/CommandLine/CommandParsingException.cs b/src/dotnet/CommandLine/CommandParsingException.cs deleted file mode 100644 index 82c675f4b..000000000 --- a/src/dotnet/CommandLine/CommandParsingException.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using Microsoft.DotNet.Tools; - -namespace Microsoft.DotNet.Cli.CommandLine -{ - internal class CommandParsingException : Exception - { - private readonly bool _isRequiredSubCommandMissing; - - public CommandParsingException( - string message, - string helpText = null) : base(message) - { - HelpText = helpText ?? ""; - Data.Add("CLI_User_Displayed_Exception", true); - } - - public CommandParsingException( - CommandLineApplication command, - string message, - bool isRequiredSubCommandMissing = false) - : this(message) - { - Command = command; - _isRequiredSubCommandMissing = isRequiredSubCommandMissing; - } - - public CommandLineApplication Command { get; } - - public string HelpText { get; } = ""; - - public override string Message - { - get - { - return _isRequiredSubCommandMissing - ? CommonLocalizableStrings.RequiredCommandNotPassed - : base.Message; - } - } - } -} \ No newline at end of file diff --git a/src/dotnet/CommandLine/HelpMessageStrings.cs b/src/dotnet/CommandLine/HelpMessageStrings.cs deleted file mode 100644 index 3bbd0e21a..000000000 --- a/src/dotnet/CommandLine/HelpMessageStrings.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.DotNet.Cli.CommandLine -{ - internal class HelpMessageStrings - { - internal static string MSBuildAdditionalArgsHelpText => LocalizableStrings.MSBuildAdditionalArgsHelpText; - } -} diff --git a/src/dotnet/CommandLine/LocalizableStrings.resx b/src/dotnet/CommandLine/LocalizableStrings.resx deleted file mode 100644 index b9051ddad..000000000 --- a/src/dotnet/CommandLine/LocalizableStrings.resx +++ /dev/null @@ -1,216 +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 - - - The last argument '{0}' accepts multiple values. No more argument can be added. - - - Required value for option '{0}' was not provided. - - - Unexpected value '{0}' for option '{1}' - - - Unrecognized {0} '{1}' - - - Response file '{0}' doesn't exist. - - - Show help information - - - Show version information - - - Specify --{0} for a list of available options and commands. - - - Usage: - - - [arguments] - - - Arguments: - - - [options] - - - Options: - - - [command] - - - Commands: - - - Use "{0} [command] --help" for more information about a command. - - - [args] - - - [[--] <additional arguments>...]] - - - Additional Arguments: - - - Invalid template pattern '{0}' - - - Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options. - - - Command '{0}' only accepts a single argument but {1} were provided. - - - Command '{0}' only accepts a single subcommand but multiple were provided: {1} - - - File does not exist: {0} - - - Arguments not allowed for option: {0} - - - Option '{0}' only accepts a single argument but {1} were provided. - - - Required argument missing for command: {0} - - - Required argument missing for option: {0} - - - Required command was not provided. - - - Argument '{0}' not recognized. Must be one of: {1} - - - Unrecognized command or argument '{0}' - - - Option '{0}' not recognized. Must be one of: {1} - - \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.cs.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index 529936172..000000000 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - The last argument '{0}' accepts multiple values. No more argument can be added. - Poslední argument {0} umožňuje zadat několik hodnot. Nemůžete přidat další argument. - - - - Unexpected value '{0}' for option '{1}' - Nečekaná hodnota {0} u možnosti {1} - - - - Unrecognized {0} '{1}' - Nerozpoznané {0} {1} - - - - Response file '{0}' doesn't exist. - Soubor odezvy {0} neexistuje. - - - - Show help information - Zobrazit nápovědu - - - - Show version information - Zobrazit verzi - - - - Specify --{0} for a list of available options and commands. - Pokud chcete zobrazit seznam dostupných možností a příkazů, zadejte --{0}. - - - - Usage: - Použití: - - - - [arguments] - [argumenty] - - - - Arguments: - Argumenty: - - - - [options] - [možnosti] - - - - Options: - Možnosti: - - - - [command] - [příkaz] - - - - Commands: - Příkazy: - - - - Use "{0} [command] --help" for more information about a command. - Další informace o příkazu získáte, když zadáte "{0} [příkaz] --help". - - - - [args] - [arg.] - - - - [[--] <additional arguments>...]] - [[--] <další argumenty>...]] - - - - Additional Arguments: - Další argumenty: - - - - Invalid template pattern '{0}' - Neplatný vzor šablony {0} - - - - Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options. - Další možnosti, které je možné předat MSBuildu. Dostupné možnosti zobrazíte příkazem dotnet msbuild -h. - - - - Required value for option '{0}' was not provided. - Nebyla zadána povinná hodnota parametru {0}. - - - - Command '{0}' only accepts a single argument but {1} were provided. - Příkaz {0} přijímá pouze jediný argument, ale bylo zadáno více argumentů ({1}). - - - - Command '{0}' only accepts a single subcommand but multiple were provided: {1} - Příkaz {0} přijímá pouze jediný příkaz v podnabídce, ale bylo zadáno více příkazů v podnabídce: {1}. - - - - File does not exist: {0} - Neexistující soubor: {0} - - - - Arguments not allowed for option: {0} - Pro možnost {0} nejsou argumenty povoleny. - - - - Option '{0}' only accepts a single argument but {1} were provided. - Možnost {0} přijímá pouze jediný argument, ale bylo zadáno více argumentů ({1}). - - - - Required argument missing for command: {0} - Chybí povinný argument pro příkaz: {0}. - - - - Required argument missing for option: {0} - Chybí povinný argument pro možnost: {0}. - - - - Required command was not provided. - Požadovaný příkaz nebyl zadán. - - - - Argument '{0}' not recognized. Must be one of: {1} - Argument {0} nebyl rozpoznán. Musí se jednat o jeden z těchto argumentů: {1}. - - - - Unrecognized command or argument '{0}' - Nerozpoznaný příkaz nebo argument: {0} - - - - Option '{0}' not recognized. Must be one of: {1} - Možnost {0} nebyla rozpoznána. Musí se jednat o jednu z těchto možností: {1}. - - - - - \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.de.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index d291993ff..000000000 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - The last argument '{0}' accepts multiple values. No more argument can be added. - Das letzte Argument „{0}“ akzeptiert mehrere Werte. Es kann kein weiteres Argument mehr hinzugefügt werden. - - - - Unexpected value '{0}' for option '{1}' - Unerwarteter Wert „{0}“ für Option „{1}“. - - - - Unrecognized {0} '{1}' - Nicht erkannt: {0} "{1}" - - - - Response file '{0}' doesn't exist. - Antwortdatei "{0}" ist nicht vorhanden. - - - - Show help information - Hilfeinformationen anzeigen - - - - Show version information - Versionsinformationen anzeigen - - - - Specify --{0} for a list of available options and commands. - Geben Sie "--{0}" für eine Liste verfügbarer Optionen und Befehle an. - - - - Usage: - Nutzung: - - - - [arguments] - [Argumente] - - - - Arguments: - Argumente: - - - - [options] - [Optionen] - - - - Options: - Optionen: - - - - [command] - [Befehl] - - - - Commands: - Befehle: - - - - Use "{0} [command] --help" for more information about a command. - Verwenden Sie "{0} [Befehl] --help", um weitere Informationen zu einem Befehl zu erhalten. - - - - [args] - [Argumente] - - - - [[--] <additional arguments>...]] - [[--] <zusätzliche Argumente>...]] - - - - Additional Arguments: - Zusätzliche Argumente: - - - - Invalid template pattern '{0}' - Ungültiges Vorlagenmuster „{0}“ - - - - Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options. - Alle zusätzlichen Optionen, die MSBuild übergeben werden sollen. Verfügbare Optionen siehe „dotnet msbuild -h“. - - - - Required value for option '{0}' was not provided. - Der erforderliche Wert für die Option "{0}" wurde nicht angegeben. - - - - Command '{0}' only accepts a single argument but {1} were provided. - Der Befehl "{0}" akzeptiert nur ein einzelnes Argument, es wurden aber {1} angegeben. - - - - Command '{0}' only accepts a single subcommand but multiple were provided: {1} - Der Befehl "{0}" akzeptiert nur einen einzelnen Unterbefehl, es wurden aber mehrere angegeben: {1} - - - - File does not exist: {0} - Die Datei ist nicht vorhanden: {0} - - - - Arguments not allowed for option: {0} - Nicht zulässige Argumente für die Option: {0} - - - - Option '{0}' only accepts a single argument but {1} were provided. - Die Option "{0}" akzeptiert nur ein einzelnes Argument, es wurden aber {1} angegeben. - - - - Required argument missing for command: {0} - Ein erforderliches Argument fehlt für den Befehl: {0} - - - - Required argument missing for option: {0} - Ein erforderliches Argument fehlt für die Option: {0} - - - - Required command was not provided. - Der erforderliche Befehl wurde nicht bereitgestellt. - - - - Argument '{0}' not recognized. Must be one of: {1} - Das Argument "{0}" wurde nicht erkannt. Folgendes ist erforderlich: {1} - - - - Unrecognized command or argument '{0}' - Befehl oder Argument "{0}" nicht erkannt - - - - Option '{0}' not recognized. Must be one of: {1} - Die Option "{0}" wurde nicht erkannt. Folgendes ist erforderlich: {1} - - - - - \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.es.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index e8bf947f7..000000000 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - The last argument '{0}' accepts multiple values. No more argument can be added. - El último argumento "{0}" acepta varios valores. No se pueden agregar más argumentos. - - - - Unexpected value '{0}' for option '{1}' - Valor inesperado "{0}" para la opción "{1}" - - - - Unrecognized {0} '{1}' - No se reconoció {0} "{1}" - - - - Response file '{0}' doesn't exist. - El archivo de respuesta "{0}" no existe. - - - - Show help information - Mostrar información de ayuda - - - - Show version information - Mostrar información de versión - - - - Specify --{0} for a list of available options and commands. - Especifique --{0} para obtener una lista de las opciones y los comandos disponibles. - - - - Usage: - Uso: - - - - [arguments] - [argumentos] - - - - Arguments: - Argumentos: - - - - [options] - [opciones] - - - - Options: - Opciones: - - - - [command] - [comando] - - - - Commands: - Comandos: - - - - Use "{0} [command] --help" for more information about a command. - Use "{0} [comando] --help" para más información sobre un comando. - - - - [args] - [args] - - - - [[--] <additional arguments>...]] - [[--] <argumentos adicionales>...]] - - - - Additional Arguments: - Argumentos adicionales: - - - - Invalid template pattern '{0}' - Patrón de plantilla no válido "{0}" - - - - Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options. - Toda opción adicional que se debe pasar a MSBuild. Consulte "dotnet msbuild -h" para ver las opciones disponibles. - - - - Required value for option '{0}' was not provided. - No se ha proporcionado el valor requerido para la opción "{0}". - - - - Command '{0}' only accepts a single argument but {1} were provided. - El comando "{0}" solo acepta un argumento, pero se proporcionaron {1}. - - - - Command '{0}' only accepts a single subcommand but multiple were provided: {1} - El comando "{0}" solo acepta un subcomando, pero se proporcionaron varios: {1}. - - - - File does not exist: {0} - El archivo no existe: {0} - - - - Arguments not allowed for option: {0} - No se permiten argumentos para la opción: {0} - - - - Option '{0}' only accepts a single argument but {1} were provided. - La opción "{0}" solo acepta un argumento, pero se proporcionaron {1}. - - - - Required argument missing for command: {0} - Falta un argumento necesario para el comando: {0} - - - - Required argument missing for option: {0} - Falta un argumento necesario para la opción: {0} - - - - Required command was not provided. - No se proporcionó el comando requerido. - - - - Argument '{0}' not recognized. Must be one of: {1} - No se reconoce el argumento "{0}". Debe ser uno de: {1} - - - - Unrecognized command or argument '{0}' - No se reconoce el comando o el argumento "{0}" - - - - Option '{0}' not recognized. Must be one of: {1} - No se reconoce la opción "{0}". Debe ser una de: {1} - - - - - \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.fr.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index c788f87f0..000000000 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - The last argument '{0}' accepts multiple values. No more argument can be added. - Le dernier argument '{0}' accepte plusieurs valeurs. Impossible d'ajouter des arguments supplémentaires. - - - - Unexpected value '{0}' for option '{1}' - Valeur inattendue '{0}' pour l'option '{1}' - - - - Unrecognized {0} '{1}' - {0} non reconnu : '{1}' - - - - Response file '{0}' doesn't exist. - Le fichier réponse '{0}' n'existe pas. - - - - Show help information - Afficher les informations d'aide - - - - Show version information - Afficher les informations de version - - - - Specify --{0} for a list of available options and commands. - Spécifiez --{0} pour obtenir la liste des options et commandes disponibles. - - - - Usage: - Utilisation : - - - - [arguments] - [arguments] - - - - Arguments: - Arguments : - - - - [options] - [options] - - - - Options: - Options : - - - - [command] - [commande] - - - - Commands: - Commandes : - - - - Use "{0} [command] --help" for more information about a command. - Utilisez "{0} [commande] --help" pour plus d'informations sur une commande. - - - - [args] - [args] - - - - [[--] <additional arguments>...]] - [[--] <arguments supplémentaires>...]] - - - - Additional Arguments: - Arguments supplémentaires : - - - - Invalid template pattern '{0}' - Modèle non valide '{0}' - - - - Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options. - Options supplémentaires à passer à MSBuild. Consultez 'dotnet msbuild -h' pour connaître les options disponibles. - - - - Required value for option '{0}' was not provided. - La valeur nécessaire pour l'option '{0}' n'a pas été fournie. - - - - Command '{0}' only accepts a single argument but {1} were provided. - La commande '{0}' n'accepte qu'un seul argument mais {1} d'entre eux ont été fournis. - - - - Command '{0}' only accepts a single subcommand but multiple were provided: {1} - La commande '{0}' n'accepte qu'une seule sous-commande mais plusieurs d'entre elles ont été fournies : {1} - - - - File does not exist: {0} - Le fichier n'existe pas : {0} - - - - Arguments not allowed for option: {0} - Arguments non autorisés pour l'option : {0} - - - - Option '{0}' only accepts a single argument but {1} were provided. - L'option '{0}' n'accepte qu'un seul argument mais {1} d'entre eux ont été fournis. - - - - Required argument missing for command: {0} - Argument obligatoire manquant pour la commande : {0} - - - - Required argument missing for option: {0} - Argument obligatoire manquant pour l'option : {0} - - - - Required command was not provided. - La commande nécessaire n'a pas été fournie. - - - - Argument '{0}' not recognized. Must be one of: {1} - Argument '{0}' non reconnu. Il doit faire partie de : {1} - - - - Unrecognized command or argument '{0}' - Commande ou argument non reconnu : '{0}' - - - - Option '{0}' not recognized. Must be one of: {1} - Option '{0}' non reconnue. Elle doit faire partie de : {1} - - - - - \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.it.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index 14961a263..000000000 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - The last argument '{0}' accepts multiple values. No more argument can be added. - L'ultimo argomento '{0}' accetta più valori. Non è possibile aggiungere altri argomenti. - - - - Unexpected value '{0}' for option '{1}' - Valore imprevisto '{0}' per l'opzione '{1}' - - - - Unrecognized {0} '{1}' - L'elemento {0} '{1}' non è stato riconosciuto - - - - Response file '{0}' doesn't exist. - Il file di risposta '{0}' non esiste. - - - - Show help information - Visualizza la Guida - - - - Show version information - Visualizza le informazioni sulla versione - - - - Specify --{0} for a list of available options and commands. - Per un elenco delle opzioni e dei comandi disponibili, specificare --{0}. - - - - Usage: - Utilizzo: - - - - [arguments] - [argomenti] - - - - Arguments: - Argomenti: - - - - [options] - [opzioni] - - - - Options: - Opzioni: - - - - [command] - [comando] - - - - Commands: - Comandi: - - - - Use "{0} [command] --help" for more information about a command. - Per altre informazioni su un comando, usare "{0} [comando] --help". - - - - [args] - [argomenti] - - - - [[--] <additional arguments>...]] - [[--] <argomenti aggiuntivi>...]] - - - - Additional Arguments: - Argomenti aggiuntivi: - - - - Invalid template pattern '{0}' - Criterio di modello '{0}' non valido - - - - Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options. - Eventuali opzioni aggiuntive da passare a MSBuild. Per le opzioni disponibili, vedere 'dotnet msbuild -h'. - - - - Required value for option '{0}' was not provided. - Il valore obbligatorio per l'opzione '{0}' non è stato specificato. - - - - Command '{0}' only accepts a single argument but {1} were provided. - Il comando '{0}' accetta un solo argomento, ma ne sono stati forniti {1}. - - - - Command '{0}' only accepts a single subcommand but multiple were provided: {1} - Il comando '{0}' accetta un solo sottocomando, ma ne è stato fornito più di uno: {1} - - - - File does not exist: {0} - Il file {0} non esiste - - - - Arguments not allowed for option: {0} - Argomenti non consentiti per l'opzione: {0} - - - - Option '{0}' only accepts a single argument but {1} were provided. - L'opzione '{0}' accetta un solo argomento, ma ne sono stati forniti {1}. - - - - Required argument missing for command: {0} - Manca l'argomento obbligatorio per il comando: {0} - - - - Required argument missing for option: {0} - Manca l'argomento obbligatorio per l'opzione: {0} - - - - Required command was not provided. - Il comando obbligatorio non è stato specificato. - - - - Argument '{0}' not recognized. Must be one of: {1} - L'argomento '{0}' non è riconosciuto. Deve essere uno dei seguenti: {1} - - - - Unrecognized command or argument '{0}' - Il comando o l'argomento '{0}' non è stato riconosciuto - - - - Option '{0}' not recognized. Must be one of: {1} - L'opzione '{0}' non è riconosciuta. Deve essere una delle seguenti: {1} - - - - - \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.ja.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index 50971bca9..000000000 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - The last argument '{0}' accepts multiple values. No more argument can be added. - 最後の引数 '{0}' は複数の値を受け入れます。さらに引数を追加することはできません。 - - - - Unexpected value '{0}' for option '{1}' - オプション '{1}' の予期しない値 '{0}' - - - - Unrecognized {0} '{1}' - 認識できない {0} '{1}' - - - - Response file '{0}' doesn't exist. - 応答ファイル '{0}' は存在しません。 - - - - Show help information - ヘルプ情報を表示する - - - - Show version information - バージョン情報を表示する - - - - Specify --{0} for a list of available options and commands. - 利用可能なオプションとコマンドの一覧に対して --{0} を指定します。 - - - - Usage: - 使用法: - - - - [arguments] - [arguments] - - - - Arguments: - 引数: - - - - [options] - [options] - - - - Options: - オプション: - - - - [command] - [command] - - - - Commands: - コマンド: - - - - Use "{0} [command] --help" for more information about a command. - コマンドに関する詳細情報については、"{0} [command] --help" を使用します。 - - - - [args] - [args] - - - - [[--] <additional arguments>...]] - [[--] <additional arguments>...]] - - - - Additional Arguments: - 追加引数: - - - - Invalid template pattern '{0}' - 無効なテンプレート パターン '{0}' - - - - Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options. - MSBuild に渡す必要があるすべての追加オプション。利用可能なオプションについては、'dotnet msbuild -h' をご覧ください。 - - - - Required value for option '{0}' was not provided. - オプション '{0}' に必要な値が指定されませんでした。 - - - - Command '{0}' only accepts a single argument but {1} were provided. - コマンド '{0}' は 1 つの引数のみを受け入れますが、{1} が指定されました。 - - - - Command '{0}' only accepts a single subcommand but multiple were provided: {1} - コマンド '{0}' は 1 つのサブコマンドのみを受け入れますが、複数指定されました: {1} - - - - File does not exist: {0} - ファイルが存在しません: {0} - - - - Arguments not allowed for option: {0} - 引数をオプションで使用できません: {0} - - - - Option '{0}' only accepts a single argument but {1} were provided. - オプション '{0}' は 1 つの引数のみを受け入れますが、{1} 個指定されました。 - - - - Required argument missing for command: {0} - 必要な引数がコマンドにありません: {0} - - - - Required argument missing for option: {0} - 必要な引数がオプションにありません: {0} - - - - Required command was not provided. - 必要なコマンドが指定されませんでした。 - - - - Argument '{0}' not recognized. Must be one of: {1} - 引数 '{0}' は認識されません。次のいずれかである必要があります: {1} - - - - Unrecognized command or argument '{0}' - 認識されないコマンドまたは引数 '{0}' - - - - Option '{0}' not recognized. Must be one of: {1} - オプション '{0}' は認識されません。次のいずれかである必要があります: {1} - - - - - \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.ko.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index 31d7d28bb..000000000 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - The last argument '{0}' accepts multiple values. No more argument can be added. - 마지막 인수 '{0}'은(는) 여러 값을 허용합니다. 더 이상 인수를 추가할 수 없습니다. - - - - Unexpected value '{0}' for option '{1}' - '{1}' 옵션에 대한 예기치 않은 값 '{0}' - - - - Unrecognized {0} '{1}' - 인식할 수 없는 {0} '{1}' - - - - Response file '{0}' doesn't exist. - '{0}' 응답 파일이 없습니다. - - - - Show help information - 도움말 정보 표시 - - - - Show version information - 버전 정보 표시 - - - - Specify --{0} for a list of available options and commands. - 사용 가능한 옵션 및 명령의 목록을 보려면 --{0}을(를) 지정합니다. - - - - Usage: - 사용법: - - - - [arguments] - [arguments] - - - - Arguments: - 인수: - - - - [options] - [options] - - - - Options: - 옵션: - - - - [command] - [command] - - - - Commands: - 명령: - - - - Use "{0} [command] --help" for more information about a command. - 명령에 대한 자세한 정보를 보려면 "{0} [command] --help"를 사용합니다. - - - - [args] - [args] - - - - [[--] <additional arguments>...]] - [[--] <추가 인수>...]] - - - - Additional Arguments: - 추가 인수: - - - - Invalid template pattern '{0}' - 잘못된 템플릿 패턴 '{0}' - - - - Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options. - MSBuild에 전달해야 할 추가 옵션입니다. 사용 가능한 옵션은 'dotnet msbuild -h'를 참조하세요. - - - - Required value for option '{0}' was not provided. - 옵션 '{0}'에 대해 필요한 값이 제공되지 않았습니다. - - - - Command '{0}' only accepts a single argument but {1} were provided. - ‘{0}’ 명령은 단일 인수만 허용하는데, {1}이(가) 제공되었습니다. - - - - Command '{0}' only accepts a single subcommand but multiple were provided: {1} - ‘{0}’ 명령은 단일 하위 명령만 허용하는데, 여러 하위 명령이 제공되었습니다. {1} - - - - File does not exist: {0} - 파일이 없습니다. {0} - - - - Arguments not allowed for option: {0} - 옵션에 대해 인수가 허용되지 않습니다. {0} - - - - Option '{0}' only accepts a single argument but {1} were provided. - '{0}' 옵션은 단일 인수만 허용하는데, {1}이(가) 제공되었습니다. - - - - Required argument missing for command: {0} - 명령 {0}에 대한 필수 인수가 없습니다. - - - - Required argument missing for option: {0} - 옵션 {0}에 대한 필수 인수가 없습니다. - - - - Required command was not provided. - 필수 명령을 제공하지 않았습니다. - - - - Argument '{0}' not recognized. Must be one of: {1} - '{0}' 인수를 인식할 수 없습니다. 다음 중 하나여야 합니다. {1} - - - - Unrecognized command or argument '{0}' - 인식할 수 없는 명령 또는 인수 '{0}' - - - - Option '{0}' not recognized. Must be one of: {1} - '{0}' 옵션을 인식할 수 없습니다. 다음 중 하나여야 합니다. {1} - - - - - \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.pl.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index 4b588e0db..000000000 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - The last argument '{0}' accepts multiple values. No more argument can be added. - Ostatni argument „{0}” przyjmuje wiele wartości. Nie można dodać kolejnych argumentów. - - - - Unexpected value '{0}' for option '{1}' - Nieoczekiwana wartość „{0}” dla opcji „{1}” - - - - Unrecognized {0} '{1}' - Nierozpoznany element {0} „{1}” - - - - Response file '{0}' doesn't exist. - Plik odpowiedzi „{0}” nie istnieje. - - - - Show help information - Wyświetl informacje pomocy - - - - Show version information - Wyświetl informacje o wersji - - - - Specify --{0} for a list of available options and commands. - Podaj opcję --{0}, aby uzyskać listę dostępnych opcji i poleceń. - - - - Usage: - Użycie: - - - - [arguments] - [argumenty] - - - - Arguments: - Argumenty: - - - - [options] - [opcje] - - - - Options: - Opcje: - - - - [command] - [polecenie] - - - - Commands: - Polecenia: - - - - Use "{0} [command] --help" for more information about a command. - Użyj polecenia „{0} [polecenie] --help”, aby uzyskać więcej informacji o danym poleceniu. - - - - [args] - [argumenty] - - - - [[--] <additional arguments>...]] - [[--] <dodatkowe argumenty>...]] - - - - Additional Arguments: - Dodatkowe argumenty: - - - - Invalid template pattern '{0}' - Nieprawidłowy wzorzec szablonu „{0}” - - - - Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options. - Dodatkowe opcje, które mają zostać przekazane programowi MSBuild. Uruchom polecenie „dotnet msbuild -h”, aby zapoznać się z dostępnymi opcjami. - - - - Required value for option '{0}' was not provided. - Nie podano wymaganej wartości dla opcji „{0}”. - - - - Command '{0}' only accepts a single argument but {1} were provided. - Polecenie „{0}” przyjmuje tylko jeden argument, a podano {1}. - - - - Command '{0}' only accepts a single subcommand but multiple were provided: {1} - Polecenie „{0}” przyjmuje tylko jedno polecenie podrzędne, a podano ich wiele: {1}. - - - - File does not exist: {0} - Plik nie istnieje: {0} - - - - Arguments not allowed for option: {0} - Dla tej opcji nie są dozwolone argumenty: {0} - - - - Option '{0}' only accepts a single argument but {1} were provided. - Opcja „{0}” przyjmuje tylko jeden argument, a podano {1}. - - - - Required argument missing for command: {0} - Brakuje argumentu wymaganego polecenia: {0} - - - - Required argument missing for option: {0} - Brakuje argumentu wymaganego opcji: {0} - - - - Required command was not provided. - Nie podano wymaganego polecenia. - - - - Argument '{0}' not recognized. Must be one of: {1} - Nie rozpoznano argumentu „{0}”. Musi on być jednym z tych: {1} - - - - Unrecognized command or argument '{0}' - Nierozpoznane polecenie lub argument „{0}” - - - - Option '{0}' not recognized. Must be one of: {1} - Nie rozpoznano opcji „{0}”. Musi ona być jedną z tych: {1} - - - - - \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index 474492f36..000000000 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - The last argument '{0}' accepts multiple values. No more argument can be added. - O último argumento '{0}' aceita vários valores. Nenhum outro argumento pode ser adicionado. - - - - Unexpected value '{0}' for option '{1}' - Valor '{0}' inesperado para a opção '{1}' - - - - Unrecognized {0} '{1}' - {0} não reconhecido '{1}' - - - - Response file '{0}' doesn't exist. - O arquivo de resposta '{0}' não existe. - - - - Show help information - Mostrar informações de ajuda - - - - Show version information - Mostrar informações de versão - - - - Specify --{0} for a list of available options and commands. - Especifique --{0} para obter uma lista das opções e comandos disponíveis. - - - - Usage: - Uso: - - - - [arguments] - [arguments] - - - - Arguments: - Argumentos: - - - - [options] - [options] - - - - Options: - Opções: - - - - [command] - [command] - - - - Commands: - Comandos: - - - - Use "{0} [command] --help" for more information about a command. - Use "{0} [command] --help" para obter mais informações sobre um comando. - - - - [args] - [args] - - - - [[--] <additional arguments>...]] - [[--] <additional arguments>...]] - - - - Additional Arguments: - Argumentos adicionais: - - - - Invalid template pattern '{0}' - Padrão de modelo '{0}' inválido - - - - Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options. - As opções extras que devem ser passadas para o MSBuild. Consulte 'dotnet msbuild -h' para obter as opções disponíveis. - - - - Required value for option '{0}' was not provided. - Um valor obrigatório para a opção '{0}' não foi fornecido. - - - - Command '{0}' only accepts a single argument but {1} were provided. - O comando '{0}' aceita somente um único argumento, mas {1} foram fornecidos. - - - - Command '{0}' only accepts a single subcommand but multiple were provided: {1} - O comando '{0}' aceita somente um único subcomando, mas vários foram fornecidos: {1} - - - - File does not exist: {0} - O arquivo não existe: {0} - - - - Arguments not allowed for option: {0} - Argumentos não permitidos para a opção: {0} - - - - Option '{0}' only accepts a single argument but {1} were provided. - A opção '{0}' aceita somente um único argumento, mas {1} foram fornecidos. - - - - Required argument missing for command: {0} - Argumento obrigatório ausente para o comando: {0} - - - - Required argument missing for option: {0} - Argumento obrigatório ausente para a opção: {0} - - - - Required command was not provided. - O comando necessário não foi fornecido. - - - - Argument '{0}' not recognized. Must be one of: {1} - Argumento '{0}' não reconhecido. Ele deve ser um dos seguintes: {1} - - - - Unrecognized command or argument '{0}' - Comando ou argumento '{0}' não reconhecido - - - - Option '{0}' not recognized. Must be one of: {1} - Opção '{0}' não reconhecida. Ela deve ser uma das seguintes: {1} - - - - - \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.ru.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index 2565938b9..000000000 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - The last argument '{0}' accepts multiple values. No more argument can be added. - Последний аргумент "{0}" принимает несколько значений. Добавить дополнительные аргументы нельзя. - - - - Unexpected value '{0}' for option '{1}' - Непредвиденное значение "{0}" для параметра "{1}" - - - - Unrecognized {0} '{1}' - Нераспознанное значение {0} "{1}" - - - - Response file '{0}' doesn't exist. - Файл ответов "{0}" не существует. - - - - Show help information - Показать справку - - - - Show version information - Показать информацию о версии - - - - Specify --{0} for a list of available options and commands. - Укажите --{0} для вывода списка доступных параметров и команд. - - - - Usage: - Использование: - - - - [arguments] - [аргументы] - - - - Arguments: - Аргументы: - - - - [options] - [параметры] - - - - Options: - Параметры: - - - - [command] - [команда] - - - - Commands: - Команды: - - - - Use "{0} [command] --help" for more information about a command. - Используйте синтаксис "{0} [команда] --help" для получения дополнительной информации о команде. - - - - [args] - [аргументы] - - - - [[--] <additional arguments>...]] - [[--] <дополнительные аргументы>...]] - - - - Additional Arguments: - Дополнительные аргументы: - - - - Invalid template pattern '{0}' - Недопустимая схема шаблона "{0}" - - - - Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options. - Все дополнительные параметры, которые следует передать в MSBuild. Для получения сведений о доступных параметрах см. "dotnet msbuild -h". - - - - Required value for option '{0}' was not provided. - Не указано обязательное значение параметра "{0}". - - - - Command '{0}' only accepts a single argument but {1} were provided. - Команда "{0}" принимает только один аргумент, но указано несколько аргументов: {1}. - - - - Command '{0}' only accepts a single subcommand but multiple were provided: {1} - Команда "{0}" принимает только одну подкоманду, но указано несколько подкоманд: {1}. - - - - File does not exist: {0} - Файл не существует: {0} - - - - Arguments not allowed for option: {0} - Аргументы для параметра не допускаются: {0} - - - - Option '{0}' only accepts a single argument but {1} were provided. - Параметр "{0}" принимает только один аргумент, но указано несколько аргументов: {1}. - - - - Required argument missing for command: {0} - Отсутствует обязательный аргумент для команды: {0} - - - - Required argument missing for option: {0} - Отсутствует обязательный аргумент для параметра: {0} - - - - Required command was not provided. - Обязательная команда не указана. - - - - Argument '{0}' not recognized. Must be one of: {1} - Аргумент "{0}" не распознан. Он должен быть одним из следующих: {1} - - - - Unrecognized command or argument '{0}' - Нераспознанная команда или аргумент "{0}" - - - - Option '{0}' not recognized. Must be one of: {1} - Параметр "{0}" не распознан. Он должен быть одним из следующих: {1} - - - - - \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.tr.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index ac2ef1d79..000000000 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - The last argument '{0}' accepts multiple values. No more argument can be added. - Son bağımsız değişken ('{0}') birden çok değer kabul ediyor. Daha fazla bağımsız değişken eklenemez. - - - - Unexpected value '{0}' for option '{1}' - '{1}' seçeneği için beklenmeyen değer: '{0}' - - - - Unrecognized {0} '{1}' - Tanınmayan {0} '{1}' - - - - Response file '{0}' doesn't exist. - Yanıt dosyası '{0}' yok. - - - - Show help information - Yardım bilgilerini göster - - - - Show version information - Sürüm bilgilerini göster - - - - Specify --{0} for a list of available options and commands. - Kullanılabilir seçenek ve komutların listesi için --{0} belirtin. - - - - Usage: - Kullanım: - - - - [arguments] - [bağımsız değişkenler] - - - - Arguments: - Bağımsız değişkenler: - - - - [options] - [seçenekler] - - - - Options: - Seçenekler: - - - - [command] - [komut] - - - - Commands: - Komutlar: - - - - Use "{0} [command] --help" for more information about a command. - Bir komut hakkında daha fazla bilgi almak için "{0} [komut] --help" kullanın. - - - - [args] - [bağımsız değişkenler] - - - - [[--] <additional arguments>...]] - [[--] <ek bağımsız değişkenler>...]] - - - - Additional Arguments: - Ek Bağımsız Değişkenler: - - - - Invalid template pattern '{0}' - Geçersiz şablon deseni: '{0}' - - - - Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options. - MSBuild’e geçirilmesi gereken ek seçenekler. Kullanılabilir seçenekler için bkz. 'dotnet msbuild -h'. - - - - Required value for option '{0}' was not provided. - '{0}' seçeneği için gerekli değer sağlanmadı. - - - - Command '{0}' only accepts a single argument but {1} were provided. - '{0}' komutu yalnızca bir bağımsız değişken kabul ediyor ancak {1} bağımsız değişken sağlandı. - - - - Command '{0}' only accepts a single subcommand but multiple were provided: {1} - '{0}' komutu yalnızca bir alt komut kabul ediyor ancak birden çok sağlandı: {1} - - - - File does not exist: {0} - Dosya yok: {0} - - - - Arguments not allowed for option: {0} - Seçenek için bağımsız değişkenlere izin verilmiyor: {0} - - - - Option '{0}' only accepts a single argument but {1} were provided. - '{0}' seçeneği yalnızca bir bağımsız değişken kabul ediyor ancak {1} bağımsız değişken sağlandı. - - - - Required argument missing for command: {0} - Komut için gerekli bağımsız değişken eksik: {0} - - - - Required argument missing for option: {0} - Seçenek için gerekli bağımsız değişken eksik: {0} - - - - Required command was not provided. - Gerekli komut sağlanmadı. - - - - Argument '{0}' not recognized. Must be one of: {1} - '{0}' bağımsız değişkeni tanınmıyor. Şunlardan biri olmalıdır: {1} - - - - Unrecognized command or argument '{0}' - Tanınmayan komut veya bağımsız değişken: '{0}' - - - - Option '{0}' not recognized. Must be one of: {1} - '{0}' seçeneği tanınmıyor. Şunlardan biri olmalıdır: {1} - - - - - \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.xlf deleted file mode 100644 index d03aa645b..000000000 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - The last argument '{0}' accepts multiple values. No more argument can be added. - - - - Unexpected value '{0}' for option '{1}' - - - - Unrecognized {0} '{1}' - - - - Response file '{0}' doesn't exist. - - - - Show help information - - - - Show version information - - - - Specify --{0} for a list of available options and commands. - - - - Usage: - - - - [arguments] - - - - Arguments: - - - - [options] - - - - Options: - - - - [command] - - - - Commands: - - - - Use "{0} [command] --help" for more information about a command. - - - - [args] - - - - [[--] <additional arguments>...]] - - - - Additional Arguments: - - - - Invalid template pattern '{0}' - - - - Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options. - - - - Required value for option '{0}' was not provided. - - - - - \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index 1df688e04..000000000 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - The last argument '{0}' accepts multiple values. No more argument can be added. - 最后一个参数“{0}”接受多个值。不能再添加任何参数。 - - - - Unexpected value '{0}' for option '{1}' - 选项“{1}”的意外值“{0}” - - - - Unrecognized {0} '{1}' - 未识别的 {0}“{1}” - - - - Response file '{0}' doesn't exist. - 响应文件“{0}”不存在。 - - - - Show help information - 显示帮助信息 - - - - Show version information - 显示版本信息 - - - - Specify --{0} for a list of available options and commands. - 为可用选项和命令的列表指定 --{0}。 - - - - Usage: - 使用情况: - - - - [arguments] - [参数] - - - - Arguments: - 参数: - - - - [options] - [选项] - - - - Options: - 选项: - - - - [command] - [命令] - - - - Commands: - 命令: - - - - Use "{0} [command] --help" for more information about a command. - 使用“{0} [命令] -- help”获取有关命令的详细信息。 - - - - [args] - [参数] - - - - [[--] <additional arguments>...]] - [[--] <附加参数>...]] - - - - Additional Arguments: - 附加参数: - - - - Invalid template pattern '{0}' - 无效模板模式“{0}” - - - - Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options. - 应传递到 MSBuild 的任何额外选项。请参阅“dotnet msbuild -h”以了解可用选项。 - - - - Required value for option '{0}' was not provided. - 未提供选项“{0}”必需的值。 - - - - Command '{0}' only accepts a single argument but {1} were provided. - 命令“{0}”仅接受一个参数但 {1} 已提供。 - - - - Command '{0}' only accepts a single subcommand but multiple were provided: {1} - 命令“{0}”仅接受一个子命令但已提供多个子命令: {1} - - - - File does not exist: {0} - 文件不存在: {0} - - - - Arguments not allowed for option: {0} - 选项不允许参数: {0} - - - - Option '{0}' only accepts a single argument but {1} were provided. - 选项“{0}”仅接受一个参数但 {1} 已提供。 - - - - Required argument missing for command: {0} - 命令缺少所需参数: {0} - - - - Required argument missing for option: {0} - 选项缺少所需参数: {0} - - - - Required command was not provided. - 未提供必需的命令。 - - - - Argument '{0}' not recognized. Must be one of: {1} - 未识别参数“{0}”。必须为一个: {1} - - - - Unrecognized command or argument '{0}' - 未识别命令或参数“{0}” - - - - Option '{0}' not recognized. Must be one of: {1} - 未识别选项“{0}”。必须为一个: {1} - - - - - \ No newline at end of file diff --git a/src/dotnet/CommandLine/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/CommandLine/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index f3ed08ca1..000000000 --- a/src/dotnet/CommandLine/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - The last argument '{0}' accepts multiple values. No more argument can be added. - 最後一個引數 '{0}' 接受多個值。無法再新增更多引數。 - - - - Unexpected value '{0}' for option '{1}' - 選項 '{1}' 有未預期的值 '{0}' - - - - Unrecognized {0} '{1}' - 無法辨識的 {0} '{1}' - - - - Response file '{0}' doesn't exist. - 回應檔 '{0}' 不存在。 - - - - Show help information - 顯示說明資訊 - - - - Show version information - 顯示版本資訊 - - - - Specify --{0} for a list of available options and commands. - 指定 --{0} 取得可用選項及命令的清單。 - - - - Usage: - 使用方式: - - - - [arguments] - [引數] - - - - Arguments: - 引數: - - - - [options] - [選項] - - - - Options: - 選項: - - - - [command] - [命令] - - - - Commands: - 命令: - - - - Use "{0} [command] --help" for more information about a command. - 使用 "{0} [命令] --help" 取得命令的詳細資訊。 - - - - [args] - [args] - - - - [[--] <additional arguments>...]] - [[--] <其他引數>...]] - - - - Additional Arguments: - 其他引數: - - - - Invalid template pattern '{0}' - 範本模式 '{0}' 無效 - - - - Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options. - 應傳遞至 MSBuild 的任何其他選項。如需可用的選項,請參閱 'dotnet msbuild -h'。 - - - - Required value for option '{0}' was not provided. - 未對選項 '{0}' 提供必要的值。 - - - - Command '{0}' only accepts a single argument but {1} were provided. - 命令 '{0}' 只接受單一引數,但提供了 {1} 個引數。 - - - - Command '{0}' only accepts a single subcommand but multiple were provided: {1} - 命令 '{0}' 只接受單一子命令,但提供了多個子命令: {1} - - - - File does not exist: {0} - 檔案不存在: {0} - - - - Arguments not allowed for option: {0} - 選項不允許的引數: {0} - - - - Option '{0}' only accepts a single argument but {1} were provided. - 選項 '{0}' 只接受單一引數,但提供了 {1} 個引數。 - - - - Required argument missing for command: {0} - 命令遺漏必要引數: {0} - - - - Required argument missing for option: {0} - 選項遺漏必要引數: {0} - - - - Required command was not provided. - 未提供所需的命令。 - - - - Argument '{0}' not recognized. Must be one of: {1} - 無法辨識引數 '{0}'。必須為下列之一: {1} - - - - Unrecognized command or argument '{0}' - 無法辨識的命令或引數 '{0}' - - - - Option '{0}' not recognized. Must be one of: {1} - 無法辨識選項 '{0}'。必須為下列之一: {1} - - - - - \ No newline at end of file diff --git a/src/dotnet/CommonLocalizableStrings.resx b/src/dotnet/CommonLocalizableStrings.resx deleted file mode 100644 index d165ca59e..000000000 --- a/src/dotnet/CommonLocalizableStrings.resx +++ /dev/null @@ -1,523 +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 - - - Unsupported project type. Please check with your sdk provider. - - - Project already has a reference to `{0}`. - - - Project reference `{0}` could not be found. - - - Project reference `{0}` removed. - - - Project - - - Project file - - - Reference - - - Project reference - - - Project reference(s) - - - Package reference - - - Project to Project - - - Project to Project reference - - - Package - - - Solution - - - Solution file - - - Executable - - - Library - - - Program - - - Application - - - Reference `{0}` added to the project. - - - Add - - - Remove - - - Delete - - - Update - - - New - - - List - - - Load - - - Save - - - Find - - - Error - - - Warning - - - File - - - Directory - - - Type - - - Value - - - Group - - - {0} added to {1}. - - - {0} removed from {1}. - - - {0} deleted from {1}. - - - {0} successfully updated. - - - {0} is invalid. - - - {0} `{1}` found but is invalid. - - - `{0}` found but is invalid. - - - Operation is invalid. - - - Operation {0} is invalid. - - - {0} not found. - - - {0} or {1} not found. - - - {0} or {1} not found in `{2}`. - - - File `{0}` not found. - - - {0} does not exist. - - - {0} `{1}` does not exist. - - - More than one {0} found. - - - {0} already contains {1}. - - - {0} already contains {1} `{2}`. - - - {0} already has {1}. - - - {0} already has {1} `{2}`. - - - {0} was not expected. - - - {0} not provided. - - - Please specify at least one {0}. - - - Could not connect with the server. - - - Required argument {0} is invalid. - - - Option {0} is invalid. - - - Argument {0} is invalid. - - - Required argument {0} was not provided. - - - Required command was not provided. - - - Could not find any project in `{0}`. - - - Could not find project or directory `{0}`. - - - Found more than one project in `{0}`. Please specify which one to use. - - - Found a project `{0}` but it is invalid. - - - Invalid project `{0}`. - - - Invalid project `{0}`. {1}. - - - Specified solution file {0} does not exist, or there is no solution file in the directory. - - - Could not find solution or directory `{0}`. - - - Found more than one solution file in {0}. Please specify which one to use. - - - Invalid solution `{0}`. {1}. - - - Specified solution file {0} does not exist, or there is no solution file in the directory. - - - Reference {0} does not exist. - - - Reference `{0}` is invalid. - - - You must specify at least one reference to add. - - - Package reference `{0}` does not exist. - - - Package reference `{0}` is invalid. - - - You must specify at least one package to add. - - - Package reference `{0}` added to the project. - - - Project {0} already has a reference `{1}`. - - - Please specify a version of the package. - - - Project `{0}` does not exist. - - - Project `{0}` is invalid. - - - You must specify at least one project to add. - - - Project `{0}` added to the solution. - - - Solution {0} already contains project {1}. - - - Specified reference {0} does not exist in project {1}. - - - Reference `{0}` deleted from the project. - - - You must specify at least one reference to remove. - - - Reference `{0}` deleted. - - - Package reference `{0}` could not be found in the project. - - - Reference `{0}` deleted from the project. - - - You must specify at least one package reference to remove. - - - Package reference `{0}` deleted. - - - Project `{0}` could not be found in the solution. - - - Project `{0}` removed from solution. - - - You must specify at least one project to remove. - - - Project `{0}` deleted from solution. - - - There are no {0} references in project {1}. ;; {0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). - - - No projects found in the solution. - - - The project or solution to operation on. If a file is not specified, the current directory is searched. - - - The project file to operate on. If a file is not specified, the command will search the current directory for one. - - - Solution file to operate on. If not specified, the command will search the current directory for one. - - - SLN_FILE - - - PROJECT - - - FRAMEWORK - - - Please specify new version of the package. - - - Please specify which package to update. - - - Nothing to update. - - - Everything is already up-to-date. - - - Version of package `{0}` updated to `{1}`. - - - Version of package `{0}` updated. - - - Could not update the version of the package `{0}`. - - - The template {0} created successfully. Please run "dotnet restore" to get started! - - - The template {0} installed successfully. You can use "dotnet new {0}" to get started with the new template. - - - Template {0} could not be created. Error returned was: {1}. - - - Template {0} could not be installed. Error returned was: {1}. - - - Specified name {0} already exists. Please specify a different name. - - - Specified alias {0} already exists. Please specify a different alias. - - - Mandatory parameter {0} missing for template {1}. - - - Project `{0}` cannot be added due to incompatible targeted frameworks between the two projects. Please review the project you are trying to add and verify that is compatible with the following targets: - - - Project `{0}` does not target framework `{1}`. - - - Project `{0}` could not be evaluated. Evaluation failed with following error: -{1}. - - - Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. - - - Target framework to publish for. The target framework has to be specified in the project file. - - - Publish the project for a given runtime. This is used when creating self-contained deployment. Default is to publish a framework-dependent app. - - - Configuration to use for building the project. Default for most projects is "Debug". - - - Defines the value for the $(VersionSuffix) property in the project. - - - Show help information. - - - Does not do an implicit restore when executing the command. - - \ No newline at end of file diff --git a/src/dotnet/CommonOptions.cs b/src/dotnet/CommonOptions.cs deleted file mode 100644 index bcd3b2268..000000000 --- a/src/dotnet/CommonOptions.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.IO; -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Tools.Common; -using Microsoft.DotNet.Tools; - -namespace Microsoft.DotNet.Cli -{ - internal static class CommonOptions - { - public static Option HelpOption() => - Create.Option( - "-h|--help", - CommonLocalizableStrings.ShowHelpDescription, - Accept.NoArguments()); - - public static Option VerbosityOption() => - Create.Option( - "-v|--verbosity", - CommonLocalizableStrings.VerbosityOptionDescription, - Accept.AnyOneOf( - "q", "quiet", - "m", "minimal", - "n", "normal", - "d", "detailed", - "diag", "diagnostic") - .ForwardAsSingle(o => $"/verbosity:{o.Arguments.Single()}")); - - public static Option FrameworkOption() => - Create.Option( - "-f|--framework", - CommonLocalizableStrings.FrameworkOptionDescription, - Accept.ExactlyOneArgument() - .WithSuggestionsFrom(_ => Suggest.TargetFrameworksFromProjectFile()) - .With(name: "FRAMEWORK") - .ForwardAsSingle(o => $"/p:TargetFramework={o.Arguments.Single()}")); - - public static Option RuntimeOption() => - Create.Option( - "-r|--runtime", - CommonLocalizableStrings.RuntimeOptionDescription, - Accept.ExactlyOneArgument() - .WithSuggestionsFrom(_ => Suggest.RunTimesFromProjectFile()) - .With(name: "RUNTIME_IDENTIFIER") - .ForwardAsSingle(o => $"/p:RuntimeIdentifier={o.Arguments.Single()}")); - - public static Option ConfigurationOption() => - Create.Option( - "-c|--configuration", - CommonLocalizableStrings.ConfigurationOptionDescription, - Accept.ExactlyOneArgument() - .With(name: "CONFIGURATION") - .WithSuggestionsFrom("DEBUG", "RELEASE") - .ForwardAsSingle(o => $"/p:Configuration={o.Arguments.Single()}")); - - public static Option VersionSuffixOption() => - Create.Option( - "--version-suffix", - CommonLocalizableStrings.CmdVersionSuffixDescription, - Accept.ExactlyOneArgument() - .With(name: "VERSION_SUFFIX") - .ForwardAsSingle(o => $"/p:VersionSuffix={o.Arguments.Single()}")); - - public static ArgumentsRule DefaultToCurrentDirectory(this ArgumentsRule rule) => - rule.With(defaultValue: () => PathUtility.EnsureTrailingSlash(Directory.GetCurrentDirectory())); - - public static Option NoRestoreOption() => - Create.Option( - "--no-restore", - CommonLocalizableStrings.NoRestoreDescription, - Accept.NoArguments()); - } -} \ No newline at end of file diff --git a/src/dotnet/DotNetCommandFactory.cs b/src/dotnet/DotNetCommandFactory.cs deleted file mode 100644 index d9c17b639..000000000 --- a/src/dotnet/DotNetCommandFactory.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using Microsoft.DotNet.Cli.Utils; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Cli -{ - public class DotNetCommandFactory : ICommandFactory - { - private bool _alwaysRunOutOfProc; - - public DotNetCommandFactory(bool alwaysRunOutOfProc = false) - { - _alwaysRunOutOfProc = alwaysRunOutOfProc; - } - - public ICommand Create( - string commandName, - IEnumerable args, - NuGetFramework framework = null, - string configuration = Constants.DefaultConfiguration) - { - BuiltInCommandMetadata builtInCommand; - if (!_alwaysRunOutOfProc && Program.TryGetBuiltInCommand(commandName, out builtInCommand)) - { - Debug.Assert(framework == null, "BuiltInCommand doesn't support the 'framework' argument."); - Debug.Assert(configuration == Constants.DefaultConfiguration, "BuiltInCommand doesn't support the 'configuration' argument."); - - return new BuiltInCommand(commandName, args, builtInCommand.Command); - } - - return Command.CreateDotNet(commandName, args, framework, configuration); - } - } -} diff --git a/src/dotnet/DotNetTopLevelCommandBase.cs b/src/dotnet/DotNetTopLevelCommandBase.cs deleted file mode 100644 index bc2fba3f3..000000000 --- a/src/dotnet/DotNetTopLevelCommandBase.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Tools; - -namespace Microsoft.DotNet.Cli -{ - public abstract class DotNetTopLevelCommandBase - { - protected abstract string CommandName { get; } - protected abstract string FullCommandNameLocalized { get; } - protected abstract string ArgumentName { get; } - protected abstract string ArgumentDescriptionLocalized { get; } - protected ParseResult ParseResult { get; private set; } - - internal abstract Dictionary> SubCommands { get; } - - public int RunCommand(string[] args) - { - DebugHelper.HandleDebugSwitch(ref args); - - var parser = Parser.Instance; - - ParseResult = parser.ParseFrom($"dotnet {CommandName}", args); - - ParseResult.ShowHelpIfRequested(); - - var subcommandName = ParseResult.Command().Name; - - try - { - var create = SubCommands[subcommandName]; - - var command = create(ParseResult["dotnet"][CommandName]); - - return command.Execute(); - } - catch (KeyNotFoundException) - { - return ReportError(CommonLocalizableStrings.RequiredCommandNotPassed); - } - catch (GracefulException e) - { - return ReportError(e.Message); - } - } - - private int ReportError(string errorMessage) - { - Reporter.Error.WriteLine(errorMessage.Red()); - ParseResult.ShowHelp(); - return 1; - } - } -} \ No newline at end of file diff --git a/src/dotnet/ForwardingApp.cs b/src/dotnet/ForwardingApp.cs deleted file mode 100644 index 25d3cff58..000000000 --- a/src/dotnet/ForwardingApp.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Cli.Utils; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; - -namespace Microsoft.DotNet.Cli -{ - public class ForwardingApp - { - private ForwardingAppImplementation _implementation; - - public ForwardingApp( - string forwardApplicationPath, - IEnumerable argsToForward, - string depsFile = null, - string runtimeConfig = null, - string additionalProbingPath = null, - Dictionary environmentVariables = null) - { - _implementation = new ForwardingAppImplementation( - forwardApplicationPath, - argsToForward, - depsFile, - runtimeConfig, - additionalProbingPath, - environmentVariables); - } - - public ProcessStartInfo GetProcessStartInfo() - { - return _implementation.GetProcessStartInfo(); - } - - public ForwardingApp WithEnvironmentVariable(string name, string value) - { - _implementation = _implementation.WithEnvironmentVariable(name, value); - return this; - } - - public int Execute() - { - return _implementation.Execute(); - } - } -} diff --git a/src/dotnet/HelpException.cs b/src/dotnet/HelpException.cs deleted file mode 100644 index f1f9eb5b4..000000000 --- a/src/dotnet/HelpException.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.Cli -{ - /// - /// Allows control flow to be interrupted in order to display help in the console. - /// - public class HelpException : Exception - { - public HelpException(string message) : base(message) - { - Data.Add(ExceptionExtensions.CLI_User_Displayed_Exception, true); - } - } -} \ No newline at end of file diff --git a/src/dotnet/ICommandRunner.cs b/src/dotnet/ICommandRunner.cs deleted file mode 100644 index 376d13fba..000000000 --- a/src/dotnet/ICommandRunner.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; - -namespace Microsoft.DotNet.Cli -{ - public interface ICommandRunner - { - int Run(string[] commandArgs); - } -} diff --git a/src/dotnet/MsbuildProject.cs b/src/dotnet/MsbuildProject.cs deleted file mode 100644 index 860d38799..000000000 --- a/src/dotnet/MsbuildProject.cs +++ /dev/null @@ -1,278 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Microsoft.Build.Construction; -using Microsoft.Build.Evaluation; -using Microsoft.Build.Exceptions; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Tools.Common; -using Microsoft.DotNet.Tools.ProjectExtensions; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Tools -{ - internal class MsbuildProject - { - const string ProjectItemElementType = "ProjectReference"; - - public ProjectRootElement ProjectRootElement { get; private set; } - public string ProjectDirectory { get; private set; } - - private ProjectCollection _projects; - private List _cachedTfms = null; - private IEnumerable cachedRuntimeIdentifiers; - - private MsbuildProject(ProjectCollection projects, ProjectRootElement project) - { - _projects = projects; - ProjectRootElement = project; - ProjectDirectory = PathUtility.EnsureTrailingSlash(ProjectRootElement.DirectoryPath); - } - - public static MsbuildProject FromFileOrDirectory(ProjectCollection projects, string fileOrDirectory) - { - if (File.Exists(fileOrDirectory)) - { - return FromFile(projects, fileOrDirectory); - } - else - { - return FromDirectory(projects, fileOrDirectory); - } - } - - public static MsbuildProject FromFile(ProjectCollection projects, string projectPath) - { - if (!File.Exists(projectPath)) - { - throw new GracefulException(CommonLocalizableStrings.ProjectDoesNotExist, projectPath); - } - - var project = TryOpenProject(projects, projectPath); - if (project == null) - { - throw new GracefulException(CommonLocalizableStrings.ProjectIsInvalid, projectPath); - } - - return new MsbuildProject(projects, project); - } - - public static MsbuildProject FromDirectory(ProjectCollection projects, string projectDirectory) - { - FileInfo projectFile = GetProjectFileFromDirectory(projectDirectory); - - var project = TryOpenProject(projects, projectFile.FullName); - if (project == null) - { - throw new GracefulException(CommonLocalizableStrings.FoundInvalidProject, projectFile.FullName); - } - - return new MsbuildProject(projects, project); - } - - public static FileInfo GetProjectFileFromDirectory(string projectDirectory) - { - DirectoryInfo dir; - try - { - dir = new DirectoryInfo(projectDirectory); - } - catch (ArgumentException) - { - throw new GracefulException(CommonLocalizableStrings.CouldNotFindProjectOrDirectory, projectDirectory); - } - - if (!dir.Exists) - { - throw new GracefulException(CommonLocalizableStrings.CouldNotFindProjectOrDirectory, projectDirectory); - } - - FileInfo[] files = dir.GetFiles("*proj"); - if (files.Length == 0) - { - throw new GracefulException( - CommonLocalizableStrings.CouldNotFindAnyProjectInDirectory, - projectDirectory); - } - - if (files.Length > 1) - { - throw new GracefulException(CommonLocalizableStrings.MoreThanOneProjectInDirectory, projectDirectory); - } - - return files.First(); - } - - public int AddProjectToProjectReferences(string framework, IEnumerable refs) - { - int numberOfAddedReferences = 0; - - ProjectItemGroupElement itemGroup = ProjectRootElement.FindUniformOrCreateItemGroupWithCondition( - ProjectItemElementType, - framework); - foreach (var @ref in refs.Select((r) => PathUtility.GetPathWithBackSlashes(r))) - { - if (ProjectRootElement.HasExistingItemWithCondition(framework, @ref)) - { - Reporter.Output.WriteLine(string.Format( - CommonLocalizableStrings.ProjectAlreadyHasAreference, - @ref)); - continue; - } - - numberOfAddedReferences++; - itemGroup.AppendChild(ProjectRootElement.CreateItemElement(ProjectItemElementType, @ref)); - - Reporter.Output.WriteLine(string.Format(CommonLocalizableStrings.ReferenceAddedToTheProject, @ref)); - } - - return numberOfAddedReferences; - } - - public int RemoveProjectToProjectReferences(string framework, IEnumerable refs) - { - int totalNumberOfRemovedReferences = 0; - - foreach (var @ref in refs) - { - totalNumberOfRemovedReferences += RemoveProjectToProjectReferenceAlternatives(framework, @ref); - } - - return totalNumberOfRemovedReferences; - } - - public IEnumerable GetProjectToProjectReferences() - { - return ProjectRootElement.GetAllItemsWithElementType(ProjectItemElementType); - } - - public IEnumerable GetRuntimeIdentifiers() - { - return cachedRuntimeIdentifiers ?? - (cachedRuntimeIdentifiers = GetEvaluatedProject().GetRuntimeIdentifiers()); - } - - public IEnumerable GetTargetFrameworks() - { - if (_cachedTfms != null) - { - return _cachedTfms; - } - - var project = GetEvaluatedProject(); - _cachedTfms = project.GetTargetFrameworks().ToList(); - return _cachedTfms; - } - - public bool CanWorkOnFramework(NuGetFramework framework) - { - foreach (var tfm in GetTargetFrameworks()) - { - if (DefaultCompatibilityProvider.Instance.IsCompatible(framework, tfm)) - { - return true; - } - } - - return false; - } - - public bool IsTargetingFramework(NuGetFramework framework) - { - foreach (var tfm in GetTargetFrameworks()) - { - if (framework.Equals(tfm)) - { - return true; - } - } - - return false; - } - - private Project GetEvaluatedProject() - { - try - { - return _projects.LoadProject(ProjectRootElement.FullPath); - } - catch (InvalidProjectFileException e) - { - throw new GracefulException(string.Format( - CommonLocalizableStrings.ProjectCouldNotBeEvaluated, - ProjectRootElement.FullPath, e.Message)); - } - } - - private int RemoveProjectToProjectReferenceAlternatives(string framework, string reference) - { - int numberOfRemovedRefs = 0; - foreach (var r in GetIncludeAlternativesForRemoval(reference)) - { - foreach (var existingItem in ProjectRootElement.FindExistingItemsWithCondition(framework, r)) - { - ProjectElementContainer itemGroup = existingItem.Parent; - itemGroup.RemoveChild(existingItem); - if (itemGroup.Children.Count == 0) - { - itemGroup.Parent.RemoveChild(itemGroup); - } - - numberOfRemovedRefs++; - Reporter.Output.WriteLine(string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, r)); - } - } - - if (numberOfRemovedRefs == 0) - { - Reporter.Output.WriteLine(string.Format( - CommonLocalizableStrings.ProjectReferenceCouldNotBeFound, - reference)); - } - - return numberOfRemovedRefs; - } - - // Easiest way to explain rationale for this function is on the example. Let's consider following directory structure: - // .../a/b/p.proj - // .../a/d/ref.proj - // .../a/e/f/ - // Project = /some/path/a/b/p.proj - // - // We do not know the format of passed reference so - // path references to consider for removal are following: - // - full path to ref.proj [/some/path/a/d/ref.proj] - // - string which is passed as reference is relative to project [../d/ref.proj] - // - string which is passed as reference is relative to current dir [../../d/ref.proj] - private IEnumerable GetIncludeAlternativesForRemoval(string reference) - { - // We do not care about duplicates in case when i.e. reference is already full path - var ret = new List(); - ret.Add(reference); - - string fullPath = Path.GetFullPath(reference); - ret.Add(fullPath); - ret.Add(PathUtility.GetRelativePath(ProjectDirectory, fullPath)); - - return ret; - } - - // There is ProjectRootElement.TryOpen but it does not work as expected - // I.e. it returns null for some valid projects - private static ProjectRootElement TryOpenProject(ProjectCollection projects, string filename) - { - try - { - return ProjectRootElement.Open(filename, projects, preserveFormatting: true); - } - catch (InvalidProjectFileException) - { - return null; - } - } - } -} diff --git a/src/dotnet/MsbuildProjectExtensions.cs b/src/dotnet/MsbuildProjectExtensions.cs deleted file mode 100644 index 06192e864..000000000 --- a/src/dotnet/MsbuildProjectExtensions.cs +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.Build.Construction; -using Microsoft.DotNet.ProjectJsonMigration; -using Microsoft.DotNet.Tools.Common; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.DotNet.Tools -{ - internal static class MsbuildProjectExtensions - { - public static bool IsConditionalOnFramework(this ProjectElement el, string framework) - { - string conditionStr; - if (!TryGetFrameworkConditionString(framework, out conditionStr)) - { - return el.ConditionChain().Count == 0; - } - - var condChain = el.ConditionChain(); - return condChain.Count == 1 && condChain.First().Trim() == conditionStr; - } - - public static ProjectItemGroupElement LastItemGroup(this ProjectRootElement root) - { - return root.ItemGroupsReversed.FirstOrDefault(); - } - - public static ProjectItemGroupElement FindUniformOrCreateItemGroupWithCondition(this ProjectRootElement root, string projectItemElementType, string framework) - { - var lastMatchingItemGroup = FindExistingUniformItemGroupWithCondition(root, projectItemElementType, framework); - - if (lastMatchingItemGroup != null) - { - return lastMatchingItemGroup; - } - - ProjectItemGroupElement ret = root.CreateItemGroupElement(); - string condStr; - if (TryGetFrameworkConditionString(framework, out condStr)) - { - ret.Condition = condStr; - } - - root.InsertAfterChild(ret, root.LastItemGroup()); - return ret; - } - - public static ProjectItemGroupElement FindExistingUniformItemGroupWithCondition(this ProjectRootElement root, string projectItemElementType, string framework) - { - return root.ItemGroupsReversed.FirstOrDefault((itemGroup) => itemGroup.IsConditionalOnFramework(framework) && itemGroup.IsUniformItemElementType(projectItemElementType)); - } - - public static bool IsUniformItemElementType(this ProjectItemGroupElement group, string projectItemElementType) - { - return group.Items.All((it) => it.ItemType == projectItemElementType); - } - - public static IEnumerable FindExistingItemsWithCondition(this ProjectRootElement root, string framework, string include) - { - return root.Items.Where((el) => el.IsConditionalOnFramework(framework) && el.HasInclude(include)); - } - - public static bool HasExistingItemWithCondition(this ProjectRootElement root, string framework, string include) - { - return root.FindExistingItemsWithCondition(framework, include).Count() != 0; - } - - public static IEnumerable GetAllItemsWithElementType(this ProjectRootElement root, string projectItemElementType) - { - return root.Items.Where((it) => it.ItemType == projectItemElementType); - } - - public static bool HasInclude(this ProjectItemElement el, string include) - { - include = NormalizeIncludeForComparison(include); - foreach (var i in el.Includes()) - { - if (include == NormalizeIncludeForComparison(i)) - { - return true; - } - } - - return false; - } - - private static bool TryGetFrameworkConditionString(string framework, out string condition) - { - if (string.IsNullOrEmpty(framework)) - { - condition = null; - return false; - } - - condition = $"'$(TargetFramework)' == '{framework}'"; - return true; - } - - private static string NormalizeIncludeForComparison(string include) - { - return PathUtility.GetPathWithBackSlashes(include.ToLower()); - } - } -} diff --git a/src/dotnet/MulticoreJitActivator.cs b/src/dotnet/MulticoreJitActivator.cs deleted file mode 100644 index c222bab4c..000000000 --- a/src/dotnet/MulticoreJitActivator.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Runtime.Loader; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Tools.Common; - -namespace Microsoft.DotNet.Cli -{ - public class MulticoreJitActivator - { - public bool TryActivateMulticoreJit() - { - var disableMulticoreJit = IsMulticoreJitDisabled(); - - if (disableMulticoreJit) - { - return false; - } - - StartCliProfileOptimization(); - - return true; - } - - private bool IsMulticoreJitDisabled() - { - return Env.GetEnvironmentVariableAsBool("DOTNET_DISABLE_MULTICOREJIT"); - } - - private void StartCliProfileOptimization() - { - var profileOptimizationRootPath = new MulticoreJitProfilePathCalculator().MulticoreJitProfilePath; - - if (!TryEnsureDirectoryExists(profileOptimizationRootPath)) - { - return; - } - - AssemblyLoadContext.Default.SetProfileOptimizationRoot(profileOptimizationRootPath); - - AssemblyLoadContext.Default.StartProfileOptimization("dotnet"); - } - - private bool TryEnsureDirectoryExists(string directoryPath) - { - try - { - PathUtility.EnsureDirectoryExists(directoryPath); - - return true; - } - catch (Exception e) - { - e.ReportAsWarning(); - return false; - } - } - } -} diff --git a/src/dotnet/MulticoreJitProfilePathCalculator.cs b/src/dotnet/MulticoreJitProfilePathCalculator.cs deleted file mode 100644 index 6faf51625..000000000 --- a/src/dotnet/MulticoreJitProfilePathCalculator.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using System.Runtime.InteropServices; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.PlatformAbstractions; - -namespace Microsoft.DotNet.Cli -{ - internal class MulticoreJitProfilePathCalculator - { - private string _multicoreJitProfilePath; - - public string MulticoreJitProfilePath - { - get - { - if (_multicoreJitProfilePath == null) - { - CalculateProfileRootPath(); - } - - return _multicoreJitProfilePath; - } - } - - private void CalculateProfileRootPath() - { - var profileRoot = GetRuntimeDataRootPathString(); - - var version = Product.Version; - - var rid = PlatformAbstractions.RuntimeEnvironment.GetRuntimeIdentifier(); - - _multicoreJitProfilePath = Path.Combine(profileRoot, "optimizationdata", version, rid); - } - - private string GetRuntimeDataRootPathString() - { - return RuntimeInformation.IsOSPlatform(OSPlatform.Windows) - ? GetWindowsRuntimeDataRoot() - : GetNonWindowsRuntimeDataRoot(); - } - - private static string GetWindowsRuntimeDataRoot() - { - return $@"{(Environment.GetEnvironmentVariable("LocalAppData"))}\Microsoft\dotnet\"; - } - - private static string GetNonWindowsRuntimeDataRoot() - { - return $"{(Environment.GetEnvironmentVariable("HOME"))}/.dotnet/"; - } - } -} diff --git a/src/dotnet/NuGetForwardingApp.cs b/src/dotnet/NuGetForwardingApp.cs deleted file mode 100644 index bf5852f75..000000000 --- a/src/dotnet/NuGetForwardingApp.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.Tools -{ - public class NuGetForwardingApp - { - private const string s_nugetExeName = "NuGet.CommandLine.XPlat.dll"; - private readonly ForwardingApp _forwardingApp; - - public NuGetForwardingApp(IEnumerable argsToForward) - { - _forwardingApp = new ForwardingApp( - GetNuGetExePath(), - argsToForward); - } - - public int Execute() - { - return _forwardingApp.Execute(); - } - - public NuGetForwardingApp WithEnvironmentVariable(string name, string value) - { - _forwardingApp.WithEnvironmentVariable(name, value); - - return this; - } - - private static string GetNuGetExePath() - { - return Path.Combine( - AppContext.BaseDirectory, - s_nugetExeName); - } - } -} diff --git a/src/dotnet/ParseResultExtensions.cs b/src/dotnet/ParseResultExtensions.cs deleted file mode 100644 index b662d9430..000000000 --- a/src/dotnet/ParseResultExtensions.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; - -namespace Microsoft.DotNet.Cli -{ - public static class ParseResultExtensions - { - public static void ShowHelp(this ParseResult parseResult) => - Console.WriteLine(parseResult.Command().HelpView()); - - public static void ShowHelpOrErrorIfAppropriate(this ParseResult parseResult) - { - parseResult.ShowHelpIfRequested(); - - if (parseResult.Errors.Any()) - { - throw new CommandParsingException( - message: string.Join(Environment.NewLine, - parseResult.Errors.Select(e => e.Message)), - helpText: parseResult?.Command()?.HelpView()); - } - } - - public static void ShowHelpIfRequested(this ParseResult parseResult) - { - var appliedCommand = parseResult.AppliedCommand(); - - if (appliedCommand.HasOption("help") || - appliedCommand.Arguments.Contains("-?") || - appliedCommand.Arguments.Contains("/?")) - { - // NOTE: this is a temporary stage in refactoring toward the ClicCommandLineParser being used at the CLI entry point. - throw new HelpException(parseResult.Command().HelpView()); - } - } - } -} \ No newline at end of file diff --git a/src/dotnet/Parser.cs b/src/dotnet/Parser.cs deleted file mode 100644 index 5f5bdd6c8..000000000 --- a/src/dotnet/Parser.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Tools.Help; -using static System.Environment; -using static Microsoft.DotNet.Cli.CommandLine.LocalizableStrings; -using LocalizableStrings = Microsoft.DotNet.Tools.Run.LocalizableStrings; - -namespace Microsoft.DotNet.Cli -{ - public static class Parser - { - static Parser() - { - ConfigureCommandLineLocalizedStrings(); - } - - private static void ConfigureCommandLineLocalizedStrings() - { - DefaultHelpViewText.AdditionalArgumentsSection = - $"{UsageCommandsAdditionalArgsHeader}:{NewLine} {LocalizableStrings.RunCommandAdditionalArgsHelpText}"; - DefaultHelpViewText.ArgumentsSection.Title = UsageArgumentsHeader; - DefaultHelpViewText.CommandsSection.Title = UsageCommandsHeader; - DefaultHelpViewText.OptionsSection.Title = UsageOptionsHeader; - DefaultHelpViewText.Synopsis.AdditionalArguments = UsageCommandAdditionalArgs; - DefaultHelpViewText.Synopsis.Command = UsageCommandToken; - DefaultHelpViewText.Synopsis.Options = UsageOptionsToken; - DefaultHelpViewText.Synopsis.Title = UsageHeader; - - ValidationMessages.Current = new CommandLineValidationMessages(); - } - - public static CommandLine.Parser Instance { get; } = new CommandLine.Parser( - options: Create.Command("dotnet", - ".NET Command Line Tools", - Accept.NoArguments(), - NewCommandParser.New(), - RestoreCommandParser.Restore(), - BuildCommandParser.Build(), - PublishCommandParser.Publish(), - RunCommandParser.Run(), - TestCommandParser.Test(), - PackCommandParser.Pack(), - MigrateCommandParser.Migrate(), - CleanCommandParser.Clean(), - SlnCommandParser.Sln(), - AddCommandParser.Add(), - RemoveCommandParser.Remove(), - ListCommandParser.List(), - NuGetCommandParser.NuGet(), - StoreCommandParser.Store(), - HelpCommandParser.Help(), - Create.Command("msbuild", ""), - Create.Command("vstest", ""), - CompleteCommandParser.Complete(), - InternalReportinstallsuccessCommandParser.InternalReportinstallsuccess(), - CommonOptions.HelpOption(), - Create.Option("--info", ""), - Create.Option("-d", ""), - Create.Option("--debug", ""))); - } -} \ No newline at end of file diff --git a/src/dotnet/ParserExtensions.cs b/src/dotnet/ParserExtensions.cs deleted file mode 100644 index fd378f0f3..000000000 --- a/src/dotnet/ParserExtensions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; - -namespace Microsoft.DotNet.Cli -{ - public static class ParserExtensions - { - public static ParseResult ParseFrom( - this CommandLine.Parser parser, - string context, - string[] args) => - parser.Parse(context.Split(' ').Concat(args).ToArray()); - } -} \ No newline at end of file diff --git a/src/dotnet/Program.cs b/src/dotnet/Program.cs deleted file mode 100644 index 6a929f4ce..000000000 --- a/src/dotnet/Program.cs +++ /dev/null @@ -1,278 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Telemetry; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Configurer; -using Microsoft.DotNet.PlatformAbstractions; -using Microsoft.DotNet.Tools.Help; -using NuGet.Frameworks; -using Command = Microsoft.DotNet.Cli.Utils.Command; - -namespace Microsoft.DotNet.Cli -{ - public class Program - { - public static int Main(string[] args) - { - DebugHelper.HandleDebugSwitch(ref args); - - new MulticoreJitActivator().TryActivateMulticoreJit(); - - if (Env.GetEnvironmentVariableAsBool("DOTNET_CLI_CAPTURE_TIMING", false)) - { - PerfTrace.Enabled = true; - } - - InitializeProcess(); - - try - { - using (PerfTrace.Current.CaptureTiming()) - { - return ProcessArgs(args); - } - } - catch (HelpException e) - { - Reporter.Output.WriteLine(e.Message); - return 0; - } - catch (Exception e) when (e.ShouldBeDisplayedAsError()) - { - Reporter.Error.WriteLine(CommandContext.IsVerbose() - ? e.ToString().Red().Bold() - : e.Message.Red().Bold()); - - var commandParsingException = e as CommandParsingException; - if (commandParsingException != null) - { - Reporter.Output.WriteLine(commandParsingException.HelpText); - } - - return 1; - } - catch (Exception e) when (!e.ShouldBeDisplayedAsError()) - { - Reporter.Error.WriteLine(e.ToString().Red().Bold()); - - return 1; - } - finally - { - if (PerfTrace.Enabled) - { - Reporter.Output.WriteLine("Performance Summary:"); - PerfTraceOutput.Print(Reporter.Output, PerfTrace.GetEvents()); - } - } - } - - internal static int ProcessArgs(string[] args, ITelemetry telemetryClient = null) - { - // 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(); - using (INuGetCacheSentinel nugetCacheSentinel = new NuGetCacheSentinel(cliFallbackFolderPathCalculator)) - using (IFirstTimeUseNoticeSentinel disposableFirstTimeUseNoticeSentinel = - new FirstTimeUseNoticeSentinel(cliFallbackFolderPathCalculator)) - { - IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel = disposableFirstTimeUseNoticeSentinel; - for (; lastArg < args.Length; lastArg++) - { - if (IsArg(args[lastArg], "d", "diagnostics")) - { - verbose = true; - } - else if (IsArg(args[lastArg], "version")) - { - PrintVersion(); - return 0; - } - else if (IsArg(args[lastArg], "info")) - { - PrintInfo(); - return 0; - } - else if (IsArg(args[lastArg], "h", "help") || - args[lastArg] == "-?" || - args[lastArg] == "/?") - { - HelpCommand.PrintHelp(); - return 0; - } - else if (args[lastArg].StartsWith("-")) - { - Reporter.Error.WriteLine($"Unknown option: {args[lastArg]}"); - success = false; - } - else - { - // It's the command, and we're done! - command = args[lastArg]; - - if (IsDotnetBeingInvokedFromNativeInstaller(command)) - { - firstTimeUseNoticeSentinel = new NoOpFirstTimeUseNoticeSentinel(); - } - - ConfigureDotNetForFirstTimeUse( - nugetCacheSentinel, - firstTimeUseNoticeSentinel, - cliFallbackFolderPathCalculator); - - break; - } - } - if (!success) - { - HelpCommand.PrintHelp(); - return 1; - } - - if (telemetryClient == null) - { - telemetryClient = new Telemetry.Telemetry(firstTimeUseNoticeSentinel); - } - TelemetryEventEntry.Subscribe(telemetryClient.TrackEvent); - TelemetryEventEntry.TelemetryFilter = new TelemetryFilter(); - } - - IEnumerable appArgs = - (lastArg + 1) >= args.Length - ? Enumerable.Empty() - : args.Skip(lastArg + 1).ToArray(); - - if (verbose.HasValue) - { - Environment.SetEnvironmentVariable(CommandContext.Variables.Verbose, verbose.ToString()); - Console.WriteLine($"Telemetry is: {(telemetryClient.Enabled ? "Enabled" : "Disabled")}"); - } - - if (string.IsNullOrEmpty(command)) - { - command = "help"; - } - - TelemetryEventEntry.TrackEvent(command, null, null); - - int exitCode; - if (BuiltInCommandsCatalog.Commands.TryGetValue(command, out var builtIn)) - { - TelemetryEventEntry.SendFiltered(Parser.Instance.ParseFrom($"dotnet {command}", appArgs.ToArray())); - exitCode = builtIn.Command(appArgs.ToArray()); - } - else - { - CommandResult result = Command.Create( - "dotnet-" + command, - appArgs, - FrameworkConstants.CommonFrameworks.NetStandardApp15) - .Execute(); - exitCode = result.ExitCode; - } - return exitCode; - } - - private static bool IsDotnetBeingInvokedFromNativeInstaller(string command) - { - return command == "internal-reportinstallsuccess"; - } - - private static void ConfigureDotNetForFirstTimeUse( - INuGetCacheSentinel nugetCacheSentinel, - IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel, - CliFallbackFolderPathCalculator cliFallbackFolderPathCalculator) - { - using (PerfTrace.Current.CaptureTiming()) - { - var nugetPackagesArchiver = new NuGetPackagesArchiver(); - var environmentProvider = new EnvironmentProvider(); - var commandFactory = new DotNetCommandFactory(alwaysRunOutOfProc: true); - var nugetCachePrimer = new NuGetCachePrimer( - nugetPackagesArchiver, - nugetCacheSentinel, - cliFallbackFolderPathCalculator); - var dotnetConfigurer = new DotnetFirstTimeUseConfigurer( - nugetCachePrimer, - nugetCacheSentinel, - firstTimeUseNoticeSentinel, - environmentProvider, - Reporter.Output, - cliFallbackFolderPathCalculator.CliFallbackFolderPath); - - dotnetConfigurer.Configure(); - } - } - - private static void InitializeProcess() - { - // by default, .NET Core doesn't have all code pages needed for Console apps. - // see the .NET Core Notes in https://msdn.microsoft.com/en-us/library/system.diagnostics.process(v=vs.110).aspx - Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); - - UILanguageOverride.Setup(); - } - - internal static bool TryGetBuiltInCommand(string commandName, out BuiltInCommandMetadata builtInCommand) - { - return BuiltInCommandsCatalog.Commands.TryGetValue(commandName, out builtInCommand); - } - - private static void PrintVersion() - { - Reporter.Output.WriteLine(Product.Version); - } - - private static void PrintInfo() - { - HelpCommand.PrintVersionHeader(); - - DotnetVersionFile versionFile = DotnetFiles.VersionFileObject; - var commitSha = versionFile.CommitSha ?? "N/A"; - Reporter.Output.WriteLine(); - Reporter.Output.WriteLine("Product Information:"); - Reporter.Output.WriteLine($" Version: {Product.Version}"); - Reporter.Output.WriteLine($" Commit SHA-1 hash: {commitSha}"); - Reporter.Output.WriteLine(); - Reporter.Output.WriteLine("Runtime Environment:"); - Reporter.Output.WriteLine($" OS Name: {RuntimeEnvironment.OperatingSystem}"); - Reporter.Output.WriteLine($" OS Version: {RuntimeEnvironment.OperatingSystemVersion}"); - Reporter.Output.WriteLine($" OS Platform: {RuntimeEnvironment.OperatingSystemPlatform}"); - Reporter.Output.WriteLine($" RID: {GetDisplayRid(versionFile)}"); - Reporter.Output.WriteLine($" Base Path: {ApplicationEnvironment.ApplicationBasePath}"); - } - - private static bool IsArg(string candidate, string longName) - { - return IsArg(candidate, shortName: null, longName: longName); - } - - private static bool IsArg(string candidate, string shortName, string longName) - { - return (shortName != null && candidate.Equals("-" + shortName)) || (longName != null && candidate.Equals("--" + longName)); - } - - private static string GetDisplayRid(DotnetVersionFile versionFile) - { - FrameworkDependencyFile fxDepsFile = new FrameworkDependencyFile(); - - string currentRid = RuntimeEnvironment.GetRuntimeIdentifier(); - - // if the current RID isn't supported by the shared framework, display the RID the CLI was - // built with instead, so the user knows which RID they should put in their "runtimes" section. - return fxDepsFile.IsRuntimeSupported(currentRid) ? - currentRid : - versionFile.BuildRid; - } - } -} diff --git a/src/dotnet/ProjectExtensions.cs b/src/dotnet/ProjectExtensions.cs deleted file mode 100644 index ab5065383..000000000 --- a/src/dotnet/ProjectExtensions.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.Build.Evaluation; -using NuGet.Frameworks; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.DotNet.Tools.ProjectExtensions -{ - internal static class ProjectExtensions - { - public static IEnumerable GetRuntimeIdentifiers(this Project project) - { - return project - .GetPropertyCommaSeparatedValues("RuntimeIdentifier") - .Concat(project.GetPropertyCommaSeparatedValues("RuntimeIdentifiers")) - .Select(value => value.ToLower()) - .Distinct(); - } - - public static IEnumerable GetTargetFrameworks(this Project project) - { - var targetFramewoksStrings = project - .GetPropertyCommaSeparatedValues("TargetFramework") - .Union(project.GetPropertyCommaSeparatedValues("TargetFrameworks")) - .Select((value) => value.ToLower()); - - var uniqueTargetFrameworkStrings = new HashSet(targetFramewoksStrings); - - return uniqueTargetFrameworkStrings - .Select((frameworkString) => NuGetFramework.Parse(frameworkString)); - } - - public static IEnumerable GetPropertyCommaSeparatedValues(this Project project, string propertyName) - { - return project.GetPropertyValue(propertyName) - .Split(';') - .Select((value) => value.Trim()) - .Where((value) => !string.IsNullOrEmpty(value)); - } - } -} diff --git a/src/dotnet/ProjectInstanceExtensions.cs b/src/dotnet/ProjectInstanceExtensions.cs deleted file mode 100644 index f437572c5..000000000 --- a/src/dotnet/ProjectInstanceExtensions.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.Build.Execution; -using Microsoft.DotNet.Cli.Sln.Internal; -using System; -using System.Linq; - -namespace Microsoft.DotNet.Tools.Common -{ - public static class ProjectInstanceExtensions - { - public static string GetProjectId(this ProjectInstance projectInstance) - { - var projectGuidProperty = projectInstance.GetPropertyValue("ProjectGuid"); - var projectGuid = string.IsNullOrEmpty(projectGuidProperty) - ? Guid.NewGuid() - : new Guid(projectGuidProperty); - return projectGuid.ToString("B").ToUpper(); - } - - public static string GetProjectTypeGuid(this ProjectInstance projectInstance) - { - string projectTypeGuid = null; - - var projectTypeGuidProperty = projectInstance.GetPropertyValue("ProjectTypeGuid"); - if (!string.IsNullOrEmpty(projectTypeGuidProperty)) - { - projectTypeGuid = projectTypeGuidProperty.Split(';').Last(); - } - else - { - projectTypeGuid = projectInstance.GetPropertyValue("DefaultProjectTypeGuid"); - } - - if (string.IsNullOrEmpty(projectTypeGuid)) - { - //ISSUE: https://github.com/dotnet/sdk/issues/522 - //The real behavior we want (once DefaultProjectTypeGuid support is in) is to throw - //when we cannot find ProjectTypeGuid or DefaultProjectTypeGuid. But for now we - //need to default to the C# one. - //throw new GracefulException(CommonLocalizableStrings.UnsupportedProjectType); - projectTypeGuid = ProjectTypeGuids.CSharpProjectTypeGuid; - } - - return projectTypeGuid; - } - } -} diff --git a/src/dotnet/Properties/AssemblyInfo.cs b/src/dotnet/Properties/AssemblyInfo.cs deleted file mode 100644 index d7ae131d6..000000000 --- a/src/dotnet/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: AssemblyMetadataAttribute("Serviceable", "True")] -[assembly: InternalsVisibleTo("dotnet.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("dotnet-add-package.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("dotnet-add-reference.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("dotnet-help.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("dotnet-list-reference.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("dotnet-remove-reference.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("dotnet-remove-package.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("dotnet-sln-add.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("dotnet-sln-list.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("dotnet-sln-remove.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("dotnet-msbuild.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("dotnet-run.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/dotnet/README.md b/src/dotnet/README.md deleted file mode 100644 index 5d8d6bb80..000000000 --- a/src/dotnet/README.md +++ /dev/null @@ -1,87 +0,0 @@ -% DOTNET(1) -% Microsoft Corporation dotnetclifeedback@microsoft.com -% June 2016 - -## NAME - -dotnet -- General driver for running the command-line commands - -## SYNOPSIS - -`dotnet [--version] [--help] [--verbose] [--info] []` - -## DESCRIPTION -`dotnet` is a generic driver for the Command Line Interface (CLI) toolchain. Invoked on its own, it will give out brief usage instructions. - -Each specific feature is implemented as a command. In order to use the feature, the command is specified after `dotnet`, such as [`dotnet build`](https://aka.ms/dotnet-build). All of the arguments following the command are its own arguments. - -The only time `dotnet` is used as a command on its own is to run portable apps. Just specify a portable application DLL after the `dotnet` verb to execute the application. - - -## OPTIONS -`-v, --verbose` - -Enables verbose output. - -`--version` - -Prints out the version of the CLI tooling. - -`--info` - -Prints out more detailed information about the CLI tooling, such as the current operating system, commit SHA for the version, etc. - -`-h, --help` - -Prints out a short help and a list of current commands. - -## DOTNET COMMANDS - -The following commands exist for dotnet: - -* [dotnet-new](https://aka.ms/dotnet-new) - * Initializes a C# or F# console application project. -* [dotnet-restore](https://aka.ms/dotnet-restore) - * Restores the dependencies for a given application. -* [dotnet-build](https://aka.ms/dotnet-build) - * Builds a .NET Core application. -* [dotnet-publish](https://aka.ms/dotnet-publish) - * Publishes a .NET portable or self-contained application. -* [dotnet-run](https://aka.ms/dotnet-run) - * Runs the application from source. -* [dotnet-test](https://aka.ms/dotnet-test) - * Runs tests using a test runner specified in the project.json. -* [dotnet-pack](https://aka.ms/dotnet-pack) - * Creates a NuGet package of your code. - -## EXAMPLES - -`dotnet new` - -Initializes a sample .NET Core console application that can be compiled and run. - -`dotnet restore` - -Restores dependencies for a given application. - -`dotnet compile` - -Compiles the application in a given directory. - -`dotnet myapp.dll` - -Runs a portable app named `myapp.dll`. - -## ENVIRONMENT - -`NUGET_PACKAGES` - -The primary package cache. If not set, it defaults to $HOME/.nuget/packages on Unix or %HOME%\NuGet\Packages on Windows. - -`DOTNET_SERVICING` - -Specifies the location of the servicing index to use by the shared host when loading the runtime. - -`DOTNET_CLI_TELEMETRY_OPTOUT` - -Specifies whether data about the .NET Core tools usage is collected and sent to Microsoft. **true** to opt-out of the telemetry feature (values true, 1 or yes accepted); otherwise, **false** (values false, 0 or no accepted). If not set, it defaults to **false**, that is, the telemetry feature is on. diff --git a/src/dotnet/SlnFileExtensions.cs b/src/dotnet/SlnFileExtensions.cs deleted file mode 100644 index 24848dffa..000000000 --- a/src/dotnet/SlnFileExtensions.cs +++ /dev/null @@ -1,343 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.Build.Construction; -using Microsoft.Build.Evaluation; -using Microsoft.Build.Exceptions; -using Microsoft.Build.Execution; -using Microsoft.DotNet.Cli.Sln.Internal; -using Microsoft.DotNet.Cli.Utils; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace Microsoft.DotNet.Tools.Common -{ - internal static class SlnFileExtensions - { - public static void AddProject(this SlnFile slnFile, string fullProjectPath) - { - if (string.IsNullOrEmpty(fullProjectPath)) - { - throw new ArgumentException(); - } - - var relativeProjectPath = PathUtility.GetRelativePath( - PathUtility.EnsureTrailingSlash(slnFile.BaseDirectory), - fullProjectPath); - - if (slnFile.Projects.Any((p) => - string.Equals(p.FilePath, relativeProjectPath, StringComparison.OrdinalIgnoreCase))) - { - Reporter.Output.WriteLine(string.Format( - CommonLocalizableStrings.SolutionAlreadyContainsProject, - slnFile.FullPath, - relativeProjectPath)); - } - else - { - ProjectInstance projectInstance = null; - try - { - projectInstance = new ProjectInstance(fullProjectPath); - } - catch (InvalidProjectFileException e) - { - Reporter.Error.WriteLine(string.Format( - CommonLocalizableStrings.InvalidProjectWithExceptionMessage, - fullProjectPath, - e.Message)); - return; - } - - var slnProject = new SlnProject - { - Id = projectInstance.GetProjectId(), - TypeGuid = projectInstance.GetProjectTypeGuid(), - Name = Path.GetFileNameWithoutExtension(relativeProjectPath), - FilePath = relativeProjectPath - }; - - slnFile.AddDefaultBuildConfigurations(slnProject); - - slnFile.AddSolutionFolders(slnProject); - - slnFile.Projects.Add(slnProject); - - Reporter.Output.WriteLine( - string.Format(CommonLocalizableStrings.ProjectAddedToTheSolution, relativeProjectPath)); - } - } - - public static void AddDefaultBuildConfigurations(this SlnFile slnFile, SlnProject slnProject) - { - if (slnProject == null) - { - throw new ArgumentException(); - } - - var defaultConfigurations = new List() - { - "Debug|Any CPU", - "Debug|x64", - "Debug|x86", - "Release|Any CPU", - "Release|x64", - "Release|x86", - }; - - // NOTE: The order you create the sections determines the order they are written to the sln - // file. In the case of an empty sln file, in order to make sure the solution configurations - // section comes first we need to add it first. This doesn't affect correctness but does - // stop VS from re-ordering things later on. Since we are keeping the SlnFile class low-level - // it shouldn't care about the VS implementation details. That's why we handle this here. - AddDefaultSolutionConfigurations(defaultConfigurations, slnFile.SolutionConfigurationsSection); - AddDefaultProjectConfigurations( - defaultConfigurations, - slnFile.ProjectConfigurationsSection.GetOrCreatePropertySet(slnProject.Id)); - } - - private static void AddDefaultSolutionConfigurations( - List defaultConfigurations, - SlnPropertySet solutionConfigs) - { - foreach (var config in defaultConfigurations) - { - if (!solutionConfigs.ContainsKey(config)) - { - solutionConfigs[config] = config; - } - } - } - - private static void AddDefaultProjectConfigurations( - List defaultConfigurations, - SlnPropertySet projectConfigs) - { - foreach (var config in defaultConfigurations) - { - var activeCfgKey = $"{config}.ActiveCfg"; - if (!projectConfigs.ContainsKey(activeCfgKey)) - { - projectConfigs[activeCfgKey] = config; - } - - var build0Key = $"{config}.Build.0"; - if (!projectConfigs.ContainsKey(build0Key)) - { - projectConfigs[build0Key] = config; - } - } - } - - public static void AddSolutionFolders(this SlnFile slnFile, SlnProject slnProject) - { - if (slnProject == null) - { - throw new ArgumentException(); - } - - var solutionFolders = slnProject.GetSolutionFoldersFromProject(); - - if (solutionFolders.Any()) - { - var nestedProjectsSection = slnFile.Sections.GetOrCreateSection( - "NestedProjects", - SlnSectionType.PreProcess); - - var pathToGuidMap = slnFile.GetSolutionFolderPaths(nestedProjectsSection.Properties); - - string parentDirGuid = null; - var solutionFolderHierarchy = string.Empty; - foreach (var dir in solutionFolders) - { - solutionFolderHierarchy = Path.Combine(solutionFolderHierarchy, dir); - if (pathToGuidMap.ContainsKey(solutionFolderHierarchy)) - { - parentDirGuid = pathToGuidMap[solutionFolderHierarchy]; - } - else - { - var solutionFolder = new SlnProject - { - Id = Guid.NewGuid().ToString("B").ToUpper(), - TypeGuid = ProjectTypeGuids.SolutionFolderGuid, - Name = dir, - FilePath = dir - }; - - slnFile.Projects.Add(solutionFolder); - - if (parentDirGuid != null) - { - nestedProjectsSection.Properties[solutionFolder.Id] = parentDirGuid; - } - parentDirGuid = solutionFolder.Id; - } - } - - nestedProjectsSection.Properties[slnProject.Id] = parentDirGuid; - } - } - - private static IDictionary GetSolutionFolderPaths( - this SlnFile slnFile, - SlnPropertySet nestedProjects) - { - var solutionFolderPaths = new Dictionary(StringComparer.OrdinalIgnoreCase); - - var solutionFolderProjects = slnFile.Projects.GetProjectsByType(ProjectTypeGuids.SolutionFolderGuid); - foreach (var slnProject in solutionFolderProjects) - { - var path = slnProject.FilePath; - var id = slnProject.Id; - while (nestedProjects.ContainsKey(id)) - { - id = nestedProjects[id]; - var parentSlnProject = solutionFolderProjects.Where(p => p.Id == id).Single(); - path = Path.Combine(parentSlnProject.FilePath, path); - } - - solutionFolderPaths[path] = slnProject.Id; - } - - return solutionFolderPaths; - } - - public static bool RemoveProject(this SlnFile slnFile, string projectPath) - { - if (string.IsNullOrEmpty(projectPath)) - { - throw new ArgumentException(); - } - - var projectPathNormalized = PathUtility.GetPathWithDirectorySeparator(projectPath); - - var projectsToRemove = slnFile.Projects.Where((p) => - string.Equals(p.FilePath, projectPathNormalized, StringComparison.OrdinalIgnoreCase)).ToList(); - - bool projectRemoved = false; - if (projectsToRemove.Count == 0) - { - Reporter.Output.WriteLine(string.Format( - CommonLocalizableStrings.ProjectReferenceCouldNotBeFound, - projectPath)); - } - else - { - foreach (var slnProject in projectsToRemove) - { - var buildConfigsToRemove = slnFile.ProjectConfigurationsSection.GetPropertySet(slnProject.Id); - if (buildConfigsToRemove != null) - { - slnFile.ProjectConfigurationsSection.Remove(buildConfigsToRemove); - } - - var nestedProjectsSection = slnFile.Sections.GetSection( - "NestedProjects", - SlnSectionType.PreProcess); - if (nestedProjectsSection != null && nestedProjectsSection.Properties.ContainsKey(slnProject.Id)) - { - nestedProjectsSection.Properties.Remove(slnProject.Id); - } - - slnFile.Projects.Remove(slnProject); - Reporter.Output.WriteLine( - string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, slnProject.FilePath)); - } - - projectRemoved = true; - } - - return projectRemoved; - } - - public static void RemoveEmptyConfigurationSections(this SlnFile slnFile) - { - if (slnFile.Projects.Count == 0) - { - var solutionConfigs = slnFile.Sections.GetSection("SolutionConfigurationPlatforms"); - if (solutionConfigs != null) - { - slnFile.Sections.Remove(solutionConfigs); - } - - var projectConfigs = slnFile.Sections.GetSection("ProjectConfigurationPlatforms"); - if (projectConfigs != null) - { - slnFile.Sections.Remove(projectConfigs); - } - } - } - - public static void RemoveEmptySolutionFolders(this SlnFile slnFile) - { - var solutionFolderProjects = slnFile.Projects - .GetProjectsByType(ProjectTypeGuids.SolutionFolderGuid) - .ToList(); - - if (solutionFolderProjects.Any()) - { - var nestedProjectsSection = slnFile.Sections.GetSection( - "NestedProjects", - SlnSectionType.PreProcess); - - if (nestedProjectsSection == null) - { - foreach (var solutionFolderProject in solutionFolderProjects) - { - if (solutionFolderProject.Sections.Count() == 0) - { - slnFile.Projects.Remove(solutionFolderProject); - } - } - } - else - { - var solutionFoldersInUse = slnFile.GetSolutionFoldersThatContainProjectsInItsHierarchy( - nestedProjectsSection.Properties); - - foreach (var solutionFolderProject in solutionFolderProjects) - { - if (!solutionFoldersInUse.Contains(solutionFolderProject.Id)) - { - nestedProjectsSection.Properties.Remove(solutionFolderProject.Id); - if (solutionFolderProject.Sections.Count() == 0) - { - slnFile.Projects.Remove(solutionFolderProject); - } - } - } - - if (nestedProjectsSection.IsEmpty) - { - slnFile.Sections.Remove(nestedProjectsSection); - } - } - } - } - - private static HashSet GetSolutionFoldersThatContainProjectsInItsHierarchy( - this SlnFile slnFile, - SlnPropertySet nestedProjects) - { - var solutionFoldersInUse = new HashSet(); - - var nonSolutionFolderProjects = slnFile.Projects.GetProjectsNotOfType( - ProjectTypeGuids.SolutionFolderGuid); - - foreach (var nonSolutionFolderProject in nonSolutionFolderProjects) - { - var id = nonSolutionFolderProject.Id; - while (nestedProjects.ContainsKey(id)) - { - id = nestedProjects[id]; - solutionFoldersInUse.Add(id); - } - } - - return solutionFoldersInUse; - } - } -} diff --git a/src/dotnet/SlnFileFactory.cs b/src/dotnet/SlnFileFactory.cs deleted file mode 100644 index e824bfd67..000000000 --- a/src/dotnet/SlnFileFactory.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using System.Linq; -using Microsoft.DotNet.Cli.Sln.Internal; -using Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.Tools.Common -{ - public static class SlnFileFactory - { - public static SlnFile CreateFromFileOrDirectory(string fileOrDirectory) - { - if (File.Exists(fileOrDirectory)) - { - return FromFile(fileOrDirectory); - } - else - { - return FromDirectory(fileOrDirectory); - } - } - - private static SlnFile FromFile(string solutionPath) - { - SlnFile slnFile = null; - try - { - slnFile = SlnFile.Read(solutionPath); - } - catch (InvalidSolutionFormatException e) - { - throw new GracefulException( - CommonLocalizableStrings.InvalidSolutionFormatString, - solutionPath, - e.Message); - } - return slnFile; - } - - private static SlnFile FromDirectory(string solutionDirectory) - { - DirectoryInfo dir; - try - { - dir = new DirectoryInfo(solutionDirectory); - if (!dir.Exists) - { - throw new GracefulException( - CommonLocalizableStrings.CouldNotFindSolutionOrDirectory, - solutionDirectory); - } - } - catch (ArgumentException) - { - throw new GracefulException( - CommonLocalizableStrings.CouldNotFindSolutionOrDirectory, - solutionDirectory); - } - - FileInfo[] files = dir.GetFiles("*.sln"); - if (files.Length == 0) - { - throw new GracefulException( - CommonLocalizableStrings.CouldNotFindSolutionIn, - solutionDirectory); - } - - if (files.Length > 1) - { - throw new GracefulException( - CommonLocalizableStrings.MoreThanOneSolutionInDirectory, - solutionDirectory); - } - - FileInfo solutionFile = files.Single(); - if (!solutionFile.Exists) - { - throw new GracefulException( - CommonLocalizableStrings.CouldNotFindSolutionIn, - solutionDirectory); - } - - return FromFile(solutionFile.FullName); - } - } -} diff --git a/src/dotnet/SlnProjectCollectionExtensions.cs b/src/dotnet/SlnProjectCollectionExtensions.cs deleted file mode 100644 index 09499e5a2..000000000 --- a/src/dotnet/SlnProjectCollectionExtensions.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Cli.Sln.Internal; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace Microsoft.DotNet.Tools.Common -{ - internal static class SlnProjectCollectionExtensions - { - public static IEnumerable GetProjectsByType( - this SlnProjectCollection projects, - string typeGuid) - { - return projects.Where(p => p.TypeGuid == typeGuid); - } - - public static IEnumerable GetProjectsNotOfType( - this SlnProjectCollection projects, - string typeGuid) - { - return projects.Where(p => p.TypeGuid != typeGuid); - } - } -} diff --git a/src/dotnet/SlnProjectExtensions.cs b/src/dotnet/SlnProjectExtensions.cs deleted file mode 100644 index 80ebf5d3e..000000000 --- a/src/dotnet/SlnProjectExtensions.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Cli.Sln.Internal; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace Microsoft.DotNet.Tools.Common -{ - internal static class SlnProjectExtensions - { - public static IList GetSolutionFoldersFromProject(this SlnProject project) - { - var solutionFolders = new List(); - - var projectFilePath = project.FilePath; - if (IsPathInTreeRootedAtSolutionDirectory(projectFilePath)) - { - var currentDirString = $".{Path.DirectorySeparatorChar}"; - if (projectFilePath.StartsWith(currentDirString)) - { - projectFilePath = projectFilePath.Substring(currentDirString.Length); - } - - var projectDirectoryPath = TrimProject(projectFilePath); - if (!string.IsNullOrEmpty(projectDirectoryPath)) - { - var solutionFoldersPath = TrimProjectDirectory(projectDirectoryPath); - if (!string.IsNullOrEmpty(solutionFoldersPath)) - { - solutionFolders.AddRange(solutionFoldersPath.Split(Path.DirectorySeparatorChar)); - } - } - } - - return solutionFolders; - } - - private static bool IsPathInTreeRootedAtSolutionDirectory(string path) - { - return !path.StartsWith(".."); - } - - private static string TrimProject(string path) - { - return Path.GetDirectoryName(path); - } - - private static string TrimProjectDirectory(string path) - { - return Path.GetDirectoryName(path); - } - } -} diff --git a/src/dotnet/Telemetry/AllowListToSendFirstAppliedOptions.cs b/src/dotnet/Telemetry/AllowListToSendFirstAppliedOptions.cs deleted file mode 100644 index 5670f6687..000000000 --- a/src/dotnet/Telemetry/AllowListToSendFirstAppliedOptions.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.Cli.Telemetry -{ - internal class AllowListToSendFirstAppliedOptions : IParseResultLogRule - { - public AllowListToSendFirstAppliedOptions( - HashSet topLevelCommandNameAllowList) - { - _topLevelCommandNameAllowList = topLevelCommandNameAllowList; - } - - private HashSet _topLevelCommandNameAllowList { get; } - - public List AllowList(ParseResult parseResult) - { - var topLevelCommandNameFromParse = parseResult["dotnet"]?.AppliedOptions?.FirstOrDefault()?.Name; - var result = new List(); - if (_topLevelCommandNameAllowList.Contains(topLevelCommandNameFromParse)) - { - var firstOption = parseResult["dotnet"]?[topLevelCommandNameFromParse] - ?.AppliedOptions?.FirstOrDefault()?.Name; - if (firstOption != null) - { - result.Add(new ApplicationInsightsEntryFormat( - "dotnet-" + topLevelCommandNameFromParse, - new Dictionary - { - {"argument", firstOption} - })); - } - } - return result; - } - } -} diff --git a/src/dotnet/Telemetry/AllowListToSendFirstArgument.cs b/src/dotnet/Telemetry/AllowListToSendFirstArgument.cs deleted file mode 100644 index b18c6e4f4..000000000 --- a/src/dotnet/Telemetry/AllowListToSendFirstArgument.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.Cli.Telemetry -{ - internal class AllowListToSendFirstArgument : IParseResultLogRule - { - public AllowListToSendFirstArgument( - HashSet topLevelCommandNameAllowList) - { - _topLevelCommandNameAllowList = topLevelCommandNameAllowList; - } - - private HashSet _topLevelCommandNameAllowList { get; } - - public List AllowList(ParseResult parseResult) - { - var result = new List(); - var topLevelCommandNameFromParse = parseResult["dotnet"]?.AppliedOptions?.FirstOrDefault()?.Name; - if (topLevelCommandNameFromParse != null) - { - if (_topLevelCommandNameAllowList.Contains(topLevelCommandNameFromParse)) - { - var firstArgument = parseResult["dotnet"][topLevelCommandNameFromParse].Arguments - ?.FirstOrDefault(); - if (firstArgument != null) - { - result.Add(new ApplicationInsightsEntryFormat( - "dotnet-" + topLevelCommandNameFromParse, - new Dictionary - { - {"argument", firstArgument} - })); - } - } - } - return result; - } - } -} diff --git a/src/dotnet/Telemetry/DockerContainerDetectorForTelemetry.cs b/src/dotnet/Telemetry/DockerContainerDetectorForTelemetry.cs deleted file mode 100644 index b06250f75..000000000 --- a/src/dotnet/Telemetry/DockerContainerDetectorForTelemetry.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.IO; -using System.Security; -using Microsoft.Win32; -using Microsoft.DotNet.PlatformAbstractions; - -namespace Microsoft.DotNet.Cli.Telemetry -{ - internal class DockerContainerDetectorForTelemetry : IDockerContainerDetector - { - public IsDockerContainer IsDockerContainer() - { - switch (RuntimeEnvironment.OperatingSystemPlatform) - { - case Platform.Windows: - try - { - using (RegistryKey subkey - = Registry.LocalMachine.OpenSubKey("System\\CurrentControlSet\\Control")) - { - return subkey?.GetValue("ContainerType") != null - ? Cli.Telemetry.IsDockerContainer.True - : Cli.Telemetry.IsDockerContainer.False; - } - } - catch (SecurityException) - { - return Cli.Telemetry.IsDockerContainer.Unknown; - } - case Platform.Linux: - return ReadProcToDetectDockerInLinux() - ? Cli.Telemetry.IsDockerContainer.True - : Cli.Telemetry.IsDockerContainer.False; - case Platform.Unknown: - return Cli.Telemetry.IsDockerContainer.Unknown; - case Platform.Darwin: - default: - return Cli.Telemetry.IsDockerContainer.False; - } - } - - private static bool ReadProcToDetectDockerInLinux() - { - return File - .ReadAllText("/proc/1/cgroup") - .Contains("/docker/"); - } - } - - internal enum IsDockerContainer - { - True, - False, - Unknown - } -} diff --git a/src/dotnet/Telemetry/IDockerContainerDetector.cs b/src/dotnet/Telemetry/IDockerContainerDetector.cs deleted file mode 100644 index 49bb8282c..000000000 --- a/src/dotnet/Telemetry/IDockerContainerDetector.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.DotNet.Cli.Telemetry -{ - internal interface IDockerContainerDetector - { - IsDockerContainer IsDockerContainer(); - } -} diff --git a/src/dotnet/Telemetry/IParseResultLogRule.cs b/src/dotnet/Telemetry/IParseResultLogRule.cs deleted file mode 100644 index 8120e772a..000000000 --- a/src/dotnet/Telemetry/IParseResultLogRule.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.Cli.Telemetry -{ - internal interface IParseResultLogRule - { - List AllowList(ParseResult parseResult); - } -} diff --git a/src/dotnet/Telemetry/ITelemetry.cs b/src/dotnet/Telemetry/ITelemetry.cs deleted file mode 100644 index 8079398ca..000000000 --- a/src/dotnet/Telemetry/ITelemetry.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; - -namespace Microsoft.DotNet.Cli.Telemetry -{ - public interface ITelemetry - { - bool Enabled { get; } - - void TrackEvent(string eventName, IDictionary properties, IDictionary measurements); - } -} diff --git a/src/dotnet/Telemetry/MacAddressGetter.cs b/src/dotnet/Telemetry/MacAddressGetter.cs deleted file mode 100644 index e9ef66ba9..000000000 --- a/src/dotnet/Telemetry/MacAddressGetter.cs +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) .NET 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.Diagnostics; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using System.Text.RegularExpressions; -using System.Net.NetworkInformation; -using System.ComponentModel; -using Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.Cli.Telemetry -{ - internal static class MacAddressGetter - { - private const string MacRegex = @"(?:[a-z0-9]{2}[:\-]){5}[a-z0-9]{2}"; - private const string ZeroRegex = @"(?:00[:\-]){5}00"; - private const int ErrorFileNotFound = 0x2; - public static string GetMacAddress() - { - try - { - var shelloutput = GetShellOutMacAddressOutput(); - if (shelloutput == null) - { - return null; - } - - return ParseMACAddress(shelloutput); - } - catch (Win32Exception e) - { - if (e.NativeErrorCode == ErrorFileNotFound) - { - return GetMacAddressByNetworkInterface(); - } - else - { - throw; - } - } - } - - private static string ParseMACAddress(string shelloutput) - { - string macAddress = null; - foreach (Match match in Regex.Matches(shelloutput, MacRegex, RegexOptions.IgnoreCase)) - { - if (!Regex.IsMatch(match.Value, ZeroRegex)) - { - macAddress = match.Value; - break; - } - } - - if (macAddress != null) - { - return macAddress; - } - return null; - } - - private static string GetIpCommandOutput() - { - var ipResult = new ProcessStartInfo - { - FileName = "ip", - Arguments = "link", - UseShellExecute = false - }.ExecuteAndCaptureOutput(out string ipStdOut, out string ipStdErr); - - if (ipResult == 0) - { - return ipStdOut; - } - else - { - return null; - } - } - - private static string GetShellOutMacAddressOutput() - { - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - var result = new ProcessStartInfo - { - FileName = "getmac.exe", - UseShellExecute = false - }.ExecuteAndCaptureOutput(out string stdOut, out string stdErr); - - if (result == 0) - { - return stdOut; - } - else - { - return null; - } - } - else - { - try - { - var ifconfigResult = new ProcessStartInfo - { - FileName = "ifconfig", - Arguments = "-a", - UseShellExecute = false - }.ExecuteAndCaptureOutput(out string ifconfigStdOut, out string ifconfigStdErr); - - if (ifconfigResult == 0) - { - return ifconfigStdOut; - } - else - { - return GetIpCommandOutput(); - } - } - catch (Win32Exception e) - { - if (e.NativeErrorCode == ErrorFileNotFound) - { - return GetIpCommandOutput(); - } - else - { - throw; - } - } - } - } - - private static string GetMacAddressByNetworkInterface() - { - return GetMacAddressesByNetworkInterface().FirstOrDefault(); - } - - private static List GetMacAddressesByNetworkInterface() - { - NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces(); - var macs = new List(); - - if (nics == null || nics.Length < 1) - { - macs.Add(string.Empty); - return macs; - } - - foreach (NetworkInterface adapter in nics) - { - IPInterfaceProperties properties = adapter.GetIPProperties(); - - PhysicalAddress address = adapter.GetPhysicalAddress(); - byte[] bytes = address.GetAddressBytes(); - macs.Add(string.Join("-", bytes.Select(x => x.ToString("X2")))); - if (macs.Count >= 10) - { - break; - } - } - return macs; - } - } -} diff --git a/src/dotnet/Telemetry/Sha256Hasher.cs b/src/dotnet/Telemetry/Sha256Hasher.cs deleted file mode 100644 index bbe7cfdfb..000000000 --- a/src/dotnet/Telemetry/Sha256Hasher.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using System.Security.Cryptography; -using System.Text; -namespace Microsoft.DotNet.Cli.Telemetry -{ - internal static class Sha256Hasher - { - /// - /// // The hashed mac address needs to be the same hashed value as produced by the other distinct sources given the same input. (e.g. VsCode) - /// - public static string Hash(string text) - { - var sha256 = SHA256.Create(); - return HashInFormat(sha256, text); - } - - private static string HashInFormat(SHA256 sha256, string text) - { - byte[] bytes = Encoding.UTF8.GetBytes(text); - byte[] hash = sha256.ComputeHash(bytes); - StringBuilder hashString = new StringBuilder(); - foreach (byte x in hash) - { - hashString.AppendFormat("{0:x2}", x); - } - return hashString.ToString(); - } - } -} diff --git a/src/dotnet/Telemetry/Telemetry.cs b/src/dotnet/Telemetry/Telemetry.cs deleted file mode 100644 index fe1209339..000000000 --- a/src/dotnet/Telemetry/Telemetry.cs +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Threading.Tasks; -using Microsoft.ApplicationInsights; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Configurer; -using Microsoft.DotNet.PlatformAbstractions; - -namespace Microsoft.DotNet.Cli.Telemetry -{ - public class Telemetry : ITelemetry - { - internal static string CurrentSessionId = null; - private TelemetryClient _client = null; - private Dictionary _commonProperties = null; - private Dictionary _commonMeasurements = null; - private Task _trackEventTask = null; - - private const string InstrumentationKey = "74cc1c9e-3e6e-4d05-b3fc-dde9101d0254"; - private const string TelemetryOptout = "DOTNET_CLI_TELEMETRY_OPTOUT"; - - public bool Enabled { get; } - - public Telemetry() : this(null) { } - - public Telemetry(IFirstTimeUseNoticeSentinel sentinel) : this(sentinel, null) { } - - public Telemetry(IFirstTimeUseNoticeSentinel sentinel, string sessionId, bool blockThreadInitialization = false) - { - Enabled = !Env.GetEnvironmentVariableAsBool(TelemetryOptout) && PermissionExists(sentinel); - - if (!Enabled) - { - return; - } - - // Store the session ID in a static field so that it can be reused - CurrentSessionId = sessionId ?? Guid.NewGuid().ToString(); - - if (blockThreadInitialization) - { - InitializeTelemetry(); - } - else - { - //initialize in task to offload to parallel thread - _trackEventTask = Task.Factory.StartNew(() => InitializeTelemetry()); - } - } - - private bool PermissionExists(IFirstTimeUseNoticeSentinel sentinel) - { - if (sentinel == null) - { - return false; - } - - return sentinel.Exists(); - } - - public void TrackEvent(string eventName, IDictionary properties, - IDictionary measurements) - { - if (!Enabled) - { - return; - } - - //continue task in existing parallel thread - _trackEventTask = _trackEventTask.ContinueWith( - x => TrackEventTask(eventName, properties, measurements) - ); - } - - public void ThreadBlockingTrackEvent(string eventName, IDictionary properties, IDictionary measurements) - { - if (!Enabled) - { - return; - } - TrackEventTask(eventName, properties, measurements); - } - - private void InitializeTelemetry() - { - try - { - _client = new TelemetryClient(); - _client.InstrumentationKey = InstrumentationKey; - _client.Context.Session.Id = CurrentSessionId; - _client.Context.Device.OperatingSystem = RuntimeEnvironment.OperatingSystem; - - _commonProperties = new TelemetryCommonProperties().GetTelemetryCommonProperties(); - _commonMeasurements = new Dictionary(); - } - catch (Exception e) - { - _client = null; - // we dont want to fail the tool if telemetry fails. - Debug.Fail(e.ToString()); - } - } - - private void TrackEventTask( - string eventName, - IDictionary properties, - IDictionary measurements) - { - if (_client == null) - { - return; - } - - try - { - Dictionary eventProperties = GetEventProperties(properties); - Dictionary eventMeasurements = GetEventMeasures(measurements); - - _client.TrackEvent(eventName, eventProperties, eventMeasurements); - _client.Flush(); - } - catch (Exception e) - { - Debug.Fail(e.ToString()); - } - } - - private Dictionary GetEventMeasures(IDictionary measurements) - { - Dictionary eventMeasurements = new Dictionary(_commonMeasurements); - if (measurements != null) - { - foreach (KeyValuePair measurement in measurements) - { - if (eventMeasurements.ContainsKey(measurement.Key)) - { - eventMeasurements[measurement.Key] = measurement.Value; - } - else - { - eventMeasurements.Add(measurement.Key, measurement.Value); - } - } - } - return eventMeasurements; - } - - private Dictionary GetEventProperties(IDictionary properties) - { - if (properties != null) - { - var eventProperties = new Dictionary(_commonProperties); - foreach (KeyValuePair property in properties) - { - if (eventProperties.ContainsKey(property.Key)) - { - eventProperties[property.Key] = property.Value; - } - else - { - eventProperties.Add(property.Key, property.Value); - } - } - return eventProperties; - } - else - { - return _commonProperties; - } - } - } -} diff --git a/src/dotnet/Telemetry/TelemetryCommonProperties.cs b/src/dotnet/Telemetry/TelemetryCommonProperties.cs deleted file mode 100644 index a14c5cf84..000000000 --- a/src/dotnet/Telemetry/TelemetryCommonProperties.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.PlatformAbstractions; -using System.IO; -using Microsoft.DotNet.Configurer; -using System.Linq; - -namespace Microsoft.DotNet.Cli.Telemetry -{ - internal class TelemetryCommonProperties - { - public TelemetryCommonProperties( - Func getCurrentDirectory = null, - Func hasher = null, - Func getMACAddress = null, - IDockerContainerDetector dockerContainerDetector = null, - IUserLevelCacheWriter userLevelCacheWriter = null) - { - _getCurrentDirectory = getCurrentDirectory ?? Directory.GetCurrentDirectory; - _hasher = hasher ?? Sha256Hasher.Hash; - _getMACAddress = getMACAddress ?? MacAddressGetter.GetMacAddress; - _dockerContainerDetector = dockerContainerDetector ?? new DockerContainerDetectorForTelemetry(); - _userLevelCacheWriter = userLevelCacheWriter ?? new UserLevelCacheWriter(new CliFallbackFolderPathCalculator()); - } - - private readonly IDockerContainerDetector _dockerContainerDetector; - private Func _getCurrentDirectory; - private Func _hasher; - private Func _getMACAddress; - private IUserLevelCacheWriter _userLevelCacheWriter; - private const string OSVersion = "OS Version"; - private const string OSPlatform = "OS Platform"; - private const string RuntimeId = "Runtime Id"; - private const string ProductVersion = "Product Version"; - private const string TelemetryProfile = "Telemetry Profile"; - private const string CurrentPathHash = "Current Path Hash"; - private const string MachineId = "Machine ID"; - private const string DockerContainer = "Docker Container"; - private const string TelemetryProfileEnvironmentVariable = "DOTNET_CLI_TELEMETRY_PROFILE"; - private const string CannotFindMacAddress = "Unknown"; - - private const string MachineIdCacheKey = "MachineId"; - private const string IsDockerContainerCacheKey = "IsDockerContainer"; - - public Dictionary GetTelemetryCommonProperties() - { - return new Dictionary - { - {OSVersion, RuntimeEnvironment.OperatingSystemVersion}, - {OSPlatform, RuntimeEnvironment.OperatingSystemPlatform.ToString()}, - {RuntimeId, RuntimeEnvironment.GetRuntimeIdentifier()}, - {ProductVersion, Product.Version}, - {TelemetryProfile, Environment.GetEnvironmentVariable(TelemetryProfileEnvironmentVariable)}, - {DockerContainer, _userLevelCacheWriter.RunWithCache(IsDockerContainerCacheKey, () => _dockerContainerDetector.IsDockerContainer().ToString("G") )}, - {CurrentPathHash, _hasher(_getCurrentDirectory())}, - {MachineId, _userLevelCacheWriter.RunWithCache(MachineIdCacheKey, GetMachineId)} - }; - } - - private string GetMachineId() - { - var macAddress = _getMACAddress(); - if (macAddress != null) - { - return _hasher(macAddress); - } - else - { - return Guid.NewGuid().ToString(); - } - } - } -} diff --git a/src/dotnet/Telemetry/TelemetryFilter.cs b/src/dotnet/Telemetry/TelemetryFilter.cs deleted file mode 100644 index 6d44ef58d..000000000 --- a/src/dotnet/Telemetry/TelemetryFilter.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.Cli.Telemetry -{ - internal class TelemetryFilter : ITelemetryFilter - { - private const string DotnetName = "dotnet"; - - public IEnumerable Filter(object objectToFilter) - { - var ruleSet = new List - { new AllowListToSendFirstArgument(new HashSet{ "new", "help" }), - new AllowListToSendFirstAppliedOptions(new HashSet{ "add", "remove", "list", "sln", "nuget" }), - new TopLevelCommandNameAndOptionToLog - ( - topLevelCommandName: new HashSet { "new" }, - optionsToLog: new HashSet { "language" } - ), - new TopLevelCommandNameAndOptionToLog - ( - topLevelCommandName: new HashSet { "build", "publish" }, - optionsToLog: new HashSet { "framework", "runtime", "configuration" } - ), - new TopLevelCommandNameAndOptionToLog - ( - topLevelCommandName: new HashSet { "run", "clean", "test" }, - optionsToLog: new HashSet { "framework", "configuration" } - ), - new TopLevelCommandNameAndOptionToLog - ( - topLevelCommandName: new HashSet { "pack" }, - optionsToLog: new HashSet { "configuration" } - ), - new TopLevelCommandNameAndOptionToLog - ( - topLevelCommandName: new HashSet { "migrate" }, - optionsToLog: new HashSet { "sdk-package-version" } - ), - new TopLevelCommandNameAndOptionToLog - ( - topLevelCommandName: new HashSet { "vstest" }, - optionsToLog: new HashSet { "platform", "framework", "logger" } - ), - new TopLevelCommandNameAndOptionToLog - ( - topLevelCommandName: new HashSet { "publish" }, - optionsToLog: new HashSet { "runtime" } - ) - }; - var result = new List(); - - if (objectToFilter is ParseResult parseResult) - { - var topLevelCommandName = parseResult[DotnetName]?.AppliedOptions?.FirstOrDefault()?.Name; - if (topLevelCommandName != null) - { - LogVerbosityForAllTopLevelCommand(result, parseResult, topLevelCommandName); - - foreach (IParseResultLogRule rule in ruleSet) - { - result.AddRange(rule.AllowList(parseResult)); - } - } - } - - return result; - } - - private static void LogVerbosityForAllTopLevelCommand( - ICollection result, - ParseResult parseResult, - string topLevelCommandName) - { - if (parseResult[DotnetName][topLevelCommandName]?.AppliedOptions != null && - parseResult[DotnetName][topLevelCommandName].AppliedOptions.Contains("verbosity")) - { - AppliedOption appliedOptions = - parseResult[DotnetName][topLevelCommandName].AppliedOptions["verbosity"]; - - result.Add(new ApplicationInsightsEntryFormat( - "dotnet-" + topLevelCommandName, - new Dictionary() - { - {"verbosity", appliedOptions.Arguments.ElementAt(0)} - })); - } - } - } -} diff --git a/src/dotnet/Telemetry/TopLevelCommandNameAndOptionToLog.cs b/src/dotnet/Telemetry/TopLevelCommandNameAndOptionToLog.cs deleted file mode 100644 index 38a234541..000000000 --- a/src/dotnet/Telemetry/TopLevelCommandNameAndOptionToLog.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.Cli.Telemetry -{ - internal class TopLevelCommandNameAndOptionToLog : IParseResultLogRule - { - public TopLevelCommandNameAndOptionToLog( - HashSet topLevelCommandName, - HashSet optionsToLog) - { - _topLevelCommandName = topLevelCommandName; - _optionsToLog = optionsToLog; - } - - private HashSet _topLevelCommandName { get; } - private HashSet _optionsToLog { get; } - private const string DotnetName = "dotnet"; - - public List AllowList(ParseResult parseResult) - { - var topLevelCommandName = parseResult[DotnetName]?.AppliedOptions?.FirstOrDefault()?.Name; - var result = new List(); - foreach (var option in _optionsToLog) - { - if (_topLevelCommandName.Contains(topLevelCommandName) - && parseResult[DotnetName]?[topLevelCommandName]?.AppliedOptions != null - && parseResult[DotnetName][topLevelCommandName].AppliedOptions.Contains(option)) - { - AppliedOption appliedOptions = - parseResult[DotnetName][topLevelCommandName] - .AppliedOptions[option]; - result.Add(new ApplicationInsightsEntryFormat( - "dotnet-" + topLevelCommandName, - new Dictionary - { - {option, appliedOptions.Arguments.ElementAt(0)} - })); - } - } - return result; - } - } -} diff --git a/src/dotnet/UILanguageOverride.cs b/src/dotnet/UILanguageOverride.cs deleted file mode 100644 index 5e44e56cc..000000000 --- a/src/dotnet/UILanguageOverride.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Globalization; - -namespace Microsoft.DotNet.Cli -{ - internal static class UILanguageOverride - { - private const string DOTNET_CLI_UI_LANGUAGE = nameof(DOTNET_CLI_UI_LANGUAGE); - private const string VSLANG = nameof(VSLANG); - private const string PreferredUILang = nameof(PreferredUILang); - - public static void Setup() - { - CultureInfo language = GetOverriddenUILanguage(); - if (language != null) - { - ApplyOverrideToCurrentProcess(language); - FlowOverrideToChildProcesses(language); - } - } - - private static void ApplyOverrideToCurrentProcess(CultureInfo language) - { - CultureInfo.DefaultThreadCurrentUICulture = language; - } - - private static void FlowOverrideToChildProcesses(CultureInfo language) - { - // Do not override any environment variables that are already set as we do not want to clobber a more granular setting with our global setting. - SetIfNotAlreadySet(DOTNET_CLI_UI_LANGUAGE, language.Name); - SetIfNotAlreadySet(VSLANG, language.LCID); // for tools following VS guidelines to just work in CLI - SetIfNotAlreadySet(PreferredUILang, language.Name); // for C#/VB targets that pass $(PreferredUILang) to compiler - } - - private static CultureInfo GetOverriddenUILanguage() - { - // DOTNET_CLI_UI_LANGUAGE= is the main way for users to customize the CLI's UI language. - string dotnetCliLanguage = Environment.GetEnvironmentVariable(DOTNET_CLI_UI_LANGUAGE); - if (dotnetCliLanguage != null) - { - try - { - return new CultureInfo(dotnetCliLanguage); - } - catch (CultureNotFoundException) { } - } - - // VSLANG= is set by VS and we respect that as well so that we will respect the VS - // language preference if we're invoked by VS. - string vsLang = Environment.GetEnvironmentVariable(VSLANG); - if (vsLang != null && int.TryParse(vsLang, out int vsLcid)) - { - try - { - return new CultureInfo(vsLcid); - } - catch (ArgumentOutOfRangeException) { } - catch (CultureNotFoundException) { } - } - - return null; - } - - private static void SetIfNotAlreadySet(string environmentVariableName, string value) - { - string currentValue = Environment.GetEnvironmentVariable(environmentVariableName); - if (currentValue == null) - { - Environment.SetEnvironmentVariable(environmentVariableName, value); - } - } - - private static void SetIfNotAlreadySet(string environmentVariableName, int value) - { - SetIfNotAlreadySet(environmentVariableName, value.ToString()); - } - } -} diff --git a/src/dotnet/commands/CommandWithRestoreOptions.cs b/src/dotnet/commands/CommandWithRestoreOptions.cs deleted file mode 100644 index aaf9748d5..000000000 --- a/src/dotnet/commands/CommandWithRestoreOptions.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using System.Linq; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Tools.MSBuild; -using Microsoft.DotNet.Tools.Restore; - -namespace Microsoft.DotNet.Tools -{ - public static class CreateWithRestoreOptions - { - public static Command Command( - string name, - string help, - ArgumentsRule arguments, - params Option[] options) - { - return Create.Command(name, help, arguments, RestoreCommandParser.AddImplicitRestoreOptions(options)); - } - - public static Command Command( - string name, - string help, - ArgumentsRule arguments, - bool treatUnmatchedTokensAsErrors, - params Option[] options) - { - return Create.Command( - name, - help, - arguments, - treatUnmatchedTokensAsErrors, - RestoreCommandParser.AddImplicitRestoreOptions(options)); - } - } -} \ No newline at end of file diff --git a/src/dotnet/commands/RestoringCommand.cs b/src/dotnet/commands/RestoringCommand.cs deleted file mode 100644 index 0239fd69b..000000000 --- a/src/dotnet/commands/RestoringCommand.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using System.Linq; -using Microsoft.DotNet.Tools.MSBuild; -using Microsoft.DotNet.Tools.Restore; - -namespace Microsoft.DotNet.Tools -{ - public class RestoringCommand : MSBuildForwardingApp - { - private bool NoRestore { get; } - - private IEnumerable ParsedArguments { get; } - - private IEnumerable TrailingArguments { get; } - - private IEnumerable ArgsToForwardToRestore() - { - var restoreArguments = ParsedArguments.Where(a => - !a.StartsWith("/p:TargetFramework")); - - if (!restoreArguments.Any(a => a.StartsWith("/verbosity:"))) - { - restoreArguments = restoreArguments.Concat(new string[] { "/verbosity:q" }); - } - - return restoreArguments.Concat(TrailingArguments); - } - - private bool ShouldRunImplicitRestore => !NoRestore; - - public RestoringCommand( - IEnumerable msbuildArgs, - IEnumerable parsedArguments, - IEnumerable trailingArguments, - bool noRestore, - string msbuildPath = null) - : base(msbuildArgs, msbuildPath) - { - NoRestore = noRestore; - ParsedArguments = parsedArguments; - TrailingArguments = trailingArguments; - } - - public override int Execute() - { - if (ShouldRunImplicitRestore) - { - int exitCode = RestoreCommand.Run(ArgsToForwardToRestore().ToArray()); - if (exitCode != 0) - { - return exitCode; - } - } - - return base.Execute(); - } - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/AddCommandParser.cs b/src/dotnet/commands/dotnet-add/AddCommandParser.cs deleted file mode 100644 index 39093759a..000000000 --- a/src/dotnet/commands/dotnet-add/AddCommandParser.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Tools; -using LocalizableStrings = Microsoft.DotNet.Tools.Add.LocalizableStrings; - -namespace Microsoft.DotNet.Cli -{ - internal static class AddCommandParser - { - public static Command Add() => - Create.Command( - "add", - LocalizableStrings.NetAddCommand, - Accept.ExactlyOneArgument() - .DefaultToCurrentDirectory() - .With(name: CommonLocalizableStrings.CmdProjectFile, - description: CommonLocalizableStrings.ArgumentsProjectDescription), AddPackageParser.AddPackage(), - AddProjectToProjectReferenceParser.AddProjectReference(), - CommonOptions.HelpOption()); - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/LocalizableStrings.resx b/src/dotnet/commands/dotnet-add/LocalizableStrings.resx deleted file mode 100644 index 0e0a56115..000000000 --- a/src/dotnet/commands/dotnet-add/LocalizableStrings.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - .NET Add Command - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/Program.cs b/src/dotnet/commands/dotnet-add/Program.cs deleted file mode 100644 index 829c5e454..000000000 --- a/src/dotnet/commands/dotnet-add/Program.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Tools.Add.PackageReference; -using Microsoft.DotNet.Tools.Add.ProjectToProjectReference; - -namespace Microsoft.DotNet.Tools.Add -{ - public class AddCommand : DotNetTopLevelCommandBase - { - protected override string CommandName => "add"; - protected override string FullCommandNameLocalized => LocalizableStrings.NetAddCommand; - protected override string ArgumentName => Constants.ProjectArgumentName; - protected override string ArgumentDescriptionLocalized => CommonLocalizableStrings.ArgumentsProjectDescription; - - internal override Dictionary> SubCommands => - new Dictionary> - { - ["reference"] = - add => new AddProjectToProjectReferenceCommand( - add["reference"], - add.Value(), - ParseResult), - - ["package"] = - add => new AddPackageReferenceCommand( - add["package"], - add.Value(), - ParseResult) - }; - - public static int Run(string[] args) - { - var command = new AddCommand(); - return command.RunCommand(args); - } - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/AddPackageParser.cs b/src/dotnet/commands/dotnet-add/dotnet-add-package/AddPackageParser.cs deleted file mode 100644 index 5ee3fd10c..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/AddPackageParser.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Threading; -using Microsoft.DotNet.Cli.CommandLine; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using LocalizableStrings = Microsoft.DotNet.Tools.Add.PackageReference.LocalizableStrings; - -namespace Microsoft.DotNet.Cli -{ - internal static class AddPackageParser - { - public static Command AddPackage() - { - return Create.Command( - "package", - LocalizableStrings.AppFullName, - Accept.ExactlyOneArgument(errorMessage: o => LocalizableStrings.SpecifyExactlyOnePackageReference) - .WithSuggestionsFrom(QueryNuGet) - .With(name: LocalizableStrings.CmdPackage, - description: LocalizableStrings.CmdPackageDescription), - CommonOptions.HelpOption(), - Create.Option("-v|--version", - LocalizableStrings.CmdVersionDescription, - Accept.ExactlyOneArgument() - .With(name: LocalizableStrings.CmdVersion) - .ForwardAsSingle(o => $"--version {o.Arguments.Single()}")), - Create.Option("-f|--framework", - LocalizableStrings.CmdFrameworkDescription, - Accept.ExactlyOneArgument() - .With(name: LocalizableStrings.CmdFramework) - .ForwardAsSingle(o => $"--framework {o.Arguments.Single()}")), - Create.Option("-n|--no-restore ", - LocalizableStrings.CmdNoRestoreDescription), - Create.Option("-s|--source", - LocalizableStrings.CmdSourceDescription, - Accept.ExactlyOneArgument() - .With(name: LocalizableStrings.CmdSource) - .ForwardAsSingle(o => $"--source {o.Arguments.Single()}")), - Create.Option("--package-directory", - LocalizableStrings.CmdPackageDirectoryDescription, - Accept.ExactlyOneArgument() - .With(name: LocalizableStrings.CmdPackageDirectory) - .ForwardAsSingle(o => $"--package-directory {o.Arguments.Single()}"))); - } - - public static IEnumerable QueryNuGet(string match) - { - var httpClient = new HttpClient(); - - Stream result; - - try - { - var cancellation = new CancellationTokenSource(TimeSpan.FromSeconds(10)); - var response = httpClient.GetAsync($"https://api-v2v3search-0.nuget.org/query?q={match}&skip=0&take=100&prerelease=true", cancellation.Token) - .Result; - - result = response.Content.ReadAsStreamAsync().Result; - } - catch (Exception) - { - yield break; - } - - JObject json; - using (var reader = new JsonTextReader(new StreamReader(result))) - { - json = JObject.Load(reader); - } - - foreach (var id in json["data"]) - { - yield return id["id"].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 deleted file mode 100644 index c18e94039..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/LocalizableStrings.resx +++ /dev/null @@ -1,165 +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 - - - .NET Add Package reference Command - - - Command to add package reference - - - The package reference to add. - - - Please specify one package reference to add. - - - Adds reference only when targeting a specific framework. - - - Adds reference without performing restore preview and compatibility check. - - - Specifies NuGet package sources to use during the restore. - - - Restores the packages to the specified directory. - - - Version for the package to be added. - - - Unable to create dependency graph file for project '{0}'. Cannot add package reference. - - - PACKAGE_NAME - - - VERSION - - - FRAMEWORK - - - SOURCE - - - PACKAGE_DIRECTORY - - \ 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 deleted file mode 100644 index a72a413a1..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/Program.cs +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Tools.MSBuild; -using Microsoft.DotNet.Tools.NuGet; - -namespace Microsoft.DotNet.Tools.Add.PackageReference -{ - internal class AddPackageReferenceCommand : CommandBase - { - private readonly AppliedOption _appliedCommand; - - private readonly string _packageId; - private readonly string _fileOrDirectory; - - public AddPackageReferenceCommand( - AppliedOption appliedCommand, - string fileOrDirectory, - ParseResult parseResult) : base(parseResult) - { - if (appliedCommand == null) - { - throw new ArgumentNullException(nameof(appliedCommand)); - } - if (fileOrDirectory == null) - { - throw new ArgumentNullException(nameof(fileOrDirectory)); - } - - _appliedCommand = appliedCommand; - _fileOrDirectory = fileOrDirectory; - _packageId = appliedCommand.Value(); - } - - protected override void ShowHelpOrErrorIfAppropriate(ParseResult parseResult) - { - if (parseResult.UnmatchedTokens.Any()) - { - throw new GracefulException(LocalizableStrings.SpecifyExactlyOnePackageReference); - } - - base.ShowHelpOrErrorIfAppropriate(parseResult); - } - - public override int Execute() - { - var projectFilePath = string.Empty; - - if (!File.Exists(_fileOrDirectory)) - { - projectFilePath = MsbuildProject.GetProjectFileFromDirectory(_fileOrDirectory).FullName; - } - else - { - projectFilePath = _fileOrDirectory; - } - - var tempDgFilePath = string.Empty; - - if (!_appliedCommand.HasOption("no-restore")) - { - // Create a Dependency Graph file for the project - tempDgFilePath = Path.GetTempFileName(); - GetProjectDependencyGraph(projectFilePath, tempDgFilePath); - } - - var result = NuGetCommand.Run( - TransformArgs( - _packageId, - tempDgFilePath, - projectFilePath)); - DisposeTemporaryFile(tempDgFilePath); - - return result; - } - - private void GetProjectDependencyGraph(string projectFilePath, string dgFilePath) - { - var args = new List(); - - // Pass the project file path - args.Add(projectFilePath); - - // Pass the task as generate restore Dependency Graph file - args.Add("/t:GenerateRestoreGraphFile"); - - // Pass Dependency Graph file output path - args.Add($"/p:RestoreGraphOutputPath=\"{dgFilePath}\""); - - // Turn off recursive restore - args.Add($"/p:RestoreRecursive=false"); - - // Turn off restore for Dotnet cli tool references so that we do not generate extra dg specs - args.Add($"/p:RestoreDotnetCliToolReferences=false"); - - // Output should not include MSBuild version header - args.Add("/nologo"); - - var result = new MSBuildForwardingApp(args).Execute(); - - if (result != 0) - { - throw new GracefulException(string.Format(LocalizableStrings.CmdDGFileException, projectFilePath)); - } - } - - private void DisposeTemporaryFile(string filePath) - { - if (File.Exists(filePath)) - { - File.Delete(filePath); - } - } - - private string[] TransformArgs(string packageId, string tempDgFilePath, string projectFilePath) - { - var args = new List - { - "package", - "add", - "--package", - packageId, - "--project", - projectFilePath - }; - - args.AddRange(_appliedCommand - .OptionValuesToBeForwarded() - .SelectMany(a => a.Split(' '))); - - if (_appliedCommand.HasOption("no-restore")) - { - args.Add("--no-restore"); - } - else - { - args.Add("--dg-file"); - args.Add(tempDgFilePath); - } - - return args.ToArray(); - } - } -} \ No newline at end of file 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 deleted file mode 100644 index 11241842a..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - .NET Add Package reference Command - Příkaz rozhraní .NET pro přidání odkazu na balíček - - - - Command to add package reference - Příkaz pro přidání odkazu na balíček - - - - Please specify one package reference to add. - Zadejte prosím jeden odkaz na balíček, který chcete přidat. - - - - Adds reference only when targeting a specific framework. - Přidá odkaz jen v případě, že cílem je konkrétní architektura. - - - - Adds reference without performing restore preview and compatibility check. - Přidá odkaz bez provedení náhledu obnovení a kontroly kompatibility. - - - - Specifies NuGet package sources to use during the restore. - Určuje zdroje balíčků NuGet, které se mají použít při obnovení. - - - - Restores the packages to the specified directory. - Obnoví balíčky do zadaného adresáře. - - - - Version for the package to be added. - Verze balíčku, která se má přidat. - - - - Unable to create dependency graph file for project '{0}'. Cannot add package reference. - Není možné vytvořit soubor grafu závislostí pro projekt {0}. Nelze přidat odkaz na balíček. - - - - VERSION - VERSION - - - - FRAMEWORK - FRAMEWORK - - - - SOURCE - SOURCE - - - - PACKAGE_DIRECTORY - PACKAGE_DIRECTORY - - - - The package reference to add. - Odkaz na balíček, který se má přidat - - - - PACKAGE_NAME - PACKAGE_NAME - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index 2ccf2d7be..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - .NET Add Package reference Command - .NET Add-Befehl für Paketverweise - - - - Command to add package reference - Befehl zum Hinzufügen eines Paketverweises - - - - Please specify one package reference to add. - Geben Sie einen Paketverweis an, der hinzugefügt werden soll. - - - - Adds reference only when targeting a specific framework. - Fügt nur bei Verwendung eines bestimmten Zielframeworks einen Verweis hinzu. - - - - Adds reference without performing restore preview and compatibility check. - Fügt ohne Durchführen einer Wiederherstellungsvorschau und einer Kompatibilitätsprüfung einen Verweis hinzu. - - - - Specifies NuGet package sources to use during the restore. - Gibt NuGet-Paketquellen für die Wiederherstellung an. - - - - Restores the packages to the specified directory. - Stellt die Pakete im angegebenen Verzeichnis wieder her. - - - - Version for the package to be added. - Version für das Paket, das hinzugefügt werden soll. - - - - Unable to create dependency graph file for project '{0}'. Cannot add package reference. - Die Abhängigkeitsdiagrammdatei für das Projekt "{0}" konnte nicht erstellt werden. Der Paketverweis kann nicht hinzugefügt werden. - - - - VERSION - VERSION - - - - FRAMEWORK - FRAMEWORK - - - - SOURCE - SOURCE - - - - PACKAGE_DIRECTORY - PACKAGE_DIRECTORY - - - - The package reference to add. - Der hinzuzufügende Paketverweis. - - - - PACKAGE_NAME - PACKAGE_NAME - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index 54fcd62ea..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - .NET Add Package reference Command - Comando de .NET para agregar referencia de paquete - - - - Command to add package reference - Comando para agregar referencia de paquete - - - - Please specify one package reference to add. - Especifique una referencia de paquete para agregar. - - - - Adds reference only when targeting a specific framework. - Agrega una referencia solo cuando el destino es una plataforma específica. - - - - Adds reference without performing restore preview and compatibility check. - Agrega una referencia sin realizar la vista previa de restauración y la comprobación de compatibilidad. - - - - Specifies NuGet package sources to use during the restore. - Especifica orígenes de paquete NuGet para usar durante la restauración. - - - - Restores the packages to the specified directory. - Restaura los paquetes en el directorio especificado. - - - - Version for the package to be added. - Versión del paquete que se va a agregar. - - - - Unable to create dependency graph file for project '{0}'. Cannot add package reference. - No se puede crear el archivo de gráfico de dependencias para el proyecto "{0}". No se puede agregar la referencia de paquete. - - - - VERSION - VERSIÓN - - - - FRAMEWORK - PLATAFORMA - - - - SOURCE - ORIGEN - - - - PACKAGE_DIRECTORY - DIRECTORIO_DE_PAQUETE - - - - The package reference to add. - La referencia de paquete para agregar. - - - - PACKAGE_NAME - PACKAGE_NAME - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index a3bbfa6a5..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - .NET Add Package reference Command - Commande Ajouter une référence de package .NET - - - - Command to add package reference - Commande permettant d'ajouter une référence de package - - - - Please specify one package reference to add. - Spécifiez au moins une référence de package à ajouter. - - - - Adds reference only when targeting a specific framework. - Ajoute une référence uniquement en cas de ciblage d'un framework spécifique. - - - - Adds reference without performing restore preview and compatibility check. - Ajoute une référence sans effectuer d'aperçu de restauration ni de vérification de compatibilité. - - - - Specifies NuGet package sources to use during the restore. - Spécifie les sources de package NuGet à utiliser durant la restauration. - - - - Restores the packages to the specified directory. - Restaure les packages dans le répertoire spécifié. - - - - Version for the package to be added. - Version du package à ajouter. - - - - Unable to create dependency graph file for project '{0}'. Cannot add package reference. - Impossible de créer le fichier de graphique de dépendance pour le projet '{0}'. Impossible d'ajouter la référence du package. - - - - VERSION - VERSION - - - - FRAMEWORK - FRAMEWORK - - - - SOURCE - SOURCE - - - - PACKAGE_DIRECTORY - PACKAGE_DIRECTORY - - - - The package reference to add. - Référence du package à ajouter. - - - - PACKAGE_NAME - PACKAGE_NAME - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index 8292d3314..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - .NET Add Package reference Command - Comando Aggiungi riferimento al pacchetto .NET - - - - Command to add package reference - Comando per aggiungere il riferimento al pacchetto - - - - Please specify one package reference to add. - Specificare almeno un riferimento al pacchetto da aggiungere. - - - - Adds reference only when targeting a specific framework. - Aggiunge il riferimento solo se destinato a un framework specifico. - - - - Adds reference without performing restore preview and compatibility check. - Aggiunge il riferimento senza eseguire l'anteprima di restore e la verifica della compatibilità. - - - - Specifies NuGet package sources to use during the restore. - Consente di specificare le origini pacchetto NuGet da usare durante il ripristino. - - - - Restores the packages to the specified directory. - Ripristina i pacchetti nella directory specificata. - - - - Version for the package to be added. - Versione del pacchetto da aggiungere. - - - - Unable to create dependency graph file for project '{0}'. Cannot add package reference. - Non è possibile creare il file del grafico dipendenze per il progetto '{0}'. Non è possibile aggiungere il riferimento al pacchetto. - - - - VERSION - VERSIONE - - - - FRAMEWORK - FRAMEWORK - - - - SOURCE - ORIGINE - - - - PACKAGE_DIRECTORY - DIRECTORY_PACCHETTO - - - - The package reference to add. - Riferimento al pacchetto da aggiungere. - - - - PACKAGE_NAME - NOME_PACCHETTO - - - - - \ 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 deleted file mode 100644 index 7170969df..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - .NET Add Package reference Command - .NET Add Package 参照コマンド - - - - Command to add package reference - パッケージ参照を追加するコマンド - - - - Please specify one package reference to add. - 追加するパッケージ参照を 1 つ指定してください。 - - - - Adds reference only when targeting a specific framework. - 特定のフレームワークを対象とする場合にのみ参照を追加します。 - - - - Adds reference without performing restore preview and compatibility check. - 復元のプレビューや互換性チェックを行わずに参照を追加します。 - - - - Specifies NuGet package sources to use during the restore. - 復元中に使用する NuGet パッケージ ソースを指定します。 - - - - Restores the packages to the specified directory. - 指定されたディレクトリにパッケージを復元します。 - - - - Version for the package to be added. - 追加するパッケージのバージョン。 - - - - Unable to create dependency graph file for project '{0}'. Cannot add package reference. - プロジェクト '{0}' の依存関係グラフ ファイルを作成できません。パッケージ参照を追加できません。 - - - - VERSION - VERSION - - - - FRAMEWORK - FRAMEWORK - - - - SOURCE - SOURCE - - - - PACKAGE_DIRECTORY - PACKAGE_DIRECTORY - - - - The package reference to add. - 追加するパッケージ参照。 - - - - PACKAGE_NAME - PACKAGE_NAME - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index d60e087eb..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - .NET Add Package reference Command - .NET 패키지 참조 추가 명령 - - - - Command to add package reference - 패키지 참조를 추가하는 명령 - - - - Please specify one package reference to add. - 추가할 하나의 패키지 참조를 지정하세요. - - - - Adds reference only when targeting a specific framework. - 특정 프레임워크를 대상으로 지정할 때에만 참조를 추가합니다. - - - - Adds reference without performing restore preview and compatibility check. - 미리 보기 복원 및 호환성 검사를 수행하지 않고 참조를 추가합니다. - - - - Specifies NuGet package sources to use during the restore. - 복원 중 사용할 NuGet 패키지 소스를 지정합니다. - - - - Restores the packages to the specified directory. - 패키지를 지정된 디렉터리에 복원합니다. - - - - Version for the package to be added. - 추가할 패키지의 버전입니다. - - - - Unable to create dependency graph file for project '{0}'. Cannot add package reference. - '{0}' 프로젝트에 대한 종속성 그래프 파일을 만들 수 없습니다. 패키지 참조를 추가할 수 없습니다. - - - - VERSION - VERSION - - - - FRAMEWORK - FRAMEWORK - - - - SOURCE - SOURCE - - - - PACKAGE_DIRECTORY - PACKAGE_DIRECTORY - - - - The package reference to add. - 추가할 패키지 참조입니다. - - - - PACKAGE_NAME - PACKAGE_NAME - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index 80aaba9ee..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - .NET Add Package reference Command - Polecenie dodawania odwołania do pakietu platformy .NET - - - - Command to add package reference - Polecenie umożliwiające dodanie odwołania do pakietu - - - - Please specify one package reference to add. - Podaj jedno odwołanie do pakietu, które ma zostać dodane. - - - - Adds reference only when targeting a specific framework. - Dodaje odwołanie tylko w przypadku określenia konkretnej platformy docelowej. - - - - Adds reference without performing restore preview and compatibility check. - Dodaje odwołanie bez tworzenia podglądu przywracania i sprawdzania zgodności. - - - - Specifies NuGet package sources to use during the restore. - Określa źródła pakietów NuGet podczas przywracania. - - - - Restores the packages to the specified directory. - Przywraca pakiety do określonego katalogu. - - - - Version for the package to be added. - Wersja pakietu do dodania. - - - - Unable to create dependency graph file for project '{0}'. Cannot add package reference. - Nie można utworzyć pliku wykresu tworzenia zależności dla projektu „{0}”. Nie można dodać odwołania do pakietu. - - - - VERSION - WERSJA - - - - FRAMEWORK - PLATFORMA - - - - SOURCE - ŹRÓDŁO - - - - PACKAGE_DIRECTORY - KATALOG_PAKIETU - - - - The package reference to add. - Odwołanie do pakietu do dodania. - - - - PACKAGE_NAME - NAZWA_PAKIETU - - - - - \ 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 deleted file mode 100644 index f99ea83f1..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - .NET Add Package reference Command - Comando de adicionar referência do pacote do .NET - - - - Command to add package reference - Comando para adicionar a referência do pacote - - - - Please specify one package reference to add. - Especifique uma referência do pacote a ser adicionada. - - - - Adds reference only when targeting a specific framework. - Adiciona referência apenas ao definir uma estrutura específica como destino. - - - - Adds reference without performing restore preview and compatibility check. - Adiciona referência sem executar a visualização da restauração e a verificação de compatibilidade. - - - - Specifies NuGet package sources to use during the restore. - Especifica as fontes de pacote NuGet a serem usadas durante a restauração. - - - - Restores the packages to the specified directory. - Restaura os pacotes para o diretório especificado. - - - - Version for the package to be added. - Versão do pacote a ser adicionada. - - - - Unable to create dependency graph file for project '{0}'. Cannot add package reference. - Não é possível criar o arquivo de gráfico de dependência para o projeto '{0}'. Não é possível adicionar a referência do pacote. - - - - VERSION - VERSION - - - - FRAMEWORK - FRAMEWORK - - - - SOURCE - ORIGEM - - - - PACKAGE_DIRECTORY - PACKAGE_DIRECTORY - - - - The package reference to add. - A referência do pacote a adicionar. - - - - PACKAGE_NAME - PACKAGE_NAME - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index 3f749fa66..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - .NET Add Package reference Command - Команда добавления ссылки на пакет .NET - - - - Command to add package reference - Команда добавления ссылки на пакет - - - - Please specify one package reference to add. - Укажите одну добавляемую ссылку на пакет. - - - - Adds reference only when targeting a specific framework. - Добавляет ссылку только при выборе конкретной целевой платформы. - - - - Adds reference without performing restore preview and compatibility check. - Добавляет ссылку без предварительной проверки восстановления и совместимости. - - - - Specifies NuGet package sources to use during the restore. - Указывает источники пакетов NuGet, используемые во время восстановления. - - - - Restores the packages to the specified directory. - Восстанавливает пакеты в указанном каталоге. - - - - Version for the package to be added. - Версия добавляемого пакета. - - - - Unable to create dependency graph file for project '{0}'. Cannot add package reference. - Не удалось создать файл графа зависимостей для проекта "{0}". Невозможно добавить ссылку на пакет. - - - - VERSION - VERSION - - - - FRAMEWORK - FRAMEWORK - - - - SOURCE - SOURCE - - - - PACKAGE_DIRECTORY - PACKAGE_DIRECTORY - - - - The package reference to add. - Добавляемая ссылка на пакет. - - - - PACKAGE_NAME - PACKAGE_NAME - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index 3b3214f1c..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - .NET Add Package reference Command - .NET Paket Başvurusu Ekleme Komutu - - - - Command to add package reference - Paket başvurusu ekleme komutu - - - - Please specify one package reference to add. - Lütfen eklenecek paket başvurusunu belirtin. - - - - Adds reference only when targeting a specific framework. - Yalnızca belirli bir çerçeveyi hedeflerken başvuru ekler. - - - - Adds reference without performing restore preview and compatibility check. - Geri yükleme önizlemesi ve uyumluluk denetimi gerçekleştirmeden başvuru ekler. - - - - Specifies NuGet package sources to use during the restore. - Geri yükleme sırasında kullanılacak NuGet paketi kaynaklarını belirtir. - - - - Restores the packages to the specified directory. - Paketleri belirtilen dizine geri yükler. - - - - Version for the package to be added. - Eklenecek paketin sürümü. - - - - Unable to create dependency graph file for project '{0}'. Cannot add package reference. - '{0}' projesi için bağımlılık grafiği dosyası oluşturulamadı. Paket başvurusu eklenemiyor. - - - - VERSION - SÜRÜM - - - - FRAMEWORK - ÇERÇEVE - - - - SOURCE - SOURCE - - - - PACKAGE_DIRECTORY - PACKAGE_DIRECTORY - - - - The package reference to add. - Eklenecek paket başvurusu. - - - - PACKAGE_NAME - PACKAGE_NAME - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.xlf deleted file mode 100644 index cb7dc33f1..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - .NET Add Package reference Command - - - - Command to add package reference - - - - Please specify one package reference to add. - - - - Adds reference only when targeting a specific framework. - - - - Adds reference without performing restore preview and compatibility check. - - - - Specifies NuGet package sources to use during the restore. - - - - Restores the packages to the specified directory. - - - - Version for the package to be added. - - - - Unable to create dependency graph file for project '{0}'. Cannot add package reference. - - - - VERSION - - - - FRAMEWORK - - - - SOURCE - - - - PACKAGE_DIRECTORY - - - - The package reference to add. - - - - PACKAGE_NAME - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index 288e9561f..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - .NET Add Package reference Command - .NET 添加包引用命令 - - - - Command to add package reference - 添加包引用的命令 - - - - Please specify one package reference to add. - 请指定一个要添加的包引用。 - - - - Adds reference only when targeting a specific framework. - 仅针对特定框架添加引用。 - - - - Adds reference without performing restore preview and compatibility check. - 在没有执行还原预览和兼容性检查的情况下添加引用。 - - - - Specifies NuGet package sources to use during the restore. - 使用还原期间所用的特定 NuGet 包源。 - - - - Restores the packages to the specified directory. - 将包还原到指定目录。 - - - - Version for the package to be added. - 要添加的包的版本。 - - - - Unable to create dependency graph file for project '{0}'. Cannot add package reference. - 无法为项目“{0}”创建依赖关系图文件。无法添加包引用。 - - - - VERSION - VERSION - - - - FRAMEWORK - FRAMEWORK - - - - SOURCE - SOURCE - - - - PACKAGE_DIRECTORY - PACKAGE_DIRECTORY - - - - The package reference to add. - 要添加的包引用。 - - - - PACKAGE_NAME - PACKAGE_NAME - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index 320a7ccd8..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-package/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - .NET Add Package reference Command - .NET 新增套件參考命令 - - - - Command to add package reference - 用以新增套件參考的命令 - - - - Please specify one package reference to add. - 請指定一個要新增的套件參考。 - - - - Adds reference only when targeting a specific framework. - 只有在以特定架構為目標時才新增參考。 - - - - Adds reference without performing restore preview and compatibility check. - 無須執行還原預覽及相容性檢查,即可新增參考。 - - - - Specifies NuGet package sources to use during the restore. - 指定在還原期間要使用的 NuGet 套件來源。 - - - - Restores the packages to the specified directory. - 將套件還原到指定目錄。 - - - - Version for the package to be added. - 要新增的套件版本。 - - - - Unable to create dependency graph file for project '{0}'. Cannot add package reference. - 無法為專案 '{0}' 建立相依性關係圖檔案。無法新增套件參考。 - - - - VERSION - VERSION - - - - FRAMEWORK - FRAMEWORK - - - - SOURCE - SOURCE - - - - PACKAGE_DIRECTORY - PACKAGE_DIRECTORY - - - - The package reference to add. - 要新增的套件參考。 - - - - PACKAGE_NAME - PACKAGE_NAME - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-proj/LocalizableStrings.resx b/src/dotnet/commands/dotnet-add/dotnet-add-proj/LocalizableStrings.resx deleted file mode 100644 index a5810e897..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-proj/LocalizableStrings.resx +++ /dev/null @@ -1,129 +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 - - - .NET Add Project to Solution Command - - - Command to add project to solution - - - Projects to add to solution - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index 944be9708..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Add Project to Solution Command - Příkaz rozhraní .NET pro přidání projektu do řešení - - - - Command to add project to solution - Příkaz pro přidání projektu do řešení - - - - Projects to add to solution - Projekty přidané do řešení - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index ed33e3f3d..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Add Project to Solution Command - .NET-Befehl zum Hinzufügen eines Projekts zur Projektmappe - - - - Command to add project to solution - Befehl zum Hinzufügen eines Projekts zur Projektmappe - - - - Projects to add to solution - Zur Projektmappe hinzuzufügende Projekte - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index f9d1dab81..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Add Project to Solution Command - Comando de .NET Agregar proyecto a solución - - - - Command to add project to solution - Comando para agregar un proyecto a una solución - - - - Projects to add to solution - Proyectos que se agregarán a la solución - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index 2323b4ba9..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Add Project to Solution Command - Commande .NET d'ajout de projet à une solution - - - - Command to add project to solution - Commande d'ajout de projet à une solution - - - - Projects to add to solution - Projets à ajouter à la solution - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index 9f5b6b257..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Add Project to Solution Command - Comando Aggiungi progetto a soluzione .NET - - - - Command to add project to solution - Comando per aggiungere il progetto alla soluzione - - - - Projects to add to solution - Progetti da aggiungere alla soluzione - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index 7db8904d8..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Add Project to Solution Command - .NET Add Project to Solution コマンド - - - - Command to add project to solution - ソリューションにプロジェクトを追加するコマンド - - - - Projects to add to solution - ソリューションに追加するプロジェクト - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index 5b6e02c56..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Add Project to Solution Command - .NET 솔루션에 프로젝트 추가 명령 - - - - Command to add project to solution - 솔루션에 프로젝트를 추가하기 위한 명령입니다. - - - - Projects to add to solution - 솔루션에 추가할 프로젝트 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index 7c8e0049f..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Add Project to Solution Command - Polecenie dodawania projektu do rozwiązania dla platformy .NET - - - - Command to add project to solution - Polecenie umożliwiające dodanie projektu do rozwiązania - - - - Projects to add to solution - Projekty, które mają zostać dodane do rozwiązania - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index 1b3694bb4..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Add Project to Solution Command - Comando Adicionar Projeto à Solução do .NET - - - - Command to add project to solution - Comando para adicionar o projeto à solução - - - - Projects to add to solution - Projetos a serem adicionados à solução - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index e609e17f9..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Add Project to Solution Command - Команда .NET "Добавить проект в решение" - - - - Command to add project to solution - Команда для добавления проекта в решение - - - - Projects to add to solution - Проекты, добавляемые в решение - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index ab0b0c18b..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Add Project to Solution Command - .NET Çözüme Proje Ekleme Komutu - - - - Command to add project to solution - Çözüme proje ekleme komutu - - - - Projects to add to solution - Çözüme eklenecek projeler - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.xlf deleted file mode 100644 index 34201b21a..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - .NET Add Project to Solution Command - - - - Command to add project to solution - - - - Projects to add to solution - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index e49d0c2b1..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Add Project to Solution Command - .NET 将项目添加到解决方案命令 - - - - Command to add project to solution - 将项目添加到解决方案的命令 - - - - Projects to add to solution - 要添加到解决方案的项目 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index b24ad1c7f..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-proj/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Add Project to Solution Command - .NET 將專案新增至解決方案命令 - - - - Command to add project to solution - 命令,將專案新增至解決方案 - - - - Projects to add to solution - 要新增至解決方案的專案 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/AddProjectToProjectReferenceParser.cs b/src/dotnet/commands/dotnet-add/dotnet-add-reference/AddProjectToProjectReferenceParser.cs deleted file mode 100644 index 417e2f97c..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/AddProjectToProjectReferenceParser.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Cli.CommandLine; -using LocalizableStrings = Microsoft.DotNet.Tools.Add.ProjectToProjectReference.LocalizableStrings; - -namespace Microsoft.DotNet.Cli -{ - internal static class AddProjectToProjectReferenceParser - { - public static Command AddProjectReference() - { - return Create.Command( - "reference", - LocalizableStrings.AppFullName, - Accept.OneOrMoreArguments() - .With(name: "args", - description: LocalizableStrings.AppHelpText), - CommonOptions.HelpOption(), - Create.Option("-f|--framework", LocalizableStrings.CmdFrameworkDescription, - Accept.ExactlyOneArgument() - .WithSuggestionsFrom(_ => Suggest.TargetFrameworksFromProjectFile()) - .With(name: Tools.Add.PackageReference.LocalizableStrings.CmdFramework))); - } - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/LocalizableStrings.resx b/src/dotnet/commands/dotnet-add/dotnet-add-reference/LocalizableStrings.resx deleted file mode 100644 index 3dc5538e3..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/LocalizableStrings.resx +++ /dev/null @@ -1,132 +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 - - - .NET Add Project to Project reference Command - - - Command to add project to project reference - - - Project to project references to add - - - Add reference only when targeting a specific framework - - \ 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 deleted file mode 100644 index 72498b37f..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/Program.cs +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using Microsoft.Build.Evaluation; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Tools.Common; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Tools.Add.ProjectToProjectReference -{ - internal class AddProjectToProjectReferenceCommand : CommandBase - { - private readonly AppliedOption _appliedCommand; - private readonly string _fileOrDirectory; - - public AddProjectToProjectReferenceCommand( - AppliedOption appliedCommand, - string fileOrDirectory, - ParseResult parseResult) : base(parseResult) - { - if (appliedCommand == null) - { - throw new ArgumentNullException(nameof(appliedCommand)); - } - if (fileOrDirectory == null) - { - throw new ArgumentNullException(nameof(fileOrDirectory)); - } - - _appliedCommand = appliedCommand; - _fileOrDirectory = fileOrDirectory; - } - - public override int Execute() - { - var projects = new ProjectCollection(); - MsbuildProject msbuildProj = MsbuildProject.FromFileOrDirectory(projects, _fileOrDirectory); - - var frameworkString = _appliedCommand.ValueOrDefault("framework"); - - PathUtility.EnsureAllPathsExist(_appliedCommand.Arguments, CommonLocalizableStrings.ReferenceDoesNotExist); - List refs = _appliedCommand.Arguments - .Select((r) => MsbuildProject.FromFile(projects, r)) - .ToList(); - - if (frameworkString == null) - { - foreach (var tfm in msbuildProj.GetTargetFrameworks()) - { - foreach (var @ref in refs) - { - if (!@ref.CanWorkOnFramework(tfm)) - { - Reporter.Error.Write(GetProjectNotCompatibleWithFrameworksDisplayString( - @ref, - msbuildProj.GetTargetFrameworks().Select((fx) => fx.GetShortFolderName()))); - return 1; - } - } - } - } - else - { - var framework = NuGetFramework.Parse(frameworkString); - if (!msbuildProj.IsTargetingFramework(framework)) - { - Reporter.Error.WriteLine(string.Format( - CommonLocalizableStrings.ProjectDoesNotTargetFramework, - msbuildProj.ProjectRootElement.FullPath, - frameworkString)); - return 1; - } - - foreach (var @ref in refs) - { - if (!@ref.CanWorkOnFramework(framework)) - { - Reporter.Error.Write(GetProjectNotCompatibleWithFrameworksDisplayString( - @ref, - new string[] { frameworkString })); - return 1; - } - } - } - - var relativePathReferences = _appliedCommand.Arguments.Select((r) => - PathUtility.GetRelativePath(msbuildProj.ProjectDirectory, Path.GetFullPath(r))) - .ToList(); - - int numberOfAddedReferences = msbuildProj.AddProjectToProjectReferences( - frameworkString, - relativePathReferences); - - if (numberOfAddedReferences != 0) - { - msbuildProj.ProjectRootElement.Save(); - } - - return 0; - } - - private static string GetProjectNotCompatibleWithFrameworksDisplayString(MsbuildProject project, IEnumerable frameworksDisplayStrings) - { - var sb = new StringBuilder(); - sb.AppendLine(string.Format(CommonLocalizableStrings.ProjectNotCompatibleWithFrameworks, project.ProjectRootElement.FullPath)); - foreach (var tfm in frameworksDisplayStrings) - { - sb.AppendLine($" - {tfm}"); - } - - return sb.ToString(); - } - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index fc67fb3d8..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Add Project to Project reference Command - Příkaz rozhraní .NET pro přidání odkazu mezi projekty - - - - Command to add project to project reference - Příkaz pro přidání odkazu mezi projekty - - - - Project to project references to add - Přidávané odkazy mezi projekty - - - - Add reference only when targeting a specific framework - Přidat odkaz jen v případě, že cílem je konkrétní architektura - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index 8a59897ac..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Add Project to Project reference Command - .NET-Befehl zum Hinzufügen von Projekt-zu-Projekt-Verweisen - - - - Command to add project to project reference - Befehl zum Hinzufügen eines Projekt-zu-Projekt-Verweises - - - - Project to project references to add - Hinzuzufügender Projekt-zu-Projekt-Verweis - - - - Add reference only when targeting a specific framework - Verweis nur bei Verwendung eines bestimmten Zielframeworks hinzufügen - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index c92b59d8f..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Add Project to Project reference Command - Comando de .NET para agregar una referencia de proyecto a proyecto - - - - Command to add project to project reference - Comando para agregar una referencia de proyecto a proyecto - - - - Project to project references to add - Referencias de proyecto a proyecto para agregar - - - - Add reference only when targeting a specific framework - Agrega una referencia solo cuando el destino es una plataforma específica. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index a01a6831b..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Add Project to Project reference Command - Commande .NET Ajouter une référence projet à projet - - - - Command to add project to project reference - Commande permettant d'ajouter le projet à la référence du projet - - - - Project to project references to add - Références projet à projet à ajouter - - - - Add reference only when targeting a specific framework - Ajouter une référence uniquement en cas de ciblage d'un framework spécifique - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index b75d26ea5..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Add Project to Project reference Command - Comando Aggiungi riferimento P2P (da progetto a progetto) .NET - - - - Command to add project to project reference - Comando per aggiungere il riferimento P2P (da progetto a progetto) - - - - Project to project references to add - Riferimenti P2P (da progetto a progetto) da aggiungere - - - - Add reference only when targeting a specific framework - Aggiunge il riferimento solo se destinato a un framework specifico - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index b81b235b4..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Add Project to Project reference Command - .NET Add Project to Project reference コマンド - - - - Command to add project to project reference - プロジェクト間参照を追加するコマンド - - - - Project to project references to add - 追加するプロジェクト間参照 - - - - Add reference only when targeting a specific framework - 特定のフレームワークを対象とする場合にのみ参照を追加します - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index dbb0c0067..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Add Project to Project reference Command - .NET 프로젝트 간 참조 추가 명령 - - - - Command to add project to project reference - 프로젝트 간 참조 추가 명령 - - - - Project to project references to add - 추가할 프로젝트 간 참조입니다. - - - - Add reference only when targeting a specific framework - 특정 프레임워크를 대상으로 지정할 때에만 참조를 추가합니다. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index 852929962..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Add Project to Project reference Command - Polecenie dodawania odwołania między projektami dla platformy .NET - - - - Command to add project to project reference - Polecenie służące do dodawania odwołania między projektami - - - - Project to project references to add - Odwołania między projektami, które mają zostać dodane - - - - Add reference only when targeting a specific framework - Dodaje odwołanie tylko w przypadku określenia konkretnej platformy docelowej - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index 943170002..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Add Project to Project reference Command - Comando Adicionar Referência de Projeto para Projeto do .NET - - - - Command to add project to project reference - Comando para adicionar a referência de projeto para projeto - - - - Project to project references to add - Referências de projeto para projeto a serem adicionadas - - - - Add reference only when targeting a specific framework - Adicionar referência apenas ao definir uma estrutura específica como destino - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index 9e38aa357..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Add Project to Project reference Command - Команда .NET "Добавить ссылку из одного проекта на другой" - - - - Command to add project to project reference - Эта команда добавляет ссылку из одного проекта на другой - - - - Project to project references to add - Добавляемые ссылки проекта на проект. - - - - Add reference only when targeting a specific framework - Добавлять ссылку только при выборе конкретной целевой платформы - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index 2c3bb8a24..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Add Project to Project reference Command - .NET Projeden Projeye başvuru ekle Komutu - - - - Command to add project to project reference - Projeden Projeye başvuru ekleme komutu - - - - Project to project references to add - Eklenecek olan, projeden projeye başvurular - - - - Add reference only when targeting a specific framework - Yalnızca belirli bir çerçeveyi hedeflerken başvuru ekler - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.xlf deleted file mode 100644 index d792b5ef3..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - .NET Add Project to Project reference Command - - - - Command to add project to project reference - - - - Project to project references to add - - - - Add reference only when targeting a specific framework - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index 9527c71ca..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Add Project to Project reference Command - .NET“添加项目到项目引用”命令 - - - - Command to add project to project reference - 用于添加项目到项目引用的命令 - - - - Project to project references to add - 要添加的项目到项目引用 - - - - Add reference only when targeting a specific framework - 仅针对特定框架添加引用 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index 893e55c64..000000000 --- a/src/dotnet/commands/dotnet-add/dotnet-add-reference/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Add Project to Project reference Command - .NET 新增專案對專案參考命令 - - - - Command to add project to project reference - 用以新增專案對專案參考的命令 - - - - Project to project references to add - 要新增的專案對專案參考 - - - - Add reference only when targeting a specific framework - 只有在以特定架構為目標時才新增參考 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index 4f1679c24..000000000 --- a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Add Command - Příkaz rozhraní .NET pro přidání - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index 827d18d0e..000000000 --- a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Add Command - .NET-Befehl "Add" - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index 8c041cfa7..000000000 --- a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Add Command - Comando Add de .NET - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index 9b8445ea9..000000000 --- a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Add Command - Commande d'ajout .NET - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index e78e593a7..000000000 --- a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Add Command - Comando Aggiungi .NET - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index 491dd67b2..000000000 --- a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Add Command - .NET Add コマンド - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index 19af5ac2b..000000000 --- a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Add Command - .NET 추가 명령 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index 1ac1b6abf..000000000 --- a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Add Command - Polecenie add platformy .NET - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index 843c2e0bf..000000000 --- a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Add Command - Comando Add do .NET - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index 224911ab8..000000000 --- a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Add Command - Команда .NET "Добавить" - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index a6865dcef..000000000 --- a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Add Command - .NET Add Komutu - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.xlf deleted file mode 100644 index 598de6d0e..000000000 --- a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - .NET Add Command - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index 873cc9000..000000000 --- a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Add Command - .NET 添加命令 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index c395916db..000000000 --- a/src/dotnet/commands/dotnet-add/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Add Command - .NET 新增命令 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/BuildCommand.cs b/src/dotnet/commands/dotnet-build/BuildCommand.cs deleted file mode 100644 index c7127353b..000000000 --- a/src/dotnet/commands/dotnet-build/BuildCommand.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Tools.MSBuild; -using Microsoft.DotNet.Tools; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Tools.Restore; -using Parser = Microsoft.DotNet.Cli.Parser; - -namespace Microsoft.DotNet.Tools.Build -{ - public class BuildCommand : RestoringCommand - { - public BuildCommand( - IEnumerable msbuildArgs, - IEnumerable userDefinedArguments, - IEnumerable trailingArguments, - bool noRestore, - string msbuildPath = null) - : base(msbuildArgs, userDefinedArguments, trailingArguments, noRestore, msbuildPath) - { - } - - public static BuildCommand FromArgs(string[] args, string msbuildPath = null) - { - var msbuildArgs = new List(); - - var parser = Parser.Instance; - - var result = parser.ParseFrom("dotnet build", args); - - result.ShowHelpOrErrorIfAppropriate(); - - var appliedBuildOptions = result["dotnet"]["build"]; - - if (appliedBuildOptions.HasOption("--no-incremental")) - { - msbuildArgs.Add("/t:Rebuild"); - } - else - { - msbuildArgs.Add("/t:Build"); - } - - msbuildArgs.AddRange(appliedBuildOptions.OptionValuesToBeForwarded()); - - msbuildArgs.AddRange(appliedBuildOptions.Arguments); - - msbuildArgs.Add($"/clp:Summary"); - - bool noRestore = appliedBuildOptions.HasOption("--no-restore"); - - return new BuildCommand( - msbuildArgs, - appliedBuildOptions.OptionValuesToBeForwarded(), - appliedBuildOptions.Arguments, - noRestore, - msbuildPath); - } - - public static int Run(string[] args) - { - DebugHelper.HandleDebugSwitch(ref args); - - BuildCommand cmd; - - try - { - cmd = FromArgs(args); - } - catch (CommandCreationException e) - { - return e.ExitCode; - } - - return cmd.Execute(); - } - } -} diff --git a/src/dotnet/commands/dotnet-build/BuildCommandParser.cs b/src/dotnet/commands/dotnet-build/BuildCommandParser.cs deleted file mode 100644 index 76da0258e..000000000 --- a/src/dotnet/commands/dotnet-build/BuildCommandParser.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Tools; -using LocalizableStrings = Microsoft.DotNet.Tools.Build.LocalizableStrings; - -namespace Microsoft.DotNet.Cli -{ - internal static class BuildCommandParser - { - public static Command Build() => - CreateWithRestoreOptions.Command( - "build", - LocalizableStrings.AppFullName, - Accept.ZeroOrMoreArguments() - .With(name: CommonLocalizableStrings.CmdProjectFile, - description: - "The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file."), - CommonOptions.HelpOption(), - Create.Option( - "-o|--output", - LocalizableStrings.OutputOptionDescription, - Accept.ExactlyOneArgument() - .With(name: LocalizableStrings.OutputOptionName) - .ForwardAsSingle(o => $"/p:OutputPath={o.Arguments.Single()}")), - CommonOptions.FrameworkOption(), - CommonOptions.RuntimeOption(), - CommonOptions.ConfigurationOption(), - CommonOptions.VersionSuffixOption(), - Create.Option( - "--no-incremental", - LocalizableStrings.NoIncrementialOptionDescription), - Create.Option( - "--no-dependencies", - LocalizableStrings.NoDependenciesOptionDescription, - Accept.NoArguments() - .ForwardAs("/p:BuildProjectReferences=false")), - CommonOptions.NoRestoreOption(), - CommonOptions.VerbosityOption()); - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/LocalizableStrings.resx b/src/dotnet/commands/dotnet-build/LocalizableStrings.resx deleted file mode 100644 index 418c52506..000000000 --- a/src/dotnet/commands/dotnet-build/LocalizableStrings.resx +++ /dev/null @@ -1,138 +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 - - - Builder for the .NET Platform. Delegates to the MSBuild 'Build' target in the project file. - - - .NET Builder - - - Set this flag to ignore project-to-project references and only build the root project - - - Disables incremental build. - - - Output directory in which to place built artifacts. - - - OUTPUT_DIR - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index b4fbe8539..000000000 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - Builder for the .NET Platform. Delegates to the MSBuild 'Build' target in the project file. - Tvůrce pro platformu .NET Deleguje do MSBuildu cíl buildu v souboru projektu. - - - - .NET Builder - .NET Builder - - - - Set this flag to ignore project-to-project references and only build the root project - Když nastavíte tento příznak, ignorují se odkazy mezi projekty a sestaví se jenom kořenový projekt. - - - - Disables incremental build. - Přírůstkové sestavení se vypne. - - - - Output directory in which to place built artifacts. - Výstupní adresář, do kterého se ukládají sestavené artefakty. - - - - OUTPUT_DIR - OUTPUT_DIR - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index 12cc5dc46..000000000 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - Builder for the .NET Platform. Delegates to the MSBuild 'Build' target in the project file. - Generator für die .NET-Plattform. Delegiert an das MSBuild-Ziel "Build" in der Projektdatei. - - - - .NET Builder - .NET-Generator - - - - Set this flag to ignore project-to-project references and only build the root project - Legen Sie dieses Flag fest, um Projekt-zu-Projekt-Verweise zu ignorieren und nur das Stammprojekt zu erstellen. - - - - Disables incremental build. - Deaktiviert die inkrementelle Erstellung. - - - - Output directory in which to place built artifacts. - Ausgabeverzeichnis, in dem erstellte Artefakte abgelegt werden. - - - - OUTPUT_DIR - OUTPUT_DIR - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index 9af91f360..000000000 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - Builder for the .NET Platform. Delegates to the MSBuild 'Build' target in the project file. - Generador para la plataforma .NET. Delega en el destino “Build” de MSBuild del archivo del proyecto. - - - - .NET Builder - Generador para .NET - - - - Set this flag to ignore project-to-project references and only build the root project - Establezca esta marca para omitir las referencias de proyecto a proyecto y compilar solo el proyecto raíz - - - - Disables incremental build. - Deshabilita la compilación incremental. - - - - Output directory in which to place built artifacts. - Directorio de salida en el que se ubicarán los artefactos compilados. - - - - OUTPUT_DIR - DIRECTORIO_DE_SALIDA - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index 1d50fcdbc..000000000 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - Builder for the .NET Platform. Delegates to the MSBuild 'Build' target in the project file. - Générateur pour la plateforme .NET. Délègue à la cible 'Build' MSBuild dans le fichier projet. - - - - .NET Builder - Générateur .NET - - - - Set this flag to ignore project-to-project references and only build the root project - Définir cet indicateur pour ignorer les références de projet à projet et générer uniquement le projet racine - - - - Disables incremental build. - Désactive la build incrémentielle. - - - - Output directory in which to place built artifacts. - Répertoire de sortie dans lequel placer les artefacts de build. - - - - OUTPUT_DIR - OUTPUT_DIR - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index 294cd2a08..000000000 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - Builder for the .NET Platform. Delegates to the MSBuild 'Build' target in the project file. - Generatore per la piattaforma .NET. Delegati per la destinazione 'Build' di MSBuild nel file di progetto. - - - - .NET Builder - Generatore .NET - - - - Set this flag to ignore project-to-project references and only build the root project - Impostare questo flag per ignorare i riferimenti P2P (da progetto a progetto) e compilare solo il progetto radice - - - - Disables incremental build. - Disabilita la compilazione incrementale. - - - - Output directory in which to place built artifacts. - Directory di output in cui inserire gli artefatti compilati. - - - - OUTPUT_DIR - DIR_OUTPUT - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index 33485abf8..000000000 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - Builder for the .NET Platform. Delegates to the MSBuild 'Build' target in the project file. - .NET Platform 用ビルダープロジェクト ファイル内の MSBuild 'Build' ターゲットへのデリゲート。 - - - - .NET Builder - .NET ビルダー - - - - Set this flag to ignore project-to-project references and only build the root project - プロジェクト間参照を無視して、ルート プロジェクトのみを構築するには、このフラグを設定します - - - - Disables incremental build. - インクリメンタル ビルドを無効にします。 - - - - Output directory in which to place built artifacts. - ビルド成果物を配置する出力ディレクトリ。 - - - - OUTPUT_DIR - OUTPUT_DIR - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index de290752b..000000000 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - Builder for the .NET Platform. Delegates to the MSBuild 'Build' target in the project file. - .NET 플랫폼용 작성기입니다. 프로젝트 파일의 MSBuild '빌드' 대상에 위임합니다. - - - - .NET Builder - .NET 작성기 - - - - Set this flag to ignore project-to-project references and only build the root project - p2p(프로젝트 간) 참조를 무시하고 루트 프로젝트만 빌드하려면 이 플래그를 설정합니다. - - - - Disables incremental build. - 증분 빌드를 사용하지 않습니다. - - - - Output directory in which to place built artifacts. - 빌드된 아티팩트를 배치할 출력 디렉터리입니다. - - - - OUTPUT_DIR - OUTPUT_DIR - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index 7025448a9..000000000 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - Builder for the .NET Platform. Delegates to the MSBuild 'Build' target in the project file. - Konstruktor dla platformy .NET. Deleguje do docelowego elementu kompilacji programu MSBuild w pliku projektu. - - - - .NET Builder - Konstruktor platformy .NET - - - - Set this flag to ignore project-to-project references and only build the root project - Ustaw tę flagę, aby ignorować odwołania między projektami i skompilować tylko projekt główny - - - - Disables incremental build. - Wyłącza kompilację przyrostową. - - - - Output directory in which to place built artifacts. - Katalog wyjściowy, w którym mają zostać umieszczone skompilowane artefakty. - - - - OUTPUT_DIR - KATALOG_WYJŚCIOWY - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index 7ae9fc8b4..000000000 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - Builder for the .NET Platform. Delegates to the MSBuild 'Build' target in the project file. - Construtor para a Plataforma .NET. Delega para o destino “Build” do MSBuild no arquivo de projeto. - - - - .NET Builder - Construtor do .NET - - - - Set this flag to ignore project-to-project references and only build the root project - Defina esse sinalizador para ignorar as referências projeto a projeto e compilar apenas o projeto raiz - - - - Disables incremental build. - Desabilita o build incremental. - - - - Output directory in which to place built artifacts. - Diretório de saída no qual os artefatos compilados serão colocados. - - - - OUTPUT_DIR - OUTPUT_DIR - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index fb177168b..000000000 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - Builder for the .NET Platform. Delegates to the MSBuild 'Build' target in the project file. - Построитель для платформы .NET Делегирование в цель "Сборка" MSBuild в файле проекта. - - - - .NET Builder - Построитель .NET - - - - Set this flag to ignore project-to-project references and only build the root project - Задайте этот флаг, чтобы пропускать ссылки проектов на проекты и выполнять сборку только корневого проекта. - - - - Disables incremental build. - Отключение инкрементной сборки. - - - - Output directory in which to place built artifacts. - Выходной каталог для размещения созданных артефактов. - - - - OUTPUT_DIR - OUTPUT_DIR - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index c521f8301..000000000 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - Builder for the .NET Platform. Delegates to the MSBuild 'Build' target in the project file. - .NET Platformu için oluşturucu. Proje dosyasındaki MSBuild 'Build' hedefine temsilci atar. - - - - .NET Builder - .NET Oluşturucusu - - - - Set this flag to ignore project-to-project references and only build the root project - Projeden projeye başvuruları yoksaymak ve yalnızca kök projeyi derlemek için bu bayrağı ayarlayın - - - - Disables incremental build. - Artımlı derlemeyi devre dışı bırakır. - - - - Output directory in which to place built artifacts. - Derlenen yapıtların yerleştirileceği çıkış dizini. - - - - OUTPUT_DIR - ÇIKIŞ_DİZİNİ - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.xlf deleted file mode 100644 index 2e1630d6f..000000000 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - Builder for the .NET Platform. Delegates to the MSBuild 'Build' target in the project file. - - - - .NET Builder - - - - Set this flag to ignore project-to-project references and only build the root project - - - - Disables incremental build. - - - - Output directory in which to place built artifacts. - - - - OUTPUT_DIR - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index d19b0876a..000000000 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - Builder for the .NET Platform. Delegates to the MSBuild 'Build' target in the project file. - 适用于.NET 平台的生成器。委托项目文件中 MSBuild“生成”目标。 - - - - .NET Builder - .NET 生成器 - - - - Set this flag to ignore project-to-project references and only build the root project - 设置此标志以忽略项目到项目引用,仅生成根项目 - - - - Disables incremental build. - 禁用增量生成。 - - - - Output directory in which to place built artifacts. - 用于放置生成项目的输出目录。 - - - - OUTPUT_DIR - OUTPUT_DIR - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index 28e2dd097..000000000 --- a/src/dotnet/commands/dotnet-build/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - Builder for the .NET Platform. Delegates to the MSBuild 'Build' target in the project file. - 適用於 .NET 平台的產生器。委派給專案檔中的 MSBuild 'Build' 目標。 - - - - .NET Builder - .NET 產生器 - - - - Set this flag to ignore project-to-project references and only build the root project - 將此旗標設定為略過專案對專案參考並僅建置根專案 - - - - Disables incremental build. - 停用累加建置。 - - - - Output directory in which to place built artifacts. - 要放置建置成品的輸出目錄。 - - - - OUTPUT_DIR - OUTPUT_DIR - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/CleanCommandParser.cs b/src/dotnet/commands/dotnet-clean/CleanCommandParser.cs deleted file mode 100644 index c88d1ede9..000000000 --- a/src/dotnet/commands/dotnet-clean/CleanCommandParser.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; -using LocalizableStrings = Microsoft.DotNet.Tools.Clean.LocalizableStrings; - -namespace Microsoft.DotNet.Cli -{ - internal static class CleanCommandParser - { - public static Command Clean() => - Create.Command( - "clean", - LocalizableStrings.AppFullName, - Accept.ZeroOrMoreArguments(), - CommonOptions.HelpOption(), - Create.Option("-o|--output", - LocalizableStrings.CmdOutputDirDescription, - Accept.ExactlyOneArgument() - .With(name: LocalizableStrings.CmdOutputDir) - .ForwardAsSingle(o => $"/p:OutputPath={o.Arguments.Single()}")), - CommonOptions.FrameworkOption(), - CommonOptions.RuntimeOption(), - CommonOptions.ConfigurationOption(), - CommonOptions.VerbosityOption()); - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/LocalizableStrings.resx b/src/dotnet/commands/dotnet-clean/LocalizableStrings.resx deleted file mode 100644 index 96c19f35b..000000000 --- a/src/dotnet/commands/dotnet-clean/LocalizableStrings.resx +++ /dev/null @@ -1,132 +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 - - - .NET Clean Command - - - Command to clean previously generated build outputs. - - - OUTPUT_DIR - - - Directory in which the build outputs have been placed. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/Program.cs b/src/dotnet/commands/dotnet-clean/Program.cs deleted file mode 100644 index e07ec356d..000000000 --- a/src/dotnet/commands/dotnet-clean/Program.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Tools.MSBuild; -using Microsoft.DotNet.Cli; -using Parser = Microsoft.DotNet.Cli.Parser; - -namespace Microsoft.DotNet.Tools.Clean -{ - public class CleanCommand : MSBuildForwardingApp - { - public CleanCommand(IEnumerable msbuildArgs, string msbuildPath = null) - : base(msbuildArgs, msbuildPath) - { - } - - public static CleanCommand FromArgs(string[] args, string msbuildPath = null) - { - var msbuildArgs = new List(); - - var parser = Parser.Instance; - - var result = parser.ParseFrom("dotnet clean", args); - - result.ShowHelpOrErrorIfAppropriate(); - - var parsedClean = result["dotnet"]["clean"]; - - msbuildArgs.AddRange(parsedClean.Arguments); - - msbuildArgs.Add("/t:Clean"); - - msbuildArgs.AddRange(parsedClean.OptionValuesToBeForwarded()); - - return new CleanCommand(msbuildArgs, msbuildPath); - } - - public static int Run(string[] args) - { - DebugHelper.HandleDebugSwitch(ref args); - - CleanCommand cmd; - try - { - cmd = FromArgs(args); - } - catch (CommandCreationException e) - { - return e.ExitCode; - } - - return cmd.Execute(); - } - } -} diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index e9447ca46..000000000 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Clean Command - Příkaz rozhraní .NET pro vyčištění - - - - Command to clean previously generated build outputs. - Příkaz slouží k vyčištění vygenerovaných výstupů buildů. - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Directory in which the build outputs have been placed. - Adresář, do kterého byly umístěny výstupy buildu. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index d460b1e0a..000000000 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Clean Command - .NET-Befehl "Clean" - - - - Command to clean previously generated build outputs. - Befehl zum Bereinigen zuvor generierter Buildausgaben. - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Directory in which the build outputs have been placed. - Verzeichnis, in dem sich die Buildausgaben befinden. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index 69d3a95dc..000000000 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Clean Command - Comando Clean de .NET - - - - Command to clean previously generated build outputs. - Comando para limpiar los archivos de salida de compilaciones anteriores. - - - - OUTPUT_DIR - DIRECTORIO_DE_SALIDA - - - - Directory in which the build outputs have been placed. - Directorio donde se han puesto los archivos de salida de la compilación - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index 79ec56b2c..000000000 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Clean Command - Commande de nettoyage .NET - - - - Command to clean previously generated build outputs. - Commande de nettoyage des sorties de build générées précédemment. - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Directory in which the build outputs have been placed. - Répertoire dans lequel les sorties de build ont été placées - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index 290225d98..000000000 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Clean Command - Comando Pulisci .NET - - - - Command to clean previously generated build outputs. - Comando per pulire gli output di compilazione generati in precedenza. - - - - OUTPUT_DIR - DIR_OUTPUT - - - - Directory in which the build outputs have been placed. - Directory in cui sono stati inseriti gli output di compilazione. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index 6a22baae8..000000000 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Clean Command - .NET Clean コマンド - - - - Command to clean previously generated build outputs. - 以前に生成されたビルド出力を消去するコマンド。 - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Directory in which the build outputs have been placed. - ビルド出力が配置されているディレクトリ。 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index 923339cc7..000000000 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Clean Command - .NET 정리 명령 - - - - Command to clean previously generated build outputs. - 이전에 생성된 빌드 출력을 정리하는 명령입니다. - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Directory in which the build outputs have been placed. - 빌드 출력이 위치한 디렉터리입니다. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index 2b133e119..000000000 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Clean Command - Polecenie clean platformy .NET - - - - Command to clean previously generated build outputs. - Polecenie służące do czyszczenia wcześniej wygenerowanych danych wyjściowych kompilacji. - - - - OUTPUT_DIR - KATALOG_WYJŚCIOWY - - - - Directory in which the build outputs have been placed. - Katalog, w którym zostały umieszczone dane wyjściowe kompilacji. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index 7a60fa046..000000000 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Clean Command - Comando Clean do .NET - - - - Command to clean previously generated build outputs. - Comando para limpar saídas de build geradas anteriormente. - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Directory in which the build outputs have been placed. - O diretório no qual as saídas do build foram colocadas. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index efd4a47a0..000000000 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Clean Command - Команда .NET "Очистить" - - - - Command to clean previously generated build outputs. - Команда для очистки ранее созданных выходных данных сборки. - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Directory in which the build outputs have been placed. - Каталог, в котором размещаются выходные данные сборки. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index 25d13051e..000000000 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Clean Command - .NET Clean Komutu - - - - Command to clean previously generated build outputs. - Daha önce oluşturulan derleme çıkışlarını temizleme komutu. - - - - OUTPUT_DIR - ÇIKIŞ_DİZİNİ - - - - Directory in which the build outputs have been placed. - Derleme çıkışlarının yerleştirildiği dizin. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.xlf deleted file mode 100644 index fb0b2c850..000000000 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - .NET Clean Command - - - - Command to clean previously generated build outputs. - - - - OUTPUT_DIR - - - - Directory in which the build outputs have been placed. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index 8a8a43c49..000000000 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Clean Command - .NET 清除命令 - - - - Command to clean previously generated build outputs. - 用于清除先前产生的生成输出的命令。 - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Directory in which the build outputs have been placed. - 放置了生成输出的目录。 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index 51c5c756e..000000000 --- a/src/dotnet/commands/dotnet-clean/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Clean Command - .NET 清除命令 - - - - Command to clean previously generated build outputs. - 用以清除先前產生之建置輸出的命令。 - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Directory in which the build outputs have been placed. - 已放置建置輸出的目錄。 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-complete/CompleteCommand.cs b/src/dotnet/commands/dotnet-complete/CompleteCommand.cs deleted file mode 100644 index a6061d37d..000000000 --- a/src/dotnet/commands/dotnet-complete/CompleteCommand.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.Cli -{ - public class CompleteCommand - { - public static int Run(string[] args) - { - try - { - DebugHelper.HandleDebugSwitch(ref args); - - // get the parser for the current subcommand - var parser = Parser.Instance; - - // parse the arguments - var result = parser.ParseFrom("dotnet complete", args); - - var complete = result["dotnet"]["complete"]; - - var suggestions = Suggestions(complete); - - foreach (var suggestion in suggestions) - { - Console.WriteLine(suggestion); - } - } - catch (Exception) - { - return 1; - } - - return 0; - } - - private static string[] Suggestions(AppliedOption complete) - { - var input = complete.Arguments.SingleOrDefault() ?? ""; - - var positionOption = complete.AppliedOptions.SingleOrDefault(a => a.Name == "position"); - if (positionOption != null) - { - var position = positionOption.Value(); - - if (position > input.Length) - { - input += " "; - } - } - - var result = Parser.Instance.Parse(input); - - return result.Suggestions() - .ToArray(); - } - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-complete/CompleteCommandParser.cs b/src/dotnet/commands/dotnet-complete/CompleteCommandParser.cs deleted file mode 100644 index 658a5e22c..000000000 --- a/src/dotnet/commands/dotnet-complete/CompleteCommandParser.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; - -namespace Microsoft.DotNet.Cli -{ - internal static class CompleteCommandParser - { - public static Command Complete() => - Create.Command( - "complete", "", - Accept.ExactlyOneArgument() - .With(name: "path"), - Create.Option("--position", "", - Accept.ExactlyOneArgument() - .With(name: "command") - .MaterializeAs(o => int.Parse(o.Arguments.Single())))); - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-complete/ParseCommand.cs b/src/dotnet/commands/dotnet-complete/ParseCommand.cs deleted file mode 100644 index dccba0271..000000000 --- a/src/dotnet/commands/dotnet-complete/ParseCommand.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.Cli -{ - public class ParseCommand - { - public static int Run(string[] args) - { - DebugHelper.HandleDebugSwitch(ref args); - - ParseResult result; - try - { - result = Parser.Instance.Parse( - args.Single()); - } - catch (Exception e) - { - throw new InvalidOperationException("The parser threw an exception.", e); - } - - Console.WriteLine(result.Diagram()); - - if (result.UnparsedTokens.Any()) - { - Console.WriteLine("Unparsed Tokens: "); - Console.WriteLine(string.Join(" ", result.UnparsedTokens)); - } - - var optionValuesToBeForwarded = result.AppliedCommand() - .OptionValuesToBeForwarded(); - if (optionValuesToBeForwarded.Any()) - { - Console.WriteLine("Option values to be forwarded: "); - Console.WriteLine(string.Join(" ", optionValuesToBeForwarded)); - } - if (result.Errors.Any()) - { - Console.WriteLine(); - Console.WriteLine("ERRORS"); - Console.WriteLine(); - foreach (var error in result.Errors) - { - Console.WriteLine($"[{error?.Option?.Name ?? "???"}] {error?.Message}"); - } - } - - return 0; - } - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-complete/Suggest.cs b/src/dotnet/commands/dotnet-complete/Suggest.cs deleted file mode 100644 index e9dd0c7ef..000000000 --- a/src/dotnet/commands/dotnet-complete/Suggest.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Microsoft.Build.Evaluation; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Tools; -using static System.Array; - -namespace Microsoft.DotNet.Cli -{ - internal static class Suggest - { - public static IEnumerable TargetFrameworksFromProjectFile() - { - var msBuildProject = GetMSBuildProject(); - - if (msBuildProject == null) - { - yield break; - } - - foreach (var tfm in msBuildProject.GetTargetFrameworks()) - { - yield return tfm.GetShortFolderName(); - } - } - - private static void Report(Exception e) => - Reporter.Verbose.WriteLine($"Exception occurred while getting suggestions: {e}"); - - public static IEnumerable RunTimesFromProjectFile() => - GetMSBuildProject() - .GetRuntimeIdentifiers() ?? - Empty(); - - public static IEnumerable ProjectReferencesFromProjectFile() => - GetMSBuildProject() - ?.GetProjectToProjectReferences() - .Select(r => r.Include) ?? - Empty(); - - private static MsbuildProject GetMSBuildProject() - { - try - { - return MsbuildProject.FromFileOrDirectory( - new ProjectCollection(), - Directory.GetCurrentDirectory()); - } - catch (Exception e) - { - Report(e); - return null; - } - } - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/HelpCommand.cs b/src/dotnet/commands/dotnet-help/HelpCommand.cs deleted file mode 100644 index 799ba9314..000000000 --- a/src/dotnet/commands/dotnet-help/HelpCommand.cs +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Diagnostics; -using System.Linq; -using System.Runtime.InteropServices; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; -using Command = Microsoft.DotNet.Cli.CommandLine.Command; -using Parser = Microsoft.DotNet.Cli.Parser; - -namespace Microsoft.DotNet.Tools.Help -{ - public class HelpCommand - { - private readonly AppliedOption _appliedOption; - - public HelpCommand(AppliedOption appliedOption) - { - _appliedOption = appliedOption; - } - - public static int Run(string[] args) - { - DebugHelper.HandleDebugSwitch(ref args); - - var parser = Parser.Instance; - var result = parser.ParseFrom("dotnet help", args); - var helpAppliedOption = result["dotnet"]["help"]; - - result.ShowHelpIfRequested(); - - HelpCommand cmd; - try - { - cmd = new HelpCommand(helpAppliedOption); - } - catch (CommandCreationException e) - { - return e.ExitCode; - } - - if (helpAppliedOption.Arguments.Any()) - { - return cmd.Execute(); - } - else - { - PrintHelp(); - return 0; - } - } - - public static void PrintHelp() - { - PrintVersionHeader(); - Reporter.Output.WriteLine(HelpUsageText.UsageText); - } - - public static void PrintVersionHeader() - { - var versionString = string.IsNullOrEmpty(Product.Version) ? string.Empty : $" ({Product.Version})"; - Reporter.Output.WriteLine(Product.LongName + versionString); - } - - public static Process ConfigureProcess(string docUrl) - { - ProcessStartInfo psInfo; - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - psInfo = new ProcessStartInfo - { - FileName = "cmd", - Arguments = $"/c start {docUrl}" - }; - } - else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - { - psInfo = new ProcessStartInfo - { - FileName = "open", - Arguments = docUrl - }; - } - else - { - psInfo = new ProcessStartInfo - { - FileName = "xdg-open", - Arguments = docUrl - }; - } - - return new Process - { - StartInfo = psInfo - }; - } - - public int Execute() - { - if (BuiltInCommandsCatalog.Commands.TryGetValue( - _appliedOption.Arguments.Single(), - out BuiltInCommandMetadata builtIn)) - { - var process = ConfigureProcess(builtIn.DocLink); - process.Start(); - process.WaitForExit(); - return 0; - } - else - { - Reporter.Error.WriteLine( - string.Format( - LocalizableStrings.CommandDoesNotExist, - _appliedOption.Arguments.Single())); - Reporter.Output.WriteLine(HelpUsageText.UsageText); - return 1; - } - } - } -} - diff --git a/src/dotnet/commands/dotnet-help/HelpCommandParser.cs b/src/dotnet/commands/dotnet-help/HelpCommandParser.cs deleted file mode 100644 index ccab6bd21..000000000 --- a/src/dotnet/commands/dotnet-help/HelpCommandParser.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.CommandLine; - -namespace Microsoft.DotNet.Tools.Help -{ - internal static class HelpCommandParser - { - public static Command Help() - { - return Create.Command( - "help", - LocalizableStrings.AppFullName, - Accept.ZeroOrOneArgument() - .With( - LocalizableStrings.CommandArgumentDescription, - LocalizableStrings.CommandArgumentName), - CommonOptions.HelpOption()); - } - } -} - diff --git a/src/dotnet/commands/dotnet-help/HelpUsageText.cs b/src/dotnet/commands/dotnet-help/HelpUsageText.cs deleted file mode 100644 index 68c637f06..000000000 --- a/src/dotnet/commands/dotnet-help/HelpUsageText.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Microsoft.DotNet.Tools; -using Microsoft.DotNet.Tools.Help; - -internal static class HelpUsageText -{ - public static readonly string UsageText = -$@"{LocalizableStrings.Usage}: dotnet [runtime-options] [path-to-application] -{LocalizableStrings.Usage}: dotnet [sdk-options] [command] [arguments] [command-options] - -path-to-application: - {LocalizableStrings.PathToApplicationDefinition} - -{LocalizableStrings.Commands}: - new {LocalizableStrings.NewDefinition} - restore {LocalizableStrings.RestoreDefinition} - run {LocalizableStrings.RunDefinition} - build {LocalizableStrings.BuildDefinition} - publish {LocalizableStrings.PublishDefinition} - test {LocalizableStrings.TestDefinition} - pack {LocalizableStrings.PackDefinition} - migrate {LocalizableStrings.MigrateDefinition} - clean {LocalizableStrings.CleanDefinition} - sln {LocalizableStrings.SlnDefinition} - add {LocalizableStrings.AddDefinition} - remove {LocalizableStrings.RemoveDefinition} - list {LocalizableStrings.ListDefinition} - nuget {LocalizableStrings.NugetDefinition} - msbuild {LocalizableStrings.MsBuildDefinition} - vstest {LocalizableStrings.VsTestDefinition} - -{LocalizableStrings.CommonOptions}: - -v|--verbosity {CommonLocalizableStrings.VerbosityOptionDescription} - -h|--help {LocalizableStrings.HelpDefinition} - -{LocalizableStrings.RunDotnetCommandHelpForMore} - -sdk-options: - --version {LocalizableStrings.SDKVersionCommandDefinition} - --info {LocalizableStrings.SDKInfoCommandDefinition} - -d|--diagnostics {LocalizableStrings.SDKDiagnosticsCommandDefinition} - -runtime-options: - --additionalprobingpath {LocalizableStrings.AdditionalprobingpathDefinition} - --fx-version {LocalizableStrings.FxVersionDefinition} - --roll-forward-on-no-candidate-fx {LocalizableStrings.RollForwardOnNoCandidateFxDefinition} - --additional-deps {LocalizableStrings.AdditionalDeps} -"; -} diff --git a/src/dotnet/commands/dotnet-help/LocalizableStrings.resx b/src/dotnet/commands/dotnet-help/LocalizableStrings.resx deleted file mode 100644 index 5552d40c5..000000000 --- a/src/dotnet/commands/dotnet-help/LocalizableStrings.resx +++ /dev/null @@ -1,261 +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 - - - Usage - - - Arguments - - - The command to execute - - - Arguments to pass to the command - - - Options specific to dotnet (host) - - - Options common to all commands - - - Common options - - - Enable diagnostic output - - - Show help. - - - Host options (passed before the command) - - - Display .NET CLI Version Number - - - Display .NET CLI Info - - - SDK commands - - - Initialize .NET projects. - - - Restore dependencies specified in the .NET project. - - - Builds a .NET project. - - - Publishes a .NET project for deployment (including the runtime). - - - Compiles and immediately executes a .NET project. - - - Runs unit tests using the test runner specified in the project. - - - Creates a NuGet package. - - - Migrates a project.json based project to a msbuild based project. - - - Project modification commands - - - Add reference to the project. - - - Remove reference from the project. - - - List reference in the project. - - - Advanced Commands - - - Provides additional NuGet commands. - - - Runs Microsoft Build Engine (MSBuild). - - - Runs Microsoft Test Execution Command Line Tool. - - - Clean build output(s). - - - Modify solution (SLN) files. - - - Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. - - - .NET CLI help utility - - - Utility to get more detailed help about each of the CLI commands. - - - COMMAND_NAME - - - CLI command for which to view more detailed help. - - - The path to an application .dll file to execute. - - - Display .NET Core SDK version. - - - Display .NET Core information. - - - Enable diagnostic output. - - - Run 'dotnet COMMAND --help' for more information on a command. - - - Path containing probing policy and assemblies to probe for. - - - Path to <application>.deps.json file. - - - Path to <application>.runtimeconfig.json file. - - - Version of the installed Shared Framework to use to run the application. - - - Roll forward on no candidate shared framework is enabled. - - - Path to additonal deps.json file. - - \ 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 deleted file mode 100644 index 86d28776a..000000000 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - Usage - Použití - - - - Arguments - Argumenty - - - - The command to execute - Prováděný příkaz - - - - Arguments to pass to the command - Argumenty předané příkazu - - - - Options specific to dotnet (host) - Specifické možnosti dotnetu (hostitel) - - - - Options common to all commands - Společné možnosti všech příkazů - - - - Common options - Společné možnosti - - - - Show help. - Zobrazí nápovědu. - - - - Host options (passed before the command) - Možnosti hostitele (předané před příkazem) - - - - Display .NET CLI Version Number - Zobrazit číslo verze .NET CLI - - - - Display .NET CLI Info - Zobrazit informace o .NET CLI - - - - SDK commands - Příkazy sady SDK - - - - Initialize .NET projects. - Inicializuje projekty .NET. - - - - Restore dependencies specified in the .NET project. - Obnoví závislosti zadané v projektu .NET. - - - - Builds a .NET project. - Sestaví projekt .NET. - - - - Publishes a .NET project for deployment (including the runtime). - Publikuje projekt .NET pro nasazení (včetně modulu runtime). - - - - Compiles and immediately executes a .NET project. - Zkompiluje a hned spustí projekt .NET. - - - - Runs unit tests using the test runner specified in the project. - Spustí testy jednotek v nástroji Test Runner zadaném v projektu. - - - - Creates a NuGet package. - Vytvoří balíček NuGet. - - - - Migrates a project.json based project to a msbuild based project. - Na základě projektu migruje soubor project.json na projekt založený na nástroji MSBuild. - - - - Project modification commands - Příkazy pro úpravy projektu - - - - Add reference to the project. - Přidá odkaz k projektu. - - - - Remove reference from the project. - Odebere odkaz z projektu. - - - - Advanced Commands - Pokročilé příkazy - - - - Provides additional NuGet commands. - Nabízí další příkazy NuGet. - - - - Runs Microsoft Build Engine (MSBuild). - Spustí Microsoft Build Engine (MSBuild). - - - - Runs Microsoft Test Execution Command Line Tool. - Spustí nástroj příkazového řádku od Microsoftu, který testuje spuštění. - - - - Enable diagnostic output - Povolit diagnostický výstup - - - - Clean build output(s). - Smaže výstupy sestavení. - - - - Modify solution (SLN) files. - Umožňuje upravovat soubory řešení (SLN). - - - - List reference in the project. - Vypíše odkaz v projektu. - - - - Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. - Zadaný příkaz {0} není platným příkazem rozhraní příkazového řádku. Zadejte prosím platné příkazy rozhraní příkazového řádku. Další informace získáte spuštěním příkazu dotnet help. - - - - .NET CLI help utility - Nástroj nápovědy k rozhraní příkazového řádku .NET - - - - Utility to get more detailed help about each of the CLI commands. - Nástroj k získání podrobnější nápovědy k jednotlivým příkazům rozhraní příkazového řádku. - - - - COMMAND_NAME - COMMAND_NAME - - - - CLI command for which to view more detailed help. - Příkaz rozhraní příkazového řádku, ke kterému chcete získat podrobnější nápovědu - - - - The path to an application .dll file to execute. - Cesta k souboru .dll aplikace, který se má spustit - - - - Display .NET Core SDK version. - Zobrazí verzi sady .NET Core SDK. - - - - Display .NET Core information. - Zobrazí informace o rozhraní .NET Core. - - - - Enable diagnostic output. - Povolí diagnostický výstup. - - - - Run 'dotnet COMMAND --help' for more information on a command. - Další informace o příkazu získáte spuštěním příkazu dotnet PŘÍKAZ --help. - - - - Path containing probing policy and assemblies to probe for. - Cesta obsahující testovací zásady a sestavení, která se mají testovat - - - - Path to <application>.deps.json file. - Cesta k souboru <aplikace>.deps.json - - - - Path to <application>.runtimeconfig.json file. - Cesta k souboru <aplikace>.runtimeconfig.json - - - - Version of the installed Shared Framework to use to run the application. - Verze nainstalované sdílené architektury, která se má použít ke spuštění aplikace - - - - Roll forward on no candidate shared framework is enabled. - Posune se vpřed, pokud není povolený žádný kandidát sdílené architektury. - - - - Path to additonal deps.json file. - Cesta k dodatečnému souboru deps.json. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index 419026640..000000000 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - Usage - Syntax - - - - Arguments - Argumente - - - - The command to execute - Der auszuführende Befehl - - - - Arguments to pass to the command - An den Befehl zu übergebende Argumente - - - - Options specific to dotnet (host) - Spezifische dotnet-Optionen (Host) - - - - Options common to all commands - Allgemeine Optionen für alle Befehle - - - - Common options - Allgemeine Optionen - - - - Show help. - Hilfe anzeigen. - - - - Host options (passed before the command) - Hostoptionen (werden vor dem Befehl übergeben) - - - - Display .NET CLI Version Number - .NET-CLI-Versionsnummer anzeigen - - - - Display .NET CLI Info - .NET-CLI-Informationen anzeigen - - - - SDK commands - SDK-Befehle - - - - Initialize .NET projects. - .NET-Projekte initialisieren. - - - - Restore dependencies specified in the .NET project. - Im .NET-Projekt angegebene Abhängigkeiten wiederherstellen. - - - - Builds a .NET project. - Erstellt ein .NET-Projekt. - - - - Publishes a .NET project for deployment (including the runtime). - Veröffentlicht ein .NET-Projekt für die Bereitstellung (einschließlich Laufzeit). - - - - Compiles and immediately executes a .NET project. - Kompiliert ein .NET-Projekt und führt es umgehend aus. - - - - Runs unit tests using the test runner specified in the project. - Führt mithilfe des im Projekt angegebenen Test Runners Komponententests aus. - - - - Creates a NuGet package. - Erstellt ein NuGet-Paket. - - - - Migrates a project.json based project to a msbuild based project. - Migriert ein auf „project.json“ basierendes Projekt zu einem MSBuild-basierten Projekt. - - - - Project modification commands - Projektänderungsbefehle - - - - Add reference to the project. - Verweis zum Projekt hinzufügen. - - - - Remove reference from the project. - Verweis aus dem Projekt entfernen. - - - - Advanced Commands - Erweiterte Befehle - - - - Provides additional NuGet commands. - Stellt zusätzliche NuGet-Befehle bereit. - - - - Runs Microsoft Build Engine (MSBuild). - Führt Microsoft-Buildmodul (MSBuild) aus. - - - - Runs Microsoft Test Execution Command Line Tool. - Führt Microsoft Testausführungs-Befehlszeilentool aus. - - - - Enable diagnostic output - Diagnoseausgabe aktivieren. - - - - Clean build output(s). - Buildausgabe(n) bereinigen. - - - - Modify solution (SLN) files. - Projektmappendateien (SLN-Dateien) ändern. - - - - List reference in the project. - Verweis im Projekt auflisten. - - - - Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. - Der angegebene Befehl "{0}" ist kein gültiger CLI-Befehl. Geben Sie gültige CLI-Befehle an. Führen Sie die dotnet-Hilfe aus, um weitere Informationen zu erhalten. - - - - .NET CLI help utility - .NET CLI-Hilfeprogramm - - - - Utility to get more detailed help about each of the CLI commands. - Programm für detailliertere Hilfe zu den einzelnen CLI-Befehlen. - - - - COMMAND_NAME - COMMAND_NAME - - - - CLI command for which to view more detailed help. - CLI-Befehl, für den detailliertere Hilfe angezeigt werden soll. - - - - The path to an application .dll file to execute. - Der Pfad zur auszuführenden DLL-Datei einer Anwendung. - - - - Display .NET Core SDK version. - .NET Core SDK-Version anzeigen. - - - - Display .NET Core information. - .NET Core-Informationen anzeigen. - - - - Enable diagnostic output. - Diagnoseausgabe aktivieren. - - - - Run 'dotnet COMMAND --help' for more information on a command. - Führen Sie "dotnet COMMAND --help" aus, um weitere Informationen zu einem Befehl zu erhalten. - - - - Path containing probing policy and assemblies to probe for. - Pfad, der die Suchrichtlinie und die zu suchenden Assemblys enthält. - - - - Path to <application>.deps.json file. - Pfad zur Datei "<Anwendung>.deps.json". - - - - Path to <application>.runtimeconfig.json file. - Pfad zur Datei "<Anwendung>.runtimeconfig.json". - - - - Version of the installed Shared Framework to use to run the application. - Version des installierten freigegebenen Frameworks, das zum Ausführen der Anwendung verwendet werden soll. - - - - Roll forward on no candidate shared framework is enabled. - Rollforward für freigegebenes Framework ohne Kandidaten ist aktiviert. - - - - Path to additonal deps.json file. - Pfad zur zusätzlichen "deps.json"-Datei. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index a4ae3a445..000000000 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - Usage - Uso - - - - Arguments - Argumentos - - - - The command to execute - Comando para ejecutar - - - - Arguments to pass to the command - Argumentos que se pasan al comando - - - - Options specific to dotnet (host) - Opciones específicas de dotnet (host) - - - - Options common to all commands - Opciones comunes a todos los comandos - - - - Common options - Opciones comunes - - - - Show help. - Muestra la ayuda. - - - - Host options (passed before the command) - Opciones de host (pasadas antes que el comando) - - - - Display .NET CLI Version Number - Muestra el número de versión de la CLI de .NET - - - - Display .NET CLI Info - Muestra información de la CLI de .NET - - - - SDK commands - Comandos de SDK - - - - Initialize .NET projects. - Inicializa proyectos de .NET. - - - - Restore dependencies specified in the .NET project. - Restaura dependencias especificadas en el proyecto de .NET. - - - - Builds a .NET project. - Compila un proyecto de .NET. - - - - Publishes a .NET project for deployment (including the runtime). - Publica un proyecto de .NET para implementarlo (incluido el entorno de tiempo de ejecución). - - - - Compiles and immediately executes a .NET project. - Compila y ejecuta de inmediato un proyecto de .NET. - - - - Runs unit tests using the test runner specified in the project. - Ejecuta pruebas unitarias usando el ejecutor de pruebas especificado en el proyecto. - - - - Creates a NuGet package. - Crea un paquete NuGet. - - - - Migrates a project.json based project to a msbuild based project. - Migra un proyecto basado en project.json a un proyecto basado en MSBuild. - - - - Project modification commands - Comandos de modificación del proyecto - - - - Add reference to the project. - Agrega referencias al proyecto. - - - - Remove reference from the project. - Quita referencias del proyecto. - - - - Advanced Commands - Comandos avanzados - - - - Provides additional NuGet commands. - Proporciona comandos NuGet adicionales. - - - - Runs Microsoft Build Engine (MSBuild). - Ejecuta Microsoft Build Engine (MSBuild). - - - - Runs Microsoft Test Execution Command Line Tool. - Ejecuta Herramienta de línea de comandos de ejecución de pruebas de Microsoft. - - - - Enable diagnostic output - Habilitar salida de diagnóstico - - - - Clean build output(s). - Borre las salidas de compilación. - - - - Modify solution (SLN) files. - Modifique archivos de la solución (SLN). - - - - List reference in the project. - Muestra referencias en el proyecto. - - - - Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. - El comando especificado "{0}" no es un comando de la CLI válido. Especifique uno válido. Para más información, ejecute la ayuda de dotnet. - - - - .NET CLI help utility - Utilidad de ayuda de la CLI de .NET - - - - Utility to get more detailed help about each of the CLI commands. - Utilidad para obtener ayuda más detallada sobre cada uno de los comandos de la CLI. - - - - COMMAND_NAME - COMMAND_NAME - - - - CLI command for which to view more detailed help. - Comando de la CLI para el que ver ayuda más detallada. - - - - The path to an application .dll file to execute. - La ruta de acceso al archivo .dll de una aplicación que se ejecutará. - - - - Display .NET Core SDK version. - Muestra la versión del SDK de .NET Core. - - - - Display .NET Core information. - Muestra la información de .NET Core. - - - - Enable diagnostic output. - Habilita la salida de diagnóstico. - - - - Run 'dotnet COMMAND --help' for more information on a command. - Ejecute "dotnet COMMAND --help" para más información sobre un comando. - - - - Path containing probing policy and assemblies to probe for. - Ruta de acceso que contiene la directiva de sondeo y los ensamblados para los que realizar el sondeo. - - - - Path to <application>.deps.json file. - Ruta de acceso al archivo <aplicación>.deps.json. - - - - Path to <application>.runtimeconfig.json file. - Ruta de acceso al archivo <aplicación>.runtimeconfig.json. - - - - Version of the installed Shared Framework to use to run the application. - Versión de la instancia de Shared Framework instalada que se usará para ejecutar la aplicación. - - - - Roll forward on no candidate shared framework is enabled. - Puesta al día activada, no hay ninguna instancia de Shared Framework habilitada. - - - - Path to additonal deps.json file. - Ruta de acceso al archivo deps.json adicional. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index 62ac2526e..000000000 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - Usage - Utilisation - - - - Arguments - Arguments - - - - The command to execute - Commande à exécuter - - - - Arguments to pass to the command - Arguments à passer à la commande - - - - Options specific to dotnet (host) - Options spécifiques à dotnet (hôte) - - - - Options common to all commands - Options communes à toutes les commandes - - - - Common options - Options communes - - - - Show help. - Affichez l'aide. - - - - Host options (passed before the command) - Options de l'hôte (passées avant la commande) - - - - Display .NET CLI Version Number - Afficher le numéro de version de l'interface CLI .NET - - - - Display .NET CLI Info - Affichage des informations sur l'interface CLI .NET - - - - SDK commands - Commandes du SDK - - - - Initialize .NET projects. - Initialisez les projets .NET. - - - - Restore dependencies specified in the .NET project. - Restaurez les dépendances spécifiées dans le projet .NET. - - - - Builds a .NET project. - Génère un projet .NET. - - - - Publishes a .NET project for deployment (including the runtime). - Publie un projet .NET à des fins de déploiement (runtime inclus). - - - - Compiles and immediately executes a .NET project. - Compile et exécute immédiatement un projet .NET. - - - - Runs unit tests using the test runner specified in the project. - Exécute des tests unitaires à l'aide du programme Test Runner spécifié dans le projet. - - - - Creates a NuGet package. - Crée un package NuGet. - - - - Migrates a project.json based project to a msbuild based project. - Effectue la migration d'un projet basé sur project.json vers un projet basé sur msbuild. - - - - Project modification commands - Commandes de modification de projet - - - - Add reference to the project. - Ajoutez une référence au projet. - - - - Remove reference from the project. - Supprimez une référence du projet. - - - - Advanced Commands - Commandes avancées - - - - Provides additional NuGet commands. - Fournit des commandes NuGet supplémentaires. - - - - Runs Microsoft Build Engine (MSBuild). - Exécute Microsoft Build Engine (MSBuild). - - - - Runs Microsoft Test Execution Command Line Tool. - Exécute l'outil en ligne de commande d'exécution de tests Microsoft. - - - - Enable diagnostic output - Activer la sortie des diagnostics - - - - Clean build output(s). - Nettoyez les sorties de build. - - - - Modify solution (SLN) files. - Modifiez les fichiers solution (SLN). - - - - List reference in the project. - Listez une référence dans le projet. - - - - Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. - La commande spécifiée '{0}' n'est pas une commande CLI valide. Spécifiez une commande CLI valide. Pour plus d'informations, exécutez dotnet help. - - - - .NET CLI help utility - Utilitaire d'aide .NET CLI - - - - Utility to get more detailed help about each of the CLI commands. - Utilitaire permettant d'obtenir une aide plus détaillée sur chacune des commandes CLI. - - - - COMMAND_NAME - COMMAND_NAME - - - - CLI command for which to view more detailed help. - Commande CLI pour laquelle afficher une aide plus détaillée. - - - - The path to an application .dll file to execute. - Chemin d'un fichier .dll d'application à exécuter. - - - - Display .NET Core SDK version. - Affichez la version du SDK .NET Core. - - - - Display .NET Core information. - Affichez les informations sur .NET Core. - - - - Enable diagnostic output. - Activez la sortie des diagnostics. - - - - Run 'dotnet COMMAND --help' for more information on a command. - Exécutez 'dotnet COMMAND --help' pour plus d'informations sur une commande. - - - - Path containing probing policy and assemblies to probe for. - Chemin contenant la stratégie de collecte et les assemblys à collecter. - - - - Path to <application>.deps.json file. - Chemin du fichier <application>.deps.json. - - - - Path to <application>.runtimeconfig.json file. - Chemin du fichier <application>.runtimeconfig.json. - - - - Version of the installed Shared Framework to use to run the application. - Version du framework partagé installé à utiliser pour exécuter l'application. - - - - Roll forward on no candidate shared framework is enabled. - Effectuez une restauration par progression si aucun framework partagé candidat n'est activé. - - - - Path to additonal deps.json file. - Chemin du fichier deps.json supplémentaire. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index 5e5d2bd4f..000000000 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - Usage - Sintassi - - - - Arguments - Argomenti - - - - The command to execute - Comando da eseguire - - - - Arguments to pass to the command - Argomenti da passare al comando - - - - Options specific to dotnet (host) - Opzioni specifiche di dotnet (host) - - - - Options common to all commands - Opzioni comuni a tutti i comandi - - - - Common options - Opzioni comuni - - - - Show help. - Visualizza la Guida. - - - - Host options (passed before the command) - Opzioni host (passate prima del comando) - - - - Display .NET CLI Version Number - Visualizza il numero di versione dell'interfaccia della riga di comando .NET - - - - Display .NET CLI Info - Visualizza le informazioni sull'interfaccia della riga di comando .NET - - - - SDK commands - Comandi SDK - - - - Initialize .NET projects. - Inizializza i progetti .NET. - - - - Restore dependencies specified in the .NET project. - Ripristina le dipendenze specificate nel progetto .NET. - - - - Builds a .NET project. - Compila un progetto .NET. - - - - Publishes a .NET project for deployment (including the runtime). - Pubblica un progetto .NET per la distribuzione (includendo il runtime). - - - - Compiles and immediately executes a .NET project. - Compila ed esegue immediatamente un progetto .NET. - - - - Runs unit tests using the test runner specified in the project. - Esegue gli unit test con l'istanza di Test Runner specificata nel progetto. - - - - Creates a NuGet package. - Crea un pacchetto NuGet. - - - - Migrates a project.json based project to a msbuild based project. - Esegue la migrazione di un progetto basato su project.json in uno basato su MSBuild. - - - - Project modification commands - Comandi di modifica del progetto - - - - Add reference to the project. - Consente di aggiungere il riferimento al progetto. - - - - Remove reference from the project. - Consente di rimuovere il riferimento dal progetto. - - - - Advanced Commands - Comandi avanzati - - - - Provides additional NuGet commands. - Fornisce comandi NuGet aggiuntivi. - - - - Runs Microsoft Build Engine (MSBuild). - Esegue Microsoft Build Engine (MSBuild). - - - - Runs Microsoft Test Execution Command Line Tool. - Esegue lo strumento da riga di comando per l'esecuzione di test Microsoft. - - - - Enable diagnostic output - Abilita l'output di diagnostica - - - - Clean build output(s). - Pulisce gli output di compilazione. - - - - Modify solution (SLN) files. - Consente di modificare i file di soluzione (SLN). - - - - List reference in the project. - Elenca il riferimento nel progetto. - - - - Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. - Il comando specificato '{0}' non è un comando valido dell'interfaccia della riga di comando. Specificare comandi validi dell'interfaccia della riga di comando. Per altre informazioni, eseguire dotnet help. - - - - .NET CLI help utility - Utilità della Guida dell'interfaccia della riga di comando .NET - - - - Utility to get more detailed help about each of the CLI commands. - Utilità che consente di ottenere informazioni dettagliate su tutti i comandi dell'interfaccia della riga di comando. - - - - COMMAND_NAME - NOME_COMANDO - - - - CLI command for which to view more detailed help. - Comando dell'interfaccia della riga di comando per il quale visualizzare informazioni dettagliate. - - - - The path to an application .dll file to execute. - Percorso di un file DLL dell'applicazione da eseguire. - - - - Display .NET Core SDK version. - Visualizza la versione di .NET Core SDK. - - - - Display .NET Core information. - Visualizza le informazioni su .NET Core. - - - - Enable diagnostic output. - Abilita l'output di diagnostica. - - - - Run 'dotnet COMMAND --help' for more information on a command. - Per altre informazioni su un comando, eseguire 'dotnet COMANDO --help'. - - - - Path containing probing policy and assemblies to probe for. - Percorso che contiene i criteri di esecuzione probe e gli assembly per cui eseguire il probe. - - - - Path to <application>.deps.json file. - Percorso del file <applicazione>.deps.json. - - - - Path to <application>.runtimeconfig.json file. - Percorso del file <applicazione>.runtimeconfig.json. - - - - Version of the installed Shared Framework to use to run the application. - Versione di Shared Framework installata da usare per eseguire l'applicazione. - - - - Roll forward on no candidate shared framework is enabled. - Esegue il roll forward nel caso in cui non è abilitata nessuna versione candidata di Shared Framework. - - - - Path to additonal deps.json file. - Percorso del file deps.json aggiuntivo. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index d26220439..000000000 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - Usage - 使用法 - - - - Arguments - Arguments - - - - The command to execute - 実行するコマンド - - - - Arguments to pass to the command - コマンドに渡す引数 - - - - Options specific to dotnet (host) - dotnet (ホスト) 固有のオプション - - - - Options common to all commands - すべてのコマンドに共通のオプション - - - - Common options - 共通のオプション - - - - Show help. - ヘルプを表示します。 - - - - Host options (passed before the command) - ホストのオプション (コマンドの前に渡されます) - - - - Display .NET CLI Version Number - .NET CLI のバージョン番号を表示する - - - - Display .NET CLI Info - .NET CLI の情報を表示する - - - - SDK commands - SDK コマンド - - - - Initialize .NET projects. - .NET プロジェクトを初期化します。 - - - - Restore dependencies specified in the .NET project. - .NET プロジェクトに指定されている依存関係を復元します。 - - - - Builds a .NET project. - .NET プロジェクトを構築します。 - - - - Publishes a .NET project for deployment (including the runtime). - 展開用の .NET プロジェクトを発行します (ランタイムを含む)。 - - - - Compiles and immediately executes a .NET project. - .NET プロジェクトをコンパイルして、直ちに実行します。 - - - - Runs unit tests using the test runner specified in the project. - プロジェクトに指定されているテスト ランナーを使用して、単体テストを実行します。 - - - - Creates a NuGet package. - NuGet パッケージを作成します。 - - - - Migrates a project.json based project to a msbuild based project. - project.json ベースのプロジェクトを msbuild ベースのプロジェクトに移行します。 - - - - Project modification commands - プロジェクト変更コマンド - - - - Add reference to the project. - 参照をプロジェクトに追加します。 - - - - Remove reference from the project. - 参照をプロジェクトから削除します。 - - - - Advanced Commands - 高度なコマンド - - - - Provides additional NuGet commands. - 追加の NuGet コマンドを提供します。 - - - - Runs Microsoft Build Engine (MSBuild). - Microsoft Build Engine (MSBuild) を実行します。 - - - - Runs Microsoft Test Execution Command Line Tool. - Microsoft Test Execution Command Line Tool を実行します。 - - - - Enable diagnostic output - 診断出力を有効にする - - - - Clean build output(s). - ビルド出力を消去します。 - - - - Modify solution (SLN) files. - ソリューション (SLN) ファイルを変更します。 - - - - List reference in the project. - プロジェクト内の参照を一覧表示します。 - - - - Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. - 指定されたコマンド '{0}' は、有効な CLI コマンドではありません。有効な CLI コマンドを指定してください。詳細については、dotnet のヘルプを参照してください。 - - - - .NET CLI help utility - .NET CLI ヘルプ ユーティリティ - - - - Utility to get more detailed help about each of the CLI commands. - 各 CLI コマンドに関する詳細なヘルプを取得するためのユーティリティ。 - - - - COMMAND_NAME - COMMAND_NAME - - - - CLI command for which to view more detailed help. - 詳細なヘルプを表示する CLI コマンド。 - - - - The path to an application .dll file to execute. - 実行するアプリケーション .dll ファイルへのパス。 - - - - Display .NET Core SDK version. - .NET Core SDK バージョンを表示します。 - - - - Display .NET Core information. - .NET Core 情報を表示します。 - - - - Enable diagnostic output. - 診断出力を有効にします。 - - - - Run 'dotnet COMMAND --help' for more information on a command. - コマンドに関する詳細情報については、'dotnet COMMAND --help' を実行します。 - - - - Path containing probing policy and assemblies to probe for. - 調査ポリシーと調査対象アセンブリを含むパス。 - - - - Path to <application>.deps.json file. - <application>.deps.json ファイルへのパス。 - - - - Path to <application>.runtimeconfig.json file. - <application>.runtimeconfig.json ファイルへのパス。 - - - - Version of the installed Shared Framework to use to run the application. - アプリケーションを実行するために使用するインストール済み Shared Framework のバージョン。 - - - - Roll forward on no candidate shared framework is enabled. - 候補がない Shared Framework に対するロールフォワードが有効です。 - - - - Path to additonal deps.json file. - 追加 deps.json ファイルへのパス。 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index e31fcdf82..000000000 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - Usage - 사용법 - - - - Arguments - 인수 - - - - The command to execute - 실행할 명령입니다. - - - - Arguments to pass to the command - 명령에 전달할 인수입니다. - - - - Options specific to dotnet (host) - dotnet(호스트)과 관련된 옵션입니다. - - - - Options common to all commands - 모든 명령에 공통된 옵션입니다. - - - - Common options - 공통 옵션 - - - - Show help. - 도움말을 표시합니다. - - - - Host options (passed before the command) - 호스트 옵션(명령 전에 전달됨) - - - - Display .NET CLI Version Number - .NET CLI 버전 번호 표시 - - - - Display .NET CLI Info - .NET CLI 정보 표시 - - - - SDK commands - SDK 명령 - - - - Initialize .NET projects. - .NET 프로젝트를 초기화합니다. - - - - Restore dependencies specified in the .NET project. - .NET 프로젝트에 지정된 종속성을 복원합니다. - - - - Builds a .NET project. - .NET 프로젝트를 빌드합니다. - - - - Publishes a .NET project for deployment (including the runtime). - 배포할 .NET 프로젝트를 게시합니다(런타임 포함). - - - - Compiles and immediately executes a .NET project. - .NET 프로젝트를 컴파일하고 즉시 실행합니다. - - - - Runs unit tests using the test runner specified in the project. - 프로젝트에 지정된 Test Runner를 사용하여 유닛 테스트를 실행합니다. - - - - Creates a NuGet package. - NuGet 패키지를 만듭니다. - - - - Migrates a project.json based project to a msbuild based project. - project.json 기반 프로젝트를 msbuild 기반 프로젝트로 마이그레이션합니다. - - - - Project modification commands - 프로젝트 수정 명령 - - - - Add reference to the project. - 프로젝트에 참조를 추가합니다. - - - - Remove reference from the project. - 프로젝트에서 참조를 제거합니다. - - - - Advanced Commands - 고급 명령 - - - - Provides additional NuGet commands. - 추가 NuGet 명령을 제공합니다. - - - - Runs Microsoft Build Engine (MSBuild). - Microsoft Build Engine(MSBuild)을 실행합니다. - - - - Runs Microsoft Test Execution Command Line Tool. - Microsoft Test Execution 명령줄 도구를 실행합니다. - - - - Enable diagnostic output - 진단 출력을 사용합니다. - - - - Clean build output(s). - 빌드 출력을 정리합니다. - - - - Modify solution (SLN) files. - 솔루션(SLN) 파일을 수정합니다. - - - - List reference in the project. - 프로젝트의 참조를 나열합니다. - - - - Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. - 지정된 명령 '{0}'은(는) 유효한 CLI 명령이 아닙니다. 유효한 CLI 명령을 지정하세요. 자세한 내용은 dotnet 도움말을 실행하세요. - - - - .NET CLI help utility - .NET CLI 도움말 유틸리티 - - - - Utility to get more detailed help about each of the CLI commands. - 각 CLI 명령에 대해 더 자세한 도움말을 얻는 유틸리티입니다. - - - - COMMAND_NAME - COMMAND_NAME - - - - CLI command for which to view more detailed help. - 더 자세한 도움말을 보는 CLI 명령입니다. - - - - The path to an application .dll file to execute. - 실행할 응용 프로그램 .dll 파일의 경로입니다. - - - - Display .NET Core SDK version. - .NET Core SDK 버전을 표시합니다. - - - - Display .NET Core information. - .NET Core 정보를 표시합니다. - - - - Enable diagnostic output. - 진단 출력을 사용합니다. - - - - Run 'dotnet COMMAND --help' for more information on a command. - 명령에 대한 자세한 정보를 보려면 'dotnet COMMAND --help'를 실행합니다. - - - - Path containing probing policy and assemblies to probe for. - 검색할 검색 정책 및 어셈블리를 포함하는 경로입니다. - - - - Path to <application>.deps.json file. - <응용 프로그램>.deps.json 파일의 경로입니다. - - - - Path to <application>.runtimeconfig.json file. - <응용 프로그램>.runtimeconfig.json 파일의 경로입니다. - - - - Version of the installed Shared Framework to use to run the application. - 응용 프로그램을 실행하는 데 사용할 설치된 공유 프레임워크의 버전입니다. - - - - Roll forward on no candidate shared framework is enabled. - 사용되지 않는 후보 공유 프레임워크에 대해 롤포워드합니다. - - - - Path to additonal deps.json file. - 추가 deps.json 파일의 경로입니다. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index 66792532c..000000000 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - Usage - Użycie - - - - Arguments - Argumenty - - - - The command to execute - Polecenie do wykonania - - - - Arguments to pass to the command - Argumenty, które zostaną przekazane do polecenia - - - - Options specific to dotnet (host) - Opcje specyficzne dla poleceń dotnet (hosta) - - - - Options common to all commands - Opcje wspólne dla wszystkich poleceń - - - - Common options - Opcje wspólne - - - - Show help. - Pokaż pomoc. - - - - Host options (passed before the command) - Opcje hosta (przekazywane przed poleceniem) - - - - Display .NET CLI Version Number - Wyświetl numer wersji interfejsu wiersza polecenia platformy .NET - - - - Display .NET CLI Info - Wyświetl informacje o interfejsie wiersza polecenia platformy .NET - - - - SDK commands - Polecenia zestawu SDK - - - - Initialize .NET projects. - Zainicjuj projekty platformy .NET. - - - - Restore dependencies specified in the .NET project. - Przywróć zależności określone w projekcie platformy .NET. - - - - Builds a .NET project. - Kompiluje projekt platformy .NET. - - - - Publishes a .NET project for deployment (including the runtime). - Publikuje projekt platformy .NET do wdrożenia (w tym środowisko uruchomieniowe). - - - - Compiles and immediately executes a .NET project. - Kompiluje i natychmiast wykonuje projekt platformy .NET. - - - - Runs unit tests using the test runner specified in the project. - Uruchamia testy jednostkowe przy użyciu określonego w projekcie modułu uruchamiającego testy. - - - - Creates a NuGet package. - Tworzy pakiet NuGet. - - - - Migrates a project.json based project to a msbuild based project. - Migruje projekt oparty na pliku project.json do projektu opartego na programie MSBuild. - - - - Project modification commands - Polecenia modyfikacji projektu - - - - Add reference to the project. - Dodaj odwołanie do projektu. - - - - Remove reference from the project. - Usuń odwołanie z projektu. - - - - Advanced Commands - Polecenia zaawansowane - - - - Provides additional NuGet commands. - Udostępnia dodatkowe polecenia NuGet. - - - - Runs Microsoft Build Engine (MSBuild). - Uruchamia aparat Microsoft Build Engine (MSBuild). - - - - Runs Microsoft Test Execution Command Line Tool. - Uruchamia narzędzie Microsoft Test Execution Command Line Tool. - - - - Enable diagnostic output - Włącz diagnostyczne dane wyjściowe - - - - Clean build output(s). - Wyczyść dane wyjściowe kompilacji. - - - - Modify solution (SLN) files. - Modyfikuj pliki rozwiązania (SLN). - - - - List reference in the project. - Wyświetl odwołanie w projekcie. - - - - Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. - Określone polecenie („{0}”) nie jest prawidłowym poleceniem interfejsu wiersza polecenia. Określ prawidłowe polecenia interfejsu wiersza polecenia. Aby uzyskać więcej informacji, uruchom polecenie dotnet help. - - - - .NET CLI help utility - Narzędzie pomocy interfejsu wiersza polecenia platformy .NET - - - - Utility to get more detailed help about each of the CLI commands. - Narzędzie pozwalające uzyskać bardziej szczegółową pomoc dotyczącą poszczególnych poleceń interfejsu wiersza polecenia. - - - - COMMAND_NAME - NAZWA_POLECENIA - - - - CLI command for which to view more detailed help. - Polecenie interfejsu wiersza polecenie, dla którego chcesz wyświetlić bardziej szczegółową pomoc. - - - - The path to an application .dll file to execute. - Ścieżka do pliku dll aplikacji do wykonania. - - - - Display .NET Core SDK version. - Wyświetl wersję zestawu SDK programu .NET Core. - - - - Display .NET Core information. - Wyświetl informacje o programie .NET Core. - - - - Enable diagnostic output. - Włącz diagnostyczne dane wyjściowe. - - - - Run 'dotnet COMMAND --help' for more information on a command. - Uruchom polecenie „dotnet POLECENIE --help”, aby uzyskać więcej informacji o danym poleceniu. - - - - Path containing probing policy and assemblies to probe for. - Ścieżka zawierająca zasady sondowania i zestawy do sondowania. - - - - Path to <application>.deps.json file. - Ścieżka do pliku <aplikacja>.deps.json. - - - - Path to <application>.runtimeconfig.json file. - Ścieżka do pliku <aplikacja>.runtimeconfig.json. - - - - Version of the installed Shared Framework to use to run the application. - Wersja zainstalowanej platformy współużytkowanej służącej do uruchamiania aplikacji. - - - - Roll forward on no candidate shared framework is enabled. - Nie przenoś do przodu w czasie dla żadnego kandydata, dla którego jest włączona platforma współużytkowana. - - - - Path to additonal deps.json file. - Ścieżka do dodatkowego pliku deps.json. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index 738bb3734..000000000 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - Usage - Uso - - - - Arguments - Argumentos - - - - The command to execute - O comando a ser executado - - - - Arguments to pass to the command - Argumentos a serem passados para o comando - - - - Options specific to dotnet (host) - Opções específicas para o dotnet (host) - - - - Options common to all commands - Opções comuns para todos os comandos - - - - Common options - Opções comuns - - - - Show help. - Mostrar ajuda. - - - - Host options (passed before the command) - Opções de host (passadas antes do comando) - - - - Display .NET CLI Version Number - Exibir o Número de Versão da CLI do .NET - - - - Display .NET CLI Info - Exibir Informações da CLI do .NET - - - - SDK commands - Comandos do SDK - - - - Initialize .NET projects. - Inicializa projetos .NET. - - - - Restore dependencies specified in the .NET project. - Restaura as dependências especificadas no projeto .NET. - - - - Builds a .NET project. - Compila um projeto .NET. - - - - Publishes a .NET project for deployment (including the runtime). - Publica um projeto .NET para implantação (incluindo o tempo de execução). - - - - Compiles and immediately executes a .NET project. - Compila e executa imediatamente um projeto .NET. - - - - Runs unit tests using the test runner specified in the project. - Executa testes de unidade usando o executor de teste especificado no projeto. - - - - Creates a NuGet package. - Cria um pacote NuGet. - - - - Migrates a project.json based project to a msbuild based project. - Migra um projeto baseado em project.json para um projeto baseado em msbuild. - - - - Project modification commands - Comandos de modificação de projeto - - - - Add reference to the project. - Adicionar referência ao projeto. - - - - Remove reference from the project. - Remover referência do projeto. - - - - Advanced Commands - Comandos Avançados - - - - Provides additional NuGet commands. - Fornece comandos adicionais do NuGet. - - - - Runs Microsoft Build Engine (MSBuild). - Executa o MSBuild (Microsoft Build Engine). - - - - Runs Microsoft Test Execution Command Line Tool. - Executa a Ferramenta de Linha de Comando de Execução de Teste da Microsoft. - - - - Enable diagnostic output - Habilita a saída de diagnóstico - - - - Clean build output(s). - Limpa as saídas do build. - - - - Modify solution (SLN) files. - Modificar arquivos de solução (SLN). - - - - List reference in the project. - Listar referência no projeto. - - - - Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. - O comando '{0}' especificado não é um comando de CLI válido. Especifique comandos de CLI válidos. Para obter mais informações, execute a ajuda do dotnet. - - - - .NET CLI help utility - Utilitário de ajuda da CLI do .NET - - - - Utility to get more detailed help about each of the CLI commands. - Utilitário para obter ajuda mais detalhada sobre cada um dos comandos da CLI. - - - - COMMAND_NAME - COMMAND_NAME - - - - CLI command for which to view more detailed help. - Comando da CLI para o qual exibir ajuda mais detalhada. - - - - The path to an application .dll file to execute. - O caminho para um arquivo .dll de aplicativo a ser executado. - - - - Display .NET Core SDK version. - Exibir versão do SDK do .NET Core. - - - - Display .NET Core information. - Exibir informações do .NET Core. - - - - Enable diagnostic output. - Habilitar saída de diagnóstico. - - - - Run 'dotnet COMMAND --help' for more information on a command. - Execute 'dotnet COMMAND --help' para obter mais informações sobre um comando. - - - - Path containing probing policy and assemblies to probe for. - Caminho contendo a política de investigação e os assemblies a investigar. - - - - Path to <application>.deps.json file. - Caminho para o arquivo <application>.deps.json. - - - - Path to <application>.runtimeconfig.json file. - Caminho para o arquivo <application>.runtimeconfig.json. - - - - Version of the installed Shared Framework to use to run the application. - Versão do Shared Framework instalada a ser usada para a execução do aplicativo. - - - - Roll forward on no candidate shared framework is enabled. - Avançar quando nenhuma estrutura compartilhada candidata estiver habilitada. - - - - Path to additonal deps.json file. - Caminho para o arquivo deps.json adicional. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index a4ce7b230..000000000 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - Usage - Использование - - - - Arguments - Аргументы - - - - The command to execute - Выполняемая команда - - - - Arguments to pass to the command - Аргументы, передаваемые в команду - - - - Options specific to dotnet (host) - Параметры, определяемые dotnet (узлом) - - - - Options common to all commands - Параметры, общие для всех команд - - - - Common options - Общие параметры - - - - Show help. - Показать справку. - - - - Host options (passed before the command) - Параметры узла (передаваемые перед командой) - - - - Display .NET CLI Version Number - Показывать номер версии .NET CLI - - - - Display .NET CLI Info - Показывать сведения о .NET CLI - - - - SDK commands - Команды SDK - - - - Initialize .NET projects. - Инициализация проектов .NET. - - - - Restore dependencies specified in the .NET project. - Восстановление зависимостей, указанных в проектах .NET. - - - - Builds a .NET project. - Сборка проекта .NET. - - - - Publishes a .NET project for deployment (including the runtime). - Публикация проекта .NET для развертывания (включая среду выполнения). - - - - Compiles and immediately executes a .NET project. - Компиляция и немедленное выполнение проекта .NET. - - - - Runs unit tests using the test runner specified in the project. - Выполнение тестов с помощью средства выполнения тестов, указанного в проекте. - - - - Creates a NuGet package. - Создание пакета NuGet. - - - - Migrates a project.json based project to a msbuild based project. - Миграция проекта на основе project.json в проект на основе msbuild. - - - - Project modification commands - Команды изменения проекта - - - - Add reference to the project. - Добавление ссылки в проект. - - - - Remove reference from the project. - Удаление ссылки из проекта. - - - - Advanced Commands - Дополнительные команды - - - - Provides additional NuGet commands. - Предоставление дополнительных команд NuGet. - - - - Runs Microsoft Build Engine (MSBuild). - Запуск Microsoft Build Engine (MSBuild). - - - - Runs Microsoft Test Execution Command Line Tool. - Запуск программы командной строки Майкрософт для выполнения тестов. - - - - Enable diagnostic output - Включить диагностические выходные данные. - - - - Clean build output(s). - Очистка выходных данных сборки. - - - - Modify solution (SLN) files. - Изменение файлов решения (SLN). - - - - List reference in the project. - Список ссылок в проекте. - - - - Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. - Указанная команда "{0}" не является допустимой командой CLI. Укажите допустимые команды CLI. Чтобы получить дополнительные сведения, откройте справку dotnet. - - - - .NET CLI help utility - Вспомогательная программа .NET CLI - - - - Utility to get more detailed help about each of the CLI commands. - Служебная программа для получения более подробной справки по каждой из команд CLI. - - - - COMMAND_NAME - COMMAND_NAME - - - - CLI command for which to view more detailed help. - Команда CLI, подробную справку по которой необходимо просмотреть. - - - - The path to an application .dll file to execute. - Путь к DLL-файлу приложения, который необходимо выполнить. - - - - Display .NET Core SDK version. - Отображение версии пакета SDK для .NET Core. - - - - Display .NET Core information. - Отображение сведений о .NET Core. - - - - Enable diagnostic output. - Включение выходных данных диагностики. - - - - Run 'dotnet COMMAND --help' for more information on a command. - Выполните команду "dotnet КОМАНДА --help" для получения дополнительной информации о команде. - - - - Path containing probing policy and assemblies to probe for. - Путь к политике проверки и проверяемым сборкам. - - - - Path to <application>.deps.json file. - Путь к файлу <приложение>.deps.json. - - - - Path to <application>.runtimeconfig.json file. - Путь к файлу <приложение>.runtimeconfig.json. - - - - Version of the installed Shared Framework to use to run the application. - Версия установленной общей платформы, которую следует использовать для запуска приложения. - - - - Roll forward on no candidate shared framework is enabled. - Если потенциальная общая платформа не включена, выполняется накат. - - - - Path to additonal deps.json file. - Путь к дополнительному файлу deps.json. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index 55ef67760..000000000 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - Usage - Kullanım - - - - Arguments - Bağımsız değişkenler - - - - The command to execute - Yürütülecek komut - - - - Arguments to pass to the command - Komuta geçirilecek bağımsız değişkenler - - - - Options specific to dotnet (host) - Dotnet’e özel seçenekler (konak) - - - - Options common to all commands - Tüm komutlar için ortak seçenekler - - - - Common options - Ortak seçenekler - - - - Show help. - Yardımı gösterir. - - - - Host options (passed before the command) - Konak seçenekleri (komuttan önce geçirilir) - - - - Display .NET CLI Version Number - .NET CLI Sürüm Numarasını Görüntüle - - - - Display .NET CLI Info - .NET CLI Bilgisini Görüntüle - - - - SDK commands - SDK komutları - - - - Initialize .NET projects. - .NET projelerini başlatır. - - - - Restore dependencies specified in the .NET project. - .NET projesinde belirtilen bağımlılıkları geri yükler. - - - - Builds a .NET project. - .NET projesi derler. - - - - Publishes a .NET project for deployment (including the runtime). - Dağıtım için bir .NET projesi yayımlar (çalışma zamanı dahil). - - - - Compiles and immediately executes a .NET project. - Bir .NET projesini derler ve hemen çalıştırır. - - - - Runs unit tests using the test runner specified in the project. - Projede belirtilen test çalıştırıcısını kullanarak birim testleri çalıştırır. - - - - Creates a NuGet package. - NuGet paketi oluşturur. - - - - Migrates a project.json based project to a msbuild based project. - project.json tabanlı bir projeyi msbuild tabanlı bir projeye geçirir. - - - - Project modification commands - Projede değişiklik komutları - - - - Add reference to the project. - Projeye başvuru ekleyin. - - - - Remove reference from the project. - Projeden başvuru kaldırın. - - - - Advanced Commands - Gelişmiş Komutlar - - - - Provides additional NuGet commands. - Ek NuGet komutları sağlar. - - - - Runs Microsoft Build Engine (MSBuild). - Microsoft Build Engine’i (MSBuild) çalıştırır. - - - - Runs Microsoft Test Execution Command Line Tool. - Microsoft Test Çalıştırması Komut Satırı Aracı’nı çalıştırır. - - - - Enable diagnostic output - Tanılama çıkışını etkinleştir - - - - Clean build output(s). - Derleme çıkışlarını temizler. - - - - Modify solution (SLN) files. - Çözüm (SLN) dosyalarını değiştirin. - - - - List reference in the project. - Projede başvuruyu listeleyin. - - - - Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. - Belirtilen '{0}' komutu geçerli bir CLI komutu değil. Lütfen geçerli bir CLI komutu belirtin. Daha fazla bilgi için dotnet yardımını çalıştırın. - - - - .NET CLI help utility - .NET CLI yardımcı programı - - - - Utility to get more detailed help about each of the CLI commands. - CLI komutlarının her biri hakkında daha ayrıntılı yardım sunan yardımcı program. - - - - COMMAND_NAME - COMMAND_NAME - - - - CLI command for which to view more detailed help. - Daha ayrıntılı yardım bilgileri görüntülenecek olan CLI komutu. - - - - The path to an application .dll file to execute. - Çalıştırılacak uygulama .dll dosyasının yolu. - - - - Display .NET Core SDK version. - .NET Core SDK sürümünü gösterir. - - - - Display .NET Core information. - .NET Core bilgilerini gösterir. - - - - Enable diagnostic output. - Tanılama çıkışını etkinleştirir. - - - - Run 'dotnet COMMAND --help' for more information on a command. - Bir komut hakkında daha fazla bilgi için 'dotnet COMMAND --help' komutunu çalıştırın. - - - - Path containing probing policy and assemblies to probe for. - Araştırma ilkesini ve araştırılacak bütünleştirilmiş kodları içeren yol. - - - - Path to <application>.deps.json file. - <uygulama>.deps.json dosyasının yolu. - - - - Path to <application>.runtimeconfig.json file. - <uygulama>.runtimeconfig.json dosyasının yolu. - - - - Version of the installed Shared Framework to use to run the application. - Uygulamayı çalıştırmak için kullanılacak olan yüklü Paylaşılan Çerçevenin sürümü - - - - Roll forward on no candidate shared framework is enabled. - Aday paylaşılan çerçevelerin hiçbirinde ileri sarma etkin değil. - - - - Path to additonal deps.json file. - Ek deps.json dosyasının yolu. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.xlf deleted file mode 100644 index dcb4ed353..000000000 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,200 +0,0 @@ - - - - - - - Usage - - - - Arguments - - - - The command to execute - - - - Arguments to pass to the command - - - - Options specific to dotnet (host) - - - - Options common to all commands - - - - Common options - - - - Enable verbose output - - - - Show help - - - - Host options (passed before the command) - - - - Display .NET CLI Version Number - - - - Display .NET CLI Info - - - - SDK commands - - - - Initialize .NET projects. - - - - Restore dependencies specified in the .NET project. - - - - Builds a .NET project. - - - - Publishes a .NET project for deployment (including the runtime). - - - - Compiles and immediately executes a .NET project. - - - - Runs unit tests using the test runner specified in the project. - - - - Creates a NuGet package. - - - - Migrates a project.json based project to a msbuild based project. - - - - Project modification commands - - - - Add reference to the project. - - - - Remove reference from the project. - - - - Advanced Commands - - - - Provides additional NuGet commands. - - - - Runs Microsoft Build Engine (MSBuild). - - - - Runs Microsoft Test Execution Command Line Tool. - - - - Enable diagnostic output - - - - Clean build output(s). - - - - Modify solution (SLN) files. - - - - List reference in the project. - - - - Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. - - - - .NET CLI help utility - - - - Utility to get more detailed help about each of the CLI commands. - - - - COMMAND_NAME - - - - CLI command for which to view more detailed help. - - - - The path to an application .dll file to execute. - - - - Display .NET Core SDK version. - - - - Display .NET Core information. - - - - Enable diagnostic output. - - - - Run 'dotnet COMMAND --help' for more information on a command. - - - - Path containing probing policy and assemblies to probe for. - - - - Path to <application>.deps.json file. - - - - Path to <application>.runtimeconfig.json file. - - - - Version of the installed Shared Framework to use to run the application. - - - - Roll forward on no candidate shared framework is enabled. - - - - Path to additonal deps.json file. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index b2d8cfd42..000000000 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - Usage - 使用情况 - - - - Arguments - Arguments - - - - The command to execute - 要执行的命令 - - - - Arguments to pass to the command - 要传递给命令的参数 - - - - Options specific to dotnet (host) - 特定于 dotnet (主机)的选项 - - - - Options common to all commands - 所有命令的常用选项 - - - - Common options - 常用选项 - - - - Show help. - 显示帮助。 - - - - Host options (passed before the command) - 主机选项(在命令之前传递) - - - - Display .NET CLI Version Number - 显示 .NET CLI 版本号 - - - - Display .NET CLI Info - 显示.NET CLI 信息 - - - - SDK commands - SDK 命令 - - - - Initialize .NET projects. - 初始化 .NET 项目。 - - - - Restore dependencies specified in the .NET project. - 还原 .NET 项目中指定的依赖项。 - - - - Builds a .NET project. - 生成 .NET 项目。 - - - - Publishes a .NET project for deployment (including the runtime). - 发布 .NET 项目以进行部署(包括运行时)。 - - - - Compiles and immediately executes a .NET project. - 编译并立即执行 .NET 项目。 - - - - Runs unit tests using the test runner specified in the project. - 使用项目中指定的测试运行程序运行单元测试。 - - - - Creates a NuGet package. - 创建 NuGet 包。 - - - - Migrates a project.json based project to a msbuild based project. - 将基于 project.json 的项目迁移到基于 MSBuild 的项目。 - - - - Project modification commands - 项目修改命令 - - - - Add reference to the project. - 将引用添加到项目中。 - - - - Remove reference from the project. - 从项目中删除引用。 - - - - Advanced Commands - 高级命令 - - - - Provides additional NuGet commands. - 提供其他 NuGet 命令。 - - - - Runs Microsoft Build Engine (MSBuild). - 运行 Microsoft 生成引擎 (MSBuild)。 - - - - Runs Microsoft Test Execution Command Line Tool. - 运行 Microsoft 测试执行命令行工具。 - - - - Enable diagnostic output - 启用诊断输出 - - - - Clean build output(s). - 清除生成输出。 - - - - Modify solution (SLN) files. - 修改解决方案(SLN)文件。 - - - - List reference in the project. - 列出项目中的引用。 - - - - Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. - 指定的命令“{0}”不是有效的 CLI 命令。请指定有效的 CLI 命令。有关详细信息,请运行 dotnet help。 - - - - .NET CLI help utility - .NET CLI 帮助实用程序 - - - - Utility to get more detailed help about each of the CLI commands. - 用于就每个 CLI 命令获取更详细帮助的实用程序。 - - - - COMMAND_NAME - COMMAND_NAME - - - - CLI command for which to view more detailed help. - 要查看其更详细帮助的 CLI 命令。 - - - - The path to an application .dll file to execute. - 要执行的应用程序 .dll 文件的路径。 - - - - Display .NET Core SDK version. - 显示 .NET Core SDK 版本。 - - - - Display .NET Core information. - 显示 .NET Core 信息。 - - - - Enable diagnostic output. - 启用诊断输出。 - - - - Run 'dotnet COMMAND --help' for more information on a command. - 运行“dotnet 命令 --help”,获取有关命令的详细信息。 - - - - Path containing probing policy and assemblies to probe for. - 要探测的包含探测策略和程序集的路径。 - - - - Path to <application>.deps.json file. - 指向 <应用程序>.deps.json 文件的路径。 - - - - Path to <application>.runtimeconfig.json file. - 指向 <应用程序>.runtimeconfig.json 文件的路径。 - - - - Version of the installed Shared Framework to use to run the application. - 要用于运行应用程序的安装版共享框架的版本。 - - - - Roll forward on no candidate shared framework is enabled. - 已启用“不前滚到候选共享框架”。 - - - - Path to additonal deps.json file. - 其他 deps.json 文件的路径。 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index 19f53ffe6..000000000 --- a/src/dotnet/commands/dotnet-help/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - Usage - 使用方式 - - - - Arguments - Arguments - - - - The command to execute - 要執行的命令 - - - - Arguments to pass to the command - 要傳遞到命令的引數 - - - - Options specific to dotnet (host) - dotnet (host) 專用選項 - - - - Options common to all commands - 所有命令通用的選項 - - - - Common options - 通用選項 - - - - Show help. - 顯示說明。 - - - - Host options (passed before the command) - 裝載選項 (在命令之前傳遞) - - - - Display .NET CLI Version Number - 顯示 .NET CLI 版本號碼 - - - - Display .NET CLI Info - 顯示 .NET CLI 資訊 - - - - SDK commands - SDK 命令 - - - - Initialize .NET projects. - 將 .NET 專案初始化。 - - - - Restore dependencies specified in the .NET project. - 還原 .NET 專案中指定的相依性。 - - - - Builds a .NET project. - 建置 .NET 專案。 - - - - Publishes a .NET project for deployment (including the runtime). - 發行用於部署的 .NET 專案 (包括執行階段)。 - - - - Compiles and immediately executes a .NET project. - 編譯並立即執行 .NET 專案。 - - - - Runs unit tests using the test runner specified in the project. - 使用專案中指定的測試執行器來執行單元測試。 - - - - Creates a NuGet package. - 建立 NuGet 套件。 - - - - Migrates a project.json based project to a msbuild based project. - 將 project.json 專案移轉到 MSBuild 專案。 - - - - Project modification commands - 專案修改命令 - - - - Add reference to the project. - 將參考新增至專案。 - - - - Remove reference from the project. - 從專案中移除參考。 - - - - Advanced Commands - 進階命令 - - - - Provides additional NuGet commands. - 提供其他 NuGet 命令。 - - - - Runs Microsoft Build Engine (MSBuild). - 執行 Microsoft Build Engine (MSBuild)。 - - - - Runs Microsoft Test Execution Command Line Tool. - 執行 Microsoft Test Execution Command Line Tool。 - - - - Enable diagnostic output - 啟用診斷輸出 - - - - Clean build output(s). - 清除建置輸出。 - - - - Modify solution (SLN) files. - 修改方案 (SLN) 檔。 - - - - List reference in the project. - 列出專案中的參考。 - - - - Specified command '{0}' is not a valid CLI command. Please specify a valid CLI commands. For more information, run dotnet help. - 指定的命令 '{0}' 不是有效的 CLI 命令。請指定有效的 CLI 命令。如需詳細資訊,請執行 dotnet help。 - - - - .NET CLI help utility - .NET CLI 說明公用程式 - - - - Utility to get more detailed help about each of the CLI commands. - 用於取得每個 CLI 命令相關詳細說明的公用程式。 - - - - COMMAND_NAME - COMMAND_NAME - - - - CLI command for which to view more detailed help. - 要檢視其詳細說明的 CLI 命令。 - - - - The path to an application .dll file to execute. - 要執行的應用程式 .dll 檔案之路徑。 - - - - Display .NET Core SDK version. - 顯示 .NET Core SDK 版本。 - - - - Display .NET Core information. - 顯示 .NET Core 資訊。 - - - - Enable diagnostic output. - 啟用診斷輸出。 - - - - Run 'dotnet COMMAND --help' for more information on a command. - 如需命令的詳細資訊,請執行 'dotnet COMMAND --help'。 - - - - Path containing probing policy and assemblies to probe for. - 包含探查原則及要探查之組件的路徑。 - - - - Path to <application>.deps.json file. - <應用程式>.deps.json 檔案的路徑。 - - - - Path to <application>.runtimeconfig.json file. - <應用程式>.runtimeconfig.json 檔案的路徑。 - - - - Version of the installed Shared Framework to use to run the application. - 用於執行應用程式的已安裝之共用架構的版本。 - - - - Roll forward on no candidate shared framework is enabled. - 已啟用在沒有候選共用架構上的向前復原。 - - - - Path to additonal deps.json file. - 其他 deps.json 檔案的路徑。 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-internal-reportinstallsuccess/InternalReportinstallsuccessCommand.cs b/src/dotnet/commands/dotnet-internal-reportinstallsuccess/InternalReportinstallsuccessCommand.cs deleted file mode 100644 index b44e9b41c..000000000 --- a/src/dotnet/commands/dotnet-internal-reportinstallsuccess/InternalReportinstallsuccessCommand.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using Microsoft.DotNet.Configurer; -using Microsoft.DotNet.Cli.Telemetry; - -namespace Microsoft.DotNet.Cli -{ - public class InternalReportinstallsuccess - { - internal const string TelemetrySessionIdEnvironmentVariableName = "DOTNET_CLI_TELEMETRY_SESSIONID"; - - public static int Run(string[] args) - { - var telemetry = new ThreadBlockingTelemetry(); - ProcessInputAndSendTelemetry(args, telemetry); - - return 0; - } - - public static void ProcessInputAndSendTelemetry(string[] args, ITelemetry telemetry) - { - var parser = Parser.Instance; - var result = parser.ParseFrom("dotnet internal-reportinstallsuccess", args); - - var internalReportinstallsuccess = result["dotnet"]["internal-reportinstallsuccess"]; - - var exeName = Path.GetFileName(internalReportinstallsuccess.Arguments.Single()); - telemetry.TrackEvent( - "reportinstallsuccess", - new Dictionary { { "exeName", exeName } }, - new Dictionary()); - } - - internal class ThreadBlockingTelemetry : ITelemetry - { - private Telemetry.Telemetry telemetry; - - internal ThreadBlockingTelemetry() - { - var sessionId = - Environment.GetEnvironmentVariable(TelemetrySessionIdEnvironmentVariableName); - telemetry = new Telemetry.Telemetry(new NoOpFirstTimeUseNoticeSentinel(), sessionId, blockThreadInitialization: true); - } - public bool Enabled => telemetry.Enabled; - - public void TrackEvent(string eventName, IDictionary properties, IDictionary measurements) - { - telemetry.ThreadBlockingTrackEvent(eventName, properties, measurements); - } - } - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-internal-reportinstallsuccess/InternalReportinstallsuccessCommandParser.cs b/src/dotnet/commands/dotnet-internal-reportinstallsuccess/InternalReportinstallsuccessCommandParser.cs deleted file mode 100644 index 1c83a86b3..000000000 --- a/src/dotnet/commands/dotnet-internal-reportinstallsuccess/InternalReportinstallsuccessCommandParser.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; - -namespace Microsoft.DotNet.Cli -{ - internal static class InternalReportinstallsuccessCommandParser - { - public static Command InternalReportinstallsuccess() => - Create.Command( - "internal-reportinstallsuccess", "internal only", - Accept.ExactlyOneArgument()); - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/ListCommandParser.cs b/src/dotnet/commands/dotnet-list/ListCommandParser.cs deleted file mode 100644 index 1fee43e0f..000000000 --- a/src/dotnet/commands/dotnet-list/ListCommandParser.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Tools; -using LocalizableStrings = Microsoft.DotNet.Tools.List.LocalizableStrings; - -namespace Microsoft.DotNet.Cli -{ - internal static class ListCommandParser - { - public static Command List() => - Create.Command("list", - LocalizableStrings.NetListCommand, - Accept.ZeroOrOneArgument() - .With(name: CommonLocalizableStrings.CmdProjectFile, - description: - CommonLocalizableStrings.ArgumentsProjectDescription) - .DefaultToCurrentDirectory(), - CommonOptions.HelpOption(), - Create.Command("reference", - Tools.List.ProjectToProjectReferences.LocalizableStrings.AppFullName, - Accept.ZeroOrOneArgument(), - CommonOptions.HelpOption())); - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/LocalizableStrings.resx b/src/dotnet/commands/dotnet-list/LocalizableStrings.resx deleted file mode 100644 index 41c12481c..000000000 --- a/src/dotnet/commands/dotnet-list/LocalizableStrings.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - .NET List Command - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/Program.cs b/src/dotnet/commands/dotnet-list/Program.cs deleted file mode 100644 index 403302b39..000000000 --- a/src/dotnet/commands/dotnet-list/Program.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Tools.List.ProjectToProjectReferences; - -namespace Microsoft.DotNet.Tools.List -{ - public class ListCommand : DotNetTopLevelCommandBase - { - protected override string CommandName => "list"; - protected override string FullCommandNameLocalized => LocalizableStrings.NetListCommand; - protected override string ArgumentName => Constants.ProjectArgumentName; - protected override string ArgumentDescriptionLocalized => CommonLocalizableStrings.ArgumentsProjectDescription; - - internal override Dictionary> SubCommands => - new Dictionary> - { - { - "reference", - o => new ListProjectToProjectReferencesCommand( - o, - ParseResult) - } - }; - - public static int Run(string[] args) - { - var command = new ListCommand(); - return command.RunCommand(args); - } - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-proj/LocalizableStrings.resx b/src/dotnet/commands/dotnet-list/dotnet-list-proj/LocalizableStrings.resx deleted file mode 100644 index a7913dc1d..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-proj/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 - - - .NET Projects in Solution viewer - - - Command to list projects in a solution - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index b151f7b6f..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - .NET Projects in Solution viewer - Projekty .NET v prohlížeči řešení - - - - Command to list projects in a solution - Příkaz pro zobrazení seznamu projektů v řešení - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index 8da16bcd0..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - .NET Projects in Solution viewer - .NET-Projekte in Projektmappenviewer - - - - Command to list projects in a solution - Befehl zum Auflisten von Projekten in einer Projektmappe - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index 420558ecc..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - .NET Projects in Solution viewer - Visor de proyectos de NET en la solución - - - - Command to list projects in a solution - Comando para mostrar los proyectos de una solución - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index 3066ae96e..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - .NET Projects in Solution viewer - Projets .NET dans la visionneuse de solutions - - - - Command to list projects in a solution - Commande permettant de lister les projets d'une solution - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index 6441bf146..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - .NET Projects in Solution viewer - Progetti .NET nel visualizzatore soluzioni - - - - Command to list projects in a solution - Comando per elencare i progetti presenti in una soluzione - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index b3ac167c7..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - .NET Projects in Solution viewer - ソリューション ビューアー内の .NET プロジェクト - - - - Command to list projects in a solution - ソリューションのプロジェクトを一覧表示するコマンド - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index a86df7d2c..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - .NET Projects in Solution viewer - .NET 솔루션 뷰어의 프로젝트 - - - - Command to list projects in a solution - 솔루션의 프로젝트를 나열하기 위한 명령입니다. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index 8bed18a05..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - .NET Projects in Solution viewer - Podgląd projektów w rozwiązaniu dla platformy .NET - - - - Command to list projects in a solution - Polecenie umożliwiające wyświetlenie listy projektów w rozwiązaniu - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index 66f962109..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - .NET Projects in Solution viewer - Projetos .NET no visualizador da Solução - - - - Command to list projects in a solution - Comando para listar os projetos em uma solução - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index 6a7ba6513..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - .NET Projects in Solution viewer - Проекты .NET в средстве просмотра решений - - - - Command to list projects in a solution - Команда для перечисления проектов в решении - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index 0d071b7ed..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - .NET Projects in Solution viewer - Çözüm görüntüleyicisinde .NET Projeleri - - - - Command to list projects in a solution - Bir çözümdeki projeleri listeleme komutu - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.xlf deleted file mode 100644 index 6856ef94e..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - .NET Projects in Solution viewer - - - - Command to list projects in a solution - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index ed721ca0b..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - .NET Projects in Solution viewer - 解决方案查看器中的 .NET 项目 - - - - Command to list projects in a solution - 用于列出解决方案中项目的命令 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index 01551fb1e..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-proj/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - .NET Projects in Solution viewer - 解決方案檢視器中的 .NET 專案 - - - - Command to list projects in a solution - 命令,用以列出解決方案中的專案 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-reference/LocalizableStrings.resx b/src/dotnet/commands/dotnet-list/dotnet-list-reference/LocalizableStrings.resx deleted file mode 100644 index 5536ff5ef..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-reference/LocalizableStrings.resx +++ /dev/null @@ -1,130 +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 - - - .NET Core Project-to-Project dependency viewer - - - Command to list project to project references - - - There are no {0} references in project {1}. -{0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-reference/Program.cs b/src/dotnet/commands/dotnet-list/dotnet-list-reference/Program.cs deleted file mode 100644 index 7a4f3cb18..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-reference/Program.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Linq; -using Microsoft.Build.Evaluation; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.Tools.List.ProjectToProjectReferences -{ - internal class ListProjectToProjectReferencesCommand : CommandBase - { - private readonly string _fileOrDirectory; - - public ListProjectToProjectReferencesCommand( - AppliedOption appliedCommand, - ParseResult parseResult) : base(parseResult) - { - if (appliedCommand == null) - { - throw new ArgumentNullException(nameof(appliedCommand)); - } - - _fileOrDirectory = appliedCommand.Arguments.Single(); - } - - public override int Execute() - { - var msbuildProj = MsbuildProject.FromFileOrDirectory(new ProjectCollection(), _fileOrDirectory); - - var p2ps = msbuildProj.GetProjectToProjectReferences(); - if (!p2ps.Any()) - { - Reporter.Output.WriteLine(string.Format( - CommonLocalizableStrings.NoReferencesFound, - CommonLocalizableStrings.P2P, - _fileOrDirectory)); - return 0; - } - - Reporter.Output.WriteLine($"{CommonLocalizableStrings.ProjectReferenceOneOrMore}"); - Reporter.Output.WriteLine(new string('-', CommonLocalizableStrings.ProjectReferenceOneOrMore.Length)); - foreach (var p2p in p2ps) - { - Reporter.Output.WriteLine(p2p.Include); - } - - return 0; - } - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index f3ad5910e..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - .NET Core Project-to-Project dependency viewer - Prohlížeč závislostí mezi projekty .NET Core - - - - Command to list project to project references - Příkaz pro zobrazení seznamu odkazů mezi projekty - - - - There are no {0} references in project {1}. -{0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). - Projekt {1} neobsahuje odkazy na {0}. -{0} je typ požadované položky (projekt, balíček, p2p) a {1} je používaný objekt (soubor projektu nebo soubor řešení). - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index 74a6572f8..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - .NET Core Project-to-Project dependency viewer - Viewer für .NET Core-Interprojektabhängigkeit - - - - Command to list project to project references - Befehl zum Auflisten von Projekt-zu-Projekt-Verweisen - - - - There are no {0} references in project {1}. -{0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). - In Projekt „{1}“ liegen keine {0}-Verweise vor. -{0} ist der Typ des angeforderten Elements (Projekt, Paket, P2P) und „{1}“ das Objekt, an dem der Vorgang ausgeführt wird (eine Projekt- oder Projektmappendatei). - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index 6a753c6f5..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - .NET Core Project-to-Project dependency viewer - Visor de dependencias de proyecto a proyecto de .NET Core - - - - Command to list project to project references - Comando para enumerar las referencias de proyecto a proyecto - - - - There are no {0} references in project {1}. -{0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). - No hay referencias de {0} en el proyecto {1}. -{0} es el tipo de elemento solicitado (proyecto, paquete, p2p) y {1} es el objeto utilizado (un archivo de proyecto o de solución). - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index be6425b01..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - .NET Core Project-to-Project dependency viewer - Visionneuse de dépendances de projet à projet .NET Core - - - - Command to list project to project references - Commande permettant de répertorier les références projet à projet - - - - There are no {0} references in project {1}. -{0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). - Il n'existe aucune référence {0} dans le projet {1}. -{0} est le type de l'élément demandé (projet, package, p2p) et {1} est l'objet utilisé (fichier projet ou fichier solution). - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index 0f73dc2ca..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - .NET Core Project-to-Project dependency viewer - Visualizzatore dipendenze P2P (da progetto a progetto) di .NET Core - - - - Command to list project to project references - Comando per elencare i riferimenti P2P (da progetto a progetto) - - - - There are no {0} references in project {1}. -{0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). - Non ci sono riferimenti a {0} nel progetto {1}. -{0} è il tipo dell'elemento richiesto (progetto, pacchetto o P2P) e {1} è l'oggetto su cui si interviene (file di progetto o di soluzione). - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index 583d8eda3..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - .NET Core Project-to-Project dependency viewer - .NET Core プロジェクト間の依存関係ビューアー - - - - Command to list project to project references - プロジェクト間参照を一覧表示するコマンド - - - - There are no {0} references in project {1}. -{0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). - プロジェクト {1} 内に {0} 参照がありません。 -{0} は要求中のアイテムの種類 (プロジェクト、パッケージ、p2p) であり、{1} は操作対象のオブジェクト (プロジェクト ファイルまたはソリューション ファイル) です。 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index 9b0d8960f..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - .NET Core Project-to-Project dependency viewer - .NET Core p2p(프로젝트 간) 종속성 뷰어 - - - - Command to list project to project references - 프로젝트 간 참조를 나열하기 위한 명령입니다. - - - - There are no {0} references in project {1}. -{0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). - {1} 프로젝트에 {0} 참조가 없습니다. -{0}은(는) 요청한 항목의 형식(프로젝트, 패키지, p2p)이고 {1}은(는) 작업 중인 개체(프로젝트 파일 또는 솔루션 파일)입니다. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index 0e65d08f5..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - .NET Core Project-to-Project dependency viewer - Podgląd zależności między projektami w programie .NET Core - - - - Command to list project to project references - Polecenie służące do wyświetlania listy odwołań między projektami - - - - There are no {0} references in project {1}. -{0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). - Brak odwołań do elementu typu {0} w projekcie {1}. -{0} to typ żądanego elementu (projekt, pakiet, odwołanie między projektami), a {1} to obiekt, na którym przeprowadzana jest operacja (plik projektu lub rozwiązania). - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index 939ec1f33..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - .NET Core Project-to-Project dependency viewer - Visualizador de dependência Projeto a Projeto do .NET Core - - - - Command to list project to project references - Comando para listar referências de projeto para projeto - - - - There are no {0} references in project {1}. -{0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). - Não há referências {0} no projeto {1}. -{0} é o tipo do item solicitado (projeto, pacote, p2p) e {1} é o objeto no qual ocorre a operação (um arquivo de projeto ou de solução). - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index 8c7def975..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - .NET Core Project-to-Project dependency viewer - Средство просмотра зависимостей между проектами .NET Core - - - - Command to list project to project references - Эта команда перечисляет ссылки из одного проекта на другой - - - - There are no {0} references in project {1}. -{0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). - В проекте {1} нет ссылок {0}. -{0} — тип запрашиваемого элемента (проект, пакет, p2p), а {1} — обрабатываемый объект (файл проекта или решения). - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index 12ed716a4..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - .NET Core Project-to-Project dependency viewer - .NET Core Projeden Projeye bağımlılık görüntüleyicisi - - - - Command to list project to project references - Projeden projeye başvuruları listeleme komutu - - - - There are no {0} references in project {1}. -{0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). - {1} projesinde {0} başvurusu yok. -{0}, istenen öğenin türü (proje, paket, p2p) ve {1}, üzerinde işlem yapılan nesnedir (bir proje dosyası veya çözüm dosyası). - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.xlf deleted file mode 100644 index 7c015ba0b..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - .NET Core Project-to-Project dependency viewer - - - - Command to list project to project references - - - - There are no {0} references in project {1}. -{0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index 7fc38d2bb..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - .NET Core Project-to-Project dependency viewer - .NET Core 项目到项目的依赖项查看器 - - - - Command to list project to project references - 用于列出项目到项目引用的命令 - - - - There are no {0} references in project {1}. -{0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). - 项目 {1} 中没有 {0} 引用。 -{0} 是正在请求的项类型(项目、包、p2p),{1} 是项目文件或解决方案文件上操作的对象。 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index 757921e30..000000000 --- a/src/dotnet/commands/dotnet-list/dotnet-list-reference/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - .NET Core Project-to-Project dependency viewer - .NET Core 專案對專案相依性檢視器 - - - - Command to list project to project references - 用以列出專案對專案參考的命令 - - - - There are no {0} references in project {1}. -{0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). - 專案 {1} 中沒有任何 {0} 參考。 -{0} 是所要求項目的類型 (專案、套件、p2p),而 {1} 是操作的物件 (專案檔或方案檔)。 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index ce6aea3e6..000000000 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET List Command - Příkaz .NET pro zobrazení seznamu - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index 41e001be7..000000000 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET List Command - .NET-Auflistbefehl - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index 36f5191ce..000000000 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET List Command - Comando de lista de .NET - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index df29efbd4..000000000 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET List Command - Commande de liste .NET - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index a8e413514..000000000 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET List Command - Comando Elenca .NET - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index b718b4da6..000000000 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET List Command - .NET List コマンド - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index 280ffedfb..000000000 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET List Command - .NET 명령 나열 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index 76642c8e3..000000000 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET List Command - Polecenie list platformy .NET - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index e264253f3..000000000 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET List Command - Comando List do .NET - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index d01c0c362..000000000 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET List Command - Команда .NET "Список" - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index 08752788f..000000000 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET List Command - .NET Listeleme Komutu - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.xlf deleted file mode 100644 index ebac5b83a..000000000 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - .NET List Command - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index aed256398..000000000 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET List Command - .NET 列表命令 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index c45809b10..000000000 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET List Command - .NET 清單命令 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/DotnetNewRedirector.cs b/src/dotnet/commands/dotnet-migrate/DotnetNewRedirector.cs deleted file mode 100644 index bc997da4c..000000000 --- a/src/dotnet/commands/dotnet-migrate/DotnetNewRedirector.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Tools.MigrateCommand; -using System.Collections.Generic; - -namespace Microsoft.DotNet.Tools.Migrate -{ - public class DotnetNewRedirector : ICanCreateDotnetCoreTemplate - { - public void CreateWithEphemeralHiveAndNoRestore( - string templateName, - string outputDirectory, - string workingDirectory) - { - RunCommand("new", new string[] { "console", "-o", workingDirectory, "--debug:ephemeral-hive", "--no-restore" }, workingDirectory); - } - private void RunCommand(string commandToExecute, IEnumerable args, string workingDirectory) - { - var command = new DotNetCommandFactory() - .Create(commandToExecute, args) - .WorkingDirectory(workingDirectory) - .CaptureStdOut() - .CaptureStdErr(); - - var commandResult = command.Execute(); - - if (commandResult.ExitCode != 0) - { - string argList = string.Join(", ", args); - throw new GracefulException($"Failed to run {commandToExecute} with " + - $"args: {argList} ... " + - $"workingDirectory = {workingDirectory}, " + - $"StdOut = {commandResult.StdOut}, " + - $"StdErr = {commandResult.StdErr}"); - } - } - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/DotnetSlnRedirector.cs b/src/dotnet/commands/dotnet-migrate/DotnetSlnRedirector.cs deleted file mode 100644 index 9824741d0..000000000 --- a/src/dotnet/commands/dotnet-migrate/DotnetSlnRedirector.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Tools.MigrateCommand; -using Microsoft.DotNet.Tools.Sln; - -namespace Microsoft.DotNet.Tools.Migrate -{ - public class DotnetSlnRedirector : ICanManipulateSolutionFile - { - public void AddProjectToSolution(string solutionFilePath, string projectFilePath) - { - var newCommandArgs = new[] {solutionFilePath, SlnAddParser.SlnAdd().Name, projectFilePath}; - var result = SlnCommand.Run(newCommandArgs); - - if (result != 0) - { - throw new GracefulException( - $"{nameof(SlnCommand)} " + - "failed to execuate given args " + - $"{string.Join(" ", newCommandArgs)}"); - } - } - - public void RemoveProjectFromSolution(string solutionFilePath, string projectFilePath) - { - var newCommandArgs = new[] {solutionFilePath, SlnRemoveParser.SlnRemove().Name, projectFilePath}; - var result = SlnCommand.Run(newCommandArgs); - - if (result != 0) - { - throw new GracefulException( - $"{nameof(SlnCommand)} " + - "failed to execuate given args " + - $"{string.Join(" ", newCommandArgs)}"); - } - } - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/LocalizableStrings.resx b/src/dotnet/commands/dotnet-migrate/LocalizableStrings.resx deleted file mode 100644 index b86e0da0d..000000000 --- a/src/dotnet/commands/dotnet-migrate/LocalizableStrings.resx +++ /dev/null @@ -1,206 +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 - - - .NET Migrate Command - - - Command used to migrate project.json projects to msbuild - - - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - - - The path to one of the following: - - a project.json file to migrate. - - a global.json file, it will migrate the folders specified in global.json. - - a solution.sln file, it will migrate the projects referenced in the solution. - - a directory to migrate, it will recursively search for project.json files to migrate. -Defaults to current directory if nothing is specified. - - - Base MSBuild template to use for migrated app. The default is the project included in dotnet new. - - - The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. - - - The path to the xproj file to use. Required when there is more than one xproj in a project directory. - - - Skip migrating project references. By default, project references are migrated recursively. - - - Output migration report to the given file in addition to the console. - - - Output migration report file as json rather than user messages. - - - Skip moving project.json, global.json, and *.xproj to a `backup` directory after successful migration. - - - Migration failed. - - - The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. - - - Summary - - - Total Projects: {0} - - - Succeeded Projects: {0} - - - Failed Projects: {0} - - - Project {0} migration succeeded ({1}). - - - Project {0} migration failed ({1}). - - - Unable to find any projects in global.json. - - - Unable to find any projects in {0}. - - - No project.json file found in '{0}'. - - - Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. - - - Unable to find project.json file at {0}. - - - Unable to find global settings file at {0}. - - - Unable to find the solution file at {0}. - - - Files backed up to {0} - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/MigrateCommandCompose.cs b/src/dotnet/commands/dotnet-migrate/MigrateCommandCompose.cs deleted file mode 100644 index 75e8612b1..000000000 --- a/src/dotnet/commands/dotnet-migrate/MigrateCommandCompose.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Linq; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.Utils; -using Parser = Microsoft.DotNet.Cli.Parser; - -namespace Microsoft.DotNet.Tools.Migrate -{ - public class MigrateCommandCompose - { - public static MigrateCommand.MigrateCommand FromArgs(string[] args, string msbuildPath = null) - { - var parser = Parser.Instance; - - var result = parser.ParseFrom("dotnet migrate", args); - - result.ShowHelpOrErrorIfAppropriate(); - - var parsedMigrateResult = result["dotnet"]["migrate"]; - var migrateCommand = new MigrateCommand.MigrateCommand( - new DotnetSlnRedirector(), - new DotnetNewRedirector(), - parsedMigrateResult.ValueOrDefault("--template-file"), - parsedMigrateResult.Arguments.FirstOrDefault(), - parsedMigrateResult.ValueOrDefault("--sdk-package-version"), - parsedMigrateResult.ValueOrDefault("--xproj-file"), - parsedMigrateResult.ValueOrDefault("--report-file"), - parsedMigrateResult.ValueOrDefault("--skip-project-references"), - parsedMigrateResult.ValueOrDefault("--format-report-file-json"), - parsedMigrateResult.ValueOrDefault("--skip-backup")); - return migrateCommand; - } - - public static int Run(string[] args) - { - // IMPORTANT: - // When updating the command line args for dotnet-migrate, we need to update the in-VS caller of dotnet migrate as well. - // It is located at dotnet/roslyn-project-system: - // src/Microsoft.VisualStudio.ProjectSystem.CSharp.VS/ProjectSystem/VS/Xproj/MigrateXprojFactory.cs - - DebugHelper.HandleDebugSwitch(ref args); - - MigrateCommand.MigrateCommand cmd; - try - { - cmd = FromArgs(args); - } - catch (CommandCreationException e) - { - return e.ExitCode; - } - - try - { - return cmd.Execute(); - } - catch (GracefulException e) - { - Reporter.Error.WriteLine(e.Message); - Reporter.Error.WriteLine(LocalizableStrings.MigrationFailedError); - return 1; - } - catch (Exception) - { - Reporter.Error.WriteLine(LocalizableStrings.MigrationFailedError); - throw; - } - } - } -} diff --git a/src/dotnet/commands/dotnet-migrate/MigrateCommandParser.cs b/src/dotnet/commands/dotnet-migrate/MigrateCommandParser.cs deleted file mode 100644 index 77377f0b4..000000000 --- a/src/dotnet/commands/dotnet-migrate/MigrateCommandParser.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Tools.Migrate; -using LocalizableStrings = Microsoft.DotNet.Tools.Migrate.LocalizableStrings; - -namespace Microsoft.DotNet.Cli -{ - internal static class MigrateCommandParser - { - public static Command Migrate() => - Create.Command( - "migrate", - ".NET Migrate Command", - Accept.ZeroOrOneArgument() - .With(name: LocalizableStrings.CmdProjectArgument, - description: LocalizableStrings.CmdProjectArgumentDescription), - CommonOptions.HelpOption(), - Create.Option("-t|--template-file", - LocalizableStrings.CmdTemplateDescription, - Accept.ExactlyOneArgument()), - Create.Option("-v|--sdk-package-version", - LocalizableStrings.CmdVersionDescription, - Accept.ExactlyOneArgument()), - Create.Option("-x|--xproj-file", - LocalizableStrings.CmdXprojFileDescription, - Accept.ExactlyOneArgument()), - Create.Option("-s|--skip-project-references", - LocalizableStrings.CmdSkipProjectReferencesDescription), - Create.Option("-r|--report-file", - LocalizableStrings.CmdReportFileDescription, - Accept.ExactlyOneArgument()), - Create.Option("--format-report-file-json", - LocalizableStrings.CmdReportOutputDescription), - Create.Option("--skip-backup", - LocalizableStrings.CmdSkipBackupDescription)); - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index 30dccd1df..000000000 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - .NET Migrate Command - Příkaz .NET pro migraci - - - - Command used to migrate project.json projects to msbuild - Příkaz se používá k migraci projektů project.json na MSBuild - - - - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - - - - The path to one of the following: - - a project.json file to migrate. - - a global.json file, it will migrate the folders specified in global.json. - - a solution.sln file, it will migrate the projects referenced in the solution. - - a directory to migrate, it will recursively search for project.json files to migrate. -Defaults to current directory if nothing is specified. - Cesta k jednomu z následujících umístění: - - k migrovanému souboru project.json - - k souboru global.json (Migrovat se budou složky zadané v souboru global.json.) - - k souboru solution.sln (Migrovat se budou projekty odkazované v řešení.) - - k migrovanému adresáři (Rekurzivně vyhledá migrované soubory project.json.) -Výchozí hodnota je aktuální adresář (pokud není zadaný jiný adresář). - - - - Base MSBuild template to use for migrated app. The default is the project included in dotnet new. - Základní šablona souboru MSBuild, která se použije pro migrovanou aplikaci. Výchozí hodnotou je projekt v příkazu dotnet new. - - - - The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. - Verze balíčku sady SDK, na kterou bude odkazovat migrovaná aplikace. Výchozí hodnotou je verze sady SDK v příkazu dotnet new. - - - - The path to the xproj file to use. Required when there is more than one xproj in a project directory. - Cesta k používanému souboru xproj. Pokud je v adresáři projektu více souborů xproj., je tento údaj povinný. - - - - Skip migrating project references. By default, project references are migrated recursively. - Vynechá migraci odkazů na projekt. Odkazy na projekt se automaticky migrují rekurzivně. - - - - Output migration report to the given file in addition to the console. - Generovat výstupní sestavu o migraci do určeného souboru (kromě konzoly). - - - - Output migration report file as json rather than user messages. - Generovat místo uživatelských zpráv soubor se sestavou o migraci ve formátu JSON. - - - - Skip moving project.json, global.json, and *.xproj to a `backup` directory after successful migration. - Přeskočit po úspěšné migraci přesun souborů project.json, global.json a *.xproj do adresáře backup. - - - - Migration failed. - Migrace se nezdařila. - - - - The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. - Migrace projektu je hotová. Přejděte prosím na https://aka.ms/coremigration, kde můžete nahlásit jakékoli problémy, nebo požádat o pomoc. - - - - Summary - Shrnutí - - - - Total Projects: {0} - Celkový počet projektů: {0} - - - - Succeeded Projects: {0} - Počet úspěšných projektů: {0} - - - - Failed Projects: {0} - Počet neúspěšných projektů: {0} - - - - Project {0} migration succeeded ({1}). - Migrace projektu {0} byla úspěšná ({1}). - - - - Project {0} migration failed ({1}). - Migrace projektu {0} byla neúspěšná ({1}). - - - - Unable to find any projects in global.json. - V souboru global.json se nenašly žádné projekty. - - - - Unable to find any projects in {0}. - V {0} se nenašly žádné projekty. - - - - No project.json file found in '{0}'. - V {0} se nenašel žádný soubor project.json. - - - - Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. - Neplatný argument projektu – {0} není souborem project.json, global.json ani solution.sln a adresář s názvem {0} neexistuje. - - - - Unable to find project.json file at {0}. - V umístění {0} se nenašel soubor project.json. - - - - Unable to find global settings file at {0}. - V umístění {0} se nenašel soubor globálního nastavení. - - - - Unable to find the solution file at {0}. - V umístění {0} se nenašel soubor řešení. - - - - Files backed up to {0} - Soubory byly zálohovány do {0}. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index b77d1bee4..000000000 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - .NET Migrate Command - .NET-Befehl "Migrate" - - - - Command used to migrate project.json projects to msbuild - Befehl zum Migrieren von project.json-Projekten zu MSBuild - - - - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - - - - The path to one of the following: - - a project.json file to migrate. - - a global.json file, it will migrate the folders specified in global.json. - - a solution.sln file, it will migrate the projects referenced in the solution. - - a directory to migrate, it will recursively search for project.json files to migrate. -Defaults to current directory if nothing is specified. - Der Pfad zu einem der folgenden Elemente: - – Datei vom Typ "project.json", die migriert werden soll - – Datei vom Typ "global.json", mit der die in "global.json" angegebenen Ordner migriert werden - – Datei vom Typ "solution.sln", mit der die in der Projektmappe referenzierten Projekte migriert werden - – Verzeichnis für die Migration, es wird rekursiv nach zu migrierenden Dateien vom Typ "project.json" gesucht -Ohne Angabe wird standardmäßig das aktuelle Verzeichnis verwendet. - - - - Base MSBuild template to use for migrated app. The default is the project included in dotnet new. - Grundlegende MSBuild-Vorlage, die für die migrierte App verwendet werden soll. Standardmäßig wird das in "dotnet new" enthaltene Projekt verwendet. - - - - The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. - Die Version des SDK-Pakets, auf das in der migrierten App verwiesen wird. Standardmäßig wird die Version des SDKs in "dotnet new" verwendet. - - - - The path to the xproj file to use. Required when there is more than one xproj in a project directory. - Der Pfad zu der zu verwendenden XPROJ-Datei. Erforderlich, wenn ein Projektverzeichnis mehrere XPROJ-Dateien enthält. - - - - Skip migrating project references. By default, project references are migrated recursively. - Migration von Projektverweisen überspringen. Projektverweise werden standardmäßig rekursiv migriert. - - - - Output migration report to the given file in addition to the console. - Migrationsbericht sowohl in der Konsole als auch in die angegebene Datei ausgeben. - - - - Output migration report file as json rather than user messages. - Migrationsberichtsdatei nicht als Benutzermeldungen, sondern als JSON ausgeben. - - - - Skip moving project.json, global.json, and *.xproj to a `backup` directory after successful migration. - "project.json", "global.json" und "*.xproj" nach erfolgreicher Migration nicht in ein Sicherungsverzeichnis verschieben. - - - - Migration failed. - Fehler beim Migrieren. - - - - The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. - Die Projektmigration ist abgeschlossen. Unter https://aka.ms/coremigration können Sie aufgetretene Probleme melden oder Hilfe erhalten. - - - - Summary - Zusammenfassung - - - - Total Projects: {0} - Projekte insgesamt: {0} - - - - Succeeded Projects: {0} - Erfolgreiche Projekte: {0} - - - - Failed Projects: {0} - Projekte mit Fehlern: {0} - - - - Project {0} migration succeeded ({1}). - Migration von Projekt {0} erfolgreich ({1}). - - - - Project {0} migration failed ({1}). - Fehler bei der Migration von Projekt {0} ({1}). - - - - Unable to find any projects in global.json. - In "global.json" wurden keine Projekte gefunden. - - - - Unable to find any projects in {0}. - In {0} wurden keine Projekte gefunden. - - - - No project.json file found in '{0}'. - In "{0}" wurde keine Datei vom Typ "project.json" gefunden. - - - - Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. - Ungültiges Projektargument – "{0}" ist keine Datei vom Typ "project.json", "global.json" oder "solution.sln", und ein Verzeichnis mit dem Namen "{0}" ist nicht vorhanden. - - - - Unable to find project.json file at {0}. - Unter {0} wurde keine Datei vom Typ "project.json" gefunden. - - - - Unable to find global settings file at {0}. - Unter {0} wurde keine globale Einstellungsdatei gefunden. - - - - Unable to find the solution file at {0}. - Unter {0} wurde keine Projektmappendatei gefunden. - - - - Files backed up to {0} - Dateien wurden in {0} gesichert - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index 8e778a2ce..000000000 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - .NET Migrate Command - Comando Migrate de .NET - - - - Command used to migrate project.json projects to msbuild - Comando usado para migrar proyectos project.json a MSBuild - - - - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - - - - The path to one of the following: - - a project.json file to migrate. - - a global.json file, it will migrate the folders specified in global.json. - - a solution.sln file, it will migrate the projects referenced in the solution. - - a directory to migrate, it will recursively search for project.json files to migrate. -Defaults to current directory if nothing is specified. - La ruta de acceso a cada uno de los siguientes elementos: - - un archivo project.json para migrarlo, - - un archivo global.json; migra las carpetas especificadas en global.json, - - un archivo solution.sln; migra los proyectos a los que se hace referencia en la solución, - - un directorio para migrar; busca archivos project.json de forma recursiva para migrarlos. -Si no se especifica ninguno, usa el directorio actual de forma predeterminada. - - - - Base MSBuild template to use for migrated app. The default is the project included in dotnet new. - Plantilla base de MSBuild para la aplicación migrada. El valor predeterminado es el proyecto incluido en dotnet new. - - - - The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. - Versión del paquete de SDK al que se hará referencia en la aplicación migrada. El valor predeterminado es la versión del SDK en dotnet new. - - - - The path to the xproj file to use. Required when there is more than one xproj in a project directory. - Ruta de acceso al archivo xproj que debe usarse. Es necesario cuando hay más de un archivo xproj en un directorio de proyecto. - - - - Skip migrating project references. By default, project references are migrated recursively. - Omite la migración de las referencias del proyecto. De forma predeterminada, las referencias del proyecto se migran recursivamente. - - - - Output migration report to the given file in addition to the console. - Emite el informe de migración en el archivo dado además de la consola. - - - - Output migration report file as json rather than user messages. - Emite el archivo de informe de la migración como json en lugar de mensajes al usuario. - - - - Skip moving project.json, global.json, and *.xproj to a `backup` directory after successful migration. - Omite el traslado de los archivos project.json, global.json y *.xproj a directorio “backup” después de una migración correcta. - - - - Migration failed. - No se pudo llevar a cabo la migración. - - - - The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. - La migración del proyecto ha finalizado. Visite https://aka.ms/coremigration para notificar los problemas que haya encontrado o solicitar ayuda. - - - - Summary - Resumen - - - - Total Projects: {0} - Proyectos totales: {0} - - - - Succeeded Projects: {0} - Proyectos correctos: {0} - - - - Failed Projects: {0} - Proyectos erróneos: {0} - - - - Project {0} migration succeeded ({1}). - La migración del proyecto {0} se realizó correctamente ({1}). - - - - Project {0} migration failed ({1}). - Error al migrar el proyecto {0} ({1}). - - - - Unable to find any projects in global.json. - No se puede encontrar ningún proyecto en global.json. - - - - Unable to find any projects in {0}. - No se puede encontrar ningún proyecto en {0}. - - - - No project.json file found in '{0}'. - No se encontró ningún archivo project.json en "{0}". - - - - Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. - Argumento de proyecto no válido: "{0}" no es un archivo project.json, global.json o solution.sln y no existe un directorio llamado "{0}". - - - - Unable to find project.json file at {0}. - No se puede encontrar el archivo project.json en {0}. - - - - Unable to find global settings file at {0}. - No se puede encontrar el archivo de configuración global en {0}. - - - - Unable to find the solution file at {0}. - No se puede encontrar el archivo de solución en {0}. - - - - Files backed up to {0} - Copia de seguridad de archivos en {0} - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index dc14acdd1..000000000 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - .NET Migrate Command - Commande de migration .NET - - - - Command used to migrate project.json projects to msbuild - Commande utilisée pour migrer les projets project.json vers msbuild - - - - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - - - - The path to one of the following: - - a project.json file to migrate. - - a global.json file, it will migrate the folders specified in global.json. - - a solution.sln file, it will migrate the projects referenced in the solution. - - a directory to migrate, it will recursively search for project.json files to migrate. -Defaults to current directory if nothing is specified. - Chemin de l'un des éléments suivants : - - fichier project.json à faire migrer ; - - fichier global.json qui effectue la migration des dossiers spécifiés dans global.json ; - - fichier solution.sln qui effectue la migration des projets référencés dans la solution ; - - répertoire à faire migrer, où est effectuée une recherche récursive des fichiers project.json à faire migrer. -La valeur par défaut correspond au répertoire actif, si rien n'est spécifié. - - - - Base MSBuild template to use for migrated app. The default is the project included in dotnet new. - Modèle MSBuild de base à utiliser pour l'application migrée. La valeur par défaut est le projet inclus dans dotnet new. - - - - The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. - Version du package du SDK à référencer dans l'application migrée. La valeur par défaut est la version du SDK dans dotnet new. - - - - The path to the xproj file to use. Required when there is more than one xproj in a project directory. - Chemin du fichier xproj à utiliser. Obligatoire s'il existe plusieurs fichiers xproj dans un répertoire de projet. - - - - Skip migrating project references. By default, project references are migrated recursively. - Ignorez la migration des références de projet. Par défaut, les références de projet font l'objet d'une migration récursive. - - - - Output migration report to the given file in addition to the console. - Envoyer le rapport de migration au fichier donné en plus de la console. - - - - Output migration report file as json rather than user messages. - Envoyer le fichier du rapport de migration au format json (et non sous la forme de messages utilisateur). - - - - Skip moving project.json, global.json, and *.xproj to a `backup` directory after successful migration. - Ignorer le déplacement de project.json, global.json et *.xproj dans un répertoire 'backup' après une migration réussie. - - - - Migration failed. - Échec de la migration. - - - - The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. - La migration du projet est finie. Accédez à https://aka.ms/coremigration pour signaler les problèmes rencontrés ou pour demander de l'aide. - - - - Summary - Récapitulatif - - - - Total Projects: {0} - Total des projets : {0} - - - - Succeeded Projects: {0} - Projets réussis : {0} - - - - Failed Projects: {0} - Projets non réussis : {0} - - - - Project {0} migration succeeded ({1}). - La migration du projet {0} a réussi ({1}). - - - - Project {0} migration failed ({1}). - Échec de la migration du projet {0} ({1}). - - - - Unable to find any projects in global.json. - Projets introuvables dans global.json. - - - - Unable to find any projects in {0}. - Projets introuvables dans {0}. - - - - No project.json file found in '{0}'. - Fichier project.json introuvable dans '{0}'. - - - - Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. - Argument de projet non valide - '{0}' n'est pas un fichier project.json, global.json ou solution.sln. De plus, il n'existe aucun répertoire nommé '{0}'. - - - - Unable to find project.json file at {0}. - Le fichier project.json est introuvable sur {0}. - - - - Unable to find global settings file at {0}. - Le fichier de paramètres globaux est introuvable sur {0}. - - - - Unable to find the solution file at {0}. - Le fichier solution est introuvable sur {0}. - - - - Files backed up to {0} - Fichiers sauvegardés sur {0} - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index cdc674e08..000000000 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - .NET Migrate Command - Comando Esegui migrazione .NET - - - - Command used to migrate project.json projects to msbuild - Comando usato per eseguire la migrazione di progetti project.json a MSBuild - - - - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - PROJECT_JSON/GLOBAL_JSON/FILE_SOLUZIONE/DIR_PROGETTO - - - - The path to one of the following: - - a project.json file to migrate. - - a global.json file, it will migrate the folders specified in global.json. - - a solution.sln file, it will migrate the projects referenced in the solution. - - a directory to migrate, it will recursively search for project.json files to migrate. -Defaults to current directory if nothing is specified. - Percorso di uno degli elementi seguenti: - - un file project.json di cui eseguire la migrazione. - - un file global.json. Verrà eseguita la migrazione delle cartelle specificate in global.json. - - file solution.sln; verrà eseguita la migrazione dei progetti cui viene fatto riferimento nella soluzione. - - una directory di cui eseguire la migrazione. Verrà eseguita la ricerca ricorsiva dei file project.json di cui eseguire la migrazione. -Se non si specifica un valore, per impostazione predefinita, verrà usata la directory corrente. - - - - Base MSBuild template to use for migrated app. The default is the project included in dotnet new. - Modello MSBuild di base da usare per l'app di cui è stata eseguita la migrazione. L'impostazione predefinita è il progetto incluso in dotnet new. - - - - The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. - Versione del pacchetto SDK a cui verrà fatto riferimento nell'app di cui è stata eseguita la migrazione. L'impostazione predefinita è la versione dell'SDK in dotnet new. - - - - The path to the xproj file to use. Required when there is more than one xproj in a project directory. - Percorso del file xproj da usare. Obbligatorio quando in una directory di progetto esistono più file xproj. - - - - Skip migrating project references. By default, project references are migrated recursively. - Non esegue la migrazione dei riferimenti al progetto. Per impostazione predefinita, la migrazione dei riferimenti al progetto è ricorsiva. - - - - Output migration report to the given file in addition to the console. - Invia il report di migrazione al file specificato oltre che alla console. - - - - Output migration report file as json rather than user messages. - Invia il file del report di migrazione come JSON anziché come messaggi utente. - - - - Skip moving project.json, global.json, and *.xproj to a `backup` directory after successful migration. - Ignora lo spostamento di project.json, global.json e *.xproj in una directory `backup` dopo una migrazione riuscita. - - - - Migration failed. - La migrazione non è riuscita. - - - - The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. - La migrazione del progetto è terminata. Visitare https://aka.ms/coremigration per segnalare eventuali problemi rilevati o richiedere assistenza. - - - - Summary - Riepilogo - - - - Total Projects: {0} - Totale progetti: {0} - - - - Succeeded Projects: {0} - Progetti riusciti: {0} - - - - Failed Projects: {0} - Progetti non riusciti: {0} - - - - Project {0} migration succeeded ({1}). - La migrazione del progetto {0} è riuscita ({1}). - - - - Project {0} migration failed ({1}). - La migrazione del progetto {0} non è riuscita ({1}). - - - - Unable to find any projects in global.json. - Non sono stati trovati progetti in global.json. - - - - Unable to find any projects in {0}. - Non sono stati trovati progetti in {0}. - - - - No project.json file found in '{0}'. - Non è stato trovato alcun file project.json in '{0}'. - - - - Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. - L'argomento del progetto non è valido. '{0}' non è un file project.json, global.json, o solution.sln e non esiste alcuna directory denominata '{0}'. - - - - Unable to find project.json file at {0}. - Non è stato trovato alcun file project.json in {0}. - - - - Unable to find global settings file at {0}. - Non è stato trovato alcun file delle impostazioni globali in {0}. - - - - Unable to find the solution file at {0}. - Non è stato trovato alcun file di soluzione in {0}. - - - - Files backed up to {0} - Backup dei file eseguito in {0} - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index b1ea0f324..000000000 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - .NET Migrate Command - .NET Migrate コマンド - - - - Command used to migrate project.json projects to msbuild - project.json プロジェクトを msbuild に移行するために使用するコマンド - - - - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - - - - The path to one of the following: - - a project.json file to migrate. - - a global.json file, it will migrate the folders specified in global.json. - - a solution.sln file, it will migrate the projects referenced in the solution. - - a directory to migrate, it will recursively search for project.json files to migrate. -Defaults to current directory if nothing is specified. - 次のいずれかへのパスです。 - - 移行する project.json ファイル。 - - global.json ファイル。global.json に指定されているフォルダーを移行します。 - - solution.sln ファイル。ソリューションで参照されているプロジェクトを移行します。 - - 移行するディレクトリ。移行する project.json ファイルを再帰的に検索します。 -何も指定しない場合、既定は現在のディレクトリです。 - - - - Base MSBuild template to use for migrated app. The default is the project included in dotnet new. - 移行されたアプリに使用する基本の MSBuild テンプレート。既定は dotnet new に含まれるプロジェクトです。 - - - - The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. - 移行されたアプリで参照される SDK パッケージのバージョン。既定は dotnet new の SDK のバージョンです。 - - - - The path to the xproj file to use. Required when there is more than one xproj in a project directory. - 使用する xproj ファイルへのパス。プロジェクト ディレクトリに複数の xproj がある場合に必要です。 - - - - Skip migrating project references. By default, project references are migrated recursively. - プロジェクト参照の移行をスキップします。既定では、プロジェクト参照は再帰的に移行されます。 - - - - Output migration report to the given file in addition to the console. - コンソールに加えて、指定されたファイルに移行レポートを出力します。 - - - - Output migration report file as json rather than user messages. - ユーザー メッセージではなく json として移行レポート ファイルを出力します。 - - - - Skip moving project.json, global.json, and *.xproj to a `backup` directory after successful migration. - 移行が成功すると、project.json、global.json、および *.xproj の `backup` ディレクトリへの移動をスキップします。 - - - - Migration failed. - 移行に失敗しました。 - - - - The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. - プロジェクトの移行が完了しました。問題が発生した場合は https://aka.ms/coremigration にアクセスしてその問題を報告するか、サポートを依頼してください。 - - - - Summary - 概要 - - - - Total Projects: {0} - 合計プロジェクト数: {0} - - - - Succeeded Projects: {0} - 成功したプロジェクトの数: {0} - - - - Failed Projects: {0} - 失敗したプロジェクトの数: {0} - - - - Project {0} migration succeeded ({1}). - プロジェクト {0} の移行に成功しました ({1})。 - - - - Project {0} migration failed ({1}). - プロジェクト {0} の移行に失敗しました ({1})。 - - - - Unable to find any projects in global.json. - global.json にプロジェクトが見つかりません。 - - - - Unable to find any projects in {0}. - {0} にプロジェクトが見つかりません。 - - - - No project.json file found in '{0}'. - '{0}' に project.json ファイルが見つかりません。 - - - - Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. - 無効なプロジェクト引数 - '{0}' は project.json、global.json、solution.sln ファイルではなく、'{0}' という名前のディレクトリは存在しません。 - - - - Unable to find project.json file at {0}. - {0} に project.json ファイルが見つかりません。 - - - - Unable to find global settings file at {0}. - {0} にグローバル設定ファイルが見つかりません。 - - - - Unable to find the solution file at {0}. - {0} にソリューション ファイルが見つかりません。 - - - - Files backed up to {0} - {0} にバックアップされるファイル - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index f053d9f34..000000000 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - .NET Migrate Command - .NET 마이그레이션 명령 - - - - Command used to migrate project.json projects to msbuild - project.json 프로젝트를 msbuild로 마이그레이션하는 데 사용하는 명령입니다. - - - - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - - - - The path to one of the following: - - a project.json file to migrate. - - a global.json file, it will migrate the folders specified in global.json. - - a solution.sln file, it will migrate the projects referenced in the solution. - - a directory to migrate, it will recursively search for project.json files to migrate. -Defaults to current directory if nothing is specified. - 다음 중 하나의 경로입니다. - - 마이그레이션할 project.json 파일 - - global.json 파일. global.json에 지정된 폴더를 마이그레이션합니다. - - solution.sln 파일. 솔루션에서 참조된 프로젝트를 마이그레이션합니다. - - 마이그레이션할 디렉터리. 마이그레이션할 project.json 파일을 재귀적으로 검색합니다. -지정하지 않는 경우 현재 디렉터리로 기본 설정됩니다. - - - - Base MSBuild template to use for migrated app. The default is the project included in dotnet new. - 마이그레이션된 앱에 사용할 기본 MSBuild 템플릿입니다. 기본값은 새 dotnet에 포함된 프로젝트입니다. - - - - The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. - 마이그레이션된 앱에서 참조되는 SDK 패키지의 버전입니다. 기본값은 새 dotnet의 SDK 버전입니다. - - - - The path to the xproj file to use. Required when there is more than one xproj in a project directory. - 사용할 xproj 파일의 경로입니다. 프로젝트 디렉터리에 두 개 이상의 xproj가 있는 경우 필요합니다. - - - - Skip migrating project references. By default, project references are migrated recursively. - 프로젝트 참조 마이그레이션을 건너뜁니다. 기본적으로 프로젝트 참조가 재귀적으로 마이그레이션됩니다. - - - - Output migration report to the given file in addition to the console. - 마이그레이션 보고서를 콘솔 외에 지정된 파일로도 출력합니다. - - - - Output migration report file as json rather than user messages. - 마이그레이션 보고서 파일을 사용자 메시지가 아니라 json으로 출력합니다. - - - - Skip moving project.json, global.json, and *.xproj to a `backup` directory after successful migration. - 마이그레이션을 완료한 후 project.json, global.json 및 *.xproj를 '백업' 디렉터리로 이동하는 작업을 건너뜁니다. - - - - Migration failed. - 마이그레이션하지 못했습니다. - - - - The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. - 프로젝트 마이그레이션이 완료되었습니다. https://aka.ms/coremigration을 방문하여 발생한 문제를 보고하거나 지원을 요청하세요. - - - - Summary - 요약 - - - - Total Projects: {0} - 총 프로젝트: {0} - - - - Succeeded Projects: {0} - 성공한 프로젝트: {0} - - - - Failed Projects: {0} - 실패한 프로젝트: {0} - - - - Project {0} migration succeeded ({1}). - 프로젝트 {0} 마이그레이션에 성공했습니다({1}). - - - - Project {0} migration failed ({1}). - 프로젝트 {0} 마이그레이션에 실패했습니다({1}). - - - - Unable to find any projects in global.json. - global.json에서 프로젝트를 찾을 수 없습니다. - - - - Unable to find any projects in {0}. - {0}에서 프로젝트를 찾을 수 없습니다. - - - - No project.json file found in '{0}'. - '{0}'에서 project.json 파일을 찾지 못했습니다. - - - - Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. - 잘못된 프로젝트 인수 - '{0}'은(는) project.json, global.json 또는 solution.sln 파일이 아니며 이름이 '{0}'인 디렉터리가 존재하지 않습니다. - - - - Unable to find project.json file at {0}. - {0}에서 project.json 파일을 찾을 수 없습니다. - - - - Unable to find global settings file at {0}. - {0}에서 전역 설정 파일을 찾을 수 없습니다. - - - - Unable to find the solution file at {0}. - {0}에서 솔루션 파일을 찾을 수 없습니다. - - - - Files backed up to {0} - 파일이 {0}에 백업되었습니다. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index fc0e5e7ba..000000000 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - .NET Migrate Command - Polecenie migrate platformy .NET - - - - Command used to migrate project.json projects to msbuild - Polecenie służące do migrowania projektów project.json do programu MSBuild - - - - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - PLIK_JSON_PROJEKTU/GLOBALNY_PLIK_JSON/PLIK_ROZWIĄZANIA/KATALOG_PROJEKTU - - - - The path to one of the following: - - a project.json file to migrate. - - a global.json file, it will migrate the folders specified in global.json. - - a solution.sln file, it will migrate the projects referenced in the solution. - - a directory to migrate, it will recursively search for project.json files to migrate. -Defaults to current directory if nothing is specified. - Ścieżka do jednego z następujących elementów: - — Plik project.json, który ma zostać zmigrowany. - — Plik global.json — zostaną zmigrowane foldery podane w tym pliku. - — Plik solution.sln — zostaną zmigrowane projekty, do których istnieją odwołania w rozwiązaniu. - — katalog, który ma zostać zmigrowany — zostaną rekursywnie wyszukane pliki project.json do zmigrowania. -W przypadku braku podanej wartości domyślnie jest to bieżący katalog. - - - - Base MSBuild template to use for migrated app. The default is the project included in dotnet new. - Podstawowy szablon programu MSBuild do użycia dla zmigrowanej aplikacji. Domyślną wartością jest projekt uwzględniony w poleceniu dotnet new. - - - - The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. - Wersja pakietu SDK, do którego odwołanie będzie się znajdować w zmigrowanej aplikacji. Domyślnie jest to wersja pakietu SDK podana w poleceniu dotnet new. - - - - The path to the xproj file to use. Required when there is more than one xproj in a project directory. - Ścieżka do pliku xproj, który ma zostać użyty. Wymagana, gdy w katalogu projektu znajduje się więcej niż jeden plik xproj. - - - - Skip migrating project references. By default, project references are migrated recursively. - Pomiń migrowanie odwołań do projektów. Domyślnie odwołania do projektów są migrowane rekursywnie. - - - - Output migration report to the given file in addition to the console. - Wyjściowy raport migracji przekazywany zarówno do danego pliku, jak i do konsoli. - - - - Output migration report file as json rather than user messages. - Wyjściowy raport migracji w postaci pliku json zamiast komunikatów dla użytkownika. - - - - Skip moving project.json, global.json, and *.xproj to a `backup` directory after successful migration. - Pomiń przenoszenie plików project.json, global.json i *.xproj do katalogu kopii zapasowych po pomyślnej migracji. - - - - Migration failed. - Migracja nie powiodła się. - - - - The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. - Zakończono migrację projektu. Aby zgłosić problemy lub poprosić o pomoc, odwiedź stronę https://aka.ms/coremigration. - - - - Summary - Podsumowanie - - - - Total Projects: {0} - Łączna liczba projektów: {0} - - - - Succeeded Projects: {0} - Projekty zakończone pomyślnie: {0} - - - - Failed Projects: {0} - Projekty zakończone niepowodzeniem: {0} - - - - Project {0} migration succeeded ({1}). - Migracja projektu {0} powiodła się ({1}). - - - - Project {0} migration failed ({1}). - Migracja projektu {0} nie powiodła się ({1}). - - - - Unable to find any projects in global.json. - Nie można odnaleźć projektów w pliku global.json. - - - - Unable to find any projects in {0}. - Nie można odnaleźć projektów w lokalizacji {0}. - - - - No project.json file found in '{0}'. - Nie odnaleziono pliku project.json w lokalizacji „{0}”. - - - - Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. - Nieprawidłowy argument projektu — element „{0}” nie jest plikiem project.json, global.json ani solution.sln oraz katalog o nazwie „{0}” nie istnieje. - - - - Unable to find project.json file at {0}. - Nie można odnaleźć pliku project.json w lokalizacji {0}. - - - - Unable to find global settings file at {0}. - Nie można odnaleźć pliku ustawień globalnych w lokalizacji {0}. - - - - Unable to find the solution file at {0}. - Nie można odnaleźć pliku rozwiązania w lokalizacji {0}. - - - - Files backed up to {0} - Wykonano kopię zapasową plików w lokalizacji {0} - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index b5325a22d..000000000 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - .NET Migrate Command - Comando Migrate do .NET - - - - Command used to migrate project.json projects to msbuild - Comando usado para migrar projetos project.json para o msbuild - - - - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - - - - The path to one of the following: - - a project.json file to migrate. - - a global.json file, it will migrate the folders specified in global.json. - - a solution.sln file, it will migrate the projects referenced in the solution. - - a directory to migrate, it will recursively search for project.json files to migrate. -Defaults to current directory if nothing is specified. - O caminho para um dos seguintes: - – um arquivo project.json a ser migrado. - – um arquivo global.json; ele migrará as pastas especificadas em global.json. - – um arquivo solution.sln; ele migrará os projetos referenciados na solução. - – um diretório a ser migrado; ele pesquisará recursivamente os arquivos project.json a serem migrados. -Usará o diretório atual como padrão se nenhuma opção for especificada. - - - - Base MSBuild template to use for migrated app. The default is the project included in dotnet new. - Modelo base do MSBuild a ser usado para o aplicativo migrado. O padrão é o projeto incluído em dotnet new. - - - - The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. - A versão do pacote SDK que será referida no aplicativo migrado. O padrão é a versão do SDK em dotnet new. - - - - The path to the xproj file to use. Required when there is more than one xproj in a project directory. - O caminho para o arquivo xproj a usar. Necessário quando houver mais de um xproj em um diretório de projeto. - - - - Skip migrating project references. By default, project references are migrated recursively. - Ignorar a migração de referências do projeto. Por padrão, as referências do projeto são migradas recursivamente. - - - - Output migration report to the given file in addition to the console. - Gerar o relatório de migração para o arquivo especificado além de para o console. - - - - Output migration report file as json rather than user messages. - Gerar o arquivo de relatório de migração como json em vez de como mensagens de usuário. - - - - Skip moving project.json, global.json, and *.xproj to a `backup` directory after successful migration. - Ignorar a migração de project.json, global.json e *.xproj para um diretório de ‘backup’ após uma migração bem-sucedida. - - - - Migration failed. - Falha na migração. - - - - The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. - A migração do projeto foi concluída. Acesse https://aka.ms/coremigration para relatar qualquer problema encontrado ou pedir ajuda. - - - - Summary - Resumo - - - - Total Projects: {0} - Total de Projetos: {0} - - - - Succeeded Projects: {0} - Projetos Bem-sucedidos: {0} - - - - Failed Projects: {0} - Projetos que Falharam: {0} - - - - Project {0} migration succeeded ({1}). - Migração do projeto {0} bem-sucedida ({1}). - - - - Project {0} migration failed ({1}). - A migração do projeto {0} falhou ({1}). - - - - Unable to find any projects in global.json. - Não é possível localizar nenhum projeto em global.json. - - - - Unable to find any projects in {0}. - Não é possível localizar nenhum projeto em {0}. - - - - No project.json file found in '{0}'. - Nenhum arquivo project.json encontrado em '{0}'. - - - - Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. - Argumento inválido de projeto – '{0}' não é um arquivo project.json, global.json nem solution.sln e um diretório chamado '{0}' não existe. - - - - Unable to find project.json file at {0}. - Não é possível localizar o arquivo project.json em {0}. - - - - Unable to find global settings file at {0}. - Não é possível localizar o arquivo de configurações globais em {0}. - - - - Unable to find the solution file at {0}. - Não é possível localizar o arquivo da solução em {0}. - - - - Files backed up to {0} - Backup de arquivos realizado em {0} - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index 450609a3b..000000000 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - .NET Migrate Command - Команда .NET "Миграция" - - - - Command used to migrate project.json projects to msbuild - Команда, используемая для миграции проектов project.json в msbuild - - - - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - - - - The path to one of the following: - - a project.json file to migrate. - - a global.json file, it will migrate the folders specified in global.json. - - a solution.sln file, it will migrate the projects referenced in the solution. - - a directory to migrate, it will recursively search for project.json files to migrate. -Defaults to current directory if nothing is specified. - Путь к: - — переносимому файлу project.json; - — файлу global.json, выполняется миграция папок, указанных в файле global.json; - — файлу solution.sln, выполняется миграция проектов, на которые ссылается решение; - — переносимому каталогу, выполняется рекурсивный поиск файлов project.json для миграции. -По умолчанию применяется текущий каталог, если не указана другая папка. - - - - Base MSBuild template to use for migrated app. The default is the project included in dotnet new. - Основной шаблон MSBuild, используемый для переносимого приложения. По умолчанию применяется проект, указанный в команде dotnet new. - - - - The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. - Версия пакета SDK, на который будет ссылаться переносимое приложение. По умолчанию применяется версия пакета SDK в команде dotnet new. - - - - The path to the xproj file to use. Required when there is more than one xproj in a project directory. - Путь к используемому XPROJ-файлу. Требуется при наличии нескольких XPROJ-файлов в каталоге проекта. - - - - Skip migrating project references. By default, project references are migrated recursively. - Пропустить перенос ссылок на проект. По умолчанию ссылки на проект переносятся рекурсивно. - - - - Output migration report to the given file in addition to the console. - Вывод отчета о миграции в консоли и в заданный файл. - - - - Output migration report file as json rather than user messages. - Вывод файла отчета о миграции в формате JSON, а не в виде сообщений для пользователя. - - - - Skip moving project.json, global.json, and *.xproj to a `backup` directory after successful migration. - Пропустить перенос файлов project.json, global.json и *.xproj в "резервный" каталог после успешной миграции. - - - - Migration failed. - Сбой миграции. - - - - The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. - Перенос проекта завершился. Посетите сайт https://aka.ms/coremigration, чтобы сообщить об обнаруженных проблемах или обратиться за помощью. - - - - Summary - Сводка - - - - Total Projects: {0} - Всего проектов: {0} - - - - Succeeded Projects: {0} - Успешно выполненных проектов: {0} - - - - Failed Projects: {0} - Невыполненных проектов: {0} - - - - Project {0} migration succeeded ({1}). - Перенос проекта {0} завершился успешно ({1}). - - - - Project {0} migration failed ({1}). - Не удалось перенести проект {0} ({1}). - - - - Unable to find any projects in global.json. - Не удалось найти проекты в global.json. - - - - Unable to find any projects in {0}. - Не удалось найти проекты в {0}. - - - - No project.json file found in '{0}'. - Файл project.json не найден в "{0}". - - - - Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. - Недопустимый аргумент проекта: "{0}" не является файлом project.json, global.json или solution.sln, а каталог с именем "{0}" не существует. - - - - Unable to find project.json file at {0}. - Не удалось найти файл project.json в {0}. - - - - Unable to find global settings file at {0}. - Не удалось найти файл глобальных параметров в {0}. - - - - Unable to find the solution file at {0}. - Не удалось найти файл решения в {0}. - - - - Files backed up to {0} - Резервные копии файлов созданы в {0} - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index 51f4cb51d..000000000 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - .NET Migrate Command - .NET Migrate Komutu - - - - Command used to migrate project.json projects to msbuild - project.json projelerini msbuild’e geçirmek için kullanılan komut - - - - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - - - - The path to one of the following: - - a project.json file to migrate. - - a global.json file, it will migrate the folders specified in global.json. - - a solution.sln file, it will migrate the projects referenced in the solution. - - a directory to migrate, it will recursively search for project.json files to migrate. -Defaults to current directory if nothing is specified. - Aşağıdakilerden birinin yolu: - - geçirilecek project.json dosyası. - - bir global.json dosyası; global.json içinde belirtilen klasörleri geçirir. - -bir solution.sln dosyası; çözümde başvurulan projeleri geçirir. - - geçirilecek dizin; geçirilecek project.json dosyalarını yinelemeli olarak arar. -Bir seçenek belirtilmezse, geçerli dizin varsayılan olarak kullanılır. - - - - Base MSBuild template to use for migrated app. The default is the project included in dotnet new. - Geçirilen uygulama için kullanılacak temel MSBuild şablonu. Yeni dotnet’e eklenen proje, varsayılan değerdir. - - - - The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. - Geçirilen uygulamada başvurulacak SDK paketinin sürümü. Yeni dotnet’teki SDK sürümü, varsayılan değerdir. - - - - The path to the xproj file to use. Required when there is more than one xproj in a project directory. - Kullanılacak xproj dosyasının yolu. Proje dizininde birden fazla xproj olduğunda gereklidir. - - - - Skip migrating project references. By default, project references are migrated recursively. - Proje başvurularını geçirmeyi atlayın. Varsayılan olarak, proje başvuruları yinelemeli olarak geçirilir. - - - - Output migration report to the given file in addition to the console. - Geçiş raporunu, konsola ek olarak belirtilen dosyaya çıkarın. - - - - Output migration report file as json rather than user messages. - Geçiş raporu dosyasını, kullanıcı iletileri yerine json olarak çıkarın. - - - - Skip moving project.json, global.json, and *.xproj to a `backup` directory after successful migration. - Geçiş başarılı olduktan sonra project.json, global.json ve *.xproj dosyalarını `yedek` bir dizine taşımayı atlayın. - - - - Migration failed. - Geçiş başarısız oldu. - - - - The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. - Proje geçirme işlemi tamamlandı. Karşılaştığınız sorunları bildirmek veya yardım istemek için lütfen https://aka.ms/coremigration sayfasını ziyaret edin. - - - - Summary - Özet - - - - Total Projects: {0} - Toplam Proje Sayısı: {0} - - - - Succeeded Projects: {0} - Başarılı Proje Sayısı: {0} - - - - Failed Projects: {0} - Başarısız Proje Sayısı: {0} - - - - Project {0} migration succeeded ({1}). - {0} projesi başarıyla geçirildi ({1}). - - - - Project {0} migration failed ({1}). - {0} projesi geçirilemedi ({1}). - - - - Unable to find any projects in global.json. - Global.json dosyasında proje bulunamıyor. - - - - Unable to find any projects in {0}. - {0} içinde proje bulunamıyor. - - - - No project.json file found in '{0}'. - '{0}' içinde project.json dosyası bulunamadı. - - - - Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. - Proje bağımsız değişkeni geçersiz - '{0}' bir project.json, global.json veya solution.sln dosyası değil ve '{0}' adlı bir dizin yok. - - - - Unable to find project.json file at {0}. - {0} konumunda project.json dosyası bulunamıyor. - - - - Unable to find global settings file at {0}. - {0} konumunda genel ayarlar dosyası bulunamıyor. - - - - Unable to find the solution file at {0}. - {0} konumunda çözüm dosyası bulunamıyor. - - - - Files backed up to {0} - Dosyalar {0} konumuna yedeklendi - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.xlf deleted file mode 100644 index d7a8520ea..000000000 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - .NET Migrate Command - - - - Command used to migrate project.json projects to msbuild - - - - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - - - - The path to one of the following: - - a project.json file to migrate. - - a global.json file, it will migrate the folders specified in global.json. - - a solution.sln file, it will migrate the projects referenced in the solution. - - a directory to migrate, it will recursively search for project.json files to migrate. -Defaults to current directory if nothing is specified. - - - - Base MSBuild template to use for migrated app. The default is the project included in dotnet new. - - - - The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. - - - - The path to the xproj file to use. Required when there is more than one xproj in a project directory. - - - - Skip migrating project references. By default, project references are migrated recursively. - - - - Output migration report to the given file in addition to the console. - - - - Output migration report file as json rather than user messages. - - - - Skip moving project.json, global.json, and *.xproj to a `backup` directory after successful migration. - - - - Migration failed. - - - - The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. - - - - Summary - - - - Total Projects: {0} - - - - Succeeded Projects: {0} - - - - Failed Projects: {0} - - - - Project {0} migration succeeded ({1}). - - - - Project {0} migration failed ({1}). - - - - Unable to find any projects in global.json. - - - - Unable to find any projects in {0}. - - - - No project.json file found in '{0}'. - - - - Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. - - - - Unable to find project.json file at {0}. - - - - Unable to find global settings file at {0}. - - - - Unable to find the solution file at {0}. - - - - Files backed up to {0} - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index 6a3e3deef..000000000 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - .NET Migrate Command - .NET 迁移命令 - - - - Command used to migrate project.json projects to msbuild - 用于将 project.json 项目迁移到 MSBuild 的命令 - - - - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - - - - The path to one of the following: - - a project.json file to migrate. - - a global.json file, it will migrate the folders specified in global.json. - - a solution.sln file, it will migrate the projects referenced in the solution. - - a directory to migrate, it will recursively search for project.json files to migrate. -Defaults to current directory if nothing is specified. - 以下文件之一的路径: - - 要迁移的 project.json 文件的路径。 - - global.json 文件的路径,它将迁移 global.json 中指定的文件夹。 - - solution.sln 文件的路径,它将迁移解决方案中引用的项目。 - - 要迁移的目录的路径,它将递归搜索要迁移的 project.json 文件。 -如果未指定,则默认使用当前目录。 - - - - Base MSBuild template to use for migrated app. The default is the project included in dotnet new. - 针对迁移的应用使用的基本 MSBuild 模板。默认值为 dotnet new 中包含的项目。 - - - - The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. - 要在迁移的应用中引用的 SDK 包版本。默认值为 dotnet new 中的 SDK 版本。 - - - - The path to the xproj file to use. Required when there is more than one xproj in a project directory. - 要使用的 xproj 文件的路径。项目目录中有多个 xproj 时需要此项。 - - - - Skip migrating project references. By default, project references are migrated recursively. - 跳过迁移项目引用。默认情况下,项目引用按递归方式进行迁移。 - - - - Output migration report to the given file in addition to the console. - 除控制台外,还将为给定文件输出迁移报告。 - - - - Output migration report file as json rather than user messages. - 将迁移报告文件输出为 json 而非用户信息。 - - - - Skip moving project.json, global.json, and *.xproj to a `backup` directory after successful migration. - 迁移成功后,跳过将 project.json、global.json 和 *.xproj 移至“备份”目录。 - - - - Migration failed. - 迁移失败。 - - - - The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. - 已完成项目迁移。请访问 https://aka.ms/coremigration,以报告所遇到的任何问题或寻求帮助。 - - - - Summary - 摘要 - - - - Total Projects: {0} - 总项目数: {0} - - - - Succeeded Projects: {0} - 成功项目数: {0} - - - - Failed Projects: {0} - 失败项目数: {0} - - - - Project {0} migration succeeded ({1}). - 项目 {0} 迁移成功({1})。 - - - - Project {0} migration failed ({1}). - 项目 {0} 迁移失败({1})。 - - - - Unable to find any projects in global.json. - 无法在 global.json 中找到任何项目。 - - - - Unable to find any projects in {0}. - 无法在 {0} 中找到任何项目。 - - - - No project.json file found in '{0}'. - 未在“{0}”中找到任何 project.json 文件。 - - - - Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. - 项目参数无效 -“{0}”不是 project.json、global.json 或 solution.sln 文件,且不存在名为“{0}”的目录。 - - - - Unable to find project.json file at {0}. - 无法在 {0} 处找到 project.json 文件。 - - - - Unable to find global settings file at {0}. - 无法在 {0} 处找到全局设置文件。 - - - - Unable to find the solution file at {0}. - 无法在 {0} 处找到解决方案文件。 - - - - Files backed up to {0} - 已备份至 {0} 的文件 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index b5cfa7a90..000000000 --- a/src/dotnet/commands/dotnet-migrate/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - .NET Migrate Command - .NET 移轉命令 - - - - Command used to migrate project.json projects to msbuild - 用來將 project.json 專案移轉到 MSBuild 的命令 - - - - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - PROJECT_JSON/GLOBAL_JSON/SOLUTION_FILE/PROJECT_DIR - - - - The path to one of the following: - - a project.json file to migrate. - - a global.json file, it will migrate the folders specified in global.json. - - a solution.sln file, it will migrate the projects referenced in the solution. - - a directory to migrate, it will recursively search for project.json files to migrate. -Defaults to current directory if nothing is specified. - 下列其中一項的路徑: - - - 要移轉的 project.json 檔案。 - - - global.json 檔案,將會移轉 global.json 中指定的資料夾。 - - solution.sln 檔案,將會移轉解決方案中參考的專案。 - - - 要移轉的目錄,將會遞迴搜尋要移轉的 project.json 檔案。 -如果未指定任何項目,預設為目前的目錄。 - - - - Base MSBuild template to use for migrated app. The default is the project included in dotnet new. - 要用於受移轉應用程式的基底 MSBuild 範本。預設為 dotnet new 中所包含的專案。 - - - - The version of the SDK package that will be referenced in the migrated app. The default is the version of the SDK in dotnet new. - 已移轉的應用程式中將會參考的 SDK 套件版本。預設為 dotnet new 中的 SDK 版本。 - - - - The path to the xproj file to use. Required when there is more than one xproj in a project directory. - 要使用之 xproj 檔案的路徑。當專案目錄中有多個 xproj 時為必要項。 - - - - Skip migrating project references. By default, project references are migrated recursively. - 跳過移轉專案參考。根據預設,會遞迴移轉專案參考。 - - - - Output migration report to the given file in addition to the console. - 將移轉報告輸出到指定的檔案及主控台。 - - - - Output migration report file as json rather than user messages. - 將移轉報告檔案輸出為 JSON 而不是使用者訊息。 - - - - Skip moving project.json, global.json, and *.xproj to a `backup` directory after successful migration. - 在成功移轉後,跳過將 project.json、global.json 和 *.xproj 移至 `backup` 目錄的作業。 - - - - Migration failed. - 移轉失敗。 - - - - The project migration has finished. Please visit https://aka.ms/coremigration to report any issues you've encountered or ask for help. - 已完成專案移轉。若要回報遇到的任何問題或尋求協助,請前往 https://aka.ms/coremigration。 - - - - Summary - 摘要 - - - - Total Projects: {0} - 專案總數: {0} - - - - Succeeded Projects: {0} - 成功專案數: {0} - - - - Failed Projects: {0} - 失敗專案數: {0} - - - - Project {0} migration succeeded ({1}). - 專案 {0} 移轉成功 ({1})。 - - - - Project {0} migration failed ({1}). - 專案 {0} 移轉失敗 ({1})。 - - - - Unable to find any projects in global.json. - 在 global.json 中找不到任何專案。 - - - - Unable to find any projects in {0}. - 在 {0} 中找不到任何專案。 - - - - No project.json file found in '{0}'. - 在 '{0}' 中找不到任何 project.json 檔案。 - - - - Invalid project argument - '{0}' is not a project.json, global.json, or solution.sln file and a directory named '{0}' doesn't exist. - 專案引數無效 - '{0}' 並非 project.json、global.json 或 solution.sln 檔案,且名為 '{0}' 的目錄不存在。 - - - - Unable to find project.json file at {0}. - 在 {0} 上找不到 project.json 檔案。 - - - - Unable to find global settings file at {0}. - 在 {0} 上找不到全域設定檔。 - - - - Unable to find the solution file at {0}. - 在 {0} 上找不到解決方案檔。 - - - - Files backed up to {0} - 檔案已備份到 {0} - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-msbuild/LocalizableStrings.resx b/src/dotnet/commands/dotnet-msbuild/LocalizableStrings.resx deleted file mode 100644 index e1c8a7c9f..000000000 --- a/src/dotnet/commands/dotnet-msbuild/LocalizableStrings.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs b/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs deleted file mode 100644 index 4140990d9..000000000 --- a/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Runtime.InteropServices; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.CommandLine; -using System.Diagnostics; -using Microsoft.DotNet.Cli.Telemetry; -using Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.Tools.MSBuild -{ - public class MSBuildForwardingApp - { - internal const string TelemetrySessionIdEnvironmentVariableName = "DOTNET_CLI_TELEMETRY_SESSIONID"; - - private MSBuildForwardingAppWithoutLogging _forwardingAppWithoutLogging; - - private static IEnumerable ConcatTelemetryLogger(IEnumerable argsToForward) - { - if (Telemetry.CurrentSessionId != null) - { - try - { - Type loggerType = typeof(MSBuildLogger); - - return argsToForward - .Concat(new[] - { - $"/Logger:{loggerType.FullName},{loggerType.GetTypeInfo().Assembly.Location}" - }); - } - catch (Exception) - { - // Exceptions during telemetry shouldn't cause anything else to fail - } - } - return argsToForward; - } - - public MSBuildForwardingApp(IEnumerable argsToForward, string msbuildPath = null) - { - _forwardingAppWithoutLogging = new MSBuildForwardingAppWithoutLogging( - ConcatTelemetryLogger(argsToForward), - msbuildPath); - } - - public ProcessStartInfo GetProcessStartInfo() - { - var ret = _forwardingAppWithoutLogging.GetProcessStartInfo(); - - ret.Environment[TelemetrySessionIdEnvironmentVariableName] = Telemetry.CurrentSessionId; - - return ret; - } - - public virtual int Execute() - { - return GetProcessStartInfo().Execute(); - } - } -} diff --git a/src/dotnet/commands/dotnet-msbuild/MSBuildLogger.cs b/src/dotnet/commands/dotnet-msbuild/MSBuildLogger.cs deleted file mode 100644 index ef9d7d93e..000000000 --- a/src/dotnet/commands/dotnet-msbuild/MSBuildLogger.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.Telemetry; -using Microsoft.DotNet.Configurer; - -namespace Microsoft.DotNet.Tools.MSBuild -{ - public sealed class MSBuildLogger : Logger - { - private readonly IFirstTimeUseNoticeSentinel _sentinel = - new FirstTimeUseNoticeSentinel(new CliFallbackFolderPathCalculator()); - private readonly ITelemetry _telemetry; - - public MSBuildLogger() - { - try - { - string sessionId = - Environment.GetEnvironmentVariable(MSBuildForwardingApp.TelemetrySessionIdEnvironmentVariableName); - - if (sessionId != null) - { - _telemetry = new Telemetry(_sentinel, sessionId); - } - } - catch (Exception) - { - // Exceptions during telemetry shouldn't cause anything else to fail - } - } - - public override void Initialize(IEventSource eventSource) - { - try - { - if (_telemetry != null && _telemetry.Enabled) - { - if (eventSource is IEventSource2 eventSource2) - { - eventSource2.TelemetryLogged += OnTelemetryLogged; - } - } - } - catch (Exception) - { - // Exceptions during telemetry shouldn't cause anything else to fail - } - } - - private void OnTelemetryLogged(object sender, TelemetryEventArgs args) - { - _telemetry.TrackEvent(args.EventName, args.Properties, measurements: null); - } - - public override void Shutdown() - { - try - { - _sentinel?.Dispose(); - } - catch (Exception) - { - // Exceptions during telemetry shouldn't cause anything else to fail - } - - base.Shutdown(); - } - } -} diff --git a/src/dotnet/commands/dotnet-msbuild/Program.cs b/src/dotnet/commands/dotnet-msbuild/Program.cs deleted file mode 100644 index 014769ff3..000000000 --- a/src/dotnet/commands/dotnet-msbuild/Program.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.DotNet.Tools.MSBuild -{ - public class MSBuildCommand - { - public static int Run(string[] args) - { - return new MSBuildForwardingApp(args).Execute(); - } - } -} diff --git a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index 04a9b1084..000000000 --- a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] - Nastavte úroveň podrobností příkazu. Povolené hodnoty jsou q [tichý], m [minimální], n [normální], d [podrobný] a diag [diagnostický]. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index e3f19dc76..000000000 --- a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] - Legen Sie den Ausführlichkeitsgrad des Befehls fest. Zulässige Werte sind "q[uiet]" (keine Ausgabe), "m[inimal]", "n[ormal]", "d[etailed]" (ausführlich) und "diag[nostic]" (Diagnose). - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index d9119e8d1..000000000 --- a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] - Establece el nivel de detalle del comando. Los valores permitidos son q[uiet], m[inimal], n[ormal], d[etailed] y diag[nostic] - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index b6dfe9a90..000000000 --- a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] - Définissez le niveau de détail de la commande. Les valeurs autorisées sont q[uiet], m[inimal], n[ormal], d[etailed] et diag[nostic] - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index 2ab91126a..000000000 --- a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] - Imposta il livello di dettaglio del comando. I valori consentiti sono: q[uiet], m[inimal], n[ormal], d[etailed], e diag[nostic] - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index c66bf81b6..000000000 --- a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] - コマンドの詳細レベルを設定します。使用可能な値: q[uiet]、m[inimal]、n[ormal]、d[etailed]、diag[nostic] - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index 6f2e5c8a5..000000000 --- a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] - 명령의 세부 정보 표시 수준을 설정합니다. 허용되는 값은 q[uiet], m[inimal], n[ormal], d[etailed] 및 diag[nostic]입니다. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index 6f2339b4f..000000000 --- a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] - Ustaw poziom szczegółowości polecenia. Dopuszczalne wartości to: q[uiet], m[inimal], n[ormal], d[etailed] i diag[nostic] - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index 201405e7e..000000000 --- a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] - Defina o nível de detalhes do comando. Os valores disponíveis são: q[uiet], m[inimal], n[ormal], d[etailed] e diag[nostic]. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index 5e2cce35e..000000000 --- a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] - Установка уровня детализации для команды. Допустимые значения: q[uiet], m[inimal], n[ormal], d[etailed] и diag[nostic] - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index 33f8cce31..000000000 --- a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] - Komutun ayrıntı düzeyini ayarlayın. İzin verilen değerler q[uiet], m[inimal], n[ormal], d[etailed] ve diag[nostic] - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.xlf deleted file mode 100644 index 1fc54de66..000000000 --- a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index 5b31d1c40..000000000 --- a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] - 设置命令的详细级别。允许值为 q[uiet]、m[inimal]、n[ormal]、d[etailed] 和 diag[nostic] - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index f454ac6b2..000000000 --- a/src/dotnet/commands/dotnet-msbuild/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - Set the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] - 設定命令的詳細資訊層級。允許的值為 q[uiet]、m[inimal]、n[ormal]、d[etailed] 及diag[nostic] - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-new/NewCommandParser.cs b/src/dotnet/commands/dotnet-new/NewCommandParser.cs deleted file mode 100644 index 88d81208a..000000000 --- a/src/dotnet/commands/dotnet-new/NewCommandParser.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Cli.CommandLine; - -namespace Microsoft.DotNet.Cli -{ - internal static class NewCommandParser - { - public static Command New() => - Create.Command("new", - "Initialize .NET projects.", - Accept - .ExactlyOneArgument() - .WithSuggestionsFrom( - "console", - "classlib", - "mstest", - "xunit", - "web", - "mvc", - "webapi", - "sln"), - Create.Option("-l|--list", - "List templates containing the specified name."), - Create.Option("-lang|--language", - "Specifies the language of the template to create", - Accept.WithSuggestionsFrom("C#", "F#") - .With(defaultValue: () => "C#")), - Create.Option("-n|--name", - "The name for the output being created. If no name is specified, the name of the current directory is used."), - Create.Option("-o|--output", - "Location to place the generated output."), - Create.Option("-h|--help", - "Displays help for this command."), - Create.Option("-all|--show-all", - "Shows all templates")); - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-new/NewCommandShim.cs b/src/dotnet/commands/dotnet-new/NewCommandShim.cs deleted file mode 100644 index cf30e3ca4..000000000 --- a/src/dotnet/commands/dotnet-new/NewCommandShim.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) .NET 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.Globalization; -using System.IO; -using System.Linq; -using System.Reflection; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.Telemetry; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Configurer; -using Microsoft.DotNet.Tools.MSBuild; -using Microsoft.TemplateEngine.Abstractions; -using Microsoft.TemplateEngine.Cli; -using Microsoft.TemplateEngine.Edge; -using Microsoft.TemplateEngine.Orchestrator.RunnableProjects; -using Microsoft.TemplateEngine.Orchestrator.RunnableProjects.Config; -using Microsoft.TemplateEngine.Orchestrator.RunnableProjects.Macros; -using Microsoft.TemplateEngine.Utils; - -namespace Microsoft.DotNet.Tools.New -{ - internal class NewCommandShim - { - private const string HostIdentifier = "dotnetcli"; - private const string CommandName = "new"; - - public static int Run(string[] args) - { - var sessionId = - Environment.GetEnvironmentVariable(MSBuildForwardingApp.TelemetrySessionIdEnvironmentVariableName); - var telemetry = - new Telemetry(new FirstTimeUseNoticeSentinel(new CliFallbackFolderPathCalculator()), sessionId); - var logger = new TelemetryLogger(null); - - if (telemetry.Enabled) - { - logger = new TelemetryLogger((name, props, measures) => - { - if (telemetry.Enabled) - { - telemetry.TrackEvent(name, props, measures); - } - }); - } - - return New3Command.Run(CommandName, CreateHost(), logger, FirstRun, args); - } - - private static ITemplateEngineHost CreateHost() - { - var builtIns = new AssemblyComponentCatalog(new[] - { - typeof(RunnableProjectGenerator).GetTypeInfo().Assembly, - typeof(ConditionalConfig).GetTypeInfo().Assembly, - }); - - var preferences = new Dictionary - { - { "prefs:language", "C#" }, - { "dotnet-cli-version", Product.Version }, - { "RuntimeFrameworkVersion", new Muxer().SharedFxVersion }, - { "NetStandardImplicitPackageVersion", new FrameworkDependencyFile().GetNetStandardLibraryVersion() }, - }; - - return new DefaultTemplateEngineHost(HostIdentifier, "v" + Product.Version, CultureInfo.CurrentCulture.Name, preferences, builtIns); - } - - private static void FirstRun(IEngineEnvironmentSettings environmentSettings, IInstaller installer) - { - Paths paths = new Paths(environmentSettings); - var templatesDir = Path.Combine(paths.Global.BaseDir, "Templates"); - - if (paths.Exists(templatesDir)) - { - var layoutIncludedPackages = environmentSettings.Host.FileSystem.EnumerateFiles(templatesDir, "*.nupkg", SearchOption.TopDirectoryOnly); - installer.InstallPackages(layoutIncludedPackages); - } - } - } -} diff --git a/src/dotnet/commands/dotnet-nuget/NuGetCommandParser.cs b/src/dotnet/commands/dotnet-nuget/NuGetCommandParser.cs deleted file mode 100644 index fd80e5589..000000000 --- a/src/dotnet/commands/dotnet-nuget/NuGetCommandParser.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Cli.CommandLine; - -namespace Microsoft.DotNet.Cli -{ - internal static class NuGetCommandParser - { - public static Command NuGet() => - Create.Command("nuget", - "NuGet Command Line 4.0.0.0", - CommonOptions.HelpOption(), - Create.Option("--version", - "Show version information"), - Create.Option("-v|--verbosity", - "The verbosity of logging to use. Allowed values: Debug, Verbose, Information, Minimal, Warning, Error.", - Accept.ExactlyOneArgument() - .With(name: "verbosity")), - Create.Command("delete", - "Deletes a package from the server.", - Accept.ExactlyOneArgument() - .With(name: "root", - description: "The Package Id and version."), - CommonOptions.HelpOption(), - Create.Option("--force-english-output", - "Forces the application to run using an invariant, English-based culture."), - Create.Option("-s|--source", - "Specifies the server URL", - Accept.ExactlyOneArgument() - .With(name: "source")), - Create.Option("--non-interactive", - "Do not prompt for user input or confirmations."), - Create.Option("-k|--api-key", - "The API key for the server.", - Accept.ExactlyOneArgument() - .With(name: "apiKey"))), - Create.Command("locals", - "Clears or lists local NuGet resources such as http requests cache, packages cache or machine-wide global packages folder.", - Accept.AnyOneOf(@"all", - @"http-cache", - @"global-packages", - @"temp") - .With(description: "Cache Location(s) Specifies the cache location(s) to list or clear."), - CommonOptions.HelpOption(), - Create.Option("--force-english-output", - "Forces the application to run using an invariant, English-based culture."), - Create.Option("-c|--clear", "Clear the selected local resources or cache location(s)."), - Create.Option("-l|--list", "List the selected local resources or cache location(s).")), - Create.Command("push", - "Pushes a package to the server and publishes it.", - CommonOptions.HelpOption(), - Create.Option("--force-english-output", - "Forces the application to run using an invariant, English-based culture."), - Create.Option("-s|--source", - "Specifies the server URL", - Accept.ExactlyOneArgument() - .With(name: "source")), - Create.Option("-ss|--symbol-source", - "Specifies the symbol server URL. If not specified, nuget.smbsrc.net is used when pushing to nuget.org.", - Accept.ExactlyOneArgument() - .With(name: "source")), - Create.Option("-t|--timeout", - "Specifies the timeout for pushing to a server in seconds. Defaults to 300 seconds (5 minutes).", - Accept.ExactlyOneArgument() - .With(name: "timeout")), - Create.Option("-k|--api-key", "The API key for the server.", - Accept.ExactlyOneArgument() - .With(name: "apiKey")), - Create.Option("-sk|--symbol-api-key", "The API key for the symbol server.", - Accept.ExactlyOneArgument() - .With(name: "apiKey")), - Create.Option("-d|--disable-buffering", - "Disable buffering when pushing to an HTTP(S) server to decrease memory usage."), - Create.Option("-n|--no-symbols", - "If a symbols package exists, it will not be pushed to a symbols server."))); - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-nuget/Program.cs b/src/dotnet/commands/dotnet-nuget/Program.cs deleted file mode 100644 index 8e6378b41..000000000 --- a/src/dotnet/commands/dotnet-nuget/Program.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Linq; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.InternalAbstractions; -using Microsoft.DotNet.Tools; - -namespace Microsoft.DotNet.Tools.NuGet -{ - public class NuGetCommand - { - public static int Run(string[] args) - { - return Run(args, new NuGetCommandRunner()); - } - - public static int Run(string[] args, ICommandRunner nugetCommandRunner) - { - DebugHelper.HandleDebugSwitch(ref args); - - if (nugetCommandRunner == null) - { - throw new ArgumentNullException(nameof(nugetCommandRunner)); - } - - return nugetCommandRunner.Run(args); - } - - private class NuGetCommandRunner : ICommandRunner - { - public int Run(string[] args) - { - var nugetApp = new NuGetForwardingApp(args); - - return nugetApp.Execute(); - } - } - } -} diff --git a/src/dotnet/commands/dotnet-pack/LocalizableStrings.resx b/src/dotnet/commands/dotnet-pack/LocalizableStrings.resx deleted file mode 100644 index d297d15e2..000000000 --- a/src/dotnet/commands/dotnet-pack/LocalizableStrings.resx +++ /dev/null @@ -1,150 +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 - - - .NET Core NuGet Package Packer - - - pack for msbuild - - - OUTPUT_DIR - - - Directory in which to place built packages. - - - Skip building the project prior to packing. By default, the project will be built. - - - Include packages with symbols in addition to regular packages in output directory. - - - Include PDBs and source files. Source files go into the src folder in the resulting nuget package - - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. - - - PROJECT - - - The project to pack, defaults to the project file in the current directory. Can be a path to any project file - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-pack/PackCommand.cs b/src/dotnet/commands/dotnet-pack/PackCommand.cs deleted file mode 100644 index a781fe254..000000000 --- a/src/dotnet/commands/dotnet-pack/PackCommand.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Tools.MSBuild; -using Microsoft.DotNet.Tools; -using Microsoft.DotNet.Cli; -using System.Diagnostics; -using Parser = Microsoft.DotNet.Cli.Parser; - -namespace Microsoft.DotNet.Tools.Pack -{ - public class PackCommand : RestoringCommand - { - public PackCommand( - IEnumerable msbuildArgs, - IEnumerable userDefinedArguments, - IEnumerable trailingArguments, - bool noRestore, - string msbuildPath = null) - : base(msbuildArgs, userDefinedArguments, trailingArguments, noRestore, msbuildPath) - { - } - - public static PackCommand FromArgs(string[] args, string msbuildPath = null) - { - var parser = Parser.Instance; - - var result = parser.ParseFrom("dotnet pack", args); - - result.ShowHelpOrErrorIfAppropriate(); - - var parsedPack = result["dotnet"]["pack"]; - - var msbuildArgs = new List() - { - "/t:pack" - }; - - msbuildArgs.AddRange(parsedPack.OptionValuesToBeForwarded()); - - msbuildArgs.AddRange(parsedPack.Arguments); - - bool noRestore = parsedPack.HasOption("--no-restore"); - - return new PackCommand( - msbuildArgs, - parsedPack.OptionValuesToBeForwarded(), - parsedPack.Arguments, - noRestore, - msbuildPath); - } - - public static int Run(string[] args) - { - DebugHelper.HandleDebugSwitch(ref args); - - PackCommand cmd; - try - { - cmd = FromArgs(args); - } - catch (CommandCreationException e) - { - return e.ExitCode; - } - - return cmd.Execute(); - } - } -} diff --git a/src/dotnet/commands/dotnet-pack/PackCommandParser.cs b/src/dotnet/commands/dotnet-pack/PackCommandParser.cs deleted file mode 100644 index 036e12072..000000000 --- a/src/dotnet/commands/dotnet-pack/PackCommandParser.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Tools; -using LocalizableStrings = Microsoft.DotNet.Tools.Pack.LocalizableStrings; - -namespace Microsoft.DotNet.Cli -{ - internal static class PackCommandParser - { - public static Command Pack() => - CreateWithRestoreOptions.Command( - "pack", - LocalizableStrings.AppFullName, - Accept.ZeroOrMoreArguments(), - CommonOptions.HelpOption(), - Create.Option( - "-o|--output", - LocalizableStrings.CmdOutputDirDescription, - Accept.ExactlyOneArgument() - .With(name: LocalizableStrings.CmdOutputDir) - .ForwardAsSingle(o => $"/p:PackageOutputPath={o.Arguments.Single()}")), - Create.Option( - "--no-build", - LocalizableStrings.CmdNoBuildOptionDescription, - Accept.NoArguments().ForwardAs("/p:NoBuild=true")), - Create.Option( - "--include-symbols", - LocalizableStrings.CmdIncludeSymbolsDescription, - Accept.NoArguments().ForwardAs("/p:IncludeSymbols=true")), - Create.Option( - "--include-source", - LocalizableStrings.CmdIncludeSourceDescription, - Accept.NoArguments().ForwardAs("/p:IncludeSource=true")), - CommonOptions.ConfigurationOption(), - CommonOptions.VersionSuffixOption(), - Create.Option( - "-s|--serviceable", - LocalizableStrings.CmdServiceableDescription, - Accept.NoArguments().ForwardAs("/p:Serviceable=true")), - CommonOptions.NoRestoreOption(), - CommonOptions.VerbosityOption()); - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index 85c8ccece..000000000 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - .NET Core NuGet Package Packer - Nástroj .NET Core pro balení balíčku NuGet - - - - pack for msbuild - zabalit pro msbuild - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Directory in which to place built packages. - Adresář, do kterého se umisťují sestavené balíčky. - - - - 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. - - - - Include packages with symbols in addition to regular packages in output directory. - Zahrne do výstupního adresáře kromě běžných balíčků i balíčky se symboly. - - - - Include PDBs and source files. Source files go into the src folder in the resulting nuget package - Zahrne soubory PDB a zdrojové soubory. Zdrojové soubory ve složce srcve výsledném balíčku NuGet - - - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. - Nastaví v balíčku příznak obsluhovatelnosti. Další informace najdete na adrese https://aka.ms/nupkgservicing. - - - - PROJECT - PROJECT - - - - The project to pack, defaults to the project file in the current directory. Can be a path to any project file - Balený projekt – výchozí hodnotou je soubor projektu v aktuálním adresáři. Může to být cesta k libovolnému souboru projektu. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index 9a72dc7b1..000000000 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - .NET Core NuGet Package Packer - .NET Core NuGet Package Packer - - - - pack for msbuild - Für MSBuild packen - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Directory in which to place built packages. - Verzeichnis, in dem erstellte Pakete abgelegt werden. - - - - 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. - - - - Include packages with symbols in addition to regular packages in output directory. - Pakete mit Symbolen zusätzlich zu regulären Paketen in Ausgabeverzeichnis einschließen. - - - - Include PDBs and source files. Source files go into the src folder in the resulting nuget package - PDBs und Quelldateien einschließen. Quelldateien werden im Ordner "src" im resultierenden NuGet-Paket abgelegt. - - - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. - Legt das Verarbeitungsflag im Paket fest. Weitere Informationen finden Sie unter https://aka.ms/nupkgservicing. - - - - PROJECT - PROJECT - - - - The project to pack, defaults to the project file in the current directory. Can be a path to any project file - Das zu packende Projekt (standardmäßig die Projektdatei im aktuellen Verzeichnis). Kann ein Pfad zu einer beliebigen Projektdatei sein. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index 46223a4b2..000000000 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - .NET Core NuGet Package Packer - pack - - - - pack for msbuild - pack para MSBuild - - - - OUTPUT_DIR - DIRECTORIO_DE_SALIDA - - - - Directory in which to place built packages. - Directorio donde se ubican los paquetes compilados. - - - - 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. - - - - Include packages with symbols in addition to regular packages in output directory. - Se incluyen paquetes con símbolos además de los paquetes habituales en el directorio de salida. - - - - Include PDBs and source files. Source files go into the src folder in the resulting nuget package - Se incluyen los archivos PDB y de código fuente. Los archivos de código fuente van a la carpeta src del paquete NuGet resultante - - - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. - Establece la marca serviceable en el paquete. Para más información, consulte https://aka.ms/nupkgservicing. - - - - PROJECT - PROYECTO - - - - The project to pack, defaults to the project file in the current directory. Can be a path to any project file - Proyecto que se va a empaquetar; de forma predeterminada, toma el archivo del proyecto del directorio actual. Puede ser una ruta de acceso a cualquier archivo de proyecto - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index e30934547..000000000 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - .NET Core NuGet Package Packer - Compresseur de package NuGet .NET Core - - - - pack for msbuild - compresser pour msbuild - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Directory in which to place built packages. - Répertoire dans lequel placer les packages générés - - - - 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é. - - - - Include packages with symbols in addition to regular packages in output directory. - Incluez les packages avec des symboles en plus des packages classiques dans le répertoire de sortie. - - - - Include PDBs and source files. Source files go into the src folder in the resulting nuget package - Inclure les PDB et les fichiers sources. Les fichiers sources vont dans le dossier src dans le paquet NuGet résultant - - - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. - Définissez l'indicateur de maintenance dans le package. Pour plus d'informations, consultez https://aka.ms/nupkgservicing. - - - - PROJECT - PROJECT - - - - The project to pack, defaults to the project file in the current directory. Can be a path to any project file - Projet à compresser, par défaut le fichier projet dans le répertoire actif. Il peut s'agir d'un chemin vers n'importe quel fichier projet - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index d6fde8790..000000000 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - .NET Core NuGet Package Packer - Strumento di creazione pacchetti NuGet di .NET Core - - - - pack for msbuild - pack per MSBuild - - - - OUTPUT_DIR - DIR_OUTPUT - - - - Directory in which to place built packages. - Directory in cui inserire i pacchetti compilati. - - - - 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. - - - - Include packages with symbols in addition to regular packages in output directory. - Include i pacchetti con simboli in aggiunta a quelli normali nella directory di output. - - - - Include PDBs and source files. Source files go into the src folder in the resulting nuget package - Include i PDB e i file di origine. I file di origine vengono inseriti nella cartella src nel pacchetto NuGet risultante - - - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. - Imposta il flag serviceable nel pacchetto. Per altre informazioni,vedere https://aka.ms/nupkgservicing. - - - - PROJECT - PROGETTO - - - - The project to pack, defaults to the project file in the current directory. Can be a path to any project file - Progetto di cui creare il pacchetto. Per impostazione predefinita, verrà usato il file di progetto nella directory corrente. Può essere un percorso di qualsiasi file di progetto - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index 32500da1a..000000000 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - .NET Core NuGet Package Packer - .NET Core NuGet パッケージ パッカー - - - - pack for msbuild - msbuild のパック - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Directory in which to place built packages. - ビルド パッケージを配置するディレクトリ。 - - - - Skip building the project prior to packing. By default, the project will be built. - パッキングの前に、プロジェクトの構築をスキップします。既定では、プロジェクトは構築されます。 - - - - Include packages with symbols in addition to regular packages in output directory. - 通常のパッケージに加えてシンボルを含むパッケージを出力ディレクトリに含めます。 - - - - Include PDBs and source files. Source files go into the src folder in the resulting nuget package - PDB とソース ファイルを含めます。ソース ファイルは、結果の nuget パッケージの src フォルダーに移動します - - - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. - パッケージに処理可能なフラグを設定します。詳しくは、https://aka.ms/nupkgservicing をご覧ください。 - - - - PROJECT - PROJECT - - - - The project to pack, defaults to the project file in the current directory. Can be a path to any project file - パックするプロジェクト。既定は現在のディレクトリ内のプロジェクト ファイルです。任意のプロジェクト ファイルへのパスを指定できます - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index 134bb3f08..000000000 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - .NET Core NuGet Package Packer - .NET Core NuGet 패키지 패커 - - - - pack for msbuild - msbuild용 팩입니다. - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Directory in which to place built packages. - 빌드된 패키지를 배치할 디렉터리입니다. - - - - Skip building the project prior to packing. By default, the project will be built. - 압축하기 전에 프로젝트를 빌드하지 않습니다. 기본적으로 프로젝트가 빌드됩니다. - - - - Include packages with symbols in addition to regular packages in output directory. - 일반 패키지 외에 기호가 포함된 패키지를 출력 디렉터리에 포함합니다. - - - - Include PDBs and source files. Source files go into the src folder in the resulting nuget package - PDB 및 소스 파일을 포함합니다. 소스 파일이 결과 nuget 패키지의 src 폴더로 이동합니다. - - - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. - 패키지에서 서비스 가능 플래그를 설정합니다. 자세한 내용은 https://aka.ms/nupkgservicing을 참조하세요. - - - - PROJECT - PROJECT - - - - The project to pack, defaults to the project file in the current directory. Can be a path to any project file - 압축할 프로젝트입니다. 현재 디렉터리의 프로젝트 파일로 기본 설정됩니다. 프로젝트 파일의 경로일 수 있습니다. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index 65a8a64ab..000000000 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - .NET Core NuGet Package Packer - Tworzenie pakietów NuGet w programie .NET Core - - - - pack for msbuild - pakowanie dla programu MSBuild - - - - OUTPUT_DIR - KATALOG_WYJŚCIOWY - - - - Directory in which to place built packages. - Katalog, w którym mają zostać umieszczone skompilowane pakiety. - - - - Skip building the project prior to packing. By default, the project will be built. - Pomiń kompilację projektu przed pakowaniem. Domyślnie projekt zostanie skompilowany. - - - - Include packages with symbols in addition to regular packages in output directory. - Dołącz pakiety z symbolami oprócz regularnych pakietów w folderze wyjściowym. - - - - Include PDBs and source files. Source files go into the src folder in the resulting nuget package - Dołącz pliki PDB i pliki źródłowe. Pliki źródłowe zostaną umieszczone w folderze src w wynikowym pakiecie NuGet - - - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. - Ustaw w pakiecie flagę oznaczającą możliwość obsługi. Aby uzyskać więcej informacji, zobacz https://aka.ms/nupkgservicing. - - - - PROJECT - PROJEKT - - - - The project to pack, defaults to the project file in the current directory. Can be a path to any project file - Projekty do spakowania, wartością domyślną jest plik projektu w bieżącym katalogu. Może to być ścieżka do dowolnego pliku projektu - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index fd7dd4b59..000000000 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - .NET Core NuGet Package Packer - Empacotador de Pacotes NuGet do .NET Core - - - - pack for msbuild - empacotar para o msbuild - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Directory in which to place built packages. - Diretório no qual os pacotes compilados serão colocados. - - - - 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. - - - - Include packages with symbols in addition to regular packages in output directory. - Inclua os pacotes com símbolos no diretório de saída, além dos pacotes regulares. - - - - Include PDBs and source files. Source files go into the src folder in the resulting nuget package - Incluir os arquivos de origem e os PDBs. Os arquivos de origem vão para a pasta de origem no pacote nuget resultante - - - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. - Defina o sinalizador operacional no pacote. Para obter mais informações, consulte https://aka.ms/nupkgservicing. - - - - PROJECT - PROJECT - - - - The project to pack, defaults to the project file in the current directory. Can be a path to any project file - O projeto a ser empacotado, usa como padrão o arquivo de projeto no diretório atual. Pode ser um caminho para qualquer arquivo de projeto - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index 36c29f987..000000000 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - .NET Core NuGet Package Packer - Упаковщик пакетов NuGet .NET Core - - - - pack for msbuild - упаковать для msbuild - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Directory in which to place built packages. - Каталог для размещения созданных пакетов. - - - - Skip building the project prior to packing. By default, the project will be built. - Пропуск сборки проекта перед упаковкой. По умолчанию выполняется сборка проекта. - - - - Include packages with symbols in addition to regular packages in output directory. - Включение пакетов с символами в дополнение к обычным пакетам в выходном каталоге. - - - - Include PDBs and source files. Source files go into the src folder in the resulting nuget package - Включение PDB-файлов и исходных файлов. Исходные файлы передаются в папку src в получившемся проекте NuGet - - - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. - Установка флага "подлежит обслуживанию" в пакете. Дополнительные сведения см. на странице https://aka.ms/nupkgservicing. - - - - PROJECT - PROJECT - - - - The project to pack, defaults to the project file in the current directory. Can be a path to any project file - Упаковываемый проект; по умолчанию используется файл проекта в текущем каталоге. Может быть путем к любому файлу проекта - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index 0e6d13a56..000000000 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - .NET Core NuGet Package Packer - .NET Core NuGet Paketi Paketleyicisi - - - - pack for msbuild - msbuild paketi - - - - OUTPUT_DIR - ÇIKIŞ_DİZİNİ - - - - Directory in which to place built packages. - Derlenen paketlerin yerleştirileceği dizin. - - - - 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. - - - - Include packages with symbols in addition to regular packages in output directory. - Çıkış dizinine, normal paketlere ek olarak sembol içeren paketler ekleyin. - - - - Include PDBs and source files. Source files go into the src folder in the resulting nuget package - PDB’leri ve kaynak dosyaları ekleyin. Elde edilen nuget paketinde kaynak dosyaları, src klasöründe yer alır - - - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. - Pakette serviceable bayrağını ayarlayın. Daha fazla bilgi için bkz. https://aka.ms/nupkgservicing. - - - - PROJECT - PROJE - - - - The project to pack, defaults to the project file in the current directory. Can be a path to any project file - Paketlenecek proje; varsayılan olarak, geçerli dizindeki proje dosyasıdır. Herhangi bir proje dosyasının yolu olabilir - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.xlf deleted file mode 100644 index 922e083e4..000000000 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - .NET Core NuGet Package Packer - - - - pack for msbuild - - - - OUTPUT_DIR - - - - Directory in which to place built packages. - - - - Skip building the project prior to packing. By default, the project will be built. - - - - Include packages with symbols in addition to regular packages in output directory. - - - - Include PDBs and source files. Source files go into the src folder in the resulting nuget package - - - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. - - - - PROJECT - - - - The project to pack, defaults to the project file in the current directory. Can be a path to any project file - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index e45821421..000000000 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - .NET Core NuGet Package Packer - .NET Core NuGet 包打包程序 - - - - pack for msbuild - 用于 MSBuild 的包 - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Directory in which to place built packages. - 用于放置生成包的目录。 - - - - Skip building the project prior to packing. By default, the project will be built. - 在打包之前跳过生成项目。默认情况下,将生成项目。 - - - - Include packages with symbols in addition to regular packages in output directory. - 除了输出目录中的常规包之外,还包括带符号的包。 - - - - Include PDBs and source files. Source files go into the src folder in the resulting nuget package - 包括 PDB 和源文件。源文件放入 nuget 结果包的 src 文件夹中 - - - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. - 在包中设置可用标志。有关详细信息,请参阅 https://aka.ms/nupkgservicing。 - - - - PROJECT - PROJECT - - - - The project to pack, defaults to the project file in the current directory. Can be a path to any project file - 要打包的项目,默认为当前目录中的项目文件。可以是任何项目文件的路径 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index 4f8d86032..000000000 --- a/src/dotnet/commands/dotnet-pack/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - .NET Core NuGet Package Packer - .NET Core NuGet 套件封裝器 - - - - pack for msbuild - MSBuild 套件 - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Directory in which to place built packages. - 要放置建置套件的目錄。 - - - - Skip building the project prior to packing. By default, the project will be built. - 在封裝前跳過建置專案。預設會建置專案。 - - - - Include packages with symbols in addition to regular packages in output directory. - 將具符號的套件及一般套件包含在輸出目錄中。 - - - - Include PDBs and source files. Source files go into the src folder in the resulting nuget package - 包含 PDB 和來源檔案。來源檔案會傳入產生之 NuGet 套件中的 src 資料夾 - - - - Set the serviceable flag in the package. For more information, please see https://aka.ms/nupkgservicing. - 設定套件中提供服務的旗標。如需詳細資訊,請參閱 https://aka.ms/nupkgservicing。 - - - - PROJECT - PROJECT - - - - The project to pack, defaults to the project file in the current directory. Can be a path to any project file - 要封裝的專案,預設為目前目錄中的專案檔。可以是任何專案檔的路徑 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/LocalizableStrings.resx b/src/dotnet/commands/dotnet-publish/LocalizableStrings.resx deleted file mode 100644 index e11675be8..000000000 --- a/src/dotnet/commands/dotnet-publish/LocalizableStrings.resx +++ /dev/null @@ -1,144 +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 - - - Publisher for the .NET Platform - - - FRAMEWORK - - - Target framework to publish for. The target framework has to be specified in the project file. - - - OUTPUT_DIR - - - Output directory in which to place the published artifacts. - - - manifest.xml - - - The path to a target manifest file that contains the list of packages to be excluded from the publish step. - - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/Program.cs b/src/dotnet/commands/dotnet-publish/Program.cs deleted file mode 100644 index f44ecb2ca..000000000 --- a/src/dotnet/commands/dotnet-publish/Program.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Tools; -using Microsoft.DotNet.Tools.MSBuild; -using Parser = Microsoft.DotNet.Cli.Parser; - -namespace Microsoft.DotNet.Tools.Publish -{ - public class PublishCommand : RestoringCommand - { - private PublishCommand( - IEnumerable msbuildArgs, - IEnumerable userDefinedArguments, - IEnumerable trailingArguments, - bool noRestore, - string msbuildPath = null) - : base(msbuildArgs, userDefinedArguments, trailingArguments, noRestore, msbuildPath) - { - } - - public static PublishCommand FromArgs(string[] args, string msbuildPath = null) - { - DebugHelper.HandleDebugSwitch(ref args); - - var msbuildArgs = new List(); - - var parser = Parser.Instance; - - var result = parser.ParseFrom("dotnet publish", args); - - result.ShowHelpOrErrorIfAppropriate(); - - msbuildArgs.Add("/t:Publish"); - - var appliedPublishOption = result["dotnet"]["publish"]; - - msbuildArgs.AddRange(appliedPublishOption.OptionValuesToBeForwarded()); - - msbuildArgs.AddRange(appliedPublishOption.Arguments); - - bool noRestore = appliedPublishOption.HasOption("--no-restore"); - - return new PublishCommand( - msbuildArgs, - appliedPublishOption.OptionValuesToBeForwarded(), - appliedPublishOption.Arguments, - noRestore, - msbuildPath); - } - - public static int Run(string[] args) - { - DebugHelper.HandleDebugSwitch(ref args); - - PublishCommand cmd; - try - { - cmd = FromArgs(args); - } - catch (CommandCreationException e) - { - return e.ExitCode; - } - - return cmd.Execute(); - } - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs b/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs deleted file mode 100644 index 9149c1dfd..000000000 --- a/src/dotnet/commands/dotnet-publish/PublishCommandParser.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Tools; -using LocalizableStrings = Microsoft.DotNet.Tools.Publish.LocalizableStrings; - -namespace Microsoft.DotNet.Cli -{ - internal static class PublishCommandParser - { - public static Command Publish() => - CreateWithRestoreOptions.Command( - "publish", - LocalizableStrings.AppDescription, - Accept.ZeroOrMoreArguments(), - CommonOptions.HelpOption(), - Create.Option( - "-o|--output", - LocalizableStrings.OutputOptionDescription, - Accept.ExactlyOneArgument() - .With(name: LocalizableStrings.OutputOption) - .ForwardAsSingle(o => $"/p:PublishDir={o.Arguments.Single()}")), - CommonOptions.FrameworkOption(), - CommonOptions.RuntimeOption(), - CommonOptions.ConfigurationOption(), - CommonOptions.VersionSuffixOption(), - Create.Option( - "--manifest", - LocalizableStrings.ManifestOptionDescription, - Accept.OneOrMoreArguments() - .With(name: LocalizableStrings.ManifestOption) - .ForwardAsSingle(o => $"/p:TargetManifestFiles={string.Join("%3B", o.Arguments)}")), - Create.Option( - "--self-contained", - LocalizableStrings.SelfContainedOptionDescription, - Accept.ZeroOrOneArgument() - .WithSuggestionsFrom("true", "false") - .ForwardAsSingle(o => - { - string value = o.Arguments.Any() ? o.Arguments.Single() : "true"; - return $"/p:SelfContained={value}"; - })), - CommonOptions.NoRestoreOption(), - CommonOptions.VerbosityOption()); - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index 37b71db9d..000000000 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - Publisher for the .NET Platform - Vydavatel pro platformu .NET - - - - FRAMEWORK - FRAMEWORK - - - - Target framework to publish for. The target framework has to be specified in the project file. - Cílová platforma pro publikování. Cílová platforma musí být v souboru projektu zadaná. - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Output directory in which to place the published artifacts. - Výstupní adresář do kterého se umisťují publikované artefakty. - - - - manifest.xml - manifest.xml - - - - The path to a target manifest file that contains the list of packages to be excluded from the publish step. - Cesta k cílovému souboru manifestu obsahujícímu seznam balíčků, které se mají vyloučit z kroku publikování - - - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. - Publikuje spolu s aplikací modul runtime .NET Core, aby se tento modul nemusel instalovat na cílový počítač. Standardně se nastaví na True, pokud je zadaný identifikátor modulu runtime. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index e3a1c6ecf..000000000 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - Publisher for the .NET Platform - Herausgeber für die .NET-Plattform - - - - FRAMEWORK - FRAMEWORK - - - - Target framework to publish for. The target framework has to be specified in the project file. - Zielframework für die Veröffentlichung. Das Zielframework muss in der Projektdatei angegeben werden. - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Output directory in which to place the published artifacts. - Ausgabeverzeichnis, in dem veröffentlichte Artefakte abgelegt werden. - - - - manifest.xml - manifest.xml - - - - The path to a target manifest file that contains the list of packages to be excluded from the publish step. - Der Pfad zu einer Zielmanifestdatei, die die Liste der von der Veröffentlichung auszuschließenden Pakete enthält. - - - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. - Veröffentlichen Sie die .NET Core-Laufzeit mit Ihrer Anwendung, damit die Laufzeit auf dem Zielcomputer nicht installiert werden muss. Der Standardwert ist "true", wenn ein Laufzeitbezeichner angegeben ist. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index 779367c21..000000000 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - Publisher for the .NET Platform - Publicador para la plataforma .NET - - - - FRAMEWORK - PLATAFORMA - - - - Target framework to publish for. The target framework has to be specified in the project file. - Plataforma de destino para la que se publica. La plataforma de destino se debe especificar en el archivo de proyecto. - - - - OUTPUT_DIR - DIRECTORIO_DE_SALIDA - - - - Output directory in which to place the published artifacts. - Directorio de salida en el que se ubicarán los artefactos publicados. - - - - manifest.xml - manifest.xml - - - - The path to a target manifest file that contains the list of packages to be excluded from the publish step. - La ruta de acceso a un archivo de manifiesto de destino que contiene la lista de paquetes que se excluirán del paso de publicación. - - - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. - Publica el tiempo de ejecución de .NET Core con su aplicación para que no sea necesario instalarlo en la máquina de destino. Si se especifica un identificador de tiempo de ejecución, se toma como predeterminado el valor "true". - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index 44a8f8c73..000000000 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - Publisher for the .NET Platform - Éditeur pour la plateforme .NET - - - - FRAMEWORK - FRAMEWORK - - - - Target framework to publish for. The target framework has to be specified in the project file. - Framework cible de la publication. Le framework cible doit être spécifié dans le fichier projet. - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Output directory in which to place the published artifacts. - Répertoire de sortie dans lequel placer les artefacts publiés. - - - - manifest.xml - manifest.xml - - - - The path to a target manifest file that contains the list of packages to be excluded from the publish step. - Chemin d'un fichier manifeste cible contenant la liste des packages à exclure de l'étape de publication. - - - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. - Publiez le runtime .NET Core avec votre application pour éviter à l'utilisateur de l'installer sur la machine cible. La valeur par défaut est 'true' si un identificateur de runtime est spécifié. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index 3e15ff10b..000000000 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - Publisher for the .NET Platform - Editore per la piattaforma .NET - - - - FRAMEWORK - FRAMEWORK - - - - Target framework to publish for. The target framework has to be specified in the project file. - Framework di destinazione per cui eseguire la pubblicazione. Il framework di destinazione deve essere specificato nel file di progetto. - - - - OUTPUT_DIR - DIR_OUTPUT - - - - Output directory in which to place the published artifacts. - Directory di output in cui inserire gli artefatti pubblicati. - - - - manifest.xml - manifest.xml - - - - The path to a target manifest file that contains the list of packages to be excluded from the publish step. - Percorso di un file manifesto di destinazione che contiene l'elenco di pacchetti da escludere dal passaggio di pubblicazione. - - - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. - Pubblica il runtime di .NET Core con l'applicazione in modo che non sia necessario installarlo nel computer di destinazione. Se si specifica un identificatore di runtime, l'impostazione predefinita è 'true'. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index 4337b4f66..000000000 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - Publisher for the .NET Platform - .NET Platform 用パブリッシャー - - - - FRAMEWORK - FRAMEWORK - - - - Target framework to publish for. The target framework has to be specified in the project file. - 発行用のターゲット フレームワーク。ターゲット フレームワークはプロジェクト ファイルで指定する必要があります。 - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Output directory in which to place the published artifacts. - 発行された成果物を配置する出力ディレクトリ。 - - - - manifest.xml - manifest.xml - - - - The path to a target manifest file that contains the list of packages to be excluded from the publish step. - 発行ステップから除外されるパッケージのリストを含むターゲット マニフェスト ファイルへのパス。 - - - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. - ランタイムをターゲット マシンにインストールしなくてもよいよう、.NET Core ランタイムをアプリケーションと一緒に発行します。ランタイム ID が指定される場合、既定の 'true' になります。 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index e5f42bc3a..000000000 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - Publisher for the .NET Platform - .NET 플랫폼용 게시자입니다. - - - - FRAMEWORK - FRAMEWORK - - - - Target framework to publish for. The target framework has to be specified in the project file. - 게시할 대상 프레임워크입니다. 대상 프레임워크는 프로젝트 파일에서 지정해야 합니다. - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Output directory in which to place the published artifacts. - 게시할 아티팩트를 배치할 출력 디렉터리입니다. - - - - manifest.xml - manifest.xml - - - - The path to a target manifest file that contains the list of packages to be excluded from the publish step. - 게시 단계에서 제외할 패키지 목록이 들어 있는 대상 매니페스트 파일의 경로입니다. - - - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. - 런타임은 대상 컴퓨터에 설치할 필요가 없으므로 응용 프로그램과 함께 .NET Core 런타임을 게시합니다. 런타임 식별자가 지정된 경우 기본값은 'true'입니다. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index 4a51e1e39..000000000 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - Publisher for the .NET Platform - Wydawca dla platformy .NET. - - - - FRAMEWORK - PLATFORMA - - - - Target framework to publish for. The target framework has to be specified in the project file. - Docelowa platforma publikacji. Platforma docelowa musi być określona w pliku projektu. - - - - OUTPUT_DIR - KATALOG_WYJŚCIOWY - - - - Output directory in which to place the published artifacts. - Katalog wyjściowy, w którym mają zostać umieszczone opublikowane artefakty. - - - - manifest.xml - manifest.xml - - - - The path to a target manifest file that contains the list of packages to be excluded from the publish step. - Ścieżka do docelowego pliku manifestu zawierającego listę pakietów, które mają zostać wykluczone z kroku publikowania. - - - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. - Opublikuj środowisko uruchomieniowe programu .NET Core z aplikacją, aby nie trzeba było go instalować na maszynie docelowej. Domyślnie jest ustawiona wartość „true” w przypadku określenia identyfikatora środowiska uruchomieniowego. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index 81a53b9d7..000000000 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - Publisher for the .NET Platform - Editor para a Plataforma .NET - - - - FRAMEWORK - FRAMEWORK - - - - Target framework to publish for. The target framework has to be specified in the project file. - Estrutura de destino na qual publicar. A estrutura de destino deve ser especificada no arquivo de projeto. - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Output directory in which to place the published artifacts. - Diretório de saída no qual os artefatos publicados serão colocados. - - - - manifest.xml - manifest.xml - - - - The path to a target manifest file that contains the list of packages to be excluded from the publish step. - O caminho para um arquivo de manifesto de destino que contém a lista de pacotes a serem excluídos da etapa de publicação. - - - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. - Publique o tempo de execução .NET Core com seu aplicativo para que o tempo de execução não precise ser instalado no computador de destino. Assumirá 'true' como padrão se um identificador de tempo de execução for especificado. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index c4ce49b81..000000000 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - Publisher for the .NET Platform - Издатель для платформы .NET - - - - FRAMEWORK - FRAMEWORK - - - - Target framework to publish for. The target framework has to be specified in the project file. - Целевая платформа публикации. Целевая платформа должна быть указана в файле проекта. - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Output directory in which to place the published artifacts. - Выходной каталог для размещения опубликованных артефактов. - - - - manifest.xml - manifest.xml - - - - The path to a target manifest file that contains the list of packages to be excluded from the publish step. - Путь к целевому файлу манифеста, содержащему список пакетов, исключаемых из публикации. - - - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. - Опубликуйте среду выполнения .NET Core вместе с приложением, чтобы ее не нужно было устанавливать на целевом компьютере. Если идентификатор среды выполнения указан, значение по умолчанию — true. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index cc3c5ae9d..000000000 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - Publisher for the .NET Platform - .NET Platformunun yayımcısı. - - - - FRAMEWORK - ÇERÇEVE - - - - Target framework to publish for. The target framework has to be specified in the project file. - Yayımlamanın yapılacağı hedef çerçeve. Hedef çerçevenin proje dosyasında belirtilmesi gerekir. - - - - OUTPUT_DIR - ÇIKIŞ_DİZİNİ - - - - Output directory in which to place the published artifacts. - Yayımlanan yapıtların yerleştirileceği çıkış dizini. - - - - manifest.xml - manifest.xml - - - - The path to a target manifest file that contains the list of packages to be excluded from the publish step. - Yayımlama adımının dışında tutulacak paketlerin listesini içeren bir hedef bildirim dosyasının yolu. - - - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. - Çalışma zamanının hedef makineye yüklenmesine gerek kalmaması için, .NET Core çalışma zamanını uygulamanızla birlikte yayımlayın. Bir çalışma zamanı tanımlayıcısı belirtilmişse, varsayılan olarak 'true' değerine ayarlanır. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.xlf deleted file mode 100644 index 8a33dc288..000000000 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - Publisher for the .NET Platform - - - - FRAMEWORK - - - - Target framework to publish for. The target framework has to be specified in the project file. - - - - OUTPUT_DIR - - - - Output directory in which to place the published artifacts. - - - - manifest.xml - - - - The path to a target manifest file that contains the list of packages to be excluded from the publish step. - - - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index 64d86e8bb..000000000 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - Publisher for the .NET Platform - 适用于 .NET 平台的发布服务器 - - - - FRAMEWORK - FRAMEWORK - - - - Target framework to publish for. The target framework has to be specified in the project file. - 要发布的目标框架。目标框架必须在项目文件中指定。 - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Output directory in which to place the published artifacts. - 用于放置已发布项的输出目录。 - - - - manifest.xml - manifest.xml - - - - The path to a target manifest file that contains the list of packages to be excluded from the publish step. - 指向目标清单文件的路径,该文件包含要通过发布步骤执行的包的列表。 - - - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. - 随附应用程序发布 .NET Core 运行时,免除在目标计算机上安装运行时的需求。如果指定了运行时标识符,则默认为 “true”。 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index ad6e74bf6..000000000 --- a/src/dotnet/commands/dotnet-publish/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - Publisher for the .NET Platform - .NET 平台的發行者 - - - - FRAMEWORK - FRAMEWORK - - - - Target framework to publish for. The target framework has to be specified in the project file. - 要為其發行的目標 Framework。其必須在專案檔中指定。 - - - - OUTPUT_DIR - OUTPUT_DIR - - - - Output directory in which to place the published artifacts. - 要放置發行之成品的輸出目錄。 - - - - manifest.xml - manifest.xml - - - - The path to a target manifest file that contains the list of packages to be excluded from the publish step. - 目標資訊清單檔案的路徑,其包含要從發行步驟中排除的套件清單。 - - - - Publish the .NET Core runtime with your application so the runtime doesn't need to be installed on the target machine. Defaults to 'true' if a runtime identifier is specified. - 隨著應用程式一併發行 .NET Core 執行階段,因此不需要在目標電腦上安裝此執行階段。若指定了執行階段識別碼,則預設為 'true'。 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/LocalizableStrings.resx b/src/dotnet/commands/dotnet-remove/LocalizableStrings.resx deleted file mode 100644 index 1f2a8221a..000000000 --- a/src/dotnet/commands/dotnet-remove/LocalizableStrings.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - .NET Remove Command - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/Program.cs b/src/dotnet/commands/dotnet-remove/Program.cs deleted file mode 100644 index d77317f64..000000000 --- a/src/dotnet/commands/dotnet-remove/Program.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Tools.Remove.PackageReference; -using Microsoft.DotNet.Tools.Remove.ProjectToProjectReference; - -namespace Microsoft.DotNet.Tools.Remove -{ - public class RemoveCommand : DotNetTopLevelCommandBase - { - protected override string CommandName => "remove"; - protected override string FullCommandNameLocalized => LocalizableStrings.NetRemoveCommand; - protected override string ArgumentName => Constants.ProjectArgumentName; - protected override string ArgumentDescriptionLocalized => CommonLocalizableStrings.ArgumentsProjectDescription; - - internal override Dictionary> SubCommands => - new Dictionary> - { - ["reference"] = - remove => new RemoveProjectToProjectReferenceCommand( - remove["reference"], - remove.Value(), - ParseResult), - - ["package"] = - remove => new RemovePackageReferenceCommand( - remove["package"], - remove.Value(), - ParseResult) - }; - - public static int Run(string[] args) - { - var command = new RemoveCommand(); - return command.RunCommand(args); - } - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/RemoveCommandParser.cs b/src/dotnet/commands/dotnet-remove/RemoveCommandParser.cs deleted file mode 100644 index c45c14599..000000000 --- a/src/dotnet/commands/dotnet-remove/RemoveCommandParser.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Tools; -using LocalizableStrings = Microsoft.DotNet.Tools.Remove.LocalizableStrings; - -namespace Microsoft.DotNet.Cli -{ - internal static class RemoveCommandParser - { - public static Command Remove() => - Create.Command("remove", - LocalizableStrings.NetRemoveCommand, - Accept.ExactlyOneArgument() - .DefaultToCurrentDirectory() - .With(name: CommonLocalizableStrings.CmdProjectFile, - description: CommonLocalizableStrings.ArgumentsProjectDescription) - .DefaultToCurrentDirectory(), - CommonOptions.HelpOption(), - RemovePackageParser.RemovePackage(), - RemoveProjectToProjectReferenceParser.RemoveReference()); - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/LocalizableStrings.resx b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/LocalizableStrings.resx deleted file mode 100644 index 969e55a2d..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/LocalizableStrings.resx +++ /dev/null @@ -1,132 +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 - - - .NET Remove Package reference Command. - - - Command to remove package reference. - - - Package reference to remove. - - - Please specify only one package reference to remove. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/Program.cs b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/Program.cs deleted file mode 100644 index 36d5fce0d..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/Program.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using System.Linq; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Tools.NuGet; - -namespace Microsoft.DotNet.Tools.Remove.PackageReference -{ - internal class RemovePackageReferenceCommand : CommandBase - { - private readonly AppliedOption _appliedCommand; - private readonly string _fileOrDirectory; - - public RemovePackageReferenceCommand( - AppliedOption appliedCommand, - string fileOrDirectory, - ParseResult parseResult) : base(parseResult) - { - if (appliedCommand == null) - { - throw new ArgumentNullException(nameof(appliedCommand)); - } - if (fileOrDirectory == null) - { - throw new ArgumentNullException(nameof(fileOrDirectory)); - } - if (appliedCommand.Arguments.Count != 1) - { - throw new GracefulException(LocalizableStrings.SpecifyExactlyOnePackageReference); - } - - _appliedCommand = appliedCommand; - _fileOrDirectory = fileOrDirectory; - } - - public override int Execute() - { - var projectFilePath = string.Empty; - - if (!File.Exists(_fileOrDirectory)) - { - projectFilePath = MsbuildProject.GetProjectFileFromDirectory(_fileOrDirectory).FullName; - } - else - { - projectFilePath = _fileOrDirectory; - } - - var packageToRemove = _appliedCommand.Arguments.Single(); - var result = NuGetCommand.Run(TransformArgs(packageToRemove, projectFilePath)); - - return result; - } - - private string[] TransformArgs(string packageId, string projectFilePath) - { - return new string[] - { - "package", - "remove", - "--package", - packageId, - "--project", - projectFilePath - }; - } - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/RemovePackageParser.cs b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/RemovePackageParser.cs deleted file mode 100644 index 1c7cdc21a..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/RemovePackageParser.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.DotNet.Cli.CommandLine; -using LocalizableStrings = Microsoft.DotNet.Tools.Remove.PackageReference.LocalizableStrings; - -namespace Microsoft.DotNet.Cli -{ - internal static class RemovePackageParser - { - public static Command RemovePackage() - { - return Create.Command( - "package", - LocalizableStrings.AppFullName, - Accept.ExactlyOneArgument() - .With(name: Tools.Add.PackageReference.LocalizableStrings.CmdPackage, - description: LocalizableStrings.AppHelpText), - CommonOptions.HelpOption()); - } - } -} diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index 7ab6efcfc..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Package reference Command. - Příkaz rozhraní .NET pro odebrání odkazu na balíček - - - - Command to remove package reference. - Příkaz pro odebrání odkazu na balíček - - - - Package reference to remove. - Odkaz na balíček, který se má odebrat - - - - Please specify only one package reference to remove. - Zadejte prosím jenom jeden odkaz na balíček, který chcete odebrat. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index bd6cc4828..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Package reference Command. - .NET-Befehl zum Entfernen von Paketverweisen - - - - Command to remove package reference. - Befehl zum Entfernen eines Paketverweises. - - - - Package reference to remove. - Zu entfernender Paketverweis. - - - - Please specify only one package reference to remove. - Geben Sie nur einen Paketverweis an, der entfernt werden soll. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index 6cd40477b..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Package reference Command. - Comando de .NET para quitar referencia de paquete. - - - - Command to remove package reference. - Comando para quitar referencia de paquete - - - - Package reference to remove. - Referencia de paquete para quitar. - - - - Please specify only one package reference to remove. - Especifique solo una referencia de paquete para quitar. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index d70fcfe47..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Package reference Command. - Commande .NET Supprimer une référence de package. - - - - Command to remove package reference. - Commande permettant de supprimer une référence de package. - - - - Package reference to remove. - Référence de package à supprimer. - - - - Please specify only one package reference to remove. - Spécifiez une seule référence de package à supprimer. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index 0f187a630..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Package reference Command. - Comando Rimuovi riferimento al pacchetto .NET. - - - - Command to remove package reference. - Comando per rimuovere il riferimento al pacchetto. - - - - Package reference to remove. - Riferimento al pacchetto da rimuovere. - - - - Please specify only one package reference to remove. - Specificare un solo riferimento al pacchetto da rimuovere. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index 488678978..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Package reference Command. - .NET パッケージ参照を削除するコマンド。 - - - - Command to remove package reference. - パッケージ参照を削除するコマンド - - - - Package reference to remove. - 削除するパッケージ参照。 - - - - Please specify only one package reference to remove. - 削除するパッケージ参照を 1 つだけ指定してください。 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index dc684dea7..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Package reference Command. - .NET 패키지 참조 제거 명령입니다. - - - - Command to remove package reference. - 패키지 참조를 제거하는 명령입니다. - - - - Package reference to remove. - 제거할 패키지 참조입니다. - - - - Please specify only one package reference to remove. - 제거할 패키지 참조를 하나만 지정하세요. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index f25b020bd..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Package reference Command. - Polecenie usuwania odwołania do pakietu platformy .NET. - - - - Command to remove package reference. - Polecenie służące do usuwania odwołania do pakietu. - - - - Package reference to remove. - Odwołanie do pakietu do usunięcia. - - - - Please specify only one package reference to remove. - Podaj tylko jedno odwołanie do pakietu, które ma zostać usunięte. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index a7b6f9677..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Package reference Command. - Comando para remover referência do pacote de .NET. - - - - Command to remove package reference. - Comando para remover a referência de pacote. - - - - Package reference to remove. - Referência de pacote a ser removida. - - - - Please specify only one package reference to remove. - Especifique somente uma referência de pacote para ser removida. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index a92421686..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Package reference Command. - Команда .NET "Удалить ссылку на пакет". - - - - Command to remove package reference. - Эта команда удаляет ссылку на пакет. - - - - Package reference to remove. - Удаляемая ссылка на пакет. - - - - Please specify only one package reference to remove. - Укажите только одну удаляемую ссылку на пакет. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index 2ecf0b413..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Package reference Command. - .NET Paket başvurusunu kaldır Komutu - - - - Command to remove package reference. - Paket başvurusunu kaldırma komutu - - - - Package reference to remove. - Kaldırılacak paket başvurusu. - - - - Please specify only one package reference to remove. - Lütfen kaldırmak için yalnızca bir paket başvurusunu belirtin. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.xlf deleted file mode 100644 index db38960c7..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - .NET Remove Package reference Command. - - - - Command to remove package reference. - - - - Package reference to remove. - - - - Please specify only one package reference to remove. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index dc98a376a..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Package reference Command. - .NET“删除包引用”命令。 - - - - Command to remove package reference. - 用于删除包引用的命令。 - - - - Package reference to remove. - 要删除的包引用。 - - - - Please specify only one package reference to remove. - 请仅指定一个要删除的包引用。 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index 03d190cbc..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Package reference Command. - .NET 移除套件參考命令。 - - - - Command to remove package reference. - 用以移除套件參考的命令。 - - - - Package reference to remove. - 要移除的套件參考。 - - - - Please specify only one package reference to remove. - 請只指定一個要移除的套件參考。 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/LocalizableStrings.resx b/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/LocalizableStrings.resx deleted file mode 100644 index 8b30c41cf..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/LocalizableStrings.resx +++ /dev/null @@ -1,129 +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 - - - .NET Remove Project from Solution Command - - - Command to remove projects from a solution - - - Projects to remove from a solution - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index 3a0ed224f..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Remove Project from Solution Command - Příkaz rozhraní .NET pro odebrání projektu z řešení - - - - Command to remove projects from a solution - Příkaz pro odebrání projektů z řešení - - - - Projects to remove from a solution - Projekty odebírané z řešení - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index 6790a8458..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Remove Project from Solution Command - .NET-Befehl zum Entfernen des Projekts aus der Projektmappe - - - - Command to remove projects from a solution - Befehl zum Entfernen von Projekten aus einer Projektmappe - - - - Projects to remove from a solution - Aus einer Projektmappe zu entfernende Projekte - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index ffe8694cb..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Remove Project from Solution Command - Comando de .NET Quitar proyecto de la solución - - - - Command to remove projects from a solution - Comando para quitar proyectos de una solución - - - - Projects to remove from a solution - Proyectos que se quitarán de una solución - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index fa406f2f1..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Remove Project from Solution Command - Commande .NET de suppression de projet d'une solution - - - - Command to remove projects from a solution - Commande permettant de supprimer des projets d'une solution - - - - Projects to remove from a solution - Projets à supprimer d'une solution - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index c4c9f26e3..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Remove Project from Solution Command - Comando Rimuovi progetto da soluzione .NET - - - - Command to remove projects from a solution - Comando per rimuovere il progetto da una soluzione - - - - Projects to remove from a solution - Progetti da rimuovere da una soluzione - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index 57dc722ce..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Remove Project from Solution Command - .NET Remove Project from Solution コマンド - - - - Command to remove projects from a solution - ソリューションからプロジェクトを削除するコマンド - - - - Projects to remove from a solution - ソリューションから削除するプロジェクト - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index b96b5595a..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Remove Project from Solution Command - .NET 솔루션에서 프로젝트 제거 명령 - - - - Command to remove projects from a solution - 솔루션에서 프로젝트를 제거하기 위한 명령입니다. - - - - Projects to remove from a solution - 솔루션에서 제거할 프로젝트 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index 0c7a09a93..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Remove Project from Solution Command - Polecenie usuwania projektu z rozwiązania dla platformy .NET - - - - Command to remove projects from a solution - Polecenie służące do usuwania projektów z rozwiązania - - - - Projects to remove from a solution - Projekty do usunięcia z rozwiązania - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index 3f9ed9fc3..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Remove Project from Solution Command - Comando para Remover Projetos de uma Solução do .NET - - - - Command to remove projects from a solution - Comando para remover projetos de uma solução - - - - Projects to remove from a solution - Projetos a serem removidos de uma solução - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index eba7b97ec..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Remove Project from Solution Command - Команда .NET "Удалить проект из решения" - - - - Command to remove projects from a solution - Команда для удаления проектов из решения - - - - Projects to remove from a solution - Проекты, удаляемые из решения - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index e1a65f44c..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Remove Project from Solution Command - .NET Projeyi Çözümden Kaldırma Komutu - - - - Command to remove projects from a solution - Projeleri çözümden kaldırma komutu - - - - Projects to remove from a solution - Bir projeden kaldırılacak çözümler - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.xlf deleted file mode 100644 index 1cc2436a4..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - .NET Remove Project from Solution Command - - - - Command to remove projects from a solution - - - - Projects to remove from a solution - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index 9e44a4152..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Remove Project from Solution Command - .NET 从解决方案中删除项目命令 - - - - Command to remove projects from a solution - 从解决方案中删除项目的命令 - - - - Projects to remove from a solution - 要从解决方案中删除的项目 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index 7325b0fe9..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - .NET Remove Project from Solution Command - .NET 從解決方案移除專案命令 - - - - Command to remove projects from a solution - 命令,從解決方案移除專案命令 - - - - Projects to remove from a solution - 要從解決方案移除的專案 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/LocalizableStrings.resx b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/LocalizableStrings.resx deleted file mode 100644 index 7952e0f6b..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/LocalizableStrings.resx +++ /dev/null @@ -1,132 +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 - - - .NET Remove Project to Project reference Command - - - Command to remove project to project reference - - - Project to project references to remove - - - Remove reference only when targeting a specific framework - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/Program.cs b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/Program.cs deleted file mode 100644 index e813dda3a..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/Program.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Linq; -using Microsoft.Build.Evaluation; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.Tools.Remove.ProjectToProjectReference -{ - internal class RemoveProjectToProjectReferenceCommand : CommandBase - { - private readonly AppliedOption _appliedCommand; - private readonly string _fileOrDirectory; - - public RemoveProjectToProjectReferenceCommand( - AppliedOption appliedCommand, - string fileOrDirectory, - ParseResult parseResult) : base(parseResult) - { - if (appliedCommand == null) - { - throw new ArgumentNullException(nameof(appliedCommand)); - } - - if (fileOrDirectory == null) - { - throw new ArgumentNullException(nameof(fileOrDirectory)); - } - - if (appliedCommand.Arguments.Count == 0) - { - throw new GracefulException(CommonLocalizableStrings.SpecifyAtLeastOneReferenceToRemove); - } - - _appliedCommand = appliedCommand; - _fileOrDirectory = fileOrDirectory; - } - - public override int Execute() - { - var msbuildProj = MsbuildProject.FromFileOrDirectory(new ProjectCollection(), _fileOrDirectory); - - int numberOfRemovedReferences = msbuildProj.RemoveProjectToProjectReferences( - _appliedCommand.ValueOrDefault("framework"), - _appliedCommand.Arguments); - - if (numberOfRemovedReferences != 0) - { - msbuildProj.ProjectRootElement.Save(); - } - - return 0; - } - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/RemoveProjectToProjectReferenceParser.cs b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/RemoveProjectToProjectReferenceParser.cs deleted file mode 100644 index 9489c9643..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/RemoveProjectToProjectReferenceParser.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Tools; -using LocalizableStrings = Microsoft.DotNet.Tools.Remove.ProjectToProjectReference.LocalizableStrings; - -namespace Microsoft.DotNet.Cli -{ - internal static class RemoveProjectToProjectReferenceParser - { - public static Command RemoveReference() => - Create.Command( - "reference", - LocalizableStrings.AppFullName, - Accept - .OneOrMoreArguments() - .WithSuggestionsFrom(_ => Suggest.ProjectReferencesFromProjectFile()) - .With(name: "args", - description: LocalizableStrings.AppHelpText), - CommonOptions.HelpOption(), - Create.Option( - "-f|--framework", - LocalizableStrings.CmdFrameworkDescription, - Accept.ExactlyOneArgument() - .With(name: CommonLocalizableStrings.CmdFramework))); - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index 81225b528..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Project to Project reference Command - Příkaz rozhraní .NET pro odebrání odkazu mezi projekty - - - - Command to remove project to project reference - Příkaz pro odebrání odkazu mezi projekty - - - - Remove reference only when targeting a specific framework - Odebrat odkaz jen v případě, že cílem je konkrétní architektura - - - - Project to project references to remove - Odebírané odkazy mezi projekty - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index ad09ce620..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Project to Project reference Command - .NET-Befehl zum Entfernen von Projekt-zu-Projekt-Verweisen - - - - Command to remove project to project reference - Befehl zum Entfernen von Projekt-zu-Projekt-Verweisen - - - - Remove reference only when targeting a specific framework - Verweis nur bei Verwendung eines bestimmten Zielframeworks entfernen - - - - Project to project references to remove - Zu entfernende Interprojektverweise - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index 111f7d692..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Project to Project reference Command - Comando de .NET para quitar una referencia de proyecto a proyecto - - - - Command to remove project to project reference - Comando para quitar una referencia de proyecto a proyecto - - - - Remove reference only when targeting a specific framework - Quita una referencia solo cuando el destino es una plataforma específica - - - - Project to project references to remove - Referencias de proyecto a proyecto que se van a quitar - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index c463353f7..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Project to Project reference Command - Commande .NET Supprimer une référence projet à projet - - - - Command to remove project to project reference - Commande permettant de supprimer une référence projet à projet - - - - Remove reference only when targeting a specific framework - Supprimer une référence uniquement en cas de ciblage d'un framework spécifique - - - - Project to project references to remove - Références de projet à projet à supprimer - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index ec3d8fa06..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Project to Project reference Command - Comando Rimuovi riferimento P2P (da progetto a progetto) .NET - - - - Command to remove project to project reference - Comando per rimuovere il riferimento P2P (da progetto a progetto) - - - - Remove reference only when targeting a specific framework - Rimuove il riferimento solo se destinato a un framework specifico - - - - Project to project references to remove - Riferimenti P2P (da progetto a progetto) da rimuovere - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index 19400ef12..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Project to Project reference Command - .NET プロジェクト間参照を削除するコマンド - - - - Command to remove project to project reference - プロジェクト間参照を削除するコマンド - - - - Remove reference only when targeting a specific framework - 特定のフレームワークを対象とする場合にのみ参照を削除する - - - - Project to project references to remove - 削除するプロジェクト間参照 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index 9f4608b9b..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Project to Project reference Command - .NET 프로젝트 간 참조 제거 명령 - - - - Command to remove project to project reference - 프로젝트 간 참조를 제거하는 명령입니다. - - - - Remove reference only when targeting a specific framework - 특정 프레임워크를 대상으로 지정할 때에만 참조를 제거합니다. - - - - Project to project references to remove - 제거할 p2p(프로젝트 간) 참조입니다. - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index 662097076..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Project to Project reference Command - Polecenie usuwania odwołania między projektami dla platformy .NET - - - - Command to remove project to project reference - Polecenie służące do usuwania odwołania między projektami - - - - Remove reference only when targeting a specific framework - Usuń odwołanie tylko w przypadku określenia konkretnej platformy docelowej - - - - Project to project references to remove - Odwołania między projektami, które mają zostać usunięte - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index 69b73cf26..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Project to Project reference Command - Comando para remover a referência de projeto para projeto do .NET - - - - Command to remove project to project reference - Comando para remover a referência projeto para projeto - - - - Remove reference only when targeting a specific framework - Remover referência apenas ao definir uma estrutura específica como destino - - - - Project to project references to remove - Referências projeto a projeto a serem removidas - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index 191761cfb..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Project to Project reference Command - Команда .NET "Удалить ссылку из одного проекта на другой" - - - - Command to remove project to project reference - Эта команда удаляет ссылку из одного проекта на другой - - - - Remove reference only when targeting a specific framework - Удалять ссылку только при выборе конкретной целевой платформы - - - - Project to project references to remove - Удаляемые ссылки проекта на проект - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index 231faa35e..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Project to Project reference Command - .NET Projeden Projeye başvuruyu kaldır Komutu - - - - Command to remove project to project reference - Projeden projeye başvuruyu kaldırma komutu - - - - Remove reference only when targeting a specific framework - Yalnızca belirli bir çerçeveyi hedeflerken başvuruyu kaldırır - - - - Project to project references to remove - Kaldırılacak olan, projeden projeye başvurular - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.xlf deleted file mode 100644 index dfa4ae1fc..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - .NET Remove Project to Project reference Command - - - - Command to remove project to project reference - - - - Remove reference only when targeting a specific framework - - - - Project to project references to remove - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index 7650bb214..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Project to Project reference Command - .NET“删除项目到项目引用”命令 - - - - Command to remove project to project reference - 用于删除项目到项目引用的命令 - - - - Remove reference only when targeting a specific framework - 仅针对特定框架删除引用 - - - - Project to project references to remove - 要删除的项目到项目引用 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index ab74b0d6c..000000000 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-reference/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - .NET Remove Project to Project reference Command - .NET 移除專案對專案參考命令 - - - - Command to remove project to project reference - 用以移除專案對專案參考的命令 - - - - Remove reference only when targeting a specific framework - 只有在以特定架構為目標時才移除參考 - - - - Project to project references to remove - 要移除的專案對專案參考 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index 5af72e616..000000000 --- a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Remove Command - Příkaz rozhraní .NET pro odebrání - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index 42054b58d..000000000 --- a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Remove Command - .NET-Befehl "Remove" - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index 281281f25..000000000 --- a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Remove Command - Comando Remove de .NET - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index 20df2a73e..000000000 --- a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Remove Command - Commande de suppression .NET - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index 3e5522f66..000000000 --- a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Remove Command - Comando Rimuovi .NET - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index fd535e483..000000000 --- a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Remove Command - .NET Remove コマンド - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index 1c9c4c102..000000000 --- a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Remove Command - .NET 제거 명령 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index 1838c8b1d..000000000 --- a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Remove Command - Polecenie remove platformy .NET - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index e8c924e2c..000000000 --- a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Remove Command - Comando Remover do .NET - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index 5342cbb8f..000000000 --- a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Remove Command - Команда .NET "Удалить" - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index 7341a9a09..000000000 --- a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Remove Command - .NET Remove Komutu - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.xlf deleted file mode 100644 index e5fc72596..000000000 --- a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - .NET Remove Command - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index ec6be8d20..000000000 --- a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Remove Command - .NET 删除命令 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index e108ca889..000000000 --- a/src/dotnet/commands/dotnet-remove/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - .NET Remove Command - .NET 移除命令 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore-projectjson/NuGet3.cs b/src/dotnet/commands/dotnet-restore-projectjson/NuGet3.cs deleted file mode 100644 index 61bacc5fd..000000000 --- a/src/dotnet/commands/dotnet-restore-projectjson/NuGet3.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.DotNet.Tools.RestoreProjectJson -{ - internal static class NuGet3 - { - public static int Restore(IEnumerable args) - { - var prefixArgs = new List(); - if (!args.Any(s => s.Equals("--verbosity", StringComparison.OrdinalIgnoreCase) || s.Equals("-v", StringComparison.OrdinalIgnoreCase))) - { - prefixArgs.Add("--verbosity"); - prefixArgs.Add("minimal"); - } - prefixArgs.Add("restore"); - - var nugetApp = new NuGetForwardingApp(Enumerable.Concat(prefixArgs, args)); - - // setting NUGET_XPROJ_WRITE_TARGETS will tell nuget restore to install .props and .targets files - // coming from NuGet packages - const string nugetXProjWriteTargets = "NUGET_XPROJ_WRITE_TARGETS"; - bool setXProjWriteTargets = Environment.GetEnvironmentVariable(nugetXProjWriteTargets) == null; - if (setXProjWriteTargets) - { - nugetApp.WithEnvironmentVariable(nugetXProjWriteTargets, "true"); - } - - return nugetApp.Execute(); - } - } -} diff --git a/src/dotnet/commands/dotnet-restore-projectjson/Program.cs b/src/dotnet/commands/dotnet-restore-projectjson/Program.cs deleted file mode 100644 index 99fcf0998..000000000 --- a/src/dotnet/commands/dotnet-restore-projectjson/Program.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.InternalAbstractions; - -namespace Microsoft.DotNet.Tools.RestoreProjectJson -{ - public partial class RestoreProjectJsonCommand - { - public static int Run(string[] args) - { - DebugHelper.HandleDebugSwitch(ref args); - - return NuGet3.Restore(args); - } - } -} diff --git a/src/dotnet/commands/dotnet-restore-projectjson/README.md b/src/dotnet/commands/dotnet-restore-projectjson/README.md deleted file mode 100644 index 629697ae7..000000000 --- a/src/dotnet/commands/dotnet-restore-projectjson/README.md +++ /dev/null @@ -1,80 +0,0 @@ -% DOTNET-RESTORE(1) -% Microsoft Corporation dotnetclifeedback@microsoft.com -% June 2016 - -## NAME - -`dotnet-restore` - Restores the dependencies and tools of a project - -## SYNOPSIS - -`dotnet restore [--source] - [--packages] [--disable-parallel] - [--fallbacksource] [--configfile] [--verbosity] - []` - -## DESCRIPTION - -The `dotnet restore` command uses NuGet to restore dependencies as well as project-specific tools that are specified in the project.json file. -By default, the restoration of dependencies and tools are done in parallel. - -In order to restore the dependencies, NuGet needs the feeds where the packages are located. -Feeds are usually provided via the NuGet.config configuration file; a default one is present when the CLI tools are installed. -You can specify more feeds by creating your own NuGet.config file in the project directory. -Feeds can also be specified per invocation on the command line. - -For dependencies, you can specify where the restored packages are placed during the restore operation using the -`--packages` argument. -If not specified, the default NuGet package cache is used. -It is found in the `.nuget/packages` directory in the user's home directory on all operating systems (for example, `/home/user1` on Linux or `C:\Users\user1` on Windows). - -For project-specific tooling, `dotnet restore` first restores the package in which the tool is packed, and then -proceeds to restore the tool's dependencies as specified in its project.json. - -## OPTIONS - -`[root]` - - A list of projects or project folders to restore. The list can contain either a path to a `project.json` file, or a path to `global.json` file or folder. The restore operation runs recursively for all subdirectories and restores for each given project.json file it finds. - -`-s`, `--source` [SOURCE] - -Specifies a source to use during the restore operation. This overrides all of the sources specified in the NuGet.config file(s). - -`--packages` [DIR] - -Specifies the directory to place the restored packages in. - -`--disable-parallel` - -Disables restoring multiple projects in parallel. - -`-f`, `--fallbacksource` [FEED] - -Specifies a fallback source that will be used in the restore operation if all other sources fail. All valid feed formats are allowed. - -`--configfile` [FILE] - -Configuration file (NuGet.config) to use for the restore operation. - -`--verbosity` [LEVEL] - -The verbosity of logging to use. Allowed values: Debug, Verbose, Information, Minimal, Warning, or Error. - -## EXAMPLES - -`dotnet restore` - -Restores dependencies and tools for the project in the current directory. - -`dotnet restore ~/projects/app1/project.json` - -Restores dependencies and tools for the `app1` project found in the given path. - -`dotnet restore --f c:\packages\mypackages` - -Restores the dependencies and tools for the project in the current directory using the file path provided as the fallback source. - -`dotnet restore --verbosity Error` - -Restores dependencies and tools for the project in the current directory and shows only errors in the output. diff --git a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.cs.xlf deleted file mode 100644 index 62aa691c1..000000000 --- a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.cs.xlf +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - minimal - minimální - - - - restore - obnovit - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.de.xlf deleted file mode 100644 index 7b5f03bd1..000000000 --- a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.de.xlf +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - minimal - minimal - - - - restore - restore - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.es.xlf deleted file mode 100644 index 17a6ff691..000000000 --- a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.es.xlf +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - minimal - mínimo - - - - restore - restore - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.fr.xlf deleted file mode 100644 index 443cc749e..000000000 --- a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.fr.xlf +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - minimal - minimal - - - - restore - restaurer - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.it.xlf deleted file mode 100644 index 7606617c8..000000000 --- a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.it.xlf +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - minimal - minimal - - - - restore - restore - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.ja.xlf deleted file mode 100644 index 62d277f20..000000000 --- a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.ja.xlf +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - minimal - 最小 - - - - restore - 復元 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.ko.xlf deleted file mode 100644 index f85a95db9..000000000 --- a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.ko.xlf +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - minimal - minimal - - - - restore - restore - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.pl.xlf deleted file mode 100644 index fc5ecde00..000000000 --- a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.pl.xlf +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - minimal - minimalne - - - - restore - przywracanie - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.pt-BR.xlf deleted file mode 100644 index d7dbf6691..000000000 --- a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.pt-BR.xlf +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - minimal - mínimo - - - - restore - restauração - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.ru.xlf deleted file mode 100644 index eebe8a7b3..000000000 --- a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.ru.xlf +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - minimal - minimal - - - - restore - restore - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.tr.xlf deleted file mode 100644 index 9b3996076..000000000 --- a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.tr.xlf +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - minimal - minimal - - - - restore - restore - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.xlf deleted file mode 100644 index 43b41d3d7..000000000 --- a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.xlf +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - minimal - - - - restore - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.zh-Hans.xlf deleted file mode 100644 index a94e21bf3..000000000 --- a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.zh-Hans.xlf +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - minimal - 最少 - - - - restore - 还原 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.zh-Hant.xlf deleted file mode 100644 index 923def7c5..000000000 --- a/src/dotnet/commands/dotnet-restore-projectjson/xlf/LocalizableStrings.zh-Hant.xlf +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - minimal - 最小 - - - - restore - 還原 - - - - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore/LocalizableStrings.resx b/src/dotnet/commands/dotnet-restore/LocalizableStrings.resx deleted file mode 100644 index 877cfa218..000000000 --- a/src/dotnet/commands/dotnet-restore/LocalizableStrings.resx +++ /dev/null @@ -1,171 +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 - - - .NET dependency restorer - - - restore for msbuild - - - PROJECT - - - Optional path to a project file or MSBuild arguments. - - - SOURCE - - - Specifies a NuGet package source to use during the restore. - - - RUNTIME_IDENTIFIER - - - Target runtime to restore packages for. - - - PACKAGES_DIRECTORY - - - Directory to install packages in. - - - Disables restoring multiple projects in parallel. - - - FILE - - - The NuGet configuration file to use. - - - Do not cache packages and http requests. - - - Treat package source failures as warnings. - - - Set this flag to ignore project to project references and only restore the root project. - - - Set this flag to force all dependencies to be resolved even if the last restore was successful. This is equivalent to deleting project.assets.json. - - \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore/Program.cs b/src/dotnet/commands/dotnet-restore/Program.cs deleted file mode 100644 index b0269370f..000000000 --- a/src/dotnet/commands/dotnet-restore/Program.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Tools.MSBuild; -using Microsoft.DotNet.Cli; -using Parser = Microsoft.DotNet.Cli.Parser; - -namespace Microsoft.DotNet.Tools.Restore -{ - public class RestoreCommand : MSBuildForwardingApp - { - public RestoreCommand(IEnumerable msbuildArgs, string msbuildPath = null) - : base(msbuildArgs, msbuildPath) - { - } - - public static RestoreCommand FromArgs(string[] args, string msbuildPath = null) - { - DebugHelper.HandleDebugSwitch(ref args); - - var parser = Parser.Instance; - - var result = parser.ParseFrom("dotnet restore", args); - - result.ShowHelpOrErrorIfAppropriate(); - - var parsedRestore = result["dotnet"]["restore"]; - - var msbuildArgs = new List - { - "/NoLogo", - "/t:Restore" - }; - - if (!HasVerbosityOption(parsedRestore)) - { - msbuildArgs.Add("/ConsoleLoggerParameters:Verbosity=Minimal"); - } - - msbuildArgs.AddRange(parsedRestore.OptionValuesToBeForwarded()); - - msbuildArgs.AddRange(parsedRestore.Arguments); - - return new RestoreCommand(msbuildArgs, msbuildPath); - } - - public static int Run(string[] args) - { - DebugHelper.HandleDebugSwitch(ref args); - - RestoreCommand cmd; - try - { - cmd = FromArgs(args); - } - catch (CommandCreationException e) - { - return e.ExitCode; - } - - return cmd.Execute(); - } - - private static bool HasVerbosityOption(AppliedOption parsedRestore) - { - return parsedRestore.HasOption("verbosity") || - parsedRestore.Arguments.Any(a => a.Contains("/v:")) || - parsedRestore.Arguments.Any(a => a.Contains("/verbosity:")); - } - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-restore/RestoreCommandParser.cs b/src/dotnet/commands/dotnet-restore/RestoreCommandParser.cs deleted file mode 100644 index 46b17d0f3..000000000 --- a/src/dotnet/commands/dotnet-restore/RestoreCommandParser.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; -using LocalizableStrings = Microsoft.DotNet.Tools.Restore.LocalizableStrings; - -namespace Microsoft.DotNet.Cli -{ - internal static class RestoreCommandParser - { - public static Command Restore() => - Create.Command( - "restore", - LocalizableStrings.AppFullName, - Accept.ZeroOrMoreArguments(), - FullRestoreOptions()); - - private static Option[] FullRestoreOptions() - { - var fullRestoreOptions = AddImplicitRestoreOptions(new Option[] { CommonOptions.HelpOption() }, true, true); - - return fullRestoreOptions.Concat(new Option[] { CommonOptions.VerbosityOption() }).ToArray(); - } - - public static Option[] AddImplicitRestoreOptions( - IEnumerable diff --git a/test/EndToEnd/GivenDotNetUsesMSBuild.cs b/test/EndToEnd/GivenDotNetUsesMSBuild.cs index f714ee38c..724ffb378 100644 --- a/test/EndToEnd/GivenDotNetUsesMSBuild.cs +++ b/test/EndToEnd/GivenDotNetUsesMSBuild.cs @@ -109,7 +109,7 @@ namespace Microsoft.DotNet.Tests.EndToEnd .Should() .Pass(); - new DotnetCommand(DotnetUnderTest.WithBackwardsCompatibleRuntimes) + new DotnetCommand() .WithWorkingDirectory(testProjectDirectory) .ExecuteWithCapturedOutput( $"-d dependency-tool-invoker -c {configuration} -f netcoreapp2.0 portable") diff --git a/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/InstallFixture.cs b/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/InstallFixture.cs deleted file mode 100644 index e8153080c..000000000 --- a/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/InstallFixture.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 Xunit; - -namespace Dotnet.Cli.Msi.Tests -{ - public class InstallFixture : IDisposable - { - private MsiManager _msiMgr = null; - - // all the tests assume that the msi to be tested is available via environment variable %CLI_MSI% - - public InstallFixture() - { - string msiFile = Environment.GetEnvironmentVariable("CLI_MSI"); - if(string.IsNullOrEmpty(msiFile)) - { - throw new InvalidOperationException("%CLI_MSI% must point to the msi that is to be tested"); - } - - _msiMgr = new MsiManager(msiFile); - - // make sure that the msi is not already installed, if so the machine is in a bad state - Assert.False(_msiMgr.IsInstalled, "The dotnet CLI msi is already installed"); - - _msiMgr.Install(InstallLocation); - Assert.True(_msiMgr.IsInstalled); - } - - public MsiManager MsiManager - { - get - { - return _msiMgr; - } - } - - public string InstallLocation - { - get - { - return Environment.ExpandEnvironmentVariables(@"%SystemDrive%\dotnet\"); - } - } - - public void Dispose() - { - if (!_msiMgr.IsInstalled) - { - return; - } - - _msiMgr.UnInstall(); - Assert.False(_msiMgr.IsInstalled, "Unable to cleanup by uninstalling dotnet"); - } - } -} diff --git a/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/InstallationTests.cs b/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/InstallationTests.cs deleted file mode 100644 index 57333b901..000000000 --- a/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/InstallationTests.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using Xunit; - -[assembly: CollectionBehavior(DisableTestParallelization = true)] - -namespace Dotnet.Cli.Msi.Tests -{ - public class InstallationTests : IDisposable - { - private MsiManager _msiMgr; - - public InstallationTests() - { - // all the tests assume that the msi to be tested is available via environment variable %CLI_MSI% - var msiFile = Environment.GetEnvironmentVariable("CLI_MSI"); - if(string.IsNullOrEmpty(msiFile)) - { - throw new InvalidOperationException("%CLI_MSI% must point to the msi that is to be tested"); - } - - _msiMgr = new MsiManager(msiFile); - } - - [Fact] - public void InstallTest() - { - string expectedInstallLocation = Environment.ExpandEnvironmentVariables(@"%ProgramFiles%\dotnet"); - - // make sure that the msi is not already installed, if so the machine is in a bad state - Assert.False(_msiMgr.IsInstalled, "The dotnet CLI msi is already installed"); - Assert.False(Directory.Exists(expectedInstallLocation)); - - _msiMgr.Install(); - Assert.True(_msiMgr.IsInstalled); - Assert.True(Directory.Exists(expectedInstallLocation)); - - _msiMgr.UnInstall(); - Assert.False(_msiMgr.IsInstalled); - Assert.False(Directory.Exists(expectedInstallLocation)); - } - - public void Dispose() - { - if (!_msiMgr.IsInstalled) - { - return; - } - - _msiMgr.UnInstall(); - Assert.False(_msiMgr.IsInstalled, "Unable to cleanup by uninstalling dotnet"); - } - } -} 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 deleted file mode 100644 index 17220aaf1..000000000 --- a/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/Microsoft.DotNet.Cli.Msi.Tests.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - net46 - true - Microsoft.DotNet.Cli.Msi.Tests - false - false - false - false - false - false - false - false - - - - - - - - - - - - - - - diff --git a/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/MsiManager.cs b/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/MsiManager.cs deleted file mode 100644 index 15ae4b707..000000000 --- a/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/MsiManager.cs +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) .NET 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.Deployment.WindowsInstaller; -using Microsoft.Deployment.WindowsInstaller.Package; - -namespace Dotnet.Cli.Msi.Tests -{ - public class MsiManager - { - private string _bundleFile; - private string _msiFile; - private string _productCode; - private InstallPackage _installPackage; - - public ProductInstallation Installation - { - get - { - return ProductInstallation.AllProducts.SingleOrDefault(p => p.ProductCode == _productCode); - } - } - - public string InstallLocation - { - get - { - return IsInstalled ? Installation.InstallLocation : null; - } - } - - public bool IsInstalled - { - get - { - var prodInstall = Installation; - return Installation == null ? false : prodInstall.IsInstalled; - } - } - - public string UpgradeCode - { - get - { - return _installPackage.Property["UpgradeCode"]; - } - } - - public MsiManager(string msiFile) - { - _bundleFile = Path.ChangeExtension(msiFile, "exe"); - _msiFile = msiFile; - - var ispackage = Installer.VerifyPackage(msiFile); - if (!ispackage) - { - throw new ArgumentException("Not a valid MSI file", msiFile); - } - - _installPackage = new InstallPackage(msiFile, DatabaseOpenMode.ReadOnly); - _productCode = _installPackage.Property["ProductCode"]; - } - - public bool Install(string customLocation = null) - { - string dotnetHome = ""; - if (!string.IsNullOrEmpty(customLocation)) - { - dotnetHome = $"DOTNETHOME={customLocation}"; - } - - RunBundle(dotnetHome); - - return IsInstalled; - } - - public bool UnInstall() - { - if (!IsInstalled) - { - throw new InvalidOperationException($"UnInstall Error: Msi at {_msiFile} is not installed."); - } - - RunBundle("/uninstall"); - - return !IsInstalled; - } - - private void RunBundle(string additionalArguments) - { - var arguments = $"/q /norestart {additionalArguments}"; - var process = Process.Start(_bundleFile, arguments); - - if (!process.WaitForExit(5 * 60 * 1000)) - { - throw new InvalidOperationException($"Failed to wait for the installation operation to complete. Check to see if the installation process is still running. Command line: {_bundleFile} {arguments}"); - } - - else if (0 != process.ExitCode) - { - throw new InvalidOperationException($"The installation operation failed with exit code: {process.ExitCode}. Command line: {_bundleFile} {arguments}"); - } - } - } -} diff --git a/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/PostInstallTests.cs b/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/PostInstallTests.cs deleted file mode 100644 index 604653b68..000000000 --- a/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/PostInstallTests.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.Win32; -using Xunit; - -namespace Dotnet.Cli.Msi.Tests -{ - public class PostInstallTests : IClassFixture - { - InstallFixture _fixture; - MsiManager _msiMgr; - - public PostInstallTests(InstallFixture fixture) - { - _fixture = fixture; - _msiMgr = fixture.MsiManager; - } - - [Fact] - public void DotnetOnPathTest() - { - Assert.True(_msiMgr.IsInstalled); - - Assert.True(Utils.ExistsOnPath("dotnet.exe"), "After installation dotnet tools must be on path"); - } - - [Fact] - public void Dotnetx64RegKeysTest() - { - var hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64); - CheckRegKeys(hklm); - } - - [Fact] - public void Dotnetx86RegKeysTest() - { - var hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32); - CheckRegKeys(hklm); - } - - private void CheckRegKeys(RegistryKey rootKey) - { - var regKey = rootKey.OpenSubKey(@"SOFTWARE\dotnet\Setup", false); - - Assert.NotNull(regKey); - Assert.Equal(1, regKey.GetValue("Install")); - Assert.Equal(_fixture.InstallLocation, regKey.GetValue("InstallDir")); - Assert.NotNull(regKey.GetValue("Version")); - } - } -} diff --git a/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/PostUninstallTests.cs b/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/PostUninstallTests.cs deleted file mode 100644 index 2c5957f1e..000000000 --- a/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/PostUninstallTests.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.Win32; -using Xunit; - -namespace Dotnet.Cli.Msi.Tests -{ - public class PostUninstallTests : InstallFixture - { - private MsiManager _msiMgr; - - public PostUninstallTests() - { - _msiMgr = base.MsiManager; - } - - [Fact] - public void DotnetOnPathTest() - { - Assert.True(_msiMgr.IsInstalled); - - _msiMgr.UnInstall(); - - Assert.False(_msiMgr.IsInstalled); - Assert.False(Utils.ExistsOnPath("dotnet.exe"), "After uninstallation dotnet tools must not be on path"); - } - - [Fact(Skip = "https://github.com/dotnet/cli/issues/2073")] - public void DotnetRegKeysTest() - { - Assert.True(_msiMgr.IsInstalled); - - _msiMgr.UnInstall(); - - Assert.False(_msiMgr.IsInstalled); - - var hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64); - Assert.Null(hklm.OpenSubKey(@"SOFTWARE\dotnet\Setup", false)); - - hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32); - Assert.Null(hklm.OpenSubKey(@"SOFTWARE\dotnet\Setup", false)); - } - } -} diff --git a/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/Properties/AssemblyInfo.cs b/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 801ed17c2..000000000 --- a/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Microsoft.DotNet.Cli.Msi.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Microsoft.DotNet.Cli.Msi.Tests")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("16614b7f-5ca3-45ae-95c2-003ab39cc09f")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/Utils.cs b/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/Utils.cs deleted file mode 100644 index 8a11be0ef..000000000 --- a/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/Utils.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.IO; -using System.Linq; -using Microsoft.Win32; - -namespace Dotnet.Cli.Msi.Tests -{ - class Utils - { - internal static bool ExistsOnPath(string fileName) - { - var paths = GetCurrentPathEnvironmentVariable(); - return paths - .Split(';') - .Any(path => File.Exists(Path.Combine(path, fileName))); - } - - internal static string GetCurrentPathEnvironmentVariable() - { - var hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32); - var regKey = hklm.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Session Manager\Environment", false); - - return (string)regKey.GetValue("Path"); - } - } -} diff --git a/test/Installer/testmsi.ps1 b/test/Installer/testmsi.ps1 deleted file mode 100644 index 47db57c58..000000000 --- a/test/Installer/testmsi.ps1 +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright (c) .NET Foundation and contributors. All rights reserved. -# Licensed under the MIT license. See LICENSE file in the project root for full license information. - -param( - [string]$InputMsi, - [string]$DotnetDir, - [string]$TestDir -) - -. "$PSScriptRoot\..\..\scripts\common\_common.ps1" - -$RepoRoot = Convert-Path "$PSScriptRoot\..\.." - -function CopyInstaller([string]$destination) -{ - # Copy both the .msi and the .exe to the testBin directory so - # the tests running in the docker container have access to them. - Copy-Item $inputMsi -Destination:$destination - - $BundlePath = [System.IO.Path]::ChangeExtension($inputMsi, "exe") - Copy-Item $BundlePath -Destination:$destination -} - -function CopyTestXUnitRunner([string]$destination) -{ - $XUnitRunnerDir = Join-Path $env:NUGET_PACKAGES xunit.runner.console\2.1.0\tools - - Copy-Item $XUnitRunnerDir\xunit.console.exe -Destination:$destination - Copy-Item $XUnitRunnerDir\xunit.runner.utility.desktop.dll -Destination:$destination -} - -Write-Output "Running tests for MSI installer at $inputMsi." - -if(!(Test-Path $inputMsi)) -{ - throw "$inputMsi not found" -} - -$testName = "Microsoft.DotNet.Cli.Msi.Tests" -$testProj="$PSScriptRoot\$testName\$testName.csproj" -$testBin="$TestDir\$testName" - -pushd "$DotnetDir" - -try { - .\dotnet restore ` - $testProj | Out-Host - - if($LastExitCode -ne 0) - { - throw "dotnet restore failed with exit code $LastExitCode." - } - - .\dotnet publish ` - --framework net46 ` - --output $testBin ` - $testProj | Out-Host - - if($LastExitCode -ne 0) - { - throw "dotnet publish failed with exit code $LastExitCode." - } - - if($env:RunInstallerTestsInDocker) - { - CopyInstaller $testBin - CopyTestXUnitRunner $testBin - - Write-Output "Running installer tests in Windows Container" - - # --net="none" works around a networking issue on the containers on the CI machines. - # Since our installer tests don't require the network, it is fine to shut it off. - $MsiFileName = [System.IO.Path]::GetFileName($inputMsi) - docker run ` - --rm ` - -v "$testBin\:D:" ` - -e "CLI_MSI=D:\$MsiFileName" ` - --net="none" ` - windowsservercore ` - D:\xunit.console.exe D:\$testName.dll | Out-Host - - if($LastExitCode -ne 0) - { - throw "xunit runner failed with exit code $LastExitCode." - } - } -} -finally { - popd -} - -Exit 0 diff --git a/test/Microsoft.DotNet.Cli.Sln.Internal.Tests/Microsoft.DotNet.Cli.Sln.Internal.Tests.cs b/test/Microsoft.DotNet.Cli.Sln.Internal.Tests/Microsoft.DotNet.Cli.Sln.Internal.Tests.cs deleted file mode 100644 index ca1241bbd..000000000 --- a/test/Microsoft.DotNet.Cli.Sln.Internal.Tests/Microsoft.DotNet.Cli.Sln.Internal.Tests.cs +++ /dev/null @@ -1,510 +0,0 @@ -// Copyright (c) .NET 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 Xunit; -using Microsoft.DotNet.Cli.Sln.Internal; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; - -namespace Microsoft.DotNet.Cli.Sln.Internal.Tests -{ - public class GivenAnSlnFile : TestBase - { - private const string SolutionModified = @" -Microsoft Visual Studio Solution File, Format Version 14.00 -# Visual Studio 16 -VisualStudioVersion = 16.0.26006.2 -MinimumVisualStudioVersion = 11.0.40219.1 -Project(""{7072A694-548F-4CAE-A58F-12D257D5F486}"") = ""AppModified"", ""AppModified\AppModified.csproj"", ""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = TRUE - EndGlobalSection -EndGlobal -"; - - private const string SolutionWithAppAndLibProjects = @" -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""App"", ""App\App.csproj"", ""{7072A694-548F-4CAE-A58F-12D257D5F486}"" -EndProject -Project(""{13B669BE-BB05-4DDF-9536-439F39A36129}"") = ""Lib"", ""..\Lib\Lib.csproj"", ""{21D9159F-60E6-4F65-BC6B-D01B71B15FFC}"" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86 - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Debug|x64.ActiveCfg = Debug|x64 - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Debug|x64.Build.0 = Debug|x64 - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Debug|x86.ActiveCfg = Debug|x86 - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Debug|x86.Build.0 = Debug|x86 - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Release|Any CPU.Build.0 = Release|Any CPU - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Release|x64.ActiveCfg = Release|x64 - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Release|x64.Build.0 = Release|x64 - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Release|x86.ActiveCfg = Release|x86 - {21D9159F-60E6-4F65-BC6B-D01B71B15FFC}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal -"; - - [Fact] - public void WhenGivenAValidSlnFileItReadsAndVerifiesContents() - { - var tmpFile = Temp.CreateFile(); - tmpFile.WriteAllText(SolutionWithAppAndLibProjects); - - SlnFile slnFile = SlnFile.Read(tmpFile.Path); - - Console.WriteLine(new - { - slnFile_FormatVersion = slnFile.FormatVersion, - slnFile_ProductDescription = slnFile.ProductDescription, - slnFile_VisualStudioVersion = slnFile.VisualStudioVersion, - slnFile_MinimumVisualStudioVersion = slnFile.MinimumVisualStudioVersion, - slnFile_BaseDirectory = slnFile.BaseDirectory, - slnFile_FullPath = slnFile.FullPath, - tmpFilePath = tmpFile.Path - }.ToString()); - - slnFile.FormatVersion.Should().Be("12.00"); - slnFile.ProductDescription.Should().Be("Visual Studio 15"); - slnFile.VisualStudioVersion.Should().Be("15.0.26006.2"); - slnFile.MinimumVisualStudioVersion.Should().Be("10.0.40219.1"); - slnFile.BaseDirectory.Should().Be(Path.GetDirectoryName(tmpFile.Path)); - slnFile.FullPath.Should().Be(Path.GetFullPath(tmpFile.Path)); - - slnFile.Projects.Count.Should().Be(2); - var project = slnFile.Projects[0]; - project.Id.Should().Be("{7072A694-548F-4CAE-A58F-12D257D5F486}"); - project.TypeGuid.Should().Be("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"); - project.Name.Should().Be("App"); - project.FilePath.Should().Be(Path.Combine("App", "App.csproj")); - project = slnFile.Projects[1]; - project.Id.Should().Be("{21D9159F-60E6-4F65-BC6B-D01B71B15FFC}"); - project.TypeGuid.Should().Be("{13B669BE-BB05-4DDF-9536-439F39A36129}"); - project.Name.Should().Be("Lib"); - project.FilePath.Should().Be(Path.Combine("..", "Lib", "Lib.csproj")); - - slnFile.SolutionConfigurationsSection.Count.Should().Be(6); - slnFile.SolutionConfigurationsSection - .GetValue("Debug|Any CPU", string.Empty) - .Should().Be("Debug|Any CPU"); - slnFile.SolutionConfigurationsSection - .GetValue("Debug|x64", string.Empty) - .Should().Be("Debug|x64"); - slnFile.SolutionConfigurationsSection - .GetValue("Debug|x86", string.Empty) - .Should().Be("Debug|x86"); - slnFile.SolutionConfigurationsSection - .GetValue("Release|Any CPU", string.Empty) - .Should().Be("Release|Any CPU"); - slnFile.SolutionConfigurationsSection - .GetValue("Release|x64", string.Empty) - .Should().Be("Release|x64"); - slnFile.SolutionConfigurationsSection - .GetValue("Release|x86", string.Empty) - .Should().Be("Release|x86"); - - slnFile.ProjectConfigurationsSection.Count.Should().Be(2); - var projectConfigSection = slnFile - .ProjectConfigurationsSection - .GetPropertySet("{7072A694-548F-4CAE-A58F-12D257D5F486}"); - projectConfigSection.Count.Should().Be(12); - projectConfigSection - .GetValue("Debug|Any CPU.ActiveCfg", string.Empty) - .Should().Be("Debug|Any CPU"); - projectConfigSection - .GetValue("Debug|Any CPU.Build.0", string.Empty) - .Should().Be("Debug|Any CPU"); - projectConfigSection - .GetValue("Debug|x64.ActiveCfg", string.Empty) - .Should().Be("Debug|x64"); - projectConfigSection - .GetValue("Debug|x64.Build.0", string.Empty) - .Should().Be("Debug|x64"); - projectConfigSection - .GetValue("Debug|x86.ActiveCfg", string.Empty) - .Should().Be("Debug|x86"); - projectConfigSection - .GetValue("Debug|x86.Build.0", string.Empty) - .Should().Be("Debug|x86"); - projectConfigSection - .GetValue("Release|Any CPU.ActiveCfg", string.Empty) - .Should().Be("Release|Any CPU"); - projectConfigSection - .GetValue("Release|Any CPU.Build.0", string.Empty) - .Should().Be("Release|Any CPU"); - projectConfigSection - .GetValue("Release|x64.ActiveCfg", string.Empty) - .Should().Be("Release|x64"); - projectConfigSection - .GetValue("Release|x64.Build.0", string.Empty) - .Should().Be("Release|x64"); - projectConfigSection - .GetValue("Release|x86.ActiveCfg", string.Empty) - .Should().Be("Release|x86"); - projectConfigSection - .GetValue("Release|x86.Build.0", string.Empty) - .Should().Be("Release|x86"); - projectConfigSection = slnFile - .ProjectConfigurationsSection - .GetPropertySet("{21D9159F-60E6-4F65-BC6B-D01B71B15FFC}"); - projectConfigSection.Count.Should().Be(12); - projectConfigSection - .GetValue("Debug|Any CPU.ActiveCfg", string.Empty) - .Should().Be("Debug|Any CPU"); - projectConfigSection - .GetValue("Debug|Any CPU.Build.0", string.Empty) - .Should().Be("Debug|Any CPU"); - projectConfigSection - .GetValue("Debug|x64.ActiveCfg", string.Empty) - .Should().Be("Debug|x64"); - projectConfigSection - .GetValue("Debug|x64.Build.0", string.Empty) - .Should().Be("Debug|x64"); - projectConfigSection - .GetValue("Debug|x86.ActiveCfg", string.Empty) - .Should().Be("Debug|x86"); - projectConfigSection - .GetValue("Debug|x86.Build.0", string.Empty) - .Should().Be("Debug|x86"); - projectConfigSection - .GetValue("Release|Any CPU.ActiveCfg", string.Empty) - .Should().Be("Release|Any CPU"); - projectConfigSection - .GetValue("Release|Any CPU.Build.0", string.Empty) - .Should().Be("Release|Any CPU"); - projectConfigSection - .GetValue("Release|x64.ActiveCfg", string.Empty) - .Should().Be("Release|x64"); - projectConfigSection - .GetValue("Release|x64.Build.0", string.Empty) - .Should().Be("Release|x64"); - projectConfigSection - .GetValue("Release|x86.ActiveCfg", string.Empty) - .Should().Be("Release|x86"); - projectConfigSection - .GetValue("Release|x86.Build.0", string.Empty) - .Should().Be("Release|x86"); - - slnFile.Sections.Count.Should().Be(3); - var solutionPropertiesSection = slnFile.Sections.GetSection("SolutionProperties"); - solutionPropertiesSection.Properties.Count.Should().Be(1); - solutionPropertiesSection.Properties - .GetValue("HideSolutionNode", string.Empty) - .Should().Be("FALSE"); - } - - [Fact] - public void WhenGivenAValidSlnFileItModifiesSavesAndVerifiesContents() - { - var tmpFile = Temp.CreateFile(); - tmpFile.WriteAllText(SolutionWithAppAndLibProjects); - - SlnFile slnFile = SlnFile.Read(tmpFile.Path); - - slnFile.FormatVersion = "14.00"; - slnFile.ProductDescription = "Visual Studio 16"; - slnFile.VisualStudioVersion = "16.0.26006.2"; - slnFile.MinimumVisualStudioVersion = "11.0.40219.1"; - - slnFile.Projects.Count.Should().Be(2); - var project = slnFile.Projects[0]; - project.Id = "{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"; - project.TypeGuid = "{7072A694-548F-4CAE-A58F-12D257D5F486}"; - project.Name = "AppModified"; - project.FilePath = Path.Combine("AppModified", "AppModified.csproj"); - slnFile.Projects.Remove(slnFile.Projects[1]); - - slnFile.SolutionConfigurationsSection.Count.Should().Be(6); - slnFile.SolutionConfigurationsSection.Remove("Release|Any CPU"); - slnFile.SolutionConfigurationsSection.Remove("Release|x64"); - slnFile.SolutionConfigurationsSection.Remove("Release|x86"); - - slnFile.ProjectConfigurationsSection.Count.Should().Be(2); - var projectConfigSection = slnFile - .ProjectConfigurationsSection - .GetPropertySet("{21D9159F-60E6-4F65-BC6B-D01B71B15FFC}"); - slnFile.ProjectConfigurationsSection.Remove(projectConfigSection); - - slnFile.Sections.Count.Should().Be(3); - var solutionPropertiesSection = slnFile.Sections.GetSection("SolutionProperties"); - solutionPropertiesSection.Properties.Count.Should().Be(1); - solutionPropertiesSection.Properties.SetValue("HideSolutionNode", "TRUE"); - - slnFile.Write(); - - File.ReadAllText(tmpFile.Path) - .Should().Be(SolutionModified); - } - - [Theory] - [InlineData("Microsoft Visual Studio Solution File, Format Version ", 1)] - [InlineData("First Line\nMicrosoft Visual Studio Solution File, Format Version ", 2)] - [InlineData("First Line\nMicrosoft Visual Studio Solution File, Format Version \nThird Line", 2)] - [InlineData("First Line\nSecondLine\nMicrosoft Visual Studio Solution File, Format Version \nFourth Line", 3)] - public void WhenGivenASolutionWithMissingHeaderVersionItThrows(string fileContents, int lineNum) - { - var tmpFile = Temp.CreateFile(); - tmpFile.WriteAllText(fileContents); - - Action action = () => - { - SlnFile.Read(tmpFile.Path); - }; - - action.ShouldThrow() - .WithMessage(FormatError(lineNum, LocalizableStrings.FileHeaderMissingVersionError)); - } - - [Theory] - [InlineData("Invalid Solution")] - [InlineData("Invalid Solution\nSpanning Multiple Lines")] - [InlineData("Microsoft Visual\nStudio Solution File,\nFormat Version ")] - public void WhenGivenASolutionWithMissingHeaderItThrows(string fileContents) - { - var tmpFile = Temp.CreateFile(); - tmpFile.WriteAllText(fileContents); - - Action action = () => - { - SlnFile.Read(tmpFile.Path); - }; - - action.ShouldThrow() - .WithMessage(LocalizableStrings.FileHeaderMissingError); - } - - [Fact] - public void WhenGivenASolutionWithMultipleGlobalSectionsItThrows() - { - const string SolutionFile = @" -Microsoft Visual Studio Solution File, Format Version 12.00 -Global -EndGlobal -Global -EndGlobal -"; - var tmpFile = Temp.CreateFile(); - tmpFile.WriteAllText(SolutionFile); - - Action action = () => - { - SlnFile.Read(tmpFile.Path); - }; - - action.ShouldThrow() - .WithMessage(FormatError(5, LocalizableStrings.GlobalSectionMoreThanOnceError)); - } - - [Fact] - public void WhenGivenASolutionWithGlobalSectionNotClosedItThrows() - { - const string SolutionFile = @" -Microsoft Visual Studio Solution File, Format Version 12.00 -Global -"; - var tmpFile = Temp.CreateFile(); - tmpFile.WriteAllText(SolutionFile); - - Action action = () => - { - SlnFile.Read(tmpFile.Path); - }; - - action.ShouldThrow() - .WithMessage(FormatError(3, LocalizableStrings.GlobalSectionNotClosedError)); - } - - [Fact] - public void WhenGivenASolutionWithProjectSectionNotClosedItThrows() - { - const string SolutionFile = @" -Microsoft Visual Studio Solution File, Format Version 12.00 -Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""App"", ""App\App.csproj"", ""{7072A694-548F-4CAE-A58F-12D257D5F486}"" -"; - var tmpFile = Temp.CreateFile(); - tmpFile.WriteAllText(SolutionFile); - - Action action = () => - { - SlnFile.Read(tmpFile.Path); - }; - - action.ShouldThrow() - .WithMessage(FormatError(3, LocalizableStrings.ProjectSectionNotClosedError)); - } - - [Fact] - public void WhenGivenASolutionWithInvalidProjectSectionItThrows() - { - const string SolutionFile = @" -Microsoft Visual Studio Solution File, Format Version 12.00 -Project""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""App"", ""App\App.csproj"", ""{7072A694-548F-4CAE-A58F-12D257D5F486}"" -EndProject -"; - - var tmpFile = Temp.CreateFile(); - tmpFile.WriteAllText(SolutionFile); - - Action action = () => - { - SlnFile.Read(tmpFile.Path); - }; - - action.ShouldThrow() - .WithMessage(FormatError(3, LocalizableStrings.ProjectParsingErrorFormatString, "(", 0)); - } - - [Fact] - public void WhenGivenASolutionWithInvalidSectionTypeItThrows() - { - const string SolutionFile = @" -Microsoft Visual Studio Solution File, Format Version 12.00 -Global - GlobalSection(SolutionConfigurationPlatforms) = thisIsUnknown - EndGlobalSection -EndGlobal -"; - var tmpFile = Temp.CreateFile(); - tmpFile.WriteAllText(SolutionFile); - - Action action = () => - { - SlnFile.Read(tmpFile.Path); - }; - - action.ShouldThrow() - .WithMessage(FormatError(4, LocalizableStrings.InvalidSectionTypeError, "thisIsUnknown")); - } - - [Fact] - public void WhenGivenASolutionWithMissingSectionIdTypeItThrows() - { - const string SolutionFile = @" -Microsoft Visual Studio Solution File, Format Version 12.00 -Global - GlobalSection = preSolution - EndGlobalSection -EndGlobal -"; - var tmpFile = Temp.CreateFile(); - tmpFile.WriteAllText(SolutionFile); - - Action action = () => - { - SlnFile.Read(tmpFile.Path); - }; - - action.ShouldThrow() - .WithMessage(FormatError(4, LocalizableStrings.SectionIdMissingError)); - } - - [Fact] - public void WhenGivenASolutionWithSectionNotClosedItThrows() - { - const string SolutionFile = @" -Microsoft Visual Studio Solution File, Format Version 12.00 -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -EndGlobal -"; - var tmpFile = Temp.CreateFile(); - tmpFile.WriteAllText(SolutionFile); - - Action action = () => - { - SlnFile.Read(tmpFile.Path); - }; - - action.ShouldThrow() - .WithMessage(FormatError(6, LocalizableStrings.ClosingSectionTagNotFoundError)); - } - - [Fact] - public void WhenGivenASolutionWithInvalidPropertySetItThrows() - { - const string SolutionFile = @" -Microsoft Visual Studio Solution File, Format Version 12.00 -Project(""{7072A694-548F-4CAE-A58F-12D257D5F486}"") = ""AppModified"", ""AppModified\AppModified.csproj"", ""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"" -EndProject -Global - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7072A694-548F-4CAE-A58F-12D257D5F486} Debug|Any CPU ActiveCfg = Debug|Any CPU - EndGlobalSection -EndGlobal -"; - var tmpFile = Temp.CreateFile(); - tmpFile.WriteAllText(SolutionFile); - - Action action = () => - { - var slnFile = SlnFile.Read(tmpFile.Path); - if (slnFile.ProjectConfigurationsSection.Count == 0) - { - // Need to force loading of nested property sets - } - }; - - action.ShouldThrow() - .WithMessage(FormatError(7, LocalizableStrings.InvalidPropertySetFormatString, ".")); - } - - private static string FormatError(int line, string format, params object[] args) - { - return string.Format( - LocalizableStrings.ErrorMessageFormatString, - line, - string.Format(format, args)); - } - } -} 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 deleted file mode 100644 index 7a3b12d4c..000000000 --- a/test/Microsoft.DotNet.Cli.Sln.Internal.Tests/Microsoft.DotNet.Cli.Sln.Internal.Tests.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - Microsoft.DotNet.Cli.Sln.Internal.Tests - ../../tools/test_key.snk - true - true - $(AssetTargetFallback);netstandardapp1.5;dotnet5.4;portable-net451+win8 - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/Microsoft.DotNet.Cli.Tests.sln b/test/Microsoft.DotNet.Cli.Tests.sln index c3d64f5d7..16df59a1d 100644 --- a/test/Microsoft.DotNet.Cli.Tests.sln +++ b/test/Microsoft.DotNet.Cli.Tests.sln @@ -1,84 +1,13 @@ + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26419.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-add-reference.Tests", "dotnet-add-reference.Tests\dotnet-add-reference.Tests.csproj", "{AB63A3E5-76A3-4EE9-A380-8E0C7B7644DC}" +VisualStudioVersion = 15.0.26124.0 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.TestFramework", "Microsoft.DotNet.TestFramework\Microsoft.DotNet.TestFramework.csproj", "{BEA33DFA-8559-4680-B40A-B522FBF37567}" EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-restore.Tests", "dotnet-restore.Tests\dotnet-restore.Tests.csproj", "{44942A2B-EA59-4E47-A6E7-8D7CF82EC825}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.Tools.Tests.Utilities", "Microsoft.DotNet.Tools.Tests.Utilities\Microsoft.DotNet.Tools.Tests.Utilities.csproj", "{770FE8B9-6381-4328-AA36-D6A21114701E}" EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-build.Tests", "dotnet-build.Tests\dotnet-build.Tests.csproj", "{A918B35C-0E62-44A5-94A1-111B82C67310}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-help.Tests", "dotnet-help.Tests\dotnet-help.Tests.csproj", "{97267605-66B9-48B3-9D27-C253EEEC00D5}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-list-reference.Tests", "dotnet-list-reference.Tests\dotnet-list-reference.Tests.csproj", "{1D6C9AA7-4830-4BF0-AE55-1F20102DEBC3}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-migrate.Tests", "dotnet-migrate.Tests\dotnet-migrate.Tests.csproj", "{394A9E3B-2E01-4FA2-A47A-2E26308E975E}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-msbuild.Tests", "dotnet-msbuild.Tests\dotnet-msbuild.Tests.csproj", "{68420EEE-D084-4809-B2EB-C5EE22A6D827}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-new.Tests", "dotnet-new.Tests\dotnet-new.Tests.csproj", "{A616564F-53D5-4394-B7EC-C373CCAE92F8}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-nuget.UnitTests", "dotnet-nuget.UnitTests\dotnet-nuget.UnitTests.csproj", "{CC6F63B6-FE02-4561-BCBB-062DBFF8F758}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-pack.Tests", "dotnet-pack.Tests\dotnet-pack.Tests.csproj", "{21C09199-7F81-494B-9100-6C4A74EFFB7F}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-publish.Tests", "dotnet-publish.Tests\dotnet-publish.Tests.csproj", "{C60AF72E-52FA-4D32-8483-ACA508A9CC98}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-remove-reference.Tests", "dotnet-remove-reference.Tests\dotnet-remove-reference.Tests.csproj", "{40962934-929D-434D-B2C7-76341B387A46}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-run.Tests", "dotnet-run.Tests\dotnet-run.Tests.csproj", "{948FCF35-9FE5-4ACF-9CF6-B65C20805DDD}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-test.Tests", "dotnet-test.Tests\dotnet-test.Tests.csproj", "{128917C9-F2CD-4C98-9BD3-20D0F0B13D61}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-vstest.Tests", "dotnet-vstest.Tests\dotnet-vstest.Tests.csproj", "{B4D339C2-21E7-4EAE-8BDD-2A7DAF88AFDF}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "msbuild.IntegrationTests", "msbuild.IntegrationTests\msbuild.IntegrationTests.csproj", "{CC1EAB87-2A9E-4F05-99EA-5B0F14031D78}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "crossgen.Tests", "crossgen.Tests\crossgen.Tests.csproj", "{B45638FC-D4F6-47E7-9440-C1D65F0492C2}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "binding-redirects.Tests", "binding-redirects.Tests\binding-redirects.Tests.csproj", "{18702FC5-7B1A-49B7-A335-A926064D577A}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "ArgumentForwardingTests", "ArgumentForwardingTests\ArgumentForwardingTests.csproj", "{67418187-0CF6-4213-87D0-5B9B841FD755}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "ArgumentsReflector", "ArgumentsReflector\ArgumentsReflector.csproj", "{8818FEBB-7243-4AB5-9E1C-179F5189FBD7}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Microsoft.DotNet.Cli.Sln.Internal.Tests", "Microsoft.DotNet.Cli.Sln.Internal.Tests\Microsoft.DotNet.Cli.Sln.Internal.Tests.csproj", "{BF42BEE8-3E23-44EB-B226-3859029A0BF5}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Microsoft.DotNet.Cli.Utils.Tests", "Microsoft.DotNet.Cli.Utils.Tests\Microsoft.DotNet.Cli.Utils.Tests.csproj", "{7C460953-7E23-436E-9EA9-E4CF37A919B7}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Microsoft.DotNet.Configurer.UnitTests", "Microsoft.DotNet.Configurer.UnitTests\Microsoft.DotNet.Configurer.UnitTests.csproj", "{91CBD27F-5069-4FD2-AC61-15A69D65E202}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Microsoft.DotNet.Tools.Tests.Utilities", "Microsoft.DotNet.Tools.Tests.Utilities\Microsoft.DotNet.Tools.Tests.Utilities.csproj", "{D399E9DD-3049-47A2-8BFF-CBE26EACED7E}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "Msbuild.Tests.Utilities", "Msbuild.Tests.Utilities\Msbuild.Tests.Utilities.csproj", "{F5A9E29F-B47B-47F4-A25B-BC991DE3369C}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "EndToEnd", "EndToEnd\EndToEnd.csproj", "{BB8A1F16-614A-428F-970F-CD5F1A981343}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet.Tests", "dotnet.Tests\dotnet.Tests.csproj", "{B4B5DA8E-E2EA-49CB-8B8C-4E157D42E710}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnet-sln-add.Tests", "dotnet-sln-add.Tests", "{5FF48976-B083-4E3B-A8E7-6FCD225D5C8E}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-sln-add.Tests", "dotnet-sln-add.Tests\dotnet-sln-add.Tests.csproj", "{FC849626-89C9-4F50-A2CA-53C4315A87F8}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnet-sln-list.Tests", "dotnet-sln-list.Tests", "{15DDC326-69C3-4081-8AA1-B578B2BDE2C6}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-sln-list.Tests", "dotnet-sln-list.Tests\dotnet-sln-list.Tests.csproj", "{5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnet-sln-remove.Tests", "dotnet-sln-remove.Tests", "{BB393A93-1770-4753-B7D6-56F0DD378177}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-sln-remove.Tests", "dotnet-sln-remove.Tests\dotnet-sln-remove.Tests.csproj", "{92BA9F90-E25B-4A1C-9598-2295D3DFC12F}" -EndProject -Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "dotnet-add-package.Tests", "dotnet-add-package.Tests\dotnet-add-package.Tests.csproj", "{3501AB72-3E05-45EE-9000-9515F5A139AC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-store.Tests", "dotnet-store.Tests\dotnet-store.Tests.csproj", "{04B21F0F-E645-44E3-868B-3C97E435FB74}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-back-compat.Tests", "dotnet-back-compat.Tests\dotnet-back-compat.Tests.csproj", "{27351B2F-325B-4843-9F4C-BC53FD06A7B5}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dotnet-remove-package.Tests", "dotnet-remove-package.Tests\dotnet-remove-package.Tests.csproj", "{CF517B15-B307-4660-87D5-CC036ADECD4B}" -EndProject -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("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EndToEnd", "EndToEnd\EndToEnd.csproj", "{AEB7B217-D4C4-46F1-9495-87F869F0ABE4}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -89,446 +18,45 @@ Global Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AB63A3E5-76A3-4EE9-A380-8E0C7B7644DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AB63A3E5-76A3-4EE9-A380-8E0C7B7644DC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AB63A3E5-76A3-4EE9-A380-8E0C7B7644DC}.Debug|x64.ActiveCfg = Debug|Any CPU - {AB63A3E5-76A3-4EE9-A380-8E0C7B7644DC}.Debug|x64.Build.0 = Debug|Any CPU - {AB63A3E5-76A3-4EE9-A380-8E0C7B7644DC}.Debug|x86.ActiveCfg = Debug|Any CPU - {AB63A3E5-76A3-4EE9-A380-8E0C7B7644DC}.Debug|x86.Build.0 = Debug|Any CPU - {AB63A3E5-76A3-4EE9-A380-8E0C7B7644DC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AB63A3E5-76A3-4EE9-A380-8E0C7B7644DC}.Release|Any CPU.Build.0 = Release|Any CPU - {AB63A3E5-76A3-4EE9-A380-8E0C7B7644DC}.Release|x64.ActiveCfg = Release|Any CPU - {AB63A3E5-76A3-4EE9-A380-8E0C7B7644DC}.Release|x64.Build.0 = Release|Any CPU - {AB63A3E5-76A3-4EE9-A380-8E0C7B7644DC}.Release|x86.ActiveCfg = Release|Any CPU - {AB63A3E5-76A3-4EE9-A380-8E0C7B7644DC}.Release|x86.Build.0 = Release|Any CPU - {44942A2B-EA59-4E47-A6E7-8D7CF82EC825}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {44942A2B-EA59-4E47-A6E7-8D7CF82EC825}.Debug|Any CPU.Build.0 = Debug|Any CPU - {44942A2B-EA59-4E47-A6E7-8D7CF82EC825}.Debug|x64.ActiveCfg = Debug|Any CPU - {44942A2B-EA59-4E47-A6E7-8D7CF82EC825}.Debug|x64.Build.0 = Debug|Any CPU - {44942A2B-EA59-4E47-A6E7-8D7CF82EC825}.Debug|x86.ActiveCfg = Debug|Any CPU - {44942A2B-EA59-4E47-A6E7-8D7CF82EC825}.Debug|x86.Build.0 = Debug|Any CPU - {44942A2B-EA59-4E47-A6E7-8D7CF82EC825}.Release|Any CPU.ActiveCfg = Release|Any CPU - {44942A2B-EA59-4E47-A6E7-8D7CF82EC825}.Release|Any CPU.Build.0 = Release|Any CPU - {44942A2B-EA59-4E47-A6E7-8D7CF82EC825}.Release|x64.ActiveCfg = Release|Any CPU - {44942A2B-EA59-4E47-A6E7-8D7CF82EC825}.Release|x64.Build.0 = Release|Any CPU - {44942A2B-EA59-4E47-A6E7-8D7CF82EC825}.Release|x86.ActiveCfg = Release|Any CPU - {44942A2B-EA59-4E47-A6E7-8D7CF82EC825}.Release|x86.Build.0 = Release|Any CPU - {A918B35C-0E62-44A5-94A1-111B82C67310}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A918B35C-0E62-44A5-94A1-111B82C67310}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A918B35C-0E62-44A5-94A1-111B82C67310}.Debug|x64.ActiveCfg = Debug|Any CPU - {A918B35C-0E62-44A5-94A1-111B82C67310}.Debug|x64.Build.0 = Debug|Any CPU - {A918B35C-0E62-44A5-94A1-111B82C67310}.Debug|x86.ActiveCfg = Debug|Any CPU - {A918B35C-0E62-44A5-94A1-111B82C67310}.Debug|x86.Build.0 = Debug|Any CPU - {A918B35C-0E62-44A5-94A1-111B82C67310}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A918B35C-0E62-44A5-94A1-111B82C67310}.Release|Any CPU.Build.0 = Release|Any CPU - {A918B35C-0E62-44A5-94A1-111B82C67310}.Release|x64.ActiveCfg = Release|Any CPU - {A918B35C-0E62-44A5-94A1-111B82C67310}.Release|x64.Build.0 = Release|Any CPU - {A918B35C-0E62-44A5-94A1-111B82C67310}.Release|x86.ActiveCfg = Release|Any CPU - {A918B35C-0E62-44A5-94A1-111B82C67310}.Release|x86.Build.0 = Release|Any CPU - {97267605-66B9-48B3-9D27-C253EEEC00D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {97267605-66B9-48B3-9D27-C253EEEC00D5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {97267605-66B9-48B3-9D27-C253EEEC00D5}.Debug|x64.ActiveCfg = Debug|Any CPU - {97267605-66B9-48B3-9D27-C253EEEC00D5}.Debug|x64.Build.0 = Debug|Any CPU - {97267605-66B9-48B3-9D27-C253EEEC00D5}.Debug|x86.ActiveCfg = Debug|Any CPU - {97267605-66B9-48B3-9D27-C253EEEC00D5}.Debug|x86.Build.0 = Debug|Any CPU - {97267605-66B9-48B3-9D27-C253EEEC00D5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {97267605-66B9-48B3-9D27-C253EEEC00D5}.Release|Any CPU.Build.0 = Release|Any CPU - {97267605-66B9-48B3-9D27-C253EEEC00D5}.Release|x64.ActiveCfg = Release|Any CPU - {97267605-66B9-48B3-9D27-C253EEEC00D5}.Release|x64.Build.0 = Release|Any CPU - {97267605-66B9-48B3-9D27-C253EEEC00D5}.Release|x86.ActiveCfg = Release|Any CPU - {97267605-66B9-48B3-9D27-C253EEEC00D5}.Release|x86.Build.0 = Release|Any CPU - {1D6C9AA7-4830-4BF0-AE55-1F20102DEBC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1D6C9AA7-4830-4BF0-AE55-1F20102DEBC3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1D6C9AA7-4830-4BF0-AE55-1F20102DEBC3}.Debug|x64.ActiveCfg = Debug|Any CPU - {1D6C9AA7-4830-4BF0-AE55-1F20102DEBC3}.Debug|x64.Build.0 = Debug|Any CPU - {1D6C9AA7-4830-4BF0-AE55-1F20102DEBC3}.Debug|x86.ActiveCfg = Debug|Any CPU - {1D6C9AA7-4830-4BF0-AE55-1F20102DEBC3}.Debug|x86.Build.0 = Debug|Any CPU - {1D6C9AA7-4830-4BF0-AE55-1F20102DEBC3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1D6C9AA7-4830-4BF0-AE55-1F20102DEBC3}.Release|Any CPU.Build.0 = Release|Any CPU - {1D6C9AA7-4830-4BF0-AE55-1F20102DEBC3}.Release|x64.ActiveCfg = Release|Any CPU - {1D6C9AA7-4830-4BF0-AE55-1F20102DEBC3}.Release|x64.Build.0 = Release|Any CPU - {1D6C9AA7-4830-4BF0-AE55-1F20102DEBC3}.Release|x86.ActiveCfg = Release|Any CPU - {1D6C9AA7-4830-4BF0-AE55-1F20102DEBC3}.Release|x86.Build.0 = Release|Any CPU - {394A9E3B-2E01-4FA2-A47A-2E26308E975E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {394A9E3B-2E01-4FA2-A47A-2E26308E975E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {394A9E3B-2E01-4FA2-A47A-2E26308E975E}.Debug|x64.ActiveCfg = Debug|Any CPU - {394A9E3B-2E01-4FA2-A47A-2E26308E975E}.Debug|x64.Build.0 = Debug|Any CPU - {394A9E3B-2E01-4FA2-A47A-2E26308E975E}.Debug|x86.ActiveCfg = Debug|Any CPU - {394A9E3B-2E01-4FA2-A47A-2E26308E975E}.Debug|x86.Build.0 = Debug|Any CPU - {394A9E3B-2E01-4FA2-A47A-2E26308E975E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {394A9E3B-2E01-4FA2-A47A-2E26308E975E}.Release|Any CPU.Build.0 = Release|Any CPU - {394A9E3B-2E01-4FA2-A47A-2E26308E975E}.Release|x64.ActiveCfg = Release|Any CPU - {394A9E3B-2E01-4FA2-A47A-2E26308E975E}.Release|x64.Build.0 = Release|Any CPU - {394A9E3B-2E01-4FA2-A47A-2E26308E975E}.Release|x86.ActiveCfg = Release|Any CPU - {394A9E3B-2E01-4FA2-A47A-2E26308E975E}.Release|x86.Build.0 = Release|Any CPU - {68420EEE-D084-4809-B2EB-C5EE22A6D827}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {68420EEE-D084-4809-B2EB-C5EE22A6D827}.Debug|Any CPU.Build.0 = Debug|Any CPU - {68420EEE-D084-4809-B2EB-C5EE22A6D827}.Debug|x64.ActiveCfg = Debug|Any CPU - {68420EEE-D084-4809-B2EB-C5EE22A6D827}.Debug|x64.Build.0 = Debug|Any CPU - {68420EEE-D084-4809-B2EB-C5EE22A6D827}.Debug|x86.ActiveCfg = Debug|Any CPU - {68420EEE-D084-4809-B2EB-C5EE22A6D827}.Debug|x86.Build.0 = Debug|Any CPU - {68420EEE-D084-4809-B2EB-C5EE22A6D827}.Release|Any CPU.ActiveCfg = Release|Any CPU - {68420EEE-D084-4809-B2EB-C5EE22A6D827}.Release|Any CPU.Build.0 = Release|Any CPU - {68420EEE-D084-4809-B2EB-C5EE22A6D827}.Release|x64.ActiveCfg = Release|Any CPU - {68420EEE-D084-4809-B2EB-C5EE22A6D827}.Release|x64.Build.0 = Release|Any CPU - {68420EEE-D084-4809-B2EB-C5EE22A6D827}.Release|x86.ActiveCfg = Release|Any CPU - {68420EEE-D084-4809-B2EB-C5EE22A6D827}.Release|x86.Build.0 = Release|Any CPU - {A616564F-53D5-4394-B7EC-C373CCAE92F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A616564F-53D5-4394-B7EC-C373CCAE92F8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A616564F-53D5-4394-B7EC-C373CCAE92F8}.Debug|x64.ActiveCfg = Debug|Any CPU - {A616564F-53D5-4394-B7EC-C373CCAE92F8}.Debug|x64.Build.0 = Debug|Any CPU - {A616564F-53D5-4394-B7EC-C373CCAE92F8}.Debug|x86.ActiveCfg = Debug|Any CPU - {A616564F-53D5-4394-B7EC-C373CCAE92F8}.Debug|x86.Build.0 = Debug|Any CPU - {A616564F-53D5-4394-B7EC-C373CCAE92F8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A616564F-53D5-4394-B7EC-C373CCAE92F8}.Release|Any CPU.Build.0 = Release|Any CPU - {A616564F-53D5-4394-B7EC-C373CCAE92F8}.Release|x64.ActiveCfg = Release|Any CPU - {A616564F-53D5-4394-B7EC-C373CCAE92F8}.Release|x64.Build.0 = Release|Any CPU - {A616564F-53D5-4394-B7EC-C373CCAE92F8}.Release|x86.ActiveCfg = Release|Any CPU - {A616564F-53D5-4394-B7EC-C373CCAE92F8}.Release|x86.Build.0 = Release|Any CPU - {CC6F63B6-FE02-4561-BCBB-062DBFF8F758}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CC6F63B6-FE02-4561-BCBB-062DBFF8F758}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CC6F63B6-FE02-4561-BCBB-062DBFF8F758}.Debug|x64.ActiveCfg = Debug|Any CPU - {CC6F63B6-FE02-4561-BCBB-062DBFF8F758}.Debug|x64.Build.0 = Debug|Any CPU - {CC6F63B6-FE02-4561-BCBB-062DBFF8F758}.Debug|x86.ActiveCfg = Debug|Any CPU - {CC6F63B6-FE02-4561-BCBB-062DBFF8F758}.Debug|x86.Build.0 = Debug|Any CPU - {CC6F63B6-FE02-4561-BCBB-062DBFF8F758}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CC6F63B6-FE02-4561-BCBB-062DBFF8F758}.Release|Any CPU.Build.0 = Release|Any CPU - {CC6F63B6-FE02-4561-BCBB-062DBFF8F758}.Release|x64.ActiveCfg = Release|Any CPU - {CC6F63B6-FE02-4561-BCBB-062DBFF8F758}.Release|x64.Build.0 = Release|Any CPU - {CC6F63B6-FE02-4561-BCBB-062DBFF8F758}.Release|x86.ActiveCfg = Release|Any CPU - {CC6F63B6-FE02-4561-BCBB-062DBFF8F758}.Release|x86.Build.0 = Release|Any CPU - {21C09199-7F81-494B-9100-6C4A74EFFB7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {21C09199-7F81-494B-9100-6C4A74EFFB7F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {21C09199-7F81-494B-9100-6C4A74EFFB7F}.Debug|x64.ActiveCfg = Debug|Any CPU - {21C09199-7F81-494B-9100-6C4A74EFFB7F}.Debug|x64.Build.0 = Debug|Any CPU - {21C09199-7F81-494B-9100-6C4A74EFFB7F}.Debug|x86.ActiveCfg = Debug|Any CPU - {21C09199-7F81-494B-9100-6C4A74EFFB7F}.Debug|x86.Build.0 = Debug|Any CPU - {21C09199-7F81-494B-9100-6C4A74EFFB7F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {21C09199-7F81-494B-9100-6C4A74EFFB7F}.Release|Any CPU.Build.0 = Release|Any CPU - {21C09199-7F81-494B-9100-6C4A74EFFB7F}.Release|x64.ActiveCfg = Release|Any CPU - {21C09199-7F81-494B-9100-6C4A74EFFB7F}.Release|x64.Build.0 = Release|Any CPU - {21C09199-7F81-494B-9100-6C4A74EFFB7F}.Release|x86.ActiveCfg = Release|Any CPU - {21C09199-7F81-494B-9100-6C4A74EFFB7F}.Release|x86.Build.0 = Release|Any CPU - {C60AF72E-52FA-4D32-8483-ACA508A9CC98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C60AF72E-52FA-4D32-8483-ACA508A9CC98}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C60AF72E-52FA-4D32-8483-ACA508A9CC98}.Debug|x64.ActiveCfg = Debug|Any CPU - {C60AF72E-52FA-4D32-8483-ACA508A9CC98}.Debug|x64.Build.0 = Debug|Any CPU - {C60AF72E-52FA-4D32-8483-ACA508A9CC98}.Debug|x86.ActiveCfg = Debug|Any CPU - {C60AF72E-52FA-4D32-8483-ACA508A9CC98}.Debug|x86.Build.0 = Debug|Any CPU - {C60AF72E-52FA-4D32-8483-ACA508A9CC98}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C60AF72E-52FA-4D32-8483-ACA508A9CC98}.Release|Any CPU.Build.0 = Release|Any CPU - {C60AF72E-52FA-4D32-8483-ACA508A9CC98}.Release|x64.ActiveCfg = Release|Any CPU - {C60AF72E-52FA-4D32-8483-ACA508A9CC98}.Release|x64.Build.0 = Release|Any CPU - {C60AF72E-52FA-4D32-8483-ACA508A9CC98}.Release|x86.ActiveCfg = Release|Any CPU - {C60AF72E-52FA-4D32-8483-ACA508A9CC98}.Release|x86.Build.0 = Release|Any CPU - {40962934-929D-434D-B2C7-76341B387A46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {40962934-929D-434D-B2C7-76341B387A46}.Debug|Any CPU.Build.0 = Debug|Any CPU - {40962934-929D-434D-B2C7-76341B387A46}.Debug|x64.ActiveCfg = Debug|Any CPU - {40962934-929D-434D-B2C7-76341B387A46}.Debug|x64.Build.0 = Debug|Any CPU - {40962934-929D-434D-B2C7-76341B387A46}.Debug|x86.ActiveCfg = Debug|Any CPU - {40962934-929D-434D-B2C7-76341B387A46}.Debug|x86.Build.0 = Debug|Any CPU - {40962934-929D-434D-B2C7-76341B387A46}.Release|Any CPU.ActiveCfg = Release|Any CPU - {40962934-929D-434D-B2C7-76341B387A46}.Release|Any CPU.Build.0 = Release|Any CPU - {40962934-929D-434D-B2C7-76341B387A46}.Release|x64.ActiveCfg = Release|Any CPU - {40962934-929D-434D-B2C7-76341B387A46}.Release|x64.Build.0 = Release|Any CPU - {40962934-929D-434D-B2C7-76341B387A46}.Release|x86.ActiveCfg = Release|Any CPU - {40962934-929D-434D-B2C7-76341B387A46}.Release|x86.Build.0 = Release|Any CPU - {948FCF35-9FE5-4ACF-9CF6-B65C20805DDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {948FCF35-9FE5-4ACF-9CF6-B65C20805DDD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {948FCF35-9FE5-4ACF-9CF6-B65C20805DDD}.Debug|x64.ActiveCfg = Debug|Any CPU - {948FCF35-9FE5-4ACF-9CF6-B65C20805DDD}.Debug|x64.Build.0 = Debug|Any CPU - {948FCF35-9FE5-4ACF-9CF6-B65C20805DDD}.Debug|x86.ActiveCfg = Debug|Any CPU - {948FCF35-9FE5-4ACF-9CF6-B65C20805DDD}.Debug|x86.Build.0 = Debug|Any CPU - {948FCF35-9FE5-4ACF-9CF6-B65C20805DDD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {948FCF35-9FE5-4ACF-9CF6-B65C20805DDD}.Release|Any CPU.Build.0 = Release|Any CPU - {948FCF35-9FE5-4ACF-9CF6-B65C20805DDD}.Release|x64.ActiveCfg = Release|Any CPU - {948FCF35-9FE5-4ACF-9CF6-B65C20805DDD}.Release|x64.Build.0 = Release|Any CPU - {948FCF35-9FE5-4ACF-9CF6-B65C20805DDD}.Release|x86.ActiveCfg = Release|Any CPU - {948FCF35-9FE5-4ACF-9CF6-B65C20805DDD}.Release|x86.Build.0 = Release|Any CPU - {128917C9-F2CD-4C98-9BD3-20D0F0B13D61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {128917C9-F2CD-4C98-9BD3-20D0F0B13D61}.Debug|Any CPU.Build.0 = Debug|Any CPU - {128917C9-F2CD-4C98-9BD3-20D0F0B13D61}.Debug|x64.ActiveCfg = Debug|Any CPU - {128917C9-F2CD-4C98-9BD3-20D0F0B13D61}.Debug|x64.Build.0 = Debug|Any CPU - {128917C9-F2CD-4C98-9BD3-20D0F0B13D61}.Debug|x86.ActiveCfg = Debug|Any CPU - {128917C9-F2CD-4C98-9BD3-20D0F0B13D61}.Debug|x86.Build.0 = Debug|Any CPU - {128917C9-F2CD-4C98-9BD3-20D0F0B13D61}.Release|Any CPU.ActiveCfg = Release|Any CPU - {128917C9-F2CD-4C98-9BD3-20D0F0B13D61}.Release|Any CPU.Build.0 = Release|Any CPU - {128917C9-F2CD-4C98-9BD3-20D0F0B13D61}.Release|x64.ActiveCfg = Release|Any CPU - {128917C9-F2CD-4C98-9BD3-20D0F0B13D61}.Release|x64.Build.0 = Release|Any CPU - {128917C9-F2CD-4C98-9BD3-20D0F0B13D61}.Release|x86.ActiveCfg = Release|Any CPU - {128917C9-F2CD-4C98-9BD3-20D0F0B13D61}.Release|x86.Build.0 = Release|Any CPU - {B4D339C2-21E7-4EAE-8BDD-2A7DAF88AFDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B4D339C2-21E7-4EAE-8BDD-2A7DAF88AFDF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B4D339C2-21E7-4EAE-8BDD-2A7DAF88AFDF}.Debug|x64.ActiveCfg = Debug|Any CPU - {B4D339C2-21E7-4EAE-8BDD-2A7DAF88AFDF}.Debug|x64.Build.0 = Debug|Any CPU - {B4D339C2-21E7-4EAE-8BDD-2A7DAF88AFDF}.Debug|x86.ActiveCfg = Debug|Any CPU - {B4D339C2-21E7-4EAE-8BDD-2A7DAF88AFDF}.Debug|x86.Build.0 = Debug|Any CPU - {B4D339C2-21E7-4EAE-8BDD-2A7DAF88AFDF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B4D339C2-21E7-4EAE-8BDD-2A7DAF88AFDF}.Release|Any CPU.Build.0 = Release|Any CPU - {B4D339C2-21E7-4EAE-8BDD-2A7DAF88AFDF}.Release|x64.ActiveCfg = Release|Any CPU - {B4D339C2-21E7-4EAE-8BDD-2A7DAF88AFDF}.Release|x64.Build.0 = Release|Any CPU - {B4D339C2-21E7-4EAE-8BDD-2A7DAF88AFDF}.Release|x86.ActiveCfg = Release|Any CPU - {B4D339C2-21E7-4EAE-8BDD-2A7DAF88AFDF}.Release|x86.Build.0 = Release|Any CPU - {CC1EAB87-2A9E-4F05-99EA-5B0F14031D78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CC1EAB87-2A9E-4F05-99EA-5B0F14031D78}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CC1EAB87-2A9E-4F05-99EA-5B0F14031D78}.Debug|x64.ActiveCfg = Debug|Any CPU - {CC1EAB87-2A9E-4F05-99EA-5B0F14031D78}.Debug|x64.Build.0 = Debug|Any CPU - {CC1EAB87-2A9E-4F05-99EA-5B0F14031D78}.Debug|x86.ActiveCfg = Debug|Any CPU - {CC1EAB87-2A9E-4F05-99EA-5B0F14031D78}.Debug|x86.Build.0 = Debug|Any CPU - {CC1EAB87-2A9E-4F05-99EA-5B0F14031D78}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CC1EAB87-2A9E-4F05-99EA-5B0F14031D78}.Release|Any CPU.Build.0 = Release|Any CPU - {CC1EAB87-2A9E-4F05-99EA-5B0F14031D78}.Release|x64.ActiveCfg = Release|Any CPU - {CC1EAB87-2A9E-4F05-99EA-5B0F14031D78}.Release|x64.Build.0 = Release|Any CPU - {CC1EAB87-2A9E-4F05-99EA-5B0F14031D78}.Release|x86.ActiveCfg = Release|Any CPU - {CC1EAB87-2A9E-4F05-99EA-5B0F14031D78}.Release|x86.Build.0 = Release|Any CPU - {B45638FC-D4F6-47E7-9440-C1D65F0492C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B45638FC-D4F6-47E7-9440-C1D65F0492C2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B45638FC-D4F6-47E7-9440-C1D65F0492C2}.Debug|x64.ActiveCfg = Debug|Any CPU - {B45638FC-D4F6-47E7-9440-C1D65F0492C2}.Debug|x64.Build.0 = Debug|Any CPU - {B45638FC-D4F6-47E7-9440-C1D65F0492C2}.Debug|x86.ActiveCfg = Debug|Any CPU - {B45638FC-D4F6-47E7-9440-C1D65F0492C2}.Debug|x86.Build.0 = Debug|Any CPU - {B45638FC-D4F6-47E7-9440-C1D65F0492C2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B45638FC-D4F6-47E7-9440-C1D65F0492C2}.Release|Any CPU.Build.0 = Release|Any CPU - {B45638FC-D4F6-47E7-9440-C1D65F0492C2}.Release|x64.ActiveCfg = Release|Any CPU - {B45638FC-D4F6-47E7-9440-C1D65F0492C2}.Release|x64.Build.0 = Release|Any CPU - {B45638FC-D4F6-47E7-9440-C1D65F0492C2}.Release|x86.ActiveCfg = Release|Any CPU - {B45638FC-D4F6-47E7-9440-C1D65F0492C2}.Release|x86.Build.0 = Release|Any CPU - {18702FC5-7B1A-49B7-A335-A926064D577A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {18702FC5-7B1A-49B7-A335-A926064D577A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {18702FC5-7B1A-49B7-A335-A926064D577A}.Debug|x64.ActiveCfg = Debug|Any CPU - {18702FC5-7B1A-49B7-A335-A926064D577A}.Debug|x64.Build.0 = Debug|Any CPU - {18702FC5-7B1A-49B7-A335-A926064D577A}.Debug|x86.ActiveCfg = Debug|Any CPU - {18702FC5-7B1A-49B7-A335-A926064D577A}.Debug|x86.Build.0 = Debug|Any CPU - {18702FC5-7B1A-49B7-A335-A926064D577A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {18702FC5-7B1A-49B7-A335-A926064D577A}.Release|Any CPU.Build.0 = Release|Any CPU - {18702FC5-7B1A-49B7-A335-A926064D577A}.Release|x64.ActiveCfg = Release|Any CPU - {18702FC5-7B1A-49B7-A335-A926064D577A}.Release|x64.Build.0 = Release|Any CPU - {18702FC5-7B1A-49B7-A335-A926064D577A}.Release|x86.ActiveCfg = Release|Any CPU - {18702FC5-7B1A-49B7-A335-A926064D577A}.Release|x86.Build.0 = Release|Any CPU - {67418187-0CF6-4213-87D0-5B9B841FD755}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {67418187-0CF6-4213-87D0-5B9B841FD755}.Debug|Any CPU.Build.0 = Debug|Any CPU - {67418187-0CF6-4213-87D0-5B9B841FD755}.Debug|x64.ActiveCfg = Debug|Any CPU - {67418187-0CF6-4213-87D0-5B9B841FD755}.Debug|x64.Build.0 = Debug|Any CPU - {67418187-0CF6-4213-87D0-5B9B841FD755}.Debug|x86.ActiveCfg = Debug|Any CPU - {67418187-0CF6-4213-87D0-5B9B841FD755}.Debug|x86.Build.0 = Debug|Any CPU - {67418187-0CF6-4213-87D0-5B9B841FD755}.Release|Any CPU.ActiveCfg = Release|Any CPU - {67418187-0CF6-4213-87D0-5B9B841FD755}.Release|Any CPU.Build.0 = Release|Any CPU - {67418187-0CF6-4213-87D0-5B9B841FD755}.Release|x64.ActiveCfg = Release|Any CPU - {67418187-0CF6-4213-87D0-5B9B841FD755}.Release|x64.Build.0 = Release|Any CPU - {67418187-0CF6-4213-87D0-5B9B841FD755}.Release|x86.ActiveCfg = Release|Any CPU - {67418187-0CF6-4213-87D0-5B9B841FD755}.Release|x86.Build.0 = Release|Any CPU - {8818FEBB-7243-4AB5-9E1C-179F5189FBD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8818FEBB-7243-4AB5-9E1C-179F5189FBD7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8818FEBB-7243-4AB5-9E1C-179F5189FBD7}.Debug|x64.ActiveCfg = Debug|Any CPU - {8818FEBB-7243-4AB5-9E1C-179F5189FBD7}.Debug|x64.Build.0 = Debug|Any CPU - {8818FEBB-7243-4AB5-9E1C-179F5189FBD7}.Debug|x86.ActiveCfg = Debug|Any CPU - {8818FEBB-7243-4AB5-9E1C-179F5189FBD7}.Debug|x86.Build.0 = Debug|Any CPU - {8818FEBB-7243-4AB5-9E1C-179F5189FBD7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8818FEBB-7243-4AB5-9E1C-179F5189FBD7}.Release|Any CPU.Build.0 = Release|Any CPU - {8818FEBB-7243-4AB5-9E1C-179F5189FBD7}.Release|x64.ActiveCfg = Release|Any CPU - {8818FEBB-7243-4AB5-9E1C-179F5189FBD7}.Release|x64.Build.0 = Release|Any CPU - {8818FEBB-7243-4AB5-9E1C-179F5189FBD7}.Release|x86.ActiveCfg = Release|Any CPU - {8818FEBB-7243-4AB5-9E1C-179F5189FBD7}.Release|x86.Build.0 = Release|Any CPU - {BF42BEE8-3E23-44EB-B226-3859029A0BF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BF42BEE8-3E23-44EB-B226-3859029A0BF5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BF42BEE8-3E23-44EB-B226-3859029A0BF5}.Debug|x64.ActiveCfg = Debug|Any CPU - {BF42BEE8-3E23-44EB-B226-3859029A0BF5}.Debug|x64.Build.0 = Debug|Any CPU - {BF42BEE8-3E23-44EB-B226-3859029A0BF5}.Debug|x86.ActiveCfg = Debug|Any CPU - {BF42BEE8-3E23-44EB-B226-3859029A0BF5}.Debug|x86.Build.0 = Debug|Any CPU - {BF42BEE8-3E23-44EB-B226-3859029A0BF5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BF42BEE8-3E23-44EB-B226-3859029A0BF5}.Release|Any CPU.Build.0 = Release|Any CPU - {BF42BEE8-3E23-44EB-B226-3859029A0BF5}.Release|x64.ActiveCfg = Release|Any CPU - {BF42BEE8-3E23-44EB-B226-3859029A0BF5}.Release|x64.Build.0 = Release|Any CPU - {BF42BEE8-3E23-44EB-B226-3859029A0BF5}.Release|x86.ActiveCfg = Release|Any CPU - {BF42BEE8-3E23-44EB-B226-3859029A0BF5}.Release|x86.Build.0 = Release|Any CPU - {7C460953-7E23-436E-9EA9-E4CF37A919B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7C460953-7E23-436E-9EA9-E4CF37A919B7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7C460953-7E23-436E-9EA9-E4CF37A919B7}.Debug|x64.ActiveCfg = Debug|Any CPU - {7C460953-7E23-436E-9EA9-E4CF37A919B7}.Debug|x64.Build.0 = Debug|Any CPU - {7C460953-7E23-436E-9EA9-E4CF37A919B7}.Debug|x86.ActiveCfg = Debug|Any CPU - {7C460953-7E23-436E-9EA9-E4CF37A919B7}.Debug|x86.Build.0 = Debug|Any CPU - {7C460953-7E23-436E-9EA9-E4CF37A919B7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7C460953-7E23-436E-9EA9-E4CF37A919B7}.Release|Any CPU.Build.0 = Release|Any CPU - {7C460953-7E23-436E-9EA9-E4CF37A919B7}.Release|x64.ActiveCfg = Release|Any CPU - {7C460953-7E23-436E-9EA9-E4CF37A919B7}.Release|x64.Build.0 = Release|Any CPU - {7C460953-7E23-436E-9EA9-E4CF37A919B7}.Release|x86.ActiveCfg = Release|Any CPU - {7C460953-7E23-436E-9EA9-E4CF37A919B7}.Release|x86.Build.0 = Release|Any CPU - {91CBD27F-5069-4FD2-AC61-15A69D65E202}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {91CBD27F-5069-4FD2-AC61-15A69D65E202}.Debug|Any CPU.Build.0 = Debug|Any CPU - {91CBD27F-5069-4FD2-AC61-15A69D65E202}.Debug|x64.ActiveCfg = Debug|Any CPU - {91CBD27F-5069-4FD2-AC61-15A69D65E202}.Debug|x64.Build.0 = Debug|Any CPU - {91CBD27F-5069-4FD2-AC61-15A69D65E202}.Debug|x86.ActiveCfg = Debug|Any CPU - {91CBD27F-5069-4FD2-AC61-15A69D65E202}.Debug|x86.Build.0 = Debug|Any CPU - {91CBD27F-5069-4FD2-AC61-15A69D65E202}.Release|Any CPU.ActiveCfg = Release|Any CPU - {91CBD27F-5069-4FD2-AC61-15A69D65E202}.Release|Any CPU.Build.0 = Release|Any CPU - {91CBD27F-5069-4FD2-AC61-15A69D65E202}.Release|x64.ActiveCfg = Release|Any CPU - {91CBD27F-5069-4FD2-AC61-15A69D65E202}.Release|x64.Build.0 = Release|Any CPU - {91CBD27F-5069-4FD2-AC61-15A69D65E202}.Release|x86.ActiveCfg = Release|Any CPU - {91CBD27F-5069-4FD2-AC61-15A69D65E202}.Release|x86.Build.0 = Release|Any CPU - {D399E9DD-3049-47A2-8BFF-CBE26EACED7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D399E9DD-3049-47A2-8BFF-CBE26EACED7E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D399E9DD-3049-47A2-8BFF-CBE26EACED7E}.Debug|x64.ActiveCfg = Debug|Any CPU - {D399E9DD-3049-47A2-8BFF-CBE26EACED7E}.Debug|x64.Build.0 = Debug|Any CPU - {D399E9DD-3049-47A2-8BFF-CBE26EACED7E}.Debug|x86.ActiveCfg = Debug|Any CPU - {D399E9DD-3049-47A2-8BFF-CBE26EACED7E}.Debug|x86.Build.0 = Debug|Any CPU - {D399E9DD-3049-47A2-8BFF-CBE26EACED7E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D399E9DD-3049-47A2-8BFF-CBE26EACED7E}.Release|Any CPU.Build.0 = Release|Any CPU - {D399E9DD-3049-47A2-8BFF-CBE26EACED7E}.Release|x64.ActiveCfg = Release|Any CPU - {D399E9DD-3049-47A2-8BFF-CBE26EACED7E}.Release|x64.Build.0 = Release|Any CPU - {D399E9DD-3049-47A2-8BFF-CBE26EACED7E}.Release|x86.ActiveCfg = Release|Any CPU - {D399E9DD-3049-47A2-8BFF-CBE26EACED7E}.Release|x86.Build.0 = Release|Any CPU - {F5A9E29F-B47B-47F4-A25B-BC991DE3369C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F5A9E29F-B47B-47F4-A25B-BC991DE3369C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F5A9E29F-B47B-47F4-A25B-BC991DE3369C}.Debug|x64.ActiveCfg = Debug|Any CPU - {F5A9E29F-B47B-47F4-A25B-BC991DE3369C}.Debug|x64.Build.0 = Debug|Any CPU - {F5A9E29F-B47B-47F4-A25B-BC991DE3369C}.Debug|x86.ActiveCfg = Debug|Any CPU - {F5A9E29F-B47B-47F4-A25B-BC991DE3369C}.Debug|x86.Build.0 = Debug|Any CPU - {F5A9E29F-B47B-47F4-A25B-BC991DE3369C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F5A9E29F-B47B-47F4-A25B-BC991DE3369C}.Release|Any CPU.Build.0 = Release|Any CPU - {F5A9E29F-B47B-47F4-A25B-BC991DE3369C}.Release|x64.ActiveCfg = Release|Any CPU - {F5A9E29F-B47B-47F4-A25B-BC991DE3369C}.Release|x64.Build.0 = Release|Any CPU - {F5A9E29F-B47B-47F4-A25B-BC991DE3369C}.Release|x86.ActiveCfg = Release|Any CPU - {F5A9E29F-B47B-47F4-A25B-BC991DE3369C}.Release|x86.Build.0 = Release|Any CPU - {BB8A1F16-614A-428F-970F-CD5F1A981343}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BB8A1F16-614A-428F-970F-CD5F1A981343}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BB8A1F16-614A-428F-970F-CD5F1A981343}.Debug|x64.ActiveCfg = Debug|Any CPU - {BB8A1F16-614A-428F-970F-CD5F1A981343}.Debug|x64.Build.0 = Debug|Any CPU - {BB8A1F16-614A-428F-970F-CD5F1A981343}.Debug|x86.ActiveCfg = Debug|Any CPU - {BB8A1F16-614A-428F-970F-CD5F1A981343}.Debug|x86.Build.0 = Debug|Any CPU - {BB8A1F16-614A-428F-970F-CD5F1A981343}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BB8A1F16-614A-428F-970F-CD5F1A981343}.Release|Any CPU.Build.0 = Release|Any CPU - {BB8A1F16-614A-428F-970F-CD5F1A981343}.Release|x64.ActiveCfg = Release|Any CPU - {BB8A1F16-614A-428F-970F-CD5F1A981343}.Release|x64.Build.0 = Release|Any CPU - {BB8A1F16-614A-428F-970F-CD5F1A981343}.Release|x86.ActiveCfg = Release|Any CPU - {BB8A1F16-614A-428F-970F-CD5F1A981343}.Release|x86.Build.0 = Release|Any CPU - {B4B5DA8E-E2EA-49CB-8B8C-4E157D42E710}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B4B5DA8E-E2EA-49CB-8B8C-4E157D42E710}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B4B5DA8E-E2EA-49CB-8B8C-4E157D42E710}.Debug|x64.ActiveCfg = Debug|Any CPU - {B4B5DA8E-E2EA-49CB-8B8C-4E157D42E710}.Debug|x64.Build.0 = Debug|Any CPU - {B4B5DA8E-E2EA-49CB-8B8C-4E157D42E710}.Debug|x86.ActiveCfg = Debug|Any CPU - {B4B5DA8E-E2EA-49CB-8B8C-4E157D42E710}.Debug|x86.Build.0 = Debug|Any CPU - {B4B5DA8E-E2EA-49CB-8B8C-4E157D42E710}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B4B5DA8E-E2EA-49CB-8B8C-4E157D42E710}.Release|Any CPU.Build.0 = Release|Any CPU - {B4B5DA8E-E2EA-49CB-8B8C-4E157D42E710}.Release|x64.ActiveCfg = Release|Any CPU - {B4B5DA8E-E2EA-49CB-8B8C-4E157D42E710}.Release|x64.Build.0 = Release|Any CPU - {B4B5DA8E-E2EA-49CB-8B8C-4E157D42E710}.Release|x86.ActiveCfg = Release|Any CPU - {B4B5DA8E-E2EA-49CB-8B8C-4E157D42E710}.Release|x86.Build.0 = Release|Any CPU - {FC849626-89C9-4F50-A2CA-53C4315A87F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FC849626-89C9-4F50-A2CA-53C4315A87F8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FC849626-89C9-4F50-A2CA-53C4315A87F8}.Debug|x64.ActiveCfg = Debug|Any CPU - {FC849626-89C9-4F50-A2CA-53C4315A87F8}.Debug|x64.Build.0 = Debug|Any CPU - {FC849626-89C9-4F50-A2CA-53C4315A87F8}.Debug|x86.ActiveCfg = Debug|Any CPU - {FC849626-89C9-4F50-A2CA-53C4315A87F8}.Debug|x86.Build.0 = Debug|Any CPU - {FC849626-89C9-4F50-A2CA-53C4315A87F8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FC849626-89C9-4F50-A2CA-53C4315A87F8}.Release|Any CPU.Build.0 = Release|Any CPU - {FC849626-89C9-4F50-A2CA-53C4315A87F8}.Release|x64.ActiveCfg = Release|Any CPU - {FC849626-89C9-4F50-A2CA-53C4315A87F8}.Release|x64.Build.0 = Release|Any CPU - {FC849626-89C9-4F50-A2CA-53C4315A87F8}.Release|x86.ActiveCfg = Release|Any CPU - {FC849626-89C9-4F50-A2CA-53C4315A87F8}.Release|x86.Build.0 = Release|Any CPU - {5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Debug|x64.ActiveCfg = Debug|Any CPU - {5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Debug|x64.Build.0 = Debug|Any CPU - {5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Debug|x86.ActiveCfg = Debug|Any CPU - {5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Debug|x86.Build.0 = Debug|Any CPU - {5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Release|Any CPU.Build.0 = Release|Any CPU - {5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Release|x64.ActiveCfg = Release|Any CPU - {5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Release|x64.Build.0 = Release|Any CPU - {5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Release|x86.ActiveCfg = Release|Any CPU - {5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF}.Release|x86.Build.0 = Release|Any CPU - {92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Debug|x64.ActiveCfg = Debug|Any CPU - {92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Debug|x64.Build.0 = Debug|Any CPU - {92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Debug|x86.ActiveCfg = Debug|Any CPU - {92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Debug|x86.Build.0 = Debug|Any CPU - {92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Release|Any CPU.Build.0 = Release|Any CPU - {92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Release|x64.ActiveCfg = Release|Any CPU - {92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Release|x64.Build.0 = Release|Any CPU - {92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Release|x86.ActiveCfg = Release|Any CPU - {92BA9F90-E25B-4A1C-9598-2295D3DFC12F}.Release|x86.Build.0 = Release|Any CPU - {3501AB72-3E05-45EE-9000-9515F5A139AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3501AB72-3E05-45EE-9000-9515F5A139AC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3501AB72-3E05-45EE-9000-9515F5A139AC}.Debug|x64.ActiveCfg = Debug|Any CPU - {3501AB72-3E05-45EE-9000-9515F5A139AC}.Debug|x64.Build.0 = Debug|Any CPU - {3501AB72-3E05-45EE-9000-9515F5A139AC}.Debug|x86.ActiveCfg = Debug|Any CPU - {3501AB72-3E05-45EE-9000-9515F5A139AC}.Debug|x86.Build.0 = Debug|Any CPU - {3501AB72-3E05-45EE-9000-9515F5A139AC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3501AB72-3E05-45EE-9000-9515F5A139AC}.Release|Any CPU.Build.0 = Release|Any CPU - {3501AB72-3E05-45EE-9000-9515F5A139AC}.Release|x64.ActiveCfg = Release|Any CPU - {3501AB72-3E05-45EE-9000-9515F5A139AC}.Release|x64.Build.0 = Release|Any CPU - {3501AB72-3E05-45EE-9000-9515F5A139AC}.Release|x86.ActiveCfg = Release|Any CPU - {3501AB72-3E05-45EE-9000-9515F5A139AC}.Release|x86.Build.0 = Release|Any CPU - {04B21F0F-E645-44E3-868B-3C97E435FB74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {04B21F0F-E645-44E3-868B-3C97E435FB74}.Debug|Any CPU.Build.0 = Debug|Any CPU - {04B21F0F-E645-44E3-868B-3C97E435FB74}.Debug|x64.ActiveCfg = Debug|Any CPU - {04B21F0F-E645-44E3-868B-3C97E435FB74}.Debug|x64.Build.0 = Debug|Any CPU - {04B21F0F-E645-44E3-868B-3C97E435FB74}.Debug|x86.ActiveCfg = Debug|Any CPU - {04B21F0F-E645-44E3-868B-3C97E435FB74}.Debug|x86.Build.0 = Debug|Any CPU - {04B21F0F-E645-44E3-868B-3C97E435FB74}.Release|Any CPU.ActiveCfg = Release|Any CPU - {04B21F0F-E645-44E3-868B-3C97E435FB74}.Release|Any CPU.Build.0 = Release|Any CPU - {04B21F0F-E645-44E3-868B-3C97E435FB74}.Release|x64.ActiveCfg = Release|Any CPU - {04B21F0F-E645-44E3-868B-3C97E435FB74}.Release|x64.Build.0 = Release|Any CPU - {04B21F0F-E645-44E3-868B-3C97E435FB74}.Release|x86.ActiveCfg = Release|Any CPU - {04B21F0F-E645-44E3-868B-3C97E435FB74}.Release|x86.Build.0 = Release|Any CPU - {27351B2F-325B-4843-9F4C-BC53FD06A7B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {27351B2F-325B-4843-9F4C-BC53FD06A7B5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {27351B2F-325B-4843-9F4C-BC53FD06A7B5}.Debug|x64.ActiveCfg = Debug|Any CPU - {27351B2F-325B-4843-9F4C-BC53FD06A7B5}.Debug|x64.Build.0 = Debug|Any CPU - {27351B2F-325B-4843-9F4C-BC53FD06A7B5}.Debug|x86.ActiveCfg = Debug|Any CPU - {27351B2F-325B-4843-9F4C-BC53FD06A7B5}.Debug|x86.Build.0 = Debug|Any CPU - {27351B2F-325B-4843-9F4C-BC53FD06A7B5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {27351B2F-325B-4843-9F4C-BC53FD06A7B5}.Release|Any CPU.Build.0 = Release|Any CPU - {27351B2F-325B-4843-9F4C-BC53FD06A7B5}.Release|x64.ActiveCfg = Release|Any CPU - {27351B2F-325B-4843-9F4C-BC53FD06A7B5}.Release|x64.Build.0 = Release|Any CPU - {27351B2F-325B-4843-9F4C-BC53FD06A7B5}.Release|x86.ActiveCfg = Release|Any CPU - {27351B2F-325B-4843-9F4C-BC53FD06A7B5}.Release|x86.Build.0 = Release|Any CPU - {CF517B15-B307-4660-87D5-CC036ADECD4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CF517B15-B307-4660-87D5-CC036ADECD4B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CF517B15-B307-4660-87D5-CC036ADECD4B}.Debug|x64.ActiveCfg = Debug|x64 - {CF517B15-B307-4660-87D5-CC036ADECD4B}.Debug|x64.Build.0 = Debug|x64 - {CF517B15-B307-4660-87D5-CC036ADECD4B}.Debug|x86.ActiveCfg = Debug|x86 - {CF517B15-B307-4660-87D5-CC036ADECD4B}.Debug|x86.Build.0 = Debug|x86 - {CF517B15-B307-4660-87D5-CC036ADECD4B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CF517B15-B307-4660-87D5-CC036ADECD4B}.Release|Any CPU.Build.0 = Release|Any CPU - {CF517B15-B307-4660-87D5-CC036ADECD4B}.Release|x64.ActiveCfg = Release|x64 - {CF517B15-B307-4660-87D5-CC036ADECD4B}.Release|x64.Build.0 = Release|x64 - {CF517B15-B307-4660-87D5-CC036ADECD4B}.Release|x86.ActiveCfg = Release|x86 - {CF517B15-B307-4660-87D5-CC036ADECD4B}.Release|x86.Build.0 = Release|x86 - {42A0CAB4-FFAD-47D4-9880-C0F4EDCF93DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {42A0CAB4-FFAD-47D4-9880-C0F4EDCF93DE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {42A0CAB4-FFAD-47D4-9880-C0F4EDCF93DE}.Debug|x64.ActiveCfg = Debug|Any CPU - {42A0CAB4-FFAD-47D4-9880-C0F4EDCF93DE}.Debug|x64.Build.0 = Debug|Any CPU - {42A0CAB4-FFAD-47D4-9880-C0F4EDCF93DE}.Debug|x86.ActiveCfg = Debug|Any CPU - {42A0CAB4-FFAD-47D4-9880-C0F4EDCF93DE}.Debug|x86.Build.0 = Debug|Any CPU - {42A0CAB4-FFAD-47D4-9880-C0F4EDCF93DE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {42A0CAB4-FFAD-47D4-9880-C0F4EDCF93DE}.Release|Any CPU.Build.0 = Release|Any CPU - {42A0CAB4-FFAD-47D4-9880-C0F4EDCF93DE}.Release|x64.ActiveCfg = Release|Any CPU - {42A0CAB4-FFAD-47D4-9880-C0F4EDCF93DE}.Release|x64.Build.0 = Release|Any CPU - {42A0CAB4-FFAD-47D4-9880-C0F4EDCF93DE}.Release|x86.ActiveCfg = Release|Any CPU - {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}.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 - EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {FC849626-89C9-4F50-A2CA-53C4315A87F8} = {5FF48976-B083-4E3B-A8E7-6FCD225D5C8E} - {5767D8F0-4ED9-4083-8BDC-ED9E65AA86EF} = {15DDC326-69C3-4081-8AA1-B578B2BDE2C6} - {92BA9F90-E25B-4A1C-9598-2295D3DFC12F} = {BB393A93-1770-4753-B7D6-56F0DD378177} + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BEA33DFA-8559-4680-B40A-B522FBF37567}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BEA33DFA-8559-4680-B40A-B522FBF37567}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BEA33DFA-8559-4680-B40A-B522FBF37567}.Debug|x64.ActiveCfg = Debug|x64 + {BEA33DFA-8559-4680-B40A-B522FBF37567}.Debug|x64.Build.0 = Debug|x64 + {BEA33DFA-8559-4680-B40A-B522FBF37567}.Debug|x86.ActiveCfg = Debug|x86 + {BEA33DFA-8559-4680-B40A-B522FBF37567}.Debug|x86.Build.0 = Debug|x86 + {BEA33DFA-8559-4680-B40A-B522FBF37567}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BEA33DFA-8559-4680-B40A-B522FBF37567}.Release|Any CPU.Build.0 = Release|Any CPU + {BEA33DFA-8559-4680-B40A-B522FBF37567}.Release|x64.ActiveCfg = Release|x64 + {BEA33DFA-8559-4680-B40A-B522FBF37567}.Release|x64.Build.0 = Release|x64 + {BEA33DFA-8559-4680-B40A-B522FBF37567}.Release|x86.ActiveCfg = Release|x86 + {BEA33DFA-8559-4680-B40A-B522FBF37567}.Release|x86.Build.0 = Release|x86 + {770FE8B9-6381-4328-AA36-D6A21114701E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {770FE8B9-6381-4328-AA36-D6A21114701E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {770FE8B9-6381-4328-AA36-D6A21114701E}.Debug|x64.ActiveCfg = Debug|x64 + {770FE8B9-6381-4328-AA36-D6A21114701E}.Debug|x64.Build.0 = Debug|x64 + {770FE8B9-6381-4328-AA36-D6A21114701E}.Debug|x86.ActiveCfg = Debug|x86 + {770FE8B9-6381-4328-AA36-D6A21114701E}.Debug|x86.Build.0 = Debug|x86 + {770FE8B9-6381-4328-AA36-D6A21114701E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {770FE8B9-6381-4328-AA36-D6A21114701E}.Release|Any CPU.Build.0 = Release|Any CPU + {770FE8B9-6381-4328-AA36-D6A21114701E}.Release|x64.ActiveCfg = Release|x64 + {770FE8B9-6381-4328-AA36-D6A21114701E}.Release|x64.Build.0 = Release|x64 + {770FE8B9-6381-4328-AA36-D6A21114701E}.Release|x86.ActiveCfg = Release|x86 + {770FE8B9-6381-4328-AA36-D6A21114701E}.Release|x86.Build.0 = Release|x86 + {AEB7B217-D4C4-46F1-9495-87F869F0ABE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AEB7B217-D4C4-46F1-9495-87F869F0ABE4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AEB7B217-D4C4-46F1-9495-87F869F0ABE4}.Debug|x64.ActiveCfg = Debug|x64 + {AEB7B217-D4C4-46F1-9495-87F869F0ABE4}.Debug|x64.Build.0 = Debug|x64 + {AEB7B217-D4C4-46F1-9495-87F869F0ABE4}.Debug|x86.ActiveCfg = Debug|x86 + {AEB7B217-D4C4-46F1-9495-87F869F0ABE4}.Debug|x86.Build.0 = Debug|x86 + {AEB7B217-D4C4-46F1-9495-87F869F0ABE4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AEB7B217-D4C4-46F1-9495-87F869F0ABE4}.Release|Any CPU.Build.0 = Release|Any CPU + {AEB7B217-D4C4-46F1-9495-87F869F0ABE4}.Release|x64.ActiveCfg = Release|x64 + {AEB7B217-D4C4-46F1-9495-87F869F0ABE4}.Release|x64.Build.0 = Release|x64 + {AEB7B217-D4C4-46F1-9495-87F869F0ABE4}.Release|x86.ActiveCfg = Release|x86 + {AEB7B217-D4C4-46F1-9495-87F869F0ABE4}.Release|x86.Build.0 = Release|x86 EndGlobalSection EndGlobal diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/BlockingMemoryStreamTests.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/BlockingMemoryStreamTests.cs deleted file mode 100644 index bb2b2c1d4..000000000 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/BlockingMemoryStreamTests.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Threading; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class BlockingMemoryStreamTests : TestBase - { - /// - /// Tests reading a bigger buffer than what is available. - /// - [Fact] - public void ReadBiggerBuffer() - { - using (var stream = new BlockingMemoryStream()) - { - stream.Write(new byte[] { 1, 2, 3 }, 0, 3); - - byte[] buffer = new byte[10]; - int count = stream.Read(buffer, 0, buffer.Length); - Assert.Equal(3, count); - Assert.Equal(1, buffer[0]); - Assert.Equal(2, buffer[1]); - Assert.Equal(3, buffer[2]); - } - } - - /// - /// Tests reading smaller buffers than what is available. - /// - [Fact] - public void ReadSmallerBuffers() - { - using (var stream = new BlockingMemoryStream()) - { - stream.Write(new byte[] { 1, 2, 3, 4 }, 0, 4); - stream.Write(new byte[] { 5, 6, 7, 8, 9 }, 0, 5); - - byte[] buffer = new byte[3]; - - int count = stream.Read(buffer, 0, buffer.Length); - Assert.Equal(3, count); - Assert.Equal(1, buffer[0]); - Assert.Equal(2, buffer[1]); - Assert.Equal(3, buffer[2]); - - count = stream.Read(buffer, 0, buffer.Length); - Assert.Equal(1, count); - Assert.Equal(4, buffer[0]); - - count = stream.Read(buffer, 0, buffer.Length); - Assert.Equal(3, count); - Assert.Equal(5, buffer[0]); - Assert.Equal(6, buffer[1]); - Assert.Equal(7, buffer[2]); - - count = stream.Read(buffer, 0, buffer.Length); - Assert.Equal(2, count); - Assert.Equal(8, buffer[0]); - Assert.Equal(9, buffer[1]); - } - } - - /// - /// Tests reading will block until the stream is written to. - /// - [Fact] - public void TestReadBlocksUntilWrite() - { - using (var stream = new BlockingMemoryStream()) - { - ManualResetEvent readerThreadExecuting = new ManualResetEvent(false); - bool readerThreadSuccessful = false; - - Thread readerThread = new Thread(() => - { - byte[] buffer = new byte[10]; - readerThreadExecuting.Set(); - int count = stream.Read(buffer, 0, buffer.Length); - - Assert.Equal(3, count); - Assert.Equal(1, buffer[0]); - Assert.Equal(2, buffer[1]); - Assert.Equal(3, buffer[2]); - - readerThreadSuccessful = true; - }); - - readerThread.IsBackground = true; - readerThread.Start(); - - // ensure the thread is executing - readerThreadExecuting.WaitOne(); - - Assert.True(readerThread.IsAlive); - - // give it a little while to ensure it is blocking - Thread.Sleep(10); - Assert.True(readerThread.IsAlive); - - stream.Write(new byte[] { 1, 2, 3 }, 0, 3); - - Assert.True(readerThread.Join(1000)); - Assert.True(readerThreadSuccessful); - } - } - } -} diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/BuiltInCommandTests.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/BuiltInCommandTests.cs deleted file mode 100644 index 03757f92a..000000000 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/BuiltInCommandTests.cs +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using System.Linq; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; - -namespace Microsoft.DotNet.Cli.Utils -{ - public class BuiltInCommandTests : TestBase - { - /// - /// Tests that BuiltInCommand.Execute returns the correct exit code and a - /// valid StartInfo FileName and Arguments. - /// - [Fact] - public void TestExecute() - { - Func testCommand = args => args.Length; - string[] testCommandArgs = new[] { "1", "2" }; - - var builtInCommand = new BuiltInCommand("fakeCommand", testCommandArgs, testCommand, new TestBuiltInCommandEnvironment()); - CommandResult result = builtInCommand.Execute(); - - Assert.Equal(testCommandArgs.Length, result.ExitCode); - Assert.Equal(new Muxer().MuxerPath, result.StartInfo.FileName); - Assert.Equal("fakeCommand 1 2", result.StartInfo.Arguments); - } - - /// - /// Tests that BuiltInCommand.Execute raises the OnOutputLine and OnErrorLine - /// the correct number of times and with the correct content. - /// - [Fact] - public void TestOnOutputLines() - { - const int exitCode = 29; - - TestBuiltInCommandEnvironment environment = new TestBuiltInCommandEnvironment(); - - Func testCommand = args => - { - TextWriter outWriter = environment.GetConsoleOut(); - outWriter.Write("first"); - outWriter.WriteLine("second"); - outWriter.WriteLine("third"); - - TextWriter errorWriter = environment.GetConsoleError(); - errorWriter.WriteLine("fourth"); - errorWriter.WriteLine("fifth"); - - return exitCode; - }; - - int onOutputLineCallCount = 0; - int onErrorLineCallCount = 0; - - CommandResult result = new BuiltInCommand("fakeCommand", Enumerable.Empty(), testCommand, environment) - .OnOutputLine(line => - { - onOutputLineCallCount++; - - if (onOutputLineCallCount == 1) - { - Assert.Equal($"firstsecond", line); - } - else - { - Assert.Equal($"third", line); - } - }) - .OnErrorLine(line => - { - onErrorLineCallCount++; - - if (onErrorLineCallCount == 1) - { - Assert.Equal($"fourth", line); - } - else - { - Assert.Equal($"fifth", line); - } - }) - .Execute(); - - Assert.Equal(exitCode, result.ExitCode); - Assert.Equal(2, onOutputLineCallCount); - Assert.Equal(2, onErrorLineCallCount); - } - - private class TestBuiltInCommandEnvironment : IBuiltInCommandEnvironment - { - private TextWriter _consoleOut; - private TextWriter _consoleError; - - public TextWriter GetConsoleOut() - { - return _consoleOut; - } - - public void SetConsoleOut(TextWriter newOut) - { - _consoleOut = newOut; - } - - public TextWriter GetConsoleError() - { - return _consoleError; - } - - public void SetConsoleError(TextWriter newError) - { - _consoleError = newError; - } - - public string GetWorkingDirectory() - { - return Directory.GetCurrentDirectory(); - } - - public void SetWorkingDirectory(string path) - { - // no-op - } - } - } -} diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/CommandResolverTestUtils.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/CommandResolverTestUtils.cs deleted file mode 100644 index c83237012..000000000 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/CommandResolverTestUtils.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; - -namespace Microsoft.DotNet.Cli.Utils.Tests -{ - public static class CommandResolverTestUtils - { - public static string CreateNonRunnableTestCommand(string directory, string filename, string extension=".dll") - { - Directory.CreateDirectory(directory); - - var filePath = Path.Combine(directory, filename + extension); - - File.WriteAllText(filePath, "test command that does nothing."); - - return filePath; - } - - public static IEnvironmentProvider SetupEnvironmentProviderWhichFindsExtensions(params string[] extensions) - { - return new EnvironmentProvider(extensions); - } - } -} diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenACompositeCommandResolver.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenACompositeCommandResolver.cs deleted file mode 100644 index 1e9e9129c..000000000 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenACompositeCommandResolver.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using FluentAssertions; -using Microsoft.DotNet.Tools.Test.Utilities; -using Moq; -using Xunit; - -namespace Microsoft.DotNet.Cli.Utils.Tests -{ - public class GivenACompositeCommandResolver - { - [Fact] - public void It_iterates_through_all_added_resolvers_in_order_when_they_return_null() - { - var compositeCommandResolver = new CompositeCommandResolver(); - - var resolverCalls = new List(); - - var mockResolver1 = new Mock(); - mockResolver1.Setup(r => r - .Resolve(It.IsAny())) - .Returns(default(CommandSpec)) - .Callback(() => resolverCalls.Add(1)); - - var mockResolver2 = new Mock(); - mockResolver2.Setup(r => r - .Resolve(It.IsAny())) - .Returns(default(CommandSpec)) - .Callback(() => resolverCalls.Add(2)); - - compositeCommandResolver.AddCommandResolver(mockResolver1.Object); - compositeCommandResolver.AddCommandResolver(mockResolver2.Object); - - compositeCommandResolver.Resolve(default(CommandResolverArguments)); - - resolverCalls.Should() - .HaveCount(2) - .And - .ContainInOrder(new [] {1, 2}); - - } - - [Fact] - public void It_stops_iterating_through_added_resolvers_when_one_returns_nonnull() - { - var compositeCommandResolver = new CompositeCommandResolver(); - - var resolverCalls = new List(); - - var mockResolver1 = new Mock(); - mockResolver1.Setup(r => r - .Resolve(It.IsAny())) - .Returns(new CommandSpec(null, null, default(CommandResolutionStrategy))) - .Callback(() => resolverCalls.Add(1)); - - var mockResolver2 = new Mock(); - mockResolver2.Setup(r => r - .Resolve(It.IsAny())) - .Returns(default(CommandSpec)) - .Callback(() => resolverCalls.Add(2)); - - compositeCommandResolver.AddCommandResolver(mockResolver1.Object); - compositeCommandResolver.AddCommandResolver(mockResolver2.Object); - - compositeCommandResolver.Resolve(default(CommandResolverArguments)); - - resolverCalls.Should() - .HaveCount(1) - .And - .ContainInOrder(new [] {1}); - - } - } -} diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenADefaultCommandResolver.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenADefaultCommandResolver.cs deleted file mode 100644 index b2e354e30..000000000 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenADefaultCommandResolver.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Linq; -using FluentAssertions; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; - -namespace Microsoft.DotNet.Cli.Utils.Tests -{ - public class GivenADefaultCommandResolver - { - [Fact] - public void It_contains_resolvers_in_the_right_order() - { - var defaultCommandResolver = DefaultCommandResolverPolicy.Create(); - - var resolvers = defaultCommandResolver.OrderedCommandResolvers; - - resolvers.Should().HaveCount(7); - - resolvers.Select(r => r.GetType()) - .Should() - .ContainInOrder( - new []{ - typeof(MuxerCommandResolver), - typeof(RootedCommandResolver), - typeof(ProjectToolsCommandResolver), - typeof(AppBaseDllCommandResolver), - typeof(AppBaseCommandResolver), - typeof(PathCommandResolver), - typeof(PublishedPathCommandResolver) - }); - } - } -} diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectDependenciesCommandFactory.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectDependenciesCommandFactory.cs deleted file mode 100644 index 109a449fc..000000000 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectDependenciesCommandFactory.cs +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using FluentAssertions; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using NuGet.Frameworks; -using Xunit; - -namespace Microsoft.DotNet.Cli.Utils.Tests -{ - public class GivenAProjectDependenciesCommandFactory : TestBase - { - private static readonly NuGetFramework s_desktopTestFramework = FrameworkConstants.CommonFrameworks.Net451; - - private RepoDirectoriesProvider _repoDirectoriesProvider; - - public GivenAProjectDependenciesCommandFactory() - { - _repoDirectoriesProvider = new RepoDirectoriesProvider(); - Environment.SetEnvironmentVariable( - Constants.MSBUILD_EXE_PATH, - Path.Combine(_repoDirectoriesProvider.Stage2Sdk, "MSBuild.dll")); - } - - [WindowsOnlyFact] - public void It_resolves_desktop_apps_defaulting_to_Debug_Configuration() - { - var configuration = "Debug"; - - var testInstance = TestAssets.Get(TestAssetKinds.DesktopTestProjects, "AppWithProjTool2Fx") - .CreateInstance() - .WithSourceFiles() - .WithNuGetConfig(_repoDirectoriesProvider.TestPackages); - - var restoreCommand = new RestoreCommand() - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput() - .Should().Pass(); - - var buildCommand = new BuildCommand() - .WithWorkingDirectory(testInstance.Root) - .WithConfiguration(configuration) - .WithCapturedOutput() - .Execute() - .Should().Pass(); - - var factory = new ProjectDependenciesCommandFactory( - s_desktopTestFramework, - null, - null, - null, - testInstance.Root.FullName); - - var command = factory.Create("dotnet-desktop-and-portable", null); - - command.CommandName.Should().Contain(testInstance.Root.GetDirectory("bin", configuration).FullName); - - Path.GetFileName(command.CommandName).Should().Be("dotnet-desktop-and-portable.exe"); - } - - [WindowsOnlyFact] - public void It_resolves_desktop_apps_when_configuration_is_Debug() - { - var configuration = "Debug"; - - var testInstance = TestAssets.Get(TestAssetKinds.DesktopTestProjects, "AppWithProjTool2Fx") - .CreateInstance() - .WithSourceFiles() - .WithNuGetConfig(_repoDirectoriesProvider.TestPackages); - - var restoreCommand = new RestoreCommand() - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput() - .Should().Pass(); - - var buildCommand = new BuildCommand() - .WithWorkingDirectory(testInstance.Root) - .WithConfiguration(configuration) - .Execute() - .Should().Pass(); - - var factory = new ProjectDependenciesCommandFactory( - s_desktopTestFramework, - configuration, - null, - null, - testInstance.Root.FullName); - - var command = factory.Create("dotnet-desktop-and-portable", null); - - command.CommandName.Should().Contain(testInstance.Root.GetDirectory("bin", configuration).FullName); - Path.GetFileName(command.CommandName).Should().Be("dotnet-desktop-and-portable.exe"); - } - - [WindowsOnlyFact] - public void It_resolves_desktop_apps_when_configuration_is_Release() - { - var configuration = "Debug"; - - var testInstance = TestAssets.Get(TestAssetKinds.DesktopTestProjects, "AppWithProjTool2Fx") - .CreateInstance() - .WithSourceFiles() - .WithNuGetConfig(_repoDirectoriesProvider.TestPackages); - - var restoreCommand = new RestoreCommand() - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput() - .Should().Pass(); - - var buildCommand = new BuildCommand() - .WithWorkingDirectory(testInstance.Root) - .WithConfiguration(configuration) - .WithCapturedOutput() - .Execute() - .Should().Pass(); - - var factory = new ProjectDependenciesCommandFactory( - s_desktopTestFramework, - configuration, - null, - null, - testInstance.Root.FullName); - - var command = factory.Create("dotnet-desktop-and-portable", null); - - command.CommandName.Should().Contain(testInstance.Root.GetDirectory("bin", configuration).FullName); - - Path.GetFileName(command.CommandName).Should().Be("dotnet-desktop-and-portable.exe"); - } - - [WindowsOnlyFact] - public void It_resolves_desktop_apps_using_configuration_passed_to_create() - { - var configuration = "Debug"; - - var testInstance = TestAssets.Get(TestAssetKinds.DesktopTestProjects, "AppWithProjTool2Fx") - .CreateInstance() - .WithSourceFiles() - .WithNuGetConfig(_repoDirectoriesProvider.TestPackages); - - var restoreCommand = new RestoreCommand() - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput() - .Should().Pass(); - - var buildCommand = new BuildCommand() - .WithWorkingDirectory(testInstance.Root) - .WithConfiguration(configuration) - .WithCapturedOutput() - .Execute() - .Should().Pass(); - - var factory = new ProjectDependenciesCommandFactory( - s_desktopTestFramework, - "Debug", - null, - null, - testInstance.Root.FullName); - - var command = factory.Create("dotnet-desktop-and-portable", null, configuration: configuration); - - command.CommandName.Should().Contain(testInstance.Root.GetDirectory("bin", configuration).FullName); - - Path.GetFileName(command.CommandName).Should().Be("dotnet-desktop-and-portable.exe"); - } - - [Fact] - public void It_resolves_tools_whose_package_name_is_different_than_dll_name() - { - Environment.SetEnvironmentVariable( - Constants.MSBUILD_EXE_PATH, - Path.Combine(new RepoDirectoriesProvider().Stage2Sdk, "MSBuild.dll")); - - var configuration = "Debug"; - - var testInstance = TestAssets.Get("AppWithDirectDepWithOutputName") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var buildCommand = new BuildCommand() - .WithProjectDirectory(testInstance.Root) - .WithConfiguration(configuration) - .WithCapturedOutput() - .Execute() - .Should().Pass(); - - var factory = new ProjectDependenciesCommandFactory( - FrameworkConstants.CommonFrameworks.NetCoreApp20, - configuration, - null, - null, - testInstance.Root.FullName); - - 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")); - } - } -} diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectDependencyCommandResolver.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectDependencyCommandResolver.cs deleted file mode 100644 index 74e4ec4e1..000000000 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectDependencyCommandResolver.cs +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) .NET 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.Cli; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.InternalAbstractions; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using NuGet.Frameworks; -using Xunit; - -namespace Microsoft.DotNet.Cli.Utils.Tests -{ - public class GivenAProjectDependencyCommandResolver : TestBase - { - private TestAssetInstance MSBuildTestProjectInstance; - - public GivenAProjectDependencyCommandResolver() - { - Environment.SetEnvironmentVariable( - Constants.MSBUILD_EXE_PATH, - Path.Combine(new RepoDirectoriesProvider().Stage2Sdk, "MSBuild.dll")); - } - - [Fact] - public void ItReturnsACommandSpecWhenToolIsInAProjectRef() - { - MSBuildTestProjectInstance = - TestAssets.Get("TestAppWithProjDepTool") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - new BuildCommand() - .WithProjectDirectory(MSBuildTestProjectInstance.Root) - .WithConfiguration("Debug") - .Execute() - .Should().Pass(); - - var projectDependenciesCommandResolver = SetupProjectDependenciesCommandResolver(); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "dotnet-portable", - Configuration = "Debug", - ProjectDirectory = MSBuildTestProjectInstance.Root.FullName, - Framework = FrameworkConstants.CommonFrameworks.NetCoreApp20 - }; - - var result = projectDependenciesCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - - var commandFile = Path.GetFileNameWithoutExtension(result.Path); - - commandFile.Should().Be("dotnet"); - - result.Args.Should().Contain(commandResolverArguments.CommandName); - } - - [Fact] - public void ItPassesDepsfileArgToHostWhenReturningACommandSpecForMSBuildProject() - { - MSBuildTestProjectInstance = - TestAssets.Get("TestAppWithProjDepTool") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - new BuildCommand() - .WithProjectDirectory(MSBuildTestProjectInstance.Root) - .WithConfiguration("Debug") - .Execute() - .Should().Pass(); - - var projectDependenciesCommandResolver = SetupProjectDependenciesCommandResolver(); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "dotnet-portable", - Configuration = "Debug", - ProjectDirectory = MSBuildTestProjectInstance.Root.FullName, - Framework = FrameworkConstants.CommonFrameworks.NetCoreApp20 - }; - - var result = projectDependenciesCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - - result.Args.Should().Contain("--depsfile"); - } - - [Fact] - public void ItReturnsNullWhenCommandNameDoesNotExistInProjectDependenciesForMSBuildProject() - { - MSBuildTestProjectInstance = - TestAssets.Get("TestAppWithProjDepTool") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var projectDependenciesCommandResolver = SetupProjectDependenciesCommandResolver(); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "nonexistent-command", - CommandArguments = null, - ProjectDirectory = MSBuildTestProjectInstance.Root.FullName, - Framework = FrameworkConstants.CommonFrameworks.NetCoreApp20 - }; - - var result = projectDependenciesCommandResolver.Resolve(commandResolverArguments); - - result.Should().BeNull(); - } - - [Fact] - public void ItSetsDepsfileToOutputInCommandspecForMSBuild() - { - var testInstance = TestAssets - .Get("TestAppWithProjDepTool") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var projectDependenciesCommandResolver = SetupProjectDependenciesCommandResolver(); - - var outputDir = testInstance.Root.GetDirectory("out"); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "dotnet-portable", - Configuration = "Debug", - ProjectDirectory = testInstance.Root.FullName, - Framework = FrameworkConstants.CommonFrameworks.NetCoreApp20, - OutputPath = outputDir.FullName - }; - - new BuildCommand() - .WithWorkingDirectory(testInstance.Root) - .Execute($"-o {outputDir.FullName}") - .Should() - .Pass(); - - var result = projectDependenciesCommandResolver.Resolve(commandResolverArguments); - - var depsFilePath = outputDir.GetFile("TestAppWithProjDepTool.deps.json"); - - result.Should().NotBeNull(); - result.Args.Should().Contain($"--depsfile {depsFilePath.FullName}"); - } - - private ProjectDependenciesCommandResolver SetupProjectDependenciesCommandResolver( - IEnvironmentProvider environment = null, - IPackagedCommandSpecFactory packagedCommandSpecFactory = null) - { - Environment.SetEnvironmentVariable( - Constants.MSBUILD_EXE_PATH, - Path.Combine(new RepoDirectoriesProvider().Stage2Sdk, "MSBuild.dll")); - - CommandContext.SetVerbose(true); - - environment = environment ?? new EnvironmentProvider(); - - packagedCommandSpecFactory = packagedCommandSpecFactory ?? new PackagedCommandSpecFactory(); - - var projectDependenciesCommandResolver = new ProjectDependenciesCommandResolver(environment, packagedCommandSpecFactory); - - return projectDependenciesCommandResolver; - } - } -} diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectPathCommandResolver.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectPathCommandResolver.cs deleted file mode 100644 index e542338d5..000000000 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectPathCommandResolver.cs +++ /dev/null @@ -1,255 +0,0 @@ -// Copyright (c) .NET 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.PlatformAbstractions; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; - -namespace Microsoft.DotNet.Cli.Utils.Tests -{ - public class GivenAProjectPathCommandResolver - { - private static readonly string s_testProjectDirectory = Path.Combine(AppContext.BaseDirectory, "testprojectdirectory"); - - [Fact] - public void It_returns_null_when_CommandName_is_null() - { - var projectPathCommandResolver = SetupPlatformProjectPathCommandResolver(forceGeneric: true); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = null, - CommandArguments = new string[] { "" }, - ProjectDirectory = "/some/directory" - }; - - var result = projectPathCommandResolver.Resolve(commandResolverArguments); - - result.Should().BeNull(); - } - - [Fact] - public void It_returns_null_when_ProjectDirectory_is_null() - { - var projectPathCommandResolver = SetupPlatformProjectPathCommandResolver(forceGeneric: true); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "command", - CommandArguments = new string[] { "" }, - ProjectDirectory = null - }; - - var result = projectPathCommandResolver.Resolve(commandResolverArguments); - - result.Should().BeNull(); - } - - [Fact] - public void It_returns_null_when_CommandName_does_not_exist_in_ProjectDirectory() - { - var projectPathCommandResolver = SetupPlatformProjectPathCommandResolver(forceGeneric: true); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "nonexistent-command", - CommandArguments = null, - ProjectDirectory = s_testProjectDirectory - }; - - var result = projectPathCommandResolver.Resolve(commandResolverArguments); - - result.Should().BeNull(); - } - - [Fact] - public void It_returns_null_when_CommandName_exists_in_a_subdirectory_of_ProjectDirectory() - { - var environment = CommandResolverTestUtils.SetupEnvironmentProviderWhichFindsExtensions(".exe"); - var projectPathCommandResolver = SetupPlatformProjectPathCommandResolver(environment, forceGeneric: true); - - var testDir = Path.Combine(s_testProjectDirectory, "projectpathtestsubdir"); - CommandResolverTestUtils.CreateNonRunnableTestCommand(testDir, "projectpathtestsubdircommand", ".exe"); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "projectpathtestsubdircommand", - CommandArguments = null, - ProjectDirectory = s_testProjectDirectory - }; - - var result = projectPathCommandResolver.Resolve(commandResolverArguments); - - result.Should().BeNull(); - } - - [Fact] - public void It_returns_a_CommandSpec_with_CommandName_as_FileName_when_CommandName_exists_in_ProjectDirectory() - { - var environment = CommandResolverTestUtils.SetupEnvironmentProviderWhichFindsExtensions(".exe"); - var projectPathCommandResolver = SetupPlatformProjectPathCommandResolver(environment, forceGeneric: true); - - CommandResolverTestUtils.CreateNonRunnableTestCommand(s_testProjectDirectory, "projectpathtestcommand1", ".exe"); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "projectpathtestcommand1", - CommandArguments = null, - ProjectDirectory = s_testProjectDirectory - }; - - var result = projectPathCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - - var commandFile = Path.GetFileNameWithoutExtension(result.Path); - - commandFile.Should().Be("projectpathtestcommand1"); - } - - [Fact] - public void It_escapes_CommandArguments_when_returning_a_CommandSpec() - { - var environment = CommandResolverTestUtils.SetupEnvironmentProviderWhichFindsExtensions(".exe"); - var projectPathCommandResolver = SetupPlatformProjectPathCommandResolver(environment, forceGeneric: true); - - CommandResolverTestUtils.CreateNonRunnableTestCommand(s_testProjectDirectory, "projectpathtestcommand1", ".exe"); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "projectpathtestcommand1", - CommandArguments = new[] { "arg with space" }, - ProjectDirectory = s_testProjectDirectory - }; - - var result = projectPathCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - result.Args.Should().Be("\"arg with space\""); - } - - [Fact] - public void It_resolves_commands_with_extensions_defined_in_InferredExtensions() - { - var extensions = new string[] { ".sh", ".cmd", ".foo", ".exe" }; - var projectPathCommandResolver = SetupPlatformProjectPathCommandResolver(forceGeneric: true); - - foreach (var extension in extensions) - { - var extensionTestDir = Path.Combine(s_testProjectDirectory, "testext" + extension); - - CommandResolverTestUtils.CreateNonRunnableTestCommand(extensionTestDir, "projectpathexttest", extension); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "projectpathexttest", - CommandArguments = null, - ProjectDirectory = extensionTestDir, - InferredExtensions = extensions - }; - - var result = projectPathCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - - var commandFileName = Path.GetFileName(result.Path); - commandFileName.Should().Be("projectpathexttest" + extension); - } - } - - [Fact] - public void It_returns_a_CommandSpec_with_Args_as_stringEmpty_when_returning_a_CommandSpec_and_CommandArguments_are_null() - { - var environment = CommandResolverTestUtils.SetupEnvironmentProviderWhichFindsExtensions(".exe"); - var projectPathCommandResolver = SetupPlatformProjectPathCommandResolver(environment, forceGeneric: true); - - CommandResolverTestUtils.CreateNonRunnableTestCommand(s_testProjectDirectory, "projectpathtestcommand1", ".exe"); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "projectpathtestcommand1", - CommandArguments = null, - ProjectDirectory = s_testProjectDirectory - }; - - var result = projectPathCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - result.Args.Should().Be(string.Empty); - } - - [Fact] - public void It_prefers_EXE_over_CMD_when_two_command_candidates_exist_and_using_WindowsExePreferredCommandSpecFactory() - { - var environment = CommandResolverTestUtils.SetupEnvironmentProviderWhichFindsExtensions(".exe"); - var platformCommandSpecFactory = new WindowsExePreferredCommandSpecFactory(); - - var projectPathCommandResolver = new ProjectPathCommandResolver(environment, platformCommandSpecFactory); - - CommandResolverTestUtils.CreateNonRunnableTestCommand(s_testProjectDirectory, "projectpathtestcommand1", ".exe"); - CommandResolverTestUtils.CreateNonRunnableTestCommand(s_testProjectDirectory, "projectpathtestcommand1", ".cmd"); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "projectpathtestcommand1", - CommandArguments = null, - ProjectDirectory = s_testProjectDirectory - }; - - var result = projectPathCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - - var commandFile = Path.GetFileName(result.Path); - commandFile.Should().Be("projectpathtestcommand1.exe"); - } - - public void It_wraps_command_with_CMD_EXE_when_command_has_CMD_Extension_and_using_WindowsExePreferredCommandSpecFactory() - { - var environment = new EnvironmentProvider(new[] { ".cmd" }); - var platformCommandSpecFactory = new WindowsExePreferredCommandSpecFactory(); - - var pathCommandResolver = new PathCommandResolver(environment, platformCommandSpecFactory); - - var testCommandPath = - CommandResolverTestUtils.CreateNonRunnableTestCommand(s_testProjectDirectory, "cmdWrapCommand", ".cmd"); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "cmdWrapCommand", - CommandArguments = null - }; - - var result = pathCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - - var commandFile = Path.GetFileName(result.Path); - commandFile.Should().Be("cmd.exe"); - - result.Args.Should().Contain(testCommandPath); - } - - private ProjectPathCommandResolver SetupPlatformProjectPathCommandResolver( - IEnvironmentProvider environment = null, - bool forceGeneric = false) - { - environment = environment ?? new EnvironmentProvider(); - - IPlatformCommandSpecFactory platformCommandSpecFactory = new GenericPlatformCommandSpecFactory(); - - if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows - && !forceGeneric) - { - platformCommandSpecFactory = new WindowsExePreferredCommandSpecFactory(); - } - - var projectPathCommandResolver = new ProjectPathCommandResolver(environment, platformCommandSpecFactory); - - return projectPathCommandResolver; - } - } -} diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs deleted file mode 100644 index 7fe281b5d..000000000 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs +++ /dev/null @@ -1,468 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using System.Linq; -using FluentAssertions; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using NuGet.Frameworks; -using NuGet.ProjectModel; -using NuGet.Versioning; -using Xunit; - -namespace Microsoft.DotNet.Tests -{ - public class GivenAProjectToolsCommandResolver : TestBase - { - private static readonly NuGetFramework s_toolPackageFramework = - FrameworkConstants.CommonFrameworks.NetCoreApp20; - - private const string TestProjectName = "AppWithToolDependency"; - - [Fact] - public void ItReturnsNullWhenCommandNameIsNull() - { - var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = null, - CommandArguments = new string[] { "" }, - ProjectDirectory = "/some/directory" - }; - - var result = projectToolsCommandResolver.Resolve(commandResolverArguments); - - result.Should().BeNull(); - } - - [Fact] - public void ItReturnsNullWhenProjectDirectoryIsNull() - { - var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "command", - CommandArguments = new string[] { "" }, - ProjectDirectory = null - }; - - var result = projectToolsCommandResolver.Resolve(commandResolverArguments); - - result.Should().BeNull(); - } - - [Fact] - public void ItReturnsNullWhenProjectDirectoryDoesNotContainAProjectFile() - { - var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); - - var projectDirectory = TestAssets.CreateTestDirectory(); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "command", - CommandArguments = new string[] { "" }, - ProjectDirectory = projectDirectory.Root.FullName - }; - - var result = projectToolsCommandResolver.Resolve(commandResolverArguments); - - result.Should().BeNull(); - } - - [Fact] - public void ItReturnsNullWhenCommandNameDoesNotExistInProjectTools() - { - var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); - - var testInstance = TestAssets.Get(TestProjectName) - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "nonexistent-command", - CommandArguments = null, - ProjectDirectory = testInstance.Root.FullName - }; - - var result = projectToolsCommandResolver.Resolve(commandResolverArguments); - - result.Should().BeNull(); - } - - [Fact] - public void ItReturnsACommandSpecWithDOTNETAsFileNameAndCommandNameInArgsWhenCommandNameExistsInProjectTools() - { - var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); - - var testInstance = TestAssets.Get(TestProjectName) - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "dotnet-portable", - CommandArguments = null, - ProjectDirectory = testInstance.Root.FullName - }; - - var result = projectToolsCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - - var commandFile = Path.GetFileNameWithoutExtension(result.Path); - - commandFile.Should().Be("dotnet"); - - result.Args.Should().Contain(commandResolverArguments.CommandName); - } - - [Fact] - public void ItEscapesCommandArgumentsWhenReturningACommandSpec() - { - var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); - - var testInstance = TestAssets.Get(TestProjectName) - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "dotnet-portable", - CommandArguments = new[] { "arg with space" }, - ProjectDirectory = testInstance.Root.FullName - }; - - var result = projectToolsCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull("Because the command is a project tool dependency"); - result.Args.Should().Contain("\"arg with space\""); - } - - [Fact] - public void ItReturnsACommandSpecWithArgsContainingCommandPathWhenReturningACommandSpecAndCommandArgumentsAreNull() - { - var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); - - var testInstance = TestAssets.Get(TestProjectName) - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "dotnet-portable", - CommandArguments = null, - ProjectDirectory = testInstance.Root.FullName - }; - - var result = projectToolsCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - - var commandPath = result.Args.Trim('"'); - commandPath.Should().Contain("dotnet-portable.dll"); - } - - [Fact] - public void ItReturnsACommandSpecWithArgsContainingCommandPathWhenInvokingAToolReferencedWithADifferentCasing() - { - var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); - - var testInstance = TestAssets.Get(TestProjectName) - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "dotnet-prefercliruntime", - CommandArguments = null, - ProjectDirectory = testInstance.Root.FullName - }; - - var result = projectToolsCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - - var commandPath = result.Args.Trim('"'); - commandPath.Should().Contain("dotnet-prefercliruntime.dll"); - } - - [Fact] - public void ItWritesADepsJsonFileNextToTheLockfile() - { - var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); - - var testInstance = TestAssets.Get(TestProjectName) - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "dotnet-portable", - CommandArguments = null, - ProjectDirectory = testInstance.Root.FullName - }; - - var repoDirectoriesProvider = new RepoDirectoriesProvider(); - - var nugetPackagesRoot = repoDirectoriesProvider.NugetPackages; - - var toolPathCalculator = new ToolPathCalculator(nugetPackagesRoot); - - var lockFilePath = toolPathCalculator.GetLockFilePath( - "dotnet-portable", - new NuGetVersion("1.0.0"), - s_toolPackageFramework); - - var directory = Path.GetDirectoryName(lockFilePath); - - var depsJsonFile = Directory - .EnumerateFiles(directory) - .FirstOrDefault(p => Path.GetFileName(p).EndsWith(FileNameSuffixes.DepsJson)); - - if (depsJsonFile != null) - { - File.Delete(depsJsonFile); - } - - var result = projectToolsCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - - new DirectoryInfo(directory) - .Should().HaveFilesMatching("*.deps.json", SearchOption.TopDirectoryOnly); - } - - [Fact] - public void GenerateDepsJsonMethodDoesntOverwriteWhenDepsFileAlreadyExists() - { - var testInstance = TestAssets.Get(TestProjectName) - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var repoDirectoriesProvider = new RepoDirectoriesProvider(); - - var nugetPackagesRoot = repoDirectoriesProvider.NugetPackages; - - var toolPathCalculator = new ToolPathCalculator(nugetPackagesRoot); - - var lockFilePath = toolPathCalculator.GetLockFilePath( - "dotnet-portable", - new NuGetVersion("1.0.0"), - s_toolPackageFramework); - - var lockFile = new LockFileFormat().Read(lockFilePath); - - var depsJsonFile = Path.Combine( - Path.GetDirectoryName(lockFilePath), - "dotnet-portable.deps.json"); - - if (File.Exists(depsJsonFile)) - { - File.Delete(depsJsonFile); - } - File.WriteAllText(depsJsonFile, "temp"); - - var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); - projectToolsCommandResolver.GenerateDepsJsonFile( - lockFile, - s_toolPackageFramework, - depsJsonFile, - new SingleProjectInfo("dotnet-portable", "1.0.0", Enumerable.Empty()), - GetToolDepsJsonGeneratorProject()); - - File.ReadAllText(depsJsonFile).Should().Be("temp"); - File.Delete(depsJsonFile); - } - - [Fact] - public void ItAddsFxVersionAsAParamWhenTheToolHasThePrefercliruntimeFile() - { - var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); - - var testInstance = TestAssets.Get("MSBuildTestApp") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "dotnet-prefercliruntime", - CommandArguments = null, - ProjectDirectory = testInstance.Root.FullName - }; - - var result = projectToolsCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - - result.Args.Should().Contain("--fx-version 2.0.1"); - } - - [Fact] - public void ItDoesNotAddFxVersionAsAParamWhenTheToolDoesNotHaveThePrefercliruntimeFile() - { - var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); - - var testInstance = TestAssets.Get(TestProjectName) - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "dotnet-portable", - CommandArguments = null, - ProjectDirectory = testInstance.Root.FullName - }; - - var result = projectToolsCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - - result.Args.Should().NotContain("--fx-version"); - } - - [Fact] - public void ItFindsToolsLocatedInTheNuGetFallbackFolder() - { - var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); - - var testInstance = TestAssets.Get("AppWithFallbackFolderToolDependency") - .CreateInstance() - .WithSourceFiles() - .WithNuGetConfig(new RepoDirectoriesProvider().TestPackages); - var testProjectDirectory = testInstance.Root.FullName; - var fallbackFolder = Path.Combine(testProjectDirectory, "fallbackFolder"); - - PopulateFallbackFolder(testProjectDirectory, fallbackFolder); - - var nugetConfig = UseNuGetConfigWithFallbackFolder(testInstance, fallbackFolder); - - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute($"--configfile {nugetConfig}") - .Should() - .Pass(); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "dotnet-fallbackfoldertool", - CommandArguments = null, - ProjectDirectory = testProjectDirectory - }; - - var result = projectToolsCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - - var commandPath = result.Args.Trim('"'); - commandPath.Should().Contain(Path.Combine( - fallbackFolder, - "dotnet-fallbackfoldertool", - "1.0.0", - "lib", - "netcoreapp2.0", - "dotnet-fallbackfoldertool.dll")); - } - - [Fact] - public void ItShowsAnErrorWhenTheToolDllIsNotFound() - { - var projectToolsCommandResolver = SetupProjectToolsCommandResolver(); - - var testInstance = TestAssets.Get("AppWithFallbackFolderToolDependency") - .CreateInstance() - .WithSourceFiles() - .WithNuGetConfig(new RepoDirectoriesProvider().TestPackages); - var testProjectDirectory = testInstance.Root.FullName; - var fallbackFolder = Path.Combine(testProjectDirectory, "fallbackFolder"); - - PopulateFallbackFolder(testProjectDirectory, fallbackFolder); - - var nugetConfig = UseNuGetConfigWithFallbackFolder(testInstance, fallbackFolder); - - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute($"--configfile {nugetConfig}") - .Should() - .Pass(); - - Directory.Delete(Path.Combine(fallbackFolder, "dotnet-fallbackfoldertool"), true); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "dotnet-fallbackfoldertool", - CommandArguments = null, - ProjectDirectory = testProjectDirectory - }; - - Action action = () => projectToolsCommandResolver.Resolve(commandResolverArguments); - - action.ShouldThrow().WithMessage( - string.Format(LocalizableStrings.CommandAssembliesNotFound, "dotnet-fallbackfoldertool")); - } - - private void PopulateFallbackFolder(string testProjectDirectory, string fallbackFolder) - { - var nugetConfigPath = Path.Combine(testProjectDirectory, "NuGet.Config"); - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute($"--configfile {nugetConfigPath} --packages {fallbackFolder}") - .Should() - .Pass(); - - Directory.Delete(Path.Combine(fallbackFolder, ".tools"), true); - } - - private string UseNuGetConfigWithFallbackFolder(TestAssetInstance testInstance, string fallbackFolder) - { - var nugetConfig = testInstance.Root.GetFile("NuGet.Config").FullName; - File.WriteAllText( - nugetConfig, - $@" - - - - - - "); - - return nugetConfig; - } - - private ProjectToolsCommandResolver SetupProjectToolsCommandResolver() - { - Environment.SetEnvironmentVariable( - Constants.MSBUILD_EXE_PATH, - Path.Combine(new RepoDirectoriesProvider().Stage2Sdk, "MSBuild.dll")); - - var packagedCommandSpecFactory = new PackagedCommandSpecFactoryWithCliRuntime(); - - var projectToolsCommandResolver = - new ProjectToolsCommandResolver(packagedCommandSpecFactory, new EnvironmentProvider()); - - return projectToolsCommandResolver; - } - - private string GetToolDepsJsonGeneratorProject() - { - // When using the product, the ToolDepsJsonGeneratorProject property is used to get this path, but for testing - // we'll hard code the path inside the SDK since we don't have a project to evaluate here - return Path.Combine(new RepoDirectoriesProvider().Stage2Sdk, "Sdks", "Microsoft.NET.Sdk", "build", "GenerateDeps", "GenerateDeps.proj"); - } - } -} diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenARootedCommandResolver.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenARootedCommandResolver.cs deleted file mode 100644 index adcd3f374..000000000 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenARootedCommandResolver.cs +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using FluentAssertions; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; - -namespace Microsoft.DotNet.Cli.Utils.Tests -{ - public class GivenARootedCommandResolver - { - [Fact] - public void It_returns_null_when_CommandName_is_null() - { - var rootedCommandResolver = new RootedCommandResolver(); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = null, - CommandArguments = null - }; - - var result = rootedCommandResolver.Resolve(commandResolverArguments); - - result.Should().BeNull(); - } - - [Fact] - public void It_returns_null_when_CommandName_is_not_rooted() - { - var rootedCommandResolver = new RootedCommandResolver(); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "some/relative/path", - CommandArguments = null - }; - - var result = rootedCommandResolver.Resolve(commandResolverArguments); - - result.Should().BeNull(); - } - - [Fact] - public void It_returns_a_CommandSpec_with_CommandName_as_Path_when_CommandName_is_rooted() - { - var rootedCommandResolver = new RootedCommandResolver(); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "/some/rooted/path", - CommandArguments = null - }; - - var result = rootedCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - result.Path.Should().Be(commandResolverArguments.CommandName); - } - - [Fact] - public void It_escapes_CommandArguments_when_returning_a_CommandSpec() - { - var rootedCommandResolver = new RootedCommandResolver(); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "/some/rooted/path", - CommandArguments = new[] { "arg with space" } - }; - - var result = rootedCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - result.Path.Should().Be(commandResolverArguments.CommandName); - - result.Args.Should().Be("\"arg with space\""); - } - - [Fact] - public void It_returns_a_CommandSpec_with_Args_as_stringEmpty_when_returning_a_CommandSpec_and_CommandArguments_are_null() - { - var rootedCommandResolver = new RootedCommandResolver(); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "/some/rooted/path", - CommandArguments = null - }; - - var result = rootedCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - result.Path.Should().Be(commandResolverArguments.CommandName); - - result.Args.Should().Be(string.Empty); - } - } -} diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAScriptCommandResolver.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAScriptCommandResolver.cs deleted file mode 100644 index 58537e863..000000000 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAScriptCommandResolver.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Linq; -using FluentAssertions; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; - -namespace Microsoft.DotNet.Cli.Utils.Tests -{ - public class GivenAScriptCommandResolver - { - [Fact] - public void It_contains_resolvers_in_the_right_order() - { - var scriptCommandResolver = ScriptCommandResolverPolicy.Create(); - - var resolvers = scriptCommandResolver.OrderedCommandResolvers; - - resolvers.Should().HaveCount(5); - - resolvers.Select(r => r.GetType()) - .Should() - .ContainInOrder( - new[]{ - typeof(RootedCommandResolver), - typeof(MuxerCommandResolver), - typeof(ProjectPathCommandResolver), - typeof(AppBaseCommandResolver), - typeof(PathCommandResolver) - }); - } - } -} diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAnAppBaseCommandResolver.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAnAppBaseCommandResolver.cs deleted file mode 100644 index 8fcfc5111..000000000 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAnAppBaseCommandResolver.cs +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) .NET 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.PlatformAbstractions; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; - -namespace Microsoft.DotNet.Cli.Utils.Tests -{ - public class GivenAnAppBaseCommandResolver - { - [Fact] - public void It_returns_null_when_CommandName_is_null() - { - var appBaseCommandResolver = SetupPlatformAppBaseCommandResolver(forceGeneric: true); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = null, - CommandArguments = null - }; - - var result = appBaseCommandResolver.Resolve(commandResolverArguments); - - result.Should().BeNull(); - } - - [Fact] - public void It_returns_null_when_CommandName_does_not_exist_applocal() - { - var appBaseCommandResolver = SetupPlatformAppBaseCommandResolver(forceGeneric: true); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "nonexistent-command", - CommandArguments = null - }; - - var result = appBaseCommandResolver.Resolve(commandResolverArguments); - - result.Should().BeNull(); - } - - [Fact] - public void It_returns_a_CommandSpec_with_CommandName_as_FileName_when_CommandName_exists_applocal() - { - var environment = CommandResolverTestUtils.SetupEnvironmentProviderWhichFindsExtensions(".exe"); - var appBaseCommandResolver = SetupPlatformAppBaseCommandResolver(environment, forceGeneric: true); - - CommandResolverTestUtils.CreateNonRunnableTestCommand(AppContext.BaseDirectory, "appbasetestcommand1", ".exe"); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "appbasetestcommand1", - CommandArguments = null - }; - - var result = appBaseCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - - var commandFile = Path.GetFileNameWithoutExtension(result.Path); - - commandFile.Should().Be("appbasetestcommand1"); - } - - [Fact] - public void It_returns_null_when_CommandName_exists_applocal_in_a_subdirectory() - { - var environment = CommandResolverTestUtils.SetupEnvironmentProviderWhichFindsExtensions(".exe"); - var appBaseCommandResolver = SetupPlatformAppBaseCommandResolver(environment, forceGeneric: true); - - var testDir = Path.Combine(AppContext.BaseDirectory, "appbasetestsubdir"); - CommandResolverTestUtils.CreateNonRunnableTestCommand(testDir, "appbasetestsubdircommand", ".exe"); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "appbasetestsubdircommand", - CommandArguments = null - }; - - var result = appBaseCommandResolver.Resolve(commandResolverArguments); - - result.Should().BeNull(); - } - - [Fact] - public void It_escapes_CommandArguments_when_returning_a_CommandSpec() - { - var environment = CommandResolverTestUtils.SetupEnvironmentProviderWhichFindsExtensions(".exe"); - var appBaseCommandResolver = SetupPlatformAppBaseCommandResolver(environment, forceGeneric: true); - - CommandResolverTestUtils.CreateNonRunnableTestCommand(AppContext.BaseDirectory, "appbasetestcommand1", ".exe"); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "appbasetestcommand1", - CommandArguments = new[] { "arg with space" } - }; - - var result = appBaseCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - result.Args.Should().Be("\"arg with space\""); - } - - [Fact] - public void It_returns_a_CommandSpec_with_Args_as_stringEmpty_when_returning_a_CommandSpec_and_CommandArguments_are_null() - { - var environment = CommandResolverTestUtils.SetupEnvironmentProviderWhichFindsExtensions(".exe"); - var appBaseCommandResolver = SetupPlatformAppBaseCommandResolver(environment, forceGeneric: true); - - CommandResolverTestUtils.CreateNonRunnableTestCommand(AppContext.BaseDirectory, "appbasetestcommand1", ".exe"); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "appbasetestcommand1", - CommandArguments = null - }; - - var result = appBaseCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - result.Args.Should().Be(string.Empty); - } - - [Fact] - public void It_prefers_EXE_over_CMD_when_two_command_candidates_exist_and_using_WindowsExePreferredCommandSpecFactory() - { - var environment = CommandResolverTestUtils.SetupEnvironmentProviderWhichFindsExtensions(".exe"); - var platformCommandSpecFactory = new WindowsExePreferredCommandSpecFactory(); - - var appBaseCommandResolver = new AppBaseCommandResolver(environment, platformCommandSpecFactory); - - CommandResolverTestUtils.CreateNonRunnableTestCommand(AppContext.BaseDirectory, "appbasetestcommand1", ".exe"); - CommandResolverTestUtils.CreateNonRunnableTestCommand(AppContext.BaseDirectory, "appbasetestcommand1", ".cmd"); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "appbasetestcommand1", - CommandArguments = null - }; - - var result = appBaseCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - - var commandFile = Path.GetFileName(result.Path); - commandFile.Should().Be("appbasetestcommand1.exe"); - } - - public void It_wraps_command_with_CMD_EXE_when_command_has_CMD_Extension_and_using_WindowsExePreferredCommandSpecFactory() - { - var environment = new EnvironmentProvider(new[] { ".cmd" }); - var platformCommandSpecFactory = new WindowsExePreferredCommandSpecFactory(); - - var pathCommandResolver = new PathCommandResolver(environment, platformCommandSpecFactory); - - var testCommandPath = - CommandResolverTestUtils.CreateNonRunnableTestCommand(AppContext.BaseDirectory, "cmdWrapCommand", ".cmd"); - - var commandResolverArguments = new CommandResolverArguments() - { - CommandName = "cmdWrapCommand", - CommandArguments = null - }; - - var result = pathCommandResolver.Resolve(commandResolverArguments); - - result.Should().NotBeNull(); - - var commandFile = Path.GetFileName(result.Path); - commandFile.Should().Be("cmd.exe"); - - result.Args.Should().Contain(testCommandPath); - } - - private AppBaseCommandResolver SetupPlatformAppBaseCommandResolver( - IEnvironmentProvider environment = null, - bool forceGeneric = false) - { - environment = environment ?? new EnvironmentProvider(); - - IPlatformCommandSpecFactory platformCommandSpecFactory = new GenericPlatformCommandSpecFactory(); - - if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows - && !forceGeneric) - { - platformCommandSpecFactory = new WindowsExePreferredCommandSpecFactory(); - } - - var appBaseCommandResolver = new AppBaseCommandResolver(environment, platformCommandSpecFactory); - - return appBaseCommandResolver; - } - } -} diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAppThrowingException.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAppThrowingException.cs deleted file mode 100644 index 1470e6d78..000000000 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAppThrowingException.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.IO; -using FluentAssertions; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; - -namespace Microsoft.DotNet.Cli.Utils.Tests -{ - public class GivenAppThrowingException : TestBase - { - [RequiresSpecificFrameworkFact("netcoreapp1.1")] - public void ItShowsStackTraceWhenRun() - { - var root = TestAssets.Get("NonRestoredTestProjects", "AppThrowingException") - .CreateInstance() - .WithSourceFiles() - .Root; - - var appRoot = Path.Combine(root.FullName, "App"); - - new RestoreCommand() - .WithWorkingDirectory(appRoot) - .Execute() - .Should().Pass(); - - string msg1 = "Unhandled Exception: AppThrowing.MyException: " - + "Exception of type 'AppThrowing.MyException' was thrown."; - string msg2 = "at AppThrowing.MyException.Main(String[] args)"; - new DotnetCommand(DotnetUnderTest.WithBackwardsCompatibleRuntimes) - .WithWorkingDirectory(appRoot) - .ExecuteWithCapturedOutput("run") - .Should().Fail() - .And.HaveStdErrContaining(msg1) - .And.HaveStdErrContaining(msg2); - } - - [RequiresSpecificFrameworkFact("netcoreapp1.1")] - public void ItShowsStackTraceWhenRunAsTool() - { - var root = TestAssets.Get("NonRestoredTestProjects", "AppThrowingException") - .CreateInstance() - .WithSourceFiles() - .Root; - - var appRoot = Path.Combine(root.FullName, "App"); - - new RestoreCommand() - .WithWorkingDirectory(appRoot) - .Execute() - .Should().Pass(); - - new PackCommand() - .WithWorkingDirectory(appRoot) - .Execute("-o ../pkgs") - .Should() - .Pass(); - - var appWithToolDepRoot = Path.Combine(root.FullName, "AppDependingOnOtherAsTool"); - - new RestoreCommand() - .WithWorkingDirectory(appWithToolDepRoot) - .Execute() - .Should().Pass(); - - string msg1 = "Unhandled Exception: AppThrowing.MyException: " - + "Exception of type 'AppThrowing.MyException' was thrown."; - string msg2 = "at AppThrowing.MyException.Main(String[] args)"; - new DotnetCommand(DotnetUnderTest.WithBackwardsCompatibleRuntimes) - .WithWorkingDirectory(appWithToolDepRoot) - .ExecuteWithCapturedOutput("throwingtool") - .Should().Fail() - .And.HaveStdErrContaining(msg1) - .And.HaveStdErrContaining(msg2); - } - } -} diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenThatWeWantToReadLockFilesQuickly.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenThatWeWantToReadLockFilesQuickly.cs deleted file mode 100644 index 5b1300348..000000000 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenThatWeWantToReadLockFilesQuickly.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Diagnostics; -using System.IO; -using FluentAssertions; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.InternalAbstractions; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using NuGet.Frameworks; -using NuGet.ProjectModel; -using Xunit; - -namespace Microsoft.DotNet.Cli.Utils.Tests -{ - public class GivenThatWeWantToReadLockFilesQuickly : TestBase - { - [Fact] - public void ItFailsInLessThanOneSecondWhenTheProjectAssetsJsonDoesNotExist() - { - var testInstance = TestAssets.Get("TestAppWithProjDepTool") - .CreateInstance() - .WithSourceFiles(); - - var assetsFile = testInstance.Root.GetDirectory("obj").GetFile("project.assets.json").FullName; - var expectedMessage = string.Join( - Environment.NewLine, - string.Format(LocalizableStrings.FileNotFound, assetsFile), - LocalizableStrings.ProjectNotRestoredOrRestoreFailed); - - Action action = () => - { - var lockFile = new LockFileFormat() - .ReadWithLock(assetsFile) - .Result; - }; - - var stopWatch = Stopwatch.StartNew(); - - action.ShouldThrow().WithMessage(expectedMessage); - - stopWatch.Stop(); - stopWatch.ElapsedMilliseconds.Should().BeLessThan(1000); - } - } -} 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 deleted file mode 100644 index 63ddee901..000000000 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.csproj +++ /dev/null @@ -1,43 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - Microsoft.DotNet.Cli.Utils.Tests - Exe - ../../tools/Key.snk - true - true - $(AssetTargetFallback);netstandardapp1.5;dotnet5.4;portable-net451+win8 - - - - - .version - PreserveNewest - - - TestAssets/TestProjects/AppWithToolDependency/%(RecursiveDir)%(Filename)%(Extension) - PreserveNewest - PreserveNewest - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/StreamForwarderTests.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/StreamForwarderTests.cs deleted file mode 100644 index b0b825e43..000000000 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/StreamForwarderTests.cs +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.InternalAbstractions; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; - -namespace StreamForwarderTests -{ - public class StreamForwarderTests : TestBase - { - public static IEnumerable ForwardingTheoryVariations - { - get - { - return new[] - { - new object[] { "123", new string[]{"123"} }, - new object[] { "123\n", new string[] {"123"} }, - new object[] { "123\r\n", new string[] {"123"} }, - new object[] { "1234\n5678", new string[] {"1234", "5678"} }, - new object[] { "1234\r\n5678", new string[] {"1234", "5678"} }, - new object[] { "1234\n5678\n", new string[] {"1234", "5678"} }, - new object[] { "1234\r\n5678\r\n", new string[] {"1234", "5678"} }, - new object[] { "1234\n5678\nabcdefghijklmnopqrstuvwxyz", new string[] {"1234", "5678", "abcdefghijklmnopqrstuvwxyz"} }, - new object[] { "1234\r\n5678\r\nabcdefghijklmnopqrstuvwxyz", new string[] {"1234", "5678", "abcdefghijklmnopqrstuvwxyz"} }, - new object[] { "1234\n5678\nabcdefghijklmnopqrstuvwxyz\n", new string[] {"1234", "5678", "abcdefghijklmnopqrstuvwxyz"} }, - new object[] { "1234\r\n5678\r\nabcdefghijklmnopqrstuvwxyz\r\n", new string[] {"1234", "5678", "abcdefghijklmnopqrstuvwxyz"} } - }; - } - } - - [Theory] - [InlineData("123")] - [InlineData("123\n")] - public void TestNoForwardingNoCapture(string inputStr) - { - TestCapturingAndForwardingHelper(ForwardOptions.None, inputStr, null, new string[0]); - } - - [Theory] - [MemberData("ForwardingTheoryVariations")] - public void TestForwardingOnly(string inputStr, string[] expectedWrites) - { - for (int i = 0; i < expectedWrites.Length; ++i) - { - expectedWrites[i] += Environment.NewLine; - } - - TestCapturingAndForwardingHelper(ForwardOptions.WriteLine, inputStr, null, expectedWrites); - } - - [Theory] - [MemberData("ForwardingTheoryVariations")] - public void TestCaptureOnly(string inputStr, string[] expectedWrites) - { - for (int i = 0; i < expectedWrites.Length; ++i) - { - expectedWrites[i] += Environment.NewLine; - } - - var expectedCaptured = string.Join("", expectedWrites); - - TestCapturingAndForwardingHelper(ForwardOptions.Capture, inputStr, expectedCaptured, new string[0]); - } - - [Theory] - [MemberData("ForwardingTheoryVariations")] - public void TestCaptureAndForwardingTogether(string inputStr, string[] expectedWrites) - { - for (int i = 0; i < expectedWrites.Length; ++i) - { - expectedWrites[i] += Environment.NewLine; - } - - var expectedCaptured = string.Join("", expectedWrites); - - TestCapturingAndForwardingHelper(ForwardOptions.WriteLine | ForwardOptions.Capture, inputStr, expectedCaptured, expectedWrites); - } - - private enum ForwardOptions - { - None = 0x0, - Capture = 0x1, - WriteLine = 0x02, - } - - private void TestCapturingAndForwardingHelper(ForwardOptions options, string str, string expectedCaptured, string[] expectedWrites) - { - var forwarder = new StreamForwarder(); - var writes = new List(); - - if ((options & ForwardOptions.WriteLine) != 0) - { - forwarder.ForwardTo(writeLine: s => writes.Add(s + Environment.NewLine)); - } - if ((options & ForwardOptions.Capture) != 0) - { - forwarder.Capture(); - } - - forwarder.Read(new StringReader(str)); - Assert.Equal(expectedWrites, writes); - - var captured = forwarder.CapturedOutput; - Assert.Equal(expectedCaptured, captured); - } - - private string SetupTestProject() - { - - var testPath = TestAssets.Get("OutputStandardOutputAndError") - .CreateInstance() - .WithRestoreFiles() - .Root.FullName; - - var buildCommand = new BuildCommand() - .WithProjectFile(new FileInfo(Path.Combine(testPath, "project.json"))) - .Execute(); - - var buildOutputExe = "OutputStandardOutputAndError" + Constants.ExeSuffix; - var buildOutputPath = Path.Combine(testPath, "bin/Debug/netcoreapp1.0", buildOutputExe); - - return buildOutputPath; - } - } -} diff --git a/test/Microsoft.DotNet.Configurer.UnitTests/GivenADotnetFirstTimeUseConfigurer.cs b/test/Microsoft.DotNet.Configurer.UnitTests/GivenADotnetFirstTimeUseConfigurer.cs deleted file mode 100644 index a9a0e904b..000000000 --- a/test/Microsoft.DotNet.Configurer.UnitTests/GivenADotnetFirstTimeUseConfigurer.cs +++ /dev/null @@ -1,305 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using FluentAssertions; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Configurer; -using Microsoft.DotNet.Tools.Test; -using Microsoft.Extensions.DependencyModel.Tests; -using Moq; -using Xunit; - -namespace Microsoft.DotNet.Configurer.UnitTests -{ - public class GivenADotnetFirstTimeUseConfigurer - { - private const string CliFallbackFolderPath = "some path"; - - private Mock _nugetCachePrimerMock; - private Mock _nugetCacheSentinelMock; - private Mock _firstTimeUseNoticeSentinelMock; - private Mock _environmentProviderMock; - private Mock _reporterMock; - - public GivenADotnetFirstTimeUseConfigurer() - { - _nugetCachePrimerMock = new Mock(); - _nugetCacheSentinelMock = new Mock(); - _firstTimeUseNoticeSentinelMock = new Mock(); - _environmentProviderMock = new Mock(); - _reporterMock = new Mock(); - - _environmentProviderMock - .Setup(e => e.GetEnvironmentVariableAsBool("DOTNET_SKIP_FIRST_TIME_EXPERIENCE", false)) - .Returns(false); - _environmentProviderMock - .Setup(e => e.GetEnvironmentVariableAsBool("DOTNET_PRINT_TELEMETRY_MESSAGE", true)) - .Returns(true); - } - - [Fact] - public void It_does_not_print_the_first_time_use_notice_if_the_sentinel_exists() - { - _firstTimeUseNoticeSentinelMock.Setup(n => n.Exists()).Returns(true); - - var dotnetFirstTimeUseConfigurer = new DotnetFirstTimeUseConfigurer( - _nugetCachePrimerMock.Object, - _nugetCacheSentinelMock.Object, - _firstTimeUseNoticeSentinelMock.Object, - _environmentProviderMock.Object, - _reporterMock.Object, - CliFallbackFolderPath); - - dotnetFirstTimeUseConfigurer.Configure(); - - _reporterMock.Verify(r => r.WriteLine(It.Is(str => str == LocalizableStrings.FirstTimeWelcomeMessage)), Times.Never); - _reporterMock.Verify(r => r.Write(It.IsAny()), Times.Never); - } - - [Fact] - public void It_does_not_print_the_first_time_use_notice_when_the_user_has_set_the_DOTNET_SKIP_FIRST_TIME_EXPERIENCE_environemnt_variable() - { - _firstTimeUseNoticeSentinelMock.Setup(n => n.Exists()).Returns(false); - _environmentProviderMock - .Setup(e => e.GetEnvironmentVariableAsBool("DOTNET_SKIP_FIRST_TIME_EXPERIENCE", false)) - .Returns(true); - - var dotnetFirstTimeUseConfigurer = new DotnetFirstTimeUseConfigurer( - _nugetCachePrimerMock.Object, - _nugetCacheSentinelMock.Object, - _firstTimeUseNoticeSentinelMock.Object, - _environmentProviderMock.Object, - _reporterMock.Object, - CliFallbackFolderPath); - - dotnetFirstTimeUseConfigurer.Configure(); - - _reporterMock.Verify(r => r.WriteLine(It.Is(str => str == LocalizableStrings.FirstTimeWelcomeMessage)), Times.Never); - _reporterMock.Verify(r => r.Write(It.IsAny()), Times.Never); - } - - [Fact] - public void It_does_not_print_the_first_time_use_notice_when_the_user_has_set_the_DOTNET_PRINT_TELEMETRY_MESSAGE_environemnt_variable() - { - _firstTimeUseNoticeSentinelMock.Setup(n => n.Exists()).Returns(false); - _environmentProviderMock - .Setup(e => e.GetEnvironmentVariableAsBool("DOTNET_PRINT_TELEMETRY_MESSAGE", true)) - .Returns(false); - - var dotnetFirstTimeUseConfigurer = new DotnetFirstTimeUseConfigurer( - _nugetCachePrimerMock.Object, - _nugetCacheSentinelMock.Object, - _firstTimeUseNoticeSentinelMock.Object, - _environmentProviderMock.Object, - _reporterMock.Object, - CliFallbackFolderPath); - - dotnetFirstTimeUseConfigurer.Configure(); - - _reporterMock.Verify(r => r.WriteLine(It.Is(str => str == LocalizableStrings.FirstTimeWelcomeMessage)), Times.Never); - _reporterMock.Verify(r => r.Write(It.IsAny()), Times.Never); - } - - [Fact] - public void It_prints_the_telemetry_if_the_sentinel_does_not_exist() - { - _firstTimeUseNoticeSentinelMock.Setup(n => n.Exists()).Returns(false); - - var dotnetFirstTimeUseConfigurer = new DotnetFirstTimeUseConfigurer( - _nugetCachePrimerMock.Object, - _nugetCacheSentinelMock.Object, - _firstTimeUseNoticeSentinelMock.Object, - _environmentProviderMock.Object, - _reporterMock.Object, - CliFallbackFolderPath); - - dotnetFirstTimeUseConfigurer.Configure(); - - _reporterMock.Verify(r => r.WriteLine(It.Is(str => str == LocalizableStrings.FirstTimeWelcomeMessage))); - _reporterMock.Verify(r => r.Write(It.IsAny()), Times.Never); - } - - [Fact] - public void It_does_not_prime_the_cache_if_the_sentinel_exists() - { - _nugetCacheSentinelMock.Setup(n => n.Exists()).Returns(true); - - var dotnetFirstTimeUseConfigurer = new DotnetFirstTimeUseConfigurer( - _nugetCachePrimerMock.Object, - _nugetCacheSentinelMock.Object, - _firstTimeUseNoticeSentinelMock.Object, - _environmentProviderMock.Object, - _reporterMock.Object, - CliFallbackFolderPath); - - dotnetFirstTimeUseConfigurer.Configure(); - - _nugetCachePrimerMock.Verify(r => r.PrimeCache(), Times.Never); - } - - [Fact] - public void It_does_not_prime_the_cache_if_first_run_experience_is_already_happening() - { - _nugetCacheSentinelMock.Setup(n => n.InProgressSentinelAlreadyExists()).Returns(true); - - var dotnetFirstTimeUseConfigurer = new DotnetFirstTimeUseConfigurer( - _nugetCachePrimerMock.Object, - _nugetCacheSentinelMock.Object, - _firstTimeUseNoticeSentinelMock.Object, - _environmentProviderMock.Object, - _reporterMock.Object, - CliFallbackFolderPath); - - dotnetFirstTimeUseConfigurer.Configure(); - - _nugetCachePrimerMock.Verify(r => r.PrimeCache(), Times.Never); - } - - [Fact] - public void It_does_not_prime_the_cache_if_cache_is_missing() - { - _nugetCachePrimerMock.Setup(n => n.SkipPrimingTheCache()).Returns(true); - - var dotnetFirstTimeUseConfigurer = new DotnetFirstTimeUseConfigurer( - _nugetCachePrimerMock.Object, - _nugetCacheSentinelMock.Object, - _firstTimeUseNoticeSentinelMock.Object, - _environmentProviderMock.Object, - _reporterMock.Object, - CliFallbackFolderPath); - - dotnetFirstTimeUseConfigurer.Configure(); - - _nugetCachePrimerMock.Verify(r => r.PrimeCache(), Times.Never); - } - - [Fact] - public void It_does_not_prime_the_cache_if_the_sentinel_exists_but_the_user_has_set_the_DOTNET_SKIP_FIRST_TIME_EXPERIENCE_environemnt_variable() - { - _nugetCacheSentinelMock.Setup(n => n.Exists()).Returns(false); - _environmentProviderMock - .Setup(e => e.GetEnvironmentVariableAsBool("DOTNET_SKIP_FIRST_TIME_EXPERIENCE", false)) - .Returns(true); - - var dotnetFirstTimeUseConfigurer = new DotnetFirstTimeUseConfigurer( - _nugetCachePrimerMock.Object, - _nugetCacheSentinelMock.Object, - _firstTimeUseNoticeSentinelMock.Object, - _environmentProviderMock.Object, - _reporterMock.Object, - CliFallbackFolderPath); - - dotnetFirstTimeUseConfigurer.Configure(); - - _nugetCachePrimerMock.Verify(r => r.PrimeCache(), Times.Never); - } - - [Fact] - public void It_primes_the_cache_if_the_sentinel_does_not_exist() - { - _nugetCacheSentinelMock.Setup(n => n.Exists()).Returns(false); - - var dotnetFirstTimeUseConfigurer = new DotnetFirstTimeUseConfigurer( - _nugetCachePrimerMock.Object, - _nugetCacheSentinelMock.Object, - _firstTimeUseNoticeSentinelMock.Object, - _environmentProviderMock.Object, - _reporterMock.Object, - CliFallbackFolderPath); - - dotnetFirstTimeUseConfigurer.Configure(); - - _nugetCachePrimerMock.Verify(r => r.PrimeCache(), Times.Once); - } - - [Fact] - public void It_prints_first_use_notice_and_primes_the_cache_if_the_sentinels_do_not_exist() - { - _nugetCacheSentinelMock.Setup(n => n.Exists()).Returns(false); - _firstTimeUseNoticeSentinelMock.Setup(n => n.Exists()).Returns(false); - - var dotnetFirstTimeUseConfigurer = new DotnetFirstTimeUseConfigurer( - _nugetCachePrimerMock.Object, - _nugetCacheSentinelMock.Object, - _firstTimeUseNoticeSentinelMock.Object, - _environmentProviderMock.Object, - _reporterMock.Object, - CliFallbackFolderPath); - - dotnetFirstTimeUseConfigurer.Configure(); - - _reporterMock.Verify(r => r.WriteLine(It.Is(str => str == LocalizableStrings.FirstTimeWelcomeMessage))); - _reporterMock.Verify(r => r.WriteLine(It.Is(str => str == LocalizableStrings.NugetCachePrimeMessage))); - _nugetCachePrimerMock.Verify(r => r.PrimeCache(), Times.Once); - _reporterMock.Verify(r => r.Write(It.IsAny()), Times.Never); - } - - [Fact] - public void It_prints_the_first_time_use_notice_if_the_cache_sentinel_exists_but_the_first_notice_sentinel_does_not() - { - _nugetCacheSentinelMock.Setup(n => n.Exists()).Returns(true); - _firstTimeUseNoticeSentinelMock.Setup(n => n.Exists()).Returns(false); - - var dotnetFirstTimeUseConfigurer = new DotnetFirstTimeUseConfigurer( - _nugetCachePrimerMock.Object, - _nugetCacheSentinelMock.Object, - _firstTimeUseNoticeSentinelMock.Object, - _environmentProviderMock.Object, - _reporterMock.Object, - CliFallbackFolderPath); - - dotnetFirstTimeUseConfigurer.Configure(); - - _reporterMock.Verify(r => - r.WriteLine(It.Is(str => str == LocalizableStrings.FirstTimeWelcomeMessage))); - _reporterMock.Verify( - r => r.WriteLine(It.Is(str => str == LocalizableStrings.NugetCachePrimeMessage)), - Times.Never); - _reporterMock.Verify(r => r.Write(It.IsAny()), Times.Never); - } - - [Fact] - public void It_prints_the_unauthorized_notice_if_the_cache_sentinel_reports_Unauthorized() - { - _nugetCacheSentinelMock.Setup(n => n.UnauthorizedAccess).Returns(true); - - var dotnetFirstTimeUseConfigurer = new DotnetFirstTimeUseConfigurer( - _nugetCachePrimerMock.Object, - _nugetCacheSentinelMock.Object, - _firstTimeUseNoticeSentinelMock.Object, - _environmentProviderMock.Object, - _reporterMock.Object, - CliFallbackFolderPath); - - dotnetFirstTimeUseConfigurer.Configure(); - - _reporterMock.Verify(r => - r.WriteLine(It.Is(str => str == LocalizableStrings.FirstTimeWelcomeMessage))); - _reporterMock.Verify(r => - r.WriteLine(It.Is(str => - str == string.Format(LocalizableStrings.UnauthorizedAccessMessage, CliFallbackFolderPath)))); - _reporterMock.Verify( - r => r.WriteLine(It.Is(str => str == LocalizableStrings.NugetCachePrimeMessage)), - Times.Never); - _reporterMock.Verify(r => r.Write(It.IsAny()), Times.Never); - } - - [Fact] - public void It_does_not_prime_the_cache_if_the_cache_sentinel_reports_Unauthorized() - { - _nugetCacheSentinelMock.Setup(n => n.UnauthorizedAccess).Returns(true); - - var dotnetFirstTimeUseConfigurer = new DotnetFirstTimeUseConfigurer( - _nugetCachePrimerMock.Object, - _nugetCacheSentinelMock.Object, - _firstTimeUseNoticeSentinelMock.Object, - _environmentProviderMock.Object, - _reporterMock.Object, - CliFallbackFolderPath); - - dotnetFirstTimeUseConfigurer.Configure(); - - _nugetCachePrimerMock.Verify(r => r.PrimeCache(), Times.Never); - } - } -} diff --git a/test/Microsoft.DotNet.Configurer.UnitTests/GivenAFirstTimeUseNoticeSentinel.cs b/test/Microsoft.DotNet.Configurer.UnitTests/GivenAFirstTimeUseNoticeSentinel.cs deleted file mode 100644 index 0957b162d..000000000 --- a/test/Microsoft.DotNet.Configurer.UnitTests/GivenAFirstTimeUseNoticeSentinel.cs +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using FluentAssertions; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Configurer; -using Microsoft.Extensions.DependencyModel.Tests; -using Microsoft.Extensions.EnvironmentAbstractions; -using Moq; -using Xunit; - -namespace Microsoft.DotNet.Configurer.UnitTests -{ - public class GivenAFirstTimeUseNoticeSentinel - { - private const string DOTNET_USER_PROFILE_FOLDER_PATH = "some path"; - - private FileSystemMockBuilder _fileSystemMockBuilder; - - public GivenAFirstTimeUseNoticeSentinel() - { - _fileSystemMockBuilder = FileSystemMockBuilder.Create(); - } - - [Fact] - public void TheSentinelHasTheCurrentVersionInItsName() - { - FirstTimeUseNoticeSentinel.SENTINEL.Should().Contain($"{Product.Version}"); - } - - [Fact] - public void ItReturnsTrueIfTheSentinelExists() - { - _fileSystemMockBuilder.AddFiles(DOTNET_USER_PROFILE_FOLDER_PATH, FirstTimeUseNoticeSentinel.SENTINEL); - - var fileSystemMock = _fileSystemMockBuilder.Build(); - - var firstTimeUseNoticeSentinel = - new FirstTimeUseNoticeSentinel( - DOTNET_USER_PROFILE_FOLDER_PATH, - fileSystemMock.File, - fileSystemMock.Directory); - - firstTimeUseNoticeSentinel.Exists().Should().BeTrue(); - } - - [Fact] - public void ItReturnsFalseIfTheSentinelDoesNotExist() - { - var fileSystemMock = _fileSystemMockBuilder.Build(); - - var firstTimeUseNoticeSentinel = - new FirstTimeUseNoticeSentinel( - DOTNET_USER_PROFILE_FOLDER_PATH, - fileSystemMock.File, - fileSystemMock.Directory); - - firstTimeUseNoticeSentinel.Exists().Should().BeFalse(); - } - - [Fact] - public void ItCreatesTheSentinelInTheDotnetUserProfileFolderPathIfItDoesNotExistAlready() - { - var fileSystemMock = _fileSystemMockBuilder.Build(); - var firstTimeUseNoticeSentinel = - new FirstTimeUseNoticeSentinel( - DOTNET_USER_PROFILE_FOLDER_PATH, - fileSystemMock.File, - fileSystemMock.Directory); - - firstTimeUseNoticeSentinel.Exists().Should().BeFalse(); - - firstTimeUseNoticeSentinel.CreateIfNotExists(); - - firstTimeUseNoticeSentinel.Exists().Should().BeTrue(); - } - - [Fact] - public void ItDoesNotCreateTheSentinelAgainIfItAlreadyExistsInTheDotnetUserProfileFolderPath() - { - const string contentToValidateSentinalWasNotReplaced = "some string"; - var sentinel = Path.Combine(DOTNET_USER_PROFILE_FOLDER_PATH, FirstTimeUseNoticeSentinel.SENTINEL); - _fileSystemMockBuilder.AddFile(sentinel, contentToValidateSentinalWasNotReplaced); - - var fileSystemMock = _fileSystemMockBuilder.Build(); - - var firstTimeUseNoticeSentinel = - new FirstTimeUseNoticeSentinel( - DOTNET_USER_PROFILE_FOLDER_PATH, - fileSystemMock.File, - fileSystemMock.Directory); - - firstTimeUseNoticeSentinel.Exists().Should().BeTrue(); - - firstTimeUseNoticeSentinel.CreateIfNotExists(); - - fileSystemMock.File.ReadAllText(sentinel).Should().Be(contentToValidateSentinalWasNotReplaced); - } - - [Fact] - public void ItCreatesTheDotnetUserProfileFolderIfItDoesNotExistAlreadyWhenCreatingTheSentinel() - { - var fileSystemMock = _fileSystemMockBuilder.Build(); - var directoryMock = new DirectoryMock(); - var firstTimeUseNoticeSentinel = - new FirstTimeUseNoticeSentinel( - DOTNET_USER_PROFILE_FOLDER_PATH, - fileSystemMock.File, - directoryMock); - - firstTimeUseNoticeSentinel.CreateIfNotExists(); - - directoryMock.Exists(DOTNET_USER_PROFILE_FOLDER_PATH).Should().BeTrue(); - directoryMock.CreateDirectoryInvoked.Should().BeTrue(); - } - - [Fact] - public void ItDoesNotAttemptToCreateTheDotnetUserProfileFolderIfItAlreadyExistsWhenCreatingTheSentinel() - { - var fileSystemMock = _fileSystemMockBuilder.Build(); - var directoryMock = new DirectoryMock(new List { DOTNET_USER_PROFILE_FOLDER_PATH }); - var firstTimeUseNoticeSentinel = - new FirstTimeUseNoticeSentinel( - DOTNET_USER_PROFILE_FOLDER_PATH, - fileSystemMock.File, - directoryMock); - - firstTimeUseNoticeSentinel.CreateIfNotExists(); - - directoryMock.CreateDirectoryInvoked.Should().BeFalse(); - } - - private class DirectoryMock : IDirectory - { - private IList _directories; - - public bool CreateDirectoryInvoked { get; set; } - - public DirectoryMock(IList directories = null) - { - _directories = directories ?? new List(); - } - - public bool Exists(string path) - { - return _directories.Any(d => d == path); - } - - public ITemporaryDirectory CreateTemporaryDirectory() - { - throw new NotImplementedException(); - } - - public IEnumerable GetFiles(string path, string searchPattern) - { - throw new NotImplementedException(); - } - - public string GetDirectoryFullName(string path) - { - throw new NotImplementedException(); - } - - public void CreateDirectory(string path) - { - _directories.Add(path); - CreateDirectoryInvoked = true; - } - } - } -} \ No newline at end of file diff --git a/test/Microsoft.DotNet.Configurer.UnitTests/GivenAFunctionReturnStringAndFakeFileSystem.cs b/test/Microsoft.DotNet.Configurer.UnitTests/GivenAFunctionReturnStringAndFakeFileSystem.cs deleted file mode 100644 index 4dfaf9c9d..000000000 --- a/test/Microsoft.DotNet.Configurer.UnitTests/GivenAFunctionReturnStringAndFakeFileSystem.cs +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using FluentAssertions; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Configurer; -using Microsoft.Extensions.DependencyModel.Tests; -using Microsoft.Extensions.EnvironmentAbstractions; -using Moq; -using Xunit; - -namespace Microsoft.DotNet.Configurer.UnitTests -{ - public class GivenAFunctionReturnStringAndFakeFileSystem - { - private const string DOTNET_USER_PROFILE_FOLDER_PATH = "some path"; - - private FileSystemMockBuilder _fileSystemMockBuilder; - private UserLevelCacheWriter _userLevelCacheWriter; - private IFileSystem _fileSystemMock; - - public GivenAFunctionReturnStringAndFakeFileSystem() - { - _fileSystemMockBuilder = FileSystemMockBuilder.Create(); - _fileSystemMock = _fileSystemMockBuilder.Build(); - _userLevelCacheWriter = - new UserLevelCacheWriter( - DOTNET_USER_PROFILE_FOLDER_PATH, - _fileSystemMock.File, - _fileSystemMock.Directory); - } - - [Fact] - public void ItReturnsTheFunctionResult() - { - _userLevelCacheWriter.RunWithCache("fooKey", () => "foo").Should().Be("foo"); - } - - [Fact] - public void ItRunsTheFunctionOnlyOnceWhenInvokeTwice() - { - var counter = new Counter(); - Func func = () => - { - counter.Increase(); - return "foo"; - }; - - _userLevelCacheWriter.RunWithCache("fookey", func).Should().Be("foo"); - _userLevelCacheWriter.RunWithCache("fookey", func).Should().Be("foo"); - counter.Count.Should().Be(1); - } - - [Fact] - public void ItKeepsTheCacheInUserProfileWithCacheKey() - { - _userLevelCacheWriter.RunWithCache("fooKey", () => "foo"); - var path = Path.Combine("some path", $"{Product.Version}_fooKey.dotnetUserLevelCache"); - _fileSystemMock.File.Exists(path); - _fileSystemMock.File.ReadAllText(path).Should().Be("foo"); - } - - [Fact] - public void ItRunsAndReturnsTheValueIfCacheCreationFailed() - { - var mockFile = new Mock(); - - var systemUndertest = - new UserLevelCacheWriter( - DOTNET_USER_PROFILE_FOLDER_PATH, - new NoPermissionFileFake(), - new NoPermissionDirectoryFake()); - - var counter = new Counter(); - Func func = () => - { - counter.Increase(); - return "foo"; - }; - - systemUndertest.RunWithCache("fookey", func).Should().Be("foo"); - systemUndertest.RunWithCache("fookey", func).Should().Be("foo"); - counter.Count.Should().Be(2); - } - - private class NoPermissionFileFake : IFile - { - public bool Exists(string path) - { - return false; - } - - public string ReadAllText(string path) - { - throw new UnauthorizedAccessException(); - } - - public Stream OpenRead(string path) - { - throw new UnauthorizedAccessException(); - } - - public Stream OpenFile( - string path, - FileMode fileMode, - FileAccess fileAccess, - FileShare fileShare, - int bufferSize, - FileOptions fileOptions) - { - throw new NotImplementedException(); - } - - public void CreateEmptyFile(string path) - { - throw new UnauthorizedAccessException(); - } - - public void WriteAllText(string path, string content) - { - throw new UnauthorizedAccessException(); - } - } - - private class NoPermissionDirectoryFake : IDirectory - { - - public ITemporaryDirectory CreateTemporaryDirectory() - { - throw new NotImplementedException(); - } - - public IEnumerable GetFiles(string path, string searchPattern) - { - throw new UnauthorizedAccessException(); - } - - public string GetDirectoryFullName(string path) - { - throw new NotImplementedException(); - } - - public bool Exists(string path) - { - return false; - } - - public void CreateDirectory(string path) - { - throw new UnauthorizedAccessException(); - } - } - - private class Counter - { - public int Count { get; private set; } - public void Increase() { Count++; } - - } - } -} diff --git a/test/Microsoft.DotNet.Configurer.UnitTests/GivenANuGetCachePrimer.cs b/test/Microsoft.DotNet.Configurer.UnitTests/GivenANuGetCachePrimer.cs deleted file mode 100644 index f51fccb84..000000000 --- a/test/Microsoft.DotNet.Configurer.UnitTests/GivenANuGetCachePrimer.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 System; -using System.Collections.Generic; -using System.Linq; -using System.IO; -using FluentAssertions; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Tools.Test.Utilities.Mock; -using Microsoft.Extensions.DependencyModel.Tests; -using Microsoft.Extensions.EnvironmentAbstractions; -using Moq; -using NuGet.Frameworks; -using Xunit; - -namespace Microsoft.DotNet.Configurer.UnitTests -{ - public class GivenANuGetCachePrimer - { - private const string COMPRESSED_ARCHIVE_PATH = "a path to somewhere"; - private const string TEMPORARY_FOLDER_PATH = "some path"; - private const string PACKAGES_ARCHIVE_PATH = "some other path"; - - private IFileSystem _fileSystemMock; - - private Mock _nugetPackagesArchiverMock; - private Mock _nugetCacheSentinel; - private CliFallbackFolderPathCalculator _cliFallbackFolderPathCalculator; - - public GivenANuGetCachePrimer() - { - var fileSystemMockBuilder = FileSystemMockBuilder.Create(); - fileSystemMockBuilder.TemporaryFolder = TEMPORARY_FOLDER_PATH; - fileSystemMockBuilder.AddFile(COMPRESSED_ARCHIVE_PATH); - _fileSystemMock = fileSystemMockBuilder.Build(); - - _nugetPackagesArchiverMock = new Mock(); - _nugetPackagesArchiverMock.Setup(n => n.NuGetPackagesArchive).Returns(COMPRESSED_ARCHIVE_PATH); - - _nugetCacheSentinel = new Mock(); - - _cliFallbackFolderPathCalculator = new CliFallbackFolderPathCalculator(); - - var nugetCachePrimer = new NuGetCachePrimer( - _nugetPackagesArchiverMock.Object, - _nugetCacheSentinel.Object, - _cliFallbackFolderPathCalculator, - _fileSystemMock.File); - - nugetCachePrimer.PrimeCache(); - } - - [Fact] - public void It_does_not_prime_the_NuGet_cache_if_the_archive_is_not_found_so_that_we_do_not_need_to_generate_the_archive_for_stage1() - { - var fileSystemMockBuilder = FileSystemMockBuilder.Create(); - var fileSystemMock = fileSystemMockBuilder.Build(); - - var nugetPackagesArchiverMock = new Mock(); - nugetPackagesArchiverMock.Setup(n => n.NuGetPackagesArchive).Returns(COMPRESSED_ARCHIVE_PATH); - - var nugetCachePrimer = new NuGetCachePrimer( - nugetPackagesArchiverMock.Object, - _nugetCacheSentinel.Object, - _cliFallbackFolderPathCalculator, - fileSystemMock.File); - - nugetCachePrimer.PrimeCache(); - - nugetPackagesArchiverMock.Verify(n => n.ExtractArchive(It.IsAny()), Times.Never); - } - - [Fact] - public void It_extracts_the_archive_to_the_fallback_folder() - { - _nugetPackagesArchiverMock.Verify(n => - n.ExtractArchive(_cliFallbackFolderPathCalculator.CliFallbackFolderPath), - Times.Exactly(1)); - } - - [Fact] - public void It_creates_a_sentinel_when_restore_succeeds() - { - _nugetCacheSentinel.Verify(n => n.CreateIfNotExists(), Times.Once); - } - - [Fact] - public void It_does_not_create_a_sentinel_when_extracting_the_archive_fails() - { - var nugetCacheSentinel = new Mock(); - var nugetPackagesArchiveMock = new Mock(); - nugetPackagesArchiveMock.Setup(n => n.ExtractArchive(It.IsAny())).Throws(); - - var nugetCachePrimer = new NuGetCachePrimer( - nugetPackagesArchiveMock.Object, - nugetCacheSentinel.Object, - _cliFallbackFolderPathCalculator, - _fileSystemMock.File); - - Action action = () => nugetCachePrimer.PrimeCache(); - - action.ShouldThrow(); - nugetCacheSentinel.Verify(n => n.CreateIfNotExists(), Times.Never); - } - } -} diff --git a/test/Microsoft.DotNet.Configurer.UnitTests/GivenANuGetCacheSentinel.cs b/test/Microsoft.DotNet.Configurer.UnitTests/GivenANuGetCacheSentinel.cs deleted file mode 100644 index 23ae45c4a..000000000 --- a/test/Microsoft.DotNet.Configurer.UnitTests/GivenANuGetCacheSentinel.cs +++ /dev/null @@ -1,272 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using FluentAssertions; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Configurer; -using Microsoft.Extensions.DependencyModel.Tests; -using Microsoft.Extensions.EnvironmentAbstractions; -using Moq; -using Xunit; - -namespace Microsoft.DotNet.Configurer.UnitTests -{ - public class GivenANuGetCacheSentinel - { - private const string NUGET_CACHE_PATH = "some path"; - - private FileSystemMockBuilder _fileSystemMockBuilder; - - public GivenANuGetCacheSentinel() - { - _fileSystemMockBuilder = FileSystemMockBuilder.Create(); - } - - [Fact] - public void As_soon_as_it_gets_created_it_tries_to_get_handle_of_the_InProgress_sentinel() - { - var fileSystemMock = _fileSystemMockBuilder.Build(); - var fileMock = new FileMock(); - var nugetCacheSentinel = - new NuGetCacheSentinel(NUGET_CACHE_PATH, fileMock, fileSystemMock.Directory); - - fileMock.OpenFileWithRightParamsCalled.Should().BeTrue(); - } - - [Fact] - public void It_sets_UnauthorizedAccess_to_false_when_no_UnauthorizedAccessException_happens() - { - var fileSystemMock = _fileSystemMockBuilder.Build(); - var fileMock = new FileMock(); - var nugetCacheSentinel = - new NuGetCacheSentinel(NUGET_CACHE_PATH, fileMock, fileSystemMock.Directory); - - nugetCacheSentinel.UnauthorizedAccess.Should().BeFalse(); - } - - [Fact] - public void It_sets_UnauthorizedAccess_to_true_when_an_UnauthorizedAccessException_happens() - { - var fileMock = new FileMock(); - var directoryMock = new DirectoryMock(); - var nugetCacheSentinel = - new NuGetCacheSentinel(NUGET_CACHE_PATH, fileMock, directoryMock); - - nugetCacheSentinel.UnauthorizedAccess.Should().BeTrue(); - } - - [Fact] - public void It_returns_true_to_the_in_progress_sentinel_already_exists_when_it_fails_to_get_a_handle_to_it() - { - var fileSystemMock = _fileSystemMockBuilder.Build(); - var fileMock = new FileMock(); - fileMock.InProgressSentinel = null; - var nugetCacheSentinel = - new NuGetCacheSentinel(NUGET_CACHE_PATH, fileMock, fileSystemMock.Directory); - - nugetCacheSentinel.InProgressSentinelAlreadyExists().Should().BeTrue(); - } - - [Fact] - public void It_returns_false_to_the_in_progress_sentinel_already_exists_when_it_fails_to_get_a_handle_to_it_but_it_failed_because_it_was_unauthorized() - { - var fileMock = new FileMock(); - var directoryMock = new DirectoryMock(); - fileMock.InProgressSentinel = null; - var nugetCacheSentinel = - new NuGetCacheSentinel(NUGET_CACHE_PATH, fileMock, directoryMock); - - nugetCacheSentinel.InProgressSentinelAlreadyExists().Should().BeFalse(); - } - - [Fact] - public void It_returns_false_to_the_in_progress_sentinel_already_exists_when_it_succeeds_in_getting_a_handle_to_it() - { - var fileSystemMock = _fileSystemMockBuilder.Build(); - var fileMock = new FileMock(); - fileMock.InProgressSentinel = new MemoryStream(); - var nugetCacheSentinel = - new NuGetCacheSentinel(NUGET_CACHE_PATH, fileMock, fileSystemMock.Directory); - - nugetCacheSentinel.InProgressSentinelAlreadyExists().Should().BeFalse(); - } - - [Fact] - public void It_disposes_of_the_handle_to_the_InProgressSentinel_when_NuGetCacheSentinel_is_disposed() - { - var fileSystemMock = _fileSystemMockBuilder.Build(); - var mockStream = new MockStream(); - var fileMock = new FileMock(); - fileMock.InProgressSentinel = mockStream; - using (var nugetCacheSentinel = - new NuGetCacheSentinel(NUGET_CACHE_PATH, fileMock, fileSystemMock.Directory)) - {} - - mockStream.IsDisposed.Should().BeTrue(); - } - - [Fact] - public void The_sentinel_has_the_current_version_in_its_name() - { - NuGetCacheSentinel.SENTINEL.Should().Contain($"{Product.Version}"); - } - - [Fact] - public void It_returns_true_if_the_sentinel_exists() - { - _fileSystemMockBuilder.AddFiles(NUGET_CACHE_PATH, NuGetCacheSentinel.SENTINEL); - - var fileSystemMock = _fileSystemMockBuilder.Build(); - - var nugetCacheSentinel = - new NuGetCacheSentinel(NUGET_CACHE_PATH, fileSystemMock.File, fileSystemMock.Directory); - - nugetCacheSentinel.Exists().Should().BeTrue(); - } - - [Fact] - public void It_returns_false_if_the_sentinel_does_not_exist() - { - var fileSystemMock = _fileSystemMockBuilder.Build(); - - var nugetCacheSentinel = - new NuGetCacheSentinel(NUGET_CACHE_PATH, fileSystemMock.File, fileSystemMock.Directory); - - nugetCacheSentinel.Exists().Should().BeFalse(); - } - - [Fact] - public void It_creates_the_sentinel_in_the_nuget_cache_path_if_it_does_not_exist_already() - { - var fileSystemMock = _fileSystemMockBuilder.Build(); - var nugetCacheSentinel = - new NuGetCacheSentinel(NUGET_CACHE_PATH, fileSystemMock.File, fileSystemMock.Directory); - - nugetCacheSentinel.Exists().Should().BeFalse(); - - nugetCacheSentinel.CreateIfNotExists(); - - nugetCacheSentinel.Exists().Should().BeTrue(); - } - - [Fact] - public void It_does_not_create_the_sentinel_again_if_it_already_exists_in_the_nuget_cache_path() - { - const string contentToValidateSentinalWasNotReplaced = "some string"; - var sentinel = Path.Combine(NUGET_CACHE_PATH, NuGetCacheSentinel.SENTINEL); - _fileSystemMockBuilder.AddFile(sentinel, contentToValidateSentinalWasNotReplaced); - - var fileSystemMock = _fileSystemMockBuilder.Build(); - - var nugetCacheSentinel = - new NuGetCacheSentinel(NUGET_CACHE_PATH, fileSystemMock.File, fileSystemMock.Directory); - - nugetCacheSentinel.Exists().Should().BeTrue(); - - nugetCacheSentinel.CreateIfNotExists(); - - fileSystemMock.File.ReadAllText(sentinel).Should().Be(contentToValidateSentinalWasNotReplaced); - } - - private class DirectoryMock : IDirectory - { - public bool Exists(string path) - { - return false; - } - - public ITemporaryDirectory CreateTemporaryDirectory() - { - throw new NotImplementedException(); - } - - public IEnumerable GetFiles(string path, string searchPattern) - { - throw new NotImplementedException(); - } - - public string GetDirectoryFullName(string path) - { - throw new NotImplementedException(); - } - - public void CreateDirectory(string path) - { - throw new UnauthorizedAccessException(); - } - } - - private class FileMock : IFile - { - public bool OpenFileWithRightParamsCalled { get; private set; } - - public Stream InProgressSentinel { get; set;} - - public bool Exists(string path) - { - throw new NotImplementedException(); - } - - 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) - { - Stream fileStream = null; - - var inProgressSentinel = - Path.Combine(GivenANuGetCacheSentinel.NUGET_CACHE_PATH, NuGetCacheSentinel.INPROGRESS_SENTINEL); - - if (path.Equals(inProgressSentinel) && - fileMode == FileMode.OpenOrCreate && - fileAccess == FileAccess.ReadWrite && - fileShare == FileShare.None && - bufferSize == 1 && - fileOptions == FileOptions.DeleteOnClose) - { - OpenFileWithRightParamsCalled = true; - fileStream = InProgressSentinel; - } - - return fileStream; - } - - public void CreateEmptyFile(string path) - { - throw new NotImplementedException(); - } - - public void WriteAllText(string path, string content) - { - throw new NotImplementedException(); - } - } - - private class MockStream : MemoryStream - { - public bool IsDisposed { get; private set;} - - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - IsDisposed = true; - } - } - } -} diff --git a/test/Microsoft.DotNet.Configurer.UnitTests/Microsoft.DotNet.Configurer.UnitTests.csproj b/test/Microsoft.DotNet.Configurer.UnitTests/Microsoft.DotNet.Configurer.UnitTests.csproj deleted file mode 100644 index 2511c7eae..000000000 --- a/test/Microsoft.DotNet.Configurer.UnitTests/Microsoft.DotNet.Configurer.UnitTests.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - Microsoft.DotNet.Configurer.UnitTests - ../../tools/Key.snk - true - true - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - - - - - - - - - - - - - - - - - diff --git a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenAnMSBuildSdkResolver.cs b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenAnMSBuildSdkResolver.cs deleted file mode 100644 index 97e1db0be..000000000 --- a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenAnMSBuildSdkResolver.cs +++ /dev/null @@ -1,352 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using FluentAssertions; -using Microsoft.Build.Framework; -using Microsoft.DotNet.MSBuildSdkResolver; -using Microsoft.DotNet.Tools.Test.Utilities; -using System.Collections.Generic; -using System.IO; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using Xunit; -using Xunit.Abstractions; -using System; - -[assembly: CollectionBehavior(DisableTestParallelization = true)] - -namespace Microsoft.DotNet.Cli.Utils.Tests -{ - public class GivenAnMSBuildSdkResolver : TestBase - { - private ITestOutputHelper _logger; - - public GivenAnMSBuildSdkResolver(ITestOutputHelper logger) - { - _logger = logger; - } - - [Fact] - public void ItHasCorrectNameAndPriority() - { - var resolver = new DotNetMSBuildSdkResolver(); - - Assert.Equal(5000, resolver.Priority); - Assert.Equal("Microsoft.DotNet.MSBuildSdkResolver", resolver.Name); - } - - [Fact] - public void ItFindsTheVersionSpecifiedInGlobalJson() - { - var environment = new TestEnvironment(); - environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "99.99.97"); - var expected = environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "99.99.98"); - environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "99.99.99"); - environment.CreateGlobalJson(environment.TestDirectory, "99.99.98"); - environment.CreateMuxerAndAddToPath(ProgramFiles.X64); - - var resolver = environment.CreateResolver(); - var result = (MockResult)resolver.Resolve( - new SdkReference("Some.Test.Sdk", null, null), - new MockContext { ProjectFilePath = environment.TestDirectory.FullName }, - new MockFactory()); - - result.Success.Should().BeTrue(); - result.Path.Should().Be(expected.FullName); - result.Version.Should().Be("99.99.98"); - result.Warnings.Should().BeNullOrEmpty(); - result.Errors.Should().BeNullOrEmpty(); - } - - [Fact] - public void ItReturnsNullIfTheVersionFoundDoesNotSatisfyTheMinVersion() - { - var environment = new TestEnvironment(); - environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "99.99.99"); - environment.CreateMuxerAndAddToPath(ProgramFiles.X64); - - var resolver = environment.CreateResolver(); - var result = (MockResult)resolver.Resolve( - new SdkReference("Some.Test.Sdk", null, "999.99.99"), - new MockContext { ProjectFilePath = environment.TestDirectory.FullName }, - new MockFactory()); - - result.Success.Should().BeFalse(); - result.Path.Should().BeNull(); - result.Version.Should().BeNull(); - result.Warnings.Should().BeNullOrEmpty(); - result.Errors.Should().Contain("Version 99.99.99 of the .NET Core SDK is smaller than the minimum version 999.99.99" - + " requested. Check that a recent enough .NET Core SDK is installed, increase the minimum version" - + " specified in the project, or increase the version specified in global.json."); - } - - [Fact] - public void ItReturnsNullWhenTheSDKRequiresAHigherVersionOfMSBuildThanTheOneAvailable() - { - var environment = new TestEnvironment(); - var expected = - environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "99.99.99", new Version(2, 0)); - environment.CreateMuxerAndAddToPath(ProgramFiles.X64); - - var resolver = environment.CreateResolver(); - var result = (MockResult)resolver.Resolve( - new SdkReference("Some.Test.Sdk", null, "99.99.99"), - new MockContext - { - MSBuildVersion = new Version(1, 0), - ProjectFilePath = environment.TestDirectory.FullName - }, - new MockFactory()); - - result.Success.Should().BeFalse(); - result.Path.Should().BeNull(); - result.Version.Should().BeNull(); - result.Warnings.Should().BeNullOrEmpty(); - result.Errors.Should().Contain("Version 99.99.99 of the .NET Core SDK requires at least version 2.0 of MSBuild." - + " The current available version of MSBuild is 1.0. Change the .NET Core SDK specified in global.json to an older" - + " version that requires the MSBuild version currently available."); - } - - [Fact] - public void ItReturnsNullWhenTheDefaultVSRequiredSDKVersionIsHigherThanTheSDKVersionAvailable() - { - var environment = new TestEnvironment(); - var expected = - environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "1.0.1"); - environment.CreateMuxerAndAddToPath(ProgramFiles.X64); - - var resolver = environment.CreateResolver(); - var result = (MockResult)resolver.Resolve( - new SdkReference("Some.Test.Sdk", null, "1.0.0"), - new MockContext { ProjectFilePath = environment.TestDirectory.FullName }, - new MockFactory()); - - result.Success.Should().BeFalse(); - result.Path.Should().BeNull(); - result.Version.Should().BeNull(); - result.Warnings.Should().BeNullOrEmpty(); - result.Errors.Should().Contain($"Version 1.0.1 of the .NET Core SDK is smaller than the minimum version" - + " 1.0.4 required by Visual Studio. Check that a recent enough" - + " .NET Core SDK is installed or increase the version specified in global.json."); - } - - [Fact] - public void ItReturnsNullWhenTheTheVSRequiredSDKVersionIsHigherThanTheSDKVersionAvailable() - { - var environment = new TestEnvironment(); - var expected = - environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "1.0.1"); - environment.CreateMuxerAndAddToPath(ProgramFiles.X64); - environment.CreateMinimumVSDefinedSDKVersionFile("2.0.0"); - - var resolver = environment.CreateResolver(); - var result = (MockResult)resolver.Resolve( - new SdkReference("Some.Test.Sdk", null, "1.0.0"), - new MockContext { ProjectFilePath = environment.TestDirectory.FullName }, - new MockFactory()); - - result.Success.Should().BeFalse(); - result.Path.Should().BeNull(); - result.Version.Should().BeNull(); - result.Warnings.Should().BeNullOrEmpty(); - result.Errors.Should().Contain($"Version 1.0.1 of the .NET Core SDK is smaller than the minimum version" - + " 2.0.0 required by Visual Studio. Check that a recent enough" - + " .NET Core SDK is installed or increase the version specified in global.json."); - } - - [Fact] - public void ItReturnsTheVersionIfItIsEqualToTheMinVersionAndTheVSDefinedMinVersion() - { - var environment = new TestEnvironment(); - var expected = environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "99.99.99"); - environment.CreateMuxerAndAddToPath(ProgramFiles.X64); - environment.CreateMinimumVSDefinedSDKVersionFile("99.99.99"); - - var resolver = environment.CreateResolver(); - var result = (MockResult)resolver.Resolve( - new SdkReference("Some.Test.Sdk", null, "99.99.99"), - new MockContext { ProjectFilePath = environment.TestDirectory.FullName }, - new MockFactory()); - - result.Success.Should().BeTrue(); - result.Path.Should().Be(expected.FullName); - result.Version.Should().Be("99.99.99"); - result.Warnings.Should().BeNullOrEmpty(); - result.Errors.Should().BeNullOrEmpty(); - } - - [Fact] - public void ItReturnsTheVersionIfItIsHigherThanTheMinVersionAndTheVSDefinedMinVersion() - { - var environment = new TestEnvironment(); - var expected = environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "999.99.99"); - environment.CreateMuxerAndAddToPath(ProgramFiles.X64); - environment.CreateMinimumVSDefinedSDKVersionFile("999.99.98"); - - var resolver = environment.CreateResolver(); - var result = (MockResult)resolver.Resolve( - new SdkReference("Some.Test.Sdk", null, "99.99.99"), - new MockContext { ProjectFilePath = environment.TestDirectory.FullName }, - new MockFactory()); - - result.Success.Should().BeTrue(); - result.Path.Should().Be(expected.FullName); - result.Version.Should().Be("999.99.99"); - result.Warnings.Should().BeNullOrEmpty(); - result.Errors.Should().BeNullOrEmpty(); - } - - private enum ProgramFiles - { - X64, - X86, - Default, - } - - private sealed class TestEnvironment : SdkResolverContext - { - public string Muxer => RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet"; - - public string PathEnvironmentVariable { get; set; } - - public DirectoryInfo TestDirectory { get; } - - public TestEnvironment(string identifier = "", [CallerMemberName] string callingMethod = "") - { - TestDirectory = TestAssets.CreateTestDirectory( - "temp", - identifier: identifier, - callingMethod: callingMethod); - - DeleteMinimumVSDefinedSDKVersionFile(); - - PathEnvironmentVariable = string.Empty; - } - - public SdkResolver CreateResolver() - => new DotNetMSBuildSdkResolver(GetEnvironmentVariable); - - public DirectoryInfo GetSdkDirectory(ProgramFiles programFiles, string sdkName, string sdkVersion) - => TestDirectory.GetDirectory( - GetProgramFilesDirectory(programFiles).FullName, - "dotnet", - "sdk", - sdkVersion, - "Sdks", - sdkName, - "Sdk"); - - public DirectoryInfo GetProgramFilesDirectory(ProgramFiles programFiles) - => TestDirectory.GetDirectory($"ProgramFiles{programFiles}"); - - public DirectoryInfo CreateSdkDirectory( - ProgramFiles programFiles, - string sdkName, - string sdkVersion, - Version minimumMSBuildVersion = null) - { - var dir = GetSdkDirectory(programFiles, sdkName, sdkVersion); - dir.Create(); - - if (minimumMSBuildVersion != null) - { - CreateMSBuildRequiredVersionFile(programFiles, sdkVersion, minimumMSBuildVersion); - } - - return dir; - } - - public void CreateMuxerAndAddToPath(ProgramFiles programFiles) - { - var muxerDirectory = - TestDirectory.GetDirectory(GetProgramFilesDirectory(programFiles).FullName, "dotnet"); - - new FileInfo(Path.Combine(muxerDirectory.FullName, Muxer)).Create(); - - PathEnvironmentVariable = $"{muxerDirectory}{Path.PathSeparator}{PathEnvironmentVariable}"; - } - - private void CreateMSBuildRequiredVersionFile( - ProgramFiles programFiles, - string sdkVersion, - Version minimumMSBuildVersion) - { - if (minimumMSBuildVersion == null) - { - minimumMSBuildVersion = new Version(1, 0); - } - - var cliDirectory = TestDirectory.GetDirectory( - GetProgramFilesDirectory(programFiles).FullName, - "dotnet", - "sdk", - sdkVersion); - - File.WriteAllText( - Path.Combine(cliDirectory.FullName, "minimumMSBuildVersion"), - minimumMSBuildVersion.ToString()); - } - - public void CreateGlobalJson(DirectoryInfo directory, string version) - => File.WriteAllText(directory.GetFile("global.json").FullName, - $@"{{ ""sdk"": {{ ""version"": ""{version}"" }} }}"); - - public string GetEnvironmentVariable(string variable) - { - switch (variable) - { - case "PATH": - return PathEnvironmentVariable; - default: - return null; - } - } - - public void CreateMinimumVSDefinedSDKVersionFile(string version) - { - File.WriteAllText(GetMinimumVSDefinedSDKVersionFilePath(), version); - } - - private void DeleteMinimumVSDefinedSDKVersionFile() - { - File.Delete(GetMinimumVSDefinedSDKVersionFilePath()); - } - - private string GetMinimumVSDefinedSDKVersionFilePath() - { - string baseDirectory = AppContext.BaseDirectory; - return Path.Combine(baseDirectory, "minimumVSDefinedSDKVersion"); - } - } - - private sealed class MockContext : SdkResolverContext - { - public new string ProjectFilePath { get => base.ProjectFilePath; set => base.ProjectFilePath = value; } - public new string SolutionFilePath { get => base.SolutionFilePath; set => base.SolutionFilePath = value; } - public new Version MSBuildVersion { get => base.MSBuildVersion; set => base.MSBuildVersion = value; } - - public MockContext() - { - MSBuildVersion = new Version(15, 3, 0); - } - } - - private sealed class MockFactory : SdkResultFactory - { - public override SdkResult IndicateFailure(IEnumerable errors, IEnumerable warnings = null) - => new MockResult { Success = false, Errors = errors, Warnings = warnings }; - - public override SdkResult IndicateSuccess(string path, string version, IEnumerable warnings = null) - => new MockResult { Success = true, Path = path, Version = version, Warnings = warnings }; - } - - private sealed class MockResult : SdkResult - { - public new bool Success { get => base.Success; set => base.Success = value; } - public string Version { get; set; } - public string Path { get; set; } - public IEnumerable Errors { get; set; } - public IEnumerable Warnings { get; set; } - } - } -} diff --git a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenThatIWantToCompareSemanticVersions.cs b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenThatIWantToCompareSemanticVersions.cs deleted file mode 100644 index d7554ef2b..000000000 --- a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenThatIWantToCompareSemanticVersions.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Xunit; -using Microsoft.DotNet.MSBuildSdkResolver; -using FluentAssertions; - -namespace Microsoft.DotNet.Cli.Utils.Tests -{ - public class GivenThatWeWantToCompareFXVersions - { - [Theory] - [InlineData("2.0.0", "1.0.0", 1)] - [InlineData("1.1.0", "1.0.0", 1)] - [InlineData("1.0.1", "1.0.0", 1)] - [InlineData("1.0.0", "1.0.0-pre", 1)] - [InlineData("1.0.0-pre+2", "1.0.0-pre+1", 1)] - [InlineData("1.0.0", "2.0.0", -1)] - [InlineData("1.0.0", "1.1.0", -1)] - [InlineData("1.0.0", "1.0.1", -1)] - [InlineData("1.0.0-pre", "1.0.0", -1)] - [InlineData("1.0.0-pre+1", "1.0.0-pre+2", -1)] - [InlineData("1.2.3", "1.2.3", 0)] - [InlineData("1.2.3-pre", "1.2.3-pre", 0)] - [InlineData("1.2.3-pre+1", "1.2.3-pre+1", 0)] - public void OneFXVersionIsBiggerThanTheOther(string s1, string s2, int expectedResult) - { - FXVersion fxVersion1; - FXVersion fxVersion2; - FXVersion.TryParse(s1, out fxVersion1); - FXVersion.TryParse(s2, out fxVersion2); - FXVersion.Compare(fxVersion1, fxVersion2).Should().Be(expectedResult); - } - } -} \ No newline at end of file diff --git a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenThatWeWantToParseSemanticVersions.cs b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenThatWeWantToParseSemanticVersions.cs deleted file mode 100644 index 1ade1399f..000000000 --- a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenThatWeWantToParseSemanticVersions.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Xunit; -using Microsoft.DotNet.MSBuildSdkResolver; -using FluentAssertions; - -namespace Microsoft.DotNet.Cli.Utils.Tests -{ - public class GivenThatWeWantToParseFXVersions - { - [Fact] - public void ReturnsNullWhenNoMajorSeparatorIsFound() - { - FXVersion fxVersion; - FXVersion.TryParse("1", out fxVersion).Should().BeFalse(); - } - - [Fact] - public void ReturnsNullWhenMajorPortionIsNotANumber() - { - FXVersion fxVersion; - FXVersion.TryParse("a.0.0", out fxVersion).Should().BeFalse(); - } - - [Fact] - public void ReturnsNullWhenNoMinorSeparatorIsFound() - { - FXVersion fxVersion; - FXVersion.TryParse("1.0", out fxVersion).Should().BeFalse(); - } - - [Fact] - public void ReturnsNullWhenMinorPortionIsNotANumber() - { - FXVersion fxVersion; - FXVersion.TryParse("1.a.0", out fxVersion).Should().BeFalse(); - } - - [Fact] - public void ReturnsNullWhenPatchPortionIsNotANumber() - { - FXVersion fxVersion; - FXVersion.TryParse("1.0.a", out fxVersion).Should().BeFalse(); - } - - [Fact] - public void ReturnsFXVersionWhenOnlyMajorMinorPatchIsFound() - { - FXVersion fxVersion; - - var result = FXVersion.TryParse("1.2.3", out fxVersion); - - result.Should().BeTrue(); - fxVersion.Major.Should().Be(1); - fxVersion.Minor.Should().Be(2); - fxVersion.Patch.Should().Be(3); - } - - [Fact] - public void ReturnsFXVersionWhenOnlyMajorMinorPatchAndPreIsFound() - { - FXVersion fxVersion; - - var result = FXVersion.TryParse("1.2.3-pre", out fxVersion); - - result.Should().BeTrue(); - fxVersion.Major.Should().Be(1); - fxVersion.Minor.Should().Be(2); - fxVersion.Patch.Should().Be(3); - fxVersion.Pre.Should().Be("-pre"); - } - - [Fact] - public void ReturnsFXVersionWhenMajorMinorPatchAndPreAndBuildIsFound() - { - FXVersion fxVersion; - - var result = FXVersion.TryParse("1.2.3-pre+build", out fxVersion); - - result.Should().BeTrue(); - fxVersion.Major.Should().Be(1); - fxVersion.Minor.Should().Be(2); - fxVersion.Patch.Should().Be(3); - fxVersion.Pre.Should().Be("-pre"); - fxVersion.Build.Should().Be("build"); - } - } -} \ No newline at end of file diff --git a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj deleted file mode 100644 index b60f6abe6..000000000 --- a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj +++ /dev/null @@ -1,37 +0,0 @@ - - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - Exe - ../../tools/Key.snk - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/xunit.runner.json b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/xunit.runner.json deleted file mode 100644 index 34b2fe2cd..000000000 --- a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/xunit.runner.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "shadowCopy": false -} \ No newline at end of file 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 76% rename from src/Microsoft.DotNet.TestFramework/Microsoft.DotNet.TestFramework.csproj rename to test/Microsoft.DotNet.TestFramework/Microsoft.DotNet.TestFramework.csproj index 2996edcbb..4d3d8cf67 100644 --- a/src/Microsoft.DotNet.TestFramework/Microsoft.DotNet.TestFramework.csproj +++ b/test/Microsoft.DotNet.TestFramework/Microsoft.DotNet.TestFramework.csproj @@ -2,7 +2,6 @@ Microsoft.DotNet.TestFramework Class Library - $(CliVersionPrefix) netstandard1.5 ../../tools/Key.snk true @@ -10,7 +9,7 @@ - + \ 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 97% rename from src/Microsoft.DotNet.TestFramework/TestAssetInfo.cs rename to test/Microsoft.DotNet.TestFramework/TestAssetInfo.cs index bec0b5729..5d7f343e6 100644 --- a/src/Microsoft.DotNet.TestFramework/TestAssetInfo.cs +++ b/test/Microsoft.DotNet.TestFramework/TestAssetInfo.cs @@ -72,9 +72,9 @@ namespace Microsoft.DotNet.TestFramework private void ThrowIfTestAssetDoesNotExist() { if (!Root.Exists) - { - throw new DirectoryNotFoundException($"Directory not found at '{Root.FullName}'"); - } + { + throw new DirectoryNotFoundException($"Directory not found at '{Root.FullName}'"); + } } } } diff --git a/src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs b/test/Microsoft.DotNet.TestFramework/TestAssetInstance.cs similarity index 99% rename from src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs rename to test/Microsoft.DotNet.TestFramework/TestAssetInstance.cs index 4d27d0fe7..9c1cd9f93 100644 --- a/src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs +++ b/test/Microsoft.DotNet.TestFramework/TestAssetInstance.cs @@ -30,7 +30,7 @@ namespace Microsoft.DotNet.TestFramework private bool _built = false; public static string CurrentRuntimeFrameworkVersion = new Muxer().SharedFxVersion; - + public TestAssetInstance(TestAssetInfo testAssetInfo, DirectoryInfo root) { if (testAssetInfo == null) diff --git a/src/Microsoft.DotNet.TestFramework/TestAssetInventoryFiles.cs b/test/Microsoft.DotNet.TestFramework/TestAssetInventoryFiles.cs similarity index 91% rename from src/Microsoft.DotNet.TestFramework/TestAssetInventoryFiles.cs rename to test/Microsoft.DotNet.TestFramework/TestAssetInventoryFiles.cs index bcc7f0045..8e2e2987a 100644 --- a/src/Microsoft.DotNet.TestFramework/TestAssetInventoryFiles.cs +++ b/test/Microsoft.DotNet.TestFramework/TestAssetInventoryFiles.cs @@ -19,30 +19,30 @@ namespace Microsoft.DotNet.TestFramework private FileInfo _build; - public FileInfo Source - { + public FileInfo Source + { get { _source.Refresh(); return _source; - } - + } + private set { _source = value; } } - public FileInfo Restore - { + public FileInfo Restore + { get { _restore.Refresh(); return _restore; - } - + } + private set { _restore = value; @@ -50,14 +50,14 @@ namespace Microsoft.DotNet.TestFramework } public FileInfo Build - { + { get { _build.Refresh(); return _build; - } - + } + private set { _build = value; diff --git a/src/Microsoft.DotNet.TestFramework/TestAssetKinds.cs b/test/Microsoft.DotNet.TestFramework/TestAssetKinds.cs similarity index 98% rename from src/Microsoft.DotNet.TestFramework/TestAssetKinds.cs rename to test/Microsoft.DotNet.TestFramework/TestAssetKinds.cs index bd5efafb4..216c92c51 100644 --- a/src/Microsoft.DotNet.TestFramework/TestAssetKinds.cs +++ b/test/Microsoft.DotNet.TestFramework/TestAssetKinds.cs @@ -14,7 +14,7 @@ namespace Microsoft.DotNet.TestFramework public class TestAssetKinds { public static string DesktopTestProjects = "DesktopTestProjects"; - + public static string TestProjects = "TestProjects"; public static string NonRestoredTestProjects = "NonRestoredTestProjects"; diff --git a/src/Microsoft.DotNet.TestFramework/TestAssets.cs b/test/Microsoft.DotNet.TestFramework/TestAssets.cs similarity index 98% rename from src/Microsoft.DotNet.TestFramework/TestAssets.cs rename to test/Microsoft.DotNet.TestFramework/TestAssets.cs index 6d05788fd..e4e94fe29 100644 --- a/src/Microsoft.DotNet.TestFramework/TestAssets.cs +++ b/test/Microsoft.DotNet.TestFramework/TestAssets.cs @@ -59,8 +59,8 @@ namespace Microsoft.DotNet.TestFramework var assetDirectory = new DirectoryInfo(Path.Combine(_root.FullName, kind, name)); return new TestAssetInfo( - assetDirectory, - name, + assetDirectory, + name, this); } diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/DotnetLegacyRuntimeIdentifiers.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/DotnetLegacyRuntimeIdentifiers.cs deleted file mode 100644 index 5c96c2a9c..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/DotnetLegacyRuntimeIdentifiers.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.InternalAbstractions; -using Microsoft.DotNet.PlatformAbstractions; - -namespace Microsoft.DotNet.Tools.Test.Utilities -{ - public static class DotnetLegacyRuntimeIdentifiers - { - public static string InferLegacyRestoreRuntimeIdentifier() - { - if (RuntimeEnvironment.OperatingSystemPlatform != Platform.Windows) - { - FrameworkDependencyFile fxDepsFile = new FrameworkDependencyFile(); - return fxDepsFile.SupportsCurrentRuntime() ? - RuntimeEnvironment.GetRuntimeIdentifier() : - DotnetFiles.VersionFileObject.BuildRid; - - } - else - { - var arch = RuntimeEnvironment.RuntimeArchitecture.ToLowerInvariant(); - return "win7-" + arch; - } - } - } -} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/EnvironmentInfo.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/EnvironmentInfo.cs deleted file mode 100644 index 2f50d2e4e..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/EnvironmentInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace Microsoft.DotNet.Tools.Test.Utilities -{ - public static class EnvironmentInfo - { - public static bool HasSharedFramework(string framework) - { - string rid = RepoDirectoriesProvider.BuildRid; - - if (framework == "netcoreapp1.0") - { - switch (rid) - { - case "fedora.24-x64": - case "opensuse.42.1-x64": - case "ubuntu.16.10-x64": - case "linux-x64": - return false; - } - } - else if (framework == "netcoreapp1.1") - { - switch (rid) - { - case "linux-x64": - return false; - } - } - - return true; - } - } -} \ No newline at end of file diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Extensions/IDisposableExtensions.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Extensions/IDisposableExtensions.cs deleted file mode 100644 index 1acb0cf7e..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Extensions/IDisposableExtensions.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -namespace Microsoft.DotNet.Tools.Test.Utilities -{ - public static class IDisposableExtensions - { - public static IDisposable DisposeAfter(this IDisposable subject, TimeSpan timeout) - { - return new IDisposableWithTimeout(subject, timeout); - } - - private class IDisposableWithTimeout :IDisposable - { - private CancellationTokenSource _cancellationTokenSource; - - private Task _timeoutTask; - - private bool _isDisposed; - - private IDisposable _subject; - - public IDisposableWithTimeout(IDisposable subject, TimeSpan timeout) - { - _subject = subject; - - _cancellationTokenSource = new CancellationTokenSource(); - - _timeoutTask = Task.Run(() => - { - Task.Delay(timeout, _cancellationTokenSource.Token).Wait(); - - DisposeInternal(); - }, - _cancellationTokenSource.Token); - } - - public void Dispose() - { - DisposeInternal(); - - CancelTimeout(); - } - - private void DisposeInternal() - { - lock(this) - { - if (!_isDisposed) - { - _subject.Dispose(); - - _isDisposed = true; - } - } - } - - private void CancelTimeout() - { - _cancellationTokenSource.Cancel(); - - try - { - _timeoutTask.Wait(); - } - catch (AggregateException) - { - } - finally - { - _cancellationTokenSource.Dispose(); - } - } - } - } -} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/LinuxOnlyFactAttribute.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/LinuxOnlyFactAttribute.cs deleted file mode 100644 index cc8814c5b..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/LinuxOnlyFactAttribute.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.PlatformAbstractions; -using Xunit; - -namespace Microsoft.DotNet.Tools.Test.Utilities -{ - public class LinuxOnlyFactAttribute : FactAttribute - { - public LinuxOnlyFactAttribute() - { - if (RuntimeEnvironment.OperatingSystemPlatform != Platform.Linux) - { - this.Skip = "This test requires linux to run"; - } - } - } -} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/MacOsOnlyFactAttribute.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/MacOsOnlyFactAttribute.cs deleted file mode 100644 index 0b4442621..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/MacOsOnlyFactAttribute.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.PlatformAbstractions; -using Xunit; - -namespace Microsoft.DotNet.Tools.Test.Utilities -{ - public class MacOsOnlyFactAttribute : FactAttribute - { - public MacOsOnlyFactAttribute() - { - if (RuntimeEnvironment.OperatingSystemPlatform != Platform.Darwin) - { - this.Skip = "This test requires macos to run"; - } - } - } -} 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 c66ed4675..0a47e5b22 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 @@ -7,18 +7,16 @@ true true $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - 1.6.0 - - - + + \ No newline at end of file diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Mock/EnvironmentMockBuilder.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Mock/EnvironmentMockBuilder.cs deleted file mode 100644 index f8e4a82d5..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Mock/EnvironmentMockBuilder.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using Microsoft.Extensions.EnvironmentAbstractions; - -namespace Microsoft.DotNet.Tools.Test.Utilities.Mock -{ - internal class EnvironmentMockBuilder - { - private Dictionary _variables = new Dictionary(); - - internal static IEnvironment Empty { get; } = Create().Build(); - - public static EnvironmentMockBuilder Create() - { - return new EnvironmentMockBuilder(); - } - - public EnvironmentMockBuilder AddVariable(string name, string value) - { - _variables.Add(name, value); - return this; - } - - internal IEnvironment Build() - { - return new EnvironmentMock(_variables); - } - - private class EnvironmentMock : IEnvironment - { - private Dictionary _variables; - - public EnvironmentMock(Dictionary variables) - { - _variables = variables; - } - - public string GetEnvironmentVariable(string name) - { - string value = null; - _variables.TryGetValue(name, out value); - return value; - } - } - } -} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Mock/FileSystemMockBuilder.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Mock/FileSystemMockBuilder.cs deleted file mode 100644 index cda8c704b..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Mock/FileSystemMockBuilder.cs +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using Microsoft.DotNet.Tools.Test.Utilities.Mock; -using Microsoft.Extensions.EnvironmentAbstractions; - -namespace Microsoft.Extensions.DependencyModel.Tests -{ - class FileSystemMockBuilder - { - private Dictionary _files = new Dictionary(); - - public string TemporaryFolder { get; set; } - - internal static IFileSystem Empty { get; } = Create().Build(); - - public static FileSystemMockBuilder Create() - { - return new FileSystemMockBuilder(); - } - - public FileSystemMockBuilder AddFile(string name, string content = "") - { - _files.Add(name, content); - return this; - } - - public FileSystemMockBuilder AddFiles(string basePath, params string[] files) - { - foreach (var file in files) - { - AddFile(Path.Combine(basePath, file)); - } - return this; - } - - internal IFileSystem Build() - { - return new FileSystemMock(_files, TemporaryFolder); - } - - private class FileSystemMock : IFileSystem - { - public FileSystemMock(Dictionary files, string temporaryFolder) - { - File = new FileMock(files); - Directory = new DirectoryMock(files, temporaryFolder); - } - - public IFile File { get; } - - public IDirectory Directory { get; } - } - - private class FileMock : IFile - { - private Dictionary _files; - - public FileMock(Dictionary files) - { - _files = files; - } - - public bool Exists(string path) - { - return _files.ContainsKey(path); - } - - public string ReadAllText(string path) - { - string text; - if (!_files.TryGetValue(path, out text)) - { - throw new FileNotFoundException(path); - } - return text; - } - - public Stream OpenRead(string path) - { - return new MemoryStream(Encoding.UTF8.GetBytes(ReadAllText(path))); - } - - 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; - } - } - - private class DirectoryMock : IDirectory - { - private Dictionary _files; - private readonly TemporaryDirectoryMock _temporaryDirectory; - - public DirectoryMock(Dictionary files, string temporaryDirectory) - { - _files = files; - _temporaryDirectory = new TemporaryDirectoryMock(temporaryDirectory); - } - - public ITemporaryDirectory CreateTemporaryDirectory() - { - return _temporaryDirectory; - } - - public IEnumerable GetFiles(string path, string searchPattern) - { - throw new NotImplementedException(); - } - - public string GetDirectoryFullName(string path) - { - throw new NotImplementedException(); - } - - public bool Exists(string path) - { - return _files.Keys.Any(k => k.StartsWith(path)); - } - - public void CreateDirectory(string path) - { - _files.Add(path, path); - } - } - - private class TemporaryDirectoryMock : ITemporaryDirectoryMock - { - public bool DisposedTemporaryDirectory { get; private set; } - - public TemporaryDirectoryMock(string temporaryDirectory) - { - DirectoryPath = temporaryDirectory; - } - - public string DirectoryPath { get; } - - public void Dispose() - { - DisposedTemporaryDirectory = true; - } - } - } - -} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Mock/ITemporaryDirectoryMock.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Mock/ITemporaryDirectoryMock.cs deleted file mode 100644 index ab09a47fa..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Mock/ITemporaryDirectoryMock.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.Extensions.EnvironmentAbstractions; - -namespace Microsoft.DotNet.Tools.Test.Utilities.Mock -{ - internal interface ITemporaryDirectoryMock : ITemporaryDirectory - { - bool DisposedTemporaryDirectory { get; } - } -} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/NetworkUtils/NetworkHelper.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/NetworkUtils/NetworkHelper.cs deleted file mode 100644 index 51f55ea6e..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/NetworkUtils/NetworkHelper.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Net; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using FluentAssertions; - -namespace Microsoft.DotNet.Tools.Test.Utilities -{ - public class NetworkHelper - { - // in milliseconds - private const int Timeout = 50000; - - public static string Localhost { get; } = "http://localhost"; - - public static bool IsServerUp(string url) - { - return SpinWait.SpinUntil(() => - { - using (var client = new HttpClient()) - { - try - { - client.BaseAddress = new Uri(url); - HttpResponseMessage response = client.GetAsync("").Result; - return response.IsSuccessStatusCode; - } - catch (Exception) - { - Thread.Sleep(100); - return false; - } - } - }, Timeout); - } - - public static void TestGetRequest(string url, string expectedResponse) - { - using (var client = new HttpClient()) - { - client.BaseAddress = new Uri(url); - - HttpResponseMessage response = client.GetAsync("").Result; - if (response.IsSuccessStatusCode) - { - var responseString = response.Content.ReadAsStringAsync().Result; - responseString.Should().Contain(expectedResponse); - } - } - } - - public static string GetLocalhostUrlWithFreePort() - { - return $"{Localhost}:{PortManager.GetPort()}/"; - } - } -} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/NetworkUtils/PortManager.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/NetworkUtils/PortManager.cs deleted file mode 100644 index c3df27f4f..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/NetworkUtils/PortManager.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Threading; - -namespace Microsoft.DotNet.Tools.Test.Utilities -{ - public static class PortManager - { - private static int s_nextPort = 8001; - - public static int GetPort() - { - return Interlocked.Increment(ref s_nextPort); - } - } -} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/NonWindowsOnlyFactAttribute.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/NonWindowsOnlyFactAttribute.cs deleted file mode 100644 index 7eda24788..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/NonWindowsOnlyFactAttribute.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.PlatformAbstractions; -using Xunit; - -namespace Microsoft.DotNet.Tools.Test.Utilities -{ - public class NonWindowsOnlyFactAttribute : FactAttribute - { - public NonWindowsOnlyFactAttribute() - { - if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows) - { - this.Skip = "This test requires non-Windows to run"; - } - } - } -} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/NonWindowsOnlyTheoryAttribute.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/NonWindowsOnlyTheoryAttribute.cs deleted file mode 100644 index ca75b47dd..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/NonWindowsOnlyTheoryAttribute.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.PlatformAbstractions; -using Xunit; - -namespace Microsoft.DotNet.Tools.Test.Utilities -{ - public class NonWindowsOnlyTheoryAttribute : TheoryAttribute - { - public NonWindowsOnlyTheoryAttribute() - { - if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows) - { - this.Skip = "This test requires non-Windows to run"; - } - } - } -} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/NuGetConfig.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/NuGetConfig.cs deleted file mode 100644 index f6f05bd51..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/NuGetConfig.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.IO; - -namespace Microsoft.DotNet.Tools.Test.Utilities -{ - public static class NuGetConfig - { - public static void Write(string directory) - { - var contents = @" - - - - - - - -"; - - var path = Path.Combine(directory, "NuGet.config"); - - File.WriteAllText(path, contents); - } - } -} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/PeReaderUtils.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/PeReaderUtils.cs deleted file mode 100644 index fc3d19587..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/PeReaderUtils.cs +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection.Metadata; -using System.Reflection.PortableExecutable; - -namespace Microsoft.DotNet.Tools.Test.Utilities -{ - public static class PeReaderUtils - { - public static bool IsCrossgened(this PEReader peReader) - { - const int CROSSGEN_FLAG = 4; - bool isCrossgened = false; - - if (peReader.HasMetadata) - { - // 4 is the magic numbers that is set in the CLR header's flags when crossgened. - isCrossgened = ((int)peReader.PEHeaders.CorHeader.Flags & CROSSGEN_FLAG) == CROSSGEN_FLAG; - } - - return isCrossgened; - } - - public static string GetAssemblyAttributeValue(string assemblyPath, string attributeName) - { - if (!File.Exists(assemblyPath)) - { - return null; - } - - using (var stream = File.OpenRead(assemblyPath)) - using (var peReader = new PEReader(stream)) - { - if (!peReader.HasMetadata) - { - return null; - } - - var mdReader = peReader.GetMetadataReader(); - var attrs = mdReader.GetAssemblyDefinition().GetCustomAttributes() - .Select(ah => mdReader.GetCustomAttribute(ah)); - - foreach (var attr in attrs) - { - var ctorHandle = attr.Constructor; - if (ctorHandle.Kind != HandleKind.MemberReference) - { - continue; - } - - var container = mdReader.GetMemberReference((MemberReferenceHandle)ctorHandle).Parent; - var name = mdReader.GetTypeReference((TypeReferenceHandle)container).Name; - if (!string.Equals(mdReader.GetString(name), attributeName)) - { - continue; - } - - var arguments = GetFixedStringArguments(mdReader, attr); - if (arguments.Count == 1) - { - return arguments[0]; - } - } - } - - return null; - } - - /// - /// Gets the fixed (required) string arguments of a custom attribute. - /// Only attributes that have only fixed string arguments. - /// - private static List GetFixedStringArguments(MetadataReader reader, CustomAttribute attribute) - { - // 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. - - var signature = reader.GetMemberReference((MemberReferenceHandle)attribute.Constructor).Signature; - var signatureReader = reader.GetBlobReader(signature); - var valueReader = reader.GetBlobReader(attribute.Value); - var arguments = new List(); - - var prolog = valueReader.ReadUInt16(); - if (prolog != 1) - { - // Invalid custom attribute prolog - return arguments; - } - - var header = signatureReader.ReadSignatureHeader(); - if (header.Kind != SignatureKind.Method || header.IsGeneric) - { - // Invalid custom attribute constructor signature - return arguments; - } - - int parameterCount; - if (!signatureReader.TryReadCompressedInteger(out parameterCount)) - { - // Invalid custom attribute constructor signature - return arguments; - } - - var returnType = signatureReader.ReadSignatureTypeCode(); - if (returnType != SignatureTypeCode.Void) - { - // Invalid custom attribute constructor signature - return arguments; - } - - for (int i = 0; i < parameterCount; i++) - { - var signatureTypeCode = signatureReader.ReadSignatureTypeCode(); - if (signatureTypeCode == SignatureTypeCode.String) - { - // Custom attribute constructor must take only strings - arguments.Add(valueReader.ReadSerializedString()); - } - } - - return arguments; - } - } -} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/ProjectUtils.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/ProjectUtils.cs deleted file mode 100644 index 3b812ed28..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/ProjectUtils.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using System.Linq; - -namespace Microsoft.DotNet.Tools.Test.Utilities -{ - public class ProjectUtils - { - public static string GetProjectJson(string testRoot, string project) - { - // We assume that the project name same as the directory name with contains the project.json - // We can do better here by using ProjectReader to get the correct project name - string projectPath = Directory.GetFiles(testRoot, "project.json", SearchOption.AllDirectories) - .FirstOrDefault(pj => Directory.GetParent(pj).Name.Equals(project)); - - if (string.IsNullOrEmpty(projectPath)) - { - throw new Exception($"Cannot file project '{project}' in '{testRoot}'"); - } - - return projectPath; - } - } -} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/RequiresSpecificFrameworkFactAttribute.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/RequiresSpecificFrameworkFactAttribute.cs deleted file mode 100644 index 30712d5bc..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/RequiresSpecificFrameworkFactAttribute.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Xunit; - -namespace Microsoft.DotNet.Tools.Test.Utilities -{ - public class RequiresSpecificFrameworkFactAttribute : FactAttribute - { - public RequiresSpecificFrameworkFactAttribute(string framework) - { - if (!EnvironmentInfo.HasSharedFramework(framework)) - { - this.Skip = $"This test requires a shared framework that isn't present: {framework}"; - } - } - } -} \ No newline at end of file diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/RequiresSpecificFrameworkTheoryAttribute.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/RequiresSpecificFrameworkTheoryAttribute.cs deleted file mode 100644 index 52166156b..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/RequiresSpecificFrameworkTheoryAttribute.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Tools.Test.Utilities; -using System; -using System.Collections.Generic; -using System.Text; -using Xunit; - -namespace Microsoft.DotNet.Tools.Test.Utilities -{ - public class RequiresSpecificFrameworkTheoryAttribute : TheoryAttribute - { - public RequiresSpecificFrameworkTheoryAttribute(string framework) - { - if (!EnvironmentInfo.HasSharedFramework(framework)) - { - this.Skip = $"This test requires a shared framework that isn't present: {framework}"; - } - } - } -} diff --git a/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj b/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj deleted file mode 100644 index 575d46870..000000000 --- a/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - Msbuild.Tests.Utilities - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - ../../tools/Key.snk - true - true - - - - - - - - - - - - - - - - - - diff --git a/test/Msbuild.Tests.Utilities/ProjDir.cs b/test/Msbuild.Tests.Utilities/ProjDir.cs deleted file mode 100644 index 3ca2f4019..000000000 --- a/test/Msbuild.Tests.Utilities/ProjDir.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.IO; -using Microsoft.Build.Construction; -using Microsoft.Build.Evaluation; - -namespace Msbuild.Tests.Utilities -{ - public class ProjDir - { - public ProjDir(string path) - { - Path = path; - Name = new DirectoryInfo(Path).Name; - } - - public string Path { get; private set; } - public string Name { get; private set; } - public string CsProjName => $"{Name}.csproj"; - public string CsProjPath => System.IO.Path.Combine(Path, CsProjName); - - public string CsProjContent() - { - return File.ReadAllText(CsProjPath); - } - - public ProjectRootElement CsProj() - { - // Passing new collection to prevent using cached version - return ProjectRootElement.Open(CsProjPath, new ProjectCollection()); - } - } -} diff --git a/test/Msbuild.Tests.Utilities/ProjectRootElementExtensions.cs b/test/Msbuild.Tests.Utilities/ProjectRootElementExtensions.cs deleted file mode 100644 index bc18d2cfb..000000000 --- a/test/Msbuild.Tests.Utilities/ProjectRootElementExtensions.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.Build.Construction; -using Microsoft.DotNet.ProjectJsonMigration; -using System.Linq; -using System.Collections.Generic; - -namespace Msbuild.Tests.Utilities -{ - public static class ProjectRootElementExtensions - { - public static int NumberOfItemGroupsWithConditionContaining( - this ProjectRootElement root, - string patternInCondition) - { - return root.ItemGroups.Count((itemGroup) => itemGroup.Condition.Contains(patternInCondition)); - } - - public static int NumberOfItemGroupsWithoutCondition(this ProjectRootElement root) - { - return root.ItemGroups.Count((ig) => string.IsNullOrEmpty(ig.Condition)); - } - - public static IEnumerable ItemsWithIncludeAndConditionContaining( - this ProjectRootElement root, - string itemType, - string includePattern, - string patternInCondition) - { - return root.Items.Where((it) => - { - if (it.ItemType != itemType || !it.Include.Contains(includePattern)) - { - return false; - } - - var condChain = it.ConditionChain(); - return condChain.Count == 1 && condChain.First().Contains(patternInCondition); - }); - } - - public static int NumberOfProjectReferencesWithIncludeAndConditionContaining( - this ProjectRootElement root, - string includePattern, - string patternInCondition) - { - return root.ItemsWithIncludeAndConditionContaining( - "ProjectReference", - includePattern, - patternInCondition) - .Count(); - } - - public static IEnumerable ItemsWithIncludeContaining( - this ProjectRootElement root, - string itemType, - string includePattern) - { - return root.Items.Where((it) => it.ItemType == itemType && it.Include.Contains(includePattern) - && it.ConditionChain().Count() == 0); - } - - public static int NumberOfProjectReferencesWithIncludeContaining( - this ProjectRootElement root, - string includePattern) - { - return root.ItemsWithIncludeContaining("ProjectReference", includePattern).Count(); - } - } -} diff --git a/test/Msbuild.Tests.Utilities/TestSetup.cs b/test/Msbuild.Tests.Utilities/TestSetup.cs deleted file mode 100644 index eaf2c7d79..000000000 --- a/test/Msbuild.Tests.Utilities/TestSetup.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.IO; - -namespace Msbuild.Tests.Utilities -{ - public class TestSetup - { - public const string TestGroup = "NonRestoredTestProjects"; - public const string ProjectName = "DotnetAddP2PProjects"; - - public string TestRoot { get; private set; } - - private const string ValidRef = "ValidRef"; - public string ValidRefDir => Path.Combine(TestRoot, ValidRef); - public string ValidRefCsprojName => $"{ValidRef}.csproj"; - public string ValidRefCsprojRelPath => Path.Combine(ValidRef, ValidRefCsprojName); - public string ValidRefCsprojPath => Path.Combine(TestRoot, ValidRefCsprojRelPath); - public string ValidRefCsprojRelToOtherProjPath => Path.Combine("..", ValidRefCsprojRelPath); - - private const string Lib = "Lib"; - public string LibDir => Path.Combine(TestRoot, Lib); - public string LibCsprojName => $"{Lib}.csproj"; - public string LibCsprojPath => Path.Combine(TestRoot, Lib, LibCsprojName); - public string LibCsprojRelPath => Path.Combine("..", Lib, LibCsprojName); - - public TestSetup(string testRoot) - { - TestRoot = testRoot; - } - } -} diff --git a/test/binding-redirects.Tests/BindingRedirectTests.cs b/test/binding-redirects.Tests/BindingRedirectTests.cs deleted file mode 100644 index 67401f8c0..000000000 --- a/test/binding-redirects.Tests/BindingRedirectTests.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using FluentAssertions; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; - -namespace Microsoft.DotNet.BindingRedirects.Tests -{ - public class GivenAnAppWithRedirectsAndExecutableDependency : TestBase, IClassFixture - { - public string _appWithConfigProjectRoot; - public string _appWithoutConfigProjectRoot; - - public GivenAnAppWithRedirectsAndExecutableDependency(TestSetupFixture testSetup) - { - _appWithConfigProjectRoot = testSetup.AppWithConfigProjectRoot; - _appWithoutConfigProjectRoot = testSetup.AppWithoutConfigProjectRoot; - } - - [Fact(Skip="https://github.com/dotnet/cli/issues/4514")] - public void Tool_Command_Runs_Executable_Dependency_For_App_With_Config() - { - new DependencyToolInvokerCommand() - .WithWorkingDirectory(_appWithConfigProjectRoot) - .ExecuteWithCapturedOutput("desktop-binding-redirects", "net46", "") - .Should().Pass().And.NotHaveStdErr(); - } - - [Fact(Skip="https://github.com/dotnet/cli/issues/4514")] - public void Tool_Command_Runs_Executable_Dependency_For_App_Without_Config() - { - new DependencyToolInvokerCommand() - .WithWorkingDirectory(_appWithoutConfigProjectRoot) - .ExecuteWithCapturedOutput("desktop-binding-redirects", "net46", "") - .Should().Pass().And.NotHaveStdErr(); - } - } -} diff --git a/test/binding-redirects.Tests/TestSetupFixture.cs b/test/binding-redirects.Tests/TestSetupFixture.cs deleted file mode 100644 index d5ce331a9..000000000 --- a/test/binding-redirects.Tests/TestSetupFixture.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.IO; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.BindingRedirects.Tests -{ - public class TestSetupFixture : TestBase - { - private readonly NuGetFramework Framework = NuGet.Frameworks.FrameworkConstants.CommonFrameworks.Net46; - private const string Config = "Debug"; - private const string AppWithConfig = "AppWithRedirectsAndConfig"; - private const string AppWithoutConfig = "AppWithRedirectsNoConfig"; - - private string _Runtime = RuntimeEnvironmentRidExtensions.GetLegacyRestoreRuntimeIdentifier(); - private string _appWithConfigProjectRoot; - private string _appWithoutConfigProjectRoot; - private TestAssetInstance _testInstance; - - public string AppWithConfigProjectRoot { get { return _appWithConfigProjectRoot; } } - public string AppWithoutConfigProjectRoot { get { return _appWithoutConfigProjectRoot; } } - - public TestSetupFixture() - { - _testInstance = TestAssets.Get("DesktopTestProjects", "BindingRedirectSample") - .CreateInstance() - .WithSourceFiles() - .WithNuGetConfig(new RepoDirectoriesProvider().TestPackages); - - _appWithConfigProjectRoot = Setup(AppWithConfig); - _appWithoutConfigProjectRoot = Setup(AppWithoutConfig); - } - - private string Setup(string project) - { - string projectDir = Path.Combine(_testInstance.Root.FullName, project); - string publishDir = Path.Combine(projectDir, "publish"); - - new RestoreCommand() - .WithWorkingDirectory(projectDir) - .WithRuntime(_Runtime) - .ExecuteWithCapturedOutput() - .Should().Pass(); - - new BuildCommand() - .WithWorkingDirectory(projectDir) - .WithFramework(Framework) - .WithRuntime(_Runtime) - .Execute() - .Should().Pass(); - - new PublishCommand() - .WithWorkingDirectory(projectDir) - .WithOutput(publishDir) - .WithFramework(Framework) - .WithRuntime(_Runtime) - .Execute() - .Should().Pass(); - - return projectDir; - } - } -} diff --git a/test/binding-redirects.Tests/binding-redirects.Tests.csproj b/test/binding-redirects.Tests/binding-redirects.Tests.csproj deleted file mode 100644 index c1a94e084..000000000 --- a/test/binding-redirects.Tests/binding-redirects.Tests.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - binding-redirects.Tests - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - $(TestOutputDir)/packages - - - - - - - - - - - - - diff --git a/test/crossgen.Tests/crossgen.Tests.cs b/test/crossgen.Tests/crossgen.Tests.cs deleted file mode 100644 index 96cc58742..000000000 --- a/test/crossgen.Tests/crossgen.Tests.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection.PortableExecutable; -using Microsoft.DotNet.Tools.Test.Utilities; -using FluentAssertions; -using Xunit; - -namespace Microsoft.DotNet.Tests -{ - /// - /// Static analysis of assemblies to make sure that they are crossgened. - /// - public class CrossgenTests : TestBase - { - [Fact(Skip="https://github.com/dotnet/cli/issues/3059")] - public void CLI_SDK_assemblies_must_be_crossgened() - { - string dotnetDir = FindDotnetDirInPath(); - string cliPath = Directory.EnumerateFiles(dotnetDir, "dotnet.dll", SearchOption.AllDirectories).First(); - cliPath = Path.GetDirectoryName(cliPath); - CheckDirectoryIsCrossgened(cliPath); - } - - [Fact(Skip="https://github.com/dotnet/cli/issues/3059")] - public void Shared_Fx_assemblies_must_be_crossgened() - { - string dotnetDir = FindDotnetDirInPath(); - string sharedFxPath = Directory.EnumerateFiles(dotnetDir, "mscorlib*.dll", SearchOption.AllDirectories).First(); - sharedFxPath = Path.GetDirectoryName(sharedFxPath); - CheckDirectoryIsCrossgened(sharedFxPath); - } - - private static void CheckDirectoryIsCrossgened(string pathToAssemblies) - { - Console.WriteLine($"Checking directory '{pathToAssemblies}' for crossgened assemblies"); - - var dlls = Directory.EnumerateFiles(pathToAssemblies, "*.dll", SearchOption.TopDirectoryOnly); - var exes = Directory.EnumerateFiles(pathToAssemblies, "*.exe", SearchOption.TopDirectoryOnly); - var assemblies = dlls.Concat(exes); - assemblies.Count().Should().NotBe(0, $"No assemblies found at directory '{pathToAssemblies}'"); - - foreach (var assembly in assemblies) - { - using (var asmStream = File.OpenRead(assembly)) - { - using (var peReader = new PEReader(asmStream)) - { - if (peReader.HasMetadata) - { - peReader.IsCrossgened().Should().BeTrue($"Managed assembly '{assembly}' is not crossgened."); - } - } - } - } - } - - private static string FindDotnetDirInPath() - { - string dotnetExecutable = $"dotnet{Microsoft.DotNet.Cli.Utils.FileNameSuffixes.CurrentPlatform.Exe}"; - foreach (string path in (Environment.GetEnvironmentVariable("PATH") ?? "").Split(Path.PathSeparator)) - { - string dotnetPath = Path.Combine(path, dotnetExecutable); - if (File.Exists(dotnetPath)) - { - return Path.GetDirectoryName(dotnetPath); - } - } - - throw new FileNotFoundException($"Unable to find '{dotnetExecutable}' in the $PATH"); - } - } -} diff --git a/test/crossgen.Tests/crossgen.Tests.csproj b/test/crossgen.Tests/crossgen.Tests.csproj deleted file mode 100644 index 1849d5995..000000000 --- a/test/crossgen.Tests/crossgen.Tests.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - crossgen.Tests - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - - - - - - - - - - - - - diff --git a/test/dotnet-add-package.Tests/GivenDotnetPackageAdd.cs b/test/dotnet-add-package.Tests/GivenDotnetPackageAdd.cs deleted file mode 100644 index 356d86ce4..000000000 --- a/test/dotnet-add-package.Tests/GivenDotnetPackageAdd.cs +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using FluentAssertions; -using Microsoft.DotNet.Tools.Test.Utilities; -using Microsoft.DotNet.Tools.Add.PackageReference; -using System; -using System.IO; -using System.Linq; -using Xunit; -using Xunit.Abstractions; - -namespace Microsoft.DotNet.Cli.Package.Add.Tests -{ - public class GivenDotnetPackageAdd : TestBase - { - private readonly ITestOutputHelper _output; - - public GivenDotnetPackageAdd(ITestOutputHelper output) - { - _output = output; - } - - [Fact] - public void WhenValidPackageIsPassedBeforeVersionItGetsAdded() - { - var testAsset = "TestAppSimple"; - var projectDirectory = TestAssets - .Get(testAsset) - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var packageName = "Newtonsoft.Json"; - var packageVersion = "9.0.1"; - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"add package {packageName} --version {packageVersion}"); - cmd.Should().Pass(); - cmd.StdOut.Should().Contain($"PackageReference for package '{packageName}' version '{packageVersion}' " + - $"added to file '{projectDirectory + Path.DirectorySeparatorChar + testAsset}.csproj'."); - cmd.StdErr.Should().BeEmpty(); - } - - [Fact] - public void - WhenValidProjectAndPackageArePassedItGetsAdded() - { - var testAsset = "TestAppSimple"; - var projectDirectory = TestAssets - .Get(testAsset) - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var csproj = $"{projectDirectory + Path.DirectorySeparatorChar + testAsset}.csproj"; - var packageName = "Newtonsoft.Json"; - var packageVersion = "9.0.1"; - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"add {csproj} package {packageName} --version {packageVersion}"); - - _output.WriteLine($"[STDOUT] {cmd.StdOut}\n[STDERR]{cmd.StdErr}\n"); - - cmd.Should().Pass(); - - cmd.StdOut.Should() - .Contain($"PackageReference for package \'{packageName}\' version \'{packageVersion}\' added to file '{csproj}'."); - - cmd.StdErr.Should().BeEmpty(); - } - - [Fact] - public void WhenValidPackageIsPassedAfterVersionItGetsAdded() - { - var testAsset = "TestAppSimple"; - var projectDirectory = TestAssets - .Get(testAsset) - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var packageName = "Newtonsoft.Json"; - var packageVersion = "9.0.1"; - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"add package --version {packageVersion} {packageName}"); - cmd.Should().Pass(); - cmd.StdOut.Should().Contain($"PackageReference for package '{packageName}' version '{packageVersion}' " + - $"added to file '{projectDirectory + Path.DirectorySeparatorChar + testAsset}.csproj'."); - cmd.StdErr.Should().BeEmpty(); - } - - [Fact] - public void WhenValidPackageIsPassedWithFrameworkItGetsAdded() - { - var testAsset = "TestAppSimple"; - var projectDirectory = TestAssets - .Get(testAsset) - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var packageName = "Newtonsoft.Json"; - var packageVersion = "9.0.1"; - var framework = "netcoreapp2.0"; - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"add package {packageName} --version {packageVersion} --framework {framework}"); - cmd.Should().Pass(); - cmd.StdOut.Should().Contain($"PackageReference for package '{packageName}' version '{packageVersion}' " + - $"added to file '{projectDirectory + Path.DirectorySeparatorChar + testAsset}.csproj'."); - cmd.StdErr.Should().BeEmpty(); - } - - [Fact] - public void WhenValidPackageIsPassedMSBuildDoesNotPrintVersionHeader() - { - var testAsset = "TestAppSimple"; - var projectDirectory = TestAssets - .Get(testAsset) - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var packageName = "Newtonsoft.Json"; - var packageVersion = "9.0.1"; - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"add package {packageName} --version {packageVersion}"); - cmd.Should().Pass(); - cmd.StdOut.Should().NotContain("Microsoft (R) Build Engine version"); - cmd.StdErr.Should().BeEmpty(); - } - - [Fact] - public void WhenMultiplePackagesArePassedCommandFails() - { - var projectDirectory = TestAssets - .Get("TestAppSimple") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"add package package1 package2 package3"); - cmd.Should().Fail(); - cmd.StdErr.Should().Contain(LocalizableStrings.SpecifyExactlyOnePackageReference); - } - - [Fact] - public void WhenNoPackageisPassedCommandFails() - { - var projectDirectory = TestAssets - .Get("TestAppSimple") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"add package"); - cmd.Should().Fail(); - cmd.StdErr.Should().Contain(LocalizableStrings.SpecifyExactlyOnePackageReference); - } - } -} diff --git a/test/dotnet-add-package.Tests/MSBuild.exe b/test/dotnet-add-package.Tests/MSBuild.exe deleted file mode 100644 index 9bda258ef..000000000 --- a/test/dotnet-add-package.Tests/MSBuild.exe +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 diff --git a/test/dotnet-add-package.Tests/MSBuild.exe.config b/test/dotnet-add-package.Tests/MSBuild.exe.config deleted file mode 100644 index 9bda258ef..000000000 --- a/test/dotnet-add-package.Tests/MSBuild.exe.config +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 diff --git a/test/dotnet-add-package.Tests/dotnet-add-package.Tests.csproj b/test/dotnet-add-package.Tests/dotnet-add-package.Tests.csproj deleted file mode 100644 index cb759125c..000000000 --- a/test/dotnet-add-package.Tests/dotnet-add-package.Tests.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-add-package.Tests - ../../tools/Key.snk - true - true - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - - - - - - - - - - - - - - - - - - diff --git a/test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs b/test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs deleted file mode 100644 index ba37b1e73..000000000 --- a/test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs +++ /dev/null @@ -1,697 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using FluentAssertions; -using Microsoft.Build.Construction; -using Microsoft.DotNet.Tools; -using Microsoft.DotNet.Tools.Test.Utilities; -using Msbuild.Tests.Utilities; -using System; -using System.IO; -using System.Linq; -using Xunit; - -namespace Microsoft.DotNet.Cli.Add.Reference.Tests -{ - public class GivenDotnetAddReference : TestBase - { - private const string HelpText = @"Usage: dotnet add reference [options] - -Arguments: - The project file to operate on. If a file is not specified, the command will search the current directory for one. - Project to project references to add - -Options: - -h, --help Show help information. - -f, --framework Add reference only when targeting a specific framework -"; - - private const string AddCommandHelpText = @"Usage: dotnet add [options] [command] - -Arguments: - The project file to operate on. If a file is not specified, the command will search the current directory for one. - -Options: - -h, --help Show help information. - -Commands: - package .NET Add Package reference Command - reference .NET Add Project to Project reference Command -"; - - const string FrameworkNet451Arg = "-f net451"; - const string ConditionFrameworkNet451 = "== 'net451'"; - const string FrameworkNetCoreApp10Arg = "-f netcoreapp1.0"; - const string ConditionFrameworkNetCoreApp10 = "== 'netcoreapp1.0'"; - static readonly string ProjectNotCompatibleErrorMessageRegEx = string.Format(CommonLocalizableStrings.ProjectNotCompatibleWithFrameworks, "[^`]*"); - static readonly string ProjectDoesNotTargetFrameworkErrorMessageRegEx = string.Format(CommonLocalizableStrings.ProjectDoesNotTargetFramework, "[^`]*", "[^`]*"); - static readonly string[] DefaultFrameworks = new string[] { "netcoreapp1.0", "net451" }; - - private TestSetup Setup([System.Runtime.CompilerServices.CallerMemberName] string callingMethod = nameof(Setup), string identifier = "") - { - return new TestSetup( - TestAssets.Get(TestSetup.TestGroup, TestSetup.ProjectName) - .CreateInstance(callingMethod: callingMethod, identifier: identifier) - .WithSourceFiles() - .Root - .FullName); - } - - private ProjDir NewDir([System.Runtime.CompilerServices.CallerMemberName] string callingMethod = nameof(NewDir), string identifier = "") - { - return new ProjDir(TestAssets.CreateTestDirectory(callingMethod: callingMethod, identifier: identifier).FullName); - } - - private ProjDir NewLib(string dir = null, [System.Runtime.CompilerServices.CallerMemberName] string callingMethod = nameof(NewDir), string identifier = "") - { - var projDir = dir == null ? NewDir(callingMethod: callingMethod, identifier: identifier) : new ProjDir(dir); - - try - { - string args = $"classlib -o \"{projDir.Path}\" --debug:ephemeral-hive --no-restore"; - new NewCommandShim() - .WithWorkingDirectory(projDir.Path) - .ExecuteWithCapturedOutput(args) - .Should().Pass(); - } - catch (System.ComponentModel.Win32Exception e) - { - throw new Exception($"Intermittent error in `dotnet new` occurred when running it in dir `{projDir.Path}`\nException:\n{e}"); - } - - return projDir; - } - - private static void SetTargetFrameworks(ProjDir proj, string[] frameworks) - { - var csproj = proj.CsProj(); - csproj.AddProperty("TargetFrameworks", string.Join(";", frameworks)); - csproj.Save(); - } - - private ProjDir NewLibWithFrameworks(string dir = null, [System.Runtime.CompilerServices.CallerMemberName] string callingMethod = nameof(NewDir), string identifier = "") - { - var ret = NewLib(dir, callingMethod: callingMethod, identifier: identifier); - SetTargetFrameworks(ret, DefaultFrameworks); - return ret; - } - - [Theory] - [InlineData("--help")] - [InlineData("-h")] - public void WhenHelpOptionIsPassedItPrintsUsage(string helpArg) - { - var cmd = new AddReferenceCommand().Execute(helpArg); - cmd.Should().Pass(); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Theory] - [InlineData("")] - [InlineData("unknownCommandName")] - public void WhenNoCommandIsPassedItPrintsError(string commandName) - { - var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"add {commandName}"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(CommonLocalizableStrings.RequiredCommandNotPassed); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(AddCommandHelpText); - } - - [Fact] - public void WhenTooManyArgumentsArePassedItPrintsError() - { - var cmd = new AddReferenceCommand() - .WithProject("one two three") - .Execute("proj.csproj"); - cmd.ExitCode.Should().NotBe(0); - cmd.StdErr.Should().BeVisuallyEquivalentTo($@"{string.Format(CommandLine.LocalizableStrings.UnrecognizedCommandOrArgument, "two")} -{string.Format(CommandLine.LocalizableStrings.UnrecognizedCommandOrArgument, "three")}"); - } - - [Theory] - [InlineData("idontexist.csproj")] - [InlineData("ihave?inv@lid/char\\acters")] - public void WhenNonExistingProjectIsPassedItPrintsErrorAndUsage(string projName) - { - var setup = Setup(); - - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(projName) - .Execute($"\"{setup.ValidRefCsprojPath}\""); - cmd.ExitCode.Should().NotBe(0); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.CouldNotFindProjectOrDirectory, projName)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenBrokenProjectIsPassedItPrintsErrorAndUsage() - { - string projName = "Broken/Broken.csproj"; - var setup = Setup(); - - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(projName) - .Execute($"\"{setup.ValidRefCsprojPath}\""); - cmd.ExitCode.Should().NotBe(0); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.ProjectIsInvalid, "Broken/Broken.csproj")); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenMoreThanOneProjectExistsInTheDirectoryItPrintsErrorAndUsage() - { - var setup = Setup(); - - var workingDir = Path.Combine(setup.TestRoot, "MoreThanOne"); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(workingDir) - .Execute($"\"{setup.ValidRefCsprojRelToOtherProjPath}\""); - cmd.ExitCode.Should().NotBe(0); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.MoreThanOneProjectInDirectory, workingDir + Path.DirectorySeparatorChar)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenNoProjectsExistsInTheDirectoryItPrintsErrorAndUsage() - { - var setup = Setup(); - - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .Execute($"\"{setup.ValidRefCsprojPath}\""); - cmd.ExitCode.Should().NotBe(0); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.CouldNotFindAnyProjectInDirectory, setup.TestRoot + Path.DirectorySeparatorChar)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void ItAddsRefWithoutCondAndPrintsStatus() - { - var setup = Setup(); - var lib = NewLibWithFrameworks(dir: setup.TestRoot); - - int noCondBefore = lib.CsProj().NumberOfItemGroupsWithoutCondition(); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"\"{setup.ValidRefCsprojPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ReferenceAddedToTheProject, @"ValidRef\ValidRef.csproj")); - cmd.StdErr.Should().BeEmpty(); - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithoutCondition().Should().Be(noCondBefore + 1); - csproj.NumberOfProjectReferencesWithIncludeContaining(setup.ValidRefCsprojName).Should().Be(1); - } - - [Fact] - public void ItAddsRefWithCondAndPrintsStatus() - { - var setup = Setup(); - var lib = NewLibWithFrameworks(dir: setup.TestRoot); - - int condBefore = lib.CsProj().NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNet451); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"{FrameworkNet451Arg} \"{setup.ValidRefCsprojPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ReferenceAddedToTheProject, @"ValidRef\ValidRef.csproj")); - cmd.StdErr.Should().BeEmpty(); - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNet451).Should().Be(condBefore + 1); - csproj.NumberOfProjectReferencesWithIncludeAndConditionContaining(setup.ValidRefCsprojName, ConditionFrameworkNet451).Should().Be(1); - } - - [Fact] - public void WhenRefWithoutCondIsPresentItAddsDifferentRefWithoutCond() - { - var setup = Setup(); - var lib = NewLibWithFrameworks(dir: setup.TestRoot); - - new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"\"{setup.LibCsprojPath}\"") - .Should().Pass(); - - int noCondBefore = lib.CsProj().NumberOfItemGroupsWithoutCondition(); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(lib.Path) - .WithProject(lib.CsProjName) - .Execute($"\"{setup.ValidRefCsprojPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ReferenceAddedToTheProject, @"ValidRef\ValidRef.csproj")); - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithoutCondition().Should().Be(noCondBefore); - csproj.NumberOfProjectReferencesWithIncludeContaining(setup.ValidRefCsprojName).Should().Be(1); - } - - [Fact] - public void WhenRefWithCondIsPresentItAddsDifferentRefWithCond() - { - var setup = Setup(); - var lib = NewLibWithFrameworks(dir: setup.TestRoot); - - new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"{FrameworkNet451Arg} \"{setup.LibCsprojPath}\"") - .Should().Pass(); - - int condBefore = lib.CsProj().NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNet451); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"{FrameworkNet451Arg} \"{setup.ValidRefCsprojPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ReferenceAddedToTheProject, @"ValidRef\ValidRef.csproj")); ; - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNet451).Should().Be(condBefore); - csproj.NumberOfProjectReferencesWithIncludeAndConditionContaining(setup.ValidRefCsprojName, ConditionFrameworkNet451).Should().Be(1); - } - - [Fact] - public void WhenRefWithCondIsPresentItAddsRefWithDifferentCond() - { - var setup = Setup(); - var lib = NewLibWithFrameworks(dir: setup.TestRoot); - - new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"{FrameworkNetCoreApp10Arg} \"{setup.ValidRefCsprojPath}\"") - .Should().Pass(); - - int condBefore = lib.CsProj().NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNet451); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"{FrameworkNet451Arg} \"{setup.ValidRefCsprojPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ReferenceAddedToTheProject, @"ValidRef\ValidRef.csproj")); - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNet451).Should().Be(condBefore + 1); - csproj.NumberOfProjectReferencesWithIncludeAndConditionContaining(setup.ValidRefCsprojName, ConditionFrameworkNet451).Should().Be(1); - } - - [Fact] - public void WhenRefWithConditionIsPresentItAddsDifferentRefWithoutCond() - { - var setup = Setup(); - var lib = NewLibWithFrameworks(dir: setup.TestRoot); - - new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"{FrameworkNet451Arg} \"{setup.LibCsprojPath}\"") - .Should().Pass(); - - int noCondBefore = lib.CsProj().NumberOfItemGroupsWithoutCondition(); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"\"{setup.ValidRefCsprojPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ReferenceAddedToTheProject, @"ValidRef\ValidRef.csproj")); - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithoutCondition().Should().Be(noCondBefore + 1); - csproj.NumberOfProjectReferencesWithIncludeContaining(setup.ValidRefCsprojName).Should().Be(1); - } - - [Fact] - public void WhenRefWithNoCondAlreadyExistsItDoesntDuplicate() - { - var setup = Setup(); - var lib = NewLibWithFrameworks(dir: setup.TestRoot); - - new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"\"{setup.ValidRefCsprojPath}\"") - .Should().Pass(); - - int noCondBefore = lib.CsProj().NumberOfItemGroupsWithoutCondition(); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(lib.Path) - .WithProject(lib.CsProjName) - .Execute($"\"{setup.ValidRefCsprojPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ProjectAlreadyHasAreference, @"ValidRef\ValidRef.csproj")); - - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithoutCondition().Should().Be(noCondBefore); - csproj.NumberOfProjectReferencesWithIncludeContaining(setup.ValidRefCsprojName).Should().Be(1); - } - - [Fact] - public void WhenRefWithCondOnItemAlreadyExistsItDoesntDuplicate() - { - var setup = Setup(); - var proj = new ProjDir(Path.Combine(setup.TestRoot, "WithExistingRefCondOnItem")); - - string contentBefore = proj.CsProjContent(); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(proj.Path) - .WithProject(proj.CsProjPath) - .Execute($"{FrameworkNet451Arg} \"{setup.LibCsprojRelPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ProjectAlreadyHasAreference, @"..\Lib\Lib.csproj")); - proj.CsProjContent().Should().BeEquivalentTo(contentBefore); - } - - [Fact] - public void WhenRefWithCondOnItemGroupAlreadyExistsItDoesntDuplicate() - { - var setup = Setup(); - var lib = NewLibWithFrameworks(dir: setup.TestRoot); - - new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"{FrameworkNet451Arg} \"{setup.ValidRefCsprojPath}\"") - .Should().Pass(); - - var csprojContentBefore = lib.CsProjContent(); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"{FrameworkNet451Arg} \"{setup.ValidRefCsprojPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ProjectAlreadyHasAreference, @"ValidRef\ValidRef.csproj")); - lib.CsProjContent().Should().BeEquivalentTo(csprojContentBefore); - } - - [Fact] - public void WhenRefWithCondWithWhitespaceOnItemGroupExistsItDoesntDuplicate() - { - var setup = Setup(); - var proj = new ProjDir(Path.Combine(setup.TestRoot, "WithExistingRefCondWhitespaces")); - - string contentBefore = proj.CsProjContent(); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(proj.Path) - .WithProject(proj.CsProjName) - .Execute($"{FrameworkNet451Arg} \"{setup.LibCsprojRelPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ProjectAlreadyHasAreference, @"..\Lib\Lib.csproj")); - proj.CsProjContent().Should().BeEquivalentTo(contentBefore); - } - - [Fact] - public void WhenRefWithoutCondAlreadyExistsInNonUniformItemGroupItDoesntDuplicate() - { - var setup = Setup(); - var proj = new ProjDir(Path.Combine(setup.TestRoot, "WithRefNoCondNonUniform")); - - string contentBefore = proj.CsProjContent(); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(proj.Path) - .WithProject(proj.CsProjName) - .Execute($"\"{setup.LibCsprojRelPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ProjectAlreadyHasAreference, @"..\Lib\Lib.csproj")); - proj.CsProjContent().Should().BeEquivalentTo(contentBefore); - } - - [Fact] - public void WhenRefWithoutCondAlreadyExistsInNonUniformItemGroupItAddsDifferentRefInDifferentGroup() - { - var setup = Setup(); - var proj = new ProjDir(Path.Combine(setup.TestRoot, "WithRefNoCondNonUniform")); - - int noCondBefore = proj.CsProj().NumberOfItemGroupsWithoutCondition(); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(proj.CsProjPath) - .Execute($"\"{setup.ValidRefCsprojPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ReferenceAddedToTheProject, @"..\ValidRef\ValidRef.csproj")); - var csproj = proj.CsProj(); - csproj.NumberOfItemGroupsWithoutCondition().Should().Be(noCondBefore + 1); - csproj.NumberOfProjectReferencesWithIncludeContaining(setup.ValidRefCsprojName).Should().Be(1); - } - - [Fact] - public void WhenRefWithCondAlreadyExistsInNonUniformItemGroupItDoesntDuplicate() - { - var setup = Setup(); - var proj = new ProjDir(Path.Combine(setup.TestRoot, "WithRefCondNonUniform")); - - string contentBefore = proj.CsProjContent(); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(proj.Path) - .WithProject(proj.CsProjName) - .Execute($"{FrameworkNet451Arg} \"{setup.LibCsprojRelPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ProjectAlreadyHasAreference, @"..\Lib\Lib.csproj")); - proj.CsProjContent().Should().BeEquivalentTo(contentBefore); - } - - [Fact] - public void WhenRefWithCondAlreadyExistsInNonUniformItemGroupItAddsDifferentRefInDifferentGroup() - { - var setup = Setup(); - var proj = new ProjDir(Path.Combine(setup.TestRoot, "WithRefCondNonUniform")); - - int condBefore = proj.CsProj().NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNet451); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(proj.CsProjPath) - .Execute($"{FrameworkNet451Arg} \"{setup.ValidRefCsprojPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ReferenceAddedToTheProject, "..\\ValidRef\\ValidRef.csproj")); - var csproj = proj.CsProj(); - csproj.NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNet451).Should().Be(condBefore + 1); - csproj.NumberOfProjectReferencesWithIncludeAndConditionContaining(setup.ValidRefCsprojName, ConditionFrameworkNet451).Should().Be(1); - } - - [Fact] - public void WhenEmptyItemGroupPresentItAddsRefInIt() - { - var setup = Setup(); - var proj = new ProjDir(Path.Combine(setup.TestRoot, "EmptyItemGroup")); - - int noCondBefore = proj.CsProj().NumberOfItemGroupsWithoutCondition(); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(proj.CsProjPath) - .Execute($"\"{setup.ValidRefCsprojPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ReferenceAddedToTheProject, @"..\ValidRef\ValidRef.csproj")); - var csproj = proj.CsProj(); - csproj.NumberOfItemGroupsWithoutCondition().Should().Be(noCondBefore); - csproj.NumberOfProjectReferencesWithIncludeContaining(setup.ValidRefCsprojName).Should().Be(1); - } - - [Fact] - public void ItAddsMultipleRefsNoCondToTheSameItemGroup() - { - string OutputText = $@"{string.Format(CommonLocalizableStrings.ReferenceAddedToTheProject, @"Lib\Lib.csproj")} -{string.Format(CommonLocalizableStrings.ReferenceAddedToTheProject, @"ValidRef\ValidRef.csproj")}"; - - var setup = Setup(); - var lib = NewLibWithFrameworks(dir: setup.TestRoot); - - int noCondBefore = lib.CsProj().NumberOfItemGroupsWithoutCondition(); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"\"{setup.LibCsprojPath}\" \"{setup.ValidRefCsprojPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().BeVisuallyEquivalentTo(OutputText); - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithoutCondition().Should().Be(noCondBefore + 1); - csproj.NumberOfProjectReferencesWithIncludeContaining(setup.ValidRefCsprojName).Should().Be(1); - csproj.NumberOfProjectReferencesWithIncludeContaining(setup.LibCsprojName).Should().Be(1); - } - - [Fact] - public void ItAddsMultipleRefsWithCondToTheSameItemGroup() - { - string OutputText = $@"{string.Format(CommonLocalizableStrings.ReferenceAddedToTheProject, @"Lib\Lib.csproj")} -{string.Format(CommonLocalizableStrings.ReferenceAddedToTheProject, @"ValidRef\ValidRef.csproj")}"; - - var setup = Setup(); - var lib = NewLibWithFrameworks(dir: setup.TestRoot); - - int noCondBefore = lib.CsProj().NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNet451); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"{FrameworkNet451Arg} \"{setup.LibCsprojPath}\" \"{setup.ValidRefCsprojPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().BeVisuallyEquivalentTo(OutputText); - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNet451).Should().Be(noCondBefore + 1); - csproj.NumberOfProjectReferencesWithIncludeAndConditionContaining(setup.ValidRefCsprojName, ConditionFrameworkNet451).Should().Be(1); - csproj.NumberOfProjectReferencesWithIncludeAndConditionContaining(setup.LibCsprojName, ConditionFrameworkNet451).Should().Be(1); - } - - [Fact] - public void WhenProjectNameIsNotPassedItFindsItAndAddsReference() - { - var setup = Setup(); - var lib = NewLibWithFrameworks(dir: setup.TestRoot); - - int noCondBefore = lib.CsProj().NumberOfItemGroupsWithoutCondition(); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(lib.Path) - .Execute($"\"{setup.ValidRefCsprojPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ReferenceAddedToTheProject, @"ValidRef\ValidRef.csproj")); - cmd.StdErr.Should().BeEmpty(); - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithoutCondition().Should().Be(noCondBefore + 1); - csproj.NumberOfProjectReferencesWithIncludeContaining(setup.ValidRefCsprojName).Should().Be(1); - } - - [Fact] - public void WhenPassedReferenceDoesNotExistItShowsAnError() - { - var lib = NewLibWithFrameworks(); - - var contentBefore = lib.CsProjContent(); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(lib.Path) - .WithProject(lib.CsProjName) - .Execute("\"IDoNotExist.csproj\""); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.ReferenceDoesNotExist, "IDoNotExist.csproj")); - lib.CsProjContent().Should().BeEquivalentTo(contentBefore); - } - - [Fact] - public void WhenPassedMultipleRefsAndOneOfthemDoesNotExistItCancelsWholeOperation() - { - var lib = NewLibWithFrameworks(); - var setup = Setup(); - - var contentBefore = lib.CsProjContent(); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"\"{setup.ValidRefCsprojPath}\" \"IDoNotExist.csproj\""); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.ReferenceDoesNotExist, "IDoNotExist.csproj")); - lib.CsProjContent().Should().BeEquivalentTo(contentBefore); - } - - [Fact] - public void WhenPassedReferenceIsUsingSlashesItNormalizesItToBackslashes() - { - var setup = Setup(); - var lib = NewLibWithFrameworks(dir: setup.TestRoot); - - int noCondBefore = lib.CsProj().NumberOfItemGroupsWithoutCondition(); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(lib.Path) - .WithProject(lib.CsProjName) - .Execute($"\"{setup.ValidRefCsprojPath.Replace('\\', '/')}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ReferenceAddedToTheProject, @"ValidRef\ValidRef.csproj")); - cmd.StdErr.Should().BeEmpty(); - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithoutCondition().Should().Be(noCondBefore + 1); - csproj.NumberOfProjectReferencesWithIncludeContaining(setup.ValidRefCsprojRelPath.Replace('/', '\\')).Should().Be(1); - } - - [Fact] - public void WhenReferenceIsRelativeAndProjectIsNotInCurrentDirectoryReferencePathIsFixed() - { - var setup = Setup(); - var proj = new ProjDir(setup.LibDir); - - int noCondBefore = proj.CsProj().NumberOfItemGroupsWithoutCondition(); - var cmd = new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(setup.LibCsprojPath) - .Execute($"\"{setup.ValidRefCsprojRelPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ReferenceAddedToTheProject, @"..\ValidRef\ValidRef.csproj")); - cmd.StdErr.Should().BeEmpty(); - var csproj = proj.CsProj(); - csproj.NumberOfItemGroupsWithoutCondition().Should().Be(noCondBefore + 1); - csproj.NumberOfProjectReferencesWithIncludeContaining(setup.ValidRefCsprojRelToOtherProjPath.Replace('/', '\\')).Should().Be(1); - } - - [Fact] - public void ItCanAddReferenceWithConditionOnCompatibleFramework() - { - var setup = Setup(); - var lib = new ProjDir(setup.LibDir); - var net45lib = new ProjDir(Path.Combine(setup.TestRoot, "Net45Lib")); - - int condBefore = lib.CsProj().NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNet451); - var cmd = new AddReferenceCommand() - .WithProject(lib.CsProjPath) - .Execute($"{FrameworkNet451Arg} \"{net45lib.CsProjPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ReferenceAddedToTheProject, @"..\Net45Lib\Net45Lib.csproj")); - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNet451).Should().Be(condBefore + 1); - csproj.NumberOfProjectReferencesWithIncludeAndConditionContaining(net45lib.CsProjName, ConditionFrameworkNet451).Should().Be(1); - } - - [Fact] - public void ItCanAddRefWithoutCondAndTargetingSupersetOfFrameworksAndOneOfReferencesCompatible() - { - var setup = Setup(); - var lib = new ProjDir(setup.LibDir); - var net452netcoreapp10lib = new ProjDir(Path.Combine(setup.TestRoot, "Net452AndNetCoreApp10Lib")); - - int noCondBefore = net452netcoreapp10lib.CsProj().NumberOfItemGroupsWithoutCondition(); - var cmd = new AddReferenceCommand() - .WithProject(net452netcoreapp10lib.CsProjPath) - .Execute($"\"{lib.CsProjPath}\""); - cmd.Should().Pass(); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ReferenceAddedToTheProject, @"..\Lib\Lib.csproj")); - var csproj = net452netcoreapp10lib.CsProj(); - csproj.NumberOfItemGroupsWithoutCondition().Should().Be(noCondBefore + 1); - csproj.NumberOfProjectReferencesWithIncludeContaining(lib.CsProjName).Should().Be(1); - } - - [Theory] - [InlineData("net45")] - [InlineData("net40")] - [InlineData("netcoreapp1.1")] - [InlineData("nonexistingframeworkname")] - public void WhenFrameworkSwitchIsNotMatchingAnyOfTargetedFrameworksItPrintsError(string framework) - { - var setup = Setup(framework); - var lib = new ProjDir(setup.LibDir); - var net45lib = new ProjDir(Path.Combine(setup.TestRoot, "Net45Lib")); - - var csProjContent = lib.CsProjContent(); - var cmd = new AddReferenceCommand() - .WithProject(lib.CsProjPath) - .Execute($"-f {framework} \"{net45lib.CsProjPath}\""); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.ProjectDoesNotTargetFramework, setup.LibCsprojPath, framework)); - - lib.CsProjContent().Should().BeEquivalentTo(csProjContent); - } - - [Theory] - [InlineData("")] - [InlineData("-f net45")] - public void WhenIncompatibleFrameworkDetectedItPrintsError(string frameworkArg) - { - var setup = Setup(); - var lib = new ProjDir(setup.LibDir); - var net45lib = new ProjDir(Path.Combine(setup.TestRoot, "Net45Lib")); - - var csProjContent = net45lib.CsProjContent(); - var cmd = new AddReferenceCommand() - .WithProject(net45lib.CsProjPath) - .Execute($"{frameworkArg} \"{lib.CsProjPath}\""); - cmd.Should().Fail(); - cmd.StdErr.Should().MatchRegex(ProjectNotCompatibleErrorMessageRegEx); - cmd.StdErr.Should().MatchRegex(" - net45"); - net45lib.CsProjContent().Should().BeEquivalentTo(csProjContent); - } - } -} diff --git a/test/dotnet-add-reference.Tests/MSBuild.exe b/test/dotnet-add-reference.Tests/MSBuild.exe deleted file mode 100644 index 2b4d0f999..000000000 --- a/test/dotnet-add-reference.Tests/MSBuild.exe +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 \ No newline at end of file diff --git a/test/dotnet-add-reference.Tests/MSBuild.exe.config b/test/dotnet-add-reference.Tests/MSBuild.exe.config deleted file mode 100644 index 2b4d0f999..000000000 --- a/test/dotnet-add-reference.Tests/MSBuild.exe.config +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 \ No newline at end of file diff --git a/test/dotnet-add-reference.Tests/dotnet-add-reference.Tests.csproj b/test/dotnet-add-reference.Tests/dotnet-add-reference.Tests.csproj deleted file mode 100644 index 2159632fc..000000000 --- a/test/dotnet-add-reference.Tests/dotnet-add-reference.Tests.csproj +++ /dev/null @@ -1,29 +0,0 @@ - - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-add-reference.Tests - ../../tools/Key.snk - true - true - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - - - - - - - - - - - - - - - - - - diff --git a/test/dotnet-back-compat.Tests/GivenThatWeWantToBeBackwardsCompatibleWith1xProjects.cs b/test/dotnet-back-compat.Tests/GivenThatWeWantToBeBackwardsCompatibleWith1xProjects.cs deleted file mode 100644 index e41cf2c8e..000000000 --- a/test/dotnet-back-compat.Tests/GivenThatWeWantToBeBackwardsCompatibleWith1xProjects.cs +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using FluentAssertions; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; -using System.Linq; -using System.Xml.Linq; - -namespace Microsoft.DotNet.Cli.Build.Tests -{ - public class GivenThatWeWantToBeBackwardsCompatibleWith1xProjects : TestBase - { - [RequiresSpecificFrameworkTheory("netcoreapp1.1")] - [InlineData("netcoreapp1.1")] - public void ItRestoresBuildsAndRuns(string target) - { - - var testAppName = "TestAppSimple"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance(testAppName + "_" + target.Replace('.', '_')) - .WithSourceFiles(); - - // Replace the 'TargetFramework' - ChangeProjectTargetFramework(testInstance.Root.GetFile($"{testAppName}.csproj"), target); - - new RestoreCommand() - .WithWorkingDirectory(testInstance.Root) - .Execute() - .Should().Pass(); - - new BuildCommand() - .WithWorkingDirectory(testInstance.Root) - .Execute() - .Should().Pass(); - - var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; - - var outputDll = testInstance.Root.GetDirectory("bin", configuration, target) - .GetFile($"{testAppName}.dll"); - - new DotnetCommand(DotnetUnderTest.WithBackwardsCompatibleRuntimes) - .ExecuteWithCapturedOutput(outputDll.FullName) - .Should().Pass() - .And.HaveStdOutContaining("Hello World"); - } - - [Theory] - [InlineData("netstandard1.3")] - [InlineData("netstandard1.6")] - public void ItRestoresBuildsAndPacks(string target) - { - - var testAppName = "TestAppSimple"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance(testAppName + "_" + target.Replace('.', '_')) - .WithSourceFiles(); - - // Replace the 'TargetFramework' - ChangeProjectTargetFramework(testInstance.Root.GetFile($"{testAppName}.csproj"), target); - - new RestoreCommand() - .WithWorkingDirectory(testInstance.Root) - .Execute() - .Should().Pass(); - - new BuildCommand() - .WithWorkingDirectory(testInstance.Root) - .Execute() - .Should().Pass(); - - new PackCommand() - .WithWorkingDirectory(testInstance.Root) - .Execute() - .Should().Pass(); - } - - [RequiresSpecificFrameworkFact("netcoreapp1.0")] // https://github.com/dotnet/cli/issues/6087 - public void ItRunsABackwardsVersionedTool() - { - var testInstance = TestAssets.Get("11TestAppWith10CLIToolReferences") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var testProjectDirectory = testInstance.Root; - - new DotnetCommand(DotnetUnderTest.WithBackwardsCompatibleRuntimes) - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput("outputsframeworkversion-netcoreapp1.0") - .Should() - .Pass() - .And - .HaveStdOutContaining("netcoreapp1.0"); - } - - void ChangeProjectTargetFramework(FileInfo projectFile, string target) - { - var projectXml = XDocument.Load(projectFile.ToString()); - var ns = projectXml.Root.Name.Namespace; - var propertyGroup = projectXml.Root.Elements(ns + "PropertyGroup").First(); - var rootNamespaceElement = propertyGroup.Element(ns + "TargetFramework"); - rootNamespaceElement.SetValue(target); - projectXml.Save(projectFile.ToString()); - } - - } -} diff --git a/test/dotnet-back-compat.Tests/dotnet-back-compat.Tests.csproj b/test/dotnet-back-compat.Tests/dotnet-back-compat.Tests.csproj deleted file mode 100644 index 5e9a3b304..000000000 --- a/test/dotnet-back-compat.Tests/dotnet-back-compat.Tests.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-back-compat.Tests - - - - - - - - - - - - diff --git a/test/dotnet-build.Tests/GivenDotnetBuildBuildsCsproj.cs b/test/dotnet-build.Tests/GivenDotnetBuildBuildsCsproj.cs deleted file mode 100644 index 04d28850c..000000000 --- a/test/dotnet-build.Tests/GivenDotnetBuildBuildsCsproj.cs +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using FluentAssertions; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; -using System.Linq; - -namespace Microsoft.DotNet.Cli.Build.Tests -{ - public class GivenDotnetBuildBuildsCsproj : TestBase - { - [Fact] - public void ItBuildsARunnableOutput() - { - var testAppName = "MSBuildTestApp"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance(testAppName) - .WithSourceFiles() - .WithRestoreFiles(); - - new BuildCommand() - .WithWorkingDirectory(testInstance.Root) - .Execute() - .Should().Pass(); - - var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; - - var outputDll = testInstance.Root.GetDirectory("bin", configuration, "netcoreapp2.0") - .GetFile($"{testAppName}.dll"); - - var outputRunCommand = new DotnetCommand(); - - outputRunCommand.ExecuteWithCapturedOutput(outputDll.FullName) - .Should().Pass() - .And.HaveStdOutContaining("Hello World"); - } - - [Fact] - public void ItImplicitlyRestoresAProjectWhenBuilding() - { - var testAppName = "MSBuildTestApp"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance(testAppName) - .WithSourceFiles(); - - new BuildCommand() - .WithWorkingDirectory(testInstance.Root) - .Execute() - .Should().Pass(); - } - - [Fact] - public void ItCanBuildAMultiTFMProjectWithImplicitRestore() - { - var testInstance = TestAssets.Get( - TestAssetKinds.DesktopTestProjects, - "NETFrameworkReferenceNETStandard20") - .CreateInstance() - .WithSourceFiles(); - - string projectDirectory = Path.Combine(testInstance.Root.FullName, "MultiTFMTestApp"); - - new BuildCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("--framework netcoreapp2.0") - .Should().Pass(); - } - - [Fact] - public void ItDoesNotImplicitlyRestoreAProjectWhenBuildingWithTheNoRestoreOption() - { - var testAppName = "MSBuildTestApp"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance(testAppName) - .WithSourceFiles(); - - new BuildCommand() - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput("--no-restore") - .Should().Fail() - .And.HaveStdOutContaining("project.assets.json"); - } - - [Fact] - public void ItRunsWhenRestoringToSpecificPackageDir() - { - var rootPath = TestAssets.CreateTestDirectory().FullName; - - string dir = "pkgs"; - string args = $"--packages {dir}"; - - string newArgs = $"console -f netcoreapp2.0 -o \"{rootPath}\" --debug:ephemeral-hive --no-restore"; - new NewCommandShim() - .WithWorkingDirectory(rootPath) - .Execute(newArgs) - .Should() - .Pass(); - - new RestoreCommand() - .WithWorkingDirectory(rootPath) - .Execute(args) - .Should() - .Pass() - .And.NotHaveStdErr(); - - new BuildCommand() - .WithWorkingDirectory(rootPath) - .Execute("--no-restore") - .Should().Pass(); - - var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; - - var outputDll = Directory.EnumerateFiles( - Path.Combine(rootPath, "bin", configuration, "netcoreapp2.0"), "*.dll", - SearchOption.TopDirectoryOnly) - .Single(); - - var outputRunCommand = new DotnetCommand(); - - outputRunCommand.ExecuteWithCapturedOutput(outputDll) - .Should().Pass() - .And.HaveStdOutContaining("Hello World"); - } - - [Fact] - public void ItPrintsBuildSummary() - { - var testAppName = "MSBuildTestApp"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - string expectedBuildSummary = @"Build succeeded. - 0 Warning(s) - 0 Error(s)"; - - var cmd = new BuildCommand() - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput(); - cmd.Should().Pass(); - cmd.StdOut.Should().ContainVisuallySameFragmentIfNotLocalized(expectedBuildSummary); - } - } -} diff --git a/test/dotnet-build.Tests/dotnet-build.Tests.csproj b/test/dotnet-build.Tests/dotnet-build.Tests.csproj deleted file mode 100644 index 3475413bc..000000000 --- a/test/dotnet-build.Tests/dotnet-build.Tests.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-build.Tests - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - - - - - - - - - - - - - diff --git a/test/dotnet-clean.Tests/GivenDotnetCleanCleansBuildArtifacts.cs b/test/dotnet-clean.Tests/GivenDotnetCleanCleansBuildArtifacts.cs deleted file mode 100644 index 7ac4dd0e6..000000000 --- a/test/dotnet-clean.Tests/GivenDotnetCleanCleansBuildArtifacts.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using FluentAssertions; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; -using System.Linq; - -namespace Microsoft.DotNet.Cli.Clean.Tests -{ - public class GivenDotnetCleanCleansBuildArtifacts : TestBase - { - [Fact] - public void ItCleansAProjectBuiltWithRuntimeIdentifier() - { - var testAppName = "MSBuildTestApp"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance(testAppName) - .WithSourceFiles() - .WithRestoreFiles(); - - new BuildCommand() - .WithRuntime("win7-x64") - .WithWorkingDirectory(testInstance.Root) - .Execute() - .Should().Pass(); - - var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; - var outputFolder = testInstance.Root.GetDirectory("bin", configuration, "netcoreapp2.0", "win7-x64"); - - outputFolder.Should().NotBeEmpty(); - - new CleanCommand() - .WithWorkingDirectory(testInstance.Root) - .Execute("-r win7-x64") - .Should().Pass(); - - outputFolder.Should().BeEmpty(); - } - } -} \ No newline at end of file diff --git a/test/dotnet-clean.Tests/dotnet-clean.Tests.csproj b/test/dotnet-clean.Tests/dotnet-clean.Tests.csproj deleted file mode 100644 index 598fee5cf..000000000 --- a/test/dotnet-clean.Tests/dotnet-clean.Tests.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-clean.Tests - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - - - - - - - - - - - - - diff --git a/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs b/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs deleted file mode 100644 index 29c00b2fb..000000000 --- a/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) .NET 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.Build.Construction; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; -using FluentAssertions; -using HelpActual = Microsoft.DotNet.Tools.Help; - -namespace Microsoft.DotNet.Help.Tests -{ - public class GivenThatIWantToShowHelpForDotnetCommand : TestBase - { - private const string HelpText = -@"Usage: dotnet [runtime-options] [path-to-application] -Usage: dotnet [sdk-options] [command] [arguments] [command-options] - -path-to-application: - The path to an application .dll file to execute. - -SDK commands: - new Initialize .NET projects. - restore Restore dependencies specified in the .NET project. - run Compiles and immediately executes a .NET project. - build Builds a .NET project. - publish Publishes a .NET project for deployment (including the runtime). - test Runs unit tests using the test runner specified in the project. - pack Creates a NuGet package. - migrate Migrates a project.json based project to a msbuild based project. - clean Clean build output(s). - sln Modify solution (SLN) files. - add Add reference to the project. - remove Remove reference from the project. - list List reference in the project. - nuget Provides additional NuGet commands. - msbuild Runs Microsoft Build Engine (MSBuild). - vstest Runs Microsoft Test Execution Command Line Tool. - -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]. - -h|--help Show help. - -Run 'dotnet COMMAND --help' for more information on a command. - -sdk-options: - --version Display .NET Core SDK version. - --info Display .NET Core information. - -d|--diagnostics Enable diagnostic output. - -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."; - - [Theory] - [InlineData("--help")] - [InlineData("-h")] - [InlineData("-?")] - [InlineData("/?")] - public void WhenHelpOptionIsPassedToDotnetItPrintsUsage(string helpArg) - { - var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"{helpArg}"); - cmd.Should().Pass(); - cmd.StdOut.Should().ContainVisuallySameFragmentIfNotLocalized(HelpText); - } - - [Fact] - public void WhenHelpCommandIsPassedToDotnetItPrintsUsage() - { - var cmd = new HelpCommand() - .ExecuteWithCapturedOutput(); - cmd.Should().Pass(); - cmd.StdOut.Should().ContainVisuallySameFragmentIfNotLocalized(HelpText); - } - - [Fact] - public void WhenInvalidCommandIsPassedToDotnetHelpItPrintsError() - { - var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput("help invalid"); - - cmd.Should().Fail(); - cmd.StdErr.Should().Contain(string.Format(Tools.Help.LocalizableStrings.CommandDoesNotExist, "invalid")); - cmd.StdOut.Should().ContainVisuallySameFragmentIfNotLocalized(HelpText); - } - - [WindowsOnlyFact] - public void WhenRunOnWindowsDotnetHelpCommandShouldContainProperProcessInformation() - { - var proc = HelpActual.HelpCommand.ConfigureProcess("https://aka.ms/dotnet-build"); - Assert.Equal("cmd", proc.StartInfo.FileName); - Assert.Equal("/c start https://aka.ms/dotnet-build", proc.StartInfo.Arguments); - } - - [LinuxOnlyFact] - public void WhenRunOnLinuxDotnetHelpCommandShouldContainProperProcessInformation() - { - var proc = HelpActual.HelpCommand.ConfigureProcess("https://aka.ms/dotnet-build"); - Assert.Equal("xdg-open", proc.StartInfo.FileName); - Assert.Equal("https://aka.ms/dotnet-build", proc.StartInfo.Arguments); - - } - [MacOsOnlyFact] - public void WhenRunOnMacOsDotnetHelpCommandShouldContainProperProcessInformation() - { - var proc = HelpActual.HelpCommand.ConfigureProcess("https://aka.ms/dotnet-build"); - Assert.Equal("open", proc.StartInfo.FileName); - Assert.Equal("https://aka.ms/dotnet-build", proc.StartInfo.Arguments); - } - } -} diff --git a/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetHelpCommand.cs b/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetHelpCommand.cs deleted file mode 100644 index 7561f1b3e..000000000 --- a/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetHelpCommand.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; -using FluentAssertions; -using HelpActual = Microsoft.DotNet.Tools.Help; - -namespace Microsoft.DotNet.Help.Tests -{ - public class GivenThatIWantToShowHelpForDotnetHelpCommand : TestBase - { - private const string HelpText = -@"Usage: dotnet help [options] - -Arguments: - CLI command for which to view more detailed help. - -Options: - -h, --help Show help information"; - - [Theory] - [InlineData("--help")] - [InlineData("-h")] - [InlineData("-?")] - [InlineData("/?")] - public void WhenHelpOptionIsPassedToDotnetHelpCommandItPrintsUsage(string helpArg) - { - var cmd = new HelpCommand() - .ExecuteWithCapturedOutput($"{helpArg}"); - cmd.Should().Pass(); - cmd.StdOut.Should().ContainVisuallySameFragmentIfNotLocalized(HelpText); - } - } -} diff --git a/test/dotnet-help.Tests/dotnet-help.Tests.csproj b/test/dotnet-help.Tests/dotnet-help.Tests.csproj deleted file mode 100644 index 2200ed754..000000000 --- a/test/dotnet-help.Tests/dotnet-help.Tests.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-help.Tests - ../../tools/Key.snk - true - true - $(AssetTargetFallback);dnxcore50;portable-net45+win8 - - - - - - - - - - - - - - diff --git a/test/dotnet-list-reference.Tests/GivenDotnetListReference.cs b/test/dotnet-list-reference.Tests/GivenDotnetListReference.cs deleted file mode 100644 index 12766e983..000000000 --- a/test/dotnet-list-reference.Tests/GivenDotnetListReference.cs +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using FluentAssertions; -using Microsoft.Build.Construction; -using Microsoft.DotNet.Tools; -using Microsoft.DotNet.Tools.Test.Utilities; -using Msbuild.Tests.Utilities; -using System; -using System.IO; -using Xunit; - -namespace Microsoft.DotNet.Cli.List.Reference.Tests -{ - public class GivenDotnetListReference : TestBase - { - private const string HelpText = @"Usage: dotnet list reference [options] - -Arguments: - The project file to operate on. If a file is not specified, the command will search the current directory for one. - -Options: - -h, --help Show help information. -"; - - private const string ListCommandHelpText = @"Usage: dotnet list [options] [command] - -Arguments: - The project file to operate on. If a file is not specified, the command will search the current directory for one. - -Options: - -h, --help Show help information. - -Commands: - reference .NET Core Project-to-Project dependency viewer -"; - - const string FrameworkNet451Arg = "-f net451"; - const string ConditionFrameworkNet451 = "== 'net451'"; - const string FrameworkNetCoreApp10Arg = "-f netcoreapp1.0"; - const string ConditionFrameworkNetCoreApp10 = "== 'netcoreapp1.0'"; - - [Theory] - [InlineData("--help")] - [InlineData("-h")] - public void WhenHelpOptionIsPassedItPrintsUsage(string helpArg) - { - var cmd = new ListReferenceCommand().Execute(helpArg); - cmd.Should().Pass(); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Theory] - [InlineData("")] - [InlineData("unknownCommandName")] - public void WhenNoCommandIsPassedItPrintsError(string commandName) - { - var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"list {commandName}"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(CommonLocalizableStrings.RequiredCommandNotPassed); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(ListCommandHelpText); - } - - [Fact] - public void WhenTooManyArgumentsArePassedItPrintsError() - { - var cmd = new ListReferenceCommand() - .WithProject("one two three") - .Execute("proj.csproj"); - cmd.ExitCode.Should().NotBe(0); - cmd.StdErr.Should().BeVisuallyEquivalentTo($@"{string.Format(CommandLine.LocalizableStrings.UnrecognizedCommandOrArgument, "two")} -{string.Format(CommandLine.LocalizableStrings.UnrecognizedCommandOrArgument, "three")}"); - } - - [Theory] - [InlineData("idontexist.csproj")] - [InlineData("ihave?inv@lid/char\\acters")] - public void WhenNonExistingProjectIsPassedItPrintsErrorAndUsage(string projName) - { - var setup = Setup(); - - var cmd = new ListReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(projName) - .Execute($"\"{setup.ValidRefCsprojPath}\""); - cmd.ExitCode.Should().NotBe(0); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.CouldNotFindProjectOrDirectory, projName)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenBrokenProjectIsPassedItPrintsErrorAndUsage() - { - string projName = "Broken/Broken.csproj"; - var setup = Setup(); - - var cmd = new ListReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(projName) - .Execute($"\"{setup.ValidRefCsprojPath}\""); - cmd.ExitCode.Should().NotBe(0); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.ProjectIsInvalid, "Broken/Broken.csproj")); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenMoreThanOneProjectExistsInTheDirectoryItPrintsErrorAndUsage() - { - var setup = Setup(); - - var workingDir = Path.Combine(setup.TestRoot, "MoreThanOne"); - var cmd = new ListReferenceCommand() - .WithWorkingDirectory(workingDir) - .Execute($"\"{setup.ValidRefCsprojRelToOtherProjPath}\""); - cmd.ExitCode.Should().NotBe(0); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.MoreThanOneProjectInDirectory, workingDir + Path.DirectorySeparatorChar)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenNoProjectsExistsInTheDirectoryItPrintsErrorAndUsage() - { - var setup = Setup(); - - var cmd = new ListReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .Execute($"\"{setup.ValidRefCsprojPath}\""); - cmd.ExitCode.Should().NotBe(0); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.CouldNotFindAnyProjectInDirectory, setup.TestRoot + Path.DirectorySeparatorChar)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenNoProjectReferencesArePresentInTheProjectItPrintsError() - { - var lib = NewLib(); - - var cmd = new ListReferenceCommand() - .WithProject(lib.CsProjPath) - .Execute(); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.NoReferencesFound, CommonLocalizableStrings.P2P, lib.CsProjPath)); - } - - [Fact] - public void ItPrintsSingleReference() - { - string OutputText = CommonLocalizableStrings.ProjectReferenceOneOrMore; - OutputText += $@" -{new string('-', OutputText.Length)} -..\ref\ref.csproj"; - - var lib = NewLib("lib"); - string ref1 = NewLib("ref").CsProjPath; - AddValidRef(ref1, lib); - - var cmd = new ListReferenceCommand() - .WithProject(lib.CsProjPath) - .Execute(); - cmd.Should().Pass(); - cmd.StdOut.Should().BeVisuallyEquivalentTo(OutputText); - } - - [Fact] - public void ItPrintsMultipleReferences() - { - string OutputText = CommonLocalizableStrings.ProjectReferenceOneOrMore; - OutputText += $@" -{new string('-', OutputText.Length)} -..\ref1\ref1.csproj -..\ref2\ref2.csproj -..\ref3\ref3.csproj"; - - var lib = NewLib("lib"); - string ref1 = NewLib("ref1").CsProjPath; - string ref2 = NewLib("ref2").CsProjPath; - string ref3 = NewLib("ref3").CsProjPath; - - AddValidRef(ref1, lib); - AddValidRef(ref2, lib); - AddValidRef(ref3, lib); - - var cmd = new ListReferenceCommand() - .WithProject(lib.CsProjPath) - .Execute(); - cmd.Should().Pass(); - cmd.StdOut.Should().BeVisuallyEquivalentTo(OutputText); - } - - private TestSetup Setup([System.Runtime.CompilerServices.CallerMemberName] string callingMethod = nameof(Setup), string identifier = "") - { - return new TestSetup( - TestAssets.Get(TestSetup.TestGroup, TestSetup.ProjectName) - .CreateInstance(callingMethod: callingMethod, identifier: identifier) - .WithSourceFiles() - .Root - .FullName); - } - - private ProjDir NewDir(string testProjectName = "temp", [System.Runtime.CompilerServices.CallerMemberName] string callingMethod = nameof(NewDir), string identifier = "") - { - return new ProjDir(TestAssets.CreateTestDirectory(testProjectName: testProjectName, callingMethod: callingMethod, identifier: identifier).FullName); - } - - private ProjDir NewLib(string testProjectName = "temp", [System.Runtime.CompilerServices.CallerMemberName] string callingMethod = nameof(NewDir), string identifier = "") - { - var dir = NewDir(testProjectName: testProjectName, callingMethod: callingMethod, identifier: identifier); - - try - { - string newArgs = $"classlib -o \"{dir.Path}\" --debug:ephemeral-hive --no-restore"; - new NewCommandShim() - .WithWorkingDirectory(dir.Path) - .ExecuteWithCapturedOutput(newArgs) - .Should().Pass(); - } - catch (System.ComponentModel.Win32Exception e) - { - throw new Exception($"Intermittent error in `dotnet new` occurred when running it in dir `{dir.Path}`\nException:\n{e}"); - } - - return dir; - } - - private void AddValidRef(string path, ProjDir proj) - { - new AddReferenceCommand() - .WithProject(proj.CsProjPath) - .Execute($"\"{path}\"") - .Should().Pass(); - } - } -} diff --git a/test/dotnet-list-reference.Tests/MSBuild.exe b/test/dotnet-list-reference.Tests/MSBuild.exe deleted file mode 100644 index 2b4d0f999..000000000 --- a/test/dotnet-list-reference.Tests/MSBuild.exe +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 \ No newline at end of file diff --git a/test/dotnet-list-reference.Tests/MSBuild.exe.config b/test/dotnet-list-reference.Tests/MSBuild.exe.config deleted file mode 100644 index 2b4d0f999..000000000 --- a/test/dotnet-list-reference.Tests/MSBuild.exe.config +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 \ No newline at end of file diff --git a/test/dotnet-list-reference.Tests/dotnet-list-reference.Tests.csproj b/test/dotnet-list-reference.Tests/dotnet-list-reference.Tests.csproj deleted file mode 100644 index c8cbdc0bc..000000000 --- a/test/dotnet-list-reference.Tests/dotnet-list-reference.Tests.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-list-reference.Tests - ../../tools/Key.snk - true - true - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - - - - - - - - - - - - - - - - diff --git a/test/dotnet-migrate.Tests/GivenThatIWantToMigrateSolutions.cs b/test/dotnet-migrate.Tests/GivenThatIWantToMigrateSolutions.cs deleted file mode 100644 index af96bd2a2..000000000 --- a/test/dotnet-migrate.Tests/GivenThatIWantToMigrateSolutions.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using FluentAssertions; -using Microsoft.DotNet.Cli.Sln.Internal; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using System.IO; -using System.Linq; -using System.Runtime.CompilerServices; -using Xunit; - -namespace Microsoft.DotNet.Migration.Tests -{ - public class GivenThatIWantToMigrateSolutions : TestBase - { - [Fact] - public void ItMigratesAndBuildsSln() - { - MigrateAndBuild( - "NonRestoredTestProjects", - "PJAppWithSlnAndXprojRefs"); - } - - private void MigrateAndBuild(string groupName, string projectName, [CallerMemberName] string callingMethod = "", string identifier = "") - { - var projectDirectory = TestAssets - .Get(groupName, projectName) - .CreateInstance(callingMethod: callingMethod, identifier: identifier) - .WithSourceFiles() - .WithEmptyGlobalJson() - .Root; - - var solutionRelPath = Path.Combine("TestApp", "TestApp.sln"); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute($"migrate \"{solutionRelPath}\"") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute($"restore \"{solutionRelPath}\"") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute($"build \"{solutionRelPath}\"") - .Should().Pass(); - - SlnFile slnFile = SlnFile.Read(Path.Combine(projectDirectory.FullName, solutionRelPath)); - - var nonSolutionFolderProjects = slnFile.Projects - .Where(p => p.TypeGuid != ProjectTypeGuids.SolutionFolderGuid); - - nonSolutionFolderProjects.Count().Should().Be(3); - - var slnProject = nonSolutionFolderProjects.Where((p) => p.Name == "TestApp").Single(); - slnProject.TypeGuid.Should().Be(ProjectTypeGuids.CSharpProjectTypeGuid); - slnProject.FilePath.Should().Be("TestApp.csproj"); - - slnProject = nonSolutionFolderProjects.Where((p) => p.Name == "TestLibrary").Single(); - slnProject.TypeGuid.Should().Be(ProjectTypeGuids.CSharpProjectTypeGuid); - slnProject.FilePath.Should().Be(Path.Combine("..", "TestLibrary", "TestLibrary.csproj")); - - slnProject = nonSolutionFolderProjects.Where((p) => p.Name == "subdir").Single(); - //ISSUE: https://github.com/dotnet/sdk/issues/522 - //Once we have that change migrate will always burn in the C# guid - //slnProject.TypeGuid.Should().Be(ProjectTypeGuids.CSharpProjectTypeGuid); - slnProject.FilePath.Should().Be(Path.Combine("src", "subdir", "subdir.csproj")); - } - } -} diff --git a/test/dotnet-migrate.Tests/MSBuild.exe b/test/dotnet-migrate.Tests/MSBuild.exe deleted file mode 100644 index 2b4d0f999..000000000 --- a/test/dotnet-migrate.Tests/MSBuild.exe +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 \ No newline at end of file diff --git a/test/dotnet-migrate.Tests/MSBuild.exe.config b/test/dotnet-migrate.Tests/MSBuild.exe.config deleted file mode 100644 index 2b4d0f999..000000000 --- a/test/dotnet-migrate.Tests/MSBuild.exe.config +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 \ No newline at end of file diff --git a/test/dotnet-migrate.Tests/NuGet.tempaspnetpatch.config b/test/dotnet-migrate.Tests/NuGet.tempaspnetpatch.config deleted file mode 100644 index 33b9693d5..000000000 --- a/test/dotnet-migrate.Tests/NuGet.tempaspnetpatch.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/test/dotnet-migrate.Tests/dotnet-migrate.Tests.csproj b/test/dotnet-migrate.Tests/dotnet-migrate.Tests.csproj deleted file mode 100644 index e15451f82..000000000 --- a/test/dotnet-migrate.Tests/dotnet-migrate.Tests.csproj +++ /dev/null @@ -1,32 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-migrate.Tests - $(AssetTargetFallback);netstandardapp1.5;dotnet5.4;portable-net451+win8 - - - - - PreserveNewest - - - - - - - - - - - - - - - - - - - - diff --git a/test/dotnet-msbuild.Tests/GivenDotnetBuildInvocation.cs b/test/dotnet-msbuild.Tests/GivenDotnetBuildInvocation.cs deleted file mode 100644 index 259d5e257..000000000 --- a/test/dotnet-msbuild.Tests/GivenDotnetBuildInvocation.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Tools.Build; -using FluentAssertions; -using Xunit; - -namespace Microsoft.DotNet.Cli.MSBuild.Tests -{ - public class GivenDotnetBuildInvocation - { - const string ExpectedPrefix = "exec /m /v:m"; - const string ExpectedSuffix = "/clp:Summary"; - - [Theory] - [InlineData(new string[] { }, "/t:Build")] - [InlineData(new string[] { "-o", "foo" }, "/t:Build /p:OutputPath=foo")] - [InlineData(new string[] { "-p:Verbosity=diag" }, "/t:Build -p:Verbosity=diag")] - [InlineData(new string[] { "--output", "foo" }, "/t:Build /p:OutputPath=foo")] - [InlineData(new string[] { "-o", "foo1 foo2" }, "/t:Build \"/p:OutputPath=foo1 foo2\"")] - [InlineData(new string[] { "--no-incremental" }, "/t:Rebuild")] - [InlineData(new string[] { "-f", "tfm" }, "/t:Build /p:TargetFramework=tfm")] - [InlineData(new string[] { "--framework", "tfm" }, "/t:Build /p:TargetFramework=tfm")] - [InlineData(new string[] { "-r", "rid" }, "/t:Build /p:RuntimeIdentifier=rid")] - [InlineData(new string[] { "--runtime", "rid" }, "/t:Build /p:RuntimeIdentifier=rid")] - [InlineData(new string[] { "-c", "config" }, "/t:Build /p:Configuration=config")] - [InlineData(new string[] { "--configuration", "config" }, "/t:Build /p:Configuration=config")] - [InlineData(new string[] { "--version-suffix", "mysuffix" }, "/t:Build /p:VersionSuffix=mysuffix")] - [InlineData(new string[] { "--no-dependencies" }, "/t:Build /p:BuildProjectReferences=false")] - [InlineData(new string[] { "-v", "diag" }, "/t:Build /verbosity:diag")] - [InlineData(new string[] { "--verbosity", "diag" }, "/t:Build /verbosity:diag")] - [InlineData(new string[] { "--no-incremental", "-o", "myoutput", "-r", "myruntime", "-v", "diag" }, "/t:Rebuild /p:OutputPath=myoutput /p:RuntimeIdentifier=myruntime /verbosity:diag")] - public void MsbuildInvocationIsCorrect(string[] args, string expectedAdditionalArgs) - { - expectedAdditionalArgs = (string.IsNullOrEmpty(expectedAdditionalArgs) ? "" : $" {expectedAdditionalArgs}"); - - var msbuildPath = ""; - BuildCommand.FromArgs(args, msbuildPath) - .GetProcessStartInfo().Arguments.Should().Be($"{ExpectedPrefix}{expectedAdditionalArgs} {ExpectedSuffix}"); - } - } -} diff --git a/test/dotnet-msbuild.Tests/GivenDotnetCleanInvocation.cs b/test/dotnet-msbuild.Tests/GivenDotnetCleanInvocation.cs deleted file mode 100644 index 461dcc16a..000000000 --- a/test/dotnet-msbuild.Tests/GivenDotnetCleanInvocation.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Tools.Clean; -using FluentAssertions; -using Xunit; -using System; - -namespace Microsoft.DotNet.Cli.MSBuild.Tests -{ - public class GivenDotnetCleanInvocation - { - const string ExpectedPrefix = "exec /m /v:m /t:Clean"; - - [Fact] - public void ItAddsProjectToMsbuildInvocation() - { - var msbuildPath = ""; - CleanCommand.FromArgs(new string[] { "" }, msbuildPath) - .GetProcessStartInfo().Arguments.Should().Be("exec /m /v:m /t:Clean"); - } - - [Theory] - [InlineData(new string[] { }, "")] - [InlineData(new string[] { "-o", "" }, "/p:OutputPath=")] - [InlineData(new string[] { "--output", "" }, "/p:OutputPath=")] - [InlineData(new string[] { "-f", "" }, "/p:TargetFramework=")] - [InlineData(new string[] { "--framework", "" }, "/p:TargetFramework=")] - [InlineData(new string[] { "-c", "" }, "/p:Configuration=")] - [InlineData(new string[] { "--configuration", "" }, "/p:Configuration=")] - [InlineData(new string[] { "-v", "diag" }, "/verbosity:diag")] - [InlineData(new string[] { "--verbosity", "diag" }, "/verbosity:diag")] - public void MsbuildInvocationIsCorrect(string[] args, string expectedAdditionalArgs) - { - expectedAdditionalArgs = (string.IsNullOrEmpty(expectedAdditionalArgs) ? "" : $" {expectedAdditionalArgs}"); - - var msbuildPath = ""; - CleanCommand.FromArgs(args, msbuildPath) - .GetProcessStartInfo().Arguments.Should().Be($"{ExpectedPrefix}{expectedAdditionalArgs}"); - } - } -} diff --git a/test/dotnet-msbuild.Tests/GivenDotnetMSBuildBuildsProjects.cs b/test/dotnet-msbuild.Tests/GivenDotnetMSBuildBuildsProjects.cs deleted file mode 100644 index 52d776505..000000000 --- a/test/dotnet-msbuild.Tests/GivenDotnetMSBuildBuildsProjects.cs +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using System.Runtime.InteropServices; -using FluentAssertions; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Configurer; -using Microsoft.DotNet.Tools.MSBuild; -using Microsoft.DotNet.Tools.Test.Utilities; -using NuGet.Protocol; -using Xunit; -using Xunit.Abstractions; -using MSBuildCommand = Microsoft.DotNet.Tools.Test.Utilities.MSBuildCommand; -using System.Diagnostics; -using System.Threading; - - -// There are tests which modify static Telemetry.CurrentSessionId and they cannot run in parallel -[assembly: CollectionBehavior(DisableTestParallelization = true)] - -namespace Microsoft.DotNet.Cli.MSBuild.Tests -{ - public class GivenDotnetMSBuildBuildsProjects : TestBase - { - private readonly ITestOutputHelper _output; - - public GivenDotnetMSBuildBuildsProjects(ITestOutputHelper output) - { - _output = output; - } - - [Fact] - public void ItRunsSpecifiedTargetsWithPropertiesCorrectly() - { - var testInstance = TestAssets.Get("MSBuildBareBonesProject") - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root; - - new MSBuildCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput("/t:SayHello") - .Should() - .Pass() - .And - .HaveStdOutContaining("Hello, from MSBuild!"); - - new MSBuildCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput("/t:SayGoodbye") - .Should() - .Pass() - .And - .HaveStdOutContaining("Goodbye, from MSBuild. :'("); - - new MSBuildCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput("/t:SayThis /p:This=GreatScott") - .Should() - .Pass() - .And - .HaveStdOutContaining("You want me to say 'GreatScott'"); - } - - [Theory(Skip="New parser feature needed")] - [InlineData("build")] - [InlineData("clean")] - [InlineData("pack")] - [InlineData("publish")] - [InlineData("restore")] - public void When_help_is_invoked_Then_MSBuild_extra_options_text_is_included_in_output(string commandName) - { - const string MSBuildHelpText = " Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options."; - - var projectDirectory = TestAssets.CreateTestDirectory(commandName); - var result = new TestCommand("dotnet") - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"{commandName} --help"); - - result.ExitCode.Should().Be(0); - result.StdOut.Should().Contain(MSBuildHelpText); - } - - [Fact] - public void WhenRestoreSourcesStartsWithUnixPathThenHttpsSourceIsParsedCorrectly() - { - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - return; - } - - // this is a workaround for https://github.com/Microsoft/msbuild/issues/1622 - var testInstance = TestAssets.Get("LibraryWithUnresolvablePackageReference") - .CreateInstance() - .WithSourceFiles(); - - var root = testInstance.Root; - var somePathThatExists = "/usr/local/bin"; - - var result = new DotnetCommand() - .WithWorkingDirectory(root) - .Execute($"msbuild /p:RestoreSources={somePathThatExists};https://api.nuget.org/v3/index.json /t:restore LibraryWithUnresolvablePackageReference.csproj"); - - _output.WriteLine($"[STDOUT]\n{result.StdOut}\n[STDERR]\n{result.StdErr}"); - - result.Should().Fail(); - - result.StdOut.Should().ContainVisuallySameFragment("NU1101"); - } - - [Fact] - public void WhenDotnetRunHelpIsInvokedAppArgumentsTextIsIncludedInOutput() - { - string AppArgumentsText = Tools.Run.LocalizableStrings.RunCommandAdditionalArgsHelpText; - - var projectDirectory = TestAssets.CreateTestDirectory("RunContainsAppArgumentsText"); - var result = new TestCommand("dotnet") - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("run --help"); - - result.ExitCode.Should().Be(0); - result.StdOut.Should().Contain(AppArgumentsText); - } - - [Fact] - public void WhenTelemetryIsEnabledTheLoggerIsAddedToTheCommandLine() - { - Telemetry.Telemetry telemetry; - string[] allArgs = GetArgsForMSBuild(() => true, out telemetry); - // telemetry will still be disabled if environment variable is set - if (telemetry.Enabled) - { - allArgs.Should().NotBeNull(); - - allArgs.Should().Contain( - value => value.IndexOf("/Logger", StringComparison.OrdinalIgnoreCase) >= 0, - "The MSBuild logger argument should be specified when telemetry is enabled."); - } - } - - [Fact] - public void WhenTelemetryIsDisabledTheLoggerIsNotAddedToTheCommandLine() - { - string[] allArgs = GetArgsForMSBuild(() => false); - - allArgs.Should().NotBeNull(); - - allArgs.Should().NotContain( - value => value.IndexOf("/Logger", StringComparison.OrdinalIgnoreCase) >= 0, - $"The MSBuild logger argument should not be specified when telemetry is disabled."); - } - - private string[] GetArgsForMSBuild(Func sentinelExists) - { - Telemetry.Telemetry telemetry; - return GetArgsForMSBuild(sentinelExists, out telemetry); - } - - private string[] GetArgsForMSBuild(Func sentinelExists, out Telemetry.Telemetry telemetry) - { - - Telemetry.Telemetry.CurrentSessionId = null; // reset static session id modified by telemetry constructor - telemetry = new Telemetry.Telemetry(new MockNuGetCacheSentinel(sentinelExists)); - - MSBuildForwardingApp msBuildForwardingApp = new MSBuildForwardingApp(Enumerable.Empty()); - - object forwardingAppWithoutLogging = msBuildForwardingApp - .GetType() - .GetField("_forwardingAppWithoutLogging", BindingFlags.Instance | BindingFlags.NonPublic) - ?.GetValue(msBuildForwardingApp); - - FieldInfo forwardingAppFieldInfo = forwardingAppWithoutLogging - .GetType() - .GetField("_forwardingApp", BindingFlags.Instance | BindingFlags.NonPublic); - - object forwardingApp = forwardingAppFieldInfo?.GetValue(forwardingAppWithoutLogging); - - FieldInfo allArgsFieldinfo = forwardingApp? - .GetType() - .GetField("_allArgs", BindingFlags.Instance | BindingFlags.NonPublic); - - return allArgsFieldinfo?.GetValue(forwardingApp) as string[]; - } - } - - public sealed class MockNuGetCacheSentinel : IFirstTimeUseNoticeSentinel - { - private readonly Func _exists; - - public bool UnauthorizedAccess => true; - - public MockNuGetCacheSentinel(Func exists = null) - { - _exists = exists ?? (() => true); - } - - public void Dispose() - { - } - - public bool InProgressSentinelAlreadyExists() => false; - - public bool Exists() => _exists(); - - public void CreateIfNotExists() - { - } - } -} diff --git a/test/dotnet-msbuild.Tests/GivenDotnetPackInvocation.cs b/test/dotnet-msbuild.Tests/GivenDotnetPackInvocation.cs deleted file mode 100644 index aba1b15a6..000000000 --- a/test/dotnet-msbuild.Tests/GivenDotnetPackInvocation.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Tools.Pack; -using FluentAssertions; -using Xunit; -using System; -using System.Linq; - -namespace Microsoft.DotNet.Cli.MSBuild.Tests -{ - public class GivenDotnetPackInvocation - { - const string ExpectedPrefix = "exec /m /v:m /t:pack"; - - [Theory] - [InlineData(new string[] { }, "")] - [InlineData(new string[] { "-o", "" }, "/p:PackageOutputPath=")] - [InlineData(new string[] { "--output", "" }, "/p:PackageOutputPath=")] - [InlineData(new string[] { "--no-build" }, "/p:NoBuild=true")] - [InlineData(new string[] { "--include-symbols" }, "/p:IncludeSymbols=true")] - [InlineData(new string[] { "--include-source" }, "/p:IncludeSource=true")] - [InlineData(new string[] { "-c", "" }, "/p:Configuration=")] - [InlineData(new string[] { "--configuration", "" }, "/p:Configuration=")] - [InlineData(new string[] { "--version-suffix", "" }, "/p:VersionSuffix=")] - [InlineData(new string[] { "-s" }, "/p:Serviceable=true")] - [InlineData(new string[] { "--serviceable" }, "/p:Serviceable=true")] - [InlineData(new string[] { "-v", "diag" }, "/verbosity:diag")] - [InlineData(new string[] { "--verbosity", "diag" }, "/verbosity:diag")] - [InlineData(new string[] { "" }, "")] - public void MsbuildInvocationIsCorrect(string[] args, string expectedAdditionalArgs) - { - expectedAdditionalArgs = (string.IsNullOrEmpty(expectedAdditionalArgs) ? "" : $" {expectedAdditionalArgs}"); - - var msbuildPath = ""; - PackCommand.FromArgs(args, msbuildPath) - .GetProcessStartInfo().Arguments.Should().Be($"{ExpectedPrefix}{expectedAdditionalArgs}"); - } - } -} diff --git a/test/dotnet-msbuild.Tests/GivenDotnetPublishInvocation.cs b/test/dotnet-msbuild.Tests/GivenDotnetPublishInvocation.cs deleted file mode 100644 index f7cf3838d..000000000 --- a/test/dotnet-msbuild.Tests/GivenDotnetPublishInvocation.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using FluentAssertions; -using System.Linq; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Tools.Publish; -using Xunit; -using Xunit.Abstractions; - -namespace Microsoft.DotNet.Cli.MSBuild.Tests -{ - public class GivenDotnetPublishInvocation - { - private readonly ITestOutputHelper output; - - public GivenDotnetPublishInvocation(ITestOutputHelper output) - { - this.output = output; - } - - const string ExpectedPrefix = "exec /m /v:m /t:Publish"; - - [Theory] - [InlineData(new string[] { }, "")] - [InlineData(new string[] { "-f", "" }, "/p:TargetFramework=")] - [InlineData(new string[] { "--framework", "" }, "/p:TargetFramework=")] - [InlineData(new string[] { "-r", "" }, "/p:RuntimeIdentifier=")] - [InlineData(new string[] { "--runtime", "" }, "/p:RuntimeIdentifier=")] - [InlineData(new string[] { "-o", "" }, "/p:PublishDir=")] - [InlineData(new string[] { "--output", "" }, "/p:PublishDir=")] - [InlineData(new string[] { "-c", "" }, "/p:Configuration=")] - [InlineData(new string[] { "--configuration", "" }, "/p:Configuration=")] - [InlineData(new string[] { "--version-suffix", "" }, "/p:VersionSuffix=")] - [InlineData(new string[] { "--manifest", "" }, "/p:TargetManifestFiles=")] - [InlineData(new string[] { "-v", "minimal" }, "/verbosity:minimal")] - [InlineData(new string[] { "--verbosity", "minimal" }, "/verbosity:minimal")] - [InlineData(new string[] { "" }, "")] - [InlineData(new string[] { "", "" }, " ")] - public void MsbuildInvocationIsCorrect(string[] args, string expectedAdditionalArgs) - { - expectedAdditionalArgs = (string.IsNullOrEmpty(expectedAdditionalArgs) ? "" : $" {expectedAdditionalArgs}"); - - var msbuildPath = ""; - PublishCommand.FromArgs(args, msbuildPath) - .GetProcessStartInfo() - .Arguments.Should() - .Be($"{ExpectedPrefix}{expectedAdditionalArgs}"); - } - - [Theory] - [InlineData(new string[] { }, "")] - [InlineData(new string[] { "-f", "" }, "/p:TargetFramework=")] - [InlineData(new string[] { "--framework", "" }, "/p:TargetFramework=")] - [InlineData(new string[] { "-r", "" }, "/p:RuntimeIdentifier=")] - [InlineData(new string[] { "--runtime", "" }, "/p:RuntimeIdentifier=")] - [InlineData(new string[] { "-o", "" }, "/p:PublishDir=")] - [InlineData(new string[] { "--output", "" }, "/p:PublishDir=")] - [InlineData(new string[] { "-c", "" }, "/p:Configuration=")] - [InlineData(new string[] { "--configuration", "" }, "/p:Configuration=")] - [InlineData(new string[] { "--version-suffix", "" }, "/p:VersionSuffix=")] - [InlineData(new string[] { "--manifest", "" }, "/p:TargetManifestFiles=")] - [InlineData(new string[] { "-v", "minimal" }, "/verbosity:minimal")] - [InlineData(new string[] { "--verbosity", "minimal" }, "/verbosity:minimal")] - public void OptionForwardingIsCorrect(string[] args, string expectedAdditionalArgs) - { - var expectedArgs = expectedAdditionalArgs.Split(' ', StringSplitOptions.RemoveEmptyEntries); - - var parser = Parser.Instance; - - var result = parser.ParseFrom("dotnet publish", args); - - result["dotnet"]["publish"] - .OptionValuesToBeForwarded() - .Should() - .BeEquivalentTo(expectedArgs); - } - } -} \ No newline at end of file diff --git a/test/dotnet-msbuild.Tests/GivenDotnetRestoreInvocation.cs b/test/dotnet-msbuild.Tests/GivenDotnetRestoreInvocation.cs deleted file mode 100644 index dd55e2abd..000000000 --- a/test/dotnet-msbuild.Tests/GivenDotnetRestoreInvocation.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Tools.Restore; -using FluentAssertions; -using Xunit; -using System; - -namespace Microsoft.DotNet.Cli.MSBuild.Tests -{ - public class GivenDotnetRestoreInvocation - { - private const string ExpectedPrefix = - "exec /m /v:m /NoLogo /t:Restore"; - - private string ExpectedPrefixWithConsoleLoggerParamaters = - $"{ExpectedPrefix} /ConsoleLoggerParameters:Verbosity=Minimal"; - - [Theory] - [InlineData(new string[] { }, "")] - [InlineData(new string[] { "-s", "" }, "/p:RestoreSources=")] - [InlineData(new string[] { "--source", "" }, "/p:RestoreSources=")] - [InlineData(new string[] { "-s", "", "-s", "" }, "/p:RestoreSources=%3B")] - [InlineData(new string[] { "-r", "" }, "/p:RuntimeIdentifiers=")] - [InlineData(new string[] { "--runtime", "" }, "/p:RuntimeIdentifiers=")] - [InlineData(new string[] { "-r", "", "-r", "" }, "/p:RuntimeIdentifiers=%3B")] - [InlineData(new string[] { "--packages", "" }, "/p:RestorePackagesPath=")] - [InlineData(new string[] { "--disable-parallel" }, "/p:RestoreDisableParallel=true")] - [InlineData(new string[] { "--configfile", "" }, "/p:RestoreConfigFile=")] - [InlineData(new string[] { "--no-cache" }, "/p:RestoreNoCache=true")] - [InlineData(new string[] { "--ignore-failed-sources" }, "/p:RestoreIgnoreFailedSources=true")] - [InlineData(new string[] { "--no-dependencies" }, "/p:RestoreRecursive=false")] - public void MsbuildInvocationWithConsoleLoggerParametersIsCorrect(string[] args, string expectedAdditionalArgs) - { - expectedAdditionalArgs = (string.IsNullOrEmpty(expectedAdditionalArgs) ? "" : $" {expectedAdditionalArgs}"); - - var msbuildPath = ""; - RestoreCommand.FromArgs(args, msbuildPath) - .GetProcessStartInfo().Arguments - .Should().Be($"{ExpectedPrefixWithConsoleLoggerParamaters}{expectedAdditionalArgs}"); - } - - [InlineData(new string[] { "-v", "minimal" }, @"/verbosity:minimal")] - [InlineData(new string[] { "--verbosity", "minimal" }, @"/verbosity:minimal")] - public void MsbuildInvocationWithVerbosityIsCorrect(string[] args, string expectedAdditionalArgs) - { - expectedAdditionalArgs = (string.IsNullOrEmpty(expectedAdditionalArgs) ? "" : $" {expectedAdditionalArgs}"); - - var msbuildPath = ""; - RestoreCommand.FromArgs(args, msbuildPath) - .GetProcessStartInfo().Arguments - .Should().Be($"{ExpectedPrefix}{expectedAdditionalArgs}"); - } - } -} diff --git a/test/dotnet-msbuild.Tests/GivenDotnetStoreInvocation.cs b/test/dotnet-msbuild.Tests/GivenDotnetStoreInvocation.cs deleted file mode 100644 index 1d0b3f283..000000000 --- a/test/dotnet-msbuild.Tests/GivenDotnetStoreInvocation.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using FluentAssertions; -using Microsoft.DotNet.Tools.Store; -using System.IO; -using System.Linq; -using Xunit; - -namespace Microsoft.DotNet.Cli.MSBuild.Tests -{ - public class GivenDotnetStoreInvocation - { - const string ExpectedPrefix = "exec /m /v:m /t:ComposeStore "; - static readonly string[] ArgsPrefix = { "-m", "" }; - - [Theory] - [InlineData("-m")] - [InlineData("--manifest")] - public void ItAddsProjectToMsbuildInvocation(string optionName) - { - var msbuildPath = ""; - string[] args = new string[] { optionName, "" }; - StoreCommand.FromArgs(args, msbuildPath) - .GetProcessStartInfo().Arguments.Should().Be($"{ExpectedPrefix}"); - } - - [Theory] - [InlineData(new string[] { "-f", "" }, @"/p:TargetFramework=")] - [InlineData(new string[] { "--framework", "" }, @"/p:TargetFramework=")] - [InlineData(new string[] { "-r", "" }, @"/p:RuntimeIdentifier=")] - [InlineData(new string[] { "--runtime", "" }, @"/p:RuntimeIdentifier=")] - [InlineData(new string[] { "--manifest", "one.xml", "--manifest", "two.xml", "--manifest", "three.xml" }, @"/p:AdditionalProjects=one.xml%3Btwo.xml%3Bthree.xml")] - public void MsbuildInvocationIsCorrect(string[] args, string expectedAdditionalArgs) - { - args = ArgsPrefix.Concat(args).ToArray(); - expectedAdditionalArgs = (string.IsNullOrEmpty(expectedAdditionalArgs) ? "" : $" {expectedAdditionalArgs}"); - - var msbuildPath = ""; - StoreCommand.FromArgs(args, msbuildPath) - .GetProcessStartInfo().Arguments.Should().Be($"{ExpectedPrefix}{expectedAdditionalArgs}"); - } - - [Theory] - [InlineData("-o")] - [InlineData("--output")] - public void ItAddsOutputPathToMsBuildInvocation(string optionName) - { - string path = "/some/path"; - var args = ArgsPrefix.Concat(new string[] { optionName, path }).ToArray(); - - var msbuildPath = ""; - StoreCommand.FromArgs(args, msbuildPath) - .GetProcessStartInfo().Arguments.Should().Be($"{ExpectedPrefix} /p:ComposeDir={Path.GetFullPath(path)}"); - } - } -} diff --git a/test/dotnet-msbuild.Tests/GivenDotnetVsTestForwardingApp.cs b/test/dotnet-msbuild.Tests/GivenDotnetVsTestForwardingApp.cs deleted file mode 100644 index 46e56e71c..000000000 --- a/test/dotnet-msbuild.Tests/GivenDotnetVsTestForwardingApp.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Tools.VSTest; -using FluentAssertions; -using Xunit; -using System; - -namespace Microsoft.DotNet.Cli.MSBuild.Tests -{ - public class GivenDotnetVsTestForwardingApp - { - [Fact] - public void ItRunsVsTestApp() - { - new VSTestForwardingApp(new string[0]) - .GetProcessStartInfo().Arguments.Should().EndWith("vstest.console.dll"); - } - } -} diff --git a/test/dotnet-msbuild.Tests/GivenForwardingApp.cs b/test/dotnet-msbuild.Tests/GivenForwardingApp.cs deleted file mode 100644 index 5ef48c827..000000000 --- a/test/dotnet-msbuild.Tests/GivenForwardingApp.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.Text; -using Xunit; -using FluentAssertions; -using Microsoft.DotNet.Tools.Test.Utilities; - -namespace Microsoft.DotNet.Cli -{ - public class GivenForwardingApp - { - [WindowsOnlyFact] - public void DotnetExeIsExecuted() - { - new ForwardingApp("", new string[0]) - .GetProcessStartInfo().FileName.Should().Be("dotnet.exe"); - } - - [NonWindowsOnlyFact] - public void DotnetIsExecuted() - { - new ForwardingApp("", new string[0]) - .GetProcessStartInfo().FileName.Should().Be("dotnet"); - } - - [Fact] - public void ItForwardsArgs() - { - new ForwardingApp("", new string[] { "one", "two", "three" }) - .GetProcessStartInfo().Arguments.Should().Be("exec one two three"); - } - - [Fact] - public void ItAddsDepsFileArg() - { - new ForwardingApp("", new string[] { "" }, depsFile: "") - .GetProcessStartInfo().Arguments.Should().Be("exec --depsfile "); - } - - [Fact] - public void ItAddsRuntimeConfigArg() - { - new ForwardingApp("", new string[] { "" }, runtimeConfig: "") - .GetProcessStartInfo().Arguments.Should().Be("exec --runtimeconfig "); - } - - [Fact] - public void ItAddsAdditionalProbingPathArg() - { - new ForwardingApp("", new string[] { "" }, additionalProbingPath: "") - .GetProcessStartInfo().Arguments.Should().Be("exec --additionalprobingpath "); - } - - [Fact] - public void ItQuotesArgsWithSpaces() - { - new ForwardingApp("", new string[] { "a b c" }) - .GetProcessStartInfo().Arguments.Should().Be("exec \"a b c\""); - } - - [Fact] - public void ItEscapesArgs() - { - new ForwardingApp("", new string[] { "a\"b\"c" }) - .GetProcessStartInfo().Arguments.Should().Be("exec a\\\"b\\\"c"); - } - - [Fact] - public void ItSetsEnvironmentalVariables() - { - var startInfo = new ForwardingApp("", new string[0], environmentVariables: new Dictionary - { - { "env1", "env1value" }, - { "env2", "env2value" } - }) - .GetProcessStartInfo(); - - startInfo.EnvironmentVariables["env1"].Should().Be("env1value"); - startInfo.EnvironmentVariables["env2"].Should().Be("env2value"); - } - } -} diff --git a/test/dotnet-msbuild.Tests/GivenMsbuildForwardingApp.cs b/test/dotnet-msbuild.Tests/GivenMsbuildForwardingApp.cs deleted file mode 100644 index 4450258ee..000000000 --- a/test/dotnet-msbuild.Tests/GivenMsbuildForwardingApp.cs +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) .NET 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.Tools.MSBuild; -using FluentAssertions; -using Xunit; -using static Microsoft.DotNet.Tools.Test.Utilities.DirectoryInfoExtensions; -using WindowsOnlyFactAttribute = Microsoft.DotNet.Tools.Test.Utilities.WindowsOnlyFactAttribute; -using NonWindowsOnlyFactAttribute = Microsoft.DotNet.Tools.Test.Utilities.NonWindowsOnlyFactAttribute; - -namespace Microsoft.DotNet.Cli.MSBuild.Tests -{ - public class GivenMsbuildForwardingApp - { - [WindowsOnlyFact] - public void DotnetExeIsExecuted() - { - var msbuildPath = ""; - new MSBuildForwardingApp(new string[0], msbuildPath) - .GetProcessStartInfo().FileName.Should().Be("dotnet.exe"); - } - - [NonWindowsOnlyFact] - public void DotnetIsExecuted() - { - var msbuildPath = ""; - new MSBuildForwardingApp(new string[0], msbuildPath) - .GetProcessStartInfo().FileName.Should().Be("dotnet"); - } - - [Theory] - [InlineData("MSBuildExtensionsPath")] - [InlineData("CscToolExe")] - [InlineData("VbcToolExe")] - [InlineData("MSBuildSDKsPath")] - [InlineData("DOTNET_CLI_TELEMETRY_SESSIONID")] - public void ItSetsEnvironmentalVariables(string envVarName) - { - var msbuildPath = ""; - var startInfo = new MSBuildForwardingApp(new string[0], msbuildPath).GetProcessStartInfo(); - startInfo.Environment.ContainsKey(envVarName).Should().BeTrue(); - } - - [Fact] - public void ItSetsMSBuildExtensionPathToExistingPath() - { - var msbuildPath = ""; - var envVar = "MSBuildExtensionsPath"; - new DirectoryInfo(new MSBuildForwardingApp(new string[0], msbuildPath) - .GetProcessStartInfo() - .Environment[envVar]) - .Should() - .Exist(); - } - - [Fact] - public void ItSetsMSBuildSDKsPathToExistingPath() - { - var msbuildPath = ""; - var envVar = "MSBuildSDKsPath"; - new DirectoryInfo(new MSBuildForwardingApp(new string[0], msbuildPath) - .GetProcessStartInfo() - .Environment[envVar]) - .Should() - .Exist(); - } - - [Fact] - public void ItSetsCscToolExePathToValidPath() - { - var msbuildPath = ""; - var envVar = "CscToolExe"; - new FileInfo(new MSBuildForwardingApp(new string[0], msbuildPath) - .GetProcessStartInfo() - .Environment[envVar]) - .Should().NotBeNull("constructor will throw on invalid path"); - } - - [Fact] - public void ItSetsVbcToolExePathToValidPath() - { - var msbuildPath = ""; - var envVar = "VbcToolExe"; - new FileInfo(new MSBuildForwardingApp(new string[0], msbuildPath) - .GetProcessStartInfo() - .Environment[envVar]) - .Should().NotBeNull("constructor will throw on invalid path"); - } - - [Fact] - public void ItSetsOrIgnoresTelemetrySessionId() - { - var msbuildPath = ""; - var envVar = "DOTNET_CLI_TELEMETRY_SESSIONID"; - var startInfo = new MSBuildForwardingApp(new string[0], msbuildPath) - .GetProcessStartInfo(); - (startInfo.Environment[envVar] == null || int.TryParse(startInfo.Environment[envVar], out _)) - .Should().BeTrue("DOTNET_CLI_TELEMETRY_SESSIONID should be null or current session id"); - } - - [Fact] - public void ItDoesNotSetCurrentWorkingDirectory() - { - var msbuildPath = ""; - var startInfo = new MSBuildForwardingApp(new string[0], msbuildPath) - .GetProcessStartInfo().WorkingDirectory.Should().Be(""); - } - } -} diff --git a/test/dotnet-msbuild.Tests/dotnet-msbuild.Tests.csproj b/test/dotnet-msbuild.Tests/dotnet-msbuild.Tests.csproj deleted file mode 100644 index 6259dcebe..000000000 --- a/test/dotnet-msbuild.Tests/dotnet-msbuild.Tests.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-msbuild.Tests - ../../tools/Key.snk - true - true - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - - - - - - - - - - - - - diff --git a/test/dotnet-new.Tests/AspNetNuGetConfiguration.cs b/test/dotnet-new.Tests/AspNetNuGetConfiguration.cs deleted file mode 100644 index b49c81009..000000000 --- a/test/dotnet-new.Tests/AspNetNuGetConfiguration.cs +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index cac098694..000000000 --- a/test/dotnet-new.Tests/GivenThatIWantANewApp.cs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using System.Linq; -using System.Xml.Linq; -using FluentAssertions; -using Microsoft.DotNet.Tools.Test.Utilities; -using Microsoft.Extensions.DependencyModel; -using Xunit; - -namespace Microsoft.DotNet.New.Tests -{ - public class GivenThatIWantANewApp : TestBase - { - [Fact] - public void When_dotnet_new_is_invoked_mupliple_times_it_should_fail() - { - var rootPath = TestAssets.CreateTestDirectory().FullName; - - new NewCommand() - .WithWorkingDirectory(rootPath) - .Execute($"console --debug:ephemeral-hive --no-restore"); - - DateTime expectedState = Directory.GetLastWriteTime(rootPath); - - var result = new NewCommand() - .WithWorkingDirectory(rootPath) - .ExecuteWithCapturedOutput($"console --debug:ephemeral-hive --no-restore"); - - DateTime actualState = Directory.GetLastWriteTime(rootPath); - - Assert.Equal(expectedState, actualState); - - result.Should().Fail(); - } - - [Fact] - public void RestoreDoesNotUseAnyCliProducedPackagesOnItsTemplates() - { - string[] cSharpTemplates = new[] { "console", "classlib", "mstest", "xunit", "web", "mvc", "webapi" }; - - var rootPath = TestAssets.CreateTestDirectory().FullName; - var packagesDirectory = Path.Combine(rootPath, "packages"); - - foreach (string cSharpTemplate in cSharpTemplates) - { - var projectFolder = Path.Combine(rootPath, cSharpTemplate + "1"); - Directory.CreateDirectory(projectFolder); - CreateAndRestoreNewProject(cSharpTemplate, projectFolder, packagesDirectory); - } - - Directory.EnumerateFiles(packagesDirectory, $"*.nupkg", SearchOption.AllDirectories) - .Should().NotContain(p => p.Contains("Microsoft.DotNet.Cli.Utils")); - } - - private void CreateAndRestoreNewProject( - string projectType, - string projectFolder, - string packagesDirectory) - { - 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") - .Should().Pass(); - } - - [Theory] - [InlineData("console", "microsoft.netcore.app")] - [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 repoRootNuGetConfig = Path.Combine(RepoDirectoriesProvider.RepoRoot, "NuGet.Config"); - - new NewCommand() - .WithWorkingDirectory(rootPath) - .Execute($"{type} --name {projectName} -o . --debug:ephemeral-hive --no-restore") - .Should().Pass(); - - new RestoreCommand() - .WithWorkingDirectory(rootPath) - .Execute($"--configfile {repoRootNuGetConfig} --packages {packagesDirectory}") - .Should().Pass(); - - new DirectoryInfo(Path.Combine(packagesDirectory, packageName)) - .Should().Exist() - .And.HaveDirectory(expectedVersion); - } - } -} diff --git a/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs b/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs deleted file mode 100644 index 8c4d05abe..000000000 --- a/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; -using FluentAssertions; -using Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.New.Tests -{ - public class GivenThatIWantANewAppWithSpecifiedType : TestBase - { - [Theory] - [InlineData("C#", "console", false, false)] - [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#", "angular", false, true)] - [InlineData("C#", "react", false, true)] - [InlineData("C#", "reactredux", false, true)] - [InlineData("F#", "console", false, false)] - [InlineData("F#", "classlib", false, false)] - [InlineData("F#", "mstest", false, false)] - [InlineData("F#", "xunit", false, false)] - [InlineData("F#", "mvc", true, false)] - [InlineData("VB", "console", false, false)] - [InlineData("VB", "classlib", false, false)] - [InlineData("VB", "mstest", false, false)] - [InlineData("VB", "xunit", false, false)] - public void TemplateRestoresAndBuildsWithoutWarnings( - string language, - string projectType, - bool useNuGetConfigForAspNet, - bool skipSpaWebpackSteps) - { - string rootPath = TestAssets.CreateTestDirectory(identifier: $"{language}_{projectType}").FullName; - string noRestoreDirective = "--no-restore"; - - new TestCommand("dotnet") { WorkingDirectory = rootPath } - .Execute($"new {projectType} -lang {language} -o {rootPath} --debug:ephemeral-hive {noRestoreDirective}") - .Should().Pass(); - - if (useNuGetConfigForAspNet) - { - AspNetNuGetConfiguration.WriteNuGetConfigWithAspNetPrivateFeeds(Path.Combine(rootPath, "NuGet.Config")); - } - - if (skipSpaWebpackSteps) - { - // Not all CI machines have Node installed, so the build would fail if we tried - // to run Webpack. Bypass this by making it appear that Webpack already ran. - 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") - .Should().Pass(); - - var buildResult = new TestCommand("dotnet") - .WithWorkingDirectory(rootPath) - .ExecuteWithCapturedOutput("build --no-restore") - .Should().Pass() - .And.NotHaveStdErr(); - } - } -} diff --git a/test/dotnet-new.Tests/MSBuild.exe b/test/dotnet-new.Tests/MSBuild.exe deleted file mode 100644 index 2b4d0f999..000000000 --- a/test/dotnet-new.Tests/MSBuild.exe +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 \ No newline at end of file diff --git a/test/dotnet-new.Tests/MSBuild.exe.config b/test/dotnet-new.Tests/MSBuild.exe.config deleted file mode 100644 index 2b4d0f999..000000000 --- a/test/dotnet-new.Tests/MSBuild.exe.config +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 \ No newline at end of file diff --git a/test/dotnet-new.Tests/NewCommandTests.cs b/test/dotnet-new.Tests/NewCommandTests.cs deleted file mode 100644 index e22cb821c..000000000 --- a/test/dotnet-new.Tests/NewCommandTests.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using FluentAssertions; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; - -namespace Microsoft.DotNet.New.Tests -{ - public class NewCommandTests : TestBase - { - [Fact] - public void WhenSwitchIsSkippedThenItPrintsError() - { - var cmd = new DotnetCommand().Execute("new Web1.1"); - - cmd.ExitCode.Should().NotBe(0); - - if (!DotnetUnderTest.IsLocalized()) - { - cmd.StdErr.Should().StartWith("No templates matched the input template name: Web1.1."); - } - } - - [Fact] - public void WhenTemplateNameIsNotUniquelyMatchedThenItIndicatesProblemToUser() - { - var cmd = new DotnetCommand().Execute("new c"); - - cmd.ExitCode.Should().NotBe(0); - - if (!DotnetUnderTest.IsLocalized()) - { - cmd.StdErr.Should().StartWith("Unable to determine the desired template from the input template name: c."); - } - } - } -} diff --git a/test/dotnet-new.Tests/NuGet.tempaspnetpatch.config b/test/dotnet-new.Tests/NuGet.tempaspnetpatch.config deleted file mode 100644 index 33b9693d5..000000000 --- a/test/dotnet-new.Tests/NuGet.tempaspnetpatch.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/test/dotnet-new.Tests/dotnet-new.Tests.csproj b/test/dotnet-new.Tests/dotnet-new.Tests.csproj deleted file mode 100644 index 133fd9730..000000000 --- a/test/dotnet-new.Tests/dotnet-new.Tests.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-new.Tests - $(AssetTargetFallback);dnxcore50;portable-net45+win8 - - - - - - - - - - - - - - - - - - - diff --git a/test/dotnet-nuget.UnitTests/GivenANuGetCommand.cs b/test/dotnet-nuget.UnitTests/GivenANuGetCommand.cs deleted file mode 100644 index 8a903ec38..000000000 --- a/test/dotnet-nuget.UnitTests/GivenANuGetCommand.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; -using FluentAssertions; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using Microsoft.DotNet.Tools.NuGet; -using Moq; -using NuGet.Frameworks; -using Xunit; - -namespace Microsoft.DotNet.Tools.Run.Tests -{ - public class GivenANuGetCommand : TestBase - { - [Theory] - [InlineData(new[] { "push", "foo.1.0.0.nupkg" }, 0)] - [InlineData(new[] { "push", "foo.1.0.0.nupkg", "-k", "12345678-1234-1234-1234-123456789012" }, 0)] - [InlineData(new[] { "push", "foo.1.0.0.nupkg", - "--api-key", "12345678-1234-1234-1234-123456789012", - "--source", "http://www.myget.org/foofeed" }, 0)] - [InlineData(new[] { "push", "foo.1.0.0.nupkg", - "--api-key", "12345678-1234-1234-1234-123456789012", - "--source", "http://www.nuget.org/foofeed", - "--symbol-api-key", "12345678-1234-1234-1234-123456789012", - "--symbol-source", "https://nuget.smbsrc.net/foo", - "--timeout", "1000", - "--disable-buffering", - "--no-symbols" }, 0)] // Unlikely option given others, but testing max options edge case - [InlineData(new[] { "delete", "foo.1.0.0.nupkg" }, 0)] - [InlineData(new[] { "delete", "foo.1.0.0.nupkg", - "--non-interactive" }, 0)] - [InlineData(new[] { "delete", "foo.1.0.0.nupkg", - "--api-key", "12345678-1234-1234-1234-123456789012", - "--source", "http://www.nuget.org/foofeed", - "--non-interactive" }, 0)] - [InlineData(new[] { "locals" }, 0)] - [InlineData(new[] { "locals", "http-cache", "packages-cache", "global-packages", "temp" }, 0)] - public void ItPassesCommandIfSupported(string[] inputArgs, int result) - { - // Arrange - string[] receivedArgs = null; - var testCommandRunner = new Mock(); - testCommandRunner - .Setup(x => x.Run(It.IsAny())) - .Callback(s => receivedArgs = s) - .Returns(0); - - // Act - var returned = NuGetCommand.Run(inputArgs, testCommandRunner.Object); - - // Assert - receivedArgs.Should().BeEquivalentTo(inputArgs); - returned.Should().Be(result); - } - } -} diff --git a/test/dotnet-nuget.UnitTests/dotnet-nuget.UnitTests.csproj b/test/dotnet-nuget.UnitTests/dotnet-nuget.UnitTests.csproj deleted file mode 100644 index 4eb2c0794..000000000 --- a/test/dotnet-nuget.UnitTests/dotnet-nuget.UnitTests.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-nuget.UnitTests - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - - - - - - - - - - - - - - - - diff --git a/test/dotnet-pack.Tests/PackTests.cs b/test/dotnet-pack.Tests/PackTests.cs deleted file mode 100644 index 32b940a45..000000000 --- a/test/dotnet-pack.Tests/PackTests.cs +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright (c) .NET 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.Linq; -using System.Xml.Linq; -using FluentAssertions; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; - -namespace Microsoft.DotNet.Tools.Pack.Tests -{ - public class PackTests : TestBase - { - [Fact(Skip="https://github.com/dotnet/cli/issues/4488")] - public void OutputsPackagesToConfigurationSubdirWhenOutputParameterIsNotPassed() - { - var testInstance = TestAssets.Get("TestLibraryWithConfiguration") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var packCommand = new PackCommand(configuration: "Test") - .WithWorkingDirectory(testInstance.Root); - - var result = packCommand.Execute(); - - result.Should().Pass(); - - var outputDir = testInstance.Root - .GetDirectory("bin", "Test"); - - outputDir.Should().Exist() - .And.HaveFiles(new [] - { - "TestLibraryWithConfiguration.1.0.0.nupkg", - "TestLibraryWithConfiguration.1.0.0.symbols.nupkg" - }); - } - - [Fact] - public void OutputsPackagesFlatIntoOutputDirWhenOutputParameterIsPassed() - { - var testInstance = TestAssets.Get("TestLibraryWithConfiguration") - .CreateInstance() - .WithSourceFiles() - .WithBuildFiles() - .WithRestoreFiles(); - - var outputDir = testInstance.Root - .GetDirectory("bin2"); - - var packCommand = new PackCommand(output: outputDir.FullName) - .WithWorkingDirectory(testInstance.Root) - .Execute() - .Should().Pass(); - - outputDir.Should().Exist() - .And.HaveFiles(new [] - { - "TestLibraryWithConfiguration.1.0.0.nupkg" - }); - } - - [Fact] - public void SettingVersionSuffixFlag_ShouldStampAssemblyInfoInOutputAssemblyAndPackage() - { - var testInstance = TestAssets.Get("TestLibraryWithConfiguration") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - new PackCommand(versionSuffix: "85") - .WithWorkingDirectory(testInstance.Root.FullName) - .WithConfiguration("Debug") - .Execute() - .Should().Pass(); - - var output = testInstance.Root - .GetDirectory("bin", "Debug", DefaultLibraryFramework) - .GetFile("TestLibraryWithConfiguration.dll"); - - var informationalVersion = PeReaderUtils.GetAssemblyAttributeValue(output.FullName, "AssemblyInformationalVersionAttribute"); - - informationalVersion.Should().NotBeNull() - .And.BeEquivalentTo("1.0.0-85"); - - var outputPackage = testInstance.Root - .GetDirectory("bin", "Debug") - .GetFile("TestLibraryWithConfiguration.1.0.0-85.nupkg"); - - outputPackage.Should().Exist(); - } - - [Fact(Skip="https://github.com/dotnet/cli/issues/4486")] - public void HasIncludedFiles() - { - var testInstance = TestAssets.Get("EndToEndTestApp") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles() - .WithBuildFiles(); - - new PackCommand() - .WithWorkingDirectory(testInstance.Root) - .Execute() - .Should().Pass(); - - var outputPackage = testInstance.Root - .GetDirectory("bin", "Debug") - .GetFile("EndToEndTestApp.1.0.0.nupkg"); - - outputPackage.Should().Exist(); - - ZipFile.Open(outputPackage.FullName, ZipArchiveMode.Read) - .Entries - .Should().Contain(e => e.FullName == "packfiles/pack1.txt") - .And.Contain(e => e.FullName == "newpath/pack2.txt") - .And.Contain(e => e.FullName == "anotherpath/pack2.txt"); - } - - [Fact(Skip="https://github.com/dotnet/cli/issues/4487")] - public void PackAddsCorrectFilesForProjectsWithOutputNameSpecified() - { - var testInstance = TestAssets.Get("LibraryWithOutputAssemblyName") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - new PackCommand() - .WithWorkingDirectory(testInstance.Root) - .Execute() - .Should().Pass(); - - // netstandard1.5 is a workaround for https://github.com/dotnet/sdk/issues/318 - var outputPackage = testInstance.Root - .GetDirectory("bin", "Debug", "netstandard1.5") - .GetFile("LibraryWithOutputAssemblyName.1.0.0.nupkg"); - - outputPackage.Should().Exist(); - - ZipFile.Open(outputPackage.FullName, ZipArchiveMode.Read) - .Entries - .Should().Contain(e => e.FullName == "lib/netstandard1.5/MyLibrary.dll"); - - var symbolsPackage = testInstance.Root - .GetDirectory("bin", "Debug") - .GetFile("LibraryWithOutputAssemblyName.1.0.0.symbols.nupkg"); - - symbolsPackage.Should().Exist(); - - ZipFile.Open(symbolsPackage.FullName, ZipArchiveMode.Read) - .Entries - .Should().Contain(e => e.FullName == "lib/netstandard1.5/MyLibrary.dll") - .And.Contain(e => e.FullName == "lib/netstandard1.5/MyLibrary.pdb"); - } - - [Theory] - [InlineData("C#", "TestAppSimple")] - [InlineData("F#", "FSharpTestAppSimple")] - public void PackWorksWithLocalProject(string language, string projectName) - { - var testInstance = TestAssets.Get(projectName) - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - new PackCommand() - .WithWorkingDirectory(testInstance.Root) - .Execute() - .Should().Pass(); - } - - [Fact] - public void ItImplicitlyRestoresAProjectWhenPackaging() - { - var testInstance = TestAssets.Get("TestAppSimple") - .CreateInstance() - .WithSourceFiles(); - - new PackCommand() - .WithWorkingDirectory(testInstance.Root) - .Execute() - .Should().Pass(); - } - - [Fact] - public void ItDoesNotImplicitlyRestoreAProjectWhenPackagingWithTheNoRestoreOption() - { - var testInstance = TestAssets.Get("TestAppSimple") - .CreateInstance() - .WithSourceFiles(); - - new PackCommand() - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput("--no-restore") - .Should().Fail() - .And.HaveStdOutContaining("project.assets.json"); - } - - [Fact] - public void HasServiceableFlagWhenArgumentPassed() - { - var testInstance = TestAssets.Get("TestLibraryWithConfiguration") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles() - .WithBuildFiles(); - - var packCommand = new PackCommand(configuration: "Debug", serviceable: true) - .WithWorkingDirectory(testInstance.Root); - - var result = packCommand.Execute(); - - result.Should().Pass(); - - var outputDir = testInstance.Root.GetDirectory("bin", "Debug"); - - outputDir.Should().Exist() - .And.HaveFile("TestLibraryWithConfiguration.1.0.0.nupkg"); - - var outputPackage = outputDir.GetFile("TestLibraryWithConfiguration.1.0.0.nupkg"); - - var zip = ZipFile.Open(outputPackage.FullName, ZipArchiveMode.Read); - - zip.Entries.Should().Contain(e => e.FullName == "TestLibraryWithConfiguration.nuspec"); - - var manifestReader = new StreamReader(zip.Entries.First(e => e.FullName == "TestLibraryWithConfiguration.nuspec").Open()); - - var nuspecXml = XDocument.Parse(manifestReader.ReadToEnd()); - - var node = nuspecXml.Descendants().Single(e => e.Name.LocalName == "serviceable"); - - Assert.Equal("true", node.Value); - } - - [Fact] - public void ItPacksAppWhenRestoringToSpecificPackageDirectory() - { - var rootPath = TestAssets.CreateTestDirectory().FullName; - var rootDir = new DirectoryInfo(rootPath); - - string dir = "pkgs"; - string args = $"--packages {dir}"; - - string newArgs = $"console -o \"{rootPath}\" --no-restore"; - new NewCommandShim() - .WithWorkingDirectory(rootPath) - .Execute(newArgs) - .Should() - .Pass(); - - new RestoreCommand() - .WithWorkingDirectory(rootPath) - .Execute(args) - .Should() - .Pass(); - - new PackCommand() - .WithWorkingDirectory(rootPath) - .ExecuteWithCapturedOutput("--no-restore") - .Should() - .Pass(); - - rootDir - .GetDirectory("bin") - .Should().HaveFilesMatching("*.nupkg", SearchOption.AllDirectories); - } - - private void CopyProjectToTempDir(string projectDir, TempDirectory tempDir) - { - // copy all the files to temp dir - foreach (var file in Directory.EnumerateFiles(projectDir)) - { - tempDir.CopyFile(file); - } - } - - private string GetProjectPath(TempDirectory projectDir) - { - return Path.Combine(projectDir.Path, "project.json"); - } - } -} diff --git a/test/dotnet-pack.Tests/dotnet-pack.Tests.csproj b/test/dotnet-pack.Tests/dotnet-pack.Tests.csproj deleted file mode 100644 index a33adc3bb..000000000 --- a/test/dotnet-pack.Tests/dotnet-pack.Tests.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-pack.Tests - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - - - - - PreserveNewest - PreserveNewest - - - - - - - - - - - - - - - diff --git a/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs b/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs deleted file mode 100644 index 2db2018fa..000000000 --- a/test/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright (c) .NET 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.Diagnostics; -using System.Runtime.InteropServices; -using FluentAssertions; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.PlatformAbstractions; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; - -namespace Microsoft.DotNet.Cli.Publish.Tests -{ - public class GivenDotnetPublishPublishesProjects : TestBase - { - [Fact] - public void ItPublishesARunnablePortableApp() - { - var testAppName = "MSBuildTestApp"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute() - .Should().Pass(); - - new PublishCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute("--framework netcoreapp2.0") - .Should().Pass(); - - var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; - var outputDll = Path.Combine(testProjectDirectory, "bin", configuration, "netcoreapp2.0", "publish", $"{testAppName}.dll"); - - new DotnetCommand() - .ExecuteWithCapturedOutput(outputDll) - .Should().Pass() - .And.HaveStdOutContaining("Hello World"); - } - - [Fact] - public void ItImplicitlyRestoresAProjectWhenPublishing() - { - var testAppName = "MSBuildTestApp"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - new PublishCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute("--framework netcoreapp2.0") - .Should().Pass(); - } - - [Fact] - public void ItCanPublishAMultiTFMProjectWithImplicitRestore() - { - var testInstance = TestAssets.Get( - TestAssetKinds.DesktopTestProjects, - "NETFrameworkReferenceNETStandard20") - .CreateInstance() - .WithSourceFiles(); - - string projectDirectory = Path.Combine(testInstance.Root.FullName, "MultiTFMTestApp"); - - new PublishCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("--framework netcoreapp2.0") - .Should().Pass(); - } - - [Fact] - public void ItDoesNotImplicitlyRestoreAProjectWhenPublishingWithTheNoRestoreOption() - { - var testAppName = "MSBuildTestApp"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - new PublishCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput("--framework netcoreapp2.0 --no-restore") - .Should().Fail() - .And.HaveStdOutContaining("project.assets.json"); - } - - [Fact] - public void ItPublishesARunnableSelfContainedApp() - { - var testAppName = "MSBuildTestApp"; - - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var testProjectDirectory = testInstance.Root; - - var rid = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier(); - - new PublishCommand() - .WithFramework("netcoreapp2.0") - .WithRuntime(rid) - .WithWorkingDirectory(testProjectDirectory) - .Execute() - .Should().Pass(); - - var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; - - var outputProgram = testProjectDirectory - .GetDirectory("bin", configuration, "netcoreapp2.0", rid, "publish", $"{testAppName}{Constants.ExeSuffix}") - .FullName; - - EnsureProgramIsRunnable(outputProgram); - - new TestCommand(outputProgram) - .ExecuteWithCapturedOutput() - .Should().Pass() - .And.HaveStdOutContaining("Hello World"); - } - - [Fact] - public void ItPublishesARidSpecificAppSettingSelfContainedToTrue() - { - var testAppName = "MSBuildTestApp"; - var outputDirectory = PublishAppWithSelfContained(testAppName, true); - - var outputProgram = Path.Combine(outputDirectory.FullName, $"{testAppName}{Constants.ExeSuffix}"); - - EnsureProgramIsRunnable(outputProgram); - - new TestCommand(outputProgram) - .ExecuteWithCapturedOutput() - .Should().Pass() - .And.HaveStdOutContaining("Hello World"); - } - - [Fact] - public void ItPublishesARidSpecificAppSettingSelfContainedToFalse() - { - var testAppName = "MSBuildTestApp"; - var outputDirectory = PublishAppWithSelfContained(testAppName, false); - - outputDirectory.Should().OnlyHaveFiles(new[] { - $"{testAppName}.dll", - $"{testAppName}.pdb", - $"{testAppName}.deps.json", - $"{testAppName}.runtimeconfig.json", - }); - - new DotnetCommand() - .ExecuteWithCapturedOutput(Path.Combine(outputDirectory.FullName, $"{testAppName}.dll")) - .Should().Pass() - .And.HaveStdOutContaining("Hello World"); - } - - private DirectoryInfo PublishAppWithSelfContained(string testAppName, bool selfContained) - { - var testInstance = TestAssets.Get(testAppName) - .CreateInstance($"PublishesSelfContained{selfContained}") - .WithSourceFiles() - .WithRestoreFiles(); - - var testProjectDirectory = testInstance.Root; - - var rid = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier(); - - new PublishCommand() - .WithRuntime(rid) - .WithSelfContained(selfContained) - .WithWorkingDirectory(testProjectDirectory) - .Execute() - .Should().Pass(); - - var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; - return testProjectDirectory - .GetDirectory("bin", configuration, "netcoreapp2.0", rid, "publish"); - } - - private static void EnsureProgramIsRunnable(string path) - { - if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - //Workaround for https://github.com/dotnet/corefx/issues/15516 - Process.Start("chmod", $"u+x {path}").WaitForExit(); - } - } - - [Fact] - public void ItPublishesAppWhenRestoringToSpecificPackageDirectory() - { - var rootPath = TestAssets.CreateTestDirectory().FullName; - var rootDir = new DirectoryInfo(rootPath); - - string dir = "pkgs"; - string args = $"--packages {dir}"; - - string newArgs = $"console -o \"{rootPath}\" --no-restore"; - new NewCommandShim() - .WithWorkingDirectory(rootPath) - .Execute(newArgs) - .Should() - .Pass(); - - new RestoreCommand() - .WithWorkingDirectory(rootPath) - .Execute(args) - .Should() - .Pass(); - - new PublishCommand() - .WithWorkingDirectory(rootPath) - .ExecuteWithCapturedOutput("--no-restore") - .Should().Pass(); - - var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; - - var outputProgram = rootDir - .GetDirectory("bin", configuration, "netcoreapp2.0", "publish", $"{rootDir.Name}.dll") - .FullName; - - new TestCommand(outputProgram) - .ExecuteWithCapturedOutput() - .Should().Pass() - .And.HaveStdOutContaining("Hello World"); - } - } -} diff --git a/test/dotnet-publish.Tests/dotnet-publish.Tests.csproj b/test/dotnet-publish.Tests/dotnet-publish.Tests.csproj deleted file mode 100644 index 31a477569..000000000 --- a/test/dotnet-publish.Tests/dotnet-publish.Tests.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-publish.Tests - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - - - - - .version - PreserveNewest - - - - - - - - - - - - - diff --git a/test/dotnet-remove-package.Tests/GivenDotnetRemovePackage.cs b/test/dotnet-remove-package.Tests/GivenDotnetRemovePackage.cs deleted file mode 100644 index 0ff55170f..000000000 --- a/test/dotnet-remove-package.Tests/GivenDotnetRemovePackage.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using FluentAssertions; -using Microsoft.DotNet.Tools; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; - -namespace Microsoft.DotNet.Cli.Remove.Package.Tests -{ - public class GivenDotnetRemovePackage : TestBase - { - private const string HelpText = @"Usage: dotnet remove package [options] - -Arguments: - The project file to operate on. If a file is not specified, the command will search the current directory for one. - Package reference to remove. - -Options: - -h, --help Show help information. -"; - - private const string RemoveCommandHelpText = @"Usage: dotnet remove [options] [command] - -Arguments: - The project file to operate on. If a file is not specified, the command will search the current directory for one. - -Options: - -h, --help Show help information. - -Commands: - package .NET Remove Package reference Command. - reference .NET Remove Project to Project reference Command -"; - - [Theory] - [InlineData("--help")] - [InlineData("-h")] - public void WhenHelpOptionIsPassedItPrintsUsage(string helpArg) - { - var cmd = new DotnetCommand().ExecuteWithCapturedOutput($"remove package {helpArg}"); - cmd.Should().Pass(); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Theory] - [InlineData("")] - [InlineData("unknownCommandName")] - public void WhenNoCommandIsPassedItPrintsError(string commandName) - { - var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"remove {commandName}"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(CommonLocalizableStrings.RequiredCommandNotPassed); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(RemoveCommandHelpText); - } - - [Fact] - public void WhenReferencedPackageIsPassedItGetsRemoved() - { - var projectDirectory = TestAssets - .Get("TestAppSimple") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var packageName = "Newtonsoft.Json"; - var add = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"add package {packageName}"); - add.Should().Pass(); - - - var remove = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"remove package {packageName}"); - - remove.Should().Pass(); - remove.StdOut.Should().Contain($"Removing PackageReference for package '{packageName}' from project '{projectDirectory + Path.DirectorySeparatorChar}TestAppSimple.csproj'."); - remove.StdErr.Should().BeEmpty(); - } - } -} diff --git a/test/dotnet-remove-package.Tests/dotnet-remove-package.Tests.csproj b/test/dotnet-remove-package.Tests/dotnet-remove-package.Tests.csproj deleted file mode 100644 index 3d884fbd5..000000000 --- a/test/dotnet-remove-package.Tests/dotnet-remove-package.Tests.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-remove-package.Tests - ../../tools/Key.snk - true - true - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - - - - - - - - - - - - - - - - - diff --git a/test/dotnet-remove-reference.Tests/GivenDotnetRemoveP2P.cs b/test/dotnet-remove-reference.Tests/GivenDotnetRemoveP2P.cs deleted file mode 100644 index 65da417b2..000000000 --- a/test/dotnet-remove-reference.Tests/GivenDotnetRemoveP2P.cs +++ /dev/null @@ -1,510 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using FluentAssertions; -using Microsoft.Build.Construction; -using Microsoft.DotNet.Tools; -using Microsoft.DotNet.Tools.Test.Utilities; -using Msbuild.Tests.Utilities; -using System; -using System.IO; -using Xunit; - -namespace Microsoft.DotNet.Cli.Remove.Reference.Tests -{ - public class GivenDotnetRemoveReference : TestBase - { - private const string HelpText = @"Usage: dotnet remove reference [options] - -Arguments: - The project file to operate on. If a file is not specified, the command will search the current directory for one. - Project to project references to remove - -Options: - -h, --help Show help information. - -f, --framework Remove reference only when targeting a specific framework -"; - - private const string RemoveCommandHelpText = @"Usage: dotnet remove [options] [command] - -Arguments: - The project file to operate on. If a file is not specified, the command will search the current directory for one. - -Options: - -h, --help Show help information. - -Commands: - package .NET Remove Package reference Command. - reference .NET Remove Project to Project reference Command -"; - - const string FrameworkNet451Arg = "-f net451"; - const string ConditionFrameworkNet451 = "== 'net451'"; - const string FrameworkNetCoreApp10Arg = "-f netcoreapp1.0"; - const string ConditionFrameworkNetCoreApp10 = "== 'netcoreapp1.0'"; - static readonly string[] DefaultFrameworks = new string[] { "netcoreapp1.0", "net451" }; - - private TestSetup Setup([System.Runtime.CompilerServices.CallerMemberName] string callingMethod = nameof(Setup), string identifier = "") - { - return new TestSetup( - TestAssets.Get(TestSetup.TestGroup, TestSetup.ProjectName) - .CreateInstance(callingMethod: callingMethod, identifier: identifier) - .WithSourceFiles() - .Root - .FullName); - } - - private ProjDir NewDir([System.Runtime.CompilerServices.CallerMemberName] string callingMethod = nameof(NewDir), string identifier = "") - { - return new ProjDir(TestAssets.CreateTestDirectory(callingMethod: callingMethod, identifier: identifier).FullName); - } - - private ProjDir NewLib(string dir = null, [System.Runtime.CompilerServices.CallerMemberName] string callingMethod = nameof(NewDir), string identifier = "") - { - var projDir = dir == null ? NewDir(callingMethod: callingMethod, identifier: identifier) : new ProjDir(dir); - - try - { - string newArgs = $"classlib -o \"{projDir.Path}\" --no-restore"; - new NewCommandShim() - .WithWorkingDirectory(projDir.Path) - .ExecuteWithCapturedOutput(newArgs) - .Should().Pass(); - } - catch (System.ComponentModel.Win32Exception e) - { - throw new Exception($"Intermittent error in `dotnet new` occurred when running it in dir `{projDir.Path}`\nException:\n{e}"); - } - - return projDir; - } - - private static void SetTargetFrameworks(ProjDir proj, string[] frameworks) - { - var csproj = proj.CsProj(); - csproj.AddProperty("TargetFrameworks", string.Join(";", frameworks)); - csproj.Save(); - } - - private ProjDir NewLibWithFrameworks(string dir = null, [System.Runtime.CompilerServices.CallerMemberName] string callingMethod = nameof(NewDir), string identifier = "") - { - var ret = NewLib(dir, callingMethod: callingMethod, identifier: identifier); - SetTargetFrameworks(ret, DefaultFrameworks); - return ret; - } - - private ProjDir GetLibRef(TestSetup setup) - { - return new ProjDir(setup.LibDir); - } - - private ProjDir AddLibRef(TestSetup setup, ProjDir proj, string additionalArgs = "") - { - var ret = GetLibRef(setup); - new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(proj.CsProjPath) - .Execute($"{additionalArgs} \"{ret.CsProjPath}\"") - .Should().Pass(); - - return ret; - } - - private ProjDir AddValidRef(TestSetup setup, ProjDir proj, string frameworkArg = "") - { - var ret = new ProjDir(setup.ValidRefDir); - new AddReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(proj.CsProjPath) - .Execute($"{frameworkArg} \"{ret.CsProjPath}\"") - .Should().Pass(); - - return ret; - } - - [Theory] - [InlineData("--help")] - [InlineData("-h")] - public void WhenHelpOptionIsPassedItPrintsUsage(string helpArg) - { - var cmd = new RemoveReferenceCommand().Execute(helpArg); - cmd.Should().Pass(); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Theory] - [InlineData("")] - [InlineData("unknownCommandName")] - public void WhenNoCommandIsPassedItPrintsError(string commandName) - { - var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"remove {commandName}"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(CommonLocalizableStrings.RequiredCommandNotPassed); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(RemoveCommandHelpText); - } - - [Fact] - public void WhenTooManyArgumentsArePassedItPrintsError() - { - var cmd = new AddReferenceCommand() - .WithProject("one two three") - .Execute("proj.csproj"); - cmd.ExitCode.Should().NotBe(0); - cmd.StdErr.Should().BeVisuallyEquivalentTo($@"{string.Format(CommandLine.LocalizableStrings.UnrecognizedCommandOrArgument, "two")} -{string.Format(CommandLine.LocalizableStrings.UnrecognizedCommandOrArgument, "three")}"); - } - - [Theory] - [InlineData("idontexist.csproj")] - [InlineData("ihave?inv@lid/char\\acters")] - public void WhenNonExistingProjectIsPassedItPrintsErrorAndUsage(string projName) - { - var setup = Setup(); - - var cmd = new RemoveReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(projName) - .Execute($"\"{setup.ValidRefCsprojPath}\""); - cmd.ExitCode.Should().NotBe(0); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.CouldNotFindProjectOrDirectory, projName)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenBrokenProjectIsPassedItPrintsErrorAndUsage() - { - string projName = "Broken/Broken.csproj"; - var setup = Setup(); - - var cmd = new RemoveReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(projName) - .Execute($"\"{setup.ValidRefCsprojPath}\""); - cmd.ExitCode.Should().NotBe(0); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.ProjectIsInvalid, "Broken/Broken.csproj")); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenMoreThanOneProjectExistsInTheDirectoryItPrintsErrorAndUsage() - { - var setup = Setup(); - - var workingDir = Path.Combine(setup.TestRoot, "MoreThanOne"); - var cmd = new RemoveReferenceCommand() - .WithWorkingDirectory(workingDir) - .Execute($"\"{setup.ValidRefCsprojRelToOtherProjPath}\""); - cmd.ExitCode.Should().NotBe(0); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.MoreThanOneProjectInDirectory, workingDir + Path.DirectorySeparatorChar)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenNoProjectsExistsInTheDirectoryItPrintsErrorAndUsage() - { - var setup = Setup(); - - var cmd = new RemoveReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .Execute($"\"{setup.ValidRefCsprojPath}\""); - cmd.ExitCode.Should().NotBe(0); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.CouldNotFindAnyProjectInDirectory, setup.TestRoot + Path.DirectorySeparatorChar)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void ItRemovesRefWithoutCondAndPrintsStatus() - { - var setup = Setup(); - var lib = NewLibWithFrameworks(setup.TestRoot); - var libref = AddLibRef(setup, lib); - - int noCondBefore = lib.CsProj().NumberOfItemGroupsWithoutCondition(); - var cmd = new RemoveReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"\"{libref.CsProjPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, Path.Combine("Lib", setup.LibCsprojName))); - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithoutCondition().Should().Be(noCondBefore - 1); - csproj.NumberOfProjectReferencesWithIncludeContaining(libref.Name).Should().Be(0); - } - - [Fact] - public void ItRemovesRefWithCondAndPrintsStatus() - { - var setup = Setup(); - var lib = NewLibWithFrameworks(setup.TestRoot); - var libref = AddLibRef(setup, lib, FrameworkNet451Arg); - - int condBefore = lib.CsProj().NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNet451); - var cmd = new RemoveReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"{FrameworkNet451Arg} \"{libref.CsProjPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, Path.Combine("Lib", setup.LibCsprojName))); - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNet451).Should().Be(condBefore - 1); - csproj.NumberOfProjectReferencesWithIncludeAndConditionContaining(libref.Name, ConditionFrameworkNet451).Should().Be(0); - } - - [Fact] - public void WhenTwoDifferentRefsArePresentItDoesNotRemoveBoth() - { - var setup = Setup(); - var lib = NewLibWithFrameworks(setup.TestRoot); - var libref = AddLibRef(setup, lib); - var validref = AddValidRef(setup, lib); - - int noCondBefore = lib.CsProj().NumberOfItemGroupsWithoutCondition(); - var cmd = new RemoveReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"\"{libref.CsProjPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, Path.Combine("Lib", setup.LibCsprojName))); - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithoutCondition().Should().Be(noCondBefore); - csproj.NumberOfProjectReferencesWithIncludeContaining(libref.Name).Should().Be(0); - } - - [Fact] - public void WhenRefWithoutCondIsNotThereItPrintsMessage() - { - var setup = Setup(); - var lib = NewLibWithFrameworks(setup.TestRoot); - var libref = GetLibRef(setup); - - string csprojContetntBefore = lib.CsProjContent(); - var cmd = new RemoveReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"\"{libref.CsProjPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ProjectReferenceCouldNotBeFound, libref.CsProjPath)); - lib.CsProjContent().Should().BeEquivalentTo(csprojContetntBefore); - } - - [Fact] - public void WhenRefWithCondIsNotThereItPrintsMessage() - { - var setup = Setup(); - var lib = NewLibWithFrameworks(setup.TestRoot); - var libref = GetLibRef(setup); - - string csprojContetntBefore = lib.CsProjContent(); - var cmd = new RemoveReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"{FrameworkNet451Arg} \"{libref.CsProjPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ProjectReferenceCouldNotBeFound, libref.CsProjPath)); - lib.CsProjContent().Should().BeEquivalentTo(csprojContetntBefore); - } - - [Fact] - public void WhenRefWithAndWithoutCondArePresentAndRemovingNoCondItDoesNotRemoveOther() - { - var setup = Setup(); - var lib = NewLibWithFrameworks(setup.TestRoot); - var librefCond = AddLibRef(setup, lib, FrameworkNet451Arg); - var librefNoCond = AddLibRef(setup, lib); - - var csprojBefore = lib.CsProj(); - int noCondBefore = csprojBefore.NumberOfItemGroupsWithoutCondition(); - int condBefore = csprojBefore.NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNet451); - var cmd = new RemoveReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"\"{librefNoCond.CsProjPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, Path.Combine("Lib", setup.LibCsprojName))); - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithoutCondition().Should().Be(noCondBefore - 1); - csproj.NumberOfProjectReferencesWithIncludeContaining(librefNoCond.Name).Should().Be(0); - - csproj.NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNet451).Should().Be(condBefore); - csproj.NumberOfProjectReferencesWithIncludeAndConditionContaining(librefCond.Name, ConditionFrameworkNet451).Should().Be(1); - } - - [Fact] - public void WhenRefWithAndWithoutCondArePresentAndRemovingCondItDoesNotRemoveOther() - { - var setup = Setup(); - var lib = NewLibWithFrameworks(setup.TestRoot); - var librefCond = AddLibRef(setup, lib, FrameworkNet451Arg); - var librefNoCond = AddLibRef(setup, lib); - - var csprojBefore = lib.CsProj(); - int noCondBefore = csprojBefore.NumberOfItemGroupsWithoutCondition(); - int condBefore = csprojBefore.NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNet451); - var cmd = new RemoveReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"{FrameworkNet451Arg} \"{librefCond.CsProjPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, Path.Combine("Lib", setup.LibCsprojName))); - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithoutCondition().Should().Be(noCondBefore); - csproj.NumberOfProjectReferencesWithIncludeContaining(librefNoCond.Name).Should().Be(1); - - csproj.NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNet451).Should().Be(condBefore - 1); - csproj.NumberOfProjectReferencesWithIncludeAndConditionContaining(librefCond.Name, ConditionFrameworkNet451).Should().Be(0); - } - - [Fact] - public void WhenRefWithDifferentCondIsPresentItDoesNotRemoveIt() - { - var setup = Setup(); - var lib = NewLibWithFrameworks(setup.TestRoot); - var librefCondNet451 = AddLibRef(setup, lib, FrameworkNet451Arg); - var librefCondNetCoreApp10 = AddLibRef(setup, lib, FrameworkNetCoreApp10Arg); - - var csprojBefore = lib.CsProj(); - int condNet451Before = csprojBefore.NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNet451); - int condNetCoreApp10Before = csprojBefore.NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNetCoreApp10); - var cmd = new RemoveReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"{FrameworkNet451Arg} \"{librefCondNet451.CsProjPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, Path.Combine("Lib", setup.LibCsprojName))); - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNet451).Should().Be(condNet451Before - 1); - csproj.NumberOfProjectReferencesWithIncludeAndConditionContaining(librefCondNet451.Name, ConditionFrameworkNet451).Should().Be(0); - - csproj.NumberOfItemGroupsWithConditionContaining(ConditionFrameworkNetCoreApp10).Should().Be(condNetCoreApp10Before); - csproj.NumberOfProjectReferencesWithIncludeAndConditionContaining(librefCondNetCoreApp10.Name, ConditionFrameworkNetCoreApp10).Should().Be(1); - } - - [Fact] - public void WhenDuplicateReferencesArePresentItRemovesThemAll() - { - var setup = Setup(); - var proj = new ProjDir(Path.Combine(setup.TestRoot, "WithDoubledRef")); - var libref = GetLibRef(setup); - - string removedText = $@"{string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, setup.LibCsprojRelPath)} -{string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, setup.LibCsprojRelPath)}"; - - int noCondBefore = proj.CsProj().NumberOfItemGroupsWithoutCondition(); - var cmd = new RemoveReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(proj.CsProjPath) - .Execute($"\"{libref.CsProjPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().BeVisuallyEquivalentTo(removedText); - - var csproj = proj.CsProj(); - csproj.NumberOfItemGroupsWithoutCondition().Should().Be(noCondBefore - 1); - csproj.NumberOfProjectReferencesWithIncludeContaining(libref.Name).Should().Be(0); - } - - [Fact] - public void WhenPassingRefWithRelPathItRemovesRefWithAbsolutePath() - { - var setup = Setup(); - var lib = GetLibRef(setup); - var libref = AddValidRef(setup, lib); - - int noCondBefore = lib.CsProj().NumberOfItemGroupsWithoutCondition(); - var cmd = new RemoveReferenceCommand() - .WithWorkingDirectory(lib.Path) - .WithProject(lib.CsProjPath) - .Execute($"\"{setup.ValidRefCsprojRelToOtherProjPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, setup.ValidRefCsprojRelToOtherProjPath)); - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithoutCondition().Should().Be(noCondBefore - 1); - csproj.NumberOfProjectReferencesWithIncludeContaining(libref.Name).Should().Be(0); - } - - [Fact] - public void WhenPassingRefWithRelPathToProjectItRemovesRefWithPathRelToProject() - { - var setup = Setup(); - var lib = GetLibRef(setup); - var libref = AddValidRef(setup, lib); - - int noCondBefore = lib.CsProj().NumberOfItemGroupsWithoutCondition(); - var cmd = new RemoveReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"\"{setup.ValidRefCsprojRelToOtherProjPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, setup.ValidRefCsprojRelToOtherProjPath)); - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithoutCondition().Should().Be(noCondBefore - 1); - csproj.NumberOfProjectReferencesWithIncludeContaining(libref.Name).Should().Be(0); - } - - [Fact] - public void WhenPassingRefWithAbsolutePathItRemovesRefWithRelPath() - { - var setup = Setup(); - var lib = GetLibRef(setup); - var libref = AddValidRef(setup, lib); - - int noCondBefore = lib.CsProj().NumberOfItemGroupsWithoutCondition(); - var cmd = new RemoveReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"\"{setup.ValidRefCsprojPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, setup.ValidRefCsprojRelToOtherProjPath)); - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithoutCondition().Should().Be(noCondBefore - 1); - csproj.NumberOfProjectReferencesWithIncludeContaining(libref.Name).Should().Be(0); - } - - [Fact] - public void WhenPassingMultipleReferencesItRemovesThemAll() - { - var setup = Setup(); - var lib = NewLibWithFrameworks(setup.TestRoot); - var libref = AddLibRef(setup, lib); - var validref = AddValidRef(setup, lib); - - string outputText = $@"{string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, Path.Combine("Lib", setup.LibCsprojName))} -{string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, Path.Combine(setup.ValidRefCsprojRelPath))}"; - - int noCondBefore = lib.CsProj().NumberOfItemGroupsWithoutCondition(); - var cmd = new RemoveReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"\"{libref.CsProjPath}\" \"{validref.CsProjPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().BeVisuallyEquivalentTo(outputText); - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithoutCondition().Should().Be(noCondBefore - 1); - csproj.NumberOfProjectReferencesWithIncludeContaining(libref.Name).Should().Be(0); - csproj.NumberOfProjectReferencesWithIncludeContaining(validref.Name).Should().Be(0); - } - - [Fact] - public void WhenPassingMultipleReferencesAndOneOfThemDoesNotExistItRemovesOne() - { - var setup = Setup(); - var lib = NewLibWithFrameworks(setup.TestRoot); - var libref = GetLibRef(setup); - var validref = AddValidRef(setup, lib); - - string outputText = $@"{string.Format(CommonLocalizableStrings.ProjectReferenceCouldNotBeFound, setup.LibCsprojPath)} -{string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, Path.Combine(setup.ValidRefCsprojRelPath))}"; - - int noCondBefore = lib.CsProj().NumberOfItemGroupsWithoutCondition(); - var cmd = new RemoveReferenceCommand() - .WithWorkingDirectory(setup.TestRoot) - .WithProject(lib.CsProjPath) - .Execute($"\"{libref.CsProjPath}\" \"{validref.CsProjPath}\""); - cmd.Should().Pass(); - cmd.StdOut.Should().BeVisuallyEquivalentTo(outputText); - var csproj = lib.CsProj(); - csproj.NumberOfItemGroupsWithoutCondition().Should().Be(noCondBefore - 1); - csproj.NumberOfProjectReferencesWithIncludeContaining(validref.Name).Should().Be(0); - } - } -} diff --git a/test/dotnet-remove-reference.Tests/MSBuild.exe b/test/dotnet-remove-reference.Tests/MSBuild.exe deleted file mode 100644 index 2b4d0f999..000000000 --- a/test/dotnet-remove-reference.Tests/MSBuild.exe +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 \ No newline at end of file diff --git a/test/dotnet-remove-reference.Tests/MSBuild.exe.config b/test/dotnet-remove-reference.Tests/MSBuild.exe.config deleted file mode 100644 index 2b4d0f999..000000000 --- a/test/dotnet-remove-reference.Tests/MSBuild.exe.config +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 \ No newline at end of file diff --git a/test/dotnet-remove-reference.Tests/dotnet-remove-reference.Tests.csproj b/test/dotnet-remove-reference.Tests/dotnet-remove-reference.Tests.csproj deleted file mode 100644 index 4d571f9e4..000000000 --- a/test/dotnet-remove-reference.Tests/dotnet-remove-reference.Tests.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-remove-reference.Tests - ../../tools/Key.snk - true - true - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - - - - - - - - - - - - - - - - - diff --git a/test/dotnet-restore.Tests/GivenThatIWantToRestoreApp.cs b/test/dotnet-restore.Tests/GivenThatIWantToRestoreApp.cs deleted file mode 100644 index 40afaea2e..000000000 --- a/test/dotnet-restore.Tests/GivenThatIWantToRestoreApp.cs +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) .NET 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.Build.Construction; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; -using FluentAssertions; -using System.Linq; - -namespace Microsoft.DotNet.Restore.Tests -{ - public class GivenThatIWantToRestoreApp : TestBase - { - private static string RepoRootNuGetConfig = Path.Combine(RepoDirectoriesProvider.RepoRoot, "NuGet.Config"); - - [Fact] - public void ItRestoresAppToSpecificDirectory() - { - var rootPath = TestAssets.CreateTestDirectory().FullName; - - string dir = "pkgs"; - string fullPath = Path.GetFullPath(Path.Combine(rootPath, dir)); - - string newArgs = $"console -o \"{rootPath}\" --no-restore"; - new NewCommandShim() - .WithWorkingDirectory(rootPath) - .Execute(newArgs) - .Should() - .Pass(); - - string args = $"--configfile {RepoRootNuGetConfig} --packages \"{dir}\""; - new RestoreCommand() - .WithWorkingDirectory(rootPath) - .ExecuteWithCapturedOutput(args) - .Should() - .Pass() - .And.NotHaveStdErr(); - - Directory.Exists(fullPath).Should().BeTrue(); - Directory.EnumerateFiles(fullPath, "*.dll", SearchOption.AllDirectories).Count().Should().BeGreaterThan(0); - } - - [Fact] - public void ItRestoresLibToSpecificDirectory() - { - var rootPath = TestAssets.CreateTestDirectory().FullName; - - string dir = "pkgs"; - string fullPath = Path.GetFullPath(Path.Combine(rootPath, dir)); - - string newArgs = $"classlib -o \"{rootPath}\" --no-restore"; - new NewCommandShim() - .WithWorkingDirectory(rootPath) - .Execute(newArgs) - .Should() - .Pass(); - - string args = $"--configfile {RepoRootNuGetConfig} --packages \"{dir}\""; - new RestoreCommand() - .WithWorkingDirectory(rootPath) - .ExecuteWithCapturedOutput(args) - .Should() - .Pass() - .And.NotHaveStdErr(); - - Directory.Exists(fullPath).Should().BeTrue(); - Directory.EnumerateFiles(fullPath, "*.dll", SearchOption.AllDirectories).Count().Should().BeGreaterThan(0); - } - - [Fact] - public void ItRestoresTestAppToSpecificDirectory() - { - var rootPath = TestAssets.Get("VSTestCore").CreateInstance().WithSourceFiles().Root.FullName; - - string dir = "pkgs"; - string fullPath = Path.GetFullPath(Path.Combine(rootPath, dir)); - - string args = $"--configfile {RepoRootNuGetConfig} --packages \"{dir}\""; - new RestoreCommand() - .WithWorkingDirectory(rootPath) - .ExecuteWithCapturedOutput(args) - .Should() - .Pass() - .And.NotHaveStdErr(); - - Directory.Exists(fullPath).Should().BeTrue(); - Directory.EnumerateFiles(fullPath, "*.dll", SearchOption.AllDirectories).Count().Should().BeGreaterThan(0); - } - - [Fact] - public void ItRestoresWithTheSpecifiedVerbosity() - { - var rootPath = TestAssets.CreateTestDirectory().FullName; - - string dir = "pkgs"; - string fullPath = Path.GetFullPath(Path.Combine(rootPath, dir)); - - string newArgs = $"console -o \"{rootPath}\" --no-restore"; - new NewCommandShim() - .WithWorkingDirectory(rootPath) - .Execute(newArgs) - .Should() - .Pass(); - - string args = $"--configfile {RepoRootNuGetConfig} --packages \"{dir}\" --verbosity quiet"; - new RestoreCommand() - .WithWorkingDirectory(rootPath) - .ExecuteWithCapturedOutput(args) - .Should() - .Pass() - .And.NotHaveStdErr() - .And.NotHaveStdOut(); - } - } -} diff --git a/test/dotnet-restore.Tests/MSBuild.exe b/test/dotnet-restore.Tests/MSBuild.exe deleted file mode 100644 index 9bda258ef..000000000 --- a/test/dotnet-restore.Tests/MSBuild.exe +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 diff --git a/test/dotnet-restore.Tests/MSBuild.exe.config b/test/dotnet-restore.Tests/MSBuild.exe.config deleted file mode 100644 index 9bda258ef..000000000 --- a/test/dotnet-restore.Tests/MSBuild.exe.config +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 diff --git a/test/dotnet-restore.Tests/dotnet-restore.Tests.csproj b/test/dotnet-restore.Tests/dotnet-restore.Tests.csproj deleted file mode 100644 index f92bf8f68..000000000 --- a/test/dotnet-restore.Tests/dotnet-restore.Tests.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-restore.Tests - $(AssetTargetFallback);dnxcore50;portable-net45+win8 - - - - - - - - - - - - - - - - diff --git a/test/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs b/test/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs deleted file mode 100644 index 5fa67328e..000000000 --- a/test/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs +++ /dev/null @@ -1,522 +0,0 @@ -// Copyright (c) .NET 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 FluentAssertions; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; - -using LocalizableStrings = Microsoft.DotNet.Tools.Run.LocalizableStrings; - -namespace Microsoft.DotNet.Cli.Run.Tests -{ - public class GivenDotnetRunBuildsCsproj : TestBase - { - [Fact] - public void ItCanRunAMSBuildProject() - { - var testAppName = "MSBuildTestApp"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute("/p:SkipInvalidConfigurations=true") - .Should().Pass(); - - new BuildCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute() - .Should().Pass(); - - new RunCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput() - .Should().Pass() - .And.HaveStdOutContaining("Hello World!"); - } - - [Fact] - public void ItImplicitlyRestoresAProjectWhenRunning() - { - var testAppName = "MSBuildTestApp"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - new RunCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput() - .Should().Pass() - .And.HaveStdOutContaining("Hello World!"); - } - - [Fact] - public void ItCanRunAMultiTFMProjectWithImplicitRestore() - { - var testInstance = TestAssets.Get( - TestAssetKinds.DesktopTestProjects, - "NETFrameworkReferenceNETStandard20") - .CreateInstance() - .WithSourceFiles(); - - string projectDirectory = Path.Combine(testInstance.Root.FullName, "MultiTFMTestApp"); - - new RunCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("--framework netcoreapp2.0") - .Should().Pass() - .And.HaveStdOutContaining("This string came from the test library!"); - } - - [Fact] - public void ItDoesNotImplicitlyRestoreAProjectWhenRunningWithTheNoRestoreOption() - { - var testAppName = "MSBuildTestApp"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - new RunCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput("--no-restore") - .Should().Fail() - .And.HaveStdOutContaining("project.assets.json"); - } - - [Fact] - public void ItBuildsTheProjectBeforeRunning() - { - var testAppName = "MSBuildTestApp"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute("/p:SkipInvalidConfigurations=true") - .Should().Pass(); - - new RunCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput() - .Should().Pass() - .And.HaveStdOutContaining("Hello World!"); - } - - [Fact] - public void ItCanRunAMSBuildProjectWhenSpecifyingAFramework() - { - var testAppName = "MSBuildTestApp"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute("/p:SkipInvalidConfigurations=true") - .Should().Pass(); - - new RunCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput("--framework netcoreapp2.0") - .Should().Pass() - .And.HaveStdOutContaining("Hello World!"); - } - - [Fact] - public void ItRunsPortableAppsFromADifferentPathAfterBuilding() - { - var testInstance = TestAssets.Get("MSBuildTestApp") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - new BuildCommand() - .WithWorkingDirectory(testInstance.Root) - .Execute() - .Should().Pass(); - - new RunCommand() - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput($"--no-build") - .Should().Pass() - .And.HaveStdOutContaining("Hello World!"); - } - - [Fact] - public void ItRunsPortableAppsFromADifferentPathWithoutBuilding() - { - var testAppName = "MSBuildTestApp"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var projectFile = testInstance.Root.GetFile(testAppName + ".csproj"); - - new RunCommand() - .WithWorkingDirectory(testInstance.Root.Parent) - .ExecuteWithCapturedOutput($"--project {projectFile.FullName}") - .Should().Pass() - .And.HaveStdOutContaining("Hello World!"); - } - - [Fact] - public void ItRunsPortableAppsFromADifferentPathSpecifyingOnlyTheDirectoryWithoutBuilding() - { - var testAppName = "MSBuildTestApp"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - new RunCommand() - .WithWorkingDirectory(testInstance.Root.Parent) - .ExecuteWithCapturedOutput($"--project {testProjectDirectory}") - .Should().Pass() - .And.HaveStdOutContaining("Hello World!"); - } - - [Fact] - public void ItRunsAppWhenRestoringToSpecificPackageDirectory() - { - var rootPath = TestAssets.CreateTestDirectory().FullName; - - string dir = "pkgs"; - string args = $"--packages {dir}"; - - string newArgs = $"console -o \"{rootPath}\" --no-restore"; - new NewCommandShim() - .WithWorkingDirectory(rootPath) - .Execute(newArgs) - .Should() - .Pass(); - - new RestoreCommand() - .WithWorkingDirectory(rootPath) - .Execute(args) - .Should() - .Pass(); - - new RunCommand() - .WithWorkingDirectory(rootPath) - .ExecuteWithCapturedOutput("--no-restore") - .Should().Pass() - .And.HaveStdOutContaining("Hello World"); - } - - [Fact] - public void ItReportsAGoodErrorWhenProjectHasMultipleFrameworks() - { - var testAppName = "MSBuildAppWithMultipleFrameworks"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - // use --no-build so this test can run on all platforms. - // the test app targets net451, which can't be built on non-Windows - new RunCommand() - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput("--no-build") - .Should().Fail() - .And.HaveStdErrContaining("--framework"); - } - - [Fact] - public void ItCanPassArgumentsToSubjectAppByDoubleDash() - { - const string testAppName = "MSBuildTestApp"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - new RunCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput("-- foo bar baz") - .Should() - .Pass() - .And.HaveStdOutContaining("echo args:foo;bar;baz"); - } - - [Fact] - public void ItGivesAnErrorWhenAttemptingToUseALaunchProfileThatDoesNotExistWhenThereIsNoLaunchSettingsFile() - { - var testAppName = "MSBuildTestApp"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute("/p:SkipInvalidConfigurations=true") - .Should().Pass(); - - new BuildCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute() - .Should().Pass(); - - new RunCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput("--launch-profile test") - .Should().Pass() - .And.HaveStdOutContaining("Hello World!") - .And.HaveStdErrContaining(LocalizableStrings.RunCommandExceptionCouldNotLocateALaunchSettingsFile); - } - - [Fact] - public void ItUsesLaunchProfileOfTheSpecifiedName() - { - var testAppName = "AppWithLaunchSettings"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute("/p:SkipInvalidConfigurations=true") - .Should().Pass(); - - new BuildCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute() - .Should().Pass(); - - var cmd = new RunCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput("--launch-profile Second"); - - cmd.Should().Pass() - .And.HaveStdOutContaining("Second"); - - cmd.StdErr.Should().BeEmpty(); - } - - [Fact] - public void ItDefaultsToTheFirstUsableLaunchProfile() - { - var testAppName = "AppWithLaunchSettings"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute("/p:SkipInvalidConfigurations=true") - .Should().Pass(); - - new BuildCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute() - .Should().Pass(); - - var cmd = new RunCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput(); - - cmd.Should().Pass() - .And.HaveStdOutContaining("First"); - - cmd.StdErr.Should().BeEmpty(); - } - - [Fact] - public void ItGivesAnErrorWhenTheLaunchProfileNotFound() - { - var testAppName = "AppWithLaunchSettings"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute("/p:SkipInvalidConfigurations=true") - .Should().Pass(); - - new BuildCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute() - .Should().Pass(); - - new RunCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput("--launch-profile Third") - .Should().Pass() - .And.HaveStdOutContaining("(NO MESSAGE)") - .And.HaveStdErrContaining(string.Format(LocalizableStrings.RunCommandExceptionCouldNotApplyLaunchSettings, "Third", "").Trim()); - } - - [Fact] - public void ItGivesAnErrorWhenTheLaunchProfileCanNotBeHandled() - { - var testAppName = "AppWithLaunchSettings"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute("/p:SkipInvalidConfigurations=true") - .Should().Pass(); - - new BuildCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute() - .Should().Pass(); - - new RunCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput("--launch-profile \"IIS Express\"") - .Should().Pass() - .And.HaveStdOutContaining("(NO MESSAGE)") - .And.HaveStdErrContaining(string.Format(LocalizableStrings.RunCommandExceptionCouldNotApplyLaunchSettings, "IIS Express", "").Trim()); - } - - [Fact] - public void ItSkipsLaunchProfilesWhenTheSwitchIsSupplied() - { - var testAppName = "AppWithLaunchSettings"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute("/p:SkipInvalidConfigurations=true") - .Should().Pass(); - - new BuildCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute() - .Should().Pass(); - - var cmd = new RunCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput("--no-launch-profile"); - - cmd.Should().Pass() - .And.HaveStdOutContaining("(NO MESSAGE)"); - - cmd.StdErr.Should().BeEmpty(); - } - - [Fact] - public void ItSkipsLaunchProfilesWhenTheSwitchIsSuppliedWithoutErrorWhenThereAreNoLaunchSettings() - { - var testAppName = "MSBuildTestApp"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute("/p:SkipInvalidConfigurations=true") - .Should().Pass(); - - new BuildCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute() - .Should().Pass(); - - var cmd = new RunCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput("--no-launch-profile"); - - cmd.Should().Pass() - .And.HaveStdOutContaining("Hello World!"); - - cmd.StdErr.Should().BeEmpty(); - } - - [Fact] - public void ItSkipsLaunchProfilesWhenThereIsNoUsableDefault() - { - var testAppName = "AppWithLaunchSettingsNoDefault"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute("/p:SkipInvalidConfigurations=true") - .Should().Pass(); - - new BuildCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute() - .Should().Pass(); - - var cmd = new RunCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput(); - - cmd.Should().Pass() - .And.HaveStdOutContaining("(NO MESSAGE)") - .And.HaveStdErrContaining(string.Format(LocalizableStrings.RunCommandExceptionCouldNotApplyLaunchSettings, LocalizableStrings.DefaultLaunchProfileDisplayName, "").Trim()); - } - - [Fact] - public void ItPrintsAnErrorWhenLaunchSettingsAreCorrupted() - { - var testAppName = "AppWithCorruptedLaunchSettings"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute("/p:SkipInvalidConfigurations=true") - .Should().Pass(); - - new BuildCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute() - .Should().Pass(); - - var cmd = new RunCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput(); - - cmd.Should().Pass() - .And.HaveStdOutContaining("(NO MESSAGE)") - .And.HaveStdErrContaining(string.Format(LocalizableStrings.RunCommandExceptionCouldNotApplyLaunchSettings, LocalizableStrings.DefaultLaunchProfileDisplayName, "").Trim()); - } - } -} diff --git a/test/dotnet-run.Tests/GivenThatWeCanPassNonProjectFilesToDotnetRun.cs b/test/dotnet-run.Tests/GivenThatWeCanPassNonProjectFilesToDotnetRun.cs deleted file mode 100644 index fafb147be..000000000 --- a/test/dotnet-run.Tests/GivenThatWeCanPassNonProjectFilesToDotnetRun.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.IO; -using FluentAssertions; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; - -namespace Microsoft.DotNet.Cli.Run.Tests -{ - public class GivenThatWeCanPassNonProjectFilesToDotnetRun : TestBase - { - [Fact] - public void ItFailsWithAnAppropriateErrorMessage() - { - var projectDirectory = TestAssets - .Get("SlnFileWithNoProjectReferences") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var slnFullPath = Path.Combine(projectDirectory, "SlnFileWithNoProjectReferences.sln"); - - new RunCommand() - .ExecuteWithCapturedOutput($"-p {slnFullPath}") - .Should().Fail() - .And.HaveStdErrContaining( - string.Format( - Microsoft.DotNet.Tools.Run.LocalizableStrings.RunCommandSpecifiecFileIsNotAValidProject, - slnFullPath)); - } - } -} \ No newline at end of file diff --git a/test/dotnet-run.Tests/dotnet-run.Tests.csproj b/test/dotnet-run.Tests/dotnet-run.Tests.csproj deleted file mode 100644 index e00d11b48..000000000 --- a/test/dotnet-run.Tests/dotnet-run.Tests.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-run.Tests - ../../tools/Key.snk - true - true - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - - - - - - - - - - - - - diff --git a/test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs b/test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs deleted file mode 100644 index 3d245115f..000000000 --- a/test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs +++ /dev/null @@ -1,718 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using FluentAssertions; -using Microsoft.Build.Construction; -using Microsoft.DotNet.Cli.Sln.Internal; -using Microsoft.DotNet.Tools; -using Microsoft.DotNet.Tools.Test.Utilities; -using System; -using System.IO; -using System.Linq; -using Xunit; -using Xunit.Abstractions; - -namespace Microsoft.DotNet.Cli.Sln.Add.Tests -{ - public class GivenDotnetSlnAdd : TestBase - { - private string HelpText = @"Usage: dotnet sln add [options] - -Arguments: - Solution file to operate on. If not specified, the command will search the current directory for one. - Add one or more specified projects to the solution. - -Options: - -h, --help Show help information. -"; - - private const string SlnCommandHelpText = @"Usage: dotnet sln [options] [command] - -Arguments: - Solution file to operate on. If not specified, the command will search the current directory for one. - -Options: - -h, --help Show help information. - -Commands: - add .NET Add project(s) to a solution file Command - list .NET List project(s) in a solution file Command - remove .NET Remove project(s) from a solution file Command -"; - - private ITestOutputHelper _output; - - public GivenDotnetSlnAdd(ITestOutputHelper output) - { - _output = output; - } - - private const string ExpectedSlnFileAfterAddingLibProj = @" -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""App"", ""App\App.csproj"", ""{7072A694-548F-4CAE-A58F-12D257D5F486}"" -EndProject -Project(""{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"") = ""Lib"", ""Lib\Lib.csproj"", ""__LIB_PROJECT_GUID__"" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86 - __LIB_PROJECT_GUID__.Debug|Any CPU.ActiveCfg = Debug|Any CPU - __LIB_PROJECT_GUID__.Debug|Any CPU.Build.0 = Debug|Any CPU - __LIB_PROJECT_GUID__.Debug|x64.ActiveCfg = Debug|x64 - __LIB_PROJECT_GUID__.Debug|x64.Build.0 = Debug|x64 - __LIB_PROJECT_GUID__.Debug|x86.ActiveCfg = Debug|x86 - __LIB_PROJECT_GUID__.Debug|x86.Build.0 = Debug|x86 - __LIB_PROJECT_GUID__.Release|Any CPU.ActiveCfg = Release|Any CPU - __LIB_PROJECT_GUID__.Release|Any CPU.Build.0 = Release|Any CPU - __LIB_PROJECT_GUID__.Release|x64.ActiveCfg = Release|x64 - __LIB_PROJECT_GUID__.Release|x64.Build.0 = Release|x64 - __LIB_PROJECT_GUID__.Release|x86.ActiveCfg = Release|x86 - __LIB_PROJECT_GUID__.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal -"; - - private const string ExpectedSlnFileAfterAddingLibProjToEmptySln = @" -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project(""{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"") = ""Lib"", ""Lib\Lib.csproj"", ""__LIB_PROJECT_GUID__"" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - __LIB_PROJECT_GUID__.Debug|Any CPU.ActiveCfg = Debug|Any CPU - __LIB_PROJECT_GUID__.Debug|Any CPU.Build.0 = Debug|Any CPU - __LIB_PROJECT_GUID__.Debug|x64.ActiveCfg = Debug|x64 - __LIB_PROJECT_GUID__.Debug|x64.Build.0 = Debug|x64 - __LIB_PROJECT_GUID__.Debug|x86.ActiveCfg = Debug|x86 - __LIB_PROJECT_GUID__.Debug|x86.Build.0 = Debug|x86 - __LIB_PROJECT_GUID__.Release|Any CPU.ActiveCfg = Release|Any CPU - __LIB_PROJECT_GUID__.Release|Any CPU.Build.0 = Release|Any CPU - __LIB_PROJECT_GUID__.Release|x64.ActiveCfg = Release|x64 - __LIB_PROJECT_GUID__.Release|x64.Build.0 = Release|x64 - __LIB_PROJECT_GUID__.Release|x86.ActiveCfg = Release|x86 - __LIB_PROJECT_GUID__.Release|x86.Build.0 = Release|x86 - EndGlobalSection -EndGlobal -"; - - private const string ExpectedSlnFileAfterAddingNestedProj = @" -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""App"", ""App.csproj"", ""{7072A694-548F-4CAE-A58F-12D257D5F486}"" -EndProject -Project(""{2150E333-8FDC-42A3-9474-1A3956D46DE8}"") = ""src"", ""src"", ""__SRC_FOLDER_GUID__"" -EndProject -Project(""{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"") = ""Lib"", ""src\Lib\Lib.csproj"", ""__LIB_PROJECT_GUID__"" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86 - __LIB_PROJECT_GUID__.Debug|Any CPU.ActiveCfg = Debug|Any CPU - __LIB_PROJECT_GUID__.Debug|Any CPU.Build.0 = Debug|Any CPU - __LIB_PROJECT_GUID__.Debug|x64.ActiveCfg = Debug|x64 - __LIB_PROJECT_GUID__.Debug|x64.Build.0 = Debug|x64 - __LIB_PROJECT_GUID__.Debug|x86.ActiveCfg = Debug|x86 - __LIB_PROJECT_GUID__.Debug|x86.Build.0 = Debug|x86 - __LIB_PROJECT_GUID__.Release|Any CPU.ActiveCfg = Release|Any CPU - __LIB_PROJECT_GUID__.Release|Any CPU.Build.0 = Release|Any CPU - __LIB_PROJECT_GUID__.Release|x64.ActiveCfg = Release|x64 - __LIB_PROJECT_GUID__.Release|x64.Build.0 = Release|x64 - __LIB_PROJECT_GUID__.Release|x86.ActiveCfg = Release|x86 - __LIB_PROJECT_GUID__.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - __LIB_PROJECT_GUID__ = __SRC_FOLDER_GUID__ - EndGlobalSection -EndGlobal -"; - - [Theory] - [InlineData("--help")] - [InlineData("-h")] - [InlineData("-?")] - [InlineData("/?")] - public void WhenHelpOptionIsPassedItPrintsUsage(string helpArg) - { - var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"sln add {helpArg}"); - cmd.Should().Pass(); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Theory] - [InlineData("")] - [InlineData("unknownCommandName")] - public void WhenNoCommandIsPassedItPrintsError(string commandName) - { - var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"sln {commandName}"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(CommonLocalizableStrings.RequiredCommandNotPassed); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(SlnCommandHelpText); - } - - [Fact] - public void WhenTooManyArgumentsArePassedItPrintsError() - { - var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput("sln one.sln two.sln three.sln add"); - cmd.Should().Fail(); - cmd.StdErr.Should().BeVisuallyEquivalentTo($@"{string.Format(CommandLine.LocalizableStrings.UnrecognizedCommandOrArgument, "two.sln")} -{string.Format(CommandLine.LocalizableStrings.UnrecognizedCommandOrArgument, "three.sln")} -{CommonLocalizableStrings.SpecifyAtLeastOneProjectToAdd}"); - } - - [Theory] - [InlineData("idontexist.sln")] - [InlineData("ihave?invalidcharacters")] - [InlineData("ihaveinv@lidcharacters")] - [InlineData("ihaveinvalid/characters")] - [InlineData("ihaveinvalidchar\\acters")] - public void WhenNonExistingSolutionIsPassedItPrintsErrorAndUsage(string solutionName) - { - var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"sln {solutionName} add p.csproj"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.CouldNotFindSolutionOrDirectory, solutionName)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenInvalidSolutionIsPassedItPrintsErrorAndUsage() - { - var projectDirectory = TestAssets - .Get("InvalidSolution") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var projectToAdd = Path.Combine("Lib", "Lib.csproj"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln InvalidSolution.sln add {projectToAdd}"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.InvalidSolutionFormatString, "InvalidSolution.sln", LocalizableStrings.FileHeaderMissingError)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenInvalidSolutionIsFoundItPrintsErrorAndUsage() - { - var projectDirectory = TestAssets - .Get("InvalidSolution") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var solutionPath = Path.Combine(projectDirectory, "InvalidSolution.sln"); - var projectToAdd = Path.Combine("Lib", "Lib.csproj"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln add {projectToAdd}"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.InvalidSolutionFormatString, solutionPath, LocalizableStrings.FileHeaderMissingError)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenNoProjectIsPassedItPrintsErrorAndUsage() - { - var projectDirectory = TestAssets - .Get("TestAppWithSlnAndCsprojFiles") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput(@"sln App.sln add"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(CommonLocalizableStrings.SpecifyAtLeastOneProjectToAdd); - - _output.WriteLine("[STD OUT]"); - _output.WriteLine(cmd.StdOut); - _output.WriteLine("[HelpText]"); - _output.WriteLine(HelpText); - - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenNoSolutionExistsInTheDirectoryItPrintsErrorAndUsage() - { - var projectDirectory = TestAssets - .Get("TestAppWithSlnAndCsprojFiles") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var solutionPath = Path.Combine(projectDirectory, "App"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(solutionPath) - .ExecuteWithCapturedOutput(@"sln add App.csproj"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.SolutionDoesNotExist, solutionPath + Path.DirectorySeparatorChar)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenMoreThanOneSolutionExistsInTheDirectoryItPrintsErrorAndUsage() - { - var projectDirectory = TestAssets - .Get("TestAppWithMultipleSlnFiles") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var projectToAdd = Path.Combine("Lib", "Lib.csproj"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln add {projectToAdd}"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.MoreThanOneSolutionInDirectory, projectDirectory + Path.DirectorySeparatorChar)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenNestedProjectIsAddedSolutionFoldersAreCreated() - { - var projectDirectory = TestAssets - .Get("TestAppWithSlnAndCsprojInSubDir") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var projectToAdd = Path.Combine("src", "Lib", "Lib.csproj"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln App.sln add {projectToAdd}"); - cmd.Should().Pass(); - - var slnPath = Path.Combine(projectDirectory, "App.sln"); - var expectedSlnContents = GetExpectedSlnContents(slnPath, ExpectedSlnFileAfterAddingNestedProj); - File.ReadAllText(slnPath) - .Should().BeVisuallyEquivalentTo(expectedSlnContents); - } - - [Fact] - public void WhenProjectDirectoryIsAddedSolutionFoldersAreNotCreated() - { - var projectDirectory = TestAssets - .Get("TestAppWithSlnAndCsprojFiles") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var projectToAdd = Path.Combine("Lib", "Lib.csproj"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln App.sln add {projectToAdd}"); - cmd.Should().Pass(); - - var slnFile = SlnFile.Read(Path.Combine(projectDirectory, "App.sln")); - var solutionFolderProjects = slnFile.Projects.Where( - p => p.TypeGuid == ProjectTypeGuids.SolutionFolderGuid); - solutionFolderProjects.Count().Should().Be(0); - slnFile.Sections.GetSection("NestedProjects").Should().BeNull(); - } - - [Theory] - [InlineData(".")] - [InlineData("")] - public void WhenSolutionFolderExistsItDoesNotGetAdded(string firstComponent) - { - var projectDirectory = TestAssets - .Get("TestAppWithSlnAndSolutionFolders") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var projectToAdd = Path.Combine($"{firstComponent}", "src", "src", "Lib", "Lib.csproj"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln App.sln add {projectToAdd}"); - cmd.Should().Pass(); - - var slnFile = SlnFile.Read(Path.Combine(projectDirectory, "App.sln")); - slnFile.Projects.Count().Should().Be(4); - - var solutionFolderProjects = slnFile.Projects.Where( - p => p.TypeGuid == ProjectTypeGuids.SolutionFolderGuid); - solutionFolderProjects.Count().Should().Be(2); - - var solutionFolders = slnFile.Sections.GetSection("NestedProjects").Properties; - solutionFolders.Count.Should().Be(3); - - solutionFolders["{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}"] - .Should().Be("{72BFCA87-B033-4721-8712-4D12166B4A39}"); - - var newlyAddedSrcFolder = solutionFolderProjects.Where( - p => p.Id != "{72BFCA87-B033-4721-8712-4D12166B4A39}").Single(); - solutionFolders[newlyAddedSrcFolder.Id] - .Should().Be("{72BFCA87-B033-4721-8712-4D12166B4A39}"); - - var libProject = slnFile.Projects.Where(p => p.Name == "Lib").Single(); - solutionFolders[libProject.Id] - .Should().Be(newlyAddedSrcFolder.Id); - } - - [Theory] - [InlineData("TestAppWithSlnAndCsprojFiles", ExpectedSlnFileAfterAddingLibProj, "")] - [InlineData("TestAppWithSlnAndCsprojProjectGuidFiles", ExpectedSlnFileAfterAddingLibProj, "{84A45D44-B677-492D-A6DA-B3A71135AB8E}")] - [InlineData("TestAppWithEmptySln", ExpectedSlnFileAfterAddingLibProjToEmptySln, "")] - public void WhenValidProjectIsPassedBuildConfigsAreAdded( - string testAsset, - string expectedSlnContentsTemplate, - string expectedProjectGuid) - { - var projectDirectory = TestAssets - .Get(testAsset) - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var projectToAdd = "Lib/Lib.csproj"; - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln App.sln add {projectToAdd}"); - cmd.Should().Pass(); - - var slnPath = Path.Combine(projectDirectory, "App.sln"); - - var expectedSlnContents = GetExpectedSlnContents( - slnPath, - expectedSlnContentsTemplate, - expectedProjectGuid); - - File.ReadAllText(slnPath) - .Should().BeVisuallyEquivalentTo(expectedSlnContents); - } - - [Theory] - [InlineData("TestAppWithSlnAndCsprojFiles")] - [InlineData("TestAppWithSlnAndCsprojProjectGuidFiles")] - [InlineData("TestAppWithEmptySln")] - public void WhenValidProjectIsPassedItGetsAdded(string testAsset) - { - var projectDirectory = TestAssets - .Get(testAsset) - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var projectToAdd = "Lib/Lib.csproj"; - var projectPath = Path.Combine("Lib", "Lib.csproj"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln App.sln add {projectToAdd}"); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ProjectAddedToTheSolution, projectPath)); - cmd.StdErr.Should().BeEmpty(); - } - - [Theory] - [InlineData("TestAppWithSlnAndCsprojFiles")] - [InlineData("TestAppWithSlnAndCsprojProjectGuidFiles")] - [InlineData("TestAppWithEmptySln")] - public void WhenInvalidProjectIsPassedItDoesNotGetAdded(string testAsset) - { - var projectDirectory = TestAssets - .Get(testAsset) - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var projectToAdd = "Lib/Library.cs"; - var projectPath = Path.Combine("Lib", "Library.cs"); - var slnFile = SlnFile.Read(Path.Combine(projectDirectory, "App.sln")); - var expectedNumberOfProjects = slnFile.Projects.Count(); - - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln App.sln add {projectToAdd}"); - cmd.Should().Pass(); - cmd.StdOut.Should().BeEmpty(); - cmd.StdErr.Should().Match(string.Format(CommonLocalizableStrings.InvalidProjectWithExceptionMessage, '*', '*')); - - slnFile = SlnFile.Read(Path.Combine(projectDirectory, "App.sln")); - slnFile.Projects.Count().Should().Be(expectedNumberOfProjects); - } - - [Theory] - [InlineData("TestAppWithSlnAndCsprojFiles")] - [InlineData("TestAppWithSlnAndCsprojProjectGuidFiles")] - [InlineData("TestAppWithEmptySln")] - public void WhenValidProjectIsPassedTheSlnBuilds(string testAsset) - { - var projectDirectory = TestAssets - .Get(testAsset) - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput(@"sln App.sln add App/App.csproj Lib/Lib.csproj"); - cmd.Should().Pass(); - - var slnPath = Path.Combine(projectDirectory, "App.sln"); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute($"restore App.sln") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("build App.sln --configuration Release") - .Should().Pass(); - - var reasonString = "should be built in release mode, otherwise it means build configurations are missing from the sln file"; - - var appReleaseDirectory = Directory.EnumerateDirectories( - Path.Combine(projectDirectory, "App", "bin"), - "Release", - SearchOption.AllDirectories); - appReleaseDirectory.Count().Should().Be(1, $"App {reasonString}"); - Directory.EnumerateFiles(appReleaseDirectory.Single(), "App.dll", SearchOption.AllDirectories) - .Count().Should().Be(1, $"App {reasonString}"); - - var libReleaseDirectory = Directory.EnumerateDirectories( - Path.Combine(projectDirectory, "Lib", "bin"), - "Release", - SearchOption.AllDirectories); - libReleaseDirectory.Count().Should().Be(1, $"Lib {reasonString}"); - Directory.EnumerateFiles(libReleaseDirectory.Single(), "Lib.dll", SearchOption.AllDirectories) - .Count().Should().Be(1, $"Lib {reasonString}"); - } - - [Theory] - [InlineData("TestAppWithSlnAndExistingCsprojReferences")] - [InlineData("TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep")] - public void WhenSolutionAlreadyContainsProjectItDoesntDuplicate(string testAsset) - { - var projectDirectory = TestAssets - .Get(testAsset) - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var solutionPath = Path.Combine(projectDirectory, "App.sln"); - var projectToAdd = Path.Combine("Lib", "Lib.csproj"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln App.sln add {projectToAdd}"); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.SolutionAlreadyContainsProject, solutionPath, projectToAdd)); - cmd.StdErr.Should().BeEmpty(); - } - - [Fact] - public void WhenPassedMultipleProjectsAndOneOfthemDoesNotExistItCancelsWholeOperation() - { - var projectDirectory = TestAssets - .Get("TestAppWithSlnAndCsprojFiles") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var slnFullPath = Path.Combine(projectDirectory, "App.sln"); - var contentBefore = File.ReadAllText(slnFullPath); - - var projectToAdd = Path.Combine("Lib", "Lib.csproj"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln App.sln add {projectToAdd} idonotexist.csproj"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.ProjectDoesNotExist, "idonotexist.csproj")); - - File.ReadAllText(slnFullPath) - .Should().BeVisuallyEquivalentTo(contentBefore); - } - - //ISSUE: https://github.com/dotnet/sdk/issues/522 - //[Fact] - public void WhenPassedAnUnknownProjectTypeItFails() - { - var projectDirectory = TestAssets - .Get("SlnFileWithNoProjectReferencesAndUnknownProject") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var slnFullPath = Path.Combine(projectDirectory, "App.sln"); - var contentBefore = File.ReadAllText(slnFullPath); - - var projectToAdd = Path.Combine("UnknownProject", "UnknownProject.unknownproj"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln App.sln add {projectToAdd}"); - cmd.Should().Fail(); - cmd.StdErr.Should().BeVisuallyEquivalentTo("Unsupported project type. Please check with your sdk provider."); - - File.ReadAllText(slnFullPath) - .Should().BeVisuallyEquivalentTo(contentBefore); - } - - [Theory] - //ISSUE: https://github.com/dotnet/sdk/issues/522 - //[InlineData("SlnFileWithNoProjectReferencesAndCSharpProject", "CSharpProject", "CSharpProject.csproj", ProjectTypeGuids.CSharpProjectTypeGuid)] - //[InlineData("SlnFileWithNoProjectReferencesAndFSharpProject", "FSharpProject", "FSharpProject.fsproj", "{F2A71F9B-5D33-465A-A702-920D77279786}")] - //[InlineData("SlnFileWithNoProjectReferencesAndVBProject", "VBProject", "VBProject.vbproj", "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}")] - [InlineData("SlnFileWithNoProjectReferencesAndUnknownProjectWithSingleProjectTypeGuid", "UnknownProject", "UnknownProject.unknownproj", "{130159A9-F047-44B3-88CF-0CF7F02ED50F}")] - [InlineData("SlnFileWithNoProjectReferencesAndUnknownProjectWithMultipleProjectTypeGuids", "UnknownProject", "UnknownProject.unknownproj", "{130159A9-F047-44B3-88CF-0CF7F02ED50F}")] - public void WhenPassedAProjectItAddsCorrectProjectTypeGuid( - string testAsset, - string projectDir, - string projectName, - string expectedTypeGuid) - { - var projectDirectory = TestAssets - .Get(testAsset) - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var projectToAdd = Path.Combine(projectDir, projectName); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln App.sln add {projectToAdd}"); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ProjectAddedToTheSolution, projectToAdd)); - cmd.StdErr.Should().BeEmpty(); - - var slnFile = SlnFile.Read(Path.Combine(projectDirectory, "App.sln")); - var nonSolutionFolderProjects = slnFile.Projects.Where( - p => p.TypeGuid != ProjectTypeGuids.SolutionFolderGuid); - nonSolutionFolderProjects.Count().Should().Be(1); - nonSolutionFolderProjects.Single().TypeGuid.Should().Be(expectedTypeGuid); - } - - [Fact] - private void WhenSlnContainsSolutionFolderWithDifferentCasingItDoesNotCreateDuplicate() - { - var projectDirectory = TestAssets - .Get("TestAppWithSlnAndCaseSensitiveSolutionFolders") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var projectToAdd = Path.Combine("src", "Lib", "Lib.csproj"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute($"sln App.sln add {projectToAdd}"); - cmd.Should().Pass(); - - var slnFile = SlnFile.Read(Path.Combine(projectDirectory, "App.sln")); - var solutionFolderProjects = slnFile.Projects.Where( - p => p.TypeGuid == ProjectTypeGuids.SolutionFolderGuid); - solutionFolderProjects.Count().Should().Be(1); - } - - private string GetExpectedSlnContents( - string slnPath, - string slnTemplate, - string expectedLibProjectGuid = null) - { - var slnFile = SlnFile.Read(slnPath); - - if (string.IsNullOrEmpty(expectedLibProjectGuid)) - { - var matchingProjects = slnFile.Projects - .Where((p) => p.FilePath.EndsWith("Lib.csproj")) - .ToList(); - - matchingProjects.Count.Should().Be(1); - var slnProject = matchingProjects[0]; - expectedLibProjectGuid = slnProject.Id; - } - var slnContents = slnTemplate.Replace("__LIB_PROJECT_GUID__", expectedLibProjectGuid); - - var matchingSrcFolder = slnFile.Projects - .Where((p) => p.FilePath == "src") - .ToList(); - if (matchingSrcFolder.Count == 1) - { - slnContents = slnContents.Replace("__SRC_FOLDER_GUID__", matchingSrcFolder[0].Id); - } - - return slnContents; - } - } -} diff --git a/test/dotnet-sln-add.Tests/MSBuild.exe b/test/dotnet-sln-add.Tests/MSBuild.exe deleted file mode 100644 index 9bda258ef..000000000 --- a/test/dotnet-sln-add.Tests/MSBuild.exe +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 diff --git a/test/dotnet-sln-add.Tests/MSBuild.exe.config b/test/dotnet-sln-add.Tests/MSBuild.exe.config deleted file mode 100644 index 9bda258ef..000000000 --- a/test/dotnet-sln-add.Tests/MSBuild.exe.config +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 diff --git a/test/dotnet-sln-add.Tests/dotnet-sln-add.Tests.csproj b/test/dotnet-sln-add.Tests/dotnet-sln-add.Tests.csproj deleted file mode 100644 index 1095e98a4..000000000 --- a/test/dotnet-sln-add.Tests/dotnet-sln-add.Tests.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-sln-add.Tests - ../../tools/Key.snk - true - true - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - - - - - - - - - - - - - - - - - - diff --git a/test/dotnet-sln-list.Tests/GivenDotnetSlnList.cs b/test/dotnet-sln-list.Tests/GivenDotnetSlnList.cs deleted file mode 100644 index fdc2d9a55..000000000 --- a/test/dotnet-sln-list.Tests/GivenDotnetSlnList.cs +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using FluentAssertions; -using Microsoft.DotNet.Cli.Sln.Internal; -using Microsoft.DotNet.Tools; -using Microsoft.DotNet.Tools.Test.Utilities; -using System; -using System.IO; -using System.Linq; -using Xunit; - -namespace Microsoft.DotNet.Cli.Sln.List.Tests -{ - public class GivenDotnetSlnList : TestBase - { - private const string HelpText = @"Usage: dotnet sln list [options] - -Arguments: - Solution file to operate on. If not specified, the command will search the current directory for one. - -Options: - -h, --help Show help information. -"; - - private const string SlnCommandHelpText = @"Usage: dotnet sln [options] [command] - -Arguments: - Solution file to operate on. If not specified, the command will search the current directory for one. - -Options: - -h, --help Show help information. - -Commands: - add .NET Add project(s) to a solution file Command - list .NET List project(s) in a solution file Command - remove .NET Remove project(s) from a solution file Command -"; - - [Theory] - [InlineData("--help")] - [InlineData("-h")] - public void WhenHelpOptionIsPassedItPrintsUsage(string helpArg) - { - var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"sln list {helpArg}"); - cmd.Should().Pass(); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Theory] - [InlineData("")] - [InlineData("unknownCommandName")] - public void WhenNoCommandIsPassedItPrintsError(string commandName) - { - var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"sln {commandName}"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(CommonLocalizableStrings.RequiredCommandNotPassed); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(SlnCommandHelpText); - } - - [Fact] - public void WhenTooManyArgumentsArePassedItPrintsError() - { - var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput("sln one.sln two.sln three.sln list"); - cmd.Should().Fail(); - cmd.StdErr.Should().BeVisuallyEquivalentTo($@"{string.Format(CommandLine.LocalizableStrings.UnrecognizedCommandOrArgument, "two.sln")} -{string.Format(CommandLine.LocalizableStrings.UnrecognizedCommandOrArgument, "three.sln")}"); - } - - [Theory] - [InlineData("idontexist.sln")] - [InlineData("ihave?invalidcharacters.sln")] - [InlineData("ihaveinv@lidcharacters.sln")] - [InlineData("ihaveinvalid/characters")] - [InlineData("ihaveinvalidchar\\acters")] - public void WhenNonExistingSolutionIsPassedItPrintsErrorAndUsage(string solutionName) - { - var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"sln {solutionName} list"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.CouldNotFindSolutionOrDirectory, solutionName)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenInvalidSolutionIsPassedItPrintsErrorAndUsage() - { - var projectDirectory = TestAssets - .Get("InvalidSolution") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("sln InvalidSolution.sln list"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.InvalidSolutionFormatString, "InvalidSolution.sln", LocalizableStrings.FileHeaderMissingError)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenInvalidSolutionIsFoundItPrintsErrorAndUsage() - { - var projectDirectory = TestAssets - .Get("InvalidSolution") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var solutionFullPath = Path.Combine(projectDirectory, "InvalidSolution.sln"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("sln list"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.InvalidSolutionFormatString, solutionFullPath, LocalizableStrings.FileHeaderMissingError)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenNoSolutionExistsInTheDirectoryItPrintsErrorAndUsage() - { - var projectDirectory = TestAssets - .Get("TestAppWithSlnAndCsprojFiles") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var solutionDir = Path.Combine(projectDirectory, "App"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(solutionDir) - .ExecuteWithCapturedOutput("sln list"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.SolutionDoesNotExist, solutionDir + Path.DirectorySeparatorChar)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenMoreThanOneSolutionExistsInTheDirectoryItPrintsErrorAndUsage() - { - var projectDirectory = TestAssets - .Get("TestAppWithMultipleSlnFiles") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("sln list"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.MoreThanOneSolutionInDirectory, projectDirectory + Path.DirectorySeparatorChar)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenNoProjectReferencesArePresentInTheSolutionItPrintsANoProjectMessage() - { - var projectDirectory = TestAssets - .Get("TestAppWithEmptySln") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("sln list"); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(CommonLocalizableStrings.NoProjectsFound); - } - - [Fact] - public void WhenProjectReferencesArePresentInTheSolutionItListsThem() - { - string OutputText = CommonLocalizableStrings.ProjectReferenceOneOrMore; - OutputText += $@" -{new string('-', OutputText.Length)} -{Path.Combine("App", "App.csproj")} -{Path.Combine("Lib", "Lib.csproj")}"; - - var projectDirectory = TestAssets - .Get("TestAppWithSlnAndExistingCsprojReferences") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("sln list"); - cmd.Should().Pass(); - cmd.StdOut.Should().BeVisuallyEquivalentTo(OutputText); - } - } -} diff --git a/test/dotnet-sln-list.Tests/MSBuild.exe b/test/dotnet-sln-list.Tests/MSBuild.exe deleted file mode 100644 index 9bda258ef..000000000 --- a/test/dotnet-sln-list.Tests/MSBuild.exe +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 diff --git a/test/dotnet-sln-list.Tests/MSBuild.exe.config b/test/dotnet-sln-list.Tests/MSBuild.exe.config deleted file mode 100644 index 9bda258ef..000000000 --- a/test/dotnet-sln-list.Tests/MSBuild.exe.config +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 diff --git a/test/dotnet-sln-list.Tests/dotnet-sln-list.Tests.csproj b/test/dotnet-sln-list.Tests/dotnet-sln-list.Tests.csproj deleted file mode 100644 index 7ecf5b2a4..000000000 --- a/test/dotnet-sln-list.Tests/dotnet-sln-list.Tests.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-sln-list.Tests - ../../tools/Key.snk - true - true - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - - - - - - - - - - - - - - - - - diff --git a/test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs b/test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs deleted file mode 100644 index 78f64b25f..000000000 --- a/test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs +++ /dev/null @@ -1,560 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using FluentAssertions; -using Microsoft.DotNet.Cli.Sln.Internal; -using Microsoft.DotNet.Tools; -using Microsoft.DotNet.Tools.Test.Utilities; -using System; -using System.IO; -using System.Linq; -using Xunit; - -namespace Microsoft.DotNet.Cli.Sln.Remove.Tests -{ - public class GivenDotnetSlnRemove : TestBase - { - private const string HelpText = @"Usage: dotnet sln remove [options] - -Arguments: - Solution file to operate on. If not specified, the command will search the current directory for one. - Remove the specified project(s) from the solution. The project is not impacted. - -Options: - -h, --help Show help information. -"; - - private const string SlnCommandHelpText = @"Usage: dotnet sln [options] [command] - -Arguments: - Solution file to operate on. If not specified, the command will search the current directory for one. - -Options: - -h, --help Show help information. - -Commands: - add .NET Add project(s) to a solution file Command - list .NET List project(s) in a solution file Command - remove .NET Remove project(s) from a solution file Command -"; - - private const string ExpectedSlnContentsAfterRemove = @" -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""App"", ""App\App.csproj"", ""{7072A694-548F-4CAE-A58F-12D257D5F486}"" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86 - EndGlobalSection -EndGlobal -"; - - private const string ExpectedSlnContentsAfterRemoveAllProjects = @" -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Global -EndGlobal -"; - - private const string ExpectedSlnContentsAfterRemoveNestedProj = @" -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""App"", ""App.csproj"", ""{7072A694-548F-4CAE-A58F-12D257D5F486}"" -EndProject -Project(""{2150E333-8FDC-42A3-9474-1A3956D46DE8}"") = ""src"", ""src"", ""{7B86CE74-F620-4B32-99FE-82D40F8D6BF2}"" -EndProject -Project(""{2150E333-8FDC-42A3-9474-1A3956D46DE8}"") = ""Lib"", ""Lib"", ""{EAB71280-AF32-4531-8703-43CDBA261AA3}"" -EndProject -Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""Lib"", ""src\Lib\Lib.csproj"", ""{84A45D44-B677-492D-A6DA-B3A71135AB8E}"" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|x64.ActiveCfg = Debug|x64 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|x64.Build.0 = Debug|x64 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|x86.ActiveCfg = Debug|x86 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|x86.Build.0 = Debug|x86 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|Any CPU.Build.0 = Release|Any CPU - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|x64.ActiveCfg = Release|x64 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|x64.Build.0 = Release|x64 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|x86.ActiveCfg = Release|x86 - {84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {EAB71280-AF32-4531-8703-43CDBA261AA3} = {7B86CE74-F620-4B32-99FE-82D40F8D6BF2} - {84A45D44-B677-492D-A6DA-B3A71135AB8E} = {EAB71280-AF32-4531-8703-43CDBA261AA3} - EndGlobalSection -EndGlobal -"; - - private const string ExpectedSlnContentsAfterRemoveLastNestedProj = @" -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26006.2 -MinimumVisualStudioVersion = 10.0.40219.1 -Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""App"", ""App.csproj"", ""{7072A694-548F-4CAE-A58F-12D257D5F486}"" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86 - {7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86 - EndGlobalSection -EndGlobal -"; - - [Theory] - [InlineData("--help")] - [InlineData("-h")] - public void WhenHelpOptionIsPassedItPrintsUsage(string helpArg) - { - var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"sln remove {helpArg}"); - cmd.Should().Pass(); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenTooManyArgumentsArePassedItPrintsError() - { - var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput("sln one.sln two.sln three.sln remove"); - cmd.Should().Fail(); - cmd.StdErr.Should().BeVisuallyEquivalentTo($@"{string.Format(CommandLine.LocalizableStrings.UnrecognizedCommandOrArgument, "two.sln")} -{string.Format(CommandLine.LocalizableStrings.UnrecognizedCommandOrArgument, "three.sln")} -{CommonLocalizableStrings.SpecifyAtLeastOneProjectToRemove}"); - } - - [Theory] - [InlineData("")] - [InlineData("unknownCommandName")] - public void WhenNoCommandIsPassedItPrintsError(string commandName) - { - var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"sln {commandName}"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(CommonLocalizableStrings.RequiredCommandNotPassed); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(SlnCommandHelpText); - } - - [Theory] - [InlineData("idontexist.sln")] - [InlineData("ihave?invalidcharacters")] - [InlineData("ihaveinv@lidcharacters")] - [InlineData("ihaveinvalid/characters")] - [InlineData("ihaveinvalidchar\\acters")] - public void WhenNonExistingSolutionIsPassedItPrintsErrorAndUsage(string solutionName) - { - var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"sln {solutionName} remove p.csproj"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.CouldNotFindSolutionOrDirectory, solutionName)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenInvalidSolutionIsPassedItPrintsErrorAndUsage() - { - var projectDirectory = TestAssets - .Get("InvalidSolution") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var projectToRemove = Path.Combine("Lib", "Lib.csproj"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln InvalidSolution.sln remove {projectToRemove}"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.InvalidSolutionFormatString, "InvalidSolution.sln", LocalizableStrings.FileHeaderMissingError)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenInvalidSolutionIsFoundItPrintsErrorAndUsage() - { - var projectDirectory = TestAssets - .Get("InvalidSolution") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var solutionPath = Path.Combine(projectDirectory, "InvalidSolution.sln"); - var projectToRemove = Path.Combine("Lib", "Lib.csproj"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln remove {projectToRemove}"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.InvalidSolutionFormatString, solutionPath, LocalizableStrings.FileHeaderMissingError)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenNoProjectIsPassedItPrintsErrorAndUsage() - { - var projectDirectory = TestAssets - .Get("TestAppWithSlnAndCsprojFiles") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput(@"sln App.sln remove"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(CommonLocalizableStrings.SpecifyAtLeastOneProjectToRemove); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenNoSolutionExistsInTheDirectoryItPrintsErrorAndUsage() - { - var projectDirectory = TestAssets - .Get("TestAppWithSlnAndCsprojFiles") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var solutionPath = Path.Combine(projectDirectory, "App"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(solutionPath) - .ExecuteWithCapturedOutput(@"sln remove App.csproj"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.SolutionDoesNotExist, solutionPath + Path.DirectorySeparatorChar)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenMoreThanOneSolutionExistsInTheDirectoryItPrintsErrorAndUsage() - { - var projectDirectory = TestAssets - .Get("TestAppWithMultipleSlnFiles") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var projectToRemove = Path.Combine("Lib", "Lib.csproj"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln remove {projectToRemove}"); - cmd.Should().Fail(); - cmd.StdErr.Should().Be(string.Format(CommonLocalizableStrings.MoreThanOneSolutionInDirectory, projectDirectory + Path.DirectorySeparatorChar)); - cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); - } - - [Fact] - public void WhenPassedAReferenceNotInSlnItPrintsStatus() - { - var projectDirectory = TestAssets - .Get("TestAppWithSlnAndExistingCsprojReferences") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var solutionPath = Path.Combine(projectDirectory, "App.sln"); - var contentBefore = File.ReadAllText(solutionPath); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("sln remove referenceDoesNotExistInSln.csproj"); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ProjectReferenceCouldNotBeFound, "referenceDoesNotExistInSln.csproj")); - File.ReadAllText(solutionPath) - .Should().BeVisuallyEquivalentTo(contentBefore); - } - - [Fact] - public void WhenPassedAReferenceItRemovesTheReferenceButNotOtherReferences() - { - var projectDirectory = TestAssets - .Get("TestAppWithSlnAndExistingCsprojReferences") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var solutionPath = Path.Combine(projectDirectory, "App.sln"); - SlnFile slnFile = SlnFile.Read(solutionPath); - slnFile.Projects.Count.Should().Be(2); - - var projectToRemove = Path.Combine("Lib", "Lib.csproj"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln remove {projectToRemove}"); - cmd.Should().Pass(); - cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, projectToRemove)); - - slnFile = SlnFile.Read(solutionPath); - slnFile.Projects.Count.Should().Be(1); - slnFile.Projects[0].FilePath.Should().Be(Path.Combine("App", "App.csproj")); - } - - [Fact] - public void WhenDuplicateReferencesArePresentItRemovesThemAll() - { - var projectDirectory = TestAssets - .Get("TestAppWithSlnAndDuplicateProjectReferences") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var solutionPath = Path.Combine(projectDirectory, "App.sln"); - SlnFile slnFile = SlnFile.Read(solutionPath); - slnFile.Projects.Count.Should().Be(3); - - var projectToRemove = Path.Combine("Lib", "Lib.csproj"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln remove {projectToRemove}"); - cmd.Should().Pass(); - - string outputText = string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, projectToRemove); - outputText += Environment.NewLine + outputText; - cmd.StdOut.Should().BeVisuallyEquivalentTo(outputText); - - slnFile = SlnFile.Read(solutionPath); - slnFile.Projects.Count.Should().Be(1); - slnFile.Projects[0].FilePath.Should().Be(Path.Combine("App", "App.csproj")); - } - - [Fact] - public void WhenPassedMultipleReferencesAndOneOfThemDoesNotExistItRemovesTheOneThatExists() - { - var projectDirectory = TestAssets - .Get("TestAppWithSlnAndExistingCsprojReferences") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var solutionPath = Path.Combine(projectDirectory, "App.sln"); - SlnFile slnFile = SlnFile.Read(solutionPath); - slnFile.Projects.Count.Should().Be(2); - - var projectToRemove = Path.Combine("Lib", "Lib.csproj"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln remove idontexist.csproj {projectToRemove} idontexisteither.csproj"); - cmd.Should().Pass(); - - string outputText = $@"{string.Format(CommonLocalizableStrings.ProjectReferenceCouldNotBeFound, "idontexist.csproj")} -{string.Format(CommonLocalizableStrings.ProjectReferenceRemoved, projectToRemove)} -{string.Format(CommonLocalizableStrings.ProjectReferenceCouldNotBeFound, "idontexisteither.csproj")}"; - - cmd.StdOut.Should().BeVisuallyEquivalentTo(outputText); - - slnFile = SlnFile.Read(solutionPath); - slnFile.Projects.Count.Should().Be(1); - slnFile.Projects[0].FilePath.Should().Be(Path.Combine("App", "App.csproj")); - } - - [Fact] - public void WhenReferenceIsRemovedBuildConfigsAreAlsoRemoved() - { - var projectDirectory = TestAssets - .Get("TestAppWithSlnAndCsprojToRemove") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var solutionPath = Path.Combine(projectDirectory, "App.sln"); - SlnFile slnFile = SlnFile.Read(solutionPath); - slnFile.Projects.Count.Should().Be(2); - - var projectToRemove = Path.Combine("Lib", "Lib.csproj"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln remove {projectToRemove}"); - cmd.Should().Pass(); - - File.ReadAllText(solutionPath) - .Should().BeVisuallyEquivalentTo(ExpectedSlnContentsAfterRemove); - } - - [Fact] - public void WhenReferenceIsRemovedSlnBuilds() - { - var projectDirectory = TestAssets - .Get("TestAppWithSlnAndCsprojToRemove") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var solutionPath = Path.Combine(projectDirectory, "App.sln"); - SlnFile slnFile = SlnFile.Read(solutionPath); - slnFile.Projects.Count.Should().Be(2); - - var projectToRemove = Path.Combine("Lib", "Lib.csproj"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln remove {projectToRemove}"); - cmd.Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute($"restore App.sln") - .Should().Pass(); - - new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .Execute("build App.sln --configuration Release") - .Should().Pass(); - - var reasonString = "should be built in release mode, otherwise it means build configurations are missing from the sln file"; - - var releaseDirectory = Directory.EnumerateDirectories( - Path.Combine(projectDirectory, "App", "bin"), - "Release", - SearchOption.AllDirectories); - releaseDirectory.Count().Should().Be(1, $"App {reasonString}"); - Directory.EnumerateFiles(releaseDirectory.Single(), "App.dll", SearchOption.AllDirectories) - .Count().Should().Be(1, $"App {reasonString}"); - } - - [Fact] - public void WhenFinalReferenceIsRemovedEmptySectionsAreRemoved() - { - var projectDirectory = TestAssets - .Get("TestAppWithSlnAndCsprojToRemove") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var solutionPath = Path.Combine(projectDirectory, "App.sln"); - SlnFile slnFile = SlnFile.Read(solutionPath); - slnFile.Projects.Count.Should().Be(2); - - var appPath = Path.Combine("App", "App.csproj"); - var libPath = Path.Combine("Lib", "Lib.csproj"); - var projectsToRemove = $"{libPath} {appPath}"; - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln remove {projectsToRemove}"); - cmd.Should().Pass(); - - File.ReadAllText(solutionPath) - .Should().BeVisuallyEquivalentTo(ExpectedSlnContentsAfterRemoveAllProjects); - } - - [Fact] - public void WhenNestedProjectIsRemovedItsSolutionFoldersAreRemoved() - { - var projectDirectory = TestAssets - .Get("TestAppWithSlnAndCsprojInSubDirToRemove") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var solutionPath = Path.Combine(projectDirectory, "App.sln"); - - var projectToRemove = Path.Combine("src", "NotLastProjInSrc", "NotLastProjInSrc.csproj"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln remove {projectToRemove}"); - cmd.Should().Pass(); - - File.ReadAllText(solutionPath) - .Should().BeVisuallyEquivalentTo(ExpectedSlnContentsAfterRemoveNestedProj); - } - - [Fact] - public void WhenFinalNestedProjectIsRemovedSolutionFoldersAreRemoved() - { - var projectDirectory = TestAssets - .Get("TestAppWithSlnAndLastCsprojInSubDirToRemove") - .CreateInstance() - .WithSourceFiles() - .Root - .FullName; - - var solutionPath = Path.Combine(projectDirectory, "App.sln"); - - var projectToRemove = Path.Combine("src", "Lib", "Lib.csproj"); - var cmd = new DotnetCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"sln remove {projectToRemove}"); - cmd.Should().Pass(); - - File.ReadAllText(solutionPath) - .Should().BeVisuallyEquivalentTo(ExpectedSlnContentsAfterRemoveLastNestedProj); - } - } -} diff --git a/test/dotnet-sln-remove.Tests/MSBuild.exe b/test/dotnet-sln-remove.Tests/MSBuild.exe deleted file mode 100644 index 9bda258ef..000000000 --- a/test/dotnet-sln-remove.Tests/MSBuild.exe +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 diff --git a/test/dotnet-sln-remove.Tests/MSBuild.exe.config b/test/dotnet-sln-remove.Tests/MSBuild.exe.config deleted file mode 100644 index 9bda258ef..000000000 --- a/test/dotnet-sln-remove.Tests/MSBuild.exe.config +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 diff --git a/test/dotnet-sln-remove.Tests/dotnet-sln-remove.Tests.csproj b/test/dotnet-sln-remove.Tests/dotnet-sln-remove.Tests.csproj deleted file mode 100644 index 42c94f8d9..000000000 --- a/test/dotnet-sln-remove.Tests/dotnet-sln-remove.Tests.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-sln-remove.Tests - ../../tools/Key.snk - true - true - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - - - - - - - - - - - - - - - - - diff --git a/test/dotnet-store.Tests/GivenDotnetStoresAndPublishesProjects.cs b/test/dotnet-store.Tests/GivenDotnetStoresAndPublishesProjects.cs deleted file mode 100644 index 00360f446..000000000 --- a/test/dotnet-store.Tests/GivenDotnetStoresAndPublishesProjects.cs +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using FluentAssertions; -using Microsoft.DotNet.PlatformAbstractions; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using System; -using System.IO; -using Xunit; - -namespace Microsoft.DotNet.Cli.Publish.Tests -{ - public class GivenDotnetStoresAndPublishesProjects : TestBase - { - private static string _tfm = "netcoreapp2.0"; - private static string _frameworkVersion = TestAssetInstance.CurrentRuntimeFrameworkVersion; - private static string _arch = RuntimeEnvironment.RuntimeArchitecture.ToLowerInvariant(); - - [Fact] - public void ItPublishesARunnablePortableApp() - { - var testAppName = "NewtonSoftDependentProject"; - var profileProjectName = "NewtonsoftProfile"; - - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - var rid = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier(); - var localAssemblyCache = Path.Combine(testProjectDirectory, "localAssemblyCache"); - var intermediateWorkingDirectory = Path.Combine(testProjectDirectory, "workingDirectory"); - var profileProjectPath = TestAssets.Get(profileProjectName).Root.FullName; - var profileProject = Path.Combine(profileProjectPath, $"{profileProjectName}.xml"); - - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute() - .Should().Pass(); - - new StoreCommand() - .WithManifest(profileProject) - .WithFramework(_tfm) - .WithRuntime(rid) - .WithOutput(localAssemblyCache) - .WithRuntimeFrameworkVersion(_frameworkVersion) - .WithIntermediateWorkingDirectory(intermediateWorkingDirectory) - .Execute() - .Should().Pass(); - - var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; - var profileFilter = Path.Combine(localAssemblyCache, _arch, _tfm, "artifact.xml"); - - new PublishCommand() - .WithFramework(_tfm) - .WithWorkingDirectory(testProjectDirectory) - .WithTargetManifest(profileFilter) - .Execute() - .Should().Pass(); - - var outputDll = Path.Combine(testProjectDirectory, "bin", configuration, _tfm, "publish", $"{testAppName}.dll"); - - new DotnetCommand() - .WithEnvironmentVariable("DOTNET_SHARED_STORE", localAssemblyCache) - .ExecuteWithCapturedOutput(outputDll) - .Should().Pass() - .And.HaveStdOutContaining("{}"); - } - - [Fact] - public void AppFailsDueToMissingCache() - { - var testAppName = "NuGetConfigDependentProject"; - var profileProjectName = "NuGetConfigProfile"; - var targetManifestFileName = "NuGetConfigFilterProfile.xml"; - - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - var profileProjectPath = TestAssets.Get(profileProjectName).Root.FullName; - var profileFilter = Path.Combine(profileProjectPath, targetManifestFileName); - - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute() - .Should().Pass(); - - var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; - - new PublishCommand() - .WithFramework(_tfm) - .WithWorkingDirectory(testProjectDirectory) - .WithTargetManifest(profileFilter) - .Execute() - .Should().Pass(); - - var outputDll = Path.Combine(testProjectDirectory, "bin", configuration, _tfm, "publish", $"{testAppName}.dll"); - - new DotnetCommand() - .ExecuteWithCapturedOutput(outputDll) - .Should().Fail() - .And.HaveStdErrContaining($"Error:{Environment.NewLine}" + - $" An assembly specified in the application dependencies manifest (NuGetConfigDependentProject.deps.json) was not found:{Environment.NewLine}" + - $" package: 'NuGet.Configuration', version: '4.3.0-beta1-2418'{Environment.NewLine}" + - " path: 'lib/netstandard1.3/NuGet.Configuration.dll'"); - } - - [Fact] - public void ItPublishesAnAppWithMultipleProfiles() - { - var testAppName = "MultiDependentProject"; - var profileProjectName = "NewtonsoftProfile"; - var profileProjectName1 = "FluentProfile"; - - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - var rid = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier(); - var localAssemblyCache = Path.Combine(testProjectDirectory, "lAC"); - var intermediateWorkingDirectory = Path.Combine(testProjectDirectory, "workingDirectory"); - - var profileProjectPath = TestAssets.Get(profileProjectName).Root.FullName; - var profileProject = Path.Combine(profileProjectPath, $"{profileProjectName}.xml"); - var profileFilter = Path.Combine(profileProjectPath, "NewtonsoftFilterProfile.xml"); - - var profileProjectPath1 = TestAssets.Get(profileProjectName1).Root.FullName; - var profileProject1 = Path.Combine(profileProjectPath1, $"{profileProjectName1}.xml"); - var profileFilter1 = Path.Combine(profileProjectPath1, "FluentFilterProfile.xml"); - - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute() - .Should().Pass(); - - new StoreCommand() - .WithManifest(profileProject) - .WithManifest(profileProject1) - .WithFramework(_tfm) - .WithRuntime(rid) - .WithOutput(localAssemblyCache) - .WithRuntimeFrameworkVersion(_frameworkVersion) - .WithIntermediateWorkingDirectory(intermediateWorkingDirectory) - .Execute() - .Should().Pass(); - - var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; - - new PublishCommand() - .WithFramework(_tfm) - .WithWorkingDirectory(testProjectDirectory) - .WithTargetManifest(profileFilter) - .WithTargetManifest(profileFilter1) - .Execute() - .Should().Pass(); - - var outputDll = Path.Combine(testProjectDirectory, "bin", configuration, _tfm, "publish", $"{testAppName}.dll"); - - new DotnetCommand() - .WithEnvironmentVariable("DOTNET_SHARED_STORE", localAssemblyCache) - .ExecuteWithCapturedOutput(outputDll) - .Should().Pass() - .And.HaveStdOutContaining("{}"); - } - } -} diff --git a/test/dotnet-store.Tests/dotnet-store.Tests.csproj b/test/dotnet-store.Tests/dotnet-store.Tests.csproj deleted file mode 100644 index 11e732e03..000000000 --- a/test/dotnet-store.Tests/dotnet-store.Tests.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-cache.Tests - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - - - - - - - - - - - - diff --git a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestFromCsprojForMultipleTFM.cs b/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestFromCsprojForMultipleTFM.cs deleted file mode 100644 index adfc7b0d4..000000000 --- a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestFromCsprojForMultipleTFM.cs +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Tools.Test.Utilities; -using FluentAssertions; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Cli.Utils; -using System.IO; -using System; -using Xunit; - -namespace Microsoft.DotNet.Cli.Test.Tests -{ - public class GivenDotnetTestBuildsAndRunsTestFromCsprojForMultipleTFM : TestBase - { - [WindowsOnlyFact] - public void MStestMultiTFM() - { - var testProjectDirectory = TestAssets.Get("VSTestMulti") - .CreateInstance("1") - .WithSourceFiles() - .WithNuGetConfig(new RepoDirectoriesProvider().TestPackages) - .Root; - - var runtime = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier(); - - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .WithRuntime(runtime) - .Execute() - .Should().Pass(); - - var result = new DotnetTestCommand() - .WithWorkingDirectory(testProjectDirectory) - .WithRuntime(runtime) - .ExecuteWithCapturedOutput(TestBase.ConsoleLoggerOutputNormal); - - if (!DotnetUnderTest.IsLocalized()) - { - result.StdOut - .Should().Contain("Total tests: 3. Passed: 2. Failed: 1. Skipped: 0.", "because .NET 4.6 tests will pass") - .And.Contain("Passed TestNamespace.VSTestTests.VSTestPassTestDesktop", "because .NET 4.6 tests will pass") - .And.Contain("Total tests: 3. Passed: 1. Failed: 2. Skipped: 0.", "because netcoreapp2.0 tests will fail") - .And.Contain("Failed TestNamespace.VSTestTests.VSTestFailTestNetCoreApp", "because netcoreapp2.0 tests will fail"); - } - result.ExitCode.Should().Be(1); - } - - [WindowsOnlyFact] - public void XunitMultiTFM() - { - // Copy XunitMulti project in output directory of project dotnet-test.Tests - string testAppName = "XunitMulti"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance("2") - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - // Restore project XunitMulti - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute() - .Should() - .Pass(); - - // Call test - CommandResult result = new DotnetTestCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput(TestBase.ConsoleLoggerOutputNormal); - - // Verify - if (!DotnetUnderTest.IsLocalized()) - { - // for target framework net46 - result.StdOut.Should().Contain("Total tests: 3. Passed: 2. Failed: 1. Skipped: 0."); - result.StdOut.Should().Contain("Passed TestNamespace.VSTestXunitTests.VSTestXunitPassTestDesktop"); - - // for target framework netcoreapp1.0 - result.StdOut.Should().Contain("Total tests: 3. Passed: 1. Failed: 2. Skipped: 0."); - result.StdOut.Should().Contain("Failed TestNamespace.VSTestXunitTests.VSTestXunitFailTestNetCoreApp"); - } - - result.ExitCode.Should().Be(1); - } - - [Fact] - public void ItCanTestAMultiTFMProjectWithImplicitRestore() - { - var testInstance = TestAssets.Get( - TestAssetKinds.DesktopTestProjects, - "MultiTFMXunitProject") - .CreateInstance() - .WithSourceFiles(); - - string projectDirectory = Path.Combine(testInstance.Root.FullName, "XUnitProject"); - - new DotnetTestCommand() - .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"{TestBase.ConsoleLoggerOutputNormal} --framework netcoreapp2.0") - .Should().Pass(); - } - } -} diff --git a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs b/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs deleted file mode 100644 index 807688463..000000000 --- a/test/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestfromCsproj.cs +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; -using FluentAssertions; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Cli.Utils; -using System.IO; -using System; -using System.Runtime.CompilerServices; - -namespace Microsoft.DotNet.Cli.Test.Tests -{ - public class GivenDotnettestBuildsAndRunsTestfromCsproj : TestBase - { - [Fact] - public void MSTestSingleTFM() - { - var testProjectDirectory = this.CopyAndRestoreVSTestDotNetCoreTestApp("3"); - - // Call test - CommandResult result = new DotnetTestCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput(TestBase.ConsoleLoggerOutputNormal); - - // Verify - if (!DotnetUnderTest.IsLocalized()) - { - result.StdOut.Should().Contain("Total tests: 2. Passed: 1. Failed: 1. Skipped: 0."); - result.StdOut.Should().Contain("Passed TestNamespace.VSTestTests.VSTestPassTest"); - result.StdOut.Should().Contain("Failed TestNamespace.VSTestTests.VSTestFailTest"); - } - - result.ExitCode.Should().Be(1); - } - - [Fact] - public void ItImplicitlyRestoresAProjectWhenTesting() - { - string testAppName = "VSTestCore"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - CommandResult result = new DotnetTestCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput(TestBase.ConsoleLoggerOutputNormal); - - if (!DotnetUnderTest.IsLocalized()) - { - result.StdOut.Should().Contain("Total tests: 2. Passed: 1. Failed: 1. Skipped: 0."); - result.StdOut.Should().Contain("Passed TestNamespace.VSTestTests.VSTestPassTest"); - result.StdOut.Should().Contain("Failed TestNamespace.VSTestTests.VSTestFailTest"); - } - - result.ExitCode.Should().Be(1); - } - - [Fact] - public void ItDoesNotImplicitlyRestoreAProjectWhenTestingWithTheNoRestoreOption() - { - string testAppName = "VSTestCore"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - new DotnetTestCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput($"{TestBase.ConsoleLoggerOutputNormal} --no-restore") - .Should().Fail() - .And.HaveStdOutContaining("project.assets.json"); - } - - [Fact] - public void XunitSingleTFM() - { - // Copy XunitCore project in output directory of project dotnet-vstest.Tests - string testAppName = "XunitCore"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance("4") - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - // Restore project XunitCore - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute() - .Should() - .Pass(); - - // Call test - CommandResult result = new DotnetTestCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput(TestBase.ConsoleLoggerOutputNormal); - - // Verify - if (!DotnetUnderTest.IsLocalized()) - { - result.StdOut.Should().Contain("Total tests: 2. Passed: 1. Failed: 1. Skipped: 0."); - result.StdOut.Should().Contain("Passed TestNamespace.VSTestXunitTests.VSTestXunitPassTest"); - result.StdOut.Should().Contain("Failed TestNamespace.VSTestXunitTests.VSTestXunitFailTest"); - } - - result.ExitCode.Should().Be(1); - } - - [Fact] - public void TestWillNotBuildTheProjectIfNoBuildArgsIsGiven() - { - // Copy and restore VSTestCore project in output directory of project dotnet-vstest.Tests - var testProjectDirectory = this.CopyAndRestoreVSTestDotNetCoreTestApp("5"); - string configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; - string expectedError = Path.Combine(testProjectDirectory, "bin", - configuration, "netcoreapp2.0", "VSTestCore.dll"); - expectedError = "The test source file " + "\"" + expectedError + "\"" + " provided was not found."; - - // Call test - CommandResult result = new DotnetTestCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput("--no-build"); - - // Verify - if (!DotnetUnderTest.IsLocalized()) - { - result.StdErr.Should().Contain(expectedError); - } - - result.ExitCode.Should().Be(1); - } - - [Fact] - public void TestWillCreateTrxLoggerInTheSpecifiedResultsDirectoryBySwitch() - { - // Copy and restore VSTestCore project in output directory of project dotnet-vstest.Tests - var testProjectDirectory = this.CopyAndRestoreVSTestDotNetCoreTestApp("6"); - - string trxLoggerDirectory = Path.Combine(testProjectDirectory, "TR", "x.y"); - - // Delete trxLoggerDirectory if it exist - if (Directory.Exists(trxLoggerDirectory)) - { - Directory.Delete(trxLoggerDirectory, true); - } - - // Call test with trx logger enabled and results directory explicitly specified. - CommandResult result = new DotnetTestCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput("--logger trx -r \"" + trxLoggerDirectory + "\""); - - // Verify - String[] trxFiles = Directory.GetFiles(trxLoggerDirectory, "*.trx"); - Assert.Equal(1, trxFiles.Length); - result.StdOut.Should().Contain(trxFiles[0]); - - // Cleanup trxLoggerDirectory if it exist - if(Directory.Exists(trxLoggerDirectory)) - { - Directory.Delete(trxLoggerDirectory, true); - } - } - - [Fact] - public void ItCreatesTrxReportInTheSpecifiedResultsDirectoryByArgs() - { - // Copy and restore VSTestCore project in output directory of project dotnet-vstest.Tests - var testProjectDirectory = this.CopyAndRestoreVSTestDotNetCoreTestApp("7"); - - string trxLoggerDirectory = Path.Combine(testProjectDirectory, "RD"); - - // Delete trxLoggerDirectory if it exist - if (Directory.Exists(trxLoggerDirectory)) - { - Directory.Delete(trxLoggerDirectory, true); - } - - // Call test with logger enable - CommandResult result = new DotnetTestCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput("--logger \"trx;logfilename=custom.trx\" -- RunConfiguration.ResultsDirectory=" + trxLoggerDirectory); - - // Verify - var trxFilePath = Path.Combine(trxLoggerDirectory, "custom.trx"); - Assert.True(File.Exists(trxFilePath)); - result.StdOut.Should().Contain(trxFilePath); - - // Cleanup trxLoggerDirectory if it exist - if (Directory.Exists(trxLoggerDirectory)) - { - Directory.Delete(trxLoggerDirectory, true); - } - } - - [Fact] - public void ItBuildsAndTestsAppWhenRestoringToSpecificDirectory() - { - // Creating folder with name short name "RestoreTest" to avoid PathTooLongException - var rootPath = TestAssets.Get("VSTestCore").CreateInstance("8").WithSourceFiles().Root.FullName; - - // Moving pkgs folder on top to avoid PathTooLongException - string dir = @"..\..\..\..\pkgs"; - string fullPath = Path.GetFullPath(Path.Combine(rootPath, dir)); - - string args = $"--packages \"{dir}\""; - new RestoreCommand() - .WithWorkingDirectory(rootPath) - .Execute(args) - .Should() - .Pass(); - - new BuildCommand() - .WithWorkingDirectory(rootPath) - .ExecuteWithCapturedOutput("--no-restore") - .Should() - .Pass() - .And.NotHaveStdErr(); - - CommandResult result = new DotnetTestCommand() - .WithWorkingDirectory(rootPath) - .ExecuteWithCapturedOutput($"{TestBase.ConsoleLoggerOutputNormal} --no-restore"); - - if (!DotnetUnderTest.IsLocalized()) - { - result.StdOut.Should().Contain("Total tests: 2. Passed: 1. Failed: 1. Skipped: 0."); - result.StdOut.Should().Contain("Passed TestNamespace.VSTestTests.VSTestPassTest"); - result.StdOut.Should().Contain("Failed TestNamespace.VSTestTests.VSTestFailTest"); - } - - result.ExitCode.Should().Be(1); - } - - [Fact] - public void ItUsesVerbosityPassedToDefineVerbosityOfConsoleLoggerOfTheTests() - { - // Copy and restore VSTestCore project in output directory of project dotnet-vstest.Tests - var testProjectDirectory = this.CopyAndRestoreVSTestDotNetCoreTestApp("9"); - - // Call test - CommandResult result = new DotnetTestCommand() - .WithWorkingDirectory(testProjectDirectory) - .ExecuteWithCapturedOutput("-v q"); - - // Verify - if (!DotnetUnderTest.IsLocalized()) - { - result.StdOut.Should().Contain("Total tests: 2. Passed: 1. Failed: 1. Skipped: 0."); - result.StdOut.Should().NotContain("Passed TestNamespace.VSTestTests.VSTestPassTest"); - result.StdOut.Should().NotContain("Failed TestNamespace.VSTestTests.VSTestFailTest"); - } - - result.ExitCode.Should().Be(1); - } - - private string CopyAndRestoreVSTestDotNetCoreTestApp([CallerMemberName] string callingMethod = "") - { - // Copy VSTestCore project in output directory of project dotnet-vstest.Tests - string testAppName = "VSTestCore"; - var testInstance = TestAssets.Get(testAppName) - .CreateInstance(callingMethod) - .WithSourceFiles(); - - var testProjectDirectory = testInstance.Root.FullName; - - // Restore project VSTestCore - new RestoreCommand() - .WithWorkingDirectory(testProjectDirectory) - .Execute() - .Should() - .Pass(); - - return testProjectDirectory; - } - } -} diff --git a/test/dotnet-test.Tests/dotnet-test.Tests.csproj b/test/dotnet-test.Tests/dotnet-test.Tests.csproj deleted file mode 100644 index a69fe3555..000000000 --- a/test/dotnet-test.Tests/dotnet-test.Tests.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-test.Tests - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - - - - - - - - - - - - diff --git a/test/dotnet-vstest.Tests/VSTestTests.cs b/test/dotnet-vstest.Tests/VSTestTests.cs deleted file mode 100644 index 47eae7e89..000000000 --- a/test/dotnet-vstest.Tests/VSTestTests.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; -using System; -using System.IO; -using FluentAssertions; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.Cli.VSTest.Tests -{ - public class VSTestTests : TestBase - { - [Fact] - public void TestsFromAGivenContainerShouldRunWithExpectedOutput() - { - var testAppName = "VSTestCore"; - var testRoot = TestAssets.Get(testAppName) - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles() - .Root; - - var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; - - new BuildCommand() - .WithWorkingDirectory(testRoot) - .Execute() - .Should().Pass(); - - var outputDll = testRoot - .GetDirectory("bin", configuration, "netcoreapp2.0") - .GetFile($"{testAppName}.dll"); - - var argsForVstest = $"\"{outputDll.FullName}\" --logger:console;verbosity=normal"; - - // Call vstest - var result = new VSTestCommand().ExecuteWithCapturedOutput(argsForVstest); - if (!DotnetUnderTest.IsLocalized()) - { - result.StdOut - .Should().Contain("Total tests: 2. Passed: 1. Failed: 1. Skipped: 0.") - .And.Contain("Passed TestNamespace.VSTestTests.VSTestPassTest") - .And.Contain("Failed TestNamespace.VSTestTests.VSTestFailTest"); - } - - result.ExitCode.Should().Be(1); - } - } -} diff --git a/test/dotnet-vstest.Tests/dotnet-vstest.Tests.csproj b/test/dotnet-vstest.Tests/dotnet-vstest.Tests.csproj deleted file mode 100644 index 2601d659f..000000000 --- a/test/dotnet-vstest.Tests/dotnet-vstest.Tests.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet-vstest.Tests - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - - - - - - - - - - - - diff --git a/test/dotnet.Tests/CommandLineApplicationTests.cs b/test/dotnet.Tests/CommandLineApplicationTests.cs deleted file mode 100644 index d9733c47e..000000000 --- a/test/dotnet.Tests/CommandLineApplicationTests.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using FluentAssertions; -using Microsoft.DotNet.Cli.CommandLine; -using Xunit; - -namespace Microsoft.DotNet.Tests -{ - public class CommandLineApplicationTests - { - [Fact] - public void WhenAnOptionRequiresASingleValueThatIsNotSuppliedItThrowsCommandParsingException() - { - var app = new CommandLineApplication(); - - app.Option("-v|--verbosity", "be verbose", CommandOptionType.SingleValue); - - Action execute = () => app.Execute("-v"); - - execute.ShouldThrow() - .Which - .Message - .Should() - .Be(string.Format(LocalizableStrings.OptionRequiresSingleValueWhichIsMissing, "-v")); - } - } -} diff --git a/test/dotnet.Tests/FakeRecordEventNameTelemetry.cs b/test/dotnet.Tests/FakeRecordEventNameTelemetry.cs deleted file mode 100644 index 4690ef771..000000000 --- a/test/dotnet.Tests/FakeRecordEventNameTelemetry.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Concurrent; -using System.Collections.Generic; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.Telemetry; - -namespace Microsoft.DotNet.Tests -{ - public class FakeRecordEventNameTelemetry : ITelemetry - { - public bool Enabled { get; set; } - - public string EventName { get; set; } - - public void TrackEvent(string eventName, - IDictionary properties, - IDictionary measurements) - { - LogEntries.Add( - new LogEntry - { - EventName = eventName, - Measurement = measurements, - Properties = properties - }); - } - - public ConcurrentBag LogEntries { get; set; } = new ConcurrentBag(); - - public class LogEntry - { - public string EventName { get; set; } - public IDictionary Properties { get; set; } - public IDictionary Measurement { get; set; } - } - } -} diff --git a/test/dotnet.Tests/GivenThatDotNetRunsCommands.cs b/test/dotnet.Tests/GivenThatDotNetRunsCommands.cs deleted file mode 100644 index 4837bc4ca..000000000 --- a/test/dotnet.Tests/GivenThatDotNetRunsCommands.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved.  -// Licensed under the MIT license. See LICENSE file in the project root for full license information.  - -using System; -using System.IO; -using FluentAssertions; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; - -namespace Microsoft.DotNet.Tests -{ - public class GivenThatDotNetRunsCommands : TestBase - { - [Fact] - public void UnresolvedPlatformReferencesFailAsExpected() - { - var testInstance = TestAssets.Get("NonRestoredTestProjects", "TestProjectWithUnresolvedPlatformDependency") - .CreateInstance() - .WithSourceFiles() - .Root.FullName; - - new RestoreCommand() - .WithWorkingDirectory(testInstance) - .ExecuteWithCapturedOutput("/p:SkipInvalidConfigurations=true") - .Should() - .Fail(); - - new DotnetCommand() - .WithWorkingDirectory(testInstance) - .ExecuteWithCapturedOutput("crash") - .Should().Fail() - .And.HaveStdErrContaining(string.Format(LocalizableStrings.NoExecutableFoundMatchingCommand, "dotnet-crash")); - } - } -} diff --git a/test/dotnet.Tests/GivenThatICareAboutVBApps.cs b/test/dotnet.Tests/GivenThatICareAboutVBApps.cs deleted file mode 100644 index 4b7d0186b..000000000 --- a/test/dotnet.Tests/GivenThatICareAboutVBApps.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved.  -// Licensed under the MIT license. See LICENSE file in the project root for full license information.  - -using System; -using System.IO; -using FluentAssertions; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; - -namespace Microsoft.DotNet.Tests -{ - public class GivenThatICareAboutVBApps : TestBase - { - private TestAssetInstance _testInstance; - - public GivenThatICareAboutVBApps() - { - _testInstance = TestAssets.Get("VBTestApp") - .CreateInstance() - .WithSourceFiles(); - - new RestoreCommand() - .WithWorkingDirectory(_testInstance.Root) - .Execute() - .Should().Pass(); - } - - [Fact] - public void ICanBuildVBApps() - { - new BuildCommand() - .WithWorkingDirectory(_testInstance.Root) - .Execute() - .Should().Pass(); - } - - [Fact] - public void ICanRunVBApps() - { - new RunCommand() - .WithWorkingDirectory(_testInstance.Root) - .Execute() - .Should().Pass(); - } - - [Fact] - public void ICanPublicAndRunVBApps() - { - new PublishCommand() - .WithWorkingDirectory(_testInstance.Root) - .Execute() - .Should().Pass(); - - var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug"; - var outputDll = Path.Combine( - _testInstance.Root.FullName, - "bin", - configuration, - "netcoreapp2.0", - "publish", - "VBTestApp.dll"); - - new DotnetCommand() - .ExecuteWithCapturedOutput(outputDll) - .Should().Pass() - .And.HaveStdOutContaining("Hello World"); - } - } -} diff --git a/test/dotnet.Tests/GivenThatIWantToManageMulticoreJIT.cs b/test/dotnet.Tests/GivenThatIWantToManageMulticoreJIT.cs deleted file mode 100644 index 72d6edd7e..000000000 --- a/test/dotnet.Tests/GivenThatIWantToManageMulticoreJIT.cs +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved.  -// Licensed under the MIT license. See LICENSE file in the project root for full license information.  - -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using System; -using System.IO; -using System.Runtime.InteropServices; -using Xunit; -using Xunit.Abstractions; -using FluentAssertions; -using Microsoft.DotNet.PlatformAbstractions; - -namespace Microsoft.DotNet.Tests -{ - public class GivenThatIWantToManageMulticoreJIT : TestBase - { - ITestOutputHelper _output; - private const string OptimizationProfileFileName = "dotnet"; - - public GivenThatIWantToManageMulticoreJIT(ITestOutputHelper output) - { - _output = output; - } - - [Fact] - public void WhenInvokedThenDotnetWritesOptimizationDataToTheProfileRoot() - { - var testDirectory = TestAssets.CreateTestDirectory(); - var testStartTime = GetTruncatedDateTime(); - - new TestCommand("dotnet") - .WithUserProfileRoot(testDirectory.FullName) - .ExecuteWithCapturedOutput("--help"); - - var optimizationProfileFilePath = GetOptimizationProfileFilePath(testDirectory.FullName); - - new FileInfo(optimizationProfileFilePath) - .Should().Exist("Because dotnet CLI creates it after each run") - .And.HaveLastWriteTimeUtc() - .Which.Should().BeOnOrAfter(testStartTime, "Because dotnet CLI was executed after that time"); - } - - [Fact] - public void WhenInvokedWithMulticoreJitDisabledThenDotnetDoesNotWriteOptimizationDataToTheProfileRoot() - { - var testDirectory = TestAssets.CreateTestDirectory(); - var testStartTime = GetTruncatedDateTime(); - - new TestCommand("dotnet") - .WithUserProfileRoot(testDirectory.FullName) - .WithEnvironmentVariable("DOTNET_DISABLE_MULTICOREJIT", "1") - .ExecuteWithCapturedOutput("--help"); - - var optimizationProfileFilePath = GetOptimizationProfileFilePath(testDirectory.FullName); - - File.Exists(optimizationProfileFilePath) - .Should().BeFalse("Because multicore JIT is disabled"); - } - - [Fact] - public void WhenTheProfileRootIsUndefinedThenDotnetDoesNotCrash() - { - var testDirectory = TestAssets.CreateTestDirectory(); - var testStartTime = GetTruncatedDateTime(); - - var optimizationProfileFilePath = GetOptimizationProfileFilePath(testDirectory.FullName); - - new TestCommand("dotnet") - .WithUserProfileRoot("") - .ExecuteWithCapturedOutput("--help") - .Should().Pass(); - } - - [Fact] - public void WhenCliRepoBuildsThenDotnetWritesOptimizationDataToTheDefaultProfileRoot() - { - var optimizationProfileFilePath = GetOptimizationProfileFilePath(); - - File.Exists(optimizationProfileFilePath) - .Should().BeTrue("Because the dotnet building dotnet writes to the default root"); - } - - private static string GetOptimizationProfileFilePath(string userHomePath = null) - { - return Path.Combine( - GetUserProfileRoot(userHomePath), - GetOptimizationRootPath(GetDotnetVersion()), - OptimizationProfileFileName); - } - - private static string GetUserProfileRoot(string overrideUserProfileRoot = null) - { - if (overrideUserProfileRoot != null) - { - return overrideUserProfileRoot; - } - - return RuntimeInformation.IsOSPlatform(OSPlatform.Windows) - ? Environment.GetEnvironmentVariable("LocalAppData") - : Environment.GetEnvironmentVariable("HOME"); - } - - private static string GetOptimizationRootPath(string version) - { - var rid = PlatformAbstractions.RuntimeEnvironment.GetRuntimeIdentifier(); - - return RuntimeInformation.IsOSPlatform(OSPlatform.Windows) - ? $@"Microsoft\dotnet\optimizationdata\{version}\{rid}" - : $@".dotnet/optimizationdata/{version}/{rid}"; - } - - private static string GetDotnetVersion() - { - return new TestCommand("dotnet") - .ExecuteWithCapturedOutput("--version" ) - .StdOut - .Trim(); - } - - private static DateTime GetTruncatedDateTime() - { - var dt = DateTime.UtcNow; - - return new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second, 0, dt.Kind); - } - } -} diff --git a/test/dotnet.Tests/GivenThatTheUserIsRunningDotNetForTheFirstTime.cs b/test/dotnet.Tests/GivenThatTheUserIsRunningDotNetForTheFirstTime.cs deleted file mode 100644 index 4fd1fb660..000000000 --- a/test/dotnet.Tests/GivenThatTheUserIsRunningDotNetForTheFirstTime.cs +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright (c) .NET 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.Collections.Generic; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; -using FluentAssertions; - -[assembly: CollectionBehavior(DisableTestParallelization = true)] - -namespace Microsoft.DotNet.Tests -{ - public class GivenThatTheUserIsRunningDotNetForTheFirstTime : TestBase - { - private static CommandResult _firstDotnetNonVerbUseCommandResult; - private static CommandResult _firstDotnetVerbUseCommandResult; - private static DirectoryInfo _nugetFallbackFolder; - private static DirectoryInfo _dotDotnetFolder; - private static string _testDirectory; - - static GivenThatTheUserIsRunningDotNetForTheFirstTime() - { - _testDirectory = TestAssets.CreateTestDirectory("Dotnet_first_time_experience_tests").FullName; - var testNuGetHome = Path.Combine(_testDirectory, "nuget_home"); - var cliTestFallbackFolder = Path.Combine(testNuGetHome, ".dotnet", "NuGetFallbackFolder"); - - var command = new DotnetCommand() - .WithWorkingDirectory(_testDirectory); - command.Environment["HOME"] = testNuGetHome; - command.Environment["USERPROFILE"] = testNuGetHome; - command.Environment["APPDATA"] = testNuGetHome; - command.Environment["DOTNET_CLI_TEST_FALLBACKFOLDER"] = cliTestFallbackFolder; - command.Environment["DOTNET_SKIP_FIRST_TIME_EXPERIENCE"] = ""; - command.Environment["SkipInvalidConfigurations"] = "true"; - - _firstDotnetNonVerbUseCommandResult = command.ExecuteWithCapturedOutput("--info"); - _firstDotnetVerbUseCommandResult = command.ExecuteWithCapturedOutput("new --debug:ephemeral-hive"); - - _nugetFallbackFolder = new DirectoryInfo(cliTestFallbackFolder); - _dotDotnetFolder = new DirectoryInfo(Path.Combine(testNuGetHome, ".dotnet")); - } - - [Fact] - public void UsingDotnetForTheFirstTimeSucceeds() - { - _firstDotnetVerbUseCommandResult - .Should() - .Pass(); - } - - [Fact] - public void UsingDotnetForTheFirstTimeWithNonVerbsDoesNotPrintEula() - { - string firstTimeNonVerbUseMessage = Cli.Utils.LocalizableStrings.DotNetCommandLineTools; - - _firstDotnetNonVerbUseCommandResult.StdOut - .Should() - .StartWith(firstTimeNonVerbUseMessage); - } - - [Fact] - public void ItShowsTheAppropriateMessageToTheUser() - { - _firstDotnetVerbUseCommandResult.StdOut - .Should() - .ContainVisuallySameFragment(Configurer.LocalizableStrings.FirstTimeWelcomeMessage) - .And.NotContain("Restore completed in"); - } - - [Fact] - public void ItCreatesASentinelFileUnderTheNuGetCacheFolder() - { - _nugetFallbackFolder - .Should() - .HaveFile($"{GetDotnetVersion()}.dotnetSentinel"); - } - - [Fact] - public void ItCreatesAFirstUseSentinelFileUnderTheDotDotNetFolder() - { - _dotDotnetFolder - .Should() - .HaveFile($"{GetDotnetVersion()}.dotnetFirstUseSentinel"); - } - - [Fact] - public void ItDoesNotCreateAFirstUseSentinelFileUnderTheDotDotNetFolderWhenInternalReportInstallSuccessIsInvoked() - { - var emptyHome = Path.Combine(_testDirectory, "empty_home"); - - var command = new DotnetCommand() - .WithWorkingDirectory(_testDirectory); - command.Environment["HOME"] = emptyHome; - command.Environment["USERPROFILE"] = emptyHome; - command.Environment["APPDATA"] = emptyHome; - command.Environment["DOTNET_CLI_TEST_FALLBACKFOLDER"] = _nugetFallbackFolder.FullName; - command.Environment["DOTNET_SKIP_FIRST_TIME_EXPERIENCE"] = ""; - // Disable to prevent the creation of the .dotnet folder by optimizationdata. - command.Environment["DOTNET_DISABLE_MULTICOREJIT"] = "true"; - command.Environment["SkipInvalidConfigurations"] = "true"; - - command.ExecuteWithCapturedOutput("internal-reportinstallsuccess test").Should().Pass(); - - var homeFolder = new DirectoryInfo(Path.Combine(emptyHome, ".dotnet")); - string[] fileEntries = Directory.GetFiles(homeFolder.ToString()); - fileEntries.Should().OnlyContain(x => !x.Contains(".dotnetFirstUseSentinel")); - } - - [Fact] - public void ItShowsTheTelemetryNoticeWhenInvokingACommandAfterInternalReportInstallSuccessHasBeenInvoked() - { - var newHome = Path.Combine(_testDirectory, "new_home"); - var newHomeFolder = new DirectoryInfo(Path.Combine(newHome, ".dotnet")); - - var command = new DotnetCommand() - .WithWorkingDirectory(_testDirectory); - command.Environment["HOME"] = newHome; - command.Environment["USERPROFILE"] = newHome; - command.Environment["APPDATA"] = newHome; - command.Environment["DOTNET_CLI_TEST_FALLBACKFOLDER"] = _nugetFallbackFolder.FullName; - command.Environment["DOTNET_SKIP_FIRST_TIME_EXPERIENCE"] = ""; - command.Environment["SkipInvalidConfigurations"] = "true"; - - command.ExecuteWithCapturedOutput("internal-reportinstallsuccess test").Should().Pass(); - - var result = command.ExecuteWithCapturedOutput("new --debug:ephemeral-hive"); - - result.StdOut - .Should() - .ContainVisuallySameFragment(Configurer.LocalizableStrings.FirstTimeWelcomeMessage); - } - - [Fact] - public void ItRestoresTheNuGetPackagesToTheNuGetCacheFolder() - { - List expectedDirectories = new List() - { - "microsoft.netcore.app", - "microsoft.netcore.platforms", - "netstandard.library", - "microsoft.aspnetcore.diagnostics", - "microsoft.aspnetcore.mvc", - "microsoft.aspnetcore.routing", - "microsoft.aspnetcore.server.iisintegration", - "microsoft.aspnetcore.server.kestrel", - "microsoft.aspnetcore.staticfiles", - "microsoft.extensions.configuration.environmentvariables", - "microsoft.extensions.configuration.json", - "microsoft.extensions.logging", - "microsoft.extensions.logging.console", - "microsoft.extensions.logging.debug", - "microsoft.extensions.options.configurationextensions", - //BrowserLink has been temporarily disabled until https://github.com/dotnet/templating/issues/644 is resolved - //"microsoft.visualstudio.web.browserlink", - }; - - _nugetFallbackFolder - .Should() - .HaveDirectories(expectedDirectories); - } - - private string GetDotnetVersion() - { - return new DotnetCommand().ExecuteWithCapturedOutput("--version").StdOut - .TrimEnd(Environment.NewLine.ToCharArray()); - } - } -} diff --git a/test/dotnet.Tests/GivenThatTheUserRequestsHelp.cs b/test/dotnet.Tests/GivenThatTheUserRequestsHelp.cs deleted file mode 100644 index c550a7370..000000000 --- a/test/dotnet.Tests/GivenThatTheUserRequestsHelp.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using FluentAssertions; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; - -namespace dotnet.Tests -{ - public class GivenThatTheUserRequestsHelp - { - [Theory] - [InlineData("-h")] - [InlineData("add -h")] - [InlineData("add package -h")] - [InlineData("add reference -h")] - [InlineData("build -h")] - [InlineData("clean -h")] - [InlineData("list -h")] - [InlineData("migrate -h")] - [InlineData("msbuild -h")] - [InlineData("new -h")] - [InlineData("nuget -h")] - [InlineData("pack -h")] - [InlineData("publish -h")] - [InlineData("remove -h")] - [InlineData("restore -h")] - [InlineData("run -h")] - [InlineData("sln -h")] - [InlineData("sln add -h")] - [InlineData("sln list -h")] - [InlineData("sln remove -h")] - [InlineData("store -h")] - [InlineData("test -h")] - public void TheResponseIsNotAnError(string commandLine) - { - var result = new DotnetCommand() - .ExecuteWithCapturedOutput(commandLine); - - result.ExitCode.Should().Be(0); - } - } -} \ No newline at end of file diff --git a/test/dotnet.Tests/MSBuild.exe b/test/dotnet.Tests/MSBuild.exe deleted file mode 100644 index 9bda258ef..000000000 --- a/test/dotnet.Tests/MSBuild.exe +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 diff --git a/test/dotnet.Tests/MSBuild.exe.config b/test/dotnet.Tests/MSBuild.exe.config deleted file mode 100644 index 9bda258ef..000000000 --- a/test/dotnet.Tests/MSBuild.exe.config +++ /dev/null @@ -1 +0,0 @@ -https://github.com/Microsoft/msbuild/issues/927 diff --git a/test/dotnet.Tests/PackagedCommandTests.cs b/test/dotnet.Tests/PackagedCommandTests.cs deleted file mode 100644 index 27c08b918..000000000 --- a/test/dotnet.Tests/PackagedCommandTests.cs +++ /dev/null @@ -1,564 +0,0 @@ -// Copyright (c) .NET 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.IO; -using System.Runtime.InteropServices; -using FluentAssertions; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Tools.Test.Utilities; -using Microsoft.DotNet.InternalAbstractions; -using Xunit; -using Xunit.Abstractions; -using Microsoft.Build.Construction; -using System.Linq; -using Microsoft.Build.Evaluation; -using System.Xml.Linq; - -namespace Microsoft.DotNet.Tests -{ - public class PackagedCommandTests : TestBase - { - private readonly ITestOutputHelper _output; - - public PackagedCommandTests(ITestOutputHelper output) - { - _output = output; - } - - public static IEnumerable DependencyToolArguments - { - get - { - var rid = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier(); - var projectOutputPath = $"AppWithProjTool2Fx\\bin\\Debug\\net451\\{rid}\\dotnet-desktop-and-portable.exe"; - return new[] - { - new object[] { "CoreFX", ".NETCoreApp,Version=v1.0", "lib\\netcoreapp1.0\\dotnet-desktop-and-portable.dll" }, - new object[] { "NetFX", ".NETFramework,Version=v4.5.1", projectOutputPath } - }; - } - } - public static IEnumerable LibraryDependencyToolArguments - { - get - { - var rid = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier(); - - var projectOutputPath = $"LibWithProjTool2Fx\\bin\\Debug\\net451\\dotnet-desktop-and-portable.exe"; - - return new[] - { - new object[] { "CoreFX", ".NETStandard,Version=v1.6", "lib\\netstandard1.6\\dotnet-desktop-and-portable.dll" }, - new object[] { "NetFX", ".NETFramework,Version=v4.5.1", projectOutputPath } - }; - } - } - - [Theory] - [InlineData("AppWithDirectAndToolDep", true)] - [InlineData("AppWithToolDependency", false)] - public void TestProjectToolIsAvailableThroughDriver(string appName, bool useCurrentFrameworkRuntimeVersion) - { - var testInstance = TestAssets.Get(appName) - .CreateInstance() - .WithSourceFiles() - .WithNuGetConfig(new RepoDirectoriesProvider().TestPackages); - - if (useCurrentFrameworkRuntimeVersion) - { - testInstance = testInstance.UseCurrentRuntimeFrameworkVersion(); - } - - // restore again now that the project has changed - new RestoreCommand() - .WithWorkingDirectory(testInstance.Root) - .Execute() - .Should().Pass(); - - new BuildCommand() - .WithProjectDirectory(testInstance.Root) - .Execute() - .Should().Pass(); - - new PortableCommand() - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput() - .Should().HaveStdOutContaining("Hello Portable World!") - .And.NotHaveStdErr() - .And.Pass(); - } - - [Theory] - [InlineData(true)] - [InlineData(false)] - public void IfPreviousVersionOfSharedFrameworkIsNotInstalled_ToolsTargetingItFail(bool toolPrefersCLIRuntime) - { - var testInstance = TestAssets.Get("AppWithToolDependency") - .CreateInstance(identifier: toolPrefersCLIRuntime ? "preferCLIRuntime" : "") - .WithSourceFiles() - .WithNuGetConfig(new RepoDirectoriesProvider().TestPackages); - - testInstance = testInstance.WithProjectChanges(project => - { - var ns = project.Root.Name.Namespace; - - var toolReference = project.Descendants(ns + "DotNetCliToolReference") - .Where(tr => tr.Attribute("Include").Value == "dotnet-portable") - .Single(); - - toolReference.Attribute("Include").Value = - toolPrefersCLIRuntime ? "dotnet-portable-v1-prefercli" : "dotnet-portable-v1"; - }); - - testInstance = testInstance.WithRestoreFiles(); - - new BuildCommand() - .WithProjectDirectory(testInstance.Root) - .Execute() - .Should().Pass(); - - new GenericCommand(toolPrefersCLIRuntime ? "portable-v1-prefercli" : "portable-v1") - .WithWorkingDirectory(testInstance.Root) - .Execute() - .Should().Fail(); - } - - [RequiresSpecificFrameworkTheory("netcoreapp1.1")] - [InlineData(true)] - [InlineData(false)] - public void IfPreviousVersionOfSharedFrameworkIsInstalled_ToolsTargetingItRun(bool toolPrefersCLIRuntime) - { - var testInstance = TestAssets.Get("AppWithToolDependency") - .CreateInstance(identifier: toolPrefersCLIRuntime ? "preferCLIRuntime" : "") - .WithSourceFiles() - .WithNuGetConfig(new RepoDirectoriesProvider().TestPackages); - - testInstance = testInstance.WithProjectChanges(project => - { - var ns = project.Root.Name.Namespace; - - var toolReference = project.Descendants(ns + "DotNetCliToolReference") - .Where(tr => tr.Attribute("Include").Value == "dotnet-portable") - .Single(); - - toolReference.Attribute("Include").Value = - toolPrefersCLIRuntime ? "dotnet-portable-v1-prefercli" : "dotnet-portable-v1"; - }); - - testInstance = testInstance.WithRestoreFiles(); - - new BuildCommand() - .WithProjectDirectory(testInstance.Root) - .Execute() - .Should().Pass(); - - var result = - new DotnetCommand(DotnetUnderTest.WithBackwardsCompatibleRuntimes) - .WithWorkingDirectory(testInstance.Root) - .Execute(toolPrefersCLIRuntime ? "portable-v1-prefercli" : "portable-v1"); - - result.Should().Pass() - .And.HaveStdOutContaining("I'm running on shared framework version 1.1.2!"); - - } - - [RequiresSpecificFrameworkFact("netcoreapp1.1")] - public void IfAToolHasNotBeenRestoredForNetCoreApp2_0ItFallsBackToNetCoreApp1_x() - { - string toolName = "dotnet-portable-v1"; - - var toolFolder = Path.Combine(new RepoDirectoriesProvider().NugetPackages, - ".tools", - toolName); - - // Other tests may have restored the tool for netcoreapp2.0, so delete its tools folder - if (Directory.Exists(toolFolder)) - { - Directory.Delete(toolFolder, true); - } - - var testInstance = TestAssets.Get("AppWithToolDependency") - .CreateInstance() - .WithSourceFiles() - .WithNuGetConfig(new RepoDirectoriesProvider().TestPackages); - - testInstance = testInstance.WithProjectChanges(project => - { - var ns = project.Root.Name.Namespace; - - // Remove reference to tool that won't restore on 1.x - project.Descendants(ns + "DotNetCliToolReference") - .Where(tr => tr.Attribute("Include").Value == "dotnet-PreferCliRuntime") - .Remove(); - - var toolReference = project.Descendants(ns + "DotNetCliToolReference") - .Where(tr => tr.Attribute("Include").Value == "dotnet-portable") - .Single(); - - toolReference.Attribute("Include").Value = toolName; - - // Restore tools for .NET Core 1.1 - project.Root.Element(ns + "PropertyGroup") - .Add(new XElement(ns + "DotnetCliToolTargetFramework", "netcoreapp1.1")); - - }); - - testInstance = testInstance.WithRestoreFiles(); - - var result = - new DotnetCommand(DotnetUnderTest.WithBackwardsCompatibleRuntimes) - .WithWorkingDirectory(testInstance.Root) - .Execute("portable-v1"); - - result.Should().Pass() - .And.HaveStdOutContaining("I'm running on shared framework version 1.1.2!"); - } - - [Fact] - public void CanInvokeToolWhosePackageNameIsDifferentFromDllName() - { - var testInstance = TestAssets.Get("AppWithDepOnToolWithOutputName") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - new BuildCommand() - .WithProjectDirectory(testInstance.Root) - .Execute() - .Should().Pass(); - - new GenericCommand("tool-with-output-name") - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput() - .Should().HaveStdOutContaining("Tool with output name!") - .And.NotHaveStdErr() - .And.Pass(); - } - - [Fact] - public void CanInvokeToolFromDirectDependenciesIfPackageNameDifferentFromToolName() - { - var testInstance = TestAssets.Get("AppWithDirectDepWithOutputName") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - const string framework = ".NETCoreApp,Version=v2.0"; - - new BuildCommand() - .WithProjectDirectory(testInstance.Root) - .WithConfiguration("Debug") - .Execute() - .Should().Pass(); - - new DependencyToolInvokerCommand(DotnetUnderTest.WithBackwardsCompatibleRuntimes) - .WithWorkingDirectory(testInstance.Root) - .WithEnvironmentVariable(CommandContext.Variables.Verbose, "true") - .ExecuteWithCapturedOutput($"tool-with-output-name", framework, "") - .Should().HaveStdOutContaining("Tool with output name!") - .And.NotHaveStdErr() - .And.Pass(); - } - - [Fact] - public void ItShowsErrorWhenToolIsNotRestored() - { - var testInstance = TestAssets.Get("NonRestoredTestProjects", "AppWithNonExistingToolDependency") - .CreateInstance() - .WithSourceFiles(); - - new TestCommand("dotnet") - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput("nonexistingtool") - .Should().Fail() - .And.HaveStdErrContaining(string.Format(LocalizableStrings.NoExecutableFoundMatchingCommand, "dotnet-nonexistingtool")); - } - - [Fact] - public void ItRunsToolRestoredToSpecificPackageDir() - { - var testInstance = TestAssets.Get("NonRestoredTestProjects", "ToolWithRandomPackageName") - .CreateInstance() - .WithSourceFiles(); - - var appWithDepOnToolDir = testInstance.Root.Sub("AppWithDepOnTool"); - var toolWithRandPkgNameDir = testInstance.Root.Sub("ToolWithRandomPackageName"); - var pkgsDir = testInstance.Root.CreateSubdirectory("pkgs"); - - // 3ebdd4f1-a194-470a-b01a-4515672791d1 - // ^-- index = 24 - string randomPackageName = Guid.NewGuid().ToString().Substring(24); - - // TODO: This is a workround for https://github.com/dotnet/cli/issues/5020 - SetGeneratedPackageName(appWithDepOnToolDir.GetFile("AppWithDepOnTool.csproj"), - randomPackageName); - - SetGeneratedPackageName(toolWithRandPkgNameDir.GetFile("ToolWithRandomPackageName.csproj"), - randomPackageName); - - new RestoreCommand() - .WithWorkingDirectory(toolWithRandPkgNameDir) - .Execute() - .Should().Pass(); - - new PackCommand() - .WithWorkingDirectory(toolWithRandPkgNameDir) - .Execute($"-o \"{pkgsDir.FullName}\"") - .Should().Pass(); - - new RestoreCommand() - .WithWorkingDirectory(appWithDepOnToolDir) - .Execute($"--packages \"{pkgsDir.FullName}\"") - .Should().Pass(); - - new TestCommand("dotnet") - .WithWorkingDirectory(appWithDepOnToolDir) - .ExecuteWithCapturedOutput("randompackage") - .Should().Pass() - .And.HaveStdOutContaining("Hello World from tool!") - .And.NotHaveStdErr(); - } - - [WindowsOnlyTheory(Skip="https://github.com/dotnet/cli/issues/4514")] - [MemberData("DependencyToolArguments")] - public void TestFrameworkSpecificDependencyToolsCanBeInvoked(string identifier, string framework, string expectedDependencyToolPath) - { - var testInstance = TestAssets.Get(TestAssetKinds.DesktopTestProjects, "AppWithProjTool2Fx") - .CreateInstance(identifier: identifier) - .WithSourceFiles() - .WithRestoreFiles(); - - new BuildCommand() - .WithWorkingDirectory(testInstance.Root) - .WithConfiguration("Debug") - .Execute() - .Should().Pass(); - - new DependencyToolInvokerCommand() - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput($"desktop-and-portable {framework} {identifier}") - .Should().HaveStdOutContaining(framework) - .And.HaveStdOutContaining(identifier) - .And.HaveStdOutContaining(expectedDependencyToolPath) - .And.NotHaveStdErr() - .And.Pass(); - } - - [WindowsOnlyTheory] - [MemberData("LibraryDependencyToolArguments")] - public void TestFrameworkSpecificLibraryDependencyToolsCannotBeInvoked(string identifier, string framework, string expectedDependencyToolPath) - { - var testInstance = TestAssets.Get(TestAssetKinds.DesktopTestProjects, "LibWithProjTool2Fx") - .CreateInstance(identifier: identifier) - .WithSourceFiles() - .WithRestoreFiles(); - - new BuildCommand() - .WithWorkingDirectory(testInstance.Root) - .WithConfiguration("Debug") - .Execute() - .Should().Pass(); - - new DependencyToolInvokerCommand() - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput($"desktop-and-portable {framework} {identifier}") - .Should().Fail(); - } - - [Fact] - public void ToolsCanAccessDependencyContextProperly() - { - var testInstance = TestAssets.Get("DependencyContextFromTool") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - new DependencyContextTestCommand(DotnetUnderTest.WithBackwardsCompatibleRuntimes) - .WithWorkingDirectory(testInstance.Root) - .Execute("") - .Should().Pass(); - } - - [Fact] - public void TestProjectDependencyIsNotAvailableThroughDriver() - { - var testInstance = TestAssets.Get("AppWithDirectDep") - .CreateInstance() - .WithSourceFiles() - .UseCurrentRuntimeFrameworkVersion() - .WithNuGetConfig(new RepoDirectoriesProvider().TestPackages); - - // restore again now that the project has changed - new RestoreCommand() - .WithWorkingDirectory(testInstance.Root) - .Execute() - .Should().Pass(); - - new BuildCommand() - .WithWorkingDirectory(testInstance.Root) - .Execute() - .Should().Pass(); - - var currentDirectory = Directory.GetCurrentDirectory(); - - CommandResult result = new HelloCommand() - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput(); - - result.StdErr.Should().Contain(string.Format(LocalizableStrings.NoExecutableFoundMatchingCommand, "dotnet-hello")); - - result.Should().Fail(); - } - - [Fact(Skip = "https://github.com/dotnet/cli/issues/6144")] - public void WhenToolAssetsFileIsInUseThenCLIRetriesLaunchingTheCommandForAtLeastOneSecond() - { - var testInstance = TestAssets.Get("AppWithToolDependency") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var assetsFile = new DirectoryInfo(new RepoDirectoriesProvider().NugetPackages) - .GetDirectory(".tools", "dotnet-portable", "1.0.0", "netcoreapp2.0") - .GetFile("project.assets.json"); - - var stopWatch = Stopwatch.StartNew(); - - using (assetsFile.Lock() - .DisposeAfter(TimeSpan.FromMilliseconds(1000))) - { - new PortableCommand() - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput() - .Should().HaveStdOutContaining("Hello Portable World!") - .And.NotHaveStdErr() - .And.Pass(); - } - - stopWatch.Stop(); - - stopWatch.ElapsedMilliseconds.Should().BeGreaterThan(1000, "Because dotnet should respect the NuGet lock"); - } - - [Fact(Skip="https://github.com/dotnet/cli/issues/6006")] - public void WhenToolAssetsFileIsLockedByNuGetThenCLIRetriesLaunchingTheCommandForAtLeastOneSecond() - { - var testInstance = TestAssets.Get("AppWithToolDependency") - .CreateInstance() - .WithSourceFiles() - .WithRestoreFiles(); - - var assetsFile = new DirectoryInfo(new RepoDirectoriesProvider().NugetPackages) - .GetDirectory(".tools", "dotnet-portable", "1.0.0", "netcoreapp1.0") - .GetFile("project.assets.json"); - - var stopWatch = Stopwatch.StartNew(); - - using (assetsFile.NuGetLock() - .DisposeAfter(TimeSpan.FromMilliseconds(1000))) - { - new PortableCommand() - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput() - .Should().HaveStdOutContaining("Hello Portable World!") - .And.NotHaveStdErr() - .And.Pass(); - } - - stopWatch.Stop(); - - stopWatch.ElapsedMilliseconds.Should().BeGreaterThan(1000, "Because dotnet should respect the NuGet lock"); - } - - private void SetGeneratedPackageName(FileInfo project, string packageName) - { - const string propertyName = "GeneratedPackageId"; - var p = ProjectRootElement.Open(project.FullName, new ProjectCollection(), true); - p.AddProperty(propertyName, packageName); - p.Save(); - } - - class HelloCommand : DotnetCommand - { - public HelloCommand() - { - } - - public override CommandResult Execute(string args = "") - { - args = $"hello {args}"; - return base.Execute(args); - } - - public override CommandResult ExecuteWithCapturedOutput(string args = "") - { - args = $"hello {args}"; - return base.ExecuteWithCapturedOutput(args); - } - } - - class PortableCommand : DotnetCommand - { - public PortableCommand() - { - } - - public override CommandResult Execute(string args = "") - { - args = $"portable {args}"; - return base.Execute(args); - } - - public override CommandResult ExecuteWithCapturedOutput(string args = "") - { - args = $"portable {args}"; - return base.ExecuteWithCapturedOutput(args); - } - } - - class GenericCommand : DotnetCommand - { - private readonly string _commandName; - - public GenericCommand(string commandName) - { - _commandName = commandName; - } - - public override CommandResult Execute(string args = "") - { - args = $"{_commandName} {args}"; - return base.Execute(args); - } - - public override CommandResult ExecuteWithCapturedOutput(string args = "") - { - args = $"{_commandName} {args}"; - return base.ExecuteWithCapturedOutput(args); - } - } - - class DependencyContextTestCommand : DotnetCommand - { - public DependencyContextTestCommand(string dotnetUnderTest) : base(dotnetUnderTest) - { - } - - public override CommandResult Execute(string path) - { - var args = $"dependency-context-test {path}"; - return base.Execute(args); - } - - public override CommandResult ExecuteWithCapturedOutput(string path) - { - var args = $"dependency-context-test {path}"; - return base.ExecuteWithCapturedOutput(args); - } - } - } -} diff --git a/test/dotnet.Tests/ParserTests/AddReferenceParserTests.cs b/test/dotnet.Tests/ParserTests/AddReferenceParserTests.cs deleted file mode 100644 index b1684d4cf..000000000 --- a/test/dotnet.Tests/ParserTests/AddReferenceParserTests.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using System.Linq; -using FluentAssertions; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Tools.Common; -using Xunit; -using Xunit.Abstractions; -using Parser = Microsoft.DotNet.Cli.Parser; - -namespace Microsoft.DotNet.Tests.ParserTests -{ - public class AddReferenceParserTests - { - private readonly ITestOutputHelper output; - - public AddReferenceParserTests(ITestOutputHelper output) - { - this.output = output; - } - - [Fact] - public void AddReferenceHasDefaultArgumentSetToCurrentDirectory() - { - var command = Parser.Instance; - - var result = command.Parse("dotnet add reference my.csproj"); - - result["dotnet"]["add"] - .Arguments - .Should() - .BeEquivalentTo( - PathUtility.EnsureTrailingSlash(Directory.GetCurrentDirectory())); - } - - [Fact] - public void AddReferenceWithoutArgumentResultsInAnError() - { - var command = Parser.Instance; - - var result = command.Parse("dotnet add reference"); - - result - .Errors - .Select(e => e.Message) - .Should() - .BeEquivalentTo(string.Format(LocalizableStrings.RequiredArgumentMissingForCommand, "reference")); - } - } -} \ No newline at end of file diff --git a/test/dotnet.Tests/ParserTests/ArgumentForwardingExtensionsTests.cs b/test/dotnet.Tests/ParserTests/ArgumentForwardingExtensionsTests.cs deleted file mode 100644 index c445c9812..000000000 --- a/test/dotnet.Tests/ParserTests/ArgumentForwardingExtensionsTests.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using FluentAssertions; -using System.Linq; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.CommandLine; -using Xunit; -using static Microsoft.DotNet.Cli.CommandLine.Accept; -using static Microsoft.DotNet.Cli.CommandLine.Create; - -namespace Microsoft.DotNet.Tests.ParserTests -{ - public class ArgumentForwardingExtensionsTests - { - [Fact] - public void AnOutgoingCommandLineCanBeGeneratedBasedOnAParseResult() - { - var command = Command("the-command", "", - Option("-o|--one", "", - ZeroOrOneArgument() - .ForwardAsSingle(o => $"/i:{o.Arguments.Single()}")), - Option("-t|--two", "", - NoArguments() - .ForwardAs("/s:true"))); - - var result = command.Parse("the-command -t -o 123"); - - result["the-command"] - .OptionValuesToBeForwarded() - .Should() - .BeEquivalentTo("/i:123", "/s:true"); - } - - [Fact] - public void MultipleArgumentsCanBeJoinedWhenForwarding() - { - var command = Command("the-command", "", - Option("-x", "", - ZeroOrMoreArguments() - .ForwardAsSingle(o => $"/x:{string.Join("&", o.Arguments)}"))); - - var result = command.Parse("the-command -x one -x two"); - - result["the-command"] - .OptionValuesToBeForwarded() - .Should() - .BeEquivalentTo("/x:one&two"); - } - - [Fact] - public void AnArgumentCanBeForwardedAsIs() - { - var command = Command("the-command", "", - Option("-x", "", - ZeroOrMoreArguments() - .Forward())); - - var result = command.Parse("the-command -x one"); - - result["the-command"] - .OptionValuesToBeForwarded() - .Should() - .BeEquivalentTo("one"); - } - } -} diff --git a/test/dotnet.Tests/ParserTests/MigrateParserTests.cs b/test/dotnet.Tests/ParserTests/MigrateParserTests.cs deleted file mode 100644 index 165bffb72..000000000 --- a/test/dotnet.Tests/ParserTests/MigrateParserTests.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Linq; -using FluentAssertions; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Tools.Migrate; -using Xunit; -using Xunit.Abstractions; -using Parser = Microsoft.DotNet.Cli.Parser; - -namespace Microsoft.DotNet.Tests.ParserTests -{ - public class MigrateParserTests - { - public MigrateParserTests(ITestOutputHelper output) - { - this.output = output; - } - - private readonly ITestOutputHelper output; - - [Fact] - public void MigrateParserConstructMigrateCommandWithoutError() - { - var command = Parser.Instance; - - var result = command.Parse("dotnet migrate --skip-backup -s " + - "-x \"C:\\ConsoleAppOnCore_1\\ConsoleAppOnCore_1.xproj\" " + - "\"C:\\ConsoleAppOnCore_1\\project.json\" " + - "-r \"C:\\report.wfw\" " + - "--format-report-file-json"); - - Action a = () => result["dotnet"]["migrate"].Value(); - a.ShouldNotThrow(); - } - - [Fact] - public void MigrateParseGetResultCorrectlyAsFollowing() - { - var command = Parser.Instance; - - var result = command.Parse("dotnet migrate --skip-backup -s " + - "-x \"C:\\ConsoleAppOnCore_1\\ConsoleAppOnCore_1.xproj\" " + - "\"C:\\ConsoleAppOnCore_1\\project.json\" " + - "-r \"C:\\report.wfw\" " + - "--format-report-file-json"); - - result["dotnet"]["migrate"]["skip-backup"].Value().Should().BeTrue(); - result["dotnet"]["migrate"]["skip-project-references"].Value().Should().BeTrue(); - result["dotnet"]["migrate"]["format-report-file-json"].Value().Should().BeTrue(); - result["dotnet"]["migrate"]["xproj-file"].Value().Should().Be("C:\\ConsoleAppOnCore_1\\ConsoleAppOnCore_1.xproj"); - result["dotnet"]["migrate"]["report-file"].Value().Should().Be("C:\\report.wfw"); - result["dotnet"]["migrate"].Arguments.Contains("C:\\ConsoleAppOnCore_1\\project.json").Should().BeTrue(); - } - } -} \ No newline at end of file diff --git a/test/dotnet.Tests/ParserTests/RestoreParserTests.cs b/test/dotnet.Tests/ParserTests/RestoreParserTests.cs deleted file mode 100644 index 726c6be8e..000000000 --- a/test/dotnet.Tests/ParserTests/RestoreParserTests.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using FluentAssertions; -using Microsoft.DotNet.Cli.CommandLine; -using Xunit; -using Xunit.Abstractions; -using Parser = Microsoft.DotNet.Cli.Parser; - -namespace Microsoft.DotNet.Tests.ParserTests -{ - public class RestoreParserTests - { - private readonly ITestOutputHelper output; - - public RestoreParserTests(ITestOutputHelper output) - { - this.output = output; - } - - [Fact] - public void RestoreCapturesArgumentsToForwardToMSBuildWhenTargetIsSpecified() - { - var parser = Parser.Instance; - - var result = parser.Parse(@"dotnet restore .\some.csproj --packages c:\.nuget\packages /p:SkipInvalidConfigurations=true"); - - result["dotnet"]["restore"] - .Arguments - .Should() - .BeEquivalentTo(@".\some.csproj", @"/p:SkipInvalidConfigurations=true"); - } - - [Fact] - public void RestoreCapturesArgumentsToForwardToMSBuildWhenTargetIsNotSpecified() - { - var parser = Parser.Instance; - - var result = parser.Parse(@"dotnet restore --packages c:\.nuget\packages /p:SkipInvalidConfigurations=true"); - - result["dotnet"]["restore"] - .Arguments - .Should() - .BeEquivalentTo(@"/p:SkipInvalidConfigurations=true"); - } - - [Fact] - public void RestoreDistinguishesRepeatSourceArgsFromCommandArgs() - { - var restore = - Parser.Instance - .Parse( - @"dotnet restore --no-cache --packages ""D:\OSS\corefx\packages"" --source https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json --source https://dotnet.myget.org/F/dotnet-core/api/v3/index.json --source https://api.nuget.org/v3/index.json D:\OSS\corefx\external\runtime\runtime.depproj") - .AppliedCommand(); - - restore - .Arguments - .Should() - .BeEquivalentTo(@"D:\OSS\corefx\external\runtime\runtime.depproj"); - - restore["--source"] - .Arguments - .Should() - .BeEquivalentTo( - "https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json", - "https://dotnet.myget.org/F/dotnet-core/api/v3/index.json", - "https://api.nuget.org/v3/index.json"); - } - } -} \ No newline at end of file diff --git a/test/dotnet.Tests/ParserTests/RunParserTests.cs b/test/dotnet.Tests/ParserTests/RunParserTests.cs deleted file mode 100644 index 6fdee951b..000000000 --- a/test/dotnet.Tests/ParserTests/RunParserTests.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Linq; -using FluentAssertions; -using Microsoft.DotNet.Tools.Run; -using Xunit; -using Xunit.Abstractions; -using System; - -namespace Microsoft.DotNet.Tests.ParserTests -{ - public class RunParserTests - { - public RunParserTests(ITestOutputHelper output) - { - this.output = output; - } - - private readonly ITestOutputHelper output; - - [Fact] - public void RunParserCanGetArguementFromDoubleDash() - { - var runCommand = RunCommand.FromArgs(new[]{ "--", "foo" }); - runCommand.Args.Single().Should().Be("foo"); - } - } -} diff --git a/test/dotnet.Tests/ParserTests/ValdidationMessageTests.cs b/test/dotnet.Tests/ParserTests/ValdidationMessageTests.cs deleted file mode 100644 index 41d184d6a..000000000 --- a/test/dotnet.Tests/ParserTests/ValdidationMessageTests.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using FluentAssertions; -using Microsoft.DotNet.Cli.CommandLine; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; -using Xunit.Abstractions; - -namespace Microsoft.DotNet.Tests.ParserTests -{ - public class ValidationMessageTests - { - [Fact] - public void ValidationMessagesFormatCorrectly() - { - // Since not all validation messages that we provided to the command-line parser are triggered by our - // tests (and some may not be possible to trigger with our current usage), unit test that we can - // obtain validation messages through the same interface as the command-line parser. - // - // In English configuration, we check that the messages are exactly what we expect and otherwise we at - // lest ensure that we don't get a FormatException. - - IValidationMessages m = new CommandLineValidationMessages(); - - m.CommandAcceptsOnlyOneArgument("xyz", 3) - .Should().BeVisuallyEquivalentToIfNotLocalized( - "Command 'xyz' only accepts a single argument but 3 were provided."); - - m.CommandAcceptsOnlyOneSubcommand("zyx", "a;b;c") - .Should().BeVisuallyEquivalentToIfNotLocalized( - "Command 'zyx' only accepts a single subcommand but multiple were provided: a;b;c"); - - m.FileDoesNotExist("abc.def") - .Should().BeVisuallyEquivalentToIfNotLocalized( - "File does not exist: abc.def"); - - m.NoArgumentsAllowed("zzz") - .Should().BeVisuallyEquivalentToIfNotLocalized( - "Arguments not allowed for option: zzz"); - - m.OptionAcceptsOnlyOneArgument("qqq", 4) - .Should().BeVisuallyEquivalentToIfNotLocalized( - "Option 'qqq' only accepts a single argument but 4 were provided."); - - m.RequiredArgumentMissingForCommand("www") - .Should().BeVisuallyEquivalentToIfNotLocalized( - "Required argument missing for command: www"); - - m.RequiredArgumentMissingForOption("rrr") - .Should().BeVisuallyEquivalentToIfNotLocalized( - "Required argument missing for option: rrr"); - - m.RequiredCommandWasNotProvided() - .Should().BeVisuallyEquivalentToIfNotLocalized( - "Required command was not provided."); - - m.UnrecognizedArgument("apple", new[] { "banana", "orange" }) - .Should().BeVisuallyEquivalentToIfNotLocalized( - "Argument 'apple' not recognized. Must be one of: \n\t'banana'\n\t\'orange'"); - - m.UnrecognizedCommandOrArgument("ppp") - .Should().BeVisuallyEquivalentToIfNotLocalized( - "Unrecognized command or argument 'ppp'"); - - m.UnrecognizedOption("apple", new[] { "banana", "orange" }) - .Should().BeVisuallyEquivalentToIfNotLocalized( - "Option 'apple' not recognized. Must be one of: \n\t'banana'\n\t\'orange'"); - } - } -} \ No newline at end of file diff --git a/test/dotnet.Tests/TelemetryCommandTest.cs b/test/dotnet.Tests/TelemetryCommandTest.cs deleted file mode 100644 index 356667009..000000000 --- a/test/dotnet.Tests/TelemetryCommandTest.cs +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using FluentAssertions; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.Telemetry; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Tools.Test.Utilities; -using System.Collections.Generic; -using Xunit; - -namespace Microsoft.DotNet.Tests -{ - public class TelemetryCommandTests : TestBase - { - private readonly FakeRecordEventNameTelemetry _fakeTelemetry; - - public string EventName { get; set; } - public IDictionary Properties { get; set; } - public TelemetryCommandTests() - { - _fakeTelemetry = new FakeRecordEventNameTelemetry(); - TelemetryEventEntry.Subscribe(_fakeTelemetry.TrackEvent); - TelemetryEventEntry.TelemetryFilter = new TelemetryFilter(); - } - - [Fact] - public void TopLevelCommandNameShouldBeSentToTelemetry() - { - string[] args = {"help"}; - Cli.Program.ProcessArgs(args); - _fakeTelemetry.LogEntries.Should().Contain(e => e.EventName == args[0]); - } - - [Fact] - public void DotnetNewCommandFirstArgumentShouldBeSentToTelemetry() - { - const string argumentToSend = "console"; - string[] args = {"new", argumentToSend}; - Cli.Program.ProcessArgs(args); - _fakeTelemetry - .LogEntries.Should() - .Contain(e => e.EventName == "dotnet-new" && e.Properties.ContainsKey("argument") && - e.Properties["argument"] == argumentToSend); - } - - [Fact] - public void DotnetHelpCommandFirstArgumentShouldBeSentToTelemetry() - { - const string argumentToSend = "something"; - string[] args = {"help", argumentToSend}; - Cli.Program.ProcessArgs(args); - _fakeTelemetry - .LogEntries.Should() - .Contain(e => e.EventName == "dotnet-help" && e.Properties.ContainsKey("argument") && - e.Properties["argument"] == argumentToSend); - } - - [Fact] - public void DotnetAddCommandFirstArgumentShouldBeSentToTelemetry() - { - const string argumentToSend = "package"; - string[] args = {"add", argumentToSend, "aPackageName"}; - Cli.Program.ProcessArgs(args); - _fakeTelemetry - .LogEntries.Should() - .Contain(e => e.EventName == "dotnet-add" && e.Properties.ContainsKey("argument") && - e.Properties["argument"] == argumentToSend); - } - - [Fact] - public void DotnetAddCommandFirstArgumentShouldBeSentToTelemetry2() - { - const string argumentToSend = "reference"; - string[] args = {"add", argumentToSend, "aPackageName"}; - Cli.Program.ProcessArgs(args); - _fakeTelemetry - .LogEntries.Should() - .Contain(e => e.EventName == "dotnet-add" && e.Properties.ContainsKey("argument") && - e.Properties["argument"] == argumentToSend); - } - - [Fact] - public void DotnetRemoveCommandFirstArgumentShouldBeSentToTelemetry() - { - const string argumentToSend = "package"; - string[] args = {"remove", argumentToSend, "aPackageName"}; - Cli.Program.ProcessArgs(args); - _fakeTelemetry - .LogEntries.Should() - .Contain(e => e.EventName == "dotnet-remove" && e.Properties.ContainsKey("argument") && - e.Properties["argument"] == argumentToSend); - } - - [Fact] - public void DotnetListCommandFirstArgumentShouldBeSentToTelemetry() - { - const string argumentToSend = "reference"; - string[] args = {"list", argumentToSend, "aPackageName"}; - Cli.Program.ProcessArgs(args); - _fakeTelemetry - .LogEntries.Should() - .Contain(e => e.EventName == "dotnet-list" && e.Properties.ContainsKey("argument") && - e.Properties["argument"] == argumentToSend); - } - - [Fact] - public void DotnetSlnCommandFirstArgumentShouldBeSentToTelemetry() - { - const string argumentToSend = "list"; - string[] args = {"sln", "aSolution", argumentToSend}; - Cli.Program.ProcessArgs(args); - _fakeTelemetry - .LogEntries.Should() - .Contain(e => e.EventName == "dotnet-sln" && e.Properties.ContainsKey("argument") && - e.Properties["argument"] == argumentToSend); - } - - [Fact] - public void DotnetNugetCommandFirstArgumentShouldBeSentToTelemetry() - { - const string argumentToSend = "push"; - string[] args = {"nuget", argumentToSend, "aRoot"}; - Cli.Program.ProcessArgs(args); - _fakeTelemetry - .LogEntries.Should() - .Contain(e => e.EventName == "dotnet-nuget" && e.Properties.ContainsKey("argument") && - e.Properties["argument"] == argumentToSend); - } - - [Fact] - public void DotnetNewCommandLanguageOpinionShouldBeSentToTelemetry() - { - const string optionKey = "language"; - const string optionValueToSend = "c#"; - string[] args = {"new", "console", "--" + optionKey, optionValueToSend}; - Cli.Program.ProcessArgs(args); - _fakeTelemetry - .LogEntries.Should() - .Contain(e => e.EventName == "dotnet-new" && e.Properties.ContainsKey(optionKey) && - e.Properties[optionKey] == optionValueToSend); - } - - [Fact] - public void AnyDotnetCommandVerbosityOpinionShouldBeSentToTelemetry() - { - const string optionKey = "verbosity"; - const string optionValueToSend = "minimal"; - string[] args = {"restore", "--" + optionKey, optionValueToSend}; - Cli.Program.ProcessArgs(args); - _fakeTelemetry - .LogEntries.Should() - .Contain(e => e.EventName == "dotnet-restore" && e.Properties.ContainsKey(optionKey) && - e.Properties[optionKey] == optionValueToSend); - } - - [Fact] - public void DotnetBuildAndPublishCommandOpinionsShouldBeSentToTelemetry() - { - const string optionKey = "configuration"; - const string optionValueToSend = "Debug"; - string[] args = {"build", "--" + optionKey, optionValueToSend}; - Cli.Program.ProcessArgs(args); - _fakeTelemetry - .LogEntries.Should() - .Contain(e => e.EventName == "dotnet-build" && e.Properties.ContainsKey(optionKey) && - e.Properties[optionKey] == optionValueToSend); - } - - [Fact] - public void DotnetPublishCommandRuntimeOpinionsShouldBeSentToTelemetry() - { - const string optionKey = "runtime"; - const string optionValueToSend = "win10-x64"; - string[] args = { "publish", "--" + optionKey, optionValueToSend }; - Cli.Program.ProcessArgs(args); - _fakeTelemetry - .LogEntries.Should() - .Contain(e => e.EventName == "dotnet-publish" && e.Properties.ContainsKey(optionKey) && - e.Properties[optionKey] == optionValueToSend); - } - - [Fact] - public void DotnetBuildAndPublishCommandOpinionsShouldBeSentToTelemetryWhenThereIsMultipleOption() - { - string[] args = {"build", "--configuration", "Debug", "--runtime", "osx.10.11-x64"}; - Cli.Program.ProcessArgs(args); - _fakeTelemetry - .LogEntries.Should() - .Contain(e => e.EventName == "dotnet-build" && e.Properties.ContainsKey("configuration") && - e.Properties["configuration"] == "Debug"); - - _fakeTelemetry - .LogEntries.Should() - .Contain(e => e.EventName == "dotnet-build" && e.Properties.ContainsKey("runtime") && - e.Properties["runtime"] == "osx.10.11-x64"); - } - - [Fact] - public void DotnetRunCleanTestCommandOpinionsShouldBeSentToTelemetryWhenThereIsMultipleOption() - { - string[] args = {"clean", "--configuration", "Debug", "--framework", "netcoreapp1.0"}; - Cli.Program.ProcessArgs(args); - _fakeTelemetry - .LogEntries.Should() - .Contain(e => e.EventName == "dotnet-clean" && e.Properties.ContainsKey("configuration") && - e.Properties["configuration"] == "Debug"); - - _fakeTelemetry - .LogEntries.Should() - .Contain(e => e.EventName == "dotnet-clean" && e.Properties.ContainsKey("framework") && - e.Properties["framework"] == "netcoreapp1.0"); - } - - [WindowsOnlyFact] - public void InternalreportinstallsuccessCommandCollectExeNameWithEventname() - { - FakeRecordEventNameTelemetry fakeTelemetry = new FakeRecordEventNameTelemetry(); - string[] args = { "c:\\mypath\\dotnet-sdk-latest-win-x64.exe" }; - - InternalReportinstallsuccess.ProcessInputAndSendTelemetry(args, fakeTelemetry); - - fakeTelemetry - .LogEntries.Should() - .Contain(e => e.EventName == "reportinstallsuccess" && e.Properties.ContainsKey("exeName") && - e.Properties["exeName"] == "dotnet-sdk-latest-win-x64.exe"); - } - - [Fact] - public void InternalreportinstallsuccessCommandIsRegistedInBuiltIn() - { - BuiltInCommandsCatalog.Commands.Should().ContainKey("internal-reportinstallsuccess"); - } - } -} diff --git a/test/dotnet.Tests/TelemetryCommonPropertiesTests.cs b/test/dotnet.Tests/TelemetryCommonPropertiesTests.cs deleted file mode 100644 index b30e59e9d..000000000 --- a/test/dotnet.Tests/TelemetryCommonPropertiesTests.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using FluentAssertions; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; -using System; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Cli.Telemetry; -using Microsoft.DotNet.Configurer; - -namespace Microsoft.DotNet.Tests -{ - public class TelemetryCommonPropertiesTests : TestBase - { - [Fact] - public void TelemetryCommonPropertiesShouldContainIfItIsInDockerOrNot() - { - var unitUnderTest = new TelemetryCommonProperties(userLevelCacheWriter: new NothingCache()); - unitUnderTest.GetTelemetryCommonProperties().Should().ContainKey("Docker Container"); - } - - [Fact] - public void TelemetryCommonPropertiesShouldReturnHashedPath() - { - var unitUnderTest = new TelemetryCommonProperties(() => "ADirectory", userLevelCacheWriter: new NothingCache()); - unitUnderTest.GetTelemetryCommonProperties()["Current Path Hash"].Should().NotBe("ADirectory"); - } - - [Fact] - public void TelemetryCommonPropertiesShouldReturnHashedMachineId() - { - var unitUnderTest = new TelemetryCommonProperties(getMACAddress: () => "plaintext", userLevelCacheWriter: new NothingCache()); - unitUnderTest.GetTelemetryCommonProperties()["Machine ID"].Should().NotBe("plaintext"); - } - - [Fact] - public void TelemetryCommonPropertiesShouldReturnNewGuidWhenCannotGetMacAddress() - { - var unitUnderTest = new TelemetryCommonProperties(getMACAddress: () => null, userLevelCacheWriter: new NothingCache()); - var assignedMachineId = unitUnderTest.GetTelemetryCommonProperties()["Machine ID"]; - - Guid.TryParse(assignedMachineId, out var _).Should().BeTrue("it should be a guid"); - } - - private class NothingCache : IUserLevelCacheWriter - { - public string RunWithCache(string cacheKey, Func getValueToCache) - { - return getValueToCache(); - } - } - } -} diff --git a/test/dotnet.Tests/TestCommandExtensions.cs b/test/dotnet.Tests/TestCommandExtensions.cs deleted file mode 100644 index e6618de2c..000000000 --- a/test/dotnet.Tests/TestCommandExtensions.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved.  -// Licensed under the MIT license. See LICENSE file in the project root for full license information.  - -using System.Runtime.InteropServices; -using Microsoft.DotNet.Tools.Test.Utilities; - -namespace Microsoft.DotNet.Tests -{ - public static class TestCommandExtensions - { - public static TestCommand WithUserProfileRoot(this TestCommand testCommand, string path) - { - var userProfileEnvironmentVariableName = GetUserProfileEnvironmentVariableName(); - return testCommand.WithEnvironmentVariable(userProfileEnvironmentVariableName, path); - } - - private static string GetUserProfileEnvironmentVariableName() - { - return RuntimeInformation.IsOSPlatform(OSPlatform.Windows) - ? "LocalAppData" - : "HOME"; - } - } -} diff --git a/test/dotnet.Tests/VersionTest.cs b/test/dotnet.Tests/VersionTest.cs deleted file mode 100644 index 3b0e1c92e..000000000 --- a/test/dotnet.Tests/VersionTest.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.IO; -using System.Collections.Generic; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.Cli; -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; -using FluentAssertions; - -namespace Microsoft.DotNet.Tests -{ - public class GivenDotnetSdk : TestBase - { - [Fact] - public void VersionCommandDisplaysCorrectVersion() - { - var versionFilePath = Path.Combine(AppContext.BaseDirectory, "ExpectedSdkVersion.txt"); - var version = GetVersionFromFile(versionFilePath); - - CommandResult result = new DotnetCommand() - .ExecuteWithCapturedOutput("--version"); - - result.Should().Pass(); - result.StdOut.Trim().Should().Be(version); - } - - private string GetVersionFromFile(string versionFilePath) - { - using (var reader = new StreamReader(File.OpenRead(versionFilePath))) - { - return reader.ReadLine(); - } - } - } -} diff --git a/test/dotnet.Tests/dotnet.Tests.csproj b/test/dotnet.Tests/dotnet.Tests.csproj deleted file mode 100644 index 66872e208..000000000 --- a/test/dotnet.Tests/dotnet.Tests.csproj +++ /dev/null @@ -1,69 +0,0 @@ - - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - dotnet.Tests - ../../tools/Key.snk - true - true - $(AssetTargetFallback);netstandardapp1.5;dotnet5.4;portable-net451+win8 - - - - - TestAssets/TestProjects/AppWithToolDependency/%(RecursiveDir)%(Filename)%(Extension) - PreserveNewest - PreserveNewest - - - TestAssets/TestProjects/DependencyContextFromTool/%(RecursiveDir)%(Filename)%(Extension) - PreserveNewest - PreserveNewest - - - - - - - $(IntermediateOutputPath)ExpectedSdkVersion.txt - - $(SdkVersion) - - $([System.IO.File]::ReadAllText($(ExpectedVersionFileInIntermediateFolder))) - - - false - true - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/msbuild.IntegrationTests/FakeRecordEventNameTelemetry.cs b/test/msbuild.IntegrationTests/FakeRecordEventNameTelemetry.cs deleted file mode 100644 index 091ededb3..000000000 --- a/test/msbuild.IntegrationTests/FakeRecordEventNameTelemetry.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Concurrent; -using System.Collections.Generic; -using Microsoft.DotNet.Cli; - -namespace Microsoft.DotNet.Cli.MSBuild.IntegrationTests -{ - public class FakeRecordEventNameTelemetry - { - public bool Enabled { get; set; } - - public string EventName { get; set; } - - public void TrackEvent(string eventName, - IDictionary properties, - IDictionary measurements) - { - LogEntries.Add( - new LogEntry - { - EventName = eventName, - Measurement = measurements, - Properties = properties - }); - } - - public ConcurrentBag LogEntries { get; set; } = new ConcurrentBag(); - - public class LogEntry - { - public string EventName { get; set; } - public IDictionary Properties { get; set; } - public IDictionary Measurement { get; set; } - } - } -} diff --git a/test/msbuild.IntegrationTests/GivenDotnetInvokesMSBuild.cs b/test/msbuild.IntegrationTests/GivenDotnetInvokesMSBuild.cs deleted file mode 100644 index af9b7d817..000000000 --- a/test/msbuild.IntegrationTests/GivenDotnetInvokesMSBuild.cs +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Tools.Test.Utilities; -using Xunit; -using System; -using System.IO; -using FluentAssertions; -using Microsoft.DotNet.TestFramework; -using Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.Cli.MSBuild.IntegrationTests -{ - public class GivenDotnetInvokesMSBuild : TestBase - { - [Theory] - [InlineData("build")] - [InlineData("clean")] - [InlineData("msbuild")] - [InlineData("pack")] - [InlineData("publish")] - [InlineData("test")] - public void When_dotnet_command_invokes_msbuild_Then_env_vars_and_m_are_passed(string command) - { - var testInstance = TestAssets.Get("MSBuildIntegration") - .CreateInstance(identifier: command) - .WithSourceFiles(); - - new DotnetCommand() - .WithWorkingDirectory(testInstance.Root) - .Execute(command) - .Should().Pass(); - } - - [Theory] - [InlineData("build")] - [InlineData("clean")] - [InlineData("msbuild")] - [InlineData("pack")] - [InlineData("publish")] - public void When_dotnet_command_invokes_msbuild_with_no_args_verbosity_is_set_to_minimum(string command) - { - var testInstance = TestAssets.Get("MSBuildIntegration") - .CreateInstance(identifier: command) - .WithSourceFiles(); - - var cmd = new DotnetCommand() - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput(command); - - cmd.Should().Pass(); - - cmd.StdOut - .Should().NotContain("Message with normal importance", "Because verbosity is set to minimum") - .And.Contain("Message with high importance", "Because high importance messages are shown on minimum verbosity"); - } - - [Theory] - [InlineData("build")] - [InlineData("clean")] - [InlineData("pack")] - [InlineData("publish")] - public void When_dotnet_command_invokes_msbuild_with_diag_verbosity_Then_arg_is_passed(string command) - { - var testInstance = TestAssets.Get("MSBuildIntegration") - .CreateInstance(identifier: command) - .WithSourceFiles(); - - var cmd = new DotnetCommand() - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput($"{command} -v diag"); - - cmd.Should().Pass(); - - cmd.StdOut.Should().Contain("Message with low importance"); - } - - [Fact] - public void When_dotnet_test_invokes_msbuild_with_no_args_verbosity_is_set_to_quiet() - { - var testInstance = TestAssets.Get("MSBuildIntegration") - .CreateInstance() - .WithSourceFiles(); - - var cmd = new DotnetCommand() - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput("test"); - - cmd.Should().Pass(); - cmd.StdOut.Should().NotContain("Message with high importance"); - } - - [Fact] - public void When_dotnet_msbuild_command_is_invoked_with_non_msbuild_switch_Then_it_fails() - { - var testInstance = TestAssets.Get("MSBuildIntegration") - .CreateInstance() - .WithSourceFiles(); - - var cmd = new DotnetCommand() - .WithWorkingDirectory(testInstance.Root) - .ExecuteWithCapturedOutput($"msbuild -v diag"); - - cmd.ExitCode.Should().NotBe(0); - } - - [Fact] - public void When_MSBuildSDKsPath_is_set_by_env_var_then_it_is_not_overridden() - { - var testInstance = TestAssets.Get("MSBuildIntegration") - .CreateInstance() - .WithSourceFiles(); - - var cmd = new DotnetCommand() - .WithWorkingDirectory(testInstance.Root) - .WithEnvironmentVariable("MSBuildSDKsPath", "AnyString") - .ExecuteWithCapturedOutput($"msbuild"); - - cmd.ExitCode.Should().NotBe(0); - - cmd.StdOut.Should().Contain("Expected 'AnyString") - .And.Contain("to exist, but it does not."); - } - } -} diff --git a/test/msbuild.IntegrationTests/msbuild.IntegrationTests.csproj b/test/msbuild.IntegrationTests/msbuild.IntegrationTests.csproj deleted file mode 100644 index 6f178d749..000000000 --- a/test/msbuild.IntegrationTests/msbuild.IntegrationTests.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) - true - msbuild.IntegrationTests - $(AssetTargetFallback);dotnet5.4;portable-net451+win8 - - - - - - - - - - - -