-
Notifications
You must be signed in to change notification settings - Fork 985
Update APK versions #2505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update APK versions #2505
Conversation
WalkthroughBumps Android app version metadata across multiple modules to versionCode 20250817 and versionName 1.12.9. Updates new-release.sh to include old/new versionCode variables and to propagate versionName/versionCode and dependency tag updates across the repo. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant Script as new-release.sh
participant Repo as Repo Files
Dev->>Script: Run release script with new version
Script->>Repo: Update versionName (1.12.9) across Gradle files
Script->>Repo: Update versionCode (20250817) across Gradle files
Script->>Repo: Update sherpa-onnx dependency tags
Script->>Repo: Propagate changes to related files (iOS, Flutter, etc.)
Script->>Repo: Remove *.bak backups
Repo-->>Dev: Updated versioned files
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates version information across all Android applications in the sherpa-onnx project to version 1.12.9 with version code 20250817. The changes automate version updates through a release script and apply consistent versioning across all Android app modules.
- Updates the release script to include Android APK version management
- Bumps all Android apps from version "1.0" (code 1) to version "1.12.9" (code 20250817)
- Adds automated find/replace commands for both Gradle and Gradle KTS build files
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| new-release.sh | Adds version code variables and automated find/replace commands for Android build files |
| android/*/app/build.gradle | Updates versionCode and versionName in Gradle build files |
| android/*/app/build.gradle.kts | Updates versionCode and versionName in Kotlin DSL build files |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (9)
android/SherpaOnnxSpeakerIdentification/app/build.gradle.kts (1)
14-15: Optional: Centralize versionCode/versionName to avoid drift.Consider defining versionName/versionCode once (e.g., via gradle.properties or a shared convention plugin) and referencing them here to reduce repo-wide search/replace churn in future releases.
android/SherpaOnnxTts/app/build.gradle (1)
14-15: Optional: Keep versioning DRY across modules.If feasible, move these values to a shared source (gradle.properties or a version catalog/convention plugin) to minimize future changes.
android/SherpaOnnxWebSocket/app/build.gradle (1)
14-15: Optional: Centralize app version values.Centralizing versionName/versionCode helps avoid mismatches across modules during releases.
android/SherpaOnnxJavaDemo/app/build.gradle (1)
12-13: Optional: Reference a shared version source.To reduce maintenance, consider pulling versionCode/versionName from gradle.properties or a convention plugin.
android/SherpaOnnxVadAsr/app/build.gradle (1)
14-15: Optional: De-duplicate version metadata.Centralize version values to minimize release friction.
android/SherpaOnnx/app/build.gradle (1)
14-15: Approve version bump; consider aligning SDK levelsVersionCode (20250817) and versionName ("1.12.9") are correctly updated. This module’s
compileSdk 32/targetSdk 32now lags behind most apps, which are on 34. To avoid API mismatch and keep modules consistent, consider updating in android/SherpaOnnx/app/build.gradle:- compileSdk 32 + compileSdk 34 // … - targetSdk 32 + targetSdk 34Feel free to address this in a follow-up if it’s out of scope for this PR.
android/SherpaOnnx2Pass/app/build.gradle (1)
14-15: LGTM on metadata bump; optional follow-up to update SDK levels.versionCode/versionName are correctly set. This module also targets/compiles 32; if consistent with the app matrix that’s fine, but consider updating to 34 to match other modules when convenient.
new-release.sh (2)
5-7: Failure auto-detecting old_version_code—please adjust the grep path/patternI ran the proposed verification script and saw that no
versionCodewas found underandroid/, soold_version_codeis always empty. It looks like your Gradle files live inandroid/app; you’ll need to point the extraction at the correct file and use a more precise pattern.Suggested update in new-release.sh (lines 5–7):
- old_version_code="$(grep -Rho 'versionCode[[:space:]]*=?[[:space:]]*[0-9]\+' android | awk '{print $NF}' | sort -nr | head -n1)" + # Extract the highest versionCode from the Android app’s Gradle file + old_version_code="$(grep -RPo '(?<=versionCode\s)\d+' android/app/build.gradle | sort -nr | head -n1 || true)"You can keep the rest of the safety checks as-is.
16-21: Make sed patterns resilient to whitespace/quote variations (optional)We ran a scan and confirmed there are no remaining hard-coded
versionName/versionCodeinstances or stalesherpa-onnxtags in your Gradle files. To future-proof against formatting drift (extra spaces, single vs. double quotes, etc.), you can opt-in to the following more tolerant regex:-find android -name "build.gradle" -type f -exec sed -i.bak "s/versionName \"$old_version\"/versionName \"$new_version\"/g" {} \; -find android -name "build.gradle.kts" -type f -exec sed -i.bak "s/versionName = \"$old_version\"/versionName = \"$new_version\"/g" {} \; +find android -name "build.gradle" -type f -exec sed -E -i.bak "s/versionName[[:space:]]+['\"]$old_version['\"]/versionName \"$new_version\"/g" {} \; +find android -name "build.gradle.kts" -type f -exec sed -E -i.bak "s/versionName[[:space:]]*=[[:space:]]*\"$old_version\"/versionName = \"$new_version\"/g" {} \; -find android -name "build.gradle" -type f -exec sed -i.bak "s/versionCode $old_version_code/versionCode $new_version_code/g" {} \; -find android -name "build.gradle.kts" -type f -exec sed -i.bak "s/versionCode = $old_version_code/versionCode = $new_version_code/g" {} \; +find android -name "build.gradle" -type f -exec sed -E -i.bak "s/versionCode[[:space:]]+$old_version_code/versionCode $new_version_code/g" {} \; +find android -name "build.gradle.kts" -type f -exec sed -E -i.bak "s/versionCode[[:space:]]*=[[:space:]]*$old_version_code/versionCode = $new_version_code/g" {} \;This is purely an optional refactor to reduce future maintenance if formatting changes.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (17)
android/SherpaOnnx/app/build.gradle(1 hunks)android/SherpaOnnx2Pass/app/build.gradle(1 hunks)android/SherpaOnnxAudioTagging/app/build.gradle.kts(1 hunks)android/SherpaOnnxAudioTaggingWearOs/app/build.gradle.kts(1 hunks)android/SherpaOnnxJavaDemo/app/build.gradle(1 hunks)android/SherpaOnnxKws/app/build.gradle(1 hunks)android/SherpaOnnxSimulateStreamingAsr/app/build.gradle.kts(1 hunks)android/SherpaOnnxSimulateStreamingAsrWearOs/app/build.gradle.kts(1 hunks)android/SherpaOnnxSpeakerDiarization/app/build.gradle.kts(1 hunks)android/SherpaOnnxSpeakerIdentification/app/build.gradle.kts(1 hunks)android/SherpaOnnxSpokenLanguageIdentification/app/build.gradle.kts(1 hunks)android/SherpaOnnxTts/app/build.gradle(1 hunks)android/SherpaOnnxTtsEngine/app/build.gradle.kts(1 hunks)android/SherpaOnnxVad/app/build.gradle(1 hunks)android/SherpaOnnxVadAsr/app/build.gradle(1 hunks)android/SherpaOnnxWebSocket/app/build.gradle(1 hunks)new-release.sh(2 hunks)
🔇 Additional comments (14)
android/SherpaOnnxSpeakerIdentification/app/build.gradle.kts (1)
14-15: LGTM: Version bump to code 20250817 and name 1.12.9 is correct.Values look consistent and within the 32-bit int range for versionCode. No other concerns in this block.
android/SherpaOnnxTts/app/build.gradle (1)
14-15: LGTM: Version metadata updated as intended.versionCode 20250817 and versionName 1.12.9 align with the release.
android/SherpaOnnxWebSocket/app/build.gradle (1)
14-15: LGTM: Correct version bump applied.Matches the repo-wide target versions. No issues spotted.
android/SherpaOnnxJavaDemo/app/build.gradle (1)
12-13: LGTM: Version update is consistent.Also noting dependency line already references sherpa-onnx v1.12.9, which is consistent with the app version.
android/SherpaOnnxVadAsr/app/build.gradle (1)
14-15: LGTM: Version bump matches the release target.No additional concerns in this block.
android/SherpaOnnxTtsEngine/app/build.gradle.kts (1)
14-15: LGTM: versionCode/versionName updated consistently.No functional changes; values match the repo-wide release. No further action needed here.
android/SherpaOnnxSimulateStreamingAsr/app/build.gradle.kts (1)
14-15: LGTM: metadata bump is correct and consistent with other modules.Nothing else to flag.
android/SherpaOnnxAudioTagging/app/build.gradle.kts (1)
14-15: LGTM: version updates are correct.Matches the target 20250817 / 1.12.9 values used across the repo.
android/SherpaOnnxSpeakerDiarization/app/build.gradle.kts (1)
14-15: Approve: Version bump is consistent across the repoAll
versionCodeandversionNameentries in Android build files match20250817/"1.12.9", and there are no stalesherpa-onnx:vtags. Ready to merge.android/SherpaOnnxAudioTaggingWearOs/app/build.gradle.kts (1)
14-15: LGTM: Version bump confirmed across all modulesI ran a consistency check across all Gradle Kotlin DSL files for
versionCode = 20250817andversionName = "1.12.9". Every module—includingandroid/SherpaOnnxAudioTaggingWearOs/app/build.gradle.kts—matches this release cadence with no outliers detected.android/SherpaOnnxKws/app/build.gradle (1)
14-15: LGTM: Correct metadata update.No behavioral changes; version bump aligns with the release.
If this appId has been published before, ensure 20250817 > last Play Console versionCode for "com.k2fsa.sherpa.onnx" to maintain monotonicity. The provided repo-wide verification script will check local consistency; Play monotonicity must be checked in your release pipeline.
android/SherpaOnnxVad/app/build.gradle (1)
14-15: LGTM: Version bump applied as intended.Consistent with other Android modules in this release.
Reminder: verify Play Console monotonicity for this applicationId as part of the release checklist.
android/SherpaOnnxSpokenLanguageIdentification/app/build.gradle.kts (1)
14-15: LGTM: Version fields updated to 20250817 / 1.12.9.Change is metadata-only and safe.
Run the repo-wide verification script from the first comment to ensure no stragglers remain for versionCode/versionName or sherpa-onnx tag references.
android/SherpaOnnxSimulateStreamingAsrWearOs/app/build.gradle.kts (1)
14-15: Version bump approved and consistent
Confirmed thatversionCode = 20250817andversionName = "1.12.9"in
• android/SherpaOnnxSimulateStreamingAsrWearOs/app/build.gradle.kts (lines 14–15)
and no stale references to the previous versions remain across the codebase.
| versionCode = 20250817 | ||
| versionName = "1.12.9" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Quick repo-wide verification script for version sync.
If helpful, run this to confirm all Android modules are on versionCode 20250817 and versionName 1.12.9, and that dependencies point to v1.12.9.
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Scanning Gradle files under android/…"
mapfile -t FILES < <(fd -a -g 'build.gradle*' android)
echo "Checking versionCode=20250817 and versionName=1.12.9"
missing_code=()
missing_name=()
for f in "${FILES[@]}"; do
rg -nP 'versionCode\s*(=)?\s*20250817\b' "$f" >/dev/null || missing_code+=("$f")
rg -nP 'versionName\s*(=)?\s*"1\.12\.9"' "$f" >/dev/null || missing_name+=("$f")
done
if (( ${#missing_code[@]} )); then
echo "Files missing versionCode 20250817:"
printf ' - %s\n' "${missing_code[@]}"
else
echo "All checked Gradle files contain versionCode 20250817 (or are not app modules)."
fi
if (( ${#missing_name[@]} )); then
echo "Files missing versionName 1.12.9:"
printf ' - %s\n' "${missing_name[@]}"
else
echo "All checked Gradle files contain versionName 1.12.9 (or are not app modules)."
fi
echo "Scanning for sherpa-onnx dependency versions:"
rg -nP "sherpa-onnx:v(\d+\.\d+\.\d+)" -C0
echo "Any non-1.12.9 versions above should be reviewed."Length of output: 268
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "Finding build.gradle and build.gradle.kts files under android/…"
find android -type f \( -name 'build.gradle' -o -name 'build.gradle.kts' \) | while IFS= read -r f; do
echo "Checking file: $f"
if grep -qP 'versionCode\s*=\s*20250817\b' "$f"; then
echo " versionCode OK"
else
echo " ⚠️ MISSING or mismatched versionCode"
fi
if grep -qP 'versionName\s*=\s*\"1\.12\.9\"' "$f"; then
echo " versionName OK"
else
echo " ⚠️ MISSING or mismatched versionName"
fi
done
echo
echo "Scanning for sherpa-onnx dependency versions:"
grep -R -nP 'sherpa-onnx:.*?(\d+\.\d+\.\d+)' android || trueLength of output: 17238
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "Identifying Android application modules (com.android.application)..."
mapfile -t APP_FILES < <(grep -R -lP 'com\.android\.application' -n android | cut -d: -f1)
if (( ${#APP_FILES[@]} == 0 )); then
echo "⚠️ No application modules found. Please verify plugin usage."
exit 1
fi
echo "Checking versionCode=20250817 and versionName=\"1.12.9\" in these files:"
for f in "${APP_FILES[@]}"; do
echo " - $f"
if grep -qP 'versionCode\s*=\s*20250817\b' "$f"; then
echo " ✔ versionCode"
else
echo " ⚠️ Missing or mismatched versionCode"
fi
if grep -qP 'versionName\s*=\s*\"1\.12\.9\"' "$f"; then
echo " ✔ versionName"
else
echo " ⚠️ Missing or mismatched versionName"
fi
done
echo
echo "Scanning for sherpa-onnx dependency versions not equal to v1.12.9:"
grep -R -nP 'sherpa-onnx:v(?!1\.12\.9)\d+\.\d+\.\d+' android || echo "✔ All sherpa-onnx dependencies are v1.12.9"Length of output: 367
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "Modules applying the Android application plugin (com.android.application):"
rg -nP 'id\s+["'\'']com\.android\.application["'\'']' -t gradle -t kotlin androidLength of output: 1664
Sync versionCode & versionName across all Groovy-DSL app modules
Our checks confirm that every Kotlin-DSL (*.kts) app module already uses
versionCode = 20250817
versionName = "1.12.9"but the following Groovy-DSL app/build.gradle files still need to be updated:
• android/SherpaOnnx/app/build.gradle
• android/SherpaOnnx2Pass/app/build.gradle
• android/SherpaOnnxJavaDemo/app/build.gradle
• android/SherpaOnnxKws/app/build.gradle
• android/SherpaOnnxVad/app/build.gradle
• android/SherpaOnnxVadAsr/app/build.gradle
• android/SherpaOnnxTts/app/build.gradle
• android/SherpaOnnxWebSocket/app/build.gradle
Please add or update in each:
versionCode 20250817
versionName "1.12.9"Dependencies on com.github.k2-fsa:sherpa-onnx:v1.12.9 are already consistent.
🤖 Prompt for AI Agents
In android/SherpaOnnxSpeakerIdentification/app/build.gradle.kts around lines
14-15, ensure the Groovy-DSL app modules listed in the review are updated to
match the Kotlin-DSL values: open each Groovy build file
(android/SherpaOnnx/app/build.gradle, android/SherpaOnnx2Pass/app/build.gradle,
android/SherpaOnnxJavaDemo/app/build.gradle,
android/SherpaOnnxKws/app/build.gradle, android/SherpaOnnxVad/app/build.gradle,
android/SherpaOnnxVadAsr/app/build.gradle,
android/SherpaOnnxTts/app/build.gradle,
android/SherpaOnnxWebSocket/app/build.gradle) and add or update the Android
defaultConfig entries so they contain versionCode 20250817 and versionName
"1.12.9" (place them under defaultConfig if not present, or replace existing
values).
Summary by CodeRabbit