Merge branch 'rel/1.0.0' of https://github.com/dotnet/cli into rhel
Conflicts: TestAssets/TestProjects/OutputStandardOutputAndError/project.json
This commit is contained in:
commit
c4cb1f2d53
233 changed files with 3061 additions and 937 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -277,3 +277,6 @@ test/PackagedCommands/Consumers/*/project.json
|
|||
# Vim swp files
|
||||
*.swp
|
||||
*.*~
|
||||
|
||||
# VS generated files
|
||||
launchSettings.json
|
214
Documentation/cli-installation-scenarios.md
Normal file
214
Documentation/cli-installation-scenarios.md
Normal file
|
@ -0,0 +1,214 @@
|
|||
Obtaining .NET CLI
|
||||
==================
|
||||
|
||||
# Contents
|
||||
* [Overview](#overview)
|
||||
* [General principles](#general-principles)
|
||||
* [Channels](#channels)
|
||||
* [Funnels and discovery mechanisms for CLI bits](#funnels-and-discovery-mechanisms-for-cli-bits)
|
||||
* [Getting Started page](#getting-started-page)
|
||||
* [Repo landing page](#repo-landing-page)
|
||||
* [Dependencies](#dependencies)
|
||||
* [Upgrades](#upgrades)
|
||||
* [Layout on disk](#layout-on-disk)
|
||||
* [Acquisition modes](#acquisition-modes)
|
||||
* [Native installers](#native-installers)
|
||||
* [Installation script](#installation-script)
|
||||
* [Windows one-liner](#windows-command)
|
||||
* [OSX/Linux one-liner](#osxlinux-shell-command)
|
||||
* [Complete manual installation](#complete-manual-installation)
|
||||
* [Docker](#docker)
|
||||
* [NuGet Packages](#nuget-packages)
|
||||
* [Acquiring through other products](#acquiring-through-other-products)
|
||||
* [IDEs and editors](#ides-and-editors)
|
||||
|
||||
|
||||
# Overview
|
||||
This document/spec outlines the CLI install experience. This covers the technologies being used for install, the principles that are driving the installation experience, the ways users are coming to the installs and what each of the installs contains, in terms of stability and similar.
|
||||
|
||||
# General principles
|
||||
|
||||
- Upgrades using the native installers Just Work(tm)
|
||||
- All user facing materials point to the getting started page
|
||||
- Defaults are stable bits; users need extra effort to install nightly builds
|
||||
- Only HTTPS links are allowed in any online property
|
||||
- Provide native installers for each supported platform
|
||||
- Provide automation-ready installers for each target platform
|
||||
|
||||
# Channels
|
||||
Channels represent a way for users who are getting the CLI to reason about the stability and quality of the bits they are getting. This is one more way for the user to be fully aware of the state the bits that are being installed are in and to set proper expectations on first use.
|
||||
|
||||
The table below outlines the channels:
|
||||
|
||||
| Property | Description |
|
||||
|------------------ |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Nightly | Unstable bits that are "bleeding edge". Users are not expected to use this channel often, however it is there for those situations when someone needs/wants a feature that hasn't been stabilizied yet. Also, used for internal testing. |
|
||||
| Preview | Pre-release stable builds with known issues and/or known feature gaps. We are OK with users installing these for preview purposes. |
|
||||
| Production | Actual releases. Most users are encouraged to install these. |
|
||||
|
||||
Below table shows the mapping between the channels, branches and feeds for the Debian pacakage. Since channels also impact the NuGet packages, it also contains the version of the package used and the feed to opt in to each channel.
|
||||
|
||||
| Channel | Branch | Debian feed | Debian package name | NuGet version | NuGet feed |
|
||||
|------------ |----------- |------------- |--------------------- |--------------- |--------------------------------------- |
|
||||
| Nightly | master | Development | dotnet-nightly | 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 |
|
||||
|
||||
|
||||
# Funnels and discovery mechanisms for CLI bits
|
||||
There are multiple ways that we will funnel users towards the installers for the CLI:
|
||||
|
||||
1. [Getting Started Page](https://aka.ms/dotnetcoregs)
|
||||
2. [Repo landing page](https://github.com/dotnet/cli/blob/rel/1.0.0/README.md)
|
||||
3. Package repositories for platforms (`apt-get`, `brew` etc.)
|
||||
4. IDEs and editors that integrate with CLI (e.g. Visual Studio, VS Code, Sublime etc.)
|
||||
|
||||
Out of the above, the first two funnels are under the control of the CLI team so we will go into slightly more details. The rest of the funnels will use a prescribed way to get to the bits and will have guidance on what bits to use.
|
||||
|
||||
## Getting Started page
|
||||
The page can be found on https://aka.ms/dotnetcoregs. This is the main curated first-run funnel for the dotnet CLI. The intent of the page is to help users test out the CLI quickly and become familiar with what the platform offers. This should be the most stable and curated experience we can offer.
|
||||
|
||||
The Getting Started page should only point users to curated install experiences that can contain only stable or LKG bits.
|
||||
|
||||
The below table shows other pertinent information for installs on the "Getting started" page.
|
||||
|
||||
| Property | Description |
|
||||
|----------------------- |-------------------------------------------------------------- |
|
||||
| Debian feed | Development |
|
||||
| Brew repo/tap | Brew binary repo (https://github.com/Homebrew/homebrew-binary)|
|
||||
| CentOS feed | TBD
|
||||
| Local install scripts | Latest from rel/1.0.0 |
|
||||
|
||||
## Repo landing page
|
||||
The repo landing page can be found on: https://github.com/dotnet/cli/readme.md. Download links on the landing page should be decreased in importance. First thing for "you want to get started" section should link to the getting started page on the marketing site. The Repo Landing Page should be used primarily by contributors to the CLI. There should be a separate page that has instructions on how to install both the latest stable as well as latest development with proper warnings around it. The separate page is to really avoid the situation from people accidentally installing unstable bits (since search engines can drop them in the repo first).
|
||||
|
||||
The source branches and other items are actually branch specific for the repo landing page. As the user switches branches, the links and badges on the page will change to reflect the builds from that branch.
|
||||
|
||||
# Dependencies
|
||||
.NET Core CLI is built on top of CoreFX and CoreCLR and as such its' dependencies set is defined by the platform that those two combine. Whether or not those dependencies will be installed depends on the installer being used. On Debian, for instance, using `apt-get` will mean that the appropriate dependencies are installed. For OS X using the PKG (installer) dependencies that are not part of OS X will not be installed. So, to summarize: the CLI bundle will not carry native dependencies of CoreFX and CoreCLR with it.
|
||||
|
||||
A list of dependencies can be found on [dependency list](TBD).
|
||||
|
||||
# Upgrades and updates
|
||||
**TODO**
|
||||
|
||||
# Layout on disk
|
||||
**TODO**
|
||||
|
||||
|
||||
# Acquisition modes
|
||||
There are multiple acquisition modes that the CLI will have:
|
||||
|
||||
1. Native installers
|
||||
2. Install scripts
|
||||
3. NuGet packages (for use in other people's commands/code)
|
||||
4. Docker
|
||||
|
||||
Let's dig into some details.
|
||||
|
||||
## Native installers
|
||||
These installation experiences are the primary way new users are getting the bits.The primary way to get information about this mode of installation is the [Getting Started page](#getting-started-page). The native installers are considered to be stable by default; this does not imply lack of bugs, but it does imply predictable behavior. They are generated from the stable branches and are never used to get the nightly bits.
|
||||
|
||||
The native installers are:
|
||||
|
||||
| Platform | Installer | Status | Package name |
|
||||
|--------------------- |------------------ |---------- |-------------------- |
|
||||
| Windows | Bundle installer | Done | dotnet |
|
||||
| Ubuntu 14.04/Debian | apt-get feed | Done | dotnet; dotnet-dbg |
|
||||
| OS X | PKG | Done | dotnet |
|
||||
| OS X | Homebrew | Not done | dotnet |
|
||||
| CentOS/RH | RPM | Not done | dotnet |
|
||||
|
||||
|
||||
## Installation script
|
||||
This approach is a shell one-liner that downloads an installation script and runs it. The installation script will download the latest zip/tarball (depending on the script used) and will unpack it to a given location. After that, the script will print out what needs to be set for the entire CLI to work (env variables, $PATH modification etc.).
|
||||
|
||||
This install covers the following main scenario:
|
||||
|
||||
* Local installation on a dev machine
|
||||
* Acquiring tools on a CI build server
|
||||
|
||||
|
||||
The features the script needs to support/have are:
|
||||
* Support for dev and stable channel
|
||||
* Support for specifying the version
|
||||
* Support for specfying the installation location
|
||||
* Support specifying whether the debug package needs to be downloaded
|
||||
* Automatically add the install to $PATH unless --no-path/-NoPath is present
|
||||
|
||||
|
||||
### Local installation
|
||||
The local installation puts the bits in any folder on disk that the user specifies when invoking the script. The layout is pretty much the same as with native installers.
|
||||
|
||||
The local install can "grow up" into a global one simply by pointing the system PATH to the relevant bin folder within the layout on disk.
|
||||
|
||||
Acquiring the tools on the CI server would be done in the same way as on a user machine with a local install: the install script would be invoked with a given set of options and then further build scripts would actually use the tools installed in this way to do their thing (build, restore, pack/publish etc.)
|
||||
|
||||
The guidance is, of course, to always use the beta channel for the script, and this is what the script will have as the default option.
|
||||
|
||||
### Installation script features
|
||||
The following arguments are needed for the installation script:
|
||||
|
||||
| dotnet-install.sh param (Linux, OSX) | dotnet-install.ps1 param (Windows) | Defaults | Description |
|
||||
|-------------------------------------- |------------------------------------ |----------------------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| --channel | -Channel | "Production" | Which channel (i.e. "nightly", "preview", "production") to install from. |
|
||||
| N/A (currently only x64 supported) | -Architecture | <bitness of the machine> | Architecture of the dotnet CLI to be installed |
|
||||
| --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. |
|
||||
| --prefix | -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 | Export the prefix/installdir to the path for the current session. This makes CLI tools available immidiately after install. |
|
||||
#### Install the latest nightly CLI
|
||||
|
||||
Windows:
|
||||
```
|
||||
./dotnet-install.ps1 -Channel nightly
|
||||
```
|
||||
OSX/Linux:
|
||||
```
|
||||
./dotnet-install.sh --channel nightly
|
||||
```
|
||||
|
||||
#### Install the latest preview to specified location
|
||||
|
||||
Windows:
|
||||
```
|
||||
./dotnet-install.ps1 -Channel preview -InstallDir C:\cli
|
||||
```
|
||||
OSX/Linux:
|
||||
```
|
||||
./dotnet-install.sh --channel preview --prefix ~/cli
|
||||
```
|
||||
|
||||
### Windows obtain one-liner example
|
||||
|
||||
```
|
||||
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.ps1'))}"
|
||||
```
|
||||
|
||||
### OSX/Linux obtain one-liner example
|
||||
|
||||
```
|
||||
curl -sSL https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.sh | bash /dev/stdin [args]
|
||||
```
|
||||
|
||||
## Docker
|
||||
[Docker](https://docs.docker.com/) has become a pretty good way to use developer tools, from trying them out in an interactive image use to using it for deployment. We have Docker images on DockerHub already.
|
||||
|
||||
Docker images should always be updated as we make new releases. We should have Docker images of stable releases, built from the rel/* branches.
|
||||
|
||||
## NuGet packages
|
||||
NuGet packages of the CLI bits that make sense are published to relevant feeds. The developer who wishes to use these needs to specify a version. The version is used to opt-in to the three channels above. The actuall "installation" here is restoring the package as a dependency for a certain project (i.e. `ProjectServer` or similar).
|
||||
|
||||
The table in the [channels section](#channels) has the examples of mapping between branches and NuGet package versions.
|
||||
|
||||
# Acquiring through other products
|
||||
|
||||
## IDEs and editors
|
||||
Anything that goes into the higher-level tools should always use a stable build of CLI coming frol rel/* branches as required.
|
||||
|
||||
If there exist any mechanism that notifies users of updates of the CLI, it should ideally point users to the Getting Started page to acquire the installers, or, if that is deemed too heavy-handed, it should point people to the last stable release. If there is a need of the URL to be "baked in" to the higher-level tool, that URL should be an aka.ms URL because it needs to be stable on that end.
|
||||
|
||||
Cross-platform IDEs/editors will work in similar way as above. The notification should also point people to the Getting Started page. The reason is simple: it is the one page where users can pick and choose their installation experience.
|
||||
|
||||
### Visual Studio
|
||||
Visual Studio will not be shipping CLI in-box. However, it will use CLI when installed. The install will be tied into other installs like WET and similar. The URL that is baked in VS should be an aka.ms URL because it needs to be stable on that end. The other, pointing end, should also be a stable URL/location.
|
|
@ -1,72 +0,0 @@
|
|||
# General principles that apply to the installs
|
||||
- This doc is represnting ideal state and not the current state
|
||||
- Only HTTPS links are allowed in any online property
|
||||
- All installers are signed properly
|
||||
- All user facing materials point to the getting started page
|
||||
- The user needs extra effort to install the "bleeding edge" bits (nightly build)
|
||||
|
||||
# Landing Pages
|
||||
[Getting Started Page](https://aka.ms/dotnetcoregs) - for customers
|
||||
[Repo landing page](https://github.com/dotnet/cli/blob/rel/1.0.0/README.md) - for contributors
|
||||
|
||||
## Getting Started Page
|
||||
The page can be found on https://aka.ms/dotnetcoregs.
|
||||
|
||||
* Installation targets: native installers (bits) & "curl&run"
|
||||
* Source branch: rel/1.0.0
|
||||
* Debian feed: (now: Development; future: Production)
|
||||
* Installation script links: Latest from rel/1.0.0
|
||||
* Getting started page can never point to unstable builds
|
||||
* URLs point to: latest green build of rel/1.0.0;
|
||||
|
||||
This is the main curated first-run experience for the dotnet CLI. The intent of the page is to help users "kick the tires" quickly and become familiar with what the platform offers. This should be the most stable and curated experience we can offer.
|
||||
|
||||
## Repo Landing Page
|
||||
The repo landing page can be found on: https://github.com/dotnet/cli/readme.md
|
||||
* Source branch: rel/1.0.0
|
||||
* Links to builds: LKG ?? latest green build of rel/1.0.0 (build status)
|
||||
* The Repo Landing Page should be used primarily by contributors to the CLI
|
||||
* Only links to "how to install" but no instructions
|
||||
* First thing for "you want to get started" section should link to the getting started page on the marketing site
|
||||
* Separate page that has instructions on how to install both the latest stable as well as latest development with proper warnings around it. The separate page is to really avoid the situation from people accidentally installing unstable bits (since SEO can drop them in the repo first).
|
||||
|
||||
# Installation modes
|
||||
|
||||
## Interactive installation (native installers)
|
||||
These installation experiences are the primary way new users are getting the bits. They are aimed towards users kicking the tires. They are found using (not not limited to) the following means:
|
||||
|
||||
* Web searches
|
||||
* Marketing materials
|
||||
* Presentations
|
||||
* Documentation
|
||||
|
||||
The primary way to get information about this mode of installation is the marketing website.
|
||||
|
||||
The native installers are:
|
||||
|
||||
* Deb packages for Debian-based distros
|
||||
* RPM packages for RH-based distros
|
||||
* Bundles for Windows
|
||||
* PKG for OS X
|
||||
* Homebrew for OS X
|
||||
|
||||
## Curl & paste installation script
|
||||
### install.sh/install.ps1
|
||||
This approach will be used for the below scenarios:
|
||||
|
||||
* Local installation (consumed by build scripts)
|
||||
* Global installation (consumed by users who like command line)
|
||||
* Copy & paste script: downloads and executes installation script
|
||||
|
||||
**TODO:** add actual commands for both Unix and Windows.
|
||||
|
||||
## Docker
|
||||
* Link to docker hub page
|
||||
* Docker images are used either as a base or as small development envs for trying out the bits
|
||||
* Docker image should have stable bits
|
||||
* Should point to the "stable" tag
|
||||
|
||||
## Acquiring through other products (VS, VS Code)
|
||||
Visual Studio will chain the native installer. The version we give them is from the rel/1.0.0 branch.
|
||||
|
||||
VS Code extension will toast/point people to the installers (getting started page).
|
|
@ -10,21 +10,27 @@ There are two runtime configuration files for a particular application. Given a
|
|||
|
||||
* `MyApp.dll` - The managed assembly for `MyApp`, including an ECMA-compliant entry point token.
|
||||
* `MyApp.exe` - A copy of the `corehost.exe` executable.
|
||||
* `MyApp.config.json` - An **optional** configuration file containing runtime configuration settings.
|
||||
* `MyApp.runtimeconfig.json` - An **optional** configuration file containing runtime configuration settings.
|
||||
* `MyApp.deps.json` - A list of dependencies, as well as compilation context data and compilation dependencies. Not technically required, but required to use the servicing or package cache/shared package install features.
|
||||
|
||||
The `MyApp.runtimeconfig.json` is designed to be user-editable (in the case of an app consumer wanting to change various CLR runtime options for an app, much like the `MyApp.exe.config` XML file works in .NET 4.x today). However, the `MyApp.deps.json` file is designed to be processed by automated tools and should not be user-edited. Having the files as separate makes this clearer. We could use a different format for the deps file, but if we're already integrating a JSON parser into the host, it seems most appropriate to re-use that here. Also, there are diagnostic benefits to being able to read the `.deps.json` file in a simple text editor.
|
||||
|
||||
**IMPORTANT**: Portable Applications, i.e. those published without a specific RID, have some adjustments to this spec which is covered at the end.
|
||||
|
||||
## File format
|
||||
|
||||
The files are both JSON files stored in UTF-8 encoding. Below are sample files. Note that not all sections are required and some will be opt-in only (see below for more details). The `.config.json` file is completely optional, and in the `.deps.json` file, only the `runtimeTarget`, `targets` and `libraries` sections are required (and within the `targets` section, only the runtime-specific target is required).
|
||||
The files are both JSON files stored in UTF-8 encoding. Below are sample files. Note that not all sections are required and some will be opt-in only (see below for more details). The `.runtimeconfig.json` file is completely optional, and in the `.deps.json` file, only the `runtimeTarget`, `targets` and `libraries` sections are required (and within the `targets` section, only the runtime-specific target is required).
|
||||
|
||||
### [appname].config.json
|
||||
### [appname].runtimeconfig.json
|
||||
```json
|
||||
{
|
||||
"runtimeConfig": {
|
||||
"runtimeOptions": {
|
||||
"gcServer": true,
|
||||
"gcConcurrent": false
|
||||
"gcConcurrent": false,
|
||||
"framework": {
|
||||
"name": "Microsoft.DotNetCore",
|
||||
"version": "1.0.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@ -32,10 +38,7 @@ The files are both JSON files stored in UTF-8 encoding. Below are sample files.
|
|||
### [appname].deps.json
|
||||
```json
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETStandardApp,Version=v1.5/osx.10.10-x64",
|
||||
"portable": false
|
||||
},
|
||||
"runtimeTarget": ".NETStandardApp,Version=v1.5/osx.10.10-x64",
|
||||
"compilationOptions": {
|
||||
"defines": [ "DEBUG" ]
|
||||
},
|
||||
|
@ -103,34 +106,26 @@ The files are both JSON files stored in UTF-8 encoding. Below are sample files.
|
|||
"type": "package",
|
||||
"sha512": "[base64 string]"
|
||||
}
|
||||
},
|
||||
"runtimes": {
|
||||
".NETStandardApp,Version=v1.5": {
|
||||
"win7-x64": [ ],
|
||||
"win7-x86": [ ],
|
||||
"win8-x64": [ "win7-x64" ],
|
||||
"win8-x86": [ "win7-x64" ],
|
||||
"etc...": [ "etc..." ]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Sections
|
||||
|
||||
### `runtimeConfig` Section (`.config.json`)
|
||||
### `runtimeOptions` Section (`.runtimeconfig.json`)
|
||||
|
||||
This section is copied verbatim from an identical section in the input `project.json` file (with the exception of the `target` parameter which is generated by the compilation process). The `runtimeConfig` section specifies parameters to be provided to the runtime during initialization. Known parameters include:
|
||||
|
||||
* `gcServer` - Boolean indicating if the server GC should be used (Default: _TBD_). Note: This is designed to mirror the existing [app.config](https://msdn.microsoft.com/en-us/library/ms229357.aspx) setting)
|
||||
* `gcConcurrent` - Boolean indicating if background garbage collection should be used (Default: _TBD_). Note: This is designed to mirror the existing [app.config](https://msdn.microsoft.com/en-us/library/yhwwzef8.aspx) setting).
|
||||
* `framework` - Indicates the name and version of the shared framework to use when activating the application. The presence of this section indicates that the application is a portable app designed to use a shared redistributable framework.
|
||||
* Others _TBD_
|
||||
|
||||
These settings are read by `corehost` to determine how to initialize the runtime. All versions of `corehost` **must ignore** settings in this section that they do not understand (thus allowing new settings to be added in later versions).
|
||||
|
||||
### `compilationOptions` Section (`.deps.json`)
|
||||
|
||||
This section is copied by storing the merged `compilationOptions` from the input `project.json`. The `project.json` can define three sets of compilation options: Global, Per-Configuration, and Per-Framework. However, the `runtime.config.json` is specific to a configuration and framework so there is only one merged section here.
|
||||
This section is copied by storing the merged `compilationOptions` from the input `project.json`. The `project.json` can define three sets of compilation options: Global, Per-Configuration, and Per-Framework. However, the `[appname].runtimeconfig.json` is specific to a configuration and framework so there is only one merged section here.
|
||||
|
||||
The exact settings found here are specific to the compiler that produced the original application binary. Some example settings include: `defines`, `languageVersion` (C#/VB), `allowUnsafe` (C#), etc.
|
||||
|
||||
|
@ -176,7 +171,7 @@ When this project is built for `dnxcore50` in the `Debug` configuration, the out
|
|||
|
||||
### `runtimeTarget` Section (`.deps.json`)
|
||||
|
||||
This property contains the name of the target from `targets` that should be used by the runtime as well as a boolean indicating if this is a "portable" deployment, meaning there are runtime-specific assets within "subtargets" (see description of portable apps below) or if it is a "standalone" deployment meaning that all the assets are in a single target and published for a single RID. This is present to simplify `corehost` so that it does not have to parse or understand target names and the meaning thereof.
|
||||
This property contains the name of the target from `targets` that should be used by the runtime. This is present to simplify `corehost` so that it does not have to parse or understand target names and the meaning thereof.
|
||||
|
||||
### `targets` Section (`.deps.json`)
|
||||
|
||||
|
@ -184,7 +179,7 @@ This section contains subsetted data from the input `project.lock.json`.
|
|||
|
||||
Each property under `targets` describes a "target", which is a collection of libraries required by the application when run or compiled in a certain framework and platform context. A target **must** specify a Framework name, and **may** specify a Runtime Identifier. Targets without Runtime Identifiers represent the dependencies and assets used for compiling the application for a particular framework. Targets with Runtime Identifiers represent the dependencies and assets used for running the application under a particular framework and on the platform defined by the Runtime Identifier. In the example above, the `.NETStandardApp,Version=v1.5` target lists the dependencies and assets used to compile the application for `dnxcore50`, and the `.NETStandardApp,Version=v1.5/osx.10.10-x64` target lists the dependencies and assets used to run the application on `dnxcore50` on a 64-bit Mac OS X 10.10 machine.
|
||||
|
||||
There will always be two targets in the `runtime.config.json` file: A compilation target, and a runtime target. The compilation target will be named with the framework name used for the compilation (`.NETStandardApp,Version=v1.5` in the example above). The runtime target will be named with the framework name and runtime identifier used to execute the application (`.NETStandardApp,Version=v1.5/osx.10.10-x64` in the example above). However, the runtime target will also be identified by name in the `runtimeOptions` section, so that `corehost` need not parse and understand target names.
|
||||
There will always be two targets in the `[appname].runtimeconfig.json` file: A compilation target, and a runtime target. The compilation target will be named with the framework name used for the compilation (`.NETStandardApp,Version=v1.5` in the example above). The runtime target will be named with the framework name and runtime identifier used to execute the application (`.NETStandardApp,Version=v1.5/osx.10.10-x64` in the example above). However, the runtime target will also be identified by name in the `runtimeOptions` section, so that `corehost` need not parse and understand target names.
|
||||
|
||||
The content of each target property in the JSON is a JSON object. Each property of that JSON object represents a single dependency required by the application when compiled for/run on that target. The name of the property contains the ID and Version of the dependency in the form `[Id]/[Version]`. The content of the property is another JSON object containing metadata about the dependency.
|
||||
|
||||
|
@ -202,18 +197,12 @@ The `native` property of a dependency object lists the relative paths to Native
|
|||
|
||||
In compilation targets, the `runtime`, `resources` and `native` properties of a dependency are omitted, because they are not relevant to compilation. Similarly, in runtime targets, the `compile` property is omitted, because it is not relevant to runtime.
|
||||
|
||||
Only dependencies with a `type` value of `package` will have asset lists (`compile`, `runtime`, `resources`, `native`). Dependencies which are satisfied by projects will have all of their assets copied to the output directory, so they will not be listed in this file.
|
||||
Only dependencies with a `type` value of `package` should be considered by `corehost`. There may be other items, used for other purposes (for example, Projects, Reference Assemblies, etc.
|
||||
|
||||
### `libraries` Section (`.deps.json`)
|
||||
|
||||
This section contains a union of all the dependencies found in the various targets, and contains common metadata for them. Specifically, it contains the `type`, as well as a boolean indicating if the library can be serviced (`serviceable`, only for `package`-typed libraries) and a SHA-512 hash of the package file (`sha512`, only for `package`-typed libraries.
|
||||
|
||||
**Open Question**: We could probably exclude projects from this set in order to reduce duplication. The main reason this is a separate section is because that's how the lock file is formatted and we want to try an keep this format the same if possible.
|
||||
|
||||
## `runtimes` Section
|
||||
|
||||
This section contains data gathered from the `runtime.json` files in packages during the restore process. It is used by the "portable" deployment model to encode the fallbacks through various RIDs. For example, `corehost` may detect that the current RID is `win8-x64`, due to running on Windows 8 in a 64-bit process. However, packages in the portable deployment model may provide assets for the `win7-x64` RID. In this case, `corehost` needs to know that `win8-x64` can load `win7-x64` assets. This data is encoded in the `runtimes` section of the deps file. The data is stored separately per Target Framework Moniker (though in practice, a `.deps.json` file will only ever have one entry; this is done simply to mirror the `project.lock.json` format). When running a particular target (as defined by `runtimeTarget`), where `portable` is set to `true`, only the `runtimes` entry matching that target name should be used.
|
||||
|
||||
## How the file is used
|
||||
|
||||
The file is read by two different components:
|
||||
|
@ -230,22 +219,23 @@ Some of the sections in the `.deps.json` file contain data used for runtime comp
|
|||
|
||||
```json
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETStandardApp,Version=v1.5/osx.10.10-x64",
|
||||
"portable": false
|
||||
},
|
||||
"targets": {
|
||||
".NETStandardApp,Version=v1.5/osx.10.10-x64": {
|
||||
"MyApp/1.0": {
|
||||
"type": "project",
|
||||
"dependencies": {
|
||||
"AspNet.Mvc": "1.0.0"
|
||||
}
|
||||
},
|
||||
"System.Foo/1.0.0": {
|
||||
"type": "package",
|
||||
"runtime": {
|
||||
"lib/dnxcore50/System.Foo.dll": { }
|
||||
}
|
||||
},
|
||||
"System.Banana/1.0.0": {
|
||||
"type": "package",
|
||||
"dependencies": {
|
||||
"System.Foo": "1.0.0"
|
||||
},
|
||||
|
@ -273,7 +263,7 @@ Some of the sections in the `.deps.json` file contain data used for runtime comp
|
|||
"System.Banana/1.0": {
|
||||
"type": "package",
|
||||
"sha512": "[base64 string]"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@ -282,7 +272,60 @@ Some of the sections in the `.deps.json` file contain data used for runtime comp
|
|||
|
||||
An application can be deployed in a "portable" deployment model. In this case, the RID-specific assets of packages are published within a folder structure that preserves the RID metadata. However, `corehost` does not use this folder structure, rather it reads data from the `.deps.json` file. Also, during deployment, the `.exe` file (`corehost` renamed) is not deployed.
|
||||
|
||||
In a `portable` target, the package entries may have an additional `subtargets` section detailing RID-specific assets. The `corehost` application should use this data, along with the current RID and the fallback data defined in the `runtimes` section to select one **and only one** "subtarget" out of each package individually. The most specific subtarget should always be selected. In practice, this means selecting the first RID shown on the appropriate line in `runtimes`. For example, given a package containing the following subtargets:
|
||||
In the portable deployment model, the `*.runtimeConfig.json` file will contain the `runtimeOptions.framework` section:
|
||||
|
||||
```json
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"framework": {
|
||||
"name": "NETCore.App",
|
||||
"version": "1.0.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This data is used to locate the shared framework folder. The exact mechanics of which version are selected are defined elsewhere, but in general, it locates the shared runtime in the `shared` folder located beside it by using the relative path `shared/[runtimeOptions.framework.name]/[runtimeOptions.framework.version]`. Once it has applied any version roll-forward logic and come to a final path to the shared framework, it locates the `[runtimeOptions.framework.name].deps.json` file within that folder and loads it **first**.
|
||||
|
||||
Next, the deps file from the application is loaded and merged into this deps file (this is conceptual, the host implementation doesn't necessary have to directly merge the data ;)). Data from the app-local deps file trumps data from the shared framework.
|
||||
|
||||
The shared framework's deps file will also contain a `runtimes` section defining the fallback logic for all RIDs known to that shared framework. For example, a shared framework deps file installed into a Ubuntu machine may look something like the following:
|
||||
|
||||
```json
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETStandardApp,Version=v1.5",
|
||||
"portable": false
|
||||
},
|
||||
"targets": {
|
||||
".NETStandardApp,Version=v1.5": {
|
||||
"System.Runtime/4.0.0": {
|
||||
"runtime": "lib/netstandard1.5/System.Runtime.dll"
|
||||
},
|
||||
"... other libraries ...": {}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"System.Runtime/4.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "[base64 string]"
|
||||
},
|
||||
"... other libraries ...": {}
|
||||
},
|
||||
"runtimes": {
|
||||
"ubuntu.15.04-x64": [ "ubuntu.14.10-x64", "ubuntu.14.04-x64", "debian.8-x64", "linux-x64", "linux", "unix", "any", "base" ],
|
||||
"ubuntu.14.10-x64": [ "ubuntu.14.04-x64", "debian.8-x64", "linux-x64", "linux", "unix", "any", "base" ],
|
||||
"ubuntu.14.04-x64": [ "debian.8-x64", "linux-x64", "linux", "unix", "any", "base" ]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The host will have a RID embedded in it during compilation (for example, `win10-x64` for Windows 64-bit). It will look up the corresponding entry in the `runtimes` section to identify what the fallback list is for `win10-x64`. The fallbacks are identified from most-specific to least-specific. In the case of `win10-x64` and the example above, the fallback list is: `"win10-x64", "win10", "win81-x64", "win81", "win8-x64", "win8", "win7-x64", "win7", "win-x64", "win", "any", "base"` (note that an exact match on the RID itself is the first preference, followed by the first item in the fallback list, then the next item, and so on).
|
||||
|
||||
In the app-local deps file for a `portable` application, the package entries may have an additional `runtimeTargets` section detailing RID-specific assets. The `corehost` application should use this data, along with the current RID and the RID fallback data defined in the `runtimes` section of the shared framework deps file to select one **and only one** RID value out of each package individually. The most specific RID present within the package should always be selected.
|
||||
|
||||
Consider `corehost` built for `ubuntu.14.04-x64` and the following snippet from an app-local deps file (some sections removed for brevity).
|
||||
|
||||
```json
|
||||
{
|
||||
|
@ -292,61 +335,42 @@ In a `portable` target, the package entries may have an additional `subtargets`
|
|||
"compile": {
|
||||
"ref/netstandard1.5/System.Data.SqlClient.dll": {}
|
||||
},
|
||||
"subtargets": {
|
||||
"runtime": {
|
||||
"runtimes/unix/lib/netstandard1.5/System.Data.SqlClient.dll": { "rid": "unix" },
|
||||
"runtimes/win7-x64/lib/netstandard1.5/System.Data.SqlClient.dll": { "rid": "win7-x64" },
|
||||
"runtimes/win7-x86/lib/netstandard1.5/System.Data.SqlClient.dll": { "rid": "win7-x86" }
|
||||
"runtimeTargets": {
|
||||
"runtimes/unix/lib/netstandard1.5/System.Data.SqlClient.dll": {
|
||||
"assetType": "runtime",
|
||||
"rid": "unix"
|
||||
},
|
||||
"native": {
|
||||
"runtimes/win7-x64/native/sni.dll": { "rid": "win7-x64" },
|
||||
"runtimes/win7-x86/native/sni.dll": { "rid": "win7-x86" }
|
||||
"runtimes/win7-x64/lib/netstandard1.5/System.Data.SqlClient.dll": {
|
||||
"assetType": "runtime",
|
||||
"rid": "win7-x64"
|
||||
},
|
||||
"runtimes/win7-x86/lib/netstandard1.5/System.Data.SqlClient.dll": {
|
||||
"assetType": "runtime",
|
||||
"rid": "win7-x86"
|
||||
},
|
||||
"runtimes/win7-x64/native/sni.dll": {
|
||||
"assetType": "native",
|
||||
"rid": "win7-x64"
|
||||
},
|
||||
"runtimes/win7-x86/native/sni.dll": {
|
||||
"assetType": "native",
|
||||
"rid": "win7-x86"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"runtimes": {
|
||||
".NETStandardApp,Version=v1.5": {
|
||||
"win7-x64": [ ],
|
||||
"win7-x86": [ ],
|
||||
"win8-x64": [ "win7-x64" ],
|
||||
"win8-x86": [ "win7-x86" ],
|
||||
"win81-x64": [ "win7-x64" ],
|
||||
"win81-x86": [ "win7-x86" ],
|
||||
"win10-x64": [ "win7-x64" ],
|
||||
"win10-x86": [ "win7-x86" ],
|
||||
"osx.10.10-x64": [ "osx", "unix" ],
|
||||
"osx.10.11-x64": [ "osx", "unix" ],
|
||||
"rhel.7-x64": [ "linux-x64", "unix" ],
|
||||
"rhel.7.1-x64": [ "linux-x64", "unix" ],
|
||||
"rhel.7.2-x64": [ "linux-x64", "unix" ],
|
||||
"rhel.7.3-x64": [ "linux-x64", "unix" ],
|
||||
"centos.7-x64": [ "linux-x64", "unix" ],
|
||||
"centos.7.1-x64": [ "linux-x64", "unix" ],
|
||||
"debian.8-x64": [ "linux-x64", "unix" ],
|
||||
"ubuntu.14.04-x64": [ "linux-x64", "unix" ],
|
||||
"ubuntu.14.10-x64": [ "linux-x64", "unix" ],
|
||||
"ubuntu.15.04-x64": [ "linux-x64", "unix" ],
|
||||
"linuxmint.17-x64": [ "linux-x64", "unix" ],
|
||||
"linuxmint.17.1-x64": [ "linux-x64", "unix" ],
|
||||
"linuxmint.17.2-x64": [ "linux-x64", "unix" ],
|
||||
"linuxmint.17.3-x64": [ "linux-x64", "unix" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
(How the data in `runtimes` was generated is beyond the scope of this document, `dotnet-publish` and NuGet will work together to ensure the appropriate data is present).
|
||||
When setting up the TPA and native library lists, it will do the following for the `System.Data.SqlClient` entry in the example above:
|
||||
|
||||
Consider `corehost` running on `debian.8-x64`. When setting up the TPA and native library lists, it will do the following for `System.Data.SqlClient`:
|
||||
1. Add all entries from the root `runtime` and `native` sections (not present in the example). (Note: This is essentially the current behavior for the existing deps file format)
|
||||
2. Add all appropriate entries from the `runtimeTargets` section, based on the `rid` property of each item:
|
||||
1. Attempt to locate any item for the RID `ubuntu.14.04-x64`. If any asset is matched, take **only** the items matching that RID exactly and add them to the appropriate lists based on the `assetType` value (`runtime` for managed code, `native` for native code)
|
||||
2. Reattempt the previous step using the first RID in the list provided by the list in the `runtimes."ubuntu.14.04-x64"` section of the shared framework deps file. If any asset is matched, take **only** the items matching that RID exactly and add them to the appropriate lists
|
||||
3. Continue to reattempt the previous search for each RID in the list, from left to right until a match is found or the list is exhausted. Exhausting the list without finding an asset, when a `runtimeTargets` section is present is **not** an error, it simply indicates that there is no need for a runtime-specific asset for that package.
|
||||
|
||||
1. Add all entries from the root `runtime` and `native` sections (not present in the example). This is the current behavior
|
||||
2. Add all appropriate entries from the `subtargets.runtime` and `subtargets.native` sections, based on the `rid` property of each item:
|
||||
1. Attempt to locate any item (in both lists) for `debian.8-x64`. If any asset is matched, take **only** the items matching that RID exactly and add them to the appropriate lists
|
||||
2. Reattempt the previous step using the first RID in the list provided by `runtimes.".NETStandardApp,Version=v1.5"."debian.8-x64"` (in this case `linux-x64`). If any asset is matched, take **only** the items matching that RID exactly and add them to the appropriate lists
|
||||
3. Continue to reattempt the previous search for each RID in the list, from left to right until a match is found or the list is exhausted. Exhausting the list without finding an asset, when a `subtargets` section is present is **not** an error.
|
||||
Note one important aspect about asset resolution: The resolution scope is **per-package**, **not per-application**, **nor per-asset**. For each individual package, the most appropriate RID is selected, and **all** assets taken from that package must match the selected RID exactly. For example, if a package provides both a `linux-x64` and a `unix` RID (in the `ubuntu.14.04-x64` example above), **only** the `linux-x64` asset would be selected for that package. However, if a different package provides only a `unix` RID, then the asset from the `unix` RID would be selected.
|
||||
|
||||
Note one important aspect about asset resolution: The resolution scope is **per-package**, **not per-application**, **nor per-asset**. For each individual package, the most appropriate RID is selected, and **all** assets taken from that package must match the selected RID exactly. For example, if a package provides both a `linux-x64` and a `unix` RID (in the `debian.8-x64` example above), **only** the `linux-x64` asset would be selected for that package. However, if a different package provides only a `unix` RID, then the asset from the `unix` RID would be selected.
|
||||
|
||||
The path to subtarget assets is resolved in the same way as normal assets with **one exception**. When searching app-local, rather than just looking for the simple file name in the app-local directory, subtarget assets are expected to be located in subdirectories matching their relative path information in the lock file. So the `native` `sni.dll` asset for `win7-x64` in the above example would be located at `APPROOT/runtimes/win7-x64/native/sni.dll`, rather than the normal app-local path of `APPROOT/sni.dll`
|
||||
The path to a runtime-specific asset is resolved in the same way as a normal asset (first check Servicing, then Package Cache, App-Local, Global Packages Location, etc.) with **one exception**. When searching app-local, rather than just looking for the simple file name in the app-local directory, a runtime-specific asset is expected to be located in a subdirectory matching the relative path information for that asset in the lock file. So the `native` `sni.dll` asset for `win7-x64` in the `System.Data.SqlClient` example above would be located at `APPROOT/runtimes/win7-x64/native/sni.dll`, rather than the normal app-local path of `APPROOT/sni.dll`.
|
||||
|
|
|
@ -9,12 +9,12 @@
|
|||
],
|
||||
"dependencies": {
|
||||
"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-151221",
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": {
|
||||
"imports": "portable-net45+win8"
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,13 +9,13 @@
|
|||
],
|
||||
"dependencies": {
|
||||
"TestLibrary": "1.0.0-*",
|
||||
"NETStandard.Library": "1.0.0-rc2-23811",
|
||||
"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-151221",
|
||||
"NETStandard.Library": "1.0.0-rc2-23901",
|
||||
"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-151221"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": {
|
||||
"imports": "portable-net45+win8"
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,12 +9,12 @@
|
|||
],
|
||||
"dependencies": {
|
||||
"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-151221",
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": {
|
||||
"imports": "portable-net45+win8"
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"version": "1.0.0-*",
|
||||
"dependencies": {
|
||||
"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-151221",
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
"compilerName": "fsc",
|
||||
"compileFiles": [
|
||||
|
@ -10,8 +10,8 @@
|
|||
"Helper.fs"
|
||||
],
|
||||
"frameworks": {
|
||||
"dnxcore50": {
|
||||
"imports": "portable-net45+win8"
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811",
|
||||
"NETStandard.Library": "1.0.0-rc2-23901",
|
||||
"EmptyLibrary": "1.0.0-*"
|
||||
},
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
{
|
||||
"dependencies": { },
|
||||
"frameworks": {
|
||||
"dnxcore50": {
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50",
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
}
|
||||
},
|
||||
"dnx451": { }
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"frameworks": {
|
||||
"dnxcore50": {
|
||||
"dependencies":{
|
||||
"System.Runtime": "4.0.21-beta-*",
|
||||
"NETStandard.Library": "1.0.0-rc2-23811",
|
||||
"System.Console": "4.0.0-beta-*"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
"version": "1.0.0-*",
|
||||
"dependencies": { },
|
||||
"frameworks": {
|
||||
"dnxcore50": {
|
||||
"dependencies":{
|
||||
"System.Runtime": "4.0.21-*"
|
||||
"netstandard1.3": {
|
||||
"imports": "dnxcore50",
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
{
|
||||
"frameworks": {
|
||||
"dnxcore50": {
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50",
|
||||
"dependencies": {
|
||||
"System.Runtime": "4.0.21-*"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811",
|
||||
"NETStandard.Library": "1.0.0-rc2-23901",
|
||||
"Microsoft.Web.Administration": "7.0.0"
|
||||
},
|
||||
"frameworks": {
|
||||
"dnxcore50": {
|
||||
"imports": "portable-net45+win8"
|
||||
}
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"projects": ["src"]]
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
|
||||
<clear />
|
||||
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
|
||||
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
|
||||
</packageSources>
|
||||
</configuration>
|
12
TestAssets/ProjectModelServer/IncorrectGlobalJson/src/Project1/Program.cs
Executable file
12
TestAssets/ProjectModelServer/IncorrectGlobalJson/src/Project1/Program.cs
Executable file
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
|
||||
namespace ConsoleApplication
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Hello World!");
|
||||
}
|
||||
}
|
||||
}
|
14
TestAssets/ProjectModelServer/IncorrectGlobalJson/src/Project1/project.json
Executable file
14
TestAssets/ProjectModelServer/IncorrectGlobalJson/src/Project1/project.json
Executable file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"version": "1.0.0-*",
|
||||
"compilationOptions": {
|
||||
"emitEntryPoint": true
|
||||
},
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"version": "1.0.0-*",
|
||||
"dependencies": {
|
||||
"
|
||||
},
|
||||
"frameworks": {
|
||||
[]
|
||||
}
|
||||
}
|
|
@ -5,10 +5,12 @@
|
|||
},
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,10 +5,12 @@
|
|||
},
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,12 +5,14 @@
|
|||
},
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811",
|
||||
"NETStandard.Library": "1.0.0-rc2-23901",
|
||||
"dotnet-hello": { "version": "1.0.0", "target": "package" }
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
},
|
||||
|
||||
"testRunner": "must-be-specified-to-generate-deps",
|
||||
|
|
|
@ -7,11 +7,13 @@
|
|||
"testRunner": "must-be-specified-to-generate-deps",
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811",
|
||||
"NETStandard.Library": "1.0.0-rc2-23901",
|
||||
"dotnet-hello": {"version": "1.0.0", "target": "package"}
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,11 +5,13 @@
|
|||
},
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
},
|
||||
|
||||
"tools": {
|
||||
|
|
|
@ -5,10 +5,12 @@
|
|||
},
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,13 +17,13 @@ namespace Microsoft.Extensions.DependencyModel
|
|||
|
||||
private static void CheckMetadata(Library library)
|
||||
{
|
||||
if (string.Equals(library.LibraryType, "package", StringComparison.OrdinalIgnoreCase))
|
||||
if (string.Equals(library.Type, "package", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(library.PackageName) ||
|
||||
if (string.IsNullOrWhiteSpace(library.Name) ||
|
||||
string.IsNullOrWhiteSpace(library.Hash) ||
|
||||
string.IsNullOrWhiteSpace(library.Version))
|
||||
{
|
||||
Error($"Empty metadata for {library.GetType().ToString()} {library.PackageName}");
|
||||
Error($"Empty metadata for {library.GetType().ToString()} {library.Name}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"version": "1.0.0-*",
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811",
|
||||
"NETStandard.Library": "1.0.0-rc2-23901",
|
||||
"Microsoft.Extensions.DependencyModel": {
|
||||
"target": "project",
|
||||
"version": "1.0.0-*"
|
||||
|
@ -9,6 +9,8 @@
|
|||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,11 +6,13 @@
|
|||
},
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811",
|
||||
"NETStandard.Library": "1.0.0-rc2-23901",
|
||||
"DependencyContextValidator": "1.0.0-*"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
{
|
||||
"version": "1.0.0-*",
|
||||
"compilationOptions": {
|
||||
"emitEntryPoint": true,
|
||||
"emitEntryPoint": true
|
||||
},
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811",
|
||||
"NETStandard.Library": "1.0.0-rc2-23901",
|
||||
"DependencyContextValidator": "1.0.0-*"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,10 +5,12 @@
|
|||
},
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,10 +5,11 @@
|
|||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": {
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50",
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
},
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
}
|
||||
},
|
||||
"net451": { }
|
||||
}
|
||||
|
|
|
@ -8,10 +8,12 @@
|
|||
"dependencies": {
|
||||
"TestLibrary": "1.0.0-*",
|
||||
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,10 +6,12 @@
|
|||
"additionalArguments": [ "-highentropyva+" ]
|
||||
},
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,10 +5,12 @@
|
|||
},
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,10 +5,12 @@
|
|||
},
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811",
|
||||
"NETStandard.Library": "1.0.0-rc2-23901",
|
||||
"SharedContentA": "1.0.0-*"
|
||||
},
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,12 +5,14 @@
|
|||
},
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"content": "testcontentfile.txt",
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,10 +8,12 @@
|
|||
"dependencies": {
|
||||
"TestLibrary": { "target":"project", "version":"1.0.0-*" },
|
||||
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,10 +6,12 @@
|
|||
"additionalArguments": [ "-highentropyva+" ]
|
||||
},
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23808"
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,11 +5,13 @@
|
|||
},
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
},
|
||||
|
||||
"scripts": {
|
||||
|
|
|
@ -8,11 +8,13 @@
|
|||
"dependencies": {
|
||||
"TestLibrary": { "target":"project", "version":"1.0.0-*" },
|
||||
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
},
|
||||
|
||||
"scripts": {
|
||||
|
|
|
@ -6,10 +6,12 @@
|
|||
"additionalArguments": [ "-highentropyva+" ]
|
||||
},
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23808"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,10 +7,12 @@
|
|||
"dependencies": {
|
||||
"TestLibraryWithAppDependency": { "target":"project", "version":"1.0.0-*" },
|
||||
|
||||
"NETStandard.Library": "1.0.0-rc2-23808"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
},
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,10 +3,12 @@
|
|||
"dependencies": {
|
||||
"TestApp": { "target":"project", "version":"1.0.0-*" },
|
||||
|
||||
"NETStandard.Library": "1.0.0-rc2-23808",
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,10 +8,12 @@
|
|||
"dependencies": {
|
||||
"TestLibrary": { "target":"project", "version":"1.0.0-*" },
|
||||
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"frameworks": {
|
||||
"dnxcore50": {
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50",
|
||||
"bin": {
|
||||
"assembly": "bin\\{configuration}\\dnxcore50\\TestLibrary.dll",
|
||||
"pdb": "bin\\{configuration}\\dnxcore50\\TestLibrary.pdb"
|
||||
|
|
|
@ -7,10 +7,13 @@
|
|||
|
||||
"frameworks": {
|
||||
"net451": { },
|
||||
"dnxcore50": {
|
||||
"imports" : "portable-net45+wp80+win8",
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"netstandardapp1.5": {
|
||||
"imports": [
|
||||
"dnxcore50",
|
||||
"portable-net45+wp80+win8"
|
||||
],
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,10 +8,13 @@
|
|||
|
||||
"frameworks": {
|
||||
"net451": { },
|
||||
"dnxcore50": {
|
||||
"imports" : "portable-net45+wp80+win8",
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"netstandardapp1.5": {
|
||||
"imports": [
|
||||
"dnxcore50",
|
||||
"portable-net45+wp80+win8"
|
||||
],
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,11 +5,13 @@
|
|||
},
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811",
|
||||
"NETStandard.Library": "1.0.0-rc2-23901",
|
||||
"System.Runtime.Analyzers": { "version": "1.1.0", "type": "build" }
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"additionalArguments": [ "-highentropyva+" ]
|
||||
},
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
"configurations": {
|
||||
"Test": {
|
||||
|
@ -14,6 +14,8 @@
|
|||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,9 +11,10 @@
|
|||
"net35": { },
|
||||
"net40": { },
|
||||
"net461": { },
|
||||
"dnxcore50": {
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50",
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
"version": "1.0.0",
|
||||
"dependencies": { },
|
||||
"frameworks": {
|
||||
"dnxcore50": {
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50",
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
}
|
||||
},
|
||||
"dnx451": {
|
||||
|
|
|
@ -7,11 +7,13 @@
|
|||
"dependencies": {
|
||||
"L11": "1.0.0-*",
|
||||
"L12": "1.0.0-*",
|
||||
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,13 +2,15 @@
|
|||
"version": "1.0.0-*",
|
||||
|
||||
"dependencies": {
|
||||
"L12": "1.0.0-*",
|
||||
"L21": "1.0.0-*",
|
||||
"L12": "1.0.0-*",
|
||||
"L21": "1.0.0-*",
|
||||
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,10 +4,12 @@
|
|||
"dependencies": {
|
||||
"L22": "1.0.0-*",
|
||||
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,10 +2,12 @@
|
|||
"version": "1.0.0-*",
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,10 +2,12 @@
|
|||
"version": "1.0.0-*",
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,10 +5,12 @@
|
|||
},
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,10 +5,12 @@
|
|||
},
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,10 +6,12 @@
|
|||
},
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<ProjectGuid>49beb486-ab5a-4416-91ea-8cd34abb0c9d</ProjectGuid>
|
||||
<RootNamespace>Microsoft.DotNet.Cli.Build.Framework</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
|
|
@ -2,12 +2,14 @@
|
|||
"version": "1.0.0-*",
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811",
|
||||
"System.Diagnostics.Process": "4.1.0-rc2-23811",
|
||||
"NETStandard.Library": "1.0.0-rc2-23901",
|
||||
"System.Diagnostics.Process": "4.1.0-rc2-23901",
|
||||
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc2-16537"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandard1.3": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
{
|
||||
public class CompileTargets
|
||||
{
|
||||
public static readonly string CoreCLRVersion = "1.0.1-rc2-23811";
|
||||
public static readonly string CoreCLRVersion = "1.0.2-rc2-23901";
|
||||
public static readonly string AppDepSdkVersion = "1.0.6-prerelease-00003";
|
||||
public static readonly bool IsWinx86 = CurrentPlatform.IsWindows && CurrentArchitecture.Isx86;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
{
|
||||
{ "RID", PlatformServices.Default.Runtime.GetRuntimeIdentifier() },
|
||||
{ "OSNAME", PlatformServices.Default.Runtime.OperatingSystem },
|
||||
{ "TFM", "dnxcore50" },
|
||||
{ "TFM", "netstandardapp1.5" },
|
||||
{ "OutputDir", Dirs.Output },
|
||||
{ "Stage1Dir", Dirs.Stage1 },
|
||||
{ "Stage1CompilationDir", Dirs.Stage1Compilation },
|
||||
|
|
|
@ -35,7 +35,8 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
"Microsoft.DotNet.Compiler.Common.Tests",
|
||||
"Microsoft.DotNet.ProjectModel.Tests",
|
||||
"Microsoft.Extensions.DependencyModel.Tests",
|
||||
"ArgumentForwardingTests"
|
||||
"ArgumentForwardingTests",
|
||||
"dotnet-test.UnitTests"
|
||||
};
|
||||
|
||||
[Target(nameof(PrepareTargets.Init), nameof(SetupTests), nameof(RestoreTests), nameof(BuildTests), nameof(RunTests), nameof(ValidateDependencies))]
|
||||
|
@ -73,14 +74,18 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
CleanNuGetTempCache();
|
||||
|
||||
var dotnet = DotNetCli.Stage2;
|
||||
|
||||
dotnet.Restore("--fallbacksource", Dirs.TestPackages)
|
||||
.WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "TestProjects"))
|
||||
.Execute().EnsureSuccessful();
|
||||
|
||||
|
||||
// The 'ProjectModelServer' directory contains intentionally-unresolved dependencies, so don't check for success. Also, suppress the output
|
||||
dotnet.Restore().WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "ProjectModelServer"))
|
||||
.CaptureStdErr()
|
||||
.CaptureStdOut()
|
||||
dotnet.Restore()
|
||||
.WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "ProjectModelServer", "DthTestProjects"))
|
||||
.Execute();
|
||||
|
||||
dotnet.Restore()
|
||||
.WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "ProjectModelServer", "DthUpdateSearchPathSample"))
|
||||
.Execute();
|
||||
|
||||
return c.Success();
|
||||
|
@ -127,7 +132,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
foreach (var project in projects)
|
||||
{
|
||||
c.Info($"Building: {project}");
|
||||
dotnet.Build("--framework", "dnxcore50")
|
||||
dotnet.Build("--framework", "netstandardapp1.5")
|
||||
.WorkingDirectory(Path.GetDirectoryName(project))
|
||||
.Execute()
|
||||
.EnsureSuccessful();
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<ProjectGuid>d7b9695d-23eb-4ea8-b8ab-707a0092e1d5</ProjectGuid>
|
||||
<RootNamespace>Microsoft.DotNet.Cli.Build</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin</OutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
|
|
|
@ -6,13 +6,15 @@
|
|||
},
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811",
|
||||
"System.IO.Compression.ZipFile": "4.0.1-rc2-23811",
|
||||
"NETStandard.Library": "1.0.0-rc2-23901",
|
||||
"System.IO.Compression.ZipFile": "4.0.1-rc2-23901",
|
||||
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc2-16537",
|
||||
"Microsoft.DotNet.Cli.Build.Framework": "1.0.0-*"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnxcore50": { }
|
||||
"netstandardapp1.5": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ popd
|
|||
|
||||
# Publish the builder
|
||||
Write-Host "Compiling Build Scripts..."
|
||||
dotnet publish "$PSScriptRoot\dotnet-cli-build" -o "$PSScriptRoot/dotnet-cli-build/bin" --framework dnxcore50
|
||||
dotnet publish "$PSScriptRoot\dotnet-cli-build" -o "$PSScriptRoot/dotnet-cli-build/bin" --framework netstandardapp1.5
|
||||
if($LASTEXITCODE -ne 0) { throw "Failed to compile build scripts" }
|
||||
|
||||
# Run the builder
|
||||
|
|
|
@ -14,6 +14,8 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
|
|||
done
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||
|
||||
source "$DIR/common/_prettyprint.sh"
|
||||
|
||||
while [[ $# > 0 ]]; do
|
||||
lowerI="$(echo $1 | awk '{print tolower($0)}')"
|
||||
case $lowerI in
|
||||
|
@ -104,7 +106,7 @@ echo "Restoring Build Script projects..."
|
|||
|
||||
# Build the builder
|
||||
echo "Compiling Build Scripts..."
|
||||
dotnet publish "$DIR/dotnet-cli-build" -o "$DIR/dotnet-cli-build/bin" --framework dnxcore50
|
||||
dotnet publish "$DIR/dotnet-cli-build" -o "$DIR/dotnet-cli-build/bin" --framework netstandardapp1.5
|
||||
|
||||
# Run the builder
|
||||
echo "Invoking Build Scripts..."
|
||||
|
|
|
@ -130,7 +130,7 @@ namespace Microsoft.DotNet.Cli.Utils
|
|||
SetColor(ConsoleColor.Gray);
|
||||
break;
|
||||
case 39:
|
||||
SetColor(OriginalForegroundColor);
|
||||
Console.ForegroundColor = OriginalForegroundColor;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
18
src/Microsoft.DotNet.Cli.Utils/CollectionsExtensions.cs
Normal file
18
src/Microsoft.DotNet.Cli.Utils/CollectionsExtensions.cs
Normal file
|
@ -0,0 +1,18 @@
|
|||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Microsoft.DotNet.Cli.Utils
|
||||
{
|
||||
public static class CollectionsExtensions
|
||||
{
|
||||
public static IEnumerable<T> OrEmptyIfNull<T>(this IEnumerable<T> enumerable)
|
||||
{
|
||||
return enumerable == null
|
||||
? Enumerable.Empty<T>()
|
||||
: enumerable;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -67,12 +67,14 @@ namespace Microsoft.DotNet.Cli.Utils
|
|||
string commandName,
|
||||
IEnumerable<string> args,
|
||||
NuGetFramework framework = null,
|
||||
string configuration = Constants.DefaultConfiguration)
|
||||
string configuration = Constants.DefaultConfiguration,
|
||||
string outputPath = null)
|
||||
{
|
||||
var commandSpec = CommandResolver.TryResolveCommandSpec(commandName,
|
||||
args,
|
||||
framework,
|
||||
configuration: configuration);
|
||||
configuration: configuration,
|
||||
outputPath: outputPath);
|
||||
|
||||
if (commandSpec == null)
|
||||
{
|
||||
|
|
|
@ -13,10 +13,15 @@ namespace Microsoft.DotNet.Cli.Utils
|
|||
{
|
||||
internal static class CommandResolver
|
||||
{
|
||||
public static CommandSpec TryResolveCommandSpec(string commandName, IEnumerable<string> args, NuGetFramework framework = null, string configuration=Constants.DefaultConfiguration)
|
||||
public static CommandSpec TryResolveCommandSpec(
|
||||
string commandName,
|
||||
IEnumerable<string> args,
|
||||
NuGetFramework framework = null,
|
||||
string configuration = Constants.DefaultConfiguration,
|
||||
string outputPath = null)
|
||||
{
|
||||
return ResolveFromRootedCommand(commandName, args) ??
|
||||
ResolveFromProjectDependencies(commandName, args, framework, configuration) ??
|
||||
ResolveFromProjectDependencies(commandName, args, framework, configuration, outputPath) ??
|
||||
ResolveFromProjectTools(commandName, args) ??
|
||||
ResolveFromAppBase(commandName, args) ??
|
||||
ResolveFromPath(commandName, args);
|
||||
|
@ -67,10 +72,11 @@ namespace Microsoft.DotNet.Cli.Utils
|
|||
}
|
||||
|
||||
public static CommandSpec ResolveFromProjectDependencies(
|
||||
string commandName,
|
||||
IEnumerable<string> args,
|
||||
NuGetFramework framework,
|
||||
string configuration)
|
||||
string commandName,
|
||||
IEnumerable<string> args,
|
||||
NuGetFramework framework,
|
||||
string configuration,
|
||||
string outputPath)
|
||||
{
|
||||
if (framework == null) return null;
|
||||
|
||||
|
@ -82,7 +88,7 @@ namespace Microsoft.DotNet.Cli.Utils
|
|||
|
||||
if (commandPackage == null) return null;
|
||||
|
||||
var depsPath = projectContext.GetOutputPaths(configuration).RuntimeFiles.Deps;
|
||||
var depsPath = projectContext.GetOutputPaths(configuration, outputPath: outputPath).RuntimeFiles.Deps;
|
||||
|
||||
return ConfigureCommandFromPackage(commandName, args, commandPackage, projectContext, depsPath);
|
||||
}
|
||||
|
@ -115,7 +121,7 @@ namespace Microsoft.DotNet.Cli.Utils
|
|||
|
||||
public static CommandSpec ResolveFromProjectTools(string commandName, IEnumerable<string> args)
|
||||
{
|
||||
var context = GetProjectContext(FrameworkConstants.CommonFrameworks.DnxCore50);
|
||||
var context = GetProjectContext(FrameworkConstants.CommonFrameworks.NetStandardApp15);
|
||||
|
||||
if (context == null)
|
||||
{
|
||||
|
|
41
src/Microsoft.DotNet.Cli.Utils/FixedPathCommandFactory.cs
Normal file
41
src/Microsoft.DotNet.Cli.Utils/FixedPathCommandFactory.cs
Normal file
|
@ -0,0 +1,41 @@
|
|||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using NuGet.Frameworks;
|
||||
|
||||
namespace Microsoft.DotNet.Cli.Utils
|
||||
{
|
||||
public class FixedPathCommandFactory : ICommandFactory
|
||||
{
|
||||
private readonly NuGetFramework _nugetFramework;
|
||||
private readonly string _configuration;
|
||||
private readonly string _outputPath;
|
||||
|
||||
public FixedPathCommandFactory(NuGetFramework nugetFramework, string configuration, string outputPath)
|
||||
{
|
||||
_nugetFramework = nugetFramework;
|
||||
_configuration = configuration;
|
||||
_outputPath = outputPath;
|
||||
}
|
||||
|
||||
public ICommand Create(
|
||||
string commandName,
|
||||
IEnumerable<string> args,
|
||||
NuGetFramework framework = null,
|
||||
string configuration = Constants.DefaultConfiguration)
|
||||
{
|
||||
if (string.IsNullOrEmpty(configuration))
|
||||
{
|
||||
configuration = _configuration;
|
||||
}
|
||||
|
||||
if (framework == null)
|
||||
{
|
||||
framework = _nugetFramework;
|
||||
}
|
||||
|
||||
return Command.Create(commandName, args, framework, configuration, _outputPath);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -10,7 +10,7 @@
|
|||
<ProjectGuid>61b7c351-c77d-43f7-b56f-bb1440178e10</ProjectGuid>
|
||||
<RootNamespace>Microsoft.DotNet.Cli.Utils</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"dnxcore50": {
|
||||
"imports": "portable-net45+win8",
|
||||
"netstandard1.3": {
|
||||
"imports": "dnxcore50",
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,8 @@ namespace Microsoft.DotNet.Cli.Compiler.Common
|
|||
|
||||
internal static readonly OptionTemplate s_publicSignTemplate = new OptionTemplate("public-sign");
|
||||
|
||||
internal static readonly OptionTemplate s_debugTypeTemplate = new OptionTemplate("debug-type");
|
||||
|
||||
internal static readonly OptionTemplate s_emitEntryPointTemplate = new OptionTemplate("emit-entry-point");
|
||||
|
||||
internal static readonly OptionTemplate s_generateXmlDocumentation = new OptionTemplate("generate-xml-documentation");
|
||||
|
@ -44,6 +46,7 @@ namespace Microsoft.DotNet.Cli.Compiler.Common
|
|||
IReadOnlyList<string> suppressWarnings = null;
|
||||
string languageVersion = null;
|
||||
string platform = null;
|
||||
string debugType = null;
|
||||
bool? allowUnsafe = null;
|
||||
bool? warningsAsErrors = null;
|
||||
bool? optimize = null;
|
||||
|
@ -62,6 +65,8 @@ namespace Microsoft.DotNet.Cli.Compiler.Common
|
|||
|
||||
syntax.DefineOptionList(s_additionalArgumentsTemplate.LongName, ref additionalArguments, "Pass the additional argument directly to the compiler");
|
||||
|
||||
syntax.DefineOption(s_debugTypeTemplate.LongName, ref debugType, "The type of PDB to emit: portable or full");
|
||||
|
||||
syntax.DefineOption(s_languageVersionTemplate.LongName, ref languageVersion,
|
||||
"The version of the language used to compile");
|
||||
|
||||
|
@ -104,6 +109,7 @@ namespace Microsoft.DotNet.Cli.Compiler.Common
|
|||
KeyFile = keyFile,
|
||||
DelaySign = delaySign,
|
||||
PublicSign = publicSign,
|
||||
DebugType = debugType,
|
||||
EmitEntryPoint = emitEntryPoint,
|
||||
GenerateXmlDocumentation = generateXmlDocumentation,
|
||||
AdditionalArguments = additionalArguments
|
||||
|
@ -115,6 +121,7 @@ namespace Microsoft.DotNet.Cli.Compiler.Common
|
|||
var defines = options.Defines;
|
||||
var suppressWarnings = options.SuppressWarnings;
|
||||
var languageVersion = options.LanguageVersion;
|
||||
var debugType = options.DebugType;
|
||||
var platform = options.Platform;
|
||||
var allowUnsafe = options.AllowUnsafe;
|
||||
var warningsAsErrors = options.WarningsAsErrors;
|
||||
|
@ -183,6 +190,11 @@ namespace Microsoft.DotNet.Cli.Compiler.Common
|
|||
args.Add(s_publicSignTemplate.ToLongArg(publicSign));
|
||||
}
|
||||
|
||||
if (debugType != null)
|
||||
{
|
||||
args.Add(s_debugTypeTemplate.ToLongArg(debugType));
|
||||
}
|
||||
|
||||
if (emitEntryPoint != null)
|
||||
{
|
||||
args.Add(s_emitEntryPointTemplate.ToLongArg(emitEntryPoint));
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<ProjectGuid>a16958e1-24c7-4f1e-b317-204ad91625dd</ProjectGuid>
|
||||
<RootNamespace>Microsoft.Dotnet.Cli.Compiler.Common</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"keyFile": "../../tools/Key.snk"
|
||||
},
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811",
|
||||
"NETStandard.Library": "1.0.0-rc2-23901",
|
||||
"System.CommandLine": "0.1.0-e160119-1",
|
||||
"Microsoft.CodeAnalysis.CSharp": "1.2.0-beta1-20160202-02",
|
||||
"Microsoft.DotNet.ProjectModel": "1.0.0-*",
|
||||
|
@ -12,8 +12,11 @@
|
|||
"Microsoft.DotNet.Files": "1.0.0-*"
|
||||
},
|
||||
"frameworks": {
|
||||
"dnxcore50": {
|
||||
"imports": "portable-net45+win8"
|
||||
"netstandard1.3": {
|
||||
"imports": [
|
||||
"dnxcore50",
|
||||
"portable-net45+win8"
|
||||
]
|
||||
}
|
||||
},
|
||||
"scripts": {}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<ProjectGuid>d521dd9f-0614-4929-93b4-d8fa5682c174</ProjectGuid>
|
||||
<RootNamespace>Microsoft.DotNet.Files</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin</OutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
|
|
|
@ -5,15 +5,15 @@
|
|||
},
|
||||
"description": "Abstraction to interact with the file system and file paths.",
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811",
|
||||
"System.Linq.Expressions": "4.0.11-rc2-23811",
|
||||
"NETStandard.Library": "1.0.0-rc2-23901",
|
||||
"System.Linq.Expressions": "4.0.11-rc2-23901",
|
||||
"Microsoft.Extensions.FileSystemGlobbing": "1.0.0-rc2-15996",
|
||||
"Microsoft.DotNet.Cli.Utils": "1.0.0-*",
|
||||
"Microsoft.DotNet.ProjectModel": "1.0.0-*"
|
||||
},
|
||||
"frameworks": {
|
||||
"dnxcore50": {
|
||||
"imports": "portable-net45+win8"
|
||||
"netstandard1.3": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
},
|
||||
"scripts": {}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<ProjectGuid>bd4f0750-4e81-4ad2-90b5-e470881792c3</ProjectGuid>
|
||||
<RootNamespace>Microsoft.DotNet.InternalAbstractions</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin</OutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
|
|
|
@ -14,11 +14,12 @@
|
|||
},
|
||||
"frameworks": {
|
||||
"net451": { },
|
||||
"dotnet5.4": {
|
||||
"netstandard1.3": {
|
||||
"imports": "dnxcore50",
|
||||
"dependencies": {
|
||||
"System.Runtime": "4.0.21-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
}
|
||||
|
|
|
@ -10,7 +10,10 @@ namespace Microsoft.DotNet.ProjectModel.Loader
|
|||
{
|
||||
public static class LoaderProjectContextExtensions
|
||||
{
|
||||
public static AssemblyLoadContext CreateLoadContext(this ProjectContext context, string configuration = "Debug")
|
||||
public static AssemblyLoadContext CreateLoadContext(
|
||||
this ProjectContext context,
|
||||
string configuration = "Debug",
|
||||
string outputPath = null)
|
||||
{
|
||||
var exporter = context.CreateExporter(configuration);
|
||||
var assemblies = new Dictionary<AssemblyName, string>(AssemblyNameComparer.OrdinalIgnoreCase);
|
||||
|
@ -38,7 +41,7 @@ namespace Microsoft.DotNet.ProjectModel.Loader
|
|||
dllImports,
|
||||
|
||||
// Add the project's output directory path to ensure project-to-project references get located
|
||||
new[] { context.GetOutputPaths(configuration).CompilationOutputPath });
|
||||
new[] { context.GetOutputPaths(configuration, outputPath: outputPath).CompilationOutputPath });
|
||||
}
|
||||
|
||||
private class AssemblyNameComparer : IEqualityComparer<AssemblyName>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<ProjectGuid>c7af0290-ef0d-44dc-9edc-600803b664f8</ProjectGuid>
|
||||
<RootNamespace>Microsoft.DotNet.ProjectModel.Loader</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
"keyFile": "../../tools/Key.snk"
|
||||
},
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811",
|
||||
"NETStandard.Library": "1.0.0-rc2-23901",
|
||||
"Microsoft.DotNet.ProjectModel": "1.0.0-*",
|
||||
"System.Runtime.Loader": "4.0.0-rc2-23811"
|
||||
"System.Runtime.Loader": "4.0.0-rc2-23901"
|
||||
},
|
||||
"frameworks": {
|
||||
"dnxcore50": {
|
||||
"imports": "portable-net45+win8"
|
||||
"netstandard1.3": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -9,7 +9,7 @@
|
|||
<ProjectGuid>bd7833f8-3209-4682-bf75-b4bca883e279</ProjectGuid>
|
||||
<RootNamespace>Microsoft.DotNet.ProjectModel.Workspaces</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
|
|
@ -4,14 +4,17 @@
|
|||
"keyFile": "../../tools/Key.snk"
|
||||
},
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811",
|
||||
"NETStandard.Library": "1.0.0-rc2-23901",
|
||||
"Microsoft.DotNet.ProjectModel": "1.0.0-*",
|
||||
"Microsoft.DotNet.Compiler.Common": "1.0.0-*",
|
||||
"Microsoft.CodeAnalysis.CSharp.Workspaces": "1.2.0-beta1-20160202-02"
|
||||
},
|
||||
"frameworks": {
|
||||
"dnxcore50": {
|
||||
"imports": "portable-net45+win8"
|
||||
"netstandard1.3": {
|
||||
"imports": [
|
||||
"dnxcore50",
|
||||
"portable-net45+win8"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -27,6 +27,8 @@ namespace Microsoft.DotNet.ProjectModel
|
|||
|
||||
public bool? PublicSign { get; set; }
|
||||
|
||||
public string DebugType { get; set; }
|
||||
|
||||
public bool? EmitEntryPoint { get; set; }
|
||||
|
||||
public bool? PreserveCompilationContext { get; set; }
|
||||
|
@ -49,6 +51,7 @@ namespace Microsoft.DotNet.ProjectModel
|
|||
KeyFile == other.KeyFile &&
|
||||
DelaySign == other.DelaySign &&
|
||||
PublicSign == other.PublicSign &&
|
||||
DebugType == other.DebugType &&
|
||||
EmitEntryPoint == other.EmitEntryPoint &&
|
||||
GenerateXmlDocumentation == other.GenerateXmlDocumentation &&
|
||||
PreserveCompilationContext == other.PreserveCompilationContext &&
|
||||
|
@ -131,6 +134,11 @@ namespace Microsoft.DotNet.ProjectModel
|
|||
result.PublicSign = option.PublicSign;
|
||||
}
|
||||
|
||||
if (option.DebugType != null)
|
||||
{
|
||||
result.DebugType = option.DebugType;
|
||||
}
|
||||
|
||||
if (option.EmitEntryPoint != null)
|
||||
{
|
||||
result.EmitEntryPoint = option.EmitEntryPoint;
|
||||
|
|
|
@ -215,7 +215,7 @@ namespace Microsoft.DotNet.ProjectModel.Compilation
|
|||
|
||||
var compileAsset = new LibraryAsset(
|
||||
project.Project.Name,
|
||||
null,
|
||||
Path.GetFileName(assemblyPath),
|
||||
assemblyPath);
|
||||
|
||||
builder.AddCompilationAssembly(compileAsset);
|
||||
|
@ -334,7 +334,7 @@ namespace Microsoft.DotNet.ProjectModel.Compilation
|
|||
|
||||
var assemblyPath = Path.Combine(package.Path, analyzer);
|
||||
|
||||
// $/analyzers/{Framework Name}{Version}/{Supported Architecture}/{Supported Programming Language}/{Analyzer}.dll
|
||||
// $/analyzers/{Framework Name}{Version}/{Supported Architecture}/{Supported Programming Language}/{Analyzer}.dll
|
||||
switch (specifiers.Length)
|
||||
{
|
||||
// $/analyzers/{analyzer}.dll
|
||||
|
@ -396,7 +396,7 @@ namespace Microsoft.DotNet.ProjectModel.Compilation
|
|||
|
||||
private static bool LibraryIsOfType(LibraryType type, LibraryDescription library)
|
||||
{
|
||||
return type.Equals(LibraryType.Unspecified) || // No type filter was requested
|
||||
return type.Equals(LibraryType.Unspecified) || // No type filter was requested
|
||||
library.Identity.Type.Equals(type); // OR, library type matches requested type
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,25 +13,45 @@ using NuGet.Frameworks;
|
|||
|
||||
namespace Microsoft.Extensions.DependencyModel
|
||||
{
|
||||
public static class DependencyContextBuilder
|
||||
public class DependencyContextBuilder
|
||||
{
|
||||
public static DependencyContext Build(CommonCompilerOptions compilerOptions, LibraryExporter libraryExporter, string configuration, NuGetFramework target, string runtime)
|
||||
{
|
||||
var dependencies = libraryExporter.GetAllExports();
|
||||
private readonly string _referenceAssembliesPath;
|
||||
|
||||
// Sometimes we have package and reference assembly with the same name (System.Runtime for example) thats why we
|
||||
// deduplicating them prefering reference assembly
|
||||
var dependencyLookup = dependencies
|
||||
.OrderBy(export => export.Library.Identity.Type == LibraryType.ReferenceAssembly)
|
||||
.GroupBy(export => export.Library.Identity.Name)
|
||||
.Select(exports => exports.First())
|
||||
.Select(export => new Dependency(export.Library.Identity.Name, export.Library.Identity.Version.ToString()))
|
||||
public DependencyContextBuilder() : this(FrameworkReferenceResolver.Default.ReferenceAssembliesPath)
|
||||
{
|
||||
}
|
||||
|
||||
public DependencyContextBuilder(string referenceAssembliesPath)
|
||||
{
|
||||
_referenceAssembliesPath = referenceAssembliesPath;
|
||||
}
|
||||
|
||||
public DependencyContext Build(CommonCompilerOptions compilerOptions,
|
||||
IEnumerable<LibraryExport> compilationExports,
|
||||
IEnumerable<LibraryExport> runtimeExports,
|
||||
NuGetFramework target,
|
||||
string runtime)
|
||||
{
|
||||
if (compilationExports == null)
|
||||
{
|
||||
compilationExports = Enumerable.Empty<LibraryExport>();
|
||||
}
|
||||
|
||||
var dependencyLookup = compilationExports
|
||||
.Concat(runtimeExports)
|
||||
.Select(export => export.Library.Identity)
|
||||
.Distinct()
|
||||
.Select(identity => new Dependency(identity.Name, identity.Version.ToString()))
|
||||
.ToDictionary(dependency => dependency.Name);
|
||||
|
||||
return new DependencyContext(target.DotNetFrameworkName, runtime,
|
||||
return new DependencyContext(
|
||||
target.DotNetFrameworkName,
|
||||
runtime,
|
||||
false,
|
||||
GetCompilationOptions(compilerOptions),
|
||||
GetLibraries(dependencies, dependencyLookup, target, configuration, runtime: false).Cast<CompilationLibrary>().ToArray(),
|
||||
GetLibraries(dependencies, dependencyLookup, target, configuration, runtime: true).Cast<RuntimeLibrary>().ToArray());
|
||||
GetLibraries(compilationExports, dependencyLookup, runtime: false).Cast<CompilationLibrary>().ToArray(),
|
||||
GetLibraries(runtimeExports, dependencyLookup, runtime: true).Cast<RuntimeLibrary>().ToArray(),
|
||||
new KeyValuePair<string, string[]>[0]);
|
||||
}
|
||||
|
||||
private static CompilationOptions GetCompilationOptions(CommonCompilerOptions compilerOptions)
|
||||
|
@ -45,22 +65,19 @@ namespace Microsoft.Extensions.DependencyModel
|
|||
compilerOptions.KeyFile,
|
||||
compilerOptions.DelaySign,
|
||||
compilerOptions.PublicSign,
|
||||
compilerOptions.DebugType,
|
||||
compilerOptions.EmitEntryPoint,
|
||||
compilerOptions.GenerateXmlDocumentation);
|
||||
}
|
||||
|
||||
private static IEnumerable<Library> GetLibraries(IEnumerable<LibraryExport> dependencies,
|
||||
private IEnumerable<Library> GetLibraries(IEnumerable<LibraryExport> exports,
|
||||
IDictionary<string, Dependency> dependencyLookup,
|
||||
NuGetFramework target,
|
||||
string configuration,
|
||||
bool runtime)
|
||||
{
|
||||
return dependencies.Select(export => GetLibrary(export, target, configuration, runtime, dependencyLookup));
|
||||
return exports.Select(export => GetLibrary(export, runtime, dependencyLookup));
|
||||
}
|
||||
|
||||
private static Library GetLibrary(LibraryExport export,
|
||||
NuGetFramework target,
|
||||
string configuration,
|
||||
private Library GetLibrary(LibraryExport export,
|
||||
bool runtime,
|
||||
IDictionary<string, Dependency> dependencyLookup)
|
||||
{
|
||||
|
@ -71,11 +88,17 @@ namespace Microsoft.Extensions.DependencyModel
|
|||
|
||||
var libraryAssets = runtime ? export.RuntimeAssemblies : export.CompilationAssemblies;
|
||||
|
||||
foreach (var libraryDependenciesGroup in export.Library.Dependencies.GroupBy(d => d.Name))
|
||||
foreach (var libraryDependency in export.Library.Dependencies)
|
||||
{
|
||||
LibraryRange libraryDependency = libraryDependenciesGroup
|
||||
.OrderByDescending(d => d.Target == LibraryType.ReferenceAssembly)
|
||||
.First();
|
||||
// skip build time dependencies
|
||||
if (!libraryDependency.Type.HasFlag(
|
||||
LibraryDependencyTypeFlag.MainReference |
|
||||
LibraryDependencyTypeFlag.MainExport |
|
||||
LibraryDependencyTypeFlag.RuntimeComponent |
|
||||
LibraryDependencyTypeFlag.BecomesNupkgDependency))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Dependency dependency;
|
||||
if (dependencyLookup.TryGetValue(libraryDependency.Name, out dependency))
|
||||
|
@ -85,19 +108,7 @@ namespace Microsoft.Extensions.DependencyModel
|
|||
}
|
||||
|
||||
string[] assemblies;
|
||||
if (type == LibraryType.Project)
|
||||
{
|
||||
var isExe = ((ProjectDescription)export.Library)
|
||||
.Project
|
||||
.GetCompilerOptions(target, configuration)
|
||||
.EmitEntryPoint
|
||||
.GetValueOrDefault(false);
|
||||
|
||||
isExe &= target.IsDesktop();
|
||||
|
||||
assemblies = new[] { export.Library.Identity.Name + (isExe ? ".exe" : ".dll") };
|
||||
}
|
||||
else if (type == LibraryType.ReferenceAssembly)
|
||||
if (type == LibraryType.ReferenceAssembly)
|
||||
{
|
||||
assemblies = ResolveReferenceAssembliesPath(libraryAssets);
|
||||
}
|
||||
|
@ -113,7 +124,8 @@ namespace Microsoft.Extensions.DependencyModel
|
|||
export.Library.Identity.Name,
|
||||
export.Library.Identity.Version.ToString(),
|
||||
export.Library.Hash,
|
||||
assemblies,
|
||||
assemblies.Select(RuntimeAssembly.Create).ToArray(),
|
||||
new RuntimeTarget[0],
|
||||
libraryDependencies.ToArray(),
|
||||
serviceable
|
||||
);
|
||||
|
@ -132,11 +144,11 @@ namespace Microsoft.Extensions.DependencyModel
|
|||
}
|
||||
}
|
||||
|
||||
private static string[] ResolveReferenceAssembliesPath(IEnumerable<LibraryAsset> libraryAssets)
|
||||
private string[] ResolveReferenceAssembliesPath(IEnumerable<LibraryAsset> libraryAssets)
|
||||
{
|
||||
var resolvedPaths = new List<string>();
|
||||
var referenceAssembliesPath =
|
||||
PathUtility.EnsureTrailingSlash(FrameworkReferenceResolver.Default.ReferenceAssembliesPath);
|
||||
PathUtility.EnsureTrailingSlash(_referenceAssembliesPath);
|
||||
foreach (var libraryAsset in libraryAssets)
|
||||
{
|
||||
// If resolved path is under ReferenceAssembliesPath store it as a relative to it
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace Microsoft.DotNet.ProjectModel
|
|||
public int Column { get; private set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
{
|
||||
return $"{Path}({Line},{Column}): Error: {base.ToString()}";
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<ProjectGuid>303677d5-7312-4c3f-baee-beb1a9bd9fe6</ProjectGuid>
|
||||
<RootNamespace>Microsoft.DotNet.ProjectModel</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin</OutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
|
|
|
@ -16,14 +16,15 @@ namespace Microsoft.DotNet.ProjectModel
|
|||
LockFilePackageLibrary package,
|
||||
LockFileTargetLibrary lockFileLibrary,
|
||||
IEnumerable<LibraryRange> dependencies,
|
||||
bool compatible)
|
||||
bool compatible,
|
||||
bool resolved)
|
||||
: base(
|
||||
new LibraryIdentity(package.Name, package.Version, LibraryType.Package),
|
||||
"sha512-" + package.Sha512,
|
||||
path,
|
||||
dependencies: dependencies,
|
||||
framework: null,
|
||||
resolved: compatible,
|
||||
resolved: resolved,
|
||||
compatible: compatible)
|
||||
{
|
||||
Library = package;
|
||||
|
|
|
@ -274,13 +274,6 @@ namespace Microsoft.DotNet.ProjectModel
|
|||
{
|
||||
var library = pair.Value;
|
||||
|
||||
if (Equals(library.Identity.Type, LibraryType.Package) &&
|
||||
!Directory.Exists(library.Path))
|
||||
{
|
||||
// If the package path doesn't exist then mark this dependency as unresolved
|
||||
library.Resolved = false;
|
||||
}
|
||||
|
||||
// The System.* packages provide placeholders on any non netstandard platform
|
||||
// To make them work seamlessly on those platforms, we fill the gap with a reference
|
||||
// assembly (if available)
|
||||
|
@ -469,6 +462,11 @@ namespace Microsoft.DotNet.ProjectModel
|
|||
|
||||
return combiner.CombinedHash;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name + " " + LibraryType;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -569,6 +569,7 @@ namespace Microsoft.DotNet.ProjectModel
|
|||
KeyFile = rawOptions.ValueAsString("keyFile"),
|
||||
DelaySign = rawOptions.ValueAsNullableBoolean("delaySign"),
|
||||
PublicSign = rawOptions.ValueAsNullableBoolean("publicSign"),
|
||||
DebugType = rawOptions.ValueAsString("debugType"),
|
||||
EmitEntryPoint = rawOptions.ValueAsNullableBoolean("emitEntryPoint"),
|
||||
GenerateXmlDocumentation = rawOptions.ValueAsNullableBoolean("xmlDoc"),
|
||||
PreserveCompilationContext = rawOptions.ValueAsNullableBoolean("preserveCompilationContext")
|
||||
|
|
|
@ -41,17 +41,22 @@ namespace Microsoft.DotNet.ProjectModel.Resolution
|
|||
PopulateDependencies(dependencies, targetLibrary, targetFramework);
|
||||
|
||||
var path = _packagePathResolver.GetInstallPath(package.Name, package.Version);
|
||||
var exists = Directory.Exists(path);
|
||||
|
||||
// If the package's compile time assemblies is for a portable profile then, read the assembly metadata
|
||||
// and turn System.* references into reference assembly dependencies
|
||||
PopulateLegacyPortableDependencies(targetFramework, dependencies, path, targetLibrary);
|
||||
if (exists)
|
||||
{
|
||||
// If the package's compile time assemblies is for a portable profile then, read the assembly metadata
|
||||
// and turn System.* references into reference assembly dependencies
|
||||
PopulateLegacyPortableDependencies(targetFramework, dependencies, path, targetLibrary);
|
||||
}
|
||||
|
||||
var packageDescription = new PackageDescription(
|
||||
path,
|
||||
package,
|
||||
targetLibrary,
|
||||
dependencies,
|
||||
compatible);
|
||||
compatible,
|
||||
resolved: compatible && exists);
|
||||
|
||||
return packageDescription;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
},
|
||||
"description": "Types to model a .NET Project",
|
||||
"dependencies": {
|
||||
"System.Reflection.Metadata": "1.2.0-rc2-23811",
|
||||
"System.Reflection.Metadata": "1.2.0-rc2-23901",
|
||||
"NuGet.Packaging": "3.4.0-beta-632",
|
||||
"Microsoft.Extensions.FileSystemGlobbing": "1.0.0-rc2-15996",
|
||||
"Microsoft.Extensions.JsonParser.Sources": {
|
||||
|
@ -32,15 +32,15 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"dnxcore50": {
|
||||
"imports": "portable-net45+win8",
|
||||
"netstandard1.3": {
|
||||
"imports": "dnxcore50",
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23811",
|
||||
"System.Dynamic.Runtime": "4.0.11-rc2-23811",
|
||||
"System.Runtime.Loader": "4.0.0-rc2-23811",
|
||||
"System.Security.Cryptography.Algorithms": "4.0.0-rc2-23811",
|
||||
"Microsoft.CSharp": "4.0.1-rc2-23811",
|
||||
"System.Xml.XDocument": "4.0.11-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901",
|
||||
"System.Dynamic.Runtime": "4.0.11-rc2-23901",
|
||||
"System.Runtime.Loader": "4.0.0-rc2-23901",
|
||||
"System.Security.Cryptography.Algorithms": "4.0.0-rc2-23901",
|
||||
"Microsoft.CSharp": "4.0.1-rc2-23901",
|
||||
"System.Xml.XDocument": "4.0.11-rc2-23901"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<ProjectGuid>0724ed7c-56e3-4604-9970-25e600611383</ProjectGuid>
|
||||
<RootNamespace>Microsoft.DotNet.TestFramework</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
"licenseUrl": "",
|
||||
"dependencies": {
|
||||
"Microsoft.DotNet.Cli.Utils": "1.0.0-*",
|
||||
"NETStandard.Library": "1.0.0-rc2-23811"
|
||||
"NETStandard.Library": "1.0.0-rc2-23901"
|
||||
},
|
||||
"frameworks": {
|
||||
"dnxcore50": {
|
||||
"imports": "portable-net45+win8"
|
||||
"netstandard1.3": {
|
||||
"imports": "dnxcore50"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@ namespace Microsoft.Extensions.DependencyModel
|
|||
{
|
||||
public class CompilationLibrary : Library
|
||||
{
|
||||
public CompilationLibrary(string libraryType, string packageName, string version, string hash, string[] assemblies, Dependency[] dependencies, bool serviceable)
|
||||
: base(libraryType, packageName, version, hash, dependencies, serviceable)
|
||||
public CompilationLibrary(string type, string name, string version, string hash, string[] assemblies, Dependency[] dependencies, bool serviceable)
|
||||
: base(type, name, version, hash, dependencies, serviceable)
|
||||
{
|
||||
Assemblies = assemblies;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ namespace Microsoft.Extensions.DependencyModel
|
|||
var assemblies = new List<string>();
|
||||
if (!DefaultResolver.TryResolveAssemblyPaths(this, assemblies))
|
||||
{
|
||||
throw new InvalidOperationException($"Can not find compilation library location for package '{PackageName}'");
|
||||
throw new InvalidOperationException($"Can not find compilation library location for package '{Name}'");
|
||||
}
|
||||
return assemblies;
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue