Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mono][tests] Run Mono iOS sample as functional test on the simulator and maccatalyst on Helix #86578

Merged
merged 31 commits into from
Jun 11, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
cdca223
Run Mono and Native AOT iOS sample on Helix
kotlarmilos May 22, 2023
0e4cae2
Merge branch 'dotnet:main' into feature/ios-sample-helix
kotlarmilos May 23, 2023
17d7dee
Run sample on iOS, tvOS, and maccatalyst
kotlarmilos May 23, 2023
14c2ff5
Disable Native AOT sample app
kotlarmilos May 23, 2023
f190a4a
Disable tvOS platform
kotlarmilos May 23, 2023
304896e
Add HelloiOS sample on iossimulator
kotlarmilos May 23, 2023
2ff8a3d
Enable AOT compilation on iossimulator
kotlarmilos May 23, 2023
da8630f
Use JustInterp AOTMode on iossimulator
kotlarmilos May 24, 2023
d844d59
Merge branch 'dotnet:main' into feature/ios-sample-helix
kotlarmilos May 26, 2023
2530db6
Remove custom tasks from the sample app
kotlarmilos May 29, 2023
12326b1
Merge branch 'feature/ios-sample-helix' of github.com:kotlarmilos/run…
kotlarmilos May 29, 2023
81d9528
Add ExcludeFromAppDir to AppleAppBuilderTask
kotlarmilos May 29, 2023
e31d036
Add BuildAppBundle target to invoke AOT compilation on CI
kotlarmilos May 29, 2023
f1450df
Use optimized flag in AppleAppBuilder and run CopySampleAppToHelixTes…
kotlarmilos May 29, 2023
b22546f
Update src/mono/sample/iOS/Program.csproj
kotlarmilos May 29, 2023
fd1a0f6
Enable ILStrip in Full AOT mode only
kotlarmilos May 30, 2023
b160c88
Merge branch 'dotnet:main' into feature/ios-sample-helix
kotlarmilos Jun 1, 2023
0987890
Update app bundle path
kotlarmilos Jun 1, 2023
1e52a6b
Change default values for TargetOS and DeployAndRun
kotlarmilos Jun 1, 2023
2151b27
Disable the functional test on a device
kotlarmilos Jun 1, 2023
6f8a02d
Avoid circular target reference
kotlarmilos Jun 1, 2023
232e579
Use different beforeTargets for _CustomAppleAotCompileProps according…
kotlarmilos Jun 2, 2023
6613ea9
Update BuildAppBundle target dependencies when run on the CI
kotlarmilos Jun 2, 2023
933bd08
Merge branch 'dotnet:main' into feature/ios-sample-helix
kotlarmilos Jun 5, 2023
83456ac
Test the CI with ProjectName=''
kotlarmilos Jun 5, 2023
a0dfebc
Use AppName as ProjectName in AppleBuild.targets
kotlarmilos Jun 5, 2023
5b211e1
Remove disabled runs
kotlarmilos Jun 6, 2023
aa100ee
Simplify .csproj file
kotlarmilos Jun 6, 2023
16e3e72
Use AssemblyName as MainLibraryFileName
kotlarmilos Jun 6, 2023
7abe5f4
Merge branch 'dotnet:main' into feature/ios-sample-helix
kotlarmilos Jun 7, 2023
5e2be8c
Set default props for the sample app. Use diagnostics_tracing and mar…
kotlarmilos Jun 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions eng/pipelines/coreclr/templates/build-perf-sample-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ steps:
artifactName: ${{ parameters.artifactName }}
- template: /eng/pipelines/common/upload-artifact-step.yml
parameters:
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/publish/app/HelloiOS/Release-iphoneos/HelloiOS.app
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/Bundle/HelloiOS/Release-iphoneos/HelloiOS.app
includeRootFolder: true
displayName: iOS Sample App NoLLVM
artifactName: iOSSampleAppNoLLVMSymbols
Expand All @@ -72,7 +72,7 @@ steps:
artifactName: ${{ parameters.artifactName }}
- template: /eng/pipelines/common/upload-artifact-step.yml
parameters:
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/publish/app/HelloiOS/Release-iphoneos/HelloiOS.app
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/Bundle/HelloiOS/Release-iphoneos/HelloiOS.app
includeRootFolder: true
displayName: iOS Sample App NoLLVM NoSymbols
artifactName: iOSSampleAppNoLLVMNoSymbols
Expand All @@ -94,7 +94,7 @@ steps:
artifactName: ${{ parameters.artifactName }}
- template: /eng/pipelines/common/upload-artifact-step.yml
parameters:
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/publish/app/HelloiOS/Release-iphoneos/HelloiOS.app
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/Bundle/HelloiOS/Release-iphoneos/HelloiOS.app
includeRootFolder: true
displayName: iOS Sample App LLVM
artifactName: iOSSampleAppLLVMSymbols
Expand All @@ -116,7 +116,7 @@ steps:
artifactName: ${{ parameters.artifactName }}
- template: /eng/pipelines/common/upload-artifact-step.yml
parameters:
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/publish/app/HelloiOS/Release-iphoneos/HelloiOS.app
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS/bin/ios-arm64/Bundle/HelloiOS/Release-iphoneos/HelloiOS.app
includeRootFolder: true
displayName: iOS Sample App LLVM NoSymbols
artifactName: iOSSampleAppLLVMNoSymbols
Expand All @@ -137,7 +137,7 @@ steps:
artifactName: ${{ parameters.artifactName }}
- template: /eng/pipelines/common/upload-artifact-step.yml
parameters:
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS-NativeAOT/bin/publish/app/HelloiOS/Release-iphoneos/HelloiOS.app
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS-NativeAOT/bin/Bundle/HelloiOS/Release-iphoneos/HelloiOS.app
includeRootFolder: true
displayName: iOS Sample App Symbols
artifactName: iOSSampleAppSymbols
Expand All @@ -159,7 +159,7 @@ steps:
artifactName: ${{ parameters.artifactName }}
- template: /eng/pipelines/common/upload-artifact-step.yml
parameters:
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS-NativeAOT/bin/publish/app/HelloiOS/Release-iphoneos/HelloiOS.app
rootFolder: $(Build.SourcesDirectory)/src/mono/sample/iOS-NativeAOT/bin/Bundle/HelloiOS/Release-iphoneos/HelloiOS.app
includeRootFolder: true
displayName: iOS Sample App NoSymbols
artifactName: iOSSampleAppNoSymbols
Expand Down
10 changes: 4 additions & 6 deletions src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -632,9 +632,8 @@
</ItemGroup>

