fix(android): Separate publishSentry Gradle task to publish symbols

This commit is contained in:
Darcy Wong 2024-09-03 13:34:37 +07:00
parent 72c9754b43
commit d99d4d80ff
5 changed files with 27 additions and 17 deletions

View file

@ -19,7 +19,7 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
CONFIG="release"
BUILD_FLAGS="build -x lint -x test" # Gradle build w/o test
TEST_FLAGS="-x assembleRelease lintRelease testRelease" # Gradle test w/o build
PUBLISH_FLAGS="publishReleaseApk" # Gradle publish
PUBLISH_FLAGS="publishSentry publishReleaseApk" # Gradle publish task
DAEMON_FLAG=
builder_describe "Builds Keyman for Android app." \
@ -28,7 +28,7 @@ builder_describe "Builds Keyman for Android app." \
"configure" \
"build" \
"test Runs lint and unit tests." \
"publish Publishes the APK to the Play Store." \
"publish Publishes symbols to Sentry and the APK to the Play Store." \
"--ci Don't start the Gradle daemon. For CI" \
"--upload-sentry Upload to sentry"
@ -118,7 +118,7 @@ if builder_start_action publish; then
# Copy Release Notes
generateReleaseNotes
# Publish Keyman for Android to Play Store
# Publish symbols and Keyman for Android to Play Store
echo "PUBLISH_FLAGS $PUBLISH_FLAGS"
cd "$KEYMAN_ROOT/android/KMAPro/"
./gradlew $DAEMON_FLAG $PUBLISH_FLAGS

View file

@ -105,12 +105,17 @@ android {
}
// how to configure the sentry android gradle plugin
sentry {
// Disables or enables the automatic configuration of Native symbols
uploadNativeSymbols = true
task publishSentry {
doLast {
println 'Publishing Keyman symbols to Sentry'
sentry {
// Disables or enables the automatic configuration of Native symbols
uploadNativeSymbols = true
// Does or doesn't include the source code of native code for Sentry
includeNativeSources = true
// Does or doesn't include the source code of native code for Sentry
includeNativeSources = true
}
}
}
String env_keys_json_file = System.getenv("keys_json_file")

View file

@ -18,7 +18,7 @@ builder_describe \
configure \
build \
test \
"publish Publishes the APKs to the Play Store." \
"publish Publishes symbols to Sentry and the APKs to the Play Store." \
--ci+ \
--upload-sentry+ \
":engine=KMEA Keyman Engine for Android" \

View file

@ -73,12 +73,17 @@ java {
}
// how to configure the sentry android gradle plugin
sentry {
// Disables or enables the automatic configuration of Native symbols
uploadNativeSymbols = true
task publishSentry {
doLast {
println 'Publishing FirstVoices symbols to Sentry'
sentry {
// Disables or enables the automatic configuration of Native symbols
uploadNativeSymbols = true
// Does or doesn't include the source code of native code for Sentry
includeNativeSources = true
// Does or doesn't include the source code of native code for Sentry
includeNativeSources = true
}
}
}
String env_keys_json_file = System.getenv("oem_firstvoices_keys_json_file")

View file

@ -17,7 +17,7 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
CONFIG="release"
BUILD_FLAGS="build -x lint -x test" # Gradle build w/o test
TEST_FLAGS="-x assembleRelease lintRelease testRelease" # Gradle test w/o build
PUBLISH_FLAGS="publishReleaseApk" # Gradle publish
PUBLISH_FLAGS="publishSentry publishReleaseApk" # Gradle publish task
DAEMON_FLAG=
builder_describe "Builds FirstVoices for Android app." \
@ -26,7 +26,7 @@ builder_describe "Builds FirstVoices for Android app." \
"configure" \
"build" \
"test Runs lint and tests." \
"publish Publishes the APK to the Play Store." \
"publish Publishes symbols to Sentry and the APK to the Play Store." \
"--ci Don't start the Gradle daemon. For CI"
# parse before describe_outputs to check debug flags
@ -89,8 +89,8 @@ if builder_start_action test; then
fi
if builder_start_action publish; then
# Publish symbols and FirstVoices to Play Store
echo "PUBLISH_FLAGS $PUBLISH_FLAGS"
cd "$KEYMAN_ROOT/oem/firstvoices/android/"
./gradlew $DAEMON_FLAG $PUBLISH_FLAGS