Skip to content

Commit

Permalink
Merge pull request #14 from tinkoff-mobile-tech/MC-5659
Browse files Browse the repository at this point in the history
MC-5659 bump up compile- and target- SdkVersions, dependencies versions & fix warnings & migrate
  • Loading branch information
Stasssm authored May 13, 2022
2 parents 22b8864 + 1af838b commit 23e0594
Show file tree
Hide file tree
Showing 25 changed files with 139 additions and 198 deletions.
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@

#### Fixed
#### Changes
- [app-demo][tinkoff-id] bump up API versions (targetSdk and compileSdk to 31) and dependencies versions MC-5659
#### Additions

## 1.0.1

#### Fixed
#### Changes
#### Additions

- Added redirect_uri configuration logic


## 1.0.0

#### Fixed
#### Changes
#### Additions


[app-demo]: app-demo
[tinkoff-id]: tinkoff-id
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ Enum со статусами пришедшими из приложения Ти
SDK поставляется с примером приложения, где можно посмотреть работу авторизации.
В папке [app-demo](app-demo) содержится тестовое приложение.
В данном приложении можно:
- Проверить работу вашего cleintId, подставив его в необходимое поле
- Проверить работу вашего clientId, подставив его в необходимое поле
- Посмотреть дизайн кнопки
- Авторизоваться
- Отозвать токены
Expand Down
18 changes: 7 additions & 11 deletions app-demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@ apply plugin: 'kotlin-android'
apply from: rootProject.file('gradle/versions.gradle')
apply from: rootProject.file('gradle/plugin/detekt.gradle')

def getBuildVersionCode = (project.findProperty("buildCounter") == null)
? 1
: Integer.parseInt(project.findProperty("buildCounter"))

