We are currently building an app in Swift, reusing an internal C++ backend used in other platforms ( Linux/Windows/Mac ).
Current state of the project:
-
App W - ( Swift App )
-
- Package X - Swift Package
-
-
- Y.xcframework - Binary Target (ios-arm64 and ios-arm64-simulator)
-
-
-
-
- Z.framework
-
-
-
-
-
-
- Z - (C++ Backend as a library) Dynamic Library
-
-
-
-
-
-
-
- Headers - Library header files
-
-
-
-
-
-
-
- Frameworks (Folder) - Required .dylib’s for Z (
-
-
-
-
-
-
-
-
- libA.dylib (Dependency of Z) [ 58 of them ]
-
-
-
-
-
-
-
-
-
- libB.dylib (Runtime dependency of python) [ 123 of them ]
-
-
-
-
-
-
-
-
- data - Supporting binary files for Z
-
-
-
-
-
-
-
- conf - Supporting configuration files, both text and binary. for Z
-
-
-
-
-
-
-
- python - Supporting .py scripts
-
-
-
-
-
-
-
-
- C.py
-
-
-
-
-
-
-
-
-
- D.py
-
-
-
-
Z.framework ( C++ ) contains 182 Dynamic Libraries.
Goal:
Validate the app for distribution with the Apple Store validation tool.
Learning when trying to solve the problem:
- A framework can contain only one dynamic library (e.g. .dylib )
- A framework cannot have nested frameworks within a Frameworks folder
- Certain file types within a framework are not treated as resource files (e.g. .py files)
Possible solutions
- Allow to have nested Frameworks in Z.framework.
-
- It’s currently not allowed
- Link 182 dynamic libraries into the project via SPM
-
- Problem: Some of the libraries need to dynamically loaded at runtime (related to the python runtime)
-
- Making the libraries static adds significantly technical challenges to the Z.framework.
Other questions:
What’s the best way to achieve this