blob: 6fa419af33cdf0b0da70c4125a10ee707248fa6a [file] [log] [blame]
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import androidx.build.Publish
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("AndroidXPlugin")
id("com.android.library")
id("kotlin-android")
}
android {
buildTypes.all {
consumerProguardFiles "proguard-rules.pro"
}
namespace "androidx.navigation.common"
}
dependencies {
api("androidx.annotation:annotation:1.1.0")
api("androidx.lifecycle:lifecycle-runtime-ktx:2.5.0-rc01")
api("androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.0-rc01")
api("androidx.savedstate:savedstate-ktx:1.2.0-rc01")
api("androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.0-rc01")
implementation("androidx.core:core-ktx:1.1.0")
implementation("androidx.collection:collection-ktx:1.1.0")
api(libs.kotlinStdlib)
testImplementation(project(":navigation:navigation-testing"))
testImplementation("androidx.arch.core:core-testing:2.1.0")
testImplementation(libs.junit)
testImplementation(libs.mockitoCore)
testImplementation(libs.truth)
testImplementation(libs.kotlinStdlib)
testImplementation(libs.kotlinCoroutinesTest)
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testCore)
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.espressoCore)
androidTestImplementation(libs.truth)
androidTestImplementation(libs.mockitoCore, excludes.bytebuddy)
androidTestImplementation(libs.dexmakerMockito, excludes.bytebuddy)
androidTestImplementation(libs.kotlinStdlib)
}
//used by testImplementation safe-args-generator
android.libraryVariants.all { variant ->
def name = variant.name
def suffix = name.capitalize()
project.tasks.register("jar${suffix}", Copy).configure {
dependsOn("assemble$suffix")
from(zipTree("${project.buildDir}/outputs/aar/navigation-common-${name}.aar")) {
include("classes.jar")
}
destinationDir(new File(project.buildDir, "libJar"))
}
}
androidx {
name = "Android Navigation Common"
publish = Publish.SNAPSHOT_AND_RELEASE
mavenGroup = LibraryGroups.NAVIGATION
inceptionYear = "2017"
description = "Android Navigation-Common"
}
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
}
}