[go: nahoru, domu]

blob: 7c2ab0f750254df3d3eb0768573ee1a29b880608 [file] [log] [blame]
Alexander Dorokhine2a847232020-08-21 13:53:43 -07001/*
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 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 */
Aurimas Liutikas19c1a1d2020-11-13 10:36:08 -080024import androidx.build.BundleInsideHelper
Omar Ismail86e66062024-05-03 16:10:50 +010025import androidx.build.LibraryType
Alexander Dorokhine2a847232020-08-21 13:53:43 -070026
Alexander Dorokhine2a847232020-08-21 13:53:43 -070027plugins {
Jim Sproch9e38b4f2021-01-06 14:21:06 -080028 id("AndroidXPlugin")
29 id("com.android.library")
Alexander Dorokhine2a847232020-08-21 13:53:43 -070030}
31
32android {
33 compileOptions {
34 sourceCompatibility = JavaVersion.VERSION_1_8
35 targetCompatibility = JavaVersion.VERSION_1_8
36 }
Omar Ismail72444772024-05-14 14:55:28 +010037 buildTypes.configureEach {
Alexander Dorokhine2a847232020-08-21 13:53:43 -070038 // 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 Sproch9e38b4f2021-01-06 14:21:06 -080043 consumerProguardFiles "proguard-rules.pro"
Alexander Dorokhine2a847232020-08-21 13:53:43 -070044 }
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 Sproch9e38b4f2021-01-06 14:21:06 -080049 androidTest.java.srcDir "../../../../external/icing/java/tests/instrumentation/"
Alexander Dorokhine2a847232020-08-21 13:53:43 -070050 }
51 defaultConfig {
52 externalNativeBuild {
53 cmake {
Alexander Dorokhine2a847232020-08-21 13:53:43 -070054 arguments "-DCMAKE_VERBOSE_MAKEFILE=ON"
55 targets "icing"
56 }
57 }
58 }
59 externalNativeBuild {
60 cmake {
Fred Sladkey7c32b452022-01-20 17:02:09 -050061 version libs.versions.cmake.get()
Jim Sproch9e38b4f2021-01-06 14:21:06 -080062 path "../../../../external/icing/CMakeLists.txt"
Alexander Dorokhine2a847232020-08-21 13:53:43 -070063 }
64 }
Aurimas Liutikasdcfa0352022-03-14 16:05:33 -070065 namespace "androidx.appsearch.localstorage"
Alexander Dorokhine2a847232020-08-21 13:53:43 -070066}
67
Omar Ismailb79ab5b2024-04-18 13:49:31 -040068// Bundles dependency in bundleInside() inside of the libs/ directory of the aar.
Aurimas Liutikas19c1a1d2020-11-13 10:36:08 -080069BundleInsideHelper.forInsideAar(
70 project,
Omar Ismailb79ab5b2024-04-18 13:49:31 -040071 /* relocations = */ null,
72 /* dropResourcesWithSuffix = */ null
Aurimas Liutikas19c1a1d2020-11-13 10:36:08 -080073)
Alexander Dorokhine2a847232020-08-21 13:53:43 -070074
75dependencies {
Aurimas Liutikas36de1fe2023-11-29 15:12:02 -080076 api("androidx.annotation:annotation:1.2.0")
Alexander Dorokhine2a847232020-08-21 13:53:43 -070077
Omar Ismailb79ab5b2024-04-18 13:49:31 -040078 // 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 Sproch9e38b4f2021-01-06 14:21:06 -080084 implementation(project(":appsearch:appsearch"))
Alexander Dorokhinef431798c2022-02-04 14:53:49 -070085 implementation('androidx.collection:collection:1.2.0')
Jim Sproch9e38b4f2021-01-06 14:21:06 -080086 implementation("androidx.concurrent:concurrent-futures:1.0.0")
Aurimas Liutikas36de1fe2023-11-29 15:12:02 -080087 implementation("androidx.core:core:1.6.0")
Alexander Dorokhine2a847232020-08-21 13:53:43 -070088
Xiaoyu Jin370c3e52021-08-17 21:14:55 +080089 androidTestImplementation project(':appsearch:appsearch-test-util')
Aurimas Liutikas907dc022021-06-23 09:37:56 -070090 androidTestImplementation(libs.testCore)
91 androidTestImplementation(libs.testRules)
92 androidTestImplementation(libs.truth)
93 androidTestImplementation(libs.mockitoAndroid)
Alexander Dorokhine2a847232020-08-21 13:53:43 -070094 //TODO(b/149787478) upgrade and link to Dependencies.kt
Aurimas Liutikasb20296a2021-12-21 15:56:47 -080095 androidTestImplementation(libs.junit)
Alexander Dorokhine2a847232020-08-21 13:53:43 -070096}
97
98androidx {
Jim Sproch9e38b4f2021-01-06 14:21:06 -080099 name = "AppSearch Local Storage"
Omar Ismail86e66062024-05-03 16:10:50 +0100100 type = LibraryType.PUBLISHED_LIBRARY
Jim Sproch9e38b4f2021-01-06 14:21:06 -0800101 inceptionYear = "2020"
Alexander Dorokhine2a847232020-08-21 13:53:43 -0700102 description =
Jim Sproch9e38b4f2021-01-06 14:21:06 -0800103 "An implementation of AppSearchSession which uses local app storage and a local copy of " +
104 "the search library"
Jinseong Jeon999075e2023-08-22 00:40:11 -0700105 metalavaK2UastEnabled = true
Alexander Dorokhine2a847232020-08-21 13:53:43 -0700106}