Skip to content

Commit

Permalink
fix: withoutSignatures should effect all builds
Browse files Browse the repository at this point in the history
  • Loading branch information
tyrauber committed Feb 3, 2024
1 parent ea32f7c commit 72d4ed1
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions plugin/src/withMapLibre.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,31 +125,34 @@ export function setExcludedArchitectures(project: XcodeProject): XcodeProject {
typeof buildSettings?.PRODUCT_NAME !== 'undefined'
) {
buildSettings['"EXCLUDED_ARCHS[sdk=iphonesimulator*]"'] = '"arm64"';

/**
* Delete Duplicate Signature File
* https://github.com/CocoaPods/CocoaPods/issues/12022
*/
const shellScript = `if [ "$XCODE_VERSION_MAJOR" = "1500" ]; then
echo "Remove signature files (Xcode 15 workaround)";
rm -rf "$BUILD_DIR/Release-iphoneos/Mapbox.xcframework-ios.signature";
fi`;

project.addBuildPhase(
[],
'PBXShellScriptBuildPhase',
'Remove signature files (Xcode 15 workaround)',
null,
{
shellPath: '/bin/sh',
shellScript,
},
);
}
}
return project;
}

const withoutSignatures: ConfigPlugin = config => {
const shellScript = `if [ "$XCODE_VERSION_MAJOR" = "1500" ]; then
echo "Remove signature files (Xcode 15 workaround)";
rm -rf "$CONFIGURATION_BUILD_DIR/Mapbox.xcframework-ios.signature";
fi`;
return withXcodeProject(config, async config => {
const xcodeProject = config.modResults;

xcodeProject.addBuildPhase(
[],
'PBXShellScriptBuildPhase',
'Remove signature files (Xcode 15 workaround)',
null,
{
shellPath: '/bin/sh',
shellScript,
},
);

return config;
});
};

const withExcludedSimulatorArchitectures: ConfigPlugin = c => {
return withXcodeProject(c, config => {
config.modResults = setExcludedArchitectures(config.modResults);
Expand All @@ -158,7 +161,7 @@ const withExcludedSimulatorArchitectures: ConfigPlugin = c => {
};

const withMapLibre: ConfigPlugin = config => {
config = withExcludedSimulatorArchitectures(config);
config = withoutSignatures(withExcludedSimulatorArchitectures(config));
return withCocoaPodsInstallerBlocks(config);
};

Expand Down

0 comments on commit 72d4ed1

Please sign in to comment.