Skip to content

Commit

Permalink
Update dependencies and README to match branch names
Browse files Browse the repository at this point in the history
  • Loading branch information
Serchinastico committed May 21, 2019
1 parent 3c2c267 commit 9ed5642
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 40 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,13 @@ To be able to get a deterministic test scenario all our tests will be executed o

Your task as Android Developer is to **migrate the application to Jetpack components**. You will do so step by step and always using tests to verify everything is still working.

**This repository is ready to build the application, pass the checkstyle and your tests in Travis-CI environments.**

Our recommendation for this exercise is:

- Before starting
1. Fork this repository.
2. Checkout `kata-jetpack` branch.
2. Checkout `00-start` branch.
3. Execute the application, explore it manually and make yourself familiar with the code.
4. Execute `MainActivityTest` and `SuperHeroDetailActivityTest` to see tests run.
4. Execute `MainActivityTest`, `SuperHeroDetailActivityTest` and `EditSuperHeroActivityTest` to see tests run.
- Feel free to migrate at your own pace and order but if you want to make it a bit easier, follow this order:
1. [Lifecycle][lifecycle]
2. [Room][room]
Expand Down Expand Up @@ -117,4 +115,4 @@ limitations under the License.
[androidDataBindingCodelab]: https://codelabs.developers.google.com/codelabs/android-room-with-a-view-kotlin/index.html#0
[androidPagingCodelab]: https://codelabs.developers.google.com/codelabs/android-paging/index.html#0
[androidLifecycleCodelab]: https://codelabs.developers.google.com/codelabs/android-lifecycles/index.html#0
[workManagerCodelab]: https://codelabs.developers.google.com/codelabs/android-workmanager-kt/index.html#0
[workManagerCodelab]: https://codelabs.developers.google.com/codelabs/android-workmanager-kt/index.html#0
34 changes: 18 additions & 16 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,63 +43,65 @@ configurations {

dependencies {
/* Lint */
ktlint "com.github.shyiko:ktlint:0.30.0"
ktlint "com.pinterest:ktlint:0.32.0"

/* Kotlin */
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

/* Jetpack */
implementation "androidx.appcompat:appcompat:1.0.2"
implementation "androidx.constraintlayout:constraintlayout:2.0.0-alpha3"
implementation "androidx.constraintlayout:constraintlayout:2.0.0-beta1"
implementation "androidx.recyclerview:recyclerview:1.0.0"
implementation "androidx.lifecycle:lifecycle-runtime:2.0.0"
implementation "androidx.lifecycle:lifecycle-extensions:2.0.0"
implementation "androidx.paging:paging-runtime-ktx:2.1.0"
implementation "android.arch.navigation:navigation-fragment-ktx:1.0.0"
implementation "android.arch.navigation:navigation-ui-ktx:1.0.0"
implementation "androidx.room:room-runtime:2.1.0-alpha05"
implementation "android.arch.work:work-runtime-ktx:1.0.0"
kapt "androidx.room:room-compiler:2.1.0-alpha05"
implementation "androidx.fragment:fragment:1.1.0-alpha05"
debugImplementation "androidx.fragment:fragment-testing:1.1.0-alpha05"
implementation "androidx.room:room-runtime:2.1.0-beta01"
implementation "android.arch.work:work-runtime-ktx:1.0.1"
kapt "androidx.room:room-compiler:2.1.0-beta01"
implementation "androidx.fragment:fragment:1.1.0-alpha09"
debugImplementation "androidx.fragment:fragment-testing:1.1.0-alpha09"

/* DI */
implementation "org.kodein.di:kodein-di-erased-jvm:6.0.1"
implementation "org.kodein.di:kodein-di-framework-android-x:6.0.1"

/* UI */
implementation "com.squareup.picasso:picasso:2.5.2"
implementation "com.squareup.picasso:picasso:2.71828"
implementation "com.google.android.material:material:1.0.0"

/* Testing */
testImplementation "androidx.test.ext:junit:1.1.0"
testImplementation "org.mockito:mockito-core:2.23.4"
testImplementation "androidx.room:room-testing:2.1.0-alpha05"
testImplementation "org.mockito:mockito-core:2.27.0"
testImplementation "androidx.room:room-testing:2.1.0-beta01"
androidTestImplementation "androidx.test.ext:junit:1.1.0"
androidTestImplementation "org.mockito:mockito-android:2.23.4"
androidTestImplementation "org.mockito:mockito-android:2.27.0"
androidTestImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0"
androidTestImplementation "com.github.tmurakami:dexopener:2.0.0"
androidTestImplementation "com.github.tmurakami:dexopener:2.0.2"
androidTestImplementation "androidx.test.espresso:espresso-core:3.1.1"
androidTestImplementation "androidx.test.espresso:espresso-contrib:3.1.1"
androidTestImplementation "androidx.test.espresso:espresso-intents:3.1.1"
androidTestImplementation "androidx.room:room-testing:2.1.0-alpha05"
androidTestImplementation "android.arch.work:work-testing:1.0.0"
androidTestImplementation "androidx.room:room-testing:2.1.0-beta01"
androidTestImplementation "android.arch.work:work-testing:1.0.1"
}

shot {
appId = "com.karumi.superheroes.jetpack"
}

task ktlint(type: JavaExec) {
main = "com.github.shyiko.ktlint.Main"
description = "Check Kotlin code style."
main = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "src/**/*.kt"
}

check.dependsOn ktlint

task ktlintFormat(type: JavaExec) {
main = "com.github.shyiko.ktlint.Main"
description = "Fix Kotlin code style deviations."
main = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "-F", "src/**/*.kt"
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
package com.karumi.jetpack.superheroes.ui.utils

import android.content.Context
import android.widget.ImageView
import com.squareup.picasso.Picasso

fun ImageView.setImageBackground(path: String?) {
if (path != null) {
context.picasso.load(path).fit().centerCrop().fit().into(this)
Picasso.get().load(path).fit().centerCrop().fit().into(this)
}
}

val Context.picasso: Picasso
get() = Picasso.with(this)
}
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
buildscript {
ext.kotlin_version = '1.3.21'
ext.kotlin_version = '1.3.31'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.android.tools.build:gradle:3.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.karumi:shot:2.1.1'
classpath "android.arch.navigation:navigation-safe-args-gradle-plugin:1.0.0"
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Jan 23 15:21:56 CET 2019
#Tue May 21 12:09:00 CEST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

0 comments on commit 9ed5642

Please sign in to comment.