Skip to content

Commit db040e6

Browse files
authored
Update dependencies, migrate to androidx and room (#175)
1 parent b9bf31f commit db040e6

File tree

208 files changed

+591
-757
lines changed

Some content is hidden

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

208 files changed

+591
-757
lines changed

Diff for: .travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jdk:
1010
android:
1111
components:
1212
- tools
13-
- android-27
14-
- build-tools-27.0.3
13+
- android-28
14+
- build-tools-28.0.3
1515
- platform-tools
1616
- extra-google-google_play_services
1717
- extra-google-m2repository
@@ -24,4 +24,4 @@ cache:
2424
directories:
2525
- $HOME/.gradle/caches/
2626
- $HOME/.gradle/wrapper/
27-
script: ./gradlew assembleDebug checkstyle lintDebug lintKotlin checkDebug
27+
script: ./gradlew assembleDebug checkstyle lintDebug lintKotlin check

Diff for: build.gradle

+6-7
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ buildscript {
77
google()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.1.1'
11-
classpath 'io.fabric.tools:gradle:1.25.2'
12-
classpath 'com.squareup.sqldelight:gradle-plugin:0.6.1'
13-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.31"
10+
classpath 'com.android.tools.build:gradle:3.5.0-alpha13'
11+
classpath 'io.fabric.tools:gradle:1.28.1'
12+
classpath 'com.squareup.sqldelight:gradle-plugin:1.1.3'
13+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.31"
1414
}
1515
}
1616

1717
plugins {
18-
id 'com.github.ben-manes.versions' version '0.17.0'
18+
id 'com.github.ben-manes.versions' version '0.21.0'
1919
}
2020

