peachsim 0.1.2430 → 0.1.2431

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/cli/commands/preview.ts +2 -1
  2. package/cli/outbound-endpoints.ts +10 -2
  3. package/dist-lib/agent-daemon-client.cjs +1 -1
  4. package/dist-lib/agent-events.cjs +1 -1
  5. package/dist-lib/attached-projects.cjs +1 -1
  6. package/dist-lib/auth/shared-session.cjs +1 -1
  7. package/dist-lib/backend-origin.cjs +1 -1
  8. package/dist-lib/beta.cjs +1 -1
  9. package/dist-lib/beta.mjs +1 -1
  10. package/dist-lib/bridge-constants.cjs +1 -1
  11. package/dist-lib/bridge-contract-input.cjs +1 -1
  12. package/dist-lib/bridge-contract-input.mjs +1 -1
  13. package/dist-lib/bridge-contract.cjs +1 -1
  14. package/dist-lib/bridge-contract.mjs +1 -1
  15. package/dist-lib/bundle-channel.cjs +15765 -5973
  16. package/dist-lib/capture-contract.cjs +1 -1
  17. package/dist-lib/capture-contract.mjs +1 -1
  18. package/dist-lib/cloud-contract.cjs +1 -1
  19. package/dist-lib/cloud-contract.mjs +1 -1
  20. package/dist-lib/cloud-test-args.cjs +1 -1
  21. package/dist-lib/cloud-test-args.mjs +1 -1
  22. package/dist-lib/cloud.cjs +1 -1
  23. package/dist-lib/cloud.mjs +1 -1
  24. package/dist-lib/config.cjs +1 -1
  25. package/dist-lib/config.mjs +1 -1
  26. package/dist-lib/detox/index.cjs +1 -1
  27. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  28. package/dist-lib/expo-swift-bundle.cjs +14638 -4888
  29. package/dist-lib/expo-swift-metadata.cjs +1 -1
  30. package/dist-lib/expo-swift-metadata.mjs +1 -1
  31. package/dist-lib/home-paths.cjs +1 -1
  32. package/dist-lib/host/bridge-host.cjs +15464 -5754
  33. package/dist-lib/host/fetch-proxy-handler.cjs +3204 -54
  34. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  35. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  36. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  37. package/dist-lib/host/websocket-proxy.cjs +1 -1
  38. package/dist-lib/index.cjs +3541 -391
  39. package/dist-lib/jump-to-source-babel.cjs +1 -1
  40. package/dist-lib/jump-to-source-native.cjs +1 -1
  41. package/dist-lib/kotlin-host.cjs +1 -1
  42. package/dist-lib/menu.cjs +1 -1
  43. package/dist-lib/menu.mjs +1 -1
  44. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  45. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  46. package/dist-lib/metro-production-bundle.cjs +1 -1
  47. package/dist-lib/metro-production-bundle.mjs +1 -1
  48. package/dist-lib/metro.cjs +3437 -287
  49. package/dist-lib/native-app-identity-project.cjs +2 -2
  50. package/dist-lib/native-app-identity-project.mjs +2 -2
  51. package/dist-lib/native-app-identity.cjs +1 -1
  52. package/dist-lib/native-app-identity.mjs +1 -1
  53. package/dist-lib/native-firebase-metadata.cjs +1 -1
  54. package/dist-lib/native-firebase-metadata.mjs +1 -1
  55. package/dist-lib/pdfium-raster.cjs +1 -1
  56. package/dist-lib/pdfium-raster.mjs +1 -1
  57. package/dist-lib/plist.cjs +1 -1
  58. package/dist-lib/plist.mjs +1 -1
  59. package/dist-lib/profiles.cjs +1 -1
  60. package/dist-lib/public-brand.cjs +1 -1
  61. package/dist-lib/public-origins-lib-esm.json +24 -24
  62. package/dist-lib/public-origins-lib.json +172 -79
  63. package/dist-lib/react-native-host-modules.cjs +1 -1
  64. package/dist-lib/react-native-host-modules.mjs +1 -1
  65. package/dist-lib/reap-browser.cjs +1 -1
  66. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  67. package/dist-lib/sdk.cjs +1 -1
  68. package/dist-lib/sdk.mjs +1 -1
  69. package/dist-lib/skills.cjs +16782 -6989
  70. package/dist-lib/swift-compile.cjs +2 -2
  71. package/dist-lib/swift-compile.mjs +2 -2
  72. package/dist-lib/swift-package.cjs +1 -1
  73. package/dist-lib/swift-package.mjs +1 -1
  74. package/dist-lib/swift-submit.cjs +1 -1
  75. package/dist-lib/swift-submit.mjs +1 -1
  76. package/dist-lib/swift-toolchain.cjs +1 -1
  77. package/dist-lib/swift.cjs +1 -1
  78. package/dist-lib/vite-swift.cjs +74 -6
  79. package/dist-lib/vite.cjs +3331 -181
  80. package/dist-lib/worklet-executable.cjs +1 -1
  81. package/dist-lib/worklet-executable.mjs +1 -1
  82. package/package.json +1 -1
  83. package/src/expo-native-workspace.ts +23 -63
  84. package/src/pbx-table.ts +200 -0
  85. package/src/pod-sources.ts +628 -0
  86. package/src/podfile-cocoapods.ts +40 -3
  87. package/src/pods-analysis.ts +488 -0
  88. package/src/pods-build-settings.ts +1015 -0
  89. package/src/pods-files.ts +478 -0
  90. package/src/pods-install.ts +475 -0
  91. package/src/pods-integration.ts +778 -0
  92. package/src/pods-post-install.ts +1811 -0
  93. package/src/pods-project.ts +2416 -0
  94. package/src/pods-scripts.ts +409 -0
  95. package/src/pods-targets.ts +757 -0
  96. package/src/pods-xcconfig.ts +198 -0
  97. package/src/podspec-cocoapods.ts +29 -3
  98. package/src/podspec-ruby-stdlib.ts +111 -10
  99. package/src/podspec-ruby.ts +52 -8
  100. package/src/swift-catalog-png.ts +75 -0
  101. package/src/swift-host.ts +4 -3
  102. package/src/swift-root-lock.ts +0 -10
  103. package/src/swift-source-pods.ts +29 -73
  104. package/src/turbo-source.ts +16 -37
