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 compileOptions { 39 sourceCompatibility = JavaVersion.VERSION_17 40 targetCompatibility = JavaVersion.VERSION_17 41 } 42 kotlin { 43 jvmToolchain(17) 44 } 45 46 @Suppress("UnstableApiUsage") 47 testOptions { 48 managedDevices { 49 localDevices { 50 create("pixel2Api28") { 51 device = "Pixel 2" 52 apiLevel = 28 53 } 54 create("pixel8Api34") { 55 device = "Pixel 8" 56 apiLevel = 34 57 systemImageSource = "aosp_atd" 58 } 59 } 60 } 61 } 62 } 63 <lambda>null64dependencies { 65 implementation(libs.kotlinx.coroutines.core) 66 67 // Hilt 68 implementation(libs.dagger.hilt.android) 69 kapt(libs.dagger.hilt.compiler) 70 71 // proto datastore 72 implementation(libs.androidx.datastore) 73 implementation(libs.protobuf.kotlin.lite) 74 75 // Testing 76 testImplementation(libs.junit) 77 testImplementation(libs.truth) 78 androidTestImplementation(libs.androidx.espresso.core) 79 androidTestImplementation(libs.androidx.junit) 80 androidTestImplementation(libs.truth) 81 androidTestImplementation(libs.kotlinx.coroutines.test) 82 } 83 <lambda>null84protobuf { 85 protoc { 86 artifact = "com.google.protobuf:protoc:3.21.12" 87 } 88 89 generateProtoTasks { 90 all().forEach {task -> 91 task.builtins { 92 create("java") { 93 option("lite") 94 } 95 } 96 97 task.builtins { 98 create("kotlin") { 99 option("lite") 100 } 101 } 102 } 103 } 104 } 105 106 // Allow references to generated code <lambda>null107kapt { 108 correctErrorTypes = true 109 } 110