@@ -103,6 +103,12 @@ android {
103103 cmake { targets(" LiteCoreJNI" ) }
104104 }
105105
106+ // Restrict the native build to specific ABIs, e.g. -PnativeAbis=arm64-v8a
107+ // Defaults to all ABIs (no filter) so CI builds are unchanged.
108+ (project.findProperty(" nativeAbis" ) as String? )
109+ ?.split(" ," )?.map { it.trim() }?.filter { it.isNotEmpty() }
110+ ?.let { ndk { abiFilters.addAll(it) } }
111+
106112 buildConfigField(" String" , " VERSION_NAME" , " \" ${buildVersion} \" " )
107113 buildConfigField(" String" , " BUILD_TIME" , " \" ${buildTime} \" " )
108114 buildConfigField(" String" , " BUILD_COMMIT" , " \" ${buildCommit} \" " )
@@ -513,7 +519,19 @@ tasks.register("ciCheck") {
513519 dependsOn(" checkstyle" , " lint" , " pmd" , " spotbugsXml" , " test" )
514520}
515521tasks.register(" ciBuild" ) {
516- dependsOn(" assembleRelease" )
522+ dependsOn(" assembleRelease" , " packageNativeSymbols" )
523+ }
524+
525+ // Archive the unstripped release .so (full symbols, same BuildID as the stripped
526+ // lib in the AAR) so crashes from shipped builds can be symbolicated. Kept out
527+ // of the published AAR on purpose; archive this zip from CI alongside the AAR.
528+ tasks.register<Zip >(" packageNativeSymbols" ) {
529+ dependsOn(" mergeReleaseNativeLibs" )
530+ archiveFileName.set(" $cblArtifactId -$buildVersion -native-symbols.zip" )
531+ destinationDirectory.set(layout.buildDirectory.dir(" outputs/native-symbols" ))
532+ from(layout.buildDirectory.dir(" intermediates/merged_native_libs/release/mergeReleaseNativeLibs/out/lib" )) {
533+ include(" **/*.so" )
534+ }
517535}
518536tasks.register(" ciPublish" ) {
519537 dependsOn(" javadocJar" , " generatePomFileForLibReleasePublication" , " publishLibReleasePublicationToMavenRepository" )
0 commit comments