Skip to content

Commit

Permalink
Merge pull request #2232 from square/py/agp_update
Browse files Browse the repository at this point in the history
Adopt AGP 4.2
  • Loading branch information
pyricau authored Dec 21, 2021
2 parents bf38722 + 250eb35 commit 14b2e21
Show file tree
Hide file tree
Showing 23 changed files with 56 additions and 101 deletions.
5 changes: 1 addition & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
apply plugin: 'com.github.ben-manes.versions'

buildscript {
ext.versions = [
'minSdk': 14,
Expand All @@ -15,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',
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 0 additions & 2 deletions leakcanary-android-core/api/leakcanary-android-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -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 <init> ()V
}

Expand Down
6 changes: 3 additions & 3 deletions leakcanary-android-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -40,7 +40,7 @@ android {
lintOptions {
disable 'GoogleAppIndexingWarning'
error 'ObsoleteSdkInt'
check 'Interoperability'
checkOnly 'Interoperability'
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +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 static final field VERSION_CODE I
public static final field VERSION_NAME Ljava/lang/String;
public fun <init> ()V
}

public final class leakcanary/FailAnnotatedTestOnLeakRunListener : leakcanary/FailTestOnLeakRunListener {
public fun <init> ()V
}
Expand Down
7 changes: 4 additions & 3 deletions leakcanary-android-instrumentation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ dependencies {
}

android {
compileSdkVersion versions.compileSdk
compileSdk versions.compileSdk
defaultConfig {
minSdkVersion versions.minSdk
minSdk versions.minSdk
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildFeatures.buildConfig = false
lintOptions {
disable 'GoogleAppIndexingWarning'
// junit references java.lang.management
ignore 'InvalidPackage'
check 'Interoperability'
checkOnly 'Interoperability'
}
}

Expand Down
9 changes: 0 additions & 9 deletions leakcanary-android-process/api/leakcanary-android-process.api
Original file line number Diff line number Diff line change
@@ -1,12 +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 static final field VERSION_CODE I
public static final field VERSION_NAME Ljava/lang/String;
public fun <init> ()V
}

public final class leakcanary/LeakCanaryProcess {
public static final field INSTANCE Lleakcanary/LeakCanaryProcess;
public final fun isInAnalyzerProcess (Landroid/content/Context;)Z
Expand Down
7 changes: 4 additions & 3 deletions leakcanary-android-process/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ dependencies {
}

android {
compileSdkVersion versions.compileSdk
compileSdk versions.compileSdk
defaultConfig {
minSdkVersion versions.minSdk
minSdk versions.minSdk
}
buildFeatures.buildConfig = false
lintOptions {
disable 'GoogleAppIndexingWarning'
// junit references java.lang.management
ignore 'InvalidPackage'
check 'Interoperability'
checkOnly 'Interoperability'
}
}

Expand Down
2 changes: 0 additions & 2 deletions leakcanary-android-release/api/leakcanary-android-release.api
Original file line number Diff line number Diff line change
Expand Up @@ -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 <init> ()V
}

Expand Down
6 changes: 3 additions & 3 deletions leakcanary-android-release/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ def gitSha() {

android {
resourcePrefix 'leak_canary_'
compileSdkVersion versions.compileSdk
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'
}
lintOptions {
disable 'GoogleAppIndexingWarning'
error 'ObsoleteSdkInt'
check 'Interoperability'
checkOnly 'Interoperability'
}
}

Expand Down
6 changes: 3 additions & 3 deletions leakcanary-android-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies {
}

android {
compileSdkVersion versions.compileSdk
compileSdk versions.compileSdk

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -40,8 +40,8 @@ android {

defaultConfig {
applicationId "com.example.leakcanary"
minSdkVersion 16
targetSdkVersion versions.compileSdk
minSdk 16
targetSdk versions.compileSdk

versionCode 1
versionName "1.0"
Expand Down
9 changes: 0 additions & 9 deletions leakcanary-android-utils/api/leakcanary-android-utils.api
Original file line number Diff line number Diff line change
@@ -1,12 +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 static final field VERSION_CODE I
public static final field VERSION_NAME Ljava/lang/String;
public fun <init> ()V
}

public final class leakcanary/LogcatSharkLog : shark/SharkLog$Logger {
public static final field Companion Lleakcanary/LogcatSharkLog$Companion;
public fun <init> ()V
Expand Down
7 changes: 4 additions & 3 deletions leakcanary-android-utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ dependencies {
}

android {
compileSdkVersion versions.compileSdk
compileSdk versions.compileSdk
defaultConfig {
minSdkVersion versions.minSdk
minSdk versions.minSdk
}
buildFeatures.buildConfig = false
lintOptions {
disable 'GoogleAppIndexingWarning'
error 'ObsoleteSdkInt'
check 'Interoperability'
checkOnly 'Interoperability'
}
}

Expand Down
7 changes: 4 additions & 3 deletions leakcanary-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ dependencies {
}

android {
compileSdkVersion versions.compileSdk
compileSdk versions.compileSdk
defaultConfig {
minSdkVersion versions.minSdk
minSdk versions.minSdk
}
buildFeatures.buildConfig = false
lintOptions {
disable 'GoogleAppIndexingWarning'
// junit references java.lang.management
ignore 'InvalidPackage'
check 'Interoperability'
checkOnly 'Interoperability'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ class LeakCanaryLeakDeobfuscationPlugin : Plugin<Project> {
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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ class LeakCanaryLeakDeobfuscationPluginTest {
}
android {
compileSdkVersion 29
compileSdk 29
defaultConfig {
minSdkVersion 29
minSdk 29
}
buildTypes {
Expand Down Expand Up @@ -128,10 +128,10 @@ class LeakCanaryLeakDeobfuscationPluginTest {
}
android {
compileSdkVersion 29
compileSdk 29
defaultConfig {
minSdkVersion 29
minSdk 29
}
buildTypes {
Expand Down Expand Up @@ -182,10 +182,10 @@ class LeakCanaryLeakDeobfuscationPluginTest {
}
android {
compileSdkVersion 29
compileSdk 29
defaultConfig {
minSdkVersion 29
minSdk 29
}
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +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 static final field VERSION_CODE I
public static final field VERSION_NAME Ljava/lang/String;
public fun <init> ()V
}

7 changes: 4 additions & 3 deletions leakcanary-object-watcher-android-androidx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ dependencies {
}

android {
compileSdkVersion versions.compileSdk
compileSdk versions.compileSdk
defaultConfig {
minSdkVersion versions.minSdk
minSdk versions.minSdk
consumerProguardFiles 'consumer-proguard-rules.pro'
}
buildFeatures.buildConfig = false
lintOptions {
disable 'GoogleAppIndexingWarning'
error 'ObsoleteSdkInt'
check 'Interoperability'
checkOnly 'Interoperability'
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +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 static final field VERSION_CODE I
public static final field VERSION_NAME Ljava/lang/String;
public fun <init> ()V
}

Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ dependencies {
}

android {
compileSdkVersion versions.compileSdk
compileSdk versions.compileSdk
defaultConfig {
minSdkVersion versions.minSdk
minSdk versions.minSdk
consumerProguardFiles 'consumer-proguard-rules.pro'
}
buildFeatures.buildConfig = false
lintOptions {
disable 'GoogleAppIndexingWarning'
error 'ObsoleteSdkInt'
check 'Interoperability'
checkOnly 'Interoperability'
}
}

Expand Down
6 changes: 3 additions & 3 deletions leakcanary-object-watcher-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 0 additions & 9 deletions plumber-android/api/plumber-android.api
Original file line number Diff line number Diff line change
@@ -1,12 +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 static final field VERSION_CODE I
public static final field VERSION_NAME Ljava/lang/String;
public fun <init> ()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;
Expand Down
7 changes: 4 additions & 3 deletions plumber-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ dependencies {

android {
resourcePrefix 'leak_canary_plumber'
compileSdkVersion versions.compileSdk
compileSdk versions.compileSdk
defaultConfig {
minSdkVersion versions.minSdk
minSdk versions.minSdk
consumerProguardFiles 'consumer-proguard-rules.pro'
}
buildFeatures.buildConfig = false
lintOptions {
disable 'GoogleAppIndexingWarning'
error 'ObsoleteSdkInt'
check 'Interoperability'
checkOnly 'Interoperability'
}
}

Expand Down

0 comments on commit 14b2e21

Please sign in to comment.