2121
allprojects {
@@ -55,7 +55,6 @@ subprojects {
5555
if (project.hasProperty("android")) {
5656
android {
5757
compileSdkVersion vers.compileSdkVersion
58-
buildToolsVersion vers.buildToolsVersion
5958

6059
defaultConfig {
6160
minSdkVersion vers.minSdkVersion
@@ -98,7 +97,7 @@ configurations {
9897
}
9998

10099
dependencies {
101-
ktlint 'com.github.shyiko:ktlint:0.21.0'
100+
ktlint 'com.github.shyiko:ktlint:0.31.0'
102101
}
103102

104103
task lintKotlin(type: JavaExec) {

Diff for: dependencies.gradle

+24-23
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
ext {
22
vers = [
3-
compileSdkVersion: 27,
4-
targetSdkVersion: 27,
5-
minSdkVersion: 21,
6-
buildToolsVersion: '27.0.3'
3+
compileSdkVersion: 28,
4+
targetSdkVersion: 28,
5+
minSdkVersion: 21
76
]
87

98
def autoDisposeVersion = '0.7.0'
10-
def autoValueVersion = '1.6'
11-
def autoValueGsonVersion = '0.7.0'
12-
def daggerVersion = '2.15'
13-
def groupieVersion = '2.0.3'
14-
def kotlinVersion = '1.2.31'
15-
def magellanVersion = '1.0.0'
16-
def supportVersion = '27.1.1'
9+
def autoValueGsonVersion = '0.8.0'
10+
def autoValueVersion = '1.6.5'
11+
def daggerVersion = '2.22.1'
12+
def groupieVersion = '2.3.0'
13+
def kotlinVersion = '1.3.31'
14+
def magellanVersion = '1.1.0'
15+
def roomVersion = '2.1.0-alpha07'
1716

1817
libs = [
1918
autoDispose: "com.uber.autodispose:autodispose:${autoDisposeVersion}",
@@ -24,23 +23,25 @@ ext {
2423
autoValueAnnotations: "com.google.auto.value:auto-value-annotations:${autoValueVersion}",
2524
autoValueGson: "com.ryanharter.auto.value:auto-value-gson:${autoValueGsonVersion}",
2625
autoValueGsonAnnotations: "com.ryanharter.auto.value:auto-value-gson-annotations:${autoValueGsonVersion}",
27-
checkstyle: 'com.puppycrawl.tools:checkstyle:8.9',
28-
crashlytics: 'com.crashlytics.sdk.android:crashlytics:2.9.1',
26+
checkstyle: 'com.puppycrawl.tools:checkstyle:8.19',
27+
crashlytics: 'com.crashlytics.sdk.android:crashlytics:2.9.9',
2928
dagger: "com.google.dagger:dagger:${daggerVersion}",
3029
daggerCompiler: "com.google.dagger:dagger-compiler:${daggerVersion}",
3130
groupie: "com.xwray:groupie:${groupieVersion}",
3231
groupieDatabinding: "com.xwray:groupie-databinding:${groupieVersion}",
33-
gson: 'com.google.code.gson:gson:2.8.2',
34-
guava: 'com.google.guava:guava:24.1-android',
35-
kotlinStdlib: "org.jetbrains.kotlin:kotlin-stdlib-jre7:${kotlinVersion}",
32+
gson: 'com.google.code.gson:gson:2.8.5',
33+
guava: 'com.google.guava:guava:27.1-android',
34+
kotlinStdlib: "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${kotlinVersion}",
3635
magellan: "com.wealthfront:magellan:${magellanVersion}",
37-
playServicesMaps: 'com.google.android.gms:play-services-maps:15.0.0',
36+
playServicesMaps: 'com.google.android.gms:play-services-maps:16.1.0',
37+
roomRuntime: "androidx.room:room-runtime:${roomVersion}",
38+
roomCompiler: "androidx.room:room-compiler:${roomVersion}",
3839
rxBroadcast: 'com.cantrowitz:rxbroadcast:2.0.0',
39-
rxJava2: 'io.reactivex.rxjava2:rxjava:2.1.12',
40-
rxRelay2: 'com.jakewharton.rxrelay2:rxrelay:2.0.0',
41-
supportDesign: "com.android.support:design:${supportVersion}",
42-
supportV4: "com.android.support:support-v4:${supportVersion}",
43-
supportV7CardView: "com.android.support:cardview-v7:${supportVersion}",
44-
supportV7RecyclerView: "com.android.support:recyclerview-v7:${supportVersion}"
40+
rxJava2: 'io.reactivex.rxjava2:rxjava:2.2.8',
41+
rxRelay2: 'com.jakewharton.rxrelay2:rxrelay:2.1.0',
42+
supportDesign: "com.google.android.material:material:1.0.0-rc01",
43+
supportV4: "androidx.legacy:legacy-support-v4:1.0.0",
44+
supportV7CardView: "androidx.cardview:cardview:1.0.0",
45+
supportV7RecyclerView: "androidx.recyclerview:recyclerview:1.0.0"
4546
]
4647
}

Diff for: farebot-app-persist/build.gradle

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
apply plugin: 'com.android.library'
2-
apply plugin: 'com.squareup.sqldelight'
2+
apply plugin: 'kotlin-android'
3+
apply plugin: 'kotlin-kapt'
34

45
dependencies {
56
implementation libs.supportV4
67
implementation libs.guava
78
implementation libs.gson
9+
implementation libs.kotlinStdlib
810

9-
implementation project(path: ':farebot-card')
10-
11-
compileOnly libs.autoValueAnnotations
12-
compileOnly libs.autoValueGsonAnnotations
11+
api libs.roomRuntime
12+
kapt libs.roomCompiler
1313

14-
annotationProcessor libs.autoValueAnnotations
15-
annotationProcessor libs.autoValueGsonAnnotations
16-
17-
annotationProcessor libs.autoValue
18-
annotationProcessor libs.autoValueGson
14+
implementation project(path: ':farebot-card')
1915
}
2016

2117
android { }

Diff for: farebot-app-persist/src/main/java/com/codebutler/farebot/persist/CardKeysPersister.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.codebutler.farebot.persist;
22

3-
import android.support.annotation.NonNull;
4-
import android.support.annotation.Nullable;
3+
import androidx.annotation.NonNull;
4+
import androidx.annotation.Nullable;
55

66
import com.codebutler.farebot.persist.db.model.SavedKey;
77

Diff for: farebot-app-persist/src/main/java/com/codebutler/farebot/persist/CardPersister.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323
package com.codebutler.farebot.persist;
2424

25-
import android.support.annotation.NonNull;
26-
import android.support.annotation.Nullable;
25+
import androidx.annotation.NonNull;
26+
import androidx.annotation.Nullable;
2727

2828
import com.codebutler.farebot.persist.db.model.SavedCard;
2929

Diff for: farebot-app-persist/src/main/java/com/codebutler/farebot/persist/db/Adapters.java

-41
This file was deleted.

Diff for: farebot-app-persist/src/main/java/com/codebutler/farebot/persist/db/DbCardKeysPersister.java

-72
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.codebutler.farebot.persist.db
2+
3+
import com.codebutler.farebot.persist.CardKeysPersister
4+
import com.codebutler.farebot.persist.db.model.SavedKey
5+
6+
class DbCardKeysPersister(private val db: FareBotDb) : CardKeysPersister {
7+
override fun getSavedKeys(): List<SavedKey> = db.savedKeyDao().selectAll()
8+
override fun getForTagId(tagId: String): SavedKey? = db.savedKeyDao().selectByCardId(tagId)
9+
override fun insert(savedKey: SavedKey): Long = db.savedKeyDao().insert(savedKey)
10+
override fun delete(savedKey: SavedKey) = db.savedKeyDao().delete(savedKey)
11+
}

Diff for: farebot-app-persist/src/main/java/com/codebutler/farebot/persist/db/DbCardPersister.java

-73
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.codebutler.farebot.persist.db
2+
3+
import com.codebutler.farebot.persist.CardPersister
4+
import com.codebutler.farebot.persist.db.model.SavedCard
5+
6+
class DbCardPersister(private val db: FareBotDb) : CardPersister {
7+
override fun getCards(): List<SavedCard> = db.savedCardDao().selectAll()
8+
override fun getCard(id: Long): SavedCard? = db.savedCardDao().selectById(id)
9+
override fun insertCard(savedCard: SavedCard): Long = db.savedCardDao().insert(savedCard)
10+
override fun deleteCard(savedCard: SavedCard) = db.savedCardDao().delete(savedCard)
11+
}

0 commit comments

Comments
 (0)