Skip to content

Commit

Permalink
fix: add generic expo config plugin to remove MapLibre.xcframework-io…
Browse files Browse the repository at this point in the history
…s.signature
  • Loading branch information
tyrauber committed Sep 24, 2024
1 parent 0d85a9d commit af8d8e0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)>)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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"
},
Expand Down
29 changes: 25 additions & 4 deletions plugin/src/withMapLibre.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const withCocoaPodsInstallerBlocks: ConfigPlugin = (c) => {
await promises.writeFile(
file,
applyCocoaPodsModifications(contents),
"utf-8",
"utf-8"

Check failure on line 46 in plugin/src/withMapLibre.ts

View workflow job for this annotation

GitHub Actions / lint_test_generate

Insert `,`
);
return config;
},
Expand All @@ -63,7 +63,7 @@ export function applyCocoaPodsModifications(contents: string): string {

export function addInstallerBlock(
src: string,
blockName: InstallerBlockName,
blockName: InstallerBlockName

Check failure on line 66 in plugin/src/withMapLibre.ts

View workflow job for this annotation

GitHub Actions / lint_test_generate

Insert `,`
): string {
const matchBlock = new RegExp(`${blockName}_install do \\|installer\\|`);
const tag = `${blockName}_installer`;
Expand Down Expand Up @@ -96,7 +96,7 @@ export function addInstallerBlock(

export function addMapLibreInstallerBlock(
src: string,
blockName: InstallerBlockName,
blockName: InstallerBlockName

Check failure on line 99 in plugin/src/withMapLibre.ts

View workflow job for this annotation

GitHub Actions / lint_test_generate

Insert `,`
): string {
return mergeContents({
tag: `@maplibre/maplibre-react-native-${blockName}_installer`,
Expand Down Expand Up @@ -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,
}

Check failure on line 147 in plugin/src/withMapLibre.ts

View workflow job for this annotation

GitHub Actions / lint_test_generate

Insert `,`
);
return config;
});
};

const withExcludedSimulatorArchitectures: ConfigPlugin = (c) => {
return withXcodeProject(c, (config) => {
config.modResults = setExcludedArchitectures(config.modResults);
Expand All @@ -137,7 +158,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 af8d8e0

Please sign in to comment.