• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2020 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: 'kotlin-android'
19apply plugin: 'dagger.hilt.android.plugin'
20apply plugin: 'kotlin-kapt'
21
22android {
23    compileSdkVersion 30
24    buildToolsVersion "30.0.2"
25
26    defaultConfig {
27        applicationId "dagger.hilt.android.simpleKotlin"
28        minSdkVersion 15
29        targetSdkVersion 30
30        versionCode 1
31        versionName "1.0"
32        testInstrumentationRunner "dagger.hilt.android.example.gradle.simpleKotlin.TestRunner"
33    }
34    buildTypes {
35        release {
36            minifyEnabled true
37            shrinkResources true
38        }
39    }
40    compileOptions {
41        sourceCompatibility 1.8
42        targetCompatibility 1.8
43    }
44    kotlinOptions {
45        jvmTarget = '1.8'
46    }
47    testOptions {
48        unitTests.includeAndroidResources = true
49    }
50    lintOptions {
51        checkReleaseBuilds = false
52    }
53    sourceSets {
54        String sharedTestDir = 'src/sharedTest/java'
55        test {
56            java.srcDirs += sharedTestDir
57        }
58        androidTest {
59            java.srcDirs += sharedTestDir
60        }
61    }
62}
63
64hilt {
65    enableExperimentalClasspathAggregation = true
66    enableTransformForLocalTests = true
67}
68
69dependencies {
70    implementation project(':android-library')
71    implementation project(':kotlin-library')
72    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
73    implementation 'androidx.appcompat:appcompat:1.2.0'
74    implementation 'androidx.activity:activity-ktx:1.1.0'
75
76    implementation 'com.google.dagger:hilt-android:LOCAL-SNAPSHOT'
77    kapt 'com.google.dagger:hilt-compiler:LOCAL-SNAPSHOT'
78
79    testImplementation 'androidx.test.ext:junit:1.1.2'
80    testImplementation 'androidx.test:runner:1.3.0'
81    testImplementation 'com.google.truth:truth:1.0.1'
82    testImplementation 'junit:junit:4.13'
83    testImplementation 'org.robolectric:robolectric:4.5-alpha-3'
84    testImplementation 'androidx.core:core:1.3.2'
85    // TODO(bcorso): This multidex dep shouldn't be required -- it's a dep for the generated code.
86    testImplementation 'androidx.multidex:multidex:2.0.0'
87    testImplementation 'com.google.dagger:hilt-android-testing:LOCAL-SNAPSHOT'
88    kaptTest 'com.google.dagger:hilt-compiler:LOCAL-SNAPSHOT'
89
90    androidTestImplementation 'androidx.fragment:fragment-ktx:1.2.5'
91    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
92    androidTestImplementation 'androidx.test:runner:1.3.0'
93    androidTestImplementation 'com.google.truth:truth:1.0.1'
94    androidTestImplementation 'com.google.dagger:hilt-android-testing:LOCAL-SNAPSHOT'
95    kaptAndroidTest 'com.google.dagger:hilt-compiler:LOCAL-SNAPSHOT'
96}
97