Skip to content

Commit 211876d

Browse files
author
Cameron Mace
committed
added polygon test
1 parent e5e70e2 commit 211876d

File tree

46 files changed

+243
-174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+243
-174
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ build-release:
1111
./gradlew assemble
1212

1313
publish:
14-
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :services:uploadArchives ; \
14+
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :services-core:uploadArchives ; \
1515
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :services-directions:uploadArchives ; \
1616
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :services-geocoding:uploadArchives ; \
1717
export IS_LOCAL_DEVELOPMENT=false; ./gradlew :services-geojson:uploadArchives ; \
@@ -23,7 +23,7 @@ publish:
2323

2424
publish-local:
2525
# This publishes to ~/.m2/repository/com/mapbox/mapboxsdk
26-
export IS_LOCAL_DEVELOPMENT=true; ./gradlew :services:uploadArchives ; \
26+
export IS_LOCAL_DEVELOPMENT=true; ./gradlew :services-core:uploadArchives ; \
2727
export IS_LOCAL_DEVELOPMENT=true; ./gradlew :services-directions:uploadArchives ; \
2828
export IS_LOCAL_DEVELOPMENT=true; ./gradlew :services-geocoding:uploadArchives ; \
2929
export IS_LOCAL_DEVELOPMENT=true; ./gradlew :services-geojson:uploadArchives ; \

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ buildscript {
1515
}
1616
classpath "net.ltgt.gradle:gradle-errorprone-plugin:${pluginVersion.errorprone}"
1717
classpath "gradle.plugin.de.fuerstenau:BuildConfigPlugin:${pluginVersion.buildConfigPlugin}"
18+
classpath 'gradle.plugin.de.fuerstenau:BuildConfigPlugin:1.1.8'
1819
classpath 'com.android.tools.build:gradle:2.3.3'
1920
classpath pluginDependencies.sonarqube
2021
}

gradle/build-config.gradle

Lines changed: 0 additions & 101 deletions
This file was deleted.

samples/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dependencies {
2-
compile project(":services")
2+
compile project(":services-core")
33
compile project(":services-directions")
44
compile project(":services-geocoding")
55
compile project(":services-optimization")

samples/src/main/java/com/mapbox/samples/BasicDirections.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
package com.mapbox.samples;
22

3+
import com.google.gson.Gson;
4+
import com.mapbox.directions.v5.DirectionsCriteria;
35
import com.mapbox.directions.v5.MapboxDirections;
46
import com.mapbox.directions.v5.models.DirectionsResponse;
57
import com.mapbox.geojson.Point;
68
import retrofit2.Call;
79
import retrofit2.Callback;
810
import retrofit2.Response;
911

12+
import java.util.Arrays;
13+
1014
/**
1115
* Shows how to make a request using the minimum required params.
1216
*/
@@ -19,12 +23,15 @@ public static void main(String[] args) {
1923
directions.enqueueCall(new Callback<DirectionsResponse>() {
2024
@Override
2125
public void onResponse(Call<DirectionsResponse> call, Response<DirectionsResponse> response) {
26+
System.out.println(response.body().routes().get(0).legs().get(0).steps().get(0).maneuver().location().latitude());
2227
System.out.println(response.body().routes().get(0).distance());
2328
System.out.println(response.body().routes().get(0).routeOptions().profile());
2429
System.out.println(response.body().routes().get(0).routeOptions().alternatives());
2530
System.out.println(response.body().routes().get(0).routeOptions().user());
31+
System.out.println(response.body().routes().get(0).legs().get(0).steps().get(0).maneuver().toString());
2632
System.out.println(response.body().routes().get(0).legs().get(0).steps().get(0)
2733
.voiceInstructions().get(0).announcement());
34+
System.out.println(response.body().routes().get(0).legs().get(0).annotation().congestion().size());
2835
}
2936

3037
@Override
@@ -40,6 +47,8 @@ private static MapboxDirections buildMapboXDirections() {
4047
.origin(Point.fromLngLat(-71.0555, 42.3612))
4148
.destination(Point.fromLngLat(-71.1014, 42.3411))
4249
.voiceInstructions(true)
50+
.annotations(DirectionsCriteria.ANNOTATION_CONGESTION)
51+
.overview(DirectionsCriteria.OVERVIEW_FULL)
4352
.steps(true)
4453
.build();
4554
}
Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
apply plugin: 'java-library'
2-
apply from: "${rootDir}/gradle/build-config.gradle"
2+
//apply plugin: 'de.fuerstenau.buildconfig'
33

44
configurations {
55
testOutput
66
}
77

8+
//buildConfig {
9+
// packageName = 'com.mapbox.services'
10+
// version = project.VERSION_NAME
11+
// buildConfigField 'String', 'GIT_REVISION', getGitRevision()
12+
//}
13+
//
14+
//static def getGitRevision() {
15+
// def cmd = "git rev-parse --short HEAD"
16+
// def proc = cmd.execute()
17+
// def ref = proc.text.trim()
18+
// return ref
19+
//}
20+
821
dependencies {
922

1023
// Gson
@@ -28,21 +41,6 @@ dependencies {
2841
testOutput sourceSets.test.output
2942
}
3043

31-
buildConfig {
32-
packageName = 'com.mapbox.services'
33-
constants = [
34-
VERSION : project.VERSION_NAME,
35-
GIT_REVISION: getGitRevision(),
36-
]
37-
}
38-
39-
def getGitRevision() {
40-
def cmd = "git rev-parse --short HEAD"
41-
def proc = cmd.execute()
42-
def ref = proc.text.trim()
43-
return ref
44-
}
45-
4644
apply from: "${rootDir}/gradle/checkstyle.gradle"
4745
apply from: "${rootDir}/gradle/jacoco.gradle"
4846
apply from: "${rootDir}/gradle/mvn-push.gradle"
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
VERSION_NAME=3.0.0-SNAPSHOT
2-
POM_ARTIFACT_ID=mapbox-java-services
2+
POM_ARTIFACT_ID=mapbox-java-services-core
33
POM_NAME=Mapbox Java Services
44
POM_DESCRIPTION=Mapbox Java Services
55
POM_PACKAGING=jar

services/src/main/java/com/mapbox/services/MapboxService.java renamed to services-core/src/main/java/com/mapbox/services/MapboxService.java

File renamed without changes.

services/src/main/java/com/mapbox/services/constants/Constants.java renamed to services-core/src/main/java/com/mapbox/services/constants/Constants.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
package com.mapbox.services.constants;
22

3-
import com.mapbox.services.BuildConfig;
4-
5-
import java.util.Locale;
6-
73
/**
84
* Includes common variables used throughout the Mapbox Service modules.
95
*
@@ -20,9 +16,9 @@ private Constants() {
2016
*
2117
* @since 1.0.0
2218
*/
23-
public static final String HEADER_USER_AGENT
24-
= String.format(Locale.US, "MapboxJava/%s (%s)",
25-
BuildConfig.VERSION, BuildConfig.GIT_REVISION);
19+
public static final String HEADER_USER_AGENT = "TODO";
20+
// = String.format(Locale.US, "MapboxJava/%s (%s)",
21+
// BuildConfig.VERSION, BuildConfig.GIT_REVISION);
2622

2723
/**
2824
* Base URL for all API calls, not hardcoded to enable testing.

services/src/main/java/com/mapbox/services/constants/package-info.java renamed to services-core/src/main/java/com/mapbox/services/constants/package-info.java

File renamed without changes.

0 commit comments

Comments
 (0)