<ItemGroup Condition="'$(ArchiveTests)' == 'true' and '$(RunSmokeTestsOnly)' != 'true' and '$(RunGrpcTestsOnly)' != 'true' and '$(TargetOS)' == 'iossimulator'">
<!-- https://github.com/dotnet/runtime/issues/57666 -->
<!-- <ProjectReference Include="$(MonoProjectRoot)sample\iOS\Program.csproj"
BuildInParallel="false" /> -->
<ProjectReference Include="$(MonoProjectRoot)sample\iOS\Program.csproj"
BuildInParallel="false" />
<ProjectReference Include="$(RepoRoot)\src\tests\FunctionalTests\iOS\Simulator\**\*.Test.csproj"
Exclude="@(ProjectExclusions)"
BuildInParallel="false" />
Expand All @@ -647,9 +646,8 @@
</ItemGroup>

<ItemGroup Condition="'$(ArchiveTests)' == 'true' and '$(RunSmokeTestsOnly)' != 'true' and '$(RunGrpcTestsOnly)' != 'true' and '$(TargetOS)' == 'maccatalyst'">
<!-- https://github.com/dotnet/runtime/issues/57666 -->
<!-- <ProjectReference Include="$(MonoProjectRoot)sample\iOS\Program.csproj"
BuildInParallel="false" /> -->
<ProjectReference Include="$(MonoProjectRoot)sample\iOS\Program.csproj"
BuildInParallel="false" />
<ProjectReference Include="$(RepoRoot)\src\tests\FunctionalTests\iOS\Simulator\**\*.Test.csproj"
Exclude="@(ProjectExclusions)"
BuildInParallel="false" />
Expand Down
8 changes: 6 additions & 2 deletions src/mono/msbuild/apple/build/AppleBuild.targets
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<BundleDir>$(AppleBundleDir)</BundleDir>
<_MonoHeaderPath>$([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackRidNativeDir), 'include', 'mono-2.0'))</_MonoHeaderPath>
<_AotModuleTablePath>$(AppleBundleDir)\modules.m</_AotModuleTablePath>
<AppName Condition="'$(AppName)' == ''">$(AssemblyName)</AppName>
</PropertyGroup>

