Skip to content

Commit

Permalink
Fix: Duplicated Signature issue with Xcode 15 (#238)
Browse files Browse the repository at this point in the history
- chore: update changelog
- fix: withoutSignatures should effect all builds
  • Loading branch information
tyrauber authored Feb 28, 2024
1 parent f520a11 commit 78e97a0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Please add unreleased changes in the following style:
PR Title ([#123](link to my pr))
```

Fix: Duplicated Signature issue with Xcode 15 ([#238](https://github.com/maplibre/maplibre-react-native/pull/238))
Update react-maplibre ([#34](https://github.com/maplibre/maplibre-react-native/issues/34))
chore: update support libraries ([#121](https://github.com/maplibre/maplibre-react-native/pull/121)).

Expand Down
26 changes: 24 additions & 2 deletions plugin/src/withMapLibre.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,32 @@ export function setExcludedArchitectures(project: XcodeProject): XcodeProject {
buildSettings['"EXCLUDED_ARCHS[sdk=iphonesimulator*]"'] = '"arm64"';
}
}

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 @@ -139,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 78e97a0

Please sign in to comment.