leo huang | e9b9585 | 2020-06-03 17:08:55 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2020 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 | |
Aurimas Liutikas | e26aaba | 2021-05-24 16:38:00 -0700 | [diff] [blame] | 17 | |
leo huang | e9b9585 | 2020-06-03 17:08:55 +0800 | [diff] [blame] | 18 | import androidx.build.LibraryGroups |
Aurimas Liutikas | e26aaba | 2021-05-24 16:38:00 -0700 | [diff] [blame] | 19 | import androidx.build.LibraryVersions |
leo huang | e9b9585 | 2020-06-03 17:08:55 +0800 | [diff] [blame] | 20 | import androidx.build.Publish |
| 21 | |
| 22 | plugins { |
| 23 | id("AndroidXPlugin") |
| 24 | id("com.android.library") |
AL Ho | e8c7930 | 2020-11-03 15:35:11 +0800 | [diff] [blame] | 25 | id("kotlin-android") |
leo huang | e9b9585 | 2020-06-03 17:08:55 +0800 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | dependencies { |
leo huang | 39b7314 | 2021-05-18 15:14:24 +0800 | [diff] [blame] | 29 | api("androidx.annotation:annotation:1.2.0") |
leo huang | e9b9585 | 2020-06-03 17:08:55 +0800 | [diff] [blame] | 30 | api(project(":camera:camera-core")) |
AL Ho | e8c7930 | 2020-11-03 15:35:11 +0800 | [diff] [blame] | 31 | implementation("androidx.core:core:1.1.0") |
| 32 | implementation("androidx.concurrent:concurrent-futures:1.0.0") |
Aurimas Liutikas | e26aaba | 2021-05-24 16:38:00 -0700 | [diff] [blame] | 33 | implementation(libs.autoValueAnnotations) |
AL Ho | e8c7930 | 2020-11-03 15:35:11 +0800 | [diff] [blame] | 34 | |
Aurimas Liutikas | e26aaba | 2021-05-24 16:38:00 -0700 | [diff] [blame] | 35 | annotationProcessor(libs.autoValue) |
AL Ho | e8c7930 | 2020-11-03 15:35:11 +0800 | [diff] [blame] | 36 | |
leo huang | 433b9dc | 2021-03-01 14:07:16 +0800 | [diff] [blame] | 37 | // TODO(leohuang): We need this for assertThrows. Point back to the AndroidX shared version if |
| 38 | // it is ever upgraded. |
| 39 | testImplementation("junit:junit:4.13") |
Aurimas Liutikas | e26aaba | 2021-05-24 16:38:00 -0700 | [diff] [blame] | 40 | testImplementation(libs.kotlinStdlib) |
| 41 | testImplementation(libs.testCore) |
| 42 | testImplementation(libs.testRunner) |
| 43 | testImplementation(libs.junit) |
| 44 | testImplementation(libs.truth) |
| 45 | testImplementation(libs.robolectric) |
| 46 | testImplementation(libs.mockitoCore) |
Jim Sproch | 9e38b4f | 2021-01-06 14:21:06 -0800 | [diff] [blame] | 47 | testImplementation(project(":camera:camera-testing"), { |
AL Ho | e8c7930 | 2020-11-03 15:35:11 +0800 | [diff] [blame] | 48 | exclude group: "androidx.camera", module: "camera-core" |
Jim Sproch | 9e38b4f | 2021-01-06 14:21:06 -0800 | [diff] [blame] | 49 | }) |
leo huang | 2059c47 | 2020-10-22 22:31:50 +0800 | [diff] [blame] | 50 | |
Jim Sproch | 9e38b4f | 2021-01-06 14:21:06 -0800 | [diff] [blame] | 51 | androidTestImplementation(project(path: ":camera:camera-camera2")) |
Aurimas Liutikas | e26aaba | 2021-05-24 16:38:00 -0700 | [diff] [blame] | 52 | androidTestImplementation(libs.testExtJunit) |
| 53 | androidTestImplementation(libs.testCore) |
| 54 | androidTestImplementation(libs.testRunner) |
| 55 | androidTestImplementation(libs.testRules) |
| 56 | androidTestImplementation(libs.truth) |
| 57 | androidTestImplementation(libs.mockitoCore, excludes.bytebuddy) // DexMaker has it's own MockMaker |
| 58 | androidTestImplementation(libs.dexmakerMockito, excludes.bytebuddy) // DexMaker has it's own MockMaker |
leo huang | 2059c47 | 2020-10-22 22:31:50 +0800 | [diff] [blame] | 59 | androidTestImplementation(project(":camera:camera-testing")) |
Aurimas Liutikas | e26aaba | 2021-05-24 16:38:00 -0700 | [diff] [blame] | 60 | androidTestImplementation(libs.kotlinStdlib) |
| 61 | androidTestImplementation(libs.kotlinCoroutinesAndroid) |
leo huang | 2059c47 | 2020-10-22 22:31:50 +0800 | [diff] [blame] | 62 | androidTestImplementation(project(":concurrent:concurrent-futures-ktx")) |
| 63 | androidTestImplementation(project(":internal-testutils-truth")) |
Aurimas Liutikas | e26aaba | 2021-05-24 16:38:00 -0700 | [diff] [blame] | 64 | androidTestImplementation libs.mockitoKotlin, { |
AL Ho | 2253130 | 2021-01-19 10:22:41 +0800 | [diff] [blame] | 65 | exclude group: 'org.mockito' // to keep control on the mockito version |
| 66 | } |
leo huang | e9b9585 | 2020-06-03 17:08:55 +0800 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | android { |
| 70 | defaultConfig { |
| 71 | minSdkVersion 21 |
| 72 | } |
| 73 | |
| 74 | // Use Robolectric 4.+ |
| 75 | testOptions.unitTests.includeAndroidResources = true |
Steven Schäfer | b752077 | 2021-05-25 17:48:51 +0200 | [diff] [blame^] | 76 | |
| 77 | kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" |
leo huang | e9b9585 | 2020-06-03 17:08:55 +0800 | [diff] [blame] | 78 | } |
| 79 | |
| 80 | androidx { |
| 81 | name = "Jetpack Camera Video Library" |
| 82 | publish = Publish.NONE |
| 83 | mavenVersion = LibraryVersions.CAMERA_VIDEO |
| 84 | mavenGroup = LibraryGroups.CAMERA |
| 85 | inceptionYear = "2020" |
| 86 | description = "Video components for the Jetpack Camera Library, a library providing a " + |
| 87 | "consistent and reliable camera foundation that enables great camera driven " + |
| 88 | "experiences across all of Android." |
| 89 | } |