@baeckerherz/expo-mapbox-navigation 0.1.18 → 0.1.20
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.
|
@@ -24,11 +24,4 @@ Pod::Spec.new do |s|
|
|
|
24
24
|
'SWIFT_COMPILATION_MODE' => 'wholemodule',
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
# Mapbox Navigation SDK v3 is SPM-only. The SPM binary xcframeworks are
|
|
28
|
-
# resolved in the Pods project but the app target must link them because
|
|
29
|
-
# this pod is a static library and cannot link dynamic frameworks itself.
|
|
30
|
-
s.user_target_xcconfig = {
|
|
31
|
-
'OTHER_LDFLAGS' => '$(inherited) -framework "MapboxNavigationNative" -framework "MapboxCommon" -framework "MapboxCoreMaps"',
|
|
32
|
-
'FRAMEWORK_SEARCH_PATHS' => '$(inherited) "$(BUILT_PRODUCTS_DIR)/PackageFrameworks"',
|
|
33
|
-
}
|
|
34
27
|
end
|
package/package.json
CHANGED
package/plugin/build/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
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");
|
|
4
5
|
const withMapboxNavPodfile_1 = require("./withMapboxNavPodfile");
|
|
5
6
|
const withMapboxNavGradle_1 = require("./withMapboxNavGradle");
|
|
6
7
|
const withMapboxNavGradleProperties_1 = require("./withMapboxNavGradleProperties");
|
|
@@ -24,9 +25,13 @@ const withMapboxNavigation = (config, { mapboxAccessToken, mapboxSecretToken, na
|
|
|
24
25
|
config.ios.infoPlist.NSLocationAlwaysAndWhenInUseUsageDescription =
|
|
25
26
|
config.ios.infoPlist.NSLocationAlwaysAndWhenInUseUsageDescription ||
|
|
26
27
|
"This app needs your location for turn-by-turn navigation, including in the background.";
|
|
27
|
-
// iOS:
|
|
28
|
-
//
|
|
29
|
-
//
|
|
28
|
+
// iOS: Add Mapbox Navigation SPM to the app project for linking + embedding.
|
|
29
|
+
// This is the single source of truth for binary xcframework embedding,
|
|
30
|
+
// preventing duplicate signatures during archiving.
|
|
31
|
+
config = (0, withMapboxNavSPM_1.withMapboxNavSPM)(config, { navigationSdkVersion });
|
|
32
|
+
// iOS: Add SPM package ref + product deps (without linking) to the Pods
|
|
33
|
+
// project so ExpoMapboxNavigation compiles after SPM targets are built.
|
|
34
|
+
// Also sets search paths for module visibility.
|
|
30
35
|
config = (0, withMapboxNavPodfile_1.withMapboxNavPodfile)(config, { navigationSdkVersion });
|
|
31
36
|
// Android: Mapbox Maven repository and optional token for SDK download
|
|
32
37
|
config = (0, withMapboxNavGradle_1.withMapboxNavGradle)(config);
|
|
@@ -4,16 +4,14 @@ interface PodfileOptions {
|
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Injects a post_install hook that:
|
|
7
|
-
* 1. Adds Mapbox Navigation SDK as an SPM
|
|
8
|
-
*
|
|
7
|
+
* 1. Adds Mapbox Navigation SDK as an SPM package reference in the Pods project
|
|
8
|
+
* with product dependencies on ExpoMapboxNavigation (for build ordering and
|
|
9
|
+
* module visibility) but WITHOUT PBXBuildFile entries — linking and embedding
|
|
10
|
+
* is handled by withMapboxNavSPM in the app project to avoid duplicate
|
|
11
|
+
* xcframework signatures during archiving.
|
|
9
12
|
* 2. Sets FRAMEWORK_SEARCH_PATHS / SWIFT_INCLUDE_PATHS so the pod can find
|
|
10
13
|
* SPM-built frameworks (including transitive deps like MapboxDirections).
|
|
11
14
|
* 3. Enables BUILD_LIBRARY_FOR_DISTRIBUTION on Mapbox/Turf targets.
|
|
12
|
-
*
|
|
13
|
-
* CocoaPods writes the Pods project to disk after post_install returns, so
|
|
14
|
-
* all in-memory modifications are persisted automatically — no explicit
|
|
15
|
-
* project.save or xcodebuild call needed. xcodebuild resolves SPM packages
|
|
16
|
-
* as part of its normal build, which works on both local and EAS clean builds.
|
|
17
15
|
*/
|
|
18
16
|
export declare const withMapboxNavPodfile: ConfigPlugin<PodfileOptions>;
|
|
19
17
|
export {};
|
|
@@ -45,16 +45,14 @@ const MAPBOX_NAV_PRODUCTS = [
|
|
|
45
45
|
const PLUGIN_MARKER = "# @baeckerherz/expo-mapbox-navigation:";
|
|
46
46
|
/**
|
|
47
47
|
* Injects a post_install hook that:
|
|
48
|
-
* 1. Adds Mapbox Navigation SDK as an SPM
|
|
49
|
-
*
|
|
48
|
+
* 1. Adds Mapbox Navigation SDK as an SPM package reference in the Pods project
|
|
49
|
+
* with product dependencies on ExpoMapboxNavigation (for build ordering and
|
|
50
|
+
* module visibility) but WITHOUT PBXBuildFile entries — linking and embedding
|
|
51
|
+
* is handled by withMapboxNavSPM in the app project to avoid duplicate
|
|
52
|
+
* xcframework signatures during archiving.
|
|
50
53
|
* 2. Sets FRAMEWORK_SEARCH_PATHS / SWIFT_INCLUDE_PATHS so the pod can find
|
|
51
54
|
* SPM-built frameworks (including transitive deps like MapboxDirections).
|
|
52
55
|
* 3. Enables BUILD_LIBRARY_FOR_DISTRIBUTION on Mapbox/Turf targets.
|
|
53
|
-
*
|
|
54
|
-
* CocoaPods writes the Pods project to disk after post_install returns, so
|
|
55
|
-
* all in-memory modifications are persisted automatically — no explicit
|
|
56
|
-
* project.save or xcodebuild call needed. xcodebuild resolves SPM packages
|
|
57
|
-
* as part of its normal build, which works on both local and EAS clean builds.
|
|
58
56
|
*/
|
|
59
57
|
const withMapboxNavPodfile = (config, { navigationSdkVersion }) => {
|
|
60
58
|
return (0, config_plugins_1.withDangerousMod)(config, [
|
|
@@ -64,7 +62,7 @@ const withMapboxNavPodfile = (config, { navigationSdkVersion }) => {
|
|
|
64
62
|
let contents = fs.readFileSync(podfilePath, "utf8");
|
|
65
63
|
const versionEscaped = navigationSdkVersion.replace(/'/g, "\\\\'");
|
|
66
64
|
const hook = `
|
|
67
|
-
${PLUGIN_MARKER} SPM in Pods + search paths + BUILD_LIBRARY_FOR_DISTRIBUTION
|
|
65
|
+
${PLUGIN_MARKER} SPM in Pods (deps only) + search paths + BUILD_LIBRARY_FOR_DISTRIBUTION
|
|
68
66
|
mapbox_nav_version = '${versionEscaped}'
|
|
69
67
|
installer.pods_project.targets.each do |target|
|
|
70
68
|
if target.name.start_with?('Mapbox') || target.name == 'Turf'
|
|
@@ -100,11 +98,6 @@ const withMapboxNavPodfile = (config, { navigationSdkVersion }) => {
|
|
|
100
98
|
dep.package = pkg_ref
|
|
101
99
|
dep.product_name = '${name}'
|
|
102
100
|
emn_target.package_product_dependencies << dep
|
|
103
|
-
if emn_target.frameworks_build_phases
|
|
104
|
-
bf = project.new(Xcodeproj::Project::Object::PBXBuildFile)
|
|
105
|
-
bf.product_ref = dep
|
|
106
|
-
emn_target.frameworks_build_phases.files << bf
|
|
107
|
-
end
|
|
108
101
|
end`).join("")}
|
|
109
102
|
end`;
|
|
110
103
|
const escapedMarker = PLUGIN_MARKER.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
package/plugin/src/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ConfigPlugin, createRunOncePlugin } from "@expo/config-plugins";
|
|
2
|
+
import { withMapboxNavSPM } from "./withMapboxNavSPM";
|
|
2
3
|
import { withMapboxNavPodfile } from "./withMapboxNavPodfile";
|
|
3
4
|
import { withMapboxNavGradle } from "./withMapboxNavGradle";
|
|
4
5
|
import { withMapboxNavGradleProperties } from "./withMapboxNavGradleProperties";
|
|
@@ -43,9 +44,14 @@ const withMapboxNavigation: ConfigPlugin<PluginConfig> = (
|
|
|
43
44
|
config.ios.infoPlist.NSLocationAlwaysAndWhenInUseUsageDescription ||
|
|
44
45
|
"This app needs your location for turn-by-turn navigation, including in the background.";
|
|
45
46
|
|
|
46
|
-
// iOS:
|
|
47
|
-
//
|
|
48
|
-
//
|
|
47
|
+
// iOS: Add Mapbox Navigation SPM to the app project for linking + embedding.
|
|
48
|
+
// This is the single source of truth for binary xcframework embedding,
|
|
49
|
+
// preventing duplicate signatures during archiving.
|
|
50
|
+
config = withMapboxNavSPM(config, { navigationSdkVersion });
|
|
51
|
+
|
|
52
|
+
// iOS: Add SPM package ref + product deps (without linking) to the Pods
|
|
53
|
+
// project so ExpoMapboxNavigation compiles after SPM targets are built.
|
|
54
|
+
// Also sets search paths for module visibility.
|
|
49
55
|
config = withMapboxNavPodfile(config, { navigationSdkVersion });
|
|
50
56
|
|
|
51
57
|
// Android: Mapbox Maven repository and optional token for SDK download
|
|
@@ -16,16 +16,14 @@ interface PodfileOptions {
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Injects a post_install hook that:
|
|
19
|
-
* 1. Adds Mapbox Navigation SDK as an SPM
|
|
20
|
-
*
|
|
19
|
+
* 1. Adds Mapbox Navigation SDK as an SPM package reference in the Pods project
|
|
20
|
+
* with product dependencies on ExpoMapboxNavigation (for build ordering and
|
|
21
|
+
* module visibility) but WITHOUT PBXBuildFile entries — linking and embedding
|
|
22
|
+
* is handled by withMapboxNavSPM in the app project to avoid duplicate
|
|
23
|
+
* xcframework signatures during archiving.
|
|
21
24
|
* 2. Sets FRAMEWORK_SEARCH_PATHS / SWIFT_INCLUDE_PATHS so the pod can find
|
|
22
25
|
* SPM-built frameworks (including transitive deps like MapboxDirections).
|
|
23
26
|
* 3. Enables BUILD_LIBRARY_FOR_DISTRIBUTION on Mapbox/Turf targets.
|
|
24
|
-
*
|
|
25
|
-
* CocoaPods writes the Pods project to disk after post_install returns, so
|
|
26
|
-
* all in-memory modifications are persisted automatically — no explicit
|
|
27
|
-
* project.save or xcodebuild call needed. xcodebuild resolves SPM packages
|
|
28
|
-
* as part of its normal build, which works on both local and EAS clean builds.
|
|
29
27
|
*/
|
|
30
28
|
export const withMapboxNavPodfile: ConfigPlugin<PodfileOptions> = (
|
|
31
29
|
config,
|
|
@@ -43,7 +41,7 @@ export const withMapboxNavPodfile: ConfigPlugin<PodfileOptions> = (
|
|
|
43
41
|
const versionEscaped = navigationSdkVersion.replace(/'/g, "\\\\'");
|
|
44
42
|
|
|
45
43
|
const hook = `
|
|
46
|
-
${PLUGIN_MARKER} SPM in Pods + search paths + BUILD_LIBRARY_FOR_DISTRIBUTION
|
|
44
|
+
${PLUGIN_MARKER} SPM in Pods (deps only) + search paths + BUILD_LIBRARY_FOR_DISTRIBUTION
|
|
47
45
|
mapbox_nav_version = '${versionEscaped}'
|
|
48
46
|
installer.pods_project.targets.each do |target|
|
|
49
47
|
if target.name.start_with?('Mapbox') || target.name == 'Turf'
|
|
@@ -80,11 +78,6 @@ export const withMapboxNavPodfile: ConfigPlugin<PodfileOptions> = (
|
|
|
80
78
|
dep.package = pkg_ref
|
|
81
79
|
dep.product_name = '${name}'
|
|
82
80
|
emn_target.package_product_dependencies << dep
|
|
83
|
-
if emn_target.frameworks_build_phases
|
|
84
|
-
bf = project.new(Xcodeproj::Project::Object::PBXBuildFile)
|
|
85
|
-
bf.product_ref = dep
|
|
86
|
-
emn_target.frameworks_build_phases.files << bf
|
|
87
|
-
end
|
|
88
81
|
end`
|
|
89
82
|
).join("")}
|
|
90
83
|
end`;
|