[vlc-commits] [Git][videolan/vlc][master] extras: copy_plugins.sh: check framework's date before re-copying

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Aug 31 16:28:58 UTC 2024



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
0d683388 by Alexandre Janniaux at 2024-08-31T15:58:27+00:00
extras: copy_plugins.sh: check framework's date before re-copying

Lipo-ing, copying and signing every plugins takes a lot of time, so this
commits heuristically checks whether the copy is needed by comparing
every input files against the output framework before copying.

On my machine, it reduces the copy duration for the plugins from a total
of 34s when every plugin was copied to 2s, not accounting the fact that
changing the file on the build target also required XCode copying again
towards the device.

- - - - -


1 changed file:

- extras/package/apple/copy_plugins.sh


Changes:

=====================================
extras/package/apple/copy_plugins.sh
=====================================
@@ -48,13 +48,20 @@ for plugin in "${PLUGINS[@]}"; do
     done
     FRAMEWORK_DIR="${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/${plugin}.framework"
     FRAMEWORK_BIN_PATH="${FRAMEWORK_DIR}/${plugin}"
-    mkdir -p "${FRAMEWORK_DIR}"
-    lipo -create \
-        -output "${FRAMEWORK_BIN_PATH}" \
-        "${INPUT_FILES[@]}"
-    install_name_tool -change "@rpath/libvlccore.dylib" "@rpath/vlccore.framework/vlccore" \
-        "${FRAMEWORK_BIN_PATH}"
-    dsymutil -o "${FRAMEWORK_DIR}.dSYM" "${FRAMEWORK_BIN_PATH}"
-    generate_info_plist "${plugin}" > "${FRAMEWORK_DIR}/Info.plist"
-    codesign --force --sign "${EXPANDED_CODE_SIGN_IDENTITY}" "${FRAMEWORK_DIR}"
+
+    for file in "${INPUT_FILES[@]}"; do
+        if [ -f "${FRAMEWORK_BIN_PATH}" ] && [ "$file" -ot "${FRAMEWORK_BIN_PATH}" ]; then
+            continue
+        fi
+        mkdir -p "${FRAMEWORK_DIR}"
+        lipo -create \
+            -output "${FRAMEWORK_BIN_PATH}" \
+            "${INPUT_FILES[@]}"
+        install_name_tool -change "@rpath/libvlccore.dylib" "@rpath/vlccore.framework/vlccore" \
+            "${FRAMEWORK_BIN_PATH}"
+        dsymutil -o "${FRAMEWORK_DIR}.dSYM" "${FRAMEWORK_BIN_PATH}"
+        generate_info_plist "${plugin}" > "${FRAMEWORK_DIR}/Info.plist"
+        codesign --force --sign "${EXPANDED_CODE_SIGN_IDENTITY}" "${FRAMEWORK_DIR}"
+        break
+    done
 done



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0d6833886f88078b3728b5f380b16c5cb24b979d

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0d6833886f88078b3728b5f380b16c5cb24b979d
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list