Skip to content

Instantly share code, notes, and snippets.

@esafirm
Last active September 23, 2020 03:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esafirm/8f868a5c0fee220b9a97385da3ce208b to your computer and use it in GitHub Desktop.
Save esafirm/8f868a5c0fee220b9a97385da3ce208b to your computer and use it in GitHub Desktop.
Download AAR and jetify it. Unix only!
#!/usr/bin/env bash
TARGET=temp_target
AAR_URL=$1
TARGET_NAME=$2
ZIP_NAME=jetifier.zip
# Download Jetifier
curl "https://dl.google.com/dl/android/studio/jetifier-zips/1.0.0-beta09/jetifier-standalone.zip" -o $ZIP_NAME
unzip $ZIP_NAME
rm -rf $ZIP_NAME
## Download the AAR
curl $AAR_URL -o $TARGET_NAME
## Jetify
FINAL_NAME="jetified-$TARGET_NAME"
./jetifier-standalone/bin/jetifier-standalone -i $TARGET_NAME -o $FINAL_NAME
## Cleanup
rm -rf jetifier-standalone
rm -rf $TARGET_NAME
echo "Your AAR is ready: $FINAL_NAME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment