Browse Source

Add avalonia aot profile to the package

pull/11429/head
Max Katz 3 years ago
parent
commit
ecda907830
  1. 12
      samples/ControlCatalog.Android/ControlCatalog.Android.csproj
  2. 23
      samples/MobileSandbox.Android/MobileSandbox.Android.csproj
  3. 5
      src/Android/Avalonia.Android/Avalonia.Android.csproj
  4. 9
      src/Android/Avalonia.Android/Avalonia.Android.targets
  5. BIN
      src/Android/Avalonia.Android/avalonia.aprof

12
samples/ControlCatalog.Android/ControlCatalog.Android.csproj

@ -16,17 +16,6 @@
</AndroidResource>
</ItemGroup>
<PropertyGroup Condition="'$(RunAOTCompilation)'=='' and '$(Configuration)'=='Release' and '$(TF_BUILD)'==''">
<RunAOTCompilation>True</RunAOTCompilation>
</PropertyGroup>
<!-- PropertyGroup Condition="'$(RunAOTCompilation)'=='True'">
<EnableLLVM>True</EnableLLVM>
<AndroidAotAdditionalArguments>no-write-symbols,nodebug</AndroidAotAdditionalArguments>
<AndroidAotMode>Hybrid</AndroidAotMode>
<AndroidGenerateJniMarshalMethods>True</AndroidGenerateJniMarshalMethods>
</PropertyGroup -->
<PropertyGroup Condition="'$(AndroidEnableProfiler)'=='True'">
<IsEmulator Condition="'$(IsEmulator)' == ''">True</IsEmulator>
<DebugSymbols>True</DebugSymbols>
@ -41,4 +30,5 @@
<ProjectReference Include="..\..\src\Android\Avalonia.Android\Avalonia.Android.csproj" />
<ProjectReference Include="..\ControlCatalog\ControlCatalog.csproj" />
</ItemGroup>
<Import Project="../../src/Android/Avalonia.Android/Avalonia.Android.targets" />
</Project>

23
samples/MobileSandbox.Android/MobileSandbox.Android.csproj

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-android</TargetFramework>
<TargetFramework>net7.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<OutputType>Exe</OutputType>
<Nullable>enable</Nullable>
@ -9,6 +9,8 @@
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<AndroidPackageFormat>apk</AndroidPackageFormat>
<MSBuildEnableWorkloadResolver>true</MSBuildEnableWorkloadResolver>
<!-- Uncomment to test without Avalonia aot profile -->
<AvaloniaUseDefaultAotProfile>false</AvaloniaUseDefaultAotProfile>
</PropertyGroup>
<ItemGroup>
<AndroidResource Include="..\..\build\Assets\Icon.png">
@ -16,22 +18,10 @@
</AndroidResource>
</ItemGroup>
<PropertyGroup Condition="'$(RunAOTCompilation)'=='' and '$(Configuration)'=='Release' and '$(TF_BUILD)'==''">
<RunAOTCompilation>True</RunAOTCompilation>
</PropertyGroup>
<!-- PropertyGroup Condition="'$(RunAOTCompilation)'=='True'">
<EnableLLVM>True</EnableLLVM>
<AndroidAotAdditionalArguments>no-write-symbols,nodebug</AndroidAotAdditionalArguments>
<AndroidAotMode>Hybrid</AndroidAotMode>
<AndroidGenerateJniMarshalMethods>True</AndroidGenerateJniMarshalMethods>
</PropertyGroup -->
<PropertyGroup Condition="'$(AndroidEnableProfiler)'=='True'">
<IsEmulator Condition="'$(IsEmulator)' == ''">True</IsEmulator>
<DebugSymbols>True</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<AndroidEnvironment Condition="'$(IsEmulator)'=='True'" Include="environment.emulator.txt" />
<AndroidEnvironment Condition="'$(IsEmulator)'!='True'" Include="environment.device.txt" />
@ -41,4 +31,11 @@
<ProjectReference Include="..\..\src\Android\Avalonia.Android\Avalonia.Android.csproj" />
<ProjectReference Include="..\MobileSandbox\MobileSandbox.csproj" />
</ItemGroup>
<ItemGroup>
<!-- https://github.com/AvaloniaUI/Avalonia/issues/8108 -->
<PackageReference Include="Mono.AotProfiler.Android" Version="7.0.0" />
</ItemGroup>
<Import Project="../../src/Android/Avalonia.Android/Avalonia.Android.targets" />
</Project>

5
src/Android/Avalonia.Android/Avalonia.Android.csproj

@ -17,6 +17,11 @@
<ProjectReference Include="..\..\Avalonia.Base\Avalonia.Base.csproj" />
<ProjectReference Include="..\..\Skia\Avalonia.Skia\Avalonia.Skia.csproj" />
</ItemGroup>
<ItemGroup>
<Content Include="*.props" Pack="true" PackagePath="build\" />
<Content Include="*.targets" Pack="true" PackagePath="build\;buildTransitive\" />
<Content Include="*.aprof" Pack="true" PackagePath="build\" />
</ItemGroup>
<Import Project="..\..\..\build\DevAnalyzers.props" />
<Import Project="..\..\..\build\TrimmingEnable.props" />
</Project>

9
src/Android/Avalonia.Android/Avalonia.Android.targets

@ -0,0 +1,9 @@
<Project>
<PropertyGroup>
<AvaloniaUseDefaultAotProfile Condition="'$(AvaloniaUseDefaultAotProfile)' == ''">true</AvaloniaUseDefaultAotProfile>
<AndroidUseDefaultAotProfile Condition="'$(AvaloniaUseDefaultAotProfile)' == 'true' and '$(AndroidUseDefaultAotProfile)' == ''">false</AndroidUseDefaultAotProfile>
</PropertyGroup>
<ItemGroup Condition="'$(AndroidEnableProfiledAot)' == 'true' and '$(AvaloniaUseDefaultAotProfile)' != 'false'">
<AndroidAotProfile Include="$(MSBuildThisFileDirectory)avalonia.aprof" />
</ItemGroup>
</Project>

BIN
src/Android/Avalonia.Android/avalonia.aprof

Binary file not shown.
Loading…
Cancel
Save