From 2bd2eb6cf9922725cb65b41233ba8ab0d414fc62 Mon Sep 17 00:00:00 2001 From: Goooler Date: Fri, 17 Dec 2021 10:38:41 +0800 Subject: [PATCH 1/8] Remove versions plugin --- build.gradle | 3 --- 1 file changed, 3 deletions(-) diff --git a/build.gradle b/build.gradle index 00305d5f7c..6c6b54688c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,3 @@ -apply plugin: 'com.github.ben-manes.versions' - buildscript { ext.versions = [ 'minSdk': 14, @@ -56,7 +54,6 @@ buildscript { dependencies { classpath deps.kotlin.gradlePlugin classpath deps.androidGradlePlugin - classpath 'com.github.ben-manes:gradle-versions-plugin:0.20.0' classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.18" classpath deps.detekt classpath deps.kotlin.binaryCompatibilityValidatorPlugin From 1aab0d52ef9cd80ecfdce56eab73fe87c33ff125 Mon Sep 17 00:00:00 2001 From: Goooler Date: Fri, 17 Dec 2021 10:43:57 +0800 Subject: [PATCH 2/8] Adopt AGP 4.2.2 --- build.gradle | 2 +- gradle.properties | 1 + leakcanary-android-core/build.gradle | 6 +++--- leakcanary-android-instrumentation/build.gradle | 6 +++--- leakcanary-android-process/build.gradle | 6 +++--- leakcanary-android-release/build.gradle | 4 ++-- leakcanary-android-sample/build.gradle | 4 ++-- leakcanary-android-utils/build.gradle | 6 +++--- leakcanary-android/build.gradle | 6 +++--- leakcanary-object-watcher-android-androidx/build.gradle | 6 +++--- .../build.gradle | 6 +++--- leakcanary-object-watcher-android/build.gradle | 6 +++--- plumber-android/build.gradle | 6 +++--- 13 files changed, 33 insertions(+), 32 deletions(-) diff --git a/build.gradle b/build.gradle index 6c6b54688c..a855fd9fd2 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ buildscript { // relies on), we're sticking a bit older because most apps will be using a more recent version // and they'll automatically resolve to higher version without having to necessarily resort to a // resolution strategy. - androidGradlePlugin: "com.android.tools.build:gradle:4.0.0", + androidGradlePlugin: "com.android.tools.build:gradle:4.2.2", androidx: [ annotation: 'androidx.annotation:annotation:1.0.2', core: 'androidx.core:core:1.0.1', diff --git a/gradle.properties b/gradle.properties index 105c203eca..4351abdc25 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,4 +20,5 @@ android.useAndroidX=true #Gradle properties: https://docs.gradle.org/current/userguide/build_environment.html org.gradle.caching=true org.gradle.configureondemand=true +org.gradle.jvmargs=-XX:+UseParallelGC -Dfile.encoding=UTF-8 org.gradle.parallel=true diff --git a/leakcanary-android-core/build.gradle b/leakcanary-android-core/build.gradle index d1263ef625..c817613448 100644 --- a/leakcanary-android-core/build.gradle +++ b/leakcanary-android-core/build.gradle @@ -29,9 +29,9 @@ def gitSha() { android { resourcePrefix 'leak_canary_' - compileSdkVersion versions.compileSdk + compileSdk versions.compileSdk defaultConfig { - minSdkVersion versions.minSdk + minSdk versions.minSdk buildConfigField "String", "LIBRARY_VERSION", "\"${rootProject.ext.VERSION_NAME}\"" buildConfigField "String", "GIT_SHA", "\"${gitSha()}\"" consumerProguardFiles 'consumer-proguard-rules.pro' @@ -40,7 +40,7 @@ android { lintOptions { disable 'GoogleAppIndexingWarning' error 'ObsoleteSdkInt' - check 'Interoperability' + checkOnly 'Interoperability' } } diff --git a/leakcanary-android-instrumentation/build.gradle b/leakcanary-android-instrumentation/build.gradle index 1fa326119d..b01916b2d6 100644 --- a/leakcanary-android-instrumentation/build.gradle +++ b/leakcanary-android-instrumentation/build.gradle @@ -16,16 +16,16 @@ dependencies { } android { - compileSdkVersion versions.compileSdk + compileSdk versions.compileSdk defaultConfig { - minSdkVersion versions.minSdk + minSdk versions.minSdk testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } lintOptions { disable 'GoogleAppIndexingWarning' // junit references java.lang.management ignore 'InvalidPackage' - check 'Interoperability' + checkOnly 'Interoperability' } } diff --git a/leakcanary-android-process/build.gradle b/leakcanary-android-process/build.gradle index 3724db5d54..09ac4571e7 100644 --- a/leakcanary-android-process/build.gradle +++ b/leakcanary-android-process/build.gradle @@ -10,15 +10,15 @@ dependencies { } android { - compileSdkVersion versions.compileSdk + compileSdk versions.compileSdk defaultConfig { - minSdkVersion versions.minSdk + minSdk versions.minSdk } lintOptions { disable 'GoogleAppIndexingWarning' // junit references java.lang.management ignore 'InvalidPackage' - check 'Interoperability' + checkOnly 'Interoperability' } } diff --git a/leakcanary-android-release/build.gradle b/leakcanary-android-release/build.gradle index a7c3a5ef15..cf36ecb760 100644 --- a/leakcanary-android-release/build.gradle +++ b/leakcanary-android-release/build.gradle @@ -17,7 +17,7 @@ def gitSha() { android { resourcePrefix 'leak_canary_' - compileSdkVersion versions.compileSdk + compileSdk versions.compileSdk defaultConfig { minSdkVersion 16 buildConfigField "String", "LIBRARY_VERSION", "\"${rootProject.ext.VERSION_NAME}\"" @@ -27,7 +27,7 @@ android { lintOptions { disable 'GoogleAppIndexingWarning' error 'ObsoleteSdkInt' - check 'Interoperability' + checkOnly 'Interoperability' } } diff --git a/leakcanary-android-sample/build.gradle b/leakcanary-android-sample/build.gradle index 5f0e50468d..3e8181d509 100644 --- a/leakcanary-android-sample/build.gradle +++ b/leakcanary-android-sample/build.gradle @@ -31,7 +31,7 @@ dependencies { } android { - compileSdkVersion versions.compileSdk + compileSdk versions.compileSdk compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -41,7 +41,7 @@ android { defaultConfig { applicationId "com.example.leakcanary" minSdkVersion 16 - targetSdkVersion versions.compileSdk + targetSdk versions.compileSdk versionCode 1 versionName "1.0" diff --git a/leakcanary-android-utils/build.gradle b/leakcanary-android-utils/build.gradle index 75b4865be6..00b774f3d0 100644 --- a/leakcanary-android-utils/build.gradle +++ b/leakcanary-android-utils/build.gradle @@ -10,14 +10,14 @@ dependencies { } android { - compileSdkVersion versions.compileSdk + compileSdk versions.compileSdk defaultConfig { - minSdkVersion versions.minSdk + minSdk versions.minSdk } lintOptions { disable 'GoogleAppIndexingWarning' error 'ObsoleteSdkInt' - check 'Interoperability' + checkOnly 'Interoperability' } } diff --git a/leakcanary-android/build.gradle b/leakcanary-android/build.gradle index 3724db5d54..09ac4571e7 100644 --- a/leakcanary-android/build.gradle +++ b/leakcanary-android/build.gradle @@ -10,15 +10,15 @@ dependencies { } android { - compileSdkVersion versions.compileSdk + compileSdk versions.compileSdk defaultConfig { - minSdkVersion versions.minSdk + minSdk versions.minSdk } lintOptions { disable 'GoogleAppIndexingWarning' // junit references java.lang.management ignore 'InvalidPackage' - check 'Interoperability' + checkOnly 'Interoperability' } } diff --git a/leakcanary-object-watcher-android-androidx/build.gradle b/leakcanary-object-watcher-android-androidx/build.gradle index 6257a24979..943b09bf3b 100644 --- a/leakcanary-object-watcher-android-androidx/build.gradle +++ b/leakcanary-object-watcher-android-androidx/build.gradle @@ -12,15 +12,15 @@ dependencies { } android { - compileSdkVersion versions.compileSdk + compileSdk versions.compileSdk defaultConfig { - minSdkVersion versions.minSdk + minSdk versions.minSdk consumerProguardFiles 'consumer-proguard-rules.pro' } lintOptions { disable 'GoogleAppIndexingWarning' error 'ObsoleteSdkInt' - check 'Interoperability' + checkOnly 'Interoperability' } } diff --git a/leakcanary-object-watcher-android-support-fragments/build.gradle b/leakcanary-object-watcher-android-support-fragments/build.gradle index 36cf3695bc..b4acaea8d7 100644 --- a/leakcanary-object-watcher-android-support-fragments/build.gradle +++ b/leakcanary-object-watcher-android-support-fragments/build.gradle @@ -12,15 +12,15 @@ dependencies { } android { - compileSdkVersion versions.compileSdk + compileSdk versions.compileSdk defaultConfig { - minSdkVersion versions.minSdk + minSdk versions.minSdk consumerProguardFiles 'consumer-proguard-rules.pro' } lintOptions { disable 'GoogleAppIndexingWarning' error 'ObsoleteSdkInt' - check 'Interoperability' + checkOnly 'Interoperability' } } diff --git a/leakcanary-object-watcher-android/build.gradle b/leakcanary-object-watcher-android/build.gradle index d60e1ead63..1222fd86fc 100644 --- a/leakcanary-object-watcher-android/build.gradle +++ b/leakcanary-object-watcher-android/build.gradle @@ -17,16 +17,16 @@ dependencies { android { resourcePrefix 'leak_canary_watcher_' - compileSdkVersion versions.compileSdk + compileSdk versions.compileSdk defaultConfig { - minSdkVersion versions.minSdk + minSdk versions.minSdk consumerProguardFiles 'consumer-proguard-rules.pro' } lintOptions { disable 'GoogleAppIndexingWarning' - check 'Interoperability' + checkOnly 'Interoperability' } buildFeatures { diff --git a/plumber-android/build.gradle b/plumber-android/build.gradle index 69f7b335ae..8ca8a2b1b9 100644 --- a/plumber-android/build.gradle +++ b/plumber-android/build.gradle @@ -14,15 +14,15 @@ dependencies { android { resourcePrefix 'leak_canary_plumber' - compileSdkVersion versions.compileSdk + compileSdk versions.compileSdk defaultConfig { - minSdkVersion versions.minSdk + minSdk versions.minSdk consumerProguardFiles 'consumer-proguard-rules.pro' } lintOptions { disable 'GoogleAppIndexingWarning' error 'ObsoleteSdkInt' - check 'Interoperability' + checkOnly 'Interoperability' } } From 69bb8acc25c9baa47c43597cdf9953d3bbaf4f2e Mon Sep 17 00:00:00 2001 From: Goooler Date: Fri, 17 Dec 2021 11:03:44 +0800 Subject: [PATCH 3/8] Run apiDump --- leakcanary-android-core/api/leakcanary-android-core.api | 2 -- .../api/leakcanary-android-instrumentation.api | 2 -- leakcanary-android-process/api/leakcanary-android-process.api | 2 -- leakcanary-android-release/api/leakcanary-android-release.api | 2 -- leakcanary-android-utils/api/leakcanary-android-utils.api | 2 -- .../api/leakcanary-object-watcher-android-androidx.api | 2 -- .../api/leakcanary-object-watcher-android-support-fragments.api | 2 -- plumber-android/api/plumber-android.api | 2 -- 8 files changed, 16 deletions(-) diff --git a/leakcanary-android-core/api/leakcanary-android-core.api b/leakcanary-android-core/api/leakcanary-android-core.api index fc9e549149..fdca51ebcd 100644 --- a/leakcanary-android-core/api/leakcanary-android-core.api +++ b/leakcanary-android-core/api/leakcanary-android-core.api @@ -4,8 +4,6 @@ public final class com/squareup/leakcanary/core/BuildConfig { public static final field GIT_SHA Ljava/lang/String; public static final field LIBRARY_PACKAGE_NAME Ljava/lang/String; public static final field LIBRARY_VERSION Ljava/lang/String; - public static final field VERSION_CODE I - public static final field VERSION_NAME Ljava/lang/String; public fun ()V } diff --git a/leakcanary-android-instrumentation/api/leakcanary-android-instrumentation.api b/leakcanary-android-instrumentation/api/leakcanary-android-instrumentation.api index fbe0c85d3a..6f449acaba 100644 --- a/leakcanary-android-instrumentation/api/leakcanary-android-instrumentation.api +++ b/leakcanary-android-instrumentation/api/leakcanary-android-instrumentation.api @@ -2,8 +2,6 @@ public final class com/squareup/leakcanary/instrumentation/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 static final field VERSION_CODE I - public static final field VERSION_NAME Ljava/lang/String; public fun ()V } diff --git a/leakcanary-android-process/api/leakcanary-android-process.api b/leakcanary-android-process/api/leakcanary-android-process.api index 34309a3056..252837fdea 100644 --- a/leakcanary-android-process/api/leakcanary-android-process.api +++ b/leakcanary-android-process/api/leakcanary-android-process.api @@ -2,8 +2,6 @@ public final class com/squareup/leakcanary/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 static final field VERSION_CODE I - public static final field VERSION_NAME Ljava/lang/String; public fun ()V } diff --git a/leakcanary-android-release/api/leakcanary-android-release.api b/leakcanary-android-release/api/leakcanary-android-release.api index 2b124e4bcb..61db32020a 100644 --- a/leakcanary-android-release/api/leakcanary-android-release.api +++ b/leakcanary-android-release/api/leakcanary-android-release.api @@ -4,8 +4,6 @@ public final class com/squareup/leakcanary/release/BuildConfig { public static final field GIT_SHA Ljava/lang/String; public static final field LIBRARY_PACKAGE_NAME Ljava/lang/String; public static final field LIBRARY_VERSION Ljava/lang/String; - public static final field VERSION_CODE I - public static final field VERSION_NAME Ljava/lang/String; public fun ()V } diff --git a/leakcanary-android-utils/api/leakcanary-android-utils.api b/leakcanary-android-utils/api/leakcanary-android-utils.api index e848d2aba1..351b0c26f3 100644 --- a/leakcanary-android-utils/api/leakcanary-android-utils.api +++ b/leakcanary-android-utils/api/leakcanary-android-utils.api @@ -2,8 +2,6 @@ public final class com/squareup/leakcanary/utils/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 static final field VERSION_CODE I - public static final field VERSION_NAME Ljava/lang/String; public fun ()V } diff --git a/leakcanary-object-watcher-android-androidx/api/leakcanary-object-watcher-android-androidx.api b/leakcanary-object-watcher-android-androidx/api/leakcanary-object-watcher-android-androidx.api index 091ccbbace..5dc92b7d35 100644 --- a/leakcanary-object-watcher-android-androidx/api/leakcanary-object-watcher-android-androidx.api +++ b/leakcanary-object-watcher-android-androidx/api/leakcanary-object-watcher-android-androidx.api @@ -2,8 +2,6 @@ public final class com/squareup/leakcanary/fragments/androidx/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 static final field VERSION_CODE I - public static final field VERSION_NAME Ljava/lang/String; public fun ()V } diff --git a/leakcanary-object-watcher-android-support-fragments/api/leakcanary-object-watcher-android-support-fragments.api b/leakcanary-object-watcher-android-support-fragments/api/leakcanary-object-watcher-android-support-fragments.api index 0260a723d7..2581f3faef 100644 --- a/leakcanary-object-watcher-android-support-fragments/api/leakcanary-object-watcher-android-support-fragments.api +++ b/leakcanary-object-watcher-android-support-fragments/api/leakcanary-object-watcher-android-support-fragments.api @@ -2,8 +2,6 @@ public final class com/squareup/leakcanary/fragments/android_support/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 static final field VERSION_CODE I - public static final field VERSION_NAME Ljava/lang/String; public fun ()V } diff --git a/plumber-android/api/plumber-android.api b/plumber-android/api/plumber-android.api index 3d1679418e..eb6ad18738 100644 --- a/plumber-android/api/plumber-android.api +++ b/plumber-android/api/plumber-android.api @@ -2,8 +2,6 @@ public final class com/squareup/leakcanary/plumber/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 static final field VERSION_CODE I - public static final field VERSION_NAME Ljava/lang/String; public fun ()V } From 7740887faae4d946d4d6747b958d9282ae947c31 Mon Sep 17 00:00:00 2001 From: Goooler Date: Fri, 17 Dec 2021 22:59:15 +0800 Subject: [PATCH 4/8] Disable BuildConfig generating by default --- leakcanary-android-instrumentation/build.gradle | 1 + leakcanary-android-process/build.gradle | 1 + leakcanary-android-utils/build.gradle | 1 + leakcanary-android/build.gradle | 1 + leakcanary-object-watcher-android-androidx/build.gradle | 1 + leakcanary-object-watcher-android-support-fragments/build.gradle | 1 + plumber-android/build.gradle | 1 + 7 files changed, 7 insertions(+) diff --git a/leakcanary-android-instrumentation/build.gradle b/leakcanary-android-instrumentation/build.gradle index b01916b2d6..c05a17dad7 100644 --- a/leakcanary-android-instrumentation/build.gradle +++ b/leakcanary-android-instrumentation/build.gradle @@ -21,6 +21,7 @@ android { minSdk versions.minSdk testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } + buildFeatures.buildConfig = false lintOptions { disable 'GoogleAppIndexingWarning' // junit references java.lang.management diff --git a/leakcanary-android-process/build.gradle b/leakcanary-android-process/build.gradle index 09ac4571e7..3a2ad3e708 100644 --- a/leakcanary-android-process/build.gradle +++ b/leakcanary-android-process/build.gradle @@ -14,6 +14,7 @@ android { defaultConfig { minSdk versions.minSdk } + buildFeatures.buildConfig = false lintOptions { disable 'GoogleAppIndexingWarning' // junit references java.lang.management diff --git a/leakcanary-android-utils/build.gradle b/leakcanary-android-utils/build.gradle index 00b774f3d0..23c8f9e158 100644 --- a/leakcanary-android-utils/build.gradle +++ b/leakcanary-android-utils/build.gradle @@ -14,6 +14,7 @@ android { defaultConfig { minSdk versions.minSdk } + buildFeatures.buildConfig = false lintOptions { disable 'GoogleAppIndexingWarning' error 'ObsoleteSdkInt' diff --git a/leakcanary-android/build.gradle b/leakcanary-android/build.gradle index 09ac4571e7..3a2ad3e708 100644 --- a/leakcanary-android/build.gradle +++ b/leakcanary-android/build.gradle @@ -14,6 +14,7 @@ android { defaultConfig { minSdk versions.minSdk } + buildFeatures.buildConfig = false lintOptions { disable 'GoogleAppIndexingWarning' // junit references java.lang.management diff --git a/leakcanary-object-watcher-android-androidx/build.gradle b/leakcanary-object-watcher-android-androidx/build.gradle index 943b09bf3b..158583f6ea 100644 --- a/leakcanary-object-watcher-android-androidx/build.gradle +++ b/leakcanary-object-watcher-android-androidx/build.gradle @@ -17,6 +17,7 @@ android { minSdk versions.minSdk consumerProguardFiles 'consumer-proguard-rules.pro' } + buildFeatures.buildConfig = false lintOptions { disable 'GoogleAppIndexingWarning' error 'ObsoleteSdkInt' diff --git a/leakcanary-object-watcher-android-support-fragments/build.gradle b/leakcanary-object-watcher-android-support-fragments/build.gradle index b4acaea8d7..3c327aeb86 100644 --- a/leakcanary-object-watcher-android-support-fragments/build.gradle +++ b/leakcanary-object-watcher-android-support-fragments/build.gradle @@ -17,6 +17,7 @@ android { minSdk versions.minSdk consumerProguardFiles 'consumer-proguard-rules.pro' } + buildFeatures.buildConfig = false lintOptions { disable 'GoogleAppIndexingWarning' error 'ObsoleteSdkInt' diff --git a/plumber-android/build.gradle b/plumber-android/build.gradle index 8ca8a2b1b9..07dc306581 100644 --- a/plumber-android/build.gradle +++ b/plumber-android/build.gradle @@ -19,6 +19,7 @@ android { minSdk versions.minSdk consumerProguardFiles 'consumer-proguard-rules.pro' } + buildFeatures.buildConfig = false lintOptions { disable 'GoogleAppIndexingWarning' error 'ObsoleteSdkInt' From 325d41e58d019c32b1119a2b30ad3e2b380171f2 Mon Sep 17 00:00:00 2001 From: Goooler Date: Fri, 17 Dec 2021 23:00:41 +0800 Subject: [PATCH 5/8] Run apiDump --- .../api/leakcanary-android-instrumentation.api | 7 ------- .../api/leakcanary-android-process.api | 7 ------- leakcanary-android-utils/api/leakcanary-android-utils.api | 7 ------- .../api/leakcanary-object-watcher-android-androidx.api | 7 ------- ...leakcanary-object-watcher-android-support-fragments.api | 7 ------- plumber-android/api/plumber-android.api | 7 ------- 6 files changed, 42 deletions(-) diff --git a/leakcanary-android-instrumentation/api/leakcanary-android-instrumentation.api b/leakcanary-android-instrumentation/api/leakcanary-android-instrumentation.api index 6f449acaba..f2cad0b69b 100644 --- a/leakcanary-android-instrumentation/api/leakcanary-android-instrumentation.api +++ b/leakcanary-android-instrumentation/api/leakcanary-android-instrumentation.api @@ -1,10 +1,3 @@ -public final class com/squareup/leakcanary/instrumentation/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 leakcanary/FailAnnotatedTestOnLeakRunListener : leakcanary/FailTestOnLeakRunListener { public fun ()V } diff --git a/leakcanary-android-process/api/leakcanary-android-process.api b/leakcanary-android-process/api/leakcanary-android-process.api index 252837fdea..04b2aa72c8 100644 --- a/leakcanary-android-process/api/leakcanary-android-process.api +++ b/leakcanary-android-process/api/leakcanary-android-process.api @@ -1,10 +1,3 @@ -public final class com/squareup/leakcanary/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 leakcanary/LeakCanaryProcess { public static final field INSTANCE Lleakcanary/LeakCanaryProcess; public final fun isInAnalyzerProcess (Landroid/content/Context;)Z diff --git a/leakcanary-android-utils/api/leakcanary-android-utils.api b/leakcanary-android-utils/api/leakcanary-android-utils.api index 351b0c26f3..f57810b4bc 100644 --- a/leakcanary-android-utils/api/leakcanary-android-utils.api +++ b/leakcanary-android-utils/api/leakcanary-android-utils.api @@ -1,10 +1,3 @@ -public final class com/squareup/leakcanary/utils/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 leakcanary/LogcatSharkLog : shark/SharkLog$Logger { public static final field Companion Lleakcanary/LogcatSharkLog$Companion; public fun ()V diff --git a/leakcanary-object-watcher-android-androidx/api/leakcanary-object-watcher-android-androidx.api b/leakcanary-object-watcher-android-androidx/api/leakcanary-object-watcher-android-androidx.api index 5dc92b7d35..e69de29bb2 100644 --- a/leakcanary-object-watcher-android-androidx/api/leakcanary-object-watcher-android-androidx.api +++ b/leakcanary-object-watcher-android-androidx/api/leakcanary-object-watcher-android-androidx.api @@ -1,7 +0,0 @@ -public final class com/squareup/leakcanary/fragments/androidx/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 -} - diff --git a/leakcanary-object-watcher-android-support-fragments/api/leakcanary-object-watcher-android-support-fragments.api b/leakcanary-object-watcher-android-support-fragments/api/leakcanary-object-watcher-android-support-fragments.api index 2581f3faef..e69de29bb2 100644 --- a/leakcanary-object-watcher-android-support-fragments/api/leakcanary-object-watcher-android-support-fragments.api +++ b/leakcanary-object-watcher-android-support-fragments/api/leakcanary-object-watcher-android-support-fragments.api @@ -1,7 +0,0 @@ -public final class com/squareup/leakcanary/fragments/android_support/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 -} - diff --git a/plumber-android/api/plumber-android.api b/plumber-android/api/plumber-android.api index eb6ad18738..6e8d568796 100644 --- a/plumber-android/api/plumber-android.api +++ b/plumber-android/api/plumber-android.api @@ -1,10 +1,3 @@ -public final class com/squareup/leakcanary/plumber/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 abstract class leakcanary/AndroidLeakFixes : java/lang/Enum { public static final field ACCESSIBILITY_NODE_INFO Lleakcanary/AndroidLeakFixes; public static final field ACTIVITY_MANAGER Lleakcanary/AndroidLeakFixes; From 37ad2606fa1610721cac793c7c3f096338a176e5 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Ricau Date: Mon, 20 Dec 2021 23:59:52 -0800 Subject: [PATCH 6/8] Update LeakCanaryLeakDeobfuscationPluginTest config --- .../LeakCanaryLeakDeobfuscationPluginTest.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/leakcanary-deobfuscation-gradle-plugin/src/test/java/com/squareup/leakcanary/deobfuscation/LeakCanaryLeakDeobfuscationPluginTest.kt b/leakcanary-deobfuscation-gradle-plugin/src/test/java/com/squareup/leakcanary/deobfuscation/LeakCanaryLeakDeobfuscationPluginTest.kt index a0e76ed011..b05d7b8ff5 100644 --- a/leakcanary-deobfuscation-gradle-plugin/src/test/java/com/squareup/leakcanary/deobfuscation/LeakCanaryLeakDeobfuscationPluginTest.kt +++ b/leakcanary-deobfuscation-gradle-plugin/src/test/java/com/squareup/leakcanary/deobfuscation/LeakCanaryLeakDeobfuscationPluginTest.kt @@ -59,10 +59,10 @@ class LeakCanaryLeakDeobfuscationPluginTest { } android { - compileSdkVersion 29 + compileSdk 29 defaultConfig { - minSdkVersion 29 + minSdk 29 } buildTypes { @@ -128,10 +128,10 @@ class LeakCanaryLeakDeobfuscationPluginTest { } android { - compileSdkVersion 29 + compileSdk 29 defaultConfig { - minSdkVersion 29 + minSdk 29 } buildTypes { From 09cdb87912f682c894824777e407632bb0ba3ce9 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Ricau Date: Tue, 21 Dec 2021 02:05:33 -0800 Subject: [PATCH 7/8] Fix obfuscation plugin not packaging mapping file into APK --- .../deobfuscation/LeakCanaryLeakDeobfuscationPlugin.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/leakcanary-deobfuscation-gradle-plugin/src/main/java/com/squareup/leakcanary/deobfuscation/LeakCanaryLeakDeobfuscationPlugin.kt b/leakcanary-deobfuscation-gradle-plugin/src/main/java/com/squareup/leakcanary/deobfuscation/LeakCanaryLeakDeobfuscationPlugin.kt index e8585a99b8..cb20bd0052 100644 --- a/leakcanary-deobfuscation-gradle-plugin/src/main/java/com/squareup/leakcanary/deobfuscation/LeakCanaryLeakDeobfuscationPlugin.kt +++ b/leakcanary-deobfuscation-gradle-plugin/src/main/java/com/squareup/leakcanary/deobfuscation/LeakCanaryLeakDeobfuscationPlugin.kt @@ -96,6 +96,14 @@ class LeakCanaryLeakDeobfuscationPlugin : Plugin { it.dependsOn(variant.mergeAssetsProvider) } + // https://github.com/square/leakcanary/pull/2230#discussion_r772992666 + findTaskProviderOrNull( + project, + "compress${variant.name.capitalize()}Assets" + )?.configure { + it.dependsOn(copyObfuscationMappingFileTaskProvider) + } + getPackageTaskProvider(variant).configure { it.dependsOn(copyObfuscationMappingFileTaskProvider) } From 250eb35a2b3815ccebbb2eddac824f16e9d1eca6 Mon Sep 17 00:00:00 2001 From: Goooler Date: Tue, 21 Dec 2021 15:28:20 +0800 Subject: [PATCH 8/8] Replace dsl --- leakcanary-android-release/build.gradle | 2 +- leakcanary-android-sample/build.gradle | 2 +- .../deobfuscation/LeakCanaryLeakDeobfuscationPluginTest.kt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/leakcanary-android-release/build.gradle b/leakcanary-android-release/build.gradle index cf36ecb760..c434bee705 100644 --- a/leakcanary-android-release/build.gradle +++ b/leakcanary-android-release/build.gradle @@ -19,7 +19,7 @@ android { resourcePrefix 'leak_canary_' compileSdk versions.compileSdk defaultConfig { - minSdkVersion 16 + minSdk 16 buildConfigField "String", "LIBRARY_VERSION", "\"${rootProject.ext.VERSION_NAME}\"" buildConfigField "String", "GIT_SHA", "\"${gitSha()}\"" consumerProguardFiles 'consumer-proguard-rules.pro' diff --git a/leakcanary-android-sample/build.gradle b/leakcanary-android-sample/build.gradle index 3e8181d509..66c2b45b9c 100644 --- a/leakcanary-android-sample/build.gradle +++ b/leakcanary-android-sample/build.gradle @@ -40,7 +40,7 @@ android { defaultConfig { applicationId "com.example.leakcanary" - minSdkVersion 16 + minSdk 16 targetSdk versions.compileSdk versionCode 1 diff --git a/leakcanary-deobfuscation-gradle-plugin/src/test/java/com/squareup/leakcanary/deobfuscation/LeakCanaryLeakDeobfuscationPluginTest.kt b/leakcanary-deobfuscation-gradle-plugin/src/test/java/com/squareup/leakcanary/deobfuscation/LeakCanaryLeakDeobfuscationPluginTest.kt index b05d7b8ff5..7066926e33 100644 --- a/leakcanary-deobfuscation-gradle-plugin/src/test/java/com/squareup/leakcanary/deobfuscation/LeakCanaryLeakDeobfuscationPluginTest.kt +++ b/leakcanary-deobfuscation-gradle-plugin/src/test/java/com/squareup/leakcanary/deobfuscation/LeakCanaryLeakDeobfuscationPluginTest.kt @@ -182,10 +182,10 @@ class LeakCanaryLeakDeobfuscationPluginTest { } android { - compileSdkVersion 29 + compileSdk 29 defaultConfig { - minSdkVersion 29 + minSdk 29 } buildTypes {