<!-- common linker arguments for app and library builds -->
Expand Down Expand Up @@ -84,6 +85,7 @@
<PropertyGroup>
<_AppleRuntimeConfigFilePath Condition="'$(_AppleRuntimeConfigFilePath)' == ''">$([MSBuild]::NormalizePath($(AppleBuildDir), '$(AssemblyName).runtimeconfig.json'))</_AppleRuntimeConfigFilePath>
<_ParsedRuntimeConfigFilePath Condition="'$(_ParsedRuntimeConfigFilePath)' == ''">$([MSBuild]::NormalizePath($(AppleBuildDir), 'runtimeconfig.bin'))</_ParsedRuntimeConfigFilePath>
<UseConsoleUITemplate Condition="'$(UseConsoleUITemplate)' == ''">true</UseConsoleUITemplate>
</PropertyGroup>

<RemoveDir Directories="$(AppleBundleDir)" />
Expand Down Expand Up @@ -183,6 +185,7 @@
<AotArguments>@(MonoAOTCompilerDefaultAotArguments, ';')</AotArguments>
<ProcessArguments>@(MonoAOTCompilerDefaultProcessArguments, ';')</ProcessArguments>
</_AotInputAssemblies>
<_ExcludeFromAppDir Include="$(_iOSLikeDedupAssembly)" />
</ItemGroup>

<!--
Expand Down Expand Up @@ -255,10 +258,11 @@
NativeMainSource="$(NativeMainSource)"
Optimized="$(Optimized)"
OutputDirectory="$(AppleBundleDir)"
ProjectName="$(AssemblyName)"
ProjectName="$(AppName)"
RuntimeComponents="$(RuntimeComponents)"
TargetOS="$(TargetOS)"
UseConsoleUITemplate="True">
ExcludeFromAppDir="@(_ExcludeFromAppDir)"
UseConsoleUITemplate="$(UseConsoleUITemplate)">
<Output TaskParameter="AppBundlePath" PropertyName="AppBundlePath" />
<Output TaskParameter="XcodeProjectPath" PropertyName="XcodeProjectPath" />
</AppleAppBuilderTask>
Expand Down
77 changes: 40 additions & 37 deletions src/mono/sample/iOS/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ MONO_CONFIG?=Debug
MONO_ARCH?=x64
DOTNET := ../../../../dotnet.sh
USE_LLVM=true
AOT?=false
TARGET?=iossimulator
DEPLOY_AND_RUN?=true
APP_SANDBOX?=false
Expand All @@ -25,68 +24,72 @@ appbuilder:
$(DOTNET) build -c Debug $(TOOLS_DIR)/AppleAppBuilder/AppleAppBuilder.csproj

runtimepack:
../../../../build.sh Mono+Libs -os $(TARGET) -arch $(MONO_ARCH) -c $(MONO_CONFIG)
../../../../build.sh mono+libs -os $(TARGET) -arch $(MONO_ARCH) -c $(MONO_CONFIG)

