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 | |
Tiem Song | ee0da74 | 2024-01-03 14:08:46 -0800 | [diff] [blame] | 17 | /** |
| 18 | * This file was created using the `create_project.py` script located in the |
| 19 | * `<AndroidX root>/development/project-creator` directory. |
| 20 | * |
| 21 | * Please use that script when creating a new project, rather than copying an existing project and |
| 22 | * modifying its settings. |
| 23 | */ |
Daniel Santiago Rivera | 326002f | 2024-11-18 09:42:58 -0500 | [diff] [blame] | 24 | |
| 25 | import androidx.build.KotlinTarget |
Owen Gray | 74cc259 | 2020-09-24 15:05:40 -0400 | [diff] [blame] | 26 | import androidx.build.LibraryType |
Yigit Boyar | ff7bf98f6 | 2020-11-23 14:57:31 -0800 | [diff] [blame] | 27 | import org.jetbrains.kotlin.gradle.tasks.KotlinCompile |
Yigit Boyar | 9d4af29 | 2020-07-13 17:38:32 -0700 | [diff] [blame] | 28 | |
Yigit Boyar | 9d4af29 | 2020-07-13 17:38:32 -0700 | [diff] [blame] | 29 | plugins { |
| 30 | id("AndroidXPlugin") |
| 31 | id("kotlin") |
| 32 | } |
| 33 | |
| 34 | dependencies { |
Daniel Santiago Rivera | 436d934 | 2024-01-30 17:15:06 -0500 | [diff] [blame] | 35 | api(libs.kotlinStdlibJdk8) |
Aurimas Liutikas | 1a0e7b1 | 2021-05-04 12:55:40 -0700 | [diff] [blame] | 36 | api(libs.javapoet) |
| 37 | api(libs.kotlinPoet) |
Daniel Santiago Rivera | 1ded726 | 2022-08-10 10:39:24 -0700 | [diff] [blame] | 38 | api(libs.kotlinPoetJavaPoet) |
Aurimas Liutikas | 1a0e7b1 | 2021-05-04 12:55:40 -0700 | [diff] [blame] | 39 | implementation(libs.guava) |
| 40 | implementation(libs.autoCommon) |
| 41 | implementation(libs.autoValueAnnotations) |
Daniel Santiago Rivera | 67365c5 | 2025-01-06 10:36:35 -0500 | [diff] [blame] | 42 | implementation(libs.kotlinMetadataJvm) |
Aurimas Liutikas | e1b8458 | 2021-04-23 14:17:30 -0700 | [diff] [blame] | 43 | implementation(libs.kspApi) |
Yigit Boyar | 9d4af29 | 2020-07-13 17:38:32 -0700 | [diff] [blame] | 44 | |
Aurimas Liutikas | 96f0b30 | 2024-07-25 15:49:23 -0700 | [diff] [blame] | 45 | testImplementation("androidx.annotation:annotation:1.8.1") |
Aurimas Liutikas | 1a0e7b1 | 2021-05-04 12:55:40 -0700 | [diff] [blame] | 46 | testImplementation(libs.googleCompileTesting) |
| 47 | testImplementation(libs.junit) |
| 48 | testImplementation(libs.jsr250) |
Daniel Santiago Rivera | 436d934 | 2024-01-30 17:15:06 -0500 | [diff] [blame] | 49 | testImplementation(libs.kotlinMetadataJvm) // Due to being shadowed in main dependency |
Kuan-Ying Chou | 5d03e1c | 2023-07-18 14:12:42 +0100 | [diff] [blame] | 50 | testImplementation(libs.testParameterInjector) |
Yigit Boyar | 211efd0 | 2020-11-20 11:59:04 -0800 | [diff] [blame] | 51 | testImplementation(project(":room:room-compiler-processing-testing")) |
Kuan-Ying Chou | fa34a94 | 2021-12-20 18:34:56 +0000 | [diff] [blame] | 52 | testImplementation(project(":internal-testutils-common")) |
Arkadii Ivanov | 9aca838 | 2023-07-14 12:21:34 +0100 | [diff] [blame] | 53 | testImplementation(project(":kruth:kruth")) |
Yigit Boyar | 9d4af29 | 2020-07-13 17:38:32 -0700 | [diff] [blame] | 54 | } |
| 55 | |
Yigit Boyar | ff7bf98f6 | 2020-11-23 14:57:31 -0800 | [diff] [blame] | 56 | tasks.withType(KotlinCompile).configureEach { |
Yigit Boyar | 9d4af29 | 2020-07-13 17:38:32 -0700 | [diff] [blame] | 57 | kotlinOptions { |
Daniel Santiago Rivera | ceb65a6 | 2021-06-09 10:03:57 -0700 | [diff] [blame] | 58 | freeCompilerArgs += [ |
Jim Sproch | bcbd33a | 2022-01-12 14:45:37 -0800 | [diff] [blame] | 59 | "-opt-in=kotlin.contracts.ExperimentalContracts", |
Daniel Santiago Rivera | b604ea3 | 2022-08-10 10:06:19 -0700 | [diff] [blame] | 60 | "-opt-in=androidx.room.compiler.processing.ExperimentalProcessingApi", |
| 61 | "-opt-in=com.squareup.kotlinpoet.javapoet.KotlinPoetJavaPoetPreview" |
Daniel Santiago Rivera | ceb65a6 | 2021-06-09 10:03:57 -0700 | [diff] [blame] | 62 | ] |
Yigit Boyar | 9d4af29 | 2020-07-13 17:38:32 -0700 | [diff] [blame] | 63 | } |
| 64 | } |
Yigit Boyar | ff7bf98f6 | 2020-11-23 14:57:31 -0800 | [diff] [blame] | 65 | |
Aurimas Liutikas | 634a5bb | 2023-05-26 13:41:02 -0700 | [diff] [blame] | 66 | tasks.withType(Test).configureEach { test -> |
Aurimas Liutikas | 7795282 | 2024-12-04 18:00:17 -0800 | [diff] [blame] | 67 | test.maxParallelForks = 2 |
Aurimas Liutikas | 634a5bb | 2023-05-26 13:41:02 -0700 | [diff] [blame] | 68 | test.systemProperty("androidx.room.compiler.processing.strict", "true") |
Kuan-Ying Chou | 3785ab16 | 2024-07-25 15:46:16 +0100 | [diff] [blame] | 69 | // With the move to K2 and KSP2 the memory usage has increased so we enlarge the heap |
| 70 | // to prevent OOM while running all the tests in one go. |
Aurimas Liutikas | 7795282 | 2024-12-04 18:00:17 -0800 | [diff] [blame] | 71 | test.maxHeapSize = "8g" |
Yigit Boyar | 40b5cb3 | 2021-01-25 22:47:35 -0800 | [diff] [blame] | 72 | } |
| 73 | |
Yigit Boyar | 9d4af29 | 2020-07-13 17:38:32 -0700 | [diff] [blame] | 74 | androidx { |
Alan Viverette | c9e1fd7 | 2023-05-08 17:36:59 -0400 | [diff] [blame] | 75 | name = "Room XProcessor" |
Yigit Boyar | 186c422 | 2021-03-01 16:53:38 -0800 | [diff] [blame] | 76 | type = LibraryType.ANNOTATION_PROCESSOR_UTILS |
Yigit Boyar | 9d4af29 | 2020-07-13 17:38:32 -0700 | [diff] [blame] | 77 | inceptionYear = "2020" |
| 78 | description = "Processing Environment Abstraction for AndroidX Room" |
Daniel Santiago Rivera | 326002f | 2024-11-18 09:42:58 -0500 | [diff] [blame] | 79 | kotlinTarget = KotlinTarget.KOTLIN_1_9 |
Alex Saveau | b50d500 | 2020-07-14 05:25:54 +0000 | [diff] [blame] | 80 | } |