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

Upgrade min-sdk to 24; use Google Truth instead of AssertJ; verious dependency updates #24

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
6 changes: 0 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,4 @@ dependencies {
implementation "androidx.appcompat:appcompat:$appcompat_version"
implementation "androidx.core:core-ktx:$ktx_version"
implementation 'androidx.multidex:multidex:2.0.1'

testImplementation "junit:junit:$junit_version"

androidTestImplementation "androidx.test:runner:$testrunner_version"
androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_version"
androidTestImplementation "org.assertj:assertj-core:$jassert_version"
}
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
buildscript {
ext {
appcompat_version = '1.6.1'
espresso_version = '3.5.1'
agp_version = '8.1.1'
jassert_version = '3.24.2'
appcompat_version = '1.7.0'
espresso_version = '3.6.1'
agp_version = '8.6.0'
junit_version = '4.13.2'
kotlin_version = '1.8.21'
ktx_version = '1.12.0'
ktx_version = '1.13.1'
roboelectric_version = '4.10.3'
testrunner_version = '1.5.2'
testrunner_version = '1.6.2'
truth_version = '1.4.4'

// for maven central upload and publishing
gradle_maven_publish_plugin_version = '0.14.2'
Expand All @@ -33,7 +33,7 @@ allprojects {
}

project.ext {
minSdkVersion = 15
minSdkVersion = 21
compileSdkVersion = 34
targetSdkVersion = 34
ndkVersion = "22.1.7171670"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distrubutionSha256Sum=e111cb9948407e26351227dabce49822fb88c37ee72f1d1582a69c68af2e702f
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
7 changes: 4 additions & 3 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,19 @@ publishing {
}

signing {
sign publishing.publications
useGpgCmd()
sign(publishing.publications["release"])
}

dependencies {
implementation "androidx.appcompat:appcompat:$appcompat_version"
implementation "androidx.core:core-ktx:$ktx_version"

testImplementation "junit:junit:$junit_version"
testImplementation "org.assertj:assertj-core:$jassert_version"
testImplementation "com.google.truth:truth:$truth_version"
testImplementation "org.robolectric:robolectric:$roboelectric_version"

androidTestImplementation "androidx.test:runner:$testrunner_version"
androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_version"
androidTestImplementation "org.assertj:assertj-core:$jassert_version"
androidTestImplementation "com.google.truth:truth:$truth_version"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

package com.lambdapioneer.argon2kt

import org.assertj.core.api.Assertions.assertThat
import com.google.common.truth.Truth.assertThat
import org.junit.Test

class Argon2KtBenchmarkUtilsInstrumentedTest {
Expand Down
24 changes: 12 additions & 12 deletions lib/src/androidTest/java/com/lambdapioneer/argon2kt/Argon2KtTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

package com.lambdapioneer.argon2kt

import org.assertj.core.api.Assertions.assertThat
import org.assertj.core.api.Assertions.fail
import com.google.common.truth.Truth.assertThat
import org.junit.Assert.fail
import org.junit.Test

class Argon2KtTest {
Expand All @@ -27,7 +27,7 @@ class Argon2KtTest {
mCostInKibibyte = 1024,
hashLengthInBytes = 32
)
assertThat(result.rawHashAsByteArray()).hasSize(32)
assertThat(result.rawHashAsByteArray()).hasLength(32)
}
}

Expand All @@ -41,8 +41,8 @@ class Argon2KtTest {
)
assertThisLineNotExecuted()
} catch (e: Argon2Exception) {
assertThat(e.message).containsIgnoringCase("-6")
assertThat(e.message).containsIgnoringCase("ARGON2_SALT_TOO_SHORT")
assertThat(e.message).contains("-6")
assertThat(e.message).contains("ARGON2_SALT_TOO_SHORT")
}
}

Expand All @@ -60,8 +60,8 @@ class Argon2KtTest {
)
assertThisLineNotExecuted()
} catch (e: Argon2Exception) {
assertThat(e.message).containsIgnoringCase("-32")
assertThat(e.message).containsIgnoringCase("ARGON2_DECODING_FAIL")
assertThat(e.message).contains("-32")
assertThat(e.message).contains("ARGON2_DECODING_FAIL")
}
}

Expand All @@ -75,8 +75,8 @@ class Argon2KtTest {
)
assertThisLineNotExecuted()
} catch (e: Argon2Exception) {
assertThat(e.message).containsIgnoringCase("-32")
assertThat(e.message).containsIgnoringCase("ARGON2_DECODING_FAIL")
assertThat(e.message).contains("-32")
assertThat(e.message).contains("ARGON2_DECODING_FAIL")
}
}

Expand All @@ -90,8 +90,8 @@ class Argon2KtTest {
)
assertThisLineNotExecuted()
} catch (e: Argon2Exception) {
assertThat(e.message).containsIgnoringCase("-6")
assertThat(e.message).containsIgnoringCase("ARGON2_SALT_TOO_SHORT")
assertThat(e.message).contains("-6")
assertThat(e.message).contains("ARGON2_SALT_TOO_SHORT")
}
}

Expand Down Expand Up @@ -371,4 +371,4 @@ private fun runTest(
assertThat(verificationResult).isTrue()
}

private fun assertThisLineNotExecuted() = fail<Void>("This line shouldn't be executed (most likely expected exception)")
private fun assertThisLineNotExecuted() = fail("This line shouldn't be executed (most likely expected exception)")
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

package com.lambdapioneer.argon2kt

import org.assertj.core.api.Assertions.assertThat
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import java.lang.IllegalArgumentException

Expand All @@ -15,8 +15,8 @@ class Argon2ErrorTest {
fun argon2Exception_whenCreatedFromCode_thenContainsMessageAndCode() {
val error = Argon2Exception.fromErrorCode(-6)

assertThat(error.message).containsIgnoringCase("ARGON2_SALT_TOO_SHORT")
assertThat(error.message).containsIgnoringCase("-6")
assertThat(error.message).contains("ARGON2_SALT_TOO_SHORT")
assertThat(error.message).contains("-6")
}

@Test(expected = IllegalArgumentException::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

package com.lambdapioneer.argon2kt

import org.assertj.core.api.Assertions.assertThat
import com.google.common.truth.Truth.assertThat
import org.junit.Test

class Argon2KtBenchmarkUnitTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

package com.lambdapioneer.argon2kt

import org.assertj.core.api.Assertions.assertThat
import com.google.common.truth.Truth.assertThat
import org.junit.Test

class Argon2KtUtilsTest {
Expand Down