run: clean appbuilder
build-appbundle: clean appbuilder
$(DOTNET) publish \
-c $(MONO_CONFIG) \
/p:TargetOS=ios \
/p:TargetOS=$(TARGET) \
/p:TargetArchitecture=$(MONO_ARCH) \
/p:UseLLVM=$(USE_LLVM) \
/p:ForceAOT=$(AOT) \
'/p:RuntimeComponents="$(RUNTIME_COMPONENTS)"' \
'/p:DeployAndRun="$(DEPLOY_AND_RUN)"' \
'/p:DiagnosticPorts="$(DIAGNOSTIC_PORTS)"'
/p:MonoEnableLLVM=$(USE_LLVM) \
/p:StripDebugSymbols=$(STRIP_DEBUG_SYMBOLS) \
/p:DeployAndRun=false \
/bl

run-sim: clean appbuilder
run: clean appbuilder
$(DOTNET) publish \
-c $(MONO_CONFIG) \
/p:TargetOS=iossimulator \
/p:TargetOS=ios \
/p:TargetArchitecture=$(MONO_ARCH) \
/p:UseLLVM=$(USE_LLVM) \
/p:ForceAOT=$(AOT) \
'/p:RuntimeComponents="$(RUNTIME_COMPONENTS)"' \
'/p:DeployAndRun="$(DEPLOY_AND_RUN)"' \
'/p:DiagnosticPorts="$(DIAGNOSTIC_PORTS)"'

build-appbundle: clean appbuilder
$(DOTNET) publish -c $(MONO_CONFIG) /p:TargetOS=$(TARGET) /p:TargetArchitecture=$(MONO_ARCH) \
'/p:DeployAndRun="$(DEPLOY_AND_RUN)"' \
/p:StripDebugSymbols=$(STRIP_DEBUG_SYMBOLS) \
/p:UseLLVM=$(USE_LLVM) /p:ForceAOT=$(AOT) /bl \
/p:MonoEnableLLVM=$(USE_LLVM) \
/p:DeployAndRun=$(DEPLOY_AND_RUN) \
/p:RuntimeComponents="$(RUNTIME_COMPONENTS)" \
/p:DiagnosticPorts="$(DIAGNOSTIC_PORTS)" \
/bl

run-catalyst:
run-sim: clean appbuilder
$(DOTNET) publish \
-c $(MONO_CONFIG) \
/p:TargetOS=maccatalyst \
/p:TargetOS=iossimulator \
/p:TargetArchitecture=$(MONO_ARCH) \
'/p:DeployAndRun="$(DEPLOY_AND_RUN)"' \
/p:UseLLVM=False \
/p:ForceAOT=True \
/p:EnableAppSandbox=$(APP_SANDBOX)
/p:MonoEnableLLVM=$(USE_LLVM) \
/p:DeployAndRun=$(DEPLOY_AND_RUN) \
/p:RuntimeComponents="$(RUNTIME_COMPONENTS)" \
/p:DiagnosticPorts="$(DIAGNOSTIC_PORTS)" \
/bl

run-sim-interp: clean appbuilder
$(DOTNET) publish \
-c $(MONO_CONFIG) \
/p:TargetOS=iossimulator \
/p:TargetArchitecture=$(MONO_ARCH) \
/p:UseLLVM=$(USE_LLVM) \
/p:ForceAOT=$(AOT) \
/p:MonoEnableLLVM=$(USE_LLVM) \
/p:MonoForceInterpreter=true \
'/p:DeployAndRun="$(DEPLOY_AND_RUN)"' \
'/p:RuntimeComponents="$(RUNTIME_COMPONENTS)"' \
'/p:DiagnosticPorts="$(DIAGNOSTIC_PORTS)"'
/p:DeployAndRun=$(DEPLOY_AND_RUN) \
/p:RuntimeComponents="$(RUNTIME_COMPONENTS)" \
/p:DiagnosticPorts="$(DIAGNOSTIC_PORTS)" \
/bl

