[go: nahoru, domu]

blob: 17c09cafc110ed9b1e704cd1682ab80e5dcb11d6 [file] [log] [blame]
Ian Lake7892d6f2018-02-14 12:12:24 -08001/*
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 Liutikas75e93a02019-05-28 16:31:38 -070017import androidx.build.Publish
Oleksandr Karpovich7b8b5432021-12-29 11:49:35 +010018import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
Ian Lake7892d6f2018-02-14 12:12:24 -080019
20plugins {
Aurimas Liutikascdb9f9f2019-04-08 12:07:49 +010021 id("AndroidXPlugin")
22 id("com.android.library")
Ian Lakeca44a772018-09-28 14:26:04 -070023 id("kotlin-android")
Ian Lake7892d6f2018-02-14 12:12:24 -080024}
25
Ian Lake55af5f12021-06-09 16:57:14 -070026android {
27 buildTypes.all {
28 consumerProguardFiles "proguard-rules.pro"
29 }
Aurimas Liutikasdcfa0352022-03-14 16:05:33 -070030 namespace "androidx.navigation.common"
Ian Lake55af5f12021-06-09 16:57:14 -070031}
32
Ian Lake7892d6f2018-02-14 12:12:24 -080033dependencies {
Ian Lakeae48ec22019-09-26 15:57:41 -070034 api("androidx.annotation:annotation:1.1.0")
Jeremy Woodsae97a5a2022-04-21 14:59:56 -070035 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 Woods4224f672021-01-26 16:16:03 -080039 implementation("androidx.core:core-ktx:1.1.0")
40 implementation("androidx.collection:collection-ktx:1.1.0")
Ian Lake7892d6f2018-02-14 12:12:24 -080041
Aurimas Liutikasbc1dbeb2021-05-04 13:36:59 -070042 api(libs.kotlinStdlib)
Ian Laked4f6ac62021-05-06 16:51:03 -070043 testImplementation(project(":navigation:navigation-testing"))
44 testImplementation("androidx.arch.core:core-testing:2.1.0")
Aurimas Liutikasbc1dbeb2021-05-04 13:36:59 -070045 testImplementation(libs.junit)
46 testImplementation(libs.mockitoCore)
47 testImplementation(libs.truth)
48 testImplementation(libs.kotlinStdlib)
Oleksandr Karpovich7b8b5432021-12-29 11:49:35 +010049 testImplementation(libs.kotlinCoroutinesTest)
Ian Lake7892d6f2018-02-14 12:12:24 -080050
Aurimas Liutikasbc1dbeb2021-05-04 13:36:59 -070051 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 McClellanb582fb42022-04-25 13:25:19 -040059
60 lintPublish(project(':navigation:navigation-common-lint'))
Ian Lake7892d6f2018-02-14 12:12:24 -080061}
62
Aurimas Liutikas8a1c0392019-12-02 11:31:04 -080063//used by testImplementation safe-args-generator
Ian Lake7892d6f2018-02-14 12:12:24 -080064android.libraryVariants.all { variant ->
Oussama Ben Abdelbaki892e5b02018-10-23 22:08:30 +000065 def name = variant.name
Ian Lake7892d6f2018-02-14 12:12:24 -080066 def suffix = name.capitalize()
Jeremy Woods47bbee82021-01-20 11:59:41 -080067 project.tasks.register("jar${suffix}", Copy).configure {
Jim Sproch9e38b4f2021-01-06 14:21:06 -080068 dependsOn("assemble$suffix")
Jeremy Woods47bbee82021-01-20 11:59:41 -080069 from(zipTree("${project.buildDir}/outputs/aar/navigation-common-${name}.aar")) {
Jim Sproch9e38b4f2021-01-06 14:21:06 -080070 include("classes.jar")
Jeremy Woods47bbee82021-01-20 11:59:41 -080071 }
Jim Sproch9e38b4f2021-01-06 14:21:06 -080072 destinationDir(new File(project.buildDir, "libJar"))
Ian Lake7892d6f2018-02-14 12:12:24 -080073 }
74}
75
Aurimas Liutikas2ad31612019-04-01 04:23:03 -070076androidx {
Ian Lake7892d6f2018-02-14 12:12:24 -080077 name = "Android Navigation Common"
Aurimas Liutikas75e93a02019-05-28 16:31:38 -070078 publish = Publish.SNAPSHOT_AND_RELEASE
Ian Lake7892d6f2018-02-14 12:12:24 -080079 mavenGroup = LibraryGroups.NAVIGATION
80 inceptionYear = "2017"
81 description = "Android Navigation-Common"
Ian Lake7892d6f2018-02-14 12:12:24 -080082}
Oleksandr Karpovich7b8b5432021-12-29 11:49:35 +010083
84tasks.withType(KotlinCompile).configureEach {
85 kotlinOptions {
86 freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
87 }
Julia McClellanb582fb42022-04-25 13:25:19 -040088}