1/* 2 * Copyright (C) 2022 The Dagger Authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17apply plugin: 'com.android.test' 18apply plugin: 'com.google.dagger.hilt.android' 19 20android { 21 compileSdkVersion 33 22 buildToolsVersion "33.0.0" 23 24 defaultConfig { 25 minSdkVersion 16 26 targetSdkVersion 33 27 testInstrumentationRunner "dagger.hilt.android.simple.uitest.TestRunner" 28 missingDimensionStrategy 'tier', 'free' 29 } 30 targetProjectPath ':app' 31 compileOptions { 32 sourceCompatibility JavaVersion.VERSION_11 33 targetCompatibility JavaVersion.VERSION_11 34 } 35} 36 37hilt { 38 enableAggregatingTask = true 39} 40 41dependencies { 42 implementation project(':app') 43 44 implementation 'junit:junit:4.13' 45 implementation 'androidx.test.ext:junit:1.1.3' 46 implementation 'androidx.test:runner:1.4.0' 47 48 implementation "com.google.dagger:hilt-android:$dagger_version" 49 implementation "com.google.dagger:hilt-android-testing:$dagger_version" 50 annotationProcessor "com.google.dagger:hilt-compiler:$dagger_version" 51} 52 53configurations.all { 54 resolutionStrategy.eachDependency { DependencyResolveDetails details -> 55 if ("$dagger_version" == 'LOCAL-SNAPSHOT' 56 && details.requested.group == 'com.google.dagger') { 57 details.useVersion 'LOCAL-SNAPSHOT' 58 details.because 'LOCAL-SNAPSHOT should act as latest version.' 59 } 60 } 61} 62