Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 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 | |
Sergey Vasilinets | 98971a7 | 2018-04-18 10:33:33 -0700 | [diff] [blame] | 17 | import static androidx.build.dependencies.DependenciesKt.* |
| 18 | import androidx.build.LibraryGroups |
| 19 | import androidx.build.LibraryVersions |
Aurimas Liutikas | b63ef63 | 2019-04-01 04:37:49 -0700 | [diff] [blame] | 20 | import androidx.build.AndroidXExtension |
Aurimas Liutikas | 75e93a0 | 2019-05-28 16:31:38 -0700 | [diff] [blame] | 21 | import androidx.build.Publish |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 22 | |
| 23 | plugins { |
Aurimas Liutikas | cdb9f9f | 2019-04-08 12:07:49 +0100 | [diff] [blame] | 24 | id("AndroidXPlugin") |
| 25 | id("com.android.library") |
Ian Lake | ca44a77 | 2018-09-28 14:26:04 -0700 | [diff] [blame] | 26 | id("kotlin-android") |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | dependencies { |
Ian Lake | ae48ec2 | 2019-09-26 15:57:41 -0700 | [diff] [blame] | 30 | api("androidx.annotation:annotation:1.1.0") |
Jake Wharton | 86978a5 | 2019-07-09 17:01:22 -0400 | [diff] [blame] | 31 | implementation("androidx.core:core:1.0.1") |
Ian Lake | ae48ec2 | 2019-09-26 15:57:41 -0700 | [diff] [blame] | 32 | implementation("androidx.collection:collection:1.0.0") |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 33 | |
| 34 | testImplementation(JUNIT) |
| 35 | testImplementation(MOCKITO_CORE) |
Ian Lake | f32b866 | 2018-10-17 22:25:07 -0700 | [diff] [blame] | 36 | testImplementation(TRUTH) |
Ian Lake | ca44a77 | 2018-09-28 14:26:04 -0700 | [diff] [blame] | 37 | testImplementation(KOTLIN_STDLIB) |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 38 | |
Dustin Lam | 3979d96 | 2019-04-08 10:40:19 -0700 | [diff] [blame] | 39 | androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT) |
| 40 | androidTestImplementation(ANDROIDX_TEST_CORE) |
| 41 | androidTestImplementation(ANDROIDX_TEST_RUNNER) |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 42 | androidTestImplementation(ESPRESSO_CORE) |
Ian Lake | f32b866 | 2018-10-17 22:25:07 -0700 | [diff] [blame] | 43 | androidTestImplementation(TRUTH) |
Ian Lake | d915c5e | 2018-06-26 13:04:46 -0700 | [diff] [blame] | 44 | androidTestImplementation(MOCKITO_CORE, libs.exclude_bytebuddy) |
| 45 | androidTestImplementation(DEXMAKER_MOCKITO, libs.exclude_bytebuddy) |
Ian Lake | ca44a77 | 2018-09-28 14:26:04 -0700 | [diff] [blame] | 46 | androidTestImplementation(KOTLIN_STDLIB) |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 47 | } |
| 48 | |
Aurimas Liutikas | 8a1c039 | 2019-12-02 11:31:04 -0800 | [diff] [blame^] | 49 | //used by testImplementation safe-args-generator |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 50 | android.libraryVariants.all { variant -> |
Oussama Ben Abdelbaki | 892e5b0 | 2018-10-23 22:08:30 +0000 | [diff] [blame] | 51 | def name = variant.name |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 52 | def suffix = name.capitalize() |
| 53 | project.tasks.create(name: "jar${suffix}", type: Jar){ |
Oussama Ben Abdelbaki | bb9937c | 2019-02-01 15:26:13 -0500 | [diff] [blame] | 54 | dependsOn variant.javaCompileProvider.get() |
| 55 | from variant.javaCompileProvider.get().destinationDir |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 56 | destinationDir new File(project.buildDir, "libJar") |
| 57 | } |
| 58 | } |
| 59 | |
Aurimas Liutikas | 2ad3161 | 2019-04-01 04:23:03 -0700 | [diff] [blame] | 60 | androidx { |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 61 | name = "Android Navigation Common" |
Aurimas Liutikas | 75e93a0 | 2019-05-28 16:31:38 -0700 | [diff] [blame] | 62 | publish = Publish.SNAPSHOT_AND_RELEASE |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 63 | mavenVersion = LibraryVersions.NAVIGATION |
| 64 | mavenGroup = LibraryGroups.NAVIGATION |
| 65 | inceptionYear = "2017" |
| 66 | description = "Android Navigation-Common" |
Aurimas Liutikas | b63ef63 | 2019-04-01 04:37:49 -0700 | [diff] [blame] | 67 | url = AndroidXExtension.ARCHITECTURE_URL |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 68 | } |