Commit 99434b69 authored by Marius Rackwitz's avatar Marius Rackwitz

[EmbedFrameworksScript] Attempt to embed each Swift stdlib just once

Before they were rsynced and codesigned multiple times.
parent 09a238e0
......@@ -45,6 +45,8 @@ module Pod
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
SWIFT_RUNTIME_LIBS_TO_INTEGRATE=""
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
......@@ -83,9 +85,9 @@ module Pod
local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\\\/\\(.+dylib\\).*/\\\\1/g | uniq -u && exit ${PIPESTATUS[0]})
for lib in $swift_runtime_libs; do
echo "rsync -auv \\"${SWIFT_STDLIB_PATH}/${lib}\\" \\"${FRAMEWORKS_DIR}\\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${FRAMEWORKS_DIR}"
code_sign_if_enabled "${FRAMEWORKS_DIR}/${lib}"
if [[ $SWIFT_RUNTIME_LIBS_TO_INTEGRATE != *"$lib"* ]]; then
SWIFT_RUNTIME_LIBS_TO_INTEGRATE="$SWIFT_RUNTIME_LIBS_TO_INTEGRATE $lib"
fi
done
}
......@@ -128,6 +130,16 @@ module Pod
script << "fi\n"
end
end
script << <<-SH.strip_heredoc
# Embed linked Swift runtime libraries
for lib in $SWIFT_RUNTIME_LIBS_TO_INTEGRATE; do
echo "rsync -auv \\"${SWIFT_STDLIB_PATH}/${lib}\\" \\"${FRAMEWORKS_DIR}\\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${FRAMEWORKS_DIR}"
code_sign_if_enabled "${FRAMEWORKS_DIR}/${lib}"
done
SH
script
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment