Skip to content
Closed
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: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*iml
*.iml
*/build
gradle.properties
*.apk
*.ap_
*.dex
Expand All @@ -23,4 +22,4 @@ ks.properties
.project
lint.xml
/dist
*.iml
*.iml
16 changes: 3 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ jdk:

env:
global:
- ANDROID_API_LEVEL=26
- ANDROID_API_LEVEL=28
- EMULATOR_API_LEVEL=22
- ANDROID_BUILD_TOOLS_VERSION=26.0.0
- ANDROID_BUILD_TOOLS_VERSION=28.0.3
- ANDROID_ABI=armeabi-v7a
- ANDROID_TAG=google_apis
- ANDROID_TARGET=android-$ANDROID_API_LEVEL
Expand All @@ -16,19 +16,9 @@ env:
android:
components:
- tools
- platform-tools
- android-$EMULATOR_API_LEVEL
- build-tools-$ANDROID_BUILD_TOOLS_VERSION
- android-$ANDROID_API_LEVEL
# For Google APIs
- addon-google_apis-google-$ANDROID_API_LEVEL
# Google Play Services
- extra-google-google_play_services
# Support library
- extra-android-support
# Latest artifacts in local repository
- extra-google-m2repository
- extra-android-m2repository
# Specify at least one system image
- sys-img-armeabi-v7a-android-$EMULATOR_API_LEVEL

Expand All @@ -39,7 +29,7 @@ before_script:
- adb shell input keyevent 82 &

script:
- ./gradlew build
- ./gradlew build --stacktrace
- ./gradlew build connectedAndroidTest --stacktrace

after_success:
Expand Down
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.1.3-2'
ext.kotlin_version = '1.2.71'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta2'
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
2 changes: 1 addition & 1 deletion cache/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ android {
def globalConfiguration = rootProject.extensions.getByName("ext")

compileSdkVersion globalConfiguration["androidCompileSdkVersion"]
buildToolsVersion globalConfiguration["androidBuildToolsVersion"]

defaultConfig {
minSdkVersion globalConfiguration["androidMinSdkVersion"]
Expand Down Expand Up @@ -60,6 +59,7 @@ dependencies {
testImplementation cacheTestDependencies.junit
testImplementation cacheTestDependencies.kotlinJUnit
testImplementation cacheTestDependencies.mockito
testImplementation cacheTestDependencies.kotlinReflect
Copy link

Choose a reason for hiding this comment

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

I do not think that this library is necessary. Just curious - why did you add it in every module?

Copy link
Author

Choose a reason for hiding this comment

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

This is so long ago, I'm not sure any more... Maybe it has to do with a gradle warning saying that different versions of a lib were found on the classpath. Maybe it's something else. Feel free to remove it. If it works well then I guess it's not needed !

testImplementation cacheTestDependencies.assertj
testImplementation cacheTestDependencies.robolectric
}
1 change: 1 addition & 0 deletions data/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ dependencies {
testImplementation dataTestDependencies.junit
testImplementation dataTestDependencies.kotlinJUnit
testImplementation dataTestDependencies.mockito
testImplementation dataTestDependencies.kotlinReflect
testImplementation dataTestDependencies.assertj
}
50 changes: 27 additions & 23 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@

ext {
//Android
androidBuildToolsVersion = "26.0.0"
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'
appCompatVersion = '1.0.0'

//Testing
robolectricVersion = '3.4.2'
Expand All @@ -32,7 +31,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 @@ -42,12 +41,13 @@ 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:${kotlinVersion}"
]

domainTestDependencies = [
junit: "junit:junit:${jUnitVersion}",
mockito: "com.nhaarman:mockito-kotlin:${mockitoKotlinVersion}",
kotlinReflect: "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}",
assertj: "org.assertj:assertj-core:${assertJVersion}"
]

Expand All @@ -58,7 +58,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:${kotlinVersion}",
rxAndroid: "io.reactivex.rxjava2:rxandroid:${rxAndroidVersion}",
javaxAnnotation: "javax.annotation:jsr250-api:${javaxAnnotationVersion}",
javaxInject: "javax.inject:javax.inject:${javaxInjectVersion}",
Expand All @@ -73,6 +73,7 @@ ext {
kotlinJUnit: "org.jetbrains.kotlin:kotlin-test-junit:${kotlin_version}",
assertj: "org.assertj:assertj-core:${assertJVersion}",
mockito: "com.nhaarman:mockito-kotlin:${mockitoKotlinVersion}",
kotlinReflect: "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}",
robolectric: "org.robolectric:robolectric:${robolectricVersion}"
]

Expand All @@ -83,7 +84,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:${kotlinVersion}",
rxAndroid: "io.reactivex.rxjava2:rxandroid:${rxAndroidVersion}",
javaxAnnotation: "javax.annotation:jsr250-api:${javaxAnnotationVersion}",
javaxInject: "javax.inject:javax.inject:${javaxInjectVersion}",
Expand All @@ -98,6 +99,7 @@ ext {
kotlinJUnit: "org.jetbrains.kotlin:kotlin-test-junit:${kotlin_version}",
assertj: "org.assertj:assertj-core:${assertJVersion}",
mockito: "com.nhaarman:mockito-kotlin:${mockitoKotlinVersion}",
kotlinReflect: "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}",
robolectric: "org.robolectric:robolectric:${robolectricVersion}"
]

Expand All @@ -106,7 +108,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:${kotlinVersion}",
javaxAnnotation: "javax.annotation:jsr250-api:${javaxAnnotationVersion}",
javaxInject: "javax.inject:javax.inject:${javaxInjectVersion}",
androidAnnotations: "com.android.support:support-annotations:${androidAnnotationsVersion}",
Expand All @@ -120,6 +122,7 @@ ext {
kotlinJUnit: "org.jetbrains.kotlin:kotlin-test-junit:${kotlin_version}",
assertj: "org.assertj:assertj-core:${assertJVersion}",
mockito: "com.nhaarman:mockito-kotlin:${mockitoKotlinVersion}",
kotlinReflect: "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}",
robolectric: "org.robolectric:robolectric:${robolectricVersion}",
roomTesting: "android.arch.persistence.room:testing:${roomVersion}",
archTesting: "android.arch.core:core-testing:${roomVersion}",
Expand All @@ -132,7 +135,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:${kotlinVersion}",
javaxAnnotation: "javax.annotation:jsr250-api:${javaxAnnotationVersion}",
javaxInject: "javax.inject:javax.inject:${javaxInjectVersion}",
androidAnnotations: "com.android.support:support-annotations:${androidAnnotationsVersion}",
Expand All @@ -148,6 +151,7 @@ ext {
kotlinJUnit: "org.jetbrains.kotlin:kotlin-test-junit:${kotlin_version}",
assertj: "org.assertj:assertj-core:${assertJVersion}",
mockito: "com.nhaarman:mockito-kotlin:${mockitoKotlinVersion}",
kotlinReflect: "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}",
supportRunner: "com.android.support.test:runner:${androidSupportRunnerVersion}",
supportRules: "com.android.support.test:rules:${androidSupportRulesVersion}"
]
Expand All @@ -158,15 +162,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:${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:${appCompatVersion}",
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 All @@ -178,12 +180,14 @@ ext {
kotlinJUnit: "org.jetbrains.kotlin:kotlin-test-junit:${kotlin_version}",
assertj: "org.assertj:assertj-core:${assertJVersion}",
mockito: "com.nhaarman:mockito-kotlin:${mockitoKotlinVersion}",
kotlinReflect: "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}",
supportRunner: "com.android.support.test:runner:${androidSupportRunnerVersion}",
supportRules: "com.android.support.test:rules:${androidSupportRulesVersion}",
mockitoAndroid: "org.mockito:mockito-android:${mockitoAndroidVersion}",
espressoCore: "com.android.support.test.espresso:espresso-core:${espressoVersion}",
espressoIntents: "com.android.support.test.espresso:espresso-intents:${espressoVersion}",
espressoContrib: "com.android.support.test.espresso:espresso-contrib:${espressoVersion}",
appCompat: "androidx.appcompat:appcompat:${appCompatVersion}",
androidRunner: "com.android.support.test:runner:${runnerVersion}",
androidRules: "com.android.support.test:rules:${runnerVersion}"
]
Expand Down
1 change: 1 addition & 0 deletions domain/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dependencies {

testImplementation domainTestDependencies.junit
testImplementation domainTestDependencies.mockito
testImplementation domainTestDependencies.kotlinReflect
testImplementation domainTestDependencies.assertj

}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
android.enableJetifier=true
android.useAndroidX=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
53 changes: 27 additions & 26 deletions mobile-ui/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
Copy link

Choose a reason for hiding this comment

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

What is purpose of this plugin? Is it related to Migrate to androidX MR?

Copy link
Author

Choose a reason for hiding this comment

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

It's used to check if new versions of libraries are available. No needed for androidx. You can skip it.

id 'com.github.ben-manes.versions' version '0.20.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
Expand All @@ -8,7 +12,6 @@ android {
def globalConfiguration = rootProject.extensions.getByName("ext")

compileSdkVersion globalConfiguration["androidCompileSdkVersion"]
buildToolsVersion globalConfiguration["androidBuildToolsVersion"]

defaultConfig {
minSdkVersion globalConfiguration["androidMinSdkVersion"]
Expand Down Expand Up @@ -74,11 +77,9 @@ 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.androidAnnotations
implementation mobileUiDependencies.appCompat
implementation mobileUiDependencies.supportDesign
implementation mobileUiDependencies.timber
implementation mobileUiDependencies.rxAndroid
Expand All @@ -95,29 +96,29 @@ dependencies {
// Instrumentation test dependencies
androidTestImplementation mobileUiTestDependencies.junit
androidTestImplementation mobileUiTestDependencies.mockito
androidTestImplementation mobileUiTestDependencies.kotlinReflect
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 mobileUiTestDependencies.espressoCore
androidTestImplementation mobileUiTestDependencies.androidRunner
androidTestImplementation mobileUiTestDependencies.androidRules
androidTestImplementation mobileUiTestDependencies.espressoIntents
androidTestImplementation mobileUiTestDependencies.espressoContrib
androidTestImplementation mobileUiTestDependencies.appCompat

kaptTest mobileUiDependencies.daggerCompiler
kaptAndroidTest mobileUiDependencies.daggerCompiler
}


dependencyUpdates.resolutionStrategy = {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
}
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
Loading