• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.1"
23
24    defaultConfig {
25        minSdkVersion 16
26        targetSdkVersion 33
27        testInstrumentationRunner "dagger.hilt.android.simple.uitest.TestRunner"
28        missingDimensionStrategy 'tier', 'free'
29    }
30    namespace "dagger.hilt.android.simple.uitest"
31    targetProjectPath ':app'
32    compileOptions {
33        sourceCompatibility JavaVersion.VERSION_11
34        targetCompatibility JavaVersion.VERSION_11
35    }
36}
37
38hilt {
39    enableAggregatingTask = true
40}
41
42dependencies {
43    implementation project(':app')
44
45    implementation 'junit:junit:4.13'
46    implementation 'androidx.test.ext:junit:1.1.3'
47    implementation 'androidx.test:runner:1.4.0'
48
49    implementation "com.google.dagger:hilt-android:$dagger_version"
50    implementation "com.google.dagger:hilt-android-testing:$dagger_version"
51    annotationProcessor "com.google.dagger:hilt-compiler:$dagger_version"
52}
53
54configurations.all {
55    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
56        if ("$dagger_version" == 'LOCAL-SNAPSHOT'
57                && details.requested.group == 'com.google.dagger') {
58            details.useVersion 'LOCAL-SNAPSHOT'
59            details.because 'LOCAL-SNAPSHOT should act as latest version.'
60        }
61    }
62}
63