This commit is contained in:
jonsequitur 2017-03-09 18:36:05 -08:00
commit 58bf70a476
100 changed files with 845 additions and 376 deletions

View file

@ -1,6 +1,27 @@
Documents Index
===============
- [Developer Guide](developer-guide.md)
## Overview and general information
- [Intro to .NET Core CLI](intro-to-cli.md)
- [Addressing Incremental Compilation Warnings](addressing-incremental-compilation-warnings.md)
- [CLI UX Guidelines](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)

View file

@ -1,17 +0,0 @@
Addressing Incremental Compilation Warnings
===========================================
Incremental compilation is unsafe when compilation relies on tools with potential side effects (tools that can cause data races or modify the state of other projects that have been deemed safe to skip compilation. Or tools that integrate timestamps or GUIDs into the build output).
The presence of such cases will turn off incremental compilation.
The following represent warning codes printed by CLI when the project structure is unsafe for incremental build and advice on how to address them:
- __[Pre / Post scripts]__: Scripts that run before and after each compiler invocation can introduce side effects that could cause incremental compilation to output corrupt builds (not building when it should have built) or to over-build. Consider modifying the project structure to run these scripts before / after the entire compile process, not between compiler invocations.
- __[PATH probing]__: Resolving tool names from PATH is problematic. First, we cannot detect when PATH tools change (which would to trigger re-compilation of sources). Second, it adds machine specific dependencies which would cause the build to succeed on some machines and fail on others. Consider using NuGet packages instead of PATH resolved tools. Thus there would be no machine specific dependencies and we would be able track when NuGet packages change and therefore trigger re-compilation.
- __[Unknown Compiler]__: csc, vbc, and fsc have known side effects (which files and directories they read, write, and what they are not reading/writing).
We dont know this for other compilers. So we choose to be safe and disable incremental compilation for now. We are planning to enable specification of tool side effects in a future version, so that they can participate in incremental compilation as well.
- __[Forced Unsafe]__: The build was not incremental because the `--no-incremental` flag was used. Remove this flag to enable incremental compilation.

View file

