Skip to content

Commit 6750b5e

Browse files
committed
Add in targets to preserve unstripped libLiteCoreJNI.so
This will allow after the fact symbolification * Warn release only on opened
1 parent 98305bf commit 6750b5e

3 files changed

Lines changed: 27 additions & 2 deletions

File tree

.github/workflows/warn_release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
on:
22
pull_request:
3-
branches: ['**/release/**']
3+
types: [opened]
4+
branches: ["**/release/**"]
45

56
jobs:
67
warn-release:

android/etc/jenkins/publish.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,11 @@ curl --remote-name "${MAVEN_URL}/${LIB_NAME}/${BUILD}/${LIB_NAME}-${BUILD}-javad
4141
curl --remote-name "${MAVEN_URL}/${LIB_NAME}/${BUILD}/${LIB_NAME}-${BUILD}-sources.jar"
4242
popd
4343

44+
# Unstripped native libs (full symbols, same BuildID as the stripped libs in the
45+
# AAR). Not published to Maven; staged here for the Jenkins archive step.
46+
# Feed to addr2line / etc/ensym_linux.pl to symbolicate field crashes.
47+
echo "======== Copy native symbols to staging directory"
48+
cp lib/build/outputs/native-symbols/*.zip "${ARTIFACTS}/" || echo "WARNING: no native symbols to archive"
49+
4450
echo "======== PUBLICATION COMPLETE Couchbase Lite Android, Community Edition"
4551

android/lib/build.gradle.kts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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
}
515521
tasks.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
}
518536
tasks.register("ciPublish") {
519537
dependsOn("javadocJar", "generatePomFileForLibReleasePublication", "publishLibReleasePublicationToMavenRepository")

0 commit comments

Comments
 (0)