Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): Update dependencies (Kotlin 1.6) #623

Merged
merged 6 commits into from
Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from 5 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
53 changes: 26 additions & 27 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ buildscript {
}
ext {
ktorVersion = '1.6.2'
junitVersion = '5.7.2'
awalaTestingVersion = '1.5.0'
junitVersion = '5.8.2'
awalaTestingVersion = '1.5.2'
}
}

Expand All @@ -33,16 +33,15 @@ repositories {
}

android {
compileSdkVersion 31
buildToolsVersion '30.0.2'
compileSdkVersion 32
ndkVersion '21.3.6528147'

defaultConfig {
applicationId "tech.relaycorp.gateway"

minSdkVersion 21

targetSdkVersion 31
targetSdkVersion 32
versionCode 1
versionName project.findProperty("versionName") ?: "0.1"

Expand Down Expand Up @@ -124,34 +123,34 @@ dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion"

// Android
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
implementation 'androidx.security:security-crypto:1.1.0-alpha03'
implementation 'androidx.work:work-runtime-ktx:2.5.0'
implementation 'androidx.work:work-runtime-ktx:2.7.1'

// Dependency Injection
api 'com.google.dagger:dagger:2.37'
kapt 'com.google.dagger:dagger-compiler:2.37'
api 'com.google.dagger:dagger:2.42'
kapt 'com.google.dagger:dagger-compiler:2.42'

// Awala
implementation 'tech.relaycorp:awala:1.65.0'
implementation 'tech.relaycorp:awala-keystore-file:1.6.0'
implementation 'tech.relaycorp:cogrpc:1.1.18'
implementation 'tech.relaycorp:cogrpc-okhttp:1.1.11'
implementation 'tech.relaycorp:awala-keystore-file:1.6.1'
implementation 'tech.relaycorp:cogrpc:1.1.21'
implementation 'tech.relaycorp:cogrpc-okhttp:1.1.12'
testImplementation "tech.relaycorp:awala-testing:$awalaTestingVersion"
androidTestImplementation "tech.relaycorp:awala-testing:$awalaTestingVersion"

// Android TLS support for Netty
implementation "io.netty:netty-handler:4.1.65.Final"
implementation "io.netty:netty-handler:4.1.77.Final"
implementation 'org.conscrypt:conscrypt-android:2.5.2'

// Local and Internet-based Parcel Delivery Connections (PDCs)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

implementation "tech.relaycorp:doh:1.0.4" needs ktor update as well to avoid conflicts

implementation 'tech.relaycorp:poweb:1.5.22'
implementation 'tech.relaycorp:poweb:1.5.25'
implementation "io.ktor:ktor-server-core:$ktorVersion"
implementation "io.ktor:ktor-server-netty:$ktorVersion"
implementation "io.ktor:ktor-websockets:$ktorVersion"
Expand All @@ -162,17 +161,17 @@ dependencies {
testImplementation "io.ktor:ktor-test-dispatcher:$ktorVersion"

// ORM
def room_version = '2.4.1'
def room_version = '2.4.2'
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-ktx:$room_version"

// required to avoid crash on Android 12 API 31
implementation 'androidx.work:work-runtime-ktx:2.7.0-beta01'
implementation 'androidx.work:work-runtime-ktx:2.7.1'

// Preferences
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'com.fredporciuncula:flow-preferences:1.5.0'
implementation 'com.fredporciuncula:flow-preferences:1.5.0'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

// needs a higher version of kotlin


// Display open-source licenses
implementation "com.mikepenz:aboutlibraries:$aboutLibrariesVersion"
Expand All @@ -181,30 +180,30 @@ dependencies {
implementation "io.ktor:ktor-client-android:$ktorVersion"

// PrivateKey operations
implementation 'org.bouncycastle:bcprov-jdk15on:1.69'
implementation 'org.bouncycastle:bcprov-jdk15on:1.70'

// Testing
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlinVersion"
testImplementation "org.junit.jupiter:junit-jupiter:$junitVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinCoroutinesVersion"
testImplementation 'org.mockito:mockito-inline:3.11.2'
testImplementation 'org.mockito:mockito-inline:4.6.0'
testImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0'

// Instrumentation Testing
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinCoroutinesVersion"
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation('com.adevinta.android:barista:4.0.0') {
androidTestImplementation('com.adevinta.android:barista:4.2.0') {
exclude group: 'org.jetbrains.kotlin'
}
androidTestImplementation "org.mockito:mockito-android:3.10.0"
androidTestImplementation "org.mockito:mockito-android:4.6.0"
androidTestImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0") {
// Workaround for Android API < 26:
// https://github.com/mockito/mockito/pull/2024
exclude group: "org.mockito", module: "mockito-core"
}
kaptAndroidTest 'com.google.dagger:dagger-compiler:2.35.1'
kaptAndroidTest 'com.google.dagger:dagger-compiler:2.42'
}

spotless {
Expand Down
15 changes: 11 additions & 4 deletions app/lint.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<lint>
<!-- We're using dependabot to keep dependencies up-to-date -->
<issue id="NewerVersionAvailable" severity="ignore"/>
<issue id="GradleDependency" severity="ignore"/>
<issue id="NewerVersionAvailable" severity="ignore" />
<issue id="GradleDependency" severity="ignore" />

<issue id="LockedOrientationActivity" severity="ignore"/>
<issue id="ConvertToWebp" severity="informational"/>
<issue id="LockedOrientationActivity" severity="ignore" />
<issue id="ConvertToWebp" severity="informational" />

<issue id="InvalidPackage">
<!-- Ignore errors about BC importing javax.naming because we don't use those modules -->
<ignore path="**/bcpkix-*.jar" />
<!-- Temporary until https://github.com/Kotlin/kotlinx.coroutines/issues/3277 / https://github.com/Kotlin/kotlinx.coroutines/issues/2004 is resolved. -->
<!-- Ignoring core jvm artifact should be completely safe, actual code with java.lang.instrument is never loaded, and we don't use the JVM version -->
<ignore path="**/kotlinx-coroutines-core-jvm-1.5.2.jar" />
<!-- Ignore errors about GRPC importing javax.naming because we don’t use those modules -->
<ignore path="**/grpc-core*.jar" />
<!-- Ignore errors about jacoco importing javax.management because we don’t use those modules -->
<ignore path="**/org.jacoco/**" />
</issue>
<issue id="TrustAllX509TrustManager">
<ignore path="org/bouncycastle/est/jcajce/*.class" />
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/data_extraction_old_rules"
android:theme="@style/Theme.Gateway"
tools:ignore="GoogleAppIndexingWarning,UnusedAttribute">

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/tech/relaycorp/gateway/ui/BaseActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.common_app_bar.appBar
import kotlinx.android.synthetic.main.common_app_bar.toolbar
import kotlinx.android.synthetic.main.common_app_bar.toolbarTitle
import kotlinx.coroutines.channels.sendBlocking
import kotlinx.coroutines.channels.trySendBlocking
import kotlinx.coroutines.flow.asFlow
import tech.relaycorp.gateway.App
import tech.relaycorp.gateway.R
Expand Down Expand Up @@ -56,7 +56,7 @@ abstract class BaseActivity : AppCompatActivity() {

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
_results.sendBlocking(ActivityResult(requestCode, resultCode, data))
_results.trySendBlocking(ActivityResult(requestCode, resultCode, data))
}

protected fun setupNavigation(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package tech.relaycorp.gateway.ui.settings

import kotlinx.coroutines.channels.sendBlocking
import kotlinx.coroutines.channels.trySendBlocking
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asFlow
Expand Down Expand Up @@ -36,7 +36,7 @@ class MigrateGatewayViewModel
private val _addressChanges = MutableStateFlow("")

fun submitted() {
_submits.sendBlocking(Click)
_submits.trySendBlocking(Click)
}

private val _submits = PublishFlow<Click>()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package tech.relaycorp.gateway.ui.sync

import kotlinx.coroutines.channels.sendBlocking
import kotlinx.coroutines.channels.trySendBlocking
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asFlow
Expand All @@ -21,7 +21,7 @@ class CourierSyncViewModel

// Inputs

fun stopClicked() = stopClicks.sendBlocking(Click)
fun stopClicked() = stopClicks.trySendBlocking(Click)
private val stopClicks = PublishFlow<Click>()

// Outputs
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/xml/data_extraction_old_rules.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<full-backup-content>
<include domain="sharedpref" path="."/>
<include domain="database" path="."/>
</full-backup-content>
12 changes: 12 additions & 0 deletions app/src/main/res/xml/data_extraction_rules.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Sample data extraction rules file; uncomment and customize as necessary.
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
for details.
-->
<data-extraction-rules>
<device-transfer>
<include domain="sharedpref" path="."/>
<include domain="database" path="."/>
</device-transfer>
</data-extraction-rules>
18 changes: 9 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@
buildscript {
ext {
kotlinVersion = '1.5.21'
kotlinCoroutinesVersion = '1.5.1'
aboutLibrariesVersion = '8.9.0'
kotlinCoroutinesVersion = '1.5.2'
aboutLibrariesVersion = '8.9.3'
}
repositories {
google()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url 'https://oss.sonatype.org/content/repositories' }
Filmaluco marked this conversation as resolved.
Show resolved Hide resolved
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.android.tools.build:gradle:7.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.14.1'
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0'
classpath "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:$aboutLibrariesVersion"
classpath 'com.github.triplet.gradle:play-publisher:3.7.0'
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ org.gradle.jvmargs=-Xmx2048m
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
android.jetifier.blacklist=bouncycastle
android.jetifier.ignorelist=bouncycastle
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Issue with KaptWithoutKotlincTask, InvocationTargetException
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists