Skip to content

Instantly share code, notes, and snippets.

@4ndrej
Last active October 26, 2016 08:28
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 4ndrej/84367905fec10d2670f94970e6552c58 to your computer and use it in GitHub Desktop.
Save 4ndrej/84367905fec10d2670f94970e6552c58 to your computer and use it in GitHub Desktop.
gradle to maven deps filter
cat build.gradle\
| awk '{$1=$1};1'\
| grep -i "compile "\
| sed -e "s/^compile //Ig" -e "s/^testCompile //Ig"\
| sed -e "s/\/\/.*//g"\
| sed -e "s/files(.*//g"\
| grep -v ^$\
| tr -d "'"\
| sed -e "s/\([-_[:alnum:]\.]*\):\([-_[:alnum:]\.]*\):\([-+_[:alnum:]\.]*\)/<dependency>\n\t<groupId>\1<\/groupId>\n\t<artifactId>\2<\/artifactId>\n\t<version>\3<\/version>\n<\/dependency>/g"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment