Skip to content
Open
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.DS_Store
.idea/
*.iml
*.iml

# Sentry CLI
android/.sentry/
5 changes: 3 additions & 2 deletions android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ local.properties
keystore.properties
.kotlin/

# Sentry Config File
sentry.properties
# Sentry Config File (typically contains auth tokens)
# Our sentry.properties only has cli.executable path, so we commit it
# sentry.properties
72 changes: 72 additions & 0 deletions android/scripts/download-sentry-cli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash
set -e

VERSION="2.58.0"
REPO="https://github.com/getsentry/sentry-cli"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CLI_DIR="$SCRIPT_DIR/../.sentry"
CLI_PATH="$CLI_DIR/sentry-cli"

# Create directory if it doesn't exist
mkdir -p "$CLI_DIR"

# Detect platform
case "$(uname -s)" in
Darwin*)
PLATFORM="Darwin-universal"
;;
Linux*)
case "$(uname -m)" in
x86_64)
PLATFORM="Linux-x86_64"
;;
aarch64)
PLATFORM="Linux-aarch64"
;;
i686)
PLATFORM="Linux-i686"
;;
*)
echo "Unsupported Linux architecture: $(uname -m)"
exit 1
;;
esac
;;
MINGW*|MSYS*|CYGWIN*)
PLATFORM="Windows-x86_64.exe"
CLI_PATH="$CLI_PATH.exe"
;;
*)
echo "Unsupported operating system: $(uname -s)"
exit 1
;;
esac

# Check if already downloaded
if [ -f "$CLI_PATH" ]; then
CURRENT_VERSION=$("$CLI_PATH" --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 || echo "unknown")
if [ "$CURRENT_VERSION" = "$VERSION" ]; then
echo "sentry-cli $VERSION already downloaded at $CLI_PATH"
exit 0
else
echo "Existing version ($CURRENT_VERSION) differs from target ($VERSION), re-downloading..."
rm -f "$CLI_PATH"
fi
fi

# Download sentry-cli
DOWNLOAD_URL="$REPO/releases/download/$VERSION/sentry-cli-$PLATFORM"
echo "Downloading sentry-cli $VERSION from $DOWNLOAD_URL"
curl -L -o "$CLI_PATH" "$DOWNLOAD_URL"

# Make executable
chmod +x "$CLI_PATH"

# Verify
DOWNLOADED_VERSION=$("$CLI_PATH" --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
if [ "$DOWNLOADED_VERSION" = "$VERSION" ]; then
echo "Successfully downloaded sentry-cli $VERSION to $CLI_PATH"
else
echo "ERROR: Downloaded version ($DOWNLOADED_VERSION) does not match expected version ($VERSION)"
exit 1
fi
1 change: 1 addition & 0 deletions android/sentry.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cli.executable=.sentry/sentry-cli
Loading