@baeckerherz/expo-mapbox-navigation 1.0.0 → 1.0.2

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baeckerherz/expo-mapbox-navigation",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Expo module wrapping Mapbox Navigation SDK v3 for iOS and Android",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -2,5 +2,7 @@ import { ConfigPlugin } from "@expo/config-plugins";
2
2
  /**
3
3
  * Adds the authenticated Mapbox Maven repository to the Android
4
4
  * project's root build.gradle for Navigation SDK v3 downloads.
5
+ * Must be Groovy syntax (Expo's root build.gradle is Groovy, not Kotlin DSL).
6
+ * See: https://docs.mapbox.com/android/navigation/build-with-nav-sdk/installation/
5
7
  */
6
8
  export declare const withMapboxNavGradle: ConfigPlugin;
@@ -5,6 +5,8 @@ const config_plugins_1 = require("@expo/config-plugins");
5
5
  /**
6
6
  * Adds the authenticated Mapbox Maven repository to the Android
7
7
  * project's root build.gradle for Navigation SDK v3 downloads.
8
+ * Must be Groovy syntax (Expo's root build.gradle is Groovy, not Kotlin DSL).
9
+ * See: https://docs.mapbox.com/android/navigation/build-with-nav-sdk/installation/
8
10
  */
9
11
  const withMapboxNavGradle = (config) => {
10
12
  return (0, config_plugins_1.withProjectBuildGradle)(config, (config) => {
@@ -15,11 +17,11 @@ const withMapboxNavGradle = (config) => {
15
17
  maven {
16
18
  url = uri("https://api.mapbox.com/downloads/v2/releases/maven")
17
19
  authentication {
18
- create<BasicAuthentication>("basic")
20
+ basic(BasicAuthentication)
19
21
  }
20
22
  credentials {
21
23
  username = "mapbox"
22
- password = providers.gradleProperty("MAPBOX_DOWNLOADS_TOKEN").getOrElse("")
24
+ password = project.findProperty("MAPBOX_DOWNLOADS_TOKEN") ?: System.getenv("MAPBOX_DOWNLOADS_TOKEN") ?: ""
23
25
  }
24
26
  }`;
25
27
  contents = contents.replace(/allprojects\s*\{\s*repositories\s*\{/, `allprojects {\n repositories {${mapboxMaven}`);
@@ -96,17 +96,28 @@ const withMapboxNavPodfile = (config, { navigationSdkVersion }) => {
96
96
  end
97
97
  end
98
98
  end
99
- # Xcode 17 bug: SPM binary xcframeworks sharing transitive deps cause
100
- # duplicate .signature file copies during archive creation. Strip them.
99
+ # SPM binary xcframeworks are linked via OTHER_LDFLAGS but not embedded
100
+ # because the SPM product deps are on the pod target (static lib), not
101
+ # the app target. We add script phases to embed them and strip duplicate
102
+ # signatures (Xcode 17 bug).
101
103
  user_proj = installer.aggregate_targets.first&.user_project
102
104
  if user_proj
103
105
  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 = '$'
106
+ d = '$'
107
+ mapbox_fws = %w[MapboxCommon MapboxCoreMaps MapboxNavigationNative]
108
+
109
+ embed_name = 'EmbedMapboxFrameworks'
110
+ unless app_target.shell_script_build_phases.any? { |p| p.name == embed_name }
111
+ phase = app_target.new_shell_script_build_phase(embed_name)
112
+ phase.shell_script = "FRAMEWORKS_DIR=\\"#{d}{BUILT_PRODUCTS_DIR}/#{d}{FRAMEWORKS_FOLDER_PATH}\\"\\nmkdir -p \\"#{d}{FRAMEWORKS_DIR}\\"\\nfor fw in #{mapbox_fws.join(' ')}; do\\n SRC=\\"#{d}{BUILT_PRODUCTS_DIR}/#{d}{fw}.framework\\"\\n if [ -d \\"#{d}{SRC}\\" ]; then\\n cp -R \\"#{d}{SRC}\\" \\"#{d}{FRAMEWORKS_DIR}/\\"\\n codesign --force --sign \\"#{d}{EXPANDED_CODE_SIGN_IDENTITY}\\" \\"#{d}{FRAMEWORKS_DIR}/#{d}{fw}.framework\\"\\n fi\\ndone\\n"
113
+ end
114
+
115
+ strip_name = 'StripXCFrameworkSignatures'
116
+ unless app_target.shell_script_build_phases.any? { |p| p.name == strip_name }
117
+ phase = app_target.new_shell_script_build_phase(strip_name)
108
118
  phase.shell_script = "DERIVED_ROOT=\\"#{d}{BUILD_DIR%/Build/*}\\"\\nfind \\"#{d}{DERIVED_ROOT}\\" -name \\"*.xcframework-*.signature\\" -delete 2>/dev/null\\nexit 0\\n"
109
119
  end
120
+
110
121
  user_proj.save
111
122
  end`;
112
123
  const escapedMarker = PLUGIN_MARKER.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -3,6 +3,8 @@ import { withProjectBuildGradle, ConfigPlugin } from "@expo/config-plugins";
3
3
  /**
4
4
  * Adds the authenticated Mapbox Maven repository to the Android
5
5
  * project's root build.gradle for Navigation SDK v3 downloads.
6
+ * Must be Groovy syntax (Expo's root build.gradle is Groovy, not Kotlin DSL).
7
+ * See: https://docs.mapbox.com/android/navigation/build-with-nav-sdk/installation/
6
8
  */
7
9
  export const withMapboxNavGradle: ConfigPlugin = (config) => {
8
10
  return withProjectBuildGradle(config, (config) => {
@@ -14,11 +16,11 @@ export const withMapboxNavGradle: ConfigPlugin = (config) => {
14
16
  maven {
15
17
  url = uri("https://api.mapbox.com/downloads/v2/releases/maven")
16
18
  authentication {
17
- create<BasicAuthentication>("basic")
19
+ basic(BasicAuthentication)
18
20
  }
19
21
  credentials {
20
22
  username = "mapbox"
21
- password = providers.gradleProperty("MAPBOX_DOWNLOADS_TOKEN").getOrElse("")
23
+ password = project.findProperty("MAPBOX_DOWNLOADS_TOKEN") ?: System.getenv("MAPBOX_DOWNLOADS_TOKEN") ?: ""
22
24
  }
23
25
  }`;
24
26
 
@@ -75,17 +75,28 @@ export const withMapboxNavPodfile: ConfigPlugin<PodfileOptions> = (
75
75
  end
76
76
  end
77
77
  end
78
- # Xcode 17 bug: SPM binary xcframeworks sharing transitive deps cause
79
- # duplicate .signature file copies during archive creation. Strip them.
78
+ # SPM binary xcframeworks are linked via OTHER_LDFLAGS but not embedded
79
+ # because the SPM product deps are on the pod target (static lib), not
80
+ # the app target. We add script phases to embed them and strip duplicate
81
+ # signatures (Xcode 17 bug).
80
82
  user_proj = installer.aggregate_targets.first&.user_project
81
83
  if user_proj
82
84
  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 = '$'
85
+ d = '$'
86
+ mapbox_fws = %w[MapboxCommon MapboxCoreMaps MapboxNavigationNative]
87
+
88
+ embed_name = 'EmbedMapboxFrameworks'
89
+ unless app_target.shell_script_build_phases.any? { |p| p.name == embed_name }
90
+ phase = app_target.new_shell_script_build_phase(embed_name)
91
+ phase.shell_script = "FRAMEWORKS_DIR=\\"#{d}{BUILT_PRODUCTS_DIR}/#{d}{FRAMEWORKS_FOLDER_PATH}\\"\\nmkdir -p \\"#{d}{FRAMEWORKS_DIR}\\"\\nfor fw in #{mapbox_fws.join(' ')}; do\\n SRC=\\"#{d}{BUILT_PRODUCTS_DIR}/#{d}{fw}.framework\\"\\n if [ -d \\"#{d}{SRC}\\" ]; then\\n cp -R \\"#{d}{SRC}\\" \\"#{d}{FRAMEWORKS_DIR}/\\"\\n codesign --force --sign \\"#{d}{EXPANDED_CODE_SIGN_IDENTITY}\\" \\"#{d}{FRAMEWORKS_DIR}/#{d}{fw}.framework\\"\\n fi\\ndone\\n"
92
+ end
93
+
94
+ strip_name = 'StripXCFrameworkSignatures'
95
+ unless app_target.shell_script_build_phases.any? { |p| p.name == strip_name }
96
+ phase = app_target.new_shell_script_build_phase(strip_name)
87
97
  phase.shell_script = "DERIVED_ROOT=\\"#{d}{BUILD_DIR%/Build/*}\\"\\nfind \\"#{d}{DERIVED_ROOT}\\" -name \\"*.xcframework-*.signature\\" -delete 2>/dev/null\\nexit 0\\n"
88
98
  end
99
+
89
100
  user_proj.save
90
101
  end`;
91
102