From af8d8e0949257649d0a6ac29745d0fe24ed47106 Mon Sep 17 00:00:00 2001 From: Ty Rauber Date: Tue, 24 Sep 2024 09:01:01 +0200 Subject: [PATCH] fix: add generic expo config plugin to remove MapLibre.xcframework-ios.signature --- CHANGELOG.md | 4 ++++ package.json | 2 +- plugin/src/withMapLibre.ts | 29 +++++++++++++++++++++++++---- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c394939e9..4b1c4c15f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ PR Title ([#123](link to my pr)) ``` +## 10.0.0-alpha.17 + +fix: add generic expo plugin to remove Duplicated Signature in Xcode 15/16 + ## 10.0.0-alpha.16 fix: [another attempt to disable code signing](<[#451](https://github.com/maplibre/maplibre-react-native/pull/451)>) diff --git a/package.json b/package.json index 9d304ad44..38b13b9f5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@maplibre/maplibre-react-native", "description": "A MapLibre GL Native plugin for creating maps in React Native", - "version": "10.0.0-alpha.16", + "version": "10.0.0-alpha.17", "publishConfig": { "access": "public" }, diff --git a/plugin/src/withMapLibre.ts b/plugin/src/withMapLibre.ts index 328da103c..04169d645 100644 --- a/plugin/src/withMapLibre.ts +++ b/plugin/src/withMapLibre.ts @@ -43,7 +43,7 @@ const withCocoaPodsInstallerBlocks: ConfigPlugin = (c) => { await promises.writeFile( file, applyCocoaPodsModifications(contents), - "utf-8", + "utf-8" ); return config; }, @@ -63,7 +63,7 @@ export function applyCocoaPodsModifications(contents: string): string { export function addInstallerBlock( src: string, - blockName: InstallerBlockName, + blockName: InstallerBlockName ): string { const matchBlock = new RegExp(`${blockName}_install do \\|installer\\|`); const tag = `${blockName}_installer`; @@ -96,7 +96,7 @@ export function addInstallerBlock( export function addMapLibreInstallerBlock( src: string, - blockName: InstallerBlockName, + blockName: InstallerBlockName ): string { return mergeContents({ tag: `@maplibre/maplibre-react-native-${blockName}_installer`, @@ -129,6 +129,27 @@ export function setExcludedArchitectures(project: XcodeProject): XcodeProject { return project; } +const withoutSignatures: ConfigPlugin = (config) => { + const shellScript = ` + echo "Remove signature files (Xcode workaround)"; + rm -rf "$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature"; + `; + return withXcodeProject(config, async (config) => { + const xcodeProject = config.modResults; + xcodeProject.addBuildPhase( + [], + "PBXShellScriptBuildPhase", + "Remove signature files (Xcode workaround)", + null, + { + shellPath: "/bin/sh", + shellScript, + } + ); + return config; + }); +}; + const withExcludedSimulatorArchitectures: ConfigPlugin = (c) => { return withXcodeProject(c, (config) => { config.modResults = setExcludedArchitectures(config.modResults); @@ -137,7 +158,7 @@ const withExcludedSimulatorArchitectures: ConfigPlugin = (c) => { }; const withMapLibre: ConfigPlugin = (config) => { - config = withExcludedSimulatorArchitectures(config); + config = withoutSignatures(withExcludedSimulatorArchitectures(config)); return withCocoaPodsInstallerBlocks(config); };