Skip to content

Commit eb79376

Browse files
- updated dependencies.
- added changelog for version 1.0.2 in readme. - updated copyright.
1 parent 8a0dbd7 commit eb79376

File tree

16 files changed

+48
-42
lines changed

16 files changed

+48
-42
lines changed

Diff for: .idea/modules.xml

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: README.md

+16-4
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,20 @@ An action has several methods like:
108108
- ``` action.safeExecute(...) ```, this method calls the "run" function inside the usecase and executes the operation into in a SafeExecuteInterface;
109109

110110
### 2.6 Custom safe executor
111-
By default safeExecute use a generic SafeExecute if you want use a custom safe executor just use
112-
``` BaseConfig.safeExecutor = MySafeExecutor() ```
113-
111+
The `safeExecute()` method call is meant to be used if you plan a different behaviour based on the error of your response.
112+
If you use the simple `execute()` call, whenever there's an error, the method will throw an exception and you will have to
113+
handle it by try-catching it and defining a behaviour for that UseCase.
114+
If you use the `safeExecute()` method call, whenever there's an error, it will fallback to an `InternalError` failure in case of
115+
an exception, saving you from an application crash.
116+
Moreover, if you'd like to customize the behaviour in a general way, you can define a class that extends from the `SafeExecuteInterface`
117+
and inside the overridden `safeExecute()` call you can define the custom behaviour you want for your application.
118+
Finally, you'll have to assign the custom `SafeExecutor` as the `BaseConfig.safeExecutor` variable.
119+
120+
```kotlin
121+
BaseConfig.safeExecutor = MySafeExecutor()
122+
```
123+
124+
It is suggested that you assign this variable as soon as possible (i.e. in the `Application`'s class `onCreate()` method).
114125

115126

116127
To call an action you have to write this:
@@ -199,6 +210,7 @@ To learn more about unit tests, please, refer to the following section: [Unit te
199210

200211
**1.0.2**
201212
- Added Scope to actions.
213+
- added safeExecute.
202214

203215
**1.0.1**
204216
- fixed abnormal behavior on ActionQueue.
@@ -209,7 +221,7 @@ To learn more about unit tests, please, refer to the following section: [Unit te
209221

210222
# License
211223

212-
Copyright (C) 2019 Sysdata S.p.A.
224+
Copyright (C) 2020 Sysdata S.p.A.
213225

214226
Licensed under the Apache License, Version 2.0 (the "License");
215227
you may not use this file except in compliance with the License.

Diff for: app/build.gradle

+10-10
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,26 @@ dependencies {
2929
def ktx_version = "2.0.0"
3030
implementation fileTree(dir: 'libs', include: ['*.jar'])
3131
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
32-
implementation 'androidx.appcompat:appcompat:1.0.2'
32+
implementation 'androidx.appcompat:appcompat:1.1.0'
3333
implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-experimental-adapter:1.0.0'
34-
implementation "com.google.android.material:material:1.1.0-alpha09"
34+
implementation "com.google.android.material:material:1.2.0-alpha03"
3535
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
36-
kapt "androidx.databinding:databinding-compiler:3.5.0"
37-
implementation "androidx.lifecycle:lifecycle-extensions:2.0.0"
38-
implementation "androidx.lifecycle:lifecycle-viewmodel:2.0.0"
36+
kapt "androidx.databinding:databinding-compiler:3.5.3"
37+
implementation "androidx.lifecycle:lifecycle-extensions:2.1.0"
38+
implementation "androidx.lifecycle:lifecycle-viewmodel:2.1.0"
3939
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$ktx_version"
40-
implementation "androidx.fragment:fragment-ktx:1.1.0-rc04"
40+
implementation "androidx.fragment:fragment-ktx:1.2.0-rc04"
4141
implementation project(':networkmodule')
4242

4343
implementation project(':ktandroidarchitecturecore')
44-
testImplementation 'junit:junit:4.12'
44+
testImplementation 'junit:junit:4.13'
4545
androidTestImplementation 'androidx.test:runner:1.2.0'
4646
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
47-
testImplementation 'org.mockito:mockito-core:2.27.0'
47+
testImplementation 'org.mockito:mockito-core:3.1.0'
4848
testImplementation 'android.arch.core:core-testing:1.1.1'
4949
testImplementation 'com.jraska.livedata:testing-ktx:1.1.0'
50-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0"
51-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0"
50+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2"
51+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.2"
5252
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.3.0"
5353
// Koin for Unit tests
5454
testImplementation "org.koin:koin-test:$koin_version"

Diff for: build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlin_version = '1.3.50'
4+
ext.kotlin_version = '1.3.61'
55
// latest stable
66
ext.koin_version = '2.0.1'
77
repositories {
88
google()
99
jcenter()
1010
}
1111
dependencies {
12-
classpath 'com.android.tools.build:gradle:3.5.0'
12+
classpath 'com.android.tools.build:gradle:3.5.3'
1313
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1414

1515
// NOTE: Do not place your application dependencies here; they belong

Diff for: ktandroidarchitecturecore/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ android {
3434
minSdkVersion 15
3535
targetSdkVersion 28
3636
versionCode 1
37-
versionName "1.0"
37+
versionName version
3838
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3939

4040
}
@@ -55,7 +55,7 @@ android {
5555

5656
dependencies {
5757
def kotlin_coroutines_version = '1.3.0-M2'
58-
def lifecycle_version = '2.1.0-rc01'
58+
def lifecycle_version = '2.2.0-rc03'
5959
implementation fileTree(dir: 'libs', include: ['*.jar'])
6060
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
6161
// For Kotlin use lifecycle-viewmodel-ktx

Diff for: ktandroidarchitecturecore/publishBintray.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ buildscript {
44
jcenter()
55
}
66
dependencies {
7-
classpath 'com.android.tools.build:gradle:3.4.0'
7+
classpath 'com.android.tools.build:gradle:3.5.3'
88
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
99
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1'
1010
}

Diff for: ktandroidarchitecturecore/src/main/java/it/sysdata/ktandroidarchitecturecore/exception/Failure.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright (C) 2019 Sysdata S.p.a.
2+
* Copyright (C) 2020 Sysdata S.p.a.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

Diff for: ktandroidarchitecturecore/src/main/java/it/sysdata/ktandroidarchitecturecore/functional/Either.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright (C) 2019 Sysdata S.p.a.
2+
* Copyright (C) 2020 Sysdata S.p.a.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

Diff for: ktandroidarchitecturecore/src/main/java/it/sysdata/ktandroidarchitecturecore/interactor/Action.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright (C) 2019 Sysdata S.p.a.
2+
* Copyright (C) 2020 Sysdata S.p.a.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

Diff for: ktandroidarchitecturecore/src/main/java/it/sysdata/ktandroidarchitecturecore/interactor/ActionParams.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/**
3-
* Copyright (C) 2019 Sysdata S.p.a.
3+
* Copyright (C) 2020 Sysdata S.p.a.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

Diff for: ktandroidarchitecturecore/src/main/java/it/sysdata/ktandroidarchitecturecore/interactor/ActionQueue.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright (C) 2019 Sysdata S.p.a.
2+
* Copyright (C) 2020 Sysdata S.p.a.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

Diff for: ktandroidarchitecturecore/src/main/java/it/sysdata/ktandroidarchitecturecore/interactor/SingleAction.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright (C) 2019 Sysdata S.p.a.
2+
* Copyright (C) 2020 Sysdata S.p.a.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

Diff for: ktandroidarchitecturecore/src/main/java/it/sysdata/ktandroidarchitecturecore/interactor/UseCase.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright (C) 2019 Sysdata S.p.a.
2+
* Copyright (C) 2020 Sysdata S.p.a.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

Diff for: ktandroidarchitecturecore/src/main/java/it/sysdata/ktandroidarchitecturecore/platform/BaseViewModel.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright (C) 2019 Sysdata S.p.a.
2+
* Copyright (C) 2020 Sysdata S.p.a.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

Diff for: ktandroidarchitecturecore/src/main/java/it/sysdata/ktandroidarchitecturecore/platform/KParcelable.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright (C) 2019 Sysdata S.p.a.
2+
* Copyright (C) 2020 Sysdata S.p.a.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

Diff for: networkmodule/build.gradle

+7-14
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
33
apply plugin: 'kotlin-android-extensions'
4+
45
android {
56
compileSdkVersion 29
6-
buildToolsVersion "29.0.2"
7-
87

98
defaultConfig {
109
minSdkVersion 15
@@ -28,12 +27,11 @@ android {
2827
dependencies {
2928
implementation fileTree(dir: 'libs', include: ['*.jar'])
3029
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
31-
implementation 'androidx.appcompat:appcompat:1.0.2'
32-
implementation 'androidx.core:core-ktx:1.0.2'
33-
testImplementation 'junit:junit:4.12'
30+
implementation 'androidx.appcompat:appcompat:1.1.0'
31+
implementation 'androidx.core:core-ktx:1.1.0'
32+
testImplementation 'junit:junit:4.13'
3433
androidTestImplementation 'androidx.test:runner:1.2.0'
3534
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
36-
3735
// Koin for Kotlin
3836
api "org.koin:koin-core:$koin_version"
3937
// Koin extended & experimental features
@@ -42,19 +40,14 @@ dependencies {
4240
testApi "org.koin:koin-test:$koin_version"
4341
// Koin for Android
4442
api "org.koin:koin-android:$koin_version"
45-
4643
// Koin AndroidX Scope features
4744
api "org.koin:koin-androidx-scope:$koin_version"
4845
// Koin AndroidX ViewModel features
4946
api "org.koin:koin-androidx-viewmodel:$koin_version"
5047
// Koin AndroidX Experimental features
5148
api "org.koin:koin-androidx-ext:$koin_version"
52-
53-
5449
//Retrofit2
55-
implementation "com.squareup.retrofit2:retrofit:2.6.0"
56-
implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
57-
implementation "com.squareup.okhttp3:logging-interceptor:4.1.0"
58-
59-
50+
implementation "com.squareup.retrofit2:retrofit:2.6.2"
51+
implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
52+
implementation "com.squareup.okhttp3:logging-interceptor:4.1.1"
6053
}

0 commit comments

Comments
 (0)