xref: /aosp_15_r20/external/accompanist/navigation-animation/build.gradle.kts (revision fa44fe6ae8e729aa3cfe5c03eedbbf98fb44e2c6)
1 /*
2  * Copyright 2023 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  *      https://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 @file:Suppress("UnstableApiUsage")
17 
<lambda>null18 plugins {
19     id(libs.plugins.android.library.get().pluginId)
20     id(libs.plugins.android.kotlin.get().pluginId)
21     id(libs.plugins.jetbrains.dokka.get().pluginId)
22     id(libs.plugins.gradle.metalava.get().pluginId)
23     id(libs.plugins.vanniktech.maven.publish.get().pluginId)
24 }
25 
<lambda>null26 kotlin {
27     explicitApi()
28 }
29 
<lambda>null30 android {
31     namespace = "com.google.accompanist.navigation.animation"
32 
33     compileSdk = 34
34 
35     defaultConfig {
36         minSdk = 21
37         // targetSdkVersion has no effect for libraries. This is only used for the test APK
38         targetSdk = 33
39 
40         testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
41     }
42 
43     compileOptions {
44         sourceCompatibility = JavaVersion.VERSION_1_8
45         targetCompatibility = JavaVersion.VERSION_1_8
46     }
47 
48     buildFeatures {
49         buildConfig = false
50         compose = true
51     }
52 
53     composeOptions {
54         kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
55     }
56 
57     lint {
58         textReport = true
59         textOutput = File("stdout")
60         // We run a full lint analysis as build part in CI, so skip vital checks for assemble tasks
61         checkReleaseBuilds = false
62         disable += setOf("GradleOverrides")
63     }
64 
65     testOptions {
66         unitTests {
67             isIncludeAndroidResources = true
68         }
69         animationsDisabled = true
70     }
71 
72     packaging {
73         // Some of the META-INF files conflict with coroutines-test. Exclude them to enable
74         // our test APK to build (has no effect on our AARs)
75         resources {
76             excludes += listOf("/META-INF/AL2.0", "/META-INF/LGPL2.1")
77         }
78     }
79 }
80 
<lambda>null81 metalava {
82     sourcePaths.setFrom("src/main")
83     filename.set("api/current.api")
84     reportLintsAsErrors.set(true)
85 }
86 
<lambda>null87 dependencies {
88     api(libs.androidx.navigation.compose)
89     implementation(libs.compose.animation.animation)
90     implementation(libs.compose.foundation.foundation)
91     implementation(libs.compose.material.material)
92     implementation(libs.kotlin.coroutines.android)
93 
94     // ======================
95     // Test dependencies
96     // ======================
97 
98     androidTestImplementation(project(":internal-testutils"))
99 
100     androidTestImplementation(libs.junit)
101     androidTestImplementation(libs.truth)
102 
103     androidTestImplementation(libs.compose.ui.test.junit4)
104     androidTestImplementation(libs.compose.ui.test.manifest)
105     androidTestImplementation(libs.compose.foundation.foundation)
106     androidTestImplementation(libs.androidx.test.runner)
107     androidTestImplementation(libs.androidx.test.rules)
108 }
109