xref: /aosp_15_r20/external/dagger2/javatests/artifacts/hilt-android/simple/app-java-only/build.gradle (revision f585d8a307d0621d6060bd7e80091fdcbf94fe27)
1/*
2 * Copyright (C) 2021 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: 'com.google.dagger.hilt.android'
19
20android {
21    compileSdkVersion 33
22    buildToolsVersion "33.0.0"
23
24    defaultConfig {
25        applicationId "dagger.hilt.android.simple"
26        minSdkVersion 16
27        targetSdkVersion 33
28        versionCode 1
29        versionName "1.0"
30        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
31    }
32    compileOptions {
33        sourceCompatibility JavaVersion.VERSION_11
34        targetCompatibility JavaVersion.VERSION_11
35    }
36    testOptions {
37        unitTests.includeAndroidResources = true
38    }
39    lintOptions {
40        checkReleaseBuilds = false
41    }
42}
43
44hilt {
45    enableTransformForLocalTests = true
46}
47
48configurations.all {
49    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
50        if ("$dagger_version" == 'LOCAL-SNAPSHOT'
51                && details.requested.group == 'com.google.dagger') {
52            details.useVersion 'LOCAL-SNAPSHOT'
53            details.because 'LOCAL-SNAPSHOT should act as latest version.'
54        }
55    }
56}
57
58dependencies {
59  implementation "com.google.dagger:hilt-android:$dagger_version"
60  annotationProcessor "com.google.dagger:hilt-compiler:$dagger_version"
61
62  testImplementation 'com.google.truth:truth:1.0.1'
63  testImplementation 'junit:junit:4.13'
64  testImplementation 'org.robolectric:robolectric:4.5-alpha-3'
65  testImplementation 'androidx.core:core:1.3.2'
66  testImplementation 'androidx.test.ext:junit:1.1.3'
67  testImplementation 'androidx.test:runner:1.4.0'
68  testImplementation 'androidx.test.espresso:espresso-core:3.4.0'
69}
70