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>null17plugins { 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>null24android { 25 namespace = "com.google.jetpackcamera.settings" 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 managedDevices { 54 localDevices { 55 create("pixel2Api28") { 56 device = "Pixel 2" 57 apiLevel = 28 58 } 59 create("pixel8Api34") { 60 device = "Pixel 8" 61 apiLevel = 34 62 systemImageSource = "aosp_atd" 63 } 64 } 65 } 66 } 67 } 68 <lambda>null69dependencies { 70 // Compose 71 val composeBom = platform(libs.compose.bom) 72 implementation(composeBom) 73 androidTestImplementation(composeBom) 74 75 // Compose - Material Design 3 76 implementation(libs.compose.material3) 77 78 // Compose - Android Studio Preview support 79 implementation(libs.compose.ui.tooling.preview) 80 debugImplementation(libs.compose.ui.tooling) 81 82 // Compose - Integration with ViewModels with Navigation and Hilt 83 implementation(libs.hilt.navigation.compose) 84 85 // Compose - Testing 86 androidTestImplementation(libs.compose.junit) 87 88 // Testing 89 testImplementation(libs.junit) 90 testImplementation(libs.mockito.core) 91 testImplementation(libs.kotlinx.coroutines.test) 92 androidTestImplementation(libs.androidx.junit) 93 androidTestImplementation(libs.androidx.espresso.core) 94 androidTestImplementation(libs.truth) 95 96 implementation(libs.androidx.core.ktx) 97 98 // Futures 99 implementation(libs.futures.ktx) 100 101 // Hilt 102 implementation(libs.dagger.hilt.android) 103 kapt(libs.dagger.hilt.compiler) 104 105 // Proto Datastore 106 implementation(libs.androidx.datastore) 107 implementation(libs.protobuf.kotlin.lite) 108 109 implementation(project(":data:settings")) 110 } 111 112 // Allow references to generated code 113 kapt { 114 correctErrorTypes = true 115 }