run-catalyst-interp:
run-catalyst: clean appbuilder
$(DOTNET) publish \
-c $(MONO_CONFIG) \
/p:TargetOS=maccatalyst \
/p:TargetArchitecture=$(MONO_ARCH) \
/p:UseLLVM=False \
'/p:DeployAndRun="$(DEPLOY_AND_RUN)"' \
/p:ForceAOT=True \
/p:MonoEnableLLVM=false \
/p:DeployAndRun=$(DEPLOY_AND_RUN) \
/p:EnableAppSandbox=$(APP_SANDBOX) \
/bl

run-catalyst-interp: clean appbuilder
$(DOTNET) publish \
-c $(MONO_CONFIG) \
/p:TargetOS=maccatalyst \
/p:TargetArchitecture=$(MONO_ARCH) \
/p:MonoEnableLLVM=False \
/p:MonoForceInterpreter=true
/p:DeployAndRun=$(DEPLOY_AND_RUN) \
/p:EnableAppSandbox=$(APP_SANDBOX) \
/bl

clean:
rm -rf bin
138 changes: 23 additions & 115 deletions src/mono/sample/iOS/Program.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,141 +3,49 @@
<OutputType>Exe</OutputType>
<OutputPath>bin</OutputPath>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<TargetOS Condition="'$(TargetOS)' == ''">ios</TargetOS>
<TargetOS Condition="'$(TargetsiOSSimulator)' == 'true'">iossimulator</TargetOS>
<DeployAndRun Condition="'$(DeployAndRun)' == ''">true</DeployAndRun>
<iOSLikeDedup Condition="'$(TargetOS)' == 'ios'">true</iOSLikeDedup>
<TargetOS Condition="'$(TargetOS)' == ''">iossimulator</TargetOS>
<RuntimeIdentifier>$(TargetOS)-$(TargetArchitecture)</RuntimeIdentifier>
<DefineConstants Condition="'$(ArchiveTests)' == 'true'">$(DefineConstants);CI_TEST</DefineConstants>
<AppName>HelloiOS</AppName>
<StripDebugSymbols Condition="'$(StripDebugSymbols)' == ''">false</StripDebugSymbols>
</PropertyGroup>
<MainLibraryFileName>$(AssemblyName).dll</MainLibraryFileName>

<PropertyGroup>
<RunAOTCompilation Condition="'$(RunAOTCompilation)' == ''">true</RunAOTCompilation>
<PublishTrimmed>true</PublishTrimmed>
<TrimMode>Link</TrimMode>
<Optimized Condition="'$(Configuration)' == 'Release'">true</Optimized>

<DevTeamProvisioning Condition="'$(DevTeamProvisioning)' == '' and '$(TargetOS)' != 'maccatalyst'">-</DevTeamProvisioning>
kotlarmilos marked this conversation as resolved.
Show resolved Hide resolved
<UseMonoJustInterp Condition="'$(UseMonoJustInterp)' == '' and '$(MonoForceInterpreter)' == 'true'">true</UseMonoJustInterp>
<ShouldILStrip Condition="'$(RunAOTCompilation)' == 'true' and '$(UseMonoJustInterp)' != 'true'" >true</ShouldILStrip>
<EnableDefaultAssembliesToBundle>true</EnableDefaultAssembliesToBundle>
<AppleGenerateAppBundle>true</AppleGenerateAppBundle>
<GenerateXcodeProject>true</GenerateXcodeProject>
<UseConsoleUITemplate>false</UseConsoleUITemplate>

<BuildAppBundleAfterTargets>CopyFilesToPublishDirectory</BuildAppBundleAfterTargets>
<BuildAppBundleAfterTargets Condition="'$(ArchiveTests)' == 'true'">CopyFilesToPublishDirectory;Build</BuildAppBundleAfterTargets>
<BuildAppBundleDependsOnTargets Condition="'$(ArchiveTests)' == 'true'">Publish</BuildAppBundleDependsOnTargets>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetOS)' == 'maccatalyst'">
<DevTeamProvisioning Condition="'$(TargetOS)' == 'maccatalyst' and '$(DevTeamProvisioning)' == ''">adhoc</DevTeamProvisioning>
ivanpovazan marked this conversation as resolved.
Show resolved Hide resolved
<EnableAppSandbox Condition="'$(EnableAppSandbox)' == ''">false</EnableAppSandbox>
</PropertyGroup>

