I have a PostProcessBuildAttribute
that is responsible for modifying the Xcode project settings of my iOS project. I also have a dylib in my Assets/Runtime/Plugins/iOS
directory. In my local development, the post processor adds the dylib to the xcode project using project.AddFile("path/to/lib.dylib", "Frameworks/" + dylib name, "PBXSourceTree.Absolute")
However, my ultimate goal is to include this dylib and accompanying post processor in a distributable package. When my test project imports the package (from tarball), the path to the dylib isn’t the same as in development – instead of Assets/Runtime/Plugins/iOS/...
, it becomes Packages/<my_package>/Runtime/Plugins/iOS/...
. I also can’t hardcode my dylib’s path using the package-version of the folder structure b/c that string is dependent on the package’s version.
What’s the best way to automatically detect the full path to the package, and switch to path to Assets
if the code is not installed as a package?