You've already forked linux-packaging-mono
Imported Upstream version 5.14.0.78
Former-commit-id: 3494343bcc9ddb42b36b82dd9ae7b69e85e0229f
This commit is contained in:
parent
74b74abd9f
commit
19234507ba
92
external/corert/samples/MonoGame/NeonShooter.csproj
vendored
Normal file
92
external/corert/samples/MonoGame/NeonShooter.csproj
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
|
||||
<DefineConstants>$(DefineConstants);WINDOWS;LINUX</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<RdXmlFile Include="rd.xml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="MonoGame.Samples\NeonShooter\Game.cs">
|
||||
<Link>Game.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\NeonShooter\Game\Art.cs">
|
||||
<Link>Game\Art.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\NeonShooter\Game\BlackHole.cs">
|
||||
<Link>Game\BlackHole.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\NeonShooter\Game\BloomComponent.cs">
|
||||
<Link>Game\BloomComponent.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\NeonShooter\Game\BloomSettings.cs">
|
||||
<Link>Game\BloomSettings.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\NeonShooter\Game\Bullet.cs">
|
||||
<Link>Game\Bullet.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\NeonShooter\Game\ColorUtil.cs">
|
||||
<Link>Game\ColorUtil.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\NeonShooter\Game\Enemy.cs">
|
||||
<Link>Game\Enemy.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\NeonShooter\Game\EnemySpawner.cs">
|
||||
<Link>Game\EnemySpawner.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\NeonShooter\Game\Entity.cs">
|
||||
<Link>Game\Entity.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\NeonShooter\Game\EntityManager.cs">
|
||||
<Link>Game\EntityManager.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\NeonShooter\Game\Extensions.cs">
|
||||
<Link>Game\Extensions.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\NeonShooter\Game\Grid.cs">
|
||||
<Link>Game\Grid.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\NeonShooter\Game\Input.cs">
|
||||
<Link>Game\Input.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\NeonShooter\Game\MathUtil.cs">
|
||||
<Link>Game\MathUtil.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\NeonShooter\Game\ParticleManager.cs">
|
||||
<Link>Game\ParticleManager.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\NeonShooter\Game\ParticleState.cs">
|
||||
<Link>Game\ParticleState.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\NeonShooter\Game\PlayerShip.cs">
|
||||
<Link>Game\PlayerShip.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\NeonShooter\Game\PlayerStatus.cs">
|
||||
<Link>Game\PlayerStatus.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\NeonShooter\Game\Sound.cs">
|
||||
<Link>Game\Sound.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\NeonShooter\Program.cs">
|
||||
<Link>Program.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<MonoGameContentReference Include="MonoGame.Samples\NeonShooter\Content\NeonShooter.mgcb">
|
||||
<Link>Content\NeonShooter.mgcb</Link>
|
||||
</MonoGameContentReference>
|
||||
</ItemGroup>
|
||||
|
||||
<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" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
71
external/corert/samples/MonoGame/Platformer2D.csproj
vendored
Normal file
71
external/corert/samples/MonoGame/Platformer2D.csproj
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
|
||||
<DefineConstants>$(DefineConstants);WINDOWS;LINUX</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<RdXmlFile Include="rd.xml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="MonoGame.Samples\Platformer2D\Game\Accelerometer.cs">
|
||||
<Link>Game\Accelerometer.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\Platformer2D\Game\Animation.cs">
|
||||
<Link>Game\Animation.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\Platformer2D\Game\AnimationPlayer.cs">
|
||||
<Link>Game\AnimationPlayer.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\Platformer2D\Game\Circle.cs">
|
||||
<Link>Game\Circle.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\Platformer2D\Game\Enemy.cs">
|
||||
<Link>Game\Enemy.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\Platformer2D\Game\Gem.cs">
|
||||
<Link>Game\Gem.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\Platformer2D\Game\Level.cs">
|
||||
<Link>Game\Level.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\Platformer2D\Game\Player.cs">
|
||||
<Link>Game\Player.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\Platformer2D\Game\RectangleExtensions.cs">
|
||||
<Link>Game\RectangleExtensions.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\Platformer2D\Game\Tile.cs">
|
||||
<Link>Game\Tile.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\Platformer2D\Game\TouchCollectionExtensions.cs">
|
||||
<Link>Game\TouchCollectionExtensions.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\Platformer2D\Game.cs">
|
||||
<Link>Game.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\Platformer2D\Game\VirtualGamePad.cs">
|
||||
<Link>Game\VirtualGamePad.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MonoGame.Samples\Platformer2D\Program.cs">
|
||||
<Link>Program.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<MonoGameContentReference Include="MonoGame.Samples\Platformer2D\Content\Platformer2D.mgcb">
|
||||
<Link>Content\Platformer2D.mgcb</Link>
|
||||
</MonoGameContentReference>
|
||||
</ItemGroup>
|
||||
|
||||
<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" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
94
external/corert/samples/MonoGame/README.md
vendored
Normal file
94
external/corert/samples/MonoGame/README.md
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
# Building a MonoGame app with CoreRT
|
||||
|
||||
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).
|
||||
|
||||
## Create .NET Core MonoGame project
|
||||
Open a new shell/command prompt window and run the following commands.
|
||||
```bash
|
||||
> dotnet new --install MonoGame.Template.CSharp
|
||||
> dotnet new mgdesktopgl -o MyGame
|
||||
> cd MyGame
|
||||
```
|
||||
|
||||
This will install .NET Core MonoGame template and create empty game project. .NET Core MonoGame port lives at https://github.com/cra0zy/MonoGame/tree/core currently. Thank you @cra0zy for the great work!
|
||||
|
||||
Verify that the empty game builds and runs. You should see blue window:
|
||||
|
||||
```bash
|
||||
> dotnet run
|
||||
```
|
||||
|
||||
MonoGame tools require [Mono](http://www.mono-project.com/download/) on non-Windows platforms.
|
||||
|
||||
## 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.0/publish/`. Navigate to `/bin/x64/<Configuration>/netcoreapp2.0/publish/` in your project folder and run the produced native executable.
|
||||
|
||||
## Try MonoGame sample game
|
||||
|
||||
Clone MonoGame samples from github:
|
||||
|
||||
```bash
|
||||
> git clone https://github.com/MonoGame/MonoGame.Samples
|
||||
```
|
||||
|
||||
MonoGame samples include project files for number of targets, but not for .NET Core yet. One has to create the project using above steps and transplant links to sample sources and assets to it. This directory contains .NET Core project for Platformer2D and NeonShooter samples that assume MonoGame.Samples is cloned under it. Build it and start playing!
|
||||
|
||||
```bash
|
||||
> dotnet publish -r win-x64 -c release Platformer2D.csproj
|
||||
> bin\x64\Release\netcoreapp2.0\publish\Platformer2D.exe
|
||||
```
|
||||
|
||||
The NeonShooter sample works on Windows-only due to https://github.com/MonoGame/MonoGame/issues/3270.
|
||||
|
||||
## Using reflection
|
||||
Runtime directives are XML configuration files, which specify which otherwise unreachable elements of your program are available for reflection. They are used at compile-time to enable AOT compilation in applications at runtime. The runtime directives are reference in the project via RdXmlFile item:
|
||||
|
||||
```xml
|
||||
<ItemGroup>
|
||||
<RdXmlFile Include="rd.xml" />
|
||||
</ItemGroup>
|
||||
```
|
||||
|
||||
MonoGame serialization engine uses reflection to create types representing the game assets that needs to mentioned in the [rd.xml](rd.xml) file. If you see MissingMetadataException thrown during game startup, add the missing types to the rd.xml file.
|
||||
|
||||
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/).
|
9
external/corert/samples/MonoGame/nuget.config
vendored
Normal file
9
external/corert/samples/MonoGame/nuget.config
vendored
Normal 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>
|
12
external/corert/samples/MonoGame/rd.xml
vendored
Normal file
12
external/corert/samples/MonoGame/rd.xml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<Directives>
|
||||
<Application>
|
||||
<Assembly Name="MonoGame.Framework">
|
||||
<Type Name="Microsoft.Xna.Framework.Content.EffectReader" Dynamic="Required All" />
|
||||
<Type Name="Microsoft.Xna.Framework.Content.SpriteFontReader" Dynamic="Required All" />
|
||||
<Type Name="Microsoft.Xna.Framework.Content.Texture2DReader" Dynamic="Required All" />
|
||||
<Type Name="Microsoft.Xna.Framework.Content.RectangleReader" Dynamic="Required All" />
|
||||
<Type Name="Microsoft.Xna.Framework.Content.ListReader`1[[System.Char,mscorlib]]" Dynamic="Required All" />
|
||||
</Assembly>
|
||||
<Assembly Name="mscorlib" />
|
||||
</Application>
|
||||
</Directives>
|
10
external/corert/samples/WebApi/README.md
vendored
10
external/corert/samples/WebApi/README.md
vendored
@@ -75,10 +75,10 @@ If your application makes use of reflection, you will need to create a rd.xml fi
|
||||
|
||||
At runtime, if a method or type is not found or cannot be loaded, an exception will be thrown. The exception message will contain information on the missing type reference, which you can then add to the rd.xml of your program.
|
||||
|
||||
Once you've created a rd.xml file, navigate to the root directory of your project and open its `.csproj` file and in the first `<PropertyGroup>` element add the following:
|
||||
Once you've created a rd.xml file, navigate to the root directory of your project and open its `.csproj` file and in the first `<ItemGroup>` element add the following:
|
||||
|
||||
```xml
|
||||
<RdXmlFile>path_to_rdxml_file\rd.xml</RdXmlFile>
|
||||
<RdXmlFile Include="path_to_rdxml_file\rd.xml" />
|
||||
```
|
||||
|
||||
where path_to_rdxml_file is the location of the file on your disk.
|
||||
@@ -120,13 +120,13 @@ public class ValuesController
|
||||
|
||||
## Restore and Publish your app
|
||||
|
||||
Once the package has been successfully added it's time to compile and publish your app! If you're using Windows, make sure you're using `x64 Native Tools Command Prompt for VS 2017` instead of the standard Windows command prompt. In the shell/command prompt window, run the following command:
|
||||
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, which you specified in the csproj file (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:
|
||||
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
|
||||
@@ -136,6 +136,8 @@ Once completed, you can find the native executable in the root folder of your pr
|
||||
|
||||
## 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.
|
||||
|
||||
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/).
|
||||
|
@@ -2,9 +2,12 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<RdXmlFile>rd.xml</RdXmlFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<RdXmlFile Include="rd.xml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="wwwroot\" />
|
||||
</ItemGroup>
|
||||
|
Reference in New Issue
Block a user