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

Enable AppleAppBuilder to bundle iOS applications built for NativeAOT runtime #81711

Merged
merged 5 commits into from
Feb 7, 2023

Conversation

ivanpovazan
Copy link
Member

This PR adds support for bundling iOS applications built for NativeAOT runtime with AppleAppBuilder.

An example of invoking the task would be as follows:

<AppleAppBuilderTask
        UseNativeAOTRuntime="True"
        TargetOS="$(TargetOS)"
        Arch="$(TargetArchitecture)"
        ProjectName="$(AppName)"
        Assemblies="@(BundleAssemblies)"
        GenerateXcodeProject="True"
        BuildAppBundle="True"
        DevTeamProvisioning="$(DevTeamProvisioning)"
        OutputDirectory="$(AppDir)"
        Optimized="$(Optimized)"
        AppDir="$(MSBuildThisFileDirectory)$(PublishDir)">
        <Output TaskParameter="AppBundlePath" PropertyName="AppBundlePath" />
        <Output TaskParameter="XcodeProjectPath" PropertyName="XcodeProjectPath" />
</AppleAppBuilderTask>

Assumptions:

$(PublishDir) should include all the *.o, *.dat, *.a required for linking the AOT compiled managed executable with the native host application (from template: https://github.com/dotnet/runtime/blob/main/src/tasks/AppleAppBuilder/Templates/main-simple.m)

Fixes: #80910


PS The purpose of adapting AppleAppBuilder is to enable building sample applications which would serve as PoC and initial steps to enable testing and validation of NativeAOT on iOS support. The full SDK integration (via Xamarin build tasks) will become available as a follow-up work.

@ghost
Copy link

ghost commented Feb 6, 2023

Tagging subscribers to this area: @directhex
See info in area-owners.md if you want to be subscribed.

Issue Details

This PR adds support for bundling iOS applications built for NativeAOT runtime with AppleAppBuilder.

An example of invoking the task would be as follows:

<AppleAppBuilderTask
        UseNativeAOTRuntime="True"
        TargetOS="$(TargetOS)"
        Arch="$(TargetArchitecture)"
        ProjectName="$(AppName)"
        Assemblies="@(BundleAssemblies)"
        GenerateXcodeProject="True"
        BuildAppBundle="True"
        DevTeamProvisioning="$(DevTeamProvisioning)"
        OutputDirectory="$(AppDir)"
        Optimized="$(Optimized)"
        AppDir="$(MSBuildThisFileDirectory)$(PublishDir)">
        <Output TaskParameter="AppBundlePath" PropertyName="AppBundlePath" />
        <Output TaskParameter="XcodeProjectPath" PropertyName="XcodeProjectPath" />
</AppleAppBuilderTask>

Assumptions:

$(PublishDir) should include all the *.o, *.dat, *.a required for linking the AOT compiled managed executable with the native host application (from template: https://github.com/dotnet/runtime/blob/main/src/tasks/AppleAppBuilder/Templates/main-simple.m)

Fixes: #80910


PS The purpose of adapting AppleAppBuilder is to enable building sample applications which would serve as PoC and initial steps to enable testing and validation of NativeAOT on iOS support. The full SDK integration (via Xamarin build tasks) will become available as a follow-up work.

Author: ivanpovazan
Assignees: ivanpovazan
Labels:

area-Infrastructure-mono

Milestone: -

src/tasks/AppleAppBuilder/AppleAppBuilder.cs Outdated Show resolved Hide resolved
src/tasks/AppleAppBuilder/AppleAppBuilder.cs Outdated Show resolved Hide resolved
src/tasks/AppleAppBuilder/Xcode.cs Outdated Show resolved Hide resolved
@ivanpovazan ivanpovazan changed the title WIP: Enable AppleAppBuilder to bundle iOS applications built for NativeAOT runtime Enable AppleAppBuilder to bundle iOS applications built for NativeAOT runtime Feb 7, 2023
@ivanpovazan ivanpovazan marked this pull request as ready for review February 7, 2023 11:27
@ivanpovazan ivanpovazan merged commit 8642a21 into dotnet:main Feb 7, 2023
@ivanpovazan ivanpovazan deleted the appbuilder-nativeaot branch February 8, 2023 10:20
@ghost ghost locked as resolved and limited conversation to collaborators Mar 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable AppleAppBuilder to bundle applications compiled with NativeAOT
2 participants