android {
compileSdkVersion rootProject.ext.compileSdkVersion

defaultConfig {
multiDexEnabled = true
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode getBuildVersionCode
versionName authVersion
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
versionCode rootProject.authCode
versionName rootProject.authVersion
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand All @@ -34,11 +30,11 @@ android {

dependencies {
api project(':tinkoff-id')
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
api "androidx.appcompat:appcompat:${appCompatVersion}"
api "androidx.constraintlayout:constraintlayout:${constraintLayoutVersion}"
api "com.google.android.material:material:${material}"
api "com.google.android.material:material:${materialVersion}"
//rx
api "io.reactivex.rxjava2:rxjava:$rxJavaVersion"
api "io.reactivex.rxjava2:rxandroid:$rxAndroidVersion"
}
}
5 changes: 4 additions & 1 deletion app-demo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@

<application
android:allowBackup="false"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.DayNight"
tools:ignore="AllowBackup,GoogleAppIndexingWarning">
tools:ignore="AllowBackup,GoogleAppIndexingWarning,UnusedAttribute">
<activity
android:name=".PartnerActivity"
android:exported="true"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ package ru.tinkoff.core.app_demo_partner

import android.net.Uri
import android.util.Log
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.OnLifecycleEvent
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import io.reactivex.Single
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable
Expand All @@ -20,7 +19,7 @@ import ru.tinkoff.core.tinkoffId.TinkoffTokenPayload
class PartnerPresenter(
private val tinkoffPartnerAuth: TinkoffIdAuth,
private val partnerActivity: PartnerActivity
) : LifecycleObserver {
) : DefaultLifecycleObserver {

private val compositeDisposable = CompositeDisposable()
private var tokenPayload: TinkoffTokenPayload? = null
Expand Down Expand Up @@ -98,8 +97,8 @@ class PartnerPresenter(
}
}

@OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
fun dispose() {
override fun onDestroy(owner: LifecycleOwner) {
super.onDestroy(owner)
compositeDisposable.clear()
}

Expand Down
6 changes: 0 additions & 6 deletions app-demo/src/main/res/values/colors.xml

This file was deleted.

11 changes: 0 additions & 11 deletions app-demo/src/main/res/values/styles.xml

This file was deleted.

17 changes: 17 additions & 0 deletions app-demo/src/main/res/xml/data_extraction_rules.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>
<cloud-backup>
<exclude domain="root" />
<exclude domain="file" />
<exclude domain="database" />
<exclude domain="sharedpref" />
<exclude domain="external" />
</cloud-backup>
<device-transfer>
<exclude domain="root" />
<exclude domain="file" />
<exclude domain="database" />
<exclude domain="sharedpref" />
<exclude domain="external" />
</device-transfer>
</data-extraction-rules>
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ def useMavenLocal = project.hasProperty("useMavenLocal")
print("useMavenLocal = " + useMavenLocal)

buildscript {

apply from: 'gradle/versions.gradle'

repositories {
// mavenLocal() // Uncomment when testing on Maven local repository
google()
jcenter()
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
gradlePluginPortal()
}
Expand All @@ -26,7 +25,7 @@ allprojects {
repositories {
if (useMavenLocal) mavenLocal()
google()
jcenter()
mavenCentral()
}
}

Expand Down
11 changes: 6 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ android.useAndroidX=true
android.enableJetifier=true
kotlin.code.style=official

POM_DESCRIPTION=Android library for Tinkoff authorization
POM_DESCRIPTION=Android library for Tinkoff authorization
POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=https://github.com/tinkoff-mobile-tech/TinkoffID-Android/blob/master/LICENSE
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=tcs
POM_DEVELOPER_NAME=Tinkoff Credit Systems
POM_DEVELOPER_EMAIL=[email protected]
POM_URL=https://github.com/tinkoff-mobile-tech/TinkoffID-Android
POM_SCM_URL=https://github.com/tinkoff-mobile-tech/TinkoffID-Android
POM_SCM_CONNECTION=scm:git@github.com:tinkoff-mobile-tech/TinkoffID-Android
POM_SCM_DEV_CONNECTION=scm:git@github.com:tinkoff-mobile-tech/TinkoffID-Android
POM_SCM_URL=https://github.com/tinkoff-mobile-tech/TinkoffID-Android/tree/main
POM_SCM_CONNECTION=scm:git:git://github.com/tinkoff-mobile-tech/TinkoffID-Android.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://github.com:tinkoff-mobile-tech/TinkoffID-Android.git

VERSION_NAME=1.0.2
VERSION_CODE=1
VERSION_CODE=3
GROUP=ru.tinkoff.core.tinkoffauth
1 change: 1 addition & 0 deletions gradle/plugin/android.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ android {
configureEach {
includeNonPublic.set(false)
noAndroidSdkLink.set(false)
suppressInheritedMembers.set(true)
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions gradle/plugin/config/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ potential-bugs:
LateinitUsage:
active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
excludeAnnotatedProperties: []
ignoreAnnotated: []
ignoreOnClassesPattern: ''
MapGetWithNotNullAssertionOperator:
active: false
Expand Down Expand Up @@ -557,7 +557,7 @@ style:
active: false
ignoreOverridableFunction: true
excludedFunctions: 'describeContents'
excludeAnnotatedFunction: ['dagger.Provides']
ignoreAnnotated: ['dagger.Provides']
LibraryCodeMustSpecifyReturnType:
active: true
LibraryEntitiesShouldNotBePublic:
Expand Down Expand Up @@ -634,10 +634,10 @@ style:
active: false
UnderscoresInNumericLiterals:
active: false
acceptableDecimalLength: 5
acceptableLength: 5
UnnecessaryAbstractClass:
active: true
excludeAnnotatedClasses: ['dagger.Module']
ignoreAnnotated: ['dagger.Module']
UnnecessaryAnnotationUseSiteTarget:
active: false
UnnecessaryApply:
Expand Down Expand Up @@ -665,7 +665,7 @@ style:
active: false
UseDataClass:
active: false
excludeAnnotatedClasses: []
ignoreAnnotated: []
allowVars: false
UseEmptyCounterpart:
active: false
Expand Down
23 changes: 14 additions & 9 deletions gradle/plugin/detekt.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,21 @@ dependencies {
}

detekt {
version = detektVersion
input = files('src')
toolVersion = detektVersion
source = files("src")
config = rootProject.files('gradle/plugin/config/detekt.yml')
}

tasks.named("detekt").configure {
reports {
xml {
enabled = false
}
html {
enabled = true
destination = file("$project.buildDir/reports/detekt-results-${project.name}.html")
}
xml.required.set(false)

sarif.required.set(false)

txt.required.set(true)
txt.outputLocation.set(file("$project.buildDir/reports/detekt-results-${project.name}.txt"))

html.required.set(true)
html.outputLocation.set(file("$project.buildDir/reports/detekt-results-${project.name}.html"))
}
}
2 changes: 1 addition & 1 deletion gradle/plugin/kotlin-library.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ apply from: rootProject.file('gradle/plugin/detekt.gradle')
apply plugin: 'kotlin-kapt'

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
}
Loading

0 comments on commit 23e0594

Please sign in to comment.