@baeckerherz/expo-mapbox-navigation 0.1.27 → 0.1.28
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/package.json
CHANGED
package/plugin/build/index.js
CHANGED
|
@@ -4,7 +4,6 @@ const config_plugins_1 = require("@expo/config-plugins");
|
|
|
4
4
|
const withMapboxNavPodfile_1 = require("./withMapboxNavPodfile");
|
|
5
5
|
const withMapboxNavGradle_1 = require("./withMapboxNavGradle");
|
|
6
6
|
const withMapboxNavGradleProperties_1 = require("./withMapboxNavGradleProperties");
|
|
7
|
-
const withMapboxArchiveFix_1 = require("./withMapboxArchiveFix");
|
|
8
7
|
const withMapboxNavigation = (config, { mapboxAccessToken, mapboxSecretToken, navigationSdkVersion = "3.5.0", }) => {
|
|
9
8
|
if (!mapboxAccessToken) {
|
|
10
9
|
throw new Error("[@baeckerherz/expo-mapbox-navigation] mapboxAccessToken is required.");
|
|
@@ -25,12 +24,9 @@ const withMapboxNavigation = (config, { mapboxAccessToken, mapboxSecretToken, na
|
|
|
25
24
|
config.ios.infoPlist.NSLocationAlwaysAndWhenInUseUsageDescription =
|
|
26
25
|
config.ios.infoPlist.NSLocationAlwaysAndWhenInUseUsageDescription ||
|
|
27
26
|
"This app needs your location for turn-by-turn navigation, including in the background.";
|
|
28
|
-
// iOS: Adds Mapbox Navigation SPM to the Pods project
|
|
29
|
-
//
|
|
27
|
+
// iOS: Adds Mapbox Navigation SPM to the Pods project, sets search paths,
|
|
28
|
+
// and adds a script phase to strip duplicate xcframework signatures.
|
|
30
29
|
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);
|
|
34
30
|
// Android: Mapbox Maven repository and optional token for SDK download
|
|
35
31
|
config = (0, withMapboxNavGradle_1.withMapboxNavGradle)(config);
|
|
36
32
|
config = (0, withMapboxNavGradleProperties_1.withMapboxNavGradleProperties)(config, { mapboxSecretToken });
|
|
@@ -95,6 +95,19 @@ const withMapboxNavPodfile = (config, { navigationSdkVersion }) => {
|
|
|
95
95
|
emn_target.frameworks_build_phases.files << bf
|
|
96
96
|
end
|
|
97
97
|
end
|
|
98
|
+
end
|
|
99
|
+
# Xcode 17 bug: SPM binary xcframeworks sharing transitive deps cause
|
|
100
|
+
# duplicate .signature file copies during archive creation. Strip them.
|
|
101
|
+
user_proj = installer.aggregate_targets.first&.user_project
|
|
102
|
+
if user_proj
|
|
103
|
+
app_target = user_proj.targets.first
|
|
104
|
+
phase_name = 'StripXCFrameworkSignatures'
|
|
105
|
+
unless app_target.shell_script_build_phases.any? { |p| p.name == phase_name }
|
|
106
|
+
phase = app_target.new_shell_script_build_phase(phase_name)
|
|
107
|
+
d = '$'
|
|
108
|
+
phase.shell_script = "DERIVED_ROOT=\\"#{d}{BUILD_DIR%/Build/*}\\"\\nfind \\"#{d}{DERIVED_ROOT}\\" -name \\"*.xcframework-*.signature\\" -delete 2>/dev/null\\nexit 0\\n"
|
|
109
|
+
end
|
|
110
|
+
user_proj.save
|
|
98
111
|
end`;
|
|
99
112
|
const escapedMarker = PLUGIN_MARKER.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
100
113
|
// Remove any previously injected hook (handles upgrades from older plugin versions)
|
package/plugin/src/index.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { ConfigPlugin, createRunOncePlugin } from "@expo/config-plugins";
|
|
|
2
2
|
import { withMapboxNavPodfile } from "./withMapboxNavPodfile";
|
|
3
3
|
import { withMapboxNavGradle } from "./withMapboxNavGradle";
|
|
4
4
|
import { withMapboxNavGradleProperties } from "./withMapboxNavGradleProperties";
|
|
5
|
-
import { withMapboxArchiveFix } from "./withMapboxArchiveFix";
|
|
6
5
|
|
|
7
6
|
interface PluginConfig {
|
|
8
7
|
/** Mapbox public access token (pk.xxx). Required for the native SDK. */
|
|
@@ -44,14 +43,10 @@ const withMapboxNavigation: ConfigPlugin<PluginConfig> = (
|
|
|
44
43
|
config.ios.infoPlist.NSLocationAlwaysAndWhenInUseUsageDescription ||
|
|
45
44
|
"This app needs your location for turn-by-turn navigation, including in the background.";
|
|
46
45
|
|
|
47
|
-
// iOS: Adds Mapbox Navigation SPM to the Pods project
|
|
48
|
-
//
|
|
46
|
+
// iOS: Adds Mapbox Navigation SPM to the Pods project, sets search paths,
|
|
47
|
+
// and adds a script phase to strip duplicate xcframework signatures.
|
|
49
48
|
config = withMapboxNavPodfile(config, { navigationSdkVersion });
|
|
50
49
|
|
|
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);
|
|
54
|
-
|
|
55
50
|
// Android: Mapbox Maven repository and optional token for SDK download
|
|
56
51
|
config = withMapboxNavGradle(config);
|
|
57
52
|
config = withMapboxNavGradleProperties(config, { mapboxSecretToken });
|
|
@@ -74,6 +74,19 @@ export const withMapboxNavPodfile: ConfigPlugin<PodfileOptions> = (
|
|
|
74
74
|
emn_target.frameworks_build_phases.files << bf
|
|
75
75
|
end
|
|
76
76
|
end
|
|
77
|
+
end
|
|
78
|
+
# Xcode 17 bug: SPM binary xcframeworks sharing transitive deps cause
|
|
79
|
+
# duplicate .signature file copies during archive creation. Strip them.
|
|
80
|
+
user_proj = installer.aggregate_targets.first&.user_project
|
|
81
|
+
if user_proj
|
|
82
|
+
app_target = user_proj.targets.first
|
|
83
|
+
phase_name = 'StripXCFrameworkSignatures'
|
|
84
|
+
unless app_target.shell_script_build_phases.any? { |p| p.name == phase_name }
|
|
85
|
+
phase = app_target.new_shell_script_build_phase(phase_name)
|
|
86
|
+
d = '$'
|
|
87
|
+
phase.shell_script = "DERIVED_ROOT=\\"#{d}{BUILD_DIR%/Build/*}\\"\\nfind \\"#{d}{DERIVED_ROOT}\\" -name \\"*.xcframework-*.signature\\" -delete 2>/dev/null\\nexit 0\\n"
|
|
88
|
+
end
|
|
89
|
+
user_proj.save
|
|
77
90
|
end`;
|
|
78
91
|
|
|
79
92
|
const escapedMarker = PLUGIN_MARKER.replace(
|