Skip to content

Commit

Permalink
Chore/dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jsamol authored and godenzim committed May 18, 2021
1 parent a4fc4ad commit 5b6cafd
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 36 deletions.
13 changes: 5 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.4.10"
ext.kotlin_version = "1.4.32"
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath 'com.android.tools.build:gradle:4.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${Version.kotlin}"
classpath "org.jetbrains.kotlin:kotlin-serialization:${Version.kotlin}"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.4.0"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.4.32"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -19,10 +19,7 @@ buildscript {
allprojects {
repositories {
google()
jcenter()
maven {
url "https://dl.bintray.com/terl/lazysodium-maven"
}
mavenCentral()
}
}

Expand Down
29 changes: 15 additions & 14 deletions buildSrc/src/main/java/GradleConfig.kt
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
object Version {
const val kotlin = "1.4.10"
// TODO: Update to Kotlin 1.5 once KT-46477 (https://youtrack.jetbrains.com/issue/KT-46477) is fixed
const val kotlin = "1.4.32"

const val kotlinSerialization = "1.0.1"
const val kotlinSerialization = "1.2.1"

const val androidxCore = "1.3.2"
const val androidxAppCompat = "1.2.0"
const val androidxConstraintLayout = "1.1.3"
const val androidxConstraintLayout = "2.0.4"

const val androidxActivity = "1.1.0"
const val androidxLifecycle = "2.2.0"
const val androidxActivity = "1.2.3"
const val androidxLifecycle = "2.3.1"

const val androidxSecurity = "1.0.0-rc03"
const val androidxSecurity = "1.0.0"

const val coroutines = "1.4.2"
const val coroutines = "1.5.0"

const val ktor = "1.4.1"
const val ktor = "1.5.4"

const val lazySodium = "4.2.0"
const val jna = "5.6.0"
const val lazySodium = "5.0.2"
const val jna = "5.8.0"

const val materialComponents = "1.2.1"
const val materialComponents = "1.3.0"

const val junit = "4.13"
const val junit = "4.13.2"

const val androidxJunit = "1.1.2"
const val androidxEspresso = "3.3.0"

const val mockk = "1.10.2"
const val mockk = "1.11.0"
}

object Dependencies {
Expand Down Expand Up @@ -57,7 +58,7 @@ object Dependencies {

const val materialComponents = "com.google.android.material:material:${Version.materialComponents}"

const val lazySodium = "com.goterl.lazycode:lazysodium-android:${Version.lazySodium}@aar"
const val lazySodium = "com.goterl:lazysodium-android:${Version.lazySodium}@aar"
const val jna = "net.java.dev.jna:jna:${Version.jna}@aar"
}

Expand Down
16 changes: 11 additions & 5 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ apply plugin: 'kotlinx-serialization'
apply plugin: 'org.jetbrains.dokka'

android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
compileSdkVersion 30
buildToolsVersion "30.0.3"

defaultConfig {
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0.0"
targetSdkVersion 30
versionCode 2
versionName "1.0.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -40,8 +40,14 @@ android {
}

kotlinOptions {
jvmTarget = '1.8'
freeCompilerArgs += '-Xexplicit-api=warning'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public class BeaconClient internal constructor(
is Failure -> Result.failure(it.error as? BeaconException ?: BeaconException.from(it.error))
}
}

/**
* Sends the [response] in reply to a previously received request.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package it.airgap.beaconsdk.internal.crypto.provider

import com.goterl.lazycode.lazysodium.LazySodiumAndroid
import com.goterl.lazycode.lazysodium.SodiumAndroid
import com.goterl.lazycode.lazysodium.exceptions.SodiumException
import com.goterl.lazycode.lazysodium.interfaces.*
import com.goterl.lazycode.lazysodium.utils.Key
import com.goterl.lazysodium.LazySodiumAndroid
import com.goterl.lazysodium.SodiumAndroid
import com.goterl.lazysodium.exceptions.SodiumException
import com.goterl.lazysodium.interfaces.*
import com.goterl.lazysodium.utils.Key
import it.airgap.beaconsdk.internal.crypto.data.KeyPair
import it.airgap.beaconsdk.internal.crypto.data.SessionKeyPair
import it.airgap.beaconsdk.internal.utils.HexString

private typealias SodiumKeyPair = com.goterl.lazycode.lazysodium.utils.KeyPair
private typealias SodiumKeyPair = com.goterl.lazysodium.utils.KeyPair

internal class LazySodiumCryptoProvider : CryptoProvider {
private val sodium: LazySodiumAndroid = LazySodiumAndroid(SodiumAndroid())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ internal class BeaconClientTest {
@Test
fun `connects for messages with callback`() {
runBlockingTest {

val requests = beaconVersionedRequests().shuffled()
val beaconMessageFlow = beaconConnectionMessageFlow(requests.size + 1)

Expand All @@ -100,7 +101,9 @@ internal class BeaconClientTest {
if (messages.size == requests.size) testDeferred.complete(Unit)
}

override fun onError(error: Throwable) = Unit
override fun onError(error: Throwable) {
throw IllegalStateException("Expected to get a new message", error)
}
}
)
beaconClient.connect(callback)
Expand Down Expand Up @@ -173,7 +176,9 @@ internal class BeaconClientTest {
val errors = mutableListOf<Throwable>()
val callback = spyk<OnNewMessageListener>(
object : OnNewMessageListener {
override fun onNewMessage(message: BeaconMessage) = Unit
override fun onNewMessage(message: BeaconMessage) {
throw IllegalStateException("Expected to throw an error")
}

override fun onError(error: Throwable) {
errors.add(error)
Expand Down
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.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 5b6cafd

Please sign in to comment.