Skip to content

Commit 1465dde

Browse files
authored
Fix versioning (mapbox#352)
* centralize all deps in dependencies.gradle * bump stable versions * support rxjava2 * downgrade to 25.1.0 to avoid ci failure * update rxjava tests to version 2
1 parent 54a56b5 commit 1465dde

19 files changed

Lines changed: 131 additions & 94 deletions

File tree

mapbox/app/build.gradle

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,34 +39,34 @@ dependencies {
3939
compile project(':libjava-services-rx')
4040

4141
// Android Support libraries
42-
compile 'com.android.support:appcompat-v7:25.1.0'
43-
compile 'com.android.support:design:25.1.0'
44-
compile "com.android.support:recyclerview-v7:25.1.0"
42+
compile rootProject.ext.dep.supportAppcompat
43+
compile rootProject.ext.dep.supportDesign
44+
compile rootProject.ext.dep.supportRecyclerview
4545

4646
// Mapbox SDK
47-
compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:5.0.0-SNAPSHOT@aar') {
48-
transitive=true
47+
compile(rootProject.ext.dep.mapbox) {
48+
transitive = true
4949
exclude group: 'com.mapbox.mapboxsdk', module: 'mapbox-java-geojson'
5050
exclude group: 'com.mapbox.mapboxsdk', module: 'mapbox-android-telemetry'
5151
}
5252

5353
// Leak Canary
54-
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
55-
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
56-
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
54+
debugCompile rootProject.ext.dep.leakcanaryDebug
55+
releaseCompile rootProject.ext.dep.leakcanaryRelease
56+
testCompile rootProject.ext.dep.leakcanaryTest
5757

5858
// Google Play Services
59-
compile 'com.google.android.gms:play-services-location:10.0.1'
59+
compile rootProject.ext.dep.gmsLocation
6060

6161
// Picasso (Static Image)
62-
compile 'com.squareup.picasso:picasso:2.5.2'
62+
compile rootProject.ext.dep.picasso
6363

6464
// RxAndroid
65-
compile 'io.reactivex:rxandroid:1.1.0'
65+
compile rootProject.ext.dep.rxandroid
6666

6767
// Testing
68-
testCompile 'junit:junit:4.12'
69-
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
68+
testCompile rootProject.ext.dep.junit
69+
androidTestCompile(rootProject.ext.dep.supportEspresso, {
7070
exclude group: 'com.android.support', module: 'support-annotations'
7171
})
7272
}

mapbox/app/src/main/java/com/mapbox/services/android/testapp/directions/DirectionsV5Activity.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
import java.util.List;
3232
import java.util.Locale;
3333

34+
import io.reactivex.android.schedulers.AndroidSchedulers;
35+
import io.reactivex.functions.Consumer;
36+
import io.reactivex.schedulers.Schedulers;
3437
import retrofit2.Call;
3538
import retrofit2.Callback;
3639
import retrofit2.Response;
37-
import rx.android.schedulers.AndroidSchedulers;
38-
import rx.functions.Action1;
39-
import rx.schedulers.Schedulers;
4040

4141
public class DirectionsV5Activity extends AppCompatActivity {
4242

@@ -124,9 +124,9 @@ private void getRoute(Position origin, Position destination) throws ServicesExce
124124
clientRx.getObservable()
125125
.subscribeOn(Schedulers.newThread())
126126
.observeOn(AndroidSchedulers.mainThread())
127-
.subscribe(new Action1<DirectionsResponse>() {
127+
.subscribe(new Consumer<DirectionsResponse>() {
128128
@Override
129-
public void call(DirectionsResponse response) {
129+
public void accept(DirectionsResponse response) throws Exception {
130130
DirectionsRoute currentRoute = response.getRoutes().get(0);
131131
Log.d(LOG_TAG, "Response code: " + response.getCode());
132132
Log.d(LOG_TAG, "Distance: " + currentRoute.getDistance());

mapbox/dependencies.gradle

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,51 @@ ext {
99
buildToolsVersion = "25.0.2"
1010

1111
dep = [
12-
gson: 'com.google.code.gson:gson:2.8.0',
13-
retrofit2Main: 'com.squareup.retrofit2:retrofit:2.1.0',
14-
retrofit2Gson: 'com.squareup.retrofit2:converter-gson:2.1.0',
15-
retrofit2Rx: 'com.squareup.retrofit2:adapter-rxjava:2.1.0',
16-
okhttp3Logging: 'com.squareup.okhttp3:logging-interceptor:3.5.0',
17-
okhttp3Mockwebserver: 'com.squareup.okhttp3:mockwebserver:3.5.0',
18-
junit: 'junit:junit:4.12',
19-
hamcrestJunit: 'org.hamcrest:hamcrest-junit:2.0.0.0'
12+
// Support
13+
supportAppcompat : 'com.android.support:appcompat-v7:25.1.0',
14+
supportCompat : 'com.android.support:support-compat:25.1.0',
15+
supportDesign : 'com.android.support:design:25.1.0',
16+
supportRecyclerview : 'com.android.support:recyclerview-v7:25.1.0',
17+
18+
// mapbox
19+
mapbox : 'com.mapbox.mapboxsdk:mapbox-android-sdk:5.0.0-SNAPSHOT@aar',
20+
21+
// gson
22+
gson : 'com.google.code.gson:gson:2.8.0',
23+
24+
// timber
25+
timber : 'com.jakewharton.timber:timber:4.5.1',
26+
27+
// retrofit
28+
retrofit2Main : 'com.squareup.retrofit2:retrofit:2.2.0',
29+
retrofit2Gson : 'com.squareup.retrofit2:converter-gson:2.2.0',
30+
retrofit2Rx : 'com.squareup.retrofit2:adapter-rxjava2:2.2.0',
31+
32+
// okhttp
33+
okhttp3 : 'com.squareup.okhttp3:okhttp:3.6.0',
34+
okhttp3Logging : 'com.squareup.okhttp3:logging-interceptor:3.6.0',
35+
okhttp3Mockwebserver : 'com.squareup.okhttp3:mockwebserver:3.6.0',
36+
37+
// lost
38+
lost : 'com.mapzen.android:lost:2.1.2',
39+
40+
// play services
41+
gmsLocation : 'com.google.android.gms:play-services-location:10.2.0',
42+
43+
// picasso
44+
picasso : 'com.squareup.picasso:picasso:2.5.2',
45+
46+
// rx android
47+
rxandroid : 'io.reactivex.rxjava2:rxandroid:2.0.1',
48+
49+
// leak canary
50+
leakcanaryDebug : 'com.squareup.leakcanary:leakcanary-android:1.5',
51+
leakcanaryRelease : 'com.squareup.leakcanary:leakcanary-android-no-op:1.5',
52+
leakcanaryTest : 'com.squareup.leakcanary:leakcanary-android-no-op:1.5',
53+
54+
// testing
55+
junit : 'junit:junit:4.12',
56+
hamcrestJunit : 'org.hamcrest:hamcrest-junit:2.0.0.0',
57+
supportEspresso : 'com.android.support.test.espresso:espresso-core:2.2.2'
2058
]
2159
}

mapbox/libandroid-services/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@ dependencies {
3232
compile project(':libandroid-telemetry')
3333

3434
// Android Support libraries
35-
compile 'com.android.support:appcompat-v7:25.1.0'
36-
compile 'com.android.support:support-compat:25.1.0'
35+
compile rootProject.ext.dep.supportAppcompat
36+
compile rootProject.ext.dep.supportCompat
3737

3838
// Timber for logging
39-
compile 'com.jakewharton.timber:timber:4.5.0'
39+
compile rootProject.ext.dep.timber
4040

4141
// LOST
42-
compile 'com.mapzen.android:lost:2.1.2'
42+
compile rootProject.ext.dep.lost
4343

4444
// Testing
45-
testCompile 'junit:junit:4.12'
46-
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
45+
testCompile rootProject.ext.dep.junit
46+
androidTestCompile(rootProject.ext.dep.supportEspresso, {
4747
exclude group: 'com.android.support', module: 'support-annotations'
4848
})
4949
}

mapbox/libandroid-telemetry/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ android {
3131

3232
dependencies {
3333
// Android Support libraries
34-
compile 'com.android.support:appcompat-v7:25.1.0'
34+
compile rootProject.ext.dep.supportAppcompat
3535

3636
// OkHttp for network requests
37-
compile 'com.squareup.okhttp3:okhttp:3.5.0'
37+
compile rootProject.ext.dep.okhttp3
3838

3939
// Testing
40-
testCompile 'junit:junit:4.12'
41-
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
40+
testCompile rootProject.ext.dep.junit
41+
androidTestCompile(rootProject.ext.dep.supportEspresso, {
4242
exclude group: 'com.android.support', module: 'support-annotations'
4343
})
4444
}

mapbox/libandroid-ui/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ dependencies {
3030
compile project(':libandroid-services')
3131

3232
// Android Support libraries
33-
compile 'com.android.support:appcompat-v7:25.1.0'
34-
compile 'com.android.support:design:25.1.0'
33+
compile rootProject.ext.dep.supportAppcompat
34+
compile rootProject.ext.dep.supportDesign
3535

3636
// Testing
37-
testCompile 'junit:junit:4.12'
38-
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
37+
testCompile rootProject.ext.dep.junit
38+
androidTestCompile(rootProject.ext.dep.supportEspresso, {
3939
exclude group: 'com.android.support', module: 'support-annotations'
4040
})
4141
}

mapbox/libjava-core/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies {
1111
buildConfig {
1212
packageName = 'com.mapbox.services'
1313
constants = [
14-
VERSION: rootProject.ext.MasVersionName,
14+
VERSION : rootProject.ext.MasVersionName,
1515
GIT_REVISION: getGitRevision(),
1616
]
1717
}

mapbox/libjava-services-rx/src/main/java/com/mapbox/services/api/rx/directions/v5/DirectionsServiceRx.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
import com.mapbox.services.api.directions.v5.models.DirectionsResponse;
44

5+
import io.reactivex.Observable;
56
import retrofit2.http.GET;
67
import retrofit2.http.Header;
78
import retrofit2.http.Path;
89
import retrofit2.http.Query;
9-
import rx.Observable;
1010

1111
/**
1212
* Interface that defines the directions service (v5).

mapbox/libjava-services-rx/src/main/java/com/mapbox/services/api/rx/directions/v5/MapboxDirectionsRx.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
import com.mapbox.services.api.directions.v5.MapboxDirections;
55
import com.mapbox.services.api.directions.v5.models.DirectionsResponse;
66

7+
import io.reactivex.Observable;
78
import retrofit2.Retrofit;
8-
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
9+
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
910
import retrofit2.converter.gson.GsonConverterFactory;
10-
import rx.Observable;
1111

1212
/**
1313
* The Directions API allows the calculation of routes between coordinates. The fastest route
@@ -37,7 +37,7 @@ private DirectionsServiceRx getServiceRx() {
3737
Retrofit retrofit = new Retrofit.Builder()
3838
.client(getOkHttpClient())
3939
.baseUrl(builder.getBaseUrl())
40-
.addCallAdapterFactory(RxJavaCallAdapterFactory.create())
40+
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
4141
.addConverterFactory(GsonConverterFactory.create())
4242
.build();
4343

mapbox/libjava-services-rx/src/main/java/com/mapbox/services/api/rx/distance/v1/DistanceServiceRx.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
import com.mapbox.services.api.distance.v1.models.DistanceResponse;
44
import com.mapbox.services.commons.geojson.MultiPoint;
55

6+
import io.reactivex.Observable;
67
import okhttp3.RequestBody;
78
import retrofit2.http.Body;
89
import retrofit2.http.Header;
910
import retrofit2.http.POST;
1011
import retrofit2.http.Path;
1112
import retrofit2.http.Query;
12-
import rx.Observable;
1313

1414
/**
1515
* Interface that defines the distance service.

0 commit comments

Comments
 (0)