You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[ios] Support bundling shared libraries into frameworks #96664
without depending on iOS workloads and pulling in Xamarin SDK.
This means that when users write their class libraries that do not have a dependency on iOS-specific API, can build such libraries by using the standard target framework and iOS-specific runtime identifier (e.g.,-f net8.0 -r ios-arm64) in order to produce a shared native library - *.dylib.
However, in order to properly consume a shared iOS library, one has to bundle it into a framework - Technical Note TN2435 which in most simplistic case comes down to generating the following bundle:
Refactor and productise AppleAppBuilder which will have minimal viable set of features (a subset of Xamarin bundler) for producing minimal app/framework bundles, and which will be available with the standard target framework.
Create the correct directory structure (differs between iOS/tvOS and MacCatalyst/macOS).
Add the native library + any other files the native library depends on (the assembly maybe?) in the correct location.
Add an Info.plist in the correct location.
The biggest complication is probably the Info.plist: should it be completely user-provided? do you generate a default file if the developer doesn't specify one? Note that the developer should at least be able to override any defaults.
IMHO this the simplest is just to create your own logic, no need to copy/move ours (it's not trivially extractable anyway).
Activity
ivanpovazan commentedon Jan 9, 2024
@rolfbjarne @steveisok what are your thoughts on the proposed approaches?
rolfbjarne commentedon Jan 9, 2024
Creating a .framework isn't very difficult:
The biggest complication is probably the Info.plist: should it be completely user-provided? do you generate a default file if the developer doesn't specify one? Note that the developer should at least be able to override any defaults.
IMHO this the simplest is just to create your own logic, no need to copy/move ours (it's not trivially extractable anyway).
jkotas commentedon Jan 9, 2024
If it is that simple, do we need the whole AppleAppBuilder for it? Can it be just a few lines of build targets (for native AOT at least)?
ivanpovazan commentedon Nov 24, 2024
Since we provided documentation on required steps to create and consume custom frameworks from shared native libraries, I will close this issue as out-of-scope.
If it becomes necessary to automate these steps as part of the build, we can reopen the issue.