<Import Project="$(RepoTasksDir)AotCompilerTask\MonoAOTCompiler.props" />
<UsingTask TaskName="AppleAppBuilderTask"
AssemblyFile="$(AppleAppBuilderTasksAssemblyPath)" />

<UsingTask TaskName="MonoAOTCompiler"
AssemblyFile="$(MonoAOTCompilerTasksAssemblyPath)" />

<UsingTask TaskName="ILStrip"
AssemblyFile="$(MonoTargetsTasksAssemblyPath)" />

<Target Name="BuildAppBundle" AfterTargets="CopyFilesToPublishDirectory">
<PropertyGroup>
<AppDir>$(MSBuildThisFileDirectory)$(PublishDir)\app</AppDir>
<IosSimulator Condition="'$(TargetsiOSSimulator)' == 'true'">iPhone 11</IosSimulator>
<Optimized Condition="'$(Configuration)' == 'Release'">True</Optimized>
<RunAOTCompilation Condition="('$(TargetsMacCatalyst)' == 'false' and '$(IosSimulator)' == '') or '$(ForceAOT)' == 'true'">true</RunAOTCompilation>
</PropertyGroup>

<RemoveDir Directories="$(AppDir)" />

<PropertyGroup Condition="'$(iOSLikeDedup)' == 'true'">
<_iOSLikeDedupAssembly>$(MSBuildThisFileDirectory)$(PublishDir)\aot-instances.dll</_iOSLikeDedupAssembly>
</PropertyGroup>
<WriteLinesToFile Condition="'$(iOSLikeDedup)' == 'true'" File="$(IntermediateOutputPath)/aot-instances.cs" Overwrite="true" Lines="" WriteOnlyWhenDifferent="true" />
<Csc Condition="'$(iOSLikeDedup)' == 'true'"
Sources="$(IntermediateOutputPath)\aot-instances.cs"
OutputAssembly="$(_iOSLikeDedupAssembly)"
TargetType="library"
Deterministic="true"
References="@(ReferencePath)"
ToolExe="$(CscToolExe)"
ToolPath="$(CscToolPath)" />

<ItemGroup>
<BundleAssemblies Condition="'$(RunAOTCompilation)' != 'true'" Include="$(MSBuildThisFileDirectory)$(PublishDir)\*.dll" />
<AotInputAssemblies Condition="'$(RunAOTCompilation)' == 'true'" Include="$(MSBuildThisFileDirectory)$(PublishDir)\*.dll">
<AotArguments>@(MonoAOTCompilerDefaultAotArguments, ';')</AotArguments>
<ProcessArguments>@(MonoAOTCompilerDefaultProcessArguments, ';')</ProcessArguments>
</AotInputAssemblies>
<_ExcludeFromAppDir Include="$(_iOSLikeDedupAssembly)" />
</ItemGroup>
<Import Project="$(MonoProjectRoot)\msbuild\apple\build\AppleBuild.props" />
<Import Project="$(MonoProjectRoot)\msbuild\apple\build\AppleBuild.InTree.targets" />

<PropertyGroup>
<AOTMode Condition="'$(TargetOS)' != 'maccatalyst'">Full</AOTMode>
<AOTMode Condition="'$(TargetOS)' == 'maccatalyst' and '$(MonoForceInterpreter)' != 'true'">Full</AOTMode>
<AOTMode Condition="'$(TargetOS)' == 'maccatalyst' and '$(MonoForceInterpreter)' == 'true'">JustInterp</AOTMode>
</PropertyGroup>

