1 /* <lambda>null2 * 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 17 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 alias(libs.plugins.google.protobuf) 23 } 24 <lambda>null25android { 26 namespace = "com.google.jetpackcamera.data.settings" 27 compileSdk = libs.versions.compileSdk.get().toInt() 28 29 defaultConfig { 30 minSdk = libs.versions.minSdk.get().toInt() 31 testOptions.targetSdk = libs.versions.targetSdk.get().toInt() 32 lint.targetSdk = libs.versions.targetSdk.get().toInt() 33 34 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 35 consumerProguardFiles("consumer-rules.pro") 36 } 37 38 flavorDimensions += "flavor" 39 productFlavors { 40 create("stable") { 41 dimension = "flavor" 42 isDefault = true 43 } 44 } 45 46 compileOptions { 47 sourceCompatibility = JavaVersion.VERSION_17 48 targetCompatibility = JavaVersion.VERSION_17 49 } 50 kotlin { 51 jvmToolchain(17) 52 } 53 54 @Suppress("UnstableApiUsage") 55 testOptions { 56 managedDevices { 57 localDevices { 58 create("pixel2Api28") { 59 device = "Pixel 2" 60 apiLevel = 28 61 } 62 create("pixel8Api34") { 63 device = "Pixel 8" 64 apiLevel = 34 65 systemImageSource = "aosp_atd" 66 } 67 } 68 } 69 } 70 } 71 <lambda>null72dependencies { 73 implementation(libs.kotlinx.coroutines.core) 74 75 // Hilt 76 implementation(libs.dagger.hilt.android) 77 kapt(libs.dagger.hilt.compiler) 78 79 // proto datastore 80 implementation(libs.androidx.datastore) 81 implementation(libs.protobuf.kotlin.lite) 82 83 // Testing 84 testImplementation(libs.junit) 85 testImplementation(libs.truth) 86 androidTestImplementation(libs.androidx.espresso.core) 87 androidTestImplementation(libs.androidx.junit) 88 androidTestImplementation(libs.truth) 89 androidTestImplementation(libs.kotlinx.coroutines.test) 90 } 91 <lambda>null92protobuf { 93 protoc { 94 artifact = "com.google.protobuf:protoc:3.21.12" 95 } 96 97 generateProtoTasks { 98 all().forEach { task -> 99 task.builtins { 100 create("java") { 101 option("lite") 102 } 103 } 104 105 task.builtins { 106 create("kotlin") { 107 option("lite") 108 } 109 } 110 } 111 } 112 } 113 114 // Allow references to generated code <lambda>null115kapt { 116 correctErrorTypes = true 117 } 118