|
| 1 | +/* |
| 2 | + * Copyright (C) 2024 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.application) |
| 19 | + alias(libs.plugins.jetbrains.kotlin.android) |
| 20 | + alias(libs.plugins.screenshot) |
| 21 | +} |
| 22 | + |
| 23 | +android { |
| 24 | + namespace = "com.example.compose.previewscreenshot" |
| 25 | + compileSdk = 34 |
| 26 | + |
| 27 | + defaultConfig { |
| 28 | + applicationId = "com.example.compose.previewscreenshot" |
| 29 | + minSdk = 24 |
| 30 | + targetSdk = 34 |
| 31 | + versionCode = 1 |
| 32 | + versionName = "1.0" |
| 33 | + |
| 34 | + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" |
| 35 | + vectorDrawables { |
| 36 | + useSupportLibrary = true |
| 37 | + } |
| 38 | + } |
| 39 | + |
| 40 | + buildTypes { |
| 41 | + release { |
| 42 | + isMinifyEnabled = false |
| 43 | + proguardFiles( |
| 44 | + getDefaultProguardFile("proguard-android-optimize.txt"), |
| 45 | + "proguard-rules.pro" |
| 46 | + ) |
| 47 | + } |
| 48 | + } |
| 49 | + compileOptions { |
| 50 | + sourceCompatibility = JavaVersion.VERSION_1_8 |
| 51 | + targetCompatibility = JavaVersion.VERSION_1_8 |
| 52 | + } |
| 53 | + kotlinOptions { |
| 54 | + jvmTarget = "1.8" |
| 55 | + } |
| 56 | + buildFeatures { |
| 57 | + compose = true |
| 58 | + } |
| 59 | + composeOptions { |
| 60 | + kotlinCompilerExtensionVersion = "1.5.13" |
| 61 | + } |
| 62 | + |
| 63 | + experimentalProperties["android.experimental.enableScreenshotTest"] = true |
| 64 | + |
| 65 | + packaging { |
| 66 | + resources { |
| 67 | + excludes += "/META-INF/{AL2.0,LGPL2.1}" |
| 68 | + } |
| 69 | + } |
| 70 | +} |
| 71 | + |
| 72 | +dependencies { |
| 73 | + |
| 74 | + implementation(libs.androidx.core.ktx) |
| 75 | + implementation(libs.androidx.lifecycle.runtime.ktx) |
| 76 | + implementation(libs.androidx.activity.compose) |
| 77 | + implementation(platform(libs.androidx.compose.bom)) |
| 78 | + implementation(libs.androidx.ui) |
| 79 | + implementation(libs.androidx.ui.graphics) |
| 80 | + implementation(libs.androidx.ui.tooling.preview) |
| 81 | + implementation(libs.androidx.material3) |
| 82 | + testImplementation(libs.junit) |
| 83 | + androidTestImplementation(libs.androidx.junit) |
| 84 | + androidTestImplementation(libs.androidx.espresso.core) |
| 85 | + androidTestImplementation(platform(libs.androidx.compose.bom)) |
| 86 | + androidTestImplementation(libs.androidx.ui.test.junit4) |
| 87 | + debugImplementation(libs.androidx.ui.tooling) |
| 88 | + debugImplementation(libs.androidx.ui.test.manifest) |
| 89 | +} |
0 commit comments