When a static lbirary built in Xcode with Swift source files it does not copy the generated header to the products directory. This script can be used to copy this header file so that it can be used by a dependency when the pre-compiled static library is used.
Created
November 6, 2019 21:34
-
-
Save brennanMKE/ad8f68524aac6877ef1f277a820d335d to your computer and use it in GitHub Desktop.
Copy Swift Header
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HEADERS_DIR="${BUILT_PRODUCTS_DIR}${PUBLIC_HEADERS_FOLDER_PATH}" | |
SWIFT_HEADER="${DERIVED_SOURCES_DIR}/${PRODUCT_NAME}-Swift.h" | |
mkdir -p "${HEADERS_DIR}" | |
if [ -f "${SWIFT_HEADER}" ]; then | |
cp "${SWIFT_HEADER}" "${HEADERS_DIR}/${PRODUCT_NAME}.h" | |
exit 0 | |
else | |
echo "error: Swift header for ${PRODUCT_NAME} not found: ${SWIFT_HEADER}" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment