Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,21 @@ publish-to-bintray:
./gradlew :services-geojson:bintrayUpload ; \
./gradlew :services:bintrayUpload ; \
./gradlew :services-turf:bintrayUpload ; \
./gradlew :services-directions-models:bintrayUpload ; \

publish-snapshot:
./gradlew :services-core:artifactoryPublish ; \
./gradlew :services-geojson:artifactoryPublish ; \
./gradlew :services:artifactoryPublish ; \
./gradlew :services-turf:artifactoryPublish ; \
./gradlew :services-directions-models:artifactoryPublish ; \

graphs:
./gradlew :services-core:generateDependencyGraphMapboxLibraries
./gradlew :services-geojson:generateDependencyGraphMapboxLibraries
./gradlew :services:generateDependencyGraphMapboxLibraries
./gradlew :services-turf:generateDependencyGraphMapboxLibraries
./gradlew :services-directions:generateDependencyGraphMapboxLibraries

directions-matrix-fixtures:
# request a symmetric 1x3 matrix for pedestrians
Expand Down
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ allprojects {
jcenter()
// For publishing to Bintray
maven { url 'https://mapbox.bintray.com/mapbox' }
maven { url 'https://oss.jfrog.org/artifactory/oss-snapshot-local/' }
}
}

Expand Down Expand Up @@ -71,6 +72,7 @@ subprojects {
def TESTABLE_MODULES = ["services",
"services-core",
"services-directions",
"services-directions-models",
"services-geocoding",
"services-geojson",
"services-matching",
Expand All @@ -87,7 +89,8 @@ def TESTABLE_MODULES = ["services",
def RELEASE_MODULES = ["services",
"services-core",
"services-geojson",
"services-turf"]
"services-turf",
"services-directions-models"]

subprojects { subproject ->

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Project-wide Gradle settings.
VERSION_NAME=4.10.0-SNAPSHOT
VERSION_NAME=5.1.0-SNAPSHOT

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package com.mapbox.samples;

import com.mapbox.api.directions.v5.DirectionsCriteria;
import com.mapbox.api.directions.v5.MapboxDirections;
import com.mapbox.api.directions.v5.WalkingOptions;
import com.mapbox.api.directions.v5.MapboxDirections;
import com.mapbox.api.directions.v5.models.DirectionsResponse;
import com.mapbox.geojson.Point;
import com.mapbox.sample.BuildConfig;

import java.io.IOException;

import retrofit2.Call;
Expand Down
1 change: 1 addition & 0 deletions services-directions-models/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
16 changes: 16 additions & 0 deletions services-directions-models/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apply plugin: 'java-library'

dependencies {
api project(":services-geojson")

// Annotations
implementation dependenciesList.supportAnnotation

// AutoValue
compileOnly dependenciesList.autoValue
compileOnly dependenciesList.autoValueGson

// Test Dependencies
testImplementation dependenciesList.okhttp3Mockwebserver
testImplementation project(path: ':services-core', configuration: 'testOutput')
}
3 changes: 3 additions & 0 deletions services-directions-models/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_ARTIFACT_ID=mapbox-sdk-directions-models
POM_DESCRIPTION=Mapbox Directions Services Models
POM_PACKAGING=jar
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.SerializedName;
import com.mapbox.api.directions.v5.DirectionsAdapterFactory;
import com.mapbox.api.directions.v5.MapboxDirections;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Expand All @@ -19,8 +18,8 @@
/**
* A part of the {@link BannerText} which includes a snippet of the full banner text instruction. In
* cases where data is available, an image url will be provided to visually include a road shield.
* To receive this information, your request must have {@link MapboxDirections#bannerInstructions()}
* set to true.
* To receive this information, your request must have
* <tt>MapboxDirections.Builder#bannerInstructions()</tt> set to true.
*
* @since 3.0.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.google.auto.value.AutoValue;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.TypeAdapter;
import com.mapbox.api.directions.v5.DirectionsAdapterFactory;
import com.mapbox.api.directions.v5.MapboxDirections;

/**
* Visual instruction information related to a particular {@link LegStep} useful for making UI
* elements inside your application such as banners. To receive this information, your request must
* have {@link MapboxDirections#bannerInstructions()} set to true.
* <tt>MapboxDirections.Builder#bannerInstructions()</tt> have set to true.
*
* @since 3.0.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.SerializedName;
import com.mapbox.api.directions.v5.DirectionsAdapterFactory;
import com.mapbox.api.directions.v5.MapboxDirections;

import java.util.List;

/**
* Includes both plain text information that can be visualized inside your navigation application
* along with the text string broken down into {@link BannerComponents} which may or may not
* include a image url. To receive this information, your request must have
* {@link MapboxDirections#bannerInstructions()} set to true.
* <tt>MapboxDirections.Builder#bannerInstructions()</tt> set to true.
*
* @since 3.0.0
*/
Expand Down Expand Up @@ -56,7 +55,7 @@ public static Builder builder() {
* This indicates the type of maneuver.
*
* @return String with type of maneuver
* @see com.mapbox.api.directions.v5.models.StepManeuver.StepManeuverType
* @see StepManeuver.StepManeuverType
* @since 3.0.0
*/
@Nullable
Expand Down Expand Up @@ -164,7 +163,7 @@ public abstract static class Builder {
*
* @param type String with type of maneuver
* @return this builder for chaining options together
* @see com.mapbox.api.directions.v5.models.StepManeuver.StepManeuverType
* @see StepManeuver.StepManeuverType
* @since 3.0.0
*/
public abstract Builder type(@Nullable @StepManeuver.StepManeuverType String type);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
package com.mapbox.api.directions.v5.models;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.google.auto.value.AutoValue;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.TypeAdapter;
import com.mapbox.api.directions.v5.DirectionsAdapterFactory;
import com.mapbox.api.directions.v5.MapboxDirections;

import java.util.List;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
* Includes both plain text information that can be visualized inside your navigation application
* along with the text string broken down into {@link BannerComponents} which may or may not
* include a image url. To receive this information, your request must have
* {@link MapboxDirections#bannerInstructions()} set to true.
* <tt>MapboxDirections.Builder#bannerInstructions()</tt> set to true.
*
* @since 5.0.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.SerializedName;
import com.mapbox.api.directions.v5.DirectionsAdapterFactory;
import com.mapbox.api.directions.v5.MapboxDirections;
import com.mapbox.geojson.Point;
import com.mapbox.geojson.PointAsCoordinatesTypeAdapter;

Expand Down Expand Up @@ -113,7 +112,7 @@ public static Builder builder() {
/**
* String of the language to be used for voice instructions. Defaults to en, and
* can be any accepted instruction language. Will be <tt>null</tt> when the language provided
* via {@link MapboxDirections#language()} is not compatible with API Voice.
* <tt>MapboxDirections.Builder#language()</tt> via is not compatible with API Voice.
*
* @return String compatible with voice instructions, null otherwise
* @since 3.1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.google.auto.value.AutoValue;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.SerializedName;
import com.mapbox.api.directions.v5.DirectionsAdapterFactory;
import com.mapbox.api.directions.v5.MapboxDirections;

import java.util.List;

Expand Down Expand Up @@ -152,9 +152,9 @@ public static Builder builder() {
public abstract List<VoiceInstructions> voiceInstructions();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AutoValueImmutableFields: AutoValue instances should be deeply immutable. Therefore, we recommend returning ImmutableList instead. Read more at http://goo.gl/qWo9sC

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AutoValueImmutableFields: AutoValue instances should be deeply immutable. Therefore, we recommend returning ImmutableList instead. Read more at http://goo.gl/qWo9sC

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AutoValueImmutableFields: AutoValue instances should be deeply immutable. Therefore, we recommend returning ImmutableList instead. Read more at http://goo.gl/qWo9sC

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AutoValueImmutableFields: AutoValue instances should be deeply immutable. Therefore, we recommend returning ImmutableList instead. Read more at http://goo.gl/qWo9sC

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AutoValueImmutableFields: AutoValue instances should be deeply immutable. Therefore, we recommend returning ImmutableList instead. Read more at http://goo.gl/qWo9sC

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AutoValueImmutableFields: AutoValue instances should be deeply immutable. Therefore, we recommend returning ImmutableList instead. Read more at http://goo.gl/qWo9sC


/**
* If in your request you set {@link MapboxDirections#bannerInstructions()} to true, you'll
* receive a list of {@link BannerInstructions} which encompasses all information necessary for
* creating a visual cue about a given {@link LegStep}.
* If in your request you set <tt>MapboxDirections.Builder#bannerInstructions()</tt> to true,
* you'll receive a list of {@link BannerInstructions} which encompasses all information necessary
* for creating a visual cue about a given {@link LegStep}.
*
* @return a list of {@link BannerInstructions}s which help display visual cues
* inside your application
Expand Down Expand Up @@ -361,9 +361,9 @@ public abstract static class Builder {
public abstract Builder voiceInstructions(@NonNull List<VoiceInstructions> voiceInstructions);

/**
* If in your request you set {@link MapboxDirections#bannerInstructions()} to true, you'll
* receive a list of {@link BannerInstructions} which encompasses all information necessary for
* creating a visual cue about a given {@link LegStep}.
* If in your request you set <tt>MapboxDirections.Builder#bannerInstructions()</tt> to true,
* you'll receive a list of {@link BannerInstructions} which encompasses all information
* necessary for creating a visual cue about a given {@link LegStep}.
*
* @param bannerInstructions a list of {@link BannerInstructions}s which help display visual
* cues inside your application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.google.gson.annotations.SerializedName;
import com.mapbox.api.directions.v5.DirectionsAdapterFactory;
import com.mapbox.api.directions.v5.DirectionsCriteria;
import com.mapbox.api.directions.v5.MapboxDirections;
import com.mapbox.api.directions.v5.WalkingOptions;
import com.mapbox.api.directions.v5.WalkingOptionsAdapterFactory;
import com.mapbox.geojson.Point;
Expand Down Expand Up @@ -67,8 +66,8 @@ public static Builder builder() {

/**
* The same profile which was used during the request that resulted in this root directions
* response. {@link MapboxDirections#builder()} ensures that a profile is always set even if the
* {@link MapboxDirections} requesting object doesn't specifically set a profile.
* response. <tt>MapboxDirections.Builder</tt> ensures that a profile is always set even if the
* <tt>MapboxDirections</tt> requesting object doesn't specifically set a profile.
*
* @return string value representing the profile
* @since 3.0.0
Expand Down Expand Up @@ -242,8 +241,8 @@ public static Builder builder() {

/**
* A universally unique identifier (UUID) for identifying and executing a similar specific route
* in the future. {@link MapboxDirections} always waits for the response object which ensures this
* value will never be null.
* in the future. <tt>MapboxDirections</tt> always waits for the response object which ensures
* this value will never be null.
*
* @return a string containing the request UUID
* @since 3.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.SerializedName;
import com.mapbox.api.directions.v5.DirectionsAdapterFactory;
import com.mapbox.api.directions.v5.MapboxDirections;
import com.mapbox.geojson.Point;

import java.lang.annotation.Retention;
Expand Down Expand Up @@ -145,7 +144,7 @@ public abstract class StepManeuver extends DirectionsJsonObject {
/**
* Indicates the exit maneuver from a rotary.
* Will not appear in results unless you supply true
* to the {@link MapboxDirections#roundaboutExits()} query parameter in the request.
* to the <tt>MapboxDirections.Builder#roundaboutExits()</tt> query parameter in the request.
*
* @since 4.1.0
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* Contains models mapping to Mapbox Directions API.
*/
package com.mapbox.api.directions.v5.models;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Contains classes for accessing the Mapbox Directions API.
*
* @since 1.0.0
*/
package com.mapbox.api.directions.v5;
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
package com.mapbox.api.directions.v5.models;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.mock;

import com.mapbox.core.TestUtils;

import org.junit.Assert;
import org.junit.Test;
import org.mockito.Mockito;

import java.util.Arrays;
import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.mock;

public class BannerInstructionsTest extends TestUtils {

@Test
Expand Down Expand Up @@ -59,6 +57,6 @@ public void testToFromJson() {
String jsonString = bannerInstructions.toJson();
BannerInstructions bannerInstructionsFromJson = BannerInstructions.fromJson(jsonString);

Assert.assertEquals(bannerInstructions, bannerInstructionsFromJson);
assertEquals(bannerInstructions, bannerInstructionsFromJson);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import org.junit.rules.ExpectedException;

import java.io.IOException;
import java.util.Arrays;

public class DirectionsWaypointTest extends TestUtils {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

import org.junit.Test;

import java.util.Arrays;
import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import org.junit.Assert;
import org.junit.Test;

import java.util.Arrays;

public class StepManeuverTest extends TestUtils {

@Test
Expand Down Expand Up @@ -50,7 +48,7 @@ public void testToFromJson2() {
String jsonString = stepManeuver.toJson();
StepManeuver stepManeuverFromJson = StepManeuver.fromJson(jsonString);

Assert.assertEquals(stepManeuver, stepManeuverFromJson);
assertEquals(stepManeuver, stepManeuverFromJson);
}

@Test
Expand Down
Loading