1/* 2 * Copyright (C) 2019 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.application' 18apply plugin: 'dagger.hilt.android.plugin' 19 20android { 21 compileSdkVersion 30 22 buildToolsVersion "30.0.2" 23 24 defaultConfig { 25 applicationId "dagger.hilt.android.example.gradle.simple" 26 minSdkVersion 15 27 targetSdkVersion 30 28 versionCode 1 29 versionName "1.0" 30 testInstrumentationRunner "dagger.hilt.android.example.gradle.simple.SimpleEmulatorTestRunner" 31 } 32 compileOptions { 33 sourceCompatibility 1.8 34 targetCompatibility 1.8 35 } 36 testOptions { 37 unitTests.includeAndroidResources = true 38 } 39 sourceSets { 40 String sharedTestDir = 'src/sharedTest/java' 41 test { 42 java.srcDirs += sharedTestDir 43 } 44 androidTest { 45 java.srcDirs += sharedTestDir 46 } 47 } 48} 49 50dependencies { 51 implementation project(':feature') 52 implementation 'androidx.appcompat:appcompat:1.2.0' 53 implementation 'com.google.dagger:hilt-android:LOCAL-SNAPSHOT' 54 annotationProcessor 'com.google.dagger:hilt-android-compiler:LOCAL-SNAPSHOT' 55 56 testImplementation 'com.google.truth:truth:1.0.1' 57 testImplementation 'junit:junit:4.13' 58 testImplementation 'org.robolectric:robolectric:4.5-alpha-3' 59 testImplementation 'androidx.core:core:1.3.2' 60 testImplementation 'androidx.test.ext:junit:1.1.2' 61 testImplementation 'androidx.test:runner:1.3.0' 62 testImplementation 'com.google.dagger:hilt-android-testing:LOCAL-SNAPSHOT' 63 testAnnotationProcessor 'com.google.dagger:hilt-android-compiler:LOCAL-SNAPSHOT' 64 65 androidTestImplementation 'com.google.truth:truth:1.0.1' 66 androidTestImplementation 'junit:junit:4.13' 67 androidTestImplementation 'androidx.test.ext:junit:1.1.2' 68 androidTestImplementation 'androidx.test:runner:1.3.0' 69 androidTestImplementation 'com.google.dagger:hilt-android-testing:LOCAL-SNAPSHOT' 70 androidTestAnnotationProcessor 'com.google.dagger:hilt-android-compiler:LOCAL-SNAPSHOT' 71 72 // To help us catch usages of Guava APIs for Java 8 in the '-jre' variant. 73 annotationProcessor'com.google.guava:guava:28.1-android' 74 testAnnotationProcessor'com.google.guava:guava:28.1-android' 75 androidTestAnnotationProcessor'com.google.guava:guava:28.1-android' 76} 77