blob: 23026428640c351ac230df930027944430a651ba [file] [log] [blame]
Chris Craik9fd8e6172017-06-23 14:07:04 -07001/*
2 * Copyright (C) 2017 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 */
Aurimas Liutikase4741f3c2017-07-14 17:32:12 -070016
Dustin Lam278920e2019-05-31 17:15:14 -070017
18import androidx.build.AndroidXExtension
Aurimas Liutikas526389b2018-02-27 14:01:24 -080019import androidx.build.LibraryGroups
Aurimas Liutikas75e93a02019-05-28 16:31:38 -070020import androidx.build.Publish
Dustin Lam94731042020-01-06 18:46:51 -080021import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
Aurimas Liutikasbb85fac2017-08-24 13:32:28 -070022
Dustin Lam278920e2019-05-31 17:15:14 -070023import static androidx.build.dependencies.DependenciesKt.*
24
Aurimas Liutikasf8b708a2017-11-02 16:07:13 -070025plugins {
Aurimas Liutikascdb9f9f2019-04-08 12:07:49 +010026 id("AndroidXPlugin")
27 id("com.android.library")
Aurimas Liutikasf8b708a2017-11-02 16:07:13 -070028 id("kotlin-android")
29}
Aurimas Liutikasbb85fac2017-08-24 13:32:28 -070030
Chris Craik9fd8e6172017-06-23 14:07:04 -070031dependencies {
Alan Viverettebdc4c862018-03-08 18:02:39 -050032 api(project(":paging:paging-common"))
Dustin Lam8f042df2019-05-31 17:58:10 -070033 // Ensure that the -ktx dependency graph mirrors the Java dependency graph
34 api(project(":paging:paging-common-ktx"))
Chris Craik968e3832018-10-10 16:25:45 -070035
Dustin Lama92a1602020-01-10 16:42:58 -080036 api(project(":lifecycle:lifecycle-runtime-ktx"))
37 api(project(":lifecycle:lifecycle-livedata-ktx"))
Chris Craikf9449842020-02-24 20:49:48 -080038 api(project(":recyclerview:recyclerview"))
Dustin Lam278920e2019-05-31 17:15:14 -070039 api(KOTLIN_STDLIB)
Dustin Lam6fd483d2019-09-17 10:45:36 -070040 api(KOTLIN_COROUTINES_ANDROID)
Dustin Lama92a1602020-01-10 16:42:58 -080041 implementation(project(":core:core-ktx"))
Chris Craik9fd8e6172017-06-23 14:07:04 -070042
Chris Craikae00d0f2020-03-15 20:10:42 -070043 androidTestImplementation(project(":paging:paging-testutils"))
44 androidTestImplementation(project(":internal-testutils-common"))
45 androidTestImplementation(project(":internal-testutils-ktx"))
Ian Lake335055e2020-02-21 16:00:23 -080046 androidTestImplementation(project(":lifecycle:lifecycle-runtime-testing"))
Dustin Lam8f042df2019-05-31 17:58:10 -070047 androidTestImplementation(ANDROIDX_TEST_CORE)
Dustin Lamdc14fd02019-08-01 19:34:18 -070048 androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT)
Dustin Lam8f042df2019-05-31 17:58:10 -070049 androidTestImplementation(ANDROIDX_TEST_RUNNER)
Chris Craikae00d0f2020-03-15 20:10:42 -070050 androidTestImplementation("androidx.arch.core:core-testing:2.1.0")
Dustin Lam94731042020-01-06 18:46:51 -080051 androidTestImplementation(KOTLIN_TEST)
Dustin Lamdc14fd02019-08-01 19:34:18 -070052 androidTestImplementation(KOTLIN_COROUTINES_TEST)
Aurimas Liutikasf4ec12f2017-11-22 12:55:43 -080053 androidTestImplementation(JUNIT)
54 androidTestImplementation(MOCKITO_CORE, libs.exclude_bytebuddy) // DexMaker has it"s own MockMaker
55 androidTestImplementation(DEXMAKER_MOCKITO, libs.exclude_bytebuddy) // DexMaker has it"s own MockMaker
Chris Craikae00d0f2020-03-15 20:10:42 -070056 androidTestImplementation(MOCKITO_KOTLIN, {
57 exclude group: "org.mockito" // to keep control on the mockito version
58 exclude group: "net.bytebuddy"
59 })
Chris Craik9fd8e6172017-06-23 14:07:04 -070060}
61
Aurimas Liutikas2ad31612019-04-01 04:23:03 -070062androidx {
Chris Craik6dd27832018-01-19 10:49:19 -080063 name = "Android Paging-Runtime"
Aurimas Liutikas75e93a02019-05-28 16:31:38 -070064 publish = Publish.SNAPSHOT_AND_RELEASE
Aurimas Liutikas7f40a7e2017-10-27 17:55:06 -070065 mavenGroup = LibraryGroups.PAGING
Aurimas Liutikasea5ee822017-11-06 12:52:28 -080066 inceptionYear = "2017"
Chris Craik6dd27832018-01-19 10:49:19 -080067 description = "Android Paging-Runtime"
Chris Craikae00d0f2020-03-15 20:10:42 -070068 url = ARCHITECTURE_URL
Dustin Lam94731042020-01-06 18:46:51 -080069}
70
Dustin Lamc351bfc2020-03-11 20:32:42 -070071// Allow usage of Kotlin's @OptIn.
Dustin Lam94731042020-01-06 18:46:51 -080072tasks.withType(KotlinCompile).configureEach {
73 kotlinOptions {
Dustin Lamc351bfc2020-03-11 20:32:42 -070074 freeCompilerArgs += ["-Xopt-in=kotlin.RequiresOptIn"]
Dustin Lam94731042020-01-06 18:46:51 -080075 }
76}