@@ -0,0 +1,409 @@
1
+ // the fixed text of the shell scripts CocoaPods 1.17 writes into Target Support Files
2
+ // (Generator::EmbedFrameworksScript, CopyResourcesScript and CopyXCFrameworksScript with
3
+ // ScriptPhaseConstants; MIT, Eloy Durán and the CocoaPods team), as those generators emit it.
4
+
5
+ export const EMBED_FRAMEWORKS_HEADER = `#!/bin/sh
6
+ set -e
7
+ set -u
8
+ set -o pipefail
9
+
10
+ function on_error {
11
+ echo "$(realpath -mq "\${0}"):$1: error: Unexpected failure"
12
+ }
13
+ trap 'on_error $LINENO' ERR
14
+
15
+ if [ -z \${FRAMEWORKS_FOLDER_PATH+x} ]; then
16
+ # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
17
+ # frameworks to, so exit 0 (signalling the script phase was successful).
18
+ exit 0
19
+ fi
20
+
21
+ echo "mkdir -p \${CONFIGURATION_BUILD_DIR}/\${FRAMEWORKS_FOLDER_PATH}"
22
+ mkdir -p "\${CONFIGURATION_BUILD_DIR}/\${FRAMEWORKS_FOLDER_PATH}"
23
+
24
+ COCOAPODS_PARALLEL_CODE_SIGN="\${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
25
+ SWIFT_STDLIB_PATH="\${TOOLCHAIN_DIR}/usr/lib/swift/\${PLATFORM_NAME}"
26
+ BCSYMBOLMAP_DIR="BCSymbolMaps"
27
+
28
+
29
+ # This protects against multiple targets copying the same framework dependency at the same time. The solution
30
+ # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
31
+ RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
32
+
33
+ # Copies and strips a vendored framework
34
+ install_framework()
35
+ {
36
+ if [ -r "\${BUILT_PRODUCTS_DIR}/$1" ]; then
37
+ local source="\${BUILT_PRODUCTS_DIR}/$1"
38
+ elif [ -r "\${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
39
+ local source="\${BUILT_PRODUCTS_DIR}/$(basename "$1")"
40
+ elif [ -r "$1" ]; then
41
+ local source="$1"
42
+ fi
43
+
44
+ local destination="\${TARGET_BUILD_DIR}/\${FRAMEWORKS_FOLDER_PATH}"
45
+
46
+ if [ -L "\${source}" ]; then
47
+ echo "Symlinked..."
48
+ source="$(readlink -f "\${source}")"
49
+ fi
50
+
51
+ if [ -d "\${source}/\${BCSYMBOLMAP_DIR}" ]; then
52
+ # Locate and install any .bcsymbolmaps if present, and remove them from the .framework before the framework is copied
53
+ find "\${source}/\${BCSYMBOLMAP_DIR}" -name "*.bcsymbolmap"|while read f; do
54
+ echo "Installing $f"
55
+ install_bcsymbolmap "$f" "$destination"
56
+ rm "$f"
57
+ done
58
+ rmdir "\${source}/\${BCSYMBOLMAP_DIR}"
59
+ fi
60
+
61
+ # Use filter instead of exclude so missing patterns don't throw errors.
62
+ echo "rsync --delete -av "\${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \\"- CVS/\\" --filter \\"- .svn/\\" --filter \\"- .git/\\" --filter \\"- .hg/\\" --filter \\"- Headers\\" --filter \\"- PrivateHeaders\\" --filter \\"- Modules\\" \\"\${source}\\" \\"\${destination}\\""
63
+ rsync --delete -av "\${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "\${source}" "\${destination}"
64
+
65
+ local basename
66
+ basename="$(basename -s .framework "$1")"
67
+ binary="\${destination}/\${basename}.framework/\${basename}"
68
+
69
+ if ! [ -r "$binary" ]; then
70
+ binary="\${destination}/\${basename}"
71
+ elif [ -L "\${binary}" ]; then
72
+ echo "Destination binary is symlinked..."
73
+ dirname="$(dirname "\${binary}")"
74
+ binary="\${dirname}/$(readlink "\${binary}")"
75
+ fi
76
+
77
+ # Strip invalid architectures so "fat" simulator / device frameworks work on device
78
+ if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
79
+ strip_invalid_archs "$binary"
80
+ fi
81
+
82
+ # Resign the code if required by the build settings to avoid unstable apps
83
+ code_sign_if_enabled "\${destination}/$(basename "$1")"
84
+
85
+ # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
86
+ if [ "\${XCODE_VERSION_MAJOR}" -lt 7 ]; then
87
+ local swift_runtime_libs
88
+ swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\\\/\\(.+dylib\\).*/\\\\1/g | uniq -u)
89
+ for lib in $swift_runtime_libs; do
90
+ echo "rsync -auv \\"\${SWIFT_STDLIB_PATH}/\${lib}\\" \\"\${destination}\\""
91
+ rsync -auv "\${SWIFT_STDLIB_PATH}/\${lib}" "\${destination}"
92
+ code_sign_if_enabled "\${destination}/\${lib}"
93
+ done
94
+ fi
95
+ }
96
+ # Copies and strips a vendored dSYM
97
+ install_dsym() {
98
+ local source="$1"
99
+ warn_missing_arch=\${2:-true}
100
+ if [ -r "$source" ]; then
101
+ # Copy the dSYM into the targets temp dir.
102
+ echo "rsync --delete -av "\${RSYNC_PROTECT_TMP_FILES[@]}" --filter \\"- CVS/\\" --filter \\"- .svn/\\" --filter \\"- .git/\\" --filter \\"- .hg/\\" --filter \\"- Headers\\" --filter \\"- PrivateHeaders\\" --filter \\"- Modules\\" \\"\${source}\\" \\"\${DERIVED_FILES_DIR}\\""
103
+ rsync --delete -av "\${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "\${source}" "\${DERIVED_FILES_DIR}"
104
+
105
+ local basename
106
+ basename="$(basename -s .dSYM "$source")"
107
+ binary_name="$(ls "$source/Contents/Resources/DWARF")"
108
+ binary="\${DERIVED_FILES_DIR}/\${basename}.dSYM/Contents/Resources/DWARF/\${binary_name}"
109
+
110
+ # Strip invalid architectures from the dSYM.
111
+ if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then
112
+ strip_invalid_archs "$binary" "$warn_missing_arch"
113
+ fi
114
+ if [[ $STRIP_BINARY_RETVAL == 0 ]]; then
115
+ # Move the stripped file into its final destination.
116
+ echo "rsync --delete -av "\${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \\"- CVS/\\" --filter \\"- .svn/\\" --filter \\"- .git/\\" --filter \\"- .hg/\\" --filter \\"- Headers\\" --filter \\"- PrivateHeaders\\" --filter \\"- Modules\\" \\"\${DERIVED_FILES_DIR}/\${basename}.framework.dSYM\\" \\"\${DWARF_DSYM_FOLDER_PATH}\\""
117
+ rsync --delete -av "\${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "\${DERIVED_FILES_DIR}/\${basename}.dSYM" "\${DWARF_DSYM_FOLDER_PATH}"
118
+ else
119
+ # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
120
+ mkdir -p "\${DWARF_DSYM_FOLDER_PATH}"
121
+ touch "\${DWARF_DSYM_FOLDER_PATH}/\${basename}.dSYM"
122
+ fi
123
+ fi
124
+ }
125
+
126
+ # Used as a return value for each invocation of \`strip_invalid_archs\` function.
127
+ STRIP_BINARY_RETVAL=0
128
+
129
+ # Strip invalid architectures
130
+ strip_invalid_archs() {
131
+ binary="$1"
132
+ warn_missing_arch=\${2:-true}
133
+ # Get architectures for current target binary
134
+ binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
135
+ # Intersect them with the architectures we are building for
136
+ intersected_archs="$(echo \${ARCHS[@]} \${binary_archs[@]} | tr ' ' '\\n' | sort | uniq -d)"
137
+ # If there are no archs supported by this binary then warn the user
138
+ if [[ -z "$intersected_archs" ]]; then
139
+ if [[ "$warn_missing_arch" == "true" ]]; then
140
+ echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
141
+ fi
142
+ STRIP_BINARY_RETVAL=1
143
+ return
144
+ fi
145
+ stripped=""
146
+ for arch in $binary_archs; do
147
+ if ! [[ "\${ARCHS}" == *"$arch"* ]]; then
148
+ # Strip non-valid architectures in-place
149
+ lipo -remove "$arch" -output "$binary" "$binary"
150
+ stripped="$stripped $arch"
151
+ fi
152
+ done
153
+ if [[ "$stripped" ]]; then
154
+ echo "Stripped $binary of architectures:$stripped"
155
+ fi
156
+ STRIP_BINARY_RETVAL=0
157
+ }
158
+
159
+ # Copies the bcsymbolmap files of a vendored framework
160
+ install_bcsymbolmap() {
161
+ local bcsymbolmap_path="$1"
162
+ local destination="\${BUILT_PRODUCTS_DIR}"
163
+ echo "rsync --delete -av "\${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "\${bcsymbolmap_path}" "\${destination}""
164
+ rsync --delete -av "\${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "\${bcsymbolmap_path}" "\${destination}"
165
+ }
166
+
167
+ # Signs a framework with the provided identity
168
+ code_sign_if_enabled() {
169
+ if [ -n "\${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "\${CODE_SIGNING_REQUIRED:-}" != "NO" -a "\${CODE_SIGNING_ALLOWED}" != "NO" ]; then
170
+ # Use the current code_sign_identity
171
+ echo "Code Signing $1 with Identity \${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
172
+ local code_sign_cmd="/usr/bin/codesign --force --sign \${EXPANDED_CODE_SIGN_IDENTITY} \${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
173
+
174
+ if [ "\${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
175
+ code_sign_cmd="$code_sign_cmd &"
176
+ fi
177
+ echo "$code_sign_cmd"
178
+ eval "$code_sign_cmd"
179
+ fi
180
+ }
181
+ `
182
+
183
+ export const INSTALL_RESOURCES_FUNCTION = `#!/bin/sh
184
+ set -e
185
+ set -u
186
+ set -o pipefail
187
+
188
+ function on_error {
189
+ echo "$(realpath -mq "\${0}"):$1: error: Unexpected failure"
190
+ }
191
+ trap 'on_error $LINENO' ERR
192
+
193
+ if [ -z \${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then
194
+ # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy
195
+ # resources to, so exit 0 (signalling the script phase was successful).
196
+ exit 0
197
+ fi
198
+
199
+ mkdir -p "\${TARGET_BUILD_DIR}/\${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
200
+
201
+ RESOURCES_TO_COPY=\${PODS_ROOT}/resources-to-copy-\${TARGETNAME}.txt
202
+ > "$RESOURCES_TO_COPY"
203
+
204
+ XCASSET_FILES=()
205
+
206
+ # This protects against multiple targets copying the same framework dependency at the same time. The solution
207
+ # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
208
+ RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
209
+
210
+ case "\${TARGETED_DEVICE_FAMILY:-}" in
211
+ 1,2)
212
+ TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
213
+ ;;
214
+ 1)
215
+ TARGET_DEVICE_ARGS="--target-device iphone"
216
+ ;;
217
+ 2)
218
+ TARGET_DEVICE_ARGS="--target-device ipad"
219
+ ;;
220
+ 3)
221
+ TARGET_DEVICE_ARGS="--target-device tv"
222
+ ;;
223
+ 4)
224
+ TARGET_DEVICE_ARGS="--target-device watch"
225
+ ;;
226
+ *)
227
+ TARGET_DEVICE_ARGS="--target-device mac"
228
+ ;;
229
+ esac
230
+
231
+ install_resource()
232
+ {
233
+ if [[ "$1" = /* ]] ; then
234
+ RESOURCE_PATH="$1"
235
+ else
236
+ RESOURCE_PATH="\${PODS_ROOT}/$1"
237
+ fi
238
+ if [[ ! -e "$RESOURCE_PATH" ]] ; then
239
+ cat << EOM
240
+ error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
241
+ EOM
242
+ exit 1
243
+ fi
244
+ case $RESOURCE_PATH in
245
+ *.storyboard)
246
+ echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target \${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile \${TARGET_BUILD_DIR}/\${UNLOCALIZED_RESOURCES_FOLDER_PATH}/\`basename \\"$RESOURCE_PATH\\" .storyboard\`.storyboardc $RESOURCE_PATH --sdk \${SDKROOT} \${TARGET_DEVICE_ARGS}" || true
247
+ ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target \${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "\${TARGET_BUILD_DIR}/\${UNLOCALIZED_RESOURCES_FOLDER_PATH}/\`basename \\"$RESOURCE_PATH\\" .storyboard\`.storyboardc" "$RESOURCE_PATH" --sdk "\${SDKROOT}" \${TARGET_DEVICE_ARGS}
248
+ ;;
249
+ *.xib)
250
+ echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target \${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile \${TARGET_BUILD_DIR}/\${UNLOCALIZED_RESOURCES_FOLDER_PATH}/\`basename \\"$RESOURCE_PATH\\" .xib\`.nib $RESOURCE_PATH --sdk \${SDKROOT} \${TARGET_DEVICE_ARGS}" || true
251
+ ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target \${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "\${TARGET_BUILD_DIR}/\${UNLOCALIZED_RESOURCES_FOLDER_PATH}/\`basename \\"$RESOURCE_PATH\\" .xib\`.nib" "$RESOURCE_PATH" --sdk "\${SDKROOT}" \${TARGET_DEVICE_ARGS}
252
+ ;;
253
+ *.framework)
254
+ echo "mkdir -p \${TARGET_BUILD_DIR}/\${FRAMEWORKS_FOLDER_PATH}" || true
255
+ mkdir -p "\${TARGET_BUILD_DIR}/\${FRAMEWORKS_FOLDER_PATH}"
256
+ echo "rsync --delete -av "\${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH \${TARGET_BUILD_DIR}/\${FRAMEWORKS_FOLDER_PATH}" || true
257
+ rsync --delete -av "\${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "\${TARGET_BUILD_DIR}/\${FRAMEWORKS_FOLDER_PATH}"
258
+ ;;
259
+ *.xcdatamodel)
260
+ echo "xcrun momc \\"$RESOURCE_PATH\\" \\"\${TARGET_BUILD_DIR}/\${UNLOCALIZED_RESOURCES_FOLDER_PATH}/\`basename "$RESOURCE_PATH"\`.mom\\"" || true
261
+ xcrun momc "$RESOURCE_PATH" "\${TARGET_BUILD_DIR}/\${UNLOCALIZED_RESOURCES_FOLDER_PATH}/\`basename "$RESOURCE_PATH" .xcdatamodel\`.mom"
262
+ ;;
263
+ *.xcdatamodeld)
264
+ echo "xcrun momc \\"$RESOURCE_PATH\\" \\"\${TARGET_BUILD_DIR}/\${UNLOCALIZED_RESOURCES_FOLDER_PATH}/\`basename "$RESOURCE_PATH" .xcdatamodeld\`.momd\\"" || true
265
+ xcrun momc "$RESOURCE_PATH" "\${TARGET_BUILD_DIR}/\${UNLOCALIZED_RESOURCES_FOLDER_PATH}/\`basename "$RESOURCE_PATH" .xcdatamodeld\`.momd"
266
+ ;;
267
+ *.xcmappingmodel)
268
+ echo "xcrun mapc \\"$RESOURCE_PATH\\" \\"\${TARGET_BUILD_DIR}/\${UNLOCALIZED_RESOURCES_FOLDER_PATH}/\`basename "$RESOURCE_PATH" .xcmappingmodel\`.cdm\\"" || true
269
+ xcrun mapc "$RESOURCE_PATH" "\${TARGET_BUILD_DIR}/\${UNLOCALIZED_RESOURCES_FOLDER_PATH}/\`basename "$RESOURCE_PATH" .xcmappingmodel\`.cdm"
270
+ ;;
271
+ *.xcassets)
272
+ ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
273
+ XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
274
+ ;;
275
+ *)
276
+ echo "$RESOURCE_PATH" || true
277
+ echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
278
+ ;;
279
+ esac
280
+ }
281
+ `
282
+
283
+ export const RESOURCES_TAIL = `
284
+ mkdir -p "\${TARGET_BUILD_DIR}/\${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
285
+ rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "\${TARGET_BUILD_DIR}/\${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
286
+ if [[ "\${ACTION}" == "install" ]] && [[ "\${SKIP_INSTALL}" == "NO" ]]; then
287
+ mkdir -p "\${INSTALL_DIR}/\${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
288
+ rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "\${INSTALL_DIR}/\${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
289
+ fi
290
+ rm -f "$RESOURCES_TO_COPY"
291
+
292
+ if [[ -n "\${WRAPPER_EXTENSION}" ]] && [ "\`xcrun --find actool\`" ] && [ -n "\${XCASSET_FILES:-}" ]
293
+ then
294
+ # Find all other xcassets (this unfortunately includes those of path pods and other targets).
295
+ OTHER_XCASSETS=$(find -L "$PWD" -iname "*.xcassets" -type d)
296
+ while read line; do
297
+ if [[ $line != "\${PODS_ROOT}*" ]]; then
298
+ XCASSET_FILES+=("$line")
299
+ fi
300
+ done <<<"$OTHER_XCASSETS"
301
+
302
+ if [ -z \${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then
303
+ printf "%s\\0" "\${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "\${PLATFORM_NAME}" --minimum-deployment-target "\${!DEPLOYMENT_TARGET_SETTING_NAME}" \${TARGET_DEVICE_ARGS} --compress-pngs --compile "\${BUILT_PRODUCTS_DIR}/\${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
304
+ else
305
+ printf "%s\\0" "\${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "\${PLATFORM_NAME}" --minimum-deployment-target "\${!DEPLOYMENT_TARGET_SETTING_NAME}" \${TARGET_DEVICE_ARGS} --compress-pngs --compile "\${BUILT_PRODUCTS_DIR}/\${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "\${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "\${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist"
306
+ fi
307
+ fi
308
+ `
309
+
310
+ export const COPY_XCFRAMEWORKS_HEADER = `#!/bin/sh
311
+ set -e
312
+ set -u
313
+ set -o pipefail
314
+
315
+ function on_error {
316
+ echo "$(realpath -mq "\${0}"):$1: error: Unexpected failure"
317
+ }
318
+ trap 'on_error $LINENO' ERR
319
+
320
+
321
+ # This protects against multiple targets copying the same framework dependency at the same time. The solution
322
+ # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
323
+ RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
324
+
325
+
326
+ `
327
+
328
+ export const COPY_XCFRAMEWORKS_BODY = `
329
+
330
+ copy_dir()
331
+ {
332
+ local source="$1"
333
+ local destination="$2"
334
+
335
+ # Use filter instead of exclude so missing patterns don't throw errors.
336
+ echo "rsync --delete -av "\${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \\"- CVS/\\" --filter \\"- .svn/\\" --filter \\"- .git/\\" --filter \\"- .hg/\\" \\"\${source}*\\" \\"\${destination}\\""
337
+ rsync --delete -av "\${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" "\${source}"/* "\${destination}"
338
+ }
339
+
340
+ SELECT_SLICE_RETVAL=""
341
+
342
+ select_slice() {
343
+ local xcframework_name="$1"
344
+ xcframework_name="\${xcframework_name##*/}"
345
+ local paths=("\${@:2}")
346
+ # Locate the correct slice of the .xcframework for the current architectures
347
+ local target_path=""
348
+
349
+ # Split archs on space so we can find a slice that has all the needed archs
350
+ local target_archs=$(echo $ARCHS | tr " " "\\n")
351
+
352
+ local target_variant=""
353
+ if [[ "$PLATFORM_NAME" == *"simulator" ]]; then
354
+ target_variant="simulator"
355
+ fi
356
+ if [[ ! -z \${EFFECTIVE_PLATFORM_NAME+x} && "$EFFECTIVE_PLATFORM_NAME" == *"maccatalyst" ]]; then
357
+ target_variant="maccatalyst"
358
+ fi
359
+ for i in \${!paths[@]}; do
360
+ local matched_all_archs="1"
361
+ local slice_archs="$(archs_for_slice "\${xcframework_name}/\${paths[$i]}")"
362
+ local slice_variant="$(variant_for_slice "\${xcframework_name}/\${paths[$i]}")"
363
+ for target_arch in $target_archs; do
364
+ if ! [[ "\${slice_variant}" == "$target_variant" ]]; then
365
+ matched_all_archs="0"
366
+ break
367
+ fi
368
+
369
+ if ! echo "\${slice_archs}" | tr " " "\\n" | grep -F -q -x "$target_arch"; then
370
+ matched_all_archs="0"
371
+ break
372
+ fi
373
+ done
374
+
375
+ if [[ "$matched_all_archs" == "1" ]]; then
376
+ # Found a matching slice
377
+ echo "Selected xcframework slice \${paths[$i]}"
378
+ SELECT_SLICE_RETVAL=\${paths[$i]}
379
+ break
380
+ fi
381
+ done
382
+ }
383
+
384
+ install_xcframework() {
385
+ local basepath="$1"
386
+ local name="$2"
387
+ local package_type="$3"
388
+ local paths=("\${@:4}")
389
+
390
+ # Locate the correct slice of the .xcframework for the current architectures
391
+ select_slice "\${basepath}" "\${paths[@]}"
392
+ local target_path="$SELECT_SLICE_RETVAL"
393
+ if [[ -z "$target_path" ]]; then
394
+ echo "warning: [CP] $(basename \${basepath}): Unable to find matching slice in '\${paths[@]}' for the current build architectures ($ARCHS) and platform (\${EFFECTIVE_PLATFORM_NAME-\${PLATFORM_NAME}})."
395
+ return
396
+ fi
397
+ local source="$basepath/$target_path"
398
+
399
+ local destination="\${PODS_XCFRAMEWORKS_BUILD_DIR}/\${name}"
400
+
401
+ if [ ! -d "$destination" ]; then
402
+ mkdir -p "$destination"
403
+ fi
404
+
405
+ copy_dir "$source/" "$destination"
406
+ echo "Copied $source to $destination"
407
+ }
408
+
409
+ `