copyfile doesn't copy the headers folder of a framework product

I'm using xcode 11.2 on Mojave (10.14.6). My project is the production of a framework. I want to copy the framework product in the absolute path : ~/Library/Frameworks (or $(HOME)/Library/Frameworks) with the "copy files" phase. The framework product holds a headers folder (and his alias). The framework is copied but not the header folder ! Is this a bug ? Is there something I can do to avoid this (except to copy it manually) ?

Replies

In a typical framework, the Headers folder is a symbolic link (in the Unix sense) to a directory in your Version directory. Usually there is a "Current" symbolic link in the "Versions" directory that links to the "current" version, which is a directory that has the "real" Headers, PrivateHeaders,Resources,Libraries,etc., directories. The "Headers" link in the top-level framework points to "Current/Headers".


Framework.framework

|--Headers --> Current/Headers (symbolic link)

|--MacOS -->Current/MacOS (symbolic link)

|--Versions

|----Current --> A (symbolic link)

|----A

|--Headers

|--MacOS


I've always had issues with copying symbolc links using a copy files build phase, so I normally use a run build script to copy over the real files and set up the links