• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 The Android Open Source Project
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 
<lambda>null17 plugins {
18     alias(libs.plugins.android.library)
19     alias(libs.plugins.kotlin.android)
20     alias(libs.plugins.kotlin.kapt)
21     alias(libs.plugins.dagger.hilt.android)
22 }
23 
<lambda>null24 android {
25     namespace = "com.google.jetpackcamera.feature.preview"
26     compileSdk = libs.versions.compileSdk.get().toInt()
27 
28     defaultConfig {
29         minSdk = libs.versions.minSdk.get().toInt()
30         testOptions.targetSdk = libs.versions.targetSdk.get().toInt()
31         lint.targetSdk = libs.versions.targetSdk.get().toInt()
32 
33         testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
34     }
35 
36     compileOptions {
37         sourceCompatibility = JavaVersion.VERSION_17
38         targetCompatibility = JavaVersion.VERSION_17
39     }
40     kotlin {
41         jvmToolchain(17)
42     }
43     buildFeatures {
44         buildConfig = true
45         compose = true
46     }
47     composeOptions {
48         kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
49     }
50 
51     @Suppress("UnstableApiUsage")
52     testOptions {
53         unitTests {
54             isReturnDefaultValues = true
55             isIncludeAndroidResources = true
56         }
57         managedDevices {
58             localDevices {
59                 create("pixel2Api28") {
60                     device = "Pixel 2"
61                     apiLevel = 28
62                 }
63                 create("pixel8Api34") {
64                     device = "Pixel 8"
65                     apiLevel = 34
66                     systemImageSource = "aosp_atd"
67                 }
68             }
69         }
70     }
71 
72     kotlinOptions {
73         freeCompilerArgs += "-Xcontext-receivers"
74     }
75 }
76 
<lambda>null77 dependencies {
78     // Compose
79     val composeBom = platform(libs.compose.bom)
80     implementation(composeBom)
81     androidTestImplementation(composeBom)
82 
83     // Compose - Material Design 3
84     implementation(libs.compose.material3)
85     implementation(libs.compose.material.icons.extended)
86 
87     // Compose - Android Studio Preview support
88     implementation(libs.compose.ui.tooling.preview)
89     debugImplementation(libs.compose.ui.tooling)
90 
91     // Compose - Integration with ViewModels with Navigation and Hilt
92     implementation(libs.hilt.navigation.compose)
93 
94     // Compose - Lifecycle utilities
95     implementation(libs.androidx.lifecycle.viewmodel.compose)
96     implementation(libs.androidx.lifecycle.runtime.compose)
97 
98     // Compose - Testing
99     androidTestImplementation(libs.compose.junit)
100     debugImplementation(libs.compose.test.manifest)
101     // noinspection TestManifestGradleConfiguration: required for release build unit tests
102     testImplementation(libs.compose.test.manifest)
103     testImplementation(libs.compose.junit)
104 
105     // Testing
106     testImplementation(libs.junit)
107     testImplementation(libs.truth)
108     testImplementation(libs.mockito.core)
109     testImplementation(libs.kotlinx.coroutines.test)
110     testImplementation(libs.robolectric)
111     debugImplementation(libs.androidx.test.monitor)
112     implementation(libs.androidx.junit)
113     androidTestImplementation(libs.androidx.junit)
114     androidTestImplementation(libs.androidx.espresso.core)
115 
116     // Futures
117     implementation(libs.futures.ktx)
118 
119     // CameraX
120     implementation(libs.camera.core)
121     implementation(libs.camera.viewfinder.compose)
122 
123     // Hilt
124     implementation(libs.dagger.hilt.android)
125     kapt(libs.dagger.hilt.compiler)
126 
127     //Tracing
128     implementation(libs.androidx.tracing)
129 
130     implementation(libs.kotlinx.atomicfu)
131 
132     // Project dependencies
133     implementation(project(":data:settings"))
134     implementation(project(":domain:camera"))
135 }
136 
137 // Allow references to generated code
138 kapt {
139     correctErrorTypes = true
140 }