Created
September 10, 2016 16:05
-
-
Save ktnr74/d402b6a083f63e0bb4398231e3cfd68d to your computer and use it in GitHub Desktop.
Download all available source code jars for com.android.support.appcompat-v7 package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GOOGLE_SOURCE_URL="https://android.googlesource.com" | |
REPO="platform/prebuilts/maven_repo/android" | |
BRANCH="+/master" | |
PACKAGE="com/android/support/appcompat-v7" | |
XPATH="/metadata/versioning/versions/version/text()" | |
GetGoogleSourceFile () { | |
curl -s --compressed -G -d "format=text" --url "$4/$3/$2/$1" | base64 -d | |
} | |
Download () { | |
GetGoogleSourceFile $PACKAGE/$1 $BRANCH $REPO $GOOGLE_SOURCE_URL | |
} | |
for VER in $(Download maven-metadata.xml | xmlstarlet sel -t -v $XPATH); do | |
for JAR in $(Download $VER/ | awk '/-sources\.jar$/{print $4}'); do | |
Download $VER/$JAR >$JAR | |
done | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment