forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAndroidSampleApp.csproj
More file actions
130 lines (114 loc) · 6.4 KB
/
AndroidSampleApp.csproj
File metadata and controls
130 lines (114 loc) · 6.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<RuntimeIdentifier>android-$(TargetArchitecture)</RuntimeIdentifier>
<PublishTrimmed>true</PublishTrimmed>
<TrimMode>Link</TrimMode>
<ForceAOT Condition="'$(ForceAOT)' == ''">false</ForceAOT>
</PropertyGroup>
<Import Project="$(RepoTasksDir)AotCompilerTask\MonoAOTCompiler.props" />
<UsingTask TaskName="AndroidAppBuilderTask" AssemblyFile="$(AndroidAppBuilderTasksAssemblyPath)"/>
<UsingTask TaskName="MonoAOTCompiler" AssemblyFile="$(MonoAOTCompilerTasksAssemblyPath)" />
<PropertyGroup Condition="'$(RunAOTCompilation)' == 'true'">
<_MobileIntermediateOutputPath>$(IntermediateOutputPath)mobile</_MobileIntermediateOutputPath>
</PropertyGroup>
<Target Name="BuildApp" AfterTargets="CopyFilesToPublishDirectory">
<PropertyGroup>
<StripDebugSymbols>False</StripDebugSymbols>
<StripDebugSymbols Condition="'$(Configuration)' == 'Release'">True</StripDebugSymbols>
<ApkDir>$(PublishDir)apk\</ApkDir>
</PropertyGroup>
<ItemGroup>
<AotInputAssemblies Include="$(PublishDir)\*.dll">
<AotArguments>@(MonoAOTCompilerDefaultAotArguments, ';')</AotArguments>
<ProcessArguments>@(MonoAOTCompilerDefaultProcessArguments, ';')</ProcessArguments>
</AotInputAssemblies>
</ItemGroup>
<MakeDir Directories="$(_MobileIntermediateOutputPath)"
Condition="'$(ForceAOT)' == 'true'"/>
<RemoveDir Directories="$(ApkDir)" />
<PropertyGroup>
<AndroidAbi Condition="'$(TargetArchitecture)' == 'arm64'">arm64-v8a</AndroidAbi>
<AndroidAbi Condition="'$(TargetArchitecture)' == 'arm'">armeabi-v7a</AndroidAbi>
<AndroidAbi Condition="'$(TargetArchitecture)' == 'x64'">x86_64</AndroidAbi>
<AndroidAbi Condition="'$(TargetArchitecture)' == 'x86'">x86</AndroidAbi>
</PropertyGroup>
<Message Importance="High" Text="Path: $(PublishDir)" />
<Message Importance="High" Text="SourceDir: $(OutputPath)" />
<PropertyGroup Condition="'$(ForceAOT)' == 'true' and '$(AOTWithLibraryFiles)' != 'true'">
<_AotOutputType>AsmOnly</_AotOutputType>
<_AotModulesTablePath>$(BundleDir)\modules.c</_AotModulesTablePath>
</PropertyGroup>
<PropertyGroup Condition="'$(ForceAOT)' == 'true' and '$(AOTWithLibraryFiles)' == 'true'">
<_AotOutputType>Library</_AotOutputType>
<_AotLibraryFormat>So</_AotLibraryFormat>
<_PrebuiltOS Condition="$([MSBuild]::IsOSPlatform('Linux'))">linux-x86_64</_PrebuiltOS>
<_PrebuiltOS Condition="$([MSBuild]::IsOSPlatform('OSX'))">darwin-x86_64</_PrebuiltOS>
<_PrebuiltOS Condition="$([MSBuild]::IsOSPlatform('Windows'))">windows-x86_64</_PrebuiltOS>
<_PrebuiltAbi Condition="'$(TargetArchitecture)' == 'arm'">arm-linux-androideabi$</_PrebuiltAbi>
<_PrebuiltAbi Condition="'$(TargetArchitecture)' == 'arm64'">aarch64-linux-android</_PrebuiltAbi>
<_PrebuiltAbi Condition="'$(TargetArchitecture)' == 'x64'">x86_64-linux-android</_PrebuiltAbi>
<_PrebuiltAbi Condition="'$(TargetArchitecture)' == 'x86'">i686-linux-android</_PrebuiltAbi>
<_AotToolPrefix>$(ANDROID_NDK_ROOT)\toolchains\llvm\prebuilt\$(_PrebuiltOS)\bin\$(_PrebuiltAbi)-</_AotToolPrefix>
</PropertyGroup>
<MonoAOTCompiler Condition="'$(ForceAOT)' == 'true'"
CompilerBinaryPath="@(MonoAotCrossCompiler->WithMetadataValue('RuntimeIdentifier','$(TargetOS.ToLowerInvariant())-$(TargetArchitecture.ToLowerInvariant())'))"
OutputDir="$(_MobileIntermediateOutputPath)"
Mode="Full"
OutputType="$(_AotOutputType)"
Assemblies="@(AotInputAssemblies)"
AotModulesTablePath="$(_AotModulesTablePath)"
ToolPrefix="$(_AotToolPrefix)"
LibraryFormat="$(_AotLibraryFormat)"
IntermediateOutputPath="$(IntermediateOutputPath)"
UseLLVM="$(UseLLVM)"
LLVMPath="$(MonoAotCrossDir)">
<Output TaskParameter="CompiledAssemblies" ItemName="BundleAssemblies" />
</MonoAOTCompiler>
<AndroidAppBuilderTask
RuntimeIdentifier="$(RuntimeIdentifier)"
ProjectName="HelloAndroid"
ForceInterpreter="$(MonoForceInterpreter)"
ForceAOT="$(ForceAOT)"
MonoRuntimeHeaders="$(MicrosoftNetCoreAppRuntimePackDir)runtimes\android-$(TargetArchitecture)\native\include\mono-2.0"
Assemblies="@(BundleAssemblies)"
MainLibraryFileName="$(AssemblyName).dll"
StripDebugSymbols="$(StripDebugSymbols)"
RuntimeComponents="$(RuntimeComponents)"
DiagnosticPorts="$(DiagnosticPorts)"
OutputDir="$(ApkDir)"
AppDir="$(PublishDir)">
<Output TaskParameter="ApkBundlePath" PropertyName="ApkBundlePath" />
<Output TaskParameter="ApkPackageId" PropertyName="ApkPackageId" />
</AndroidAppBuilderTask>
<Message Importance="High" Text="Apk: $(ApkBundlePath)"/>
<Message Importance="High" Text="PackageId: $(ApkPackageId)"/>
<Exec Condition="'$(DeployAndRun)' == 'true' and '$(ArchiveTests)' != 'true'" Command="dotnet xharness android test --package-name=net.dot.HelloAndroid --instrumentation=net.dot.MonoRunner --app=$(ApkDir)/bin/HelloAndroid.apk --expected-exit-code=42 --output-directory=$(ApkDir)/log" />
</Target>
<ItemGroup>
<Compile Include="Program.cs" />
</ItemGroup>
<Target Name="CopySampleAppToHelixTestDir"
Condition="'$(ArchiveTests)' == 'true'"
AfterTargets="Build"
DependsOnTargets="Publish;BuildApp" >
<PropertyGroup>
<!-- Helix properties -->
<!-- AnyCPU as Platform-->
<OSPlatformConfig>$(TargetOS).AnyCPU.$(Configuration)</OSPlatformConfig>
<!-- <OSPlatformConfig>$(TargetOS).$(Platform).$(Configuration)</OSPlatformConfig> -->
<HelixArchiveRoot>$(ArtifactsDir)helix/</HelixArchiveRoot>
<HelixArchiveRunOnlyRoot>$(HelixArchiveRoot)runonly/</HelixArchiveRunOnlyRoot>
<HelixArchiveRunOnlyAppsDir>$(HelixArchiveRunOnlyRoot)$(OSPlatformConfig)/</HelixArchiveRunOnlyAppsDir>
</PropertyGroup>
<ItemGroup>
<_apkFiles Include="$(ApkBundlePath)" />
</ItemGroup>
<Copy SourceFiles="@(_apkFiles)"
DestinationFolder="$(HelixArchiveRunOnlyAppsDir)/%(RecursiveDir)" />
<Message Importance="High" Text="ApkBundlePath: $(ApkBundlePath)"/>
<Message Importance="High" Text="TestArchiveTestsDir: $(TestArchiveTestsDir)"/>
</Target>
</Project>