xref: /aosp_15_r20/external/jetpack-camera-app/core/common/build.gradle.kts (revision 7e7863dab8204bb545ead586e736dea632e06846)
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.core.common"
26     compileSdk = libs.versions.compileSdk.get().toInt()
27     compileSdkPreview = libs.versions.compileSdkPreview.get()
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     buildTypes {
39         release {
40             proguardFiles(
41                     getDefaultProguardFile("proguard-android-optimize.txt"),
42                     "proguard-rules.pro"
43             )
44         }
45         create("benchmark") {
46             initWith(buildTypes.getByName("release"))
47         }
48     }
49 
50     flavorDimensions += "flavor"
51     productFlavors {
52         create("stable") {
53             dimension = "flavor"
54             isDefault = true
55         }
56 
57         create("preview") {
58             dimension = "flavor"
59             targetSdkPreview = libs.versions.targetSdkPreview.get()
60         }
61     }
62 
63     compileOptions {
64         sourceCompatibility = JavaVersion.VERSION_17
65         targetCompatibility = JavaVersion.VERSION_17
66     }
67     kotlin {
68         jvmToolchain(17)
69     }
70 }
71 
<lambda>null72 dependencies {
73 
74     implementation(libs.androidx.core.ktx)
75     implementation(libs.androidx.appcompat)
76     implementation(libs.android.material)
77     implementation(libs.kotlinx.atomicfu)
78     implementation(libs.androidx.tracing)
79 
80     testImplementation(libs.junit)
81     testImplementation(libs.truth)
82     testImplementation(libs.robolectric)
83 
84     androidTestImplementation(libs.androidx.junit)
85     androidTestImplementation(libs.androidx.espresso.core)
86 
87     // Hilt
88     implementation(libs.dagger.hilt.android)
89     kapt(libs.dagger.hilt.compiler)
90 }
91 
<lambda>null92 kapt {
93     correctErrorTypes = true
94 }
95