Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 8cfe6ec

Browse files
committed
refactor: merge format-common-impl into format-common
Also converts the format-common module into an Android library since UriTotpFinder requires the Android SDK.
1 parent 39a0284 commit 8cfe6ec

File tree

11 files changed

+23
-41
lines changed

11 files changed

+23
-41
lines changed

app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ dependencies {
5858
implementation(projects.autofillParser)
5959
implementation(projects.coroutineUtils)
6060
implementation(projects.cryptoPgpainless)
61-
implementation(projects.formatCommonImpl)
61+
implementation(projects.formatCommon)
6262
implementation(projects.passgen.diceware)
6363
implementation(projects.passgen.random)
6464
implementation(projects.uiCompose)

detekt-baselines/format-common-impl.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

detekt-baselines/format-common.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
<?xml version='1.0' encoding='UTF-8'?>
1+
<?xml version="1.0" ?>
22
<SmellBaseline>
3-
<ManuallySuppressedIssues/>
4-
<CurrentIssues/>
3+
<ManuallySuppressedIssues></ManuallySuppressedIssues>
4+
<CurrentIssues>
5+
<ID>MaxLineLength:UriTotpFinderTest.kt$UriTotpFinderTest.Companion$"otpauth://totp/ACME%20Co:[email protected]?secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ&amp;issuer=ACME%20Co&amp;algorithm=SHA256&amp;digits=12&amp;period=25"</ID>
6+
<ID>ReturnCount:UriTotpFinder.kt$UriTotpFinder$override fun findSecret(content: String): String?</ID>
7+
</CurrentIssues>
58
</SmellBaseline>

format-common-impl/build.gradle.kts

Lines changed: 0 additions & 23 deletions
This file was deleted.

format-common/build.gradle.kts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,27 @@
55
@file:Suppress("DSL_SCOPE_VIOLATION", "UnstableApiUsage")
66

77
plugins {
8-
kotlin("jvm")
8+
id("com.github.android-password-store.android-library")
9+
id("com.github.android-password-store.kotlin-android")
910
id("com.github.android-password-store.kotlin-library")
1011
}
1112

13+
android {
14+
namespace = "app.passwordstore.format.common"
15+
compileOptions { isCoreLibraryDesugaringEnabled = true }
16+
}
17+
1218
dependencies {
19+
api(libs.kotlin.coroutines.core)
1320
api(libs.thirdparty.kotlinResult)
21+
compileOnly(libs.androidx.annotation)
22+
coreLibraryDesugaring(libs.android.desugarJdkLibs)
1423
implementation(projects.coroutineUtils)
15-
implementation(libs.androidx.annotation)
1624
implementation(libs.dagger.hilt.core)
1725
implementation(libs.thirdparty.commons.codec)
18-
implementation(libs.kotlin.coroutines.core)
26+
testImplementation(projects.coroutineUtilsTesting)
27+
testImplementation(libs.bundles.testDependencies)
28+
testImplementation(libs.kotlin.coroutines.test)
29+
testImplementation(libs.testing.robolectric)
30+
testImplementation(libs.testing.turbine)
1931
}

format-common-impl/src/test/kotlin/app/passwordstore/data/passfile/PasswordEntryTest.kt renamed to format-common/src/test/kotlin/app/passwordstore/data/passfile/PasswordEntryTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class PasswordEntryTest {
153153
/**
154154
* Same as [generatesOtpFromTotpUri], but advances the clock by 5 seconds. This exercises the
155155
* [Totp.remainingTime] calculation logic, and acts as a regression test to resolve the bug which
156-
* blocked https://msfjarvis.dev/aps/issue/1550.
156+
* blocked https://github.com/Android-Password-Store/Android-Password-Store/issues/1550.
157157
*/
158158
@Test
159159
fun generatedOtpHasCorrectRemainingTime() = runTest {

0 commit comments

Comments
 (0)