From 431bded8e1a0df936b17526a345d5688efad2009 Mon Sep 17 00:00:00 2001 From: Omar Ismail Date: Thu, 18 Apr 2024 13:44:27 -0400 Subject: Repackage icing lib using AndroidXRepackagePlugin without protobuf runtime BUG: 296864329 TESTED: Ran ./gradlew :appsearch:appsearch-local-storage:cC and it worked. Also published the appsearch-local-storage project, and when viewing the AAR, it contained the bundled icing lib, without the protobuf runtime Change-Id: I59b78db63403ffe960f5df294e8646eae338b112 --- build.gradle | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index d0d1a39..97cc5e1 100644 --- a/build.gradle +++ b/build.gradle @@ -18,10 +18,19 @@ import androidx.build.SdkHelperKt plugins { id("AndroidXPlugin") + id("AndroidXRepackagePlugin") id("java-library") id("com.google.protobuf") } +repackage { + // Must match what is in frameworks/support/appsearch/appsearch-external-protobuf/build.gradle + addRelocation { + sourcePackage = "com.google.protobuf" + targetPackage = "com.google.android.icing.protobuf" + } +} + sourceSets { main { java.srcDir 'java/src/' @@ -32,7 +41,7 @@ sourceSets { dependencies { compileOnly("androidx.annotation:annotation:1.1.0") compileOnly(SdkHelperKt.getSdkDependency(project)) - implementation(libs.protobufLite) + compileOnly(libs.protobufLite) } afterEvaluate { -- cgit v1.2.3 From b1b8c8771490b286182357d1f2f8418a47e3297c Mon Sep 17 00:00:00 2001 From: Prashanth Swaminathan Date: Wed, 24 Apr 2024 20:47:59 +0000 Subject: Set cmake_minimum_required version to 3.22.1 On newer NDKs that make use of features like IN_LIST, older cmake_minimum_required versions used in some of our CMakeLists.txt files can cause build errors. As the cmake version used for building is tied to the version distributed by the NDK toolchain, bump the version across the repository to the version the NDK supports. This will allow us to freely use the features in the cmake binary available in the NDK. Test: ./gradlew assembleRelease Change-Id: I22a9182ccdaf41cb3a657fd47f35d343c41affbb --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 48a63d4..4b7c752 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.10.2) +cmake_minimum_required(VERSION 3.22.1) project(icing) -- cgit v1.2.3