xref: /aosp_15_r20/external/leakcanary2/leakcanary-android-core/build.gradle (revision d9e8da70d8c9df9a41d7848ae506fb3115cae6e6)
1*d9e8da70SAndroid Build Coastguard Workerplugins {
2*d9e8da70SAndroid Build Coastguard Worker  id("com.android.library")
3*d9e8da70SAndroid Build Coastguard Worker  id("org.jetbrains.kotlin.android")
4*d9e8da70SAndroid Build Coastguard Worker  id("com.vanniktech.maven.publish")
5*d9e8da70SAndroid Build Coastguard Worker}
6*d9e8da70SAndroid Build Coastguard Worker
7*d9e8da70SAndroid Build Coastguard Workerdependencies {
8*d9e8da70SAndroid Build Coastguard Worker  api projects.sharkAndroid
9*d9e8da70SAndroid Build Coastguard Worker  api projects.leakcanaryObjectWatcherAndroidCore
10*d9e8da70SAndroid Build Coastguard Worker  api projects.leakcanaryObjectWatcherAndroidAndroidx
11*d9e8da70SAndroid Build Coastguard Worker  api projects.leakcanaryObjectWatcherAndroidSupportFragments
12*d9e8da70SAndroid Build Coastguard Worker  implementation libs.kotlin.stdlib
13*d9e8da70SAndroid Build Coastguard Worker
14*d9e8da70SAndroid Build Coastguard Worker  // Optional dependency
15*d9e8da70SAndroid Build Coastguard Worker  compileOnly libs.androidX.work.runtime
16*d9e8da70SAndroid Build Coastguard Worker  compileOnly libs.androidX.work.multiprocess
17*d9e8da70SAndroid Build Coastguard Worker
18*d9e8da70SAndroid Build Coastguard Worker  testImplementation libs.assertjCore
19*d9e8da70SAndroid Build Coastguard Worker  testImplementation libs.junit
20*d9e8da70SAndroid Build Coastguard Worker  testImplementation libs.kotlin.reflect
21*d9e8da70SAndroid Build Coastguard Worker  testImplementation libs.mockito
22*d9e8da70SAndroid Build Coastguard Worker  testImplementation libs.mockitoKotlin
23*d9e8da70SAndroid Build Coastguard Worker  androidTestImplementation libs.androidX.test.espresso
24*d9e8da70SAndroid Build Coastguard Worker  androidTestImplementation libs.androidX.test.rules
25*d9e8da70SAndroid Build Coastguard Worker  androidTestImplementation libs.androidX.test.runner
26*d9e8da70SAndroid Build Coastguard Worker  androidTestImplementation libs.assertjCore
27*d9e8da70SAndroid Build Coastguard Worker  androidTestImplementation projects.sharkHprofTest
28*d9e8da70SAndroid Build Coastguard Worker  androidTestUtil libs.androidX.test.orchestrator
29*d9e8da70SAndroid Build Coastguard Worker}
30*d9e8da70SAndroid Build Coastguard Worker
31*d9e8da70SAndroid Build Coastguard Workerdef gitSha() {
32*d9e8da70SAndroid Build Coastguard Worker  return 'git rev-parse --short HEAD'.execute().text.trim()
33*d9e8da70SAndroid Build Coastguard Worker}
34*d9e8da70SAndroid Build Coastguard Worker
35*d9e8da70SAndroid Build Coastguard Workerandroid {
36*d9e8da70SAndroid Build Coastguard Worker  resourcePrefix 'leak_canary_'
37*d9e8da70SAndroid Build Coastguard Worker  compileSdk versions.compileSdk
38*d9e8da70SAndroid Build Coastguard Worker  defaultConfig {
39*d9e8da70SAndroid Build Coastguard Worker    minSdk versions.minSdk
40*d9e8da70SAndroid Build Coastguard Worker    // Avoid DeprecatedTargetSdkVersionDialog during UI tests
41*d9e8da70SAndroid Build Coastguard Worker    targetSdk versions.compileSdk
42*d9e8da70SAndroid Build Coastguard Worker    buildConfigField "String", "LIBRARY_VERSION", "\"${rootProject.ext.VERSION_NAME}\""
43*d9e8da70SAndroid Build Coastguard Worker    buildConfigField "String", "GIT_SHA", "\"${gitSha()}\""
44*d9e8da70SAndroid Build Coastguard Worker    consumerProguardFiles 'consumer-proguard-rules.pro'
45*d9e8da70SAndroid Build Coastguard Worker    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
46*d9e8da70SAndroid Build Coastguard Worker
47*d9e8da70SAndroid Build Coastguard Worker    testInstrumentationRunnerArguments clearPackageData: 'true'
48*d9e8da70SAndroid Build Coastguard Worker    testOptions {
49*d9e8da70SAndroid Build Coastguard Worker      execution 'ANDROIDX_TEST_ORCHESTRATOR'
50*d9e8da70SAndroid Build Coastguard Worker    }
51*d9e8da70SAndroid Build Coastguard Worker  }
52*d9e8da70SAndroid Build Coastguard Worker  lintOptions {
53*d9e8da70SAndroid Build Coastguard Worker    disable 'GoogleAppIndexingWarning'
54*d9e8da70SAndroid Build Coastguard Worker    error 'ObsoleteSdkInt'
55*d9e8da70SAndroid Build Coastguard Worker    checkOnly 'Interoperability'
56*d9e8da70SAndroid Build Coastguard Worker  }
57*d9e8da70SAndroid Build Coastguard Worker}
58