Yigit Boyar | 9d4af29 | 2020-07-13 17:38:32 -0700 | [diff] [blame] | 1 | /* |
| 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 Boyar | 9d4af29 | 2020-07-13 17:38:32 -0700 | [diff] [blame] | 17 | import androidx.build.LibraryGroups |
Owen Gray | 74cc259 | 2020-09-24 15:05:40 -0400 | [diff] [blame] | 18 | import androidx.build.LibraryType |
Yigit Boyar | ff7bf98f6 | 2020-11-23 14:57:31 -0800 | [diff] [blame] | 19 | import org.jetbrains.kotlin.gradle.tasks.KotlinCompile |
Yigit Boyar | 9d4af29 | 2020-07-13 17:38:32 -0700 | [diff] [blame] | 20 | |
Yigit Boyar | 9d4af29 | 2020-07-13 17:38:32 -0700 | [diff] [blame] | 21 | plugins { |
| 22 | id("AndroidXPlugin") |
| 23 | id("kotlin") |
| 24 | } |
| 25 | |
| 26 | dependencies { |
Aurimas Liutikas | 1a0e7b1 | 2021-05-04 12:55:40 -0700 | [diff] [blame] | 27 | api(libs.kotlinStdlib) |
| 28 | api(libs.javapoet) |
| 29 | api(libs.kotlinPoet) |
Yigit Boyar | 9d4af29 | 2020-07-13 17:38:32 -0700 | [diff] [blame] | 30 | implementation("androidx.annotation:annotation:1.1.0") |
Aurimas Liutikas | 1a0e7b1 | 2021-05-04 12:55:40 -0700 | [diff] [blame] | 31 | implementation(libs.guava) |
| 32 | implementation(libs.autoCommon) |
| 33 | implementation(libs.autoValueAnnotations) |
Yigit Boyar | deeb7a2 | 2020-12-02 21:25:25 -0800 | [diff] [blame] | 34 | |
Aurimas Liutikas | 1a0e7b1 | 2021-05-04 12:55:40 -0700 | [diff] [blame] | 35 | implementation(libs.kotlinMetadataJvm) |
| 36 | implementation(libs.intellijAnnotations) |
Aurimas Liutikas | e1b8458 | 2021-04-23 14:17:30 -0700 | [diff] [blame] | 37 | implementation(libs.kspApi) |
Aurimas Liutikas | 1a0e7b1 | 2021-05-04 12:55:40 -0700 | [diff] [blame] | 38 | implementation(libs.kotlinStdlibJdk8) // KSP defines older version as dependency, force update. |
Yigit Boyar | 9d4af29 | 2020-07-13 17:38:32 -0700 | [diff] [blame] | 39 | |
Aurimas Liutikas | 1a0e7b1 | 2021-05-04 12:55:40 -0700 | [diff] [blame] | 40 | testImplementation(libs.googleCompileTesting) |
| 41 | testImplementation(libs.junit) |
| 42 | testImplementation(libs.jsr250) |
| 43 | testImplementation(libs.kotlinCompileTestingKsp) |
Aurimas Liutikas | e1b8458 | 2021-04-23 14:17:30 -0700 | [diff] [blame] | 44 | testImplementation(libs.ksp) |
Yigit Boyar | 211efd0 | 2020-11-20 11:59:04 -0800 | [diff] [blame] | 45 | testImplementation(project(":room:room-compiler-processing-testing")) |
Yigit Boyar | 9d4af29 | 2020-07-13 17:38:32 -0700 | [diff] [blame] | 46 | } |
| 47 | |
Yigit Boyar | ff7bf98f6 | 2020-11-23 14:57:31 -0800 | [diff] [blame] | 48 | tasks.withType(KotlinCompile).configureEach { |
Yigit Boyar | 9d4af29 | 2020-07-13 17:38:32 -0700 | [diff] [blame] | 49 | kotlinOptions { |
Daniel Santiago Rivera | ceb65a6 | 2021-06-09 10:03:57 -0700 | [diff] [blame] | 50 | 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 Boyar | 9d4af29 | 2020-07-13 17:38:32 -0700 | [diff] [blame] | 56 | } |
| 57 | } |
Yigit Boyar | ff7bf98f6 | 2020-11-23 14:57:31 -0800 | [diff] [blame] | 58 | |
Yigit Boyar | 40b5cb3 | 2021-01-25 22:47:35 -0800 | [diff] [blame] | 59 | tasks.withType(Test).configureEach { |
Yigit Boyar | 54a407a | 2021-06-23 18:59:22 -0700 | [diff] [blame^] | 60 | it.systemProperty("androidx.room.compiler.processing.strict", "true") |
Yigit Boyar | 40b5cb3 | 2021-01-25 22:47:35 -0800 | [diff] [blame] | 61 | } |
| 62 | |
Yigit Boyar | 9d4af29 | 2020-07-13 17:38:32 -0700 | [diff] [blame] | 63 | androidx { |
| 64 | name = "AndroidX Room XProcessor" |
Yigit Boyar | 186c422 | 2021-03-01 16:53:38 -0800 | [diff] [blame] | 65 | type = LibraryType.ANNOTATION_PROCESSOR_UTILS |
Yigit Boyar | 9d4af29 | 2020-07-13 17:38:32 -0700 | [diff] [blame] | 66 | mavenGroup = LibraryGroups.ROOM |
| 67 | inceptionYear = "2020" |
| 68 | description = "Processing Environment Abstraction for AndroidX Room" |
Alex Saveau | b50d500 | 2020-07-14 05:25:54 +0000 | [diff] [blame] | 69 | } |