Xamarin Support (#1360)
* Multi-target `BenchmarkDotNet.Samples` to include `netstandard2.0` * Don't probe for `mono` binary for `InProcess` * Detect Xamarin.Android / Xamarin.iOS * Fix for `Directory.CurrentDirectory()` as `ArtifactPath` * Default to `InProcess` for Xamarin platforms * Added documentation, sample, and a new `BenchmarkDotNet.Xamarin.sln`
|
@ -56,3 +56,6 @@ src/BenchmarkDotNet/Disassemblers/net461/*
|
|||
# Cake
|
||||
tools/**
|
||||
.dotnet
|
||||
|
||||
# Xamarin
|
||||
Resource.designer.cs
|
|
@ -0,0 +1,125 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.29920.165
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchmarkDotNet", "src\BenchmarkDotNet\BenchmarkDotNet.csproj", "{6A3481EC-78A3-4A2E-994D-ED16778D83BB}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchmarkDotNet.Samples.Forms", "samples\BenchmarkDotNet.Samples.Forms\BenchmarkDotNet.Samples.Forms.csproj", "{34358E9C-7048-43F5-AA66-4F9060081178}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BenchmarkDotNet.Samples.Android", "samples\BenchmarkDotNet.Samples.Android\BenchmarkDotNet.Samples.Android.csproj", "{F8547E13-AE77-44CC-9F1D-1717921C4B86}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BenchmarkDotNet.Samples.iOS", "samples\BenchmarkDotNet.Samples.iOS\BenchmarkDotNet.Samples.iOS.csproj", "{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchmarkDotNet.Disassembler.x64", "src\BenchmarkDotNet.Disassembler.x64\BenchmarkDotNet.Disassembler.x64.csproj", "{78BD1D11-7841-4079-8ED7-CD253A71FD33}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchmarkDotNet.Disassembler.x86", "src\BenchmarkDotNet.Disassembler.x86\BenchmarkDotNet.Disassembler.x86.csproj", "{6E54F07F-5B12-465A-ADA2-39879DB704C1}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchmarkDotNet.Annotations", "src\BenchmarkDotNet.Annotations\BenchmarkDotNet.Annotations.csproj", "{FA360486-97B1-4BA9-BCB2-78F86EA0F881}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|iPhone = Debug|iPhone
|
||||
Debug|iPhoneSimulator = Debug|iPhoneSimulator
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|iPhone = Release|iPhone
|
||||
Release|iPhoneSimulator = Release|iPhoneSimulator
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{34358E9C-7048-43F5-AA66-4F9060081178}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{34358E9C-7048-43F5-AA66-4F9060081178}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{34358E9C-7048-43F5-AA66-4F9060081178}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{34358E9C-7048-43F5-AA66-4F9060081178}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{34358E9C-7048-43F5-AA66-4F9060081178}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{34358E9C-7048-43F5-AA66-4F9060081178}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{34358E9C-7048-43F5-AA66-4F9060081178}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{34358E9C-7048-43F5-AA66-4F9060081178}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{34358E9C-7048-43F5-AA66-4F9060081178}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{34358E9C-7048-43F5-AA66-4F9060081178}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{34358E9C-7048-43F5-AA66-4F9060081178}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{34358E9C-7048-43F5-AA66-4F9060081178}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
|
||||
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Debug|iPhone.Deploy.0 = Debug|Any CPU
|
||||
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU
|
||||
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Release|Any CPU.Deploy.0 = Release|Any CPU
|
||||
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Release|iPhone.Deploy.0 = Release|Any CPU
|
||||
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
|
||||
{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}.Debug|Any CPU.ActiveCfg = Debug|iPhone
|
||||
{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}.Debug|iPhone.ActiveCfg = Debug|iPhone
|
||||
{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}.Debug|iPhone.Build.0 = Debug|iPhone
|
||||
{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
||||
{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
||||
{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}.Release|Any CPU.ActiveCfg = Release|iPhone
|
||||
{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}.Release|iPhone.ActiveCfg = Release|iPhone
|
||||
{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}.Release|iPhone.Build.0 = Release|iPhone
|
||||
{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
|
||||
{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
|
||||
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {36B462DE-57CC-423E-855A-F3B19FE99549}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
uid: BenchmarkDotNet.Samples.Xamarin
|
||||
---
|
||||
|
||||
## Sample: IntroXamarin
|
||||
|
||||
To use BenchmarkDotNet with Xamarin, you will need to build a small UI for running Benchmarks and displaying the results so you can actually read them.
|
||||
Using [Xamarin.Forms](https://dotnet.microsoft.com/apps/xamarin/xamarin-forms) is a simple way to be able to run your benchmarks on iOS or Android.
|
||||
|
||||
Other notes:
|
||||
|
||||
* Use `Release` builds when running actual benchmarks.
|
||||
* Disable the linker via the `Don't Link` or `None`.
|
||||
|
||||
### Source code
|
||||
|
||||
[!code-csharp[MainPage.xaml.cs](../../../samples/BenchmarkDotNet.Samples.Forms/MainPage.xaml.cs)]
|
||||
|
||||
### Output
|
||||
|
||||
![Xamarin Output](../../images/xamarin-screenshot.png)
|
||||
|
||||
### Links
|
||||
|
||||
* [Xamarin.Android linker settings](https://docs.microsoft.com/xamarin/android/deploy-test/linker#linker-behavior)
|
||||
* [Xamarin.iOS linker settings](https://docs.microsoft.com/xamarin/ios/deploy-test/linker#dont-link)
|
||||
* The permanent link to this sample: @BenchmarkDotNet.Samples.Xamarin
|
||||
|
||||
---
|
После Ширина: | Высота: | Размер: 92 KiB |
|
@ -0,0 +1,97 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{F8547E13-AE77-44CC-9F1D-1717921C4B86}</ProjectGuid>
|
||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<TemplateGuid>{c9e5eea5-ca05-42a1-839b-61506e0a37df}</TemplateGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>BenchmarkDotNet.Samples.Forms.Droid</RootNamespace>
|
||||
<AssemblyName>BenchmarkDotNet.Samples.Forms.Android</AssemblyName>
|
||||
<AndroidApplication>True</AndroidApplication>
|
||||
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
|
||||
<AndroidResgenClass>Resource</AndroidResgenClass>
|
||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
||||
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
||||
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
|
||||
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
|
||||
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
|
||||
<AndroidUseAapt2>true</AndroidUseAapt2>
|
||||
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>portable</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidLinkMode>None</AndroidLinkMode>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>portable</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidManagedSymbols>true</AndroidManagedSymbols>
|
||||
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
|
||||
<AndroidSupportedAbis>armeabi-v7a;x86;x86_64;arm64-v8a</AndroidSupportedAbis>
|
||||
<AndroidLinkMode>None</AndroidLinkMode>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Mono.Android" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.5.0.530" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.5.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainActivity.cs" />
|
||||
<Compile Include="Resources\Resource.designer.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Properties\AndroidManifest.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\layout\Tabbar.xml" />
|
||||
<AndroidResource Include="Resources\layout\Toolbar.xml" />
|
||||
<AndroidResource Include="Resources\values\styles.xml" />
|
||||
<AndroidResource Include="Resources\values\colors.xml" />
|
||||
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon.xml" />
|
||||
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon_round.xml" />
|
||||
<AndroidResource Include="Resources\mipmap-hdpi\icon.png" />
|
||||
<AndroidResource Include="Resources\mipmap-hdpi\launcher_foreground.png" />
|
||||
<AndroidResource Include="Resources\mipmap-mdpi\icon.png" />
|
||||
<AndroidResource Include="Resources\mipmap-mdpi\launcher_foreground.png" />
|
||||
<AndroidResource Include="Resources\mipmap-xhdpi\icon.png" />
|
||||
<AndroidResource Include="Resources\mipmap-xhdpi\launcher_foreground.png" />
|
||||
<AndroidResource Include="Resources\mipmap-xxhdpi\icon.png" />
|
||||
<AndroidResource Include="Resources\mipmap-xxhdpi\launcher_foreground.png" />
|
||||
<AndroidResource Include="Resources\mipmap-xxxhdpi\icon.png" />
|
||||
<AndroidResource Include="Resources\mipmap-xxxhdpi\launcher_foreground.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Resources\drawable\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BenchmarkDotNet.Samples.Forms\BenchmarkDotNet.Samples.Forms.csproj">
|
||||
<Project>{EF54613D-8A3D-42DB-BF98-AD95C582FEF3}</Project>
|
||||
<Name>BenchmarkDotNet.Samples.Forms</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
|
||||
using Android.App;
|
||||
using Android.Content.PM;
|
||||
using Android.Runtime;
|
||||
using Android.Views;
|
||||
using Android.Widget;
|
||||
using Android.OS;
|
||||
|
||||
namespace BenchmarkDotNet.Samples.Forms.Droid
|
||||
{
|
||||
[Activity(Label = "BenchmarkDotNet.Samples.Forms", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
|
||||
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
|
||||
{
|
||||
protected override void OnCreate(Bundle savedInstanceState)
|
||||
{
|
||||
TabLayoutResource = Resource.Layout.Tabbar;
|
||||
ToolbarResource = Resource.Layout.Toolbar;
|
||||
|
||||
base.OnCreate(savedInstanceState);
|
||||
|
||||
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
|
||||
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
|
||||
LoadApplication(new App());
|
||||
}
|
||||
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
|
||||
{
|
||||
Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
|
||||
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.benchmarkdotnet.samples">
|
||||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
|
||||
<application android:label="BenchmarkDotNet.Samples.Android"></application>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
</manifest>
|
|
@ -0,0 +1,34 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using Android.App;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("BenchmarkDotNet.Samples.Forms.Android")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("BenchmarkDotNet.Samples.Forms.Android")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
// Add some common permissions, these can be removed if not needed
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.TabLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/sliding_tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:tabIndicatorColor="@android:color/white"
|
||||
app:tabGravity="fill"
|
||||
app:tabMode="fixed" />
|
|
@ -0,0 +1,9 @@
|
|||
<android.support.v7.widget.Toolbar
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
android:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/launcher_background" />
|
||||
<foreground android:drawable="@mipmap/launcher_foreground" />
|
||||
</adaptive-icon>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/launcher_background" />
|
||||
<foreground android:drawable="@mipmap/launcher_foreground" />
|
||||
</adaptive-icon>
|
После Ширина: | Высота: | Размер: 4.6 KiB |
Двоичные данные
samples/BenchmarkDotNet.Samples.Android/Resources/mipmap-hdpi/launcher_foreground.png
Normal file
После Ширина: | Высота: | Размер: 11 KiB |
После Ширина: | Высота: | Размер: 2.7 KiB |
Двоичные данные
samples/BenchmarkDotNet.Samples.Android/Resources/mipmap-mdpi/launcher_foreground.png
Normal file
После Ширина: | Высота: | Размер: 6.3 KiB |
После Ширина: | Высота: | Размер: 6.9 KiB |
Двоичные данные
samples/BenchmarkDotNet.Samples.Android/Resources/mipmap-xhdpi/launcher_foreground.png
Normal file
После Ширина: | Высота: | Размер: 18 KiB |
Двоичные данные
samples/BenchmarkDotNet.Samples.Android/Resources/mipmap-xxhdpi/icon.png
Normal file
После Ширина: | Высота: | Размер: 12 KiB |
Двоичные данные
samples/BenchmarkDotNet.Samples.Android/Resources/mipmap-xxhdpi/launcher_foreground.png
Normal file
После Ширина: | Высота: | Размер: 33 KiB |
Двоичные данные
samples/BenchmarkDotNet.Samples.Android/Resources/mipmap-xxxhdpi/icon.png
Normal file
После Ширина: | Высота: | Размер: 19 KiB |
Двоичные данные
samples/BenchmarkDotNet.Samples.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png
Normal file
После Ширина: | Высота: | Размер: 51 KiB |
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="launcher_background">#FFFFFF</color>
|
||||
<color name="colorPrimary">#3F51B5</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
</resources>
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<resources>
|
||||
|
||||
<style name="MainTheme" parent="MainTheme.Base">
|
||||
</style>
|
||||
<!-- Base theme applied no matter what API -->
|
||||
<style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!--We will be using the toolbar so no need to show ActionBar-->
|
||||
<item name="windowActionBar">false</item>
|
||||
<!-- Set theme colors from https://aka.ms/material-colors -->
|
||||
<!-- colorPrimary is used for the default action bar background -->
|
||||
<item name="colorPrimary">#2196F3</item>
|
||||
<!-- colorPrimaryDark is used for the status bar -->
|
||||
<item name="colorPrimaryDark">#1976D2</item>
|
||||
<!-- colorAccent is used as the default value for colorControlActivated
|
||||
which is used to tint widgets -->
|
||||
<item name="colorAccent">#FF4081</item>
|
||||
<!-- You can also set colorControlNormal, colorControlActivated
|
||||
colorControlHighlight and colorSwitchThumbNormal. -->
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
|
||||
<item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>
|
||||
</style>
|
||||
|
||||
<style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
|
||||
<item name="colorAccent">#FF4081</item>
|
||||
</style>
|
||||
</resources>
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Application xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
x:Class="BenchmarkDotNet.Samples.Forms.App">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace BenchmarkDotNet.Samples.Forms
|
||||
{
|
||||
public partial class App : Application
|
||||
{
|
||||
public App()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
MainPage = new MainPage();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
using Xamarin.Forms.Xaml;
|
||||
|
||||
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
|
|
@ -0,0 +1,22 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\BenchmarkDotNet.Samples\IntroBasic.cs" Link="Benchmarks\IntroBasic.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Collections.Immutable" Version="1.7.0" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.5.0.530" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.5.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\BenchmarkDotNet\BenchmarkDotNet.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
x:Class="BenchmarkDotNet.Samples.Forms.MainPage">
|
||||
<Grid RowSpacing="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Button
|
||||
x:Name="Run"
|
||||
Text="Run"
|
||||
Padding="10,10,10,0"
|
||||
Clicked="Button_Clicked" />
|
||||
<ScrollView Orientation="Both" Grid.Row="1">
|
||||
<Label
|
||||
x:Name="Summary"
|
||||
Grid.Row="1"
|
||||
Padding="10"
|
||||
FontFamily="monospace" />
|
||||
</ScrollView>
|
||||
<ActivityIndicator
|
||||
x:Name="Indicator"
|
||||
Grid.RowSpan="2"
|
||||
Color="DarkGray"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center" />
|
||||
</Grid>
|
||||
</ContentPage>
|
|
@ -0,0 +1,62 @@
|
|||
using BenchmarkDotNet.Analysers;
|
||||
using BenchmarkDotNet.Exporters;
|
||||
using BenchmarkDotNet.Loggers;
|
||||
using BenchmarkDotNet.Running;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace BenchmarkDotNet.Samples.Forms
|
||||
{
|
||||
public partial class MainPage : ContentPage
|
||||
{
|
||||
public MainPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
async void Button_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
SetIsRunning(true);
|
||||
try
|
||||
{
|
||||
var logger = new AccumulationLogger();
|
||||
await Task.Run(() =>
|
||||
{
|
||||
var summary = BenchmarkRunner.Run<IntroBasic>();
|
||||
MarkdownExporter.Console.ExportToLog(summary, logger);
|
||||
ConclusionHelper.Print(logger,
|
||||
summary.BenchmarksCases
|
||||
.SelectMany(benchmark => benchmark.Config.GetCompositeAnalyser().Analyse(summary))
|
||||
.Distinct()
|
||||
.ToList());
|
||||
});
|
||||
SetSummary(logger.GetLog());
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
await DisplayAlert("Error", exc.Message, "Ok");
|
||||
}
|
||||
finally
|
||||
{
|
||||
SetIsRunning(false);
|
||||
}
|
||||
}
|
||||
|
||||
void SetIsRunning(bool isRunning)
|
||||
{
|
||||
Indicator.IsRunning = isRunning;
|
||||
Run.IsVisible =
|
||||
Summary.IsVisible = !isRunning;
|
||||
}
|
||||
|
||||
void SetSummary(string text)
|
||||
{
|
||||
Summary.Text = text;
|
||||
var size = Summary.Measure(double.MaxValue, double.MaxValue).Request;
|
||||
Summary.WidthRequest = size.Width;
|
||||
Summary.HeightRequest = size.Height;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace BenchmarkDotNet.Samples.Forms.iOS
|
||||
{
|
||||
// The UIApplicationDelegate for the application. This class is responsible for launching the
|
||||
// User Interface of the application, as well as listening (and optionally responding) to
|
||||
// application events from iOS.
|
||||
[Register("AppDelegate")]
|
||||
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
|
||||
{
|
||||
//
|
||||
// This method is invoked when the application has loaded and is ready to run. In this
|
||||
// method you should instantiate the window, load the UI into it and then make the window
|
||||
// visible.
|
||||
//
|
||||
// You have 17 seconds to return from this method, or iOS will terminate your application.
|
||||
//
|
||||
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
|
||||
{
|
||||
global::Xamarin.Forms.Forms.Init();
|
||||
LoadApplication(new App());
|
||||
|
||||
return base.FinishedLaunching(app, options);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,117 @@
|
|||
{
|
||||
"images": [
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "20x20",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon40.png"
|
||||
},
|
||||
{
|
||||
"scale": "3x",
|
||||
"size": "20x20",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon60.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "29x29",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon58.png"
|
||||
},
|
||||
{
|
||||
"scale": "3x",
|
||||
"size": "29x29",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon87.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "40x40",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon80.png"
|
||||
},
|
||||
{
|
||||
"scale": "3x",
|
||||
"size": "40x40",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon120.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "60x60",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon120.png"
|
||||
},
|
||||
{
|
||||
"scale": "3x",
|
||||
"size": "60x60",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon180.png"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"size": "20x20",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon20.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "20x20",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon40.png"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"size": "29x29",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon29.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "29x29",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon58.png"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"size": "40x40",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon40.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "40x40",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon80.png"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"size": "76x76",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon76.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "76x76",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon152.png"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"size": "83.5x83.5",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon167.png"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"size": "1024x1024",
|
||||
"idiom": "ios-marketing",
|
||||
"filename": "Icon1024.png"
|
||||
}
|
||||
],
|
||||
"properties": {},
|
||||
"info": {
|
||||
"version": 1,
|
||||
"author": "xcode"
|
||||
}
|
||||
}
|
Двоичные данные
samples/BenchmarkDotNet.Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png
Normal file
После Ширина: | Высота: | Размер: 69 KiB |
Двоичные данные
samples/BenchmarkDotNet.Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png
Normal file
После Ширина: | Высота: | Размер: 3.7 KiB |
Двоичные данные
samples/BenchmarkDotNet.Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png
Normal file
После Ширина: | Высота: | Размер: 4.6 KiB |
Двоичные данные
samples/BenchmarkDotNet.Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png
Normal file
После Ширина: | Высота: | Размер: 4.6 KiB |
Двоичные данные
samples/BenchmarkDotNet.Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png
Normal file
После Ширина: | Высота: | Размер: 5.1 KiB |
Двоичные данные
samples/BenchmarkDotNet.Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png
Normal file
После Ширина: | Высота: | Размер: 1.3 KiB |
Двоичные данные
samples/BenchmarkDotNet.Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png
Normal file
После Ширина: | Высота: | Размер: 845 B |
Двоичные данные
samples/BenchmarkDotNet.Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png
Normal file
После Ширина: | Высота: | Размер: 1.1 KiB |
Двоичные данные
samples/BenchmarkDotNet.Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png
Normal file
После Ширина: | Высота: | Размер: 1.7 KiB |
Двоичные данные
samples/BenchmarkDotNet.Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png
Normal file
После Ширина: | Высота: | Размер: 2.5 KiB |
Двоичные данные
samples/BenchmarkDotNet.Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png
Normal file
После Ширина: | Высота: | Размер: 2.3 KiB |
Двоичные данные
samples/BenchmarkDotNet.Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png
Normal file
После Ширина: | Высота: | Размер: 2.4 KiB |
Двоичные данные
samples/BenchmarkDotNet.Samples.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png
Normal file
После Ширина: | Высота: | Размер: 2.7 KiB |
|
@ -0,0 +1,135 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}</ProjectGuid>
|
||||
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<TemplateGuid>{6143fdea-f3c2-4a09-aafa-6e230626515e}</TemplateGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>BenchmarkDotNet.Samples.Forms.iOS</RootNamespace>
|
||||
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
|
||||
<AssemblyName>BenchmarkDotNet.Samples.Forms.iOS</AssemblyName>
|
||||
<MtouchEnableSGenConc>true</MtouchEnableSGenConc>
|
||||
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchArch>x86_64</MtouchArch>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchArch>x86_64</MtouchArch>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhone\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchArch>ARM64</MtouchArch>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchInterpreter>-all</MtouchInterpreter>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\iPhone\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchArch>ARM64</MtouchArch>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
<None Include="Entitlements.plist" />
|
||||
<None Include="Info.plist" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<InterfaceDefinition Include="Resources\LaunchScreen.storyboard" />
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon1024.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon180.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon167.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon152.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon120.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon87.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon80.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon76.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon60.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon58.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon40.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon29.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Icon20.png">
|
||||
<Visible>false</Visible>
|
||||
</ImageAsset>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Xamarin.iOS" />
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.5.0.530" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.5.2" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BenchmarkDotNet.Samples.Forms\BenchmarkDotNet.Samples.Forms.csproj">
|
||||
<Project>{EF54613D-8A3D-42DB-BF98-AD95C582FEF3}</Project>
|
||||
<Name>BenchmarkDotNet.Samples.Forms</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>8.0</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>BenchmarkDotNet.Samples</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.benchmarkdotnet.samples</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>BenchmarkDotNet.Samples.Forms</string>
|
||||
<key>XSAppIconAssets</key>
|
||||
<string>Assets.xcassets/AppIcon.appiconset</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace BenchmarkDotNet.Samples.Forms.iOS
|
||||
{
|
||||
public class Application
|
||||
{
|
||||
// This is the main entry point of the application.
|
||||
static void Main(string[] args)
|
||||
{
|
||||
// if you want to use a different Application Delegate class from "AppDelegate"
|
||||
// you can specify it here.
|
||||
UIApplication.Main(args, null, "AppDelegate");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("BenchmarkDotNet.Samples.Forms.iOS")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("BenchmarkDotNet.Samples.Forms.iOS")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
После Ширина: | Высота: | Размер: 8.7 KiB |
После Ширина: | Высота: | Размер: 10 KiB |
После Ширина: | Высота: | Размер: 34 KiB |
После Ширина: | Высота: | Размер: 7.1 KiB |
После Ширина: | Высота: | Размер: 8.2 KiB |
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="X5k-f2-b5h">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="gAE-YM-kbH">
|
||||
<objects>
|
||||
<viewController id="X5k-f2-b5h" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="Y8P-hJ-Z43"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="9ZL-r4-8FZ"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="yd7-JS-zBw">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" misplaced="YES" image="Icon-60.png" translatesAutoresizingMaskIntoConstraints="NO" id="23">
|
||||
<rect key="frame" x="270" y="270" width="60" height="60"/>
|
||||
<rect key="contentStretch" x="0.0" y="0.0" width="0.0" height="0.0"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.20392156862745098" green="0.59607843137254901" blue="0.85882352941176465" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="23" firstAttribute="centerY" secondItem="yd7-JS-zBw" secondAttribute="centerY" priority="1" id="39"/>
|
||||
<constraint firstItem="23" firstAttribute="centerX" secondItem="yd7-JS-zBw" secondAttribute="centerX" priority="1" id="41"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="XAI-xm-WK6" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="349" y="339"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="Icon-60.png" width="180" height="180"/>
|
||||
</resources>
|
||||
</document>
|
|
@ -77,7 +77,18 @@ namespace BenchmarkDotNet.Configs
|
|||
|
||||
public SummaryStyle SummaryStyle => SummaryStyle.Default;
|
||||
|
||||
public string ArtifactsPath => Path.Combine(Directory.GetCurrentDirectory(), "BenchmarkDotNet.Artifacts");
|
||||
public string ArtifactsPath
|
||||
{
|
||||
get
|
||||
{
|
||||
var root = Directory.GetCurrentDirectory();
|
||||
if (root == "/")
|
||||
{
|
||||
root = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
|
||||
}
|
||||
return Path.Combine(root, "BenchmarkDotNet.Artifacts");
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<Job> GetJobs() => Array.Empty<Job>();
|
||||
|
||||
|
|
|
@ -13,8 +13,14 @@ namespace BenchmarkDotNet.Environments
|
|||
|
||||
public string MonoBclPath { get; }
|
||||
|
||||
public bool IsXamarinAndroid { get; }
|
||||
|
||||
public bool IsXamariniOS { get; }
|
||||
|
||||
private MonoRuntime(string name) : base(RuntimeMoniker.Mono, "mono", name)
|
||||
{
|
||||
IsXamarinAndroid = Type.GetType("Java.Lang.Object, Mono.Android") != null;
|
||||
IsXamariniOS = !IsXamarinAndroid && Type.GetType("Foundation.NSObject, Xamarin.iOS") != null;
|
||||
}
|
||||
|
||||
public MonoRuntime(string name, string customPath) : this(name) => CustomPath = customPath;
|
||||
|
|
|
@ -23,14 +23,28 @@ namespace BenchmarkDotNet.Helpers
|
|||
private void Attach()
|
||||
{
|
||||
process.Exited += ProcessOnExited;
|
||||
Console.CancelKeyPress += CancelKeyPressHandlerCallback;
|
||||
try
|
||||
{
|
||||
Console.CancelKeyPress += CancelKeyPressHandlerCallback;
|
||||
}
|
||||
catch (PlatformNotSupportedException)
|
||||
{
|
||||
// Thrown when running in Xamarin
|
||||
}
|
||||
AppDomain.CurrentDomain.ProcessExit += ProcessExitEventHandlerHandlerCallback;
|
||||
}
|
||||
|
||||
private void Detach()
|
||||
{
|
||||
process.Exited -= ProcessOnExited;
|
||||
Console.CancelKeyPress -= CancelKeyPressHandlerCallback;
|
||||
try
|
||||
{
|
||||
Console.CancelKeyPress -= CancelKeyPressHandlerCallback;
|
||||
}
|
||||
catch (PlatformNotSupportedException)
|
||||
{
|
||||
// Thrown when running in Xamarin
|
||||
}
|
||||
AppDomain.CurrentDomain.ProcessExit -= ProcessExitEventHandlerHandlerCallback;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace BenchmarkDotNet.Toolchains
|
|||
return false;
|
||||
}
|
||||
|
||||
if (runtime is MonoRuntime mono)
|
||||
if (runtime is MonoRuntime mono && !benchmarkCase.GetToolchain().IsInProcess)
|
||||
{
|
||||
if (string.IsNullOrEmpty(mono.CustomPath) && !HostEnvironmentInfo.GetCurrent().IsMonoInstalled.Value)
|
||||
{
|
||||
|
|
|
@ -6,7 +6,9 @@ using BenchmarkDotNet.Portability;
|
|||
using BenchmarkDotNet.Running;
|
||||
using BenchmarkDotNet.Toolchains.CoreRt;
|
||||
using BenchmarkDotNet.Toolchains.CsProj;
|
||||
using BenchmarkDotNet.Toolchains.InProcess;
|
||||
using BenchmarkDotNet.Toolchains.InProcess.Emit;
|
||||
using BenchmarkDotNet.Toolchains.InProcess.NoEmit;
|
||||
using BenchmarkDotNet.Toolchains.Mono;
|
||||
using BenchmarkDotNet.Toolchains.Roslyn;
|
||||
|
||||
|
@ -39,6 +41,10 @@ namespace BenchmarkDotNet.Toolchains
|
|||
return RoslynToolchain.Instance;
|
||||
|
||||
case MonoRuntime mono:
|
||||
if (mono.IsXamarinAndroid)
|
||||
return InProcessEmitToolchain.Instance;
|
||||
if (mono.IsXamariniOS)
|
||||
return InProcessNoEmitToolchain.Instance;
|
||||
if (!string.IsNullOrEmpty(mono.AotArgs))
|
||||
return MonoAotToolchain.Instance;
|
||||
|
||||
|
|