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