<MonoAOTCompiler
Condition="'$(RunAOTCompilation)' == 'true'"
CompilerBinaryPath="@(MonoAotCrossCompiler->WithMetadataValue('RuntimeIdentifier','$(TargetOS)-$(TargetArchitecture.ToLowerInvariant())'))"
Mode="$(AOTMode)"
OutputType="AsmOnly"
Assemblies="@(AotInputAssemblies)"
DedupAssembly="$(_iOSLikeDedupAssembly)"
AotModulesTablePath="$(AppDir)\modules.m"
AotModulesTableLanguage="ObjC"
OutputDir="$(PublishDir)"
IntermediateOutputPath="$(IntermediateOutputPath)"
UseLLVM="$(UseLLVM)"
LLVMPath="$(MonoAotCrossDir)">
<Output TaskParameter="CompiledAssemblies" ItemName="BundleAssemblies" />
</MonoAOTCompiler>

<ILStrip Condition="'$(RunAOTCompilation)' == 'true' and '$(AOTMode)' == 'Full'" Assemblies="@(BundleAssemblies)" />
<PropertyGroup>
<RuntimeComponents Condition="'$(RuntimeComponents)' == ''">marshal-ilgen</RuntimeComponents>
</PropertyGroup>

<AppleAppBuilderTask
TargetOS="$(TargetOS)"
Arch="$(TargetArchitecture)"
ProjectName="$(AppName)"
MonoRuntimeHeaders="$(MicrosoftNetCoreAppRuntimePackDir)runtimes\$(TargetOS)-$(TargetArchitecture)\native\include\mono-2.0"
Assemblies="@(BundleAssemblies)"
MainLibraryFileName="Program.dll"
GenerateXcodeProject="True"
BuildAppBundle="True"
DevTeamProvisioning="$(DevTeamProvisioning)"
OutputDirectory="$(AppDir)"
Optimized="$(Optimized)"
ForceAOT="$(RunAOTCompilation)"
ForceInterpreter="$(MonoForceInterpreter)"
RuntimeComponents="$(RuntimeComponents)"
EnableAppSandbox="$(EnableAppSandbox)"
DiagnosticPorts="$(DiagnosticPorts)"
StripSymbolTable="$(StripDebugSymbols)"
ExcludeFromAppDir="@(_ExcludeFromAppDir)"
AppDir="$(MSBuildThisFileDirectory)$(PublishDir)">
<Output TaskParameter="AppBundlePath" PropertyName="AppBundlePath" />
<Output TaskParameter="XcodeProjectPath" PropertyName="XcodeProjectPath" />
</AppleAppBuilderTask>

<Message Importance="High" Text="Xcode: $(XcodeProjectPath)"/>
<Message Importance="High" Text="App: $(AppBundlePath)"/>
</Target>
<Target Name="BuildAppBundle" AfterTargets="$(BuildAppBundleAfterTargets)" DependsOnTargets="$(BuildAppBundleDependsOnTargets)"/>

<Target Name="RunAppBundle"
AfterTargets="BuildAppBundle"
AfterTargets="_AppleGenerateAppBundle"
Condition="'$(ArchiveTests)' != 'true' and '$(DeployAndRun)' == 'true'">
<!-- FIXME: only run if the TargetArchitecture matches the current architecture -->

<!-- install and run on ios simulator or device -->
<!-- Install and run on a device or simulator -->
<Exec Condition="'$(TargetOS)' == 'iossimulator'" Command="dotnet xharness apple run --app=$(AppBundlePath) --targets=ios-simulator-64 --output-directory=/tmp/out" />
<Exec Condition="'$(TargetOS)' == 'ios'" Command="dotnet xharness apple run --app=$(AppBundlePath) --targets=ios-device --output-directory=/tmp/out" />

<!-- run on MacCatalyst -->
<!-- run on maccatalyst -->
<Exec Condition="'$(TargetOS)' == 'maccatalyst'" Command="open -W $(AppBundlePath)" />

</Target>

<Target Name="CopySampleAppToHelixTestDir"
Condition="'$(ArchiveTests)' == 'true'"
AfterTargets="Build"
DependsOnTargets="Publish;BuildAppBundle" >
AfterTargets="_AppleGenerateAppBundle" >
<PropertyGroup>
<!-- Helix properties -->
<!-- AnyCPU as Platform-->
Expand Down