aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/pull_request.yml2
-rw-r--r--autofill-parser/api.txt154
-rw-r--r--autofill-parser/api/autofill-parser.api126
-rw-r--r--build-logic/android-plugins/build.gradle.kts1
-rw-r--r--build-logic/android-plugins/src/main/kotlin/app/passwordstore/gradle/PublishedAndroidLibraryPlugin.kt10
-rw-r--r--build-logic/kotlin-plugins/build.gradle.kts5
-rw-r--r--build-logic/kotlin-plugins/src/main/kotlin/app/passwordstore/gradle/BinaryCompatibilityPlugin.kt34
-rw-r--r--build-logic/settings.gradle.kts10
-rw-r--r--build.gradle.kts1
-rw-r--r--gradle/libs.versions.toml2
-rw-r--r--scripts/pre-push-hook.sh8
-rw-r--r--settings.gradle.kts2
12 files changed, 182 insertions, 173 deletions
diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml
index a27f3c1e..8ead698d 100644
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -175,7 +175,7 @@ jobs:
if: "${{ steps.service-changed.outputs.result == 'true' }}"
uses: gradle/gradle-build-action@v2.3.2
with:
- arguments: apiCheck
+ arguments: metalavaCheckCompatibilityRelease
gradle-home-cache-cleanup: true
- name: Upload Kotlin build report
diff --git a/autofill-parser/api.txt b/autofill-parser/api.txt
new file mode 100644
index 00000000..16aa5931
--- /dev/null
+++ b/autofill-parser/api.txt
@@ -0,0 +1,154 @@
+// Signature format: 4.0
+package com.github.androidpasswordstore.autofillparser {
+
+ public enum AutofillAction {
+ method public static com.github.androidpasswordstore.autofillparser.AutofillAction valueOf(String name) throws java.lang.IllegalArgumentException;
+ method public static com.github.androidpasswordstore.autofillparser.AutofillAction[] values();
+ enum_constant public static final com.github.androidpasswordstore.autofillparser.AutofillAction FillOtpFromSms;
+ enum_constant public static final com.github.androidpasswordstore.autofillparser.AutofillAction Generate;
+ enum_constant public static final com.github.androidpasswordstore.autofillparser.AutofillAction Match;
+ enum_constant public static final com.github.androidpasswordstore.autofillparser.AutofillAction Search;
+ }
+
+ public final class AutofillHelperKt {
+ method public static String computeCertificatesHash(android.content.Context context, String appPackage);
+ }
+
+ @RequiresApi(android.os.Build.VERSION_CODES.O) public abstract sealed class AutofillScenario<T> {
+ method public final java.util.List<T> getFieldsToSave();
+ method public final boolean getHasFieldsToSave();
+ method public final boolean getHasPasswordFieldsToSave();
+ method public final boolean getHasUsername();
+ method public abstract java.util.List<T> getPasswordFieldsToSave();
+ method public abstract T? getUsername();
+ method public final boolean hasFieldsToFillOn(com.github.androidpasswordstore.autofillparser.AutofillAction action);
+ property public final java.util.List<T> fieldsToSave;
+ property public final boolean hasFieldsToSave;
+ property public final boolean hasPasswordFieldsToSave;
+ property public final boolean hasUsername;
+ property public abstract java.util.List<T> passwordFieldsToSave;
+ property public abstract T? username;
+ field public static final com.github.androidpasswordstore.autofillparser.AutofillScenario.Companion Companion;
+ }
+
+ public static final class AutofillScenario.Companion {
+ method @Deprecated public com.github.androidpasswordstore.autofillparser.AutofillScenario<android.view.autofill.AutofillId>? fromBundle(android.os.Bundle clientState);
+ method public com.github.androidpasswordstore.autofillparser.AutofillScenario<android.view.autofill.AutofillId>? fromClientState(android.os.Bundle clientState);
+ }
+
+ public final class AutofillScenarioKt {
+ method @RequiresApi(android.os.Build.VERSION_CODES.O) public static void fillWithAutofillId(android.service.autofill.Dataset.Builder, com.github.androidpasswordstore.autofillparser.AutofillScenario<android.view.autofill.AutofillId> scenario, com.github.androidpasswordstore.autofillparser.AutofillAction action, com.github.androidpasswordstore.autofillparser.Credentials? credentials);
+ method @RequiresApi(android.os.Build.VERSION_CODES.O) public static String? getPasswordValue(com.github.androidpasswordstore.autofillparser.AutofillScenario<? extends android.app.assist.AssistStructure.ViewNode>);
+ method @RequiresApi(android.os.Build.VERSION_CODES.O) public static String? getUsernameValue(com.github.androidpasswordstore.autofillparser.AutofillScenario<? extends android.app.assist.AssistStructure.ViewNode>);
+ method @RequiresApi(android.os.Build.VERSION_CODES.O) public static com.github.androidpasswordstore.autofillparser.AutofillScenario<android.app.assist.AssistStructure.ViewNode>? recoverNodes(com.github.androidpasswordstore.autofillparser.AutofillScenario<android.view.autofill.AutofillId>, android.app.assist.AssistStructure structure);
+ }
+
+ public final class AutofillStrategyDslKt {
+ }
+
+ public final class AutofillStrategyKt {
+ }
+
+ public enum BrowserAutofillSupportLevel {
+ method public static com.github.androidpasswordstore.autofillparser.BrowserAutofillSupportLevel valueOf(String name) throws java.lang.IllegalArgumentException;
+ method public static com.github.androidpasswordstore.autofillparser.BrowserAutofillSupportLevel[] values();
+ enum_constant public static final com.github.androidpasswordstore.autofillparser.BrowserAutofillSupportLevel FlakyFill;
+ enum_constant public static final com.github.androidpasswordstore.autofillparser.BrowserAutofillSupportLevel GeneralFill;
+ enum_constant public static final com.github.androidpasswordstore.autofillparser.BrowserAutofillSupportLevel GeneralFillAndSave;
+ enum_constant public static final com.github.androidpasswordstore.autofillparser.BrowserAutofillSupportLevel None;
+ enum_constant public static final com.github.androidpasswordstore.autofillparser.BrowserAutofillSupportLevel PasswordFill;
+ enum_constant public static final com.github.androidpasswordstore.autofillparser.BrowserAutofillSupportLevel PasswordFillAndSaveIfNoAccessibility;
+ }
+
+ public final class Credentials {
+ ctor public Credentials(String? username, String? password, String? otp);
+ method public String? component1();
+ method public String? component2();
+ method public String? component3();
+ method public com.github.androidpasswordstore.autofillparser.Credentials copy(String? username, String? password, String? otp);
+ method public String? getOtp();
+ method public String? getPassword();
+ method public String? getUsername();
+ property public final String? otp;
+ property public final String? password;
+ property public final String? username;
+ }
+
+ public final class FeatureAndTrustDetectionKt {
+ method @RequiresApi(android.os.Build.VERSION_CODES.O) public static java.util.List<kotlin.Pair<java.lang.String,com.github.androidpasswordstore.autofillparser.BrowserAutofillSupportLevel>> getInstalledBrowsersWithAutofillSupportLevel(android.content.Context context);
+ }
+
+ @RequiresApi(android.os.Build.VERSION_CODES.O) public final class FillableForm {
+ method public com.github.androidpasswordstore.autofillparser.FormOrigin getFormOrigin();
+ method public java.util.List<android.view.autofill.AutofillId> getIgnoredIds();
+ method public Integer? getSaveFlags();
+ method public com.github.androidpasswordstore.autofillparser.AutofillScenario<android.view.autofill.AutofillId> getScenario();
+ method public android.os.Bundle toClientState();
+ property public final com.github.androidpasswordstore.autofillparser.FormOrigin formOrigin;
+ property public final java.util.List<android.view.autofill.AutofillId> ignoredIds;
+ property public final Integer? saveFlags;
+ property public final com.github.androidpasswordstore.autofillparser.AutofillScenario<android.view.autofill.AutofillId> scenario;
+ field public static final com.github.androidpasswordstore.autofillparser.FillableForm.Companion Companion;
+ }
+
+ public static final class FillableForm.Companion {
+ method public com.github.androidpasswordstore.autofillparser.FillableForm? parseAssistStructure(android.content.Context context, android.app.assist.AssistStructure structure, boolean isManualRequest, optional kotlin.sequences.Sequence<java.lang.String> customSuffixes);
+ }
+
+ @RequiresApi(android.os.Build.VERSION_CODES.O) public final class FixedSaveCallback {
+ ctor public FixedSaveCallback(android.content.Context context, android.service.autofill.SaveCallback callback);
+ method public void onFailure(CharSequence message);
+ method public void onSuccess(android.content.IntentSender intentSender);
+ }
+
+ public abstract sealed class FormOrigin {
+ method public String getIdentifier();
+ method public final String getPrettyIdentifier(android.content.Context context, optional boolean untrusted);
+ method public final android.os.Bundle toBundle();
+ property public String identifier;
+ field public static final com.github.androidpasswordstore.autofillparser.FormOrigin.Companion Companion;
+ }
+
+ public static final class FormOrigin.App extends com.github.androidpasswordstore.autofillparser.FormOrigin {
+ ctor public FormOrigin.App(String identifier);
+ method public String component1();
+ method public com.github.androidpasswordstore.autofillparser.FormOrigin.App copy(String identifier);
+ property public String identifier;
+ }
+
+ public static final class FormOrigin.Companion {
+ method public com.github.androidpasswordstore.autofillparser.FormOrigin? fromBundle(android.os.Bundle bundle);
+ }
+
+ public static final class FormOrigin.Web extends com.github.androidpasswordstore.autofillparser.FormOrigin {
+ ctor public FormOrigin.Web(String identifier);
+ method public String component1();
+ method public com.github.androidpasswordstore.autofillparser.FormOrigin.Web copy(String identifier);
+ property public String identifier;
+ }
+
+ public final class PublicSuffixListCacheKt {
+ method public static void cachePublicSuffixList(android.content.Context context);
+ }
+
+}
+
+package mozilla.components.lib.publicsuffixlist {
+
+ public final class PublicSuffixListLoaderKt {
+ }
+
+ public final class PublicSuffixListLoaderTest {
+ ctor public PublicSuffixListLoaderTest();
+ method public void testLoadingBundledPublicSuffixList();
+ }
+
+}
+
+package mozilla.components.lib.publicsuffixlist.ext {
+
+ public final class ByteArrayKt {
+ }
+
+}
+
diff --git a/autofill-parser/api/autofill-parser.api b/autofill-parser/api/autofill-parser.api
deleted file mode 100644
index 8ce4b41c..00000000
--- a/autofill-parser/api/autofill-parser.api
+++ /dev/null
@@ -1,126 +0,0 @@
-public final class com/github/androidpasswordstore/autofillparser/AutofillAction : java/lang/Enum {
- public static final field FillOtpFromSms Lcom/github/androidpasswordstore/autofillparser/AutofillAction;
- public static final field Generate Lcom/github/androidpasswordstore/autofillparser/AutofillAction;
- public static final field Match Lcom/github/androidpasswordstore/autofillparser/AutofillAction;
- public static final field Search Lcom/github/androidpasswordstore/autofillparser/AutofillAction;
- public static fun valueOf (Ljava/lang/String;)Lcom/github/androidpasswordstore/autofillparser/AutofillAction;
- public static fun values ()[Lcom/github/androidpasswordstore/autofillparser/AutofillAction;
-}
-
-public final class com/github/androidpasswordstore/autofillparser/AutofillHelperKt {
- public static final fun computeCertificatesHash (Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String;
-}
-
-public abstract class com/github/androidpasswordstore/autofillparser/AutofillScenario {
- public static final field Companion Lcom/github/androidpasswordstore/autofillparser/AutofillScenario$Companion;
- public final fun getFieldsToSave ()Ljava/util/List;
- public final fun getHasFieldsToSave ()Z
- public final fun getHasPasswordFieldsToSave ()Z
- public final fun getHasUsername ()Z
- public abstract fun getPasswordFieldsToSave ()Ljava/util/List;
- public abstract fun getUsername ()Ljava/lang/Object;
- public final fun hasFieldsToFillOn (Lcom/github/androidpasswordstore/autofillparser/AutofillAction;)Z
-}
-
-public final class com/github/androidpasswordstore/autofillparser/AutofillScenario$Companion {
- public final fun fromBundle (Landroid/os/Bundle;)Lcom/github/androidpasswordstore/autofillparser/AutofillScenario;
- public final fun fromClientState (Landroid/os/Bundle;)Lcom/github/androidpasswordstore/autofillparser/AutofillScenario;
-}
-
-public final class com/github/androidpasswordstore/autofillparser/AutofillScenarioKt {
- public static final fun fillWithAutofillId (Landroid/service/autofill/Dataset$Builder;Lcom/github/androidpasswordstore/autofillparser/AutofillScenario;Lcom/github/androidpasswordstore/autofillparser/AutofillAction;Lcom/github/androidpasswordstore/autofillparser/Credentials;)V
- public static final fun getPasswordValue (Lcom/github/androidpasswordstore/autofillparser/AutofillScenario;)Ljava/lang/String;
- public static final fun getUsernameValue (Lcom/github/androidpasswordstore/autofillparser/AutofillScenario;)Ljava/lang/String;
- public static final fun recoverNodes (Lcom/github/androidpasswordstore/autofillparser/AutofillScenario;Landroid/app/assist/AssistStructure;)Lcom/github/androidpasswordstore/autofillparser/AutofillScenario;
-}
-
-public final class com/github/androidpasswordstore/autofillparser/BrowserAutofillSupportLevel : java/lang/Enum {
- public static final field FlakyFill Lcom/github/androidpasswordstore/autofillparser/BrowserAutofillSupportLevel;
- public static final field GeneralFill Lcom/github/androidpasswordstore/autofillparser/BrowserAutofillSupportLevel;
- public static final field GeneralFillAndSave Lcom/github/androidpasswordstore/autofillparser/BrowserAutofillSupportLevel;
- public static final field None Lcom/github/androidpasswordstore/autofillparser/BrowserAutofillSupportLevel;
- public static final field PasswordFill Lcom/github/androidpasswordstore/autofillparser/BrowserAutofillSupportLevel;
- public static final field PasswordFillAndSaveIfNoAccessibility Lcom/github/androidpasswordstore/autofillparser/BrowserAutofillSupportLevel;
- public static fun valueOf (Ljava/lang/String;)Lcom/github/androidpasswordstore/autofillparser/BrowserAutofillSupportLevel;
- public static fun values ()[Lcom/github/androidpasswordstore/autofillparser/BrowserAutofillSupportLevel;
-}
-
-public final class com/github/androidpasswordstore/autofillparser/Credentials {
- public fun <init> (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
- public final fun component1 ()Ljava/lang/String;
- public final fun component2 ()Ljava/lang/String;
- public final fun component3 ()Ljava/lang/String;
- public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lcom/github/androidpasswordstore/autofillparser/Credentials;
- public static synthetic fun copy$default (Lcom/github/androidpasswordstore/autofillparser/Credentials;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lcom/github/androidpasswordstore/autofillparser/Credentials;
- public fun equals (Ljava/lang/Object;)Z
- public final fun getOtp ()Ljava/lang/String;
- public final fun getPassword ()Ljava/lang/String;
- public final fun getUsername ()Ljava/lang/String;
- public fun hashCode ()I
- public fun toString ()Ljava/lang/String;
-}
-
-public final class com/github/androidpasswordstore/autofillparser/FeatureAndTrustDetectionKt {
- public static final fun getInstalledBrowsersWithAutofillSupportLevel (Landroid/content/Context;)Ljava/util/List;
-}
-
-public final class com/github/androidpasswordstore/autofillparser/FillableForm {
- public static final field Companion Lcom/github/androidpasswordstore/autofillparser/FillableForm$Companion;
- public synthetic fun <init> (Lcom/github/androidpasswordstore/autofillparser/FormOrigin;Lcom/github/androidpasswordstore/autofillparser/AutofillScenario;Ljava/util/List;Ljava/lang/Integer;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public final fun getFormOrigin ()Lcom/github/androidpasswordstore/autofillparser/FormOrigin;
- public final fun getIgnoredIds ()Ljava/util/List;
- public final fun getSaveFlags ()Ljava/lang/Integer;
- public final fun getScenario ()Lcom/github/androidpasswordstore/autofillparser/AutofillScenario;
- public final fun toClientState ()Landroid/os/Bundle;
-}
-
-public final class com/github/androidpasswordstore/autofillparser/FillableForm$Companion {
- public final fun parseAssistStructure (Landroid/content/Context;Landroid/app/assist/AssistStructure;ZLkotlin/sequences/Sequence;)Lcom/github/androidpasswordstore/autofillparser/FillableForm;
- public static synthetic fun parseAssistStructure$default (Lcom/github/androidpasswordstore/autofillparser/FillableForm$Companion;Landroid/content/Context;Landroid/app/assist/AssistStructure;ZLkotlin/sequences/Sequence;ILjava/lang/Object;)Lcom/github/androidpasswordstore/autofillparser/FillableForm;
-}
-
-public final class com/github/androidpasswordstore/autofillparser/FixedSaveCallback {
- public fun <init> (Landroid/content/Context;Landroid/service/autofill/SaveCallback;)V
- public final fun onFailure (Ljava/lang/CharSequence;)V
- public final fun onSuccess (Landroid/content/IntentSender;)V
-}
-
-public abstract class com/github/androidpasswordstore/autofillparser/FormOrigin {
- public static final field Companion Lcom/github/androidpasswordstore/autofillparser/FormOrigin$Companion;
- public synthetic fun <init> (Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
- public fun getIdentifier ()Ljava/lang/String;
- public final fun getPrettyIdentifier (Landroid/content/Context;Z)Ljava/lang/String;
- public static synthetic fun getPrettyIdentifier$default (Lcom/github/androidpasswordstore/autofillparser/FormOrigin;Landroid/content/Context;ZILjava/lang/Object;)Ljava/lang/String;
- public final fun toBundle ()Landroid/os/Bundle;
-}
-
-public final class com/github/androidpasswordstore/autofillparser/FormOrigin$App : com/github/androidpasswordstore/autofillparser/FormOrigin {
- public fun <init> (Ljava/lang/String;)V
- public final fun component1 ()Ljava/lang/String;
- public final fun copy (Ljava/lang/String;)Lcom/github/androidpasswordstore/autofillparser/FormOrigin$App;
- public static synthetic fun copy$default (Lcom/github/androidpasswordstore/autofillparser/FormOrigin$App;Ljava/lang/String;ILjava/lang/Object;)Lcom/github/androidpasswordstore/autofillparser/FormOrigin$App;
- public fun equals (Ljava/lang/Object;)Z
- public fun getIdentifier ()Ljava/lang/String;
- public fun hashCode ()I
- public fun toString ()Ljava/lang/String;
-}
-
-public final class com/github/androidpasswordstore/autofillparser/FormOrigin$Companion {
- public final fun fromBundle (Landroid/os/Bundle;)Lcom/github/androidpasswordstore/autofillparser/FormOrigin;
-}
-
-public final class com/github/androidpasswordstore/autofillparser/FormOrigin$Web : com/github/androidpasswordstore/autofillparser/FormOrigin {
- public fun <init> (Ljava/lang/String;)V
- public final fun component1 ()Ljava/lang/String;
- public final fun copy (Ljava/lang/String;)Lcom/github/androidpasswordstore/autofillparser/FormOrigin$Web;
- public static synthetic fun copy$default (Lcom/github/androidpasswordstore/autofillparser/FormOrigin$Web;Ljava/lang/String;ILjava/lang/Object;)Lcom/github/androidpasswordstore/autofillparser/FormOrigin$Web;
- public fun equals (Ljava/lang/Object;)Z
- public fun getIdentifier ()Ljava/lang/String;
- public fun hashCode ()I
- public fun toString ()Ljava/lang/String;
-}
-
-public final class com/github/androidpasswordstore/autofillparser/PublicSuffixListCacheKt {
- public static final fun cachePublicSuffixList (Landroid/content/Context;)V
-}
-
diff --git a/build-logic/android-plugins/build.gradle.kts b/build-logic/android-plugins/build.gradle.kts
index e3ab454f..870f5d18 100644
--- a/build-logic/android-plugins/build.gradle.kts
+++ b/build-logic/android-plugins/build.gradle.kts
@@ -56,6 +56,7 @@ gradlePlugin {
dependencies {
implementation(libs.build.agp)
implementation(libs.build.mavenpublish)
+ implementation(libs.build.metalava)
implementation(libs.build.r8)
implementation(libs.build.semver)
implementation(libs.build.sentry)
diff --git a/build-logic/android-plugins/src/main/kotlin/app/passwordstore/gradle/PublishedAndroidLibraryPlugin.kt b/build-logic/android-plugins/src/main/kotlin/app/passwordstore/gradle/PublishedAndroidLibraryPlugin.kt
index b005043b..542bfeb6 100644
--- a/build-logic/android-plugins/src/main/kotlin/app/passwordstore/gradle/PublishedAndroidLibraryPlugin.kt
+++ b/build-logic/android-plugins/src/main/kotlin/app/passwordstore/gradle/PublishedAndroidLibraryPlugin.kt
@@ -5,6 +5,8 @@ package app.passwordstore.gradle
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.MavenPublishPlugin
import com.vanniktech.maven.publish.SonatypeHost
+import me.tylerbwong.gradle.metalava.Documentation
+import me.tylerbwong.gradle.metalava.extension.MetalavaExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.apply
@@ -21,6 +23,7 @@ class PublishedAndroidLibraryPlugin : Plugin<Project> {
apply(LibraryPlugin::class)
apply(MavenPublishPlugin::class)
apply(SigningPlugin::class)
+ apply("me.tylerbwong.gradle.metalava")
}
project.extensions.getByType<MavenPublishBaseExtension>().run {
publishToMavenCentral(SonatypeHost.DEFAULT, true)
@@ -33,5 +36,12 @@ class PublishedAndroidLibraryPlugin : Plugin<Project> {
useInMemoryPgpKeys(signingKey, signingPassword)
}
}
+ project.extensions.getByType<MetalavaExtension>().run {
+ documentation.set(Documentation.PUBLIC)
+ inputKotlinNulls.set(true)
+ outputKotlinNulls.set(true)
+ reportLintsAsErrors.set(true)
+ reportWarningsAsErrors.set(true)
+ }
}
}
diff --git a/build-logic/kotlin-plugins/build.gradle.kts b/build-logic/kotlin-plugins/build.gradle.kts
index d891ec0d..1a547454 100644
--- a/build-logic/kotlin-plugins/build.gradle.kts
+++ b/build-logic/kotlin-plugins/build.gradle.kts
@@ -26,10 +26,6 @@ afterEvaluate {
gradlePlugin {
plugins {
- register("binary-compatibility") {
- id = "com.github.android-password-store.binary-compatibility"
- implementationClass = "app.passwordstore.gradle.BinaryCompatibilityPlugin"
- }
register("kotlin-android") {
id = "com.github.android-password-store.kotlin-android"
implementationClass = "app.passwordstore.gradle.KotlinAndroidPlugin"
@@ -59,7 +55,6 @@ gradlePlugin {
dependencies {
implementation(libs.build.agp)
- implementation(libs.build.binarycompat)
implementation(libs.build.detekt)
implementation(libs.build.kotlin)
implementation(libs.build.r8)
diff --git a/build-logic/kotlin-plugins/src/main/kotlin/app/passwordstore/gradle/BinaryCompatibilityPlugin.kt b/build-logic/kotlin-plugins/src/main/kotlin/app/passwordstore/gradle/BinaryCompatibilityPlugin.kt
deleted file mode 100644
index a64d8fb3..00000000
--- a/build-logic/kotlin-plugins/src/main/kotlin/app/passwordstore/gradle/BinaryCompatibilityPlugin.kt
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
- * SPDX-License-Identifier: GPL-3.0-only
- */
-
-package app.passwordstore.gradle
-
-import kotlinx.validation.ApiValidationExtension
-import kotlinx.validation.BinaryCompatibilityValidatorPlugin
-import org.gradle.api.Plugin
-import org.gradle.api.Project
-import org.gradle.kotlin.dsl.apply
-import org.gradle.kotlin.dsl.getByType
-
-@Suppress("Unused")
-class BinaryCompatibilityPlugin : Plugin<Project> {
-
- override fun apply(project: Project) {
- project.pluginManager.apply(BinaryCompatibilityValidatorPlugin::class)
- project.extensions.getByType<ApiValidationExtension>().ignoredProjects =
- mutableSetOf(
- "app",
- "coroutine-utils",
- "coroutine-utils-testing",
- "crypto-common",
- "crypto-pgpainless",
- "format-common",
- "diceware",
- "random",
- "sentry-stub",
- "ui-compose",
- )
- }
-}
diff --git a/build-logic/settings.gradle.kts b/build-logic/settings.gradle.kts
index bb233022..07992f1a 100644
--- a/build-logic/settings.gradle.kts
+++ b/build-logic/settings.gradle.kts
@@ -9,7 +9,7 @@ rootProject.name = "build-logic"
dependencyResolutionManagement {
repositories {
exclusiveContent {
- forRepository(::google)
+ forRepository { google() }
filter {
includeGroup("androidx.databinding")
includeGroup("com.android")
@@ -31,11 +31,15 @@ dependencyResolutionManagement {
includeModule("com.android.tools", "repository")
includeModule("com.android.tools", "sdklib")
includeModule("com.android.tools", "sdk-common")
+ includeModule("com.android.tools.metalava", "metalava")
}
}
exclusiveContent {
- forRepository(::gradlePluginPortal)
- filter { includeModule("com.github.ben-manes", "gradle-versions-plugin") }
+ forRepository { gradlePluginPortal() }
+ filter {
+ includeModule("com.github.ben-manes", "gradle-versions-plugin")
+ includeModule("me.tylerbwong.gradle.metalava", "plugin")
+ }
}
exclusiveContent {
forRepository { maven("https://storage.googleapis.com/r8-releases/raw") }
diff --git a/build.gradle.kts b/build.gradle.kts
index 9b77f32d..0ad75cd6 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -6,7 +6,6 @@
plugins {
id("com.github.android-password-store.kotlin-common")
- id("com.github.android-password-store.binary-compatibility")
id("com.github.android-password-store.git-hooks")
id("com.github.android-password-store.spotless")
id("com.github.android-password-store.versions")
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 6acbf8d5..8375b28a 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -37,11 +37,11 @@ androidx-swiperefreshlayout = "androidx.swiperefreshlayout:swiperefreshlayout:1.
aps-sublimeFuzzy = "com.github.android-password-store:sublime-fuzzy:2.2.1"
aps-zxingAndroidEmbedded = "com.github.android-password-store:zxing-android-embedded:4.2.1"
build-agp = { module = "com.android.tools.build:gradle", version.ref = "agp" }
-build-binarycompat = "org.jetbrains.kotlinx:binary-compatibility-validator:0.11.1"
build-detekt = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.21.0"
build-download = "de.undercouch:gradle-download-task:5.3.0"
build-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
build-mavenpublish = "com.vanniktech:gradle-maven-publish-plugin:0.22.0"
+build-metalava = "me.tylerbwong.gradle.metalava:plugin:0.3.2"
build-okhttp = "com.squareup.okhttp3:okhttp:4.10.0"
build-r8 = "com.android.tools:r8:4.0.18-dev"
build-semver = "com.vdurmont:semver4j:3.1.0"
diff --git a/scripts/pre-push-hook.sh b/scripts/pre-push-hook.sh
index 9cfbc9e1..6580b9c7 100644
--- a/scripts/pre-push-hook.sh
+++ b/scripts/pre-push-hook.sh
@@ -7,8 +7,12 @@ set -o pipefail
ZERO="0000000000000000000000000000000000000000"
GRADLE_EXEC="${GRADLE_EXEC:-./gradlew}"
-while read local_ref local_oid remote_ref remote_oid; do
+while read -r local_ref local_oid remote_ref remote_oid; do
+ # These useless assignments are to silence warnings from shellcheck about unused variables
+ _=$local_ref
+ _=$remote_ref
+ _=$remote_oid
if [ "${local_oid}" != "${ZERO}" ]; then
- "${GRADLE_EXEC}" apiCheck detekt spotlessCheck test -PslimTests
+ "${GRADLE_EXEC}" metalavaCheckCompatibilityRelease detekt spotlessCheck test -PslimTests
fi
done
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 32330fce..df15a3a0 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -41,6 +41,7 @@ pluginManagement {
includeModule("com.github.ben-manes", "gradle-versions-plugin")
includeModule("com.gradle", "gradle-enterprise-gradle-plugin")
includeModule("com.gradle.enterprise", "com.gradle.enterprise.gradle.plugin")
+ includeModule("me.tylerbwong.gradle.metalava", "plugin")
}
}
exclusiveContent {
@@ -141,6 +142,7 @@ dependencyResolutionManagement {
includeModule("com.android.tools", "repository")
includeModule("com.android.tools", "sdklib")
includeModule("com.android.tools", "sdk-common")
+ includeModule("com.android.tools.metalava", "metalava")
includeModule("com.google.android.material", "material")
}
}