Skip to content

Commit 36966f2

Browse files
Migrate to NN 201.0.0
1 parent ad77e78 commit 36966f2

36 files changed

+258
-324
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ allprojects {
6464
// we allow access to snapshots repo if ALLOW_SNAPSHOT_REPOSITORY is set, what means we are running on CI
6565
// with Navigation Native forced to be some snapshot version
6666
// if you need to use snapshots while development, just set `addSnapshotsRepo` to true manually
67-
def addSnapshotsRepo = true//project.hasProperty('ALLOW_SNAPSHOT_REPOSITORY') ? project.property('ALLOW_SNAPSHOT_REPOSITORY') : (System.getenv("ALLOW_SNAPSHOT_REPOSITORY")?.toBoolean() ?: false)
67+
def addSnapshotsRepo = project.hasProperty('ALLOW_SNAPSHOT_REPOSITORY') ? project.property('ALLOW_SNAPSHOT_REPOSITORY') : (System.getenv("ALLOW_SNAPSHOT_REPOSITORY")?.toBoolean() ?: false)
6868
if (addSnapshotsRepo) {
6969
println("Snapshot repository reference added.")
7070
maven {

examples/src/main/java/com/mapbox/navigation/examples/core/AdasisActivity.kt

+13-7
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ import com.mapbox.navigation.base.route.RouterFailure
2929
import com.mapbox.navigation.base.route.RouterOrigin
3030
import com.mapbox.navigation.core.MapboxNavigation
3131
import com.mapbox.navigation.core.MapboxNavigationProvider
32-
import com.mapbox.navigation.core.adasis.AdasisConfig
32+
import com.mapbox.navigation.core.adas.AdasisConfig
33+
import com.mapbox.navigation.core.adas.AdasisDataSendingConfig
34+
import com.mapbox.navigation.core.adas.AdasisMessageBinaryFormat
3335
import com.mapbox.navigation.core.directions.session.RoutesObserver
3436
import com.mapbox.navigation.core.replay.MapboxReplayer
3537
import com.mapbox.navigation.core.replay.ReplayLocationEngine
@@ -121,7 +123,7 @@ class AdasisActivity : AppCompatActivity() {
121123
routeLineView.renderRouteDrawData(mapboxMap.getStyle()!!, this)
122124
}
123125
}
124-
isNavigating = true
126+
isNavigating = result.navigationRoutes.isNotEmpty()
125127
startSimulation(result.navigationRoutes[0].directionsRoute)
126128
}
127129
}
@@ -280,16 +282,20 @@ class AdasisActivity : AppCompatActivity() {
280282
mapboxNavigation.registerRouteProgressObserver(routeProgressObserver)
281283
mapboxNavigation.registerRouteProgressObserver(replayProgressObserver)
282284

283-
mapboxNavigation.setAdasisMessageCallback(
284-
AdasisConfig.Builder().build()
285-
) { messageBuffer, context ->
285+
val dataSendingConfig = AdasisDataSendingConfig.Builder(
286+
AdasisMessageBinaryFormat.FlatBuffers,
287+
).build()
288+
289+
mapboxNavigation.setAdasisMessageObserver(
290+
AdasisConfig.Builder(dataSendingConfig).build()
291+
) { messageBuffer ->
286292
this@AdasisActivity.runOnUiThread {
287293
// TODO decode buffer and print data
288294
adasisMessagesLog += "${numberOfMessages++}: ${messageBuffer.size} bytes\n"
289295
binding.adasisMsgLog.text = adasisMessagesLog
290296
binding.scrollContainer.fullScroll(View.FOCUS_DOWN)
291297

292-
Log.d(TAG, "Adasis message: $messageBuffer, context: $context")
298+
Log.d(TAG, "Adasis message: $messageBuffer")
293299
}
294300
}
295301
}
@@ -302,7 +308,7 @@ class AdasisActivity : AppCompatActivity() {
302308
mapboxNavigation.unregisterLocationObserver(locationObserver)
303309
mapboxNavigation.unregisterRouteProgressObserver(routeProgressObserver)
304310
mapboxNavigation.unregisterRouteProgressObserver(replayProgressObserver)
305-
mapboxNavigation.resetAdasisMessageCallback()
311+
mapboxNavigation.resetAdasisMessageObserver()
306312
}
307313

308314
override fun onDestroy() {

gradle/artifact-settings.gradle

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ ext {
1616
}
1717

1818
def getVersionName() {
19-
// if (project.hasProperty('VERSION_NAME')) {
20-
// return project.property('VERSION_NAME')
21-
// }
22-
// def prefix = project.ext.releaseTagPrefix
23-
// def cmd = ["git", "describe", "--tag", "--match", "$prefix*", "--abbrev=0"]
24-
// def version = cmd.execute().text
25-
return "2.19.0-preview.1-SNAPSHOT"
19+
if (project.hasProperty('VERSION_NAME')) {
20+
return project.property('VERSION_NAME')
21+
}
22+
def prefix = project.ext.releaseTagPrefix
23+
def cmd = ["git", "describe", "--tag", "--match", "$prefix*", "--abbrev=0"]
24+
def version = cmd.execute().text
25+
return project.ext.snapshot ? getSnapshotVersion(version) : getReleaseVersion(version)
2626
}
2727

2828
def getReleaseVersion(String version) {

gradle/dependencies.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ext {
1313
// version which we should use in this build
1414
def mapboxNavigatorVersion = System.getenv("FORCE_MAPBOX_NAVIGATION_NATIVE_VERSION")
1515
if (mapboxNavigatorVersion == null || mapboxNavigatorVersion == '') {
16-
mapboxNavigatorVersion = 'nio-adas-lpo-flatbuffers-vectors-13-SNAPSHOT'
16+
mapboxNavigatorVersion = '201.0.0'
1717
}
1818
println("Navigation Native version: " + mapboxNavigatorVersion)
1919
def androidXWorkManagerVersion = project.hasProperty('WORK_MANAGER_VERSION') ? project.property('WORK_MANAGER_VERSION') : '2.7.0'

0 commit comments

Comments
 (0)