blob: c7250a8d34e23c75a966ab84cc684a6a7ecd11e7 [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
Tiem Songee0da742024-01-03 14:08:46 -080017/**
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 Rivera326002f2024-11-18 09:42:58 -050024
25import androidx.build.KotlinTarget
Owen Gray74cc2592020-09-24 15:05:40 -040026import androidx.build.LibraryType
Yigit Boyarff7bf98f62020-11-23 14:57:31 -080027import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
Yigit Boyar9d4af292020-07-13 17:38:32 -070028
Yigit Boyar9d4af292020-07-13 17:38:32 -070029plugins {
30 id("AndroidXPlugin")
31 id("kotlin")
32}
33
34dependencies {
Daniel Santiago Rivera436d9342024-01-30 17:15:06 -050035 api(libs.kotlinStdlibJdk8)
Aurimas Liutikas1a0e7b12021-05-04 12:55:40 -070036 api(libs.javapoet)
37 api(libs.kotlinPoet)
Daniel Santiago Rivera1ded7262022-08-10 10:39:24 -070038 api(libs.kotlinPoetJavaPoet)
Aurimas Liutikas1a0e7b12021-05-04 12:55:40 -070039 implementation(libs.guava)
40 implementation(libs.autoCommon)
41 implementation(libs.autoValueAnnotations)
Daniel Santiago Rivera67365c52025-01-06 10:36:35 -050042 implementation(libs.kotlinMetadataJvm)
Aurimas Liutikase1b84582021-04-23 14:17:30 -070043 implementation(libs.kspApi)
Yigit Boyar9d4af292020-07-13 17:38:32 -070044
Aurimas Liutikas96f0b302024-07-25 15:49:23 -070045 testImplementation("androidx.annotation:annotation:1.8.1")
Aurimas Liutikas1a0e7b12021-05-04 12:55:40 -070046 testImplementation(libs.googleCompileTesting)
47 testImplementation(libs.junit)
48 testImplementation(libs.jsr250)
Daniel Santiago Rivera436d9342024-01-30 17:15:06 -050049 testImplementation(libs.kotlinMetadataJvm) // Due to being shadowed in main dependency
Kuan-Ying Chou5d03e1c2023-07-18 14:12:42 +010050 testImplementation(libs.testParameterInjector)
Yigit Boyar211efd02020-11-20 11:59:04 -080051 testImplementation(project(":room:room-compiler-processing-testing"))
Kuan-Ying Choufa34a942021-12-20 18:34:56 +000052 testImplementation(project(":internal-testutils-common"))
Arkadii Ivanov9aca8382023-07-14 12:21:34 +010053 testImplementation(project(":kruth:kruth"))
Yigit Boyar9d4af292020-07-13 17:38:32 -070054}
55
Yigit Boyarff7bf98f62020-11-23 14:57:31 -080056tasks.withType(KotlinCompile).configureEach {
Yigit Boyar9d4af292020-07-13 17:38:32 -070057 kotlinOptions {
Daniel Santiago Riveraceb65a62021-06-09 10:03:57 -070058 freeCompilerArgs += [
Jim Sprochbcbd33a2022-01-12 14:45:37 -080059 "-opt-in=kotlin.contracts.ExperimentalContracts",
Daniel Santiago Riverab604ea32022-08-10 10:06:19 -070060 "-opt-in=androidx.room.compiler.processing.ExperimentalProcessingApi",
61 "-opt-in=com.squareup.kotlinpoet.javapoet.KotlinPoetJavaPoetPreview"
Daniel Santiago Riveraceb65a62021-06-09 10:03:57 -070062 ]
Yigit Boyar9d4af292020-07-13 17:38:32 -070063 }
64}
Yigit Boyarff7bf98f62020-11-23 14:57:31 -080065
Aurimas Liutikas634a5bb2023-05-26 13:41:02 -070066tasks.withType(Test).configureEach { test ->
Aurimas Liutikas77952822024-12-04 18:00:17 -080067 test.maxParallelForks = 2
Aurimas Liutikas634a5bb2023-05-26 13:41:02 -070068 test.systemProperty("androidx.room.compiler.processing.strict", "true")
Kuan-Ying Chou3785ab162024-07-25 15:46:16 +010069 // 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 Liutikas77952822024-12-04 18:00:17 -080071 test.maxHeapSize = "8g"
Yigit Boyar40b5cb32021-01-25 22:47:35 -080072}
73
Yigit Boyar9d4af292020-07-13 17:38:32 -070074androidx {
Alan Viverettec9e1fd72023-05-08 17:36:59 -040075 name = "Room XProcessor"
Yigit Boyar186c4222021-03-01 16:53:38 -080076 type = LibraryType.ANNOTATION_PROCESSOR_UTILS
Yigit Boyar9d4af292020-07-13 17:38:32 -070077 inceptionYear = "2020"
78 description = "Processing Environment Abstraction for AndroidX Room"
Daniel Santiago Rivera326002f2024-11-18 09:42:58 -050079 kotlinTarget = KotlinTarget.KOTLIN_1_9
Alex Saveaub50d5002020-07-14 05:25:54 +000080}