chore(ios): fix script

This commit is contained in:
devthejo 2026-01-12 22:54:20 +01:00
parent 1b98fab868
commit e1d87bb261
3 changed files with 275 additions and 194 deletions

View file

@ -197,9 +197,11 @@
9E6F0A1338934BA5AD468D4B /* Fix Xcode 15 Bug */,
229987488EA44E69AA932D58 /* Fix Xcode 15 Bug */,
A891237ADBD54747890A99FB /* Fix Xcode 15 Bug */,
B700EE07E2A24654A0953D3B /* Remove signature files (Xcode workaround) */,
9E272D599E42446BB8DFD8D0 /* Fix Xcode 15 Bug */,
CBAD4F53ADB04F499371D5DE /* Remove signature files (Xcode workaround) */,
884372829D0E4436B7BC6F91 /* Fix Xcode 15 Bug */,
F778935A7C8642C4851AE054 /* Remove signature files (Xcode workaround) */,
A1D9EF7E0B4442DF8860F6A5 /* Fix Xcode 15 Bug */,
B6A277D5FA3848ECACDAF93C /* Remove signature files (Xcode workaround) */,
);
buildRules = (
);
@ -1066,6 +1068,74 @@ fi";
shellScript = "
echo \"Remove signature files (Xcode workaround)\";
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
";
};
884372829D0E4436B7BC6F91 /* Fix Xcode 15 Bug */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
name = "Fix Xcode 15 Bug";
inputPaths = (
);
outputPaths = (
);
shellPath = /bin/sh;
shellScript = "if [ \"$XCODE_VERSION_MAJOR\" = \"1500\" ]; then
echo \"Remove signature files (Xcode 15 workaround)\"
find \"$BUILD_DIR/${CONFIGURATION}-iphoneos\" -name \"*.signature\" -type f | xargs -r rm
fi";
};
F778935A7C8642C4851AE054 /* Remove signature files (Xcode workaround) */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
name = "Remove signature files (Xcode workaround)";
inputPaths = (
);
outputPaths = (
);
shellPath = /bin/sh;
shellScript = "
echo \"Remove signature files (Xcode workaround)\";
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
";
};
A1D9EF7E0B4442DF8860F6A5 /* Fix Xcode 15 Bug */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
name = "Fix Xcode 15 Bug";
inputPaths = (
);
outputPaths = (
);
shellPath = /bin/sh;
shellScript = "if [ \"$XCODE_VERSION_MAJOR\" = \"1500\" ]; then
echo \"Remove signature files (Xcode 15 workaround)\"
find \"$BUILD_DIR/${CONFIGURATION}-iphoneos\" -name \"*.signature\" -type f | xargs -r rm
fi";
};
B6A277D5FA3848ECACDAF93C /* Remove signature files (Xcode workaround) */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
name = "Remove signature files (Xcode workaround)";
inputPaths = (
);
outputPaths = (
);
shellPath = /bin/sh;
shellScript = "
echo \"Remove signature files (Xcode workaround)\";
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
";
};
/* End PBXShellScriptBuildPhase section */

View file

@ -25,30 +25,30 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.16.0</string>
<string>202601121722</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.alertesecours.alertesecours</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.alertesecours.alertesecours</string>
</array>
<key>CFBundleURLName</key>
<string>com.alertesecours.alertesecours</string>
</dict>
<dict>
<key>CFBundleURLName</key>
<string>com.alertesecours.alertesecours.expo</string>
<key>CFBundleURLSchemes</key>
<array>
<string>exp+alerte-secours</string>
</array>
<key>CFBundleURLName</key>
<string>com.alertesecours.alertesecours.expo</string>
</dict>
</array>
<key>CFBundleVersion</key>
<string>231</string>
<string>202601121722</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>

View file

@ -57,8 +57,19 @@ if [ -s "$IPA_PLIST_TMP" ]; then
IPA_BUILD_NUMBER=$(/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" "$IPA_PLIST_TMP" 2>/dev/null || echo "")
echo " IPA Info.plist (from payload): ${IPA_PKG_VERSION:-unknown} (${IPA_BUILD_NUMBER:-unknown})"
if [ -n "$IPA_PKG_VERSION" ] && [ -n "$IPA_BUILD_NUMBER" ]; then
if [ "$SRC_PKG_VERSION" != "$IPA_PKG_VERSION" ] || [ "$SRC_BUILD_NUMBER" != "$IPA_BUILD_NUMBER" ]; then
echo "Error: IPA version mismatch with source Info.plist."
# Enforce that CFBundleShortVersionString matches exactly between source and IPA.
if [ "$SRC_PKG_VERSION" != "$IPA_PKG_VERSION" ]; then
echo "Error: IPA CFBundleShortVersionString mismatch with source Info.plist."
echo "Hint: Run 'yarn bundle:ios' to export a fresh IPA aligned with current versions."
rm -f "$IPA_PLIST_TMP"
exit 1
fi
# Allow IPA CFBundleVersion to be greater than or equal to the source
# (Xcode may auto-increment it), but reject if it is lower, which
# indicates a stale IPA.
if [ "$IPA_BUILD_NUMBER" -lt "$SRC_BUILD_NUMBER" ]; then
echo "Error: IPA CFBundleVersion ($IPA_BUILD_NUMBER) is lower than source build number ($SRC_BUILD_NUMBER)."
echo "Hint: Run 'yarn bundle:ios' to export a fresh IPA aligned with current versions."
rm -f "$IPA_PLIST_TMP"
exit 1