Imported Upstream version 5.20.0.180

Former-commit-id: ff953ca879339fe1e1211f7220f563e1342e66cb
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-02-04 20:11:37 +00:00
parent 0e2d47d1c8
commit 0510252385
3360 changed files with 83827 additions and 39243 deletions

View File

@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-*" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,12 @@
using System;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}

View File

@@ -0,0 +1,55 @@
# Building a Hello World console app with CoreRT
CoreRT is an AOT-optimized .NET Core runtime. This document will guide you through compiling a .NET Core Console application with CoreRT.
_Please ensure that [pre-requisites](../prerequisites.md) are installed._
## Create .NET Core Console project
Open a new shell/command prompt window and run the following commands.
```bash
> dotnet new console -o HelloWorld
> cd HelloWorld
```
This will create a simple Hello World console app in `Program.cs` and associated project files.
## Add CoreRT to your project
Using CoreRT to compile your application is done via the ILCompiler NuGet package, which is [published to MyGet with the CoreRT daily builds](https://dotnet.myget.org/feed/dotnet-core/package/nuget/Microsoft.DotNet.ILCompiler).
For the compiler to work, it first needs to be added to your project.
In your shell/command prompt navigate to the root directory of your project and run the command:
```bash
> dotnet new nuget
```
This will add a nuget.config file to your application. Open the file and in the ``<packageSources> `` element under ``<clear/>`` add the following:
```xml
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
```
Once you've added the package source, add a reference to the compiler by running the following command:
```bash
> dotnet add package Microsoft.DotNet.ILCompiler -v 1.0.0-alpha-*
```
## Restore and Publish your app
Once the package has been successfully added it's time to compile and publish your app! In the shell/command prompt window, run the following command:
```bash
> dotnet publish -r <RID> -c <Configuration>
```
where `<Configuration>` is your project configuration (such as Debug or Release) and `<RID>` is the runtime identifier (one of win-x64, linux-x64, osx-x64). For example, if you want to publish a release configuration of your app for a 64-bit version of Windows the command would look like:
```bash
> dotnet publish -r win-x64 -c release
```
Once completed, you can find the native executable in the root folder of your project under `/bin/x64/<Configuration>/netcoreapp2.1/publish/`. Navigate to `/bin/x64/<Configuration>/netcoreapp2.1/publish/` in your project folder and run the produced native executable.
Feel free to modify the sample application and experiment. However, keep in mind some functionality might not yet be supported in CoreRT. Let us know on the [Issues page](https://github.com/dotnet/corert/issues/).

View File

@@ -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="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>

View File

@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<DefineConstants>$(DefineConstants);WINDOWS;LINUX</DefineConstants>
</PropertyGroup>
@@ -85,8 +85,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-*" />
<PackageReference Include="MonoGame.Content.Builder" Version="3.7.0.1" />
<PackageReference Include="MonoGame.Framework.DesktopGL.Core" Version="3.7.0.3" />
<PackageReference Include="MonoGame.Content.Builder" Version="3.7.0.9" />
<PackageReference Include="MonoGame.Framework.DesktopGL.Core" Version="3.7.0.7" />
</ItemGroup>
</Project>

View File

@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<DefineConstants>$(DefineConstants);WINDOWS;LINUX</DefineConstants>
</PropertyGroup>
@@ -64,8 +64,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-*" />
<PackageReference Include="MonoGame.Content.Builder" Version="3.7.0.1" />
<PackageReference Include="MonoGame.Framework.DesktopGL.Core" Version="3.7.0.3" />
<PackageReference Include="MonoGame.Content.Builder" Version="3.7.0.9" />
<PackageReference Include="MonoGame.Framework.DesktopGL.Core" Version="3.7.0.7" />
</ItemGroup>
</Project>

View File

@@ -1,10 +1,8 @@
# Building a MonoGame app with CoreRT
This document will guide you through compiling a .NET Core [MonoGame](http://www.monogame.net) game with CoreRT.
CoreRT is an AOT-optimized .NET Core runtime. This document will guide you through compiling a .NET Core [MonoGame](http://www.monogame.net) game with CoreRT.
## Install the .NET Core SDK
CoreRT is an AOT-optimized .NET Core runtime. If you're new to .NET Core make sure to visit the [official starting page](http://dotnet.github.io). It will guide you through installing pre-requisites and building your first app.
If you're already familiar with .NET Core make sure you've [downloaded and installed the .NET Core 2 SDK](https://www.microsoft.com/net/download/core).
_Please ensure that [pre-requisites](../prerequisites.md) are installed._
## Create .NET Core MonoGame project
Open a new shell/command prompt window and run the following commands.
@@ -22,7 +20,7 @@ Verify that the empty game builds and runs. You should see blue window:
> dotnet run
```
MonoGame tools require [Mono](http://www.mono-project.com/download/) on non-Windows platforms.
MonoGame tools require [Mono](http://www.mono-project.com/download/) on non-Windows platforms. On Windows, MonoGame tools depend on [Visual Studio 2012 Visual C++ redistributable](https://www.microsoft.com/en-us/download/details.aspx?id=30679).
## Add CoreRT to your project
Using CoreRT to compile your application is done via the ILCompiler NuGet package, which is [published to MyGet with the CoreRT daily builds](https://dotnet.myget.org/feed/dotnet-core/package/nuget/Microsoft.DotNet.ILCompiler).
@@ -61,7 +59,7 @@ where `<Configuration>` is your project configuration (such as Debug or Release)
> dotnet publish -r win-x64 -c release
```
Once completed, you can find the native executable in the root folder of your project under `/bin/x64/<Configuration>/netcoreapp2.0/publish/`. Navigate to `/bin/x64/<Configuration>/netcoreapp2.0/publish/` in your project folder and run the produced native executable.
Once completed, you can find the native executable in the root folder of your project under `/bin/x64/<Configuration>/netcoreapp2.1/publish/`. Navigate to `/bin/x64/<Configuration>/netcoreapp2.1/publish/` in your project folder and run the produced native executable.
## Try MonoGame sample game
@@ -75,7 +73,7 @@ MonoGame samples include project files for number of targets, but not for .NET C
```bash
> dotnet publish -r win-x64 -c release Platformer2D.csproj
> bin\x64\Release\netcoreapp2.0\publish\Platformer2D.exe
> bin\x64\Release\netcoreapp2.1\publish\Platformer2D.exe
```
The NeonShooter sample works on Windows-only due to https://github.com/MonoGame/MonoGame/issues/3270.

View File

@@ -1,13 +1,10 @@
# Building a WebAPI app with CoreRT
This document will guide you through compiling a .NET Core Web API application with CoreRT.
CoreRT is an AOT-optimized .NET Core runtime. This document will guide you through compiling a .NET Core Web API application with CoreRT.
## Install the .NET Core SDK
CoreRT is an AOT-optimized .NET Core runtime. If you're new to .NET Core make sure to visit the [official starting page](http://dotnet.github.io). It will guide you through installing pre-requisites and building your first app.
If you're already familiar with .NET Core make sure you've [downloaded and installed the .NET Core 2 SDK](https://www.microsoft.com/net/download/core).
_Please ensure that [pre-requisites](../prerequisites.md) are installed._
## Create your app
Open a new shell/command prompt window and run the following commands.
```bash
> dotnet new webapi -o myApp
@@ -51,6 +48,10 @@ services.AddMvc();
to
```csharp
var applicationPartManager = new ApplicationPartManager();
applicationPartManager.ApplicationParts.Add(new AssemblyPart(typeof(Startup).Assembly));
services.Add(new ServiceDescriptor(typeof(ApplicationPartManager), applicationPartManager));
services.AddMvcCore().AddJsonFormatters();
```
@@ -86,9 +87,9 @@ where path_to_rdxml_file is the location of the file on your disk.
Under the second `<ItemGroup>` remove the line containing a reference to `Microsoft.AspNetCore.All` and substitute it with:
```xml
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Formatters.Json" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Formatters.Json" Version="2.1.0" />
```
This substitution removes unnecessary package references added by AspNetCore.All, which will remove them from your application's published files and avoid encountering unsupported features, as described in [the section above](#add-core-mvc-services)
@@ -132,12 +133,12 @@ where `<Configuration>` is your project configuration (such as Debug or Release)
> dotnet publish -r win-x64 -c release
```
Once completed, you can find the native executable in the root folder of your project under `/bin/x64/<Configuration>/netcoreapp2.0/publish/`
Once completed, you can find the native executable in the root folder of your project under `/bin/x64/<Configuration>/netcoreapp2.1/publish/`
## Try it out!
If you are running macOS, make sure you have [libuv](https://github.com/libuv/libuv) installed, as ASP.NET is built on top of libuv. You can use [homebrew](https://brew.sh/) to get it (`brew install libuv`).
Navigate to `/bin/x64/<Configuration>/netcoreapp2.0/publish/` in your project folder and run the produced executable. It should display "Now listening on: http://localhost:XXXX" with XXXX being a port on your machine. Open your browser and navigate to that URL. You should see "Hello World!" displayed in your browser.
Navigate to `/bin/x64/<Configuration>/netcoreapp2.1/publish/` in your project folder and run the produced executable. It should display "Now listening on: http://localhost:XXXX" with XXXX being a port on your machine. Open your browser and navigate to that URL. You should see "Hello World!" displayed in your browser.
Feel free to modify the sample application and experiment. However, keep in mind some functionality might not yet be supported in CoreRT. Let us know on the [Issues page](https://github.com/dotnet/corert/issues/).

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
@@ -13,9 +13,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Formatters.Json" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Formatters.Json" Version="2.1.0" />
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-*" />
</ItemGroup>

View File

@@ -8,6 +8,7 @@ using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc.ApplicationParts;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
@@ -27,6 +28,11 @@ namespace SampleWebApi
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
// Override automatic discovery of Application parts done by MVC. It is not compatible with single file compilation.
var applicationPartManager = new ApplicationPartManager();
applicationPartManager.ApplicationParts.Add(new AssemblyPart(typeof(Startup).Assembly));
services.Add(new ServiceDescriptor(typeof(ApplicationPartManager), applicationPartManager));
services.AddMvcCore().AddJsonFormatters();
}

View File

@@ -6,13 +6,12 @@
<Type Name="Microsoft.AspNetCore.Server.Kestrel.Core.Internal.KestrelServerOptionsSetup" Dynamic="Required All" />
</Assembly>
<Assembly Name="Microsoft.AspNetCore.Server.Kestrel" Dynamic="Required All"/>
<Assembly Name="Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv">
<Type Name="Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.LibuvTransportFactory" Dynamic="Required All" />
<Type Name="Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.LibuvTransportOptions" Dynamic="Required All" />
<Assembly Name="Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets">
<Type Name="Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketTransportFactory" Dynamic="Required All" />
<Type Name="Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketTransportOptions" Dynamic="Required All" />
</Assembly>
<Assembly Name="Microsoft.Extensions.DependencyInjection" Dynamic="Required All">
<Type Name="Microsoft.Extensions.DependencyInjection.DefaultServiceProviderFactory" Dynamic="Required All" />
<Type Name="Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteExpressionBuilder" Dynamic="Required All" />
<Type Name="Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver" Dynamic="Required All" />
<Type Name="Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteValidator" Dynamic="Required All" />
</Assembly>
@@ -32,6 +31,7 @@
<Assembly Name="Microsoft.AspNetCore.Mvc.Formatters.Json">
<Type Name="Microsoft.AspNetCore.Mvc.Formatters.Json.Internal.MvcJsonMvcOptionsSetup" Dynamic="Required All" />
<Type Name="Microsoft.AspNetCore.Mvc.MvcJsonOptions" Dynamic="Required All" />
<Type Name="Microsoft.AspNetCore.Mvc.MvcJsonOptionsConfigureCompatibilityOptions" Dynamic="Required All" />
</Assembly>
<Assembly Name="Microsoft.AspNetCore.Authorization">
<Type Name="Microsoft.AspNetCore.Authorization.DefaultAuthorizationPolicyProvider" Dynamic="Required All" />
@@ -40,8 +40,12 @@
<Assembly Name="Microsoft.AspNetCore.Http">
<Type Name="Microsoft.AspNetCore.Http.HttpContextFactory" Dynamic="Required All" />
</Assembly>
<Assembly Name="Microsoft.AspNetCore.HostFiltering">
<Type Name="Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware" Dynamic="Required All" />
</Assembly>
<Assembly Name="Microsoft.AspNetCore.Hosting" Dynamic="Required All">
<Type Name="Microsoft.AspNetCore.Hosting.Internal.ApplicationLifetime" Dynamic="Required All" />
<Type Name="Microsoft.AspNetCore.Hosting.Internal.StartupLoader+ConfigureServicesDelegateBuilder`1[[System.Object,System.Private.CoreLib]]" Dynamic="Required All" />
</Assembly>
<Assembly Name="Microsoft.Extensions.Logging.Abstractions">
<Type Name="Microsoft.Extensions.Logging.Logger`1[[Microsoft.AspNetCore.Hosting.Internal.WebHost,Microsoft.AspNetCore.Hosting]]" Dynamic="Required All" />
@@ -49,9 +53,15 @@
<Assembly Name="Microsoft.Extensions.Logging">
<Type Name="Microsoft.Extensions.Logging.LoggerFactory" Dynamic="Required All" />
</Assembly>
<Assembly Name="Microsoft.Extensions.Logging.Configuration">
<Type Name="Microsoft.Extensions.Logging.Configuration.LoggerProviderConfigurationFactory" Dynamic="Required All" />
<Type Name="Microsoft.Extensions.Logging.Configuration.LoggerProviderConfiguration`1[[Microsoft.Extensions.Logging.Console.ConsoleLoggerProvider,Microsoft.Extensions.Logging.Console]]" Dynamic="Required All" />
<Type Name="Microsoft.Extensions.Logging.Configuration.LoggerProviderOptionsChangeTokenSource`2[[Microsoft.Extensions.Logging.Console.ConsoleLoggerOptions,Microsoft.Extensions.Logging.Console],[Microsoft.Extensions.Logging.Console.ConsoleLoggerProvider,Microsoft.Extensions.Logging.Console]]" Dynamic="Required All" />
</Assembly>
<Assembly Name="Microsoft.Extensions.Logging.Console">
<Type Name="Microsoft.Extensions.Logging.Console.ConsoleLoggerOptions" Dynamic="Required All" />
<Type Name="Microsoft.Extensions.Logging.Console.ConsoleLoggerProvider" Dynamic="Required All" />
<Type Name="Microsoft.Extensions.Logging.Console.ConsoleLoggerOptionsSetup" Dynamic="Required All" />
</Assembly>
<Assembly Name="Microsoft.Extensions.Logging.Debug">
<Type Name="Microsoft.Extensions.Logging.Debug.DebugLogger" Dynamic="Required All" />

View File

@@ -0,0 +1,20 @@
If you're new to .NET Core make sure to visit the [official starting page](http://dotnet.github.io). It will guide you through installing pre-requisites and building your first app.
If you're already familiar with .NET Core make sure you've [downloaded and installed the .NET Core 2 SDK](https://www.microsoft.com/net/download/core).
The following pre-requisites need to be installed for building .NET Core projects with CoreRT:
# Windows
* Install [Visual Studio 2017](https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx), including Visual C++ support.
# Ubuntu (14.04+)
* Install clang and developer packages for libraries that .NET Core depends on.
```sh
sudo apt-get install libcurl4-openssl-dev zlib1g-dev libkrb5-dev
```
# macOS (10.12+)
* Install [Command Line Tools for XCode 8](https://developer.apple.com/xcode/download/) or higher.