Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
migrate to androidx
  • Loading branch information
martinbonnin committed Oct 13, 2018
commit 5d2bef6150222012dbf91ad09862a007f3142eb2
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.dicedmelon.gradle:jacoco-android:0.1.1"

classpath("com.dicedmelon.gradle:jacoco-android:0.1.2") {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
41 changes: 19 additions & 22 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,23 @@
ext {
//Android
androidMinSdkVersion = 15
androidTargetSdkVersion = 26
androidCompileSdkVersion = 26
androidTargetSdkVersion = 28
androidCompileSdkVersion = 28

//Libraries
kotlinVersion = '1.1.3-2'
rxKotlinVersion = '2.1.0'
rxAndroidVersion = '2.0.1'
kotlinVersion = '1.2.71'
rxKotlinVersion = '2.3.0'
rxAndroidVersion = '2.1.0'
javaxAnnotationVersion = '1.0'
javaxInjectVersion = '1'
gsonVersion = '2.8.1'
okHttpVersion = '3.8.1'
androidAnnotationsVersion = '21.0.3'
retrofitVersion = '2.3.0'
roomVersion = '1.0.0-alpha6'
supportLibraryVersion = '26.0.1'
timberVersion = '4.5.1'
glideVersion = '4.0.0'
daggerVersion = '2.11'
timberVersion = '4.7.1'
glideVersion = '4.8.0'
daggerVersion = '2.16' // As of today, 2.17 does not work. See https://issuetracker.google.com/issues/115738511
glassfishAnnotationVersion = '10.0-b28'

//Testing
Expand All @@ -31,7 +30,7 @@ ext {
espressoVersion = '3.0.0'
testingSupportLibVersion = '0.1'
mockitoKotlinVersion = '1.5.0'
mockitoAndroidVersion = '2.8.47'
mockitoAndroidVersion = '2.8.9' // As of today, 2.23.0 does not work
Copy link

Choose a reason for hiding this comment

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

downgraded library?

androidSupportRunnerVersion = '1.0.0'
androidSupportRulesVersion = '1.0.0'
dexmakerMockitoversion = '2.2.0'
Expand All @@ -41,7 +40,7 @@ ext {
javaxAnnotation: "javax.annotation:jsr250-api:${javaxAnnotationVersion}",
javaxInject: "javax.inject:javax.inject:${javaxInjectVersion}",
rxKotlin: "io.reactivex.rxjava2:rxkotlin:${rxKotlinVersion}",
kotlin: "org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}"
kotlin: "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}"
]

domainTestDependencies = [
Expand All @@ -57,7 +56,7 @@ ext {
okHttpLogger: "com.squareup.okhttp3:logging-interceptor:${okHttpVersion}",
gson: "com.google.code.gson:gson:${gsonVersion}",
rxKotlin: "io.reactivex.rxjava2:rxkotlin:${rxKotlinVersion}",
kotlin: "org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}",
kotlin: "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}",
rxAndroid: "io.reactivex.rxjava2:rxandroid:${rxAndroidVersion}",
javaxAnnotation: "javax.annotation:jsr250-api:${javaxAnnotationVersion}",
javaxInject: "javax.inject:javax.inject:${javaxInjectVersion}",
Expand All @@ -82,7 +81,7 @@ ext {
okHttpLogger: "com.squareup.okhttp3:logging-interceptor:${okHttpVersion}",
gson: "com.google.code.gson:gson:${gsonVersion}",
rxKotlin: "io.reactivex.rxjava2:rxkotlin:${rxKotlinVersion}",
kotlin: "org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}",
kotlin: "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}",
rxAndroid: "io.reactivex.rxjava2:rxandroid:${rxAndroidVersion}",
javaxAnnotation: "javax.annotation:jsr250-api:${javaxAnnotationVersion}",
javaxInject: "javax.inject:javax.inject:${javaxInjectVersion}",
Expand All @@ -105,7 +104,7 @@ ext {
dagger: "com.google.dagger:dagger:${daggerVersion}",
gson: "com.google.code.gson:gson:${gsonVersion}",
rxKotlin: "io.reactivex.rxjava2:rxkotlin:${rxKotlinVersion}",
kotlin: "org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}",
kotlin: "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}",
javaxAnnotation: "javax.annotation:jsr250-api:${javaxAnnotationVersion}",
javaxInject: "javax.inject:javax.inject:${javaxInjectVersion}",
androidAnnotations: "com.android.support:support-annotations:${androidAnnotationsVersion}",
Expand All @@ -131,7 +130,7 @@ ext {
dagger: "com.google.dagger:dagger:${daggerVersion}",
gson: "com.google.code.gson:gson:${gsonVersion}",
rxKotlin: "io.reactivex.rxjava2:rxkotlin:${rxKotlinVersion}",
kotlin: "org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}",
kotlin: "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}",
javaxAnnotation: "javax.annotation:jsr250-api:${javaxAnnotationVersion}",
javaxInject: "javax.inject:javax.inject:${javaxInjectVersion}",
androidAnnotations: "com.android.support:support-annotations:${androidAnnotationsVersion}",
Expand All @@ -157,15 +156,13 @@ ext {
rxKotlin: "io.reactivex.rxjava2:rxkotlin:${rxKotlinVersion}",
rxAndroid: "io.reactivex.rxjava2:rxandroid:${rxAndroidVersion}",
glide: "com.github.bumptech.glide:glide:${glideVersion}",
kotlin: "org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}",
kotlin: "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}",
javaxAnnotation: "javax.annotation:jsr250-api:${javaxAnnotationVersion}",
javaxInject: "javax.inject:javax.inject:${javaxInjectVersion}",
androidAnnotations: "com.android.support:support-annotations:${supportLibraryVersion}",
androidSupportV4: "com.android.support:support-v4:${supportLibraryVersion}",
androidSupportV13: "com.android.support:support-v13:${supportLibraryVersion}",
appCompatV7: "com.android.support:appcompat-v7:${supportLibraryVersion}",
supportRecyclerView:"com.android.support:recyclerview-v7:${supportLibraryVersion}",
supportDesign: "com.android.support:design:${supportLibraryVersion}",
androidAnnotations: "androidx.annotation:annotation:1.0.0",
appCompat: "androidx.appcompat:appcompat:1.0.0",
supportRecyclerView:"androidx.recyclerview:recyclerview:1.0.0",
supportDesign: "com.google.android.material:material:1.0.0-rc01",
Copy link

Choose a reason for hiding this comment

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

I am pretty sure that when you use supportDesign library you don't need to add supportRecyclerView.

timber: "com.jakewharton.timber:timber:${timberVersion}",
daggerSupport: "com.google.dagger:dagger-android-support:${daggerVersion}",
daggerProcessor: "com.google.dagger:dagger-android-processor:${daggerVersion}",
Expand Down
38 changes: 11 additions & 27 deletions mobile-ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ dependencies {
implementation mobileUiDependencies.kotlin
implementation mobileUiDependencies.javaxInject
implementation mobileUiDependencies.rxKotlin
implementation mobileUiDependencies.androidAnnotations
implementation mobileUiDependencies.androidSupportV4
implementation mobileUiDependencies.androidSupportV13
implementation mobileUiDependencies.appCompatV7
implementation mobileUiDependencies.supportRecyclerView
implementation mobileUiDependencies.supportDesign
implementation 'androidx.annotation:annotation:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation mobileUiDependencies.timber
implementation mobileUiDependencies.rxAndroid
implementation mobileUiDependencies.glide
Expand All @@ -99,27 +99,11 @@ dependencies {
androidTestImplementation mobileUiTestDependencies.junit
androidTestImplementation mobileUiTestDependencies.mockito
androidTestImplementation mobileUiTestDependencies.mockitoAndroid
androidTestImplementation (mobileUiTestDependencies.espressoCore) {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation (mobileUiTestDependencies.androidRunner) {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation (mobileUiTestDependencies.androidRules) {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation (mobileUiTestDependencies.espressoIntents) {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation(mobileUiTestDependencies.espressoContrib) {
exclude module: 'appcompat'
exclude module: 'appcompat-v7'
exclude module: 'support-v4'
exclude module: 'support-v13'
exclude module: 'support-annotations'
exclude module: 'recyclerview-v7'
exclude module: 'design'
}
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-beta02'
androidTestImplementation 'androidx.test:runner:1.1.0-beta02'
androidTestImplementation 'androidx.test:rules:1.1.0-beta02'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.0-beta02'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.0-beta02'

kaptTest mobileUiDependencies.daggerCompiler
kaptAndroidTest mobileUiDependencies.daggerCompiler
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.buffer.android.boilerplate.ui.browse

import android.support.test.espresso.Espresso.onView
import android.support.test.espresso.assertion.ViewAssertions.matches
import android.support.test.espresso.contrib.RecyclerViewActions
import android.support.test.espresso.matcher.ViewMatchers.*
import android.support.test.rule.ActivityTestRule
import android.support.test.runner.AndroidJUnit4
import android.support.v7.widget.RecyclerView
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.contrib.RecyclerViewActions
import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.rule.ActivityTestRule
import androidx.test.runner.AndroidJUnit4
import androidx.recyclerview.widget.RecyclerView
import com.nhaarman.mockito_kotlin.whenever
import io.reactivex.Single
import org.buffer.android.boilerplate.domain.model.Bufferoo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.buffer.android.boilerplate.ui.test

import android.app.Activity
import android.app.Application
import android.support.test.InstrumentationRegistry
import androidx.test.InstrumentationRegistry
import dagger.android.AndroidInjector
import dagger.android.DispatchingAndroidInjector
import dagger.android.HasActivityInjector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package org.buffer.android.boilerplate.ui.test
import android.app.Application
import android.content.Context
import android.os.Bundle
import android.support.test.runner.AndroidJUnitRunner
import androidx.test.runner.AndroidJUnitRunner
import io.reactivex.plugins.RxJavaPlugins
import io.reactivex.schedulers.Schedulers

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.buffer.android.boilerplate.ui.test.util

import android.content.res.Resources
import android.support.v7.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView
import android.view.View
import org.hamcrest.Description
import org.hamcrest.Matcher
Expand Down Expand Up @@ -40,10 +40,10 @@ open class RecyclerViewMatcher constructor(var recyclerViewId: Int) {
this.resources = view.resources

if (childView == null) {
val recyclerView = view.rootView.findViewById<RecyclerView>(recyclerViewId)
val recyclerView = view.rootView.findViewById(recyclerViewId)
as RecyclerView
if (recyclerView != null && recyclerView.id == recyclerViewId) {
childView = recyclerView.findViewHolderForAdapterPosition(position).itemView
if (recyclerView.id == recyclerViewId) {
childView = recyclerView.findViewHolderForAdapterPosition(position)?.itemView
} else {
return false
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.buffer.android.boilerplate.ui.browse

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.LinearLayoutManager
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import android.view.View
import dagger.android.AndroidInjection
import kotlinx.android.synthetic.main.activity_browse.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.buffer.android.boilerplate.ui.browse

import android.support.v7.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Expand Down
2 changes: 1 addition & 1 deletion mobile-ui/src/main/res/layout/activity_browse.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_browse"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down