Skip to content

Instantly share code, notes, and snippets.

@maxme
Created November 4, 2015 12:56
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 maxme/43b43da9db0209498521 to your computer and use it in GitHub Desktop.
Save maxme/43b43da9db0209498521 to your computer and use it in GitHub Desktop.
deps="$(find . -iname "build.gradle" | xargs grep 'compile ' | grep -v project | sed -E "s/.*'(.*)'.*/\1/" | sort | uniq)"
function printTemplate() {
cat << EOF
remote_file(
name = '$1-file',
out = '$2',
url = 'mvn:$4:$1:aar:$3',
sha1 = '0ec99fae8716984ec56489fb45d1ae752724bae7',
)
android_prebuilt_aar(
name = '$1',
aar = ':$1-file',
)
EOF
}
echo $depsr
for i in $deps ; do
name=$(echo $i | cut -d ":" -f2)
group=$(echo $i | cut -d ":" -f1)
version=$(echo $i | cut -d ":" -f3)
file="$name.aar"
printTemplate "$name" "$file" "$version" "$group"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment