Skip to content

Commit

Permalink
Merge pull request #23 from ukanth/automate-apk-build
Browse files Browse the repository at this point in the history
Added script to automate apk build
  • Loading branch information
ukanth authored Nov 7, 2023
2 parents 14dea3b + 25918d5 commit cbc10c4
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
/build
/captures
.externalNativeBuild
/app/output
/app/build/outputs/apk/release
39 changes: 39 additions & 0 deletions app/automate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

# Get the directory of the script
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# echo "The script directory is: $SCRIPT_DIR"

# Define project and output directories using the script's directory
PROJECT_DIR="$(cd "$(dirname "$SCRIPT_DIR")" && pwd)"
OUTPUT_DIR="$SCRIPT_DIR/output/"
# echo "The project directory is : $PROJECT_DIR"

# Create the output directory if it doesn't exist
mkdir -p "$OUTPUT_DIR"

# Navigate to the project directory
cd "$PROJECT_DIR"

# Clean the project
./gradlew clean

# Define the path to your keystore.properties file (update as needed)
KEYSTORE_PROPERTIES_FILE="$PROJECT_DIR/keystore.properties"

# Check if the keystore.properties file exists
if [ -f "$KEYSTORE_PROPERTIES_FILE" ]; then
echo "Using keystore.properties file for signing."
else
echo "Error: keystore.properties file not found. Please create one with the keystore information."
exit 1
fi

# Build the release APK
./gradlew assembleRelease -Pkeystore.properties="$KEYSTORE_PROPERTIES_FILE"

# Copy the APK to the output directory
cp "$PROJECT_DIR/app/build/outputs/apk/release/app-release.apk" "$OUTPUT_DIR"

# Notify completion
echo "APK build complete and copied to $OUTPUT_DIR"

0 comments on commit cbc10c4

Please sign in to comment.