xref: /aosp_15_r20/external/leakcanary2/leakcanary-android-sample/build.gradle (revision d9e8da70d8c9df9a41d7848ae506fb3115cae6e6)
1plugins {
2  id("com.android.application")
3  id("org.jetbrains.kotlin.android")
4  // Required to run obfuscated instrumentation tests:
5  // ./gradlew leakcanary-android-sample:connectedCheck -Pminify
6  id("com.slack.keeper")
7}
8
9keeper {
10  variantFilter {
11    setIgnore(!project.hasProperty('minify'))
12  }
13}
14
15dependencies {
16  debugImplementation projects.leakcanaryAndroid
17  // debugImplementation projects.leakcanaryAndroidStartup
18
19  // Uncomment to use the :leakcanary process
20  // debugImplementation projects.leakcanaryAndroidProcess
21  releaseImplementation projects.leakcanaryAndroidRelease
22  // Optional
23  releaseImplementation projects.leakcanaryObjectWatcherAndroid
24
25  implementation libs.kotlin.stdlib
26  // Uncomment to use WorkManager
27  // implementation libs.androidX.work.runtime
28
29  testImplementation libs.junit
30  testImplementation libs.robolectric
31
32  androidTestImplementation projects.leakcanaryAndroidInstrumentation
33  androidTestImplementation libs.androidX.test.espresso
34  androidTestImplementation libs.androidX.test.rules
35  androidTestImplementation libs.androidX.test.runner
36  androidTestImplementation libs.androidX.test.junit
37  androidTestImplementation libs.androidX.test.junitKtx
38  androidTestUtil libs.androidX.test.orchestrator
39}
40
41android {
42  compileSdk versions.compileSdk
43
44  compileOptions {
45    sourceCompatibility JavaVersion.VERSION_1_8
46    targetCompatibility JavaVersion.VERSION_1_8
47  }
48
49  defaultConfig {
50    applicationId "com.example.leakcanary"
51    minSdk 16
52    targetSdk versions.compileSdk
53
54    versionCode 1
55    versionName "1.0"
56
57    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
58
59    // Run ./gradlew leakcanary-android-sample:connectedCheck -Porchestrator
60    if (project.hasProperty('orchestrator')) {
61      testInstrumentationRunnerArguments clearPackageData: 'true'
62      testOptions {
63        execution 'ANDROIDX_TEST_ORCHESTRATOR'
64      }
65    }
66  }
67
68  buildTypes {
69    // Build with ./gradlew leakcanary-android-sample:installDebug -Pminify
70    if (project.hasProperty('minify')) {
71      debug {
72        minifyEnabled true
73        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')
74      }
75    } else {
76      debug
77    }
78    release {
79      signingConfig signingConfigs.debug
80    }
81  }
82
83  dexOptions {
84    dexInProcess false
85  }
86
87  lintOptions {
88    disable 'GoogleAppIndexingWarning'
89  }
90
91  testOptions {
92    unitTests {
93      includeAndroidResources = true
94    }
95  }
96}
97