@ -1,4 +0,0 @@
CLI native prerequisites
=========================
This document now lives in the [.NET Core native pre-requisities document](https://github.com/dotnet/core/blob/master/Documentation/prereqs.md) in the dotnet/core repository.

View file

@ -1,44 +0,0 @@
dotnet-test communication protocol
===================================
## Introduction
Anytime you pass a port to dotnet test, the command will run in design time. That means that dotnet test will connect to that port
using TCP and will then exchange an established set of messages with whatever else is connected to that port. When this happens, the runner
also receives a new port 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. The
command needs to send the adapter structure messages containing the results of the test execution.
### Communication protocol at design time.
1. 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.
2. Once dotnet test starts, it sends a TestSession.Connected message to the adapter indicating that it is ready to receive messages.
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.
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 serialize/deseralize the information in the description of the protocol.
#### Test Execution
![alt tag](./images/DotnetTestExecuteTests.png)
1. 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.
1. 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.
2. At this point, the adapter can launch the runner (and attach to it for debugging if it chooses to).
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.
4. 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.
5. 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.
6. After all tests finish, the runner sends a TestRunner.Completed message to dotnet test, which dotnet test sends as TestExecution.Completed to the adapter.
7. Once the adapter is done, it sends dotnet test a TestSession.Terminate which will cause dotnet test to shutdown.
#### Test discovery
![alt tag](./images/DotnetTestDiscoverTests.png)
1. 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.
2. 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.
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.
4. Once the adapter is done, it sends dotnet test a TestSession.Terminate which will cause dotnet test to shutdown.

View file

@ -0,0 +1,157 @@
.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 \<PROJECT\> reference \<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:\<target\>” and “/target:\<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 commands verbosity levels cannot fit naturally in [MSBuilds 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 doesnt 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”

View file

@ -0,0 +1,62 @@
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.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

View file

@ -1,100 +0,0 @@
Intro 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.
- Runtime agnostic.
- Simple extensibility and layering - "you had one job!"
- Cross-platform - support and personality.
- Outside-in philosophy - higher-level tools drive the CLI.
Historical Context - DNX
========================
We've been using [DNX](http://blogs.msdn.com/b/dotnet/archive/2015/04/29/net-announcements-at-build-2015.aspx#dnx) for all .NET Core scenarios for nearly two years. It provides a lot of great experiences, but doesn't have great "pay for play" characteristics. DNX is a big leap from building the [CoreCLR](https://github.com/dotnet/coreclr) and [CoreFX](https://github.com/dotnet/corefx) repos and wanting to build an app with a simple environment. In fact, one of the open source contributors to CoreCLR said: "I can build CoreCLR, but I don't know how to build 'Hello World'." We cannot have that!
.NET Core includes three new components: a set of standalone command-line (CLI) tools, a shared framework and a set of runtime services. These components will replace DNX and are essentially DNX split in three parts.
The DNX services will be offered as a hosting option available to apps. You can opt to use a host that offers one or more of these services, like file change watching or NuGet package servicing. You can also opt to use a shared framework, to ease deployment of dependencies and for performance reasons. Some of this is still being designed and isn't yet implemented.
ASP.NET 5 will transition to the new tools for RC2. This is already in progress. There will be a smooth transition from DNX to these new .NET Core components.
Experience
==========
The [CLI 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. Same as `dnx run`.
**dotnet build**
`dotnet build --native` native compiles your app into a single executable file.
`dotnet build` compiles your app or library as an IL binary. In the case of an app, `build` generates runnable assets by copying an executable host to make the IL binary runable. The host relies on a shared framework for dependencies, including a runtime.
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).
This is also the basics of the current extensibility model of the toolchain. Any executable found in the PATH named in this way, that is as `dotnet-{command}`, will be invoked by the `dotnet` driver.
There are some principles that we are using when adding new commands:
* Each command is represented by a verb (`run`, `build`, `publish`, `restore` etc.)
* We support the short and the long form of switches for most commands
* The switches have the same format on all supported platforms (so, no /-style switches on Windows for example)
* Each command has a help that can be viewed by running `dotnet [command] --help`
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.
Adding a new command locally
============================
Given the extensibility model described above, it is very easy to add a command that can be invoked with the `dotnet` driver. Just add any executable in a PATH and name it as per the instructions above.
As an example, let's say we want to add a local command that will mimic `dotnet clean`. By convention, `dotnet build` will drop binaries in two directories `./bin` and `./obj`. A clean command thus will need to delete these two directories. A trivial example, but it should work.
On *nix OS-es, we will write a very simple shell script to help us with this:
```shell
#!/bin/bash
rm -rf bin/ obj/
```
We then do the following to make it be a command in the CLI toolchain
* Name it as `dotnet-clean`
* Set the executable bit on: `chmod +X dotnet-clean`
* Copy it over somewhere in the $PATH: `sudo cp dotnet-clean /usr/local/bin`
After this, the command ready to be invoked via the `dotnet` driver.
Guidances 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, i.e. 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 above in the [design section](#design) to have an unified user experience for your users.

View file

@ -1,4 +0,0 @@
Known issues & workarounds
==========================
This document now lives in the [known issues document](https://github.com/dotnet/core/blob/master/cli/known-issues.md) in the dotnet/core repository.

View file

@ -126,8 +126,8 @@ Below table shows the mapping between the channels, branches and feeds for the D
| Channel | Branch | Debian feed | Debian package name | NuGet version | NuGet feed |
|------------ |----------- |------------- |--------------------- |--------------- |--------------------------------------- |
| Future | master | Development | dotnet-future | 1.0.0-dev-* | https://dotnet.myget.org/f/dotnet-cli |
| Preview | rel/<ver> | Development | dotnet | 1.0.0-beta-* | https://dotnet.myget.org/f/dotnet-cli |
| Production | production/<ver> | Production | dotnet | 1.0.0 | https://api.nuget.org/v3/index.json |
| Preview | rel/<ver> | Development | dotnet-dev-<version> | 1.0.0-beta-* | https://dotnet.myget.org/f/dotnet-cli |
| Production | rel/<ver> | Production | dotnet-dev-<version> | 1.0.0 | https://api.nuget.org/v3/index.json |
## Funnels and discovery mechanisms for CLI bits
@ -203,20 +203,29 @@ The features the script needs to support/have are:
* Support specifying whether the debug package needs to be downloaded
* Automatically add the install to $PATH unless --no-path/-NoPath is present
The installation script exists in this repo under `scripts/obtain` path. However, for most users it is reccomended 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 | "preview" | Which channel (i.e. "Future", "preview", "production", "release/1.1.0") to install from. |
| --version | -Version | global.json or Latest | Which version of CLI to install; you need to specify the version as 3-part version (i.e. 1.0.0-13232). If omitted, it will default to the first global.json that contains the sdkVersion property; if that is not present it will use Latest. |
| --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%`. |
| --debug | -Debug | false | Whether to use the "fat" packages that contain debugging symbols or not. |
| --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. |
| dotnet-install.sh arg (Linux, OSX) | dotnet-install.ps1 arg (Windows) | Defaults | Description |
|------------------------------------|----------------------------------|-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| --channel | -Channel | "production" | Which channel (i.e. "Future", "preview", "production", "release/1.1.0") 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). If omitted, it will default to Latest for that channel. |
| --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%`. |
| --debug-symbols | -DebugSymbols | false | Whether to use the "fat" packages that contain debugging symbols or not. |
| --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 (`<auto>`) | Architecture to install. The possible values are `<auto>`, `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.
> 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

View file

@ -1,4 +0,0 @@
Supported OS Matrix for CLI
===========================
The supported matrix now lives in the [roadmap document](https://github.com/dotnet/core/blob/master/roadmap.md) in the dotnet/core repository.

View file

@ -4,22 +4,12 @@
This repo contains the source code for cross-platform [.NET Core](http://github.com/dotnet/core) command line toolchain. It contains the implementation of each command, the native packages for various supported platforms as well as documentation.
RC 4 release - MSBuild based tools
---------------------------------------
As was outlined in the ["Changes to project.json" blog post](https://blogs.msdn.microsoft.com/dotnet/2016/05/23/changes-to-project-json/), we have started work to move away from project.json to csproj and MSBuild. All the new `latest` releases from this repo (from `rel/1.0.0` branch) are MSBuild-enabled tools.
Looking for V1 of the .NET Core tooling?
----------------------------------------
If you are looking for the v1.0.1 release of the .NET Core tools (CLI, MSBuild and the new csproj), head over to https://dot.net/core and download!
The current official release of the csproj-enabled CLI tools is **CLI RC 4**.
There are a couple of things to keep in mind:
* RC 4 CLI bits are still **in development** so some rough edges are to be expected.
* RC 4 bits **do not support** project.json so you will have to either keep Preview 2 tools around or migrate your project or add a global.json file to your project to target preview2. You can find more information on this using the [project.json to csproj instructions](https://github.com/dotnet/cli/blob/rel/1.0.0/Documentation/ProjectJsonToCSProj.md).
* RC 4 refers to the **CLI tools only** and does not cover Visual Studio, VS Code or Visual Studio for Mac.
* We welcome any and all issues that relate to MSBuild-based tools, so feel free to try them out and leave comments and file any bugs/problems.
### Download links
* Instructions and links for download: [RC3 download links](https://github.com/dotnet/core/blob/master/release-notes/rc3-download.md).
* Directory for future Preview release notes: [.NET Core release notes](https://github.com/dotnet/core/tree/master/release-notes).
> **Note:** the master branch of the CLI repo is based on the upcoming v2 of .NET Core and is considered pre-release. For production-level usage, please use the
> v1 of the tools.
Found an issue?
---------------
@ -32,9 +22,9 @@ This project has adopted the code of conduct defined by the [Contributor Covenan
Build Status
------------
|Ubuntu 14.04 / Linux Mint 17 |Ubuntu 16.04 |Debian 8.2 |Windows x64 |Windows x86 |Mac OS X |CentOS 7.1 / Oracle Linux 7.1 |RHEL 7.2 |
|:------:|:------:|:------:|:------:|:------:|:------:|:------:|:------:|
|[![][ubuntu-14.04-build-badge]][ubuntu-14.04-build]|[![][ubuntu-16.04-build-badge]][ubuntu-16.04-build]|[![][debian-8.2-build-badge]][debian-8.2-build]|[![][win-x64-build-badge]][win-x64-build]|[![][win-x86-build-badge]][win-x86-build]|[![][osx-build-badge]][osx-build]|[![][centos-build-badge]][centos-build]|[![][rhel-build-badge]][rhel-build]|
|Ubuntu 14.04 / Linux Mint 17 |Ubuntu 16.04 |Debian 8.2 |Windows x64 |Windows x86 |Mac OS X |CentOS 7.1 / Oracle Linux 7.1 |RHEL 7.2 | Linux x64 |
|:------:|:------:|:------:|:------:|:------:|:------:|:------:|:------:|:------:|
|[![][ubuntu-14.04-build-badge]][ubuntu-14.04-build]|[![][ubuntu-16.04-build-badge]][ubuntu-16.04-build]|[![][debian-8.2-build-badge]][debian-8.2-build]|[![][win-x64-build-badge]][win-x64-build]|[![][win-x86-build-badge]][win-x86-build]|[![][osx-build-badge]][osx-build]|[![][centos-build-badge]][centos-build]|[![][rhel-build-badge]][rhel-build]|[![][linux-build-badge]][linux-build]|
[win-x64-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/5449/badge
[win-x64-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=5449
@ -60,6 +50,9 @@ Build Status
[rhel-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/5446/badge
[rhel-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=5446
[linux-build-badge]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/5603/badge
[linux-build]: https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=5603
Installers and Binaries
-----------------------
@ -80,6 +73,7 @@ In order to download just the .NET Core runtime without the SDK, please visit ht
| **Mac OS X** | [Installer][osx-installer] - [Checksum][osx-installer-checksum]<br>[tar.gz][osx-targz] - [Checksum][osx-targz-checksum] |
| **CentOS 7.1 / Oracle Linux 7** | [tar.gz][centos-targz] - [Checksum][centos-targz-checksum] |
| **RHEL 7.2** | [tar.gz][rhel-targz] - [Checksum][rhel-targz-checksum] |
| **Linux x64** | [tar.gz][linux-targz] - [Checksum][linux-targz-checksum] |
*Note: Our Debian packages are put together slightly differently than the other OS specific installers. Instead of combining everything, we have separate component packages that depend on each other. If you're installing these directly from the .deb files (via dpkg or similar), then you'll need to install the [corresponding Host, Host FX Resolver, and Shared Framework packages](https://github.com/dotnet/core-setup#daily-builds) before installing the Sdk package.*
@ -119,6 +113,9 @@ In order to download just the .NET Core runtime without the SDK, please visit ht
[rhel-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-rhel-x64.latest.tar.gz
[rhel-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-rhel-x64.latest.tar.gz.sha
[linux-targz]: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-linux-x64.latest.tar.gz
[linux-targz-checksum]: https://dotnetclichecksums.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-linux-x64.latest.tar.gz.sha
Docker
------

View file

@ -1,10 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net451</TargetFrameworks>
<OutputType>Exe</OutputType>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">$(PackageTargetFallback);portable-net45+win8;dnxcore50</PackageTargetFallback>
<RuntimeIdentifiers>win7-x64;win7-x86;osx.10.10-x64;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64</RuntimeIdentifiers>
<RuntimeFrameworkVersion>2.0.0-beta-001509-00</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>
</PropertyGroup>
<ItemGroup>

View file

@ -1,9 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeFrameworkVersion>2.0.0-beta-001509-00</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>
</PropertyGroup>
<ItemGroup>

View file

@ -1,4 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
@ -6,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
<ItemGroup>

View file

@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net451;netcoreapp2.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
<ItemGroup>

View file

@ -1,10 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net451;netcoreapp2.0;netstandard1.4</TargetFrameworks>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
</Project>

View file

@ -1,10 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
</Project>

View file

@ -1,10 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
</Project>

View file

@ -1,9 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net452;netcoreapp2.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
</Project>

View file

@ -1,9 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net451;netcoreapp1.0;netstandard1.4</TargetFrameworks>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
</Project>

View file

@ -1,10 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net451;netcoreapp1.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
<ItemGroup>

View file

@ -1,10 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net451;netcoreapp1.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
<ItemGroup>

View file

@ -1,10 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net451;netcoreapp1.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net451'" >
<ProjectReference Include="..\Lib\Lib.csproj" />

View file

@ -1,10 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net451;netcoreapp1.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
<SomeItemCausingThisGroupToNotBeUniform Include="foo" />

View file

@ -1,10 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net451;netcoreapp1.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
<ItemGroup>

View file

@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "FolderHasDifferentName", "FolderHasDifferentName.xproj", "{0138CB8F-4AA9-4029-A21E-C07C30F425BA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0138CB8F-4AA9-4029-A21E-C07C30F425BA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.23107" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.23107</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>0138cb8f-4aa9-4029-a21e-c07c30f425ba</ProjectGuid>
<RootNamespace>TestAppWithContents</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\..\artifacts\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

View file

@ -0,0 +1,16 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
namespace TestApp
{
public class Program
{
public static int Main(string[] args)
{
Console.WriteLine("Hello World");
return 0;
}
}
}

View file

@ -0,0 +1,26 @@
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"dependencies": {
"Microsoft.NETCore.App": "1.0.1"
},
"frameworks": {
"netcoreapp1.0": {}
},
"runtimes": {
"win7-x64": {},
"win7-x86": {},
"osx.10.10-x64": {},
"osx.10.11-x64": {},
"ubuntu.14.04-x64": {},
"ubuntu.16.04-x64": {},
"centos.7-x64": {},
"rhel.7.2-x64": {},
"debian.8-x64": {},
"fedora.23-x64": {},
"opensuse.13.2-x64": {}
}
}

View file

@ -1,10 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<GeneratedPackageId>random-name</GeneratedPackageId>
<RuntimeFrameworkVersion>2.0.0-beta-001509-00</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>
</PropertyGroup>
<ItemGroup>

View file

@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<OutputType>Exe</OutputType>
<RuntimeFrameworkVersion>2.0.0-beta-001509-00</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>
</PropertyGroup>
<ItemGroup>

View file

@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<OutputType>Exe</OutputType>
<RuntimeFrameworkVersion>2.0.0-beta-001509-00</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>
</PropertyGroup>
<ItemGroup>

View file

@ -1,4 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net451;netcoreapp2.0</TargetFrameworks>
@ -8,7 +10,7 @@
<PackageReference Include="dotnet-desktop-and-portable" Version="1.0.0-*" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
<ItemGroup>

View file

@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<OutputType>Exe</OutputType>
<RuntimeFrameworkVersion>2.0.0-beta-001509-00</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>
</PropertyGroup>
<ItemGroup>

View file

@ -1,4 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<VersionPrefix>1.0.0</VersionPrefix>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
@ -9,7 +11,7 @@
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
<ItemGroup>

View file

@ -0,0 +1,3 @@
<CacheArtifacts>
<Package Id="FluentAssertions" Version ="4.12.0"/>
</CacheArtifacts>

View file

@ -0,0 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<PackageReference Include="FluentAssertions" Version ="4.12.0"/>
</ItemGroup>
</Project>

View file

@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net451;netcoreapp2.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
</Project>

View file

@ -1,4 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net451;netcoreapp2.0</TargetFrameworks>
@ -8,7 +10,7 @@
<PackageReference Include="dotnet-desktop-and-portable" Version="1.0.0-*" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
<ItemGroup>

View file

@ -1,9 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeIdentifiers>win7-x64;win7-x86;osx.10.10-x64;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64</RuntimeIdentifiers>
<RuntimeFrameworkVersion>2.0.0-beta-001509-00</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>
</PropertyGroup>
<ItemGroup>

View file

@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NewtonSoft.Json" Version="9.0.1" />
<PackageReference Include="FluentAssertions" Version="4.12.0" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,24 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
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());
}
}

View file

@ -1,7 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<OutputType>Exe</OutputType>
<RuntimeFrameworkVersion>2.0.0-beta-001509-00</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>
</PropertyGroup>
</Project>

View file

@ -1,4 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
@ -9,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
</Project>

View file

@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
</Project>

View file

@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeFrameworkVersion>2.0.0-beta-001509-00</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>
</PropertyGroup>
<ItemGroup>

View file

@ -1,4 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
@ -9,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
</Project>

View file

@ -1,4 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
@ -9,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
</Project>

View file

@ -1,4 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
@ -9,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
</Project>

View file

@ -1,10 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
</Project>

View file

@ -1,4 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
@ -9,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
</Project>

View file

@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
</Project>

View file

@ -1,4 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
@ -9,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
</Project>

View file

@ -1,4 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
@ -13,7 +15,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
</Project>

View file

@ -1,4 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
@ -13,7 +15,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
</Project>

View file

@ -1,10 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
</Project>

View file

@ -1,4 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
@ -9,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
</Project>

View file

@ -1,5 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
@ -10,7 +11,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<RuntimeFrameworkVersion>2.0.0-beta-001509-00</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>
</ItemGroup>
<ItemGroup>

View file

@ -1,9 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeFrameworkVersion>2.0.0-beta-001509-00</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>
</PropertyGroup>
<ItemGroup>

View file

@ -1,5 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
@ -13,7 +13,7 @@
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-beta-001509-00" />
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
<ItemGroup>

View file

@ -1,9 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeFrameworkVersion>2.0.0-beta-001509-00</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>
</PropertyGroup>
<ItemGroup>

View file

@ -20,7 +20,7 @@
DependsOnTargets="MSBuildWorkaroundTarget;
RestoreDotnetCliBuildFramework">
<Exec Command="$(DotnetStage0) publish -o $(DotnetCliBuildDirectory)/bin --framework netcoreapp1.0 /p:GeneratingPropsFile=true"
<Exec Command="$(DotnetStage0) publish -o $(DotnetCliBuildDirectory)/bin --framework netcoreapp1.0 /p:GeneratePropsFile=$(GeneratePropsFile)"
WorkingDirectory="$(DotnetCliBuildDirectory)"/>
</Target>
@ -35,7 +35,7 @@
Outputs="@(RestoreDotnetCliBuildFrameworkOutputs)">
<PropertyGroup>
<ExtraRestoreArgs Condition=" '$(GeneratingPropsFile)' == 'true' ">$(ExtraRestoreArgs) /p:GeneratingPropsFile=$(GeneratingPropsFile)</ExtraRestoreArgs>
<ExtraRestoreArgs>$(ExtraRestoreArgs) /p:GeneratePropsFile=$(GeneratePropsFile)</ExtraRestoreArgs>
<ExtraRestoreArgs Condition="'$(OS)' != 'Windows_NT'">$(ExtraRestoreArgs) --disable-parallel</ExtraRestoreArgs>
</PropertyGroup>
@ -47,6 +47,7 @@
<Import Project="build/GitCommitInfo.targets" />
<Import Project="build/HostInfo.targets" />
<Import Project="build/BuildInfo.targets" />
<Import Project="build/Prepare.targets" />
<Import Project="build/Compile.targets" />
<Import Project="build/Package.targets" />

View file

@ -1,6 +1,6 @@
<Project ToolsVersion="14.0">
<PropertyGroup>
<SdkBrandName>Microsoft .NET Core 2.0.0 - SDK Alpha</SdkBrandName>
<SdkBrandName>Microsoft .NET Core 2.0.0 - SDK Preview 1</SdkBrandName>
<SharedFrameworkBrandName>Microsoft .NET Core 2.0.0 - Runtime</SharedFrameworkBrandName>
<SharedHostBrandName>Microsoft .NET Core 2.0.0 - Host</SharedHostBrandName>
<HostFxrBrandName>Microsoft .NET Core 2.0.0 - Host FX Resolver</HostFxrBrandName>

View file

@ -2,7 +2,12 @@
<PropertyGroup>
<CLITargets Condition=" '$(CLITargets)' == '' ">Prepare;Compile;Test;Package;Publish</CLITargets>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<IncludeAdditionalSharedFrameworks Condition=" '$(IncludeAdditionalSharedFrameworks)' == '' ">true</IncludeAdditionalSharedFrameworks>
<HasAdditionalSharedFramework Condition="'$(Rid)' != 'linux-x64' AND
'$(Rid)' != 'ubuntu.16.10-x64' AND
'$(Rid)' != 'fedora.24-x64' AND
'$(Rid)' != 'opensuse.42.1-x64'">true</HasAdditionalSharedFramework>
<IncludeAdditionalSharedFrameworks Condition=" '$(IncludeAdditionalSharedFrameworks)' == '' AND '$(HasAdditionalSharedFramework)' == 'true' ">true</IncludeAdditionalSharedFrameworks>
<IncludeAdditionalSharedFrameworks Condition=" '$(IncludeAdditionalSharedFrameworks)' == '' ">false</IncludeAdditionalSharedFrameworks>
<IncludeNuGetPackageArchive Condition=" '$(IncludeNuGetPackageArchive)' == '' ">true</IncludeNuGetPackageArchive>
<SkipBuildingInstallers Condition=" '$(SkipBuildingInstallers)' == '' ">false</SkipBuildingInstallers>
</PropertyGroup>

39
build/BuildInfo.targets Normal file
View file

@ -0,0 +1,39 @@
<Project ToolsVersion="15.0">
<Target Name="WriteBuildInfoProps"
DependsOnTargets="BuildDotnetCliBuildFramework">
<GetCurrentRuntimeInformation>
<Output TaskParameter="Rid" PropertyName="HostRid" />
<Output TaskParameter="OSName" PropertyName="HostOSName" />
</GetCurrentRuntimeInformation>
<PropertyGroup>
<Rid Condition=" '$(Rid)' == '' ">$(HostRid)</Rid>
<Architecture Condition=" '$(Architecture)' == '' ">x64</Architecture>
<OSName Condition=" '$(OSName)' == '' ">$(HostOSName)</OSName>
<BuildInfoPropsContent>
&lt;Project ToolsVersion=&quot;15.0&quot;&gt;
&lt;PropertyGroup&gt;
&lt;Rid&gt;$(Rid)&lt;/Rid&gt;
&lt;Architecture&gt;$(Architecture)&lt;/Architecture&gt;
&lt;OSName&gt;$(OSName)&lt;/OSName&gt;
&lt;/PropertyGroup&gt;
&lt;/Project&gt;
</BuildInfoPropsContent>
<ExistingBuildInfoPropsContent Condition=" Exists('$(BuildInfoProps)') ">
$([System.IO.File]::ReadAllText($(BuildInfoProps)))
</ExistingBuildInfoPropsContent>
<ShouldOverwriteBuildInfoPropsFile>false</ShouldOverwriteBuildInfoPropsFile>
<ShouldOverwriteBuildInfoPropsFile
Condition=" '$(ExistingBuildInfoPropsContent.Trim())' != '$(BuildInfoPropsContent.Trim())' ">true</ShouldOverwriteBuildInfoPropsFile>
</PropertyGroup>
<WriteLinesToFile File="$(BuildInfoProps)"
Lines="$(BuildInfoPropsContent)"
Condition=" '$(ShouldOverwriteBuildInfoPropsFile)' == 'true' "
Overwrite="true" />
</Target>
</Project>

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CLI_SharedFrameworkVersion>2.0.0-beta-001675-00</CLI_SharedFrameworkVersion>
<CLI_SharedFrameworkVersion>2.0.0-beta-001697-00</CLI_SharedFrameworkVersion>
<CLI_MSBuild_Version>15.2.0-preview-000047-02</CLI_MSBuild_Version>
<CLI_Roslyn_Version>2.0.0-rc4-61325-08</CLI_Roslyn_Version>
<CLI_NETSDK_Version>1.1.0-alpha-20170303-2</CLI_NETSDK_Version>
<CLI_NETSDK_Version>1.1.0-alpha-20170306-2</CLI_NETSDK_Version>
<CLI_NuGet_Version>4.3.0-beta1-2342</CLI_NuGet_Version>
<CLI_WEBSDK_Version>1.0.0-alpha-20170130-3-281</CLI_WEBSDK_Version>
<CLI_TestPlatform_Version>15.0.0</CLI_TestPlatform_Version>

View file

@ -10,10 +10,17 @@
<Output TaskParameter="ConsoleOutput" PropertyName="GitInfoCommitHash" />
</Exec>
<ItemGroup>
<GitInfoCommitCountLines Include="$(GitInfoCommitCount)" />
<GitInfoCommitHashLines Include="$(GitInfoCommitHash)" />
</ItemGroup>
<PropertyGroup>
<ShouldOverWriteThePropsFile
Condition=" '$(CommitCount)' != '$(GitInfoCommitCount)' Or
'$(CommitHash)' != '$(GitInfoCommitHash)' ">true</ShouldOverWriteThePropsFile>
<!-- Batching in GitInfoCommitCount and GitInfoCommitHash here ensures that the property contains only the last line of the output -->
<GitInfoCommitCount>%(GitInfoCommitCountLines.Identity)</GitInfoCommitCount>
<GitInfoCommitCount>$(GitInfoCommitCount.PadLeft(6,'0'))</GitInfoCommitCount>
<GitInfoCommitHash>%(GitInfoCommitHashLines.Identity)</GitInfoCommitHash>
<GitCommitInfoPropsContent>
&lt;Project ToolsVersion=&quot;15.0&quot;&gt;
@ -23,11 +30,19 @@
&lt;/PropertyGroup&gt;
&lt;/Project&gt;
</GitCommitInfoPropsContent>
<ExistingGitCommitInfoProps Condition=" Exists('$(GitCommitInfoProps)') ">
$([System.IO.File]::ReadAllText($(GitCommitInfoProps)))
</ExistingGitCommitInfoProps>
<ShouldOverwriteGitCommitInfoPropsFile>false</ShouldOverwriteGitCommitInfoPropsFile>
<ShouldOverwriteGitCommitInfoPropsFile
Condition=" '$(ExistingGitCommitInfoProps.Trim())' != '$(GitCommitInfoPropsContent.Trim())' ">true</ShouldOverwriteGitCommitInfoPropsFile>
</PropertyGroup>
<WriteLinesToFile File="$(GitCommitInfoProps)"
Lines="$(GitCommitInfoPropsContent)"
Condition=" '$(ShouldOverwriteThePropsFile)' == 'true' "
Condition=" '$(ShouldOverwriteGitCommitInfoPropsFile)' == 'true' "
Overwrite="true" />
</Target>
</Project>

View file

@ -2,10 +2,9 @@
<Target Name="WriteHostInfoProps"
Condition=" !Exists('$(HostInfoProps)') "
DependsOnTargets="BuildDotnetCliBuildFramework">
<!-- Current Runtime Information -->
<GetCurrentRuntimeInformation>
<Output TaskParameter="Rid" PropertyName="HostRid" />
<Output TaskParameter="Architecture" PropertyName="HostArchitecture" />
<Output TaskParameter="OSName" PropertyName="HostOSName" />
</GetCurrentRuntimeInformation>
@ -13,9 +12,8 @@
<HostInfoPropsContent>
&lt;Project ToolsVersion=&quot;15.0&quot;&gt;
&lt;PropertyGroup&gt;
&lt;Rid&gt;$(HostRid)&lt;/Rid&gt;
&lt;Architecture&gt;$(HostArchitecture)&lt;/Architecture&gt;
&lt;OSName&gt;$(HostOSName)&lt;/OSName&gt;
&lt;HostRid&gt;$(HostRid)&lt;/HostRid&gt;
&lt;HostOSName&gt;$(HostOSName)&lt;/HostOSName&gt;
&lt;/PropertyGroup&gt;
&lt;/Project&gt;
</HostInfoPropsContent>

View file

@ -3,5 +3,6 @@
<GeneratedPropsDir>$(RepoRoot)/artifacts/obj</GeneratedPropsDir>
<GitCommitInfoProps>$(GeneratedPropsDir)/GitCommitInfo.props</GitCommitInfoProps>
<HostInfoProps>$(GeneratedPropsDir)/HostInfo.props</HostInfoProps>
<BuildInfoProps>$(GeneratedPropsDir)/BuildInfo.props</BuildInfoProps>
</PropertyGroup>
</Project>

View file

@ -3,7 +3,8 @@
DependsOnTargets="BuildDotnetCliBuildFramework;
EnsureGeneratedPropsDirectory;
WriteGitCommitInfoProps;
WriteHostInfoProps"/>
WriteHostInfoProps;
WriteBuildInfoProps"/>
<Target Name="EnsureGeneratedPropsDirectory">
<MakeDir Condition=" !Exists('$(GeneratedPropsDir)') "

View file

@ -7,11 +7,19 @@
DependsOnTargets="Init;DownloadHostAndSharedFxArtifacts;RestoreSrcPackages;RestoreToolsPackages" />
<Target Name="Init"
DependsOnTargets="SetTelemetryProfile;
DependsOnTargets="PrintBuildInfo;
SetTelemetryProfile;
BuildDotnetCliBuildFramework;
CheckPrereqs;">
</Target>
<Target Name="PrintBuildInfo">
<Message Text="Host info - Rid: $(HostRid), OSName: $(HostOSName)" Importance="High" />
<Message Text="Build info - Rid: $(Rid), Architecture: $(Architecture), OSName: $(OSName)" Importance="High" />
<Message Text="If you intended to use a different Rid, Architecture, or OSName run the following command to generate your build state:" Importance="High" />
<Message Text="dotnet msbuild build.proj /p:Architecture=Architecture /p:Rid=Rid /p:OSName=OSName /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles" Importance="High" />
</Target>
<Target Name="SetTelemetryProfile"
DependsOnTargets="BuildDotnetCliBuildFramework" >
<SetEnvVar Name="DOTNET_CLI_TELEMETRY_PROFILE" Value="$(DOTNET_CLI_TELEMETRY_PROFILE);https://github.com/dotnet/cli;$(CommitHash)" />

View file

@ -3,7 +3,7 @@
<VersionMajor>2</VersionMajor>
<VersionMinor>0</VersionMinor>
<VersionPatch>0</VersionPatch>
<ReleaseSuffix>alpha</ReleaseSuffix>
<ReleaseSuffix>preview1</ReleaseSuffix>
<CliVersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)-$(ReleaseSuffix)</CliVersionPrefix>
<SimpleVersion Condition=" '$(DropSuffix)' == '' ">$(VersionMajor).$(VersionMinor).$(VersionPatch).$(CommitCount)</SimpleVersion>

View file

@ -1,7 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeFrameworkVersion>2.0.0-beta-001509-00</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>
</PropertyGroup>
<ItemGroup>
<DotNetCliToolReference Include="dotnet-deb-tool" Version="2.0.0-*" />

View file

@ -57,6 +57,7 @@ namespace Microsoft.DotNet.Cli.Build
{ "osx_x64", false },
{ "debian_x64", false },
{ "centos_x64", false },
{ "linux_x64", false },
};
if (!badges.ContainsKey(VersionBadgeMoniker))

View file

@ -13,16 +13,12 @@ namespace Microsoft.DotNet.Cli.Build
[Output]
public string Rid { get; set; }
[Output]
public string Architecture { get; set; }
[Output]
public string OSName { get; set; }
public override bool Execute()
{
Rid = RuntimeEnvironment.GetRuntimeIdentifier();
Architecture = RuntimeEnvironment.RuntimeArchitecture;
OSName = GetOSShortName();
return true;

View file

@ -7,6 +7,9 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<OutputPath>bin\$(Configuration)</OutputPath>
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81</PackageTargetFallback>
<!-- Specify a RID so that the runtime package with crossgen will be restored -->
<RuntimeIdentifiers>$(CoreCLRRid)</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
@ -31,5 +34,9 @@
<PackageReference Include="Microsoft.Build.Framework" Version="$(CLI_MSBuild_Version)" />
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="$(PlatformAbstractionsVersion)" />
<PackageReference Include="Microsoft.DotNet.VersionTools" Version="$(VersionToolsVersion)" />
<!-- This will cause the package with crossgen in it to be restored -->
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
</ItemGroup>
</Project>

View file

@ -44,7 +44,7 @@ $env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH"
# Generate some props files that are imported by update-dependencies
Write-Host "Generating property files..."
dotnet msbuild $RepoRoot\build.proj /p:Architecture=$Architecture /p:GeneratingPropsFile=true /t:WriteDynamicPropsToStaticPropsFiles
dotnet msbuild $RepoRoot\build.proj /p:Architecture=$Architecture /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles
if($LASTEXITCODE -ne 0) { throw "Failed to generate intermidates" }
# Restore the app

View file

@ -44,7 +44,7 @@ export PATH=$DOTNET_INSTALL_DIR:$PATH
# Generate some props files that are imported by update-dependencies
echo "Generating property files..."
dotnet msbuild "$REPO_ROOT/build.proj" /p:Architecture=x64 /p:GeneratingPropsFile=true /t:WriteDynamicPropsToStaticPropsFiles
dotnet msbuild "$REPO_ROOT/build.proj" /p:Architecture=x64 /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles
echo "Resotring $PROJECT_PATH..."
dotnet restore "$PROJECT_PATH"

View file

@ -14,8 +14,9 @@
</PropertyGroup>
<Import Project="build/InitRepo.props" />
<Import Condition=" Exists('$(GitCommitInfoProps)') Or '$(GeneratingPropsFile)' != 'true' " Project="$(GitCommitInfoProps)" />
<Import Condition=" Exists('$(HostInfoProps)') Or '$(GeneratingPropsFile)' != 'true' " Project="$(HostInfoProps)" />
<Import Condition=" '$(GeneratePropsFile)' != 'true' " Project="$(GitCommitInfoProps)" />
<Import Condition=" '$(GeneratePropsFile)' != 'true' " Project="$(HostInfoProps)" />
<Import Condition=" '$(GeneratePropsFile)' != 'true' " Project="$(BuildInfoProps)" />
<Import Project="build/BranchInfo.props" />

View file

@ -9,7 +9,7 @@ def project = GithubProject
def branch = GithubBranchName
def isPR = true
def platformList = ['Debian8.2:x64:Debug', 'Ubuntu:x64:Release', 'Ubuntu16.04:x64:Debug', 'OSX:x64:Release', 'Windows_NT:x64:Release', 'Windows_NT:x86:Debug', 'RHEL7.2:x64:Release', 'CentOS7.1:x64:Debug']
def platformList = ['Linux:x64:Release', 'Debian8.2:x64:Debug', 'Ubuntu:x64:Release', 'Ubuntu16.04:x64:Debug', 'OSX:x64:Release', 'Windows_NT:x64:Release', 'Windows_NT:x86:Debug', 'RHEL7.2:x64:Release', 'CentOS7.1:x64:Debug']
def static getBuildJobName(def configuration, def os, def architecture) {
return configuration.toLowerCase() + '_' + os.toLowerCase() + '_' + architecture.toLowerCase()
@ -19,6 +19,7 @@ def static getBuildJobName(def configuration, def os, def architecture) {
platformList.each { platform ->
// Calculate names
def (os, architecture, configuration) = platform.tokenize(':')
def osUsedForMachineAffinity = os;
// Calculate job name
def jobName = getBuildJobName(configuration, os, architecture)
@ -34,6 +35,10 @@ platformList.each { platform ->
else if (os == 'Ubuntu') {
buildCommand = "./build.sh --skip-prereqs --configuration ${configuration} --docker ubuntu.14.04 --targets Default"
}
else if (os == 'Linux') {
osUsedForMachineAffinity = 'Ubuntu16.04';
buildCommand = "./build.sh --linux-portable --skip-prereqs --configuration ${configuration} --targets Default"
}
else {
// Jenkins non-Ubuntu CI machines don't have docker
buildCommand = "./build.sh --skip-prereqs --configuration ${configuration} --targets Default"
@ -53,9 +58,13 @@ platformList.each { platform ->
}
}
Utilities.setMachineAffinity(newJob, os, 'latest-or-auto')
Utilities.setMachineAffinity(newJob, osUsedForMachineAffinity, 'latest-or-auto')
Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
Utilities.addMSTestResults(newJob, '**/*.trx')
// Remove this check once tests work for 2.0. Until that time Linux portable tests will fail so we
// don't run the tests and there won't be any .trx file.
if (os != 'Linux') {
Utilities.addMSTestResults(newJob, '**/*.trx')
}
Utilities.addGithubPRTriggerForBranch(newJob, branch, "${os} ${architecture} ${configuration} Build")
}

View file

@ -114,7 +114,7 @@ if ($NoBuild)
}
else
{
dotnet msbuild build.proj /p:Architecture=$Architecture /p:GeneratingPropsFile=true /t:WriteDynamicPropsToStaticPropsFiles
dotnet msbuild build.proj /p:Architecture=$Architecture /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles
dotnet msbuild build.proj /m /v:diag /fl /flp:v=diag /p:Architecture=$Architecture $ExtraParameters
if($LASTEXITCODE -ne 0) { throw "Failed to build" }
}

View file

@ -55,6 +55,9 @@ source "$REPOROOT/scripts/common/_prettyprint.sh"
BUILD=1
LINUX_PORTABLE_INSTALL_ARGS=
CUSTOM_BUILD_ARGS=
# Set nuget package cache under the repo
export NUGET_PACKAGES="$REPOROOT/.nuget/packages"
@ -93,6 +96,12 @@ while [[ $# > 0 ]]; do
args=( "${args[@]/$2}" )
shift
;;
--linux-portable)
LINUX_PORTABLE_INSTALL_ARGS="--linux-portable"
# Until we get test support for 2.0 we need to pass in the targets without test.
CUSTOM_BUILD_ARGS="/p:Rid=\"linux-x64\" /p:OSName=\"linux\" /p:CLITargets=\"Prepare;Compile;Package;Publish\""
args=( "${args[@]/$1}" )
;;
--help)
echo "Usage: $0 [--configuration <CONFIGURATION>] [--targets <TARGETS...>] [--skip-prereqs] [--nopackage] [--docker <IMAGENAME>] [--help]"
echo ""
@ -102,6 +111,7 @@ while [[ $# > 0 ]]; do
echo " --nopackage Skip packaging targets"
echo " --nobuild Skip building, showing the command that would be used to build"
echo " --docker <IMAGENAME> Build in Docker using the Dockerfile located in scripts/docker/IMAGENAME"
echo " --linux-portable Builds the Linux portable .NET Tools instead of a distro-specific version."
echo " --help Display this help message"
exit 0
;;
@ -155,8 +165,8 @@ if [ $? != 0 ]; then
fi
# now execute the script
echo "installing CLI: $dotnetInstallPath --channel \"master\" --install-dir $DOTNET_INSTALL_DIR --architecture \"$ARCHITECTURE\""
$dotnetInstallPath --channel "master" --install-dir $DOTNET_INSTALL_DIR --architecture "$ARCHITECTURE"
echo "installing CLI: $dotnetInstallPath --channel \"master\" --install-dir $DOTNET_INSTALL_DIR --architecture \"$ARCHITECTURE\" $LINUX_PORTABLE_INSTALL_ARGS"
$dotnetInstallPath --channel "master" --install-dir $DOTNET_INSTALL_DIR --architecture "$ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS
if [ $? != 0 ]; then
echo "run-build: Error: Boot-strapping post-PJ stage0 with exit code $?." >&2
exit $?
@ -179,9 +189,9 @@ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
echo "${args[@]}"
if [ $BUILD -eq 1 ]; then
dotnet msbuild build.proj /p:Architecture=$ARCHITECTURE /p:GeneratingPropsFile=true /t:WriteDynamicPropsToStaticPropsFiles
dotnet msbuild build.proj /m /v:diag /fl /flp:v=diag /p:Architecture=$ARCHITECTURE "${args[@]}"
dotnet msbuild build.proj /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles
dotnet msbuild build.proj /m /v:diag /fl /flp:v=diag /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS "${args[@]}"
else
echo "Not building due to --nobuild"
echo "Command that would be run is: 'dotnet msbuild build.proj /m /p:Architecture=$ARCHITECTURE ${args[@]}'"
echo "Command that would be run is: 'dotnet msbuild build.proj /m /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS ${args[@]}'"
fi

View file

@ -9,6 +9,7 @@ using Microsoft.DotNet.Cli;
using System.Diagnostics;
using System;
using System.IO;
using System.Linq;
namespace Microsoft.DotNet.Tools.Cache
{
@ -31,9 +32,9 @@ namespace Microsoft.DotNet.Tools.Cache
app.ArgumentSeparatorHelpText = HelpMessageStrings.MSBuildAdditionalArgsHelpText;
app.HelpOption("-h|--help");
CommandOption projectArgument = app.Option(
CommandOption projectArguments = app.Option(
$"-e|--entries <{LocalizableStrings.ProjectEntries}>", LocalizableStrings.ProjectEntryDescription,
CommandOptionType.SingleValue);
CommandOptionType.MultipleValue);
CommandOption frameworkOption = app.Option(
$"-f|--framework <{LocalizableStrings.FrameworkOption}>", LocalizableStrings.FrameworkOptionDescription,
@ -70,13 +71,19 @@ namespace Microsoft.DotNet.Tools.Cache
{
msbuildArgs = new List<string>();
if (string.IsNullOrEmpty(projectArgument.Value()))
if (!projectArguments.HasValue())
{
throw new InvalidOperationException(LocalizableStrings.SpecifyEntries);
throw new InvalidOperationException(LocalizableStrings.SpecifyEntries).DisplayAsError();
}
msbuildArgs.Add("/t:ComposeCache");
msbuildArgs.Add(projectArgument.Value());
msbuildArgs.Add(projectArguments.Values[0]);
var additionalProjectsargs = projectArguments.Values.Skip(1);
if (additionalProjectsargs.Count() > 0)
{
msbuildArgs.Add($"/p:AdditionalProjects={string.Join("%3B", additionalProjectsargs)}");
}
if (!string.IsNullOrEmpty(frameworkOption.Value()))
{
@ -106,12 +113,12 @@ namespace Microsoft.DotNet.Tools.Cache
if (skipOptimizationOption.HasValue())
{
msbuildArgs.Add($"/p:SkipOptimization={skipOptimizationOption.HasValue()}");
msbuildArgs.Add($"/p:SkipOptimization=true");
}
if (preserveWorkingDir.HasValue())
{
msbuildArgs.Add($"/p:PreserveComposeWorkingDir={preserveWorkingDir.HasValue()}");
msbuildArgs.Add($"/p:PreserveComposeWorkingDir=true");
}
if (!string.IsNullOrEmpty(verbosityOption.Value()))

View file

@ -131,6 +131,7 @@ namespace Microsoft.DotNet.Tools.Migrate
}
var csprojFilesToAdd = new HashSet<string>();
var xprojFilesToRemove = new HashSet<string>();
var slnPathWithTrailingSlash = PathUtility.EnsureTrailingSlash(slnFile.BaseDirectory);
foreach (var report in migrationReport.ProjectMigrationReports)
@ -140,35 +141,35 @@ namespace Microsoft.DotNet.Tools.Migrate
slnPathWithTrailingSlash,
reportPathWithTrailingSlash);
var xprojPath = Path.Combine(relativeReportPath, report.ProjectName + ".xproj");
var xprojProjectsReferencedBySolution = slnFile.Projects.Where(p => p.FilePath == xprojPath);
var migratedProjectName = report.ProjectName + ".csproj";
if (xprojProjectsReferencedBySolution.Count() == 1)
{
var slnProject = xprojProjectsReferencedBySolution.Single();
slnProject.FilePath = Path.Combine(
Path.GetDirectoryName(slnProject.FilePath),
migratedProjectName);
slnProject.TypeGuid = ProjectTypeGuids.CSharpProjectTypeGuid;
}
else
{
var csprojPath = Path.Combine(relativeReportPath, migratedProjectName);
var solutionContainsCsprojPriorToMigration = slnFile.Projects
.Where(p => p.FilePath == csprojPath)
.Any();
var csprojPath = Path.Combine(relativeReportPath, migratedProjectName);
var solutionContainsCsprojPriorToMigration = slnFile.Projects
.Where(p => p.FilePath == csprojPath)
.Any();
if (!solutionContainsCsprojPriorToMigration)
{
csprojFilesToAdd.Add(Path.Combine(report.ProjectDirectory, migratedProjectName));
}
if (!solutionContainsCsprojPriorToMigration)
{
csprojFilesToAdd.Add(Path.Combine(report.ProjectDirectory, migratedProjectName));
}
foreach (var preExisting in report.PreExistingCsprojDependencies)
{
csprojFilesToAdd.Add(Path.Combine(report.ProjectDirectory, preExisting));
}
var projectDirectory = new DirectoryInfo(report.ProjectDirectory);
foreach (var xprojFileName in projectDirectory.EnumerateFiles("*.xproj"))
{
var xprojPath = Path.Combine(relativeReportPath, xprojFileName.Name);
var solutionContainsXprojFileToRemove = slnFile.Projects
.Where(p => p.FilePath == xprojPath)
.Any();
if (solutionContainsXprojFileToRemove)
{
xprojFilesToRemove.Add(Path.Combine(report.ProjectDirectory, xprojFileName.Name));
}
}
}
Version version;
@ -185,7 +186,12 @@ namespace Microsoft.DotNet.Tools.Migrate
foreach (var csprojFile in csprojFilesToAdd)
{
AddProject(slnFile.FullPath, csprojFile);
RunDotnetSlnCommand(slnFile.FullPath, csprojFile, "add");
}
foreach (var xprojFile in xprojFilesToRemove)
{
RunDotnetSlnCommand(slnFile.FullPath, xprojFile, "remove");
}
}
@ -209,19 +215,19 @@ namespace Microsoft.DotNet.Tools.Migrate
slnFile.RemoveEmptySolutionFolders();
}
private void AddProject(string slnPath, string csprojPath)
private void RunDotnetSlnCommand(string slnPath, string projPath, string commandName)
{
List<string> args = new List<string>()
var args = new List<string>()
{
"sln",
slnPath,
"add",
csprojPath,
commandName,
projPath,
};
var dotnetPath = Path.Combine(AppContext.BaseDirectory, "dotnet.dll");
var addCommand = new ForwardingApp(dotnetPath, args);
addCommand.Execute();
var command = new ForwardingApp(dotnetPath, args);
command.Execute();
}
private void MoveProjectJsonArtifactsToBackup(MigrationReport migrationReport)

View file

@ -35,6 +35,9 @@ namespace Microsoft.DotNet.Tools.Publish
var appliedPublishOption = result["dotnet"]["publish"];
CommandOption filterProjOption = app.Option(
$"--filter <{LocalizableStrings.FilterProjOption}>", LocalizableStrings.FilterProjOptionDescription,
CommandOptionType.MultipleValue);
msbuildArgs.AddRange(appliedPublishOption.OptionValuesToBeForwarded());
msbuildArgs.AddRange(appliedPublishOption.Arguments);

View file

@ -24,7 +24,7 @@
<Target Name="PrecompileScript"
BeforeTargets="Build"
Condition=" '$(IsCrossTargetingBuild)' != 'true' ">
<Exec Command="dotnet publish ../ArgumentsReflector/ArgumentsReflector.csproj --output $(MSBuildThisFileDirectory)/$(OutputPath)" />
<Exec Command="$(DotnetInOutputDirectory) publish ../ArgumentsReflector/ArgumentsReflector.csproj --output $(MSBuildThisFileDirectory)/$(OutputPath)" />
</Target>
</Project>

View file

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<assemblies>
<assembly name="dotnet-nuget.UnitTests.dll" environment="64-bit .NET (unknown version) [collection-per-class, parallel (8 threads)]" test-framework="xUnit.net 2.2.0.3330" run-date="2016-11-11" run-time="11:10:10" total="9" passed="9" failed="0" skipped="0" time="0.423" errors="0">
<errors />
<collection total="9" passed="9" failed="0" skipped="0" name="Test collection for Microsoft.DotNet.Tools.Run.Tests.GivenANuGetCommand" time="0.186">
<test name="Microsoft.DotNet.Tools.Run.Tests.GivenANuGetCommand.ItPassesCommandIfSupported(inputArgs: [\&quot;push\&quot;, \&quot;foo.1.0.0.nupkg\&quot;], result: 0)" type="Microsoft.DotNet.Tools.Run.Tests.GivenANuGetCommand" method="ItPassesCommandIfSupported" time="0.1749716" result="Pass" />
<test name="Microsoft.DotNet.Tools.Run.Tests.GivenANuGetCommand.ItPassesCommandIfSupported(inputArgs: [\&quot;push\&quot;, \&quot;foo.1.0.0.nupkg\&quot;, \&quot;-k\&quot;, \&quot;12345678-1234-1234-1234-123456789012\&quot;], result: 0)" type="Microsoft.DotNet.Tools.Run.Tests.GivenANuGetCommand" method="ItPassesCommandIfSupported" time="0.0014575" result="Pass" />
<test name="Microsoft.DotNet.Tools.Run.Tests.GivenANuGetCommand.ItPassesCommandIfSupported(inputArgs: [\&quot;push\&quot;, \&quot;foo.1.0.0.nupkg\&quot;, \&quot;--api-key\&quot;, \&quot;12345678-1234-1234-1234-123456789012\&quot;, \&quot;--source\&quot;, ...], result: 0)" type="Microsoft.DotNet.Tools.Run.Tests.GivenANuGetCommand" method="ItPassesCommandIfSupported" time="0.000841" result="Pass" />
<test name="Microsoft.DotNet.Tools.Run.Tests.GivenANuGetCommand.ItPassesCommandIfSupported(inputArgs: [\&quot;push\&quot;, \&quot;foo.1.0.0.nupkg\&quot;, \&quot;--api-key\&quot;, \&quot;12345678-1234-1234-1234-123456789012\&quot;, \&quot;--source\&quot;, ...], result: 0)" type="Microsoft.DotNet.Tools.Run.Tests.GivenANuGetCommand" method="ItPassesCommandIfSupported" time="0.0008232" result="Pass" />
<test name="Microsoft.DotNet.Tools.Run.Tests.GivenANuGetCommand.ItPassesCommandIfSupported(inputArgs: [\&quot;delete\&quot;, \&quot;foo.1.0.0.nupkg\&quot;], result: 0)" type="Microsoft.DotNet.Tools.Run.Tests.GivenANuGetCommand" method="ItPassesCommandIfSupported" time="0.0007595" result="Pass" />
<test name="Microsoft.DotNet.Tools.Run.Tests.GivenANuGetCommand.ItPassesCommandIfSupported(inputArgs: [\&quot;delete\&quot;, \&quot;foo.1.0.0.nupkg\&quot;, \&quot;--non-interactive\&quot;], result: 0)" type="Microsoft.DotNet.Tools.Run.Tests.GivenANuGetCommand" method="ItPassesCommandIfSupported" time="0.0048949" result="Pass" />
<test name="Microsoft.DotNet.Tools.Run.Tests.GivenANuGetCommand.ItPassesCommandIfSupported(inputArgs: [\&quot;delete\&quot;, \&quot;foo.1.0.0.nupkg\&quot;, \&quot;--api-key\&quot;, \&quot;12345678-1234-1234-1234-123456789012\&quot;, \&quot;--source\&quot;, ...], result: 0)" type="Microsoft.DotNet.Tools.Run.Tests.GivenANuGetCommand" method="ItPassesCommandIfSupported" time="0.0007998" result="Pass" />
<test name="Microsoft.DotNet.Tools.Run.Tests.GivenANuGetCommand.ItPassesCommandIfSupported(inputArgs: [\&quot;locals\&quot;], result: 0)" type="Microsoft.DotNet.Tools.Run.Tests.GivenANuGetCommand" method="ItPassesCommandIfSupported" time="0.0006186" result="Pass" />
<test name="Microsoft.DotNet.Tools.Run.Tests.GivenANuGetCommand.ItPassesCommandIfSupported(inputArgs: [\&quot;locals\&quot;, \&quot;http-cache\&quot;, \&quot;packages-cache\&quot;, \&quot;global-packages\&quot;, \&quot;temp\&quot;], result: 0)" type="Microsoft.DotNet.Tools.Run.Tests.GivenANuGetCommand" method="ItPassesCommandIfSupported" time="0.0005597" result="Pass" />
</collection>
</assembly>
</assemblies>

View file

@ -3,12 +3,13 @@
using Microsoft.DotNet.Cli.Utils;
using NuGet.Frameworks;
using System.Collections.Generic;
namespace Microsoft.DotNet.Tools.Test.Utilities
{
public sealed class CacheCommand : TestCommand
{
private string _profileProject;
private List<string> _profileProject = new List<string>();
private string _framework;
private string _output;
private string _runtime;
@ -22,7 +23,8 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
public CacheCommand WithEntries(string profileProject)
{
_profileProject = profileProject;
_profileProject.Add($"--entries {profileProject}");
return this;
}
public CacheCommand WithFramework(string framework)
@ -83,7 +85,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
FrameworkVersionOption);
}
private string ProfileProjectOption => string.IsNullOrEmpty(_profileProject) ? "" : $"--entries {_profileProject}";
private string ProfileProjectOption => string.Join(" ", _profileProject) ;
private string FrameworkOption => string.IsNullOrEmpty(_framework) ? "" : $"-f {_framework}";

View file

@ -1,7 +1,6 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.Tools.Test.Utilities
@ -9,7 +8,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
public sealed class DotnetCommand : TestCommand
{
public DotnetCommand()
: base("dotnet")
: base(DotnetUnderTest.FullName)
{
}

View file

@ -3,6 +3,7 @@
using Microsoft.DotNet.Cli.Utils;
using NuGet.Frameworks;
using System.Collections.Generic;
namespace Microsoft.DotNet.Tools.Test.Utilities
{
@ -11,7 +12,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
private string _framework;
private string _output;
private string _runtime;
private string _profileproj;
private List<string> _profileFilterProject = new List<string>();
public PublishCommand()
: base("dotnet")
@ -43,7 +44,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
public PublishCommand WithProFileProject(string profileproj)
{
_profileproj = profileproj;
_profileFilterProject.Add( $" --filter {profileproj}");
return this;
}
@ -74,6 +75,6 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
private string RuntimeOption => string.IsNullOrEmpty(_runtime) ? "" : $"-r {_runtime}";
private string ProfileProjOption => string.IsNullOrEmpty(_profileproj) ? "" : $"--filter {_profileproj}";
private string ProfileProjOption => string.Join(" ", _profileFilterProject);
}
}

View file

@ -0,0 +1,26 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.Tools.Test.Utilities
{
public static class DotnetUnderTest
{
static string _pathToDotnetUnderTest;
public static string FullName
{
get
{
if (_pathToDotnetUnderTest == null)
{
_pathToDotnetUnderTest = new Muxer().MuxerPath;
}
return _pathToDotnetUnderTest;
}
}
}
}

View file

@ -33,10 +33,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
var rid = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier();
var localAssemblyCache = Path.Combine(testProjectDirectory, "localAssemblyCache");
var intermediateWorkingDirectory = Path.Combine(testProjectDirectory, "workingDirectory");
var profileProjectPath = TestAssets.Get(profileProjectName)
.CreateInstance()
.WithSourceFiles()
.Root.FullName;
var profileProjectPath = TestAssets.Get(profileProjectName).Root.FullName;
var profileProject = Path.Combine(profileProjectPath, $"{profileProjectName}.xml");
new RestoreCommand()
@ -55,12 +52,12 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
.Should().Pass();
var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug";
var profilefilter = Path.Combine(localAssemblyCache, _arch, _tfm, "artifact.xml");
var profileFilter = Path.Combine(localAssemblyCache, _arch, _tfm, "artifact.xml");
new PublishCommand()
.WithFramework(_tfm)
.WithWorkingDirectory(testProjectDirectory)
.WithProFileProject(profilefilter)
.WithProFileProject(profileFilter)
.Execute()
.Should().Pass();
@ -85,11 +82,8 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
.UseCurrentRuntimeFrameworkVersion();
var testProjectDirectory = testInstance.Root.ToString();
var profileProjectPath = TestAssets.Get(profileProjectName)
.CreateInstance()
.WithSourceFiles()
.Root.FullName;
var profileProject = Path.Combine(profileProjectPath, "NewtonsoftFilterProfile.xml");
var profileProjectPath = TestAssets.Get(profileProjectName).Root.FullName;
var profileFilter = Path.Combine(profileProjectPath, "NewtonsoftFilterProfile.xml");
new RestoreCommand()
.WithWorkingDirectory(testProjectDirectory)
@ -101,7 +95,7 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
new PublishCommand()
.WithFramework(_tfm)
.WithWorkingDirectory(testProjectDirectory)
.WithProFileProject(profileProject)
.WithProFileProject(profileFilter)
.Execute()
.Should().Pass();
@ -112,5 +106,65 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
.Should().Fail()
.And.HaveStdErrContaining("assembly specified in the dependencies manifest was not found -- package: 'newtonsoft.json',");
}
[Fact]
public void ItPublishesAnAppWithMultipleProfiles()
{
var testAppName = "MultiDependentProject";
var profileProjectName = "NewtonsoftProfile";
var profileProjectName1 = "FluentProfile";
var testInstance = TestAssets.Get(testAppName)
.CreateInstance()
.WithSourceFiles()
.UseCurrentRuntimeFrameworkVersion();
var testProjectDirectory = testInstance.Root.ToString();
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 CacheCommand()
.WithEntries(profileProject)
.WithEntries(profileProject1)
.WithFramework(_tfm)
.WithRuntime(rid)
.WithOutput(localAssemblyCache)
.WithRuntimeFrameworkVersion(_frameworkVersion)
.WithIntermediateWorkingDirectory(intermediateWorkingDirectory)
.Execute($"--preserve-working-dir")
.Should().Pass();
var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug";
new PublishCommand()
.WithFramework(_tfm)
.WithWorkingDirectory(testProjectDirectory)
.WithProFileProject(profileFilter)
.WithProFileProject(profileFilter1)
.Execute()
.Should().Pass();
var outputDll = Path.Combine(testProjectDirectory, "bin", configuration, _tfm, "publish", $"{testAppName}.dll");
new TestCommand("dotnet")
.WithEnvironmentVariable("DOTNET_SHARED_PACKAGES", localAssemblyCache)
.ExecuteWithCapturedOutput(outputDll)
.Should().Pass()
.And.HaveStdOutContaining("{}");
}
}
}

View file

@ -229,11 +229,29 @@ namespace Microsoft.DotNet.Migration.Tests
.Execute($"restore \"{solutionRelPath}\"")
.Should().Pass();
//ISSUE: https://github.com/dotnet/cli/issues/5205
//new DotnetCommand()
// .WithWorkingDirectory(projectDirectory)
// .Execute($"build \"{solutionRelPath}\"")
// .Should().Pass();
new DotnetCommand()
.WithWorkingDirectory(projectDirectory)
.Execute($"build \"{solutionRelPath}\"")
.Should().Pass();
}
[Fact]
public void WhenXprojNameIsDifferentThanDirNameItGetsRemovedFromSln()
{
var projectDirectory = TestAssets
.Get("NonRestoredTestProjects", "PJAppWithXprojNameDifferentThanDirName")
.CreateInstance()
.WithSourceFiles()
.Root;
new DotnetCommand()
.WithWorkingDirectory(projectDirectory)
.Execute($"migrate")
.Should().Pass();
var slnFile = SlnFile.Read(Path.Combine(projectDirectory.FullName, "FolderHasDifferentName.sln"));
slnFile.Projects.Count.Should().Be(1);
slnFile.Projects[0].FilePath.Should().Be("PJAppWithXprojNameDifferentThanDirName.csproj");
}
private void MigrateAndBuild(string groupName, string projectName, [CallerMemberName] string callingMethod = "", string identifier = "")
@ -257,11 +275,10 @@ namespace Microsoft.DotNet.Migration.Tests
.Execute($"restore \"{solutionRelPath}\"")
.Should().Pass();
//ISSUE: https://github.com/dotnet/cli/issues/5205
//new DotnetCommand()
// .WithWorkingDirectory(projectDirectory)
// .Execute($"build \"{solutionRelPath}\"")
// .Should().Pass();
new DotnetCommand()
.WithWorkingDirectory(projectDirectory)
.Execute($"build \"{solutionRelPath}\"")
.Should().Pass();
SlnFile slnFile = SlnFile.Read(Path.Combine(projectDirectory.FullName, solutionRelPath));

View file

@ -465,11 +465,10 @@ EndGlobal
cmd.StdErr.Should().BeEmpty();
}
//ISSUE: https://github.com/dotnet/cli/issues/5205
//[Theory]
//[InlineData("TestAppWithSlnAndCsprojFiles")]
//[InlineData("TestAppWithSlnAndCsprojProjectGuidFiles")]
//[InlineData("TestAppWithEmptySln")]
[Theory]
[InlineData("TestAppWithSlnAndCsprojFiles")]
[InlineData("TestAppWithSlnAndCsprojProjectGuidFiles")]
[InlineData("TestAppWithEmptySln")]
public void WhenValidProjectIsPassedTheSlnBuilds(string testAsset)
{
var projectDirectory = TestAssets

3
testAsset.props Normal file
View file

@ -0,0 +1,3 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="build/DependencyVersions.props" />
</Project>

View file

@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeIdentifiers>win7-x64;win7-x86;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;osx.10.10-x64;rhel.7-x64</RuntimeIdentifiers>
<RuntimeIdentifiers>linux-x64;win7-x64;win7-x86;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;osx.10.10-x64;rhel.7-x64</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>