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.application) 19 alias(libs.plugins.kotlin.android) 20 alias(libs.plugins.kotlin.kapt) 21 alias(libs.plugins.dagger.hilt.android) 22 } 23 <lambda>null24android { 25 compileSdk = libs.versions.compileSdk.get().toInt() 26 27 namespace = "com.google.jetpackcamera" 28 29 defaultConfig { 30 applicationId = "com.google.jetpackcamera" 31 minSdk = libs.versions.minSdk.get().toInt() 32 targetSdk = libs.versions.targetSdk.get().toInt() 33 versionCode = 1 34 versionName = "0.1.0" 35 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 36 testInstrumentationRunnerArguments["clearPackageData"] = "true" 37 } 38 39 40 buildTypes { 41 getByName("debug") { 42 signingConfig = signingConfigs.getByName("debug") 43 } 44 getByName("release") { 45 isMinifyEnabled = true 46 proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt")) 47 } 48 create("benchmark") { 49 initWith(buildTypes.getByName("release")) 50 signingConfig = signingConfigs.getByName("debug") 51 matchingFallbacks += listOf("release") 52 } 53 } 54 55 flavorDimensions += "flavor" 56 productFlavors { 57 create("stable") { 58 dimension = "flavor" 59 isDefault = true 60 } 61 } 62 63 compileOptions { 64 sourceCompatibility = JavaVersion.VERSION_17 65 targetCompatibility = JavaVersion.VERSION_17 66 } 67 kotlin { 68 jvmToolchain(17) 69 } 70 buildFeatures { 71 buildConfig = true 72 compose = true 73 } 74 composeOptions { 75 kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() 76 } 77 packaging { 78 resources { 79 excludes += "/META-INF/{AL2.0,LGPL2.1}" 80 } 81 } 82 83 @Suppress("UnstableApiUsage") 84 testOptions { 85 execution = "ANDROIDX_TEST_ORCHESTRATOR" 86 87 managedDevices { 88 localDevices { 89 create("pixel2Api28") { 90 device = "Pixel 2" 91 apiLevel = 28 92 } 93 create("pixel8Api34") { 94 device = "Pixel 8" 95 apiLevel = 34 96 systemImageSource = "aosp_atd" 97 } 98 } 99 } 100 } 101 102 kotlinOptions { 103 freeCompilerArgs += "-Xcontext-receivers" 104 } 105 } 106 <lambda>null107dependencies { 108 implementation(libs.androidx.tracing) 109 implementation(project(":core:common")) 110 implementation(project(":feature:postcapture")) 111 // Compose 112 val composeBom = platform(libs.compose.bom) 113 implementation(composeBom) 114 androidTestImplementation(composeBom) 115 116 // Compose - Material Design 3 117 implementation(libs.compose.material3) 118 implementation(libs.compose.material.icons.extended) 119 120 // Compose - Android Studio Preview support 121 implementation(libs.compose.ui.tooling.preview) 122 debugImplementation(libs.compose.ui.tooling) 123 124 // Compose - Integration with ViewModels 125 implementation(libs.androidx.lifecycle.viewmodel.compose) 126 implementation(libs.androidx.lifecycle.runtime.compose) 127 128 // Compose - Integration with Activities 129 implementation(libs.androidx.activity.compose) 130 131 // Compose - Testing 132 androidTestImplementation(libs.compose.junit) 133 134 // Testing 135 testImplementation(libs.junit) 136 androidTestImplementation(libs.androidx.junit) 137 androidTestImplementation(libs.androidx.espresso.core) 138 androidTestImplementation(libs.androidx.rules) 139 androidTestImplementation(libs.androidx.uiautomator) 140 androidTestImplementation(libs.truth) 141 androidTestUtil(libs.androidx.orchestrator) 142 143 144 implementation(libs.androidx.core.ktx) 145 implementation(libs.androidx.lifecycle.runtime.compose) 146 147 // Hilt 148 implementation(libs.dagger.hilt.android) 149 kapt(libs.dagger.hilt.compiler) 150 151 // Accompanist - Permissions 152 implementation(libs.accompanist.permissions) 153 154 // Jetpack Navigation 155 implementation(libs.androidx.navigation.compose) 156 157 // Access Settings data 158 implementation(project(":data:settings")) 159 160 // Camera Preview 161 implementation(project(":feature:preview")) 162 163 // Settings Screen 164 implementation(project(":feature:settings")) 165 166 // Permissions Screen 167 implementation(project(":feature:permissions")) 168 169 // benchmark 170 implementation(libs.androidx.profileinstaller) 171 } 172 173 // Allow references to generated code 174 kapt { 175 correctErrorTypes = true 176 }