Skip to content

Instantly share code, notes, and snippets.

@abyrd
Created February 24, 2014 22:06
Show Gist options
  • Save abyrd/9198195 to your computer and use it in GitHub Desktop.
Save abyrd/9198195 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# Helps create Gradle dependency lists by processing output of:
# mvn dependency:list -DexcludeTransitive=true | cut -c11- > deps.txt
# Note: Install gradle manually, the package is broken on Ubuntu.
with open("deps.txt") as f:
deps = []
for line in f.readlines() :
fields = [x.strip() for x in line.split(':')]
if len(fields) < 5 : continue
del fields[2] # remove 'jar'
deps.append(fields)
deps.sort(key = lambda x: x[0:2])
for fields in deps :
print fields[3], "'%s'" % (':'.join(fields[:3]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment