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