blob: f1c428659b1f1190586b4a31da01f87b234c0555 [file] [log] [blame]
Yigit Boyar9d4af292020-07-13 17:38:32 -07001/*
2 * Copyright (C) 2020 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
Yigit Boyar9d4af292020-07-13 17:38:32 -070017import androidx.build.LibraryGroups
Owen Gray74cc2592020-09-24 15:05:40 -040018import androidx.build.LibraryType
Yigit Boyarff7bf98f62020-11-23 14:57:31 -080019import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
Yigit Boyar9d4af292020-07-13 17:38:32 -070020
Yigit Boyar9d4af292020-07-13 17:38:32 -070021plugins {
22 id("AndroidXPlugin")
23 id("kotlin")
24}
25
26dependencies {
Aurimas Liutikas1a0e7b12021-05-04 12:55:40 -070027 api(libs.kotlinStdlib)
28 api(libs.javapoet)
29 api(libs.kotlinPoet)
Yigit Boyar9d4af292020-07-13 17:38:32 -070030 implementation("androidx.annotation:annotation:1.1.0")
Aurimas Liutikas1a0e7b12021-05-04 12:55:40 -070031 implementation(libs.guava)
32 implementation(libs.autoCommon)
33 implementation(libs.autoValueAnnotations)
Yigit Boyardeeb7a22020-12-02 21:25:25 -080034
Aurimas Liutikas1a0e7b12021-05-04 12:55:40 -070035 implementation(libs.kotlinMetadataJvm)
36 implementation(libs.intellijAnnotations)
Aurimas Liutikase1b84582021-04-23 14:17:30 -070037 implementation(libs.kspApi)
Aurimas Liutikas1a0e7b12021-05-04 12:55:40 -070038 implementation(libs.kotlinStdlibJdk8) // KSP defines older version as dependency, force update.
Yigit Boyar9d4af292020-07-13 17:38:32 -070039
Aurimas Liutikas1a0e7b12021-05-04 12:55:40 -070040 testImplementation(libs.googleCompileTesting)
41 testImplementation(libs.junit)
42 testImplementation(libs.jsr250)
43 testImplementation(libs.kotlinCompileTestingKsp)
Aurimas Liutikase1b84582021-04-23 14:17:30 -070044 testImplementation(libs.ksp)
Yigit Boyar211efd02020-11-20 11:59:04 -080045 testImplementation(project(":room:room-compiler-processing-testing"))
Yigit Boyar9d4af292020-07-13 17:38:32 -070046}
47
Yigit Boyarff7bf98f62020-11-23 14:57:31 -080048tasks.withType(KotlinCompile).configureEach {
Yigit Boyar9d4af292020-07-13 17:38:32 -070049 kotlinOptions {
Daniel Santiago Riveraceb65a62021-06-09 10:03:57 -070050 freeCompilerArgs += [
51 "-Xjvm-default=all",
52 "-Xopt-in=kotlin.RequiresOptIn",
53 "-Xopt-in=kotlin.contracts.ExperimentalContracts",
54 "-Xopt-in=androidx.room.compiler.processing.ExperimentalProcessingApi"
55 ]
Yigit Boyar9d4af292020-07-13 17:38:32 -070056 }
57}
Yigit Boyarff7bf98f62020-11-23 14:57:31 -080058
Yigit Boyar40b5cb32021-01-25 22:47:35 -080059tasks.withType(Test).configureEach {
Yigit Boyar54a407a2021-06-23 18:59:22 -070060 it.systemProperty("androidx.room.compiler.processing.strict", "true")
Yigit Boyar40b5cb32021-01-25 22:47:35 -080061}
62
Yigit Boyar9d4af292020-07-13 17:38:32 -070063androidx {
64 name = "AndroidX Room XProcessor"
Yigit Boyar186c4222021-03-01 16:53:38 -080065 type = LibraryType.ANNOTATION_PROCESSOR_UTILS
Yigit Boyar9d4af292020-07-13 17:38:32 -070066 mavenGroup = LibraryGroups.ROOM
67 inceptionYear = "2020"
68 description = "Processing Environment Abstraction for AndroidX Room"
Alex Saveaub50d5002020-07-14 05:25:54 +000069}