refactor: merge format-common-impl into format-common

Also converts the format-common module into an Android library since
UriTotpFinder requires the Android SDK.
This commit is contained in:
Harsh Shandilya 2022-12-19 16:47:17 +05:30
parent 39a0284cd5
commit 8cfe6ec84c
No known key found for this signature in database
11 changed files with 23 additions and 41 deletions

View file

@ -58,7 +58,7 @@ dependencies {
implementation(projects.autofillParser) implementation(projects.autofillParser)
implementation(projects.coroutineUtils) implementation(projects.coroutineUtils)
implementation(projects.cryptoPgpainless) implementation(projects.cryptoPgpainless)
implementation(projects.formatCommonImpl) implementation(projects.formatCommon)
implementation(projects.passgen.diceware) implementation(projects.passgen.diceware)
implementation(projects.passgen.random) implementation(projects.passgen.random)
implementation(projects.uiCompose) implementation(projects.uiCompose)

View file

@ -1,8 +0,0 @@
<?xml version="1.0" ?>
<SmellBaseline>
<ManuallySuppressedIssues></ManuallySuppressedIssues>
<CurrentIssues>
<ID>MaxLineLength:UriTotpFinderTest.kt$UriTotpFinderTest.Companion$"otpauth://totp/ACME%20Co:john@example.com?secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ&amp;issuer=ACME%20Co&amp;algorithm=SHA256&amp;digits=12&amp;period=25"</ID>
<ID>ReturnCount:UriTotpFinder.kt$UriTotpFinder$override fun findSecret(content: String): String?</ID>
</CurrentIssues>
</SmellBaseline>

View file

@ -1,5 +1,8 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version="1.0" ?>
<SmellBaseline> <SmellBaseline>
<ManuallySuppressedIssues/> <ManuallySuppressedIssues></ManuallySuppressedIssues>
<CurrentIssues/> <CurrentIssues>
<ID>MaxLineLength:UriTotpFinderTest.kt$UriTotpFinderTest.Companion$"otpauth://totp/ACME%20Co:john@example.com?secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ&amp;issuer=ACME%20Co&amp;algorithm=SHA256&amp;digits=12&amp;period=25"</ID>
<ID>ReturnCount:UriTotpFinder.kt$UriTotpFinder$override fun findSecret(content: String): String?</ID>
</CurrentIssues>
</SmellBaseline> </SmellBaseline>

View file

@ -1,23 +0,0 @@
/*
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
* SPDX-License-Identifier: GPL-3.0-only
*/
@file:Suppress("DSL_SCOPE_VIOLATION", "UnstableApiUsage")
plugins {
id("com.github.android-password-store.android-library")
id("com.github.android-password-store.kotlin-android")
id("com.github.android-password-store.kotlin-library")
}
android { namespace = "app.passwordstore.format.common.impl" }
dependencies {
api(projects.formatCommon)
implementation(libs.dagger.hilt.core)
testImplementation(projects.coroutineUtilsTesting)
testImplementation(libs.bundles.testDependencies)
testImplementation(libs.kotlin.coroutines.test)
testImplementation(libs.testing.robolectric)
testImplementation(libs.testing.turbine)
}

View file

@ -5,15 +5,27 @@
@file:Suppress("DSL_SCOPE_VIOLATION", "UnstableApiUsage") @file:Suppress("DSL_SCOPE_VIOLATION", "UnstableApiUsage")
plugins { plugins {
kotlin("jvm") id("com.github.android-password-store.android-library")
id("com.github.android-password-store.kotlin-android")
id("com.github.android-password-store.kotlin-library") id("com.github.android-password-store.kotlin-library")
} }
android {
namespace = "app.passwordstore.format.common"
compileOptions { isCoreLibraryDesugaringEnabled = true }
}
dependencies { dependencies {
api(libs.kotlin.coroutines.core)
api(libs.thirdparty.kotlinResult) api(libs.thirdparty.kotlinResult)
compileOnly(libs.androidx.annotation)
coreLibraryDesugaring(libs.android.desugarJdkLibs)
implementation(projects.coroutineUtils) implementation(projects.coroutineUtils)
implementation(libs.androidx.annotation)
implementation(libs.dagger.hilt.core) implementation(libs.dagger.hilt.core)
implementation(libs.thirdparty.commons.codec) implementation(libs.thirdparty.commons.codec)
implementation(libs.kotlin.coroutines.core) testImplementation(projects.coroutineUtilsTesting)
testImplementation(libs.bundles.testDependencies)
testImplementation(libs.kotlin.coroutines.test)
testImplementation(libs.testing.robolectric)
testImplementation(libs.testing.turbine)
} }

View file

@ -153,7 +153,7 @@ class PasswordEntryTest {
/** /**
* Same as [generatesOtpFromTotpUri], but advances the clock by 5 seconds. This exercises the * Same as [generatesOtpFromTotpUri], but advances the clock by 5 seconds. This exercises the
* [Totp.remainingTime] calculation logic, and acts as a regression test to resolve the bug which * [Totp.remainingTime] calculation logic, and acts as a regression test to resolve the bug which
* blocked https://msfjarvis.dev/aps/issue/1550. * blocked https://github.com/Android-Password-Store/Android-Password-Store/issues/1550.
*/ */
@Test @Test
fun generatedOtpHasCorrectRemainingTime() = runTest { fun generatedOtpHasCorrectRemainingTime() = runTest {

View file

@ -179,8 +179,6 @@ include("crypto-pgpainless")
include("format-common") include("format-common")
include("format-common-impl")
include("passgen:diceware") include("passgen:diceware")
include("passgen:random") include("passgen:random")