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 | |
Aurimas Liutikas | 75e93a0 | 2019-05-28 16:31:38 -0700 | [diff] [blame] | 17 | import androidx.build.Publish |
Oleksandr Karpovich | 7b8b543 | 2021-12-29 11:49:35 +0100 | [diff] [blame] | 18 | import org.jetbrains.kotlin.gradle.tasks.KotlinCompile |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 19 | |
| 20 | plugins { |
Aurimas Liutikas | cdb9f9f | 2019-04-08 12:07:49 +0100 | [diff] [blame] | 21 | id("AndroidXPlugin") |
| 22 | id("com.android.library") |
Ian Lake | ca44a77 | 2018-09-28 14:26:04 -0700 | [diff] [blame] | 23 | id("kotlin-android") |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 24 | } |
| 25 | |
Ian Lake | 55af5f1 | 2021-06-09 16:57:14 -0700 | [diff] [blame] | 26 | android { |
| 27 | buildTypes.all { |
| 28 | consumerProguardFiles "proguard-rules.pro" |
| 29 | } |
Aurimas Liutikas | dcfa035 | 2022-03-14 16:05:33 -0700 | [diff] [blame] | 30 | namespace "androidx.navigation.common" |
Ian Lake | 55af5f1 | 2021-06-09 16:57:14 -0700 | [diff] [blame] | 31 | } |
| 32 | |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 33 | dependencies { |
Ian Lake | ae48ec2 | 2019-09-26 15:57:41 -0700 | [diff] [blame] | 34 | api("androidx.annotation:annotation:1.1.0") |
Jeremy Woods | ae97a5a | 2022-04-21 14:59:56 -0700 | [diff] [blame] | 35 | api("androidx.lifecycle:lifecycle-runtime-ktx:2.5.0-rc01") |
| 36 | api("androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.0-rc01") |
| 37 | api("androidx.savedstate:savedstate-ktx:1.2.0-rc01") |
| 38 | api("androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.0-rc01") |
Jeremy Woods | 4224f67 | 2021-01-26 16:16:03 -0800 | [diff] [blame] | 39 | implementation("androidx.core:core-ktx:1.1.0") |
| 40 | implementation("androidx.collection:collection-ktx:1.1.0") |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 41 | |
Aurimas Liutikas | bc1dbeb | 2021-05-04 13:36:59 -0700 | [diff] [blame] | 42 | api(libs.kotlinStdlib) |
Ian Lake | d4f6ac6 | 2021-05-06 16:51:03 -0700 | [diff] [blame] | 43 | testImplementation(project(":navigation:navigation-testing")) |
| 44 | testImplementation("androidx.arch.core:core-testing:2.1.0") |
Aurimas Liutikas | bc1dbeb | 2021-05-04 13:36:59 -0700 | [diff] [blame] | 45 | testImplementation(libs.junit) |
| 46 | testImplementation(libs.mockitoCore) |
| 47 | testImplementation(libs.truth) |
| 48 | testImplementation(libs.kotlinStdlib) |
Oleksandr Karpovich | 7b8b543 | 2021-12-29 11:49:35 +0100 | [diff] [blame] | 49 | testImplementation(libs.kotlinCoroutinesTest) |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 50 | |
Aurimas Liutikas | bc1dbeb | 2021-05-04 13:36:59 -0700 | [diff] [blame] | 51 | androidTestImplementation(libs.testExtJunit) |
| 52 | androidTestImplementation(libs.testCore) |
| 53 | androidTestImplementation(libs.testRunner) |
| 54 | androidTestImplementation(libs.espressoCore) |
| 55 | androidTestImplementation(libs.truth) |
| 56 | androidTestImplementation(libs.mockitoCore, excludes.bytebuddy) |
| 57 | androidTestImplementation(libs.dexmakerMockito, excludes.bytebuddy) |
| 58 | androidTestImplementation(libs.kotlinStdlib) |
Julia McClellan | b582fb4 | 2022-04-25 13:25:19 -0400 | [diff] [blame^] | 59 | |
| 60 | lintPublish(project(':navigation:navigation-common-lint')) |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 61 | } |
| 62 | |
Aurimas Liutikas | 8a1c039 | 2019-12-02 11:31:04 -0800 | [diff] [blame] | 63 | //used by testImplementation safe-args-generator |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 64 | android.libraryVariants.all { variant -> |
Oussama Ben Abdelbaki | 892e5b0 | 2018-10-23 22:08:30 +0000 | [diff] [blame] | 65 | def name = variant.name |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 66 | def suffix = name.capitalize() |
Jeremy Woods | 47bbee8 | 2021-01-20 11:59:41 -0800 | [diff] [blame] | 67 | project.tasks.register("jar${suffix}", Copy).configure { |
Jim Sproch | 9e38b4f | 2021-01-06 14:21:06 -0800 | [diff] [blame] | 68 | dependsOn("assemble$suffix") |
Jeremy Woods | 47bbee8 | 2021-01-20 11:59:41 -0800 | [diff] [blame] | 69 | from(zipTree("${project.buildDir}/outputs/aar/navigation-common-${name}.aar")) { |
Jim Sproch | 9e38b4f | 2021-01-06 14:21:06 -0800 | [diff] [blame] | 70 | include("classes.jar") |
Jeremy Woods | 47bbee8 | 2021-01-20 11:59:41 -0800 | [diff] [blame] | 71 | } |
Jim Sproch | 9e38b4f | 2021-01-06 14:21:06 -0800 | [diff] [blame] | 72 | destinationDir(new File(project.buildDir, "libJar")) |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 73 | } |
| 74 | } |
| 75 | |
Aurimas Liutikas | 2ad3161 | 2019-04-01 04:23:03 -0700 | [diff] [blame] | 76 | androidx { |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 77 | name = "Android Navigation Common" |
Aurimas Liutikas | 75e93a0 | 2019-05-28 16:31:38 -0700 | [diff] [blame] | 78 | publish = Publish.SNAPSHOT_AND_RELEASE |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 79 | mavenGroup = LibraryGroups.NAVIGATION |
| 80 | inceptionYear = "2017" |
| 81 | description = "Android Navigation-Common" |
Ian Lake | 7892d6f | 2018-02-14 12:12:24 -0800 | [diff] [blame] | 82 | } |
Oleksandr Karpovich | 7b8b543 | 2021-12-29 11:49:35 +0100 | [diff] [blame] | 83 | |
| 84 | tasks.withType(KotlinCompile).configureEach { |
| 85 | kotlinOptions { |
| 86 | freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn" |
| 87 | } |
Julia McClellan | b582fb4 | 2022-04-25 13:25:19 -0400 | [diff] [blame^] | 88 | } |