Xcode won't create IB plugin in resources folder
I created a custom control and framework / IB plugin for it using the IB3 plugin template.
According to the docs, the plugin should be embedded directly into the framework's resource directory. When I create a project, the plugin is in the configuration folder (Debug) along with the framework.
This is the same behavior right out of the box when I create a new template. I tried changing CONFIGURATION_BUILD_DIR
to $(BUILD_DIR)/$(CONFIGURATION)/FrameworkName.framework/Resources/
but didn't get any changes.
For the grins, I also tried messing around with the install path, but also didn't get it anywhere. I checked several other open source projects to check their build settings, but they are identical to my own, and yet their plugin is built and placed in the resource directory as expected.
Don't mess with your build settings. Instead, add a Copy Files build phase to the target structure. In the inspector for the build phase of the copied files, set the directory to Resources. Add the plugin to this build phase by dragging the plugin product from the Products group in the Groups and Files tree in Xcode.
a source to share
Thanks, Barry. When I tried to use the build phase of the copy files, IB was unable to resolve the connection between the framework and the plugin. For some reason, he couldn't find the plugin associated with it.
However, after endless play, I found that I was closer than I thought. Change CONFIGURATION_BUILD_DIR
to:
$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/FrameworkName.framework/Resources/
and updating the wireframe search paths solved the problem for me. This is not a plugin template behavior (at least on my machine) out of the box, so hopefully this helps someone else.
a source to share
To get an embedded product of one target Xcode target to be included in the resource directory of another target Xcode product, you must find the product in the groups and files tree and drag the product into the other target's "package resource phase" copy. You must also add a target dependency between the two targets using the target's receive info panel.
If you see a built-in plugin in the build product catalog, it doesn't mean that it was not copied to the resource directory as well. Xcode creates all targets in the build directory and then copies (does not move) them to the final destination, which in this case is the infrastructure resource directory. One of the reasons for this is that a product can have multiple final destinations.
a source to share