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 */, 9E6F0A1338934BA5AD468D4B /* Fix Xcode 15 Bug */,
229987488EA44E69AA932D58 /* Fix Xcode 15 Bug */, 229987488EA44E69AA932D58 /* Fix Xcode 15 Bug */,
A891237ADBD54747890A99FB /* Fix Xcode 15 Bug */, A891237ADBD54747890A99FB /* Fix Xcode 15 Bug */,
B700EE07E2A24654A0953D3B /* Remove signature files (Xcode workaround) */,
9E272D599E42446BB8DFD8D0 /* Fix Xcode 15 Bug */, 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 = ( buildRules = (
); );
@ -1066,6 +1068,74 @@ fi";
shellScript = " shellScript = "
echo \"Remove signature files (Xcode workaround)\"; echo \"Remove signature files (Xcode workaround)\";
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\"; 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 */ /* End PBXShellScriptBuildPhase section */

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>BGTaskSchedulerPermittedIdentifiers</key> <key>BGTaskSchedulerPermittedIdentifiers</key>
<array> <array>
<string>com.transistorsoft</string> <string>com.transistorsoft</string>
@ -25,30 +25,30 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.16.0</string> <string>202601121722</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
<array> <array>
<dict> <dict>
<key>CFBundleURLName</key>
<string>com.alertesecours.alertesecours</string>
<key>CFBundleURLSchemes</key> <key>CFBundleURLSchemes</key>
<array> <array>
<string>com.alertesecours.alertesecours</string> <string>com.alertesecours.alertesecours</string>
</array> </array>
<key>CFBundleURLName</key>
<string>com.alertesecours.alertesecours</string>
</dict> </dict>
<dict> <dict>
<key>CFBundleURLName</key>
<string>com.alertesecours.alertesecours.expo</string>
<key>CFBundleURLSchemes</key> <key>CFBundleURLSchemes</key>
<array> <array>
<string>exp+alerte-secours</string> <string>exp+alerte-secours</string>
</array> </array>
<key>CFBundleURLName</key>
<string>com.alertesecours.alertesecours.expo</string>
</dict> </dict>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>231</string> <string>202601121722</string>
<key>ITSAppUsesNonExemptEncryption</key> <key>ITSAppUsesNonExemptEncryption</key>
<false/> <false/>
<key>LSApplicationQueriesSchemes</key> <key>LSApplicationQueriesSchemes</key>
@ -179,5 +179,5 @@
<string>Automatic</string> <string>Automatic</string>
<key>UIViewControllerBasedStatusBarAppearance</key> <key>UIViewControllerBasedStatusBarAppearance</key>
<false/> <false/>
</dict> </dict>
</plist> </plist>

View file

@ -52,19 +52,30 @@ fi
IPA_PLIST_TMP=$(mktemp -t as_ipa_Info.plist) IPA_PLIST_TMP=$(mktemp -t as_ipa_Info.plist)
unzip -p "$IPA_PATH" "Payload/AlerteSecours.app/Info.plist" > "$IPA_PLIST_TMP" 2>/dev/null || true unzip -p "$IPA_PATH" "Payload/AlerteSecours.app/Info.plist" > "$IPA_PLIST_TMP" 2>/dev/null || true
if [ -s "$IPA_PLIST_TMP" ]; then if [ -s "$IPA_PLIST_TMP" ]; then
IPA_PKG_VERSION=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "$IPA_PLIST_TMP" 2>/dev/null || echo "") IPA_PKG_VERSION=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "$IPA_PLIST_TMP" 2>/dev/null || echo "")
IPA_BUILD_NUMBER=$(/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" "$IPA_PLIST_TMP" 2>/dev/null || echo "") 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})" 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 [ -n "$IPA_PKG_VERSION" ] && [ -n "$IPA_BUILD_NUMBER" ]; then
if [ "$SRC_PKG_VERSION" != "$IPA_PKG_VERSION" ] || [ "$SRC_BUILD_NUMBER" != "$IPA_BUILD_NUMBER" ]; then # Enforce that CFBundleShortVersionString matches exactly between source and IPA.
echo "Error: IPA version mismatch with source Info.plist." 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." echo "Hint: Run 'yarn bundle:ios' to export a fresh IPA aligned with current versions."
rm -f "$IPA_PLIST_TMP" rm -f "$IPA_PLIST_TMP"
exit 1 exit 1
fi fi
fi fi
else else
echo "Warning: Could not read Info.plist from IPA payload for verification. Continuing." echo "Warning: Could not read Info.plist from IPA payload for verification. Continuing."
fi fi
rm -f "$IPA_PLIST_TMP" rm -f "$IPA_PLIST_TMP"