@baeckerherz/expo-mapbox-navigation 0.1.21 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/ExpoMapboxNavigation.podspec +5 -0
- package/package.json +1 -1
- package/plugin/build/index.js +7 -9
- package/plugin/build/withMapboxArchiveFix.d.ts +14 -0
- package/plugin/build/withMapboxArchiveFix.js +53 -0
- package/plugin/build/withMapboxNavPodfile.d.ts +13 -9
- package/plugin/build/withMapboxNavPodfile.js +36 -10
- package/plugin/src/index.ts +7 -9
- package/plugin/src/withMapboxArchiveFix.ts +65 -0
- package/plugin/src/withMapboxNavPodfile.ts +45 -10
|
@@ -24,4 +24,9 @@ Pod::Spec.new do |s|
|
|
|
24
24
|
'SWIFT_COMPILATION_MODE' => 'wholemodule',
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
# Mapbox Navigation SDK v3 binary xcframeworks must be linked by the app
|
|
28
|
+
# target (static pods can't link dynamic frameworks).
|
|
29
|
+
s.user_target_xcconfig = {
|
|
30
|
+
'OTHER_LDFLAGS' => '$(inherited) -framework "MapboxNavigationNative" -framework "MapboxCommon" -framework "MapboxCoreMaps"',
|
|
31
|
+
}
|
|
27
32
|
end
|
package/package.json
CHANGED
package/plugin/build/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
4
|
-
const withMapboxNavSPM_1 = require("./withMapboxNavSPM");
|
|
5
4
|
const withMapboxNavPodfile_1 = require("./withMapboxNavPodfile");
|
|
6
5
|
const withMapboxNavGradle_1 = require("./withMapboxNavGradle");
|
|
7
6
|
const withMapboxNavGradleProperties_1 = require("./withMapboxNavGradleProperties");
|
|
7
|
+
const withMapboxArchiveFix_1 = require("./withMapboxArchiveFix");
|
|
8
8
|
const withMapboxNavigation = (config, { mapboxAccessToken, mapboxSecretToken, navigationSdkVersion = "3.5.0", }) => {
|
|
9
9
|
if (!mapboxAccessToken) {
|
|
10
10
|
throw new Error("[@baeckerherz/expo-mapbox-navigation] mapboxAccessToken is required.");
|
|
@@ -25,14 +25,12 @@ const withMapboxNavigation = (config, { mapboxAccessToken, mapboxSecretToken, na
|
|
|
25
25
|
config.ios.infoPlist.NSLocationAlwaysAndWhenInUseUsageDescription =
|
|
26
26
|
config.ios.infoPlist.NSLocationAlwaysAndWhenInUseUsageDescription ||
|
|
27
27
|
"This app needs your location for turn-by-turn navigation, including in the background.";
|
|
28
|
-
// iOS:
|
|
29
|
-
//
|
|
30
|
-
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// can find SPM-built modules (including PackageFrameworks directory).
|
|
35
|
-
config = (0, withMapboxNavPodfile_1.withMapboxNavPodfile)(config);
|
|
28
|
+
// iOS: Adds Mapbox Navigation SPM to the Pods project and sets search paths
|
|
29
|
+
// so ExpoMapboxNavigation can import Mapbox modules.
|
|
30
|
+
config = (0, withMapboxNavPodfile_1.withMapboxNavPodfile)(config, { navigationSdkVersion });
|
|
31
|
+
// iOS: Workaround for Xcode 17 bug — duplicate xcframework .signature files
|
|
32
|
+
// during archive creation. Strips them from BUILD_DIR before the archive step.
|
|
33
|
+
config = (0, withMapboxArchiveFix_1.withMapboxArchiveFix)(config);
|
|
36
34
|
// Android: Mapbox Maven repository and optional token for SDK download
|
|
37
35
|
config = (0, withMapboxNavGradle_1.withMapboxNavGradle)(config);
|
|
38
36
|
config = (0, withMapboxNavGradleProperties_1.withMapboxNavGradleProperties)(config, { mapboxSecretToken });
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ConfigPlugin } from "@expo/config-plugins";
|
|
2
|
+
/**
|
|
3
|
+
* Adds a Run Script build phase to the app target that removes xcframework
|
|
4
|
+
* .signature files from the build directory before the archive step.
|
|
5
|
+
*
|
|
6
|
+
* Xcode 17 has a bug where SPM binary xcframeworks that appear in multiple
|
|
7
|
+
* transitive dependency paths (e.g. MapboxCommon, used by both
|
|
8
|
+
* MapboxNavigationNative and MapboxCoreMaps) cause duplicate .signature
|
|
9
|
+
* file copies during archive creation, failing with "item already exists".
|
|
10
|
+
*
|
|
11
|
+
* These .signature files are package integrity checks (not code signing)
|
|
12
|
+
* and are not required for App Store distribution.
|
|
13
|
+
*/
|
|
14
|
+
export declare const withMapboxArchiveFix: ConfigPlugin;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withMapboxArchiveFix = void 0;
|
|
4
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
|
+
const SCRIPT_NAME = "[Mapbox] Strip xcframework signatures";
|
|
6
|
+
/**
|
|
7
|
+
* Adds a Run Script build phase to the app target that removes xcframework
|
|
8
|
+
* .signature files from the build directory before the archive step.
|
|
9
|
+
*
|
|
10
|
+
* Xcode 17 has a bug where SPM binary xcframeworks that appear in multiple
|
|
11
|
+
* transitive dependency paths (e.g. MapboxCommon, used by both
|
|
12
|
+
* MapboxNavigationNative and MapboxCoreMaps) cause duplicate .signature
|
|
13
|
+
* file copies during archive creation, failing with "item already exists".
|
|
14
|
+
*
|
|
15
|
+
* These .signature files are package integrity checks (not code signing)
|
|
16
|
+
* and are not required for App Store distribution.
|
|
17
|
+
*/
|
|
18
|
+
const withMapboxArchiveFix = (config) => {
|
|
19
|
+
return (0, config_plugins_1.withXcodeProject)(config, (config) => {
|
|
20
|
+
const project = config.modResults;
|
|
21
|
+
const nativeTargetKey = Object.keys(project.hash.project.objects["PBXNativeTarget"]).find((key) => !key.includes("_comment"));
|
|
22
|
+
if (!nativeTargetKey)
|
|
23
|
+
return config;
|
|
24
|
+
const target = project.hash.project.objects["PBXNativeTarget"][nativeTargetKey];
|
|
25
|
+
const alreadyAdded = (target.buildPhases || []).some((uuid) => {
|
|
26
|
+
const comment = project.hash.project.objects["PBXShellScriptBuildPhase"]?.[`${uuid}_comment`];
|
|
27
|
+
return comment === SCRIPT_NAME;
|
|
28
|
+
});
|
|
29
|
+
if (alreadyAdded)
|
|
30
|
+
return config;
|
|
31
|
+
if (!project.hash.project.objects["PBXShellScriptBuildPhase"]) {
|
|
32
|
+
project.hash.project.objects["PBXShellScriptBuildPhase"] = {};
|
|
33
|
+
}
|
|
34
|
+
const uuid = project.generateUuid();
|
|
35
|
+
project.hash.project.objects["PBXShellScriptBuildPhase"][uuid] = {
|
|
36
|
+
isa: "PBXShellScriptBuildPhase",
|
|
37
|
+
buildActionMask: 2147483647,
|
|
38
|
+
files: [],
|
|
39
|
+
inputPaths: [],
|
|
40
|
+
name: SCRIPT_NAME,
|
|
41
|
+
outputPaths: [],
|
|
42
|
+
runOnlyForDeploymentPostprocessing: 0,
|
|
43
|
+
shellPath: "/bin/sh",
|
|
44
|
+
shellScript: 'find "${BUILD_DIR}" -name "*.xcframework-*.signature" -delete 2>/dev/null\\nexit 0\\n',
|
|
45
|
+
};
|
|
46
|
+
project.hash.project.objects["PBXShellScriptBuildPhase"][`${uuid}_comment`] = SCRIPT_NAME;
|
|
47
|
+
if (!target.buildPhases)
|
|
48
|
+
target.buildPhases = [];
|
|
49
|
+
target.buildPhases.push(uuid);
|
|
50
|
+
return config;
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
exports.withMapboxArchiveFix = withMapboxArchiveFix;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { ConfigPlugin } from "@expo/config-plugins";
|
|
2
|
+
interface PodfileOptions {
|
|
3
|
+
navigationSdkVersion: string;
|
|
4
|
+
}
|
|
2
5
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* Injects a post_install hook that:
|
|
7
|
+
* 1. Adds Mapbox Navigation SDK as an SPM dependency in the Pods project,
|
|
8
|
+
* linking only MapboxNavigationUIKit to ExpoMapboxNavigation. Using a
|
|
9
|
+
* single top-level product avoids duplicate xcframework signature copies
|
|
10
|
+
* during archiving (MapboxCommon appears in multiple transitive chains).
|
|
11
|
+
* 2. Sets FRAMEWORK_SEARCH_PATHS / SWIFT_INCLUDE_PATHS so the pod can find
|
|
12
|
+
* all SPM-built modules (including transitive deps like MapboxDirections).
|
|
13
|
+
* 3. Enables BUILD_LIBRARY_FOR_DISTRIBUTION on Mapbox/Turf targets.
|
|
11
14
|
*/
|
|
12
|
-
export declare const withMapboxNavPodfile: ConfigPlugin
|
|
15
|
+
export declare const withMapboxNavPodfile: ConfigPlugin<PodfileOptions>;
|
|
16
|
+
export {};
|
|
@@ -37,25 +37,28 @@ exports.withMapboxNavPodfile = void 0;
|
|
|
37
37
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
38
38
|
const fs = __importStar(require("fs"));
|
|
39
39
|
const path = __importStar(require("path"));
|
|
40
|
+
const MAPBOX_NAV_URL = "https://github.com/mapbox/mapbox-navigation-ios.git";
|
|
40
41
|
const PLUGIN_MARKER = "# @baeckerherz/expo-mapbox-navigation:";
|
|
41
42
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
43
|
+
* Injects a post_install hook that:
|
|
44
|
+
* 1. Adds Mapbox Navigation SDK as an SPM dependency in the Pods project,
|
|
45
|
+
* linking only MapboxNavigationUIKit to ExpoMapboxNavigation. Using a
|
|
46
|
+
* single top-level product avoids duplicate xcframework signature copies
|
|
47
|
+
* during archiving (MapboxCommon appears in multiple transitive chains).
|
|
48
|
+
* 2. Sets FRAMEWORK_SEARCH_PATHS / SWIFT_INCLUDE_PATHS so the pod can find
|
|
49
|
+
* all SPM-built modules (including transitive deps like MapboxDirections).
|
|
50
|
+
* 3. Enables BUILD_LIBRARY_FOR_DISTRIBUTION on Mapbox/Turf targets.
|
|
50
51
|
*/
|
|
51
|
-
const withMapboxNavPodfile = (config) => {
|
|
52
|
+
const withMapboxNavPodfile = (config, { navigationSdkVersion }) => {
|
|
52
53
|
return (0, config_plugins_1.withDangerousMod)(config, [
|
|
53
54
|
"ios",
|
|
54
55
|
async (config) => {
|
|
55
56
|
const podfilePath = path.join(config.modRequest.platformProjectRoot, "Podfile");
|
|
56
57
|
let contents = fs.readFileSync(podfilePath, "utf8");
|
|
58
|
+
const versionEscaped = navigationSdkVersion.replace(/'/g, "\\\\'");
|
|
57
59
|
const hook = `
|
|
58
|
-
${PLUGIN_MARKER}
|
|
60
|
+
${PLUGIN_MARKER} SPM in Pods + search paths + BUILD_LIBRARY_FOR_DISTRIBUTION
|
|
61
|
+
mapbox_nav_version = '${versionEscaped}'
|
|
59
62
|
installer.pods_project.targets.each do |target|
|
|
60
63
|
if target.name.start_with?('Mapbox') || target.name == 'Turf'
|
|
61
64
|
target.build_configurations.each do |cfg|
|
|
@@ -69,6 +72,29 @@ const withMapboxNavPodfile = (config) => {
|
|
|
69
72
|
cfg.build_settings['SWIFT_INCLUDE_PATHS'] = paths
|
|
70
73
|
end
|
|
71
74
|
end
|
|
75
|
+
end
|
|
76
|
+
emn_target = installer.pods_project.targets.find { |t| t.name == 'ExpoMapboxNavigation' }
|
|
77
|
+
if emn_target
|
|
78
|
+
project = installer.pods_project
|
|
79
|
+
root = project.root_object
|
|
80
|
+
pkg_ref = root.package_references&.find { |r| r.respond_to?(:repositoryURL) && r.repositoryURL == '${MAPBOX_NAV_URL}' }
|
|
81
|
+
unless pkg_ref
|
|
82
|
+
pkg_ref = project.new(Xcodeproj::Project::Object::XCRemoteSwiftPackageReference)
|
|
83
|
+
pkg_ref.repositoryURL = '${MAPBOX_NAV_URL}'
|
|
84
|
+
pkg_ref.requirement = { 'kind' => 'exactVersion', 'version' => mapbox_nav_version }
|
|
85
|
+
root.package_references << pkg_ref
|
|
86
|
+
end
|
|
87
|
+
unless emn_target.package_product_dependencies.any? { |d| d.product_name == 'MapboxNavigationUIKit' }
|
|
88
|
+
dep = project.new(Xcodeproj::Project::Object::XCSwiftPackageProductDependency)
|
|
89
|
+
dep.package = pkg_ref
|
|
90
|
+
dep.product_name = 'MapboxNavigationUIKit'
|
|
91
|
+
emn_target.package_product_dependencies << dep
|
|
92
|
+
if emn_target.frameworks_build_phases
|
|
93
|
+
bf = project.new(Xcodeproj::Project::Object::PBXBuildFile)
|
|
94
|
+
bf.product_ref = dep
|
|
95
|
+
emn_target.frameworks_build_phases.files << bf
|
|
96
|
+
end
|
|
97
|
+
end
|
|
72
98
|
end`;
|
|
73
99
|
const escapedMarker = PLUGIN_MARKER.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
74
100
|
// Remove any previously injected hook (handles upgrades from older plugin versions)
|
package/plugin/src/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ConfigPlugin, createRunOncePlugin } from "@expo/config-plugins";
|
|
2
|
-
import { withMapboxNavSPM } from "./withMapboxNavSPM";
|
|
3
2
|
import { withMapboxNavPodfile } from "./withMapboxNavPodfile";
|
|
4
3
|
import { withMapboxNavGradle } from "./withMapboxNavGradle";
|
|
5
4
|
import { withMapboxNavGradleProperties } from "./withMapboxNavGradleProperties";
|
|
5
|
+
import { withMapboxArchiveFix } from "./withMapboxArchiveFix";
|
|
6
6
|
|
|
7
7
|
interface PluginConfig {
|
|
8
8
|
/** Mapbox public access token (pk.xxx). Required for the native SDK. */
|
|
@@ -44,15 +44,13 @@ const withMapboxNavigation: ConfigPlugin<PluginConfig> = (
|
|
|
44
44
|
config.ios.infoPlist.NSLocationAlwaysAndWhenInUseUsageDescription ||
|
|
45
45
|
"This app needs your location for turn-by-turn navigation, including in the background.";
|
|
46
46
|
|
|
47
|
-
// iOS:
|
|
48
|
-
//
|
|
49
|
-
|
|
50
|
-
// project avoids duplicate xcframework signatures during archiving.
|
|
51
|
-
config = withMapboxNavSPM(config, { navigationSdkVersion });
|
|
47
|
+
// iOS: Adds Mapbox Navigation SPM to the Pods project and sets search paths
|
|
48
|
+
// so ExpoMapboxNavigation can import Mapbox modules.
|
|
49
|
+
config = withMapboxNavPodfile(config, { navigationSdkVersion });
|
|
52
50
|
|
|
53
|
-
// iOS:
|
|
54
|
-
//
|
|
55
|
-
config =
|
|
51
|
+
// iOS: Workaround for Xcode 17 bug — duplicate xcframework .signature files
|
|
52
|
+
// during archive creation. Strips them from BUILD_DIR before the archive step.
|
|
53
|
+
config = withMapboxArchiveFix(config);
|
|
56
54
|
|
|
57
55
|
// Android: Mapbox Maven repository and optional token for SDK download
|
|
58
56
|
config = withMapboxNavGradle(config);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { withXcodeProject, ConfigPlugin } from "@expo/config-plugins";
|
|
2
|
+
|
|
3
|
+
const SCRIPT_NAME = "[Mapbox] Strip xcframework signatures";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Adds a Run Script build phase to the app target that removes xcframework
|
|
7
|
+
* .signature files from the build directory before the archive step.
|
|
8
|
+
*
|
|
9
|
+
* Xcode 17 has a bug where SPM binary xcframeworks that appear in multiple
|
|
10
|
+
* transitive dependency paths (e.g. MapboxCommon, used by both
|
|
11
|
+
* MapboxNavigationNative and MapboxCoreMaps) cause duplicate .signature
|
|
12
|
+
* file copies during archive creation, failing with "item already exists".
|
|
13
|
+
*
|
|
14
|
+
* These .signature files are package integrity checks (not code signing)
|
|
15
|
+
* and are not required for App Store distribution.
|
|
16
|
+
*/
|
|
17
|
+
export const withMapboxArchiveFix: ConfigPlugin = (config) => {
|
|
18
|
+
return withXcodeProject(config, (config) => {
|
|
19
|
+
const project = config.modResults;
|
|
20
|
+
|
|
21
|
+
const nativeTargetKey = Object.keys(
|
|
22
|
+
project.hash.project.objects["PBXNativeTarget"]
|
|
23
|
+
).find((key) => !key.includes("_comment"));
|
|
24
|
+
|
|
25
|
+
if (!nativeTargetKey) return config;
|
|
26
|
+
|
|
27
|
+
const target =
|
|
28
|
+
project.hash.project.objects["PBXNativeTarget"][nativeTargetKey];
|
|
29
|
+
|
|
30
|
+
const alreadyAdded = (target.buildPhases || []).some((uuid: string) => {
|
|
31
|
+
const comment =
|
|
32
|
+
project.hash.project.objects["PBXShellScriptBuildPhase"]?.[
|
|
33
|
+
`${uuid}_comment`
|
|
34
|
+
];
|
|
35
|
+
return comment === SCRIPT_NAME;
|
|
36
|
+
});
|
|
37
|
+
if (alreadyAdded) return config;
|
|
38
|
+
|
|
39
|
+
if (!project.hash.project.objects["PBXShellScriptBuildPhase"]) {
|
|
40
|
+
project.hash.project.objects["PBXShellScriptBuildPhase"] = {};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const uuid = project.generateUuid();
|
|
44
|
+
project.hash.project.objects["PBXShellScriptBuildPhase"][uuid] = {
|
|
45
|
+
isa: "PBXShellScriptBuildPhase",
|
|
46
|
+
buildActionMask: 2147483647,
|
|
47
|
+
files: [],
|
|
48
|
+
inputPaths: [],
|
|
49
|
+
name: SCRIPT_NAME,
|
|
50
|
+
outputPaths: [],
|
|
51
|
+
runOnlyForDeploymentPostprocessing: 0,
|
|
52
|
+
shellPath: "/bin/sh",
|
|
53
|
+
shellScript:
|
|
54
|
+
'find "${BUILD_DIR}" -name "*.xcframework-*.signature" -delete 2>/dev/null\\nexit 0\\n',
|
|
55
|
+
};
|
|
56
|
+
project.hash.project.objects["PBXShellScriptBuildPhase"][
|
|
57
|
+
`${uuid}_comment`
|
|
58
|
+
] = SCRIPT_NAME;
|
|
59
|
+
|
|
60
|
+
if (!target.buildPhases) target.buildPhases = [];
|
|
61
|
+
target.buildPhases.push(uuid);
|
|
62
|
+
|
|
63
|
+
return config;
|
|
64
|
+
});
|
|
65
|
+
};
|
|
@@ -2,19 +2,28 @@ import { withDangerousMod, ConfigPlugin } from "@expo/config-plugins";
|
|
|
2
2
|
import * as fs from "fs";
|
|
3
3
|
import * as path from "path";
|
|
4
4
|
|
|
5
|
+
const MAPBOX_NAV_URL = "https://github.com/mapbox/mapbox-navigation-ios.git";
|
|
6
|
+
|
|
5
7
|
const PLUGIN_MARKER = "# @baeckerherz/expo-mapbox-navigation:";
|
|
6
8
|
|
|
9
|
+
interface PodfileOptions {
|
|
10
|
+
navigationSdkVersion: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
7
13
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* Injects a post_install hook that:
|
|
15
|
+
* 1. Adds Mapbox Navigation SDK as an SPM dependency in the Pods project,
|
|
16
|
+
* linking only MapboxNavigationUIKit to ExpoMapboxNavigation. Using a
|
|
17
|
+
* single top-level product avoids duplicate xcframework signature copies
|
|
18
|
+
* during archiving (MapboxCommon appears in multiple transitive chains).
|
|
19
|
+
* 2. Sets FRAMEWORK_SEARCH_PATHS / SWIFT_INCLUDE_PATHS so the pod can find
|
|
20
|
+
* all SPM-built modules (including transitive deps like MapboxDirections).
|
|
21
|
+
* 3. Enables BUILD_LIBRARY_FOR_DISTRIBUTION on Mapbox/Turf targets.
|
|
16
22
|
*/
|
|
17
|
-
export const withMapboxNavPodfile: ConfigPlugin = (
|
|
23
|
+
export const withMapboxNavPodfile: ConfigPlugin<PodfileOptions> = (
|
|
24
|
+
config,
|
|
25
|
+
{ navigationSdkVersion }
|
|
26
|
+
) => {
|
|
18
27
|
return withDangerousMod(config, [
|
|
19
28
|
"ios",
|
|
20
29
|
async (config) => {
|
|
@@ -24,8 +33,11 @@ export const withMapboxNavPodfile: ConfigPlugin = (config) => {
|
|
|
24
33
|
);
|
|
25
34
|
let contents = fs.readFileSync(podfilePath, "utf8");
|
|
26
35
|
|
|
36
|
+
const versionEscaped = navigationSdkVersion.replace(/'/g, "\\\\'");
|
|
37
|
+
|
|
27
38
|
const hook = `
|
|
28
|
-
${PLUGIN_MARKER}
|
|
39
|
+
${PLUGIN_MARKER} SPM in Pods + search paths + BUILD_LIBRARY_FOR_DISTRIBUTION
|
|
40
|
+
mapbox_nav_version = '${versionEscaped}'
|
|
29
41
|
installer.pods_project.targets.each do |target|
|
|
30
42
|
if target.name.start_with?('Mapbox') || target.name == 'Turf'
|
|
31
43
|
target.build_configurations.each do |cfg|
|
|
@@ -39,6 +51,29 @@ export const withMapboxNavPodfile: ConfigPlugin = (config) => {
|
|
|
39
51
|
cfg.build_settings['SWIFT_INCLUDE_PATHS'] = paths
|
|
40
52
|
end
|
|
41
53
|
end
|
|
54
|
+
end
|
|
55
|
+
emn_target = installer.pods_project.targets.find { |t| t.name == 'ExpoMapboxNavigation' }
|
|
56
|
+
if emn_target
|
|
57
|
+
project = installer.pods_project
|
|
58
|
+
root = project.root_object
|
|
59
|
+
pkg_ref = root.package_references&.find { |r| r.respond_to?(:repositoryURL) && r.repositoryURL == '${MAPBOX_NAV_URL}' }
|
|
60
|
+
unless pkg_ref
|
|
61
|
+
pkg_ref = project.new(Xcodeproj::Project::Object::XCRemoteSwiftPackageReference)
|
|
62
|
+
pkg_ref.repositoryURL = '${MAPBOX_NAV_URL}'
|
|
63
|
+
pkg_ref.requirement = { 'kind' => 'exactVersion', 'version' => mapbox_nav_version }
|
|
64
|
+
root.package_references << pkg_ref
|
|
65
|
+
end
|
|
66
|
+
unless emn_target.package_product_dependencies.any? { |d| d.product_name == 'MapboxNavigationUIKit' }
|
|
67
|
+
dep = project.new(Xcodeproj::Project::Object::XCSwiftPackageProductDependency)
|
|
68
|
+
dep.package = pkg_ref
|
|
69
|
+
dep.product_name = 'MapboxNavigationUIKit'
|
|
70
|
+
emn_target.package_product_dependencies << dep
|
|
71
|
+
if emn_target.frameworks_build_phases
|
|
72
|
+
bf = project.new(Xcodeproj::Project::Object::PBXBuildFile)
|
|
73
|
+
bf.product_ref = dep
|
|
74
|
+
emn_target.frameworks_build_phases.files << bf
|
|
75
|
+
end
|
|
76
|
+
end
|
|
42
77
|
end`;
|
|
43
78
|
|
|
44
79
|
const escapedMarker = PLUGIN_MARKER.replace(
|