Alexander Dorokhine | 2a84723 | 2020-08-21 13:53:43 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2019 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 | */ |
Aurimas Liutikas | 19c1a1d | 2020-11-13 10:36:08 -0800 | [diff] [blame] | 24 | import androidx.build.BundleInsideHelper |
Omar Ismail | 86e6606 | 2024-05-03 16:10:50 +0100 | [diff] [blame] | 25 | import androidx.build.LibraryType |
Alexander Dorokhine | 2a84723 | 2020-08-21 13:53:43 -0700 | [diff] [blame] | 26 | |
Alexander Dorokhine | 2a84723 | 2020-08-21 13:53:43 -0700 | [diff] [blame] | 27 | plugins { |
Jim Sproch | 9e38b4f | 2021-01-06 14:21:06 -0800 | [diff] [blame] | 28 | id("AndroidXPlugin") |
| 29 | id("com.android.library") |
Alexander Dorokhine | 2a84723 | 2020-08-21 13:53:43 -0700 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | android { |
| 33 | compileOptions { |
| 34 | sourceCompatibility = JavaVersion.VERSION_1_8 |
| 35 | targetCompatibility = JavaVersion.VERSION_1_8 |
| 36 | } |
Omar Ismail | 7244477 | 2024-05-14 14:55:28 +0100 | [diff] [blame] | 37 | buildTypes.configureEach { |
Alexander Dorokhine | 2a84723 | 2020-08-21 13:53:43 -0700 | [diff] [blame] | 38 | // TODO(b/161836669): Minifiation is currently disabled because if it is on, the aar gets |
| 39 | // desugared twice in some workflows, which fails. Decide how to handle this (e.g. |
| 40 | // splitting targets, continuing with the consumerProguardFiles solution here, fixing the |
| 41 | // flows that perform duplicate desugaring, or something else). |
| 42 | minifyEnabled false |
Jim Sproch | 9e38b4f | 2021-01-06 14:21:06 -0800 | [diff] [blame] | 43 | consumerProguardFiles "proguard-rules.pro" |
Alexander Dorokhine | 2a84723 | 2020-08-21 13:53:43 -0700 | [diff] [blame] | 44 | } |
| 45 | // TODO(b/161205849): We've had to move libicing.so compilation into appsearch:appsearch to get |
| 46 | // it included into the exported aar. Find a proper solution for bundling libicing.so into |
| 47 | // appsearch-release.aar and move compilation of libicing.so back into the external/icing tree. |
| 48 | sourceSets { |
Jim Sproch | 9e38b4f | 2021-01-06 14:21:06 -0800 | [diff] [blame] | 49 | androidTest.java.srcDir "../../../../external/icing/java/tests/instrumentation/" |
Alexander Dorokhine | 2a84723 | 2020-08-21 13:53:43 -0700 | [diff] [blame] | 50 | } |
| 51 | defaultConfig { |
| 52 | externalNativeBuild { |
| 53 | cmake { |
Alexander Dorokhine | 2a84723 | 2020-08-21 13:53:43 -0700 | [diff] [blame] | 54 | arguments "-DCMAKE_VERBOSE_MAKEFILE=ON" |
| 55 | targets "icing" |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | externalNativeBuild { |
| 60 | cmake { |
Fred Sladkey | 7c32b45 | 2022-01-20 17:02:09 -0500 | [diff] [blame] | 61 | version libs.versions.cmake.get() |
Jim Sproch | 9e38b4f | 2021-01-06 14:21:06 -0800 | [diff] [blame] | 62 | path "../../../../external/icing/CMakeLists.txt" |
Alexander Dorokhine | 2a84723 | 2020-08-21 13:53:43 -0700 | [diff] [blame] | 63 | } |
| 64 | } |
Aurimas Liutikas | dcfa035 | 2022-03-14 16:05:33 -0700 | [diff] [blame] | 65 | namespace "androidx.appsearch.localstorage" |
Alexander Dorokhine | 2a84723 | 2020-08-21 13:53:43 -0700 | [diff] [blame] | 66 | } |
| 67 | |
Omar Ismail | b79ab5b | 2024-04-18 13:49:31 -0400 | [diff] [blame] | 68 | // Bundles dependency in bundleInside() inside of the libs/ directory of the aar. |
Aurimas Liutikas | 19c1a1d | 2020-11-13 10:36:08 -0800 | [diff] [blame] | 69 | BundleInsideHelper.forInsideAar( |
| 70 | project, |
Omar Ismail | b79ab5b | 2024-04-18 13:49:31 -0400 | [diff] [blame] | 71 | /* relocations = */ null, |
| 72 | /* dropResourcesWithSuffix = */ null |
Aurimas Liutikas | 19c1a1d | 2020-11-13 10:36:08 -0800 | [diff] [blame] | 73 | ) |
Alexander Dorokhine | 2a84723 | 2020-08-21 13:53:43 -0700 | [diff] [blame] | 74 | |
| 75 | dependencies { |
Aurimas Liutikas | 36de1fe | 2023-11-29 15:12:02 -0800 | [diff] [blame] | 76 | api("androidx.annotation:annotation:1.2.0") |
Alexander Dorokhine | 2a84723 | 2020-08-21 13:53:43 -0700 | [diff] [blame] | 77 | |
Omar Ismail | b79ab5b | 2024-04-18 13:49:31 -0400 | [diff] [blame] | 78 | // icing project brings in repackaged protos only (not the runtime lib) |
| 79 | bundleInside(project(":icing")) |
| 80 | |
| 81 | // Repackaged protobufLite brought in by |
| 82 | // project(":appsearch:appsearch-external-protobuf") and used at runtime |
| 83 | implementation(project(":appsearch:appsearch-external-protobuf")) |
Jim Sproch | 9e38b4f | 2021-01-06 14:21:06 -0800 | [diff] [blame] | 84 | implementation(project(":appsearch:appsearch")) |
Alexander Dorokhine | f431798c | 2022-02-04 14:53:49 -0700 | [diff] [blame] | 85 | implementation('androidx.collection:collection:1.2.0') |
Jim Sproch | 9e38b4f | 2021-01-06 14:21:06 -0800 | [diff] [blame] | 86 | implementation("androidx.concurrent:concurrent-futures:1.0.0") |
Aurimas Liutikas | 36de1fe | 2023-11-29 15:12:02 -0800 | [diff] [blame] | 87 | implementation("androidx.core:core:1.6.0") |
Alexander Dorokhine | 2a84723 | 2020-08-21 13:53:43 -0700 | [diff] [blame] | 88 | |
Xiaoyu Jin | 370c3e5 | 2021-08-17 21:14:55 +0800 | [diff] [blame] | 89 | androidTestImplementation project(':appsearch:appsearch-test-util') |
Aurimas Liutikas | 907dc02 | 2021-06-23 09:37:56 -0700 | [diff] [blame] | 90 | androidTestImplementation(libs.testCore) |
| 91 | androidTestImplementation(libs.testRules) |
| 92 | androidTestImplementation(libs.truth) |
| 93 | androidTestImplementation(libs.mockitoAndroid) |
Alexander Dorokhine | 2a84723 | 2020-08-21 13:53:43 -0700 | [diff] [blame] | 94 | //TODO(b/149787478) upgrade and link to Dependencies.kt |
Aurimas Liutikas | b20296a | 2021-12-21 15:56:47 -0800 | [diff] [blame] | 95 | androidTestImplementation(libs.junit) |
Alexander Dorokhine | 2a84723 | 2020-08-21 13:53:43 -0700 | [diff] [blame] | 96 | } |
| 97 | |
| 98 | androidx { |
Jim Sproch | 9e38b4f | 2021-01-06 14:21:06 -0800 | [diff] [blame] | 99 | name = "AppSearch Local Storage" |
Omar Ismail | 86e6606 | 2024-05-03 16:10:50 +0100 | [diff] [blame] | 100 | type = LibraryType.PUBLISHED_LIBRARY |
Jim Sproch | 9e38b4f | 2021-01-06 14:21:06 -0800 | [diff] [blame] | 101 | inceptionYear = "2020" |
Alexander Dorokhine | 2a84723 | 2020-08-21 13:53:43 -0700 | [diff] [blame] | 102 | description = |
Jim Sproch | 9e38b4f | 2021-01-06 14:21:06 -0800 | [diff] [blame] | 103 | "An implementation of AppSearchSession which uses local app storage and a local copy of " + |
| 104 | "the search library" |
Jinseong Jeon | 999075e | 2023-08-22 00:40:11 -0700 | [diff] [blame] | 105 | metalavaK2UastEnabled = true |
Alexander Dorokhine | 2a84723 | 2020-08-21 13:53:43 -0700 | [diff] [blame] | 106 | } |