summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2022-12-19 16:47:17 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2022-12-19 16:47:17 +0530
commit8cfe6ec84c1bd8119fd59fbb76d729da284ced27 (patch)
tree7035f03675f8924bfc3870b68b6345faf020aaac
parent39a0284cd55298eb4930db681e813260aea58867 (diff)
refactor: merge format-common-impl into format-common
Also converts the format-common module into an Android library since UriTotpFinder requires the Android SDK.
-rw-r--r--app/build.gradle.kts2
-rw-r--r--detekt-baselines/format-common-impl.xml8
-rw-r--r--detekt-baselines/format-common.xml9
-rw-r--r--format-common-impl/build.gradle.kts23
-rw-r--r--format-common/build.gradle.kts18
-rw-r--r--format-common/src/main/kotlin/app/passwordstore/util/totp/UriTotpFinder.kt (renamed from format-common-impl/src/main/kotlin/app/passwordstore/util/totp/UriTotpFinder.kt)0
-rw-r--r--format-common/src/test/kotlin/app/passwordstore/data/passfile/PasswordEntryTest.kt (renamed from format-common-impl/src/test/kotlin/app/passwordstore/data/passfile/PasswordEntryTest.kt)2
-rw-r--r--format-common/src/test/kotlin/app/passwordstore/util/time/TestUserClock.kt (renamed from format-common-impl/src/test/kotlin/app/passwordstore/util/time/TestUserClock.kt)0
-rw-r--r--format-common/src/test/kotlin/app/passwordstore/util/totp/OtpTest.kt (renamed from format-common-impl/src/test/kotlin/app/passwordstore/util/totp/OtpTest.kt)0
-rw-r--r--format-common/src/test/kotlin/app/passwordstore/util/totp/UriTotpFinderTest.kt (renamed from format-common-impl/src/test/kotlin/app/passwordstore/util/totp/UriTotpFinderTest.kt)0
-rw-r--r--settings.gradle.kts2
11 files changed, 23 insertions, 41 deletions
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 62e1f857..c4d1cff5 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -58,7 +58,7 @@ dependencies {
implementation(projects.autofillParser)
implementation(projects.coroutineUtils)
implementation(projects.cryptoPgpainless)
- implementation(projects.formatCommonImpl)
+ implementation(projects.formatCommon)
implementation(projects.passgen.diceware)
implementation(projects.passgen.random)
implementation(projects.uiCompose)
diff --git a/detekt-baselines/format-common-impl.xml b/detekt-baselines/format-common-impl.xml
deleted file mode 100644
index 1d731d42..00000000
--- a/detekt-baselines/format-common-impl.xml
+++ /dev/null
@@ -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>
diff --git a/detekt-baselines/format-common.xml b/detekt-baselines/format-common.xml
index c373eea4..1d731d42 100644
--- a/detekt-baselines/format-common.xml
+++ b/detekt-baselines/format-common.xml
@@ -1,5 +1,8 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" ?>
<SmellBaseline>
- <ManuallySuppressedIssues/>
- <CurrentIssues/>
+ <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>
diff --git a/format-common-impl/build.gradle.kts b/format-common-impl/build.gradle.kts
deleted file mode 100644
index f9bd7628..00000000
--- a/format-common-impl/build.gradle.kts
+++ /dev/null
@@ -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)
-}
diff --git a/format-common/build.gradle.kts b/format-common/build.gradle.kts
index a42a2404..34b5c69e 100644
--- a/format-common/build.gradle.kts
+++ b/format-common/build.gradle.kts
@@ -5,15 +5,27 @@
@file:Suppress("DSL_SCOPE_VIOLATION", "UnstableApiUsage")
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")
}
+android {
+ namespace = "app.passwordstore.format.common"
+ compileOptions { isCoreLibraryDesugaringEnabled = true }
+}
+
dependencies {
+ api(libs.kotlin.coroutines.core)
api(libs.thirdparty.kotlinResult)
+ compileOnly(libs.androidx.annotation)
+ coreLibraryDesugaring(libs.android.desugarJdkLibs)
implementation(projects.coroutineUtils)
- implementation(libs.androidx.annotation)
implementation(libs.dagger.hilt.core)
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)
}
diff --git a/format-common-impl/src/main/kotlin/app/passwordstore/util/totp/UriTotpFinder.kt b/format-common/src/main/kotlin/app/passwordstore/util/totp/UriTotpFinder.kt
index 741a21a7..741a21a7 100644
--- a/format-common-impl/src/main/kotlin/app/passwordstore/util/totp/UriTotpFinder.kt
+++ b/format-common/src/main/kotlin/app/passwordstore/util/totp/UriTotpFinder.kt
diff --git a/format-common-impl/src/test/kotlin/app/passwordstore/data/passfile/PasswordEntryTest.kt b/format-common/src/test/kotlin/app/passwordstore/data/passfile/PasswordEntryTest.kt
index 0d77cfe2..31ced9f3 100644
--- a/format-common-impl/src/test/kotlin/app/passwordstore/data/passfile/PasswordEntryTest.kt
+++ b/format-common/src/test/kotlin/app/passwordstore/data/passfile/PasswordEntryTest.kt
@@ -153,7 +153,7 @@ class PasswordEntryTest {
/**
* 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
- * blocked https://msfjarvis.dev/aps/issue/1550.
+ * blocked https://github.com/Android-Password-Store/Android-Password-Store/issues/1550.
*/
@Test
fun generatedOtpHasCorrectRemainingTime() = runTest {
diff --git a/format-common-impl/src/test/kotlin/app/passwordstore/util/time/TestUserClock.kt b/format-common/src/test/kotlin/app/passwordstore/util/time/TestUserClock.kt
index 8a860a39..8a860a39 100644
--- a/format-common-impl/src/test/kotlin/app/passwordstore/util/time/TestUserClock.kt
+++ b/format-common/src/test/kotlin/app/passwordstore/util/time/TestUserClock.kt
diff --git a/format-common-impl/src/test/kotlin/app/passwordstore/util/totp/OtpTest.kt b/format-common/src/test/kotlin/app/passwordstore/util/totp/OtpTest.kt
index 54ac492d..54ac492d 100644
--- a/format-common-impl/src/test/kotlin/app/passwordstore/util/totp/OtpTest.kt
+++ b/format-common/src/test/kotlin/app/passwordstore/util/totp/OtpTest.kt
diff --git a/format-common-impl/src/test/kotlin/app/passwordstore/util/totp/UriTotpFinderTest.kt b/format-common/src/test/kotlin/app/passwordstore/util/totp/UriTotpFinderTest.kt
index c62df0e7..c62df0e7 100644
--- a/format-common-impl/src/test/kotlin/app/passwordstore/util/totp/UriTotpFinderTest.kt
+++ b/format-common/src/test/kotlin/app/passwordstore/util/totp/UriTotpFinderTest.kt
diff --git a/settings.gradle.kts b/settings.gradle.kts
index e051f053..f0df8965 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -179,8 +179,6 @@ include("crypto-pgpainless")
include("format-common")
-include("format-common-impl")
-
include("passgen:diceware")
include("passgen:random")