I'm working on a suite of apps supporting macOS, iOS and iPadOS (potentially tvOS, watchOS and visionOS in the future). Each of these App targets contain minimal code to only load the framework dynamically instead of the recommended load-time imports for Apple platforms. The rationales for runtime loading of framework (using dlopen and dlsym) is expressed in earlier post - fyi.
Each app can load multiple frameworks at runtime. Instead of naming the frameworks like this - AppName_purpose1.framework, AppName_purpose2.framework, AppName_purpose3.framework, can it be named as AppName.purpose1, AppName.purpose2, AppName.purpose3 etc?
Basically, change the Framework bundle extension name from .framework to a custom name based on purpose. The folder's extension name is changed, but it's still a framework bundle.
The advantage of this approach is, in my project,
- Frameworks belonging to each of the apps cleanly distinguish themselves with a concise name.
- While this post is about Apple platforms, I'm also checking if other platforms allow to change the names of dynamic libraries (windows allows change). Using my custom extension can standardize the dynamic library's extension name across all platforms.
- Easy framework name construction - The
Frameworkname is now the same as theAppbundle name, which can be queried and this string can be appended with an appropriate extension to load all theFrameworks.
Is it possible to change the extension name of the Framework bundle from the default .framework? If yes, how?
can it be named as AppName.purpose1
No.
You might be able to get this to work but it’s very likely that it will engender problems at some point during your distribution process.
Quoting Placing content in a bundle:
If you put content in the wrong location, you may encounter hard-to-debug code signing and distribution problems.
While this specifically refers to the content of a bundle, the same thing applies to the bundle’s extension [1].
Taking a step back, your recent threads exhibit a strong desire to make Apple platforms look like the other platforms you support. I understand why you want to do that, but such efforts have to be balance. Eventually you need to recognise that there are differences between platforms, and your attempts to bend one platform to look like another is more trouble than its worth.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] Ironically, there are no constraints on the extension used for bundles. So, on the Mac you could package this code as bundles, rather than frameworks, and away you go. However, that won’t work for iOS, where all third-party library code has to be package as a framework.