From eaf76a76f4f7135da281efcfdb1ce669d49d8f07 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Sat, 21 Nov 2020 21:58:09 +0100 Subject: [PATCH] Add binary-compatibility-validator to Chucker --- .github/workflows/pre-merge.yaml | 21 +++++++++++ build.gradle | 11 ++++++ library-no-op/api/library-no-op.api | 56 +++++++++++++++++++++++++++++ library/api/library.api | 55 ++++++++++++++++++++++++++++ 4 files changed, 143 insertions(+) create mode 100644 library-no-op/api/library-no-op.api create mode 100644 library/api/library.api diff --git a/.github/workflows/pre-merge.yaml b/.github/workflows/pre-merge.yaml index b94699fe3..c24c54cb8 100644 --- a/.github/workflows/pre-merge.yaml +++ b/.github/workflows/pre-merge.yaml @@ -76,6 +76,27 @@ jobs: - name: Stop Gradle run: ./gradlew --stop + api-check: + runs-on: [ubuntu-latest] + + steps: + - name: Checkout Repo + uses: actions/checkout@v2 + - name: Cache Gradle Folders + uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches/ + ~/.gradle/wrapper/ + key: cache-gradle-${{ hashFiles('build.gradle') }} + restore-keys: cache-gradle- + + - name: Run apiCheck + run: ./gradlew apiCheck + + - name: Stop Gradle + run: ./gradlew --stop + publish-artifact: runs-on: [ubuntu-latest] diff --git a/build.gradle b/build.gradle index 6eb65a71d..8da76db70 100644 --- a/build.gradle +++ b/build.gradle @@ -20,6 +20,7 @@ buildscript { retrofitVersion = '2.9.0' // Debug and quality control + binaryCompatibilityValidator = '0.2.4' detektVersion = '1.14.0' dokkaVersion = '1.4.10.2' ktLintVersion = '0.39.0' @@ -49,8 +50,18 @@ buildscript { classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion" classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detektVersion" classpath "org.jlleitschuh.gradle:ktlint-gradle:$ktLintGradleVersion" + classpath "org.jetbrains.kotlinx:binary-compatibility-validator:$binaryCompatibilityValidator" } } +apply plugin: 'binary-compatibility-validator' + +apiValidation { + ignoredProjects += ["sample"] + ignoredPackages += [ + "com.chuckerteam.chucker.internal", + "com.chuckerteam.chucker.databinding" + ] +} allprojects { version = VERSION_NAME diff --git a/library-no-op/api/library-no-op.api b/library-no-op/api/library-no-op.api new file mode 100644 index 000000000..b460352bf --- /dev/null +++ b/library-no-op/api/library-no-op.api @@ -0,0 +1,56 @@ +public final class com/chuckerteam/chucker/BuildConfig { + public static final field BUILD_TYPE Ljava/lang/String; + public static final field DEBUG Z + public static final field LIBRARY_PACKAGE_NAME Ljava/lang/String; + public fun ()V +} + +public final class com/chuckerteam/chucker/api/Chucker { + public static final field INSTANCE Lcom/chuckerteam/chucker/api/Chucker; + public static final fun dismissNotifications (Landroid/content/Context;)V + public static final fun getLaunchIntent (Landroid/content/Context;)Landroid/content/Intent; + public final fun isOp ()Z +} + +public final class com/chuckerteam/chucker/api/ChuckerCollector { + public fun (Landroid/content/Context;)V + public fun (Landroid/content/Context;Z)V + public fun (Landroid/content/Context;ZLcom/chuckerteam/chucker/api/RetentionManager$Period;)V + public synthetic fun (Landroid/content/Context;ZLcom/chuckerteam/chucker/api/RetentionManager$Period;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun getShowNotification ()Z + public final fun setShowNotification (Z)V +} + +public final class com/chuckerteam/chucker/api/ChuckerInterceptor : okhttp3/Interceptor { + public fun (Landroid/content/Context;)V + public synthetic fun (Lcom/chuckerteam/chucker/api/ChuckerInterceptor$Builder;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun intercept (Lokhttp3/Interceptor$Chain;)Lokhttp3/Response; + public final fun redactHeaders ([Ljava/lang/String;)Lcom/chuckerteam/chucker/api/ChuckerInterceptor; +} + +public final class com/chuckerteam/chucker/api/ChuckerInterceptor$Builder { + public fun (Landroid/content/Context;)V + public final fun alwaysReadResponseBody (Z)Lcom/chuckerteam/chucker/api/ChuckerInterceptor$Builder; + public final fun build ()Lcom/chuckerteam/chucker/api/ChuckerInterceptor; + public final fun collector (Lcom/chuckerteam/chucker/api/ChuckerCollector;)Lcom/chuckerteam/chucker/api/ChuckerInterceptor$Builder; + public final fun maxContentLength (J)Lcom/chuckerteam/chucker/api/ChuckerInterceptor$Builder; + public final fun redactHeaders (Ljava/lang/Iterable;)Lcom/chuckerteam/chucker/api/ChuckerInterceptor$Builder; + public final fun redactHeaders ([Ljava/lang/String;)Lcom/chuckerteam/chucker/api/ChuckerInterceptor$Builder; +} + +public final class com/chuckerteam/chucker/api/RetentionManager { + public fun (Landroid/content/Context;)V + public fun (Landroid/content/Context;Ljava/lang/Object;)V + public synthetic fun (Landroid/content/Context;Ljava/lang/Object;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun doMaintenance ()V +} + +public final class com/chuckerteam/chucker/api/RetentionManager$Period : java/lang/Enum { + public static final field FOREVER Lcom/chuckerteam/chucker/api/RetentionManager$Period; + public static final field ONE_DAY Lcom/chuckerteam/chucker/api/RetentionManager$Period; + public static final field ONE_HOUR Lcom/chuckerteam/chucker/api/RetentionManager$Period; + public static final field ONE_WEEK Lcom/chuckerteam/chucker/api/RetentionManager$Period; + public static fun valueOf (Ljava/lang/String;)Lcom/chuckerteam/chucker/api/RetentionManager$Period; + public static fun values ()[Lcom/chuckerteam/chucker/api/RetentionManager$Period; +} + diff --git a/library/api/library.api b/library/api/library.api new file mode 100644 index 000000000..1dad95705 --- /dev/null +++ b/library/api/library.api @@ -0,0 +1,55 @@ +public final class com/chuckerteam/chucker/BuildConfig { + public static final field BUILD_TYPE Ljava/lang/String; + public static final field DEBUG Z + public static final field LIBRARY_PACKAGE_NAME Ljava/lang/String; + public fun ()V +} + +public final class com/chuckerteam/chucker/api/Chucker { + public static final field INSTANCE Lcom/chuckerteam/chucker/api/Chucker; + public static final fun dismissNotifications (Landroid/content/Context;)V + public static final fun getLaunchIntent (Landroid/content/Context;)Landroid/content/Intent; + public final fun isOp ()Z +} + +public final class com/chuckerteam/chucker/api/ChuckerCollector { + public fun (Landroid/content/Context;)V + public fun (Landroid/content/Context;Z)V + public fun (Landroid/content/Context;ZLcom/chuckerteam/chucker/api/RetentionManager$Period;)V + public synthetic fun (Landroid/content/Context;ZLcom/chuckerteam/chucker/api/RetentionManager$Period;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun getShowNotification ()Z + public final fun setShowNotification (Z)V +} + +public final class com/chuckerteam/chucker/api/ChuckerInterceptor : okhttp3/Interceptor { + public fun (Landroid/content/Context;)V + public synthetic fun (Lcom/chuckerteam/chucker/api/ChuckerInterceptor$Builder;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun intercept (Lokhttp3/Interceptor$Chain;)Lokhttp3/Response; + public final fun redactHeader ([Ljava/lang/String;)V +} + +public final class com/chuckerteam/chucker/api/ChuckerInterceptor$Builder { + public fun (Landroid/content/Context;)V + public final fun alwaysReadResponseBody (Z)Lcom/chuckerteam/chucker/api/ChuckerInterceptor$Builder; + public final fun build ()Lcom/chuckerteam/chucker/api/ChuckerInterceptor; + public final fun collector (Lcom/chuckerteam/chucker/api/ChuckerCollector;)Lcom/chuckerteam/chucker/api/ChuckerInterceptor$Builder; + public final fun maxContentLength (J)Lcom/chuckerteam/chucker/api/ChuckerInterceptor$Builder; + public final fun redactHeaders (Ljava/lang/Iterable;)Lcom/chuckerteam/chucker/api/ChuckerInterceptor$Builder; + public final fun redactHeaders ([Ljava/lang/String;)Lcom/chuckerteam/chucker/api/ChuckerInterceptor$Builder; +} + +public final class com/chuckerteam/chucker/api/RetentionManager { + public fun (Landroid/content/Context;)V + public fun (Landroid/content/Context;Lcom/chuckerteam/chucker/api/RetentionManager$Period;)V + public synthetic fun (Landroid/content/Context;Lcom/chuckerteam/chucker/api/RetentionManager$Period;ILkotlin/jvm/internal/DefaultConstructorMarker;)V +} + +public final class com/chuckerteam/chucker/api/RetentionManager$Period : java/lang/Enum { + public static final field FOREVER Lcom/chuckerteam/chucker/api/RetentionManager$Period; + public static final field ONE_DAY Lcom/chuckerteam/chucker/api/RetentionManager$Period; + public static final field ONE_HOUR Lcom/chuckerteam/chucker/api/RetentionManager$Period; + public static final field ONE_WEEK Lcom/chuckerteam/chucker/api/RetentionManager$Period; + public static fun valueOf (Ljava/lang/String;)Lcom/chuckerteam/chucker/api/RetentionManager$Period; + public static fun values ()[Lcom/chuckerteam/chucker/api/RetentionManager$Period; +} +