iOS-Framework icon indicating copy to clipboard operation
iOS-Framework copied to clipboard

Xcode 4.5.2 Path Issue + Private/Public Headers

Open PaulSolt opened this issue 12 years ago • 2 comments

In Xcode 4.5.2 I had to make some changes:

  1. I had to change the last line in the script for the library target. Otherwise I had an error saying that the cp command's file/folder did not exist.
/bin/cp -a "${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/A/Headers"

TO

/bin/cp -a "${TARGET_BUILD_DIR}/include/${PRODUCT_NAME}/" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/A/Headers"
  1. I had to "Add Build Phase" for the "Copy Headers" for the Static Library template. It was not enabled by default for iPhone. After adding it I was able to copy the headers.

CopyHeaders.png

PaulSolt avatar Dec 08 '12 18:12 PaulSolt

Looks like there's a better fix, and you can still use the original script.

With the static library template, you'll need to change the "Copy Files" destination from "include/${PRODUCT_NAME}" to "${PRODUCT_NAME}"

This will make the build script work. The previous solution I had would fail on the Archive step for a test app using the library. Library Copy Files Path

PaulSolt avatar Dec 13 '12 17:12 PaulSolt

If you set the PUBLIC_HEADERS_FOLDER_PATH properly you can just remove the Copy Files build phase altogether. The script will copy the headers properly using that value.

Likewise I found it necessary to add the Copy Headers phase to enable adding any headers to the public headers part of the target.

jeffremer avatar Jan 14 '13 00:01 jeffremer