Skip to content

Commit f8f8703

Browse files
Xamarin Support
* 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`
1 parent 742f44f commit f8f8703

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1032
-6
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,6 @@ src/BenchmarkDotNet/Disassemblers/net461/*
5656
# Cake
5757
tools/**
5858
.dotnet
59+
60+
# Xamarin
61+
Resource.designer.cs

BenchmarkDotNet.Xamarin.sln

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.29920.165
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchmarkDotNet.Samples", "samples\BenchmarkDotNet.Samples\BenchmarkDotNet.Samples.csproj", "{D10D4FE7-44A1-4A33-A927-A694BCAF6284}"
7+
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchmarkDotNet", "src\BenchmarkDotNet\BenchmarkDotNet.csproj", "{6A3481EC-78A3-4A2E-994D-ED16778D83BB}"
9+
EndProject
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchmarkDotNet.Samples.Forms", "samples\BenchmarkDotNet.Samples.Forms\BenchmarkDotNet.Samples.Forms.csproj", "{34358E9C-7048-43F5-AA66-4F9060081178}"
11+
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BenchmarkDotNet.Samples.Android", "samples\BenchmarkDotNet.Samples.Android\BenchmarkDotNet.Samples.Android.csproj", "{F8547E13-AE77-44CC-9F1D-1717921C4B86}"
13+
EndProject
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BenchmarkDotNet.Samples.iOS", "samples\BenchmarkDotNet.Samples.iOS\BenchmarkDotNet.Samples.iOS.csproj", "{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}"
15+
EndProject
16+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchmarkDotNet.Disassembler.x64", "src\BenchmarkDotNet.Disassembler.x64\BenchmarkDotNet.Disassembler.x64.csproj", "{78BD1D11-7841-4079-8ED7-CD253A71FD33}"
17+
EndProject
18+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchmarkDotNet.Disassembler.x86", "src\BenchmarkDotNet.Disassembler.x86\BenchmarkDotNet.Disassembler.x86.csproj", "{6E54F07F-5B12-465A-ADA2-39879DB704C1}"
19+
EndProject
20+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchmarkDotNet.Annotations", "src\BenchmarkDotNet.Annotations\BenchmarkDotNet.Annotations.csproj", "{FA360486-97B1-4BA9-BCB2-78F86EA0F881}"
21+
EndProject
22+
Global
23+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
24+
Debug|Any CPU = Debug|Any CPU
25+
Debug|iPhone = Debug|iPhone
26+
Debug|iPhoneSimulator = Debug|iPhoneSimulator
27+
Release|Any CPU = Release|Any CPU
28+
Release|iPhone = Release|iPhone
29+
Release|iPhoneSimulator = Release|iPhoneSimulator
30+
EndGlobalSection
31+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
32+
{D10D4FE7-44A1-4A33-A927-A694BCAF6284}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{D10D4FE7-44A1-4A33-A927-A694BCAF6284}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{D10D4FE7-44A1-4A33-A927-A694BCAF6284}.Debug|iPhone.ActiveCfg = Debug|Any CPU
35+
{D10D4FE7-44A1-4A33-A927-A694BCAF6284}.Debug|iPhone.Build.0 = Debug|Any CPU
36+
{D10D4FE7-44A1-4A33-A927-A694BCAF6284}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
37+
{D10D4FE7-44A1-4A33-A927-A694BCAF6284}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
38+
{D10D4FE7-44A1-4A33-A927-A694BCAF6284}.Release|Any CPU.ActiveCfg = Release|Any CPU
39+
{D10D4FE7-44A1-4A33-A927-A694BCAF6284}.Release|Any CPU.Build.0 = Release|Any CPU
40+
{D10D4FE7-44A1-4A33-A927-A694BCAF6284}.Release|iPhone.ActiveCfg = Release|Any CPU
41+
{D10D4FE7-44A1-4A33-A927-A694BCAF6284}.Release|iPhone.Build.0 = Release|Any CPU
42+
{D10D4FE7-44A1-4A33-A927-A694BCAF6284}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
43+
{D10D4FE7-44A1-4A33-A927-A694BCAF6284}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
44+
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45+
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
46+
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Debug|iPhone.ActiveCfg = Debug|Any CPU
47+
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Debug|iPhone.Build.0 = Debug|Any CPU
48+
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
49+
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
50+
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
51+
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Release|Any CPU.Build.0 = Release|Any CPU
52+
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Release|iPhone.ActiveCfg = Release|Any CPU
53+
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Release|iPhone.Build.0 = Release|Any CPU
54+
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
55+
{6A3481EC-78A3-4A2E-994D-ED16778D83BB}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
56+
{34358E9C-7048-43F5-AA66-4F9060081178}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
57+
{34358E9C-7048-43F5-AA66-4F9060081178}.Debug|Any CPU.Build.0 = Debug|Any CPU
58+
{34358E9C-7048-43F5-AA66-4F9060081178}.Debug|iPhone.ActiveCfg = Debug|Any CPU
59+
{34358E9C-7048-43F5-AA66-4F9060081178}.Debug|iPhone.Build.0 = Debug|Any CPU
60+
{34358E9C-7048-43F5-AA66-4F9060081178}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
61+
{34358E9C-7048-43F5-AA66-4F9060081178}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
62+
{34358E9C-7048-43F5-AA66-4F9060081178}.Release|Any CPU.ActiveCfg = Release|Any CPU
63+
{34358E9C-7048-43F5-AA66-4F9060081178}.Release|Any CPU.Build.0 = Release|Any CPU
64+
{34358E9C-7048-43F5-AA66-4F9060081178}.Release|iPhone.ActiveCfg = Release|Any CPU
65+
{34358E9C-7048-43F5-AA66-4F9060081178}.Release|iPhone.Build.0 = Release|Any CPU
66+
{34358E9C-7048-43F5-AA66-4F9060081178}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
67+
{34358E9C-7048-43F5-AA66-4F9060081178}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
68+
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
69+
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Debug|Any CPU.Build.0 = Debug|Any CPU
70+
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
71+
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Debug|iPhone.ActiveCfg = Debug|Any CPU
72+
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Debug|iPhone.Build.0 = Debug|Any CPU
73+
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Debug|iPhone.Deploy.0 = Debug|Any CPU
74+
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
75+
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
76+
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU
77+
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Release|Any CPU.ActiveCfg = Release|Any CPU
78+
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Release|Any CPU.Build.0 = Release|Any CPU
79+
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Release|Any CPU.Deploy.0 = Release|Any CPU
80+
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Release|iPhone.ActiveCfg = Release|Any CPU
81+
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Release|iPhone.Build.0 = Release|Any CPU
82+
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Release|iPhone.Deploy.0 = Release|Any CPU
83+
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
84+
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
85+
{F8547E13-AE77-44CC-9F1D-1717921C4B86}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
86+
{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}.Debug|Any CPU.ActiveCfg = Debug|iPhone
87+
{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}.Debug|iPhone.ActiveCfg = Debug|iPhone
88+
{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}.Debug|iPhone.Build.0 = Debug|iPhone
89+
{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
90+
{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
91+
{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}.Release|Any CPU.ActiveCfg = Release|iPhone
92+
{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}.Release|iPhone.ActiveCfg = Release|iPhone
93+
{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}.Release|iPhone.Build.0 = Release|iPhone
94+
{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
95+
{0A63C8A0-F7EB-47D7-8057-0C87C77C02A4}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
96+
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
97+
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Debug|Any CPU.Build.0 = Debug|Any CPU
98+
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Debug|iPhone.ActiveCfg = Debug|Any CPU
99+
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Debug|iPhone.Build.0 = Debug|Any CPU
100+
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
101+
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
102+
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Release|Any CPU.ActiveCfg = Release|Any CPU
103+
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Release|Any CPU.Build.0 = Release|Any CPU
104+
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Release|iPhone.ActiveCfg = Release|Any CPU
105+
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Release|iPhone.Build.0 = Release|Any CPU
106+
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
107+
{78BD1D11-7841-4079-8ED7-CD253A71FD33}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
108+
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
109+
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
110+
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Debug|iPhone.ActiveCfg = Debug|Any CPU
111+
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Debug|iPhone.Build.0 = Debug|Any CPU
112+
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
113+
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
114+
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
115+
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Release|Any CPU.Build.0 = Release|Any CPU
116+
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Release|iPhone.ActiveCfg = Release|Any CPU
117+
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Release|iPhone.Build.0 = Release|Any CPU
118+
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
119+
{6E54F07F-5B12-465A-ADA2-39879DB704C1}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
120+
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
121+
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Debug|Any CPU.Build.0 = Debug|Any CPU
122+
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Debug|iPhone.ActiveCfg = Debug|Any CPU
123+
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Debug|iPhone.Build.0 = Debug|Any CPU
124+
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
125+
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
126+
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Release|Any CPU.ActiveCfg = Release|Any CPU
127+
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Release|Any CPU.Build.0 = Release|Any CPU
128+
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Release|iPhone.ActiveCfg = Release|Any CPU
129+
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Release|iPhone.Build.0 = Release|Any CPU
130+
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
131+
{FA360486-97B1-4BA9-BCB2-78F86EA0F881}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
132+
EndGlobalSection
133+
GlobalSection(SolutionProperties) = preSolution
134+
HideSolutionNode = FALSE
135+
EndGlobalSection
136+
GlobalSection(ExtensibilityGlobals) = postSolution
137+
SolutionGuid = {36B462DE-57CC-423E-855A-F3B19FE99549}
138+
EndGlobalSection
139+
EndGlobal

docs/articles/samples/IntroXamarin.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
uid: BenchmarkDotNet.Samples.Xamarin
3+
---
4+
5+
## Sample: IntroXamarin
6+
7+
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.
8+
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.
9+
10+
Other notes:
11+
12+
* Use `Release` builds when running actual benchmarks.
13+
* Disable the linker via the `Don't Link` or `None`.
14+
15+
### Source code
16+
17+
[!code-csharp[MainPage.xaml.cs](../../../samples/BenchmarkDotNet.Samples.Forms/MainPage.xaml.cs)]
18+
19+
### Output
20+
21+
![Xamarin Output](../../images/xamarin-screenshot.png)
22+
23+
### Links
24+
25+
* [Xamarin.Android linker settings](https://docs.microsoft.com/xamarin/android/deploy-test/linker#linker-behavior)
26+
* [Xamarin.iOS linker settings](https://docs.microsoft.com/xamarin/ios/deploy-test/linker#dont-link)
27+
* The permanent link to this sample: @BenchmarkDotNet.Samples.Xamarin
28+
29+
---

docs/images/xamarin-screenshot.png

91.5 KB
Loading
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProjectGuid>{F8547E13-AE77-44CC-9F1D-1717921C4B86}</ProjectGuid>
7+
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
8+
<TemplateGuid>{c9e5eea5-ca05-42a1-839b-61506e0a37df}</TemplateGuid>
9+
<OutputType>Library</OutputType>
10+
<RootNamespace>BenchmarkDotNet.Samples.Forms.Droid</RootNamespace>
11+
<AssemblyName>BenchmarkDotNet.Samples.Forms.Android</AssemblyName>
12+
<AndroidApplication>True</AndroidApplication>
13+
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
14+
<AndroidResgenClass>Resource</AndroidResgenClass>
15+
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
16+
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
17+
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
18+
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
19+
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
20+
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
21+
<AndroidUseAapt2>true</AndroidUseAapt2>
22+
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
23+
<NuGetPackageImportStamp>
24+
</NuGetPackageImportStamp>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
27+
<DebugSymbols>true</DebugSymbols>
28+
<DebugType>portable</DebugType>
29+
<Optimize>false</Optimize>
30+
<OutputPath>bin\Debug</OutputPath>
31+
<DefineConstants>DEBUG;</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
<AndroidLinkMode>None</AndroidLinkMode>
35+
</PropertyGroup>
36+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
37+
<DebugSymbols>true</DebugSymbols>
38+
<DebugType>portable</DebugType>
39+
<Optimize>true</Optimize>
40+
<OutputPath>bin\Release</OutputPath>
41+
<ErrorReport>prompt</ErrorReport>
42+
<WarningLevel>4</WarningLevel>
43+
<AndroidManagedSymbols>true</AndroidManagedSymbols>
44+
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
45+
<AndroidSupportedAbis>armeabi-v7a;x86;x86_64;arm64-v8a</AndroidSupportedAbis>
46+
<AndroidLinkMode>None</AndroidLinkMode>
47+
</PropertyGroup>
48+
<ItemGroup>
49+
<Reference Include="Mono.Android" />
50+
<Reference Include="System" />
51+
<Reference Include="System.Core" />
52+
<Reference Include="System.Xml.Linq" />
53+
<Reference Include="System.Xml" />
54+
<Reference Include="System.Numerics" />
55+
<Reference Include="System.Numerics.Vectors" />
56+
</ItemGroup>
57+
<ItemGroup>
58+
<PackageReference Include="Xamarin.Forms" Version="4.5.0.530" />
59+
<PackageReference Include="Xamarin.Essentials" Version="1.5.2" />
60+
</ItemGroup>
61+
<ItemGroup>
62+
<Compile Include="MainActivity.cs" />
63+
<Compile Include="Resources\Resource.designer.cs" />
64+
<Compile Include="Properties\AssemblyInfo.cs" />
65+
</ItemGroup>
66+
<ItemGroup>
67+
<None Include="Properties\AndroidManifest.xml" />
68+
</ItemGroup>
69+
<ItemGroup>
70+
<AndroidResource Include="Resources\layout\Tabbar.xml" />
71+
<AndroidResource Include="Resources\layout\Toolbar.xml" />
72+
<AndroidResource Include="Resources\values\styles.xml" />
73+
<AndroidResource Include="Resources\values\colors.xml" />
74+
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon.xml" />
75+
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon_round.xml" />
76+
<AndroidResource Include="Resources\mipmap-hdpi\icon.png" />
77+
<AndroidResource Include="Resources\mipmap-hdpi\launcher_foreground.png" />
78+
<AndroidResource Include="Resources\mipmap-mdpi\icon.png" />
79+
<AndroidResource Include="Resources\mipmap-mdpi\launcher_foreground.png" />
80+
<AndroidResource Include="Resources\mipmap-xhdpi\icon.png" />
81+
<AndroidResource Include="Resources\mipmap-xhdpi\launcher_foreground.png" />
82+
<AndroidResource Include="Resources\mipmap-xxhdpi\icon.png" />
83+
<AndroidResource Include="Resources\mipmap-xxhdpi\launcher_foreground.png" />
84+
<AndroidResource Include="Resources\mipmap-xxxhdpi\icon.png" />
85+
<AndroidResource Include="Resources\mipmap-xxxhdpi\launcher_foreground.png" />
86+
</ItemGroup>
87+
<ItemGroup>
88+
<Folder Include="Resources\drawable\" />
89+
</ItemGroup>
90+
<ItemGroup>
91+
<ProjectReference Include="..\BenchmarkDotNet.Samples.Forms\BenchmarkDotNet.Samples.Forms.csproj">
92+
<Project>{EF54613D-8A3D-42DB-BF98-AD95C582FEF3}</Project>
93+
<Name>BenchmarkDotNet.Samples.Forms</Name>
94+
</ProjectReference>
95+
</ItemGroup>
96+
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
97+
</Project>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System;
2+
3+
using Android.App;
4+
using Android.Content.PM;
5+
using Android.Runtime;
6+
using Android.Views;
7+
using Android.Widget;
8+
using Android.OS;
9+
10+
namespace BenchmarkDotNet.Samples.Forms.Droid
11+
{
12+
[Activity(Label = "BenchmarkDotNet.Samples.Forms", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
13+
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
14+
{
15+
protected override void OnCreate(Bundle savedInstanceState)
16+
{
17+
TabLayoutResource = Resource.Layout.Tabbar;
18+
ToolbarResource = Resource.Layout.Toolbar;
19+
20+
base.OnCreate(savedInstanceState);
21+
22+
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
23+
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
24+
LoadApplication(new App());
25+
}
26+
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
27+
{
28+
Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
29+
30+
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
31+
}
32+
}
33+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.benchmarkdotnet.samples">
3+
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
4+
<application android:label="BenchmarkDotNet.Samples.Android"></application>
5+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
6+
</manifest>

0 commit comments

Comments
 (0)