Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/sdk-versions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# SDK Versions

This document shows which version of the various Sentry SDKs are used in which Sentry Flutter SDK version.

## Version Table

| Sentry Flutter SDK | Sentry Android SDK | Sentry Cocoa SDK | Sentry JavaScript SDK | Sentry Native SDK |
| ------------------ | ------------------ | ---------------- | --------------------- | ----------------- |
| 9.6.0 | 8.17.0 | 8.52.1 | 9.40.0 | 0.9.1 |
| 9.5.0 | 8.13.2 | 8.52.1 | 9.40.0 | 0.9.1 |
| 9.4.1 | 8.13.2 | 8.52.1 | 9.5.0 | 0.9.0 |
| 9.4.0 | 8.13.2 | 8.52.1 | 9.5.0 | 0.9.0 |
| 9.3.0 | 8.12.0 | 8.52.1 | 9.5.0 | 0.9.0 |
| 9.2.0 | 8.12.0 | 8.52.1 | 9.5.0 | 0.9.0 |
| 9.1.0 | 8.12.0 | 8.52.1 | 9.5.0 | 0.9.0 |
| 9.0.0 | 8.12.0 | 8.51.0 | 9.5.0 | 0.8.4 |
3 changes: 3 additions & 0 deletions scripts/bump-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ done
perl -pi -e "s/sdkVersion = '.*'/sdkVersion = '$NEW_VERSION'/" packages/*/lib/src/version.dart
# Bump version in flutter example
perl -pi -e "s/^version: .*/version: $NEW_VERSION/" packages/flutter/example/pubspec.yaml

# Update SDK versions table mapping for this Flutter release
"${SCRIPT_DIR}/update-sdk-versions-table.sh" "$NEW_VERSION"
102 changes: 102 additions & 0 deletions scripts/update-sdk-versions-table.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#!/usr/bin/env bash

set -euo pipefail

detect_repo_root() {
local git_root
if command -v git >/dev/null 2>&1; then
if git_root=$(git rev-parse --show-toplevel 2>/dev/null); then
echo "${git_root}"
return 0
fi
fi

# Fallback to script directory's parent (repo layout assumption)
local script_dir
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo "$(cd "${script_dir}/.." && pwd)"
}

REPO_ROOT="$(detect_repo_root)"

DOC="${REPO_ROOT}/docs/sdk-versions.md"

print_usage() {
cat <<'USAGE'
Usage: scripts/update-sdk-versions-table.sh <flutter_version>

Arguments:
<flutter_version> Required. The Sentry Flutter SDK version (e.g., 9.9.9 or 9.5.0-beta.1).
USAGE
}

# Parse flags (support -h/--help only for now)
for arg in "$@"; do
case "$arg" in
-h|--help)
print_usage
exit 0
;;
esac
done

# Positional argument: Flutter version (required)
FLUTTER_VERSION=${1:-}
if [[ -z "${FLUTTER_VERSION}" ]]; then
echo "Error: Missing required <flutter_version> argument." >&2
echo >&2
print_usage >&2
exit 2
fi

ANDROID_VERSION="$(${REPO_ROOT}/packages/flutter/scripts/update-android.sh get-version)"
COCOA_VERSION="$(${REPO_ROOT}/packages/flutter/scripts/update-cocoa.sh get-version)"
JS_VERSION="$(${REPO_ROOT}/packages/flutter/scripts/update-js.sh get-version)"
NATIVE_VERSION="$(${REPO_ROOT}/packages/flutter/scripts/update-native.sh get-version)"

ROW="| ${FLUTTER_VERSION} | ${ANDROID_VERSION} | ${COCOA_VERSION} | ${JS_VERSION} | ${NATIVE_VERSION} |"

# Bootstrap docs file if missing
if [[ ! -f "${DOC}" ]]; then
{
echo '# SDK Versions'
echo
echo 'This document shows which version of the various Sentry SDKs are used in which Sentry Flutter SDK version.'
echo
echo '## Version Table'
echo
echo '| Sentry Flutter SDK | Sentry Android SDK | Sentry Cocoa SDK | Sentry JavaScript SDK | Sentry Native SDK |'
echo '| ------------------ | ------------------ | ---------------- | --------------------- | ----------------- |'
echo "${ROW}"
} > "${DOC}"
exit 0
fi

# Always insert the new row directly below the table separator of the first table
awk -v row="$ROW" '
BEGIN { in_table=0; inserted=0 }
{
print $0
if (!in_table && $0 ~ /^\| Sentry Flutter SDK \|/) {
in_table=1
next
}
if (in_table && !inserted && $0 ~ /^\| *-+ *\|/) {
print row
inserted=1
in_table=0
}
}
END {
if (!inserted) {
# If no header/separator found, append at end for robustness
print row
}
}
' "$DOC" >"$DOC.tmp"

mv "$DOC.tmp" "$DOC"

exit 0